diff --git a/.github/workflows/deploy-vue-storefront-cloud.yml b/.github/workflows/deploy-vue-storefront-cloud.yml index fdfd78d4c..4968536dc 100644 --- a/.github/workflows/deploy-vue-storefront-cloud.yml +++ b/.github/workflows/deploy-vue-storefront-cloud.yml @@ -26,40 +26,43 @@ jobs: password: ${{ secrets.CLOUD_PASSWORD }} dockerfile: .vuestorefrontcloud/docker/Dockerfile buildoptions: --compress - buildargs: NPM_EMAIL,NPM_PASS,NPM_USER,NPM_REGISTRY,STORE_URL,MAGENTO_BASE_URL,MAGENTO_GRAPHQL_URL,MAGENTO_EXTERNAL_CHECKOUT_ENABLED,MAGENTO_EXTERNAL_CHECKOUT_URL,MAGENTO_EXTERNAL_CHECKOUT_SYNC_PATH,IMAGE_PROVIDER,IMAGE_PROVIDER_BASE_URL,REDIS_HOST,REDIS_PORT,REDIS_CACHE_INVALIDATE_KEY,REDIS_CACHE_INVALIDATE_URL,REDIS_KEY_PREFIX,REDIS_ENABLED,SENTRY_DSN,RECAPTCHA_ENABLED,RECAPTCHA_HIDE_BADGE,RECAPTCHA_VERSION,RECAPTCHA_SIZE,RECAPTCHA_MIN_SCORE,RECAPTCHA_SITE_KEY,RECAPTCHA_SECRET_KEY + buildargs: NPM_EMAIL,NPM_PASS,NPM_USER,NPM_REGISTRY,LAST_COMMIT,VSF_STORE_URL,VSF_MAGENTO_BASE_URL,VSF_MAGENTO_GRAPHQL_URL,VSF_MAGENTO_EXTERNAL_CHECKOUT_ENABLED,VSF_MAGENTO_EXTERNAL_CHECKOUT_URL,VSF_MAGENTO_EXTERNAL_CHECKOUT_SYNC_PATH,VSF_IMAGE_PROVIDER,VSF_IMAGE_PROVIDER_BASE_URL,VSF_REDIS_HOST,VSF_REDIS_PORT,VSF_REDIS_CACHE_INVALIDATE_KEY,VSF_REDIS_CACHE_INVALIDATE_URL,VSF_REDIS_KEY_PREFIX,VSF_REDIS_ENABLED,VSF_RECAPTCHA_ENABLED,VSF_RECAPTCHA_HIDE_BADGE,VSF_RECAPTCHA_VERSION,VSF_RECAPTCHA_SIZE,VSF_RECAPTCHA_MIN_SCORE,VSF_RECAPTCHA_SITE_KEY,VSF_RECAPTCHA_SECRET_KEY,VSF_SENTRY_DSN, + env: NPM_EMAIL: ${{ secrets.NPM_EMAIL }} NPM_USER: ${{ secrets.CLOUD_USERNAME }} NPM_PASS: ${{ secrets.CLOUD_PASSWORD }} NPM_REGISTRY: https://registrynpm.storefrontcloud.io - STORE_URL: '' # TODO + VSF_STORE_URL: '' # TODO + + VSF_MAGENTO_BASE_URL: https://magento2-instance.vuestorefront.io/ + VSF_MAGENTO_GRAPHQL_URL: https://magento2-instance.vuestorefront.io/graphql + VSF_MAGENTO_EXTERNAL_CHECKOUT_ENABLED: false + VSF_MAGENTO_EXTERNAL_CHECKOUT_URL: '' + VSF_MAGENTO_EXTERNAL_CHECKOUT_SYNC_PATH: '' - MAGENTO_BASE_URL: https://magento2-instance.vuestorefront.io/ - MAGENTO_GRAPHQL_URL: https://magento2-instance.vuestorefront.io/graphql - MAGENTO_EXTERNAL_CHECKOUT_ENABLED: false - MAGENTO_EXTERNAL_CHECKOUT_URL: '' - MAGENTO_EXTERNAL_CHECKOUT_SYNC_PATH: '' + VSF_IMAGE_PROVIDER: cloudinary + VSF_IMAGE_PROVIDER_BASE_URL: https://res-4.cloudinary.com/dnozky7on/image/upload/ - IMAGE_PROVIDER: cloudinary - IMAGE_PROVIDER_BASE_URL: https://res-4.cloudinary.com/dnozky7on/image/upload/ + VSF_REDIS_ENABLED: true + VSF_REDIS_HOST: localhost + VSF_REDIS_PORT: 6379 + VSF_REDIS_KEY_PREFIX: ${{ github.sha }} + VSF_REDIS_CACHE_INVALIDATE_KEY: magento2vsf2 + VSF_REDIS_CACHE_INVALIDATE_URL: /cache-invalidate - REDIS_ENABLED: true - REDIS_HOST: localhost - REDIS_PORT: 6379 - REDIS_KEY_PREFIX: ${{ github.sha }} - REDIS_CACHE_INVALIDATE_KEY: magento2vsf2 - REDIS_CACHE_INVALIDATE_URL: /cache-invalidate + VSF_RECAPTCHA_ENABLED: false + VSF_RECAPTCHA_HIDE_BADGE: false + VSF_RECAPTCHA_VERSION: 3 + VSF_RECAPTCHA_SIZE: invisible + VSF_RECAPTCHA_MIN_SCORE: 0.5 + VSF_RECAPTCHA_SITE_KEY: 6Ldce0EeAAAAAAGGtGWG-e-SygXiFub6PXHT5fKd + VSF_RECAPTCHA_SECRET_KEY: ${{ secrets.RECAPTCHA_SECRET_KEY }} - RECAPTCHA_ENABLED: false - RECAPTCHA_HIDE_BADGE: false - RECAPTCHA_VERSION: 3 - RECAPTCHA_SIZE: invisible - RECAPTCHA_MIN_SCORE: 0.5 - RECAPTCHA_SITE_KEY: 6Ldce0EeAAAAAAGGtGWG-e-SygXiFub6PXHT5fKd - RECAPTCHA_SECRET_KEY: ${{ secrets.RECAPTCHA_SECRET_KEY }} + VSF_SENTRY_DSN: ${{ secrets.SENTRY_DSN }} - SENTRY_DSN: ${{ secrets.SENTRY_DSN }} + LAST_COMMIT: ${{ github.sha }} deploy-main: uses: ./.github/workflows/deployment-template.yml diff --git a/.vuestorefrontcloud/docker/Dockerfile b/.vuestorefrontcloud/docker/Dockerfile index ccf1a0b3d..068e1c634 100644 --- a/.vuestorefrontcloud/docker/Dockerfile +++ b/.vuestorefrontcloud/docker/Dockerfile @@ -1,59 +1,66 @@ FROM node:16 -ARG COMMIT +ARG LAST_COMMIT ARG NPM_USER ARG NPM_PASS ARG NPM_EMAIL ARG NPM_REGISTRY -ARG MAGENTO_BASE_URL -ARG MAGENTO_GRAPHQL_URL -ARG MAGENTO_EXTERNAL_CHECKOUT_ENABLED -ARG MAGENTO_EXTERNAL_CHECKOUT_URL -ARG MAGENTO_EXTERNAL_CHECKOUT_SYNC_PATH -ARG STORE_URL -ARG IMAGE_PROVIDER -ARG IMAGE_PROVIDER_BASE_URL -ARG REDIS_ENABLED -ARG REDIS_HOST -ARG REDIS_PORT -ARG REDIS_KEY_PREFIX -ARG REDIS_CACHE_INVALIDATE_URL -ARG REDIS_CACHE_INVALIDATE_KEY -ARG RECAPTCHA_ENABLED -ARG RECAPTCHA_HIDE_BADGE -ARG RECAPTCHA_VERSION -ARG RECAPTCHA_SIZE -ARG RECAPTCHA_MIN_SCORE -ARG RECAPTCHA_SITE_KEY -ARG RECAPTCHA_SECRET_KEY -ARG SENTRY_DSN - -ENV NUXT_APP_ENV=production -ENV NUXT_APP_PORT=3000 - -ENV MAGENTO_BASE_URL=${MAGENTO_BASE_URL} -ENV MAGENTO_GRAPHQL_URL=${MAGENTO_GRAPHQL_URL} -ENV MAGENTO_EXTERNAL_CHECKOUT_ENABLED=${MAGENTO_EXTERNAL_CHECKOUT_ENABLED} -ENV MAGENTO_EXTERNAL_CHECKOUT_URL=${MAGENTO_EXTERNAL_CHECKOUT_URL} -ENV MAGENTO_EXTERNAL_CHECKOUT_SYNC_PATH=${MAGENTO_EXTERNAL_CHECKOUT_SYNC_PATH} -ENV STORE_URL=${STORE_URL} -ENV LAST_COMMIT=${COMMIT} -ENV IMAGE_PROVIDER=${IMAGE_PROVIDER} -ENV IMAGE_PROVIDER_BASE_URL=${IMAGE_PROVIDER_BASE_URL} -ENV REDIS_ENABLED=${REDIS_ENABLED} -ENV REDIS_HOST=${REDIS_HOST} -ENV REDIS_PORT=${REDIS_PORT} -ENV REDIS_KEY_PREFIX=${REDIS_KEY_PREFIX} -ENV REDIS_CACHE_INVALIDATE_KEY=${REDIS_CACHE_INVALIDATE_KEY} -ENV REDIS_CACHE_INVALIDATE_URL=${REDIS_CACHE_INVALIDATE_URL} -ENV SENTRY_DSN=${SENTRY_DSN} -ENV RECAPTCHA_ENABLED=${RECAPTCHA_ENABLED} -ENV RECAPTCHA_HIDE_BADGE=${RECAPTCHA_HIDE_BADGE} -ENV RECAPTCHA_VERSION=${RECAPTCHA_VERSION} -ENV RECAPTCHA_SIZE=${RECAPTCHA_SIZE} -ENV RECAPTCHA_MIN_SCORE=${RECAPTCHA_MIN_SCORE} -ENV RECAPTCHA_SITE_KEY=${RECAPTCHA_SITE_KEY} -ENV RECAPTCHA_SECRET_KEY=${RECAPTCHA_SITE_KEY} + +ARG VSF_STORE_URL + +ARG VSF_MAGENTO_BASE_URL +ARG VSF_MAGENTO_GRAPHQL_URL +ARG VSF_MAGENTO_EXTERNAL_CHECKOUT_ENABLED +ARG VSF_MAGENTO_EXTERNAL_CHECKOUT_URL +ARG VSF_MAGENTO_EXTERNAL_CHECKOUT_SYNC_PATH + +ARG VSF_IMAGE_PROVIDER +ARG VSF_IMAGE_PROVIDER_BASE_URL + +ARG VSF_REDIS_ENABLED +ARG VSF_REDIS_HOST +ARG VSF_REDIS_PORT +ARG VSF_REDIS_KEY_PREFIX +ARG VSF_REDIS_CACHE_INVALIDATE_URL +ARG VSF_REDIS_CACHE_INVALIDATE_KEY + +ARG VSF_RECAPTCHA_ENABLED +ARG VSF_RECAPTCHA_HIDE_BADGE +ARG VSF_RECAPTCHA_VERSION +ARG VSF_RECAPTCHA_SIZE +ARG VSF_RECAPTCHA_MIN_SCORE +ARG VSF_RECAPTCHA_SITE_KEY +ARG VSF_RECAPTCHA_SECRET_KEY + +ARG VSF_SENTRY_DSN + +ENV LAST_COMMIT=${LAST_COMMIT} + +ENV VSF_NUXT_APP_ENV=production +ENV VSF_NUXT_APP_PORT=3000 + +ENV VSF_MAGENTO_BASE_URL=${VSF_MAGENTO_BASE_URL} +ENV VSF_MAGENTO_GRAPHQL_URL=${VSF_MAGENTO_GRAPHQL_URL} +ENV VSF_MAGENTO_EXTERNAL_CHECKOUT_ENABLED=${VSF_MAGENTO_EXTERNAL_CHECKOUT_ENABLED} +ENV VSF_MAGENTO_EXTERNAL_CHECKOUT_URL=${VSF_MAGENTO_EXTERNAL_CHECKOUT_URL} +ENV VSF_MAGENTO_EXTERNAL_CHECKOUT_SYNC_PATH=${VSF_MAGENTO_EXTERNAL_CHECKOUT_SYNC_PATH} +ENV VSF_STORE_URL=${VSF_STORE_URL} +ENV VSF_IMAGE_PROVIDER=${VSF_IMAGE_PROVIDER} +ENV VSF_IMAGE_PROVIDER_BASE_URL=${VSF_IMAGE_PROVIDER_BASE_URL} +ENV VSF_REDIS_ENABLED=${VSF_REDIS_ENABLED} +ENV VSF_REDIS_HOST=${VSF_REDIS_HOST} +ENV VSF_REDIS_PORT=${VSF_REDIS_PORT} +ENV VSF_REDIS_KEY_PREFIX=${VSF_REDIS_KEY_PREFIX} +ENV VSF_REDIS_CACHE_INVALIDATE_KEY=${VSF_REDIS_CACHE_INVALIDATE_KEY} +ENV VSF_REDIS_CACHE_INVALIDATE_URL=${VSF_REDIS_CACHE_INVALIDATE_URL} +ENV VSF_SENTRY_DSN=${VSF_SENTRY_DSN} +ENV VSF_RECAPTCHA_ENABLED=${VSF_RECAPTCHA_ENABLED} +ENV VSF_RECAPTCHA_HIDE_BADGE=${VSF_RECAPTCHA_HIDE_BADGE} +ENV VSF_RECAPTCHA_VERSION=${VSF_RECAPTCHA_VERSION} +ENV VSF_RECAPTCHA_SIZE=${VSF_RECAPTCHA_SIZE} +ENV VSF_RECAPTCHA_MIN_SCORE=${VSF_RECAPTCHA_MIN_SCORE} +ENV VSF_RECAPTCHA_SITE_KEY=${VSF_RECAPTCHA_SITE_KEY} +ENV VSF_RECAPTCHA_SECRET_KEY=${VSF_RECAPTCHA_SITE_KEY} RUN npm config set @vsf-enterprise:registry=https://registrynpm.storefrontcloud.io diff --git a/.vuestorefrontcloud/docker/nuxt.config.additional.js b/.vuestorefrontcloud/docker/nuxt.config.additional.js index aa9029696..b5e52cd90 100755 --- a/.vuestorefrontcloud/docker/nuxt.config.additional.js +++ b/.vuestorefrontcloud/docker/nuxt.config.additional.js @@ -10,7 +10,7 @@ export default () => { '@nuxtjs/sentry' ], sentry: { - dsn: process.env.SENTRY_DSN, + dsn: process.env.VSF_SENTRY_DSN, tracing: true, }, }; diff --git a/docs/guide/configuration.md b/docs/guide/configuration.md index 7f7aa7673..5ede460a5 100644 --- a/docs/guide/configuration.md +++ b/docs/guide/configuration.md @@ -93,9 +93,9 @@ By default, we use the `ipx` provider. that means the images are fetched from Ma 2. Configure your provider in `nuxt.config.js`. Here is the example: ```javascript image: { - provider: process.env.IMAGE_PROVIDER + provider: process.env.VSF_IMAGE_PROVIDER magekit: { - baseURL: process.env.IMAGE_PROVIDER_BASE_URL + baseURL: process.env.VSF_IMAGE_PROVIDER_BASE_URL } }, ``` diff --git a/docs/guide/ssr.md b/docs/guide/ssr.md index f55541fb2..069d7d4ca 100644 --- a/docs/guide/ssr.md +++ b/docs/guide/ssr.md @@ -17,11 +17,11 @@ The cached pages are: To invalidate a tag and remove pages associated with that tag, use the [Invalidation endpoint](https://docs.vuestorefront.io/v2/performance/ssr-cache.html#invalidating-tags). -Go to the route configured in the `.env` file under the `REDIS_CACHE_INVALIDATE_KEY` key with two query parameters: -* `key` — string matching the `REDIS_CACHE_INVALIDATE_KEY` key in the `.env` file. +Go to the route configured in the `.env` file under the `VSF_REDIS_CACHE_INVALIDATE_KEY` key with two query parameters: +* `key` — string matching the `VSF_REDIS_CACHE_INVALIDATE_KEY` key in the `.env` file. * `tags` — a comma-separated list of tags for invalidation. -Assuming that you are running the application locally, the `REDIS_CACHE_INVALIDATE_URL` key is equal to `/cache-invalidate,` and the `REDIS_CACHE_INVALIDATE_KEY` key is equal to `secret_key`, and you want to invalidate the `Vhome` tag, the full URL will look like this: +Assuming that you are running the application locally, the `VSF_REDIS_CACHE_INVALIDATE_URL` key is equal to `/cache-invalidate,` and the `VSF_REDIS_CACHE_INVALIDATE_KEY` key is equal to `secret_key`, and you want to invalidate the `Vhome` tag, the full URL will look like this: ## How to cache other pages @@ -50,22 +50,21 @@ Once you have the Redis driver installed, you need to add the Redis configuratio ``` .env -REDIS_HOST=127.0.0.1 -REDIS_PORT=6379 -REDIS_PASSWORD= -REDIS_KEY_PREFIX= -REDIS_CACHE_INVALIDATE_URL=/cache-invalidate -REDIS_ENABLED=true +VSF_REDIS_HOST=127.0.0.1 +VSF_REDIS_PORT=6379 +VSF_REDIS_KEY_PREFIX= +VSF_REDIS_CACHE_INVALIDATE_URL=/cache-invalidate +VSF_REDIS_ENABLED=true ``` Then you have to update `nuxt.config.js file` and add this to the `modules` object: ```javascript ['@vue-storefront/cache/nuxt', { - enabled: process.env.REDIS_ENABLED, + enabled: process.env.VSF_REDIS_ENABLED, invalidation: { - endpoint: process.env.REDIS_CACHE_INVALIDATE_URL, - key: process.env.REDIS_CACHE_INVALIDATE_KEY, + endpoint: process.env.VSF_REDIS_CACHE_INVALIDATE_URL, + key: process.env.VSF_REDIS_CACHE_INVALIDATE_KEY, handlers: [ '@vue-storefront/cache/defaultHandler', ], @@ -75,9 +74,9 @@ Then you have to update `nuxt.config.js file` and add this to the `modules` obje { // docs: https://github.com/luin/ioredis/blob/master/API.md#new-redisport-host-options redis: { - keyPrefix: process.env.REDIS_KEY_PREFIX, - host: process.env.REDIS_HOST, - port: process.env.REDIS_PORT, + keyPrefix: process.env.VSF_REDIS_KEY_PREFIX, + host: process.env.VSF_REDIS_HOST, + port: process.env.VSF_REDIS_PORT, }, }, ], diff --git a/packages/api-client/.env.example b/packages/api-client/.env.example index 81611d304..0cf706fde 100644 --- a/packages/api-client/.env.example +++ b/packages/api-client/.env.example @@ -1 +1 @@ -MAGENTO_GRAPHQL_URL=https://{YOUR_SITE_FRONT_URL}/graphql +VSF_MAGENTO_GRAPHQL_URL=https://{YOUR_SITE_FRONT_URL}/graphql diff --git a/packages/api-client/README.md b/packages/api-client/README.md index 4dd25f7e2..ac5c3cf50 100644 --- a/packages/api-client/README.md +++ b/packages/api-client/README.md @@ -75,9 +75,9 @@ Find more information about the module [GraphQl Custom Config](https://github.co ```bash $ cp packages/theme/.env.example packages/theme/config/.env ``` -6. Update `MAGENT_GRAPHQL_URL` with url to Magento >=2.4.2 GraphQL endpoint, and the other variable accordingly to your store configurations. +6. Update `VSF_MAGENTO_GRAPHQL_URL` with url to Magento >=2.4.2 GraphQL endpoint, and the other variable accordingly to your store configurations. ``` - MAGENTO_GRAPHQL_URL=https://{YOUR_SITE_FRONT_URL}/graphql + VSF_MAGENTO_GRAPHQL_URL=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` diff --git a/packages/api-client/possible-types.js b/packages/api-client/possible-types.js index 18d78b326..53590aae3 100644 --- a/packages/api-client/possible-types.js +++ b/packages/api-client/possible-types.js @@ -2,7 +2,7 @@ require('dotenv').config(); const fetch = require('cross-fetch'); const fs = require('fs'); -fetch(process.env.MAGENTO_GRAPHQL_URL, { +fetch(process.env.VSF_MAGENTO_GRAPHQL_URL, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ diff --git a/packages/composables/README.md b/packages/composables/README.md index 558f26641..ac00d9f78 100644 --- a/packages/composables/README.md +++ b/packages/composables/README.md @@ -75,9 +75,9 @@ Find more information about the module [GraphQl Custom Config](https://github.co ```bash $ cp packages/theme/.env.example packages/theme/.env ``` -6. Update `MAGENTO_GRAPHQL_URL` with url to Magento >=2.4.2 GraphQL endpoint, and the other variable accordingly to your store configurations. +6. Update `VSF_MAGENTO_GRAPHQL_URL` with url to Magento >=2.4.2 GraphQL endpoint, and the other variable accordingly to your store configurations. ``` - MAGENTO_GRAPHQL_URL=https://{YOUR_SITE_FRONT_URL}/graphql + VSF_MAGENTO_GRAPHQL_URL=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` diff --git a/packages/theme/.env.example b/packages/theme/.env.example index 67768ebaf..4cb318199 100644 --- a/packages/theme/.env.example +++ b/packages/theme/.env.example @@ -1,27 +1,28 @@ -STORE_URL=http://localhost:3000 -NUXT_APP_ENV=development -NUXT_APP_PORT=3000 +VSF_NUXT_APP_ENV=development +VSF_NUXT_APP_PORT=3000 -MAGENTO_BASE_URL={YOUR_SITE_FRONT_URL} -MAGENTO_GRAPHQL_URL=https://{YOUR_SITE_FRONT_URL}/graphql +VSF_STORE_URL=http://localhost:3000 -MAGENTO_EXTERNAL_CHECKOUT_ENABLED=false -MAGENTO_EXTERNAL_CHECKOUT_URL=https://{YOUR_SITE_FRONT_URL} -MAGENTO_EXTERNAL_CHECKOUT_SYNC_PATH=/vue/cart/sync +VSF_MAGENTO_BASE_URL={YOUR_SITE_FRONT_URL} +VSF_MAGENTO_GRAPHQL_URL=https://{YOUR_SITE_FRONT_URL}/graphql -IMAGE_PROVIDER=cloudinary -IMAGE_PROVIDER_BASE_URL=https://res-4.cloudinary.com/{YOUR_ID}/image/upload/ +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 -REDIS_ENABLED=false -REDIS_HOST=127.0.0.1 -REDIS_PORT=6379 -REDIS_KEY_PREFIX= -REDIS_CACHE_INVALIDATE_URL=/cache-invalidate +VSF_IMAGE_PROVIDER=cloudinary +VSF_IMAGE_PROVIDER_BASE_URL=https://res-4.cloudinary.com/{YOUR_ID}/image/upload/ -RECAPTCHA_ENABLED=false -RECAPTCHA_SITE_KEY= -RECAPTCHA_SECRET_KEY= -RECAPTCHA_HIDE_BADGE= -RECAPTCHA_SIZE=invisible -RECAPTCHA_MIN_SCORE=0.5 -RECAPTCHA_VERSION=3 +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 + +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 diff --git a/packages/theme/middleware.config.js b/packages/theme/middleware.config.js index 041a3b4f4..4102b6858 100755 --- a/packages/theme/middleware.config.js +++ b/packages/theme/middleware.config.js @@ -1,22 +1,22 @@ /* eslint-disable unicorn/prefer-module */ const cookieNames = require('./enums/cookieNameEnum'); -const isCheckoutEnabled = process.env.MAGENTO_EXTERNAL_CHECKOUT_ENABLED === 'true'; +const isCheckoutEnabled = process.env.VSF_MAGENTO_EXTERNAL_CHECKOUT_ENABLED === 'true'; module.exports = { integrations: { magento: { location: '@vue-storefront/magento-api/server', configuration: { - api: process.env.MAGENTO_GRAPHQL_URL, + api: process.env.VSF_MAGENTO_GRAPHQL_URL, cookies: { ...cookieNames, }, defaultStore: 'default', externalCheckout: { enable: isCheckoutEnabled, - cmsUrl: process.env.MAGENTO_EXTERNAL_CHECKOUT_URL, - syncUrlPath: process.env.MAGENTO_EXTERNAL_CHECKOUT_SYNC_PATH, + cmsUrl: process.env.VSF_MAGENTO_EXTERNAL_CHECKOUT_URL, + syncUrlPath: process.env.VSF_MAGENTO_EXTERNAL_CHECKOUT_SYNC_PATH, stores: { default: isCheckoutEnabled, }, @@ -27,15 +27,15 @@ module.exports = { customApolloHttpLinkOptions: { useGETForQueries: true, }, - magentoBaseUrl: process.env.MAGENTO_BASE_URL, - magentoApiEndpoint: process.env.MAGENTO_GRAPHQL_URL, - imageProvider: process.env.IMAGAE_PROVIDER, + magentoBaseUrl: process.env.VSF_MAGENTO_BASE_URL, + magentoApiEndpoint: process.env.VSF_MAGENTO_GRAPHQL_URL, + imageProvider: process.env.VSF_IMAGAE_PROVIDER, recaptcha: { - isEnabled: process.env.RECAPTCHA_ENABLED === 'true', - sitekey: process.env.RECAPTCHA_SITE_KEY, - secretkey: process.env.RECAPTCHA_SECRET_KEY, - version: process.env.RECAPTCHA_VERSION, - score: process.env.RECAPTCHA_MIN_SCORE, + isEnabled: process.env.VSF_RECAPTCHA_ENABLED === 'true', + sitekey: process.env.VSF_RECAPTCHA_SITE_KEY, + secretkey: process.env.VSF_RECAPTCHA_SECRET_KEY, + version: process.env.VSF_RECAPTCHA_VERSION, + score: process.env.VSF_RECAPTCHA_MIN_SCORE, }, }, }, diff --git a/packages/theme/nuxt.config.js b/packages/theme/nuxt.config.js index 6c7e6954f..4b863eeb0 100755 --- a/packages/theme/nuxt.config.js +++ b/packages/theme/nuxt.config.js @@ -27,9 +27,9 @@ const { export default () => { const baseConfig = { ssr: true, - dev: process.env.NUXT_APP_ENV !== 'production', + dev: process.env.VSF_NUXT_APP_ENV !== 'production', server: { - port: process.env.PORT || process.env.NUXT_APP_PORT, + port: process.env.VSF_NUXT_APP_PORT, host: '0.0.0.0', }, head: { @@ -96,17 +96,17 @@ export default () => { modules: [ '~/modules/catalog', ['nuxt-i18n', { - baseUrl: process.env.STORE_URL || 'http://localhost:3000', + baseUrl: process.env.VSF_STORE_URL || 'http://localhost:3000', }], 'cookie-universal-nuxt', 'vue-scrollto/nuxt', '@vue-storefront/middleware/nuxt', '@nuxt/image', ['@vue-storefront/cache/nuxt', { - enabled: process.env.REDIS_ENABLED === 'true', + enabled: process.env.VSF_REDIS_ENABLED === 'true', invalidation: { - endpoint: process.env.REDIS_CACHE_INVALIDATE_URL, - key: process.env.REDIS_CACHE_INVALIDATE_KEY, + endpoint: process.env.VSF_REDIS_CACHE_INVALIDATE_URL, + key: process.env.VSF_REDIS_CACHE_INVALIDATE_KEY, handlers: [ '@vue-storefront/cache/defaultHandler', ], @@ -116,9 +116,9 @@ export default () => { { // docs: https://github.com/luin/ioredis/blob/master/API.md#new-redisport-host-options redis: { - keyPrefix: process.env.REDIS_KEY_PREFIX, - host: process.env.REDIS_HOST, - port: process.env.REDIS_PORT, + keyPrefix: process.env.VSF_REDIS_KEY_PREFIX, + host: process.env.VSF_REDIS_HOST, + port: process.env.VSF_REDIS_PORT, }, }, ], @@ -225,29 +225,29 @@ export default () => { }, }, image: { - provider: process.env.IMAGE_PROVIDER, + provider: process.env.VSF_IMAGE_PROVIDER, }, }; - if (process.env.IMAGE_PROVIDER === 'cloudinary') { + if (process.env.VSF_IMAGE_PROVIDER === 'cloudinary') { baseConfig.image.cloudinary = { - baseURL: process.env.IMAGE_PROVIDER_BASE_URL, + baseURL: process.env.VSF_IMAGE_PROVIDER_BASE_URL, }; } - if (process.env.RECAPTCHA_ENABLED === 'true') { + if (process.env.VSF_RECAPTCHA_ENABLED === 'true') { baseConfig.modules.push('@nuxtjs/recaptcha'); baseConfig.recaptcha = { - hideBadge: process.env.RECAPTCHA_HIDE_BADGE, // Hide badge element (v3 & v2 via size=invisible) - siteKey: process.env.RECAPTCHA_SITE_KEY, // Site key for requests - version: process.env.RECAPTCHA_VERSION, // Version 2 or 3 - size: process.env.RECATPCHA_SIZE, // Size: 'compact', 'normal', 'invisible' (v2) + hideBadge: process.env.VSF_RECAPTCHA_HIDE_BADGE, // Hide badge element (v3 & v2 via size=invisible) + siteKey: process.env.VSF_RECAPTCHA_SITE_KEY, // Site key for requests + version: process.env.VSF_RECAPTCHA_VERSION, // Version 2 or 3 + size: process.env.VSF_RECATPCHA_SIZE, // Size: 'compact', 'normal', 'invisible' (v2) }; baseConfig.publicRuntimeConfig = { ...baseConfig.publicRuntimeConfig, - isRecaptcha: process.env.RECAPTCHA_ENABLED === 'true', + isRecaptcha: process.env.VSF_RECAPTCHA_ENABLED === 'true', }; }