Skip to content

Commit 83bdb13

Browse files
authored
build: use node type transform (#93036)
If we bump to node v24.0 which is now LTS we can also drop the --experimental flag. I've pinged dev-infra about what the right way to do this is, and will update the PR or open a new one to just drop the flag in case this one gets merged sooner.
1 parent 2b2767a commit 83bdb13

File tree

6 files changed

+10
-17
lines changed

6 files changed

+10
-17
lines changed

.github/workflows/backend.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,8 @@ jobs:
6161
mode: default
6262

6363
- name: Run API docs tests
64-
# install ts-node for ts build scripts to execute properly without potentially installing
65-
# conflicting deps when running scripts locally
66-
# see: https://github.com/getsentry/sentry/pull/32328/files
6764
run: |
68-
pnpm add ts-node && make test-api-docs
65+
make test-api-docs
6966
7067
- name: Inspect failure
7168
if: failure()

.github/workflows/openapi-diff.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,8 @@ jobs:
5050

5151
- name: Build OpenAPI Derefed JSON
5252
if: steps.changes.outputs.api_docs == 'true'
53-
# install ts-node for ts build scripts to execute properly without potentially installing
54-
# conflicting deps when running scripts locally
55-
# see: https://github.com/getsentry/sentry/pull/32328/files
5653
run: |
57-
pnpm add ts-node && make build-api-docs
54+
make build-api-docs
5855
5956
- name: Compare OpenAPI Derefed JSON
6057
if: steps.changes.outputs.api_docs == 'true'

.github/workflows/openapi.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,8 @@ jobs:
5454

5555
- name: Build OpenAPI Derefed JSON
5656
if: steps.changes.outputs.api_docs == 'true'
57-
# install ts-node for ts build scripts to execute properly without potentially installing
58-
# conflicting deps when running scripts locally
59-
# see: https://github.com/getsentry/sentry/pull/32328/files
6057
run: |
61-
pnpm add ts-node && make build-api-docs
58+
make build-api-docs
6259
6360
- name: Build RPC method schema
6461
if: steps.changes.outputs.api_docs == 'true'

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ build-api-docs: build-deprecated-docs build-spectacular-docs
5151

5252
watch-api-docs:
5353
@cd api-docs/ && pnpm install --frozen-lockfile
54-
@cd api-docs/ && ts-node ./watch.ts
54+
@cd api-docs/ && node --experimental-transform-types ./watch.ts
5555

5656
diff-api-docs:
5757
@echo "--> diffing local api docs against sentry-api-schema/openapi-derefed.json"

knip.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ const config: KnipConfig = {
7575
'@babel/preset-react', // Still used in jest
7676
'@babel/preset-typescript', // Still used in jest
7777
'@emotion/babel-plugin', // Still used in jest
78+
'ts-node', // Still used implicitly
79+
'terser', // Still used in a loader
7880
],
7981
rules: {
8082
binaries: 'off',

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,14 +255,14 @@
255255
"dev-acceptance": "NO_DEV_SERVER=1 NODE_ENV=development rspack --watch",
256256
"webpack-profile": "NO_TS_FORK=1 rspack --profile --json > stats.json",
257257
"install-api-docs": "pnpm install --frozen-lockfile --dir ./api-docs",
258-
"build-deprecated-docs": "pnpm run install-api-docs && ts-node api-docs/index.ts api-docs/openapi.json tests/apidocs/openapi-deprecated.json",
259-
"diff-docs": "pnpm run install-api-docs && ts-node api-docs/openapi-diff.ts",
260-
"deref-api-docs": "ts-node api-docs/index.ts tests/apidocs/openapi-spectacular.json tests/apidocs/openapi-derefed.json",
258+
"build-deprecated-docs": "pnpm run install-api-docs && node --experimental-transform-types api-docs/index.ts api-docs/openapi.json tests/apidocs/openapi-deprecated.json",
259+
"diff-docs": "pnpm run install-api-docs && node --experimental-transform-types api-docs/openapi-diff.ts",
260+
"deref-api-docs": "node --experimental-transform-types api-docs/index.ts tests/apidocs/openapi-spectacular.json tests/apidocs/openapi-derefed.json",
261261
"build-chartcuterie-config": "node --experimental-strip-types config/build-chartcuterie.ts",
262262
"build-acceptance": "CODECOV_ENABLE_BA=false IS_ACCEPTANCE_TEST=1 NODE_ENV=production rspack",
263263
"build-production": "NODE_ENV=production rspack --mode production",
264264
"build": "NODE_OPTIONS=--max-old-space-size=4096 rspack",
265-
"build-js-loader": "ts-node scripts/build-js-loader.ts",
265+
"build-js-loader": "node --experimental-transform-types scripts/build-js-loader.ts",
266266
"build-js-po": "node --experimental-strip-types build-utils/ts-extract-gettext.ts",
267267
"validate-api-examples": "pnpm run --dir api-docs openapi-examples-validator ../tests/apidocs/openapi-derefed.json --no-additional-properties",
268268
"mkcert-localhost": "mkcert -key-file config/localhost-key.pem -cert-file config/localhost.pem localhost 127.0.0.1 dev.getsentry.net *.dev.getsentry.net && mkcert -install",

0 commit comments

Comments
 (0)