diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b6a38191c..c9b6a0141 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,3 +55,6 @@ jobs: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} NEXT_VERSION: ${{ steps.next_version.outputs.version }} SENTRY_RELEASE: ${{ steps.next_version.outputs.version }} + SENTRY_ORG: chromatic-lt + SENTRY_PROJECT: cli + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} diff --git a/package.json b/package.json index 16517b38b..8904bee0d 100644 --- a/package.json +++ b/package.json @@ -73,6 +73,9 @@ "build-storybook": "storybook build --stats-json", "build-test-storybook": "cross-env SMOKE_TEST=true storybook build -o test-storybook --stats-json", "build-subdir": "cd subdir ; yarn build ; cd ..", + "sentry": "yarn sentry:sourcemaps:cli && yarn sentry:sourcemaps:action", + "sentry:sourcemaps:cli": "sentry-cli sourcemaps inject dist && sentry-cli sourcemaps upload dist", + "sentry:sourcemaps:action": "sentry-cli sourcemaps inject action && sentry-cli sourcemaps upload action", "chromatic": "./dist/bin.js", "chromatic-prebuilt": "./dist/bin.js --storybook-build-dir=\"storybook-static\"", "chromatic-staging": "CHROMATIC_INDEX_URL=https://www.staging-chromatic.com ./dist/bin.js", @@ -80,7 +83,7 @@ "lint": "yarn lint:js bin-src node-src test-stories ./isChromatic.js ./isChromatic.mjs", "lint:js": "cross-env NODE_ENV=production eslint --cache --cache-location=.cache/eslint --report-unused-disable-directives", "lint:package": "sort-package-json", - "release": "./scripts/versionAndBuild.mjs && auto shipit", + "release": "./scripts/versionAndBuild.mjs && yarn sentry && yarn clean:sourcemaps && auto shipit", "prepack": "clean-package", "postpack": "clean-package restore", "publish-action": "./scripts/publish-action.mjs", @@ -90,7 +93,8 @@ "test": "vitest run --coverage && vitest run -c vitest.no-threads.config.ts", "typescript:check": "tsc --project ./tsconfig.json --noEmit", "prepare": "yarn run build", - "dev": "tsup --watch" + "dev": "tsup --watch", + "clean:sourcemaps": "rm -f dist/*.map && rm -f action/*.map" }, "resolutions": { "any-observable": "^0.5.1" @@ -103,6 +107,7 @@ "@auto-it/slack": "^11.1.6", "@discoveryjs/json-ext": "^0.5.7", "@eslint-community/eslint-plugin-eslint-comments": "^4.3.0", + "@sentry/cli": "^2.37.0", "@sentry/node": "^8.30.0", "@storybook/addon-essentials": "^8.1.5", "@storybook/addon-webpack5-compiler-swc": "^1.0.3", diff --git a/yarn.lock b/yarn.lock index ecc4242f8..1d308070b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3655,6 +3655,92 @@ __metadata: languageName: node linkType: hard +"@sentry/cli-darwin@npm:2.37.0": + version: 2.37.0 + resolution: "@sentry/cli-darwin@npm:2.37.0" + conditions: os=darwin + languageName: node + linkType: hard + +"@sentry/cli-linux-arm64@npm:2.37.0": + version: 2.37.0 + resolution: "@sentry/cli-linux-arm64@npm:2.37.0" + conditions: (os=linux | os=freebsd) & cpu=arm64 + languageName: node + linkType: hard + +"@sentry/cli-linux-arm@npm:2.37.0": + version: 2.37.0 + resolution: "@sentry/cli-linux-arm@npm:2.37.0" + conditions: (os=linux | os=freebsd) & cpu=arm + languageName: node + linkType: hard + +"@sentry/cli-linux-i686@npm:2.37.0": + version: 2.37.0 + resolution: "@sentry/cli-linux-i686@npm:2.37.0" + conditions: (os=linux | os=freebsd) & (cpu=x86 | cpu=ia32) + languageName: node + linkType: hard + +"@sentry/cli-linux-x64@npm:2.37.0": + version: 2.37.0 + resolution: "@sentry/cli-linux-x64@npm:2.37.0" + conditions: (os=linux | os=freebsd) & cpu=x64 + languageName: node + linkType: hard + +"@sentry/cli-win32-i686@npm:2.37.0": + version: 2.37.0 + resolution: "@sentry/cli-win32-i686@npm:2.37.0" + conditions: os=win32 & (cpu=x86 | cpu=ia32) + languageName: node + linkType: hard + +"@sentry/cli-win32-x64@npm:2.37.0": + version: 2.37.0 + resolution: "@sentry/cli-win32-x64@npm:2.37.0" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@sentry/cli@npm:^2.37.0": + version: 2.37.0 + resolution: "@sentry/cli@npm:2.37.0" + dependencies: + "@sentry/cli-darwin": "npm:2.37.0" + "@sentry/cli-linux-arm": "npm:2.37.0" + "@sentry/cli-linux-arm64": "npm:2.37.0" + "@sentry/cli-linux-i686": "npm:2.37.0" + "@sentry/cli-linux-x64": "npm:2.37.0" + "@sentry/cli-win32-i686": "npm:2.37.0" + "@sentry/cli-win32-x64": "npm:2.37.0" + https-proxy-agent: "npm:^5.0.0" + node-fetch: "npm:^2.6.7" + progress: "npm:^2.0.3" + proxy-from-env: "npm:^1.1.0" + which: "npm:^2.0.2" + dependenciesMeta: + "@sentry/cli-darwin": + optional: true + "@sentry/cli-linux-arm": + optional: true + "@sentry/cli-linux-arm64": + optional: true + "@sentry/cli-linux-i686": + optional: true + "@sentry/cli-linux-x64": + optional: true + "@sentry/cli-win32-i686": + optional: true + "@sentry/cli-win32-x64": + optional: true + bin: + sentry-cli: bin/sentry-cli + checksum: 10c0/a6e5e3510b7b6a5b3414a2b2bee3bd9c3066b05f70ff20ff65df1d7fb384458182d12a8a0f0319af02e8dbaf6f5e5d23da394eb6bdb8b9face3909699d0f9495 + languageName: node + linkType: hard + "@sentry/core@npm:8.30.0": version: 8.30.0 resolution: "@sentry/core@npm:8.30.0" @@ -7457,6 +7543,7 @@ __metadata: "@auto-it/slack": "npm:^11.1.6" "@discoveryjs/json-ext": "npm:^0.5.7" "@eslint-community/eslint-plugin-eslint-comments": "npm:^4.3.0" + "@sentry/cli": "npm:^2.37.0" "@sentry/node": "npm:^8.30.0" "@storybook/addon-essentials": "npm:^8.1.5" "@storybook/addon-webpack5-compiler-swc": "npm:^1.0.3" @@ -15780,6 +15867,13 @@ __metadata: languageName: node linkType: hard +"progress@npm:^2.0.3": + version: 2.0.3 + resolution: "progress@npm:2.0.3" + checksum: 10c0/1697e07cb1068055dbe9fe858d242368ff5d2073639e652b75a7eb1f2a1a8d4afd404d719de23c7b48481a6aa0040686310e2dac2f53d776daa2176d3f96369c + languageName: node + linkType: hard + "promise-deferred@npm:^2.0.3": version: 2.0.4 resolution: "promise-deferred@npm:2.0.4" @@ -15849,6 +15943,13 @@ __metadata: languageName: node linkType: hard +"proxy-from-env@npm:^1.1.0": + version: 1.1.0 + resolution: "proxy-from-env@npm:1.1.0" + checksum: 10c0/fe7dd8b1bdbbbea18d1459107729c3e4a2243ca870d26d34c2c1bcd3e4425b7bcc5112362df2d93cc7fb9746f6142b5e272fd1cc5c86ddf8580175186f6ad42b + languageName: node + linkType: hard + "pump@npm:^2.0.0": version: 2.0.1 resolution: "pump@npm:2.0.1" @@ -20026,7 +20127,7 @@ __metadata: languageName: node linkType: hard -"which@npm:^2.0.1": +"which@npm:^2.0.1, which@npm:^2.0.2": version: 2.0.2 resolution: "which@npm:2.0.2" dependencies: