Skip to content

Commit 36ffe82

Browse files
vcua-mobifyshauryemahajanSFpatricksullivansfsf-henry-semagandavmarta
authored
@W-19330454@ - Release PWA Kit 3.12.0-preview.3 (#3229)
* bump versions and update changelogs * Add breaking label to multi-ship changelog entry * snyc to -preview.2 * @W-19442561 - Fix Incorrectly Disabled Continue to Shipping Method Button for Multiship (#3199) * @W-19443375,@W-19350149 MULTISHIP fix address function mismatch and options promotions (#3203) * @W-19451314 - Add ShipmentId to Create Shipment Body (#3211) * @W-19349040 MULTISHIP fix form default delivery option selection (#3217) * @ W-19450629 feat: remove quantity selector from shipping methods preview cart in multi-ship (#3216) * remove quantity selector from shipping methods preview cart in multi ship * update change log --------- Signed-off-by: sf-henry-semaganda <henry.semaganda@salesforce.com> * Fix non-extensible template to use correct passwordless login callback uri (#3222) * Check if monorepo is a dev version before publishing to npm (#3210) * Check if monorepo is a dev version before publishing to npm * Check env.IS_DEV_VERSION * test step * test * Apply suggestion * More test * test * test * test * use if block * test * test * use quiet mode * test * test * test * test * test * test * test * Try this regex that's perhaps more compatible * Re-enable other steps and clean up verification step --------- Co-authored-by: Vincent Marta <vmarta@salesforce.com> * Merge pull request #3204 from SalesforceCommerceCloud/bugfix/pin-testing-library-version @W-19443536 - [Bugfix] Fix unit test failures in generated projects * Fix: Don't pass `code_challenge` if its undefined in `getPasswordResetToken` (#3228) * add fix * make code challenge optional * lint --------- Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> * @W-19364221 - Handle Removal of Last Address for Registered (#3231) * Gracefully handle when some config.app.* properties are missing (@W-19453183@) (#3230) * Don't assume that config.app.* properties exist * Don't assume that config.app.* properties exist * Add todos * Use the default config for Commerce Agent when necessary * Debugging * Move utils file to somewhere more upgradable and extensible * No longer need these .hbs files * Sync the corresponding .hbs files * Fix import path * Fix require path so it can work inside monorepo * Refactor to make it easier to get commerce agent config * Fix module error Turns out that I can't mix both esm and commonjs ways. * Sync the eslint comments * Remove commented out code * Update CHANGELOG.md --------- Signed-off-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> * @W-19364130 feat: fix shipping costs summary mode pricing (#3240) * fix shipping costs sumary mode * update change log * add clear annotation * add test coverage * update basket too * update * bump versions to -preview.3 * Merge pull request #3214 from SalesforceCommerceCloud/restore-per-pr-e2e Restore e2e-PR workflow * Fix e2e-pr after incorrect merge resolution * preview.3 not preview-3 --------- Signed-off-by: sf-henry-semaganda <henry.semaganda@salesforce.com> Signed-off-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: shauryemahajanSF <143645277+shauryemahajanSF@users.noreply.github.com> Co-authored-by: patricksullivansf <100441292+patricksullivansf@users.noreply.github.com> Co-authored-by: sf-henry-semaganda <henry.semaganda@salesforce.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Jainam Sheth <99490559+shethj@users.noreply.github.com> Co-authored-by: Joel Uong <88680517+joeluong-sfcc@users.noreply.github.com>
1 parent c0d7ff4 commit 36ffe82

File tree

120 files changed

+9773
-8536
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+9773
-8536
lines changed

.github/actions/count_deps/action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
name: count_deps
2+
inputs:
3+
project_dir:
4+
description: 'Path to the project directory'
5+
required: true
26
runs:
37
using: composite
48
steps:
59
- name: Count Generated Project Dependencies
610
# TODO: Can TOTAL_PACKAGES be exported in a cleaner way?
711
run: |-
812
MAX_PACKAGES="2260"
9-
total=$(./scripts/count-dependencies.js generated-${{ matrix.template }})
13+
total=$(./scripts/count-dependencies.js "${{ inputs.project_dir }}")
1014
echo "TOTAL_PACKAGES=${total}" >> $GITHUB_ENV
1115
1216
if [ "$total" -gt "$MAX_PACKAGES" ]; then

.github/actions/e2e_validate_generated_app/action.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,21 @@ runs:
1414
steps:
1515
- name: Validate generated project
1616
run: |
17-
set -e
18-
COMMAND="node e2e/scripts/validate-generated-project.js ${{ inputs.PROJECT_KEY }}"
17+
set -euo pipefail
18+
19+
COMMAND=(node e2e/scripts/validate-generated-project.js "${{ inputs.PROJECT_KEY }}")
20+
1921
if [[ -n "${{ inputs.TEMPLATE_VERSION }}" ]]; then
20-
COMMAND="$COMMAND --templateVersion ${{ inputs.TEMPLATE_VERSION }}"
22+
COMMAND+=(--templateVersion "${{ inputs.TEMPLATE_VERSION }}")
2123
fi
22-
$COMMAND
24+
25+
echo "Executing command: ${COMMAND[*]}"
26+
27+
if ! "${COMMAND[@]}"; then
28+
echo "❌ Node.js validation script failed with exit code $?"
29+
echo "::error::Validation of generated project failed"
30+
exit 1
31+
fi
32+
33+
echo "✅ Project validation completed successfully"
2334
shell: bash

.github/workflows/e2e-pr.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ jobs:
7676
if: ${{ env.SKIP_WORKFLOW != 'true' }}
7777
run: |-
7878
jq -r 'to_entries[] | "\(.key)=\(.value // "")"' e2e/mrt-target/mrt-target-details.json >> "$GITHUB_OUTPUT"
79-
# Set the RETAIL_APP_HOME environment variable to the MRT target URL.
80-
# This is used by the e2e tests to run the tests against the MRT target.
81-
echo "RETAIL_APP_HOME=${{ steps.mrt_target_details.outputs.envURL }}" >> "$GITHUB_ENV"
8279
8380
# Engage post-run cleanup via a Node action that has a post hook.
8481
# - The action defines `runs.post` so its post step runs at the
@@ -178,4 +175,8 @@ jobs:
178175
- name: Run Playwright tests
179176
if: ${{ env.SKIP_WORKFLOW != 'true' }}
180177
run: |
181-
npx playwright test --project=chromium --project=mobile-chrome --project=a11y-mobile --project=a11y-desktop --workers=4
178+
# Set the RETAIL_APP_HOME environment variable to the MRT target URL.
179+
# This is used by the e2e tests to run the tests against the MRT target.
180+
export RETAIL_APP_HOME="https://${{ steps.mrt_target_details.outputs.ssrExternalHostname }}"
181+
echo "RETAIL_APP_HOME environment variable value: $RETAIL_APP_HOME"
182+
npx playwright test --project=chromium --project=mobile-chrome --project=a11y-mobile-slas-private-client --project=a11y-desktop-slas-private-client --workers=4

.github/workflows/e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ jobs:
266266

267267
- name: Run a11y test for Node 22 with npm 11
268268
if: env.IS_MRT_NODE == 'true'
269-
run: npm run test:e2e:a11y
269+
run: npm run test:e2e:a11y:slas-public-client
270270

271271
notify-slack-pwa-ext:
272272
needs: [run-generator-retail-app-ext]

.github/workflows/test.yml

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ jobs:
8787
- name: Run unit tests
8888
uses: "./.github/actions/unit_tests"
8989

90-
91-
9290
- name: Smoke test scripts
9391
if: env.IS_DEFAULT_NPM == 'true'
9492
uses: "./.github/actions/smoke_tests"
@@ -119,8 +117,20 @@ jobs:
119117
if: env.IS_NOT_FORK == 'true' && env.IS_DEFAULT_NPM == 'true'
120118
uses: "./.github/actions/check_clean"
121119

120+
- name: Check if monorepo version is a dev version
121+
run: |-
122+
version=`jq -r ".version" package.json`
123+
echo "The monorepo version is $version"
124+
if echo "$version" | grep -Eiq "[0-9]-dev(\.|$)"; then
125+
echo "Dev version detected."
126+
echo "IS_DEV_VERSION=true" >> "$GITHUB_ENV"
127+
else
128+
echo "Monorepo is not on a dev version."
129+
echo "IS_DEV_VERSION=false" >> "$GITHUB_ENV"
130+
fi
131+
122132
- name: Publish to NPM
123-
if: env.IS_NOT_FORK == 'true' && env.IS_MRT_NODE == 'true' && env.RELEASE == 'true'
133+
if: env.IS_NOT_FORK == 'true' && env.IS_MRT_NODE == 'true' && env.RELEASE == 'true' && env.IS_DEV_VERSION == 'false'
124134
uses: "./.github/actions/publish_to_npm"
125135
with:
126136
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
@@ -188,7 +198,6 @@ jobs:
188198
runs-on: ubuntu-latest
189199
env:
190200
IS_TEMPLATE_FROM_RETAIL_REACT_APP: ${{ matrix.template == 'retail-react-app-test-project' || matrix.template == 'retail-react-app-demo' }}
191-
PROJECT_DIR: generated-${{ matrix.template }}
192201
steps:
193202
- name: Checkout
194203
uses: actions/checkout@v4
@@ -201,31 +210,39 @@ jobs:
201210
- name: Setup Ubuntu Machine
202211
uses: "./.github/actions/setup_ubuntu"
203212

213+
- name: Set project directory with generated projects path
214+
run: |
215+
GENERATED_PROJECTS_DIR=$(node -e "console.log(require('./e2e/config.js').GENERATED_PROJECTS_DIR)")
216+
echo "PATH_TO_PROJECT_DIR=$GENERATED_PROJECTS_DIR/generated-${{ matrix.template }}" >> $GITHUB_ENV
217+
218+
- name: Create generated-projects directory
219+
run: mkdir -p "$(dirname "${{ env.PATH_TO_PROJECT_DIR }}")"
220+
204221
- name: Generate ${{ matrix.template }} project
205222
run: |-
206-
node packages/pwa-kit-create-app/scripts/create-mobify-app-dev.js --outputDir ${{ env.PROJECT_DIR }}
223+
node packages/pwa-kit-create-app/scripts/create-mobify-app-dev.js --outputDir "${{ env.PATH_TO_PROJECT_DIR }}"
207224
env:
208225
GENERATOR_PRESET: ${{ matrix.template }}
209226
timeout-minutes: 8
210227

211-
212-
213228
- name: Run unit tests
214229
if: env.IS_TEMPLATE_FROM_RETAIL_REACT_APP == 'true'
215230
uses: "./.github/actions/unit_tests"
216231
with:
217-
cwd: ${{ env.PROJECT_DIR }}
232+
cwd: ${{ env.PATH_TO_PROJECT_DIR }}
218233

219234
- name: Run smoke tests
220235
if: env.IS_TEMPLATE_FROM_RETAIL_REACT_APP == 'true'
221236
uses: "./.github/actions/smoke_tests"
222237
with:
223-
dir: ${{ env.PROJECT_DIR }}
238+
dir: ${{ env.PATH_TO_PROJECT_DIR }}
224239

225240
- name: Count Generated Project Dependencies
226241
id: count_deps
227242
if: env.IS_TEMPLATE_FROM_RETAIL_REACT_APP == 'true'
228243
uses: "./.github/actions/count_deps"
244+
with:
245+
project_dir: ${{ env.PATH_TO_PROJECT_DIR }}
229246

230247
- name: Store Verdaccio logfile artifact
231248
uses: actions/upload-artifact@v4
@@ -260,7 +277,7 @@ jobs:
260277
if: env.IS_NOT_FORK == 'true' && env.DEVELOP == 'true' && matrix.template == 'retail-react-app-test-project'
261278
uses: "./.github/actions/push_to_mrt"
262279
with:
263-
CWD: ${{ env.PROJECT_DIR }}
280+
CWD: ${{ env.PATH_TO_PROJECT_DIR }}
264281
TARGET: generated-pwa
265282

266283
- name: Send GitHub Action data to Slack workflow (Generated)
@@ -283,7 +300,6 @@ jobs:
283300
runs-on: windows-latest
284301
env:
285302
IS_TEMPLATE_FROM_RETAIL_REACT_APP: ${{ matrix.template == 'retail-react-app-test-project' || matrix.template == 'retail-react-app-demo' }}
286-
PROJECT_DIR: generated-${{ matrix.template }}
287303
steps:
288304
- name: Checkout
289305
uses: actions/checkout@v4
@@ -296,30 +312,40 @@ jobs:
296312
- name: Setup Windows Machine
297313
uses: "./.github/actions/setup_windows"
298314

315+
- name: Set project directory with generated projects path
316+
run: |
317+
GENERATED_PROJECTS_DIR=$(node -e "console.log(require('./e2e/config.js').GENERATED_PROJECTS_DIR)")
318+
echo "PATH_TO_PROJECT_DIR=$GENERATED_PROJECTS_DIR/generated-${{ matrix.template }}" >> $GITHUB_ENV
319+
shell: bash
320+
321+
- name: Create generated-projects directory
322+
run: mkdir -p "$(dirname "${{ env.PATH_TO_PROJECT_DIR }}")"
323+
shell: bash
324+
299325
- name: Generate ${{ matrix.template }} project
300326
run: |-
301-
node packages/pwa-kit-create-app/scripts/create-mobify-app-dev.js --outputDir ${{ env.PROJECT_DIR }}
327+
node packages/pwa-kit-create-app/scripts/create-mobify-app-dev.js --outputDir "${{ env.PATH_TO_PROJECT_DIR }}"
302328
env:
303329
GENERATOR_PRESET: ${{ matrix.template }}
304330
timeout-minutes: 7
305331

306-
307-
308332
- name: Run unit tests
309333
if: env.IS_TEMPLATE_FROM_RETAIL_REACT_APP == 'true'
310334
uses: "./.github/actions/unit_tests"
311335
with:
312-
cwd: ${{ env.PROJECT_DIR }}
336+
cwd: ${{ env.PATH_TO_PROJECT_DIR }}
313337

314338
- name: Run smoke tests
315339
if: env.IS_TEMPLATE_FROM_RETAIL_REACT_APP == 'true'
316340
uses: "./.github/actions/smoke_tests"
317341
with:
318-
dir: ${{ env.PROJECT_DIR }}
342+
dir: ${{ env.PATH_TO_PROJECT_DIR }}
319343

320344
- name: Count Generated Project Dependencies
321345
if: env.IS_TEMPLATE_FROM_RETAIL_REACT_APP == 'true'
322346
uses: "./.github/actions/count_deps"
347+
with:
348+
project_dir: ${{ env.PATH_TO_PROJECT_DIR }}
323349

324350
- name: Store Verdaccio logfile artifact
325351
uses: actions/upload-artifact@v4

e2e/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = {
3434
},
3535
{
3636
expectedPrompt: /Do you wish to use template extensibility?/i,
37-
response: '2\n'
37+
response: '1\n'
3838
},
3939
{
4040
expectedPrompt: /What is the name of your Project?/i,
@@ -72,7 +72,7 @@ module.exports = {
7272
},
7373
{
7474
expectedPrompt: /Do you wish to use template extensibility?/i,
75-
response: '1\n'
75+
response: '2\n'
7676
},
7777
{
7878
expectedPrompt: /What is the name of your Project?/i,

0 commit comments

Comments
 (0)