ts-checker-rspack-plugin 1.1.7 → 1.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/lib/getDependenciesWorker.js +652 -0
- package/lib/getIssuesWorker.js +1091 -0
- package/lib/index.js +970 -4
- package/lib/plugin-state.d.ts +0 -1
- package/lib/plugin.d.ts +1 -1
- package/lib/rpc/rpc-worker.d.ts +0 -1
- package/lib/rpc/wrap-rpc.d.ts +0 -1
- package/lib/typescript/worker/lib/file-system/file-system.d.ts +0 -1
- package/lib/utils/async/abort-error.d.ts +0 -1
- package/lib/utils/async/pool.d.ts +0 -1
- package/lib/watch/watch-file-system.d.ts +0 -1
- package/package.json +9 -8
- package/lib/files-change.js +0 -57
- package/lib/files-match.js +0 -2
- package/lib/formatter/basic-formatter.js +0 -13
- package/lib/formatter/code-frame-formatter.js +0 -32
- package/lib/formatter/formatter-config.js +0 -36
- package/lib/formatter/formatter-options.js +0 -2
- package/lib/formatter/formatter.js +0 -2
- package/lib/formatter/index.js +0 -22
- package/lib/formatter/stats-formatter.js +0 -30
- package/lib/formatter/types/babel__code-frame.js +0 -7
- package/lib/formatter/webpack-formatter.js +0 -32
- package/lib/hooks/intercept-done-to-get-dev-server-tap.js +0 -18
- package/lib/hooks/tap-after-compile-to-add-dependencies.js +0 -59
- package/lib/hooks/tap-after-compile-to-get-issues.js +0 -43
- package/lib/hooks/tap-after-environment-to-patch-watching.js +0 -22
- package/lib/hooks/tap-done-to-async-get-issues.js +0 -74
- package/lib/hooks/tap-error-to-log-message.js +0 -32
- package/lib/hooks/tap-start-to-run-workers.js +0 -122
- package/lib/hooks/tap-stop-to-terminate-workers.js +0 -26
- package/lib/infrastructure-logger.js +0 -14
- package/lib/issue/index.js +0 -19
- package/lib/issue/issue-config.js +0 -29
- package/lib/issue/issue-location.js +0 -22
- package/lib/issue/issue-match.js +0 -20
- package/lib/issue/issue-options.js +0 -2
- package/lib/issue/issue-position.js +0 -16
- package/lib/issue/issue-predicate.js +0 -11
- package/lib/issue/issue-severity.js +0 -12
- package/lib/issue/issue-webpack-error.js +0 -31
- package/lib/issue/issue.js +0 -41
- package/lib/logger.js +0 -2
- package/lib/plugin-config.js +0 -26
- package/lib/plugin-hooks.js +0 -45
- package/lib/plugin-options.js +0 -2
- package/lib/plugin-pools.js +0 -32
- package/lib/plugin-state.js +0 -17
- package/lib/plugin.js +0 -74
- package/lib/rpc/expose-rpc.js +0 -69
- package/lib/rpc/index.js +0 -12
- package/lib/rpc/rpc-error.js +0 -12
- package/lib/rpc/rpc-worker.js +0 -86
- package/lib/rpc/types.js +0 -2
- package/lib/rpc/wrap-rpc.js +0 -70
- package/lib/typescript/type-script-config-overwrite.js +0 -2
- package/lib/typescript/type-script-diagnostics-options.js +0 -2
- package/lib/typescript/type-script-support.js +0 -31
- package/lib/typescript/type-script-worker-config.js +0 -36
- package/lib/typescript/type-script-worker-options.js +0 -2
- package/lib/typescript/worker/get-dependencies-worker.js +0 -15
- package/lib/typescript/worker/get-issues-worker.js +0 -70
- package/lib/typescript/worker/lib/artifacts.js +0 -94
- package/lib/typescript/worker/lib/config.js +0 -162
- package/lib/typescript/worker/lib/dependencies.js +0 -84
- package/lib/typescript/worker/lib/diagnostics.js +0 -112
- package/lib/typescript/worker/lib/emit.js +0 -13
- package/lib/typescript/worker/lib/file-system/file-system.js +0 -2
- package/lib/typescript/worker/lib/file-system/mem-file-system.js +0 -81
- package/lib/typescript/worker/lib/file-system/passive-file-system.js +0 -68
- package/lib/typescript/worker/lib/file-system/real-file-system.js +0 -171
- package/lib/typescript/worker/lib/host/compiler-host.js +0 -17
- package/lib/typescript/worker/lib/host/watch-compiler-host.js +0 -32
- package/lib/typescript/worker/lib/host/watch-solution-builder-host.js +0 -53
- package/lib/typescript/worker/lib/performance.js +0 -29
- package/lib/typescript/worker/lib/program/program.js +0 -37
- package/lib/typescript/worker/lib/program/solution-builder.js +0 -39
- package/lib/typescript/worker/lib/program/watch-program.js +0 -51
- package/lib/typescript/worker/lib/system.js +0 -229
- package/lib/typescript/worker/lib/tracing.js +0 -27
- package/lib/typescript/worker/lib/tsbuildinfo.js +0 -96
- package/lib/typescript/worker/lib/typescript.js +0 -6
- package/lib/typescript/worker/lib/worker-config.js +0 -5
- package/lib/utils/async/abort-error.js +0 -15
- package/lib/utils/async/controlled-promise.js +0 -17
- package/lib/utils/async/is-pending.js +0 -10
- package/lib/utils/async/pool.js +0 -36
- package/lib/utils/async/wait.js +0 -7
- package/lib/utils/path/forward-slash.js +0 -15
- package/lib/utils/path/is-inside-another-path.js +0 -22
- package/lib/utils/path/relative-to-context.js +0 -16
- package/lib/watch/inclusive-node-watch-file-system.js +0 -183
- package/lib/watch/watch-file-system.js +0 -2
|
@@ -0,0 +1,1091 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: definition[key]
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
(()=>{
|
|
21
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
+
})();
|
|
23
|
+
var __webpack_exports__ = {};
|
|
24
|
+
const external_process_namespaceObject = require("process");
|
|
25
|
+
var external_process_default = /*#__PURE__*/ __webpack_require__.n(external_process_namespaceObject);
|
|
26
|
+
function exposeRpc(fn) {
|
|
27
|
+
const sendMessage = (message)=>new Promise((resolve, reject)=>{
|
|
28
|
+
if (external_process_default().send) if (external_process_default().connected) external_process_default().send(message, void 0, void 0, (error)=>{
|
|
29
|
+
if (error) reject(error);
|
|
30
|
+
else resolve(void 0);
|
|
31
|
+
});
|
|
32
|
+
else reject(new Error(`Process ${external_process_default().pid} doesn't have open IPC channels`));
|
|
33
|
+
else reject(new Error(`Process ${external_process_default().pid} doesn't have IPC channels`));
|
|
34
|
+
});
|
|
35
|
+
const handleMessage = async (message)=>{
|
|
36
|
+
if ('call' === message.type) {
|
|
37
|
+
if (!external_process_default().send) return;
|
|
38
|
+
let value;
|
|
39
|
+
let error;
|
|
40
|
+
try {
|
|
41
|
+
value = await fn(...message.args);
|
|
42
|
+
} catch (fnError) {
|
|
43
|
+
error = fnError;
|
|
44
|
+
}
|
|
45
|
+
try {
|
|
46
|
+
if (error) await sendMessage({
|
|
47
|
+
type: 'reject',
|
|
48
|
+
id: message.id,
|
|
49
|
+
error
|
|
50
|
+
});
|
|
51
|
+
else await sendMessage({
|
|
52
|
+
type: 'resolve',
|
|
53
|
+
id: message.id,
|
|
54
|
+
value
|
|
55
|
+
});
|
|
56
|
+
} catch (sendError) {
|
|
57
|
+
if (error) console.error(error);
|
|
58
|
+
console.error(sendError);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
external_process_default().on('message', handleMessage);
|
|
63
|
+
}
|
|
64
|
+
require("child_process");
|
|
65
|
+
const WORKER_DATA_ENV_KEY = 'WORKER_DATA';
|
|
66
|
+
function getRpcWorkerData() {
|
|
67
|
+
return JSON.parse(external_process_namespaceObject.env[WORKER_DATA_ENV_KEY] || '{}');
|
|
68
|
+
}
|
|
69
|
+
const external_path_namespaceObject = require("path");
|
|
70
|
+
var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
|
|
71
|
+
function forwardSlash(input) {
|
|
72
|
+
return external_path_default().normalize(input).replace(/\\+/g, '/');
|
|
73
|
+
}
|
|
74
|
+
const external_os_namespaceObject = require("os");
|
|
75
|
+
function compareIssuePositions(positionA, positionB) {
|
|
76
|
+
if (positionA === positionB) return 0;
|
|
77
|
+
if (!positionA) return -1;
|
|
78
|
+
if (!positionB) return 1;
|
|
79
|
+
return Math.sign(positionA.line - positionB.line) || Math.sign(positionA.column - positionB.column);
|
|
80
|
+
}
|
|
81
|
+
function compareIssueLocations(locationA, locationB) {
|
|
82
|
+
if (locationA === locationB) return 0;
|
|
83
|
+
if (!locationA) return -1;
|
|
84
|
+
if (!locationB) return 1;
|
|
85
|
+
return compareIssuePositions(locationA.start, locationB.start) || compareIssuePositions(locationA.end, locationB.end);
|
|
86
|
+
}
|
|
87
|
+
function isIssueSeverity(value) {
|
|
88
|
+
return [
|
|
89
|
+
'error',
|
|
90
|
+
'warning'
|
|
91
|
+
].includes(value);
|
|
92
|
+
}
|
|
93
|
+
function compareIssueSeverities(severityA, severityB) {
|
|
94
|
+
const [priorityA, priorityB] = [
|
|
95
|
+
severityA,
|
|
96
|
+
severityB
|
|
97
|
+
].map((severity)=>[
|
|
98
|
+
'warning',
|
|
99
|
+
'error'
|
|
100
|
+
].indexOf(severity));
|
|
101
|
+
return Math.sign(priorityB - priorityA);
|
|
102
|
+
}
|
|
103
|
+
function isIssue(value) {
|
|
104
|
+
return !!value && 'object' == typeof value && isIssueSeverity(value.severity) && !!value.code && !!value.message;
|
|
105
|
+
}
|
|
106
|
+
function compareStrings(stringA, stringB) {
|
|
107
|
+
if (stringA === stringB) return 0;
|
|
108
|
+
if (null == stringA) return -1;
|
|
109
|
+
if (null == stringB) return 1;
|
|
110
|
+
return stringA.toString().localeCompare(stringB.toString());
|
|
111
|
+
}
|
|
112
|
+
function compareIssues(issueA, issueB) {
|
|
113
|
+
return compareIssueSeverities(issueA.severity, issueB.severity) || compareStrings(issueA.file, issueB.file) || compareIssueLocations(issueA.location, issueB.location) || compareStrings(issueA.code, issueB.code) || compareStrings(issueA.message, issueB.message) || 0;
|
|
114
|
+
}
|
|
115
|
+
function equalsIssues(issueA, issueB) {
|
|
116
|
+
return 0 === compareIssues(issueA, issueB);
|
|
117
|
+
}
|
|
118
|
+
function deduplicateAndSortIssues(issues) {
|
|
119
|
+
const sortedIssues = issues.filter(isIssue).sort(compareIssues);
|
|
120
|
+
return sortedIssues.filter((issue, index)=>0 === index || !equalsIssues(issue, sortedIssues[index - 1]));
|
|
121
|
+
}
|
|
122
|
+
const worker_config_config = getRpcWorkerData();
|
|
123
|
+
const typescript = require(worker_config_config.typescriptPath);
|
|
124
|
+
const diagnosticsPerConfigFile = new Map();
|
|
125
|
+
function updateDiagnostics(configFile, diagnostics) {
|
|
126
|
+
diagnosticsPerConfigFile.set(configFile, diagnostics);
|
|
127
|
+
}
|
|
128
|
+
function getIssues() {
|
|
129
|
+
const allDiagnostics = [];
|
|
130
|
+
diagnosticsPerConfigFile.forEach((diagnostics)=>{
|
|
131
|
+
allDiagnostics.push(...diagnostics);
|
|
132
|
+
});
|
|
133
|
+
return createIssuesFromDiagnostics(allDiagnostics);
|
|
134
|
+
}
|
|
135
|
+
function invalidateDiagnostics() {
|
|
136
|
+
diagnosticsPerConfigFile.clear();
|
|
137
|
+
}
|
|
138
|
+
function getDiagnosticsOfProgram(program) {
|
|
139
|
+
const programDiagnostics = [];
|
|
140
|
+
try {
|
|
141
|
+
if (worker_config_config.diagnosticOptions.syntactic) programDiagnostics.push(...program.getSyntacticDiagnostics());
|
|
142
|
+
if (worker_config_config.diagnosticOptions.global) programDiagnostics.push(...program.getGlobalDiagnostics());
|
|
143
|
+
if (worker_config_config.diagnosticOptions.semantic) programDiagnostics.push(...program.getSemanticDiagnostics());
|
|
144
|
+
if (worker_config_config.diagnosticOptions.declaration) programDiagnostics.push(...program.getDeclarationDiagnostics());
|
|
145
|
+
} catch (e) {
|
|
146
|
+
if (e instanceof Error) programDiagnostics.push({
|
|
147
|
+
code: 1,
|
|
148
|
+
category: 1,
|
|
149
|
+
messageText: `TSC compiler crashed: ${e.message}
|
|
150
|
+
${e.stack}`,
|
|
151
|
+
file: void 0,
|
|
152
|
+
start: void 0,
|
|
153
|
+
length: void 0
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
return programDiagnostics;
|
|
157
|
+
}
|
|
158
|
+
function createIssueFromDiagnostic(diagnostic) {
|
|
159
|
+
let file;
|
|
160
|
+
let location;
|
|
161
|
+
if (diagnostic.file) {
|
|
162
|
+
file = diagnostic.file.fileName;
|
|
163
|
+
if (diagnostic.start && diagnostic.length) {
|
|
164
|
+
const { line: startLine, character: startCharacter } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
|
|
165
|
+
const { line: endLine, character: endCharacter } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start + diagnostic.length);
|
|
166
|
+
location = {
|
|
167
|
+
start: {
|
|
168
|
+
line: startLine + 1,
|
|
169
|
+
column: startCharacter + 1
|
|
170
|
+
},
|
|
171
|
+
end: {
|
|
172
|
+
line: endLine + 1,
|
|
173
|
+
column: endCharacter + 1
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
code: 'TS' + String(diagnostic.code),
|
|
180
|
+
severity: 0 === diagnostic.category ? 'warning' : 'error',
|
|
181
|
+
message: typescript.flattenDiagnosticMessageText(diagnostic.messageText, external_os_namespaceObject.EOL),
|
|
182
|
+
file,
|
|
183
|
+
location
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
function createIssuesFromDiagnostics(diagnostics) {
|
|
187
|
+
return deduplicateAndSortIssues(diagnostics.map((diagnostic)=>createIssueFromDiagnostic(diagnostic)));
|
|
188
|
+
}
|
|
189
|
+
const external_memfs_namespaceObject = require("memfs");
|
|
190
|
+
const external_node_fs_namespaceObject = require("node:fs");
|
|
191
|
+
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
192
|
+
const existsCache = new Map();
|
|
193
|
+
const readStatsCache = new Map();
|
|
194
|
+
const readFileCache = new Map();
|
|
195
|
+
const readDirCache = new Map();
|
|
196
|
+
const realPathCache = new Map();
|
|
197
|
+
const realFileSystem = {
|
|
198
|
+
exists (path) {
|
|
199
|
+
return exists(getRealPath(path));
|
|
200
|
+
},
|
|
201
|
+
readFile (path, encoding) {
|
|
202
|
+
return readFile(getRealPath(path), encoding);
|
|
203
|
+
},
|
|
204
|
+
readDir (path) {
|
|
205
|
+
return readDir(getRealPath(path));
|
|
206
|
+
},
|
|
207
|
+
readStats (path) {
|
|
208
|
+
return readStats(getRealPath(path));
|
|
209
|
+
},
|
|
210
|
+
realPath (path) {
|
|
211
|
+
return getRealPath(path);
|
|
212
|
+
},
|
|
213
|
+
normalizePath (path) {
|
|
214
|
+
return (0, external_path_namespaceObject.normalize)(path);
|
|
215
|
+
},
|
|
216
|
+
writeFile (path, data) {
|
|
217
|
+
writeFile(getRealPath(path), data);
|
|
218
|
+
},
|
|
219
|
+
deleteFile (path) {
|
|
220
|
+
deleteFile(getRealPath(path));
|
|
221
|
+
},
|
|
222
|
+
createDir (path) {
|
|
223
|
+
createDir(getRealPath(path));
|
|
224
|
+
},
|
|
225
|
+
updateTimes (path, atime, mtime) {
|
|
226
|
+
updateTimes(getRealPath(path), atime, mtime);
|
|
227
|
+
},
|
|
228
|
+
clearCache () {
|
|
229
|
+
existsCache.clear();
|
|
230
|
+
readStatsCache.clear();
|
|
231
|
+
readFileCache.clear();
|
|
232
|
+
readDirCache.clear();
|
|
233
|
+
realPathCache.clear();
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
function exists(path) {
|
|
237
|
+
const normalizedPath = (0, external_path_namespaceObject.normalize)(path);
|
|
238
|
+
if (!existsCache.has(normalizedPath)) existsCache.set(normalizedPath, external_node_fs_default().existsSync(normalizedPath));
|
|
239
|
+
return !!existsCache.get(normalizedPath);
|
|
240
|
+
}
|
|
241
|
+
function readStats(path) {
|
|
242
|
+
const normalizedPath = (0, external_path_namespaceObject.normalize)(path);
|
|
243
|
+
if (!readStatsCache.has(normalizedPath)) {
|
|
244
|
+
if (exists(normalizedPath)) readStatsCache.set(normalizedPath, external_node_fs_default().statSync(normalizedPath));
|
|
245
|
+
}
|
|
246
|
+
return readStatsCache.get(normalizedPath);
|
|
247
|
+
}
|
|
248
|
+
function readFile(path, encoding) {
|
|
249
|
+
const normalizedPath = (0, external_path_namespaceObject.normalize)(path);
|
|
250
|
+
if (!readFileCache.has(normalizedPath)) {
|
|
251
|
+
const stats = readStats(normalizedPath);
|
|
252
|
+
if (stats && stats.isFile()) readFileCache.set(normalizedPath, external_node_fs_default().readFileSync(normalizedPath, {
|
|
253
|
+
encoding: encoding
|
|
254
|
+
}).toString());
|
|
255
|
+
else readFileCache.set(normalizedPath, void 0);
|
|
256
|
+
}
|
|
257
|
+
return readFileCache.get(normalizedPath);
|
|
258
|
+
}
|
|
259
|
+
function readDir(path) {
|
|
260
|
+
const normalizedPath = (0, external_path_namespaceObject.normalize)(path);
|
|
261
|
+
if (!readDirCache.has(normalizedPath)) {
|
|
262
|
+
const stats = readStats(normalizedPath);
|
|
263
|
+
if (stats && stats.isDirectory()) readDirCache.set(normalizedPath, external_node_fs_default().readdirSync(normalizedPath, {
|
|
264
|
+
withFileTypes: true
|
|
265
|
+
}));
|
|
266
|
+
else readDirCache.set(normalizedPath, []);
|
|
267
|
+
}
|
|
268
|
+
return readDirCache.get(normalizedPath) || [];
|
|
269
|
+
}
|
|
270
|
+
function getRealPath(path) {
|
|
271
|
+
const normalizedPath = (0, external_path_namespaceObject.normalize)(path);
|
|
272
|
+
if (!realPathCache.has(normalizedPath)) {
|
|
273
|
+
let base = normalizedPath;
|
|
274
|
+
let nested = '';
|
|
275
|
+
while(base !== (0, external_path_namespaceObject.dirname)(base)){
|
|
276
|
+
if (exists(base)) {
|
|
277
|
+
realPathCache.set(normalizedPath, (0, external_path_namespaceObject.normalize)((0, external_path_namespaceObject.join)(external_node_fs_default().realpathSync(base), nested)));
|
|
278
|
+
break;
|
|
279
|
+
}
|
|
280
|
+
nested = (0, external_path_namespaceObject.join)((0, external_path_namespaceObject.basename)(base), nested);
|
|
281
|
+
base = (0, external_path_namespaceObject.dirname)(base);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
return realPathCache.get(normalizedPath) || normalizedPath;
|
|
285
|
+
}
|
|
286
|
+
function createDir(path) {
|
|
287
|
+
const normalizedPath = (0, external_path_namespaceObject.normalize)(path);
|
|
288
|
+
external_node_fs_default().mkdirSync(normalizedPath, {
|
|
289
|
+
recursive: true
|
|
290
|
+
});
|
|
291
|
+
existsCache.set(normalizedPath, true);
|
|
292
|
+
if (readDirCache.has((0, external_path_namespaceObject.dirname)(normalizedPath))) readDirCache.delete((0, external_path_namespaceObject.dirname)(normalizedPath));
|
|
293
|
+
if (readStatsCache.has(normalizedPath)) readStatsCache.delete(normalizedPath);
|
|
294
|
+
}
|
|
295
|
+
function writeFile(path, data) {
|
|
296
|
+
const normalizedPath = (0, external_path_namespaceObject.normalize)(path);
|
|
297
|
+
if (!exists((0, external_path_namespaceObject.dirname)(normalizedPath))) createDir((0, external_path_namespaceObject.dirname)(normalizedPath));
|
|
298
|
+
external_node_fs_default().writeFileSync(normalizedPath, data);
|
|
299
|
+
existsCache.set(normalizedPath, true);
|
|
300
|
+
if (readDirCache.has((0, external_path_namespaceObject.dirname)(normalizedPath))) readDirCache.delete((0, external_path_namespaceObject.dirname)(normalizedPath));
|
|
301
|
+
if (readStatsCache.has(normalizedPath)) readStatsCache.delete(normalizedPath);
|
|
302
|
+
if (readFileCache.has(normalizedPath)) readFileCache.delete(normalizedPath);
|
|
303
|
+
}
|
|
304
|
+
function deleteFile(path) {
|
|
305
|
+
if (exists(path)) {
|
|
306
|
+
const normalizedPath = (0, external_path_namespaceObject.normalize)(path);
|
|
307
|
+
external_node_fs_default().unlinkSync(normalizedPath);
|
|
308
|
+
existsCache.set(normalizedPath, false);
|
|
309
|
+
if (readDirCache.has((0, external_path_namespaceObject.dirname)(normalizedPath))) readDirCache.delete((0, external_path_namespaceObject.dirname)(normalizedPath));
|
|
310
|
+
if (readStatsCache.has(normalizedPath)) readStatsCache.delete(normalizedPath);
|
|
311
|
+
if (readFileCache.has(normalizedPath)) readFileCache.delete(normalizedPath);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
function updateTimes(path, atime, mtime) {
|
|
315
|
+
if (exists(path)) {
|
|
316
|
+
const normalizedPath = (0, external_path_namespaceObject.normalize)(path);
|
|
317
|
+
external_node_fs_default().utimesSync((0, external_path_namespaceObject.normalize)(path), atime, mtime);
|
|
318
|
+
if (readStatsCache.has(normalizedPath)) readStatsCache.delete(normalizedPath);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
const memFileSystem = {
|
|
322
|
+
...realFileSystem,
|
|
323
|
+
exists (path) {
|
|
324
|
+
return mem_file_system_exists(realFileSystem.realPath(path));
|
|
325
|
+
},
|
|
326
|
+
readFile (path, encoding) {
|
|
327
|
+
return mem_file_system_readFile(realFileSystem.realPath(path), encoding);
|
|
328
|
+
},
|
|
329
|
+
readDir (path) {
|
|
330
|
+
return mem_file_system_readDir(realFileSystem.realPath(path));
|
|
331
|
+
},
|
|
332
|
+
readStats (path) {
|
|
333
|
+
return mem_file_system_readStats(realFileSystem.realPath(path));
|
|
334
|
+
},
|
|
335
|
+
writeFile (path, data) {
|
|
336
|
+
mem_file_system_writeFile(realFileSystem.realPath(path), data);
|
|
337
|
+
},
|
|
338
|
+
deleteFile (path) {
|
|
339
|
+
mem_file_system_deleteFile(realFileSystem.realPath(path));
|
|
340
|
+
},
|
|
341
|
+
createDir (path) {
|
|
342
|
+
mem_file_system_createDir(realFileSystem.realPath(path));
|
|
343
|
+
},
|
|
344
|
+
updateTimes (path, atime, mtime) {
|
|
345
|
+
mem_file_system_updateTimes(realFileSystem.realPath(path), atime, mtime);
|
|
346
|
+
},
|
|
347
|
+
clearCache () {
|
|
348
|
+
realFileSystem.clearCache();
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
function mem_file_system_exists(path) {
|
|
352
|
+
return external_memfs_namespaceObject.fs.existsSync(realFileSystem.normalizePath(path));
|
|
353
|
+
}
|
|
354
|
+
function mem_file_system_readStats(path) {
|
|
355
|
+
return mem_file_system_exists(path) ? external_memfs_namespaceObject.fs.statSync(realFileSystem.normalizePath(path)) : void 0;
|
|
356
|
+
}
|
|
357
|
+
function mem_file_system_readFile(path, encoding) {
|
|
358
|
+
const stats = mem_file_system_readStats(path);
|
|
359
|
+
if (stats && stats.isFile()) return external_memfs_namespaceObject.fs.readFileSync(realFileSystem.normalizePath(path), {
|
|
360
|
+
encoding: encoding
|
|
361
|
+
}).toString();
|
|
362
|
+
}
|
|
363
|
+
function mem_file_system_readDir(path) {
|
|
364
|
+
const stats = mem_file_system_readStats(path);
|
|
365
|
+
if (stats && stats.isDirectory()) return external_memfs_namespaceObject.fs.readdirSync(realFileSystem.normalizePath(path), {
|
|
366
|
+
withFileTypes: true
|
|
367
|
+
});
|
|
368
|
+
return [];
|
|
369
|
+
}
|
|
370
|
+
function mem_file_system_createDir(path) {
|
|
371
|
+
external_memfs_namespaceObject.fs.mkdirSync(realFileSystem.normalizePath(path), {
|
|
372
|
+
recursive: true
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
function mem_file_system_writeFile(path, data) {
|
|
376
|
+
if (!mem_file_system_exists((0, external_path_namespaceObject.dirname)(path))) mem_file_system_createDir((0, external_path_namespaceObject.dirname)(path));
|
|
377
|
+
external_memfs_namespaceObject.fs.writeFileSync(realFileSystem.normalizePath(path), data);
|
|
378
|
+
}
|
|
379
|
+
function mem_file_system_deleteFile(path) {
|
|
380
|
+
if (mem_file_system_exists(path)) external_memfs_namespaceObject.fs.unlinkSync(realFileSystem.normalizePath(path));
|
|
381
|
+
}
|
|
382
|
+
function mem_file_system_updateTimes(path, atime, mtime) {
|
|
383
|
+
if (mem_file_system_exists(path)) external_memfs_namespaceObject.fs.utimesSync(realFileSystem.normalizePath(path), atime, mtime);
|
|
384
|
+
}
|
|
385
|
+
const passiveFileSystem = {
|
|
386
|
+
...memFileSystem,
|
|
387
|
+
exists (path) {
|
|
388
|
+
return passive_file_system_exists(realFileSystem.realPath(path));
|
|
389
|
+
},
|
|
390
|
+
readFile (path, encoding) {
|
|
391
|
+
return passive_file_system_readFile(realFileSystem.realPath(path), encoding);
|
|
392
|
+
},
|
|
393
|
+
readDir (path) {
|
|
394
|
+
return passive_file_system_readDir(realFileSystem.realPath(path));
|
|
395
|
+
},
|
|
396
|
+
readStats (path) {
|
|
397
|
+
return passive_file_system_readStats(realFileSystem.realPath(path));
|
|
398
|
+
},
|
|
399
|
+
realPath (path) {
|
|
400
|
+
return realFileSystem.realPath(path);
|
|
401
|
+
},
|
|
402
|
+
clearCache () {
|
|
403
|
+
realFileSystem.clearCache();
|
|
404
|
+
}
|
|
405
|
+
};
|
|
406
|
+
function passive_file_system_exists(path) {
|
|
407
|
+
return realFileSystem.exists(path) || memFileSystem.exists(path);
|
|
408
|
+
}
|
|
409
|
+
function passive_file_system_readFile(path, encoding) {
|
|
410
|
+
const fsStats = realFileSystem.readStats(path);
|
|
411
|
+
const memStats = memFileSystem.readStats(path);
|
|
412
|
+
if (fsStats && memStats) return fsStats.mtimeMs > memStats.mtimeMs ? realFileSystem.readFile(path, encoding) : memFileSystem.readFile(path, encoding);
|
|
413
|
+
if (fsStats) return realFileSystem.readFile(path, encoding);
|
|
414
|
+
if (memStats) return memFileSystem.readFile(path, encoding);
|
|
415
|
+
}
|
|
416
|
+
function passive_file_system_readDir(path) {
|
|
417
|
+
const fsDirents = realFileSystem.readDir(path);
|
|
418
|
+
const memDirents = memFileSystem.readDir(path);
|
|
419
|
+
return fsDirents.filter((fsDirent)=>!memDirents.some((memDirent)=>memDirent.name === fsDirent.name)).concat(memDirents);
|
|
420
|
+
}
|
|
421
|
+
function passive_file_system_readStats(path) {
|
|
422
|
+
const fsStats = realFileSystem.readStats(path);
|
|
423
|
+
const memStats = memFileSystem.readStats(path);
|
|
424
|
+
if (fsStats && memStats) return fsStats.mtimeMs > memStats.mtimeMs ? fsStats : memStats;
|
|
425
|
+
if (fsStats) return fsStats;
|
|
426
|
+
if (memStats) return memStats;
|
|
427
|
+
}
|
|
428
|
+
const mode = worker_config_config.mode;
|
|
429
|
+
let artifacts = {
|
|
430
|
+
files: [],
|
|
431
|
+
dirs: [],
|
|
432
|
+
excluded: [],
|
|
433
|
+
extensions: []
|
|
434
|
+
};
|
|
435
|
+
let isInitialRun = true;
|
|
436
|
+
const fileWatcherCallbacksMap = new Map();
|
|
437
|
+
const directoryWatcherCallbacksMap = new Map();
|
|
438
|
+
const recursiveDirectoryWatcherCallbacksMap = new Map();
|
|
439
|
+
const system_deletedFiles = new Map();
|
|
440
|
+
const timeoutCallbacks = new Set();
|
|
441
|
+
const ignoredPaths = [
|
|
442
|
+
'/node_modules/.',
|
|
443
|
+
'/.git',
|
|
444
|
+
'/.#'
|
|
445
|
+
];
|
|
446
|
+
const system = {
|
|
447
|
+
...typescript.sys,
|
|
448
|
+
useCaseSensitiveFileNames: true,
|
|
449
|
+
realpath (path) {
|
|
450
|
+
return getReadFileSystem(path).realPath(path);
|
|
451
|
+
},
|
|
452
|
+
fileExists (path) {
|
|
453
|
+
const stats = getReadFileSystem(path).readStats(path);
|
|
454
|
+
return !!stats && stats.isFile();
|
|
455
|
+
},
|
|
456
|
+
readFile (path, encoding) {
|
|
457
|
+
return getReadFileSystem(path).readFile(path, encoding);
|
|
458
|
+
},
|
|
459
|
+
getFileSize (path) {
|
|
460
|
+
const stats = getReadFileSystem(path).readStats(path);
|
|
461
|
+
return stats ? stats.size : 0;
|
|
462
|
+
},
|
|
463
|
+
writeFile (path, data) {
|
|
464
|
+
getWriteFileSystem(path).writeFile(path, data);
|
|
465
|
+
system.invokeFileChanged(path);
|
|
466
|
+
},
|
|
467
|
+
deleteFile (path) {
|
|
468
|
+
getWriteFileSystem(path).deleteFile(path);
|
|
469
|
+
system.invokeFileDeleted(path);
|
|
470
|
+
},
|
|
471
|
+
directoryExists (path) {
|
|
472
|
+
return Boolean(getReadFileSystem(path).readStats(path)?.isDirectory());
|
|
473
|
+
},
|
|
474
|
+
createDirectory (path) {
|
|
475
|
+
getWriteFileSystem(path).createDir(path);
|
|
476
|
+
invokeDirectoryWatchers(path);
|
|
477
|
+
},
|
|
478
|
+
getDirectories (path) {
|
|
479
|
+
const dirents = getReadFileSystem(path).readDir(path);
|
|
480
|
+
return dirents.filter((dirent)=>dirent.isDirectory() || dirent.isSymbolicLink() && system.directoryExists((0, external_path_namespaceObject.join)(path, dirent.name))).map((dirent)=>dirent.name);
|
|
481
|
+
},
|
|
482
|
+
getModifiedTime (path) {
|
|
483
|
+
if (void 0 === path) return;
|
|
484
|
+
const stats = getReadFileSystem(path).readStats(path);
|
|
485
|
+
if (stats) return stats.mtime;
|
|
486
|
+
},
|
|
487
|
+
setModifiedTime (path, date) {
|
|
488
|
+
getWriteFileSystem(path).updateTimes(path, date, date);
|
|
489
|
+
invokeDirectoryWatchers(path);
|
|
490
|
+
invokeFileWatchers(path, typescript.FileWatcherEventKind.Changed);
|
|
491
|
+
},
|
|
492
|
+
watchFile (path, callback) {
|
|
493
|
+
return createWatcher(fileWatcherCallbacksMap, path, callback);
|
|
494
|
+
},
|
|
495
|
+
watchDirectory (path, callback, recursive = false) {
|
|
496
|
+
return createWatcher(recursive ? recursiveDirectoryWatcherCallbacksMap : directoryWatcherCallbacksMap, path, callback);
|
|
497
|
+
},
|
|
498
|
+
setTimeout: (callback, timeout, ...args)=>{
|
|
499
|
+
const timeoutId = setImmediate(()=>{
|
|
500
|
+
callback(...args);
|
|
501
|
+
timeoutCallbacks.delete(timeoutId);
|
|
502
|
+
});
|
|
503
|
+
timeoutCallbacks.add(timeoutId);
|
|
504
|
+
return timeoutId;
|
|
505
|
+
},
|
|
506
|
+
clearTimeout: (timeoutId)=>{
|
|
507
|
+
clearImmediate(timeoutId);
|
|
508
|
+
timeoutCallbacks.delete(timeoutId);
|
|
509
|
+
},
|
|
510
|
+
async waitForQueued () {
|
|
511
|
+
while(timeoutCallbacks.size > 0)await new Promise((resolve)=>setImmediate(resolve));
|
|
512
|
+
isInitialRun = false;
|
|
513
|
+
},
|
|
514
|
+
invokeFileCreated (path) {
|
|
515
|
+
const normalizedPath = normalizeAndResolvePath(path);
|
|
516
|
+
invokeFileWatchers(path, typescript.FileWatcherEventKind.Created);
|
|
517
|
+
invokeDirectoryWatchers(normalizedPath);
|
|
518
|
+
system_deletedFiles.set(normalizedPath, false);
|
|
519
|
+
},
|
|
520
|
+
invokeFileChanged (path) {
|
|
521
|
+
const normalizedPath = normalizeAndResolvePath(path);
|
|
522
|
+
if (system_deletedFiles.get(normalizedPath) || !fileWatcherCallbacksMap.has(normalizedPath)) {
|
|
523
|
+
invokeFileWatchers(path, typescript.FileWatcherEventKind.Created);
|
|
524
|
+
invokeDirectoryWatchers(normalizedPath);
|
|
525
|
+
system_deletedFiles.set(normalizedPath, false);
|
|
526
|
+
} else invokeFileWatchers(path, typescript.FileWatcherEventKind.Changed);
|
|
527
|
+
},
|
|
528
|
+
invokeFileDeleted (path) {
|
|
529
|
+
const normalizedPath = normalizeAndResolvePath(path);
|
|
530
|
+
if (!system_deletedFiles.get(normalizedPath)) {
|
|
531
|
+
invokeFileWatchers(path, typescript.FileWatcherEventKind.Deleted);
|
|
532
|
+
invokeDirectoryWatchers(path);
|
|
533
|
+
system_deletedFiles.set(normalizedPath, true);
|
|
534
|
+
}
|
|
535
|
+
},
|
|
536
|
+
invalidateCache () {
|
|
537
|
+
realFileSystem.clearCache();
|
|
538
|
+
memFileSystem.clearCache();
|
|
539
|
+
passiveFileSystem.clearCache();
|
|
540
|
+
},
|
|
541
|
+
setArtifacts (nextArtifacts) {
|
|
542
|
+
artifacts = nextArtifacts;
|
|
543
|
+
}
|
|
544
|
+
};
|
|
545
|
+
function createWatcher(watchersMap, path, callback) {
|
|
546
|
+
const normalizedPath = normalizeAndResolvePath(path);
|
|
547
|
+
const watchers = watchersMap.get(normalizedPath) || [];
|
|
548
|
+
const nextWatchers = [
|
|
549
|
+
...watchers,
|
|
550
|
+
callback
|
|
551
|
+
];
|
|
552
|
+
watchersMap.set(normalizedPath, nextWatchers);
|
|
553
|
+
return {
|
|
554
|
+
close: ()=>{
|
|
555
|
+
const watchers = watchersMap.get(normalizedPath) || [];
|
|
556
|
+
const nextWatchers = watchers.filter((watcher)=>watcher !== callback);
|
|
557
|
+
if (nextWatchers.length > 0) watchersMap.set(normalizedPath, nextWatchers);
|
|
558
|
+
else watchersMap.delete(normalizedPath);
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
function invokeFileWatchers(path, event) {
|
|
563
|
+
const normalizedPath = normalizeAndResolvePath(path);
|
|
564
|
+
if (normalizedPath.endsWith('.js')) invokeFileWatchers(normalizedPath.slice(0, -3) + '.d.ts', event);
|
|
565
|
+
const fileWatcherCallbacks = fileWatcherCallbacksMap.get(normalizedPath);
|
|
566
|
+
if (fileWatcherCallbacks) fileWatcherCallbacks.forEach((fileWatcherCallback)=>fileWatcherCallback(forwardSlash(normalizedPath), event));
|
|
567
|
+
}
|
|
568
|
+
function invokeDirectoryWatchers(path) {
|
|
569
|
+
const normalizedPath = normalizeAndResolvePath(path);
|
|
570
|
+
const directory = (0, external_path_namespaceObject.dirname)(normalizedPath);
|
|
571
|
+
if (ignoredPaths.some((ignoredPath)=>forwardSlash(normalizedPath).includes(ignoredPath))) return;
|
|
572
|
+
const directoryWatcherCallbacks = directoryWatcherCallbacksMap.get(directory);
|
|
573
|
+
if (directoryWatcherCallbacks) directoryWatcherCallbacks.forEach((directoryWatcherCallback)=>directoryWatcherCallback(forwardSlash(normalizedPath)));
|
|
574
|
+
recursiveDirectoryWatcherCallbacksMap.forEach((recursiveDirectoryWatcherCallbacks, watchedDirectory)=>{
|
|
575
|
+
if (watchedDirectory === directory || directory.startsWith(watchedDirectory) && '/' === forwardSlash(directory)[watchedDirectory.length]) recursiveDirectoryWatcherCallbacks.forEach((recursiveDirectoryWatcherCallback)=>recursiveDirectoryWatcherCallback(forwardSlash(normalizedPath)));
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
function normalizeAndResolvePath(path) {
|
|
579
|
+
let normalizedPath = realFileSystem.normalizePath(path);
|
|
580
|
+
try {
|
|
581
|
+
normalizedPath = realFileSystem.realPath(normalizedPath);
|
|
582
|
+
} catch (error) {}
|
|
583
|
+
return normalizedPath;
|
|
584
|
+
}
|
|
585
|
+
function isArtifact(path) {
|
|
586
|
+
return (artifacts.dirs.some((dir)=>path.includes(dir)) || artifacts.files.some((file)=>path === file)) && artifacts.extensions.some((extension)=>path.endsWith(extension));
|
|
587
|
+
}
|
|
588
|
+
function getReadFileSystem(path) {
|
|
589
|
+
if (('readonly' === mode || 'write-tsbuildinfo' === mode) && isArtifact(path)) {
|
|
590
|
+
if (isInitialRun && !memFileSystem.exists(path) && passiveFileSystem.exists(path)) {
|
|
591
|
+
const stats = passiveFileSystem.readStats(path);
|
|
592
|
+
if (stats?.isFile()) {
|
|
593
|
+
const content = passiveFileSystem.readFile(path);
|
|
594
|
+
if (content) {
|
|
595
|
+
memFileSystem.writeFile(path, content);
|
|
596
|
+
memFileSystem.updateTimes(path, stats.atime, stats.mtime);
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
return memFileSystem;
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
return passiveFileSystem;
|
|
603
|
+
}
|
|
604
|
+
function getWriteFileSystem(path) {
|
|
605
|
+
if ('write-references' === mode || 'write-tsbuildinfo' === mode && path.endsWith('.tsbuildinfo') || 'write-dts' === mode && [
|
|
606
|
+
'.tsbuildinfo',
|
|
607
|
+
'.d.ts',
|
|
608
|
+
'.d.ts.map'
|
|
609
|
+
].some((suffix)=>path.endsWith(suffix))) return realFileSystem;
|
|
610
|
+
return passiveFileSystem;
|
|
611
|
+
}
|
|
612
|
+
let config_parsedConfig;
|
|
613
|
+
let parseConfigDiagnostics = [];
|
|
614
|
+
const parseConfigFileHost = {
|
|
615
|
+
...system,
|
|
616
|
+
onUnRecoverableConfigFileDiagnostic: (diagnostic)=>{
|
|
617
|
+
parseConfigDiagnostics.push(diagnostic);
|
|
618
|
+
}
|
|
619
|
+
};
|
|
620
|
+
function getUserProvidedConfigOverwrite() {
|
|
621
|
+
return worker_config_config.configOverwrite || {};
|
|
622
|
+
}
|
|
623
|
+
function getImplicitConfigOverwrite() {
|
|
624
|
+
const baseCompilerOptionsOverwrite = {
|
|
625
|
+
skipLibCheck: true,
|
|
626
|
+
sourceMap: false,
|
|
627
|
+
inlineSourceMap: false
|
|
628
|
+
};
|
|
629
|
+
switch(worker_config_config.mode){
|
|
630
|
+
case 'write-dts':
|
|
631
|
+
return {
|
|
632
|
+
compilerOptions: {
|
|
633
|
+
...baseCompilerOptionsOverwrite,
|
|
634
|
+
declaration: true,
|
|
635
|
+
emitDeclarationOnly: true,
|
|
636
|
+
noEmit: false
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
case 'write-tsbuildinfo':
|
|
640
|
+
case 'write-references':
|
|
641
|
+
return {
|
|
642
|
+
compilerOptions: {
|
|
643
|
+
...baseCompilerOptionsOverwrite,
|
|
644
|
+
declaration: true,
|
|
645
|
+
emitDeclarationOnly: false,
|
|
646
|
+
noEmit: false
|
|
647
|
+
}
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
return {
|
|
651
|
+
compilerOptions: baseCompilerOptionsOverwrite
|
|
652
|
+
};
|
|
653
|
+
}
|
|
654
|
+
function applyConfigOverwrite(baseConfig, ...overwriteConfigs) {
|
|
655
|
+
let config = baseConfig;
|
|
656
|
+
for (const overwriteConfig of overwriteConfigs)config = {
|
|
657
|
+
...config || {},
|
|
658
|
+
...overwriteConfig || {},
|
|
659
|
+
compilerOptions: {
|
|
660
|
+
...config?.compilerOptions || {},
|
|
661
|
+
...overwriteConfig?.compilerOptions || {}
|
|
662
|
+
}
|
|
663
|
+
};
|
|
664
|
+
return config;
|
|
665
|
+
}
|
|
666
|
+
function parseConfig(configFileName, configFileContext) {
|
|
667
|
+
const configFilePath = forwardSlash(configFileName);
|
|
668
|
+
const { config: baseConfig, error: readConfigError } = typescript.readConfigFile(configFilePath, parseConfigFileHost.readFile);
|
|
669
|
+
const overwrittenConfig = applyConfigOverwrite(baseConfig || {}, getImplicitConfigOverwrite(), getUserProvidedConfigOverwrite());
|
|
670
|
+
const parsedConfigFile = typescript.parseJsonConfigFileContent(overwrittenConfig, parseConfigFileHost, configFileContext);
|
|
671
|
+
return {
|
|
672
|
+
...parsedConfigFile,
|
|
673
|
+
options: {
|
|
674
|
+
...parsedConfigFile.options,
|
|
675
|
+
configFilePath: configFilePath
|
|
676
|
+
},
|
|
677
|
+
errors: readConfigError ? [
|
|
678
|
+
readConfigError
|
|
679
|
+
] : parsedConfigFile.errors
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
function getParseConfigIssues() {
|
|
683
|
+
const issues = createIssuesFromDiagnostics(parseConfigDiagnostics);
|
|
684
|
+
issues.forEach((issue)=>{
|
|
685
|
+
if (!issue.file) issue.file = worker_config_config.configFile;
|
|
686
|
+
});
|
|
687
|
+
return issues;
|
|
688
|
+
}
|
|
689
|
+
function getParsedConfig(force = false) {
|
|
690
|
+
if (!config_parsedConfig || force) {
|
|
691
|
+
config_parsedConfig = parseConfig(worker_config_config.configFile, worker_config_config.context);
|
|
692
|
+
parseConfigDiagnostics = config_parsedConfig.errors || [];
|
|
693
|
+
}
|
|
694
|
+
return config_parsedConfig;
|
|
695
|
+
}
|
|
696
|
+
function parseNextConfig() {
|
|
697
|
+
const prevParsedConfig = config_parsedConfig;
|
|
698
|
+
const nextParsedConfig = getParsedConfig(true);
|
|
699
|
+
return [
|
|
700
|
+
prevParsedConfig,
|
|
701
|
+
nextParsedConfig
|
|
702
|
+
];
|
|
703
|
+
}
|
|
704
|
+
function invalidateConfig() {
|
|
705
|
+
config_parsedConfig = void 0;
|
|
706
|
+
parseConfigDiagnostics = [];
|
|
707
|
+
}
|
|
708
|
+
function getConfigFilePathFromCompilerOptions(compilerOptions) {
|
|
709
|
+
return compilerOptions.configFilePath;
|
|
710
|
+
}
|
|
711
|
+
function getConfigFilePathFromProgram(program) {
|
|
712
|
+
return getConfigFilePathFromCompilerOptions(program.getCompilerOptions());
|
|
713
|
+
}
|
|
714
|
+
function getConfigFilePathFromBuilderProgram(builderProgram) {
|
|
715
|
+
return getConfigFilePathFromCompilerOptions(builderProgram.getProgram().getCompilerOptions());
|
|
716
|
+
}
|
|
717
|
+
function didConfigFileChanged({ changedFiles = [], deletedFiles = [] }) {
|
|
718
|
+
return [
|
|
719
|
+
...changedFiles,
|
|
720
|
+
...deletedFiles
|
|
721
|
+
].map((file)=>external_path_namespaceObject.normalize(file)).includes(external_path_namespaceObject.normalize(worker_config_config.configFile));
|
|
722
|
+
}
|
|
723
|
+
function didDependenciesProbablyChanged(dependencies, { changedFiles = [], deletedFiles = [] }) {
|
|
724
|
+
const didSomeDependencyHasBeenAdded = changedFiles.some((changeFile)=>!dependencies.files.includes(changeFile));
|
|
725
|
+
const didSomeDependencyHasBeenDeleted = deletedFiles.some((deletedFile)=>dependencies.files.includes(deletedFile));
|
|
726
|
+
return didSomeDependencyHasBeenAdded || didSomeDependencyHasBeenDeleted;
|
|
727
|
+
}
|
|
728
|
+
function didRootFilesChanged() {
|
|
729
|
+
const [prevConfig, nextConfig] = parseNextConfig();
|
|
730
|
+
return prevConfig && JSON.stringify(prevConfig.fileNames) !== JSON.stringify(nextConfig.fileNames);
|
|
731
|
+
}
|
|
732
|
+
function invalidateTsBuildInfo() {
|
|
733
|
+
const parsedConfig = getParsedConfig();
|
|
734
|
+
if ('function' == typeof typescript.getTsBuildInfoEmitOutputFilePath && 'readonly' !== worker_config_config.mode && parsedConfig.options.incremental) {
|
|
735
|
+
const tsBuildInfoPath = typescript.getTsBuildInfoEmitOutputFilePath(parsedConfig.options);
|
|
736
|
+
if (tsBuildInfoPath) try {
|
|
737
|
+
system.deleteFile(tsBuildInfoPath);
|
|
738
|
+
} catch (error) {}
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
function emitTsBuildInfoIfNeeded(builderProgram) {
|
|
742
|
+
const parsedConfig = getParsedConfig();
|
|
743
|
+
if ('readonly' !== worker_config_config.mode && parsedConfig && isIncrementalEnabled(parsedConfig.options)) {
|
|
744
|
+
const program = builderProgram.getProgram();
|
|
745
|
+
if ('function' == typeof program.emitBuildInfo) program.emitBuildInfo();
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
function getTsBuildInfoEmitPath(compilerOptions) {
|
|
749
|
+
if ('function' == typeof typescript.getTsBuildInfoEmitOutputFilePath) return typescript.getTsBuildInfoEmitOutputFilePath(compilerOptions);
|
|
750
|
+
const removeJsonExtension = (filePath)=>filePath.endsWith('.json') ? filePath.slice(0, -5) : filePath;
|
|
751
|
+
const configFile = compilerOptions.configFilePath;
|
|
752
|
+
if (!isIncrementalEnabled(compilerOptions)) return;
|
|
753
|
+
if (compilerOptions.tsBuildInfoFile) return compilerOptions.tsBuildInfoFile;
|
|
754
|
+
const outPath = compilerOptions.outFile || compilerOptions.out;
|
|
755
|
+
let buildInfoExtensionLess;
|
|
756
|
+
if (outPath) buildInfoExtensionLess = removeJsonExtension(outPath);
|
|
757
|
+
else {
|
|
758
|
+
if (!configFile) return;
|
|
759
|
+
const configFileExtensionLess = removeJsonExtension(configFile);
|
|
760
|
+
buildInfoExtensionLess = compilerOptions.outDir ? compilerOptions.rootDir ? external_path_namespaceObject.resolve(compilerOptions.outDir, external_path_namespaceObject.relative(compilerOptions.rootDir, configFileExtensionLess)) : external_path_namespaceObject.resolve(compilerOptions.outDir, external_path_namespaceObject.basename(configFileExtensionLess)) : configFileExtensionLess;
|
|
761
|
+
}
|
|
762
|
+
return buildInfoExtensionLess + '.tsbuildinfo';
|
|
763
|
+
}
|
|
764
|
+
function isIncrementalEnabled(compilerOptions) {
|
|
765
|
+
return Boolean((compilerOptions.incremental || compilerOptions.composite) && !compilerOptions.outFile);
|
|
766
|
+
}
|
|
767
|
+
let artifacts_artifacts;
|
|
768
|
+
function getArtifacts(force = false) {
|
|
769
|
+
if (!artifacts_artifacts || force) {
|
|
770
|
+
const parsedConfig = getParsedConfig();
|
|
771
|
+
artifacts_artifacts = getArtifactsWorker(parsedConfig, worker_config_config.context);
|
|
772
|
+
}
|
|
773
|
+
return artifacts_artifacts;
|
|
774
|
+
}
|
|
775
|
+
function invalidateArtifacts() {
|
|
776
|
+
artifacts_artifacts = void 0;
|
|
777
|
+
}
|
|
778
|
+
function registerArtifacts() {
|
|
779
|
+
system.setArtifacts(getArtifacts());
|
|
780
|
+
}
|
|
781
|
+
function getArtifactsWorker(parsedConfig, configFileContext, processedConfigFiles = []) {
|
|
782
|
+
const files = new Set();
|
|
783
|
+
const dirs = new Set();
|
|
784
|
+
if (parsedConfig.fileNames.length > 0) {
|
|
785
|
+
if (parsedConfig.options.outFile) files.add(external_path_namespaceObject.resolve(configFileContext, parsedConfig.options.outFile));
|
|
786
|
+
const tsBuildInfoPath = getTsBuildInfoEmitPath(parsedConfig.options);
|
|
787
|
+
if (tsBuildInfoPath) files.add(external_path_namespaceObject.resolve(configFileContext, tsBuildInfoPath));
|
|
788
|
+
if (parsedConfig.options.outDir) dirs.add(external_path_namespaceObject.resolve(configFileContext, parsedConfig.options.outDir));
|
|
789
|
+
}
|
|
790
|
+
for (const projectReference of parsedConfig.projectReferences || []){
|
|
791
|
+
const configFile = typescript.resolveProjectReferencePath(projectReference);
|
|
792
|
+
if (processedConfigFiles.includes(configFile)) continue;
|
|
793
|
+
const parsedConfig = parseConfig(configFile, external_path_namespaceObject.dirname(configFile));
|
|
794
|
+
const childArtifacts = getArtifactsWorker(parsedConfig, configFileContext, [
|
|
795
|
+
...processedConfigFiles,
|
|
796
|
+
configFile
|
|
797
|
+
]);
|
|
798
|
+
childArtifacts.files.forEach((file)=>{
|
|
799
|
+
files.add(file);
|
|
800
|
+
});
|
|
801
|
+
childArtifacts.dirs.forEach((dir)=>{
|
|
802
|
+
dirs.add(dir);
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
const extensions = [
|
|
806
|
+
typescript.Extension.Dts,
|
|
807
|
+
typescript.Extension.Js,
|
|
808
|
+
typescript.Extension.TsBuildInfo
|
|
809
|
+
];
|
|
810
|
+
return {
|
|
811
|
+
files: Array.from(files).map((file)=>external_path_namespaceObject.normalize(file)),
|
|
812
|
+
dirs: Array.from(dirs).map((dir)=>external_path_namespaceObject.normalize(dir)),
|
|
813
|
+
excluded: [],
|
|
814
|
+
extensions
|
|
815
|
+
};
|
|
816
|
+
}
|
|
817
|
+
let dependencies_dependencies;
|
|
818
|
+
function getDependencies(force = false) {
|
|
819
|
+
if (!dependencies_dependencies || force) {
|
|
820
|
+
const parsedConfig = getParsedConfig();
|
|
821
|
+
dependencies_dependencies = getDependenciesWorker(parsedConfig, worker_config_config.context);
|
|
822
|
+
}
|
|
823
|
+
return dependencies_dependencies;
|
|
824
|
+
}
|
|
825
|
+
function invalidateDependencies() {
|
|
826
|
+
dependencies_dependencies = void 0;
|
|
827
|
+
}
|
|
828
|
+
function getDependenciesWorker(parsedConfig, configFileContext, processedConfigFiles = []) {
|
|
829
|
+
const files = new Set(parsedConfig.fileNames);
|
|
830
|
+
const configFilePath = parsedConfig.options.configFilePath;
|
|
831
|
+
if ('string' == typeof configFilePath) files.add(configFilePath);
|
|
832
|
+
const dirs = new Set(Object.keys(parsedConfig.wildcardDirectories || {}));
|
|
833
|
+
const excluded = new Set((parsedConfig.raw?.exclude || []).map((filePath)=>external_path_namespaceObject.resolve(configFileContext, filePath)));
|
|
834
|
+
for (const projectReference of parsedConfig.projectReferences || []){
|
|
835
|
+
const childConfigFilePath = typescript.resolveProjectReferencePath(projectReference);
|
|
836
|
+
const childConfigContext = external_path_namespaceObject.dirname(childConfigFilePath);
|
|
837
|
+
if (processedConfigFiles.includes(childConfigFilePath)) continue;
|
|
838
|
+
const childParsedConfig = parseConfig(childConfigFilePath, childConfigContext);
|
|
839
|
+
const childDependencies = getDependenciesWorker(childParsedConfig, childConfigContext, [
|
|
840
|
+
...processedConfigFiles,
|
|
841
|
+
childConfigFilePath
|
|
842
|
+
]);
|
|
843
|
+
childDependencies.files.forEach((file)=>{
|
|
844
|
+
files.add(file);
|
|
845
|
+
});
|
|
846
|
+
childDependencies.dirs.forEach((dir)=>{
|
|
847
|
+
dirs.add(dir);
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
const extensions = [
|
|
851
|
+
typescript.Extension.Ts,
|
|
852
|
+
typescript.Extension.Tsx,
|
|
853
|
+
typescript.Extension.Js,
|
|
854
|
+
typescript.Extension.Jsx,
|
|
855
|
+
typescript.Extension.TsBuildInfo
|
|
856
|
+
];
|
|
857
|
+
return {
|
|
858
|
+
files: Array.from(files).map((file)=>external_path_namespaceObject.normalize(file)),
|
|
859
|
+
dirs: Array.from(dirs).map((dir)=>external_path_namespaceObject.normalize(dir)),
|
|
860
|
+
excluded: Array.from(excluded).map((aPath)=>external_path_namespaceObject.normalize(aPath)),
|
|
861
|
+
extensions: extensions
|
|
862
|
+
};
|
|
863
|
+
}
|
|
864
|
+
const performance = typescript.performance;
|
|
865
|
+
function enablePerformanceIfNeeded() {
|
|
866
|
+
if (worker_config_config.profile) performance?.enable?.();
|
|
867
|
+
}
|
|
868
|
+
function disablePerformanceIfNeeded() {
|
|
869
|
+
if (worker_config_config.profile) performance?.disable?.();
|
|
870
|
+
}
|
|
871
|
+
function printPerformanceMeasuresIfNeeded() {
|
|
872
|
+
if (worker_config_config.profile) {
|
|
873
|
+
const measures = {};
|
|
874
|
+
performance?.forEachMeasure?.((measureName, duration)=>{
|
|
875
|
+
measures[measureName] = duration;
|
|
876
|
+
});
|
|
877
|
+
console.table(measures);
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
function emitDtsIfNeeded(program) {
|
|
881
|
+
const parsedConfig = getParsedConfig();
|
|
882
|
+
if ('write-dts' === worker_config_config.mode && parsedConfig.options.declaration) program.emit(void 0, void 0, void 0, true);
|
|
883
|
+
}
|
|
884
|
+
function createCompilerHost(parsedConfig) {
|
|
885
|
+
const baseCompilerHost = typescript.createCompilerHost(parsedConfig.options);
|
|
886
|
+
return {
|
|
887
|
+
...baseCompilerHost,
|
|
888
|
+
fileExists: system.fileExists,
|
|
889
|
+
readFile: system.readFile,
|
|
890
|
+
directoryExists: system.directoryExists,
|
|
891
|
+
getDirectories: system.getDirectories,
|
|
892
|
+
realpath: system.realpath
|
|
893
|
+
};
|
|
894
|
+
}
|
|
895
|
+
const traceableTypescript = typescript;
|
|
896
|
+
function startTracingIfNeeded(compilerOptions) {
|
|
897
|
+
if ('string' == typeof compilerOptions.generateTrace && 'function' == typeof traceableTypescript.startTracing) traceableTypescript.startTracing(worker_config_config.build ? 'build' : 'project', compilerOptions.generateTrace, getConfigFilePathFromCompilerOptions(compilerOptions));
|
|
898
|
+
}
|
|
899
|
+
function stopTracingIfNeeded(program) {
|
|
900
|
+
const compilerOptions = program.getCompilerOptions();
|
|
901
|
+
if ('string' == typeof compilerOptions.generateTrace && 'function' == typeof traceableTypescript.tracing?.stopTracing) traceableTypescript.tracing.stopTracing();
|
|
902
|
+
}
|
|
903
|
+
function dumpTracingLegendIfNeeded() {
|
|
904
|
+
traceableTypescript.tracing?.dumpLegend();
|
|
905
|
+
}
|
|
906
|
+
let program_compilerHost;
|
|
907
|
+
let program_program;
|
|
908
|
+
function useProgram() {
|
|
909
|
+
const parsedConfig = getParsedConfig();
|
|
910
|
+
if (!program_compilerHost) program_compilerHost = createCompilerHost(parsedConfig);
|
|
911
|
+
if (!program_program) {
|
|
912
|
+
startTracingIfNeeded(parsedConfig.options);
|
|
913
|
+
program_program = typescript.createProgram({
|
|
914
|
+
rootNames: parsedConfig.fileNames,
|
|
915
|
+
options: parsedConfig.options,
|
|
916
|
+
projectReferences: parsedConfig.projectReferences,
|
|
917
|
+
host: program_compilerHost
|
|
918
|
+
});
|
|
919
|
+
}
|
|
920
|
+
updateDiagnostics(getConfigFilePathFromProgram(program_program), getDiagnosticsOfProgram(program_program));
|
|
921
|
+
emitDtsIfNeeded(program_program);
|
|
922
|
+
stopTracingIfNeeded(program_program);
|
|
923
|
+
}
|
|
924
|
+
function invalidateProgram(withHost = false) {
|
|
925
|
+
if (withHost) program_compilerHost = void 0;
|
|
926
|
+
program_program = void 0;
|
|
927
|
+
}
|
|
928
|
+
function createWatchCompilerHost(parsedConfig, createProgram, reportDiagnostic, reportWatchStatus, afterProgramCreate) {
|
|
929
|
+
const baseWatchCompilerHost = typescript.createWatchCompilerHost(parsedConfig.fileNames, parsedConfig.options, system, createProgram, reportDiagnostic, reportWatchStatus, parsedConfig.projectReferences);
|
|
930
|
+
return {
|
|
931
|
+
...baseWatchCompilerHost,
|
|
932
|
+
createProgram (rootNames, options, compilerHost, oldProgram, configFileParsingDiagnostics, projectReferences) {
|
|
933
|
+
return baseWatchCompilerHost.createProgram(rootNames, options, compilerHost, oldProgram, configFileParsingDiagnostics, projectReferences);
|
|
934
|
+
},
|
|
935
|
+
afterProgramCreate (program) {
|
|
936
|
+
if (afterProgramCreate) afterProgramCreate(program);
|
|
937
|
+
},
|
|
938
|
+
onWatchStatusChange () {},
|
|
939
|
+
watchFile: system.watchFile,
|
|
940
|
+
watchDirectory: system.watchDirectory,
|
|
941
|
+
setTimeout: system.setTimeout,
|
|
942
|
+
clearTimeout: system.clearTimeout,
|
|
943
|
+
fileExists: system.fileExists,
|
|
944
|
+
readFile: system.readFile,
|
|
945
|
+
directoryExists: system.directoryExists,
|
|
946
|
+
getDirectories: system.getDirectories,
|
|
947
|
+
realpath: system.realpath
|
|
948
|
+
};
|
|
949
|
+
}
|
|
950
|
+
function createWatchSolutionBuilderHost(parsedConfig, createProgram, reportDiagnostic, reportWatchStatus, reportSolutionBuilderStatus, afterProgramCreate, afterProgramEmitAndDiagnostics) {
|
|
951
|
+
const controlledWatchCompilerHost = createWatchCompilerHost(parsedConfig, createProgram, reportDiagnostic, reportWatchStatus, afterProgramCreate);
|
|
952
|
+
return {
|
|
953
|
+
...controlledWatchCompilerHost,
|
|
954
|
+
reportDiagnostic (diagnostic) {
|
|
955
|
+
if (reportDiagnostic) reportDiagnostic(diagnostic);
|
|
956
|
+
},
|
|
957
|
+
reportSolutionBuilderStatus (diagnostic) {
|
|
958
|
+
if (reportSolutionBuilderStatus) reportSolutionBuilderStatus(diagnostic);
|
|
959
|
+
},
|
|
960
|
+
afterProgramEmitAndDiagnostics (program) {
|
|
961
|
+
if (afterProgramEmitAndDiagnostics) afterProgramEmitAndDiagnostics(program);
|
|
962
|
+
},
|
|
963
|
+
createDirectory (path) {
|
|
964
|
+
system.createDirectory(path);
|
|
965
|
+
},
|
|
966
|
+
writeFile (path, data) {
|
|
967
|
+
system.writeFile(path, data);
|
|
968
|
+
},
|
|
969
|
+
getModifiedTime (fileName) {
|
|
970
|
+
return system.getModifiedTime(fileName);
|
|
971
|
+
},
|
|
972
|
+
setModifiedTime (fileName, date) {
|
|
973
|
+
system.setModifiedTime(fileName, date);
|
|
974
|
+
},
|
|
975
|
+
deleteFile (fileName) {
|
|
976
|
+
system.deleteFile(fileName);
|
|
977
|
+
},
|
|
978
|
+
getParsedCommandLine (fileName) {
|
|
979
|
+
return typescript.getParsedCommandLineOfConfigFile(fileName, {
|
|
980
|
+
skipLibCheck: true
|
|
981
|
+
}, {
|
|
982
|
+
...system,
|
|
983
|
+
onUnRecoverableConfigFileDiagnostic: (diagnostic)=>{
|
|
984
|
+
if (reportDiagnostic) reportDiagnostic(diagnostic);
|
|
985
|
+
}
|
|
986
|
+
});
|
|
987
|
+
}
|
|
988
|
+
};
|
|
989
|
+
}
|
|
990
|
+
let solutionBuilderHost;
|
|
991
|
+
let solutionBuilder;
|
|
992
|
+
function useSolutionBuilder() {
|
|
993
|
+
if (!solutionBuilderHost) {
|
|
994
|
+
const parsedConfig = getParsedConfig();
|
|
995
|
+
solutionBuilderHost = createWatchSolutionBuilderHost(parsedConfig, (rootNames, compilerOptions, host, oldProgram, configFileParsingDiagnostics, projectReferences)=>{
|
|
996
|
+
if (compilerOptions) startTracingIfNeeded(compilerOptions);
|
|
997
|
+
return typescript.createSemanticDiagnosticsBuilderProgram(rootNames, compilerOptions, host, oldProgram, configFileParsingDiagnostics, projectReferences);
|
|
998
|
+
}, void 0, void 0, void 0, void 0, (builderProgram)=>{
|
|
999
|
+
updateDiagnostics(getConfigFilePathFromBuilderProgram(builderProgram), getDiagnosticsOfProgram(builderProgram));
|
|
1000
|
+
emitTsBuildInfoIfNeeded(builderProgram);
|
|
1001
|
+
stopTracingIfNeeded(builderProgram);
|
|
1002
|
+
});
|
|
1003
|
+
}
|
|
1004
|
+
if (!solutionBuilder) {
|
|
1005
|
+
solutionBuilder = typescript.createSolutionBuilderWithWatch(solutionBuilderHost, [
|
|
1006
|
+
worker_config_config.configFile
|
|
1007
|
+
], {
|
|
1008
|
+
watch: true
|
|
1009
|
+
});
|
|
1010
|
+
solutionBuilder.build();
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
function invalidateSolutionBuilder(withHost = false) {
|
|
1014
|
+
if (withHost) solutionBuilderHost = void 0;
|
|
1015
|
+
solutionBuilder = void 0;
|
|
1016
|
+
}
|
|
1017
|
+
let watchCompilerHost;
|
|
1018
|
+
let watchProgram;
|
|
1019
|
+
let shouldUpdateRootFiles = false;
|
|
1020
|
+
function useWatchProgram() {
|
|
1021
|
+
if (!watchCompilerHost) {
|
|
1022
|
+
const parsedConfig = getParsedConfig();
|
|
1023
|
+
watchCompilerHost = createWatchCompilerHost(parsedConfig, (rootNames, compilerOptions, host, oldProgram, configFileParsingDiagnostics, projectReferences)=>{
|
|
1024
|
+
if (compilerOptions) startTracingIfNeeded(compilerOptions);
|
|
1025
|
+
return typescript.createSemanticDiagnosticsBuilderProgram(rootNames, compilerOptions, host, oldProgram, configFileParsingDiagnostics, projectReferences);
|
|
1026
|
+
}, void 0, void 0, (builderProgram)=>{
|
|
1027
|
+
updateDiagnostics(getConfigFilePathFromBuilderProgram(builderProgram), getDiagnosticsOfProgram(builderProgram));
|
|
1028
|
+
emitDtsIfNeeded(builderProgram);
|
|
1029
|
+
emitTsBuildInfoIfNeeded(builderProgram);
|
|
1030
|
+
stopTracingIfNeeded(builderProgram);
|
|
1031
|
+
});
|
|
1032
|
+
watchProgram = void 0;
|
|
1033
|
+
}
|
|
1034
|
+
if (!watchProgram) watchProgram = typescript.createWatchProgram(watchCompilerHost);
|
|
1035
|
+
if (shouldUpdateRootFiles) {
|
|
1036
|
+
watchProgram.updateRootFileNames(getDependencies().files);
|
|
1037
|
+
shouldUpdateRootFiles = false;
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
function invalidateWatchProgram(withHost = false) {
|
|
1041
|
+
if (withHost) watchCompilerHost = void 0;
|
|
1042
|
+
watchProgram = void 0;
|
|
1043
|
+
}
|
|
1044
|
+
function invalidateWatchProgramRootFileNames() {
|
|
1045
|
+
shouldUpdateRootFiles = true;
|
|
1046
|
+
}
|
|
1047
|
+
const getIssuesWorker = async (change, watching)=>{
|
|
1048
|
+
system.invalidateCache();
|
|
1049
|
+
if (didConfigFileChanged(change)) {
|
|
1050
|
+
invalidateConfig();
|
|
1051
|
+
invalidateDependencies();
|
|
1052
|
+
invalidateArtifacts();
|
|
1053
|
+
invalidateDiagnostics();
|
|
1054
|
+
invalidateProgram(true);
|
|
1055
|
+
invalidateWatchProgram(true);
|
|
1056
|
+
invalidateSolutionBuilder(true);
|
|
1057
|
+
invalidateTsBuildInfo();
|
|
1058
|
+
} else if (didDependenciesProbablyChanged(getDependencies(), change)) {
|
|
1059
|
+
invalidateConfig();
|
|
1060
|
+
invalidateDependencies();
|
|
1061
|
+
invalidateArtifacts();
|
|
1062
|
+
if (didRootFilesChanged()) {
|
|
1063
|
+
invalidateWatchProgramRootFileNames();
|
|
1064
|
+
invalidateSolutionBuilder();
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
registerArtifacts();
|
|
1068
|
+
enablePerformanceIfNeeded();
|
|
1069
|
+
const parseConfigIssues = getParseConfigIssues();
|
|
1070
|
+
if (parseConfigIssues.length) return parseConfigIssues;
|
|
1071
|
+
if (worker_config_config.build) useSolutionBuilder();
|
|
1072
|
+
else if (watching) useWatchProgram();
|
|
1073
|
+
else useProgram();
|
|
1074
|
+
change.changedFiles?.forEach((changedFile)=>{
|
|
1075
|
+
system?.invokeFileChanged(changedFile);
|
|
1076
|
+
});
|
|
1077
|
+
change.deletedFiles?.forEach((deletedFile)=>{
|
|
1078
|
+
system?.invokeFileDeleted(deletedFile);
|
|
1079
|
+
});
|
|
1080
|
+
await system.waitForQueued();
|
|
1081
|
+
const issues = getIssues();
|
|
1082
|
+
dumpTracingLegendIfNeeded();
|
|
1083
|
+
printPerformanceMeasuresIfNeeded();
|
|
1084
|
+
disablePerformanceIfNeeded();
|
|
1085
|
+
return issues;
|
|
1086
|
+
};
|
|
1087
|
+
exposeRpc(getIssuesWorker);
|
|
1088
|
+
for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
1089
|
+
Object.defineProperty(exports, '__esModule', {
|
|
1090
|
+
value: true
|
|
1091
|
+
});
|