@esportsplus/typescript 0.13.1 → 0.14.2
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/bin/tsc +1 -1
- package/build/cli/tsc.d.ts +1 -0
- package/build/cli/tsc.js +167 -0
- package/package.json +3 -4
- package/src/cli/tsc.ts +258 -0
- package/bin/tsc-alias +0 -3
package/bin/tsc
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/build/cli/tsc.js
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { spawn } from 'child_process';
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
import { pathToFileURL } from 'url';
|
|
4
|
+
import fs from 'fs';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import ts from 'typescript';
|
|
7
|
+
let require = createRequire(import.meta.url), skipFlags = ['--help', '--init', '--noEmit', '--showConfig', '--version', '-h', '-noEmit', '-v'];
|
|
8
|
+
async function build(tsconfig, plugins) {
|
|
9
|
+
let root = path.dirname(path.resolve(tsconfig)), { config, error } = ts.readConfigFile(tsconfig, ts.sys.readFile);
|
|
10
|
+
if (error) {
|
|
11
|
+
console.error(ts.flattenDiagnosticMessageText(error.messageText, '\n'));
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
let parsed = ts.parseJsonConfigFileContent(config, ts.sys, root);
|
|
15
|
+
if (parsed.errors.length > 0) {
|
|
16
|
+
for (let i = 0, n = parsed.errors.length; i < n; i++) {
|
|
17
|
+
console.error(ts.flattenDiagnosticMessageText(parsed.errors[i].messageText, '\n'));
|
|
18
|
+
}
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
await loadTransformers(plugins, root).then((transformers) => {
|
|
22
|
+
let program = ts.createProgram(parsed.fileNames, parsed.options), result = program.emit(undefined, undefined, undefined, false, {
|
|
23
|
+
after: transformers.after.map(f => f(program)),
|
|
24
|
+
afterDeclarations: transformers.afterDeclarations.map(f => f(program)),
|
|
25
|
+
before: transformers.before.map(f => f(program))
|
|
26
|
+
});
|
|
27
|
+
let diagnostics = ts.getPreEmitDiagnostics(program).concat(result.diagnostics);
|
|
28
|
+
if (diagnostics.length > 0) {
|
|
29
|
+
console.error(ts.formatDiagnosticsWithColorAndContext(diagnostics, {
|
|
30
|
+
getCanonicalFileName: (fileName) => fileName,
|
|
31
|
+
getCurrentDirectory: () => root,
|
|
32
|
+
getNewLine: () => '\n'
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
if (result.emitSkipped) {
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
if (shouldRunTscAlias(process.argv.slice(2))) {
|
|
39
|
+
return runTscAlias().then((code) => {
|
|
40
|
+
if (code !== 0) {
|
|
41
|
+
process.exit(code);
|
|
42
|
+
}
|
|
43
|
+
process.exit(0);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
process.exit(0);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function findPackageJson(moduleName, root) {
|
|
50
|
+
let nodeModulesPath = path.join(root, 'node_modules', moduleName.startsWith('@') ? moduleName.split('/').slice(0, 2).join('/') : moduleName.split('/')[0], 'package.json');
|
|
51
|
+
if (fs.existsSync(nodeModulesPath)) {
|
|
52
|
+
return nodeModulesPath;
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
function findTsconfig(args) {
|
|
57
|
+
let projectIndex = args.indexOf('-p');
|
|
58
|
+
if (projectIndex === -1) {
|
|
59
|
+
projectIndex = args.indexOf('--project');
|
|
60
|
+
}
|
|
61
|
+
if (projectIndex !== -1 && args[projectIndex + 1]) {
|
|
62
|
+
return args[projectIndex + 1];
|
|
63
|
+
}
|
|
64
|
+
return ts.findConfigFile(process.cwd(), ts.sys.fileExists, 'tsconfig.json');
|
|
65
|
+
}
|
|
66
|
+
function getPlugins(tsconfig) {
|
|
67
|
+
let { config, error } = ts.readConfigFile(tsconfig, ts.sys.readFile);
|
|
68
|
+
if (error) {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
return config?.compilerOptions?.plugins?.filter((p) => typeof p === 'object' && p !== null && 'transform' in p) ?? [];
|
|
72
|
+
}
|
|
73
|
+
async function loadTransformers(plugins, root) {
|
|
74
|
+
let after = [], afterDeclarations = [], before = [], promises = [];
|
|
75
|
+
for (let i = 0, n = plugins.length; i < n; i++) {
|
|
76
|
+
let plugin = plugins[i];
|
|
77
|
+
promises.push(import(resolvePlugin(plugin.transform, root)).then((module) => {
|
|
78
|
+
let factory = module.default ?? module.createTransformer ?? module;
|
|
79
|
+
if (typeof factory !== 'function') {
|
|
80
|
+
console.error(`Plugin ${plugin.transform}: no transformer factory found`);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (plugin.afterDeclarations) {
|
|
84
|
+
afterDeclarations.push(factory);
|
|
85
|
+
}
|
|
86
|
+
else if (plugin.after) {
|
|
87
|
+
after.push(factory);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
before.push(factory);
|
|
91
|
+
}
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
return Promise.all(promises).then(() => ({ after, afterDeclarations, before }));
|
|
95
|
+
}
|
|
96
|
+
function main() {
|
|
97
|
+
let args = process.argv.slice(2), tsconfig = findTsconfig(args);
|
|
98
|
+
if (!tsconfig) {
|
|
99
|
+
passthrough();
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
let plugins = getPlugins(tsconfig);
|
|
103
|
+
if (plugins.length === 0) {
|
|
104
|
+
passthrough();
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
console.log(`Found ${plugins.length} transformer plugin(s), using programmatic build...`);
|
|
108
|
+
build(tsconfig, plugins).catch((err) => {
|
|
109
|
+
console.error(err);
|
|
110
|
+
process.exit(1);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function passthrough() {
|
|
114
|
+
let args = process.argv.slice(2), child = spawn(process.execPath, [require.resolve('typescript/lib/tsc.js'), ...args], { stdio: 'inherit' });
|
|
115
|
+
child.on('exit', (code) => {
|
|
116
|
+
if (code === 0 && shouldRunTscAlias(args)) {
|
|
117
|
+
runTscAlias().then((aliasCode) => process.exit(aliasCode ?? 0));
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
process.exit(code ?? 0);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function resolveExport(exportValue) {
|
|
124
|
+
if (typeof exportValue === 'string') {
|
|
125
|
+
return exportValue;
|
|
126
|
+
}
|
|
127
|
+
if (exportValue && typeof exportValue === 'object') {
|
|
128
|
+
return exportValue.import ?? exportValue.default ?? null;
|
|
129
|
+
}
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
function resolvePlugin(modulePath, root) {
|
|
133
|
+
if (modulePath.startsWith('.')) {
|
|
134
|
+
return pathToFileURL(path.resolve(root, modulePath)).href;
|
|
135
|
+
}
|
|
136
|
+
let packageJsonPath = findPackageJson(modulePath, root);
|
|
137
|
+
if (!packageJsonPath) {
|
|
138
|
+
throw new Error(`tsc: cannot find package '${modulePath}' in ${root}`);
|
|
139
|
+
}
|
|
140
|
+
let packageDir = path.dirname(packageJsonPath), packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')), parts = modulePath.split('/'), subpath = './' + (modulePath.startsWith('@') ? parts.slice(2) : parts.slice(1)).join('/');
|
|
141
|
+
if (packageJson.exports) {
|
|
142
|
+
let exportEntry = subpath === './' ? packageJson.exports['.'] : packageJson.exports[subpath];
|
|
143
|
+
if (exportEntry) {
|
|
144
|
+
let resolved = resolveExport(exportEntry);
|
|
145
|
+
if (resolved) {
|
|
146
|
+
return pathToFileURL(path.resolve(packageDir, resolved)).href;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
throw new Error(`tsc: package subpath '${subpath}' is not exported by '${modulePath}'`);
|
|
150
|
+
}
|
|
151
|
+
return pathToFileURL(path.resolve(packageDir, packageJson.main ?? 'index.js')).href;
|
|
152
|
+
}
|
|
153
|
+
function runTscAlias() {
|
|
154
|
+
return new Promise((resolve) => {
|
|
155
|
+
let child = spawn(process.execPath, [require.resolve('tsc-alias/dist/bin/index.js'), ...process.argv.slice(2)], { stdio: 'inherit' });
|
|
156
|
+
child.on('exit', (code) => resolve(code ?? 0));
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
function shouldRunTscAlias(args) {
|
|
160
|
+
for (let i = 0, n = skipFlags.length; i < n; i++) {
|
|
161
|
+
if (args.includes(skipFlags[i])) {
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
main();
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "ICJR",
|
|
3
3
|
"bin": {
|
|
4
|
-
"tsc": "./bin/tsc",
|
|
5
|
-
"tsc
|
|
4
|
+
"esportsplus-tsc": "./bin/tsc",
|
|
5
|
+
"tsc": "./bin/tsc"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@esportsplus/cli-passthrough": "^0.0.12",
|
|
9
8
|
"@esportsplus/utilities": "^0.27.2",
|
|
10
9
|
"@types/node": "^25.0.3",
|
|
11
10
|
"tsc-alias": "^1.8.16",
|
|
@@ -34,7 +33,7 @@
|
|
|
34
33
|
},
|
|
35
34
|
"type": "module",
|
|
36
35
|
"types": "build/index.d.ts",
|
|
37
|
-
"version": "0.
|
|
36
|
+
"version": "0.14.2",
|
|
38
37
|
"scripts": {
|
|
39
38
|
"build": "tsc && tsc-alias",
|
|
40
39
|
"-": "-"
|
package/src/cli/tsc.ts
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { spawn } from 'child_process';
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
import { pathToFileURL } from 'url';
|
|
4
|
+
|
|
5
|
+
import fs from 'fs';
|
|
6
|
+
import path from 'path';
|
|
7
|
+
import ts from 'typescript';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
type ExportValue = string | { default?: string; import?: string; types?: string } | null;
|
|
11
|
+
|
|
12
|
+
type PluginConfig = {
|
|
13
|
+
after?: boolean;
|
|
14
|
+
afterDeclarations?: boolean;
|
|
15
|
+
transform: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
type TransformerCreator = (program: ts.Program) => ts.TransformerFactory<ts.SourceFile>;
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
let require = createRequire(import.meta.url),
|
|
22
|
+
skipFlags = ['--help', '--init', '--noEmit', '--showConfig', '--version', '-h', '-noEmit', '-v'];
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
async function build(tsconfig: string, plugins: PluginConfig[]): Promise<void> {
|
|
26
|
+
let root = path.dirname(path.resolve(tsconfig)),
|
|
27
|
+
{ config, error } = ts.readConfigFile(tsconfig, ts.sys.readFile);
|
|
28
|
+
|
|
29
|
+
if (error) {
|
|
30
|
+
console.error(ts.flattenDiagnosticMessageText(error.messageText, '\n'));
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let parsed = ts.parseJsonConfigFileContent(config, ts.sys, root);
|
|
35
|
+
|
|
36
|
+
if (parsed.errors.length > 0) {
|
|
37
|
+
for (let i = 0, n = parsed.errors.length; i < n; i++) {
|
|
38
|
+
console.error(ts.flattenDiagnosticMessageText(parsed.errors[i].messageText, '\n'));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
await loadTransformers(plugins, root).then((transformers) => {
|
|
45
|
+
let program = ts.createProgram(parsed.fileNames, parsed.options),
|
|
46
|
+
result = program.emit(undefined, undefined, undefined, false, {
|
|
47
|
+
after: transformers.after.map(f => f(program)),
|
|
48
|
+
afterDeclarations: transformers.afterDeclarations.map(f => f(program)) as ts.TransformerFactory<ts.SourceFile | ts.Bundle>[],
|
|
49
|
+
before: transformers.before.map(f => f(program))
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
let diagnostics = ts.getPreEmitDiagnostics(program).concat(result.diagnostics);
|
|
53
|
+
|
|
54
|
+
if (diagnostics.length > 0) {
|
|
55
|
+
console.error(
|
|
56
|
+
ts.formatDiagnosticsWithColorAndContext(diagnostics, {
|
|
57
|
+
getCanonicalFileName: (fileName) => fileName,
|
|
58
|
+
getCurrentDirectory: () => root,
|
|
59
|
+
getNewLine: () => '\n'
|
|
60
|
+
})
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (result.emitSkipped) {
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (shouldRunTscAlias(process.argv.slice(2))) {
|
|
69
|
+
return runTscAlias().then((code) => {
|
|
70
|
+
if (code !== 0) {
|
|
71
|
+
process.exit(code);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
process.exit(0);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
process.exit(0);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function findPackageJson(moduleName: string, root: string): string | null {
|
|
83
|
+
let nodeModulesPath = path.join(root, 'node_modules', moduleName.startsWith('@') ? moduleName.split('/').slice(0, 2).join('/') : moduleName.split('/')[0], 'package.json');
|
|
84
|
+
|
|
85
|
+
if (fs.existsSync(nodeModulesPath)) {
|
|
86
|
+
return nodeModulesPath;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function findTsconfig(args: string[]): string | undefined {
|
|
93
|
+
let projectIndex = args.indexOf('-p');
|
|
94
|
+
|
|
95
|
+
if (projectIndex === -1) {
|
|
96
|
+
projectIndex = args.indexOf('--project');
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (projectIndex !== -1 && args[projectIndex + 1]) {
|
|
100
|
+
return args[projectIndex + 1];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return ts.findConfigFile(process.cwd(), ts.sys.fileExists, 'tsconfig.json');
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function getPlugins(tsconfig: string): PluginConfig[] {
|
|
107
|
+
let { config, error } = ts.readConfigFile(tsconfig, ts.sys.readFile);
|
|
108
|
+
|
|
109
|
+
if (error) {
|
|
110
|
+
return [];
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return config?.compilerOptions?.plugins?.filter(
|
|
114
|
+
(p: unknown) => typeof p === 'object' && p !== null && 'transform' in p
|
|
115
|
+
) ?? [];
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
async function loadTransformers(plugins: PluginConfig[], root: string): Promise<{
|
|
119
|
+
after: TransformerCreator[];
|
|
120
|
+
afterDeclarations: TransformerCreator[];
|
|
121
|
+
before: TransformerCreator[];
|
|
122
|
+
}> {
|
|
123
|
+
let after: TransformerCreator[] = [],
|
|
124
|
+
afterDeclarations: TransformerCreator[] = [],
|
|
125
|
+
before: TransformerCreator[] = [],
|
|
126
|
+
promises: Promise<void>[] = [];
|
|
127
|
+
|
|
128
|
+
for (let i = 0, n = plugins.length; i < n; i++) {
|
|
129
|
+
let plugin = plugins[i];
|
|
130
|
+
|
|
131
|
+
promises.push(
|
|
132
|
+
import(resolvePlugin(plugin.transform, root)).then((module) => {
|
|
133
|
+
let factory = module.default ?? module.createTransformer ?? module;
|
|
134
|
+
|
|
135
|
+
if (typeof factory !== 'function') {
|
|
136
|
+
console.error(`Plugin ${plugin.transform}: no transformer factory found`);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (plugin.afterDeclarations) {
|
|
141
|
+
afterDeclarations.push(factory);
|
|
142
|
+
}
|
|
143
|
+
else if (plugin.after) {
|
|
144
|
+
after.push(factory);
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
before.push(factory);
|
|
148
|
+
}
|
|
149
|
+
})
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return Promise.all(promises).then(() => ({ after, afterDeclarations, before }));
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function main(): void {
|
|
157
|
+
let args = process.argv.slice(2),
|
|
158
|
+
tsconfig = findTsconfig(args);
|
|
159
|
+
|
|
160
|
+
if (!tsconfig) {
|
|
161
|
+
passthrough();
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
let plugins = getPlugins(tsconfig);
|
|
166
|
+
|
|
167
|
+
if (plugins.length === 0) {
|
|
168
|
+
passthrough();
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
console.log(`Found ${plugins.length} transformer plugin(s), using programmatic build...`);
|
|
173
|
+
|
|
174
|
+
build(tsconfig, plugins).catch((err) => {
|
|
175
|
+
console.error(err);
|
|
176
|
+
process.exit(1);
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function passthrough(): void {
|
|
181
|
+
let args = process.argv.slice(2),
|
|
182
|
+
child = spawn(process.execPath, [require.resolve('typescript/lib/tsc.js'), ...args], { stdio: 'inherit' });
|
|
183
|
+
|
|
184
|
+
child.on('exit', (code) => {
|
|
185
|
+
if (code === 0 && shouldRunTscAlias(args)) {
|
|
186
|
+
runTscAlias().then((aliasCode) => process.exit(aliasCode ?? 0));
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
process.exit(code ?? 0);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function resolveExport(exportValue: ExportValue): string | null {
|
|
195
|
+
if (typeof exportValue === 'string') {
|
|
196
|
+
return exportValue;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (exportValue && typeof exportValue === 'object') {
|
|
200
|
+
return exportValue.import ?? exportValue.default ?? null;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function resolvePlugin(modulePath: string, root: string): string {
|
|
207
|
+
if (modulePath.startsWith('.')) {
|
|
208
|
+
return pathToFileURL(path.resolve(root, modulePath)).href;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
let packageJsonPath = findPackageJson(modulePath, root);
|
|
212
|
+
|
|
213
|
+
if (!packageJsonPath) {
|
|
214
|
+
throw new Error(`tsc: cannot find package '${modulePath}' in ${root}`);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
let packageDir = path.dirname(packageJsonPath),
|
|
218
|
+
packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')),
|
|
219
|
+
parts = modulePath.split('/'),
|
|
220
|
+
subpath = './' + (modulePath.startsWith('@') ? parts.slice(2) : parts.slice(1)).join('/');
|
|
221
|
+
|
|
222
|
+
if (packageJson.exports) {
|
|
223
|
+
let exportEntry = subpath === './' ? packageJson.exports['.'] : packageJson.exports[subpath];
|
|
224
|
+
|
|
225
|
+
if (exportEntry) {
|
|
226
|
+
let resolved = resolveExport(exportEntry);
|
|
227
|
+
|
|
228
|
+
if (resolved) {
|
|
229
|
+
return pathToFileURL(path.resolve(packageDir, resolved)).href;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
throw new Error(`tsc: package subpath '${subpath}' is not exported by '${modulePath}'`);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return pathToFileURL(path.resolve(packageDir, packageJson.main ?? 'index.js')).href;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function runTscAlias(): Promise<number> {
|
|
240
|
+
return new Promise((resolve) => {
|
|
241
|
+
let child = spawn(process.execPath, [require.resolve('tsc-alias/dist/bin/index.js'), ...process.argv.slice(2)], { stdio: 'inherit' });
|
|
242
|
+
|
|
243
|
+
child.on('exit', (code) => resolve(code ?? 0));
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function shouldRunTscAlias(args: string[]): boolean {
|
|
248
|
+
for (let i = 0, n = skipFlags.length; i < n; i++) {
|
|
249
|
+
if (args.includes(skipFlags[i])) {
|
|
250
|
+
return false;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return true;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
main();
|
package/bin/tsc-alias
DELETED