@tsrx/typescript-plugin 0.4.4 → 0.4.6

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
@@ -56,3 +56,22 @@ nearest `package.json` to resolve ambiguity.
56
56
  The language server, tsserver plugin, and `tsrx-tsc` share the same compiler
57
57
  selection behavior. See the [TSRX documentation](https://tsrx.dev/) for target
58
58
  setup and authoring guidance.
59
+
60
+ ## Command-line type checking
61
+
62
+ Install this package, TypeScript, and your target compiler, then run
63
+ `tsrx-tsc --noEmit -p tsconfig.json` to check TypeScript and `.tsrx` files.
64
+
65
+ With Deno 2.8 or newer and the npm dependencies installed locally, add a task to
66
+ `deno.json`:
67
+
68
+ ```json
69
+ {
70
+ "tasks": {
71
+ "check": "tsrx-tsc --noEmit -p tsconfig.json"
72
+ }
73
+ }
74
+ ```
75
+
76
+ Run `deno task check`. This uses the npm-installed TypeScript version and your
77
+ `tsconfig.json`, including `tsrx.compiler`. No custom loader script is needed.
package/dist/tsc.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- const e=require(`./language-CofXAudP.js`),t=(0,require(`node:module`).createRequire)(require(`url`).pathToFileURL(__filename).href),{runTsc:n}=t(`@volar/typescript/lib/quickstart/runTsc.js`),r=t.resolve(`typescript/lib/tsc.js`);process.env.TSRX_TSC=`true`,n(r,{extraSupportedExtensions:[`.tsrx`],extraExtensionsToRemove:[`.tsrx`]},(t,n)=>{let r=n.options;return[e.t({ts:t,configFileName:r.configFile?.fileName??r.configFilePath,configHost:t.sys})]});
2
+ const e=require(`./language-CofXAudP.js`);let t=require(`node:fs`);t=e.i(t,1);let n=require(`node:module`);n=e.i(n,1);let r=require(`node:url`);const i=(0,n.createRequire)(require(`url`).pathToFileURL(__filename).href),{runTsc:a}=i(`@volar/typescript/lib/quickstart/runTsc.js`),o=i.resolve(`typescript/lib/tsc.js`);process.env.TSRX_TSC=`true`;const s=(0,r.pathToFileURL)(o).href,c=n.default.registerHooks?.({load(e,n,r){if(e!==s)return r(e,n);let i=t.default.readFileSync(o,`utf8`);return c?.deregister(),{format:`commonjs`,source:i,shortCircuit:!0}}});try{a(o,{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{c?.deregister()}
3
3
  //# sourceMappingURL=tsc.js.map
package/dist/tsc.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tsc.js","names":["require","getTsrxLanguagePlugin"],"sources":["../src/tsc.js"],"sourcesContent":["#!/usr/bin/env node\n\nimport { createRequire } from 'node:module';\nimport { getTsrxLanguagePlugin } from './language.js';\n\nconst require = createRequire(import.meta.url);\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\nrunTsc(\n\ttscPath,\n\t{\n\t\textraSupportedExtensions: ['.tsrx'],\n\t\textraExtensionsToRemove: ['.tsrx'],\n\t},\n\t(ts, create_program_options) => {\n\t\tconst compiler_options =\n\t\t\t/** @type {import('typescript').CompilerOptions & {\n\t\t\t * configFile?: import('typescript').TsConfigSourceFile,\n\t\t\t * configFilePath?: string,\n\t\t\t * }} */ (create_program_options.options);\n\t\treturn [\n\t\t\tgetTsrxLanguagePlugin({\n\t\t\t\tts,\n\t\t\t\tconfigFileName: compiler_options.configFile?.fileName ?? compiler_options.configFilePath,\n\t\t\t\tconfigHost: ts.sys,\n\t\t\t}),\n\t\t];\n\t},\n);\n"],"mappings":";0CAKMA,GAAAA,wBAAAA,CAAAA,eAAAA,QAAAA,MAAAA,CAAAA,cAAAA,WAAAA,CAAAA,KAAwC,CACxC,CAAE,UACPA,EAAQ,6CAA6C,CAEhD,EAAUA,EAAQ,QAAQ,wBAAwB,CAExD,QAAQ,IAAI,SAAW,OAEvB,EACC,EACA,CACC,yBAA0B,CAAC,QAAQ,CACnC,wBAAyB,CAAC,QAAQ,CAClC,EACA,EAAI,IAA2B,CAC/B,IAAM,EAIK,EAAuB,QAClC,MAAO,CACNC,EAAAA,EAAsB,CACrB,KACA,eAAgB,EAAiB,YAAY,UAAY,EAAiB,eAC1E,WAAY,EAAG,IACf,CAAC,CACF,EAEF"}
1
+ {"version":3,"file":"tsc.js","names":["require","fs","getTsrxLanguagePlugin"],"sources":["../src/tsc.js"],"sourcesContent":["#!/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';\n\nconst require = createRequire(import.meta.url);\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":";gJAOA,MAAMA,GAAAA,EAAAA,EAAAA,eAAAA,QAAAA,MAAAA,CAAAA,cAAAA,WAAAA,CAAAA,KAAwC,CACxC,CAAE,UACPA,EAAQ,6CAA6C,CAEhD,EAAUA,EAAQ,QAAQ,wBAAwB,CAExD,QAAQ,IAAI,SAAW,OAKvB,MAAM,GAAA,EAAA,EAAA,eAAwB,EAAQ,CAAC,KACjC,EAAO,EAAA,QAAY,gBAAgB,CACxC,KAAK,EAAK,EAAS,EAAU,CAC5B,GAAI,IAAQ,EACX,OAAO,EAAS,EAAK,EAAQ,CAE9B,IAAM,EAASC,EAAAA,QAAG,aAAa,EAAS,OAAO,CAI/C,OADA,GAAM,YAAY,CACX,CAAE,OAAQ,WAAY,SAAQ,aAAc,GAAM,EAE1D,CAAC,CAEF,GAAI,CACH,EACC,EACA,CACC,yBAA0B,CAAC,QAAQ,CACnC,wBAAyB,CAAC,QAAQ,CAClC,EACA,EAAI,IAA2B,CAC/B,IAAM,EAIK,EAAuB,QAClC,MAAO,CACNC,EAAAA,EAAsB,CACrB,KACA,eAAgB,EAAiB,YAAY,UAAY,EAAiB,eAC1E,WAAY,EAAG,IACf,CAAC,CACF,EAEF,QACQ,CACT,GAAM,YAAY"}
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.4.4",
6
+ "version": "0.4.6",
7
7
  "main": "dist/index.js",
8
8
  "bin": {
9
9
  "tsrx-tsc": "./dist/tsc.js"
@@ -29,16 +29,16 @@
29
29
  "@types/estree": "^1.0.8",
30
30
  "@types/node": "^24.3.0",
31
31
  "tsdown": "^0.22.0",
32
- "@tsrx/core": "0.2.2"
32
+ "@tsrx/core": "0.2.4"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "typescript": "^5.9.3",
36
36
  "@tsrx/ripple": "^0.2.0",
37
37
  "octane": "*",
38
- "@tsrx/react": "0.3.2",
39
- "@tsrx/solid": "0.2.2",
40
- "@tsrx/preact": "0.2.2",
41
- "@tsrx/vue": "0.2.2"
38
+ "@tsrx/react": "0.3.4",
39
+ "@tsrx/solid": "0.2.4",
40
+ "@tsrx/preact": "0.2.4",
41
+ "@tsrx/vue": "0.2.4"
42
42
  },
43
43
  "peerDependenciesMeta": {
44
44
  "@tsrx/react": {