@tsrx/typescript-plugin 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -21,10 +21,11 @@ plugin next to the workspace `typescript` package it runs. On TypeScript 7 the
21
21
  The plugin and the TSRX language server run on TypeScript's JavaScript API of
22
22
  `typescript@^5.9.3 || ^6.0.0`. `tsrx-tsc` runs on those versions through Volar and
23
23
  on TypeScript 7 through the native compiler, so the peer dependency range is
24
- `^5.9.3 || ^6.0.0 || ^7.1.0-dev.20260923.1`. The `typescript@7` package is a
25
- launcher for the platform binary with no JavaScript API, so when `tsrx-tsc`
26
- resolves one it runs that binary itself with `--runExternalCode`, which lets
27
- TypeScript type-check `.tsrx` files through
24
+ `^5.9.3 || ^6.0.0 || ^7.1.0-dev.20260923.1`. The peer dependency is optional: npm
25
+ and pnpm do not install a `typescript` with this package, so the project's own is
26
+ used. The `typescript@7` package is a launcher for the platform binary with no
27
+ JavaScript API, so when `tsrx-tsc` resolves one it runs that binary itself with
28
+ `--runExternalCode`, which lets TypeScript type-check `.tsrx` files through
28
29
  [`@tsrx/content-mapper`](https://github.com/tsrx-org/tsrx/tree/main/packages/content-mapper)
29
30
  (an optional peer dependency of this package). That needs a TypeScript 7.1 nightly
30
31
  (`7.1.0-dev.20260923.1` or newer; the stable 7.0 releases have no content-mapper
package/dist/tsc.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- const e=require("./language-C8Cl5qyV.js");let t=require("node:fs");t=e.l(t,1);let n=require("node:url"),r=require("node:path");r=e.l(r,1);let i=require("node:module");i=e.l(i,1);let a=require("node:child_process");const o=`^5.9.3 || ^6.0.0`,s=`TypeScript 7 support for .tsrx files is not complete yet; the gaps and the upstream TypeScript issues behind them are tracked in https://github.com/tsrx-org/tsrx/issues/136. If you run into one that is not listed there, please file a new issue on the tsrx repository.`;function c(e){return Number.parseInt(e,10)}function l(e){return c(e)>=7}function u(e){let[t,n]=e.trim().split(`-`,2),r=t.split(`.`).map(e=>Number.parseInt(e,10)||0);for(;r.length<3;)r.push(0);if(n===void 0||n===``)return{core:r,channel:`release`,prerelease:[]};let i=n.split(`.`).map(e=>/^\d+$/.test(e)?Number.parseInt(e,10):e);return{core:r,channel:i[0]===`dev`?`nightly`:`prerelease`,prerelease:i}}const d={nightly:0,prerelease:1,release:2};function f(e,t){let n=u(e),r=u(t);for(let e=0;e<3;e++)if(n.core[e]!==r.core[e])return n.core[e]-r.core[e];if(n.channel!==r.channel)return d[n.channel]-d[r.channel];let i=Math.max(n.prerelease.length,r.prerelease.length);for(let e=0;e<i;e++){let t=n.prerelease[e],i=r.prerelease[e];if(t!==i)return t===void 0?-1:i===void 0?1:typeof t==`number`&&typeof i==`number`?t-i:typeof t==`number`?-1:typeof i==`number`?1:t<i?-1:1}return 0}function p(e){return l(e)&&f(e,`7.1.0-dev.20260923.1`)>=0}function m(e,t){let n=typeof e==`string`?e:e?.version;if(typeof n!=`string`||!l(n))return;let r=`resolved typescript@${n}, the native TypeScript compiler, whose npm package has no JavaScript API.`;switch(t){case`tsrx-tsc`:return p(n)?void 0:`tsrx-tsc ${r} tsrx-tsc runs TypeScript 7 through "tsc --runExternalCode" and @tsrx/content-mapper, which needs a 7.1 nightly with the content-mapper protocol (7.1.0-dev.20260923.1 or newer; install typescript@next), or TypeScript ${o} through Volar. ${s}`;case`language-server`:return`The TSRX language server's classic backend ${r} The classic backend hosts TypeScript ${o} through Volar: install one of those versions, or run the server with --typescript-backend=native beside TypeScript 7's own language server, which needs no other TypeScript. ${s}`}}const h=`--runExternalCode`,g=`@tsrx/content-mapper`;function _(){return`@typescript/typescript-${process.platform}-${process.arch}`}function v(e){let n=_(),a=(0,i.createRequire)(e),o;try{o=a.resolve(`${n}/package.json`)}catch{throw Error(`tsrx-tsc could not resolve ${n} next to ${e}. Either this platform is unsupported by TypeScript 7, or the package is missing on disk (the typescript package lists it as an optional dependency; reinstall with optional dependencies enabled).`)}let s=r.default.join(r.default.dirname(o),`lib`,process.platform===`win32`?`tsc.exe`:`tsc`);if(!t.default.existsSync(s))throw Error(`tsrx-tsc found ${n} but not its compiler at ${s}.`);return s}function y(e){return e.includes(`--runExternalCode`)?[...e]:b(e)?[...e,h]:[h,...e]}function b(e){return e[0]===`--build`||e[0]===`-b`}const x=/\.(?:[cm]?[jt]sx?|tsrx|d\.[cm]?ts)$/i,S=/* @__PURE__ */ new Set([`--version`,`-v`,`--help`,`-h`,`--init`]);function C(n,i,a=e.o){let o=[];if(n.some(e=>S.has(e)))return o;function s(e){let n=r.default.resolve(i,e),a=t.default.statSync(n,{throwIfNoEntry:!1});if(a?.isDirectory()){let e=r.default.join(n,`tsconfig.json`);t.default.existsSync(e)&&o.push(e)}else a?.isFile()&&o.push(n)}if(b(n)){for(let e of n.slice(1))!e.startsWith(`-`)&&!x.test(e)&&s(e);return o.length===0&&s(`.`),w(o,a)}for(let e=0;e<n.length;e++){let t=n[e];if(t===`-p`||t===`--project`)return n[e+1]!==void 0&&s(n[e+1]),o}return n.some(e=>!e.startsWith(`-`)&&x.test(e))||s(`.`),o}function w(n,i){let a=[],o=/* @__PURE__ */ new Set;function s(n){if(o.has(n))return;o.add(n);let{layers:c,diagnostics:l,extends_failures:u}=e.i(i,n),d=c[c.length-1],f=e.r(d.config,[`references`]);if(f.state===`found`&&Array.isArray(f.value))for(let n of f.value){let i=e.r(n,[`path`]);if(i.state!==`found`||typeof i.value!=`string`)continue;let a=r.default.resolve(d.dir,i.value),o=t.default.statSync(a,{throwIfNoEntry:!1});if(o?.isDirectory()){let e=r.default.join(a,`tsconfig.json`);t.default.existsSync(e)&&s(e)}else o?.isFile()&&s(a)}let p=t=>{let n=e.a(c,n=>e.r(n.config,[t]));return n.state===`found`&&Array.isArray(n.value)&&n.value.length===0},m=e.a(c,t=>e.r(t.config,[`include`]));(l.length!==0||u.length!==0||!p(`files`)||m.state!==`absent`&&!p(`include`))&&a.push(n)}for(let e of n)s(e);return a}function T(t,n=e.o){let{layers:r,diagnostics:i,extends_failures:a}=e.i(n,t);if(i.length>0||a.length>0)return!0;let o=e.a(r,t=>e.r(t.config,[`contentMappers`]));return o.state===`absent`?!1:!Array.isArray(o.value)||o.value.some(e=>typeof e==`object`&&!!e&&Array.isArray(e.extensions)&&e.extensions.some(e=>typeof e==`string`&&e.toLowerCase()===`.tsrx`))}function E(e){return`tsrx-tsc: ${e} declares no content mapper for .tsrx files, so TypeScript 7 would not check them. Install ${g} next to the project and add "contentMappers": [{ "package": "${g}", "extensions": [".tsrx"] }] at the top level of tsconfig.json (TypeScript 5 and 6 ignore the key, so the same file keeps working with the classic path). ${s}`}function D(e){let t=e.cwd??process.cwd(),n=e.stderr??process.stderr,r;try{r=v(e.typescript_package_json_path)}catch(e){return n.write(`${e instanceof Error?e.message:String(e)}\n`),1}for(let r of C(e.args,t,e.host))if(!T(r,e.host))return n.write(`${E(r)}\n`),1;let i=(0,a.spawnSync)(r,y(e.args),{cwd:t,env:e.env??process.env,stdio:`inherit`,windowsHide:!0});return i.error?(n.write(`tsrx-tsc could not start ${r}: ${i.error.message}\n`),1):i.status===null?(n.write(`tsrx-tsc: ${r} was terminated by signal ${i.signal}.\n`),1):i.status}const O=(0,i.createRequire)(require("url").pathToFileURL(__filename).href),k=O.resolve(`typescript/package.json`),A=O(k).version,j=m(A,`tsrx-tsc`);j&&(console.error(j),process.exit(1)),l(A)&&process.exit(D({typescript_package_json_path:k,args:process.argv.slice(2)}));const{runTsc:M}=O(`@volar/typescript/lib/quickstart/runTsc.js`),N=O.resolve(`typescript/lib/tsc.js`);process.env.TSRX_TSC=`true`;const P=(0,n.pathToFileURL)(N).href,F=i.default.registerHooks?.({load(e,n,r){if(e!==P)return r(e,n);let i=t.default.readFileSync(N,`utf8`);return F?.deregister(),{format:`commonjs`,source:i,shortCircuit:!0}}});try{M(N,{extraSupportedExtensions:[`.tsrx`],extraExtensionsToRemove:[`.tsrx`]},(t,n)=>{let r=n.options;return[e.t({ts:t,configFileName:r.configFile?.fileName??r.configFilePath,configHost:t.sys})]})}finally{F?.deregister()}
2
+ const e=require("./language-C8Cl5qyV.js");let t=require("node:fs");t=e.l(t,1);let n=require("node:url"),r=require("node:path");r=e.l(r,1);let i=require("node:module");i=e.l(i,1);let a=require("node:child_process");const o=`TypeScript 7 support for .tsrx files is not complete yet; the gaps and the upstream TypeScript issues behind them are tracked in https://github.com/tsrx-org/tsrx/issues/136. If you run into one that is not listed there, please file a new issue on the tsrx repository.`;function s(e){return Number.parseInt(e,10)}function c(e){return s(e)>=7}function l(e){let[t,n]=e.trim().split(`-`,2),r=t.split(`.`).map(e=>Number.parseInt(e,10)||0);for(;r.length<3;)r.push(0);if(n===void 0||n===``)return{core:r,channel:`release`,prerelease:[]};let i=n.split(`.`).map(e=>/^\d+$/.test(e)?Number.parseInt(e,10):e);return{core:r,channel:i[0]===`dev`?`nightly`:`prerelease`,prerelease:i}}const u={nightly:0,prerelease:1,release:2};function d(e,t){let n=l(e),r=l(t);for(let e=0;e<3;e++)if(n.core[e]!==r.core[e])return n.core[e]-r.core[e];if(n.channel!==r.channel)return u[n.channel]-u[r.channel];let i=Math.max(n.prerelease.length,r.prerelease.length);for(let e=0;e<i;e++){let t=n.prerelease[e],i=r.prerelease[e];if(t!==i)return t===void 0?-1:i===void 0?1:typeof t==`number`&&typeof i==`number`?t-i:typeof t==`number`?-1:typeof i==`number`?1:t<i?-1:1}return 0}function f(e){return c(e)&&d(e,`7.1.0-dev.20260923.1`)>=0}function p(e,t){let n=typeof e==`string`?e:e?.version;if(typeof n!=`string`||!c(n))return;let r=`resolved typescript@${n}, the native TypeScript compiler, whose npm package has no JavaScript API.`;if(t===`tsrx-tsc`)return f(n)?void 0:`tsrx-tsc ${r} tsrx-tsc runs TypeScript 7 through "tsc --runExternalCode" and @tsrx/content-mapper, which needs a 7.1 nightly with the content-mapper protocol (7.1.0-dev.20260923.1 or newer; install typescript@next), or TypeScript ^5.9.3 || ^6.0.0 through Volar. ${o}`}const m=`--runExternalCode`,h=`@tsrx/content-mapper`;function g(){return`@typescript/typescript-${process.platform}-${process.arch}`}function _(e){let n=g(),a=(0,i.createRequire)(e),o;try{o=a.resolve(`${n}/package.json`)}catch{throw Error(`tsrx-tsc could not resolve ${n} next to ${e}. Either this platform is unsupported by TypeScript 7, or the package is missing on disk (the typescript package lists it as an optional dependency; reinstall with optional dependencies enabled).`)}let s=r.default.join(r.default.dirname(o),`lib`,process.platform===`win32`?`tsc.exe`:`tsc`);if(!t.default.existsSync(s))throw Error(`tsrx-tsc found ${n} but not its compiler at ${s}.`);return s}function v(e){return e.includes(`--runExternalCode`)?[...e]:y(e)?[...e,m]:[m,...e]}function y(e){return e[0]===`--build`||e[0]===`-b`}const b=/\.(?:[cm]?[jt]sx?|tsrx|d\.[cm]?ts)$/i,x=/* @__PURE__ */ new Set([`--version`,`-v`,`--help`,`-h`,`--init`]);function S(n,i,a=e.o){let o=[];if(n.some(e=>x.has(e)))return o;function s(e){let n=r.default.resolve(i,e),a=t.default.statSync(n,{throwIfNoEntry:!1});if(a?.isDirectory()){let e=r.default.join(n,`tsconfig.json`);t.default.existsSync(e)&&o.push(e)}else a?.isFile()&&o.push(n)}if(y(n)){for(let e of n.slice(1))!e.startsWith(`-`)&&!b.test(e)&&s(e);return o.length===0&&s(`.`),C(o,a)}for(let e=0;e<n.length;e++){let t=n[e];if(t===`-p`||t===`--project`)return n[e+1]!==void 0&&s(n[e+1]),o}return n.some(e=>!e.startsWith(`-`)&&b.test(e))||s(`.`),o}function C(n,i){let a=[],o=/* @__PURE__ */ new Set;function s(n){if(o.has(n))return;o.add(n);let{layers:c,diagnostics:l,extends_failures:u}=e.i(i,n),d=c[c.length-1],f=e.r(d.config,[`references`]);if(f.state===`found`&&Array.isArray(f.value))for(let n of f.value){let i=e.r(n,[`path`]);if(i.state!==`found`||typeof i.value!=`string`)continue;let a=r.default.resolve(d.dir,i.value),o=t.default.statSync(a,{throwIfNoEntry:!1});if(o?.isDirectory()){let e=r.default.join(a,`tsconfig.json`);t.default.existsSync(e)&&s(e)}else o?.isFile()&&s(a)}let p=t=>{let n=e.a(c,n=>e.r(n.config,[t]));return n.state===`found`&&Array.isArray(n.value)&&n.value.length===0},m=e.a(c,t=>e.r(t.config,[`include`]));(l.length!==0||u.length!==0||!p(`files`)||m.state!==`absent`&&!p(`include`))&&a.push(n)}for(let e of n)s(e);return a}function w(t,n=e.o){let{layers:r,diagnostics:i,extends_failures:a}=e.i(n,t);if(i.length>0||a.length>0)return!0;let o=e.a(r,t=>e.r(t.config,[`contentMappers`]));return o.state===`absent`?!1:!Array.isArray(o.value)||o.value.some(e=>typeof e==`object`&&!!e&&Array.isArray(e.extensions)&&e.extensions.some(e=>typeof e==`string`&&e.toLowerCase()===`.tsrx`))}function T(e){return`tsrx-tsc: ${e} declares no content mapper for .tsrx files, so TypeScript 7 would not check them. Install ${h} next to the project and add "contentMappers": [{ "package": "${h}", "extensions": [".tsrx"] }] at the top level of tsconfig.json (TypeScript 5 and 6 ignore the key, so the same file keeps working with the classic path). ${o}`}function E(e){let t=e.cwd??process.cwd(),n=e.stderr??process.stderr,r;try{r=_(e.typescript_package_json_path)}catch(e){return n.write(`${e instanceof Error?e.message:String(e)}\n`),1}for(let r of S(e.args,t,e.host))if(!w(r,e.host))return n.write(`${T(r)}\n`),1;let i=(0,a.spawnSync)(r,v(e.args),{cwd:t,env:e.env??process.env,stdio:`inherit`,windowsHide:!0});return i.error?(n.write(`tsrx-tsc could not start ${r}: ${i.error.message}\n`),1):i.status===null?(n.write(`tsrx-tsc: ${r} was terminated by signal ${i.signal}.\n`),1):i.status}const D=(0,i.createRequire)(require("url").pathToFileURL(__filename).href);let O;try{O=D.resolve(`typescript/package.json`)}catch{console.error(`tsrx-tsc needs the typescript package installed next to @tsrx/typescript-plugin. In the project: npm install -D typescript, or pnpm add -D typescript.`),process.exit(1)}const k=D(O).version,A=p(k,`tsrx-tsc`);A&&(console.error(A),process.exit(1)),c(k)&&process.exit(E({typescript_package_json_path:O,args:process.argv.slice(2)}));const{runTsc:j}=D(`@volar/typescript/lib/quickstart/runTsc.js`),M=D.resolve(`typescript/lib/tsc.js`);process.env.TSRX_TSC=`true`;const N=(0,n.pathToFileURL)(M).href,P=i.default.registerHooks?.({load(e,n,r){if(e!==N)return r(e,n);let i=t.default.readFileSync(M,`utf8`);return P?.deregister(),{format:`commonjs`,source:i,shortCircuit:!0}}});try{j(M,{extraSupportedExtensions:[`.tsrx`],extraExtensionsToRemove:[`.tsrx`]},(t,n)=>{let r=n.options;return[e.t({ts:t,configFileName:r.configFile?.fileName??r.configFilePath,configHost:t.sys})]})}finally{P?.deregister()}
3
3
  //# sourceMappingURL=tsc.js.map
package/dist/tsc.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tsc.js","names":["require","createRequire","path","fs","NODE_CONFIG_HOST","load_tsconfig_layers","get_own_config_value","resolve_inherited_config_value","spawnSync","require","createRequire","pathToFileURL","fs","getTsrxLanguagePlugin"],"sources":["../src/typescript-version.js","../src/native-tsc.js","../src/tsc.js"],"sourcesContent":["/**\n * The TypeScript versions TSRX's JavaScript tooling runs on, and the messages\n * shown when a project resolves a `typescript` package it cannot use.\n *\n * TypeScript 7 (`typescript@7`) is the native compiler: its npm package only\n * launches the platform binary and exposes no JavaScript API. Everything that\n * hosts TypeScript through Volar (the tsserver plugin, the classic TSRX language\n * server, and `tsrx-tsc` on the classic path) therefore needs TypeScript 5.9 or\n * 6 installed. The native path needs no other TypeScript: `@tsrx/content-mapper`\n * and the TSRX language server's native backend read `tsconfig.json` and resolve\n * compilers themselves (`tsconfig-resolution.js`, `package-resolution.js`), and\n * TypeScript 7 type-checks `.tsrx` files through the mapper, which needs a 7.1\n * nightly: the stable 7.0 releases have no content-mapper protocol. `tsrx-tsc`\n * runs that native path itself when the installed `typescript` is such a build\n * (`native-tsc.js`), so one command serves every supported TypeScript line.\n */\n\n/** The `typescript` versions whose JavaScript API TSRX runs on. */\nexport const SUPPORTED_TYPESCRIPT_RANGE = '^5.9.3 || ^6.0.0';\n\n/**\n * The oldest TypeScript 7 build `@tsrx/content-mapper` supports (`tsc\n * --runExternalCode`, `tsc --lsp`): the first 7.1 nightly whose `tsc --watch`\n * recompiles after an edit (microsoft/TypeScript#64351). The content-mapper\n * protocol itself arrived in `7.1.0-dev.20260822.1`. The VS Code \"TypeScript 7\n * Nightly\" extension version that bundles it is `0.<date>.<n>` for the same date.\n */\nexport const MINIMUM_NATIVE_TYPESCRIPT_VERSION = '7.1.0-dev.20260923.1';\n\n/**\n * Where the gaps in TypeScript 7 support and their upstream issues are tracked:\n * the tracking issue, which outlives the pull request that added the support.\n */\nexport const TYPESCRIPT_7_TRACKING_URL = 'https://github.com/tsrx-org/tsrx/issues/136';\n\n/** One sentence to append to every message that mentions TypeScript 7. */\nexport const TYPESCRIPT_7_SUPPORT_NOTE = `TypeScript 7 support for .tsrx files is not complete yet; the gaps and the upstream TypeScript issues behind them are tracked in ${TYPESCRIPT_7_TRACKING_URL}. If you run into one that is not listed there, please file a new issue on the tsrx repository.`;\n\n/**\n * @param {string} version\n * @returns {number}\n */\nexport function typescript_major(version) {\n\treturn Number.parseInt(version, 10);\n}\n\n/**\n * Whether a `typescript` package version is the native compiler (7 and up),\n * whose package has no JavaScript API.\n * @param {string} version\n * @returns {boolean}\n */\nexport function is_native_typescript_package(version) {\n\treturn typescript_major(version) >= 7;\n}\n\n/**\n * @typedef {object} ParsedTypeScriptVersion\n * @property {number[]} core `major.minor.patch` as numbers.\n * @property {'nightly' | 'prerelease' | 'release'} channel\n * @property {Array<number | string>} prerelease The dot-separated prerelease\n * identifiers, numeric ones as numbers.\n */\n\n/**\n * @param {string} version\n * @returns {ParsedTypeScriptVersion}\n */\nfunction parse_typescript_version(version) {\n\tconst [core_part, prerelease_part] = version.trim().split('-', 2);\n\tconst core = core_part.split('.').map((part) => Number.parseInt(part, 10) || 0);\n\twhile (core.length < 3) core.push(0);\n\tif (prerelease_part === undefined || prerelease_part === '') {\n\t\treturn { core, channel: 'release', prerelease: [] };\n\t}\n\tconst prerelease = prerelease_part\n\t\t.split('.')\n\t\t.map((part) => (/^\\d+$/.test(part) ? Number.parseInt(part, 10) : part));\n\treturn { core, channel: prerelease[0] === 'dev' ? 'nightly' : 'prerelease', prerelease };\n}\n\nconst CHANNEL_ORDER = { nightly: 0, prerelease: 1, release: 2 };\n\n/**\n * Order two `typescript` package versions. Semantic versioning except in one\n * respect: TypeScript's `-dev.<yyyymmdd>.<n>` nightlies are cut before the\n * betas and release candidates of the same `major.minor.patch`, so a\n * `-beta` or `-rc` build ranks above every nightly of that version, not\n * below it as plain identifier order would say.\n * @param {string} a\n * @param {string} b\n * @returns {number} Negative when `a` is older than `b`, positive when newer, `0` when equal.\n */\nexport function compare_typescript_versions(a, b) {\n\tconst left = parse_typescript_version(a);\n\tconst right = parse_typescript_version(b);\n\tfor (let index = 0; index < 3; index++) {\n\t\tif (left.core[index] !== right.core[index]) {\n\t\t\treturn left.core[index] - right.core[index];\n\t\t}\n\t}\n\tif (left.channel !== right.channel) {\n\t\treturn CHANNEL_ORDER[left.channel] - CHANNEL_ORDER[right.channel];\n\t}\n\tconst length = Math.max(left.prerelease.length, right.prerelease.length);\n\tfor (let index = 0; index < length; index++) {\n\t\tconst left_part = left.prerelease[index];\n\t\tconst right_part = right.prerelease[index];\n\t\tif (left_part === right_part) continue;\n\t\tif (left_part === undefined) return -1;\n\t\tif (right_part === undefined) return 1;\n\t\tif (typeof left_part === 'number' && typeof right_part === 'number') {\n\t\t\treturn left_part - right_part;\n\t\t}\n\t\tif (typeof left_part === 'number') return -1;\n\t\tif (typeof right_part === 'number') return 1;\n\t\treturn left_part < right_part ? -1 : 1;\n\t}\n\treturn 0;\n}\n\n/**\n * Whether a `typescript` package version is a native TypeScript 7 build that\n * speaks the content-mapper protocol and is at least\n * {@link MINIMUM_NATIVE_TYPESCRIPT_VERSION}, so `tsc --runExternalCode` can\n * type-check `.tsrx` files through `@tsrx/content-mapper`.\n * @param {string} version\n * @returns {boolean}\n */\nexport function has_content_mapper_protocol(version) {\n\treturn (\n\t\tis_native_typescript_package(version) &&\n\t\tcompare_typescript_versions(version, MINIMUM_NATIVE_TYPESCRIPT_VERSION) >= 0\n\t);\n}\n\n/** @typedef {'tsrx-tsc' | 'language-server'} TypeScriptConsumer */\n\n/**\n * The message to show when `typescript` resolved to a package the given tool\n * cannot run on, or `undefined` when it can. `tsrx-tsc` runs on the classic\n * range through Volar and on TypeScript 7 builds with the content-mapper\n * protocol through native `tsc`; only a TypeScript 7 build older than\n * {@link MINIMUM_NATIVE_TYPESCRIPT_VERSION} (the stable 7.0 releases and the\n * earlier 7.1 nightlies) is unsupported there.\n * @param {{ version?: string } | string | undefined} typescript The `typescript` module, or its version.\n * @param {TypeScriptConsumer} tool\n * @returns {string | undefined}\n */\nexport function unsupported_typescript_message(typescript, tool) {\n\tconst version = typeof typescript === 'string' ? typescript : typescript?.version;\n\tif (typeof version !== 'string' || !is_native_typescript_package(version)) {\n\t\treturn undefined;\n\t}\n\tconst resolved = `resolved typescript@${version}, the native TypeScript compiler, whose npm package has no JavaScript API.`;\n\tswitch (tool) {\n\t\tcase 'tsrx-tsc':\n\t\t\tif (has_content_mapper_protocol(version)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn `tsrx-tsc ${resolved} tsrx-tsc runs TypeScript 7 through \"tsc --runExternalCode\" and @tsrx/content-mapper, which needs a 7.1 nightly with the content-mapper protocol (${MINIMUM_NATIVE_TYPESCRIPT_VERSION} or newer; install typescript@next), or TypeScript ${SUPPORTED_TYPESCRIPT_RANGE} through Volar. ${TYPESCRIPT_7_SUPPORT_NOTE}`;\n\t\tcase 'language-server':\n\t\t\treturn `The TSRX language server's classic backend ${resolved} The classic backend hosts TypeScript ${SUPPORTED_TYPESCRIPT_RANGE} through Volar: install one of those versions, or run the server with --typescript-backend=native beside TypeScript 7's own language server, which needs no other TypeScript. ${TYPESCRIPT_7_SUPPORT_NOTE}`;\n\t}\n}\n","/**\n * `tsrx-tsc` on TypeScript 7. The `typescript@7` package is a launcher for the\n * native compiler without a JavaScript API, so Volar cannot host it; instead\n * this module runs the platform binary itself with `--runExternalCode`, which\n * lets TypeScript start `@tsrx/content-mapper` for the `.tsrx` files the\n * project's `tsconfig.json` declares under `contentMappers`. The mapper is\n * never enabled on the command line by TypeScript itself (TS100024 without the\n * flag); `tsrx-tsc` turns it on because running it is already the decision to\n * execute the project's TSRX compiler, exactly as the classic path does\n * in-process.\n */\n\nimport { spawnSync } from 'node:child_process';\nimport fs from 'node:fs';\nimport { createRequire } from 'node:module';\nimport path from 'node:path';\nimport { NODE_CONFIG_HOST } from './config-host.js';\nimport {\n\tget_own_config_value,\n\tload_tsconfig_layers,\n\tresolve_inherited_config_value,\n} from './tsconfig-resolution.js';\nimport { TYPESCRIPT_7_SUPPORT_NOTE } from './typescript-version.js';\n\nexport const RUN_EXTERNAL_CODE_FLAG = '--runExternalCode';\nexport const CONTENT_MAPPER_PACKAGE = '@tsrx/content-mapper';\n\n/**\n * The platform package the `typescript@7` launcher resolves its binary from:\n * `@typescript/typescript-<os>-<arch>`, listed as an optional dependency of the\n * launcher so package managers install only the matching one.\n * @returns {string}\n */\nexport function native_platform_package_name() {\n\treturn `@typescript/typescript-${process.platform}-${process.arch}`;\n}\n\n/**\n * Locate the native `tsc` binary the way the launcher's `lib/getExePath.js`\n * does, resolving the platform package from the launcher's own location.\n * @param {string} typescript_package_json_path The resolved `typescript/package.json`.\n * @returns {string}\n */\nexport function resolve_native_tsc_binary(typescript_package_json_path) {\n\tconst platform_package = native_platform_package_name();\n\tconst require = createRequire(typescript_package_json_path);\n\t/** @type {string} */\n\tlet platform_package_json;\n\ttry {\n\t\tplatform_package_json = require.resolve(`${platform_package}/package.json`);\n\t} catch {\n\t\tthrow new Error(\n\t\t\t`tsrx-tsc could not resolve ${platform_package} next to ${typescript_package_json_path}. Either this platform is unsupported by TypeScript 7, or the package is missing on disk (the typescript package lists it as an optional dependency; reinstall with optional dependencies enabled).`,\n\t\t);\n\t}\n\tconst binary = path.join(\n\t\tpath.dirname(platform_package_json),\n\t\t'lib',\n\t\tprocess.platform === 'win32' ? 'tsc.exe' : 'tsc',\n\t);\n\tif (!fs.existsSync(binary)) {\n\t\tthrow new Error(`tsrx-tsc found ${platform_package} but not its compiler at ${binary}.`);\n\t}\n\treturn binary;\n}\n\n/**\n * The argument list for native `tsc`: the user's arguments with\n * `--runExternalCode` added once. `--build` must stay the first argument, so\n * the flag follows the arguments in build mode and leads otherwise.\n * @param {readonly string[]} args\n * @returns {string[]}\n */\nexport function native_tsc_arguments(args) {\n\tif (args.includes(RUN_EXTERNAL_CODE_FLAG)) {\n\t\treturn [...args];\n\t}\n\treturn is_build_mode(args)\n\t\t? [...args, RUN_EXTERNAL_CODE_FLAG]\n\t\t: [RUN_EXTERNAL_CODE_FLAG, ...args];\n}\n\n/** @param {readonly string[]} args */\nfunction is_build_mode(args) {\n\treturn args[0] === '--build' || args[0] === '-b';\n}\n\nconst SOURCE_FILE_EXTENSIONS = /\\.(?:[cm]?[jt]sx?|tsrx|d\\.[cm]?ts)$/i;\n\n/** Flags after which `tsc` prints or writes something and never reads a project. */\nconst INFORMATIONAL_FLAGS = new Set(['--version', '-v', '--help', '-h', '--init']);\n\n/**\n * The `tsconfig.json` files whose sources a `tsc` invocation compiles,\n * mirroring how the compiler picks them: `-p`/`--project` (a file, or a\n * directory holding `tsconfig.json`; TypeScript accepts no `--project=path`\n * form); otherwise `tsconfig.json` in the working directory unless source\n * files are passed, which makes `tsc` ignore every tsconfig. In build mode the\n * roots are each positional argument that is a directory or a config file, or\n * the working directory when there is none, and the result is every project\n * in their `references` graph that compiles something: a solution-style config\n * (`files: []`) only points at other projects and is left out. Paths that do\n * not exist are left out, so `tsc` reports them itself, and `--version`,\n * `--help` and `--init` read none.\n * @param {readonly string[]} args\n * @param {string} cwd\n * @param {import('./config-host.js').ConfigHost} [host]\n * @returns {string[]}\n */\nexport function project_config_paths(args, cwd, host = NODE_CONFIG_HOST) {\n\t/** @type {string[]} */\n\tconst configs = [];\n\tif (args.some((arg) => INFORMATIONAL_FLAGS.has(arg))) {\n\t\treturn configs;\n\t}\n\t/** @param {string} candidate A file or a directory. */\n\tfunction add(candidate) {\n\t\tconst resolved = path.resolve(cwd, candidate);\n\t\tconst stats = fs.statSync(resolved, { throwIfNoEntry: false });\n\t\tif (stats?.isDirectory()) {\n\t\t\tconst nested = path.join(resolved, 'tsconfig.json');\n\t\t\tif (fs.existsSync(nested)) configs.push(nested);\n\t\t} else if (stats?.isFile()) {\n\t\t\tconfigs.push(resolved);\n\t\t}\n\t}\n\tif (is_build_mode(args)) {\n\t\tfor (const arg of args.slice(1)) {\n\t\t\tif (!arg.startsWith('-') && !SOURCE_FILE_EXTENSIONS.test(arg)) add(arg);\n\t\t}\n\t\tif (configs.length === 0) add('.');\n\t\treturn build_graph_projects(configs, host);\n\t}\n\tfor (let index = 0; index < args.length; index++) {\n\t\tconst arg = args[index];\n\t\tif (arg === '-p' || arg === '--project') {\n\t\t\tif (args[index + 1] !== undefined) add(args[index + 1]);\n\t\t\treturn configs;\n\t\t}\n\t}\n\tif (args.some((arg) => !arg.startsWith('-') && SOURCE_FILE_EXTENSIONS.test(arg))) {\n\t\treturn configs;\n\t}\n\tadd('.');\n\treturn configs;\n}\n\n/**\n * Walk the `references` graph of the build roots, in build order, and return\n * the projects that compile sources. `references` is the one top-level key\n * TypeScript does not inherit through `extends`, so each config's own entry is\n * read; `files` and `include` are inherited, and a config whose resolved\n * `files` is empty with no `include` is a solution that compiles nothing\n * (TypeScript unions the two lists). Configs that cannot be read are kept for\n * `tsc` to report.\n * @param {readonly string[]} roots\n * @param {import('./config-host.js').ConfigHost} host\n * @returns {string[]}\n */\nfunction build_graph_projects(roots, host) {\n\t/** @type {string[]} */\n\tconst projects = [];\n\tconst seen = new Set();\n\t/** @param {string} config_path */\n\tfunction visit(config_path) {\n\t\tif (seen.has(config_path)) return;\n\t\tseen.add(config_path);\n\t\tconst { layers, diagnostics, extends_failures } = load_tsconfig_layers(host, config_path);\n\t\tconst own = layers[layers.length - 1];\n\t\tconst references = get_own_config_value(own.config, ['references']);\n\t\tif (references.state === 'found' && Array.isArray(references.value)) {\n\t\t\tfor (const reference of references.value) {\n\t\t\t\tconst target = get_own_config_value(reference, ['path']);\n\t\t\t\tif (target.state !== 'found' || typeof target.value !== 'string') continue;\n\t\t\t\tconst resolved = path.resolve(own.dir, target.value);\n\t\t\t\tconst stats = fs.statSync(resolved, { throwIfNoEntry: false });\n\t\t\t\tif (stats?.isDirectory()) {\n\t\t\t\t\tconst nested = path.join(resolved, 'tsconfig.json');\n\t\t\t\t\tif (fs.existsSync(nested)) visit(nested);\n\t\t\t\t} else if (stats?.isFile()) {\n\t\t\t\t\tvisit(resolved);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// TypeScript unions `files` and `include`, so a solution is a config\n\t\t// whose `files` is empty and that has no `include` to add anything.\n\t\t/** @param {'files' | 'include'} key */\n\t\tconst is_empty_list = (key) => {\n\t\t\tconst value = resolve_inherited_config_value(layers, (layer) =>\n\t\t\t\tget_own_config_value(layer.config, [key]),\n\t\t\t);\n\t\t\treturn value.state === 'found' && Array.isArray(value.value) && value.value.length === 0;\n\t\t};\n\t\tconst include = resolve_inherited_config_value(layers, (layer) =>\n\t\t\tget_own_config_value(layer.config, ['include']),\n\t\t);\n\t\tconst is_solution =\n\t\t\tdiagnostics.length === 0 &&\n\t\t\textends_failures.length === 0 &&\n\t\t\tis_empty_list('files') &&\n\t\t\t(include.state === 'absent' || is_empty_list('include'));\n\t\tif (!is_solution) projects.push(config_path);\n\t}\n\tfor (const root of roots) visit(root);\n\treturn projects;\n}\n\n/**\n * Whether a tsconfig, through its `extends` chain, declares a content mapper\n * for `.tsrx` files. Without one, native `tsc` never spawns the mapper: `.tsrx`\n * files are silently not checked and their importers report TS2307, which a\n * type-check command must not let pass. A config that does not parse, or whose\n * `extends` chain does not resolve, counts as declared so that `tsc` reports\n * the real problem instead of this guard.\n * @param {string} config_path\n * @param {import('./config-host.js').ConfigHost} [host]\n * @returns {boolean}\n */\nexport function declares_tsrx_content_mapper(config_path, host = NODE_CONFIG_HOST) {\n\tconst { layers, diagnostics, extends_failures } = load_tsconfig_layers(host, config_path);\n\tif (diagnostics.length > 0 || extends_failures.length > 0) {\n\t\treturn true;\n\t}\n\tconst mappers = resolve_inherited_config_value(layers, (layer) =>\n\t\tget_own_config_value(layer.config, ['contentMappers']),\n\t);\n\tif (mappers.state === 'absent') {\n\t\treturn false;\n\t}\n\tif (!Array.isArray(mappers.value)) {\n\t\t// Let TypeScript report the malformed entry.\n\t\treturn true;\n\t}\n\treturn mappers.value.some(\n\t\t(entry) =>\n\t\t\tentry !== null &&\n\t\t\ttypeof entry === 'object' &&\n\t\t\tArray.isArray(/** @type {{ extensions?: unknown }} */ (entry).extensions) &&\n\t\t\t/** @type {{ extensions: unknown[] }} */ (entry).extensions.some(\n\t\t\t\t(extension) => typeof extension === 'string' && extension.toLowerCase() === '.tsrx',\n\t\t\t),\n\t);\n}\n\n/**\n * @param {string} config_path\n * @returns {string}\n */\nexport function missing_content_mapper_message(config_path) {\n\treturn `tsrx-tsc: ${config_path} declares no content mapper for .tsrx files, so TypeScript 7 would not check them. Install ${CONTENT_MAPPER_PACKAGE} next to the project and add \"contentMappers\": [{ \"package\": \"${CONTENT_MAPPER_PACKAGE}\", \"extensions\": [\".tsrx\"] }] at the top level of tsconfig.json (TypeScript 5 and 6 ignore the key, so the same file keeps working with the classic path). ${TYPESCRIPT_7_SUPPORT_NOTE}`;\n}\n\n/**\n * Run native `tsc --runExternalCode` for a `tsrx-tsc` invocation and return the\n * exit code. Output streams through untouched.\n * @param {{\n * \ttypescript_package_json_path: string,\n * \targs: readonly string[],\n * \tcwd?: string,\n * \tenv?: NodeJS.ProcessEnv,\n * \thost?: import('./config-host.js').ConfigHost,\n * \tstderr?: { write: (chunk: string) => unknown },\n * }} options\n * @returns {number}\n */\nexport function run_native_tsc(options) {\n\tconst cwd = options.cwd ?? process.cwd();\n\tconst stderr = options.stderr ?? process.stderr;\n\t/** @type {string} */\n\tlet binary;\n\ttry {\n\t\tbinary = resolve_native_tsc_binary(options.typescript_package_json_path);\n\t} catch (error) {\n\t\tstderr.write(`${error instanceof Error ? error.message : String(error)}\\n`);\n\t\treturn 1;\n\t}\n\tfor (const config_path of project_config_paths(options.args, cwd, options.host)) {\n\t\tif (!declares_tsrx_content_mapper(config_path, options.host)) {\n\t\t\tstderr.write(`${missing_content_mapper_message(config_path)}\\n`);\n\t\t\treturn 1;\n\t\t}\n\t}\n\tconst result = spawnSync(binary, native_tsc_arguments(options.args), {\n\t\tcwd,\n\t\tenv: options.env ?? process.env,\n\t\tstdio: 'inherit',\n\t\twindowsHide: true,\n\t});\n\tif (result.error) {\n\t\tstderr.write(`tsrx-tsc could not start ${binary}: ${result.error.message}\\n`);\n\t\treturn 1;\n\t}\n\tif (result.status === null) {\n\t\tstderr.write(`tsrx-tsc: ${binary} was terminated by signal ${result.signal}.\\n`);\n\t\treturn 1;\n\t}\n\treturn result.status;\n}\n","#!/usr/bin/env node\n\nimport fs from 'node:fs';\nimport node_module, { createRequire } from 'node:module';\nimport { pathToFileURL } from 'node:url';\nimport { getTsrxLanguagePlugin } from './language.js';\nimport { run_native_tsc } from './native-tsc.js';\nimport {\n\tis_native_typescript_package,\n\tunsupported_typescript_message,\n} from './typescript-version.js';\n\nconst require = createRequire(import.meta.url);\nconst typescript_package_json_path = require.resolve('typescript/package.json');\nconst typescript_version = /** @type {{ version: string }} */ (\n\trequire(typescript_package_json_path)\n).version;\n\n// The TypeScript 7 package is a launcher for the native binary without\n// `lib/tsc.js` or any other JavaScript entry. A build with the content-mapper\n// protocol is run natively with `--runExternalCode`; an older one (the stable\n// 7.0 releases, earlier nightlies) is explained instead of failing on the\n// export map.\nconst unsupported_typescript = unsupported_typescript_message(typescript_version, 'tsrx-tsc');\nif (unsupported_typescript) {\n\tconsole.error(unsupported_typescript);\n\tprocess.exit(1);\n}\nif (is_native_typescript_package(typescript_version)) {\n\tprocess.exit(run_native_tsc({ typescript_package_json_path, args: process.argv.slice(2) }));\n}\n\nconst { runTsc } = /** @type {typeof import('@volar/typescript/lib/quickstart/runTsc.js')} */ (\n\trequire('@volar/typescript/lib/quickstart/runTsc.js')\n);\nconst tscPath = require.resolve('typescript/lib/tsc.js');\n\nprocess.env.TSRX_TSC = 'true';\n\n// Deno's CommonJS loader bypasses Volar's fs.readFileSync patch. Read the CLI\n// through that patch explicitly, keeping Volar responsible for transforming it.\n// Older Node versions without registerHooks retain Volar's default loader.\nconst tsc_url = pathToFileURL(tscPath).href;\nconst hook = node_module.registerHooks?.({\n\tload(url, context, nextLoad) {\n\t\tif (url !== tsc_url) {\n\t\t\treturn nextLoad(url, context);\n\t\t}\n\t\tconst source = fs.readFileSync(tscPath, 'utf8');\n\t\t// Only the CLI entry needs interception. Restore normal loading before\n\t\t// it resolves the consumer's compiler and its dependencies.\n\t\thook?.deregister();\n\t\treturn { format: 'commonjs', source, shortCircuit: true };\n\t},\n});\n\ntry {\n\trunTsc(\n\t\ttscPath,\n\t\t{\n\t\t\textraSupportedExtensions: ['.tsrx'],\n\t\t\textraExtensionsToRemove: ['.tsrx'],\n\t\t},\n\t\t(ts, create_program_options) => {\n\t\t\tconst compiler_options =\n\t\t\t\t/** @type {import('typescript').CompilerOptions & {\n\t\t\t\t * configFile?: import('typescript').TsConfigSourceFile,\n\t\t\t\t * configFilePath?: string,\n\t\t\t\t * }} */ (create_program_options.options);\n\t\t\treturn [\n\t\t\t\tgetTsrxLanguagePlugin({\n\t\t\t\t\tts,\n\t\t\t\t\tconfigFileName: compiler_options.configFile?.fileName ?? compiler_options.configFilePath,\n\t\t\t\t\tconfigHost: ts.sys,\n\t\t\t\t}),\n\t\t\t];\n\t\t},\n\t);\n} finally {\n\thook?.deregister();\n}\n"],"mappings":";sNAkBA,MAAa,EAA6B,mBAkB7B,EAA4B,8QAMzC,SAAgB,EAAiB,EAAS,CACzC,OAAO,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C,EAAAA,EAAsB,CACrB,KACA,eAAgB,EAAiB,YAAY,UAAY,EAAiB,eAC1E,WAAY,EAAG,GAChB,CAAC,CACF,CACD,CACD,CACD,QAAU,CACT,GAAM,WAAW,CAClB"}
1
+ {"version":3,"file":"tsc.js","names":["require","createRequire","path","fs","NODE_CONFIG_HOST","load_tsconfig_layers","get_own_config_value","resolve_inherited_config_value","spawnSync","require","createRequire","pathToFileURL","fs","getTsrxLanguagePlugin"],"sources":["../src/typescript-version.js","../src/native-tsc.js","../src/tsc.js"],"sourcesContent":["/**\n * The TypeScript versions TSRX's JavaScript tooling runs on, and the messages\n * shown when a project resolves a `typescript` package it cannot use.\n *\n * TypeScript 7 (`typescript@7`) is the native compiler: its npm package only\n * launches the platform binary and exposes no JavaScript API. Everything that\n * hosts TypeScript through Volar (the tsserver plugin, the classic TSRX language\n * server, and `tsrx-tsc` on the classic path) therefore needs TypeScript 5.9 or\n * 6 installed. The native path needs no other TypeScript: `@tsrx/content-mapper`\n * and the TSRX language server's native backend read `tsconfig.json` and resolve\n * compilers themselves (`tsconfig-resolution.js`, `package-resolution.js`), and\n * TypeScript 7 type-checks `.tsrx` files through the mapper, which needs a 7.1\n * nightly: the stable 7.0 releases have no content-mapper protocol. `tsrx-tsc`\n * runs that native path itself when the installed `typescript` is such a build\n * (`native-tsc.js`), so one command serves every supported TypeScript line.\n */\n\n/** The `typescript` versions whose JavaScript API TSRX runs on. */\nexport const SUPPORTED_TYPESCRIPT_RANGE = '^5.9.3 || ^6.0.0';\n\n/**\n * The oldest TypeScript 7 build `@tsrx/content-mapper` supports (`tsc\n * --runExternalCode`, `tsc --lsp`): the first 7.1 nightly whose `tsc --watch`\n * recompiles after an edit (microsoft/TypeScript#64351). The content-mapper\n * protocol itself arrived in `7.1.0-dev.20260822.1`. The VS Code \"TypeScript 7\n * Nightly\" extension version that bundles it is `0.<date>.<n>` for the same date.\n */\nexport const MINIMUM_NATIVE_TYPESCRIPT_VERSION = '7.1.0-dev.20260923.1';\n\n/**\n * Where the gaps in TypeScript 7 support and their upstream issues are tracked:\n * the tracking issue, which outlives the pull request that added the support.\n */\nexport const TYPESCRIPT_7_TRACKING_URL = 'https://github.com/tsrx-org/tsrx/issues/136';\n\n/** One sentence to append to every message that mentions TypeScript 7. */\nexport const TYPESCRIPT_7_SUPPORT_NOTE = `TypeScript 7 support for .tsrx files is not complete yet; the gaps and the upstream TypeScript issues behind them are tracked in ${TYPESCRIPT_7_TRACKING_URL}. If you run into one that is not listed there, please file a new issue on the tsrx repository.`;\n\n/**\n * @param {string} version\n * @returns {number}\n */\nexport function typescript_major(version) {\n\treturn Number.parseInt(version, 10);\n}\n\n/**\n * Whether a `typescript` package version is the native compiler (7 and up),\n * whose package has no JavaScript API.\n * @param {string} version\n * @returns {boolean}\n */\nexport function is_native_typescript_package(version) {\n\treturn typescript_major(version) >= 7;\n}\n\n/**\n * @typedef {object} ParsedTypeScriptVersion\n * @property {number[]} core `major.minor.patch` as numbers.\n * @property {'nightly' | 'prerelease' | 'release'} channel\n * @property {Array<number | string>} prerelease The dot-separated prerelease\n * identifiers, numeric ones as numbers.\n */\n\n/**\n * @param {string} version\n * @returns {ParsedTypeScriptVersion}\n */\nfunction parse_typescript_version(version) {\n\tconst [core_part, prerelease_part] = version.trim().split('-', 2);\n\tconst core = core_part.split('.').map((part) => Number.parseInt(part, 10) || 0);\n\twhile (core.length < 3) core.push(0);\n\tif (prerelease_part === undefined || prerelease_part === '') {\n\t\treturn { core, channel: 'release', prerelease: [] };\n\t}\n\tconst prerelease = prerelease_part\n\t\t.split('.')\n\t\t.map((part) => (/^\\d+$/.test(part) ? Number.parseInt(part, 10) : part));\n\treturn { core, channel: prerelease[0] === 'dev' ? 'nightly' : 'prerelease', prerelease };\n}\n\nconst CHANNEL_ORDER = { nightly: 0, prerelease: 1, release: 2 };\n\n/**\n * Order two `typescript` package versions. Semantic versioning except in one\n * respect: TypeScript's `-dev.<yyyymmdd>.<n>` nightlies are cut before the\n * betas and release candidates of the same `major.minor.patch`, so a\n * `-beta` or `-rc` build ranks above every nightly of that version, not\n * below it as plain identifier order would say.\n * @param {string} a\n * @param {string} b\n * @returns {number} Negative when `a` is older than `b`, positive when newer, `0` when equal.\n */\nexport function compare_typescript_versions(a, b) {\n\tconst left = parse_typescript_version(a);\n\tconst right = parse_typescript_version(b);\n\tfor (let index = 0; index < 3; index++) {\n\t\tif (left.core[index] !== right.core[index]) {\n\t\t\treturn left.core[index] - right.core[index];\n\t\t}\n\t}\n\tif (left.channel !== right.channel) {\n\t\treturn CHANNEL_ORDER[left.channel] - CHANNEL_ORDER[right.channel];\n\t}\n\tconst length = Math.max(left.prerelease.length, right.prerelease.length);\n\tfor (let index = 0; index < length; index++) {\n\t\tconst left_part = left.prerelease[index];\n\t\tconst right_part = right.prerelease[index];\n\t\tif (left_part === right_part) continue;\n\t\tif (left_part === undefined) return -1;\n\t\tif (right_part === undefined) return 1;\n\t\tif (typeof left_part === 'number' && typeof right_part === 'number') {\n\t\t\treturn left_part - right_part;\n\t\t}\n\t\tif (typeof left_part === 'number') return -1;\n\t\tif (typeof right_part === 'number') return 1;\n\t\treturn left_part < right_part ? -1 : 1;\n\t}\n\treturn 0;\n}\n\n/**\n * Whether a `typescript` package version is a native TypeScript 7 build that\n * speaks the content-mapper protocol and is at least\n * {@link MINIMUM_NATIVE_TYPESCRIPT_VERSION}, so `tsc --runExternalCode` can\n * type-check `.tsrx` files through `@tsrx/content-mapper`.\n * @param {string} version\n * @returns {boolean}\n */\nexport function has_content_mapper_protocol(version) {\n\treturn (\n\t\tis_native_typescript_package(version) &&\n\t\tcompare_typescript_versions(version, MINIMUM_NATIVE_TYPESCRIPT_VERSION) >= 0\n\t);\n}\n\n/** @typedef {'tsrx-tsc'} TypeScriptConsumer The language server finds its own (`find-typescript.js`). */\n\n/**\n * The message to show when `typescript` resolved to a package the given tool\n * cannot run on, or `undefined` when it can. `tsrx-tsc` runs on the classic\n * range through Volar and on TypeScript 7 builds with the content-mapper\n * protocol through native `tsc`; only a TypeScript 7 build older than\n * {@link MINIMUM_NATIVE_TYPESCRIPT_VERSION} (the stable 7.0 releases and the\n * earlier 7.1 nightlies) is unsupported there.\n * @param {{ version?: string } | string | undefined} typescript The `typescript` module, or its version.\n * @param {TypeScriptConsumer} tool\n * @returns {string | undefined}\n */\nexport function unsupported_typescript_message(typescript, tool) {\n\tconst version = typeof typescript === 'string' ? typescript : typescript?.version;\n\tif (typeof version !== 'string' || !is_native_typescript_package(version)) {\n\t\treturn undefined;\n\t}\n\tconst resolved = `resolved typescript@${version}, the native TypeScript compiler, whose npm package has no JavaScript API.`;\n\tswitch (tool) {\n\t\tcase 'tsrx-tsc':\n\t\t\tif (has_content_mapper_protocol(version)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn `tsrx-tsc ${resolved} tsrx-tsc runs TypeScript 7 through \"tsc --runExternalCode\" and @tsrx/content-mapper, which needs a 7.1 nightly with the content-mapper protocol (${MINIMUM_NATIVE_TYPESCRIPT_VERSION} or newer; install typescript@next), or TypeScript ${SUPPORTED_TYPESCRIPT_RANGE} through Volar. ${TYPESCRIPT_7_SUPPORT_NOTE}`;\n\t}\n}\n","/**\n * `tsrx-tsc` on TypeScript 7. The `typescript@7` package is a launcher for the\n * native compiler without a JavaScript API, so Volar cannot host it; instead\n * this module runs the platform binary itself with `--runExternalCode`, which\n * lets TypeScript start `@tsrx/content-mapper` for the `.tsrx` files the\n * project's `tsconfig.json` declares under `contentMappers`. The mapper is\n * never enabled on the command line by TypeScript itself (TS100024 without the\n * flag); `tsrx-tsc` turns it on because running it is already the decision to\n * execute the project's TSRX compiler, exactly as the classic path does\n * in-process.\n */\n\nimport { spawnSync } from 'node:child_process';\nimport fs from 'node:fs';\nimport { createRequire } from 'node:module';\nimport path from 'node:path';\nimport { NODE_CONFIG_HOST } from './config-host.js';\nimport {\n\tget_own_config_value,\n\tload_tsconfig_layers,\n\tresolve_inherited_config_value,\n} from './tsconfig-resolution.js';\nimport { TYPESCRIPT_7_SUPPORT_NOTE } from './typescript-version.js';\n\nexport const RUN_EXTERNAL_CODE_FLAG = '--runExternalCode';\nexport const CONTENT_MAPPER_PACKAGE = '@tsrx/content-mapper';\n\n/**\n * The platform package the `typescript@7` launcher resolves its binary from:\n * `@typescript/typescript-<os>-<arch>`, listed as an optional dependency of the\n * launcher so package managers install only the matching one.\n * @returns {string}\n */\nexport function native_platform_package_name() {\n\treturn `@typescript/typescript-${process.platform}-${process.arch}`;\n}\n\n/**\n * Locate the native `tsc` binary the way the launcher's `lib/getExePath.js`\n * does, resolving the platform package from the launcher's own location.\n * @param {string} typescript_package_json_path The resolved `typescript/package.json`.\n * @returns {string}\n */\nexport function resolve_native_tsc_binary(typescript_package_json_path) {\n\tconst platform_package = native_platform_package_name();\n\tconst require = createRequire(typescript_package_json_path);\n\t/** @type {string} */\n\tlet platform_package_json;\n\ttry {\n\t\tplatform_package_json = require.resolve(`${platform_package}/package.json`);\n\t} catch {\n\t\tthrow new Error(\n\t\t\t`tsrx-tsc could not resolve ${platform_package} next to ${typescript_package_json_path}. Either this platform is unsupported by TypeScript 7, or the package is missing on disk (the typescript package lists it as an optional dependency; reinstall with optional dependencies enabled).`,\n\t\t);\n\t}\n\tconst binary = path.join(\n\t\tpath.dirname(platform_package_json),\n\t\t'lib',\n\t\tprocess.platform === 'win32' ? 'tsc.exe' : 'tsc',\n\t);\n\tif (!fs.existsSync(binary)) {\n\t\tthrow new Error(`tsrx-tsc found ${platform_package} but not its compiler at ${binary}.`);\n\t}\n\treturn binary;\n}\n\n/**\n * The argument list for native `tsc`: the user's arguments with\n * `--runExternalCode` added once. `--build` must stay the first argument, so\n * the flag follows the arguments in build mode and leads otherwise.\n * @param {readonly string[]} args\n * @returns {string[]}\n */\nexport function native_tsc_arguments(args) {\n\tif (args.includes(RUN_EXTERNAL_CODE_FLAG)) {\n\t\treturn [...args];\n\t}\n\treturn is_build_mode(args)\n\t\t? [...args, RUN_EXTERNAL_CODE_FLAG]\n\t\t: [RUN_EXTERNAL_CODE_FLAG, ...args];\n}\n\n/** @param {readonly string[]} args */\nfunction is_build_mode(args) {\n\treturn args[0] === '--build' || args[0] === '-b';\n}\n\nconst SOURCE_FILE_EXTENSIONS = /\\.(?:[cm]?[jt]sx?|tsrx|d\\.[cm]?ts)$/i;\n\n/** Flags after which `tsc` prints or writes something and never reads a project. */\nconst INFORMATIONAL_FLAGS = new Set(['--version', '-v', '--help', '-h', '--init']);\n\n/**\n * The `tsconfig.json` files whose sources a `tsc` invocation compiles,\n * mirroring how the compiler picks them: `-p`/`--project` (a file, or a\n * directory holding `tsconfig.json`; TypeScript accepts no `--project=path`\n * form); otherwise `tsconfig.json` in the working directory unless source\n * files are passed, which makes `tsc` ignore every tsconfig. In build mode the\n * roots are each positional argument that is a directory or a config file, or\n * the working directory when there is none, and the result is every project\n * in their `references` graph that compiles something: a solution-style config\n * (`files: []`) only points at other projects and is left out. Paths that do\n * not exist are left out, so `tsc` reports them itself, and `--version`,\n * `--help` and `--init` read none.\n * @param {readonly string[]} args\n * @param {string} cwd\n * @param {import('./config-host.js').ConfigHost} [host]\n * @returns {string[]}\n */\nexport function project_config_paths(args, cwd, host = NODE_CONFIG_HOST) {\n\t/** @type {string[]} */\n\tconst configs = [];\n\tif (args.some((arg) => INFORMATIONAL_FLAGS.has(arg))) {\n\t\treturn configs;\n\t}\n\t/** @param {string} candidate A file or a directory. */\n\tfunction add(candidate) {\n\t\tconst resolved = path.resolve(cwd, candidate);\n\t\tconst stats = fs.statSync(resolved, { throwIfNoEntry: false });\n\t\tif (stats?.isDirectory()) {\n\t\t\tconst nested = path.join(resolved, 'tsconfig.json');\n\t\t\tif (fs.existsSync(nested)) configs.push(nested);\n\t\t} else if (stats?.isFile()) {\n\t\t\tconfigs.push(resolved);\n\t\t}\n\t}\n\tif (is_build_mode(args)) {\n\t\tfor (const arg of args.slice(1)) {\n\t\t\tif (!arg.startsWith('-') && !SOURCE_FILE_EXTENSIONS.test(arg)) add(arg);\n\t\t}\n\t\tif (configs.length === 0) add('.');\n\t\treturn build_graph_projects(configs, host);\n\t}\n\tfor (let index = 0; index < args.length; index++) {\n\t\tconst arg = args[index];\n\t\tif (arg === '-p' || arg === '--project') {\n\t\t\tif (args[index + 1] !== undefined) add(args[index + 1]);\n\t\t\treturn configs;\n\t\t}\n\t}\n\tif (args.some((arg) => !arg.startsWith('-') && SOURCE_FILE_EXTENSIONS.test(arg))) {\n\t\treturn configs;\n\t}\n\tadd('.');\n\treturn configs;\n}\n\n/**\n * Walk the `references` graph of the build roots, in build order, and return\n * the projects that compile sources. `references` is the one top-level key\n * TypeScript does not inherit through `extends`, so each config's own entry is\n * read; `files` and `include` are inherited, and a config whose resolved\n * `files` is empty with no `include` is a solution that compiles nothing\n * (TypeScript unions the two lists). Configs that cannot be read are kept for\n * `tsc` to report.\n * @param {readonly string[]} roots\n * @param {import('./config-host.js').ConfigHost} host\n * @returns {string[]}\n */\nfunction build_graph_projects(roots, host) {\n\t/** @type {string[]} */\n\tconst projects = [];\n\tconst seen = new Set();\n\t/** @param {string} config_path */\n\tfunction visit(config_path) {\n\t\tif (seen.has(config_path)) return;\n\t\tseen.add(config_path);\n\t\tconst { layers, diagnostics, extends_failures } = load_tsconfig_layers(host, config_path);\n\t\tconst own = layers[layers.length - 1];\n\t\tconst references = get_own_config_value(own.config, ['references']);\n\t\tif (references.state === 'found' && Array.isArray(references.value)) {\n\t\t\tfor (const reference of references.value) {\n\t\t\t\tconst target = get_own_config_value(reference, ['path']);\n\t\t\t\tif (target.state !== 'found' || typeof target.value !== 'string') continue;\n\t\t\t\tconst resolved = path.resolve(own.dir, target.value);\n\t\t\t\tconst stats = fs.statSync(resolved, { throwIfNoEntry: false });\n\t\t\t\tif (stats?.isDirectory()) {\n\t\t\t\t\tconst nested = path.join(resolved, 'tsconfig.json');\n\t\t\t\t\tif (fs.existsSync(nested)) visit(nested);\n\t\t\t\t} else if (stats?.isFile()) {\n\t\t\t\t\tvisit(resolved);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// TypeScript unions `files` and `include`, so a solution is a config\n\t\t// whose `files` is empty and that has no `include` to add anything.\n\t\t/** @param {'files' | 'include'} key */\n\t\tconst is_empty_list = (key) => {\n\t\t\tconst value = resolve_inherited_config_value(layers, (layer) =>\n\t\t\t\tget_own_config_value(layer.config, [key]),\n\t\t\t);\n\t\t\treturn value.state === 'found' && Array.isArray(value.value) && value.value.length === 0;\n\t\t};\n\t\tconst include = resolve_inherited_config_value(layers, (layer) =>\n\t\t\tget_own_config_value(layer.config, ['include']),\n\t\t);\n\t\tconst is_solution =\n\t\t\tdiagnostics.length === 0 &&\n\t\t\textends_failures.length === 0 &&\n\t\t\tis_empty_list('files') &&\n\t\t\t(include.state === 'absent' || is_empty_list('include'));\n\t\tif (!is_solution) projects.push(config_path);\n\t}\n\tfor (const root of roots) visit(root);\n\treturn projects;\n}\n\n/**\n * Whether a tsconfig, through its `extends` chain, declares a content mapper\n * for `.tsrx` files. Without one, native `tsc` never spawns the mapper: `.tsrx`\n * files are silently not checked and their importers report TS2307, which a\n * type-check command must not let pass. A config that does not parse, or whose\n * `extends` chain does not resolve, counts as declared so that `tsc` reports\n * the real problem instead of this guard.\n * @param {string} config_path\n * @param {import('./config-host.js').ConfigHost} [host]\n * @returns {boolean}\n */\nexport function declares_tsrx_content_mapper(config_path, host = NODE_CONFIG_HOST) {\n\tconst { layers, diagnostics, extends_failures } = load_tsconfig_layers(host, config_path);\n\tif (diagnostics.length > 0 || extends_failures.length > 0) {\n\t\treturn true;\n\t}\n\tconst mappers = resolve_inherited_config_value(layers, (layer) =>\n\t\tget_own_config_value(layer.config, ['contentMappers']),\n\t);\n\tif (mappers.state === 'absent') {\n\t\treturn false;\n\t}\n\tif (!Array.isArray(mappers.value)) {\n\t\t// Let TypeScript report the malformed entry.\n\t\treturn true;\n\t}\n\treturn mappers.value.some(\n\t\t(entry) =>\n\t\t\tentry !== null &&\n\t\t\ttypeof entry === 'object' &&\n\t\t\tArray.isArray(/** @type {{ extensions?: unknown }} */ (entry).extensions) &&\n\t\t\t/** @type {{ extensions: unknown[] }} */ (entry).extensions.some(\n\t\t\t\t(extension) => typeof extension === 'string' && extension.toLowerCase() === '.tsrx',\n\t\t\t),\n\t);\n}\n\n/**\n * @param {string} config_path\n * @returns {string}\n */\nexport function missing_content_mapper_message(config_path) {\n\treturn `tsrx-tsc: ${config_path} declares no content mapper for .tsrx files, so TypeScript 7 would not check them. Install ${CONTENT_MAPPER_PACKAGE} next to the project and add \"contentMappers\": [{ \"package\": \"${CONTENT_MAPPER_PACKAGE}\", \"extensions\": [\".tsrx\"] }] at the top level of tsconfig.json (TypeScript 5 and 6 ignore the key, so the same file keeps working with the classic path). ${TYPESCRIPT_7_SUPPORT_NOTE}`;\n}\n\n/**\n * Run native `tsc --runExternalCode` for a `tsrx-tsc` invocation and return the\n * exit code. Output streams through untouched.\n * @param {{\n * \ttypescript_package_json_path: string,\n * \targs: readonly string[],\n * \tcwd?: string,\n * \tenv?: NodeJS.ProcessEnv,\n * \thost?: import('./config-host.js').ConfigHost,\n * \tstderr?: { write: (chunk: string) => unknown },\n * }} options\n * @returns {number}\n */\nexport function run_native_tsc(options) {\n\tconst cwd = options.cwd ?? process.cwd();\n\tconst stderr = options.stderr ?? process.stderr;\n\t/** @type {string} */\n\tlet binary;\n\ttry {\n\t\tbinary = resolve_native_tsc_binary(options.typescript_package_json_path);\n\t} catch (error) {\n\t\tstderr.write(`${error instanceof Error ? error.message : String(error)}\\n`);\n\t\treturn 1;\n\t}\n\tfor (const config_path of project_config_paths(options.args, cwd, options.host)) {\n\t\tif (!declares_tsrx_content_mapper(config_path, options.host)) {\n\t\t\tstderr.write(`${missing_content_mapper_message(config_path)}\\n`);\n\t\t\treturn 1;\n\t\t}\n\t}\n\tconst result = spawnSync(binary, native_tsc_arguments(options.args), {\n\t\tcwd,\n\t\tenv: options.env ?? process.env,\n\t\tstdio: 'inherit',\n\t\twindowsHide: true,\n\t});\n\tif (result.error) {\n\t\tstderr.write(`tsrx-tsc could not start ${binary}: ${result.error.message}\\n`);\n\t\treturn 1;\n\t}\n\tif (result.status === null) {\n\t\tstderr.write(`tsrx-tsc: ${binary} was terminated by signal ${result.signal}.\\n`);\n\t\treturn 1;\n\t}\n\treturn result.status;\n}\n","#!/usr/bin/env node\n\nimport fs from 'node:fs';\nimport node_module, { createRequire } from 'node:module';\nimport { pathToFileURL } from 'node:url';\nimport { getTsrxLanguagePlugin } from './language.js';\nimport { run_native_tsc } from './native-tsc.js';\nimport {\n\tis_native_typescript_package,\n\tunsupported_typescript_message,\n} from './typescript-version.js';\n\nconst require = createRequire(import.meta.url);\n// `typescript` is an optional peer dependency: npm and pnpm do not install one.\n/** @type {string} */\nlet typescript_package_json_path;\ntry {\n\ttypescript_package_json_path = require.resolve('typescript/package.json');\n} catch {\n\tconsole.error(\n\t\t'tsrx-tsc needs the typescript package installed next to @tsrx/typescript-plugin. In the project: npm install -D typescript, or pnpm add -D typescript.',\n\t);\n\tprocess.exit(1);\n}\nconst typescript_version = /** @type {{ version: string }} */ (\n\trequire(typescript_package_json_path)\n).version;\n\n// The TypeScript 7 package is a launcher for the native binary without\n// `lib/tsc.js` or any other JavaScript entry. A build with the content-mapper\n// protocol is run natively with `--runExternalCode`; an older one (the stable\n// 7.0 releases, earlier nightlies) is explained instead of failing on the\n// export map.\nconst unsupported_typescript = unsupported_typescript_message(typescript_version, 'tsrx-tsc');\nif (unsupported_typescript) {\n\tconsole.error(unsupported_typescript);\n\tprocess.exit(1);\n}\nif (is_native_typescript_package(typescript_version)) {\n\tprocess.exit(run_native_tsc({ typescript_package_json_path, args: process.argv.slice(2) }));\n}\n\nconst { runTsc } = /** @type {typeof import('@volar/typescript/lib/quickstart/runTsc.js')} */ (\n\trequire('@volar/typescript/lib/quickstart/runTsc.js')\n);\nconst tscPath = require.resolve('typescript/lib/tsc.js');\n\nprocess.env.TSRX_TSC = 'true';\n\n// Deno's CommonJS loader bypasses Volar's fs.readFileSync patch. Read the CLI\n// through that patch explicitly, keeping Volar responsible for transforming it.\n// Older Node versions without registerHooks retain Volar's default loader.\nconst tsc_url = pathToFileURL(tscPath).href;\nconst hook = node_module.registerHooks?.({\n\tload(url, context, nextLoad) {\n\t\tif (url !== tsc_url) {\n\t\t\treturn nextLoad(url, context);\n\t\t}\n\t\tconst source = fs.readFileSync(tscPath, 'utf8');\n\t\t// Only the CLI entry needs interception. Restore normal loading before\n\t\t// it resolves the consumer's compiler and its dependencies.\n\t\thook?.deregister();\n\t\treturn { format: 'commonjs', source, shortCircuit: true };\n\t},\n});\n\ntry {\n\trunTsc(\n\t\ttscPath,\n\t\t{\n\t\t\textraSupportedExtensions: ['.tsrx'],\n\t\t\textraExtensionsToRemove: ['.tsrx'],\n\t\t},\n\t\t(ts, create_program_options) => {\n\t\t\tconst compiler_options =\n\t\t\t\t/** @type {import('typescript').CompilerOptions & {\n\t\t\t\t * configFile?: import('typescript').TsConfigSourceFile,\n\t\t\t\t * configFilePath?: string,\n\t\t\t\t * }} */ (create_program_options.options);\n\t\t\treturn [\n\t\t\t\tgetTsrxLanguagePlugin({\n\t\t\t\t\tts,\n\t\t\t\t\tconfigFileName: compiler_options.configFile?.fileName ?? compiler_options.configFilePath,\n\t\t\t\t\tconfigHost: ts.sys,\n\t\t\t\t}),\n\t\t\t];\n\t\t},\n\t);\n} finally {\n\thook?.deregister();\n}\n"],"mappings":";sNAkBA,MAkBa,EAA4B,8QAMzC,SAAgB,EAAiB,EAAS,CACzC,OAAO,OAAO,SAAS,EAAS,EAAE,CACnC,CAQA,SAAgB,EAA6B,EAAS,CACrD,OAAO,EAAiB,CAAO,GAAK,CACrC,CAcA,SAAS,EAAyB,EAAS,CAC1C,GAAM,CAAC,EAAW,GAAmB,EAAQ,KAAK,CAAC,CAAC,MAAM,IAAK,CAAC,EAC1D,EAAO,EAAU,MAAM,GAAG,CAAC,CAAC,IAAK,GAAS,OAAO,SAAS,EAAM,EAAE,GAAK,CAAC,EAC9E,KAAO,EAAK,OAAS,GAAG,EA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,GAAI,CACH,EAA+BD,EAAQ,QAAQ,yBAAyB,CACzE,MAAQ,CACP,QAAQ,MACP,wJACD,EACA,QAAQ,KAAK,CAAC,CACf,CACA,MAAM,EACLA,EAAQ,CAA4B,CAAC,CACpC,QAOI,EAAyB,EAA+B,EAAoB,UAAU,EACxF,IACH,QAAQ,MAAM,CAAsB,EACpC,QAAQ,KAAK,CAAC,GAEX,EAA6B,CAAkB,GAClD,QAAQ,KAAK,EAAe,CAAE,+BAA8B,KAAM,QAAQ,KAAK,MAAM,CAAC,CAAE,CAAC,CAAC,EAG3F,KAAM,CAAE,UACPA,EAAQ,4CAA4C,EAE/C,EAAUA,EAAQ,QAAQ,uBAAuB,EAEvD,QAAQ,IAAI,SAAW,OAKvB,MAAM,GAAA,EAAUE,EAAAA,cAAAA,CAAc,CAAO,CAAC,CAAC,KACjC,EAAO,EAAA,QAAY,gBAAgB,CACxC,KAAK,EAAK,EAAS,EAAU,CAC5B,GAAI,IAAQ,EACX,OAAO,EAAS,EAAK,CAAO,EAE7B,IAAM,EAASC,EAAAA,QAAG,aAAa,EAAS,MAAM,EAI9C,OADA,GAAM,WAAW,EACV,CAAE,OAAQ,WAAY,SAAQ,aAAc,EAAK,CACzD,CACD,CAAC,EAED,GAAI,CACH,EACC,EACA,CACC,yBAA0B,CAAC,OAAO,EAClC,wBAAyB,CAAC,OAAO,CAClC,GACC,EAAI,IAA2B,CAC/B,IAAM,EAIK,EAAuB,QAClC,MAAO,CACNC,EAAAA,EAAsB,CACrB,KACA,eAAgB,EAAiB,YAAY,UAAY,EAAiB,eAC1E,WAAY,EAAG,GAChB,CAAC,CACF,CACD,CACD,CACD,QAAU,CACT,GAAM,WAAW,CAClB"}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "TypeScript plugin for TSRX",
4
4
  "license": "MIT",
5
5
  "author": "Dominic Gannaway",
6
- "version": "0.6.0",
6
+ "version": "0.6.1",
7
7
  "main": "dist/index.js",
8
8
  "bin": {
9
9
  "tsrx-tsc": "./dist/tsc.js"
@@ -38,13 +38,16 @@
38
38
  "typescript": "^5.9.3 || ^6.0.0 || ^7.1.0-dev.20260923.1",
39
39
  "@tsrx/ripple": "^0.2.0",
40
40
  "octane": "*",
41
- "@tsrx/content-mapper": "0.1.2",
42
41
  "@tsrx/react": "0.4.3",
42
+ "@tsrx/content-mapper": "0.1.2",
43
43
  "@tsrx/solid": "0.3.3",
44
44
  "@tsrx/preact": "0.3.3",
45
45
  "@tsrx/vue": "0.3.3"
46
46
  },
47
47
  "peerDependenciesMeta": {
48
+ "typescript": {
49
+ "optional": true
50
+ },
48
51
  "@tsrx/content-mapper": {
49
52
  "optional": true
50
53
  },