mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-27 06:43:19 +08:00
Lowering named helpers by the size of their registry at first use (%union.retag.N, %arr.map.N, ...), lifted closures and optional-chain locals by compiler-wide counters (%fnN, chain.N), generic instances by their instance count, and records and unions by creation order (rN, uN). Class expressions, mixin instances, function-local generics, non-exported namespace segments and some module globals carried the byte offset of their declaration. A name therefore depended on which unit lowered first and on the positions of unrelated code. Helpers, instances, records and unions are now named by a hash of the key they are interned by (keyedHelperName), and recursive records and unions by their printed type and declaration. Closures and optional-chain ids are named by their lowering unit, their structural position and a count per key within the unit. Offset-based names use the structural position: the chain of enclosing named declarations and the node's ordinal among same-kind nodes inside the nearest one, so an edit outside that declaration leaves the name unchanged. Two different keys with the same name throw an InternalCompilerError. The module lists its records and unions by id. The generated program is unchanged apart from these names and that order, and test:lowering-order now fails on any name difference.
54 lines
2.6 KiB
JSON
54 lines
2.6 KiB
JSON
{
|
|
"name": "scriptc-monorepo",
|
|
"private": true,
|
|
"engines": {
|
|
"node": ">=24.0.0"
|
|
},
|
|
"scripts": {
|
|
"build": "pnpm -r --filter \"./packages/*\" run build",
|
|
"build:fresh": "rm -rf packages/compiler/dist packages/cli/dist node_modules/.cache/scriptc-tsc && pnpm build",
|
|
"build:native-compiler": "node --max-old-space-size=8192 --import tsx scripts/build-native-cli.mts",
|
|
"bench:builds": "node scripts/bench-builds.mjs",
|
|
"bench:runtime": "node scripts/bench-runtime.mjs",
|
|
"bench:ast-access": "node scripts/bench-ast-access.mjs",
|
|
"bench:backend-analysis": "node scripts/bench-backend-analysis.mjs",
|
|
"test": "vitest run",
|
|
"test:ts7": "node scripts/test-ts7.mjs",
|
|
"test:checker-identity": "node scripts/checker-identity.mjs",
|
|
"generate:ts7-ast": "node scripts/generate-ts7-ast-schema.mjs",
|
|
"test:fetch-conformance": "vitest run tests/harness/fetch-conformance.test.ts",
|
|
"test:test262": "tsx tests/test262/run.ts",
|
|
"test:test262:fetch": "node tests/test262/fetch.mjs",
|
|
"test:cache-identity": "node tests/harness/cache-identity.mjs",
|
|
"test:lowering-order": "node scripts/lowering-order.mjs --fail-on names",
|
|
"test:sandbox": "node scripts/sandbox-test.mjs",
|
|
"test:sandbox:image": "node scripts/sandbox-image.mjs",
|
|
"test:watch": "vitest",
|
|
"lint": "node docs/scripts/limitations-partials.mjs check && oxlint --deny-warnings packages scripts internal/compatibility/src tests/harness vitest.config.ts",
|
|
"lint:fix": "pnpm lint --fix",
|
|
"format": "oxfmt --write \"{packages,scripts,internal/compatibility/src,tests/harness}/**/*.{js,mjs,cjs,ts,mts,cts,tsx}\" vitest.config.ts .oxlintrc.jsonc .oxfmtrc.jsonc",
|
|
"format:check": "oxfmt --check \"{packages,scripts,internal/compatibility/src,tests/harness}/**/*.{js,mjs,cjs,ts,mts,cts,tsx}\" vitest.config.ts .oxlintrc.jsonc .oxfmtrc.jsonc",
|
|
"manifest": "tsx scripts/surface-manifest.mjs",
|
|
"node-compat": "pnpm --filter @internal/compatibility run update",
|
|
"node-compat:backlog": "pnpm --filter @internal/compatibility run backlog --",
|
|
"node-compat:check": "pnpm --filter @internal/compatibility run check",
|
|
"scriptc": "tsx packages/cli/src/main.ts"
|
|
},
|
|
"devDependencies": {
|
|
"@scriptc/experimental": "workspace:*",
|
|
"@scriptc/threads": "workspace:*",
|
|
"@scriptc/types": "workspace:*",
|
|
"@types/node": "^24.0.0",
|
|
"effect": "3.22.2",
|
|
"js-yaml": "4.3.0",
|
|
"oxfmt": "0.71.0",
|
|
"oxlint": "1.86.0",
|
|
"rollup": "4.62.2",
|
|
"three": "0.186.1",
|
|
"tsx": "^4.19.0",
|
|
"typescript": "5.9.3",
|
|
"vercel": "58.1.0",
|
|
"vitest": "^3.0.0"
|
|
}
|
|
}
|