Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1ea15a3
chore: add gitflow actions (#379)
bloodf Jan 3, 2022
2ea26d4
docs: added roadmap to the docs (#380)
Jan 3, 2022
352b658
fix(theme): refactor and fix store switcher (#383)
bartoszherba Jan 10, 2022
2e2dbce
fix(theme): fix preselection sort order when query param is available…
bartoszherba Jan 10, 2022
e700ed1
fix: broken cart after placing order as guest (#386)
KevinGorjan Jan 10, 2022
d9334a5
fix(theme): fix flashing category page (#387)
bartoszherba Jan 10, 2022
2b00372
fix(theme): fix flashing category page (#388)
bartoszherba Jan 10, 2022
ea9f74b
fix: default billing information does not appear on address (#382)
KevinGorjan Jan 10, 2022
a13b11c
chore: upgraded vsf core to 2.5.4 (#389)
Jan 10, 2022
3d530cb
fix(composables): update url resolver clearing patter to remove local…
bartoszherba Jan 10, 2022
aab749d
fix(theme): fix links to catch current locale (#391)
bartoszherba Jan 11, 2022
165593d
style(theme): aligned titles in my account menu (#400)
KevinGorjan Jan 12, 2022
6d9ce76
feat(middleware): added i18n route middleware (#408)
Jan 13, 2022
b8c233c
fix(theme): update localisation for all :link bindings (#416)
bartoszherba Jan 14, 2022
69c4fe1
docs(theme): update custom queries documentation to be more friendly …
bartoszherba Jan 14, 2022
e89baad
chore(theme): removed html-validator (#414)
Jan 14, 2022
9ab3fe3
refactor: update dependencies (#420)
bloodf Jan 17, 2022
fbb1598
refactor(theme): enables currency switcher on TopBar.vue (#421)
bloodf Jan 17, 2022
8280bba
fix(theme): fix 404 issue when redirecting to address details page (#…
bartoszherba Jan 17, 2022
469cecb
test: scaffold unit tests in composables and api client package (#419)
KevinGorjan Jan 17, 2022
03102de
fix(theme): fix disappearing category sidebar filter change (#423)
bartoszherba Jan 17, 2022
34e2f2f
fix(theme): out of stock product will no longer break cart (#404)
bartoszherba Jan 17, 2022
59be797
Revert "refactor(theme): enables currency switcher on TopBar.vue (#42…
Jan 17, 2022
2344e01
refactor(i18n): changed i18n middleware to plugin and fix store switc…
Jan 17, 2022
f2d6adb
refactor(theme): changed i18n midl. to plugin & fix store switcher by…
bloodf Jan 18, 2022
b194a80
fix(api-client): update default mutation error handling for apollo cl…
bartoszherba Jan 18, 2022
a863b78
fix: expired user token (#392)
KevinGorjan Jan 18, 2022
c614437
refactor(theme): enable the currency switcher on `TopBar.vue` (#430)
bloodf Jan 18, 2022
624bdc7
Fix useFacet(...) customQuery implemention (#413)
Aliaaaam Jan 13, 2022
86c8818
chore: updated version number to rc.5.3, updated yarn.lock, fixed clo…
Jan 18, 2022
7885d94
Merge branch 'main' into release/1.0.0-rc.5.3
Jan 18, 2022
3b091bd
fix(theme): update localisation for all :link bindings (#449)
bartoszherba Jan 19, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/deploy-vue-storefront-cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
branches:
- main
- develop
- release/*

jobs:
build:
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/draft-release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: "Draft new release"

on:
workflow_dispatch:
inputs:
version:
description: 'The version you want to release.'
required: true

jobs:
draft-new-release:
name: "Draft a new release"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Initialize mandatory git config
run: |
git config user.name "GitHub actions"
git config user.email [email protected]
- name: Create release branch
run: git checkout -b release/${{ github.event.inputs.version }}

- name: Bump version in package.json
run: lerna version "${{ github.event.inputs.version }}" --no-git-tag-version --no-changelog --ignore-changes "*/internals/**" -y

- name: Commit changelog and manifest files
id: make-commit
run: |
git add .
git commit --message "chore: release ${{ github.event.inputs.version }}"
echo "::set-output name=commit::$(git rev-parse HEAD)"
- name: Push new branch
run: git push origin release/${{ github.event.inputs.version }}

- name: Create pull request
uses: thomaseizinger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
head: release/${{ github.event.inputs.version }}
base: main
title: "chore: release version ${{ github.event.inputs.version }}"
reviewers: ${{ github.actor }}
body: |
Hey @${{ github.actor }}!
Remeber to update this PR with the correct information, before merging it :)
49 changes: 49 additions & 0 deletions .github/workflows/merge-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "Publish new release"

on:
pull_request:
branches:
- main
types:
- closed

jobs:
release:
name: Publish new release
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- name: Extract version from branch name (for release branches)
if: startsWith(github.event.pull_request.head.ref, 'release/')
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#release/}
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
- name: Extract version from branch name (for hotfix branches)
if: startsWith(github.event.pull_request.head.ref, 'hotfix/')
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#hotfix/}
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
- name: Create Release
uses: thomaseizinger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
target_commitish: ${{ github.event.pull_request.merge_commit_sha }}
tag_name: ${{ env.RELEASE_VERSION }}
name: ${{ env.RELEASE_VERSION }}
draft: false
prerelease: false

- name: Merge main into develop branch
uses: thomaseizinger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
head: main
base: develop
title: Merge main into develop branch
body: |
This PR merges the main branch back into develop.
This happens to ensure that the updates that happend on the release branch, i.e. CHANGELOG and manifest updates are also present on the develop branch.
File renamed without changes.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '16'
node-version: '16.13.0'
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install

- name: Build packages
run: yarn build
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ dist
.yarn/install-state.gz
.pnp.*
.vscode/*
.vscode
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
Expand Down
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
2 changes: 2 additions & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = {
['/guide/environments', 'Environments'],
['/guide/functional-catalog', 'Functional catalog'],
['/guide/about', 'About'],
['/guide/roadmap', 'Roadmap'],
]
},
{
Expand Down Expand Up @@ -105,6 +106,7 @@ module.exports = {
{
title: 'Reference',
children: [
['/plugins/', 'Plugins'],
['/api-reference/', 'API Reference'],
]
},
Expand Down
35 changes: 34 additions & 1 deletion docs/guide/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,42 @@ Then on the `config` folder create a file `dev.json` with your configurations.
{
"magentoGraphQl": "https://{YOUR_SITE_FRONT_URL}/graphql", // Define Magento GraphQL endpoint
"enableMagentoExternalCheckout": false, // Flag if VSF will use External Checkout
"externalCheckoutUrl": "https://{YOUR_SITE_FRONT_URL}", // External checkout URL
"externalCheckoutUrl": "https://{YOUR_SITE_FRONT_URL}", // External checkout URL
"externalCheckoutSyncPath": "/vue/cart/sync", // External Checkout synchronization path
"nuxtAppEnvironment": "development", // Define nuxt application environment
"nuxtAppPort": 3000 // Define nuxt port
}
```

## Multistore and localization

Each Magento Store View need to have corresponding locale configuration object in `i18n.locales` array in `nuxt.config.js`.

### Locale configuration object reference

`code` (required) - unique identifier of the locale - corresponding to Magento store view code
For other properties please follow official [nuxt-i18n docs](https://i18n.nuxtjs.org/options-reference#locales)

### Sample configuration

```json
locales: [
{
code: 'default',
file: 'en.js',
iso: 'en_US',
},
{
code: 'german',
file: 'de.js',
iso: 'de_DE',
},
],
```
So for this configuration you need to have two Magento store views with corresponding store codes: `default` and `german`

## Translations

There are two steps to translate whole storefront:
1. Add translations in Magento for products and categories if necessary
2. Add translations to files in the `lang` directory
90 changes: 59 additions & 31 deletions docs/guide/override-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,79 @@ To override one or multiple queries without creating a custom composable for eac

## Examples

### Overriding query
In this example we will override `products` query by adding `image` field and one `custom_attribute`.

---
Because queries can be long so it will be best to keep all custom queries in a dedicated directory.
Inside the theme's root create `customQueries` directory, then copy `productList.ts` file from api-client lib into the created directory. Now you can easily modify the query inside your custom queries catalog. As we wanted to add `image` and `custom_attribute`file after the modification will look like the following example:
```typescript
import gql from 'graphql-tag';

export default gql`
query productsList($search: String = "", $filter: ProductAttributeFilterInput, $pageSize: Int = 10, $currentPage: Int = 1, $sort: ProductAttributeSortInput) {
products(search: $search, filter: $filter, pageSize: $pageSize, currentPage: $currentPage, sort: $sort) {
aggregations {
attribute_code
label
options {
label
value
count
}
}
items {
...
image {
url
position
disabled
label
}
custom_attribute
...
}
page_info {
current_page
page_size
total_pages
}
total_count
}
}
`;

```

Once you prepared custom query you must register it so the application will know where it is and how to use it. Inside the theme's `middleware.config.js`, under `integrations.magento` add `customQueries` field. Import your custom query and configure it as in the following example:

```js
import customProductsQuery from './customQueries/productList';

const config = require('./config.js');
const cookieNames = require('./enums/cookieNameEnum');
import gql from 'graphql-tag';

module.exports = {
integrations: {
magento: {
customQueries: {
/**********************
** HERE : use the default query key to override it.
***********************/
'products': ({ query, variables, metadata }) => {
query = gql`
...
`;
return { query, variables }
}
},
location: '@vue-storefront/magento-api/server',
configuration: {
api: config.get('magentoGraphQl'),
cookies: {
...cookieNames,
},
defaultStore: 'default',
externalCheckout: {
enable: config.get('enableMagentoExternalCheckout'),
cmsUrl: config.get('externalCheckoutUrl'),
syncUrlPath: config.get('externalCheckoutSyncPath'),
stores: {
default: config.get('enableMagentoExternalCheckout'),
},
},
facets: {
available: ['color', 'size', 'price'],
},
customApolloHttpLinkOptions: {
useGETForQueries: false,
/** ********************
** HERE : use the default query key to override it.
********************** */
products: ({ query, variables }) => {
return { query: customProductsQuery, variables }; // Your custom query
},
},
...
},
},
};


```

**Important**

Keep in mind that only attributes present on `ProductInterface` are accessible via GraphQL without any additional modification on the Magento side. To be able to get any custom attributes you must extend GraphQL schema in the Magento2. Follow [Magento 2 documentation](https://devdocs.magento.com/guides/v2.4/graphql/develop/extend-existing-schema.html) to achieve that.


33 changes: 33 additions & 0 deletions docs/guide/roadmap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Roadmap

The current goal is to release a stable 1.0.0 version by the end of February. Details below.

## January 2022

- finish multi-store functionality
- performance improvements
- analysis
- improve the speed of communication with Magento
- Redis Caching
- CDNs
- Design QA & improvements

## February 2022

- performance improvements
- meet web core vitals or at least 80 score
- Unit & integration tests for crucial functionalities
- quality assurance
- user acceptance tests
- load tests

### Milestone: Release stable 1.0.0 version by the end of February

## March 2022

- Accessibility tests & improvements
- extensibility
- improve docs
- add the possibility to add plugins
- add the possibility to install external extensions
- theming
Binary file added docs/plugins/i18n-plugin-diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions docs/plugins/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Plugins

Here you can find documentation for global Middlewares

## i18n

i18n plugin is responsible for handling store changes after URL changes.

It checks if locale in i18n module is changes and update `vsf-store` and `vsf-locale` cookie to match new store on both
client and server side.

### Flow
1. Start: load middleware
2. Read current Magento Store Code from vsf-store cookie
3. Is store code found?
2. No: Set default locale if isn't already set
1. End
4. Yes: Check if current store code has corresponding locale in Nuxt.config.js
1. No: Set default locale if isn't already set
1. End
5. Yes: If corresponded locale is different than current locale
1. No: End
6. Yes: set new locale
7. Go forward (load the page with correct locale and date)
8. End


![i18n flow](./i18n-plugin-diagram.png)
Loading