Skip to content

Commit

Permalink
Merge pull request #1355 from vuestorefront/release/1.1.0
Browse files Browse the repository at this point in the history
chore: release 1.1.0
  • Loading branch information
bartoszherba authored Oct 19, 2022
2 parents 5acb16a + 4d5394c commit 6b7a593
Show file tree
Hide file tree
Showing 193 changed files with 2,469 additions and 8,025 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
**/lib/*
packages/api-client/src/types/GraphQL.ts
packages/api-client/server
packages/composables
packages/api-client/lib
packages/theme/static/sw.js
.eslintrc.js
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ module.exports = {
project: [
resolve(__dirname, './tsconfig.json'),
resolve(__dirname, './packages/api-client/tsconfig.eslint.json'),
resolve(__dirname, './packages/composables/tsconfig.eslint.json'),
resolve(__dirname, './packages/theme/tsconfig.json'),
resolve(__dirname, './packages/theme/tests/e2e/tsconfig.json'),
resolve(__dirname, './packages/load-tests/tsconfig.json'),
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/deploy-vue-storefront-cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
jobs:
create-deployment:
runs-on: ubuntu-latest

permissions:
deployments: write

outputs:
environment-name: ${{ steps.determine-environment.outputs.name }}
environment-code: ${{ steps.determine-environment.outputs.code }}
Expand Down Expand Up @@ -48,6 +52,7 @@ jobs:
echo ::set-output name=name::${{ env.ENVNAME }}
echo ::set-output name=code::${{ env.ENVCODE }}
echo ::set-output name=middleware-url::${{ env.MIDDLEWARE_URL }}
echo ::set-output name=ssr-middleware-url::${{ env.SSR_MIDDLEWARE_URL }}
- name: Create GitHub deployment
id: deployment
Expand Down Expand Up @@ -88,6 +93,7 @@ jobs:

VSF_STORE_URL: ''
VSF_MIDDLEWARE_URL: ${{ needs.create-deployment.outputs.environment-middleware-url }}
VSF_SSR_MIDDLEWARE_URL: ${{ needs.create-deployment.outputs.environment-ssr-middleware-url }}

VSF_MAGENTO_BASE_URL: https://magento2-instance.vuestorefront.io/
VSF_MAGENTO_GRAPHQL_URL: https://magento2-instance.vuestorefront.io/graphql
Expand All @@ -99,7 +105,7 @@ jobs:
VSF_IMAGE_PROVIDER_BASE_URL: https://res-4.cloudinary.com/dnozky7on/image/upload/
VSF_IMAGE_PROVIDER_DOMAIN: https://res-4.cloudinary.com

VSF_REDIS_ENABLED: true
VSF_REDIS_ENABLED: false
VSF_REDIS_HOST: redis # VSF cloud specific
VSF_REDIS_PORT: 6379
VSF_REDIS_KEY_PREFIX: ${{ github.sha }}
Expand All @@ -113,6 +119,8 @@ jobs:
VSF_RECAPTCHA_SITE_KEY: 6Ldce0EeAAAAAAGGtGWG-e-SygXiFub6PXHT5fKd
VSF_RECAPTCHA_SECRET_KEY: ${{ secrets.RECAPTCHA_SECRET_KEY }}

VSF_COOKIE_SECURE: true

VSF_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}

LAST_COMMIT: ${{ github.sha }}
Expand All @@ -129,6 +137,10 @@ jobs:

finalize-deployment:
runs-on: ubuntu-latest

permissions:
deployments: write

needs: [create-deployment, build, deploy]
if: always()
steps:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/public_env_info/canary
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ENVNAME=canary
ENVCODE=demo-magento2-canary
BASE_URL=https://demo-magento2-canary.europe-west1.gcp.storefrontcloud.io
MIDDLEWARE_URL=https://demo-magento2-canary.europe-west1.gcp.storefrontcloud.io/api
BASE_URL=https://magento2stage.vuestorefront.io
MIDDLEWARE_URL=https://magento2stage.vuestorefront.io/api
SSR_MIDDLEWARE_URL=http://localhost:3000/api
MAGENTO_GRAPHQL_URL=https://magento2-instance.vuestorefront.io:8443/graphql
1 change: 1 addition & 0 deletions .github/workflows/public_env_info/dev
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ ENVNAME=dev
ENVCODE=demo-magento2-dev
BASE_URL=https://demo-magento2-dev.europe-west1.gcp.storefrontcloud.io
MIDDLEWARE_URL=https://demo-magento2-dev.europe-west1.gcp.storefrontcloud.io/api
SSR_MIDDLEWARE_URL=http://localhost:3000/api
MAGENTO_GRAPHQL_URL=https://magento2-instance.vuestorefront.io:8443/graphql
1 change: 1 addition & 0 deletions .github/workflows/public_env_info/enterprise
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ ENVNAME=enterprise
ENVCODE=demo-magento2-enterprise
BASE_URL=https://demo-magento2-enterprise.europe-west1.gcp.storefrontcloud.io
MIDDLEWARE_URL=https://demo-magento2-enterprise.europe-west1.gcp.storefrontcloud.io/api
SSR_MIDDLEWARE_URL=http://localhost:3000/api
MAGENTO_GRAPHQL_URL=https://magento2-instance.vuestorefront.io:8443/graphql
1 change: 1 addition & 0 deletions .github/workflows/public_env_info/production
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ ENVNAME=production
ENVCODE=demo-magento2
BASE_URL=https://demo-magento2.europe-west1.gcp.vuestorefront.cloud
MIDDLEWARE_URL=https://demo-magento2.europe-west1.gcp.vuestorefront.cloud/api
SSR_MIDDLEWARE_URL=http://localhost:3000/api
MAGENTO_GRAPHQL_URL=https://magento2-instance.vuestorefront.io:8443/graphql
3 changes: 0 additions & 3 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,3 @@ jobs:
- run: yarn build:api-client && yarn publish:api-client "${{ github.event.inputs.npmTag }}" "$NODE_AUTH_TOKEN"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: yarn build:composables && yarn publish:composables "${{ github.event.inputs.npmTag }}" "$NODE_AUTH_TOKEN"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions .vuestorefrontcloud/docker/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/node_modules
internals
12 changes: 4 additions & 8 deletions .vuestorefrontcloud/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,18 @@ ENV VSF_RECAPTCHA_SITE_KEY=${VSF_RECAPTCHA_SITE_KEY}
ENV VSF_RECAPTCHA_SECRET_KEY=${VSF_RECAPTCHA_SECRET_KEY}
ENV VSF_MIDDLEWARE_URL=${VSF_MIDDLEWARE_URL}

RUN npm config set @vsf-enterprise:registry=https://registrynpm.storefrontcloud.io

RUN npm install -g npm-cli-login \
&& npm-cli-login
RUN npm config set @vsf-enterprise:registry=https://registrynpm.storefrontcloud.io \
&& npm install -g npm-cli-login \
&& npm-cli-login

WORKDIR /var/www

COPY . .

RUN mv /var/www/packages/theme/nuxt.config.js /var/www/packages/theme/base.nuxt.config.js && cp .vuestorefrontcloud/docker/nuxt.config.additional.js /var/www/packages/theme/nuxt.config.js

RUN yarn install

RUN npx [email protected] workspace @vue-storefront/magento-theme add @sentry/tracing @nuxtjs/sentry
RUN yarn install && yarn build && yarn cache clean --all

RUN yarn build && yarn cache clean --all
COPY .vuestorefrontcloud/docker/vue-storefront.sh /usr/local/bin/

RUN chmod a+x /usr/local/bin/vue-storefront.sh
Expand Down
1 change: 0 additions & 1 deletion .vuestorefrontcloud/docker/nuxt.config.additional.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export default () => {
...baseDefaults,
modules: [
...baseDefaults.modules,
'@nuxtjs/sentry',
],
sentry: {
dsn: process.env.VSF_SENTRY_DSN,
Expand Down
89 changes: 85 additions & 4 deletions docs/installation-setup/configure-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,72 @@ After installation, the first step is configuring the integration using the envi

3. Update values in the `.env` file.

4. Explanation of env variables

#### Nuxt application configuration options
```
VSF_NUXT_APP_ENV=development # application mode [production|development]
VSF_NUXT_APP_PORT=3000 # nuxt server port property
VSF_NUXT_APP_HOST=0.0.0.0 # nuxt server host property
```

#### Storefront and middleware endpoints configuration
```
VSF_STORE_URL=https://localhost:3000 # external base url
VSF_MIDDLEWARE_URL=https://localhost:3000/api/ # external middleware base url
VSF_SSR_MIDDLEWARE_URL=http://localhost:3000/api/ # internal middleware base url
```
**NOTE**: *For many infrastructures `middleware_url` and `ssr_middleware_url` will be the same, but sometimes they might be different. For example, when it comes to deployment using a rolling-update strategy on the Kubernetes cluster, the Kubernetes is probing SSR if it's already up. SSR is trying to call middleware using an external URL (market...storefrontcloud.io) rather than localhost:3000/API, while the middleware isn't available publicly yet, because the SSR didn't respond with 200 in the first place.*
#### Magento 2 endpoints configuration and others
```
VSF_MAGENTO_BASE_URL={YOUR_SITE_FRONT_URL}
VSF_MAGENTO_GRAPHQL_URL=https://{YOUR_SITE_FRONT_URL}/graphql
VSF_MAGENTO_EXTERNAL_CHECKOUT_ENABLED=false
VSF_MAGENTO_EXTERNAL_CHECKOUT_URL=https://{YOUR_SITE_FRONT_URL}
VSF_MAGENTO_EXTERNAL_CHECKOUT_SYNC_PATH=/vue/cart/sync
```
#### Image provider configuration
```
VSF_IMAGE_PROVIDER=cloudinary
VSF_IMAGE_PROVIDER_BASE_URL=https://res-4.cloudinary.com/{YOUR_ID}/image/upload/
VSF_IMAGE_PROVIDER_DOMAIN=https://res-4.cloudinary.com
```
#### Redis cache configuration
```
VSF_REDIS_ENABLED=false
VSF_REDIS_HOST=127.0.0.1
VSF_REDIS_PORT=6379
VSF_REDIS_KEY_PREFIX=
VSF_REDIS_CACHE_INVALIDATE_URL=/cache-invalidate
```
#### ReCaptcha configuration
```
VSF_RECAPTCHA_ENABLED=false
VSF_RECAPTCHA_SITE_KEY=
VSF_RECAPTCHA_SECRET_KEY=
VSF_RECAPTCHA_HIDE_BADGE=
VSF_RECAPTCHA_SIZE=invisible
VSF_RECAPTCHA_MIN_SCORE=0.5
VSF_RECAPTCHA_VERSION=3
```
#### Cookies configuration
```
VSF_COOKIE_HTTP_ONLY=
VSF_COOKIE_SECURE=
VSF_COOKIE_SAME_SITE=
VSF_COOKIE_PATH=
```
#### Other
```
NODE_TLS_REJECT_UNAUTHORIZED=0 # toggle TLS verification (eg. for a local development)
```
### 2. Setup store configuration
The `plugins/storeConfigPlugin.ts` plugin loads store configuration data from Magento and saves it into the Pinia store under the `$state.storeConfig` property. By default, the amount of data loaded from Magento is minimal to avoid over-fetching, but as your application grows, you might need to pull more data.
Expand Down Expand Up @@ -74,7 +140,7 @@ When working with translation in your application, you need to:
### 4. Configure default cookies settings
Vue Storefront app uses different cookies but all share the same default config. To adjust the configuration you have to modify `middleware.config.js`.
Vue Storefront app uses different cookies but all share the same default config. To adjust the configuration you have to add `env` variable, which is the recommended way, or modify `middleware.config.js`.
Once done, rebuild your application.
```js
Expand All @@ -85,8 +151,8 @@ module.exports = {
/*...*/
// Here you can override default cookies options
cookiesDefaultOpts: {
httpOnly: false,
secure: true, // Make sure that you have ssl configured, otherwise disable this flag
httpOnly: VSF_COOKIE_HTTP_ONLY || false,
secure: VSF_COOKIE_SECURE || true, // Make sure that you have ssl configured, otherwise disable this flag
},
/*...*/
},
Expand All @@ -100,13 +166,28 @@ module.exports = {
### Install `mkcert`
Please, follow the steps in the [official instruction](https://github.com/FiloSottile/mkcert). Different OS might require different steps to accomplish the task.
### Generate certificate for a local development
#### Update nuxt.config.js
In the `nuxt.config.js` add the certificate configuration
```
baseConfig.server = {
...baseConfig.server,
https: {
key: fs.readFileSync(path.resolve(__dirname, 'localhost-key.pem')),
cert: fs.readFileSync(path.resolve(__dirname, 'localhost.pem')),
},
};
```
#### Generate certificate for a local development
If you set up your project from CLI run the command in the APP root directory.
If you are a contributor and have cloned Vue Storefront repository, run the command in `packages/theme`.
```
mkcert localhost
```
### Start project
```bash
yarn dev
Expand Down
26 changes: 26 additions & 0 deletions docs/migration-guides/1.1.0/1.1.0-bic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 1.1.0 Backward incompatible changes reference

In this document, you can see crucial breaking changes in the `1.1.0` compared to `1.0.2` release. To see all changes, please take a look at [the release pull request.](https://github.com/vuestorefront/magento2/pull/1355)

## feat!: implement Magento URL rewrites

[https://github.com/vuestorefront/magento2/pull/1321/files](https://github.com/vuestorefront/magento2/pull/1321)

| File | What was changed |
|--------------------------------------------------------------------------------------------| --- |
| **[!]** packages/theme/middleware/url-resolver.ts | A new, rewrite-aware URL resolver is added. |
| **[!]** packages/theme/modules/catalog/index.ts | Routes configuration is removed. |
| **[!]** packages/theme/stores/page.ts | Add Pinia PageStore to store route data state for pages. |
| packages/api-client/src/api/route/route.ts | The query data structure is modified: relative_url and redirect_code are removed. |
| packages/theme/composables/useUiHelpers/index.ts | The category prefix is removed from the category URL string. |
| packages/theme/modules/catalog/category/helpers/useTraverseCategory.ts | The category prefix is removed from the category URL string. |
| packages/theme/modules/catalog/product/composables/useProduct/useProduct.ts | Add getProductPath method. Get a product path from url_rewrites or url_key. |
| packages/theme/helpers/cart/addToCart.ts | GroupedProduct’s add-to-cart URL resolution is simplified and replaced with the getProductPath. |
| packages/theme/modules/catalog/category/components/views/useProductsWithCommonCardProps.ts | Product link URL resolution is simplified and replaced with the getProductPath. |
| packages/theme/modules/customer/pages/MyAccount/MyWishlist.vue | Product link URL resolution is simplified and replaced with the getProductPath. |
| packages/theme/modules/catalog/product/components/ProductsCarousel.vue | Product link URL resolution is simplified and replaced with the getProductPath. |
| packages/theme/modules/GraphQL/types.ts | Add missing optional fields on the RoutableInterface |

***Notes:*** If you are using in your project old, prefixed URL or URL resolvers, replace them with the usage of the new **useProduct::getProductPath**

***Notes:*** The old routing system is replaced with a Magento route **type** resolver. Previously, VSF was able to route to a CMS, Category, or Product page based on the URL prefix. Currently, the renderer type is resolved based on the GraphQL **route** query and the route **type** field.
57 changes: 57 additions & 0 deletions docs/migration-guides/1.1.0/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Vue Storefront for Magento 1.1.0

Vue Storefront for Magento 1.1.0 contains backward-incompatible changes. To review these backward-incompatible changes, see

[1.1.0 **Backward incompatible changes reference** ](./1.1.0-bic.md)

## Vue Storefront for Magento 1.1.0 highlights

Vue Storefront for Magento 1.1.0 provides a few new features like SEO-friendly URLs, SEO meta tags, Google Cloud CDN support, and more.

## Features

- feat!: implement magento URL rewrites [https://github.com/vuestorefront/magento2/pull/1321](https://github.com/vuestorefront/magento2/pull/1321/files)
- feat: add GC CDN support [https://github.com/vuestorefront/magento2/pull/1338](https://github.com/vuestorefront/magento2/pull/1338)
- feat: implement a meta info on cms, product,category page [https://github.com/vuestorefront/magento2/pull/1326](https://github.com/vuestorefront/magento2/pull/1326)
- feat: implement add a grouped product to cart [https://github.com/vuestorefront/magento2/pull/1324](https://github.com/vuestorefront/magento2/pull/1324)
- feat: make security connection optional by default [https://github.com/vuestorefront/magento2/pull/1354](https://github.com/vuestorefront/magento2/pull/1354)

### Bugfix

- fix: product list page is sometimes unresponsive after the store switch [https://github.com/vuestorefront/magento2/pull/1352](https://github.com/vuestorefront/magento2/pull/1352)
- fix: logout doesn't work after reload of the MyAccount page [https://github.com/vuestorefront/magento2/pull/1347](https://github.com/vuestorefront/magento2/pull/1347)
- fix: pods do not get up after deployment [https://github.com/vuestorefront/magento2/pull/1351](https://github.com/vuestorefront/magento2/pull/1351)
- fix: add missing canary URL protocols [https://github.com/vuestorefront/magento2/pull/1349](https://github.com/vuestorefront/magento2/pull/1349)
- fix: product is not marked as added to the wishlist [https://github.com/vuestorefront/magento2/pull/1346](https://github.com/vuestorefront/magento2/pull/1346)
- fix: fix the issue with a store switching on the customer account [https://github.com/vuestorefront/magento2/pull/1345](https://github.com/vuestorefront/magento2/pull/1345)
- fix: fix a message about the submitted review [https://github.com/vuestorefront/magento2/pull/1331](https://github.com/vuestorefront/magento2/pull/1331)
- fix: vsf2 not working with docker-compose [https://github.com/vuestorefront/magento2/pull/1337](https://github.com/vuestorefront/magento2/pull/1337)
- fix: pods have warnings error after deployment [https://github.com/vuestorefront/magento2/pull/1335](https://github.com/vuestorefront/magento2/pull/1335)
- fix: fix product detail components [https://github.com/vuestorefront/magento2/pull/1330](https://github.com/vuestorefront/magento2/pull/1330)
- fix: downloadableProduct might not have been initialized [https://github.com/vuestorefront/magento2/pull/1325](https://github.com/vuestorefront/magento2/pull/1325)
- fix: getAvailableShippingMethods query variables [https://github.com/vuestorefront/magento2/pull/1318](https://github.com/vuestorefront/magento2/pull/1318)
- fix: update CDN default configuration [https://github.com/vuestorefront/magento2/pull/1372](https://github.com/vuestorefront/magento2/pull/1372)
- fix: getMagentoImage reading 'split' error [https://github.com/vuestorefront/magento2/pull/1373](https://github.com/vuestorefront/magento2/pull/1373)
- fix: cart type error in the console after opening mini cart as a guest [https://github.com/vuestorefront/magento2/pull/1374](https://github.com/vuestorefront/magento2/pull/1374)
- fix: product detail gallery is missing when browsing products using mobile [https://github.com/vuestorefront/magento2/pull/1375](https://github.com/vuestorefront/magento2/pull/1375)
- fix: ssr reload on the grouped product page [https://github.com/vuestorefront/magento2/pull/1376](https://github.com/vuestorefront/magento2/pull/1376)
- fix: product list page items on product page list page zero prices issues [https://github.com/vuestorefront/magento2/pull/1379](https://github.com/vuestorefront/magento2/pull/1379)
-
### Chore

- chore: removed deprecated composables packages from the repository [https://github.com/vuestorefront/magento2/pull/1322](https://github.com/vuestorefront/magento2/pull/1322)

### Docs

- docs: fixed breaking change reference link [https://github.com/vuestorefront/magento2/pull/1350](https://github.com/vuestorefront/magento2/pull/1350)
- docs: fix wording + add installation video [https://github.com/vuestorefront/magento2/pull/1319](https://github.com/vuestorefront/magento2/pull/1319)
- docs: removed outdated information about cors configuration [https://github.com/vuestorefront/magento2/pull/1378](https://github.com/vuestorefront/magento2/pull/1378)

### Repository

- ci: fix code not checked out [https://github.com/vuestorefront/magento2/pull/1327](https://github.com/vuestorefront/magento2/pull/1327)
- ci: refactor k6 action to add new env vars [https://github.com/vuestorefront/magento2/pull/1287](https://github.com/vuestorefront/magento2/pull/1287)

### Credits

Huge thanks to @[sethidden](https://github.com/sethidden), [@sequensucks](https://github.com/sequensucks), [@Frodigo](https://github.com/Frodigo), [@bartoszherba](https://github.com/bartoszherba)
1 change: 1 addition & 0 deletions docs/migration-guides/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Migration guides
## 1.0.x
- [1.1.0](./1.1.0/)
- [1.0.2](./1.0.2/)
- [1.0.1](./1.0.1/)
- [1.0.0](./1.0.0/)
Expand Down
2 changes: 1 addition & 1 deletion internals/eslint-import/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue-storefront/eslint-config-import",
"version": "1.0.2",
"version": "1.1.0",
"author": "Heitor Ramon Ribeiro <[email protected]>",
"license": "MIT",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion internals/eslint-jest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue-storefront/eslint-config-jest",
"version": "1.0.2",
"version": "1.1.0",
"author": "Heitor Ramon Ribeiro <[email protected]>",
"license": "MIT",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion internals/eslint-typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue-storefront/eslint-config-typescript",
"version": "1.0.2",
"version": "1.1.0",
"author": "Heitor Ramon Ribeiro <[email protected]>",
"license": "MIT",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion internals/eslint-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue-storefront/eslint-config-vue",
"version": "1.0.2",
"version": "1.1.0",
"author": "Heitor Ramon Ribeiro <[email protected]>",
"license": "MIT",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion internals/eslint/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue-storefront/eslint-config-base",
"version": "1.0.2",
"version": "1.1.0",
"author": "Heitor Ramon Ribeiro <[email protected]>",
"license": "MIT",
"scripts": {
Expand Down
Loading

0 comments on commit 6b7a593

Please sign in to comment.