-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge release/1.0.0-beta.4 into master
- Loading branch information
Showing
35 changed files
with
1,526 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<img src="https://blog.vuestorefront.io/wp-content/uploads/2020/01/1QU9F6hQlFyHsJIbsdmt6FA.png" height="100px" /> | ||
|
||
## Vue Storefront 2 integration with Magento (WIP) | ||
|
||
### @vue-storefront/magento-api | ||
|
||
This is only the **api-client** package, you need to install the other dependencies also. | ||
|
||
------ | ||
This project is a Magento 2 integration for Vue Storefront 2. | ||
This integration is being developed by superheroes from [Cyberfuze](https://cyberfuze.com/), [Ecritel](https://www.ecritel.com/) and [Leonex](https://www.leonex.de/) ❤️ | ||
|
||
## How to start if you want to try out the integration | ||
|
||
``` | ||
yarn global add @vue-storefront/cli | ||
``` | ||
``` | ||
vsf init <project_name> && cd <project_name> && yarn && yarn dev | ||
``` | ||
|
||
## How to start if you want to contribute? | ||
|
||
Want to contribute? Ping us on `magento2-vsf2` channel on [our Discord](https://discord.vuestorefront.io)! | ||
### Requirements: | ||
- NodeJS v12 or later | ||
- Magento v2.4 instance for GraphQL endpoint | ||
### Steps | ||
1. Fork the repo | ||
2. Clone your fork of the repo | ||
``` | ||
example: | ||
git clone https://github.com/vuestorefront/magento2.git | ||
cd magento2 | ||
``` | ||
3. Checkout develop branch `git checkout develop` | ||
4. Run `yarn` to install dependencies | ||
5. Copy .env.example and update GraphQL Endpoint | ||
``` | ||
cp packages/theme/.env.example .env | ||
``` | ||
6. Update `MAGENTO_GRAPHQL=` with url to Magento 2.4 GrapgQL endpoint | ||
``` | ||
MAGENTO_GRAPHQL=https://{YOUR_SITE_FRONT_URL}/graphql | ||
``` | ||
7. Build dependencies `yarn build:api-client && yarn build:composables` | ||
8. Run `yarn dev:theme` to run theme. You can find other commands in `package.json` | ||
- If you need HMR on Api Client/Composables run `yarn dev:api-client` or `yarn dev:composables` on a separate terminal window. | ||
## Resources | ||
- [Vue Storefront Documentation](https://docs.vuestorefront.io/v2/) | ||
- [Magento 2 integration Documentation (WIP)](https://docs.vuestorefront.io/magento) | ||
- [Community Chat](https://discord.vuestorefront.io) | ||
## Support | ||
If you have any questions about this integration we will be happy to answer them on `magento2-vsf2` channel on [our Discord](discord.vuestorefront.io). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { ApolloQueryResult } from 'apollo-client'; | ||
import { CategorySearchQuery, CategorySearchQueryVariables } from '../../types/GraphQL'; | ||
import query from './query.graphql'; | ||
import { Context } from '../../types/context'; | ||
|
||
export default async ( | ||
{ client }: Context, | ||
params: CategorySearchQueryVariables, | ||
): Promise<ApolloQueryResult<CategorySearchQuery>> => client | ||
.query<CategorySearchQuery, CategorySearchQueryVariables>({ | ||
query, | ||
variables: { ...params }, | ||
fetchPolicy: 'cache-first', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#import "../../fragments/categoryDataFragment.graphql" | ||
#import "../../fragments/categoryUrlData.graphql" | ||
|
||
query categorySearch($filters: CategoryFilterInput) { | ||
categoryList(filters: $filters) { | ||
...CategoryData | ||
...CategoryUrlData | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<img src="https://blog.vuestorefront.io/wp-content/uploads/2020/01/1QU9F6hQlFyHsJIbsdmt6FA.png" height="100px" /> | ||
|
||
## Vue Storefront 2 integration with Magento (WIP) | ||
|
||
This project is a Magento 2 integration for Vue Storefront 2. | ||
This integration is being developed by superheroes from [Cyberfuze](https://cyberfuze.com/), [Ecritel](https://www.ecritel.com/) and [Leonex](https://www.leonex.de/) ❤️ | ||
|
||
## How to start if you want to try out the integration | ||
|
||
``` | ||
yarn global add @vue-storefront/cli | ||
``` | ||
``` | ||
vsf init <project_name> && cd <project_name> && yarn && yarn dev | ||
``` | ||
|
||
## How to start if you want to contribute? | ||
|
||
Want to contribute? Ping us on `magento2-vsf2` channel on [our Discord](https://discord.vuestorefront.io)! | ||
### Requirements: | ||
- NodeJS v12 or later | ||
- Magento v2.4 instance for GraphQL endpoint | ||
### Steps | ||
1. Fork the repo | ||
2. Clone your fork of the repo | ||
``` | ||
example: | ||
git clone https://github.com/vuestorefront/magento2.git | ||
cd magento2 | ||
``` | ||
3. Checkout develop branch `git checkout develop` | ||
4. Run `yarn` to install dependencies | ||
5. Copy .env.example and update GraphQL Endpoint | ||
``` | ||
cp packages/theme/.env.example .env | ||
``` | ||
6. Update `MAGENTO_GRAPHQL=` with url to Magento 2.4 GrapgQL endpoint | ||
``` | ||
MAGENTO_GRAPHQL=https://{YOUR_SITE_FRONT_URL}/graphql | ||
``` | ||
7. Build dependencies `yarn build:api-client && yarn build:composables` | ||
8. Run `yarn dev:theme` to run theme. You can find other commands in `package.json` | ||
- If you need HMR on Api Client/Composables run `yarn dev:api-client` or `yarn dev:composables` on a separate terminal window. | ||
## Resources | ||
- [Vue Storefront Documentation](https://docs.vuestorefront.io/v2/) | ||
- [Magento 2 integration Documentation (WIP)](https://docs.vuestorefront.io/magento) | ||
- [Community Chat](https://discord.vuestorefront.io) | ||
## Support | ||
If you have any questions about this integration we will be happy to answer them on `magento2-vsf2` channel on [our Discord](discord.vuestorefront.io). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
packages/composables/src/composables/useCategorySearch/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { | ||
Context, | ||
} from '@vue-storefront/core'; | ||
import { Category } from '@vue-storefront/magento-api'; | ||
import { UseCategorySearchFactory, useCategorySearchFactory } from '../../factories/useCategorySearchFactory'; | ||
|
||
const factoryParams: UseCategorySearchFactory<Category> = { | ||
search: async (context: Context, params): Promise<Category[]> => { | ||
// @ts-ignore | ||
const { data } = await context.$magento.api.categorySearch({ filters: { name: { match: `${params.term}` } } }); | ||
|
||
return data.categoryList; | ||
}, | ||
}; | ||
|
||
export default useCategorySearchFactory<Category>(factoryParams); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.