From 3c2cdb80b9b539eda92312b1ab2f20cfaa484220 Mon Sep 17 00:00:00 2001 From: Tom Milewski Date: Tue, 24 Oct 2023 14:15:28 -0700 Subject: [PATCH 1/3] ci(repo): Update CI flow; Integrate Turbo caching --- .github/workflows/ci.yml | 184 +++++++++++++++++++++++++++++ package-lock.json | 246 ++++++++++----------------------------- package.json | 2 +- turbo.json | 9 +- verdaccio.yaml | 19 +++ 5 files changed, 266 insertions(+), 194 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 verdaccio.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000000..f1bc52b97a8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,184 @@ +name: CI + +on: + workflow_dispatch: + merge_group: + pull_request: + branches: + - main + +env: + FORCE_COLOR: '1' + NODE_VERSION: '18' + TURBO_ARGS: --output-logs=new-only --cache-dir=./.turbo-cache --concurrency=8 + TURBO_TOKEN: ${{ secrets.TEST_TURBO_TOKEN }} + TURBO_TEAM: ${{ secrets.TEST_TURBO_TEAM }} + TURBO_REMOTE_CACHE_SIGNATURE_KEY: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + TURBO_REMOTE_ONLY: true + TURBO_CONCURRENCY: 8 # Available CPU in RUNNER_LARGE + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + formatting-linting: + name: Formatting & Linting + runs-on: ${{ vars.RUNNER_LARGE }} + env: + TURBO_REMOTE_ONLY: false + + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + show-progress: false + + - name: Setup NodeJS ${{ env.NODE_VERSION }} + uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Cache node_modules + uses: actions/cache@v3 + id: npm-cache + with: + path: ./node_modules + key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-node-modules-${{ hashFiles('**/package-lock.json') }} + + - name: Install NPM Dependencies + if: steps.npm-cache.outputs.cache-hit != 'true' + run: npm ci --audit=false --fund=false + + - name: Require Changeset + run: if [ "${{ github.event.pull_request.user.login }}" = "clerk-cookie" ]; then echo 'Skipping' && exit 0; else npx changeset status --since=origin/main; fi + + - name: Check Formatting + run: npm run format:check + + - name: Lint packages using publint + run: npm run lint:publint -- ${{ env.TURBO_ARGS }} + + - name: Lint types using attw + run: npm run lint:attw -- ${{ env.TURBO_ARGS }} + continue-on-error: true # TODO: Remove this when all related errors are fixed + + - name: Run lint + run: npm run lint -- ${{ env.TURBO_ARGS }} -- --quiet + + unit-tests: + name: Unit Tests + needs: formatting-linting + runs-on: ${{ vars.RUNNER_LARGE }} + + strategy: + matrix: + node-version: [ 18, 20 ] + + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + show-progress: false + + - name: Setup NodeJS ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Cache node_modules + uses: actions/cache@v3 + id: npm-cache + with: + path: ./node_modules + key: ${{ runner.os }}-node-${{ matrix.node-version }}-node-modules-${{ hashFiles('**/package-lock.json') }} + + - name: Install NPM Dependencies + if: steps.npm-cache.outputs.cache-hit != 'true' + run: npm ci --audit=false --fund=false + + - name: Run tests + run: npx turbo test ${{ env.TURBO_ARGS }} + env: + NODE_VERSION: ${{ matrix.node-version }} + + integration-tests: + name: Integration Tests + needs: formatting-linting + runs-on: ${{ vars.RUNNER_LARGE }} + + strategy: + matrix: + test-name: [ 'generic', 'nextjs', 'remix' ] + + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + show-progress: false + + - name: Setup NodeJS ${{ env.NODE_VERSION }} + uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Cache node_modules + uses: actions/cache@v3 + id: npm-cache + with: + path: ./node_modules + key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-node-modules-${{ hashFiles('**/package-lock.json') }} + + - name: Install NPM Dependencies + if: steps.npm-cache.outputs.cache-hit != 'true' + run: npm ci --audit=false --fund=false + + - name: Get Playwright Version + id: playwright-version + run: echo "VERSION=$(node -e "console.log($(npm ls @playwright/test --json).dependencies['@playwright/test'].version)")" >> "$GITHUB_OUTPUT" + + - name: Cache Playwright Binaries + uses: actions/cache@v3 + id: playwright-cache + with: + path: ~/.cache/ms-playwright + key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-playwright-${{ steps.playwright-version.outputs.VERSION }} + + - name: Install Playwright Browsers + if: steps.playwright-cache.outputs.cache-hit != 'true' + run: npx playwright install --with-deps + + - name: Update NPM Registry + run: npm set registry http://localhost:4873/ + + - name: Run Verdaccio + run: | + nohup ./node_modules/.bin/verdaccio --config ./verdaccio.yaml & sleep 5 + ./node_modules/.bin/npm-cli-adduser -u user -p pass -e test@test.com -r http://localhost:4873/ + ./node_modules/.bin/npm-cli-login -u user -p pass -e test@test.com -r http://localhost:4873/ + + - name: Publish to Verdaccio + run: | + if [ "$(npm config get registry)" = "https://registry.npmjs.org/" ]; then echo 'Error: Using default registry' && exit 1; else npx turbo build ${{ env.TURBO_ARGS }} && npx changeset publish --no-git-tag; fi + + - name: Install @clerk/backend in /integration + working-directory: ./integration + run: npm init -y && npm install @clerk/backend + + - name: Run Playwright tests + run: npm run test:integration:${{ matrix.test-name }} + env: + INTEGRATION_INSTANCE_KEYS: ${{ secrets.INTEGRATION_INSTANCE_KEYS }} + MAILSAC_API_KEY: ${{ secrets.MAILSAC_API_KEY }} + E2E_CLERK_VERSION: 'latest' + + - name: Upload Playwright Report for ${{ matrix.test-name }} + uses: actions/upload-artifact@v3 + if: always() + with: + name: playwright-report-${{ github.ref }}-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.test-name }} + path: playwright-report/ + retention-days: 1 diff --git a/package-lock.json b/package-lock.json index a7ca31b48c5..d33e6291ee4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@commitlint/config-conventional": "^17.7.0", "@emotion/jest": "^11.11.0", "@faker-js/faker": "^8.1.0", - "@playwright/test": "^1.38.1", + "@playwright/test": "^1.39.0", "@testing-library/dom": "^8.19.0", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", @@ -68,7 +68,6 @@ }, "node_modules/@aashutoshrathi/word-wrap": { "version": "1.2.6", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -3915,7 +3914,6 @@ }, "node_modules/@eslint/eslintrc": { "version": "2.1.2", - "dev": true, "license": "MIT", "dependencies": { "ajv": "^6.12.4", @@ -3937,12 +3935,10 @@ }, "node_modules/@eslint/eslintrc/node_modules/argparse": { "version": "2.0.1", - "dev": true, "license": "Python-2.0" }, "node_modules/@eslint/eslintrc/node_modules/globals": { "version": "13.21.0", - "dev": true, "license": "MIT", "dependencies": { "type-fest": "^0.20.2" @@ -3956,7 +3952,6 @@ }, "node_modules/@eslint/eslintrc/node_modules/js-yaml": { "version": "4.1.0", - "dev": true, "license": "MIT", "dependencies": { "argparse": "^2.0.1" @@ -3967,7 +3962,6 @@ }, "node_modules/@eslint/js": { "version": "8.49.0", - "dev": true, "license": "MIT", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -4224,7 +4218,6 @@ }, "node_modules/@fastify/ajv-compiler": { "version": "3.5.0", - "dev": true, "license": "MIT", "dependencies": { "ajv": "^8.11.0", @@ -4234,7 +4227,6 @@ }, "node_modules/@fastify/ajv-compiler/node_modules/ajv": { "version": "8.12.0", - "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", @@ -4249,22 +4241,18 @@ }, "node_modules/@fastify/ajv-compiler/node_modules/json-schema-traverse": { "version": "1.0.0", - "dev": true, "license": "MIT" }, "node_modules/@fastify/deepmerge": { "version": "1.3.0", - "dev": true, "license": "MIT" }, "node_modules/@fastify/error": { "version": "3.2.1", - "dev": true, "license": "MIT" }, "node_modules/@fastify/fast-json-stringify-compiler": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "fast-json-stringify": "^5.7.0" @@ -4863,7 +4851,6 @@ }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.11", - "dev": true, "license": "Apache-2.0", "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", @@ -4876,7 +4863,6 @@ }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", - "dev": true, "license": "Apache-2.0", "engines": { "node": ">=12.22" @@ -4888,7 +4874,6 @@ }, "node_modules/@humanwhocodes/object-schema": { "version": "1.2.1", - "dev": true, "license": "BSD-3-Clause" }, "node_modules/@iarna/toml": { @@ -7209,11 +7194,12 @@ } }, "node_modules/@playwright/test": { - "version": "1.38.1", + "version": "1.39.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.39.0.tgz", + "integrity": "sha512-3u1iFqgzl7zr004bGPYiN/5EZpRUSFddQBra8Rqll5N0/vfpqlP9I9EXqAoGacuAbX6c9Ulg/Cjqglp5VkK6UQ==", "dev": true, - "license": "Apache-2.0", "dependencies": { - "playwright": "1.38.1" + "playwright": "1.39.0" }, "bin": { "playwright": "cli.js" @@ -9689,7 +9675,6 @@ }, "node_modules/abort-controller": { "version": "3.0.0", - "dev": true, "license": "MIT", "dependencies": { "event-target-shim": "^5.0.0" @@ -9705,7 +9690,6 @@ }, "node_modules/abstract-logging": { "version": "2.0.1", - "dev": true, "license": "MIT" }, "node_modules/accepts": { @@ -9722,7 +9706,6 @@ }, "node_modules/acorn": { "version": "8.10.0", - "dev": true, "license": "MIT", "bin": { "acorn": "bin/acorn" @@ -9750,7 +9733,6 @@ }, "node_modules/acorn-jsx": { "version": "5.3.2", - "dev": true, "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" @@ -9796,7 +9778,6 @@ }, "node_modules/ajv": { "version": "6.12.6", - "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", @@ -9811,7 +9792,6 @@ }, "node_modules/ajv-formats": { "version": "2.1.1", - "dev": true, "license": "MIT", "dependencies": { "ajv": "^8.0.0" @@ -9827,7 +9807,6 @@ }, "node_modules/ajv-formats/node_modules/ajv": { "version": "8.12.0", - "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", @@ -9842,7 +9821,6 @@ }, "node_modules/ajv-formats/node_modules/json-schema-traverse": { "version": "1.0.0", - "dev": true, "license": "MIT" }, "node_modules/ajv-keywords": { @@ -9912,7 +9890,6 @@ }, "node_modules/ansi-regex": { "version": "5.0.1", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -9998,7 +9975,6 @@ }, "node_modules/archy": { "version": "1.0.0", - "dev": true, "license": "MIT" }, "node_modules/are-we-there-yet": { @@ -10257,7 +10233,6 @@ }, "node_modules/atomic-sleep": { "version": "1.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8.0.0" @@ -10322,7 +10297,6 @@ }, "node_modules/avvio": { "version": "8.2.1", - "dev": true, "license": "MIT", "dependencies": { "archy": "^1.0.0", @@ -12611,7 +12585,6 @@ }, "node_modules/cross-spawn": { "version": "7.0.3", - "dev": true, "license": "MIT", "dependencies": { "path-key": "^3.1.0", @@ -13136,7 +13109,6 @@ }, "node_modules/deep-is": { "version": "0.1.4", - "dev": true, "license": "MIT" }, "node_modules/deepmerge": { @@ -13450,7 +13422,6 @@ }, "node_modules/doctrine": { "version": "3.0.0", - "dev": true, "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" @@ -14546,7 +14517,6 @@ }, "node_modules/eslint": { "version": "8.49.0", - "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", @@ -14901,7 +14871,6 @@ }, "node_modules/eslint-scope": { "version": "7.2.2", - "dev": true, "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", @@ -15007,7 +14976,6 @@ }, "node_modules/eslint/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -15021,12 +14989,10 @@ }, "node_modules/eslint/node_modules/argparse": { "version": "2.0.1", - "dev": true, "license": "Python-2.0" }, "node_modules/eslint/node_modules/chalk": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -15041,7 +15007,6 @@ }, "node_modules/eslint/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -15052,12 +15017,10 @@ }, "node_modules/eslint/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/eslint/node_modules/globals": { "version": "13.20.0", - "dev": true, "license": "MIT", "dependencies": { "type-fest": "^0.20.2" @@ -15071,7 +15034,6 @@ }, "node_modules/eslint/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -15079,7 +15041,6 @@ }, "node_modules/eslint/node_modules/js-yaml": { "version": "4.1.0", - "dev": true, "license": "MIT", "dependencies": { "argparse": "^2.0.1" @@ -15090,7 +15051,6 @@ }, "node_modules/eslint/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -15101,7 +15061,6 @@ }, "node_modules/espree": { "version": "9.6.1", - "dev": true, "license": "BSD-2-Clause", "dependencies": { "acorn": "^8.9.0", @@ -15129,7 +15088,6 @@ }, "node_modules/esquery": { "version": "1.5.0", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "estraverse": "^5.1.0" @@ -15211,7 +15169,6 @@ }, "node_modules/event-target-shim": { "version": "5.0.1", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -15224,7 +15181,6 @@ }, "node_modules/events": { "version": "3.3.0", - "dev": true, "license": "MIT", "engines": { "node": ">=0.8.x" @@ -15671,17 +15627,14 @@ }, "node_modules/fast-content-type-parse": { "version": "1.0.0", - "dev": true, "license": "MIT" }, "node_modules/fast-decode-uri-component": { "version": "1.0.1", - "dev": true, "license": "MIT" }, "node_modules/fast-deep-equal": { "version": "3.1.3", - "dev": true, "license": "MIT" }, "node_modules/fast-fifo": { @@ -15716,12 +15669,10 @@ }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", - "dev": true, "license": "MIT" }, "node_modules/fast-json-stringify": { "version": "5.7.0", - "dev": true, "license": "MIT", "dependencies": { "@fastify/deepmerge": "^1.0.0", @@ -15734,7 +15685,6 @@ }, "node_modules/fast-json-stringify/node_modules/ajv": { "version": "8.12.0", - "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", @@ -15749,17 +15699,14 @@ }, "node_modules/fast-json-stringify/node_modules/json-schema-traverse": { "version": "1.0.0", - "dev": true, "license": "MIT" }, "node_modules/fast-levenshtein": { "version": "2.0.6", - "dev": true, "license": "MIT" }, "node_modules/fast-querystring": { "version": "1.1.2", - "dev": true, "license": "MIT", "dependencies": { "fast-decode-uri-component": "^1.0.1" @@ -15767,7 +15714,6 @@ }, "node_modules/fast-redact": { "version": "3.2.0", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -15781,7 +15727,6 @@ }, "node_modules/fast-uri": { "version": "2.2.0", - "dev": true, "license": "MIT" }, "node_modules/fastest-levenshtein": { @@ -15793,7 +15738,6 @@ }, "node_modules/fastify": { "version": "4.12.0", - "dev": true, "license": "MIT", "dependencies": { "@fastify/ajv-compiler": "^3.3.1", @@ -15815,7 +15759,6 @@ }, "node_modules/fastify-plugin": { "version": "4.5.0", - "dev": true, "license": "MIT" }, "node_modules/fastq": { @@ -15966,7 +15909,6 @@ }, "node_modules/file-entry-cache": { "version": "6.0.1", - "dev": true, "license": "MIT", "dependencies": { "flat-cache": "^3.0.4" @@ -16066,7 +16008,6 @@ }, "node_modules/find-my-way": { "version": "7.6.2", - "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", @@ -16083,7 +16024,6 @@ }, "node_modules/find-up": { "version": "5.0.0", - "dev": true, "license": "MIT", "dependencies": { "locate-path": "^6.0.0", @@ -16107,7 +16047,6 @@ }, "node_modules/flat-cache": { "version": "3.0.4", - "dev": true, "license": "MIT", "dependencies": { "flatted": "^3.1.0", @@ -16119,7 +16058,6 @@ }, "node_modules/flat-cache/node_modules/glob": { "version": "7.2.3", - "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -16138,7 +16076,6 @@ }, "node_modules/flat-cache/node_modules/rimraf": { "version": "3.0.2", - "dev": true, "license": "ISC", "dependencies": { "glob": "^7.1.3" @@ -16152,7 +16089,6 @@ }, "node_modules/flatted": { "version": "3.2.7", - "dev": true, "license": "ISC" }, "node_modules/follow-redirects": { @@ -16433,7 +16369,6 @@ }, "node_modules/forwarded": { "version": "0.2.0", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" @@ -16513,7 +16448,6 @@ }, "node_modules/fs.realpath": { "version": "1.0.0", - "dev": true, "license": "ISC" }, "node_modules/fsevents": { @@ -17988,7 +17922,6 @@ }, "node_modules/glob-parent": { "version": "6.0.2", - "dev": true, "license": "ISC", "dependencies": { "is-glob": "^4.0.3" @@ -18217,7 +18150,6 @@ }, "node_modules/graphemer": { "version": "1.4.0", - "dev": true, "license": "MIT" }, "node_modules/graphql": { @@ -18898,7 +18830,6 @@ }, "node_modules/imurmurhash": { "version": "0.1.4", - "dev": true, "license": "MIT", "engines": { "node": ">=0.8.19" @@ -18914,7 +18845,6 @@ }, "node_modules/inflight": { "version": "1.0.6", - "dev": true, "license": "ISC", "dependencies": { "once": "^1.3.0", @@ -18923,7 +18853,6 @@ }, "node_modules/inherits": { "version": "2.0.4", - "dev": true, "license": "ISC" }, "node_modules/ini": { @@ -19069,7 +18998,6 @@ }, "node_modules/ipaddr.js": { "version": "1.9.1", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.10" @@ -19377,7 +19305,6 @@ }, "node_modules/is-path-inside": { "version": "3.0.3", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -19655,7 +19582,6 @@ }, "node_modules/isexe": { "version": "2.0.0", - "dev": true, "license": "ISC" }, "node_modules/isobject": { @@ -21654,12 +21580,10 @@ }, "node_modules/json-schema-traverse": { "version": "0.4.1", - "dev": true, "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", - "dev": true, "license": "MIT" }, "node_modules/json-stringify-safe": { @@ -21886,7 +21810,6 @@ }, "node_modules/levn": { "version": "0.4.1", - "dev": true, "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1", @@ -21898,7 +21821,6 @@ }, "node_modules/light-my-request": { "version": "5.9.2", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "cookie": "^0.5.0", @@ -22280,7 +22202,6 @@ }, "node_modules/locate-path": { "version": "6.0.0", - "dev": true, "license": "MIT", "dependencies": { "p-locate": "^5.0.0" @@ -22428,7 +22349,6 @@ }, "node_modules/lodash.merge": { "version": "4.6.2", - "dev": true, "license": "MIT" }, "node_modules/lodash.mergewith": { @@ -23436,7 +23356,6 @@ }, "node_modules/natural-compare": { "version": "1.4.0", - "dev": true, "license": "MIT" }, "node_modules/natural-compare-lite": { @@ -24357,7 +24276,6 @@ }, "node_modules/on-exit-leak-free": { "version": "2.1.0", - "dev": true, "license": "MIT" }, "node_modules/on-finished": { @@ -24381,7 +24299,6 @@ }, "node_modules/once": { "version": "1.4.0", - "dev": true, "license": "ISC", "dependencies": { "wrappy": "1" @@ -24435,7 +24352,6 @@ }, "node_modules/optionator": { "version": "0.9.3", - "dev": true, "license": "MIT", "dependencies": { "@aashutoshrathi/word-wrap": "^1.2.3", @@ -24539,7 +24455,6 @@ }, "node_modules/p-locate": { "version": "5.0.0", - "dev": true, "license": "MIT", "dependencies": { "p-limit": "^3.0.2" @@ -24553,7 +24468,6 @@ }, "node_modules/p-locate/node_modules/p-limit": { "version": "3.1.0", - "dev": true, "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" @@ -24893,7 +24807,6 @@ }, "node_modules/path-exists": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -24901,7 +24814,6 @@ }, "node_modules/path-is-absolute": { "version": "1.0.1", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -24909,7 +24821,6 @@ }, "node_modules/path-key": { "version": "3.1.1", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -25052,7 +24963,6 @@ }, "node_modules/pino": { "version": "8.14.1", - "dev": true, "license": "MIT", "dependencies": { "atomic-sleep": "^1.0.0", @@ -25073,7 +24983,6 @@ }, "node_modules/pino-abstract-transport": { "version": "1.0.0", - "dev": true, "license": "MIT", "dependencies": { "readable-stream": "^4.0.0", @@ -25082,7 +24991,6 @@ }, "node_modules/pino-abstract-transport/node_modules/buffer": { "version": "6.0.3", - "dev": true, "funding": [ { "type": "github", @@ -25105,7 +25013,6 @@ }, "node_modules/pino-abstract-transport/node_modules/readable-stream": { "version": "4.4.0", - "dev": true, "license": "MIT", "dependencies": { "abort-controller": "^3.0.0", @@ -25119,7 +25026,6 @@ }, "node_modules/pino-abstract-transport/node_modules/split2": { "version": "4.2.0", - "dev": true, "license": "ISC", "engines": { "node": ">= 10.x" @@ -25127,7 +25033,6 @@ }, "node_modules/pino-std-serializers": { "version": "6.2.1", - "dev": true, "license": "MIT" }, "node_modules/pirates": { @@ -25251,11 +25156,12 @@ "license": "MIT" }, "node_modules/playwright": { - "version": "1.38.1", + "version": "1.39.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.39.0.tgz", + "integrity": "sha512-naE5QT11uC/Oiq0BwZ50gDmy8c8WLPRTEWuSSFVG2egBka/1qMoSqYQcROMT9zLwJ86oPofcTH2jBY/5wWOgIw==", "dev": true, - "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.38.1" + "playwright-core": "1.39.0" }, "bin": { "playwright": "cli.js" @@ -25268,9 +25174,10 @@ } }, "node_modules/playwright-core": { - "version": "1.38.1", + "version": "1.39.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.39.0.tgz", + "integrity": "sha512-+k4pdZgs1qiM+OUkSjx96YiKsXsmb59evFoqv8SKO067qBA+Z2s/dCzJij/ZhdQcs2zlTAgRKfeiiLm8PQ2qvw==", "dev": true, - "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" }, @@ -25939,7 +25846,6 @@ }, "node_modules/prelude-ls": { "version": "1.2.1", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.8.0" @@ -26032,7 +25938,6 @@ }, "node_modules/process": { "version": "0.11.10", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.6.0" @@ -26045,7 +25950,6 @@ }, "node_modules/process-warning": { "version": "2.2.0", - "dev": true, "license": "MIT" }, "node_modules/progress": { @@ -26134,7 +26038,6 @@ }, "node_modules/proxy-addr": { "version": "2.0.7", - "dev": true, "license": "MIT", "dependencies": { "forwarded": "0.2.0", @@ -26309,7 +26212,6 @@ }, "node_modules/quick-format-unescaped": { "version": "4.0.4", - "dev": true, "license": "MIT" }, "node_modules/quick-lru": { @@ -26416,7 +26318,6 @@ }, "node_modules/react": { "version": "18.2.0", - "dev": true, "license": "MIT", "dependencies": { "loose-envify": "^1.1.0" @@ -26552,7 +26453,6 @@ }, "node_modules/react-dom": { "version": "18.2.0", - "dev": true, "license": "MIT", "dependencies": { "loose-envify": "^1.1.0", @@ -26869,7 +26769,6 @@ }, "node_modules/real-require": { "version": "0.2.0", - "dev": true, "license": "MIT", "engines": { "node": ">= 12.13.0" @@ -27199,7 +27098,6 @@ }, "node_modules/require-from-string": { "version": "2.0.2", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -27314,7 +27212,6 @@ }, "node_modules/ret": { "version": "0.2.2", - "dev": true, "license": "MIT", "engines": { "node": ">=4" @@ -27338,7 +27235,6 @@ }, "node_modules/rfdc": { "version": "1.3.0", - "dev": true, "license": "MIT" }, "node_modules/rimraf": { @@ -27533,7 +27429,6 @@ }, "node_modules/safe-regex2": { "version": "2.0.0", - "dev": true, "license": "MIT", "dependencies": { "ret": "~0.2.0" @@ -27541,7 +27436,6 @@ }, "node_modules/safe-stable-stringify": { "version": "2.4.3", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -27570,7 +27464,6 @@ }, "node_modules/scheduler": { "version": "0.23.0", - "dev": true, "license": "MIT", "dependencies": { "loose-envify": "^1.1.0" @@ -27595,7 +27488,6 @@ }, "node_modules/secure-json-parse": { "version": "2.7.0", - "dev": true, "license": "BSD-3-Clause" }, "node_modules/select-hose": { @@ -27816,7 +27708,6 @@ }, "node_modules/set-cookie-parser": { "version": "2.6.0", - "dev": true, "license": "MIT" }, "node_modules/set-function-name": { @@ -27894,7 +27785,6 @@ }, "node_modules/shebang-command": { "version": "2.0.0", - "dev": true, "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" @@ -27905,7 +27795,6 @@ }, "node_modules/shebang-regex": { "version": "3.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -28405,7 +28294,6 @@ }, "node_modules/sonic-boom": { "version": "3.3.0", - "dev": true, "license": "MIT", "dependencies": { "atomic-sleep": "^1.0.0" @@ -28989,7 +28877,6 @@ }, "node_modules/strip-ansi": { "version": "6.0.1", - "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -29051,7 +28938,6 @@ }, "node_modules/strip-json-comments": { "version": "3.1.1", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -29598,7 +29484,6 @@ }, "node_modules/text-table": { "version": "0.2.0", - "dev": true, "license": "MIT" }, "node_modules/thenify": { @@ -29622,7 +29507,6 @@ }, "node_modules/thread-stream": { "version": "2.3.0", - "dev": true, "license": "MIT", "dependencies": { "real-require": "^0.2.0" @@ -29695,7 +29579,6 @@ }, "node_modules/tiny-lru": { "version": "10.4.1", - "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=12" @@ -30392,7 +30275,6 @@ }, "node_modules/type-check": { "version": "0.4.0", - "dev": true, "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1" @@ -30411,7 +30293,6 @@ }, "node_modules/type-fest": { "version": "0.20.2", - "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" @@ -30511,7 +30392,6 @@ "version": "5.2.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", - "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -30721,7 +30601,6 @@ }, "node_modules/uri-js": { "version": "4.4.1", - "dev": true, "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" @@ -31785,7 +31664,6 @@ }, "node_modules/which": { "version": "2.0.2", - "dev": true, "license": "ISC", "dependencies": { "isexe": "^2.0.0" @@ -32040,7 +31918,6 @@ }, "node_modules/wrappy": { "version": "1.0.2", - "dev": true, "license": "ISC" }, "node_modules/write-file-atomic": { @@ -32273,7 +32150,6 @@ }, "node_modules/yocto-queue": { "version": "0.1.0", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -32473,11 +32349,11 @@ }, "packages/backend": { "name": "@clerk/backend", - "version": "0.31.1", + "version": "0.31.3", "license": "MIT", "dependencies": { - "@clerk/shared": "0.24.5", - "@clerk/types": "3.56.0", + "@clerk/shared": "1.0.0", + "@clerk/types": "3.57.0", "@peculiar/webcrypto": "1.4.1", "@types/node": "16.18.6", "cookie": "0.5.0", @@ -32518,11 +32394,11 @@ }, "packages/chrome-extension": { "name": "@clerk/chrome-extension", - "version": "0.4.8", + "version": "0.4.10", "license": "MIT", "dependencies": { - "@clerk/clerk-js": "4.62.0", - "@clerk/clerk-react": "4.26.5" + "@clerk/clerk-js": "4.63.0", + "@clerk/clerk-react": "4.27.0" }, "devDependencies": { "@types/chrome": "*", @@ -32538,12 +32414,12 @@ }, "packages/clerk-js": { "name": "@clerk/clerk-js", - "version": "4.62.0", + "version": "4.63.0", "license": "MIT", "dependencies": { - "@clerk/localizations": "1.26.5", - "@clerk/shared": "0.24.5", - "@clerk/types": "3.56.0", + "@clerk/localizations": "1.26.7", + "@clerk/shared": "1.0.0", + "@clerk/types": "3.57.0", "@emotion/cache": "11.11.0", "@emotion/react": "11.11.1", "@floating-ui/react": "0.25.4", @@ -32877,17 +32753,17 @@ }, "packages/expo": { "name": "@clerk/clerk-expo", - "version": "0.19.10", + "version": "0.19.12", "license": "MIT", "dependencies": { - "@clerk/clerk-js": "4.62.0", - "@clerk/clerk-react": "4.26.5", - "@clerk/shared": "0.24.5", + "@clerk/clerk-js": "4.63.0", + "@clerk/clerk-react": "4.27.0", + "@clerk/shared": "1.0.0", "base-64": "1.0.0", "react-native-url-polyfill": "2.0.0" }, "devDependencies": { - "@clerk/types": "^3.56.0", + "@clerk/types": "^3.57.0", "@types/base-64": "^1.0.0", "@types/node": "^16.11.55", "@types/react": "*", @@ -32908,12 +32784,12 @@ }, "packages/fastify": { "name": "@clerk/fastify", - "version": "0.6.15", + "version": "0.6.17", "license": "MIT", "dependencies": { - "@clerk/backend": "0.31.1", - "@clerk/shared": "0.24.5", - "@clerk/types": "3.56.0", + "@clerk/backend": "0.31.3", + "@clerk/shared": "1.0.0", + "@clerk/types": "3.57.0", "cookies": "0.8.0" }, "devDependencies": { @@ -32929,13 +32805,13 @@ } }, "packages/gatsby-plugin-clerk": { - "version": "4.4.16", + "version": "4.4.18", "license": "MIT", "dependencies": { - "@clerk/backend": "0.31.1", - "@clerk/clerk-react": "4.26.5", - "@clerk/clerk-sdk-node": "4.12.14", - "@clerk/types": "3.56.0", + "@clerk/backend": "0.31.3", + "@clerk/clerk-react": "4.27.0", + "@clerk/clerk-sdk-node": "4.12.16", + "@clerk/types": "3.57.0", "cookie": "0.5.0", "tslib": "2.4.1" }, @@ -32958,10 +32834,10 @@ }, "packages/localizations": { "name": "@clerk/localizations", - "version": "1.26.5", + "version": "1.26.7", "license": "MIT", "dependencies": { - "@clerk/types": "3.56.0" + "@clerk/types": "3.57.0" }, "devDependencies": { "tsup": "*", @@ -32976,14 +32852,14 @@ }, "packages/nextjs": { "name": "@clerk/nextjs", - "version": "4.25.5", + "version": "4.25.7", "license": "MIT", "dependencies": { - "@clerk/backend": "0.31.1", - "@clerk/clerk-react": "4.26.5", - "@clerk/clerk-sdk-node": "4.12.14", - "@clerk/shared": "0.24.5", - "@clerk/types": "3.56.0", + "@clerk/backend": "0.31.3", + "@clerk/clerk-react": "4.27.0", + "@clerk/clerk-sdk-node": "4.12.16", + "@clerk/shared": "1.0.0", + "@clerk/types": "3.57.0", "path-to-regexp": "6.2.1", "tslib": "2.4.1" }, @@ -33015,11 +32891,11 @@ }, "packages/react": { "name": "@clerk/clerk-react", - "version": "4.26.5", + "version": "4.27.0", "license": "MIT", "dependencies": { - "@clerk/shared": "0.24.5", - "@clerk/types": "3.56.0", + "@clerk/shared": "1.0.0", + "@clerk/types": "3.57.0", "tslib": "2.4.1" }, "devDependencies": { @@ -33041,13 +32917,13 @@ }, "packages/remix": { "name": "@clerk/remix", - "version": "3.0.7", + "version": "3.1.0", "license": "MIT", "dependencies": { - "@clerk/backend": "0.31.1", - "@clerk/clerk-react": "4.26.5", - "@clerk/shared": "0.24.5", - "@clerk/types": "3.56.0", + "@clerk/backend": "0.31.3", + "@clerk/clerk-react": "4.27.0", + "@clerk/shared": "1.0.0", + "@clerk/types": "3.57.0", "cookie": "0.5.0", "tslib": "2.4.1" }, @@ -33076,12 +32952,12 @@ }, "packages/sdk-node": { "name": "@clerk/clerk-sdk-node", - "version": "4.12.14", + "version": "4.12.16", "license": "MIT", "dependencies": { - "@clerk/backend": "0.31.1", - "@clerk/shared": "0.24.5", - "@clerk/types": "3.56.0", + "@clerk/backend": "0.31.3", + "@clerk/shared": "1.0.0", + "@clerk/types": "3.57.0", "@types/cookies": "0.7.7", "@types/express": "4.17.14", "@types/node-fetch": "2.6.2", @@ -33117,7 +32993,7 @@ }, "packages/shared": { "name": "@clerk/shared", - "version": "0.24.5", + "version": "1.0.0", "license": "MIT", "dependencies": { "glob-to-regexp": "0.4.1", @@ -33125,7 +33001,7 @@ "swr": "2.2.0" }, "devDependencies": { - "@clerk/types": "3.56.0", + "@clerk/types": "3.57.0", "@types/glob-to-regexp": "0.4.1", "@types/js-cookie": "3.0.2", "tsup": "*", @@ -33142,10 +33018,10 @@ }, "packages/themes": { "name": "@clerk/themes", - "version": "1.7.8", + "version": "1.7.9", "license": "MIT", "devDependencies": { - "@clerk/types": "3.56.0", + "@clerk/types": "3.57.0", "typescript": "*" }, "engines": { @@ -33157,7 +33033,7 @@ }, "packages/types": { "name": "@clerk/types", - "version": "3.56.0", + "version": "3.57.0", "license": "MIT", "dependencies": { "csstype": "3.1.1" diff --git a/package.json b/package.json index 38d04fc6348..aabdcea86ee 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@commitlint/config-conventional": "^17.7.0", "@emotion/jest": "^11.11.0", "@faker-js/faker": "^8.1.0", - "@playwright/test": "^1.38.1", + "@playwright/test": "^1.39.0", "@testing-library/dom": "^8.19.0", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", diff --git a/turbo.json b/turbo.json index 7d2694fc462..7652790fb93 100644 --- a/turbo.json +++ b/turbo.json @@ -6,31 +6,24 @@ "globalDependencies": [ ".changeset/changelog.js", ".changeset/config.json", - ".dockerignore", ".github/**", ".jit", ".nvmrc", ".prettier*", "jest.*.ts", - "packages/eslint-config-custom/index.js", "package.json", "package-lock.json", "tsconfig.json", "tsconfig.*.json", - "verdaccio.*.yaml" + "verdaccio.yaml" ], "globalEnv": [ - "CI", "CLERK_*", "GATSBY_CLERK_*", "NEXT_PUBLIC_CLERK_*", "NODE_ENV", - "NODE_EXTRA_CA_CERTS", "NODE_VERSION", "NPM_VERSION", - "RUNNER_ARCH", - "RUNNER_DEBUG", - "RUNNER_OS", "TZ", "VERCEL" ], diff --git a/verdaccio.yaml b/verdaccio.yaml new file mode 100644 index 00000000000..97478ce7f04 --- /dev/null +++ b/verdaccio.yaml @@ -0,0 +1,19 @@ +storage: ./.verdaccio/storage +auth: + htpasswd: + file: ./.verdaccio/htpasswd +uplinks: + npmjs: + url: https://registry.npmjs.org/ +packages: + '@clerk/*': + access: $all + publish: $all + 'gatsby-plugin-clerk': + access: $all + publish: $all + '**': + access: $all + publish: $all + proxy: npmjs +log: { type: stdout, format: pretty, level: http } From 50426abaa9ae5b2c2a7775fdd343822552795300 Mon Sep 17 00:00:00 2001 From: Tom Milewski Date: Tue, 24 Oct 2023 14:43:59 -0700 Subject: [PATCH 2/3] chore(repo): Add changeset --- .changeset/blue-lies-drop.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .changeset/blue-lies-drop.md diff --git a/.changeset/blue-lies-drop.md b/.changeset/blue-lies-drop.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/blue-lies-drop.md @@ -0,0 +1,2 @@ +--- +--- From 5900c99c14c118d5748598c47dcdfd164de41276 Mon Sep 17 00:00:00 2001 From: Tom Milewski Date: Thu, 26 Oct 2023 14:15:41 -0700 Subject: [PATCH 3/3] build(repo): Extracted actions (#1946) --- .github/actions/init/action.yml | 117 ++++++++++++++++++++++ .github/actions/setup/action.yml | 2 +- .github/actions/verdaccio/action.yml | 40 ++++++++ .github/workflows/base-changeset.yml | 21 ---- .github/workflows/base-prettier.yml | 12 --- .github/workflows/base-registry.yml | 29 ------ .github/workflows/checks.yml | 105 -------------------- .github/workflows/ci.yml | 142 +++++++++------------------ package.json | 2 - 9 files changed, 207 insertions(+), 263 deletions(-) create mode 100644 .github/actions/init/action.yml create mode 100644 .github/actions/verdaccio/action.yml delete mode 100644 .github/workflows/base-changeset.yml delete mode 100644 .github/workflows/base-prettier.yml delete mode 100644 .github/workflows/base-registry.yml delete mode 100644 .github/workflows/checks.yml diff --git a/.github/actions/init/action.yml b/.github/actions/init/action.yml new file mode 100644 index 00000000000..4bb0adf0d27 --- /dev/null +++ b/.github/actions/init/action.yml @@ -0,0 +1,117 @@ + +name: Setup Action +description: Checkout, setup node and dependencies +inputs: + node-version: + description: 'The node version to use' + required: false + default: '18' + playwright-enabled: + description: 'Enable Playwright?' + required: false + default: 'false' + turbo-enabled: + description: 'Enable Turbo?' + required: false + default: 'true' + turbo-cache-dir: + description: 'The cache dir to use for Turbo' + required: false + default: './.turbo-cache' + turbo-signature: + description: 'The signature to use for Turbo' + required: false + turbo-remote-only: + description: 'Only use remote cache?' + required: false + default: 'true' + turbo-team: + description: 'The team to use for Turbo remote auth' + required: true + turbo-token: + description: 'The token to use for Turbo remote auth' + required: true + +runs: + using: "composite" + steps: + - name: Configure Turborepo + id: turbo + uses: actions/github-script@v6 + env: + # envs are required to pass inputs to the script + ENABLED: ${{ inputs.turbo-enabled }} + CACHE_DIR: ${{ inputs.turbo-cache-dir }} + REMOTE_ONLY: ${{ inputs.turbo-remote-only }} + SIGNATURE: ${{ inputs.turbo-signature }} + TEAM: ${{ inputs.turbo-team }} + TOKEN: ${{ inputs.turbo-token }} + with: + script: | + const os = require('os') + const cpus = + typeof os.availableParallelism === "function" + ? os.availableParallelism() + : os.cpus().length; + + const { ENABLED, CACHE_DIR, SIGNATURE, REMOTE_ONLY, TEAM, TOKEN } = process.env + + core.exportVariable('TURBO_ARGS', + [ + '--output-logs=new-only', + `--cache-dir=${CACHE_DIR}`, + `--concurrency=${cpus}` + ].join(' ') + ) + + if (ENABLED === 'true') { + core.exportVariable('TURBO_TEAM', TEAM) + core.exportVariable('TURBO_TOKEN', TOKEN) + core.exportVariable('TURBO_REMOTE_ONLY', REMOTE_ONLY) + } + + if (SIGNATURE && SIGNATURE !== '') { + core.exportVariable('TURBO_REMOTE_CACHE_SIGNATURE_KEY', SIGNATURE) + } + + core.exportVariable('FORCE_COLOR', '1') + + - name: Turborepo CLI Args + shell: bash + run: echo $TURBO_ARGS + + - name: Setup NodeJS ${{ inputs.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ inputs.node-version }} + + - name: Cache node_modules + uses: actions/cache@v3 + id: npm-cache + with: + path: ./node_modules + key: ${{ runner.os }}-node-${{ inputs.node-version }}-node-modules-${{ hashFiles('**/package-lock.json') }} + + - name: Install NPM Dependencies + if: steps.npm-cache.outputs.cache-hit != 'true' + run: npm ci --audit=false --fund=false + shell: bash + + - name: Get Playwright Version + if: inputs.playwright-enabled == 'true' + shell: bash + id: playwright-version + run: echo "VERSION=$(node -e "console.log($(npm ls @playwright/test --json).dependencies['@playwright/test'].version)")" >> "$GITHUB_OUTPUT" + + - name: Cache Playwright Binaries + if: inputs.playwright-enabled == 'true' + uses: actions/cache@v3 + id: playwright-cache + with: + path: ~/.cache/ms-playwright + key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-playwright-${{ steps.playwright-version.outputs.VERSION }} + + - name: Install Playwright Browsers + if: inputs.playwright-enabled == 'true' && steps.playwright-cache.outputs.cache-hit != 'true' + shell: bash + run: npx playwright install --with-deps diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 81526e771ed..8a03be072a9 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -30,7 +30,7 @@ runs: name: Install dependencies shell: bash run: npm ci - - if: ${{ inputs.use-turbo-cache == 'true' }} + - if: ${{ inputs.use-turbo-cache == 'true' }} name: Download turbo cache uses: actions/download-artifact@v3 with: diff --git a/.github/actions/verdaccio/action.yml b/.github/actions/verdaccio/action.yml new file mode 100644 index 00000000000..197a55138d8 --- /dev/null +++ b/.github/actions/verdaccio/action.yml @@ -0,0 +1,40 @@ +name: Run Verdaccio +description: Checkout, setup node and dependencies +inputs: + auth-email: + description: 'The email to use for auth' + required: false + default: 'test@test.com' + auth-password: + description: 'The pass to use for auth' + required: false + default: 'pass' + auth-user: + description: 'The user to use for auth' + required: false + default: 'user' + publish-cmd: + description: 'The command to use to publish' + required: true + registry: + description: 'The registry to use' + required: false + default: 'http://localhost:4873' + +runs: + using: "composite" + steps: + - name: Update NPM Registry to Verdaccio + shell: bash + run: npm set registry ${{ inputs.registry }} + + - name: Run Verdaccio + shell: bash + run: | + nohup ./node_modules/.bin/verdaccio --config ./verdaccio.yaml & sleep 5 + ./node_modules/.bin/npm-cli-adduser -u ${{ inputs.auth-user }} -p ${{ inputs.auth-password }} -e ${{ inputs.auth-email }} -r ${{ inputs.registry }} + ./node_modules/.bin/npm-cli-login -u ${{ inputs.auth-user }} -p ${{ inputs.auth-password }} -e ${{ inputs.auth-email }} -r ${{ inputs.registry }} + + - name: Publish to Verdaccio + shell: bash + run: ${{ inputs.publish-cmd }} diff --git a/.github/workflows/base-changeset.yml b/.github/workflows/base-changeset.yml deleted file mode 100644 index 099307baa64..00000000000 --- a/.github/workflows/base-changeset.yml +++ /dev/null @@ -1,21 +0,0 @@ -on: - workflow_call: - -jobs: - check: - runs-on: ${{ vars.RUNNER_LARGE }} - steps: - - name: Checkout repo - uses: actions/checkout@v3 - with: - ref: ${{github.event.pull_request.head.sha}} - fetch-depth: 0 - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github.event.pull_request ) }} - run: | - echo "$GITHUB_CONTEXT" - - name: Setup - uses: ./.github/actions/setup - - run: | - if [ "${{ github.event.pull_request.user.login }}" = "clerk-cookie" ]; then echo 'Skipping' && exit 0; else npx changeset status --since=origin/main; fi diff --git a/.github/workflows/base-prettier.yml b/.github/workflows/base-prettier.yml deleted file mode 100644 index 46ca38c8d30..00000000000 --- a/.github/workflows/base-prettier.yml +++ /dev/null @@ -1,12 +0,0 @@ -on: - workflow_call: - -jobs: - check: - runs-on: ${{ vars.RUNNER_LARGE }} - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - name: Setup - uses: ./.github/actions/setup - - run: npm run format:check diff --git a/.github/workflows/base-registry.yml b/.github/workflows/base-registry.yml deleted file mode 100644 index 964ccd8081f..00000000000 --- a/.github/workflows/base-registry.yml +++ /dev/null @@ -1,29 +0,0 @@ -on: - workflow_call: - -jobs: - registry: - runs-on: ${{ vars.RUNNER_LARGE }} - steps: - - uses: actions/checkout@v3 - - name: Setup - uses: ./.github/actions/setup - - name: Configure npm to use Verdaccio - run: | - npm set registry http://localhost:4873/ - nohup ./node_modules/.bin/verdaccio --config ./verdaccio.publish.yaml & - sleep 5 - ./node_modules/.bin/npm-cli-adduser -u user -p pass -e test@test.com -r http://localhost:4873/ - ./node_modules/.bin/npm-cli-login -u user -p pass -e test@test.com -r http://localhost:4873/ - - name: Publish to Verdaccio - # The command below includes a sanity check - # and fails early if the default npm registry is used - run: | - npm run release:verdaccio - - name: List published packages - run: | - ls -all .verdaccio/storage/@clerk - - uses: actions/upload-artifact@v3 - with: - name: verdaccio - path: .verdaccio diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml deleted file mode 100644 index 13d9d020c55..00000000000 --- a/.github/workflows/checks.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Quality checks and tests -on: - merge_group: - pull_request: - branches: [ main, main-v4 ] - -concurrency: - group: checks-${{ github.ref }} - cancel-in-progress: true - -jobs: - prettier: - name: Prettier - uses: ./.github/workflows/base-prettier.yml - - changeset: - name: Require changeset - uses: ./.github/workflows/base-changeset.yml - - build: - if: ${{ github.repository == 'clerkinc/javascript' }} - name: Build & publish - needs: [ prettier, changeset ] - uses: ./.github/workflows/base-build.yml - - eslint: - name: ESLint - needs: build - runs-on: ${{ vars.RUNNER_LARGE }} - steps: - - uses: actions/checkout@v3 - - name: Setup - uses: ./.github/actions/setup - with: - use-turbo-cache: 'true' - - name: Run lint - run: npm run lint -- --output-logs=errors-only -- --quiet - - unit-tests: - name: Run unit tests - needs: build - runs-on: ${{ vars.RUNNER_LARGE }} - strategy: - matrix: - node-version: [ 18, 19 ] - steps: - - uses: actions/checkout@v3 - - name: Setup - uses: ./.github/actions/setup - with: - use-turbo-cache: 'true' - - name: Run tests - run: npm run test:ci - - publint: - name: Run publint - needs: build - runs-on: ${{ vars.RUNNER_LARGE }} - steps: - - uses: actions/checkout@v3 - - name: Setup - uses: ./.github/actions/setup - with: - use-turbo-cache: 'true' - - name: Lint packages using publint - run: npm run lint:publint - - attw: - name: Run attw - needs: build - runs-on: ${{ vars.RUNNER_LARGE }} - steps: - - uses: actions/checkout@v3 - - name: Setup - uses: ./.github/actions/setup - with: - use-turbo-cache: 'true' - - name: Lint types using attw - # Remove this when all related errors are fixed - continue-on-error: true - run: npm run lint:attw - - integration-generic: - name: Integration (Generic) - needs: build - uses: ./.github/workflows/base-e2e.yml - with: - SCRIPT: 'npm run test:integration:generic' - secrets: inherit - - integration-nextjs: - name: Integration (NextJS) - needs: build - uses: ./.github/workflows/base-e2e.yml - with: - SCRIPT: 'npm run test:integration:nextjs' - secrets: inherit - - integration-remix: - name: Integration (Remix) - needs: build - uses: ./.github/workflows/base-e2e.yml - with: - SCRIPT: 'npm run test:integration:remix' - secrets: inherit diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f1bc52b97a8..e46988188d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,20 +2,12 @@ name: CI on: workflow_dispatch: - merge_group: + # merge_group: pull_request: branches: - main - -env: - FORCE_COLOR: '1' - NODE_VERSION: '18' - TURBO_ARGS: --output-logs=new-only --cache-dir=./.turbo-cache --concurrency=8 - TURBO_TOKEN: ${{ secrets.TEST_TURBO_TOKEN }} - TURBO_TEAM: ${{ secrets.TEST_TURBO_TEAM }} - TURBO_REMOTE_CACHE_SIGNATURE_KEY: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} - TURBO_REMOTE_ONLY: true - TURBO_CONCURRENCY: 8 # Available CPU in RUNNER_LARGE + - main-v4 + - ci-updates concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -25,8 +17,6 @@ jobs: formatting-linting: name: Formatting & Linting runs-on: ${{ vars.RUNNER_LARGE }} - env: - TURBO_REMOTE_ONLY: false steps: - name: Checkout Repo @@ -35,21 +25,23 @@ jobs: fetch-depth: 0 show-progress: false - - name: Setup NodeJS ${{ env.NODE_VERSION }} - uses: actions/setup-node@v3 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: Cache node_modules - uses: actions/cache@v3 - id: npm-cache + - name: Setup + id: config + uses: ./.github/actions/init with: - path: ./node_modules - key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-node-modules-${{ hashFiles('**/package-lock.json') }} + turbo-remote-only: false + turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + turbo-team: ${{ vars.TURBO_TEAM }} + turbo-token: ${{ secrets.TURBO_TOKEN }} - - name: Install NPM Dependencies - if: steps.npm-cache.outputs.cache-hit != 'true' - run: npm ci --audit=false --fund=false + - name: Test Envs + run: | + echo "TURBO_ARGS: $TURBO_ARGS" + echo "TURBO_TEAM: $TURBO_TEAM" + echo "TURBO_TOKEN: $TURBO_TOKEN" + echo "TURBO_REMOTE_ONLY: $TURBO_REMOTE_ONLY" + echo "TURBO_REMOTE_CACHE_SIGNATURE_KEY: $TURBO_REMOTE_CACHE_SIGNATURE_KEY" + echo "FORCE_COLOR: $FORCE_COLOR" - name: Require Changeset run: if [ "${{ github.event.pull_request.user.login }}" = "clerk-cookie" ]; then echo 'Skipping' && exit 0; else npx changeset status --since=origin/main; fi @@ -58,14 +50,14 @@ jobs: run: npm run format:check - name: Lint packages using publint - run: npm run lint:publint -- ${{ env.TURBO_ARGS }} + run: npm run lint:publint -- $TURBO_ARGS - name: Lint types using attw - run: npm run lint:attw -- ${{ env.TURBO_ARGS }} + run: npm run lint:attw -- $TURBO_ARGS continue-on-error: true # TODO: Remove this when all related errors are fixed - name: Run lint - run: npm run lint -- ${{ env.TURBO_ARGS }} -- --quiet + run: npm run lint -- $TURBO_ARGS -- --quiet unit-tests: name: Unit Tests @@ -83,24 +75,17 @@ jobs: fetch-depth: 0 show-progress: false - - name: Setup NodeJS ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - - name: Cache node_modules - uses: actions/cache@v3 - id: npm-cache + - name: Setup + id: config + uses: ./.github/actions/init with: - path: ./node_modules - key: ${{ runner.os }}-node-${{ matrix.node-version }}-node-modules-${{ hashFiles('**/package-lock.json') }} - - - name: Install NPM Dependencies - if: steps.npm-cache.outputs.cache-hit != 'true' - run: npm ci --audit=false --fund=false + node-version: ${{ matrix.node-version }} + turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + turbo-team: ${{ vars.TURBO_TEAM }} + turbo-token: ${{ secrets.TURBO_TOKEN }} - name: Run tests - run: npx turbo test ${{ env.TURBO_ARGS }} + run: npx turbo test $TURBO_ARGS env: NODE_VERSION: ${{ matrix.node-version }} @@ -120,65 +105,36 @@ jobs: fetch-depth: 0 show-progress: false - - name: Setup NodeJS ${{ env.NODE_VERSION }} - uses: actions/setup-node@v3 + - name: Setup + id: config + uses: ./.github/actions/init with: - node-version: ${{ env.NODE_VERSION }} - - - name: Cache node_modules - uses: actions/cache@v3 - id: npm-cache - with: - path: ./node_modules - key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-node-modules-${{ hashFiles('**/package-lock.json') }} - - - name: Install NPM Dependencies - if: steps.npm-cache.outputs.cache-hit != 'true' - run: npm ci --audit=false --fund=false + turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + turbo-team: ${{ vars.TURBO_TEAM }} + turbo-token: ${{ secrets.TURBO_TOKEN }} + playwright-enabled: true - - name: Get Playwright Version - id: playwright-version - run: echo "VERSION=$(node -e "console.log($(npm ls @playwright/test --json).dependencies['@playwright/test'].version)")" >> "$GITHUB_OUTPUT" - - - name: Cache Playwright Binaries - uses: actions/cache@v3 - id: playwright-cache + - name: Verdaccio + uses: ./.github/actions/verdaccio with: - path: ~/.cache/ms-playwright - key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-playwright-${{ steps.playwright-version.outputs.VERSION }} - - - name: Install Playwright Browsers - if: steps.playwright-cache.outputs.cache-hit != 'true' - run: npx playwright install --with-deps - - - name: Update NPM Registry - run: npm set registry http://localhost:4873/ - - - name: Run Verdaccio - run: | - nohup ./node_modules/.bin/verdaccio --config ./verdaccio.yaml & sleep 5 - ./node_modules/.bin/npm-cli-adduser -u user -p pass -e test@test.com -r http://localhost:4873/ - ./node_modules/.bin/npm-cli-login -u user -p pass -e test@test.com -r http://localhost:4873/ - - - name: Publish to Verdaccio - run: | - if [ "$(npm config get registry)" = "https://registry.npmjs.org/" ]; then echo 'Error: Using default registry' && exit 1; else npx turbo build ${{ env.TURBO_ARGS }} && npx changeset publish --no-git-tag; fi + publish-cmd: | + if [ "$(npm config get registry)" = "https://registry.npmjs.org/" ]; then echo 'Error: Using default registry' && exit 1; else npx turbo build $TURBO_ARGS && npx changeset publish --no-git-tag; fi - name: Install @clerk/backend in /integration working-directory: ./integration run: npm init -y && npm install @clerk/backend - - name: Run Playwright tests + - name: Run Integration Tests run: npm run test:integration:${{ matrix.test-name }} env: + E2E_CLERK_VERSION: 'latest' INTEGRATION_INSTANCE_KEYS: ${{ secrets.INTEGRATION_INSTANCE_KEYS }} MAILSAC_API_KEY: ${{ secrets.MAILSAC_API_KEY }} - E2E_CLERK_VERSION: 'latest' - - name: Upload Playwright Report for ${{ matrix.test-name }} - uses: actions/upload-artifact@v3 - if: always() - with: - name: playwright-report-${{ github.ref }}-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.test-name }} - path: playwright-report/ - retention-days: 1 + # - name: Upload Integration Report for ${{ matrix.test-name }} + # uses: actions/upload-artifact@v3 + # if: always() + # with: + # name: integration-report-${{ github.ref }}-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.test-name }} + # path: playwright-report/ + # retention-days: 1 diff --git a/package.json b/package.json index aabdcea86ee..c001b32c06a 100644 --- a/package.json +++ b/package.json @@ -28,10 +28,8 @@ "release:canary": "TURBO_FORCE=true FORCE_COLOR=1 npm run build && changeset publish --tag canary --no-git-tag", "release:snapshot": "TURBO_FORCE=true FORCE_COLOR=1 npm run build && changeset publish --tag snapshot --no-git-tag", "release:staging": "TURBO_FORCE=true FORCE_COLOR=1 npm run build && changeset publish --tag staging --no-git-tag", - "release:verdaccio": "if [ \"$(npm config get registry)\" = \"https://registry.npmjs.org/\" ]; then echo 'Error: Using default registry' && exit 1; else TURBO_FORCE=true TURBO_CONCURRENCY=4 npm run build && changeset publish --no-git-tag; fi", "test": "FORCE_COLOR=1 turbo test --concurrency=${TURBO_CONCURRENCY:-80%}", "test:cache:clear": "FORCE_COLOR=1 turbo test:cache:clear --continue --concurrency=${TURBO_CONCURRENCY:-80%}", - "test:ci": "FORCE_COLOR=1 turbo test --concurrency=${TURBO_CONCURRENCY:-80%}", "test:integration:base": "DEBUG=1 npx playwright test --config integration/playwright.config.ts", "test:integration:deployment:nextjs": "DEBUG=1 npx playwright test --config integration/playwright.deployments.config.ts", "test:integration:generic": "E2E_APP_ID=react.vite.* npm run test:integration:base -- --grep @generic",