singularity-forge/packages/native/package.json

107 lines
3.3 KiB
JSON
Raw Normal View History

{
"name": "@singularity-forge/native",
"version": "2.75.0",
2026-04-15 13:38:15 +02:00
"description": "Native Rust bindings for sf-run — high-performance native modules via N-API",
fix: align @gsd/native module type with compiled output (#3253) * fix: align @gsd/native module type with compiled output (#2861) The package declared "type": "module" and used "import"-only export conditions, but the addon loader used import.meta.url which is incompatible when the parent package enforces ESM resolution on Node.js v24. Switch to "type": "commonjs" with "default" export conditions and remove the import.meta.url/__dirname shim (CJS provides both natively). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: restore dual CJS/ESM compat for native addon loader The ESM-to-CJS conversion removed import.meta.url polyfills, but the CI test loader (dist-redirect.mjs) transpiles this file to ESM via ts.transpileModule — making __dirname and require unavailable at test time. Add runtime typeof guards that use the CJS globals when available (compiled output) and fall back to import.meta.url in ESM (test runner). Use @ts-expect-error to suppress TS1470 for the import.meta branches that are unreachable in the compiled CJS output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use indirect eval for import.meta.url to avoid CJS parse-time error import.meta is a parse-time syntax error in CJS — typeof guards don't help because Node.js rejects the syntax before executing any code. Wrapping in new Function("return import.meta.url") hides the syntax from the CJS parser while still working when executed as ESM (test runner). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: replace new Function(import.meta.url) with loader-injected CJS globals import.meta is static syntax unavailable in new Function() and eval() scopes, causing rtk-portability CI failures across all platforms. Instead of trying to access import.meta.url indirectly, the test loader (dist-redirect.mjs) now injects __dirname, __filename, and require as a preamble when transpiling workspace packages to ESM. This lets native.ts use __dirname/require directly in both CJS (production) and ESM (CI test) contexts without any import.meta.url fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:51:57 -04:00
"type": "commonjs",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsc -p tsconfig.json",
"build:native": "node ../../rust-engine/scripts/build.js",
"build:native:dev": "node ../../rust-engine/scripts/build.js --dev",
"test": "npm run build:native:dev && node --test src/__tests__/grep.test.mjs src/__tests__/ps.test.mjs src/__tests__/glob.test.mjs src/__tests__/clipboard.test.mjs src/__tests__/highlight.test.mjs src/__tests__/html.test.mjs src/__tests__/text.test.mjs src/__tests__/fd.test.mjs src/__tests__/image.test.mjs src/__tests__/edit.test.mjs src/__tests__/symbol.test.mjs src/__tests__/watch.test.mjs"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
fix: align @gsd/native module type with compiled output (#3253) * fix: align @gsd/native module type with compiled output (#2861) The package declared "type": "module" and used "import"-only export conditions, but the addon loader used import.meta.url which is incompatible when the parent package enforces ESM resolution on Node.js v24. Switch to "type": "commonjs" with "default" export conditions and remove the import.meta.url/__dirname shim (CJS provides both natively). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: restore dual CJS/ESM compat for native addon loader The ESM-to-CJS conversion removed import.meta.url polyfills, but the CI test loader (dist-redirect.mjs) transpiles this file to ESM via ts.transpileModule — making __dirname and require unavailable at test time. Add runtime typeof guards that use the CJS globals when available (compiled output) and fall back to import.meta.url in ESM (test runner). Use @ts-expect-error to suppress TS1470 for the import.meta branches that are unreachable in the compiled CJS output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use indirect eval for import.meta.url to avoid CJS parse-time error import.meta is a parse-time syntax error in CJS — typeof guards don't help because Node.js rejects the syntax before executing any code. Wrapping in new Function("return import.meta.url") hides the syntax from the CJS parser while still working when executed as ESM (test runner). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: replace new Function(import.meta.url) with loader-injected CJS globals import.meta is static syntax unavailable in new Function() and eval() scopes, causing rtk-portability CI failures across all platforms. Instead of trying to access import.meta.url indirectly, the test loader (dist-redirect.mjs) now injects __dirname, __filename, and require as a preamble when transpiling workspace packages to ESM. This lets native.ts use __dirname/require directly in both CJS (production) and ESM (CI test) contexts without any import.meta.url fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:51:57 -04:00
"default": "./dist/index.js"
},
"./grep": {
"types": "./dist/grep/index.d.ts",
fix: align @gsd/native module type with compiled output (#3253) * fix: align @gsd/native module type with compiled output (#2861) The package declared "type": "module" and used "import"-only export conditions, but the addon loader used import.meta.url which is incompatible when the parent package enforces ESM resolution on Node.js v24. Switch to "type": "commonjs" with "default" export conditions and remove the import.meta.url/__dirname shim (CJS provides both natively). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: restore dual CJS/ESM compat for native addon loader The ESM-to-CJS conversion removed import.meta.url polyfills, but the CI test loader (dist-redirect.mjs) transpiles this file to ESM via ts.transpileModule — making __dirname and require unavailable at test time. Add runtime typeof guards that use the CJS globals when available (compiled output) and fall back to import.meta.url in ESM (test runner). Use @ts-expect-error to suppress TS1470 for the import.meta branches that are unreachable in the compiled CJS output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use indirect eval for import.meta.url to avoid CJS parse-time error import.meta is a parse-time syntax error in CJS — typeof guards don't help because Node.js rejects the syntax before executing any code. Wrapping in new Function("return import.meta.url") hides the syntax from the CJS parser while still working when executed as ESM (test runner). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: replace new Function(import.meta.url) with loader-injected CJS globals import.meta is static syntax unavailable in new Function() and eval() scopes, causing rtk-portability CI failures across all platforms. Instead of trying to access import.meta.url indirectly, the test loader (dist-redirect.mjs) now injects __dirname, __filename, and require as a preamble when transpiling workspace packages to ESM. This lets native.ts use __dirname/require directly in both CJS (production) and ESM (CI test) contexts without any import.meta.url fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:51:57 -04:00
"default": "./dist/grep/index.js"
},
"./ps": {
"types": "./dist/ps/index.d.ts",
fix: align @gsd/native module type with compiled output (#3253) * fix: align @gsd/native module type with compiled output (#2861) The package declared "type": "module" and used "import"-only export conditions, but the addon loader used import.meta.url which is incompatible when the parent package enforces ESM resolution on Node.js v24. Switch to "type": "commonjs" with "default" export conditions and remove the import.meta.url/__dirname shim (CJS provides both natively). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: restore dual CJS/ESM compat for native addon loader The ESM-to-CJS conversion removed import.meta.url polyfills, but the CI test loader (dist-redirect.mjs) transpiles this file to ESM via ts.transpileModule — making __dirname and require unavailable at test time. Add runtime typeof guards that use the CJS globals when available (compiled output) and fall back to import.meta.url in ESM (test runner). Use @ts-expect-error to suppress TS1470 for the import.meta branches that are unreachable in the compiled CJS output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use indirect eval for import.meta.url to avoid CJS parse-time error import.meta is a parse-time syntax error in CJS — typeof guards don't help because Node.js rejects the syntax before executing any code. Wrapping in new Function("return import.meta.url") hides the syntax from the CJS parser while still working when executed as ESM (test runner). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: replace new Function(import.meta.url) with loader-injected CJS globals import.meta is static syntax unavailable in new Function() and eval() scopes, causing rtk-portability CI failures across all platforms. Instead of trying to access import.meta.url indirectly, the test loader (dist-redirect.mjs) now injects __dirname, __filename, and require as a preamble when transpiling workspace packages to ESM. This lets native.ts use __dirname/require directly in both CJS (production) and ESM (CI test) contexts without any import.meta.url fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:51:57 -04:00
"default": "./dist/ps/index.js"
},
"./glob": {
"types": "./dist/glob/index.d.ts",
fix: align @gsd/native module type with compiled output (#3253) * fix: align @gsd/native module type with compiled output (#2861) The package declared "type": "module" and used "import"-only export conditions, but the addon loader used import.meta.url which is incompatible when the parent package enforces ESM resolution on Node.js v24. Switch to "type": "commonjs" with "default" export conditions and remove the import.meta.url/__dirname shim (CJS provides both natively). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: restore dual CJS/ESM compat for native addon loader The ESM-to-CJS conversion removed import.meta.url polyfills, but the CI test loader (dist-redirect.mjs) transpiles this file to ESM via ts.transpileModule — making __dirname and require unavailable at test time. Add runtime typeof guards that use the CJS globals when available (compiled output) and fall back to import.meta.url in ESM (test runner). Use @ts-expect-error to suppress TS1470 for the import.meta branches that are unreachable in the compiled CJS output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use indirect eval for import.meta.url to avoid CJS parse-time error import.meta is a parse-time syntax error in CJS — typeof guards don't help because Node.js rejects the syntax before executing any code. Wrapping in new Function("return import.meta.url") hides the syntax from the CJS parser while still working when executed as ESM (test runner). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: replace new Function(import.meta.url) with loader-injected CJS globals import.meta is static syntax unavailable in new Function() and eval() scopes, causing rtk-portability CI failures across all platforms. Instead of trying to access import.meta.url indirectly, the test loader (dist-redirect.mjs) now injects __dirname, __filename, and require as a preamble when transpiling workspace packages to ESM. This lets native.ts use __dirname/require directly in both CJS (production) and ESM (CI test) contexts without any import.meta.url fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:51:57 -04:00
"default": "./dist/glob/index.js"
},
"./clipboard": {
"types": "./dist/clipboard/index.d.ts",
fix: align @gsd/native module type with compiled output (#3253) * fix: align @gsd/native module type with compiled output (#2861) The package declared "type": "module" and used "import"-only export conditions, but the addon loader used import.meta.url which is incompatible when the parent package enforces ESM resolution on Node.js v24. Switch to "type": "commonjs" with "default" export conditions and remove the import.meta.url/__dirname shim (CJS provides both natively). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: restore dual CJS/ESM compat for native addon loader The ESM-to-CJS conversion removed import.meta.url polyfills, but the CI test loader (dist-redirect.mjs) transpiles this file to ESM via ts.transpileModule — making __dirname and require unavailable at test time. Add runtime typeof guards that use the CJS globals when available (compiled output) and fall back to import.meta.url in ESM (test runner). Use @ts-expect-error to suppress TS1470 for the import.meta branches that are unreachable in the compiled CJS output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use indirect eval for import.meta.url to avoid CJS parse-time error import.meta is a parse-time syntax error in CJS — typeof guards don't help because Node.js rejects the syntax before executing any code. Wrapping in new Function("return import.meta.url") hides the syntax from the CJS parser while still working when executed as ESM (test runner). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: replace new Function(import.meta.url) with loader-injected CJS globals import.meta is static syntax unavailable in new Function() and eval() scopes, causing rtk-portability CI failures across all platforms. Instead of trying to access import.meta.url indirectly, the test loader (dist-redirect.mjs) now injects __dirname, __filename, and require as a preamble when transpiling workspace packages to ESM. This lets native.ts use __dirname/require directly in both CJS (production) and ESM (CI test) contexts without any import.meta.url fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:51:57 -04:00
"default": "./dist/clipboard/index.js"
},
"./ast": {
"types": "./dist/ast/index.d.ts",
fix: align @gsd/native module type with compiled output (#3253) * fix: align @gsd/native module type with compiled output (#2861) The package declared "type": "module" and used "import"-only export conditions, but the addon loader used import.meta.url which is incompatible when the parent package enforces ESM resolution on Node.js v24. Switch to "type": "commonjs" with "default" export conditions and remove the import.meta.url/__dirname shim (CJS provides both natively). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: restore dual CJS/ESM compat for native addon loader The ESM-to-CJS conversion removed import.meta.url polyfills, but the CI test loader (dist-redirect.mjs) transpiles this file to ESM via ts.transpileModule — making __dirname and require unavailable at test time. Add runtime typeof guards that use the CJS globals when available (compiled output) and fall back to import.meta.url in ESM (test runner). Use @ts-expect-error to suppress TS1470 for the import.meta branches that are unreachable in the compiled CJS output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use indirect eval for import.meta.url to avoid CJS parse-time error import.meta is a parse-time syntax error in CJS — typeof guards don't help because Node.js rejects the syntax before executing any code. Wrapping in new Function("return import.meta.url") hides the syntax from the CJS parser while still working when executed as ESM (test runner). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: replace new Function(import.meta.url) with loader-injected CJS globals import.meta is static syntax unavailable in new Function() and eval() scopes, causing rtk-portability CI failures across all platforms. Instead of trying to access import.meta.url indirectly, the test loader (dist-redirect.mjs) now injects __dirname, __filename, and require as a preamble when transpiling workspace packages to ESM. This lets native.ts use __dirname/require directly in both CJS (production) and ESM (CI test) contexts without any import.meta.url fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:51:57 -04:00
"default": "./dist/ast/index.js"
},
"./html": {
"types": "./dist/html/index.d.ts",
fix: align @gsd/native module type with compiled output (#3253) * fix: align @gsd/native module type with compiled output (#2861) The package declared "type": "module" and used "import"-only export conditions, but the addon loader used import.meta.url which is incompatible when the parent package enforces ESM resolution on Node.js v24. Switch to "type": "commonjs" with "default" export conditions and remove the import.meta.url/__dirname shim (CJS provides both natively). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: restore dual CJS/ESM compat for native addon loader The ESM-to-CJS conversion removed import.meta.url polyfills, but the CI test loader (dist-redirect.mjs) transpiles this file to ESM via ts.transpileModule — making __dirname and require unavailable at test time. Add runtime typeof guards that use the CJS globals when available (compiled output) and fall back to import.meta.url in ESM (test runner). Use @ts-expect-error to suppress TS1470 for the import.meta branches that are unreachable in the compiled CJS output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use indirect eval for import.meta.url to avoid CJS parse-time error import.meta is a parse-time syntax error in CJS — typeof guards don't help because Node.js rejects the syntax before executing any code. Wrapping in new Function("return import.meta.url") hides the syntax from the CJS parser while still working when executed as ESM (test runner). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: replace new Function(import.meta.url) with loader-injected CJS globals import.meta is static syntax unavailable in new Function() and eval() scopes, causing rtk-portability CI failures across all platforms. Instead of trying to access import.meta.url indirectly, the test loader (dist-redirect.mjs) now injects __dirname, __filename, and require as a preamble when transpiling workspace packages to ESM. This lets native.ts use __dirname/require directly in both CJS (production) and ESM (CI test) contexts without any import.meta.url fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:51:57 -04:00
"default": "./dist/html/index.js"
},
"./text": {
"types": "./dist/text/index.d.ts",
fix: align @gsd/native module type with compiled output (#3253) * fix: align @gsd/native module type with compiled output (#2861) The package declared "type": "module" and used "import"-only export conditions, but the addon loader used import.meta.url which is incompatible when the parent package enforces ESM resolution on Node.js v24. Switch to "type": "commonjs" with "default" export conditions and remove the import.meta.url/__dirname shim (CJS provides both natively). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: restore dual CJS/ESM compat for native addon loader The ESM-to-CJS conversion removed import.meta.url polyfills, but the CI test loader (dist-redirect.mjs) transpiles this file to ESM via ts.transpileModule — making __dirname and require unavailable at test time. Add runtime typeof guards that use the CJS globals when available (compiled output) and fall back to import.meta.url in ESM (test runner). Use @ts-expect-error to suppress TS1470 for the import.meta branches that are unreachable in the compiled CJS output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use indirect eval for import.meta.url to avoid CJS parse-time error import.meta is a parse-time syntax error in CJS — typeof guards don't help because Node.js rejects the syntax before executing any code. Wrapping in new Function("return import.meta.url") hides the syntax from the CJS parser while still working when executed as ESM (test runner). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: replace new Function(import.meta.url) with loader-injected CJS globals import.meta is static syntax unavailable in new Function() and eval() scopes, causing rtk-portability CI failures across all platforms. Instead of trying to access import.meta.url indirectly, the test loader (dist-redirect.mjs) now injects __dirname, __filename, and require as a preamble when transpiling workspace packages to ESM. This lets native.ts use __dirname/require directly in both CJS (production) and ESM (CI test) contexts without any import.meta.url fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:51:57 -04:00
"default": "./dist/text/index.js"
},
"./fd": {
"types": "./dist/fd/index.d.ts",
fix: align @gsd/native module type with compiled output (#3253) * fix: align @gsd/native module type with compiled output (#2861) The package declared "type": "module" and used "import"-only export conditions, but the addon loader used import.meta.url which is incompatible when the parent package enforces ESM resolution on Node.js v24. Switch to "type": "commonjs" with "default" export conditions and remove the import.meta.url/__dirname shim (CJS provides both natively). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: restore dual CJS/ESM compat for native addon loader The ESM-to-CJS conversion removed import.meta.url polyfills, but the CI test loader (dist-redirect.mjs) transpiles this file to ESM via ts.transpileModule — making __dirname and require unavailable at test time. Add runtime typeof guards that use the CJS globals when available (compiled output) and fall back to import.meta.url in ESM (test runner). Use @ts-expect-error to suppress TS1470 for the import.meta branches that are unreachable in the compiled CJS output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use indirect eval for import.meta.url to avoid CJS parse-time error import.meta is a parse-time syntax error in CJS — typeof guards don't help because Node.js rejects the syntax before executing any code. Wrapping in new Function("return import.meta.url") hides the syntax from the CJS parser while still working when executed as ESM (test runner). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: replace new Function(import.meta.url) with loader-injected CJS globals import.meta is static syntax unavailable in new Function() and eval() scopes, causing rtk-portability CI failures across all platforms. Instead of trying to access import.meta.url indirectly, the test loader (dist-redirect.mjs) now injects __dirname, __filename, and require as a preamble when transpiling workspace packages to ESM. This lets native.ts use __dirname/require directly in both CJS (production) and ESM (CI test) contexts without any import.meta.url fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:51:57 -04:00
"default": "./dist/fd/index.js"
},
"./image": {
"types": "./dist/image/index.d.ts",
fix: align @gsd/native module type with compiled output (#3253) * fix: align @gsd/native module type with compiled output (#2861) The package declared "type": "module" and used "import"-only export conditions, but the addon loader used import.meta.url which is incompatible when the parent package enforces ESM resolution on Node.js v24. Switch to "type": "commonjs" with "default" export conditions and remove the import.meta.url/__dirname shim (CJS provides both natively). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: restore dual CJS/ESM compat for native addon loader The ESM-to-CJS conversion removed import.meta.url polyfills, but the CI test loader (dist-redirect.mjs) transpiles this file to ESM via ts.transpileModule — making __dirname and require unavailable at test time. Add runtime typeof guards that use the CJS globals when available (compiled output) and fall back to import.meta.url in ESM (test runner). Use @ts-expect-error to suppress TS1470 for the import.meta branches that are unreachable in the compiled CJS output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use indirect eval for import.meta.url to avoid CJS parse-time error import.meta is a parse-time syntax error in CJS — typeof guards don't help because Node.js rejects the syntax before executing any code. Wrapping in new Function("return import.meta.url") hides the syntax from the CJS parser while still working when executed as ESM (test runner). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: replace new Function(import.meta.url) with loader-injected CJS globals import.meta is static syntax unavailable in new Function() and eval() scopes, causing rtk-portability CI failures across all platforms. Instead of trying to access import.meta.url indirectly, the test loader (dist-redirect.mjs) now injects __dirname, __filename, and require as a preamble when transpiling workspace packages to ESM. This lets native.ts use __dirname/require directly in both CJS (production) and ESM (CI test) contexts without any import.meta.url fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:51:57 -04:00
"default": "./dist/image/index.js"
},
"./xxhash": {
"types": "./dist/xxhash/index.d.ts",
fix: align @gsd/native module type with compiled output (#3253) * fix: align @gsd/native module type with compiled output (#2861) The package declared "type": "module" and used "import"-only export conditions, but the addon loader used import.meta.url which is incompatible when the parent package enforces ESM resolution on Node.js v24. Switch to "type": "commonjs" with "default" export conditions and remove the import.meta.url/__dirname shim (CJS provides both natively). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: restore dual CJS/ESM compat for native addon loader The ESM-to-CJS conversion removed import.meta.url polyfills, but the CI test loader (dist-redirect.mjs) transpiles this file to ESM via ts.transpileModule — making __dirname and require unavailable at test time. Add runtime typeof guards that use the CJS globals when available (compiled output) and fall back to import.meta.url in ESM (test runner). Use @ts-expect-error to suppress TS1470 for the import.meta branches that are unreachable in the compiled CJS output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use indirect eval for import.meta.url to avoid CJS parse-time error import.meta is a parse-time syntax error in CJS — typeof guards don't help because Node.js rejects the syntax before executing any code. Wrapping in new Function("return import.meta.url") hides the syntax from the CJS parser while still working when executed as ESM (test runner). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: replace new Function(import.meta.url) with loader-injected CJS globals import.meta is static syntax unavailable in new Function() and eval() scopes, causing rtk-portability CI failures across all platforms. Instead of trying to access import.meta.url indirectly, the test loader (dist-redirect.mjs) now injects __dirname, __filename, and require as a preamble when transpiling workspace packages to ESM. This lets native.ts use __dirname/require directly in both CJS (production) and ESM (CI test) contexts without any import.meta.url fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:51:57 -04:00
"default": "./dist/xxhash/index.js"
},
"./diff": {
"types": "./dist/diff/index.d.ts",
fix: align @gsd/native module type with compiled output (#3253) * fix: align @gsd/native module type with compiled output (#2861) The package declared "type": "module" and used "import"-only export conditions, but the addon loader used import.meta.url which is incompatible when the parent package enforces ESM resolution on Node.js v24. Switch to "type": "commonjs" with "default" export conditions and remove the import.meta.url/__dirname shim (CJS provides both natively). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: restore dual CJS/ESM compat for native addon loader The ESM-to-CJS conversion removed import.meta.url polyfills, but the CI test loader (dist-redirect.mjs) transpiles this file to ESM via ts.transpileModule — making __dirname and require unavailable at test time. Add runtime typeof guards that use the CJS globals when available (compiled output) and fall back to import.meta.url in ESM (test runner). Use @ts-expect-error to suppress TS1470 for the import.meta branches that are unreachable in the compiled CJS output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use indirect eval for import.meta.url to avoid CJS parse-time error import.meta is a parse-time syntax error in CJS — typeof guards don't help because Node.js rejects the syntax before executing any code. Wrapping in new Function("return import.meta.url") hides the syntax from the CJS parser while still working when executed as ESM (test runner). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: replace new Function(import.meta.url) with loader-injected CJS globals import.meta is static syntax unavailable in new Function() and eval() scopes, causing rtk-portability CI failures across all platforms. Instead of trying to access import.meta.url indirectly, the test loader (dist-redirect.mjs) now injects __dirname, __filename, and require as a preamble when transpiling workspace packages to ESM. This lets native.ts use __dirname/require directly in both CJS (production) and ESM (CI test) contexts without any import.meta.url fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:51:57 -04:00
"default": "./dist/diff/index.js"
},
"./edit": {
"types": "./dist/edit/index.d.ts",
"default": "./dist/edit/index.js"
},
"./forge-parser": {
"types": "./dist/forge-parser/index.d.ts",
"default": "./dist/forge-parser/index.js"
},
"./highlight": {
"types": "./dist/highlight/index.d.ts",
fix: align @gsd/native module type with compiled output (#3253) * fix: align @gsd/native module type with compiled output (#2861) The package declared "type": "module" and used "import"-only export conditions, but the addon loader used import.meta.url which is incompatible when the parent package enforces ESM resolution on Node.js v24. Switch to "type": "commonjs" with "default" export conditions and remove the import.meta.url/__dirname shim (CJS provides both natively). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: restore dual CJS/ESM compat for native addon loader The ESM-to-CJS conversion removed import.meta.url polyfills, but the CI test loader (dist-redirect.mjs) transpiles this file to ESM via ts.transpileModule — making __dirname and require unavailable at test time. Add runtime typeof guards that use the CJS globals when available (compiled output) and fall back to import.meta.url in ESM (test runner). Use @ts-expect-error to suppress TS1470 for the import.meta branches that are unreachable in the compiled CJS output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use indirect eval for import.meta.url to avoid CJS parse-time error import.meta is a parse-time syntax error in CJS — typeof guards don't help because Node.js rejects the syntax before executing any code. Wrapping in new Function("return import.meta.url") hides the syntax from the CJS parser while still working when executed as ESM (test runner). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: replace new Function(import.meta.url) with loader-injected CJS globals import.meta is static syntax unavailable in new Function() and eval() scopes, causing rtk-portability CI failures across all platforms. Instead of trying to access import.meta.url indirectly, the test loader (dist-redirect.mjs) now injects __dirname, __filename, and require as a preamble when transpiling workspace packages to ESM. This lets native.ts use __dirname/require directly in both CJS (production) and ESM (CI test) contexts without any import.meta.url fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:51:57 -04:00
"default": "./dist/highlight/index.js"
},
"./json-parse": {
"types": "./dist/json-parse/index.d.ts",
fix: align @gsd/native module type with compiled output (#3253) * fix: align @gsd/native module type with compiled output (#2861) The package declared "type": "module" and used "import"-only export conditions, but the addon loader used import.meta.url which is incompatible when the parent package enforces ESM resolution on Node.js v24. Switch to "type": "commonjs" with "default" export conditions and remove the import.meta.url/__dirname shim (CJS provides both natively). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: restore dual CJS/ESM compat for native addon loader The ESM-to-CJS conversion removed import.meta.url polyfills, but the CI test loader (dist-redirect.mjs) transpiles this file to ESM via ts.transpileModule — making __dirname and require unavailable at test time. Add runtime typeof guards that use the CJS globals when available (compiled output) and fall back to import.meta.url in ESM (test runner). Use @ts-expect-error to suppress TS1470 for the import.meta branches that are unreachable in the compiled CJS output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use indirect eval for import.meta.url to avoid CJS parse-time error import.meta is a parse-time syntax error in CJS — typeof guards don't help because Node.js rejects the syntax before executing any code. Wrapping in new Function("return import.meta.url") hides the syntax from the CJS parser while still working when executed as ESM (test runner). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: replace new Function(import.meta.url) with loader-injected CJS globals import.meta is static syntax unavailable in new Function() and eval() scopes, causing rtk-portability CI failures across all platforms. Instead of trying to access import.meta.url indirectly, the test loader (dist-redirect.mjs) now injects __dirname, __filename, and require as a preamble when transpiling workspace packages to ESM. This lets native.ts use __dirname/require directly in both CJS (production) and ESM (CI test) contexts without any import.meta.url fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:51:57 -04:00
"default": "./dist/json-parse/index.js"
},
"./stream-process": {
"types": "./dist/stream-process/index.d.ts",
fix: align @gsd/native module type with compiled output (#3253) * fix: align @gsd/native module type with compiled output (#2861) The package declared "type": "module" and used "import"-only export conditions, but the addon loader used import.meta.url which is incompatible when the parent package enforces ESM resolution on Node.js v24. Switch to "type": "commonjs" with "default" export conditions and remove the import.meta.url/__dirname shim (CJS provides both natively). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: restore dual CJS/ESM compat for native addon loader The ESM-to-CJS conversion removed import.meta.url polyfills, but the CI test loader (dist-redirect.mjs) transpiles this file to ESM via ts.transpileModule — making __dirname and require unavailable at test time. Add runtime typeof guards that use the CJS globals when available (compiled output) and fall back to import.meta.url in ESM (test runner). Use @ts-expect-error to suppress TS1470 for the import.meta branches that are unreachable in the compiled CJS output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use indirect eval for import.meta.url to avoid CJS parse-time error import.meta is a parse-time syntax error in CJS — typeof guards don't help because Node.js rejects the syntax before executing any code. Wrapping in new Function("return import.meta.url") hides the syntax from the CJS parser while still working when executed as ESM (test runner). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: replace new Function(import.meta.url) with loader-injected CJS globals import.meta is static syntax unavailable in new Function() and eval() scopes, causing rtk-portability CI failures across all platforms. Instead of trying to access import.meta.url indirectly, the test loader (dist-redirect.mjs) now injects __dirname, __filename, and require as a preamble when transpiling workspace packages to ESM. This lets native.ts use __dirname/require directly in both CJS (production) and ESM (CI test) contexts without any import.meta.url fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:51:57 -04:00
"default": "./dist/stream-process/index.js"
},
"./truncate": {
"types": "./dist/truncate/index.d.ts",
fix: align @gsd/native module type with compiled output (#3253) * fix: align @gsd/native module type with compiled output (#2861) The package declared "type": "module" and used "import"-only export conditions, but the addon loader used import.meta.url which is incompatible when the parent package enforces ESM resolution on Node.js v24. Switch to "type": "commonjs" with "default" export conditions and remove the import.meta.url/__dirname shim (CJS provides both natively). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: restore dual CJS/ESM compat for native addon loader The ESM-to-CJS conversion removed import.meta.url polyfills, but the CI test loader (dist-redirect.mjs) transpiles this file to ESM via ts.transpileModule — making __dirname and require unavailable at test time. Add runtime typeof guards that use the CJS globals when available (compiled output) and fall back to import.meta.url in ESM (test runner). Use @ts-expect-error to suppress TS1470 for the import.meta branches that are unreachable in the compiled CJS output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use indirect eval for import.meta.url to avoid CJS parse-time error import.meta is a parse-time syntax error in CJS — typeof guards don't help because Node.js rejects the syntax before executing any code. Wrapping in new Function("return import.meta.url") hides the syntax from the CJS parser while still working when executed as ESM (test runner). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: replace new Function(import.meta.url) with loader-injected CJS globals import.meta is static syntax unavailable in new Function() and eval() scopes, causing rtk-portability CI failures across all platforms. Instead of trying to access import.meta.url indirectly, the test loader (dist-redirect.mjs) now injects __dirname, __filename, and require as a preamble when transpiling workspace packages to ESM. This lets native.ts use __dirname/require directly in both CJS (production) and ESM (CI test) contexts without any import.meta.url fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:51:57 -04:00
"default": "./dist/truncate/index.js"
},
"./ttsr": {
"types": "./dist/ttsr/index.d.ts",
fix: align @gsd/native module type with compiled output (#3253) * fix: align @gsd/native module type with compiled output (#2861) The package declared "type": "module" and used "import"-only export conditions, but the addon loader used import.meta.url which is incompatible when the parent package enforces ESM resolution on Node.js v24. Switch to "type": "commonjs" with "default" export conditions and remove the import.meta.url/__dirname shim (CJS provides both natively). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: restore dual CJS/ESM compat for native addon loader The ESM-to-CJS conversion removed import.meta.url polyfills, but the CI test loader (dist-redirect.mjs) transpiles this file to ESM via ts.transpileModule — making __dirname and require unavailable at test time. Add runtime typeof guards that use the CJS globals when available (compiled output) and fall back to import.meta.url in ESM (test runner). Use @ts-expect-error to suppress TS1470 for the import.meta branches that are unreachable in the compiled CJS output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use indirect eval for import.meta.url to avoid CJS parse-time error import.meta is a parse-time syntax error in CJS — typeof guards don't help because Node.js rejects the syntax before executing any code. Wrapping in new Function("return import.meta.url") hides the syntax from the CJS parser while still working when executed as ESM (test runner). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: replace new Function(import.meta.url) with loader-injected CJS globals import.meta is static syntax unavailable in new Function() and eval() scopes, causing rtk-portability CI failures across all platforms. Instead of trying to access import.meta.url indirectly, the test loader (dist-redirect.mjs) now injects __dirname, __filename, and require as a preamble when transpiling workspace packages to ESM. This lets native.ts use __dirname/require directly in both CJS (production) and ESM (CI test) contexts without any import.meta.url fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:51:57 -04:00
"default": "./dist/ttsr/index.js"
}
},
"files": [
"dist"
],
"engines": {
"node": ">=24.15.0"
},
"optionalDependencies": {
"@singularity-forge/engine-darwin-arm64": ">=2.75.0",
"@singularity-forge/engine-darwin-x64": ">=2.75.0",
"@singularity-forge/engine-linux-x64-gnu": ">=2.75.0",
"@singularity-forge/engine-linux-arm64-gnu": ">=2.75.0",
"@singularity-forge/engine-win32-x64-msvc": ">=2.75.0"
},
"license": "MIT"
}