@di-framework/tsc 5.0.0 → 5.2.0
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 +0 -1
- package/package.json +1 -5
- package/bin/dtsc.cjs +0 -43
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@di-framework/tsc",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "ttsc transform that injects runtime parameter checks from TypeScript types (assertAll)",
|
|
5
5
|
"author": "@di-framework Contributors",
|
|
6
6
|
"license": "(MIT OR Apache-2.0)",
|
|
@@ -10,16 +10,12 @@
|
|
|
10
10
|
"exports": {
|
|
11
11
|
".": "./plugin.cjs"
|
|
12
12
|
},
|
|
13
|
-
"bin": {
|
|
14
|
-
"dtsc": "bin/dtsc.cjs"
|
|
15
|
-
},
|
|
16
13
|
"ttsc": {
|
|
17
14
|
"plugin": {
|
|
18
15
|
"transform": "@di-framework/tsc"
|
|
19
16
|
}
|
|
20
17
|
},
|
|
21
18
|
"files": [
|
|
22
|
-
"bin",
|
|
23
19
|
"plugin.cjs",
|
|
24
20
|
"plugin",
|
|
25
21
|
"README.md",
|
package/bin/dtsc.cjs
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
const { spawnSync } = require('node:child_process');
|
|
5
|
-
const fs = require('node:fs');
|
|
6
|
-
const path = require('node:path');
|
|
7
|
-
|
|
8
|
-
function findTtscJs(startDir) {
|
|
9
|
-
let dir = path.resolve(startDir);
|
|
10
|
-
for (;;) {
|
|
11
|
-
const candidate = path.join(dir, 'node_modules', 'ttsc', 'lib', 'launcher', 'ttsc.js');
|
|
12
|
-
if (fs.existsSync(candidate)) return candidate;
|
|
13
|
-
const parent = path.dirname(dir);
|
|
14
|
-
if (parent === dir) return null;
|
|
15
|
-
dir = parent;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const args = process.argv.slice(2);
|
|
20
|
-
const ttscJs = findTtscJs(process.cwd());
|
|
21
|
-
|
|
22
|
-
let result;
|
|
23
|
-
if (ttscJs) {
|
|
24
|
-
result = spawnSync(process.execPath, [ttscJs, ...args], {
|
|
25
|
-
stdio: 'inherit',
|
|
26
|
-
env: process.env,
|
|
27
|
-
});
|
|
28
|
-
} else {
|
|
29
|
-
result = spawnSync('ttsc', args, {
|
|
30
|
-
stdio: 'inherit',
|
|
31
|
-
env: process.env,
|
|
32
|
-
shell: process.platform === 'win32',
|
|
33
|
-
});
|
|
34
|
-
if (result.error && result.error.code === 'ENOENT') {
|
|
35
|
-
console.error(
|
|
36
|
-
'dtsc: could not find ttsc. Install it in this project (`npm i -D ttsc`) or on PATH.',
|
|
37
|
-
);
|
|
38
|
-
process.exit(1);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (result.signal) process.kill(process.pid, result.signal);
|
|
43
|
-
process.exit(result.status ?? 1);
|