From 65d1542aa7a0aef2293f64dbda993f7e24751e08 Mon Sep 17 00:00:00 2001 From: Ben Elan Date: Wed, 6 Dec 2023 14:13:29 -0800 Subject: [PATCH] ci: remove workarounds no longer needed with Stencil v4 (#8325) ## Summary Removes some workarounds that are no longer needed. The first types test was because we didn't commit `components.d.ts` and needed to build twice to get the correct types. After updating to Stencil v4, we started getting JSDOM type errors from that test. ``` ../../node_modules/puppeteer/lib/types.d.ts:7584:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher. 7584 #private; ~~~~~~~~ Found 22 errors in the same file, starting at: ../../node_modules/puppeteer/lib/types.d.ts:33 ``` It looks like it is using the wrong tsconfig or something, because we are above ES2015. Alternatively we could use `skipLibCheck`, but that can cause a variety of issues, especially with monorepos. Also removes the extra build that happens before publishing CC. It was originally for the `component.d.ts` types issue and to make sure the version is correct in the source code preamble. Now that we don't have the types issue anymore, we can move the versioning before the first build in the CI to get rid of the second build. --- .github/workflows/deploy-next.yml | 19 +++++++++++-------- packages/calcite-components/package.json | 3 +-- .../support/buildForPreambleVersion.sh | 14 -------------- 3 files changed, 12 insertions(+), 24 deletions(-) delete mode 100755 packages/calcite-components/support/buildForPreambleVersion.sh diff --git a/.github/workflows/deploy-next.yml b/.github/workflows/deploy-next.yml index e4186cf21e5..fd5c6b789a5 100644 --- a/.github/workflows/deploy-next.yml +++ b/.github/workflows/deploy-next.yml @@ -21,11 +21,6 @@ jobs: registry-url: "https://registry.npmjs.org" env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: e2e test - run: | - npm install - npm run build - npm test - name: storybook/next deployment env: NEXT_RELEASE_ENABLED: ${{ secrets.NEXT_RELEASE_ENABLED }} @@ -36,14 +31,22 @@ jobs: if npm run util:is-next-deployable; then git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" + + npm install + # version the packages with lerna before building to ensure + # the version in the CC source code preamble is correct for deployment + npm run version:next + npm run build + npm test + # deploy storybook, but still release next if it fails { npm run --workspace=@esri/calcite-components build-storybook && npx --workspace=@esri/calcite-components storybook-to-ghpages \ - --host-token-env-variable=GH_TOKEN_FOR_STORYBOOK --existing-output-dir=docs --ci; } || true + --host-token-env-variable=GH_TOKEN_FOR_STORYBOOK \ + --existing-output-dir=docs --ci; } || true - # remove the build to docs after storybook deploys to gh-pages + # remove the built docs after storybook deploys to gh-pages git reset --hard - npm run version:next npm run publish:next npm run util:push-tags fi diff --git a/packages/calcite-components/package.json b/packages/calcite-components/package.json index ce43f1b64af..06b31402036 100644 --- a/packages/calcite-components/package.json +++ b/packages/calcite-components/package.json @@ -34,7 +34,6 @@ "lint:scss": "stylelint --fix \"src/**/*.scss\" && prettier --write \"**/*.scss\" >/dev/null", "lint:ts": "eslint --ext .ts,.tsx --fix . && prettier --write \"**/*.ts?(x)\" >/dev/null", "posttest": "npm run test:prerender", - "prepublishOnly": "./support/buildForPreambleVersion.sh", "release:docs": "npm run docs && storybook-to-ghpages --existing-output-dir=docs", "start": "npm run util:clean-js-files && concurrently --kill-others --raw \"tsc --project ./tsconfig-demos.json --watch\" \"npm run build:watch-dev -- --serve\"", "test": "stencil test --no-docs --no-build --spec --e2e", @@ -51,7 +50,7 @@ "util:patch-esm-resolution": "ts-node --esm support/patchESMResolution.ts", "util:prep-build-reqs": "npm run util:copy-assets && npm run util:generate-t9n-types", "util:sync-t9n-en-bundles": "ts-node --esm support/syncEnT9nBundles.ts", - "util:test-types": "tsc --esModuleInterop dist/types/**/*.d.ts dist/components/*.d.ts && ! grep -rnw 'dist/types' -e '