tsx-strict 0.1.1 → 0.1.4
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 +4 -4
- package/dist/cli.js +2 -3
- package/dist/cli.js.map +1 -1
- package/dist/compiler-provider.d.ts +1 -1
- package/dist/compiler-provider.d.ts.map +1 -1
- package/dist/compiler-provider.js +3 -4
- package/dist/compiler-provider.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +53 -34
- package/dist/index.js.map +1 -1
- package/dist/killer.d.ts +1 -1
- package/dist/killer.d.ts.map +1 -1
- package/dist/killer.js +7 -5
- package/dist/killer.js.map +1 -1
- package/dist/stdout-manipulator.d.ts +2 -3
- package/dist/stdout-manipulator.d.ts.map +1 -1
- package/dist/stdout-manipulator.js +11 -31
- package/dist/stdout-manipulator.js.map +1 -1
- package/dist/utils/sheu.d.ts +6 -6
- package/dist/utils/sheu.d.ts.map +1 -1
- package/dist/utils/sheu.js.map +1 -1
- package/package.json +1 -1
- package/dist/args-manager.d.ts +0 -20
- package/dist/args-manager.d.ts.map +0 -1
- package/dist/args-manager.js +0 -88
- package/dist/args-manager.js.map +0 -1
- package/dist/debounce.d.ts +0 -2
- package/dist/debounce.d.ts.map +0 -1
- package/dist/debounce.js +0 -11
- package/dist/debounce.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `Tsx-Strict`
|
|
2
2
|
|
|
3
|
-
Type-safe TSX runner with automatic type-checking
|
|
3
|
+
### Type-safe TSX runner with automatic type-checking
|
|
4
4
|
|
|
5
5
|
tsx-strict is a CLI tool that runs TypeScript files with TSX while providing real-time type checking. It combines the speed of tsx with the safety of TypeScript's compiler, ensuring your code is both executable and type-safe.
|
|
6
6
|
|
|
@@ -16,7 +16,7 @@ tsx-strict is a CLI tool that runs TypeScript files with TSX while providing rea
|
|
|
16
16
|
## Installation
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
|
|
19
|
+
pnpm install -g tsx-strict
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
Or use with npx:
|
|
@@ -68,7 +68,7 @@ tsx-strict src/index.ts
|
|
|
68
68
|
### Watch Mode with Custom TSC Arguments
|
|
69
69
|
|
|
70
70
|
```bash
|
|
71
|
-
tsx-strict --watch --tsc-args --strict --exactOptionalPropertyTypes src/app.ts
|
|
71
|
+
tsx-strict --watch --tsc-args "--strict --exactOptionalPropertyTypes" src/app.ts
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
### Silent Mode
|
package/dist/cli.js
CHANGED
|
@@ -13,18 +13,17 @@ program
|
|
|
13
13
|
.version(packageJson.version)
|
|
14
14
|
.argument("<file>", "TypeScript file to run")
|
|
15
15
|
.option("-w, --watch", "Enable watch mode", false)
|
|
16
|
-
.option("--no-clear", "Do not clear screen",
|
|
16
|
+
.option("--no-clear", "Do not clear screen", true)
|
|
17
17
|
.option("--compiler", "Compiler", "typescript/bin/tsc")
|
|
18
18
|
.option("--tsc-args <args...>", "Additional tsc arguments")
|
|
19
19
|
.option("--tsx-args <args...>", "Additional tsx arguments")
|
|
20
|
-
.option("--silent", "Suppress output", false)
|
|
21
20
|
.option("--no-type-check", "Skip type checking (run tsx directly)", true)
|
|
22
21
|
.action(async (file, options) => {
|
|
23
22
|
try {
|
|
24
23
|
await (0, index_1.runTsxStrict)(file, options);
|
|
25
24
|
}
|
|
26
25
|
catch (error) {
|
|
27
|
-
console.error("Error
|
|
26
|
+
console.error("Error:", error.message);
|
|
28
27
|
process.exit(1);
|
|
29
28
|
}
|
|
30
29
|
});
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AACA,yCAAoC;AACpC,mCAAuC;AACvC,mBAAiB;AACjB,2BAAkC;AAElC,MAAM,WAAW,GAAG,I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AAE;IAC9B,IAAI,CAAC;QACH,MAAM,IAAA,oBAAY,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AACL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function getCompilerPath(compilerArg: string | null, resolver?: NodeRequire[
|
|
1
|
+
export declare function getCompilerPath(compilerArg: string | null, resolver?: NodeRequire["resolve"]): string;
|
|
2
2
|
//# sourceMappingURL=compiler-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiler-provider.d.ts","sourceRoot":"","sources":["../src/compiler-provider.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,
|
|
1
|
+
{"version":3,"file":"compiler-provider.d.ts","sourceRoot":"","sources":["../src/compiler-provider.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAC7B,WAAW,EAAE,MAAM,GAAG,IAAI,EAC1B,QAAQ,GAAE,WAAW,CAAC,SAAS,CAAmB,GACjD,MAAM,CAkBR"}
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCompilerPath = getCompilerPath;
|
|
4
4
|
function getCompilerPath(compilerArg, resolver = require.resolve) {
|
|
5
|
-
if (!compilerArg)
|
|
6
|
-
compilerArg =
|
|
7
|
-
}
|
|
5
|
+
if (!compilerArg)
|
|
6
|
+
compilerArg = "typescript/bin/tsc";
|
|
8
7
|
try {
|
|
9
8
|
return resolver(compilerArg, { paths: [process.cwd()] });
|
|
10
9
|
}
|
|
@@ -15,7 +14,7 @@ function getCompilerPath(compilerArg, resolver = require.resolve) {
|
|
|
15
14
|
return resolver(compilerArg);
|
|
16
15
|
}
|
|
17
16
|
catch (e) {
|
|
18
|
-
if (e.code ===
|
|
17
|
+
if (e.code === "MODULE_NOT_FOUND") {
|
|
19
18
|
console.error(e.message);
|
|
20
19
|
process.exit(9);
|
|
21
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiler-provider.js","sourceRoot":"","sources":["../src/compiler-provider.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"compiler-provider.js","sourceRoot":"","sources":["../src/compiler-provider.ts"],"names":[],"mappings":";;AAAA,0CAqBC;AArBD,SAAgB,eAAe,CAC7B,WAA0B,EAC1B,WAAmC,OAAO,CAAC,OAAO;IAElD,IAAI,CAAC,WAAW;QAAE,WAAW,GAAG,oBAAoB,CAAC;IAErD,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;IAC3D,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,2DAA2D;IAC7D,CAAC;IAED,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,IAAI,CAAC,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;YAClC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;YACzB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,MAAM,CAAC,CAAC;IACV,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export declare let
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
2
|
+
export declare let tsxKiller: (() => Promise<void>) | null;
|
|
3
|
+
export declare function setTsxKiller(value: typeof tsxKiller): void;
|
|
4
|
+
export declare function getTsxKiller(): (() => Promise<void>) | null;
|
|
5
5
|
export declare function runTsxStrict(file: string, options: Record<string, any>): Promise<void>;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAWA,eAAO,IAAI,SAAS,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,IAAW,CAAC;AAE1D,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,SAAS,QAEnD;AAED,wBAAgB,YAAY,WANC,OAAO,CAAC,IAAI,CAAC,SAQzC;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,iBAgJ5E"}
|
package/dist/index.js
CHANGED
|
@@ -37,9 +37,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.
|
|
41
|
-
exports.
|
|
42
|
-
exports.
|
|
40
|
+
exports.tsxKiller = void 0;
|
|
41
|
+
exports.setTsxKiller = setTsxKiller;
|
|
42
|
+
exports.getTsxKiller = getTsxKiller;
|
|
43
43
|
exports.runTsxStrict = runTsxStrict;
|
|
44
44
|
const node_cleanup_1 = __importStar(require("node-cleanup"));
|
|
45
45
|
const cross_spawn_1 = __importDefault(require("cross-spawn"));
|
|
@@ -49,27 +49,53 @@ const readline_1 = require("readline");
|
|
|
49
49
|
const killer_1 = require("./killer");
|
|
50
50
|
const compiler_provider_1 = require("./compiler-provider");
|
|
51
51
|
let firstTime = true;
|
|
52
|
-
exports.
|
|
53
|
-
function
|
|
54
|
-
exports.
|
|
52
|
+
exports.tsxKiller = null;
|
|
53
|
+
function setTsxKiller(value) {
|
|
54
|
+
exports.tsxKiller = value;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
return exports.
|
|
56
|
+
function getTsxKiller() {
|
|
57
|
+
return exports.tsxKiller;
|
|
58
58
|
}
|
|
59
59
|
async function runTsxStrict(file, options) {
|
|
60
|
-
const {
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
const { clear = true, typeCheck = true, compiler = "tsc", watch = false, tscArgs = "", tsxArgs = "", maxNodeMem, } = options;
|
|
61
|
+
runTsxCommand();
|
|
62
|
+
if (!typeCheck)
|
|
63
|
+
return;
|
|
63
64
|
function runTsxCommand() {
|
|
64
|
-
|
|
65
|
+
const tsxArgsArray = [];
|
|
66
|
+
if (!clear && watch)
|
|
67
|
+
tsxArgsArray.push("--watch-preserve-output");
|
|
68
|
+
else if (watch)
|
|
69
|
+
tsxArgsArray.push("--watch");
|
|
70
|
+
tsxArgsArray.push(file);
|
|
71
|
+
if (tsxArgs.trim()) {
|
|
72
|
+
const additionalArgs = tsxArgs
|
|
73
|
+
.trim()
|
|
74
|
+
.split(/\s+/)
|
|
75
|
+
.filter((arg) => arg.length > 0);
|
|
76
|
+
const uniqueArgs = Array.from(new Set([...tsxArgsArray, ...additionalArgs]));
|
|
77
|
+
tsxArgsArray.length = 0;
|
|
78
|
+
tsxArgsArray.push(...uniqueArgs);
|
|
79
|
+
}
|
|
80
|
+
const tsxCommand = `npx tsx ${tsxArgsArray.join(" ")}`;
|
|
81
|
+
exports.tsxKiller = (0, runner_1.run)(tsxCommand);
|
|
82
|
+
}
|
|
83
|
+
const tscArgsArray = [];
|
|
84
|
+
const nodeArgs = maxNodeMem ? [`--max_old_space_size=${maxNodeMem}`] : [];
|
|
85
|
+
tscArgsArray.push((0, compiler_provider_1.getCompilerPath)(compiler));
|
|
86
|
+
tscArgsArray.push("--noEmit");
|
|
87
|
+
if (watch)
|
|
88
|
+
tscArgsArray.push("--watch");
|
|
89
|
+
if (tscArgs.trim()) {
|
|
90
|
+
const additionalArgs = tscArgs
|
|
91
|
+
.trim()
|
|
92
|
+
.split(/\s+/)
|
|
93
|
+
.filter((arg) => arg.length > 0);
|
|
94
|
+
const uniqueArgs = Array.from(new Set([...tscArgsArray, ...additionalArgs]));
|
|
95
|
+
tscArgsArray.length = 0;
|
|
96
|
+
tscArgsArray.push(...uniqueArgs);
|
|
65
97
|
}
|
|
66
|
-
const tscProcess = (0, cross_spawn_1.default)("node", [
|
|
67
|
-
...(maxNodeMem ? [`--max_old_space_size=${maxNodeMem}`] : []),
|
|
68
|
-
(0, compiler_provider_1.getCompilerPath)(compiler),
|
|
69
|
-
"--noEmit",
|
|
70
|
-
watch ? "--watch" : "",
|
|
71
|
-
...tscArgs,
|
|
72
|
-
]);
|
|
98
|
+
const tscProcess = (0, cross_spawn_1.default)("node", [...nodeArgs, ...tscArgsArray]);
|
|
73
99
|
if (!tscProcess.stdout)
|
|
74
100
|
throw new Error("Unable to read Typescript stdout");
|
|
75
101
|
if (!tscProcess.stderr)
|
|
@@ -82,25 +108,18 @@ async function runTsxStrict(file, options) {
|
|
|
82
108
|
let compilationId = 0;
|
|
83
109
|
let compilationErrorSinceStart = false;
|
|
84
110
|
const rl = (0, readline_1.createInterface)({ input: tscProcess.stdout });
|
|
85
|
-
rl.on("line", function (
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
if (!silent) {
|
|
90
|
-
(0, stdout_manipulator_1.print)(line, {
|
|
91
|
-
noClear,
|
|
92
|
-
});
|
|
93
|
-
}
|
|
111
|
+
rl.on("line", function (line) {
|
|
112
|
+
(0, stdout_manipulator_1.print)(line, {
|
|
113
|
+
clear,
|
|
114
|
+
});
|
|
94
115
|
const state = (0, stdout_manipulator_1.detectState)(line);
|
|
95
116
|
const compilationStarted = state.compilationStarted;
|
|
96
117
|
const compilationError = state.compilationError;
|
|
97
118
|
const compilationComplete = state.compilationComplete;
|
|
98
119
|
compilationErrorSinceStart =
|
|
99
120
|
(!compilationStarted && compilationErrorSinceStart) || compilationError;
|
|
100
|
-
if (state.fileEmitted !== null)
|
|
121
|
+
if (state.fileEmitted !== null)
|
|
101
122
|
Signal.emitFile(state.fileEmitted);
|
|
102
|
-
// triggerOnEmit();
|
|
103
|
-
}
|
|
104
123
|
if (compilationStarted) {
|
|
105
124
|
compilationId++;
|
|
106
125
|
(0, killer_1.killProcesses)(compilationId).then((previousCompilationId) => {
|
|
@@ -129,8 +148,8 @@ async function runTsxStrict(file, options) {
|
|
|
129
148
|
});
|
|
130
149
|
if (typeof process.on === "function")
|
|
131
150
|
process.on("message", (msg) => {
|
|
132
|
-
if (msg === "run-on-success-command" && exports.
|
|
133
|
-
(0, exports.
|
|
151
|
+
if (msg === "run-on-success-command" && exports.tsxKiller)
|
|
152
|
+
(0, exports.tsxKiller)().then(runTsxCommand);
|
|
134
153
|
});
|
|
135
154
|
const sendSignal = (msg) => process.send && process.send(msg);
|
|
136
155
|
const Signal = {
|
|
@@ -143,7 +162,7 @@ async function runTsxStrict(file, options) {
|
|
|
143
162
|
(0, node_cleanup_1.default)((_exitCode, signal) => {
|
|
144
163
|
if (signal)
|
|
145
164
|
tscProcess.kill(signal);
|
|
146
|
-
(0, killer_1.killProcesses)(0
|
|
165
|
+
(0, killer_1.killProcesses)(0).then(() => process.exit());
|
|
147
166
|
// don't call cleanup handler again
|
|
148
167
|
(0, node_cleanup_1.uninstall)();
|
|
149
168
|
return false;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;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AC,SAAS,CAAC;QACxC,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC;QAC5C,QAAQ,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,UAAU,CAAC,gBAAgB,IAAI,EAAE,CAAC;KAC/D,CAAC;IAEF,IAAA,sBAAW,EAAC,CAAC,SAAwB,EAAE,MAAqB,EAAE,EAAE;QAC9D,IAAI,MAAM;YAAE,UAAU,CAAC,IAAI,CAAC,MAAa,CAAC,CAAC;QAE3C,IAAA,sBAAa,EAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QAC5C,mCAAmC;QACnC,IAAA,wBAAS,GAAE,CAAC;QACZ,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/killer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ChildProcess } from "child_process";
|
|
2
2
|
export declare function kill(child: ChildProcess): Promise<void>;
|
|
3
|
-
export declare function killProcesses(currentCompilationId: number
|
|
3
|
+
export declare function killProcesses(currentCompilationId: number): Promise<number>;
|
|
4
4
|
//# sourceMappingURL=killer.d.ts.map
|
package/dist/killer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"killer.d.ts","sourceRoot":"","sources":["../src/killer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAQ,MAAM,eAAe,CAAC;AAenD,wBAAgB,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBvD;AAID,wBAAsB,aAAa,CACjC,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"killer.d.ts","sourceRoot":"","sources":["../src/killer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAQ,MAAM,eAAe,CAAC;AAenD,wBAAgB,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBvD;AAID,wBAAsB,aAAa,CACjC,oBAAoB,EAAE,MAAM,GAE3B,OAAO,CAAC,MAAM,CAAC,CAyBjB"}
|
package/dist/killer.js
CHANGED
|
@@ -42,15 +42,17 @@ function kill(child) {
|
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
let runningKillProcessesPromise = null;
|
|
45
|
-
async function killProcesses(currentCompilationId
|
|
45
|
+
async function killProcesses(currentCompilationId
|
|
46
|
+
// killAll: boolean = false
|
|
47
|
+
) {
|
|
46
48
|
if (runningKillProcessesPromise) {
|
|
47
49
|
return runningKillProcessesPromise.then(() => currentCompilationId);
|
|
48
50
|
}
|
|
49
51
|
const promisesToWaitFor = [];
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
promisesToWaitFor.push(
|
|
53
|
-
(0, _1.
|
|
52
|
+
const tsxKiller = (0, _1.getTsxKiller)();
|
|
53
|
+
if (tsxKiller) {
|
|
54
|
+
promisesToWaitFor.push(tsxKiller());
|
|
55
|
+
(0, _1.setTsxKiller)(null);
|
|
54
56
|
}
|
|
55
57
|
runningKillProcessesPromise = Promise.all(promisesToWaitFor)
|
|
56
58
|
.then(() => {
|
package/dist/killer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"killer.js","sourceRoot":"","sources":["../src/killer.ts"],"names":[],"mappings":";;;;;AAiBA,oBAqBC;AAID,sCA4BC;AAtED,sDAA6B;AAC7B,8DAAgC;AAChC,iDAAmD;AACnD,
|
|
1
|
+
{"version":3,"file":"killer.js","sourceRoot":"","sources":["../src/killer.ts"],"names":[],"mappings":";;;;;AAiBA,oBAqBC;AAID,sCA4BC;AAtED,sDAA6B;AAC7B,8DAAgC;AAChC,iDAAmD;AACnD,wBAA+C;AAE/C,IAAI,WAAW,GAAG,IAAI,CAAC,CAAC,UAAU;AAClC,IAAI,KAAK,GAAG,IAAI,CAAC;AAEjB,MAAM,SA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AA2B,GAA2B,IAAI,CAAC;AAExD,KAAK,UAAU,aAAa,CACjC,oBAA4B;AAC5B,2BAA2B;;IAE3B,IAAI,2BAA2B,EAAE,CAAC;QAChC,OAAO,2BAA2B,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC,CAAC;IACtE,CAAC;IAED,MAAM,iBAAiB,GAAmB,EAAE,CAAC;IAE7C,MAAM,SAAS,GAAG,IAAA,eAAY,GAAE,CAAC;IACjC,IAAI,SAAS,EAAE,CAAC;QACd,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;QACpC,IAAA,eAAY,EAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IAED,2BAA2B,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;SACzD,IAAI,CAAC,GAAG,EAAE;QACT,2BAA2B,GAAG,IAAI,CAAC;QACnC,OAAO,oBAAoB,CAAC;IAC9B,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACf,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;QACjD,2BAA2B,GAAG,IAAI,CAAC;QACnC,OAAO,oBAAoB,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEL,OAAO,2BAA2B,CAAC;AACrC,CAAC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
type TPrintParams = {
|
|
2
2
|
noColors?: boolean;
|
|
3
|
-
|
|
3
|
+
clear?: boolean;
|
|
4
4
|
requestedToListEmittedFiles?: boolean;
|
|
5
5
|
signalEmittedFiles?: boolean;
|
|
6
6
|
};
|
|
7
|
-
export declare function print(line: string, { noColors,
|
|
7
|
+
export declare function print(line: string, { noColors, requestedToListEmittedFiles, signalEmittedFiles, }?: TPrintParams): void;
|
|
8
8
|
export declare function deleteClear(line: string): string;
|
|
9
|
-
export declare function manipulate(line: string): string;
|
|
10
9
|
export declare function detectState(line: string): {
|
|
11
10
|
compilationStarted: boolean;
|
|
12
11
|
compilationError: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdout-manipulator.d.ts","sourceRoot":"","sources":["../src/stdout-manipulator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stdout-manipulator.d.ts","sourceRoot":"","sources":["../src/stdout-manipulator.ts"],"names":[],"mappings":"AAgEA,KAAK,YAAY,GAAG;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAKF,wBAAgB,KAAK,CACnB,IAAI,EAAE,MAAM,EACZ,EACE,QAAgB,EAChB,2BAAmC,EACnC,kBAA0B,GAC3B,GAAE,YAAiB,GACnB,IAAI,CA4BN;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAShD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM;;;;;EAwBvC"}
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.print = print;
|
|
7
7
|
exports.deleteClear = deleteClear;
|
|
8
|
-
exports.manipulate = manipulate;
|
|
9
8
|
exports.detectState = detectState;
|
|
10
9
|
const sheu_1 = __importDefault(require("./utils/sheu"));
|
|
11
10
|
const ANSI_REGEX = new RegExp("[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))", "g");
|
|
@@ -25,20 +24,7 @@ const nativeCompilationStartedRegex = /build starting at /;
|
|
|
25
24
|
// compilation complete
|
|
26
25
|
const compilationCompleteRegex = /( Compilation complete\. Watching for file changes\.| Found \d+ error[s]?\. Watching for file changes\.)/;
|
|
27
26
|
const nativeCompilationCompleteRegex = /build finished in /;
|
|
28
|
-
|
|
29
|
-
" -w, --watch Watch input files. [on by default, use --noWatch to disable]",
|
|
30
|
-
" --onSuccess COMMAND Executes `COMMAND` on **every successful** compilation.",
|
|
31
|
-
" --onFirstSuccess COMMAND Executes `COMMAND` on the **first successful** compilation.",
|
|
32
|
-
" --onFailure COMMAND Executes `COMMAND` on **every failed** compilation.",
|
|
33
|
-
" --onEmit COMMAND Executes debounced `COMMAND` on **every emitted file**, ignoring unchanged files and disregards compilation success or failure.",
|
|
34
|
-
" --onEmitDebounceMs DELAY Delay by which to debounce `--onEmit` (default: 300).",
|
|
35
|
-
" --onCompilationStarted COMMAND Executes `COMMAND` on **every compilation start** event.",
|
|
36
|
-
" --onCompilationComplete COMMAND Executes `COMMAND` on **every successful or failed** compilation.",
|
|
37
|
-
" --noColors Removes the red/green colors from the compiler output",
|
|
38
|
-
" --noClear Prevents the compiler from clearing the screen",
|
|
39
|
-
" --compiler PATH The PATH will be used instead of typescript compiler. Defaults typescript/bin/tsc.",
|
|
40
|
-
].join("\n");
|
|
41
|
-
function color(line, noClear = false) {
|
|
27
|
+
function color(line) {
|
|
42
28
|
// coloring errors:
|
|
43
29
|
line = line.replace(typescriptErrorRegex, (m) => `\u001B[36m${m}\u001B[39m`); // Cyan
|
|
44
30
|
line = line.replace(typescriptPrettyErrorRegex, (m) => `\u001B[36m${m}\u001B[39m`); // Cyan
|
|
@@ -49,35 +35,32 @@ function color(line, noClear = false) {
|
|
|
49
35
|
line = line.replace(compilationCompleteWithoutErrorRegex, (m) => `\u001B[32m${m}\u001B[39m`); // Green
|
|
50
36
|
// usage
|
|
51
37
|
line = line.replace(tscUsageSyntaxRegex, (m) => `\u001B[33m${m}\u001B[39m`); // Yellow
|
|
52
|
-
if (noClear && compilationStartedRegex.test(line)) {
|
|
53
|
-
return "\n\n----------------------\n" + line;
|
|
54
|
-
}
|
|
55
38
|
return line;
|
|
56
39
|
}
|
|
57
40
|
let tsErrorMessagePrinted = false;
|
|
58
41
|
let prevLine = "";
|
|
59
|
-
function print(line, { noColors = false,
|
|
60
|
-
if (signalEmittedFiles &&
|
|
42
|
+
function print(line, { noColors = false, requestedToListEmittedFiles = false, signalEmittedFiles = false, } = {}) {
|
|
43
|
+
if ((signalEmittedFiles &&
|
|
61
44
|
!requestedToListEmittedFiles &&
|
|
62
|
-
line.startsWith("TSFILE:"))
|
|
45
|
+
line.startsWith("TSFILE:")) ||
|
|
46
|
+
(!line &&
|
|
47
|
+
(prevLine.includes("Starting") || prevLine.includes("Found 0 Errors")))) {
|
|
63
48
|
return;
|
|
64
49
|
}
|
|
65
|
-
if (!line &&
|
|
66
|
-
(prevLine.includes("Starting") || prevLine.includes("Found 0 Errors")))
|
|
67
|
-
return;
|
|
68
50
|
if (line.includes("Starting") || line.includes("Found 0 errors")) {
|
|
69
51
|
tsErrorMessagePrinted = false;
|
|
52
|
+
prevLine = line;
|
|
70
53
|
return;
|
|
71
54
|
}
|
|
72
55
|
if (line.includes(": error TS") && !tsErrorMessagePrinted) {
|
|
73
|
-
console.error(
|
|
56
|
+
console.error(`\n[${sheu_1.default.red("Error")}] Unable to compile TypeScript:`);
|
|
74
57
|
tsErrorMessagePrinted = true;
|
|
75
58
|
}
|
|
76
|
-
if (line.includes("Founnd ") || line.includes("
|
|
59
|
+
if (line.includes("Founnd ") || line.includes("Watching for file changes."))
|
|
77
60
|
line = sheu_1.default.red(line.split(" - ")[1]);
|
|
78
|
-
if (line)
|
|
61
|
+
if (line.replaceAll(" ", ""))
|
|
79
62
|
prevLine = line;
|
|
80
|
-
console.
|
|
63
|
+
console.info(!noColors ? line : color(line));
|
|
81
64
|
}
|
|
82
65
|
function deleteClear(line) {
|
|
83
66
|
// '\x1bc11:40:16 - Starting compilation in watch mode...'
|
|
@@ -89,9 +72,6 @@ function deleteClear(line) {
|
|
|
89
72
|
.replace(/^\x1bc/, "");
|
|
90
73
|
return result;
|
|
91
74
|
}
|
|
92
|
-
function manipulate(line) {
|
|
93
|
-
return line.replace(tscUsageSyntaxRegex, newAdditionToSyntax);
|
|
94
|
-
}
|
|
95
75
|
function detectState(line) {
|
|
96
76
|
const clearLine = stripAnsi(line);
|
|
97
77
|
const compilationStarted = compilationStartedRegex.test(clearLine) ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdout-manipulator.js","sourceRoot":"","sources":["../src/stdout-manipulator.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"stdout-manipulator.js","sourceRoot":"","sources":["../src/stdout-manipulator.ts"],"names":[],"mappings":";;;;;AA0EA,sBAmCC;AAED,kCASC;AAED,kCAwBC;AAlJD,wDAAgC;AAEhC,MAAM,UAAU,GAAG,IAAI,MAAM,CAC3B,uLAAuL,EACvL,GAAG,CACJ,CAAC;AACF,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAE/D,MAAM,mBAAmB,GAAG,mCAAmC,CAAC;AAChE,MAAM,0BAA0B,GAAG,2BAA2B,CAAC;AAC/D,MAAM,oBAAoB,GAAG,4BAA4B,CAAC;AAC1D,MAAM,0BAA0B,GAAG,kBAAkB,CAAC;AAEtD,SAAS;AACT,MAAM,iCAAiC,GACrC,2DAA2D,CAAC;AAC9D,MAAM,uCAAuC,GAAG,8BAA8B,CAAC;AAE/E,YAAY;AACZ,MAAM,oCAAoC,GACxC,+CAA+C,CAAC;AAElD,sBAAsB;AACtB,MAAM,uBAAuB,GAC3B,4GAA4G,CAAC;AAE/G,MAAM,6BAA6B,GAAG,oBAAoB,CAAC;AAE3D,uBAAuB;AACvB,MAAM,wBAAwB,GAC5B,0GAA0G,CAAC;AAE7G,MAAM,8BAA8B,GAAG,oBAAoB,CAAC;AAE5D,SA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B,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,WAAW,CAAC,IAAY;IACtC,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAClC,MAAM,kBAAkB,GACtB,uBAAuB,CAAC,IAAI,CAAC,SAAS,CAAC;QACvC,6BAA6B,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAEhD,MAAM,gBAAgB,GACpB,iCAAiC,CAAC,IAAI,CAAC,SAAS,CAAC;QACjD,uCAAuC,CAAC,IAAI,CAAC,SAAS,CAAC;QACvD,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC;QACpC,0BAA0B,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAE7C,MAAM,mBAAmB,GACvB,wBAAwB,CAAC,IAAI,CAAC,SAAS,CAAC;QACxC,8BAA8B,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACjD,MAAM,eAAe,GAAG,0BAA0B,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACnE,MAAM,WAAW,GAAG,eAAe,KAAK,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,mEAAmE;IAE7I,OAAO;QACL,kBAAkB;QAClB,gBAAgB;QAChB,mBAAmB;QACnB,WAAW;KACZ,CAAC;AACJ,CAAC"}
|
package/dist/utils/sheu.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export default class sheu {
|
|
2
|
-
static red(text:
|
|
3
|
-
static green(text:
|
|
4
|
-
static yellow(text:
|
|
5
|
-
static blue(text:
|
|
6
|
-
static magenta(text:
|
|
7
|
-
static cyan(text:
|
|
2
|
+
static red(text: any): string;
|
|
3
|
+
static green(text: any): string;
|
|
4
|
+
static yellow(text: any): string;
|
|
5
|
+
static blue(text: any): string;
|
|
6
|
+
static magenta(text: any): string;
|
|
7
|
+
static cyan(text: any): string;
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=sheu.d.ts.map
|
package/dist/utils/sheu.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheu.d.ts","sourceRoot":"","sources":["../../src/utils/sheu.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,IAAI;IACvB,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"sheu.d.ts","sourceRoot":"","sources":["../../src/utils/sheu.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,IAAI;IACvB,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAI7B,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAI/B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAIhC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAI9B,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAIjC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;CAG/B"}
|
package/dist/utils/sheu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheu.js","sourceRoot":"","sources":["../../src/utils/sheu.ts"],"names":[],"mappings":";;AAAA,MAAqB,IAAI;IACvB,MAAM,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"sheu.js","sourceRoot":"","sources":["../../src/utils/sheu.ts"],"names":[],"mappings":";;AAAA,MAAqB,IAAI;IACvB,MAAM,CAAC,GAAG,CAAC,IAAS;QAClB,OAAO,WAAW,IAAI,SAAS,CAAC;IAClC,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,IAAS;QACpB,OAAO,WAAW,IAAI,SAAS,CAAC;IAClC,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,IAAS;QACrB,OAAO,WAAW,IAAI,SAAS,CAAC;IAClC,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,IAAS;QACnB,OAAO,WAAW,IAAI,SAAS,CAAC;IAClC,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,IAAS;QACtB,OAAO,WAAW,IAAI,SAAS,CAAC;IAClC,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,IAAS;QACnB,OAAO,WAAW,IAAI,SAAS,CAAC;IAClC,CAAC;CACF;AAxBD,uBAwBC"}
|
package/package.json
CHANGED
package/dist/args-manager.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export declare function isCommandExist(args: string[], command: string): boolean;
|
|
2
|
-
export declare function hasWatchCommand(args: string[]): boolean;
|
|
3
|
-
export declare function extractArgs(inputArgs: string[]): {
|
|
4
|
-
onFirstSuccessCommand: string | null;
|
|
5
|
-
onSuccessCommand: string | null;
|
|
6
|
-
onFailureCommand: string | null;
|
|
7
|
-
onEmitCommand: string | null;
|
|
8
|
-
onEmitDebounceMs: number;
|
|
9
|
-
onCompilationStarted: string | null;
|
|
10
|
-
onCompilationComplete: string | null;
|
|
11
|
-
maxNodeMem: string | null;
|
|
12
|
-
noColors: boolean;
|
|
13
|
-
noClear: boolean;
|
|
14
|
-
requestedToListEmittedFiles: boolean;
|
|
15
|
-
signalEmittedFiles: boolean;
|
|
16
|
-
silent: boolean;
|
|
17
|
-
compiler: string;
|
|
18
|
-
args: string[];
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=args-manager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"args-manager.d.ts","sourceRoot":"","sources":["../src/args-manager.ts"],"names":[],"mappings":"AAWA,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEvE;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAEvD;AAgCD,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE;;;;;;;;;;;;;;;;EA2D9C"}
|
package/dist/args-manager.js
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isCommandExist = isCommandExist;
|
|
4
|
-
exports.hasWatchCommand = hasWatchCommand;
|
|
5
|
-
exports.extractArgs = extractArgs;
|
|
6
|
-
const compiler_provider_1 = require("./compiler-provider");
|
|
7
|
-
function removeRunnerArgs(args) {
|
|
8
|
-
return args.splice(2); // removing "node tsc-watch.js"
|
|
9
|
-
}
|
|
10
|
-
function getCommandIdx(args, command) {
|
|
11
|
-
const lowerCasedCommand = command.toLowerCase();
|
|
12
|
-
return args.map((arg) => arg.toLowerCase()).indexOf(lowerCasedCommand);
|
|
13
|
-
}
|
|
14
|
-
function isCommandExist(args, command) {
|
|
15
|
-
return getCommandIdx(args, command) >= 0;
|
|
16
|
-
}
|
|
17
|
-
function hasWatchCommand(args) {
|
|
18
|
-
return isCommandExist(args, "-w") || isCommandExist(args, "--watch");
|
|
19
|
-
}
|
|
20
|
-
function forceWatch(args) {
|
|
21
|
-
if (!hasWatchCommand(args)) {
|
|
22
|
-
args.push("--watch");
|
|
23
|
-
}
|
|
24
|
-
return args;
|
|
25
|
-
}
|
|
26
|
-
function extractCommandWithValue(args, command) {
|
|
27
|
-
let commandValue = null;
|
|
28
|
-
let commandIdx = getCommandIdx(args, command);
|
|
29
|
-
if (commandIdx > -1) {
|
|
30
|
-
commandValue = args[commandIdx + 1];
|
|
31
|
-
args.splice(commandIdx, 2);
|
|
32
|
-
}
|
|
33
|
-
return commandValue;
|
|
34
|
-
}
|
|
35
|
-
function extractCommand(args, command) {
|
|
36
|
-
let commandIdx = getCommandIdx(args, command);
|
|
37
|
-
if (commandIdx > -1) {
|
|
38
|
-
args.splice(commandIdx, 1);
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
function extractArgs(inputArgs) {
|
|
44
|
-
const cleanArgs = removeRunnerArgs(inputArgs);
|
|
45
|
-
const noWatch = extractCommand(cleanArgs, "--noWatch");
|
|
46
|
-
const args = noWatch ? cleanArgs : forceWatch(cleanArgs);
|
|
47
|
-
const onFirstSuccessCommand = extractCommandWithValue(args, "--onFirstSuccess");
|
|
48
|
-
const onSuccessCommand = extractCommandWithValue(args, "--onSuccess");
|
|
49
|
-
const onFailureCommand = extractCommandWithValue(args, "--onFailure");
|
|
50
|
-
const onEmitCommand = extractCommandWithValue(args, "--onEmit");
|
|
51
|
-
const onEmitDebounceMs = Number(extractCommandWithValue(args, "--onEmitDebounceMs")) || 300;
|
|
52
|
-
const onCompilationStarted = extractCommandWithValue(args, "--onCompilationStarted");
|
|
53
|
-
const onCompilationComplete = extractCommandWithValue(args, "--onCompilationComplete");
|
|
54
|
-
const maxNodeMem = extractCommandWithValue(args, "--maxNodeMem");
|
|
55
|
-
const noColors = extractCommand(args, "--noColors");
|
|
56
|
-
const noClear = extractCommand(args, "--noClear");
|
|
57
|
-
const silent = extractCommand(args, "--silent");
|
|
58
|
-
const signalEmittedFiles = extractCommand(args, "--signalEmittedFiles");
|
|
59
|
-
const requestedToListEmittedFiles = extractCommand(args, "--listEmittedFiles");
|
|
60
|
-
const compiler = (0, compiler_provider_1.getCompilerPath)(extractCommandWithValue(args, "--compiler"));
|
|
61
|
-
if (signalEmittedFiles || requestedToListEmittedFiles) {
|
|
62
|
-
if (args[0] === "--build" || args[0] === "-b") {
|
|
63
|
-
// TS6369: Option '--build' must be the first command line argument.
|
|
64
|
-
args.splice(1, 0, "--listEmittedFiles");
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
args.unshift("--listEmittedFiles");
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return {
|
|
71
|
-
onFirstSuccessCommand,
|
|
72
|
-
onSuccessCommand,
|
|
73
|
-
onFailureCommand,
|
|
74
|
-
onEmitCommand,
|
|
75
|
-
onEmitDebounceMs,
|
|
76
|
-
onCompilationStarted,
|
|
77
|
-
onCompilationComplete,
|
|
78
|
-
maxNodeMem,
|
|
79
|
-
noColors,
|
|
80
|
-
noClear,
|
|
81
|
-
requestedToListEmittedFiles,
|
|
82
|
-
signalEmittedFiles,
|
|
83
|
-
silent,
|
|
84
|
-
compiler,
|
|
85
|
-
args,
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
//# sourceMappingURL=args-manager.js.map
|
package/dist/args-manager.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"args-manager.js","sourceRoot":"","sources":["../src/args-manager.ts"],"names":[],"mappings":";;AAWA,wCAEC;AAED,0CAEC;AAgCD,kCA2DC;AA5GD,2DAAsD;AAEtD,SAAS,gBAAgB,CAAC,IAAc;IACtC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,+BAA+B;AACxD,CAAC;AAED,SAAS,aAAa,CAAC,IAAc,EAAE,OAAe;IACpD,MAAM,iBAAiB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAChD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACzE,CAAC;AAED,SAAgB,cAAc,CAAC,IAAc,EAAE,OAAe;IAC5D,OAAO,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AAC3C,CAAC;AAED,SAAgB,eAAe,CAAC,IAAc;IAC5C,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,cAAc,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACvE,CAAC;AAED,SAAS,UAAU,CAAC,IAAc;IAChC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3B,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CA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QACR,OAAO;QACP,2BAA2B;QAC3B,kBAAkB;QAClB,MAAM;QACN,QAAQ;QACR,IAAI;KACL,CAAC;AACJ,CAAC"}
|
package/dist/debounce.d.ts
DELETED
package/dist/debounce.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../src/debounce.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,SAAM,IAEzG,GAAG,MAAM,UAAU,CAAC,CAAC,CAAC,UAI/B"}
|
package/dist/debounce.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.debounce = debounce;
|
|
4
|
-
function debounce(fn, delay = 300) {
|
|
5
|
-
let timer;
|
|
6
|
-
return (...args) => {
|
|
7
|
-
timer && clearTimeout(timer);
|
|
8
|
-
timer = setTimeout(() => fn.apply(this, args), delay);
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=debounce.js.map
|
package/dist/debounce.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debounce.js","sourceRoot":"","sources":["../src/debounce.ts"],"names":[],"mappings":";;AAAA,4BAMC;AAND,SAAgB,QAAQ,CAAyE,EAAK,EAAE,KAAK,GAAG,GAAG;IACjH,IAAI,KAAgD,CAAA;IACpD,OAAO,CAAC,GAAG,IAAmB,EAAE,EAAE;QAChC,KAAK,IAAI,YAAY,CAAC,KAAK,CAAC,CAAA;QAC5B,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,CAAA;IACvD,CAAC,CAAA;AACH,CAAC"}
|