…ces.ts`
`scripts/hardenNamespaces.ts` imported the TypeScript compiler API, which
`typescript@7` no longer ships, so `check:types` failed on the "Types
(latest)" job. The script now parses the emitted JavaScript with `acorn`.
The script also rewrote each `.js` file without its `.js.map`, so segments
after the start of each rewritten statement pointed into the new
`Object.defineProperty` text. The edits now go through `magic-string`, and
`@jridgewell/remapping` combines its map with the tsc map. The emitted
JavaScript does not change.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BS98KhLjRx59DyEQFi6C7c
Follow-up to #5306.
Types (latest) on
main.scripts/hardenNamespaces.tsimported the TypeScript compiler API, whichtypescript@7no longer ships (import ts from 'typescript'resolves tolib/version). As a result,check:typesfailed in Verify / Types (latest). The script now parses the emitted JavaScript withacorn.Source maps (review comment). The script rewrote each
.jsfile without updating its.js.map, so segments after the start of each rewritten statement pointed into the newObject.definePropertytext. The edits now go throughmagic-string, and@jridgewell/remappingcombines the edit map with the tsc map. Only the text around the value changes, so the value and the;keep their segments:The emitted JavaScript is byte-identical to the output from #5306. The new devDependencies (
[email protected],[email protected],@jridgewell/[email protected]) were already in the lockfile at these versions.Validation
tsc -b scripts/tsconfig.jsonpasses with[email protected]and withtypescript@latest(7.0.2). With 7.0.2 the Fix viem imports under SES lockdown() #5306 script fails with the same errors as CI.pnpm buildhardens 119 members in_cjsand 119 in_esm, andpnpm test:env:sespasses.;resolve to their original positions (0 failures). The Fix viem imports under SES lockdown() #5306 maps fail 119 of these checks.Generated by Claude Code