Skip to content

Commit

Permalink
Merge develop into bfh 20220302 (#434)
Browse files Browse the repository at this point in the history
* Fix SDK's peer dependencies versioning (#432)

Previously the range was matching all possible versions. Now matching React 16 and 17 only.

* Node warnings with better version formatting (#410)

The node version range is now taken from the engines field of the package.json, which is more readable than seeing semver's representation (>=12.0.0 <13.0.0-0||>=14.0.0 <15.0.0-0).

* [Circle CI] Add test generated project job on Windows (#412)

* Update config.yml

* Add `generatedSFCCProjectTestWindows` test job

* Test not using gtime.js script

* Increase log verbosity

* Run first the CI job generated project on Windows

* Use  outputDir generated-project

* Use execSync

* Update npx pwa-kit-create-app command

* Use process.argv as outputDir

* Test execFileSync

* Add try/catch to execSync

* Show npm i logging

* Show npm install logs as we do in the BFH branch

* Show verdaccio logs

* More logs npm install verbose

* Use Node child_process & Update verdaccio config & bump version

* Use verdaccio npmjs cache true

* Set GENERATOR_PRESET env variable

* Update create-mobify-app.js

* Test using a xlarge Windows machine

* Increase Verdaccio max_fails config

* Remove server keepAliveTimeout

* Dump all Verdaccio logs to a file for debugging

* Fix smoketestscripts on Windows

* Add Circle CI unit to the scripts path

* Really fix smoketestscripts Circle CI job on Windows

* Update config.yml

* More testing smoke test script on Windows

* And more testing smoke test script on Windows

* smoketestscripts job working on Windows

* fix typo

* Clean up

* More clean up

* Update latest v4 verdaccio

* Remove file from bad merge

Co-authored-by: Vincent Marta <vmarta@salesforce.com>
  • Loading branch information
adamraya and vmarta authored Mar 22, 2022
1 parent 088ce8b commit ddac0ca
Show file tree
Hide file tree
Showing 7 changed files with 463 additions and 543 deletions.
89 changes: 53 additions & 36 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ commands:
name: 'Smoke test scripts'
command: |
# Basic smoke-tests for uncommonly run scripts in a project
node /home/circleci/project/scripts/smoke-test-npm-scripts.js --dir << parameters.dir >>
node ./scripts/smoke-test-npm-scripts.js --dir << parameters.dir >>
lighthouse-ci:
description: 'Run Lighthouse CI on the PWA'
steps:
Expand All @@ -158,6 +158,46 @@ commands:
# that would prevent Lerna from publishing (Lerna gets this right).
git diff --exit-code
generate_and_test_project:
description: 'Generate project'
steps:
- run:
name: Generate project
environment:
GENERATOR_PRESET: 'test-project'
command: |
set GENERATOR_PRESET=test-project
node packages/pwa-kit-create-app/scripts/create-mobify-app-dev.js --outputDir generated-project
cd generated-project
npm run prod:build
- run:
name: Generate hello-world project
environment:
GENERATOR_PRESET: 'hello-world-test-project'
command: |
set GENERATOR_PRESET=hello-world-test-project
node packages/pwa-kit-create-app/scripts/create-mobify-app-dev.js --outputDir generated-project-hello-world
- runtests:
cwd: generated-project
- smoketestscripts:
dir: generated-project
- run:
name: Count Generated Project Dependencies
environment:
command: |
MAX_PACKAGES="2250"
total=$(./scripts/count-dependencies.js generated-project)
echo "export TOTAL_PACKAGES=${total}" >> $BASH_ENV;
source $BASH_ENV
if [ "$total" -gt "$MAX_PACKAGES" ]; then
echo "Error: Found $TOTAL_PACKAGES installed packages (max $MAX_PACKAGES).";
exit 1;
else
echo "Found $TOTAL_PACKAGES installed packages (max $MAX_PACKAGES).";
fi
early_return_for_forked_pull_requests:
description: >-
If this build is from a fork, stop executing the current job and return success.
Expand Down Expand Up @@ -270,41 +310,8 @@ jobs:
steps:
- checkout
- setup
- run:
name: Generate project
environment:
GENERATOR_PRESET: 'test-project'
command: |
node ./scripts/gtime.js generated_project_install \
node packages/pwa-kit-create-app/scripts/create-mobify-app-dev.js --outputDir /tmp/project
- generate_and_test_project

cd /tmp/project
npm run build
- run:
name: Generate hello-world project
environment:
GENERATOR_PRESET: 'hello-world-test-project'
command: |
node packages/pwa-kit-create-app/scripts/create-mobify-app-dev.js --outputDir /tmp/hello-world
- runtests:
cwd: /tmp/project
- smoketestscripts:
dir: /tmp/project
- run:
name: Count Generated Project Dependencies
environment:
command: |
MAX_PACKAGES="2500"
total=$(./scripts/count-dependencies.js /tmp/project)
echo "export TOTAL_PACKAGES=${total}" >> $BASH_ENV;
source $BASH_ENV
if [ "$total" -gt "$MAX_PACKAGES" ]; then
echo "Error: Found $TOTAL_PACKAGES installed packages (max $MAX_PACKAGES).";
exit 1;
else
echo "Found $TOTAL_PACKAGES installed packages (max $MAX_PACKAGES).";
fi
- early_return_for_forked_pull_requests
- slack/status:
fail_only: true
Expand Down Expand Up @@ -348,9 +355,18 @@ jobs:
target=""
fi
if [[ $target ]]; then
cd /tmp/project
cd generated-project
npm run push -- --message "Generated PWA build ${CIRCLE_BUILD_NUM} on ${CIRCLE_BRANCH} (${CIRCLE_SHA1})" --target $target
fi
generatedSFCCProjectTestWindows:
executor:
name: win/default
size: "large"
shell: bash.exe
steps:
- checkout
- setup_windows
- generate_and_test_project

workflows:
version: 2
Expand All @@ -362,6 +378,7 @@ workflows:
- testNode14npm7
- testNode14npm8
- generatedSFCCProjectTest
- generatedSFCCProjectTestWindows
nightly-build:
triggers:
- schedule:
Expand Down
7 changes: 3 additions & 4 deletions packages/pwa-kit-create-app/local-npm-repo/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ auth:
uplinks:
npmjs:
url: https://registry.npmjs.org/
max_fails: 100
cache: false

# Allow anybody to publish any package, with no auth.
Expand All @@ -19,6 +20,7 @@ packages:
access: $all
publish: $all
proxy: npmjs

'**':
access: $all
publish: $all
Expand All @@ -28,7 +30,4 @@ publish:
allow_offline: true

logs:
- {type: stdout, format: pretty, level: http}

server:
keepAliveTimeout: 0
- {type: file, path: ./verdaccio.log, level: warn}
Loading

0 comments on commit ddac0ca

Please sign in to comment.