{"_id":"noxcturnal@0.1.2","bugs":{"url":"https://github.com/expo/noxcturnal/issues"},"dist":{"shasum":"2b9471ffde49841be51309ff848cf3c38bf55c8a","tarball":"http://registry-npm.ywwl.com/noxcturnal/download/noxcturnal-0.1.2.tgz","fileCount":7,"integrity":"sha512-TI0s/H/vHLHPwYOqmdQCG6MxxDofswe9dPkIdZEDvM52ZItwF7x1Bt62MKsmliORNIPicJa2tg9GtFXbOSHxIQ==","signatures":[{"sig":"MEUCIH7UJTwfWOXFaNw5t8Eh3fUgp5OyjM6PEFLI5JEbmHsGAiEA/CJk8cu3iXSDnUi1bkRB4IptDBNVfdNB4js+1KhKQDU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCm1GhJAqNBm/jGdM3AZbL/14XE4arP8HG8RtT7nzTvzAIhAMxMVWQtOQNLPDNjojNVSv801mWnEYFkBRmcewPzHC43"}],"unpackedSize":1129090,"size":242549,"noattachment":false,"key":"/noxcturnal/-/noxcturnal-0.1.2.tgz"},"main":"./dist/noxcturnal.js","name":"noxcturnal","napi":{"targets":["aarch64-apple-darwin","x86_64-apple-darwin","x86_64-unknown-linux-gnu","aarch64-unknown-linux-gnu","x86_64-unknown-linux-musl","aarch64-unknown-linux-musl","x86_64-pc-windows-msvc","aarch64-pc-windows-msvc"],"binaryName":"noxcturnal"},"_from":"file:noxcturnal-0.1.2.tgz","types":"./dist/noxcturnal.d.ts","module":"./dist/noxcturnal.mjs","source":"./js/index.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/noxcturnal.d.ts","import":"./dist/noxcturnal.mjs","source":"./js/index.ts","require":"./dist/noxcturnal.js"},"./package.json":"./package.json"},"license":"MIT","scripts":{"lint":"cargo clippy --all-targets -- -D warnings","test":"node scripts/native.mjs check && vitest run","build":"pnpm build:native && pnpm build:js","check":"node scripts/check.mjs","format":"oxfmt . && cargo fmt && cargo fmt --manifest-path vendor/oxc_transformer/Cargo.toml && cargo fmt --manifest-path vendor/oxc_react_compiler/Cargo.toml","codegen":"node scripts/sync-oxc-event-schema.mjs && node scripts/generate-event-schema.mjs && node scripts/generate-inline-helpers.mjs && node scripts/generate-regexp-unicode-properties.mjs","release":"node scripts/release.mjs publish","build:js":"rimraf dist && rollup -c scripts/rollup.config.mjs","benchmark":"node scripts/native.mjs check && vitest bench --run","changeset":"changeset","test:types":"vitest run --typecheck.only","test:watch":"node scripts/native.mjs check && vitest","check:types":"tsc --noEmit && pnpm test:types","build:native":"node scripts/native.mjs build","format:check":"oxfmt --check . && cargo fmt --check && cargo fmt --manifest-path vendor/oxc_transformer/Cargo.toml --check && cargo fmt --manifest-path vendor/oxc_react_compiler/Cargo.toml --check","build:release":"node scripts/native.mjs build --release && pnpm build:js","codegen:check":"node scripts/sync-oxc-event-schema.mjs --check && node scripts/generate-event-schema.mjs --check && node scripts/generate-inline-helpers.mjs --check && node scripts/generate-regexp-unicode-properties.mjs --check && pnpm codegen:estree:check","package:check":"node scripts/check-package.mjs","test:coverage":"node scripts/native.mjs check && vitest run --coverage","codegen:estree":"node scripts/generate-estree-schema.mjs","codegen:estree:check":"node scripts/generate-estree-schema.mjs --check"},"version":"0.1.2","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"ebeff57f-07ed-43c2-956f-a7723f33d1ae"}},"homepage":"https://github.com/expo/noxcturnal#readme","_resolved":"/tmp/nix-shell.g8noMm/2dc53e5201dc35b48e9aaa7372530b1f/noxcturnal-0.1.2.tgz","_integrity":"sha512-TI0s/H/vHLHPwYOqmdQCG6MxxDofswe9dPkIdZEDvM52ZItwF7x1Bt62MKsmliORNIPicJa2tg9GtFXbOSHxIQ==","repository":{"url":"git+https://github.com/expo/noxcturnal.git","type":"git"},"_npmVersion":"11.6.2","description":"Native-backed JavaScript transform runtime with visitor ergonomics","directories":{},"lint-staged":{"*":"oxfmt --no-error-on-unmatched-pattern"},"maintainers":[{"name":"philpl","email":"phil@kitten.sh"}],"_nodeVersion":"22.23.1","dependencies":{"@babel/code-frame":"^7.20.0","@oxc-project/types":"0.141.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"npm":"11.6.2","oxfmt":"^0.60.0","dotenv":"^17.2.3","rimraf":"^6.1.3","rollup":"^4.62.3","vitest":"^3.2.4","esbuild":"0.28.1","prettier":"^3.9.6","typescript":"^5.8.3","@babel/core":"^7.29.7","@types/node":"^22.15.0","lint-staged":"^17.1.1","@napi-rs/cli":"^3.4.5","regexpu-core":"6.4.0","hermes-parser":"0.36.0","@babel/helpers":"7.29.7","@babel/runtime":"7.29.7","@changesets/cli":"^2.31.1","@babel/generator":"7.29.7","babel-preset-expo":"56.0.13","rollup-plugin-dts":"^6.4.1","@types/babel__core":"7.20.5","@vitest/coverage-v8":"^3.2.7","@rollup/plugin-babel":"^7.1.0","@rollup/plugin-terser":"^1.0.0","@rollup/plugin-commonjs":"^29.0.3","@types/babel__generator":"7.27.0","rollup-plugin-cjs-check":"^1.0.3","@types/babel__code-frame":"^7.0.6","@jridgewell/trace-mapping":"^0.3.31","@changesets/get-github-info":"^0.6.0","@rollup/plugin-node-resolve":"^16.0.3","regenerate-unicode-properties":"10.2.2","@babel/plugin-transform-for-of":"7.29.7","@babel/plugin-transform-classes":"7.29.7","@babel/plugin-transform-runtime":"7.29.7","@babel/plugin-proposal-decorators":"7.29.7","@babel/plugin-transform-react-jsx":"7.29.7","babel-plugin-syntax-hermes-parser":"0.36.0","babel-plugin-transform-flow-enums":"0.0.2","@babel/plugin-transform-parameters":"7.29.7","@babel/plugin-transform-typescript":"^7.29.7","@babel/plugin-transform-dotall-regex":"7.29.7","@babel/plugin-transform-sticky-regex":"7.29.7","@babel/plugin-transform-block-scoping":"7.29.7","@babel/plugin-transform-destructuring":"7.29.7","@babel/plugin-transform-unicode-regex":"7.29.7","@babel/plugin-transform-private-methods":"7.29.7","@babel/plugin-transform-class-properties":"7.29.7","@babel/plugin-transform-flow-strip-types":"7.29.7","@babel/plugin-transform-optional-chaining":"7.29.7","@babel/plugin-transform-async-to-generator":"7.29.7","@babel/plugin-transform-class-static-block":"7.29.7","@babel/plugin-transform-object-rest-spread":"7.29.7","@babel/plugin-transform-unicode-sets-regex":"7.29.7","@babel/plugin-transform-export-namespace-from":"7.29.7","@babel/plugin-transform-react-jsx-development":"7.29.7","@babel/plugin-transform-optional-catch-binding":"7.29.7","@babel/plugin-transform-react-pure-annotations":"7.29.7","@babel/plugin-transform-unicode-property-regex":"7.29.7","@babel/plugin-transform-exponentiation-operator":"7.29.7","@babel/plugin-transform-async-generator-functions":"7.29.7","@babel/plugin-transform-private-property-in-object":"7.29.7","@babel/plugin-transform-nullish-coalescing-operator":"7.29.7","@babel/plugin-transform-explicit-resource-management":"7.29.7","@babel/plugin-transform-logical-assignment-operators":"7.29.7","@babel/plugin-transform-named-capturing-groups-regex":"7.29.7"},"optionalDependencies":{"@noxcturnal/noxcturnal-darwin-x64":"0.1.2","@noxcturnal/noxcturnal-darwin-arm64":"0.1.2","@noxcturnal/noxcturnal-linux-x64-gnu":"0.1.2","@noxcturnal/noxcturnal-linux-x64-musl":"0.1.2","@noxcturnal/noxcturnal-win32-x64-msvc":"0.1.2","@noxcturnal/noxcturnal-linux-arm64-gnu":"0.1.2","@noxcturnal/noxcturnal-linux-arm64-musl":"0.1.2","@noxcturnal/noxcturnal-win32-arm64-msvc":"0.1.2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/noxcturnal_0.1.2_1792140983702_0.6629778676811358"},"readme":"# Noxcturnal\n\nNoxcturnal is a native-backed JavaScript transformation library. It combines a typed,\nBabel-like visitor API in TypeScript with parsing, semantic analysis, traversal, edit validation,\nrendering, and source-map generation in Rust.\n\nNoxcturnal is an independent transform runtime. It is not a Metro transformer and does not collect\ndependencies, rewrite modules, or wrap output for a particular framework.\n\n> [!NOTE]\n> Noxcturnal is under active development. Its public API may change before the first stable release.\n\n## Installation\n\n```sh\npnpm add noxcturnal\n```\n\nNoxcturnal requires Node.js 18 or later. The package selects a prebuilt native binary for supported\nmacOS, Linux, and Windows targets.\n\n## Usage\n\nPlugins declare exactly which nodes and fields they need. Noxcturnal compiles those declarations\ninto native routes, sends only the requested data to JavaScript, and commits the resulting edits as\none transaction.\n\n```ts\nimport { defineNativePipeline, defineNativePlugin, defineVisitor, transform } from 'noxcturnal';\n\nconst replaceBuildId = defineNativePlugin({\n  name: 'replace-build-id',\n  contract: { metadata: { writes: ['replacedBuildId'] } },\n  visitors: [\n    defineVisitor(\n      'Identifier',\n      {\n        fields: ['name', 'global'],\n        where: { name: { equals: '__BUILD_ID__' } },\n      },\n      path => {\n        if (path.node.global) {\n          path.replaceWith(path.context.code.stringLiteral('development'));\n          path.context.metadata.set('replacedBuildId', true);\n        }\n      },\n    ),\n  ],\n});\n\nconst pipeline = defineNativePipeline({\n  phases: [{ name: 'application', plugins: [replaceBuildId] }],\n});\n\nconst result = transform('console.log(__BUILD_ID__);', 'app.js', pipeline);\n\nif (result.status === 'complete') {\n  console.log(result.code);\n}\n```\n\nEvery plugin in a phase observes the same immutable input. Its edits become visible together at the\nphase boundary, after validation and an optional reparse. Split dependent transforms into separate\nphases when a later transform must observe an earlier transform's output.\n\n`path.matchesPattern()` uses native AST facts. Declare `fields: ['memberPath']` for static or\ncomputed member expressions or `fields: ['name']` for identifiers, including in child contracts.\nMissing declarations throw. An identifier reached through a `memberPath` declaration returns false,\nas do other nodes such as a `super()` callee or a spread argument. Matching never reparses source\nin JavaScript. For fixed patterns, prefer a native\n`where: { memberPath: { equals: 'process.env.NODE_ENV' } }` predicate. Predicates share chain\nprefixes without transferring full paths for every nested member.\n\nGenerated UIDs avoid decoded AST identifier names and names already reserved in the phase. Text\ninside comments and string literals does not reserve names.\n\n### Configuration and per-file data\n\nPipeline definitions describe reusable program configuration:\n\n- `plugin.withOptions(options)` creates a definition with different declared behavior.\n- `plugin.withParameters(values)` binds values used by native predicates.\n- `pluginData` passes current-file data to state factories, hooks, and visitors.\n\n```ts\nconst result = transform(source, filename, pipeline, {\n  pluginData: { platform: 'ios' },\n});\n```\n\nDo not close over per-file data in a reusable plugin definition. Read it from `pluginData` instead.\nIf that data affects output, include it in the consumer's transform-result cache key;\n`pipelineCacheKey` intentionally covers only Noxcturnal-owned configuration.\n\n### Native transforms\n\nA phase can run declarative native transforms without a JavaScript visitor:\n\n```ts\nconst pipeline = defineNativePipeline({\n  phases: [\n    {\n      name: 'syntax',\n      native: {\n        typescript: 'strip',\n        transforms: {\n          optionalChaining: { loose: false },\n          nullishCoalescingOperator: { loose: false },\n        },\n      },\n    },\n  ],\n});\n```\n\nThe native surface includes TypeScript and Flow erasure, JSX modes, React Compiler and React\nRefresh integration, common ES syntax lowering, constant folding, and dead-code elimination.\n\n### Transform outcomes\n\n`transform` has three outcomes:\n\n- A successful transform returns a `NativeTransformResult`.\n- An intentional compatibility boundary returns a `NativeBailoutResult` with the pristine input in\n  `source`.\n- Invalid input or configuration and internal failures throw.\n\nRun a compatibility transformer only for a returned bailout. Thrown failures should propagate.\nSyntax failures use `TransformSyntaxError`; fatal native failures use `NativeTransformError` with\nthe stable code `NOXCTURNAL_TRANSFORM_ERROR`.\n\n## Development\n\nThe reproducible development environment includes Node.js, pnpm, Rust, CMake, Ninja, Python, and\nthe C++ tools needed to build the optional Hermes-backed Flow parser.\n\n```sh\nnix develop\npnpm install\npnpm build\npnpm check\npnpm benchmark\n```\n\nUse `pnpm format` to format the TypeScript and Rust sources. User-visible changes should include a\nchangeset because the main package and its native platform packages are released as one fixed\nversion group.\n\nThe test suite is organized by ownership and purpose; see [test/README.md](test/README.md) before\nadding, moving, or deleting coverage.\n\n## License\n\nMIT\n","publish_time":1792140983800,"_cnpm_publish_time":1792140983800,"dist-tags":{"canary":"0.1.0","latest":"0.1.12"}}