package
Oxc's modular runtime helpers
npm install @oxc-project/runtimeGitHub-flavored package documentation.
Across all versions, last 30 days.
28,194,183 in 30 days
Runtime metadata.
Estimated unpacked size across 1 packages.
262.9 kB
Includes dependencies.
Vendored from the complete published @babel/runtime@8.0.8 package, including all 95 CommonJS/ESM helper pairs and Babel's MIT license. All credits to the Babel team.
upstream.json records the upstream version, SHA-256 of every upstream helper file, and the local patches. The tests check these hashes so unrecorded edits cannot silently diverge from Babel.
setFunctionName.js and esm/setFunctionName.js preserve "[]" for Symbol(""), matching native computed method names. Babel 8.0.8 returns an empty name. These files are unchanged from Oxc's existing helpers and are the only patches to the upstream helper tree.decorate, decorateParam, and decorateMetadata. They are adapted from TypeScript and are absent from Babel 8.upstream.json; they are outside the Babel 8 source snapshot.src/ layout remain Oxc-specific. Babel's export targets and sideEffects: false are synchronized while preserving Oxc's existing conditional-export precedence; explicit helpers/esm/* and older package exports remain supported.Download and extract a specific published version of @babel/runtime, then run from this directory:
node scripts/sync.mjs /path/to/extracted/babel-runtimeThe script copies every unpatched upstream helper and the license, updates exports and the hash manifest, and preserves compatibility helpers and recorded local patches. Before writing, it checks that each patched helper still matches its recorded local hash and that its upstream source is unchanged. If upstream changes a patched helper, the script stops so its local changes can be reviewed against the new version.
The manifest uses the script's generated JSON formatting and is excluded from repository formatting. Repeating the command with the recorded upstream version leaves the runtime tree unchanged. Tests reconstruct that upstream tree offline, using the vendored helpers and the original sources of the two patched helpers.
Run the import, integrity, and runtime behavior tests with:
node --run test