From a46d145d1a94c3a2f8a2aca65a8bef8cbfd87bb6 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Mon, 3 Mar 2025 17:11:09 -0800 Subject: [PATCH 01/63] WIP --- .../check_if_latest_release/action.yml | 3 +- .github/workflows/deploy_latest_release.yml | 60 ++++++++++++++++--- e2e/config.js | 2 + e2e/scripts/generate-project.js | 3 +- .../scripts/create-mobify-app.js | 31 ++++++++++ 5 files changed, 88 insertions(+), 11 deletions(-) diff --git a/.github/actions/check_if_latest_release/action.yml b/.github/actions/check_if_latest_release/action.yml index 10006447bb..2ec8cda31f 100644 --- a/.github/actions/check_if_latest_release/action.yml +++ b/.github/actions/check_if_latest_release/action.yml @@ -18,9 +18,10 @@ runs: if [ "$LATEST_TAG_NAME" == "$RELEASE_EVENT_TAG_NAME" ]; then echo "We are releasing the latest tag. Continuing deployment workflow." + echo "IS_LATEST_RELEASE=true" >> $GITHUB_ENV exit 0 else echo "We are not releasing the latest tag. Stopping deployment workflow." - exit 1 + exit 0 fi shell: bash \ No newline at end of file diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 4628951b4c..6a029fe487 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -20,7 +20,49 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} - deploy-bug-bounty: + # Re-enable this when the PR is ready to be merged + # deploy-bug-bounty: + # if: env.IS_LATEST_RELEASE == 'true' + # needs: check-latest-release + # runs-on: ubuntu-latest + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + + # - name: Setup node + # id: setup_node + # uses: actions/setup-node@v4 + # with: + # node-version: 22 + # cache: "npm" + + # - name: Install Monorepo Dependencies + # run: |- + # # Install node dependencies + # node ./scripts/gtime.js monorepo_install npm ci + + # - name: Generate Retail App Demo + # uses: ./.github/actions/e2e_generate_app + # with: + # PROJECT_KEY: "retail-react-app-bug-bounty" + + # - name: Create MRT credentials file + # uses: "./.github/actions/create_mrt" + # with: + # mobify_user: ${{ secrets.MOBIFY_STG_CLIENT_USER }} + # mobify_api_key: ${{ secrets.MOBIFY_STG_CLIENT_API_KEY }} + + # - name: Push Bundle to MRT (Bug Bounty) + # uses: "./.github/actions/push_to_mrt" + # with: + # CWD: "../generated-projects/retail-react-app-bug-bounty" + # TARGET: testing + # PROJECT: pwa-kit + # MESSAGE: "tag ${{ github.event.release.tag_name }}" + # FLAGS: --cloud-origin https://cloud-testing.mobify-staging.com -c ~/.mobify --wait + + deploy-demo-site: + if: env.IS_LATEST_RELEASE == 'true' needs: check-latest-release runs-on: ubuntu-latest steps: @@ -42,19 +84,19 @@ jobs: - name: Generate Retail App Demo uses: ./.github/actions/e2e_generate_app with: - PROJECT_KEY: "retail-react-app-bug-bounty" + PROJECT_KEY: "retail-react-app-demo-site" - name: Create MRT credentials file uses: "./.github/actions/create_mrt" with: - mobify_user: ${{ secrets.MOBIFY_STG_CLIENT_USER }} - mobify_api_key: ${{ secrets.MOBIFY_STG_CLIENT_API_KEY }} + mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} + mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} - - name: Push Bundle to MRT (Bug Bounty) + - name: Push Bundle to MRT (Demo Site) uses: "./.github/actions/push_to_mrt" with: - CWD: "../generated-projects/retail-react-app-bug-bounty" - TARGET: testing - PROJECT: pwa-kit + CWD: "../generated-projects/retail-react-app-demo-site" + TARGET: production + PROJECT: scaffold-pwa MESSAGE: "tag ${{ github.event.release.tag_name }}" - FLAGS: --cloud-origin https://cloud-testing.mobify-staging.com -c ~/.mobify --wait + FLAGS: --wait diff --git a/e2e/config.js b/e2e/config.js index 14f9be37df..78aad54683 100644 --- a/e2e/config.js +++ b/e2e/config.js @@ -102,10 +102,12 @@ module.exports = { ], "retail-app-private-client": [], "retail-react-app-bug-bounty": [], + "retail-react-app-demo-site": [], }, PRESET: { "retail-app-private-client": "retail-react-app-private-slas-client", "retail-react-app-bug-bounty": "retail-react-app-bug-bounty", + "retail-react-app-demo-site": "retail-react-app-demo-private" }, EXPECTED_GENERATED_ARTIFACTS: { "retail-app-demo": [ diff --git a/e2e/scripts/generate-project.js b/e2e/scripts/generate-project.js index 8f10792bbb..6405a4942c 100644 --- a/e2e/scripts/generate-project.js +++ b/e2e/scripts/generate-project.js @@ -63,7 +63,8 @@ program 'retail-app-ext', 'retail-app-no-ext', 'retail-app-private-client', - 'retail-react-app-bug-bounty' + 'retail-react-app-bug-bounty', + 'retail-react-app-demo-site' ] if (!validKeys.includes(value)) { throw new Error('Invalid project key.') diff --git a/packages/pwa-kit-create-app/scripts/create-mobify-app.js b/packages/pwa-kit-create-app/scripts/create-mobify-app.js index 8f331ada46..024041a1c2 100755 --- a/packages/pwa-kit-create-app/scripts/create-mobify-app.js +++ b/packages/pwa-kit-create-app/scripts/create-mobify-app.js @@ -270,6 +270,37 @@ const PRESETS = [ assets: ['translations'], private: false }, + { + id: 'retail-react-app-demo-private', + name: 'Retail React App Demo Private Client', + description: ` + Generates a project using the settings for a special B2C Commerce + instance that is used for demo purposes and sets it up with a private SLAS client. + + This has social and passwordless login enabled but requires a client secret to run. + `, + shortDescription: 'The Retail app with demo Commerce Cloud instance and a private SLAS client', + templateSource: { + type: TEMPLATE_SOURCE_NPM, + id: '@salesforce/retail-react-app' + }, + questions: [...EXTENSIBILITY_QUESTIONS, ...RETAIL_REACT_APP_QUESTIONS], + answers: { + ['project.extend']: true, + ['project.hybrid']: false, + ['project.name']: 'demo-storefront', + ['project.commerce.instanceUrl']: 'https://zzte-053.dx.commercecloud.salesforce.com', + ['project.commerce.clientId']: '', + ['project.commerce.siteId']: 'RefArch', + ['project.commerce.organizationId']: 'f_ecom_zzte_053', + ['project.commerce.shortCode']: 'kv7kzm78', + ['project.commerce.isSlasPrivate']: false, + ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1', + ['project.einstein.siteId']: 'aaij-MobileFirst' + }, + assets: ['translations'], + private: true + }, { id: 'retail-react-app-test-project', name: 'Retail React App Test Project', From 474b0a442fd7ea2430af52e08b34ddf38ce9da18 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 14:21:37 -0800 Subject: [PATCH 02/63] Use zzrf-001 stg --- .github/workflows/deploy_latest_release.yml | 5 +++-- packages/pwa-kit-create-app/scripts/create-mobify-app.js | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 6a029fe487..b458b602e2 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -3,7 +3,7 @@ on: # For testing - to be removed push: branches: - - 'mrt-test-ci-deploy' + - 'deploy-demo-env-on-release' # Run this workflow when a new Github release is published release: types: [released] @@ -92,11 +92,12 @@ jobs: mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} + #TODO - change target to production once testing is done - name: Push Bundle to MRT (Demo Site) uses: "./.github/actions/push_to_mrt" with: CWD: "../generated-projects/retail-react-app-demo-site" - TARGET: production + TARGET: staging PROJECT: scaffold-pwa MESSAGE: "tag ${{ github.event.release.tag_name }}" FLAGS: --wait diff --git a/packages/pwa-kit-create-app/scripts/create-mobify-app.js b/packages/pwa-kit-create-app/scripts/create-mobify-app.js index 024041a1c2..507e5176a4 100755 --- a/packages/pwa-kit-create-app/scripts/create-mobify-app.js +++ b/packages/pwa-kit-create-app/scripts/create-mobify-app.js @@ -289,12 +289,12 @@ const PRESETS = [ ['project.extend']: true, ['project.hybrid']: false, ['project.name']: 'demo-storefront', - ['project.commerce.instanceUrl']: 'https://zzte-053.dx.commercecloud.salesforce.com', - ['project.commerce.clientId']: '', + ['project.commerce.instanceUrl']: 'https://zzrf-001.dx.commercecloud.salesforce.com', + ['project.commerce.clientId']: '083859f2-5d93-4209-b999-a112266d63a0', ['project.commerce.siteId']: 'RefArch', - ['project.commerce.organizationId']: 'f_ecom_zzte_053', + ['project.commerce.organizationId']: 'f_ecom_zzrf_001', ['project.commerce.shortCode']: 'kv7kzm78', - ['project.commerce.isSlasPrivate']: false, + ['project.commerce.isSlasPrivate']: true, ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1', ['project.einstein.siteId']: 'aaij-MobileFirst' }, From f9fe4cd95f1e8c4980309f62bb10cfdf33a3db81 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 14:48:31 -0800 Subject: [PATCH 03/63] Set output --- .github/actions/check_if_latest_release/action.yml | 2 +- .github/workflows/deploy_latest_release.yml | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/actions/check_if_latest_release/action.yml b/.github/actions/check_if_latest_release/action.yml index 2ec8cda31f..890c14e4da 100644 --- a/.github/actions/check_if_latest_release/action.yml +++ b/.github/actions/check_if_latest_release/action.yml @@ -18,7 +18,7 @@ runs: if [ "$LATEST_TAG_NAME" == "$RELEASE_EVENT_TAG_NAME" ]; then echo "We are releasing the latest tag. Continuing deployment workflow." - echo "IS_LATEST_RELEASE=true" >> $GITHUB_ENV + echo "IS_LATEST_RELEASE=true" >> $GITHUB_OUTPUT exit 0 else echo "We are not releasing the latest tag. Stopping deployment workflow." diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index b458b602e2..818d857907 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -11,20 +11,23 @@ on: jobs: check-latest-release: runs-on: ubuntu-latest + outputs: + IS_LATEST_RELEASE: ${{ steps.checkRelease.outputs.IS_LATEST_RELEASE }} steps: - name: Checkout uses: actions/checkout@v4 - name: Check if latest release + id: checkRelease uses: ./.github/actions/check_if_latest_release with: token: ${{ secrets.GITHUB_TOKEN }} # Re-enable this when the PR is ready to be merged # deploy-bug-bounty: - # if: env.IS_LATEST_RELEASE == 'true' # needs: check-latest-release # runs-on: ubuntu-latest + # if: ${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE}} == 'true' # steps: # - name: Checkout # uses: actions/checkout@v4 @@ -62,9 +65,9 @@ jobs: # FLAGS: --cloud-origin https://cloud-testing.mobify-staging.com -c ~/.mobify --wait deploy-demo-site: - if: env.IS_LATEST_RELEASE == 'true' needs: check-latest-release runs-on: ubuntu-latest + if: ${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE}} == 'true' steps: - name: Checkout uses: actions/checkout@v4 From efd0610b6aec58e6fa9ed84222cd45e856924fb7 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 15:00:41 -0800 Subject: [PATCH 04/63] test --- .../check_if_latest_release/action.yml | 1 + .github/workflows/deploy_latest_release.yml | 64 ++++++++++--------- 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/.github/actions/check_if_latest_release/action.yml b/.github/actions/check_if_latest_release/action.yml index 890c14e4da..a4e6625c55 100644 --- a/.github/actions/check_if_latest_release/action.yml +++ b/.github/actions/check_if_latest_release/action.yml @@ -22,6 +22,7 @@ runs: exit 0 else echo "We are not releasing the latest tag. Stopping deployment workflow." + echo "IS_LATEST_RELEASE=false" >> $GITHUB_OUTPUT exit 0 fi shell: bash \ No newline at end of file diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 818d857907..505434b4a7 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -69,38 +69,42 @@ jobs: runs-on: ubuntu-latest if: ${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE}} == 'true' steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Did we trigger? + run: |- + echo "Job started" - - name: Setup node - id: setup_node - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: "npm" + # - name: Checkout + # uses: actions/checkout@v4 - - name: Install Monorepo Dependencies - run: |- - # Install node dependencies - node ./scripts/gtime.js monorepo_install npm ci + # - name: Setup node + # id: setup_node + # uses: actions/setup-node@v4 + # with: + # node-version: 22 + # cache: "npm" - - name: Generate Retail App Demo - uses: ./.github/actions/e2e_generate_app - with: - PROJECT_KEY: "retail-react-app-demo-site" + # - name: Install Monorepo Dependencies + # run: |- + # # Install node dependencies + # node ./scripts/gtime.js monorepo_install npm ci - - name: Create MRT credentials file - uses: "./.github/actions/create_mrt" - with: - mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} - mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} + # - name: Generate Retail App Demo + # uses: ./.github/actions/e2e_generate_app + # with: + # PROJECT_KEY: "retail-react-app-demo-site" - #TODO - change target to production once testing is done - - name: Push Bundle to MRT (Demo Site) - uses: "./.github/actions/push_to_mrt" - with: - CWD: "../generated-projects/retail-react-app-demo-site" - TARGET: staging - PROJECT: scaffold-pwa - MESSAGE: "tag ${{ github.event.release.tag_name }}" - FLAGS: --wait + # - name: Create MRT credentials file + # uses: "./.github/actions/create_mrt" + # with: + # mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} + # mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} + + # #TODO - change target to production once testing is done + # - name: Push Bundle to MRT (Demo Site) + # uses: "./.github/actions/push_to_mrt" + # with: + # CWD: "../generated-projects/retail-react-app-demo-site" + # TARGET: staging + # PROJECT: scaffold-pwa + # MESSAGE: "tag ${{ github.event.release.tag_name }}" + # FLAGS: --wait From cb39e571c7cf765220b4400785340df9f1832d08 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 15:11:26 -0800 Subject: [PATCH 05/63] test --- .github/workflows/deploy_latest_release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 505434b4a7..a3579dcbab 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -72,6 +72,7 @@ jobs: - name: Did we trigger? run: |- echo "Job started" + echo "IS_LATEST_RELEASE: ${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE}}" # - name: Checkout # uses: actions/checkout@v4 From f8208b814cafadef4c825b28475916281f2afa4a Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 15:17:45 -0800 Subject: [PATCH 06/63] test --- .github/actions/check_if_latest_release/action.yml | 4 ++-- .github/workflows/deploy_latest_release.yml | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/actions/check_if_latest_release/action.yml b/.github/actions/check_if_latest_release/action.yml index a4e6625c55..db325e8498 100644 --- a/.github/actions/check_if_latest_release/action.yml +++ b/.github/actions/check_if_latest_release/action.yml @@ -18,11 +18,11 @@ runs: if [ "$LATEST_TAG_NAME" == "$RELEASE_EVENT_TAG_NAME" ]; then echo "We are releasing the latest tag. Continuing deployment workflow." - echo "IS_LATEST_RELEASE=true" >> $GITHUB_OUTPUT + echo "IS_LATEST_RELEASE=true" >> $GITHUB_ENV exit 0 else echo "We are not releasing the latest tag. Stopping deployment workflow." - echo "IS_LATEST_RELEASE=false" >> $GITHUB_OUTPUT + echo "IS_LATEST_RELEASE=false" >> $GITHUB_ENV exit 0 fi shell: bash \ No newline at end of file diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index a3579dcbab..6a50f259c9 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -18,10 +18,17 @@ jobs: uses: actions/checkout@v4 - name: Check if latest release - id: checkRelease uses: ./.github/actions/check_if_latest_release with: token: ${{ secrets.GITHUB_TOKEN }} + + - name: Update Github Outputs + id: checkRelease + run: |- + echo "IS_LATEST_RELEASE=${{ env.IS_LATEST_RELEASE }}" >> "$GITHUB_OUTPUT" + echo ${{ env.IS_LATEST_RELEASE }} + echo ${{ steps.checkRelease.outputs.test }} + # Re-enable this when the PR is ready to be merged # deploy-bug-bounty: From e4966437ed09ec21b535580a5ede6863366e070e Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 15:43:18 -0800 Subject: [PATCH 07/63] test --- .../check_if_latest_release/action.yml | 6 +- .github/workflows/deploy_latest_release.yml | 86 ++++++++++--------- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/.github/actions/check_if_latest_release/action.yml b/.github/actions/check_if_latest_release/action.yml index db325e8498..067976f3a5 100644 --- a/.github/actions/check_if_latest_release/action.yml +++ b/.github/actions/check_if_latest_release/action.yml @@ -17,12 +17,10 @@ runs: echo "Release event tag: $RELEASE_EVENT_TAG_NAME" if [ "$LATEST_TAG_NAME" == "$RELEASE_EVENT_TAG_NAME" ]; then - echo "We are releasing the latest tag. Continuing deployment workflow." + echo "We are releasing the latest tag." echo "IS_LATEST_RELEASE=true" >> $GITHUB_ENV - exit 0 else - echo "We are not releasing the latest tag. Stopping deployment workflow." + echo "We are not releasing the latest tag." echo "IS_LATEST_RELEASE=false" >> $GITHUB_ENV - exit 0 fi shell: bash \ No newline at end of file diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 6a50f259c9..4f618c0fcc 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -26,8 +26,9 @@ jobs: id: checkRelease run: |- echo "IS_LATEST_RELEASE=${{ env.IS_LATEST_RELEASE }}" >> "$GITHUB_OUTPUT" - echo ${{ env.IS_LATEST_RELEASE }} - echo ${{ steps.checkRelease.outputs.test }} + echo "Env: ${{ env.IS_LATEST_RELEASE }}" + echo "Var: $IS_LATEST_RELEASE" + echo "Output: ${{ steps.checkRelease.outputs.test }}" # Re-enable this when the PR is ready to be merged @@ -74,45 +75,46 @@ jobs: deploy-demo-site: needs: check-latest-release runs-on: ubuntu-latest - if: ${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE}} == 'true' steps: - - name: Did we trigger? + - name: Continue deployment? run: |- - echo "Job started" - echo "IS_LATEST_RELEASE: ${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE}}" - - # - name: Checkout - # uses: actions/checkout@v4 - - # - name: Setup node - # id: setup_node - # uses: actions/setup-node@v4 - # with: - # node-version: 22 - # cache: "npm" - - # - name: Install Monorepo Dependencies - # run: |- - # # Install node dependencies - # node ./scripts/gtime.js monorepo_install npm ci - - # - name: Generate Retail App Demo - # uses: ./.github/actions/e2e_generate_app - # with: - # PROJECT_KEY: "retail-react-app-demo-site" - - # - name: Create MRT credentials file - # uses: "./.github/actions/create_mrt" - # with: - # mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} - # mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} - - # #TODO - change target to production once testing is done - # - name: Push Bundle to MRT (Demo Site) - # uses: "./.github/actions/push_to_mrt" - # with: - # CWD: "../generated-projects/retail-react-app-demo-site" - # TARGET: staging - # PROJECT: scaffold-pwa - # MESSAGE: "tag ${{ github.event.release.tag_name }}" - # FLAGS: --wait + if [${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE }} != 'true'] + echo "Deploy is not for the latest release. Stopping deployment" + exit 0 + fi + + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup node + id: setup_node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: "npm" + + - name: Install Monorepo Dependencies + run: |- + # Install node dependencies + node ./scripts/gtime.js monorepo_install npm ci + + - name: Generate Retail App Demo + uses: ./.github/actions/e2e_generate_app + with: + PROJECT_KEY: "retail-react-app-demo-site" + + - name: Create MRT credentials file + uses: "./.github/actions/create_mrt" + with: + mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} + mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} + + #TODO - change target to production once testing is done + - name: Push Bundle to MRT (Demo Site) + uses: "./.github/actions/push_to_mrt" + with: + CWD: "../generated-projects/retail-react-app-demo-site" + TARGET: staging + PROJECT: scaffold-pwa + MESSAGE: "tag ${{ github.event.release.tag_name }}" + FLAGS: --wait From 97b1fa7a462f2cef774e63d56bfd8a99eea792bc Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 15:44:56 -0800 Subject: [PATCH 08/63] test --- .github/workflows/deploy_latest_release.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 4f618c0fcc..e5c2aa25fa 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -26,9 +26,6 @@ jobs: id: checkRelease run: |- echo "IS_LATEST_RELEASE=${{ env.IS_LATEST_RELEASE }}" >> "$GITHUB_OUTPUT" - echo "Env: ${{ env.IS_LATEST_RELEASE }}" - echo "Var: $IS_LATEST_RELEASE" - echo "Output: ${{ steps.checkRelease.outputs.test }}" # Re-enable this when the PR is ready to be merged @@ -78,7 +75,7 @@ jobs: steps: - name: Continue deployment? run: |- - if [${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE }} != 'true'] + if [${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE }} != 'true']; then echo "Deploy is not for the latest release. Stopping deployment" exit 0 fi From d662a3f50a1d99290d92b8246389eda089ae0e9a Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 15:50:26 -0800 Subject: [PATCH 09/63] test --- .github/workflows/deploy_latest_release.yml | 79 ++++++++++----------- 1 file changed, 39 insertions(+), 40 deletions(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index e5c2aa25fa..13cecce87f 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -74,44 +74,43 @@ jobs: runs-on: ubuntu-latest steps: - name: Continue deployment? + if: ${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE }} != 'true' run: |- - if [${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE }} != 'true']; then - echo "Deploy is not for the latest release. Stopping deployment" - exit 0 - fi - - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup node - id: setup_node - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: "npm" - - - name: Install Monorepo Dependencies - run: |- - # Install node dependencies - node ./scripts/gtime.js monorepo_install npm ci - - - name: Generate Retail App Demo - uses: ./.github/actions/e2e_generate_app - with: - PROJECT_KEY: "retail-react-app-demo-site" - - - name: Create MRT credentials file - uses: "./.github/actions/create_mrt" - with: - mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} - mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} - - #TODO - change target to production once testing is done - - name: Push Bundle to MRT (Demo Site) - uses: "./.github/actions/push_to_mrt" - with: - CWD: "../generated-projects/retail-react-app-demo-site" - TARGET: staging - PROJECT: scaffold-pwa - MESSAGE: "tag ${{ github.event.release.tag_name }}" - FLAGS: --wait + echo "Deploy is not for the latest release. Stopping deployment" + exit 0 + + # - name: Checkout + # uses: actions/checkout@v4 + + # - name: Setup node + # id: setup_node + # uses: actions/setup-node@v4 + # with: + # node-version: 22 + # cache: "npm" + + # - name: Install Monorepo Dependencies + # run: |- + # # Install node dependencies + # node ./scripts/gtime.js monorepo_install npm ci + + # - name: Generate Retail App Demo + # uses: ./.github/actions/e2e_generate_app + # with: + # PROJECT_KEY: "retail-react-app-demo-site" + + # - name: Create MRT credentials file + # uses: "./.github/actions/create_mrt" + # with: + # mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} + # mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} + + # #TODO - change target to production once testing is done + # - name: Push Bundle to MRT (Demo Site) + # uses: "./.github/actions/push_to_mrt" + # with: + # CWD: "../generated-projects/retail-react-app-demo-site" + # TARGET: staging + # PROJECT: scaffold-pwa + # MESSAGE: "tag ${{ github.event.release.tag_name }}" + # FLAGS: --wait From f0deacb331cbb49134dc909aa13369bc482e47bd Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 15:52:07 -0800 Subject: [PATCH 10/63] test --- .github/workflows/deploy_latest_release.yml | 78 +++++++++++---------- 1 file changed, 42 insertions(+), 36 deletions(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 13cecce87f..3c041d27ad 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -34,6 +34,12 @@ jobs: # runs-on: ubuntu-latest # if: ${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE}} == 'true' # steps: + # - name: Continue deployment? + # if: ${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE }} != 'true' + # run: |- + # echo "Deploy is not for the latest release. Stopping deployment" + # exit 0 + # - name: Checkout # uses: actions/checkout@v4 @@ -74,43 +80,43 @@ jobs: runs-on: ubuntu-latest steps: - name: Continue deployment? - if: ${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE }} != 'true' + if: ${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE }} == 'true' run: |- echo "Deploy is not for the latest release. Stopping deployment" exit 0 - # - name: Checkout - # uses: actions/checkout@v4 - - # - name: Setup node - # id: setup_node - # uses: actions/setup-node@v4 - # with: - # node-version: 22 - # cache: "npm" - - # - name: Install Monorepo Dependencies - # run: |- - # # Install node dependencies - # node ./scripts/gtime.js monorepo_install npm ci - - # - name: Generate Retail App Demo - # uses: ./.github/actions/e2e_generate_app - # with: - # PROJECT_KEY: "retail-react-app-demo-site" - - # - name: Create MRT credentials file - # uses: "./.github/actions/create_mrt" - # with: - # mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} - # mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} - - # #TODO - change target to production once testing is done - # - name: Push Bundle to MRT (Demo Site) - # uses: "./.github/actions/push_to_mrt" - # with: - # CWD: "../generated-projects/retail-react-app-demo-site" - # TARGET: staging - # PROJECT: scaffold-pwa - # MESSAGE: "tag ${{ github.event.release.tag_name }}" - # FLAGS: --wait + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup node + id: setup_node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: "npm" + + - name: Install Monorepo Dependencies + run: |- + # Install node dependencies + node ./scripts/gtime.js monorepo_install npm ci + + - name: Generate Retail App Demo + uses: ./.github/actions/e2e_generate_app + with: + PROJECT_KEY: "retail-react-app-demo-site" + + - name: Create MRT credentials file + uses: "./.github/actions/create_mrt" + with: + mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} + mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} + + #TODO - change target to production once testing is done + - name: Push Bundle to MRT (Demo Site) + uses: "./.github/actions/push_to_mrt" + with: + CWD: "../generated-projects/retail-react-app-demo-site" + TARGET: staging + PROJECT: scaffold-pwa + MESSAGE: "tag ${{ github.event.release.tag_name }}" + FLAGS: --wait From d4f9b803259b63cf7a281db4b1f0d328a3855f1c Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 16:00:58 -0800 Subject: [PATCH 11/63] test --- .github/workflows/deploy_latest_release.yml | 65 +++++++++++---------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 3c041d27ad..66230a960e 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -82,41 +82,42 @@ jobs: - name: Continue deployment? if: ${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE }} == 'true' run: |- + echo "Input: ${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE }}" echo "Deploy is not for the latest release. Stopping deployment" exit 0 - name: Checkout uses: actions/checkout@v4 - - name: Setup node - id: setup_node - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: "npm" - - - name: Install Monorepo Dependencies - run: |- - # Install node dependencies - node ./scripts/gtime.js monorepo_install npm ci - - - name: Generate Retail App Demo - uses: ./.github/actions/e2e_generate_app - with: - PROJECT_KEY: "retail-react-app-demo-site" - - - name: Create MRT credentials file - uses: "./.github/actions/create_mrt" - with: - mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} - mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} - - #TODO - change target to production once testing is done - - name: Push Bundle to MRT (Demo Site) - uses: "./.github/actions/push_to_mrt" - with: - CWD: "../generated-projects/retail-react-app-demo-site" - TARGET: staging - PROJECT: scaffold-pwa - MESSAGE: "tag ${{ github.event.release.tag_name }}" - FLAGS: --wait + # - name: Setup node + # id: setup_node + # uses: actions/setup-node@v4 + # with: + # node-version: 22 + # cache: "npm" + + # - name: Install Monorepo Dependencies + # run: |- + # # Install node dependencies + # node ./scripts/gtime.js monorepo_install npm ci + + # - name: Generate Retail App Demo + # uses: ./.github/actions/e2e_generate_app + # with: + # PROJECT_KEY: "retail-react-app-demo-site" + + # - name: Create MRT credentials file + # uses: "./.github/actions/create_mrt" + # with: + # mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} + # mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} + + # #TODO - change target to production once testing is done + # - name: Push Bundle to MRT (Demo Site) + # uses: "./.github/actions/push_to_mrt" + # with: + # CWD: "../generated-projects/retail-react-app-demo-site" + # TARGET: staging + # PROJECT: scaffold-pwa + # MESSAGE: "tag ${{ github.event.release.tag_name }}" + # FLAGS: --wait From 4d7b89d6eca42c8c40420bfc83834b9633481273 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 16:02:59 -0800 Subject: [PATCH 12/63] test --- .github/workflows/deploy_latest_release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 66230a960e..82ec44ffb2 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -80,11 +80,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Continue deployment? - if: ${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE }} == 'true' + if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true' run: |- - echo "Input: ${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE }}" - echo "Deploy is not for the latest release. Stopping deployment" - exit 0 + echo "Input: ${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE }}" + echo "Deploy is not for the latest release. Stopping deployment" + exit 0 - name: Checkout uses: actions/checkout@v4 From 1c63829230e45ba352ea5b2a6560ee22b50fc013 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 16:04:00 -0800 Subject: [PATCH 13/63] test --- .github/workflows/deploy_latest_release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 82ec44ffb2..f69afbd0cc 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -80,9 +80,8 @@ jobs: runs-on: ubuntu-latest steps: - name: Continue deployment? - if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true' + if: needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true' run: |- - echo "Input: ${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE }}" echo "Deploy is not for the latest release. Stopping deployment" exit 0 From ccd15e6e0811e7157ff926bc5a20b74720870ff9 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 16:08:09 -0800 Subject: [PATCH 14/63] test --- .github/workflows/deploy_latest_release.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index f69afbd0cc..d7ecb20af8 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -78,13 +78,8 @@ jobs: deploy-demo-site: needs: check-latest-release runs-on: ubuntu-latest + if: needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true' steps: - - name: Continue deployment? - if: needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true' - run: |- - echo "Deploy is not for the latest release. Stopping deployment" - exit 0 - - name: Checkout uses: actions/checkout@v4 From 3cac50c07ec649276384e7c471efa9cad8062f20 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 16:08:50 -0800 Subject: [PATCH 15/63] test --- .github/workflows/deploy_latest_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index d7ecb20af8..d27bfea7b7 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -78,7 +78,7 @@ jobs: deploy-demo-site: needs: check-latest-release runs-on: ubuntu-latest - if: needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true' + if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true' steps: - name: Checkout uses: actions/checkout@v4 From 4edc95f9049d8666f058f6df8e21ea4e19386b71 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 16:52:32 -0800 Subject: [PATCH 16/63] Add logging --- .github/workflows/deploy_latest_release.yml | 68 +++++++++---------- .../scripts/create-mobify-app.js | 7 +- 2 files changed, 38 insertions(+), 37 deletions(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index d27bfea7b7..66f9b6ff4c 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -26,20 +26,16 @@ jobs: id: checkRelease run: |- echo "IS_LATEST_RELEASE=${{ env.IS_LATEST_RELEASE }}" >> "$GITHUB_OUTPUT" - + if: ${{ env.IS_LATEST_RELEASEE }} != 'true' + # run: |- + # echo "Deploy is not for the latest release. Stopping deployment" # Re-enable this when the PR is ready to be merged # deploy-bug-bounty: # needs: check-latest-release # runs-on: ubuntu-latest - # if: ${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE}} == 'true' + # if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true' # steps: - # - name: Continue deployment? - # if: ${{ needs.check-latest-release.outputs.IS_LATEST_RELEASE }} != 'true' - # run: |- - # echo "Deploy is not for the latest release. Stopping deployment" - # exit 0 - # - name: Checkout # uses: actions/checkout@v4 @@ -83,35 +79,35 @@ jobs: - name: Checkout uses: actions/checkout@v4 - # - name: Setup node - # id: setup_node - # uses: actions/setup-node@v4 - # with: - # node-version: 22 - # cache: "npm" + - name: Setup node + id: setup_node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: "npm" - # - name: Install Monorepo Dependencies - # run: |- - # # Install node dependencies - # node ./scripts/gtime.js monorepo_install npm ci + - name: Install Monorepo Dependencies + run: |- + # Install node dependencies + node ./scripts/gtime.js monorepo_install npm ci - # - name: Generate Retail App Demo - # uses: ./.github/actions/e2e_generate_app - # with: - # PROJECT_KEY: "retail-react-app-demo-site" + - name: Generate Retail App Demo + uses: ./.github/actions/e2e_generate_app + with: + PROJECT_KEY: "retail-react-app-demo-site" - # - name: Create MRT credentials file - # uses: "./.github/actions/create_mrt" - # with: - # mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} - # mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} + - name: Create MRT credentials file + uses: "./.github/actions/create_mrt" + with: + mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} + mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} - # #TODO - change target to production once testing is done - # - name: Push Bundle to MRT (Demo Site) - # uses: "./.github/actions/push_to_mrt" - # with: - # CWD: "../generated-projects/retail-react-app-demo-site" - # TARGET: staging - # PROJECT: scaffold-pwa - # MESSAGE: "tag ${{ github.event.release.tag_name }}" - # FLAGS: --wait + #TODO - change target to production once testing is done + - name: Push Bundle to MRT (Demo Site) + uses: "./.github/actions/push_to_mrt" + with: + CWD: "../generated-projects/retail-react-app-demo-site" + TARGET: staging + PROJECT: scaffold-pwa + MESSAGE: "tag ${{ github.event.release.tag_name }}" + FLAGS: --wait diff --git a/packages/pwa-kit-create-app/scripts/create-mobify-app.js b/packages/pwa-kit-create-app/scripts/create-mobify-app.js index 507e5176a4..56fbe2de37 100755 --- a/packages/pwa-kit-create-app/scripts/create-mobify-app.js +++ b/packages/pwa-kit-create-app/scripts/create-mobify-app.js @@ -291,7 +291,7 @@ const PRESETS = [ ['project.name']: 'demo-storefront', ['project.commerce.instanceUrl']: 'https://zzrf-001.dx.commercecloud.salesforce.com', ['project.commerce.clientId']: '083859f2-5d93-4209-b999-a112266d63a0', - ['project.commerce.siteId']: 'RefArch', + ['project.commerce.siteId']: 'RefArchGlobal', ['project.commerce.organizationId']: 'f_ecom_zzrf_001', ['project.commerce.shortCode']: 'kv7kzm78', ['project.commerce.isSlasPrivate']: true, @@ -840,6 +840,11 @@ const main = async (opts) => { // Add the preset to the context. context.preset = selectedPreset + // If using the preset, output the preset name + if (presetId) { + console.log(`Using preset "${selectedPreset.name}"`) + } + if (!OUTPUT_DIR_FLAG_ACTIVE) { outputDir = p.join(process.cwd(), selectedPreset.id) } From 70963d7ee43e3e5546d4dd7f3f337a8e056a685f Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 16:53:46 -0800 Subject: [PATCH 17/63] fix conditional --- .github/workflows/deploy_latest_release.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 66f9b6ff4c..f9fd135a46 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -26,9 +26,10 @@ jobs: id: checkRelease run: |- echo "IS_LATEST_RELEASE=${{ env.IS_LATEST_RELEASE }}" >> "$GITHUB_OUTPUT" - if: ${{ env.IS_LATEST_RELEASEE }} != 'true' - # run: |- - # echo "Deploy is not for the latest release. Stopping deployment" + if: ${{ env.IS_LATEST_RELEASE }} != 'true'; then + run: |- + echo "Deploy is not for the latest release. Stopping deployment" + fi # Re-enable this when the PR is ready to be merged # deploy-bug-bounty: From fac54ed60092b2134e5c9a18f5192152ab7764ba Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 16:54:33 -0800 Subject: [PATCH 18/63] Add brackets --- .github/workflows/deploy_latest_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index f9fd135a46..bdd6f26e7f 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -26,7 +26,7 @@ jobs: id: checkRelease run: |- echo "IS_LATEST_RELEASE=${{ env.IS_LATEST_RELEASE }}" >> "$GITHUB_OUTPUT" - if: ${{ env.IS_LATEST_RELEASE }} != 'true'; then + if: [${{ env.IS_LATEST_RELEASE }} != 'true']; then run: |- echo "Deploy is not for the latest release. Stopping deployment" fi From 7d69a87a2b3465f35f05aa057158ea515dd5fdb4 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 16:55:40 -0800 Subject: [PATCH 19/63] fix --- .github/workflows/deploy_latest_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index bdd6f26e7f..32c0c93343 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -26,7 +26,7 @@ jobs: id: checkRelease run: |- echo "IS_LATEST_RELEASE=${{ env.IS_LATEST_RELEASE }}" >> "$GITHUB_OUTPUT" - if: [${{ env.IS_LATEST_RELEASE }} != 'true']; then + if [${{ env.IS_LATEST_RELEASE }} != 'true']; then run: |- echo "Deploy is not for the latest release. Stopping deployment" fi From ee90db9a101604dff5dd5e46d86e111d1fbe02d7 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 16:56:38 -0800 Subject: [PATCH 20/63] fix --- .github/workflows/deploy_latest_release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 32c0c93343..4bae43d0d2 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -27,7 +27,6 @@ jobs: run: |- echo "IS_LATEST_RELEASE=${{ env.IS_LATEST_RELEASE }}" >> "$GITHUB_OUTPUT" if [${{ env.IS_LATEST_RELEASE }} != 'true']; then - run: |- echo "Deploy is not for the latest release. Stopping deployment" fi From 6c85fe226ac9b04769f214827debfb9df8829964 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 16:58:17 -0800 Subject: [PATCH 21/63] adjust --- .github/workflows/deploy_latest_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 4bae43d0d2..26fabc6e74 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -26,7 +26,7 @@ jobs: id: checkRelease run: |- echo "IS_LATEST_RELEASE=${{ env.IS_LATEST_RELEASE }}" >> "$GITHUB_OUTPUT" - if [${{ env.IS_LATEST_RELEASE }} != 'true']; then + if [ $IS_LATEST_RELEASE != 'true']; then echo "Deploy is not for the latest release. Stopping deployment" fi From 70556ecf3bde2a4f417d73892f120e536e110751 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 17:00:53 -0800 Subject: [PATCH 22/63] test --- .github/workflows/deploy_latest_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 26fabc6e74..7b74852e8b 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -26,7 +26,7 @@ jobs: id: checkRelease run: |- echo "IS_LATEST_RELEASE=${{ env.IS_LATEST_RELEASE }}" >> "$GITHUB_OUTPUT" - if [ $IS_LATEST_RELEASE != 'true']; then + if [ '${{ env.IS_LATEST_RELEASE }}' != 'true']; then echo "Deploy is not for the latest release. Stopping deployment" fi From 1add78b8dbbc4c2021b06825baab285243bdf91e Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 17:03:41 -0800 Subject: [PATCH 23/63] test --- .github/workflows/deploy_latest_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 7b74852e8b..63432f537f 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -26,7 +26,7 @@ jobs: id: checkRelease run: |- echo "IS_LATEST_RELEASE=${{ env.IS_LATEST_RELEASE }}" >> "$GITHUB_OUTPUT" - if [ '${{ env.IS_LATEST_RELEASE }}' != 'true']; then + if [ "${{ env.IS_LATEST_RELEASE }}" != "true"]; then echo "Deploy is not for the latest release. Stopping deployment" fi From 17b44401373abd2f9dd64b6231b0f585fb43fb91 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 17:06:31 -0800 Subject: [PATCH 24/63] test --- .github/workflows/deploy_latest_release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 63432f537f..7d3e81a30d 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -25,8 +25,9 @@ jobs: - name: Update Github Outputs id: checkRelease run: |- + IS_LATEST_RELEASE=$(echo ${{ env.IS_LATEST_RELEASE }}) echo "IS_LATEST_RELEASE=${{ env.IS_LATEST_RELEASE }}" >> "$GITHUB_OUTPUT" - if [ "${{ env.IS_LATEST_RELEASE }}" != "true"]; then + if [ $IS_LATEST_RELEASE != "true" ]; then echo "Deploy is not for the latest release. Stopping deployment" fi From 424d1cbb560d96eef77101e68fa8b635c4ca1cc2 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 4 Mar 2025 17:08:10 -0800 Subject: [PATCH 25/63] flip condition for testing --- .github/workflows/deploy_latest_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 7d3e81a30d..83d9dc490c 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -75,7 +75,7 @@ jobs: deploy-demo-site: needs: check-latest-release runs-on: ubuntu-latest - if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true' + if: needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true' steps: - name: Checkout uses: actions/checkout@v4 From 137cc6fbb3e26aedf22ee44a2c0910c9e0a60498 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Wed, 5 Mar 2025 13:02:01 -0800 Subject: [PATCH 26/63] Update handlebars for RefArchGlobal locales --- .../assets/bootstrap/js/config/sites.js.hbs | 64 +++++++++++++++++-- .../retail-react-app/config/sites.js.hbs | 50 +++++++++++++++ .../scripts/create-mobify-app.js | 4 ++ 3 files changed, 111 insertions(+), 7 deletions(-) diff --git a/packages/pwa-kit-create-app/assets/bootstrap/js/config/sites.js.hbs b/packages/pwa-kit-create-app/assets/bootstrap/js/config/sites.js.hbs index eea02f1045..d83f84fb13 100644 --- a/packages/pwa-kit-create-app/assets/bootstrap/js/config/sites.js.hbs +++ b/packages/pwa-kit-create-app/assets/bootstrap/js/config/sites.js.hbs @@ -10,17 +10,67 @@ module.exports = [ { id: '{{answers.project.commerce.siteId}}', + {{#ifEquals answers.project.commerce.siteId "RefArchGlobal" }} l10n: { - supportedCurrencies: ['USD'], - defaultCurrency: 'USD', - defaultLocale: 'en-US', + supportedCurrencies: ['GBP', 'EUR', 'CNY', 'JPY'], + defaultCurrency: 'GBP', supportedLocales: [ { - id: 'en-US', - // alias: 'us', - preferredCurrency: 'USD' + id: 'de-DE', + preferredCurrency: 'EUR' + }, + { + id: 'en-GB', + preferredCurrency: 'GBP' + }, + { + id: 'es-MX', + preferredCurrency: 'MXN' + }, + { + id: 'fr-FR', + preferredCurrency: 'EUR' + }, + { + id: 'it-IT', + preferredCurrency: 'EUR' + }, + { + id: 'ja-JP', + preferredCurrency: 'JPY' + }, + { + id: 'ko-KR', + preferredCurrency: 'KRW' + }, + { + id: 'pt-BR', + preferredCurrency: 'BRL' + }, + { + id: 'zh-CN', + preferredCurrency: 'CNY' + }, + { + id: 'zh-TW', + preferredCurrency: 'TWD' } - ] + ], + defaultLocale: 'en-GB' } + {{else}} + l10n: { + supportedCurrencies: ['USD'], + defaultCurrency: 'USD', + defaultLocale: 'en-US', + supportedLocales: [ + { + id: 'en-US', + // alias: 'us', + preferredCurrency: 'USD' + } + ] + } + {{/ifEquals}} } ] diff --git a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/sites.js.hbs b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/sites.js.hbs index eea02f1045..f14d0e5b31 100644 --- a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/sites.js.hbs +++ b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/sites.js.hbs @@ -10,6 +10,55 @@ module.exports = [ { id: '{{answers.project.commerce.siteId}}', + {{#ifEquals answers.project.commerce.siteId "RefArchGlobal" }} + l10n: { + supportedCurrencies: ['GBP', 'EUR', 'CNY', 'JPY'], + defaultCurrency: 'GBP', + supportedLocales: [ + { + id: 'de-DE', + preferredCurrency: 'EUR' + }, + { + id: 'en-GB', + preferredCurrency: 'GBP' + }, + { + id: 'es-MX', + preferredCurrency: 'MXN' + }, + { + id: 'fr-FR', + preferredCurrency: 'EUR' + }, + { + id: 'it-IT', + preferredCurrency: 'EUR' + }, + { + id: 'ja-JP', + preferredCurrency: 'JPY' + }, + { + id: 'ko-KR', + preferredCurrency: 'KRW' + }, + { + id: 'pt-BR', + preferredCurrency: 'BRL' + }, + { + id: 'zh-CN', + preferredCurrency: 'CNY' + }, + { + id: 'zh-TW', + preferredCurrency: 'TWD' + } + ], + defaultLocale: 'en-GB' + } + {{else}} l10n: { supportedCurrencies: ['USD'], defaultCurrency: 'USD', @@ -22,5 +71,6 @@ module.exports = [ } ] } + {{/ifEquals}} } ] diff --git a/packages/pwa-kit-create-app/scripts/create-mobify-app.js b/packages/pwa-kit-create-app/scripts/create-mobify-app.js index 56fbe2de37..f73ee5f24d 100755 --- a/packages/pwa-kit-create-app/scripts/create-mobify-app.js +++ b/packages/pwa-kit-create-app/scripts/create-mobify-app.js @@ -59,6 +59,10 @@ sh.set('-e') // will ensure those escaped double quotes are still escaped after processing the template. Handlebars.registerHelper('script', (object) => object.replaceAll('"', '\\"')) +Handlebars.registerHelper('ifEquals', function(arg1, arg2, options) { + return (arg1 == arg2) ? options.fn(this) : options.inverse(this); +}) + // Validations const validPreset = (preset) => { return ALL_PRESET_NAMES.includes(preset) From c0725e9dced21c3672227cbf6f9425d6212f57c3 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Wed, 5 Mar 2025 13:19:16 -0800 Subject: [PATCH 27/63] Add US locale + currency to RefArchGlobal and set as default --- .../assets/bootstrap/js/config/sites.js.hbs | 12 ++++++++---- .../@salesforce/retail-react-app/config/sites.js.hbs | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/packages/pwa-kit-create-app/assets/bootstrap/js/config/sites.js.hbs b/packages/pwa-kit-create-app/assets/bootstrap/js/config/sites.js.hbs index d83f84fb13..531ee21499 100644 --- a/packages/pwa-kit-create-app/assets/bootstrap/js/config/sites.js.hbs +++ b/packages/pwa-kit-create-app/assets/bootstrap/js/config/sites.js.hbs @@ -12,9 +12,14 @@ module.exports = [ id: '{{answers.project.commerce.siteId}}', {{#ifEquals answers.project.commerce.siteId "RefArchGlobal" }} l10n: { - supportedCurrencies: ['GBP', 'EUR', 'CNY', 'JPY'], - defaultCurrency: 'GBP', + supportedCurrencies: ['USD', 'GBP', 'EUR', 'CNY', 'JPY'], + defaultCurrency: 'USD', + defaultLocale: 'en-US', supportedLocales: [ + { + id: 'en-US', + preferredCurrency: 'USD' + }, { id: 'de-DE', preferredCurrency: 'EUR' @@ -55,8 +60,7 @@ module.exports = [ id: 'zh-TW', preferredCurrency: 'TWD' } - ], - defaultLocale: 'en-GB' + ] } {{else}} l10n: { diff --git a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/sites.js.hbs b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/sites.js.hbs index f14d0e5b31..3dbfc87cf6 100644 --- a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/sites.js.hbs +++ b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/sites.js.hbs @@ -12,9 +12,14 @@ module.exports = [ id: '{{answers.project.commerce.siteId}}', {{#ifEquals answers.project.commerce.siteId "RefArchGlobal" }} l10n: { - supportedCurrencies: ['GBP', 'EUR', 'CNY', 'JPY'], - defaultCurrency: 'GBP', + supportedCurrencies: ['USD', 'GBP', 'EUR', 'CNY', 'JPY'], + defaultCurrency: 'USD', + defaultLocale: 'en-US', supportedLocales: [ + { + id: 'en-US', + preferredCurrency: 'USD' + }, { id: 'de-DE', preferredCurrency: 'EUR' @@ -55,8 +60,7 @@ module.exports = [ id: 'zh-TW', preferredCurrency: 'TWD' } - ], - defaultLocale: 'en-GB' + ] } {{else}} l10n: { From 3c60cb7f68b2101de9b0987b0992d46b947c079a Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Wed, 5 Mar 2025 13:31:24 -0800 Subject: [PATCH 28/63] Add site alias --- .../assets/bootstrap/js/config/default.js.hbs | 3 ++- .../@salesforce/retail-react-app/config/default.js.hbs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs b/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs index 1ef907c78c..d60152a926 100644 --- a/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs +++ b/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs @@ -52,7 +52,8 @@ module.exports = { defaultSite: '{{answers.project.commerce.siteId}}', // Provide aliases for your sites. These will be used in place of your site id when generating paths throughout the application. // siteAliases: { - // RefArch: 'us' + // RefArch: 'us', + // RefArchGlobal: 'global' // }, // The sites for your app, which is imported from sites.js sites, diff --git a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs index 11d0fb5427..d4a3b186c0 100644 --- a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs +++ b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs @@ -54,7 +54,8 @@ module.exports = { defaultSite: '{{answers.project.commerce.siteId}}', // Provide aliases for your sites. These will be used in place of your site id when generating paths throughout the application. // siteAliases: { - // RefArch: 'us' + // RefArch: 'us', + // RefArchGlobal: 'global' // }, // The sites for your app, which is imported from sites.js sites, From 5048c024820ecf07cc7fe09e3fa7707548c3e58c Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Wed, 5 Mar 2025 14:59:48 -0800 Subject: [PATCH 29/63] Enable passwordless and social login --- .../assets/bootstrap/js/config/default.js.hbs | 8 +++++++ .../retail-react-app/config/default.js.hbs | 8 +++++++ .../scripts/create-mobify-app.js | 21 ++++++++++++------- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs b/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs index d60152a926..ab3bcf93c3 100644 --- a/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs +++ b/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs @@ -20,7 +20,11 @@ module.exports = { login: { passwordless: { // Enables or disables passwordless login for the site. Defaults to: false + {{~#if answers.project.demo.enablePasswordlessAndSocialLogin}} + enabled: true, + {{else}} enabled: false, + {{/if}} // The callback URI, which can be an absolute URL (including third-party URIs) or a relative path set up by the developer. // Required in 'callback' mode; if missing, passwordless login defaults to 'sms' mode, which requires Marketing Cloud configuration. // If the env var `PASSWORDLESS_LOGIN_CALLBACK_URI` is set, it will override the config value. @@ -31,7 +35,11 @@ module.exports = { }, social: { // Enables or disables social login for the site. Defaults to: false + {{~#if answers.project.demo.enablePasswordlessAndSocialLogin}} + enabled: true, + {{else}} enabled: false, + {{/if}} // The third-party identity providers supported by your app. The PWA Kit supports Google and Apple by default. // Additional IDPs will also need to be added to the IDP_CONFIG in the SocialLogin component. idps: ['google', 'apple'], diff --git a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs index d4a3b186c0..ffb655bd76 100644 --- a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs +++ b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs @@ -22,7 +22,11 @@ module.exports = { login: { passwordless: { // Enables or disables passwordless login for the site. Defaults to: false + {{~#if answers.project.demo.enablePasswordlessAndSocialLogin}} + enabled: true, + {{else}} enabled: false, + {{/if}} // The callback URI, which can be an absolute URL (including third-party URIs) or a relative path set up by the developer. // Required in 'callback' mode; if missing, passwordless login defaults to 'sms' mode, which requires Marketing Cloud configuration. // If the env var `PASSWORDLESS_LOGIN_CALLBACK_URI` is set, it will override the config value. @@ -33,7 +37,11 @@ module.exports = { }, social: { // Enables or disables social login for the site. Defaults to: false + {{~#if answers.project.demo.enablePasswordlessAndSocialLogin}} + enabled: true, + {{else}} enabled: false, + {{/if}} // The third-party identity providers supported by your app. The PWA Kit supports Google and Apple by default. // Additional IDPs will also need to be added to the IDP_CONFIG in the SocialLogin component. idps: ['google', 'apple'], diff --git a/packages/pwa-kit-create-app/scripts/create-mobify-app.js b/packages/pwa-kit-create-app/scripts/create-mobify-app.js index f73ee5f24d..43ce079ce6 100755 --- a/packages/pwa-kit-create-app/scripts/create-mobify-app.js +++ b/packages/pwa-kit-create-app/scripts/create-mobify-app.js @@ -269,7 +269,8 @@ const PRESETS = [ ['project.commerce.shortCode']: 'kv7kzm78', ['project.commerce.isSlasPrivate']: false, ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1', - ['project.einstein.siteId']: 'aaij-MobileFirst' + ['project.einstein.siteId']: 'aaij-MobileFirst', + ['project.demo.enablePasswordlessAndSocialLogin']: false }, assets: ['translations'], private: false @@ -300,7 +301,8 @@ const PRESETS = [ ['project.commerce.shortCode']: 'kv7kzm78', ['project.commerce.isSlasPrivate']: true, ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1', - ['project.einstein.siteId']: 'aaij-MobileFirst' + ['project.einstein.siteId']: 'aaij-MobileFirst', + ['project.demo.enablePasswordlessAndSocialLogin']: true // True only for PWA Kit demo environments! }, assets: ['translations'], private: true @@ -325,7 +327,8 @@ const PRESETS = [ ['project.commerce.shortCode']: 'kv7kzm78', ['project.commerce.isSlasPrivate']: false, ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1', - ['project.einstein.siteId']: 'aaij-MobileFirst' + ['project.einstein.siteId']: 'aaij-MobileFirst', + ['project.demo.enablePasswordlessAndSocialLogin']: false }, assets: ['translations'], private: true @@ -350,7 +353,8 @@ const PRESETS = [ ['project.commerce.shortCode']: 'kv7kzm78', ['project.commerce.isSlasPrivate']: true, ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1', - ['project.einstein.siteId']: 'aaij-MobileFirst' + ['project.einstein.siteId']: 'aaij-MobileFirst', + ['project.demo.enablePasswordlessAndSocialLogin']: false }, assets: ['translations'], private: true @@ -375,7 +379,8 @@ const PRESETS = [ ['project.commerce.shortCode']: 'staging-001', ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1', ['project.einstein.siteId']: 'aaij-MobileFirst', - ['project.commerce.isSlasPrivate']: true + ['project.commerce.isSlasPrivate']: true, + ['project.demo.enablePasswordlessAndSocialLogin']: false }, assets: ['translations'], private: true @@ -400,7 +405,8 @@ const PRESETS = [ ['project.commerce.shortCode']: 'xitgmcd3', ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1', ['project.einstein.siteId']: 'aaij-MobileFirst', - ['project.commerce.isSlasPrivate']: true + ['project.commerce.isSlasPrivate']: true, + ['project.demo.enablePasswordlessAndSocialLogin']: false }, assets: ['translations'], private: true @@ -425,7 +431,8 @@ const PRESETS = [ ['project.commerce.shortCode']: 'performance-001', ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1', ['project.einstein.siteId']: 'aaij-MobileFirst', - ['project.commerce.isSlasPrivate']: false + ['project.commerce.isSlasPrivate']: false, + ['project.demo.enablePasswordlessAndSocialLogin']: false }, assets: ['translations'], private: true From 264ff063e735134dec75c1d52f0a0a5df3451130 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Wed, 5 Mar 2025 15:15:46 -0800 Subject: [PATCH 30/63] Adjust comment since handlebars don't add a newline --- .../assets/bootstrap/js/config/default.js.hbs | 6 ++++-- .../@salesforce/retail-react-app/config/default.js.hbs | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs b/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs index ab3bcf93c3..533acf0193 100644 --- a/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs +++ b/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs @@ -19,10 +19,11 @@ module.exports = { }, login: { passwordless: { - // Enables or disables passwordless login for the site. Defaults to: false {{~#if answers.project.demo.enablePasswordlessAndSocialLogin}} + // Enables or disables passwordless login for the site. Defaults to: false enabled: true, {{else}} + // Enables or disables passwordless login for the site. Defaults to: false enabled: false, {{/if}} // The callback URI, which can be an absolute URL (including third-party URIs) or a relative path set up by the developer. @@ -34,10 +35,11 @@ module.exports = { landingPath: '/passwordless-login-landing' }, social: { - // Enables or disables social login for the site. Defaults to: false {{~#if answers.project.demo.enablePasswordlessAndSocialLogin}} + // Enables or disables social login for the site. Defaults to: false enabled: true, {{else}} + // Enables or disables social login for the site. Defaults to: false enabled: false, {{/if}} // The third-party identity providers supported by your app. The PWA Kit supports Google and Apple by default. diff --git a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs index ffb655bd76..496beed540 100644 --- a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs +++ b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs @@ -21,10 +21,11 @@ module.exports = { }, login: { passwordless: { - // Enables or disables passwordless login for the site. Defaults to: false {{~#if answers.project.demo.enablePasswordlessAndSocialLogin}} + // Enables or disables passwordless login for the site. Defaults to: false enabled: true, {{else}} + // Enables or disables passwordless login for the site. Defaults to: false enabled: false, {{/if}} // The callback URI, which can be an absolute URL (including third-party URIs) or a relative path set up by the developer. @@ -36,10 +37,11 @@ module.exports = { landingPath: '/passwordless-login-landing' }, social: { - // Enables or disables social login for the site. Defaults to: false {{~#if answers.project.demo.enablePasswordlessAndSocialLogin}} + // Enables or disables social login for the site. Defaults to: false enabled: true, {{else}} + // Enables or disables social login for the site. Defaults to: false enabled: false, {{/if}} // The third-party identity providers supported by your app. The PWA Kit supports Google and Apple by default. From 472d336e3ccbcbb6ee45f91c9421991ffb66b8de Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Wed, 5 Mar 2025 15:19:20 -0800 Subject: [PATCH 31/63] Apply aliases --- .../assets/bootstrap/js/config/default.js.hbs | 10 +++++----- .../@salesforce/retail-react-app/config/default.js.hbs | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs b/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs index 533acf0193..1a6711c5fa 100644 --- a/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs +++ b/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs @@ -60,11 +60,11 @@ module.exports = { }, // The default site for your app. This value will be used when a siteRef could not be determined from the url defaultSite: '{{answers.project.commerce.siteId}}', - // Provide aliases for your sites. These will be used in place of your site id when generating paths throughout the application. - // siteAliases: { - // RefArch: 'us', - // RefArchGlobal: 'global' - // }, + Provide aliases for your sites. These will be used in place of your site id when generating paths throughout the application. + siteAliases: { + RefArch: 'us', + RefArchGlobal: 'global' + }, // The sites for your app, which is imported from sites.js sites, // Commerce api config diff --git a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs index 496beed540..e95209e921 100644 --- a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs +++ b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs @@ -63,10 +63,10 @@ module.exports = { // The default site for your app. This value will be used when a siteRef could not be determined from the url defaultSite: '{{answers.project.commerce.siteId}}', // Provide aliases for your sites. These will be used in place of your site id when generating paths throughout the application. - // siteAliases: { - // RefArch: 'us', - // RefArchGlobal: 'global' - // }, + siteAliases: { + RefArch: 'us', + RefArchGlobal: 'global' + }, // The sites for your app, which is imported from sites.js sites, // Commerce api config From 19b87e029e03652c68b77d3c61252962fcc8b478 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Wed, 5 Mar 2025 15:23:16 -0800 Subject: [PATCH 32/63] Adjust newline --- .../assets/bootstrap/js/config/default.js.hbs | 6 ++---- .../@salesforce/retail-react-app/config/default.js.hbs | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs b/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs index 1a6711c5fa..33706ed301 100644 --- a/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs +++ b/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs @@ -19,11 +19,10 @@ module.exports = { }, login: { passwordless: { - {{~#if answers.project.demo.enablePasswordlessAndSocialLogin}} // Enables or disables passwordless login for the site. Defaults to: false + {{#if answers.project.demo.enablePasswordlessAndSocialLogin}} enabled: true, {{else}} - // Enables or disables passwordless login for the site. Defaults to: false enabled: false, {{/if}} // The callback URI, which can be an absolute URL (including third-party URIs) or a relative path set up by the developer. @@ -35,11 +34,10 @@ module.exports = { landingPath: '/passwordless-login-landing' }, social: { - {{~#if answers.project.demo.enablePasswordlessAndSocialLogin}} // Enables or disables social login for the site. Defaults to: false + {{#if answers.project.demo.enablePasswordlessAndSocialLogin}} enabled: true, {{else}} - // Enables or disables social login for the site. Defaults to: false enabled: false, {{/if}} // The third-party identity providers supported by your app. The PWA Kit supports Google and Apple by default. diff --git a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs index e95209e921..0a3f27c750 100644 --- a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs +++ b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs @@ -21,11 +21,10 @@ module.exports = { }, login: { passwordless: { - {{~#if answers.project.demo.enablePasswordlessAndSocialLogin}} // Enables or disables passwordless login for the site. Defaults to: false + {{#if answers.project.demo.enablePasswordlessAndSocialLogin}} enabled: true, {{else}} - // Enables or disables passwordless login for the site. Defaults to: false enabled: false, {{/if}} // The callback URI, which can be an absolute URL (including third-party URIs) or a relative path set up by the developer. @@ -37,11 +36,10 @@ module.exports = { landingPath: '/passwordless-login-landing' }, social: { - {{~#if answers.project.demo.enablePasswordlessAndSocialLogin}} // Enables or disables social login for the site. Defaults to: false + {{#if answers.project.demo.enablePasswordlessAndSocialLogin}} enabled: true, {{else}} - // Enables or disables social login for the site. Defaults to: false enabled: false, {{/if}} // The third-party identity providers supported by your app. The PWA Kit supports Google and Apple by default. From 57593e962c56d895a1a9aa0d465ad34eb05d3704 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Wed, 5 Mar 2025 15:26:10 -0800 Subject: [PATCH 33/63] Comment --- .../assets/bootstrap/js/config/default.js.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs b/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs index 33706ed301..bf13712184 100644 --- a/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs +++ b/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs @@ -58,7 +58,7 @@ module.exports = { }, // The default site for your app. This value will be used when a siteRef could not be determined from the url defaultSite: '{{answers.project.commerce.siteId}}', - Provide aliases for your sites. These will be used in place of your site id when generating paths throughout the application. + // Provide aliases for your sites. These will be used in place of your site id when generating paths throughout the application. siteAliases: { RefArch: 'us', RefArchGlobal: 'global' From 1ae59cbc9fc3c1d9cf909fcac2cc3b23240d8c46 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Wed, 5 Mar 2025 15:45:07 -0800 Subject: [PATCH 34/63] Add siteid and locale to demo path --- .../assets/bootstrap/js/config/default.js.hbs | 13 +++++++++--- .../retail-react-app/config/default.js.hbs | 11 ++++++++-- .../scripts/create-mobify-app.js | 21 ++++++++----------- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs b/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs index bf13712184..cf00502948 100644 --- a/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs +++ b/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs @@ -10,17 +10,24 @@ module.exports = { app: { // Customize how your 'site' and 'locale' are displayed in the url. url: { + {{#if answers.project.demo.enableDemoSettings}} + // Determine where the siteRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none' + // site: 'path', + // Determine where the localeRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none' + locale: 'path', + {{else}} // Determine where the siteRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none' // site: 'none', // Determine where the localeRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none' - locale: 'none' + locale: 'none', + {{/if}} // This boolean value dictates whether or not default site or locale values are shown in the url. Defaults to: false // showDefaults: true }, login: { passwordless: { // Enables or disables passwordless login for the site. Defaults to: false - {{#if answers.project.demo.enablePasswordlessAndSocialLogin}} + {{#if answers.project.demo.enableDemoSettings}} enabled: true, {{else}} enabled: false, @@ -35,7 +42,7 @@ module.exports = { }, social: { // Enables or disables social login for the site. Defaults to: false - {{#if answers.project.demo.enablePasswordlessAndSocialLogin}} + {{#if answers.project.demo.enableDemoSettings}} enabled: true, {{else}} enabled: false, diff --git a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs index 0a3f27c750..d6a818c35f 100644 --- a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs +++ b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs @@ -10,10 +10,17 @@ module.exports = { app: { // Customize settings for your url url: { + {{#if answers.project.demo.enableDemoSettings}} + // Determine where the siteRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none' + // site: 'path', + // Determine where the localeRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none' + locale: 'path', + {{else}} // Determine where the siteRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none' // site: 'none', // Determine where the localeRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none' locale: 'none', + {{/if}} // This boolean value dictates whether default site or locale values are shown in the url. Defaults to: false // showDefaults: true, // This boolean value dictates whether the plus sign (+) is interpreted as space for query param string. Defaults to: false @@ -22,7 +29,7 @@ module.exports = { login: { passwordless: { // Enables or disables passwordless login for the site. Defaults to: false - {{#if answers.project.demo.enablePasswordlessAndSocialLogin}} + {{#if answers.project.demo.enableDemoSettings}} enabled: true, {{else}} enabled: false, @@ -37,7 +44,7 @@ module.exports = { }, social: { // Enables or disables social login for the site. Defaults to: false - {{#if answers.project.demo.enablePasswordlessAndSocialLogin}} + {{#if answers.project.demo.enableDemoSettings}} enabled: true, {{else}} enabled: false, diff --git a/packages/pwa-kit-create-app/scripts/create-mobify-app.js b/packages/pwa-kit-create-app/scripts/create-mobify-app.js index 43ce079ce6..0379bab74c 100755 --- a/packages/pwa-kit-create-app/scripts/create-mobify-app.js +++ b/packages/pwa-kit-create-app/scripts/create-mobify-app.js @@ -59,10 +59,6 @@ sh.set('-e') // will ensure those escaped double quotes are still escaped after processing the template. Handlebars.registerHelper('script', (object) => object.replaceAll('"', '\\"')) -Handlebars.registerHelper('ifEquals', function(arg1, arg2, options) { - return (arg1 == arg2) ? options.fn(this) : options.inverse(this); -}) - // Validations const validPreset = (preset) => { return ALL_PRESET_NAMES.includes(preset) @@ -270,7 +266,7 @@ const PRESETS = [ ['project.commerce.isSlasPrivate']: false, ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1', ['project.einstein.siteId']: 'aaij-MobileFirst', - ['project.demo.enablePasswordlessAndSocialLogin']: false + ['project.demo.enableDemoSettings']: false }, assets: ['translations'], private: false @@ -284,7 +280,8 @@ const PRESETS = [ This has social and passwordless login enabled but requires a client secret to run. `, - shortDescription: 'The Retail app with demo Commerce Cloud instance and a private SLAS client', + shortDescription: + 'The Retail app with demo Commerce Cloud instance and a private SLAS client', templateSource: { type: TEMPLATE_SOURCE_NPM, id: '@salesforce/retail-react-app' @@ -302,7 +299,7 @@ const PRESETS = [ ['project.commerce.isSlasPrivate']: true, ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1', ['project.einstein.siteId']: 'aaij-MobileFirst', - ['project.demo.enablePasswordlessAndSocialLogin']: true // True only for PWA Kit demo environments! + ['project.demo.enableDemoSettings']: true // True only for presets deployed to demo environments like pwa-kit.mobify-storefront.com }, assets: ['translations'], private: true @@ -328,7 +325,7 @@ const PRESETS = [ ['project.commerce.isSlasPrivate']: false, ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1', ['project.einstein.siteId']: 'aaij-MobileFirst', - ['project.demo.enablePasswordlessAndSocialLogin']: false + ['project.demo.enableDemoSettings']: false }, assets: ['translations'], private: true @@ -354,7 +351,7 @@ const PRESETS = [ ['project.commerce.isSlasPrivate']: true, ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1', ['project.einstein.siteId']: 'aaij-MobileFirst', - ['project.demo.enablePasswordlessAndSocialLogin']: false + ['project.demo.enableDemoSettings']: false }, assets: ['translations'], private: true @@ -380,7 +377,7 @@ const PRESETS = [ ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1', ['project.einstein.siteId']: 'aaij-MobileFirst', ['project.commerce.isSlasPrivate']: true, - ['project.demo.enablePasswordlessAndSocialLogin']: false + ['project.demo.enableDemoSettings']: false }, assets: ['translations'], private: true @@ -406,7 +403,7 @@ const PRESETS = [ ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1', ['project.einstein.siteId']: 'aaij-MobileFirst', ['project.commerce.isSlasPrivate']: true, - ['project.demo.enablePasswordlessAndSocialLogin']: false + ['project.demo.enableDemoSettings']: false }, assets: ['translations'], private: true @@ -432,7 +429,7 @@ const PRESETS = [ ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1', ['project.einstein.siteId']: 'aaij-MobileFirst', ['project.commerce.isSlasPrivate']: false, - ['project.demo.enablePasswordlessAndSocialLogin']: false + ['project.demo.enableDemoSettings']: false }, assets: ['translations'], private: true From 3535578d28e591d0ac07520c25735723018feb52 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Wed, 5 Mar 2025 15:53:14 -0800 Subject: [PATCH 35/63] Enable site setting --- .../assets/bootstrap/js/config/default.js.hbs | 6 ++++-- .../@salesforce/retail-react-app/config/default.js.hbs | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs b/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs index cf00502948..5e8bdc49e4 100644 --- a/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs +++ b/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs @@ -12,17 +12,19 @@ module.exports = { url: { {{#if answers.project.demo.enableDemoSettings}} // Determine where the siteRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none' - // site: 'path', + site: 'path', // Determine where the localeRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none' locale: 'path', {{else}} // Determine where the siteRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none' - // site: 'none', + site: 'none', // Determine where the localeRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none' locale: 'none', {{/if}} // This boolean value dictates whether or not default site or locale values are shown in the url. Defaults to: false // showDefaults: true + // This boolean value dictates whether the plus sign (+) is interpreted as space for query param string. Defaults to: false + interpretPlusSignAsSpace: false }, login: { passwordless: { diff --git a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs index d6a818c35f..827b48dbbb 100644 --- a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs +++ b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs @@ -12,12 +12,12 @@ module.exports = { url: { {{#if answers.project.demo.enableDemoSettings}} // Determine where the siteRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none' - // site: 'path', + site: 'path', // Determine where the localeRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none' locale: 'path', {{else}} // Determine where the siteRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none' - // site: 'none', + site: 'none', // Determine where the localeRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none' locale: 'none', {{/if}} From 2fb735a9859b280d29afe414c9686a6f1a6e9b83 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Wed, 5 Mar 2025 15:57:57 -0800 Subject: [PATCH 36/63] Re-add handlebar helper --- packages/pwa-kit-create-app/scripts/create-mobify-app.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/pwa-kit-create-app/scripts/create-mobify-app.js b/packages/pwa-kit-create-app/scripts/create-mobify-app.js index 0379bab74c..c1ff489e55 100755 --- a/packages/pwa-kit-create-app/scripts/create-mobify-app.js +++ b/packages/pwa-kit-create-app/scripts/create-mobify-app.js @@ -59,6 +59,10 @@ sh.set('-e') // will ensure those escaped double quotes are still escaped after processing the template. Handlebars.registerHelper('script', (object) => object.replaceAll('"', '\\"')) +Handlebars.registerHelper('ifEquals', function (arg1, arg2, options) { + return arg1 == arg2 ? options.fn(this) : options.inverse(this) +}) + // Validations const validPreset = (preset) => { return ALL_PRESET_NAMES.includes(preset) From 7252dfe4ebe1cf54ccafb6ebd3590cd13801e805 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Wed, 5 Mar 2025 16:10:24 -0800 Subject: [PATCH 37/63] showDefaults: true --- .../assets/bootstrap/js/config/default.js.hbs | 6 ++++-- .../assets/bootstrap/js/config/sites.js.hbs | 8 ++++---- .../@salesforce/retail-react-app/config/default.js.hbs | 6 ++++-- .../@salesforce/retail-react-app/config/sites.js.hbs | 8 ++++---- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs b/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs index 5e8bdc49e4..2e05c72921 100644 --- a/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs +++ b/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs @@ -15,14 +15,16 @@ module.exports = { site: 'path', // Determine where the localeRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none' locale: 'path', + // This boolean value dictates whether or not default site or locale values are shown in the url. Defaults to: false + showDefaults: true, {{else}} // Determine where the siteRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none' site: 'none', // Determine where the localeRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none' locale: 'none', - {{/if}} // This boolean value dictates whether or not default site or locale values are shown in the url. Defaults to: false - // showDefaults: true + showDefaults: false, + {{/if}} // This boolean value dictates whether the plus sign (+) is interpreted as space for query param string. Defaults to: false interpretPlusSignAsSpace: false }, diff --git a/packages/pwa-kit-create-app/assets/bootstrap/js/config/sites.js.hbs b/packages/pwa-kit-create-app/assets/bootstrap/js/config/sites.js.hbs index 531ee21499..d9045e4687 100644 --- a/packages/pwa-kit-create-app/assets/bootstrap/js/config/sites.js.hbs +++ b/packages/pwa-kit-create-app/assets/bootstrap/js/config/sites.js.hbs @@ -20,14 +20,14 @@ module.exports = [ id: 'en-US', preferredCurrency: 'USD' }, - { - id: 'de-DE', - preferredCurrency: 'EUR' - }, { id: 'en-GB', preferredCurrency: 'GBP' }, + { + id: 'de-DE', + preferredCurrency: 'EUR' + }, { id: 'es-MX', preferredCurrency: 'MXN' diff --git a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs index 827b48dbbb..a331acd956 100644 --- a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs +++ b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs @@ -15,14 +15,16 @@ module.exports = { site: 'path', // Determine where the localeRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none' locale: 'path', + // This boolean value dictates whether default site or locale values are shown in the url. Defaults to: false + showDefaults: true, {{else}} // Determine where the siteRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none' site: 'none', // Determine where the localeRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none' locale: 'none', + // This boolean value dictates whether or not default site or locale values are shown in the url. Defaults to: false + showDefaults: false, {{/if}} - // This boolean value dictates whether default site or locale values are shown in the url. Defaults to: false - // showDefaults: true, // This boolean value dictates whether the plus sign (+) is interpreted as space for query param string. Defaults to: false interpretPlusSignAsSpace: false }, diff --git a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/sites.js.hbs b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/sites.js.hbs index 3dbfc87cf6..87ff79047c 100644 --- a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/sites.js.hbs +++ b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/sites.js.hbs @@ -20,14 +20,14 @@ module.exports = [ id: 'en-US', preferredCurrency: 'USD' }, - { - id: 'de-DE', - preferredCurrency: 'EUR' - }, { id: 'en-GB', preferredCurrency: 'GBP' }, + { + id: 'de-DE', + preferredCurrency: 'EUR' + }, { id: 'es-MX', preferredCurrency: 'MXN' From af69be855c333a2d234a8938451144e09c1492d9 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Wed, 5 Mar 2025 16:45:04 -0800 Subject: [PATCH 38/63] Use translatable title for demo store --- .../bootstrap/js/overrides/app/pages/home/index.jsx.hbs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/pwa-kit-create-app/assets/bootstrap/js/overrides/app/pages/home/index.jsx.hbs b/packages/pwa-kit-create-app/assets/bootstrap/js/overrides/app/pages/home/index.jsx.hbs index ee1854e2c5..c8a31056f1 100644 --- a/packages/pwa-kit-create-app/assets/bootstrap/js/overrides/app/pages/home/index.jsx.hbs +++ b/packages/pwa-kit-create-app/assets/bootstrap/js/overrides/app/pages/home/index.jsx.hbs @@ -82,7 +82,14 @@ const Home = () => { /> Date: Wed, 5 Mar 2025 16:53:02 -0800 Subject: [PATCH 39/63] Fix lint --- .../assets/bootstrap/js/config/sites.js.hbs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/pwa-kit-create-app/assets/bootstrap/js/config/sites.js.hbs b/packages/pwa-kit-create-app/assets/bootstrap/js/config/sites.js.hbs index d9045e4687..87ff79047c 100644 --- a/packages/pwa-kit-create-app/assets/bootstrap/js/config/sites.js.hbs +++ b/packages/pwa-kit-create-app/assets/bootstrap/js/config/sites.js.hbs @@ -63,18 +63,18 @@ module.exports = [ ] } {{else}} - l10n: { - supportedCurrencies: ['USD'], - defaultCurrency: 'USD', - defaultLocale: 'en-US', - supportedLocales: [ - { - id: 'en-US', - // alias: 'us', - preferredCurrency: 'USD' - } - ] - } + l10n: { + supportedCurrencies: ['USD'], + defaultCurrency: 'USD', + defaultLocale: 'en-US', + supportedLocales: [ + { + id: 'en-US', + // alias: 'us', + preferredCurrency: 'USD' + } + ] + } {{/ifEquals}} } ] From e71baf0398c5f402fe84fe8ae0f39a37917c04c6 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Thu, 6 Mar 2025 16:13:51 -0800 Subject: [PATCH 40/63] Deploy to production demo site --- .github/workflows/deploy_latest_release.yml | 2 +- .github/workflows/test.yml | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 83d9dc490c..5d52851195 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -108,7 +108,7 @@ jobs: uses: "./.github/actions/push_to_mrt" with: CWD: "../generated-projects/retail-react-app-demo-site" - TARGET: staging + TARGET: production PROJECT: scaffold-pwa MESSAGE: "tag ${{ github.event.release.tag_name }}" FLAGS: --wait diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 12813f5c15..3e945289d5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -101,6 +101,7 @@ jobs: mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} + # TODO - Do we still need this? - name: Push Bundle to MRT (Development) if: env.IS_NOT_FORK == 'true' && env.IS_MRT_NODE == 'true' && env.DEVELOP == 'true' uses: "./.github/actions/push_to_mrt" @@ -108,13 +109,6 @@ jobs: CWD: "./packages/template-retail-react-app" TARGET: staging - - name: Push Bundle to MRT (Production) - if: env.IS_NOT_FORK == 'true' && env.IS_MRT_NODE == 'true' && env.RELEASE == 'true' - uses: "./.github/actions/push_to_mrt" - with: - CWD: "./packages/template-retail-react-app" - TARGET: production - - name: Push Bundle to MRT (Commerce SDK React) if: env.IS_NOT_FORK == 'true' && env.IS_MRT_NODE == 'true' && env.DEVELOP == 'true' uses: "./.github/actions/push_to_mrt" From e7da5be664249f8a94a2e34d621669f3e0bb4656 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Thu, 6 Mar 2025 16:25:04 -0800 Subject: [PATCH 41/63] Re-enable bug bounty deploy --- .github/workflows/deploy_latest_release.yml | 72 ++++++++++----------- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 5d52851195..e2d67ebe62 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -31,51 +31,50 @@ jobs: echo "Deploy is not for the latest release. Stopping deployment" fi - # Re-enable this when the PR is ready to be merged - # deploy-bug-bounty: - # needs: check-latest-release - # runs-on: ubuntu-latest - # if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true' - # steps: - # - name: Checkout - # uses: actions/checkout@v4 + deploy-bug-bounty: + needs: check-latest-release + runs-on: ubuntu-latest + if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true' + steps: + - name: Checkout + uses: actions/checkout@v4 - # - name: Setup node - # id: setup_node - # uses: actions/setup-node@v4 - # with: - # node-version: 22 - # cache: "npm" + - name: Setup node + id: setup_node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: "npm" - # - name: Install Monorepo Dependencies - # run: |- - # # Install node dependencies - # node ./scripts/gtime.js monorepo_install npm ci + - name: Install Monorepo Dependencies + run: |- + # Install node dependencies + node ./scripts/gtime.js monorepo_install npm ci - # - name: Generate Retail App Demo - # uses: ./.github/actions/e2e_generate_app - # with: - # PROJECT_KEY: "retail-react-app-bug-bounty" + - name: Generate Retail App Demo + uses: ./.github/actions/e2e_generate_app + with: + PROJECT_KEY: "retail-react-app-bug-bounty" - # - name: Create MRT credentials file - # uses: "./.github/actions/create_mrt" - # with: - # mobify_user: ${{ secrets.MOBIFY_STG_CLIENT_USER }} - # mobify_api_key: ${{ secrets.MOBIFY_STG_CLIENT_API_KEY }} + - name: Create MRT credentials file + uses: "./.github/actions/create_mrt" + with: + mobify_user: ${{ secrets.MOBIFY_STG_CLIENT_USER }} + mobify_api_key: ${{ secrets.MOBIFY_STG_CLIENT_API_KEY }} - # - name: Push Bundle to MRT (Bug Bounty) - # uses: "./.github/actions/push_to_mrt" - # with: - # CWD: "../generated-projects/retail-react-app-bug-bounty" - # TARGET: testing - # PROJECT: pwa-kit - # MESSAGE: "tag ${{ github.event.release.tag_name }}" - # FLAGS: --cloud-origin https://cloud-testing.mobify-staging.com -c ~/.mobify --wait + - name: Push Bundle to MRT (Bug Bounty) + uses: "./.github/actions/push_to_mrt" + with: + CWD: "../generated-projects/retail-react-app-bug-bounty" + TARGET: testing + PROJECT: pwa-kit + MESSAGE: "tag ${{ github.event.release.tag_name }}" + FLAGS: --cloud-origin https://cloud-testing.mobify-staging.com -c ~/.mobify --wait deploy-demo-site: needs: check-latest-release runs-on: ubuntu-latest - if: needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true' + if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true' steps: - name: Checkout uses: actions/checkout@v4 @@ -103,7 +102,6 @@ jobs: mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} - #TODO - change target to production once testing is done - name: Push Bundle to MRT (Demo Site) uses: "./.github/actions/push_to_mrt" with: From 6ec6c7bf15fd50ce6d16283127bb1dba79162d14 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Fri, 7 Mar 2025 10:39:08 -0800 Subject: [PATCH 42/63] Use Salesforce Cloud as default logo for extensible projects --- .../js/overrides/app/assets/svg/brand-logo.svg | 15 ++++++++++----- .../js/overrides/app/assets/svg/sample-logo.svg | 5 +++++ 2 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 packages/pwa-kit-create-app/assets/bootstrap/js/overrides/app/assets/svg/sample-logo.svg diff --git a/packages/pwa-kit-create-app/assets/bootstrap/js/overrides/app/assets/svg/brand-logo.svg b/packages/pwa-kit-create-app/assets/bootstrap/js/overrides/app/assets/svg/brand-logo.svg index 99970ffaf2..fa35edc7dc 100644 --- a/packages/pwa-kit-create-app/assets/bootstrap/js/overrides/app/assets/svg/brand-logo.svg +++ b/packages/pwa-kit-create-app/assets/bootstrap/js/overrides/app/assets/svg/brand-logo.svg @@ -1,5 +1,10 @@ - - - - - + + + \ No newline at end of file diff --git a/packages/pwa-kit-create-app/assets/bootstrap/js/overrides/app/assets/svg/sample-logo.svg b/packages/pwa-kit-create-app/assets/bootstrap/js/overrides/app/assets/svg/sample-logo.svg new file mode 100644 index 0000000000..99970ffaf2 --- /dev/null +++ b/packages/pwa-kit-create-app/assets/bootstrap/js/overrides/app/assets/svg/sample-logo.svg @@ -0,0 +1,5 @@ + + + + + From e5358bf531268089c0236bb2b50c02e89b1457db Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Fri, 7 Mar 2025 10:40:02 -0800 Subject: [PATCH 43/63] Change condition so we run a deploy --- .github/workflows/deploy_latest_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index e2d67ebe62..354caf19c7 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -74,7 +74,7 @@ jobs: deploy-demo-site: needs: check-latest-release runs-on: ubuntu-latest - if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true' + if: needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true' steps: - name: Checkout uses: actions/checkout@v4 From 5920ebb00bf145db8e219f03ccd41e488afcae12 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Fri, 7 Mar 2025 11:05:28 -0800 Subject: [PATCH 44/63] Restore latest release condition --- .github/workflows/deploy_latest_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 354caf19c7..e2d67ebe62 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -74,7 +74,7 @@ jobs: deploy-demo-site: needs: check-latest-release runs-on: ubuntu-latest - if: needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true' + if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true' steps: - name: Checkout uses: actions/checkout@v4 From 45a66b164fa7697ad92f9bef24ea342b5cd664b2 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Mon, 10 Mar 2025 09:53:39 -0700 Subject: [PATCH 45/63] Revert "Use Salesforce Cloud as default logo for extensible projects" This reverts commit 6ec6c7bf15fd50ce6d16283127bb1dba79162d14. --- .../js/overrides/app/assets/svg/brand-logo.svg | 15 +++++---------- .../js/overrides/app/assets/svg/sample-logo.svg | 5 ----- 2 files changed, 5 insertions(+), 15 deletions(-) delete mode 100644 packages/pwa-kit-create-app/assets/bootstrap/js/overrides/app/assets/svg/sample-logo.svg diff --git a/packages/pwa-kit-create-app/assets/bootstrap/js/overrides/app/assets/svg/brand-logo.svg b/packages/pwa-kit-create-app/assets/bootstrap/js/overrides/app/assets/svg/brand-logo.svg index fa35edc7dc..99970ffaf2 100644 --- a/packages/pwa-kit-create-app/assets/bootstrap/js/overrides/app/assets/svg/brand-logo.svg +++ b/packages/pwa-kit-create-app/assets/bootstrap/js/overrides/app/assets/svg/brand-logo.svg @@ -1,10 +1,5 @@ - - - \ No newline at end of file + + + + + diff --git a/packages/pwa-kit-create-app/assets/bootstrap/js/overrides/app/assets/svg/sample-logo.svg b/packages/pwa-kit-create-app/assets/bootstrap/js/overrides/app/assets/svg/sample-logo.svg deleted file mode 100644 index 99970ffaf2..0000000000 --- a/packages/pwa-kit-create-app/assets/bootstrap/js/overrides/app/assets/svg/sample-logo.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - From bd51f1a92ad98882e1e0dce2c7a2eeb379c2658d Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Mon, 10 Mar 2025 09:57:45 -0700 Subject: [PATCH 46/63] Use a non-extensible template for demo site --- packages/pwa-kit-create-app/scripts/create-mobify-app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pwa-kit-create-app/scripts/create-mobify-app.js b/packages/pwa-kit-create-app/scripts/create-mobify-app.js index c1ff489e55..c5b6938b44 100755 --- a/packages/pwa-kit-create-app/scripts/create-mobify-app.js +++ b/packages/pwa-kit-create-app/scripts/create-mobify-app.js @@ -292,7 +292,7 @@ const PRESETS = [ }, questions: [...EXTENSIBILITY_QUESTIONS, ...RETAIL_REACT_APP_QUESTIONS], answers: { - ['project.extend']: true, + ['project.extend']: false, // Intentionally not an extensible project so that the correct logos appear on demo site ['project.hybrid']: false, ['project.name']: 'demo-storefront', ['project.commerce.instanceUrl']: 'https://zzrf-001.dx.commercecloud.salesforce.com', From 5ec39541c5fa545ae5274037345552e156d2f0eb Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Mon, 10 Mar 2025 09:58:49 -0700 Subject: [PATCH 47/63] Deploy demo site --- .github/workflows/deploy_latest_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index e2d67ebe62..354caf19c7 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -74,7 +74,7 @@ jobs: deploy-demo-site: needs: check-latest-release runs-on: ubuntu-latest - if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true' + if: needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true' steps: - name: Checkout uses: actions/checkout@v4 From 9afbfdccac2c0b9ac9d8619858abec0285159b45 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Mon, 10 Mar 2025 10:17:42 -0700 Subject: [PATCH 48/63] Revert deployment condition --- .github/workflows/deploy_latest_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 354caf19c7..e2d67ebe62 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -74,7 +74,7 @@ jobs: deploy-demo-site: needs: check-latest-release runs-on: ubuntu-latest - if: needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true' + if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true' steps: - name: Checkout uses: actions/checkout@v4 From ef88febb41e9950569192a510f8e9546ed3718f3 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 11 Mar 2025 14:37:32 -0700 Subject: [PATCH 49/63] Apply suggestions --- .github/workflows/deploy_latest_release.yml | 2 +- e2e/config.js | 2 +- .../assets/bootstrap/js/config/default.js.hbs | 7 +++++++ .../assets/bootstrap/js/config/sites.js.hbs | 4 ++-- .../retail-react-app/config/default.js.hbs | 7 +++++++ .../retail-react-app/config/sites.js.hbs | 4 ++-- .../scripts/create-mobify-app.js | 16 +++++++--------- 7 files changed, 27 insertions(+), 15 deletions(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index e2d67ebe62..9eb973bb30 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -26,10 +26,10 @@ jobs: id: checkRelease run: |- IS_LATEST_RELEASE=$(echo ${{ env.IS_LATEST_RELEASE }}) - echo "IS_LATEST_RELEASE=${{ env.IS_LATEST_RELEASE }}" >> "$GITHUB_OUTPUT" if [ $IS_LATEST_RELEASE != "true" ]; then echo "Deploy is not for the latest release. Stopping deployment" fi + echo "IS_LATEST_RELEASE=$IS_LATEST_RELEASE" >> "$GITHUB_OUTPUT" deploy-bug-bounty: needs: check-latest-release diff --git a/e2e/config.js b/e2e/config.js index 78aad54683..d610da3487 100644 --- a/e2e/config.js +++ b/e2e/config.js @@ -107,7 +107,7 @@ module.exports = { PRESET: { "retail-app-private-client": "retail-react-app-private-slas-client", "retail-react-app-bug-bounty": "retail-react-app-bug-bounty", - "retail-react-app-demo-site": "retail-react-app-demo-private" + "retail-react-app-demo-site": "retail-react-app-demo-site-internal" }, EXPECTED_GENERATED_ARTIFACTS: { "retail-app-demo": [ diff --git a/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs b/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs index 2e05c72921..fa70b9633f 100644 --- a/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs +++ b/packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs @@ -70,10 +70,17 @@ module.exports = { // The default site for your app. This value will be used when a siteRef could not be determined from the url defaultSite: '{{answers.project.commerce.siteId}}', // Provide aliases for your sites. These will be used in place of your site id when generating paths throughout the application. + {{#if answers.project.demo.enableDemoSettings}} siteAliases: { RefArch: 'us', RefArchGlobal: 'global' }, + {{else}} + // siteAliases: { + // RefArch: 'us', + // RefArchGlobal: 'global' + // }, + {{/if}} // The sites for your app, which is imported from sites.js sites, // Commerce api config diff --git a/packages/pwa-kit-create-app/assets/bootstrap/js/config/sites.js.hbs b/packages/pwa-kit-create-app/assets/bootstrap/js/config/sites.js.hbs index 87ff79047c..b1a904fbb4 100644 --- a/packages/pwa-kit-create-app/assets/bootstrap/js/config/sites.js.hbs +++ b/packages/pwa-kit-create-app/assets/bootstrap/js/config/sites.js.hbs @@ -10,7 +10,7 @@ module.exports = [ { id: '{{answers.project.commerce.siteId}}', - {{#ifEquals answers.project.commerce.siteId "RefArchGlobal" }} + {{#if answers.project.demo.enableDemoSettings}} l10n: { supportedCurrencies: ['USD', 'GBP', 'EUR', 'CNY', 'JPY'], defaultCurrency: 'USD', @@ -75,6 +75,6 @@ module.exports = [ } ] } - {{/ifEquals}} + {{/if}} } ] diff --git a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs index a331acd956..8aefdf2deb 100644 --- a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs +++ b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs @@ -70,10 +70,17 @@ module.exports = { // The default site for your app. This value will be used when a siteRef could not be determined from the url defaultSite: '{{answers.project.commerce.siteId}}', // Provide aliases for your sites. These will be used in place of your site id when generating paths throughout the application. + {{#if answers.project.demo.enableDemoSettings}} siteAliases: { RefArch: 'us', RefArchGlobal: 'global' }, + {{else}} + // siteAliases: { + // RefArch: 'us', + // RefArchGlobal: 'global' + // }, + {{/if}} // The sites for your app, which is imported from sites.js sites, // Commerce api config diff --git a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/sites.js.hbs b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/sites.js.hbs index 87ff79047c..b1a904fbb4 100644 --- a/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/sites.js.hbs +++ b/packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/sites.js.hbs @@ -10,7 +10,7 @@ module.exports = [ { id: '{{answers.project.commerce.siteId}}', - {{#ifEquals answers.project.commerce.siteId "RefArchGlobal" }} + {{#if answers.project.demo.enableDemoSettings}} l10n: { supportedCurrencies: ['USD', 'GBP', 'EUR', 'CNY', 'JPY'], defaultCurrency: 'USD', @@ -75,6 +75,6 @@ module.exports = [ } ] } - {{/ifEquals}} + {{/if}} } ] diff --git a/packages/pwa-kit-create-app/scripts/create-mobify-app.js b/packages/pwa-kit-create-app/scripts/create-mobify-app.js index c5b6938b44..eb50977e66 100755 --- a/packages/pwa-kit-create-app/scripts/create-mobify-app.js +++ b/packages/pwa-kit-create-app/scripts/create-mobify-app.js @@ -59,10 +59,6 @@ sh.set('-e') // will ensure those escaped double quotes are still escaped after processing the template. Handlebars.registerHelper('script', (object) => object.replaceAll('"', '\\"')) -Handlebars.registerHelper('ifEquals', function (arg1, arg2, options) { - return arg1 == arg2 ? options.fn(this) : options.inverse(this) -}) - // Validations const validPreset = (preset) => { return ALL_PRESET_NAMES.includes(preset) @@ -276,13 +272,15 @@ const PRESETS = [ private: false }, { - id: 'retail-react-app-demo-private', - name: 'Retail React App Demo Private Client', + id: 'retail-react-app-demo-site-internal', + name: 'Retail React App Demo Store', description: ` - Generates a project using the settings for a special B2C Commerce - instance that is used for demo purposes and sets it up with a private SLAS client. + Generates a project using the settings for a special B2C Commerce instance that is used + for demo purposes. The demo site is accessible at https://pwa-kit.mobify-storefront.com/ - This has social and passwordless login enabled but requires a client secret to run. + This environment uses a SLAS private client and has social and passwordless login enabled. + This environment is set up to use multiple locales. + Future features that are enabled for the demo environment may be added to this preset. `, shortDescription: 'The Retail app with demo Commerce Cloud instance and a private SLAS client', From f432ace5fe0b826d3c03a1f2e9709e014dd96fab Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 11 Mar 2025 16:51:51 -0700 Subject: [PATCH 50/63] Fallback name if no release tag name --- .github/workflows/deploy_latest_release.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 9eb973bb30..743f879f04 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -34,7 +34,9 @@ jobs: deploy-bug-bounty: needs: check-latest-release runs-on: ubuntu-latest - if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true' + if: needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true' + env: + BUNDLE_NAME: "${{ github.event.release.tag_name }} && 'tag ${{ github.event.release.tag_name }}' || 'build ${{ github.run_id }} on ${{ github.ref }} (${{ github.sha }})' " steps: - name: Checkout uses: actions/checkout@v4 @@ -68,13 +70,15 @@ jobs: CWD: "../generated-projects/retail-react-app-bug-bounty" TARGET: testing PROJECT: pwa-kit - MESSAGE: "tag ${{ github.event.release.tag_name }}" + MESSAGE: $BUNDLE_NAME FLAGS: --cloud-origin https://cloud-testing.mobify-staging.com -c ~/.mobify --wait deploy-demo-site: needs: check-latest-release runs-on: ubuntu-latest - if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true' + if: needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true' + env: + BUNDLE_NAME: "${{ github.event.release.tag_name }} && 'tag ${{ github.event.release.tag_name }}' || 'build ${{ github.run_id }} on ${{ github.ref }} (${{ github.sha }})' " steps: - name: Checkout uses: actions/checkout@v4 @@ -106,7 +110,7 @@ jobs: uses: "./.github/actions/push_to_mrt" with: CWD: "../generated-projects/retail-react-app-demo-site" - TARGET: production + TARGET: staging PROJECT: scaffold-pwa - MESSAGE: "tag ${{ github.event.release.tag_name }}" + MESSAGE: $BUNDLE_NAME FLAGS: --wait From bcac19c6b3336d07e0afca09ec9aa95fc96f0460 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 11 Mar 2025 16:59:06 -0700 Subject: [PATCH 51/63] test --- .github/workflows/deploy_latest_release.yml | 124 ++++++++++---------- 1 file changed, 64 insertions(+), 60 deletions(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 743f879f04..db78a3991c 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -38,79 +38,83 @@ jobs: env: BUNDLE_NAME: "${{ github.event.release.tag_name }} && 'tag ${{ github.event.release.tag_name }}' || 'build ${{ github.run_id }} on ${{ github.ref }} (${{ github.sha }})' " steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Print bundle name + run: |- + echo $BUNDLE_NAME - - name: Setup node - id: setup_node - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: "npm" + # - name: Checkout + # uses: actions/checkout@v4 - - name: Install Monorepo Dependencies - run: |- - # Install node dependencies - node ./scripts/gtime.js monorepo_install npm ci + # - name: Setup node + # id: setup_node + # uses: actions/setup-node@v4 + # with: + # node-version: 22 + # cache: "npm" - - name: Generate Retail App Demo - uses: ./.github/actions/e2e_generate_app - with: - PROJECT_KEY: "retail-react-app-bug-bounty" + # - name: Install Monorepo Dependencies + # run: |- + # # Install node dependencies + # node ./scripts/gtime.js monorepo_install npm ci - - name: Create MRT credentials file - uses: "./.github/actions/create_mrt" - with: - mobify_user: ${{ secrets.MOBIFY_STG_CLIENT_USER }} - mobify_api_key: ${{ secrets.MOBIFY_STG_CLIENT_API_KEY }} + # - name: Generate Retail App Demo + # uses: ./.github/actions/e2e_generate_app + # with: + # PROJECT_KEY: "retail-react-app-bug-bounty" - - name: Push Bundle to MRT (Bug Bounty) - uses: "./.github/actions/push_to_mrt" - with: - CWD: "../generated-projects/retail-react-app-bug-bounty" - TARGET: testing - PROJECT: pwa-kit - MESSAGE: $BUNDLE_NAME - FLAGS: --cloud-origin https://cloud-testing.mobify-staging.com -c ~/.mobify --wait + # - name: Create MRT credentials file + # uses: "./.github/actions/create_mrt" + # with: + # mobify_user: ${{ secrets.MOBIFY_STG_CLIENT_USER }} + # mobify_api_key: ${{ secrets.MOBIFY_STG_CLIENT_API_KEY }} + + # - name: Push Bundle to MRT (Bug Bounty) + # uses: "./.github/actions/push_to_mrt" + # with: + # CWD: "../generated-projects/retail-react-app-bug-bounty" + # TARGET: testing + # PROJECT: pwa-kit + # MESSAGE: $BUNDLE_NAME + # FLAGS: --cloud-origin https://cloud-testing.mobify-staging.com -c ~/.mobify --wait deploy-demo-site: needs: check-latest-release runs-on: ubuntu-latest - if: needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true' + if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true' env: - BUNDLE_NAME: "${{ github.event.release.tag_name }} && 'tag ${{ github.event.release.tag_name }}' || 'build ${{ github.run_id }} on ${{ github.ref }} (${{ github.sha }})' " + BUNDLE_NAME: "${{ $github.event.release.tag_name && 'tag $github.event.release.tag_name ' || 'build $github.run_id on github.ref ( github.sha )'}} " steps: - - name: Checkout - uses: actions/checkout@v4 + # - name: Checkout + # uses: actions/checkout@v4 - - name: Setup node - id: setup_node - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: "npm" + # - name: Setup node + # id: setup_node + # uses: actions/setup-node@v4 + # with: + # node-version: 22 + # cache: "npm" - - name: Install Monorepo Dependencies - run: |- - # Install node dependencies - node ./scripts/gtime.js monorepo_install npm ci + # - name: Install Monorepo Dependencies + # run: |- + # # Install node dependencies + # node ./scripts/gtime.js monorepo_install npm ci - - name: Generate Retail App Demo - uses: ./.github/actions/e2e_generate_app - with: - PROJECT_KEY: "retail-react-app-demo-site" + # - name: Generate Retail App Demo + # uses: ./.github/actions/e2e_generate_app + # with: + # PROJECT_KEY: "retail-react-app-demo-site" - - name: Create MRT credentials file - uses: "./.github/actions/create_mrt" - with: - mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} - mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} + # - name: Create MRT credentials file + # uses: "./.github/actions/create_mrt" + # with: + # mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} + # mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} - - name: Push Bundle to MRT (Demo Site) - uses: "./.github/actions/push_to_mrt" - with: - CWD: "../generated-projects/retail-react-app-demo-site" - TARGET: staging - PROJECT: scaffold-pwa - MESSAGE: $BUNDLE_NAME - FLAGS: --wait + # - name: Push Bundle to MRT (Demo Site) + # uses: "./.github/actions/push_to_mrt" + # with: + # CWD: "../generated-projects/retail-react-app-demo-site" + # TARGET: staging + # PROJECT: scaffold-pwa + # MESSAGE: $BUNDLE_NAME + # FLAGS: --wait From 7f6185b834433b3dc5466ca9996e0bb31c7955b9 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 11 Mar 2025 16:59:56 -0700 Subject: [PATCH 52/63] test --- .github/workflows/deploy_latest_release.yml | 58 ++++++++++----------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index db78a3991c..d0d9bf8bbc 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -84,37 +84,37 @@ jobs: env: BUNDLE_NAME: "${{ $github.event.release.tag_name && 'tag $github.event.release.tag_name ' || 'build $github.run_id on github.ref ( github.sha )'}} " steps: - # - name: Checkout - # uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - # - name: Setup node - # id: setup_node - # uses: actions/setup-node@v4 - # with: - # node-version: 22 - # cache: "npm" + - name: Setup node + id: setup_node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: "npm" - # - name: Install Monorepo Dependencies - # run: |- - # # Install node dependencies - # node ./scripts/gtime.js monorepo_install npm ci + - name: Install Monorepo Dependencies + run: |- + # Install node dependencies + node ./scripts/gtime.js monorepo_install npm ci - # - name: Generate Retail App Demo - # uses: ./.github/actions/e2e_generate_app - # with: - # PROJECT_KEY: "retail-react-app-demo-site" + - name: Generate Retail App Demo + uses: ./.github/actions/e2e_generate_app + with: + PROJECT_KEY: "retail-react-app-demo-site" - # - name: Create MRT credentials file - # uses: "./.github/actions/create_mrt" - # with: - # mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} - # mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} + - name: Create MRT credentials file + uses: "./.github/actions/create_mrt" + with: + mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} + mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} - # - name: Push Bundle to MRT (Demo Site) - # uses: "./.github/actions/push_to_mrt" - # with: - # CWD: "../generated-projects/retail-react-app-demo-site" - # TARGET: staging - # PROJECT: scaffold-pwa - # MESSAGE: $BUNDLE_NAME - # FLAGS: --wait + - name: Push Bundle to MRT (Demo Site) + uses: "./.github/actions/push_to_mrt" + with: + CWD: "../generated-projects/retail-react-app-demo-site" + TARGET: staging + PROJECT: scaffold-pwa + MESSAGE: $BUNDLE_NAME + FLAGS: --wait From fcff88a219d8a41bdfe797b2162a0180bda646e8 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 11 Mar 2025 17:07:38 -0700 Subject: [PATCH 53/63] New step for bundle name --- .github/workflows/deploy_latest_release.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index d0d9bf8bbc..ab661bf82e 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -35,12 +35,17 @@ jobs: needs: check-latest-release runs-on: ubuntu-latest if: needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true' - env: - BUNDLE_NAME: "${{ github.event.release.tag_name }} && 'tag ${{ github.event.release.tag_name }}' || 'build ${{ github.run_id }} on ${{ github.ref }} (${{ github.sha }})' " steps: - - name: Print bundle name + - name: Set bundle name run: |- - echo $BUNDLE_NAME + TAG_NAME=$(echo ${{ github.event.release.tag_name }}) + if [ "$TAG_NAME" ]; then + BUNDLE_NAME="tag ${{ github.event.release.tag_name }}" + else + BUNDLE_NAME="build ${{ github.run_id }} on ${{ github.ref }} (${{ github.sha }})"" + fi + echo "Setting bundle name as $BUNDLE_NAME" + echo "BUNDLE_NAME=$BUNDLE_NAME" >> $GITHUB_ENV # - name: Checkout # uses: actions/checkout@v4 @@ -81,8 +86,6 @@ jobs: needs: check-latest-release runs-on: ubuntu-latest if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true' - env: - BUNDLE_NAME: "${{ $github.event.release.tag_name && 'tag $github.event.release.tag_name ' || 'build $github.run_id on github.ref ( github.sha )'}} " steps: - name: Checkout uses: actions/checkout@v4 @@ -110,6 +113,8 @@ jobs: mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} + + - name: Push Bundle to MRT (Demo Site) uses: "./.github/actions/push_to_mrt" with: From bc17df1b417be2aab4349b117cf6705142b6b04c Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 11 Mar 2025 17:08:34 -0700 Subject: [PATCH 54/63] fix else --- .github/workflows/deploy_latest_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index ab661bf82e..a78f816712 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -42,7 +42,7 @@ jobs: if [ "$TAG_NAME" ]; then BUNDLE_NAME="tag ${{ github.event.release.tag_name }}" else - BUNDLE_NAME="build ${{ github.run_id }} on ${{ github.ref }} (${{ github.sha }})"" + BUNDLE_NAME="build ${{ github.run_id }} on ${{ github.ref }} (${{ github.sha }})" fi echo "Setting bundle name as $BUNDLE_NAME" echo "BUNDLE_NAME=$BUNDLE_NAME" >> $GITHUB_ENV From 2aff6f03f8808afc3296f9b058658373a7b87e22 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 11 Mar 2025 17:11:24 -0700 Subject: [PATCH 55/63] Use new step with everything else --- .github/workflows/deploy_latest_release.yml | 83 ++++++++++++--------- 1 file changed, 46 insertions(+), 37 deletions(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index a78f816712..e7f6b37a7b 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -36,10 +36,36 @@ jobs: runs-on: ubuntu-latest if: needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true' steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup node + id: setup_node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: "npm" + + - name: Install Monorepo Dependencies + run: |- + # Install node dependencies + node ./scripts/gtime.js monorepo_install npm ci + + - name: Generate Retail App Demo + uses: ./.github/actions/e2e_generate_app + with: + PROJECT_KEY: "retail-react-app-bug-bounty" + + - name: Create MRT credentials file + uses: "./.github/actions/create_mrt" + with: + mobify_user: ${{ secrets.MOBIFY_STG_CLIENT_USER }} + mobify_api_key: ${{ secrets.MOBIFY_STG_CLIENT_API_KEY }} + - name: Set bundle name run: |- TAG_NAME=$(echo ${{ github.event.release.tag_name }}) - if [ "$TAG_NAME" ]; then + if [ "$TAG_NAME" ]; then BUNDLE_NAME="tag ${{ github.event.release.tag_name }}" else BUNDLE_NAME="build ${{ github.run_id }} on ${{ github.ref }} (${{ github.sha }})" @@ -47,40 +73,14 @@ jobs: echo "Setting bundle name as $BUNDLE_NAME" echo "BUNDLE_NAME=$BUNDLE_NAME" >> $GITHUB_ENV - # - name: Checkout - # uses: actions/checkout@v4 - - # - name: Setup node - # id: setup_node - # uses: actions/setup-node@v4 - # with: - # node-version: 22 - # cache: "npm" - - # - name: Install Monorepo Dependencies - # run: |- - # # Install node dependencies - # node ./scripts/gtime.js monorepo_install npm ci - - # - name: Generate Retail App Demo - # uses: ./.github/actions/e2e_generate_app - # with: - # PROJECT_KEY: "retail-react-app-bug-bounty" - - # - name: Create MRT credentials file - # uses: "./.github/actions/create_mrt" - # with: - # mobify_user: ${{ secrets.MOBIFY_STG_CLIENT_USER }} - # mobify_api_key: ${{ secrets.MOBIFY_STG_CLIENT_API_KEY }} - - # - name: Push Bundle to MRT (Bug Bounty) - # uses: "./.github/actions/push_to_mrt" - # with: - # CWD: "../generated-projects/retail-react-app-bug-bounty" - # TARGET: testing - # PROJECT: pwa-kit - # MESSAGE: $BUNDLE_NAME - # FLAGS: --cloud-origin https://cloud-testing.mobify-staging.com -c ~/.mobify --wait + - name: Push Bundle to MRT (Bug Bounty) + uses: "./.github/actions/push_to_mrt" + with: + CWD: "../generated-projects/retail-react-app-bug-bounty" + TARGET: testing + PROJECT: pwa-kit + MESSAGE: ${{ env.BUNDLE_NAME }}) + FLAGS: --cloud-origin https://cloud-testing.mobify-staging.com -c ~/.mobify --wait deploy-demo-site: needs: check-latest-release @@ -113,7 +113,16 @@ jobs: mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} - + - name: Set bundle name + run: |- + TAG_NAME=$(echo ${{ github.event.release.tag_name }}) + if [ "$TAG_NAME" ]; then + BUNDLE_NAME="tag ${{ github.event.release.tag_name }}" + else + BUNDLE_NAME="build ${{ github.run_id }} on ${{ github.ref }} (${{ github.sha }})" + fi + echo "Setting bundle name as $BUNDLE_NAME" + echo "BUNDLE_NAME=$BUNDLE_NAME" >> $GITHUB_ENV - name: Push Bundle to MRT (Demo Site) uses: "./.github/actions/push_to_mrt" @@ -121,5 +130,5 @@ jobs: CWD: "../generated-projects/retail-react-app-demo-site" TARGET: staging PROJECT: scaffold-pwa - MESSAGE: $BUNDLE_NAME + MESSAGE: ${{ env.BUNDLE_NAME }}) FLAGS: --wait From a9e1e9bd5d03fcfac08c797a3f2c89fbc7cf9dd2 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 11 Mar 2025 17:16:35 -0700 Subject: [PATCH 56/63] redeploy demo site --- .github/workflows/deploy_latest_release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index e7f6b37a7b..3ec1996d53 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -34,7 +34,7 @@ jobs: deploy-bug-bounty: needs: check-latest-release runs-on: ubuntu-latest - if: needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true' + if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true' steps: - name: Checkout uses: actions/checkout@v4 @@ -85,7 +85,7 @@ jobs: deploy-demo-site: needs: check-latest-release runs-on: ubuntu-latest - if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true' + if: needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true' steps: - name: Checkout uses: actions/checkout@v4 From 86e064f6b6f65792f0fbc4bac54ffb18ec5cdc5c Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 11 Mar 2025 17:22:23 -0700 Subject: [PATCH 57/63] Fix conditions after release --- .github/workflows/deploy_latest_release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 3ec1996d53..128855cf57 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -85,7 +85,7 @@ jobs: deploy-demo-site: needs: check-latest-release runs-on: ubuntu-latest - if: needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true' + if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true' steps: - name: Checkout uses: actions/checkout@v4 @@ -128,7 +128,7 @@ jobs: uses: "./.github/actions/push_to_mrt" with: CWD: "../generated-projects/retail-react-app-demo-site" - TARGET: staging + TARGET: production PROJECT: scaffold-pwa MESSAGE: ${{ env.BUNDLE_NAME }}) FLAGS: --wait From dc0de629da3840d0ad1227e04b5e1bcdb4e378f1 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 11 Mar 2025 17:41:55 -0700 Subject: [PATCH 58/63] Test matrix --- .github/workflows/deploy_latest_release.yml | 84 ++++++--------------- 1 file changed, 24 insertions(+), 60 deletions(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 128855cf57..9a98659992 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -31,10 +31,25 @@ jobs: fi echo "IS_LATEST_RELEASE=$IS_LATEST_RELEASE" >> "$GITHUB_OUTPUT" - deploy-bug-bounty: + deploy-sites: needs: check-latest-release runs-on: ubuntu-latest - if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true' + if: needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true' + strategy: + matrix: + environment: + - name: bug-bounty + project_key: retail-react-app-bug-bounty + target: testing + project: pwa-kit + mobify_user: ${{ secrets.MOBIFY_STG_CLIENT_USER }} + mobify_api_key: ${{ secrets.MOBIFY_STG_CLIENT_API_KEY }} + - name: demo-site + project_key: retail-react-app-demo-site + target: production + project: scaffold-pwa + mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} + mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} steps: - name: Checkout uses: actions/checkout@v4 @@ -54,64 +69,13 @@ jobs: - name: Generate Retail App Demo uses: ./.github/actions/e2e_generate_app with: - PROJECT_KEY: "retail-react-app-bug-bounty" + PROJECT_KEY: ${{ matrix.environment.project_key }} - name: Create MRT credentials file uses: "./.github/actions/create_mrt" with: - mobify_user: ${{ secrets.MOBIFY_STG_CLIENT_USER }} - mobify_api_key: ${{ secrets.MOBIFY_STG_CLIENT_API_KEY }} - - - name: Set bundle name - run: |- - TAG_NAME=$(echo ${{ github.event.release.tag_name }}) - if [ "$TAG_NAME" ]; then - BUNDLE_NAME="tag ${{ github.event.release.tag_name }}" - else - BUNDLE_NAME="build ${{ github.run_id }} on ${{ github.ref }} (${{ github.sha }})" - fi - echo "Setting bundle name as $BUNDLE_NAME" - echo "BUNDLE_NAME=$BUNDLE_NAME" >> $GITHUB_ENV - - - name: Push Bundle to MRT (Bug Bounty) - uses: "./.github/actions/push_to_mrt" - with: - CWD: "../generated-projects/retail-react-app-bug-bounty" - TARGET: testing - PROJECT: pwa-kit - MESSAGE: ${{ env.BUNDLE_NAME }}) - FLAGS: --cloud-origin https://cloud-testing.mobify-staging.com -c ~/.mobify --wait - - deploy-demo-site: - needs: check-latest-release - runs-on: ubuntu-latest - if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true' - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup node - id: setup_node - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: "npm" - - - name: Install Monorepo Dependencies - run: |- - # Install node dependencies - node ./scripts/gtime.js monorepo_install npm ci - - - name: Generate Retail App Demo - uses: ./.github/actions/e2e_generate_app - with: - PROJECT_KEY: "retail-react-app-demo-site" - - - name: Create MRT credentials file - uses: "./.github/actions/create_mrt" - with: - mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} - mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} + mobify_user: ${{ matrix.environment.mobify_user }} + mobify_api_key: ${{ matrix.environment.mobify_api_key }} - name: Set bundle name run: |- @@ -124,11 +88,11 @@ jobs: echo "Setting bundle name as $BUNDLE_NAME" echo "BUNDLE_NAME=$BUNDLE_NAME" >> $GITHUB_ENV - - name: Push Bundle to MRT (Demo Site) + - name: Push Bundle to MRT (${{matrix.environment.name}}) uses: "./.github/actions/push_to_mrt" with: - CWD: "../generated-projects/retail-react-app-demo-site" - TARGET: production - PROJECT: scaffold-pwa + CWD: "../generated-projects/${{ matrix.environment.project_key }}" + TARGET: ${{ matrix.environment.target }} + PROJECT: ${{ matrix.environment.project }} MESSAGE: ${{ env.BUNDLE_NAME }}) FLAGS: --wait From 193485bd881597f5b28fe783b499949389454f39 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 11 Mar 2025 17:46:28 -0700 Subject: [PATCH 59/63] Handle secrets outside of matrix --- .github/workflows/deploy_latest_release.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 9a98659992..85b03892ca 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -42,14 +42,14 @@ jobs: project_key: retail-react-app-bug-bounty target: testing project: pwa-kit - mobify_user: ${{ secrets.MOBIFY_STG_CLIENT_USER }} - mobify_api_key: ${{ secrets.MOBIFY_STG_CLIENT_API_KEY }} + mobify_user: MOBIFY_STG_CLIENT_USER + mobify_api_key: MOBIFY_STG_CLIENT_API_KEY - name: demo-site project_key: retail-react-app-demo-site target: production project: scaffold-pwa - mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} - mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} + mobify_user: MOBIFY_CLIENT_USER + mobify_api_key: secrets.MOBIFY_CLIENT_API_KEY steps: - name: Checkout uses: actions/checkout@v4 @@ -74,8 +74,8 @@ jobs: - name: Create MRT credentials file uses: "./.github/actions/create_mrt" with: - mobify_user: ${{ matrix.environment.mobify_user }} - mobify_api_key: ${{ matrix.environment.mobify_api_key }} + mobify_user: ${{ secrets[matrix.environment.mobify_user] }} + mobify_api_key: ${{ secrets[environment.mobify_api_key] }} - name: Set bundle name run: |- From 3c3fa8bc4754d3c937c52c948c68ccfabae0a49d Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 11 Mar 2025 17:47:08 -0700 Subject: [PATCH 60/63] test --- .github/workflows/deploy_latest_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 85b03892ca..a5a0b9153b 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -75,7 +75,7 @@ jobs: uses: "./.github/actions/create_mrt" with: mobify_user: ${{ secrets[matrix.environment.mobify_user] }} - mobify_api_key: ${{ secrets[environment.mobify_api_key] }} + mobify_api_key: ${{ secrets[matrix.environment.mobify_api_key] }} - name: Set bundle name run: |- From 0294eb95b7320cf45a59a4bfeda764878c2594a9 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 11 Mar 2025 17:52:06 -0700 Subject: [PATCH 61/63] Fix api key name --- .github/workflows/deploy_latest_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index a5a0b9153b..1684807a2e 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -49,7 +49,7 @@ jobs: target: production project: scaffold-pwa mobify_user: MOBIFY_CLIENT_USER - mobify_api_key: secrets.MOBIFY_CLIENT_API_KEY + mobify_api_key: MOBIFY_CLIENT_API_KEY steps: - name: Checkout uses: actions/checkout@v4 From 7d25a038de6af4a605cd92abc4e9403990da3da9 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 11 Mar 2025 18:13:23 -0700 Subject: [PATCH 62/63] Set flags and don't fail-fast --- .github/workflows/deploy_latest_release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 1684807a2e..854754acf9 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -36,6 +36,7 @@ jobs: runs-on: ubuntu-latest if: needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true' strategy: + fail-fast: false matrix: environment: - name: bug-bounty @@ -44,12 +45,14 @@ jobs: project: pwa-kit mobify_user: MOBIFY_STG_CLIENT_USER mobify_api_key: MOBIFY_STG_CLIENT_API_KEY + flags: --cloud-origin https://cloud-testing.mobify-staging.com -c ~/.mobify --wait - name: demo-site project_key: retail-react-app-demo-site target: production project: scaffold-pwa mobify_user: MOBIFY_CLIENT_USER mobify_api_key: MOBIFY_CLIENT_API_KEY + flags: --wait steps: - name: Checkout uses: actions/checkout@v4 @@ -95,4 +98,4 @@ jobs: TARGET: ${{ matrix.environment.target }} PROJECT: ${{ matrix.environment.project }} MESSAGE: ${{ env.BUNDLE_NAME }}) - FLAGS: --wait + FLAGS: ${{ matrix.environment.flags }} From 3fd0db6232a818641d84d72d38fc22b5ad305555 Mon Sep 17 00:00:00 2001 From: vcua-mobify Date: Tue, 11 Mar 2025 18:19:48 -0700 Subject: [PATCH 63/63] Reapply on release condition --- .github/workflows/deploy_latest_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_latest_release.yml b/.github/workflows/deploy_latest_release.yml index 854754acf9..5edb0cc765 100644 --- a/.github/workflows/deploy_latest_release.yml +++ b/.github/workflows/deploy_latest_release.yml @@ -34,7 +34,7 @@ jobs: deploy-sites: needs: check-latest-release runs-on: ubuntu-latest - if: needs.check-latest-release.outputs.IS_LATEST_RELEASE != 'true' + if: needs.check-latest-release.outputs.IS_LATEST_RELEASE == 'true' strategy: fail-fast: false matrix: