Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ jobs:
- run: pnpm --filter @scriptc/llvm-darwin-arm64 build:native
- run: pnpm --filter @scriptc/runtime-darwin-arm64 build:native
- run: pnpm build
- name: TypeScript 7 full parity sweep
if: matrix.flavor == 'plain' && matrix.shard == 1
run: pnpm test:ts7
# Separate vitest invocations because the shard axes must not mix: a file
# lands in exactly ONE --shard slice, so an env-sharded file behind
# --shard would run only one of its three case slices and silently
Expand Down Expand Up @@ -141,6 +144,8 @@ jobs:
version: 0.16.0
- run: pnpm --filter @scriptc/runtime-wasm32-wasi build:native
- run: pnpm build
- name: TypeScript 7 full parity sweep
run: pnpm test:ts7
- name: Linux helper object format and no-clang output contract
run: |
PATH="$RUNNER_TEMP/traps:$PATH"
Expand Down Expand Up @@ -306,6 +311,8 @@ jobs:
pnpm install --frozen-lockfile
}
- run: pnpm build
- name: TypeScript 7 full parity sweep
run: pnpm test:ts7
- name: Windows path regressions
run: pnpm exec vitest run packages/compiler/test/ts7/program.test.ts packages/cli/test/paths.test.ts
- name: Windows Sandbox path regression
Expand Down
2 changes: 1 addition & 1 deletion docs/src/generated/node-v24-compatibility-meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"schemaVersion": 3,
"nodeVersion": "24.15.0",
"nodeCommit": "848430679556aed0bd073f2bc263331ad84fa119",
"artifactVersion": "23946578017afb1446f3",
"artifactVersion": "af5f71a4e38e710a5e12",
"rowCount": 3662
}
24 changes: 12 additions & 12 deletions docs/src/generated/node-v24-compatibility.json
Original file line number Diff line number Diff line change
Expand Up @@ -697,19 +697,19 @@
"entries": 2,
"apiEntries": 2,
"static": {
"supported": 0,
"supported": 2,
"partial": 0,
"refused": 0,
"not-implemented": 2,
"not-implemented": 0,
"by-design": 0,
"unreviewed": 0,
"not-applicable": 0
},
"dynamic": {
"supported": 0,
"supported": 2,
"partial": 0,
"refused": 0,
"not-implemented": 2,
"not-implemented": 0,
"by-design": 0,
"unreviewed": 0,
"not-applicable": 0
Expand Down Expand Up @@ -58639,12 +58639,12 @@
"inherited": false
},
"static": {
"status": "not-implemented",
"status": "supported",
"detail": "Derived from the exact API rows in this chapter.",
"verification": "derived"
},
"dynamic": {
"status": "not-implemented",
"status": "supported",
"detail": "Derived from the exact API rows in this chapter.",
"verification": "derived"
}
Expand All @@ -58667,14 +58667,14 @@
"inherited": true
},
"static": {
"status": "not-implemented",
"detail": "Not implemented in scriptc's static module-loader subset yet.",
"verification": "declared-gap"
"status": "supported",
"detail": "Implemented for the documented scriptc module-loader subset.",
"verification": "test-backed"
},
"dynamic": {
"status": "not-implemented",
"detail": "Not implemented in the embedded module-loader subset yet.",
"verification": "declared-gap"
"status": "supported",
"detail": "Implemented for the documented embedded module-loader subset.",
"verification": "test-backed"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion internal/compatibility/dynamic-support.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
{ "chapter": "esm", "symbols": ["meta", "import.meta.resolve", "dirname", "filename", "main", "data:", "require", "__filename", "require.main", "require.resolve", "NODE_PATH", "require.extensions", "require.cache"], "status": "not-implemented" },
{ "chapter": "packages", "symbols": ["package.json", "\"name\"", "\"main\"", "\"type\"", "\"exports\"", "\"imports\""], "status": "partial", "evidence": ["tests/fixtures/npm/cases/dual-entry/main.ts", "tests/fixtures/npm/cases/self-name/main.ts", "tests/fixtures/npm/cases/scoped-nested/main.ts"] },
{ "chapter": "packages", "symbols": ["--input-type"], "status": "not-applicable" },
{ "chapter": "typescript", "symbols": ["type"], "status": "not-implemented" }
{ "chapter": "typescript", "symbols": ["type"], "status": "supported", "evidence": ["tests/corpus/2705-type-import-link-dynamic/main.ts", "tests/corpus/2706-type-import-link-dynamic-success/main.ts", "tests/harness/errors.test.ts"] }
],
"modules": {
"events": { "exports": ["EventEmitter", "once", "on", "listenerCount", "getEventListeners", "setMaxListeners", "defaultMaxListeners", "errorMonitor", "captureRejectionSymbol"], "members": ["emitter.addListener", "emitter.emit", "emitter.eventNames", "emitter.getMaxListeners", "emitter.listenerCount", "emitter.listeners", "emitter.off", "emitter.on", "emitter.once", "emitter.prependListener", "emitter.prependOnceListener", "emitter.removeAllListeners", "emitter.removeListener", "emitter.setMaxListeners", "emitter.rawListeners", "events.getEventListeners", "events.listenerCount", "events.once", "events.on", "events.setMaxListeners"], "evidence": ["tests/fixtures/npm/cases/stream-shims/main.ts"] },
Expand Down
43 changes: 5 additions & 38 deletions internal/compatibility/generated/node-v24-backlog.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
"nodeVersion": "24.15.0",
"nodeCommit": "848430679556aed0bd073f2bc263331ad84fa119",
"summary": {
"taskCount": 3369,
"tierItemCount": 6673,
"taskCount": 3368,
"tierItemCount": 6671,
"tiers": {
"static": {
"replace-refusal": 73,
"verify-gap": 2764,
"audit-partial": 371,
"classify": 3,
"implement": 93
"implement": 92
},
"dynamic": {
"audit-partial": 745,
"verify-gap": 2302,
"replace-refusal": 101,
"implement": 221
"implement": 220
}
},
"priorities": {
"high": 4510,
"high": 4508,
"normal": 1411,
"low": 752
}
Expand Down Expand Up @@ -62178,39 +62178,6 @@
}
}
},
{
"id": "typescript:e0b7094a6baa",
"chapter": "typescript",
"label": "Importing types without type keyword",
"signature": "Importing types without `type` keyword",
"apiSymbol": "type",
"docsUrl": "https://nodejs.org/docs/v24.15.0/api/typescript.html#importing-types-without-type-keyword",
"nodeStability": {
"index": "2",
"level": 2,
"text": "Stable",
"inherited": true
},
"priority": "high",
"tiers": {
"static": {
"status": "not-implemented",
"action": "implement",
"verification": "declared-gap",
"confidence": "medium",
"source": "compiler-feature:typescript.type",
"tests": []
},
"dynamic": {
"status": "not-implemented",
"action": "implement",
"verification": "declared-gap",
"confidence": "medium",
"source": "island-feature:typescript.type",
"tests": []
}
}
},
{
"id": "net:a4534171f578",
"chapter": "net",
Expand Down
46 changes: 34 additions & 12 deletions internal/compatibility/generated/node-v24-internal.json
Original file line number Diff line number Diff line change
Expand Up @@ -770,19 +770,19 @@
"entries": 11,
"apiEntries": 2,
"static": {
"supported": 0,
"supported": 2,
"partial": 0,
"refused": 0,
"not-implemented": 2,
"not-implemented": 0,
"by-design": 0,
"unreviewed": 0,
"not-applicable": 0
},
"dynamic": {
"supported": 0,
"supported": 2,
"partial": 0,
"refused": 0,
"not-implemented": 2,
"not-implemented": 0,
"by-design": 0,
"unreviewed": 0,
"not-applicable": 0
Expand Down Expand Up @@ -78423,12 +78423,23 @@
"inherited": false
},
"static": {
"status": "not-implemented",
"evidence": "derived:descendants"
"status": "supported",
"evidence": "derived:descendants",
"tests": [
"tests/corpus/2702-type-import-link-static/main.ts",
"tests/corpus/2703-type-import-link-static-reexport/main.ts",
"tests/corpus/2704-type-import-link-static-success/main.ts",
"tests/harness/errors.test.ts"
]
},
"dynamic": {
"status": "not-implemented",
"evidence": "derived:descendants"
"status": "supported",
"evidence": "derived:descendants",
"tests": [
"tests/corpus/2705-type-import-link-dynamic/main.ts",
"tests/corpus/2706-type-import-link-dynamic-success/main.ts",
"tests/harness/errors.test.ts"
]
},
"anchorSource": "chapter"
},
Expand Down Expand Up @@ -78585,12 +78596,23 @@
"inherited": true
},
"static": {
"status": "not-implemented",
"evidence": "compiler-feature:typescript.type"
"status": "supported",
"evidence": "compiler-feature:typescript.type",
"tests": [
"tests/corpus/2702-type-import-link-static/main.ts",
"tests/corpus/2703-type-import-link-static-reexport/main.ts",
"tests/corpus/2704-type-import-link-static-success/main.ts",
"tests/harness/errors.test.ts"
]
},
"dynamic": {
"status": "not-implemented",
"evidence": "island-feature:typescript.type"
"status": "supported",
"evidence": "island-feature:typescript.type",
"tests": [
"tests/corpus/2705-type-import-link-dynamic/main.ts",
"tests/corpus/2706-type-import-link-dynamic-success/main.ts",
"tests/harness/errors.test.ts"
]
},
"anchorSource": "exact"
},
Expand Down
2 changes: 1 addition & 1 deletion internal/compatibility/static-support.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
{ "chapter": "esm", "symbols": ["meta", "import.meta.resolve", "data:", "require", "__filename", "require.main", "require.resolve", "NODE_PATH", "require.extensions", "require.cache"], "status": "not-implemented" },
{ "chapter": "packages", "symbols": ["package.json", "\"name\"", "\"main\"", "\"type\"", "\"exports\"", "\"imports\""], "status": "partial", "evidence": ["tests/corpus/2092-package-imports/main.ts", "tests/corpus/2120-package-self-import/main.ts", "tests/corpus/2124-imports-field-wildcard/main.ts", "tests/corpus/2390-dot-requires/main.cjs"] },
{ "chapter": "packages", "symbols": ["--input-type"], "status": "not-applicable" },
{ "chapter": "typescript", "symbols": ["type"], "status": "not-implemented" }
{ "chapter": "typescript", "symbols": ["type"], "status": "supported", "evidence": ["tests/corpus/2702-type-import-link-static/main.ts", "tests/corpus/2703-type-import-link-static-reexport/main.ts", "tests/corpus/2704-type-import-link-static-success/main.ts", "tests/harness/errors.test.ts"] }
],
"dedicated": [
{ "symbols": ["console.log", "console.info", "console.debug", "console.error", "console.warn"], "status": "partial", "evidence": ["tests/corpus/1460-console-error-warn.ts", "tests/corpus/2440-console-inspect-args.ts"] },
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"build": "pnpm -r --filter \"./packages/*\" run build",
"build:fresh": "rm -rf packages/compiler/dist packages/cli/dist node_modules/.cache/scriptc-tsc && pnpm build",
"test": "vitest run",
"test:ts7": "node scripts/test-ts7.mjs",
"test:fetch-conformance": "vitest run tests/harness/fetch-conformance.test.ts",
"test:cache-identity": "node tests/harness/cache-identity.mjs",
"test:sandbox": "node scripts/sandbox-test.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"access": "public"
},
"scripts": {
"build": "node node_modules/typescript5/bin/tsc -p tsconfig.json"
"build": "node node_modules/typescript/bin/tsc -p tsconfig.json"
},
"dependencies": {
"@scriptc/runtime": "workspace:*",
Expand Down
23 changes: 21 additions & 2 deletions packages/compiler/src/frontend/lowering/lower-island.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { Lowerer } from "./lowerer.js";
import { BOOL, BYTES_U8, DYN, F64, IrExpr, IrStmt, IrType, JSVAL, MAX_ISLAND_CALLBACK_ARITY, STRING, VOID, canConvertToDyn, canMarshalTypedFuncIntoIsland, islandPromisePayloadTag, isUnitType } from "../../ir/ir.js";
import { ISLAND_SURFACE, IslandFnEntry, STATIC_MATH_FNS, STATIC_MATH_PROPS, boundaryIntoIslandMsg } from "./surfaces.js";
import { requiresDynamicApiDiag, requiresDynamicPackageDiag } from "../../diagnostics/diagnostic.js";
import { isCjsJsFile, isJsSourceFile, locOf, npmPackageNameOf } from "../program.js";
import { esmNamedImportLinkCrash, isCjsJsFile, isJsSourceFile, locOf, npmPackageNameOf } from "../program.js";
import { foldedStringKeyOf, lowerDynObjectLiteral, pureReemittable } from "./lower-exprs.js";
import { PoisonError, dynUndefinedExpr, newFnCtx, nodeThrowExpr, own } from "./lowerer.js";
import {
Expand Down Expand Up @@ -2794,13 +2794,32 @@ export function lowerStaticReadableStreamReaderCall(
lowerer.fnStack.push(fnCtx);
try {
const body: IrStmt[] = [];
const linkCrash = esmNamedImportLinkCrash(lowerer.program, dep);
if (linkCrash !== null) {
// A dynamic import links its graph when the returned promise is
// settled. Preserve that timing by throwing from the synthesized
// namespace builder, which runs inside the Promise reaction; the
// bridge turns the throw into the import promise's rejection. No
// module init may run before this link failure.
body.push({
kind: "throw",
value: {
kind: "libCall",
fn: "error.new",
args: [{ kind: "strLit", value: linkCrash.message, type: STRING, loc }],
type: { kind: "object", className: linkCrash.className },
loc,
},
loc,
});
}
// A synchronous entry has no run-once guard, so its historical
// self-import path must not call %init again. An ASYNC entry does
// have the stronger evaluation-promise cache: awaiting that cached
// promise is essential for top-level `await import("./self")`,
// which deadlocks (and ultimately exits 13) in Node rather than
// exposing a half-evaluated namespace.
if (dep !== lowerer.entry || isAsync) {
if (linkCrash === null && (dep !== lowerer.entry || isAsync)) {
const call: IrExpr = {
kind: "call",
callee: initName,
Expand Down
5 changes: 2 additions & 3 deletions packages/compiler/src/frontend/lowering/lower-modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1963,9 +1963,8 @@ export function collectGlobals(lowerer: Lowerer, sf: ts.SourceFile, topStmts: ts
}]
: [];
// Node's startup refusal (a resolution the graph carries that Node
// rejects — preflight's Node-order resolution walk — or the module-
// LINK SyntaxError of a named import of a CommonJS export its lexer
// cannot detect — cjsNamedImportLinkCheck): the graph is refused
// rejects — preflight's Node-order resolution walk — or a module-LINK
// SyntaxError from either named-import checker): the graph is refused
// before ANY module evaluates, so %main opens with exactly that throw
// (message and error class both Node's) and the entry init below it
// never runs. The init still lowers — the program must otherwise
Expand Down
6 changes: 3 additions & 3 deletions packages/compiler/src/frontend/lowering/lowerer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ export interface LowerOptions {
* path.win32 keep answering THEIR platform everywhere, like Node's. */
targetPlatform?: string;
/** Node's startup refusal (LoadResult.startupCrash — preflight's
* resolution walk and CJS named-import link check): the program
* resolution walk and named-import link checks): the program
* compiles to that startup crash. */
startupCrash?: StartupCrash | null;
/** LIBRARY mode's reachability roots: the profile-mapped exports of the
Expand Down Expand Up @@ -430,8 +430,8 @@ export interface LowererMode {
/** The build's target platform (LowerOptions.targetPlatform — lowerToIr
* passes it to every pass). Defaults to the host. */
targetPlatform?: string;
/** Node's startup refusal (preflight's resolution walk / CJS named-
* import link check): %main opens with exactly this throw, before any
/** Node's startup refusal (preflight's resolution walk / named-import
* link checks): %main opens with exactly this throw, before any
* module init — Node refuses the whole graph before anything evaluates,
* so nothing runs. */
startupCrash?: StartupCrash | null;
Expand Down
Loading
Loading