From 5423810ea014359412cec62ad42c58b3188b4f8e Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Thu, 12 Nov 2026 12:08:33 +0000 Subject: [PATCH 1/3] chore(build): Replace es-check with an acorn-based script es-check only ever ran acorn.parse() on our build output, which a small script does too. The old per-package globs (`build/esm/*.js`) were not recursive and only covered ~560 of ~3100 built files; the script checks all of `build/`. Co-Authored-By: Francesco Gringl-Novy <2411343+mydea@users.noreply.github.com> --- package.json | 2 +- packages/angular/package.json | 2 +- packages/astro/package.json | 2 +- packages/aws-serverless/package.json | 2 +- packages/browser-utils/package.json | 2 +- packages/browser/package.json | 2 +- packages/bun/package.json | 2 +- packages/cloudflare/package.json | 2 +- packages/core/package.json | 2 +- packages/deno/package.json | 2 +- packages/elysia/package.json | 2 +- packages/feedback/package.json | 2 +- packages/gatsby/package.json | 2 +- packages/google-cloud-serverless/package.json | 2 +- packages/hono/package.json | 2 +- packages/integration-shims/package.json | 2 +- packages/nestjs/package.json | 2 +- packages/nextjs/package.json | 2 +- packages/nitro/package.json | 2 +- packages/node-native/package.json | 2 +- packages/node/package.json | 2 +- packages/nuxt/package.json | 2 +- packages/opentelemetry/package.json | 2 +- packages/profiling-node/package.json | 2 +- packages/react-router/package.json | 2 +- packages/react/package.json | 2 +- packages/remix/package.json | 2 +- packages/replay-canvas/package.json | 2 +- packages/replay-internal/package.json | 2 +- packages/replay-worker/package.json | 2 +- .../server-runtime-injection/package.json | 2 +- packages/server-utils/package.json | 2 +- packages/solid/package.json | 2 +- packages/solidstart/package.json | 2 +- packages/svelte/package.json | 2 +- packages/sveltekit/package.json | 2 +- packages/tanstackstart-react/package.json | 2 +- packages/vercel-edge/package.json | 2 +- packages/vue/package.json | 2 +- packages/wasm/package.json | 2 +- pnpm-lock.yaml | 17 ++------ scripts/es-check.mjs | 43 +++++++++++++++++++ 42 files changed, 86 insertions(+), 54 deletions(-) create mode 100644 scripts/es-check.mjs diff --git a/package.json b/package.json index b7dcfa889a95..8c7deb2fd20e 100644 --- a/package.json +++ b/package.json @@ -144,8 +144,8 @@ "@types/jsdom": "^21.1.6", "@types/node": "^20.19.0", "@vitest/coverage-v8": "^4.1.11", + "acorn": "^8.14.0", "deepmerge": "^4.2.2", - "es-check": "^9.8.1", "esbuild": "^0.28.1", "jsdom": "^21.1.2", "madge": "8.0.0", diff --git a/packages/angular/package.json b/packages/angular/package.json index 7cbba52f86ff..8e9543ff8d4f 100644 --- a/packages/angular/package.json +++ b/packages/angular/package.json @@ -55,7 +55,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/{esm2020,fesm2015,fesm2020}/*.mjs --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test": "pnpm run test:unit", "test:unit": "vitest run", "test:unit:watch": "vitest --watch", diff --git a/packages/astro/package.json b/packages/astro/package.json index dbb68cdb564f..28d691c83ea1 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -93,7 +93,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/cjs/*.js && es-check es2020 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test": "pnpm run test:unit", "test:unit": "vitest run", "test:watch": "vitest --watch", diff --git a/packages/aws-serverless/package.json b/packages/aws-serverless/package.json index 08cb65b57c12..335f2fe8d9b9 100644 --- a/packages/aws-serverless/package.json +++ b/packages/aws-serverless/package.json @@ -95,7 +95,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2022 ./build/npm/cjs/*.js && es-check es2022 ./build/npm/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2022", "test": "vitest run", "test:watch": "vitest --watch", "yalc:publish": "yalc publish --push --sig" diff --git a/packages/browser-utils/package.json b/packages/browser-utils/package.json index 224637a4f0d2..20f12311c057 100644 --- a/packages/browser-utils/package.json +++ b/packages/browser-utils/package.json @@ -53,7 +53,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/cjs/*.js && es-check es2020 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test:unit": "vitest run", "test": "vitest run", "test:watch": "vitest --watch", diff --git a/packages/browser/package.json b/packages/browser/package.json index 0147f5b3ef30..9113e30084ea 100644 --- a/packages/browser/package.json +++ b/packages/browser/package.json @@ -66,7 +66,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/{bundles,npm/cjs/prod}/*.js && es-check es2020 ./build/npm/esm/prod/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "size:check": "cat build/bundles/bundle.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES2017: \",$1,\"kB\";}'", "test": "vitest run", "test:watch": "vitest --watch", diff --git a/packages/bun/package.json b/packages/bun/package.json index 94c5d75ae932..04489f065fb3 100644 --- a/packages/bun/package.json +++ b/packages/bun/package.json @@ -67,7 +67,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2022 ./build/cjs/*.js && es-check es2022 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2022", "install:bun": "node ./scripts/install-bun.js", "test": "run-s install:bun test:bun", "test:bun": "bun test", diff --git a/packages/cloudflare/package.json b/packages/cloudflare/package.json index 6cfe55eabbe4..a4862c16ead7 100644 --- a/packages/cloudflare/package.json +++ b/packages/cloudflare/package.json @@ -97,7 +97,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2022 ./build/cjs/prod/*.js && es-check es2022 ./build/esm/prod/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2022", "test": "pnpm run test:unit", "test:unit": "vitest run", "test:watch": "vitest --watch", diff --git a/packages/core/package.json b/packages/core/package.json index 1090e703e385..1fcea3898a4f 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -81,7 +81,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/cjs/*.js && es-check es2020 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test": "vitest run", "test:watch": "vitest --watch", "yalc:publish": "yalc publish --push --sig" diff --git a/packages/deno/package.json b/packages/deno/package.json index 93c30a70cd1f..cb6b00ddef56 100644 --- a/packages/deno/package.json +++ b/packages/deno/package.json @@ -50,7 +50,7 @@ "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", "lint:fix": "oxlint . --fix --type-aware", - "lint:es-compatibility": "es-check es2022 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2022", "install:deno": "node ./scripts/install-deno.mjs", "test": "run-s install:deno deno-types test:types test:unit", "test:types": "deno check --unstable-sloppy-imports test", diff --git a/packages/elysia/package.json b/packages/elysia/package.json index 375ae8b5f19c..c5e0aeb8b4f9 100644 --- a/packages/elysia/package.json +++ b/packages/elysia/package.json @@ -63,7 +63,7 @@ "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", "lint:fix": "oxlint . --fix --type-aware", - "lint:es-compatibility": "es-check es2022 ./build/cjs/*.js && es-check es2022 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2022", "test": "vitest run", "test:watch": "vitest --watch", "yalc:publish": "yalc publish --push --sig" diff --git a/packages/feedback/package.json b/packages/feedback/package.json index 8add18f47a1d..cf86aae395bd 100644 --- a/packages/feedback/package.json +++ b/packages/feedback/package.json @@ -55,7 +55,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/{bundles,npm/cjs}/*.js && es-check es2020 ./build/npm/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test": "vitest run", "test:watch": "vitest --watch", "yalc:publish": "yalc publish --push --sig" diff --git a/packages/gatsby/package.json b/packages/gatsby/package.json index 7d1e21e41377..d2c428cf9856 100644 --- a/packages/gatsby/package.json +++ b/packages/gatsby/package.json @@ -68,7 +68,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/cjs/*.js && es-check es2020 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test": "vitest run", "test:watch": "vitest --watch", "yalc:publish": "yalc publish --push --sig" diff --git a/packages/google-cloud-serverless/package.json b/packages/google-cloud-serverless/package.json index bedb5fa1ec13..79f7992bf1a6 100644 --- a/packages/google-cloud-serverless/package.json +++ b/packages/google-cloud-serverless/package.json @@ -72,7 +72,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2022 ./build/cjs/*.js && es-check es2022 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2022", "test": "vitest run", "test:watch": "vitest --watch", "yalc:publish": "yalc publish --push --sig" diff --git a/packages/hono/package.json b/packages/hono/package.json index 27c1983ee59d..da883714031c 100644 --- a/packages/hono/package.json +++ b/packages/hono/package.json @@ -127,7 +127,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2022 ./build/cjs/*.js && es-check es2022 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2022", "test": "pnpm run test:unit", "test:unit": "vitest run", "test:watch": "vitest --watch", diff --git a/packages/integration-shims/package.json b/packages/integration-shims/package.json index fc36769f0de3..793bc13c95d6 100644 --- a/packages/integration-shims/package.json +++ b/packages/integration-shims/package.json @@ -35,7 +35,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/cjs/*.js && es-check es2020 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test": "vitest run" }, "repository": { diff --git a/packages/nestjs/package.json b/packages/nestjs/package.json index be7431d73cff..9eeaa4803c8b 100644 --- a/packages/nestjs/package.json +++ b/packages/nestjs/package.json @@ -86,7 +86,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2022 ./build/cjs/*.js && es-check es2022 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2022", "test": "vitest run", "test:watch": "vitest --watch", "yalc:publish": "yalc publish --push --sig" diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 18be625fa5cf..9b79f7f92251 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -122,7 +122,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/cjs/*.js && es-check es2020 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test": "pnpm run test:unit", "test:all": "run-s test:unit", "test:unit": "vitest run", diff --git a/packages/nitro/package.json b/packages/nitro/package.json index 00c81795b0b2..612fec384b62 100644 --- a/packages/nitro/package.json +++ b/packages/nitro/package.json @@ -63,7 +63,7 @@ "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", "lint:fix": "oxlint . --fix --type-aware", - "lint:es-compatibility": "es-check es2022 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2022", "test": "vitest run", "test:watch": "vitest --watch", "yalc:publish": "yalc publish --push --sig" diff --git a/packages/node-native/package.json b/packages/node-native/package.json index 880063f1ea53..25fa2a96e9b7 100644 --- a/packages/node-native/package.json +++ b/packages/node-native/package.json @@ -44,7 +44,7 @@ "clean": "rm -rf build", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2022 ./build/cjs/*.js && es-check es2022 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2022", "lint:fix": "oxlint . --fix --type-aware", "build": "pnpm run build:types && pnpm run build:transpile", "build:transpile": "pnpm exec rolldown -c rollup.npm.config.mjs", diff --git a/packages/node/package.json b/packages/node/package.json index 927ff23eb293..82f14f8891ee 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -103,7 +103,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2022 ./build/cjs/*.js && es-check es2022 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2022", "test": "pnpm run test:unit", "test:unit": "vitest run", "test:watch": "vitest --watch", diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index 66f481d1337d..40f1e4efa0b9 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -94,7 +94,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/cjs/*.js && es-check es2020 ./build/esm/*.js --module && es-check es2020 ./build/module/*.mjs --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test": "pnpm run test:unit", "test:unit": "vitest run", "test:watch": "vitest --watch", diff --git a/packages/opentelemetry/package.json b/packages/opentelemetry/package.json index ade84ba7af2d..78287d24fbf1 100644 --- a/packages/opentelemetry/package.json +++ b/packages/opentelemetry/package.json @@ -51,7 +51,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2022 ./build/cjs/*.js && es-check es2022 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2022", "test": "pnpm run test:unit", "test:unit": "vitest run", "test:watch": "vitest --watch", diff --git a/packages/profiling-node/package.json b/packages/profiling-node/package.json index 02a916ccbf0a..174732801943 100644 --- a/packages/profiling-node/package.json +++ b/packages/profiling-node/package.json @@ -36,7 +36,7 @@ "clean": "rm -rf build", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2022 ./build/cjs/*.js && es-check es2022 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2022", "lint:fix": "oxlint . --fix --type-aware", "build": "pnpm run build:types && pnpm run build:transpile", "build:transpile": "pnpm exec rolldown -c rollup.npm.config.mjs", diff --git a/packages/react-router/package.json b/packages/react-router/package.json index 3c2290ca697e..55222fc3de14 100644 --- a/packages/react-router/package.json +++ b/packages/react-router/package.json @@ -97,7 +97,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/cjs/*.js && es-check es2020 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test": "pnpm run test:unit", "test:unit": "vitest run", "test:watch": "vitest --watch", diff --git a/packages/react/package.json b/packages/react/package.json index 42b6b8073a7c..c0a918f7215f 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -102,7 +102,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/cjs/*.js && es-check es2020 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test": "vitest run", "test:watch": "vitest --watch", "yalc:publish": "yalc publish --push --sig" diff --git a/packages/remix/package.json b/packages/remix/package.json index a95d66868c16..9f2c44e6435a 100644 --- a/packages/remix/package.json +++ b/packages/remix/package.json @@ -121,7 +121,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/cjs/*.js && es-check es2020 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020 'build/{cjs,esm}/**/*.js' build/import-hook.mjs && node ../../scripts/es-check.mjs es2022 build/v3-node.mjs", "test": "pnpm run test:unit", "test:unit": "vitest run --config vitest.config.unit.ts", "test:watch": "vitest --watch --config vitest.config.unit.ts", diff --git a/packages/replay-canvas/package.json b/packages/replay-canvas/package.json index 52849b98859e..171fefc9fa28 100644 --- a/packages/replay-canvas/package.json +++ b/packages/replay-canvas/package.json @@ -39,7 +39,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/{bundles,npm/cjs}/*.js && es-check es2020 ./build/npm/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test": "vitest run", "test:watch": "vitest --watch", "yalc:publish": "yalc publish --push --sig" diff --git a/packages/replay-internal/package.json b/packages/replay-internal/package.json index 7ee227f62708..01f8abd1115a 100644 --- a/packages/replay-internal/package.json +++ b/packages/replay-internal/package.json @@ -55,7 +55,7 @@ "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", "lint:fix": "oxlint . --fix --type-aware", - "lint:es-compatibility": "es-check es2020 ./build/{bundles,npm/cjs}/*.js && es-check es2020 ./build/npm/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test": "vitest run", "test:watch": "vitest --watch", "yalc:publish": "yalc publish --push --sig" diff --git a/packages/replay-worker/package.json b/packages/replay-worker/package.json index db0dd63e05c6..388423ae79b0 100644 --- a/packages/replay-worker/package.json +++ b/packages/replay-worker/package.json @@ -40,7 +40,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test": "vitest run", "test:watch": "vitest --watch" }, diff --git a/packages/server-runtime-injection/package.json b/packages/server-runtime-injection/package.json index 7fa9b0c76d15..e9ad10c901b4 100644 --- a/packages/server-runtime-injection/package.json +++ b/packages/server-runtime-injection/package.json @@ -70,7 +70,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/cjs/*.js && es-check es2020 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test:unit": "vitest run", "test": "vitest run", "test:watch": "vitest --watch", diff --git a/packages/server-utils/package.json b/packages/server-utils/package.json index 0b8481af2e02..089b51e3e8dd 100644 --- a/packages/server-utils/package.json +++ b/packages/server-utils/package.json @@ -127,7 +127,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/cjs/*.js && es-check es2020 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test:unit": "vitest run", "test": "vitest run", "test:watch": "vitest --watch", diff --git a/packages/solid/package.json b/packages/solid/package.json index feba8ad958da..fd61809b86d4 100644 --- a/packages/solid/package.json +++ b/packages/solid/package.json @@ -99,7 +99,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/cjs/*.js && es-check es2020 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test": "vitest run", "test:watch": "vitest --watch", "yalc:publish": "yalc publish --push --sig" diff --git a/packages/solidstart/package.json b/packages/solidstart/package.json index f6a5a45db176..6ddea4a7a66c 100644 --- a/packages/solidstart/package.json +++ b/packages/solidstart/package.json @@ -125,7 +125,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/cjs/*.js && es-check es2020 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test": "pnpm run test:unit", "test:unit": "vitest run", "test:watch": "vitest --watch", diff --git a/packages/svelte/package.json b/packages/svelte/package.json index 92bc2f35b584..55a860a505db 100644 --- a/packages/svelte/package.json +++ b/packages/svelte/package.json @@ -61,7 +61,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/cjs/*.js && es-check es2020 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test": "vitest run", "test:watch": "vitest --watch", "yalc:publish": "yalc publish --push --sig" diff --git a/packages/sveltekit/package.json b/packages/sveltekit/package.json index 7e7b9b592573..39c72b6877c4 100644 --- a/packages/sveltekit/package.json +++ b/packages/sveltekit/package.json @@ -107,7 +107,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/cjs/*.js && es-check es2020 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test": "pnpm run test:unit", "test:unit": "vitest run", "test:watch": "vitest --watch", diff --git a/packages/tanstackstart-react/package.json b/packages/tanstackstart-react/package.json index 72be6bceca15..f1f6150e74ca 100644 --- a/packages/tanstackstart-react/package.json +++ b/packages/tanstackstart-react/package.json @@ -80,7 +80,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/cjs/*.js && es-check es2020 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test": "pnpm run test:unit", "test:unit": "vitest run", "test:watch": "vitest --watch", diff --git a/packages/vercel-edge/package.json b/packages/vercel-edge/package.json index d6e3e219e5cc..97fd7cc5ffa3 100644 --- a/packages/vercel-edge/package.json +++ b/packages/vercel-edge/package.json @@ -55,7 +55,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/cjs/*.js && es-check es2020 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test": "vitest run", "test:watch": "vitest --watch", "yalc:publish": "yalc publish --push --sig" diff --git a/packages/vue/package.json b/packages/vue/package.json index a56781b71fe1..aace53ece35c 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -82,7 +82,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/cjs/*.js && es-check es2020 ./build/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "test": "vitest run", "test:watch": "vitest --watch", "yalc:publish": "yalc publish --push --sig" diff --git a/packages/wasm/package.json b/packages/wasm/package.json index 425d0597a608..51c0fe316468 100644 --- a/packages/wasm/package.json +++ b/packages/wasm/package.json @@ -56,7 +56,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "es-check es2020 ./build/{bundles,npm/cjs}/*.js && es-check es2020 ./build/npm/esm/*.js --module", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020", "yalc:publish": "yalc publish --push --sig" }, "sideEffects": false diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cf346db61233..b3bbf5f9ac69 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -201,12 +201,12 @@ importers: '@vitest/coverage-v8': specifier: ^4.1.11 version: 4.1.11(vitest@4.1.12) + acorn: + specifier: ^8.14.0 + version: 8.18.0 deepmerge: specifier: ^4.2.2 version: 4.3.1 - es-check: - specifier: ^9.8.1 - version: 9.8.1 esbuild: specifier: ^0.28.1 version: 0.28.1 @@ -11558,11 +11558,6 @@ packages: resolution: {integrity: sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg==} engines: {node: '>= 0.4'} - es-check@9.8.1: - resolution: {integrity: sha512-F6bumjRmN+OWpEUh3ewhE/S1ey6cHKGMNXPn0iE2tBnict3O855Uij6UYbuHnLS1E3eILvg61KdH6kHbGi9www==} - engines: {node: '>=18.0.0'} - hasBin: true - es-define-property@1.0.1: resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} engines: {node: '>= 0.4'} @@ -31107,12 +31102,6 @@ snapshots: unbox-primitive: 1.1.0 which-typed-array: 1.1.19 - es-check@9.8.1: - dependencies: - acorn: 8.18.0 - browserslist: 4.29.0 - fast-glob: 3.3.3 - es-define-property@1.0.1: {} es-errors@1.3.0: {} diff --git a/scripts/es-check.mjs b/scripts/es-check.mjs new file mode 100644 index 000000000000..e1bec7f61cea --- /dev/null +++ b/scripts/es-check.mjs @@ -0,0 +1,43 @@ +// Fails if any built file (default: everything in `build/`) uses syntax newer than the given ES version. +/* eslint-disable no-console */ +import { globSync, readFileSync } from 'node:fs'; +import { parse } from 'acorn'; + +const [target, ...args] = process.argv.slice(2); +const ecmaVersion = Number(target?.replace(/^es/, '')); +const patterns = args.length ? args : ['build/**/*.{js,mjs,cjs}']; + +if (!ecmaVersion) { + console.error('Usage: node es-check.mjs [glob...]'); + process.exit(1); +} + +let fileCount = 0; +let failed = false; + +for (const pattern of patterns) { + const files = globSync(pattern, { exclude: ['**/node_modules/**'] }); + + if (!files.length) { + console.error(`es-check: no files match ${pattern}`); + failed = true; + } + + for (const file of files) { + fileCount++; + try { + // Module grammar is stricter than script grammar and also accepts CJS and IIFE output, so + // one mode covers every file. Hashbangs are allowed for CLI entry points. + parse(readFileSync(file, 'utf8'), { ecmaVersion, sourceType: 'module', allowHashBang: true }); + } catch (error) { + console.error(`es-check: ${file} is not valid ${target}: ${error.message}`); + failed = true; + } + } +} + +if (failed) { + process.exit(1); +} + +console.log(`es-check: ${fileCount} files are valid ${target}`); From 30d1a46b579ae5180024a69075141ac5f581a2b8 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Fri, 13 Nov 2026 07:02:02 +0000 Subject: [PATCH 2/3] chore(deps): Record upstream deprecation of postcss-selector-parser 7.2.0 in lockfile --- pnpm-lock.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d661038a2eb7..4cd85d7d8aa8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15845,6 +15845,7 @@ packages: postcss-selector-parser@7.2.0: resolution: {integrity: sha512-Khh/tERVBn0I1499dvBSHY0pWJloMJWUxDsOBM0CCDPAcVZ10Jl2L1qy1f19uEX22spa8Mv7DCdEQJc0cGwBhQ==} engines: {node: '>=4'} + deprecated: Double-escapes CSS Modules class names (#362). Use 7.2.1. postcss-svgo@7.1.3: resolution: {integrity: sha512-2QfoFOYMcj8lwcVEf9WeTlkVIAm7u2QvOEhMzkQU3KUhhGX/l8hVV9EtjMv4iq3E9iI3OeeMN0YoMLbGusuigw==} From d59935d8148e9bd49ce5953471091e2b043621f4 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Fri, 13 Nov 2026 10:37:23 +0000 Subject: [PATCH 3/3] chore(remix): Check the Remix 3 client bundle against ES2022 web-vitals 6 is inlined untranspiled. Its Array.prototype.at use is guarded since #26347, and its remaining ES2022 syntax (public instance class fields) runs on all supported browsers. Co-Authored-By: Francesco Gringl-Novy <2411343+mydea@users.noreply.github.com> --- packages/remix/package.json | 5 ++++- scripts/es-check.mjs | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/remix/package.json b/packages/remix/package.json index 7b637be0506f..787d3be99e19 100644 --- a/packages/remix/package.json +++ b/packages/remix/package.json @@ -107,6 +107,9 @@ "react": "18.x", "remix": "3.x" }, + "//_scripts_comment": [ + "`lint:es-compatibility`: `build/v3-node.mjs` is Node-only and uses top-level await. `build/esm/v3/client-bundle.js` inlines web-vitals 6 untranspiled, whose only ES2022 syntax is public instance class fields (Chrome 72, Firefox 69, Safari 14, so supported by all our minimum browsers). Its `Array.prototype.at` use is guarded since #26347." + ], "scripts": { "build": "run-p build:transpile build:types", "build:dev": "pnpm run build", @@ -120,7 +123,7 @@ "lint:fix": "oxlint . --fix --type-aware", "lint": "oxlint . --type-aware", "lint:types": "oxlint src --type-aware --type-check", - "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020 'build/{cjs,esm}/**/*.js' build/import-hook.mjs && node ../../scripts/es-check.mjs es2022 build/v3-node.mjs", + "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020 'build/{cjs,esm}/**/*.js' '!build/esm/v3/client-bundle.js' build/import-hook.mjs && node ../../scripts/es-check.mjs es2022 build/esm/v3/client-bundle.js build/v3-node.mjs", "test": "pnpm run test:unit", "test:unit": "vitest run --config vitest.config.unit.ts", "test:watch": "vitest --watch --config vitest.config.unit.ts", diff --git a/scripts/es-check.mjs b/scripts/es-check.mjs index e1bec7f61cea..eff596cc0137 100644 --- a/scripts/es-check.mjs +++ b/scripts/es-check.mjs @@ -1,11 +1,14 @@ // Fails if any built file (default: everything in `build/`) uses syntax newer than the given ES version. +// Globs starting with `!` exclude files from the other globs. /* eslint-disable no-console */ import { globSync, readFileSync } from 'node:fs'; import { parse } from 'acorn'; const [target, ...args] = process.argv.slice(2); const ecmaVersion = Number(target?.replace(/^es/, '')); -const patterns = args.length ? args : ['build/**/*.{js,mjs,cjs}']; +const excludes = ['**/node_modules/**', ...args.filter(arg => arg.startsWith('!')).map(arg => arg.slice(1))]; +const includes = args.filter(arg => !arg.startsWith('!')); +const patterns = includes.length ? includes : ['build/**/*.{js,mjs,cjs}']; if (!ecmaVersion) { console.error('Usage: node es-check.mjs [glob...]'); @@ -16,7 +19,7 @@ let fileCount = 0; let failed = false; for (const pattern of patterns) { - const files = globSync(pattern, { exclude: ['**/node_modules/**'] }); + const files = globSync(pattern, { exclude: excludes }); if (!files.length) { console.error(`es-check: no files match ${pattern}`);