fork-ts-checker-webpack-plugin 7.0.0-alpha.12 → 7.0.0-alpha.16
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 +38 -23
- package/lib/formatter/code-frame-formatter.js +2 -2
- package/lib/formatter/formatter-config.js +2 -2
- package/lib/formatter/webpack-formatter.js +2 -2
- package/lib/hooks/intercept-done-to-get-dev-server-tap.js +2 -2
- package/lib/hooks/tap-after-compile-to-add-dependencies.js +1 -1
- package/lib/hooks/tap-after-compile-to-get-issues.js +2 -2
- package/lib/hooks/tap-after-environment-to-patch-watching.js +1 -1
- package/lib/hooks/tap-done-to-async-get-issues.js +8 -8
- package/lib/hooks/tap-error-to-log-message.js +4 -4
- package/lib/hooks/tap-start-to-run-workers.js +7 -7
- package/lib/hooks/tap-stop-to-terminate-workers.js +1 -1
- package/lib/issue/issue-config.js +4 -4
- package/lib/issue/issue-location.js +2 -2
- package/lib/issue/issue-match.js +1 -1
- package/lib/issue/issue-webpack-error.js +2 -2
- package/lib/issue/issue.js +3 -3
- package/lib/{logger/logger.d.ts → logger.d.ts} +1 -2
- package/lib/{logger/logger.js → logger.js} +0 -0
- package/lib/plugin-config.d.ts +3 -2
- package/lib/plugin-config.js +5 -5
- package/lib/plugin-hooks.d.ts +2 -2
- package/lib/plugin-options.d.ts +3 -2
- package/lib/plugin-options.json +9 -44
- package/lib/plugin-pools.js +2 -2
- package/lib/plugin.d.ts +1 -1
- package/lib/plugin.js +16 -16
- package/lib/rpc/rpc-worker.js +1 -1
- package/lib/typescript/extension/type-script-embedded-extension.js +2 -2
- package/lib/typescript/extension/vue/type-script-vue-extension-support.js +1 -1
- package/lib/typescript/extension/vue/type-script-vue-extension.js +1 -1
- package/lib/typescript/type-script-support.js +1 -1
- package/lib/typescript/type-script-worker-config.d.ts +1 -1
- package/lib/typescript/type-script-worker-config.js +1 -1
- package/lib/typescript/type-script-worker-options.d.ts +1 -1
- package/lib/typescript/worker/get-dependencies-worker.js +7 -7
- package/lib/typescript/worker/get-issues-worker.js +24 -25
- package/lib/typescript/worker/lib/artifacts.js +3 -3
- package/lib/typescript/worker/lib/config.js +3 -3
- package/lib/typescript/worker/lib/dependencies.js +2 -2
- package/lib/typescript/worker/lib/diagnostics.js +1 -1
- package/lib/typescript/worker/lib/extensions.js +1 -1
- package/lib/typescript/worker/lib/file-system/mem-file-system.js +2 -2
- package/lib/typescript/worker/lib/file-system/real-file-system.js +23 -23
- package/lib/typescript/worker/lib/host/watch-solution-builder-host.js +1 -1
- package/lib/typescript/worker/lib/program/program.js +3 -3
- package/lib/typescript/worker/lib/program/solution-builder.js +6 -6
- package/lib/typescript/worker/lib/program/watch-program.js +7 -7
- package/lib/typescript/worker/lib/system.js +27 -11
- package/lib/typescript/worker/lib/tracing.js +1 -1
- package/lib/typescript/worker/lib/tsbuildinfo.js +2 -2
- package/lib/typescript/worker/lib/worker-config.js +1 -1
- package/lib/utils/path/relative-to-context.js +1 -1
- package/lib/watch/inclusive-node-watch-file-system.js +10 -10
- package/package.json +39 -34
- package/lib/logger/logger-config.d.ts +0 -10
- package/lib/logger/logger-config.js +0 -12
- package/lib/logger/logger-factory.d.ts +0 -5
- package/lib/logger/logger-factory.js +0 -21
- package/lib/logger/logger-options.d.ts +0 -8
- package/lib/logger/logger-options.js +0 -2
- package/lib/logger/partial-logger.d.ts +0 -4
- package/lib/logger/partial-logger.js +0 -11
- package/lib/logger/webpack-infrastructure-logger.d.ts +0 -4
- package/lib/logger/webpack-infrastructure-logger.js +0 -13
package/lib/plugin.js
CHANGED
|
@@ -41,36 +41,36 @@ const rpc_1 = require("./rpc");
|
|
|
41
41
|
const type_script_support_1 = require("./typescript/type-script-support");
|
|
42
42
|
class ForkTsCheckerWebpackPlugin {
|
|
43
43
|
constructor(options = {}) {
|
|
44
|
-
const explorerSync = cosmiconfig_1.cosmiconfigSync('fork-ts-checker');
|
|
44
|
+
const explorerSync = (0, cosmiconfig_1.cosmiconfigSync)('fork-ts-checker');
|
|
45
45
|
const { config: externalOptions } = explorerSync.search() || {};
|
|
46
46
|
// first validate options directly passed to the constructor
|
|
47
47
|
const config = { name: 'ForkTsCheckerWebpackPlugin' };
|
|
48
|
-
schema_utils_1.validate(plugin_options_json_1.default, options, config);
|
|
49
|
-
this.options = deepmerge_1.default(externalOptions || {}, options || {});
|
|
48
|
+
(0, schema_utils_1.validate)(plugin_options_json_1.default, options, config);
|
|
49
|
+
this.options = (0, deepmerge_1.default)(externalOptions || {}, options || {});
|
|
50
50
|
// then validate merged options
|
|
51
|
-
schema_utils_1.validate(plugin_options_json_1.default, this.options, config);
|
|
51
|
+
(0, schema_utils_1.validate)(plugin_options_json_1.default, this.options, config);
|
|
52
52
|
}
|
|
53
53
|
static getCompilerHooks(compiler) {
|
|
54
|
-
return plugin_hooks_1.getPluginHooks(compiler);
|
|
54
|
+
return (0, plugin_hooks_1.getPluginHooks)(compiler);
|
|
55
55
|
}
|
|
56
56
|
apply(compiler) {
|
|
57
|
-
const config = plugin_config_1.createPluginConfig(compiler, this.options);
|
|
58
|
-
const state = plugin_state_1.createPluginState();
|
|
59
|
-
type_script_support_1.assertTypeScriptSupport(config.typescript);
|
|
60
|
-
const getIssuesWorker = rpc_1.createRpcWorker(path.resolve(__dirname, './typescript/worker/get-issues-worker.js'), config.typescript, config.typescript.memoryLimit);
|
|
61
|
-
const getDependenciesWorker = rpc_1.createRpcWorker(path.resolve(__dirname, './typescript/worker/get-dependencies-worker.js'), config.typescript);
|
|
62
|
-
tap_after_environment_to_patch_watching_1.tapAfterEnvironmentToPatchWatching(compiler, state);
|
|
63
|
-
tap_start_to_run_workers_1.tapStartToRunWorkers(compiler, getIssuesWorker, getDependenciesWorker, config, state);
|
|
64
|
-
tap_after_compile_to_add_dependencies_1.tapAfterCompileToAddDependencies(compiler, config, state);
|
|
65
|
-
tap_stop_to_terminate_workers_1.tapStopToTerminateWorkers(compiler, getIssuesWorker, getDependenciesWorker, state);
|
|
66
|
-
tap_error_to_log_message_1.tapErrorToLogMessage(compiler, config);
|
|
57
|
+
const config = (0, plugin_config_1.createPluginConfig)(compiler, this.options);
|
|
58
|
+
const state = (0, plugin_state_1.createPluginState)();
|
|
59
|
+
(0, type_script_support_1.assertTypeScriptSupport)(config.typescript);
|
|
60
|
+
const getIssuesWorker = (0, rpc_1.createRpcWorker)(path.resolve(__dirname, './typescript/worker/get-issues-worker.js'), config.typescript, config.typescript.memoryLimit);
|
|
61
|
+
const getDependenciesWorker = (0, rpc_1.createRpcWorker)(path.resolve(__dirname, './typescript/worker/get-dependencies-worker.js'), config.typescript);
|
|
62
|
+
(0, tap_after_environment_to_patch_watching_1.tapAfterEnvironmentToPatchWatching)(compiler, state);
|
|
63
|
+
(0, tap_start_to_run_workers_1.tapStartToRunWorkers)(compiler, getIssuesWorker, getDependenciesWorker, config, state);
|
|
64
|
+
(0, tap_after_compile_to_add_dependencies_1.tapAfterCompileToAddDependencies)(compiler, config, state);
|
|
65
|
+
(0, tap_stop_to_terminate_workers_1.tapStopToTerminateWorkers)(compiler, getIssuesWorker, getDependenciesWorker, state);
|
|
66
|
+
(0, tap_error_to_log_message_1.tapErrorToLogMessage)(compiler, config);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
exports.ForkTsCheckerWebpackPlugin = ForkTsCheckerWebpackPlugin;
|
|
70
70
|
/**
|
|
71
71
|
* Current version of the plugin
|
|
72
72
|
*/
|
|
73
|
-
ForkTsCheckerWebpackPlugin.version = '7.0.0-alpha.
|
|
73
|
+
ForkTsCheckerWebpackPlugin.version = '7.0.0-alpha.16'; // will be replaced by the @semantic-release/exec
|
|
74
74
|
/**
|
|
75
75
|
* Default pools for the plugin concurrency limit
|
|
76
76
|
*/
|
package/lib/rpc/rpc-worker.js
CHANGED
|
@@ -44,7 +44,7 @@ function createRpcWorker(modulePath, data, memoryLimit) {
|
|
|
44
44
|
}
|
|
45
45
|
if (!(childProcess === null || childProcess === void 0 ? void 0 : childProcess.connected)) {
|
|
46
46
|
childProcess = child_process.fork(modulePath, options);
|
|
47
|
-
remoteMethod = wrap_rpc_1.wrapRpc(childProcess);
|
|
47
|
+
remoteMethod = (0, wrap_rpc_1.wrapRpc)(childProcess);
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
terminate() {
|
|
@@ -19,9 +19,9 @@ function createTypeScriptEmbeddedExtension({ embeddedExtensions, getEmbeddedSour
|
|
|
19
19
|
return embeddedSourceCache.get(fileName);
|
|
20
20
|
}
|
|
21
21
|
function parsePotentiallyEmbeddedFileName(fileName) {
|
|
22
|
-
const extension = path_1.extname(fileName);
|
|
22
|
+
const extension = (0, path_1.extname)(fileName);
|
|
23
23
|
const embeddedFileName = fileName.slice(0, fileName.length - extension.length);
|
|
24
|
-
const embeddedExtension = path_1.extname(embeddedFileName);
|
|
24
|
+
const embeddedExtension = (0, path_1.extname)(embeddedFileName);
|
|
25
25
|
return {
|
|
26
26
|
extension,
|
|
27
27
|
embeddedFileName,
|
|
@@ -13,7 +13,7 @@ function assertTypeScriptVueExtensionSupport(config) {
|
|
|
13
13
|
catch (error) {
|
|
14
14
|
throw new Error([
|
|
15
15
|
`Could not initialize '${compilerName}'. When you use 'typescript.extensions.vue' option, make sure to install '${compilerName}' and that the version matches that of 'vue'.`,
|
|
16
|
-
`Error details: ${error
|
|
16
|
+
`Error details: ${String(error)}`,
|
|
17
17
|
].join('\n'));
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -108,7 +108,7 @@ function createTypeScriptVueExtension(config) {
|
|
|
108
108
|
return createVueInlineScriptEmbeddedSource(paddedSourceText, script.attrs.lang);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
return type_script_embedded_extension_1.createTypeScriptEmbeddedExtension({
|
|
111
|
+
return (0, type_script_embedded_extension_1.createTypeScriptEmbeddedExtension)({
|
|
112
112
|
embeddedExtensions: ['.vue'],
|
|
113
113
|
getEmbeddedSource: getVueEmbeddedSource,
|
|
114
114
|
});
|
|
@@ -61,7 +61,7 @@ function assertTypeScriptSupport(config) {
|
|
|
61
61
|
].join(os_1.default.EOL));
|
|
62
62
|
}
|
|
63
63
|
if (config.extensions.vue.enabled) {
|
|
64
|
-
type_script_vue_extension_support_1.assertTypeScriptVueExtensionSupport(config.extensions.vue);
|
|
64
|
+
(0, type_script_vue_extension_support_1.assertTypeScriptVueExtensionSupport)(config.extensions.vue);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
exports.assertTypeScriptSupport = assertTypeScriptSupport;
|
|
@@ -10,7 +10,7 @@ interface TypeScriptWorkerConfig {
|
|
|
10
10
|
configOverwrite: TypeScriptConfigOverwrite;
|
|
11
11
|
build: boolean;
|
|
12
12
|
context: string;
|
|
13
|
-
mode: 'readonly' | 'write-tsbuildinfo' | 'write-references';
|
|
13
|
+
mode: 'readonly' | 'write-tsbuildinfo' | 'write-dts' | 'write-references';
|
|
14
14
|
diagnosticOptions: TypeScriptDiagnosticsOptions;
|
|
15
15
|
extensions: {
|
|
16
16
|
vue: TypeScriptVueExtensionConfig;
|
|
@@ -25,7 +25,7 @@ function createTypeScriptWorkerConfig(compiler, options) {
|
|
|
25
25
|
defaultCompilerOptions.declarationMap = false;
|
|
26
26
|
}
|
|
27
27
|
return Object.assign(Object.assign({ enabled: options !== false, memoryLimit: 2048, build: false, mode: 'write-tsbuildinfo', profile: false }, optionsAsObject), { configFile: configFile, configOverwrite: Object.assign(Object.assign({}, (optionsAsObject.configOverwrite || {})), { compilerOptions: Object.assign(Object.assign({}, defaultCompilerOptions), ((optionsAsObject.configOverwrite || {}).compilerOptions || {})) }), context: optionsAsObject.context || path_1.default.dirname(configFile), extensions: {
|
|
28
|
-
vue: type_script_vue_extension_config_1.createTypeScriptVueExtensionConfig(optionsAsObject.extensions ? optionsAsObject.extensions.vue : undefined),
|
|
28
|
+
vue: (0, type_script_vue_extension_config_1.createTypeScriptVueExtensionConfig)(optionsAsObject.extensions ? optionsAsObject.extensions.vue : undefined),
|
|
29
29
|
}, diagnosticOptions: Object.assign({ syntactic: false, semantic: true, declaration: false, global: false }, (optionsAsObject.diagnosticOptions || {})), typescriptPath: typescriptPath });
|
|
30
30
|
}
|
|
31
31
|
exports.createTypeScriptWorkerConfig = createTypeScriptWorkerConfig;
|
|
@@ -7,7 +7,7 @@ declare type TypeScriptWorkerOptions = {
|
|
|
7
7
|
configOverwrite?: TypeScriptConfigOverwrite;
|
|
8
8
|
context?: string;
|
|
9
9
|
build?: boolean;
|
|
10
|
-
mode?: 'readonly' | 'write-tsbuildinfo' | 'write-references';
|
|
10
|
+
mode?: 'readonly' | 'write-tsbuildinfo' | 'write-dts' | 'write-references';
|
|
11
11
|
diagnosticOptions?: Partial<TypeScriptDiagnosticsOptions>;
|
|
12
12
|
extensions?: {
|
|
13
13
|
vue?: TypeScriptVueExtensionOptions;
|
|
@@ -6,13 +6,13 @@ const dependencies_1 = require("./lib/dependencies");
|
|
|
6
6
|
const system_1 = require("./lib/system");
|
|
7
7
|
const getDependenciesWorker = ({ changedFiles = [], deletedFiles = [], }) => {
|
|
8
8
|
system_1.system.invalidateCache();
|
|
9
|
-
if (config_1.didConfigFileChanged({ changedFiles, deletedFiles })) {
|
|
10
|
-
config_1.invalidateConfig();
|
|
11
|
-
dependencies_1.invalidateDependencies();
|
|
9
|
+
if ((0, config_1.didConfigFileChanged)({ changedFiles, deletedFiles })) {
|
|
10
|
+
(0, config_1.invalidateConfig)();
|
|
11
|
+
(0, dependencies_1.invalidateDependencies)();
|
|
12
12
|
}
|
|
13
|
-
else if (config_1.didRootFilesChanged()) {
|
|
14
|
-
dependencies_1.invalidateDependencies();
|
|
13
|
+
else if ((0, config_1.didRootFilesChanged)()) {
|
|
14
|
+
(0, dependencies_1.invalidateDependencies)();
|
|
15
15
|
}
|
|
16
|
-
return dependencies_1.getDependencies();
|
|
16
|
+
return (0, dependencies_1.getDependencies)();
|
|
17
17
|
};
|
|
18
|
-
rpc_1.exposeRpc(getDependenciesWorker);
|
|
18
|
+
(0, rpc_1.exposeRpc)(getDependenciesWorker);
|
|
@@ -24,38 +24,37 @@ const tsbuildinfo_1 = require("./lib/tsbuildinfo");
|
|
|
24
24
|
const worker_config_1 = require("./lib/worker-config");
|
|
25
25
|
const getIssuesWorker = ({ changedFiles = [], deletedFiles = [] }, watching) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
26
|
system_1.system.invalidateCache();
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
artifacts_1.invalidateArtifacts();
|
|
31
|
-
diagnostics_1.invalidateDiagnostics();
|
|
32
|
-
program_1.invalidateProgram(true);
|
|
33
|
-
watch_program_1.invalidateWatchProgram(true);
|
|
34
|
-
solution_builder_1.invalidateSolutionBuilder(true);
|
|
35
|
-
tsbuildinfo_1.invalidateTsBuildInfo();
|
|
27
|
+
(0, dependencies_1.invalidateDependencies)();
|
|
28
|
+
if ((0, config_1.didConfigFileChanged)({ changedFiles, deletedFiles })) {
|
|
29
|
+
(0, config_1.invalidateConfig)();
|
|
30
|
+
(0, artifacts_1.invalidateArtifacts)();
|
|
31
|
+
(0, diagnostics_1.invalidateDiagnostics)();
|
|
32
|
+
(0, program_1.invalidateProgram)(true);
|
|
33
|
+
(0, watch_program_1.invalidateWatchProgram)(true);
|
|
34
|
+
(0, solution_builder_1.invalidateSolutionBuilder)(true);
|
|
35
|
+
(0, tsbuildinfo_1.invalidateTsBuildInfo)();
|
|
36
36
|
}
|
|
37
|
-
else if (config_1.didRootFilesChanged()) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
solution_builder_1.invalidateSolutionBuilder();
|
|
37
|
+
else if ((0, config_1.didRootFilesChanged)()) {
|
|
38
|
+
(0, artifacts_1.invalidateArtifacts)();
|
|
39
|
+
(0, watch_program_1.invalidateWatchProgramRootFileNames)();
|
|
40
|
+
(0, solution_builder_1.invalidateSolutionBuilder)();
|
|
42
41
|
}
|
|
43
|
-
artifacts_1.registerArtifacts();
|
|
44
|
-
performance_1.enablePerformanceIfNeeded();
|
|
45
|
-
const parseConfigIssues = config_1.getParseConfigIssues();
|
|
42
|
+
(0, artifacts_1.registerArtifacts)();
|
|
43
|
+
(0, performance_1.enablePerformanceIfNeeded)();
|
|
44
|
+
const parseConfigIssues = (0, config_1.getParseConfigIssues)();
|
|
46
45
|
if (parseConfigIssues.length) {
|
|
47
46
|
// report config parse issues and exit
|
|
48
47
|
return parseConfigIssues;
|
|
49
48
|
}
|
|
50
49
|
// use proper implementation based on the config
|
|
51
50
|
if (worker_config_1.config.build) {
|
|
52
|
-
solution_builder_1.useSolutionBuilder();
|
|
51
|
+
(0, solution_builder_1.useSolutionBuilder)();
|
|
53
52
|
}
|
|
54
53
|
else if (watching) {
|
|
55
|
-
watch_program_1.useWatchProgram();
|
|
54
|
+
(0, watch_program_1.useWatchProgram)();
|
|
56
55
|
}
|
|
57
56
|
else {
|
|
58
|
-
program_1.useProgram();
|
|
57
|
+
(0, program_1.useProgram)();
|
|
59
58
|
}
|
|
60
59
|
// simulate file system events
|
|
61
60
|
changedFiles.forEach((changedFile) => {
|
|
@@ -67,10 +66,10 @@ const getIssuesWorker = ({ changedFiles = [], deletedFiles = [] }, watching) =>
|
|
|
67
66
|
// wait for all queued events to be processed
|
|
68
67
|
yield system_1.system.waitForQueued();
|
|
69
68
|
// retrieve all collected diagnostics as normalized issues
|
|
70
|
-
const issues = diagnostics_1.getIssues();
|
|
71
|
-
tracing_1.dumpTracingLegendIfNeeded();
|
|
72
|
-
performance_1.printPerformanceMeasuresIfNeeded();
|
|
73
|
-
performance_1.disablePerformanceIfNeeded();
|
|
69
|
+
const issues = (0, diagnostics_1.getIssues)();
|
|
70
|
+
(0, tracing_1.dumpTracingLegendIfNeeded)();
|
|
71
|
+
(0, performance_1.printPerformanceMeasuresIfNeeded)();
|
|
72
|
+
(0, performance_1.disablePerformanceIfNeeded)();
|
|
74
73
|
return issues;
|
|
75
74
|
});
|
|
76
|
-
rpc_1.exposeRpc(getIssuesWorker);
|
|
75
|
+
(0, rpc_1.exposeRpc)(getIssuesWorker);
|
|
@@ -29,7 +29,7 @@ const worker_config_1 = require("./worker-config");
|
|
|
29
29
|
let artifacts;
|
|
30
30
|
function getArtifacts(force = false) {
|
|
31
31
|
if (!artifacts || force) {
|
|
32
|
-
const parsedConfig = config_1.getParsedConfig();
|
|
32
|
+
const parsedConfig = (0, config_1.getParsedConfig)();
|
|
33
33
|
artifacts = getArtifactsWorker(parsedConfig, worker_config_1.config.context);
|
|
34
34
|
}
|
|
35
35
|
return artifacts;
|
|
@@ -50,7 +50,7 @@ function getArtifactsWorker(parsedConfig, configFileContext, processedConfigFile
|
|
|
50
50
|
if (parsedConfig.options.outFile) {
|
|
51
51
|
files.add(path.resolve(configFileContext, parsedConfig.options.outFile));
|
|
52
52
|
}
|
|
53
|
-
const tsBuildInfoPath = tsbuildinfo_1.getTsBuildInfoEmitPath(parsedConfig.options);
|
|
53
|
+
const tsBuildInfoPath = (0, tsbuildinfo_1.getTsBuildInfoEmitPath)(parsedConfig.options);
|
|
54
54
|
if (tsBuildInfoPath) {
|
|
55
55
|
files.add(path.resolve(configFileContext, tsBuildInfoPath));
|
|
56
56
|
}
|
|
@@ -64,7 +64,7 @@ function getArtifactsWorker(parsedConfig, configFileContext, processedConfigFile
|
|
|
64
64
|
// handle circular dependencies
|
|
65
65
|
continue;
|
|
66
66
|
}
|
|
67
|
-
const parsedConfig = config_1.parseConfig(configFile, path.dirname(configFile));
|
|
67
|
+
const parsedConfig = (0, config_1.parseConfig)(configFile, path.dirname(configFile));
|
|
68
68
|
const childArtifacts = getArtifactsWorker(parsedConfig, configFileContext, [
|
|
69
69
|
...processedConfigFiles,
|
|
70
70
|
configFile,
|
|
@@ -39,7 +39,7 @@ for (const extension of extensions_1.extensions) {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
function parseConfig(configFileName, configFileContext, configOverwriteJSON = {}) {
|
|
42
|
-
const configFilePath = forward_slash_1.forwardSlash(configFileName);
|
|
42
|
+
const configFilePath = (0, forward_slash_1.forwardSlash)(configFileName);
|
|
43
43
|
const parsedConfigFileJSON = typescript_1.typescript.readConfigFile(configFilePath, parseConfigFileHost.readFile);
|
|
44
44
|
const overwrittenConfigFileJSON = Object.assign(Object.assign(Object.assign({}, (parsedConfigFileJSON.config || {})), configOverwriteJSON), { compilerOptions: Object.assign(Object.assign({}, ((parsedConfigFileJSON.config || {}).compilerOptions || {})), (configOverwriteJSON.compilerOptions || {})) });
|
|
45
45
|
const parsedConfigFile = typescript_1.typescript.parseJsonConfigFileContent(overwrittenConfigFileJSON, parseConfigFileHost, configFileContext);
|
|
@@ -47,7 +47,7 @@ function parseConfig(configFileName, configFileContext, configOverwriteJSON = {}
|
|
|
47
47
|
}
|
|
48
48
|
exports.parseConfig = parseConfig;
|
|
49
49
|
function getParseConfigIssues() {
|
|
50
|
-
const issues = diagnostics_1.createIssuesFromDiagnostics(parseConfigDiagnostics);
|
|
50
|
+
const issues = (0, diagnostics_1.createIssuesFromDiagnostics)(parseConfigDiagnostics);
|
|
51
51
|
issues.forEach((issue) => {
|
|
52
52
|
if (!issue.file) {
|
|
53
53
|
issue.file = worker_config_1.config.configFile;
|
|
@@ -60,7 +60,7 @@ function getParsedConfig(force = false) {
|
|
|
60
60
|
if (!parsedConfig || force) {
|
|
61
61
|
parseConfigDiagnostics = [];
|
|
62
62
|
parsedConfig = parseConfig(worker_config_1.config.configFile, worker_config_1.config.context, worker_config_1.config.configOverwrite);
|
|
63
|
-
const configFilePath = forward_slash_1.forwardSlash(worker_config_1.config.configFile);
|
|
63
|
+
const configFilePath = (0, forward_slash_1.forwardSlash)(worker_config_1.config.configFile);
|
|
64
64
|
const parsedConfigFileJSON = typescript_1.typescript.readConfigFile(configFilePath, parseConfigFileHost.readFile);
|
|
65
65
|
const overwrittenConfigFileJSON = Object.assign(Object.assign(Object.assign({}, (parsedConfigFileJSON.config || {})), worker_config_1.config.configOverwrite), { compilerOptions: Object.assign(Object.assign({}, ((parsedConfigFileJSON.config || {}).compilerOptions || {})), (worker_config_1.config.configOverwrite.compilerOptions || {})) });
|
|
66
66
|
parsedConfig = typescript_1.typescript.parseJsonConfigFileContent(overwrittenConfigFileJSON, parseConfigFileHost, worker_config_1.config.context);
|
|
@@ -28,7 +28,7 @@ const worker_config_1 = require("./worker-config");
|
|
|
28
28
|
let dependencies;
|
|
29
29
|
function getDependencies(force = false) {
|
|
30
30
|
if (!dependencies || force) {
|
|
31
|
-
const parsedConfig = config_1.getParsedConfig();
|
|
31
|
+
const parsedConfig = (0, config_1.getParsedConfig)();
|
|
32
32
|
dependencies = getDependenciesWorker(parsedConfig, worker_config_1.config.context);
|
|
33
33
|
for (const extension of extensions_1.extensions) {
|
|
34
34
|
if (extension.extendDependencies) {
|
|
@@ -59,7 +59,7 @@ function getDependenciesWorker(parsedConfig, configFileContext, processedConfigF
|
|
|
59
59
|
// handle circular dependencies
|
|
60
60
|
continue;
|
|
61
61
|
}
|
|
62
|
-
const childParsedConfig = config_1.parseConfig(childConfigFilePath, childConfigContext);
|
|
62
|
+
const childParsedConfig = (0, config_1.parseConfig)(childConfigFilePath, childConfigContext);
|
|
63
63
|
const childDependencies = getDependenciesWorker(childParsedConfig, childConfigContext, [
|
|
64
64
|
...processedConfigFiles,
|
|
65
65
|
childConfigFilePath,
|
|
@@ -89,7 +89,7 @@ function createIssueFromDiagnostic(diagnostic) {
|
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
function createIssuesFromDiagnostics(diagnostics) {
|
|
92
|
-
let issues = issue_1.deduplicateAndSortIssues(diagnostics.map((diagnostic) => createIssueFromDiagnostic(diagnostic)));
|
|
92
|
+
let issues = (0, issue_1.deduplicateAndSortIssues)(diagnostics.map((diagnostic) => createIssueFromDiagnostic(diagnostic)));
|
|
93
93
|
extensions_1.extensions.forEach((extension) => {
|
|
94
94
|
if (extension.extendIssues) {
|
|
95
95
|
issues = extension.extendIssues(issues);
|
|
@@ -7,5 +7,5 @@ const worker_config_1 = require("./worker-config");
|
|
|
7
7
|
const extensions = [];
|
|
8
8
|
exports.extensions = extensions;
|
|
9
9
|
if ((_b = (_a = worker_config_1.config.extensions) === null || _a === void 0 ? void 0 : _a.vue) === null || _b === void 0 ? void 0 : _b.enabled) {
|
|
10
|
-
extensions.push(type_script_vue_extension_1.createTypeScriptVueExtension(worker_config_1.config.extensions.vue));
|
|
10
|
+
extensions.push((0, type_script_vue_extension_1.createTypeScriptVueExtension)(worker_config_1.config.extensions.vue));
|
|
11
11
|
}
|
|
@@ -61,8 +61,8 @@ function createDir(path) {
|
|
|
61
61
|
memfs_1.fs.mkdirSync(real_file_system_1.realFileSystem.normalizePath(path), { recursive: true });
|
|
62
62
|
}
|
|
63
63
|
function writeFile(path, data) {
|
|
64
|
-
if (!exists(path_1.dirname(path))) {
|
|
65
|
-
createDir(path_1.dirname(path));
|
|
64
|
+
if (!exists((0, path_1.dirname)(path))) {
|
|
65
|
+
createDir((0, path_1.dirname)(path));
|
|
66
66
|
}
|
|
67
67
|
memfs_1.fs.writeFileSync(real_file_system_1.realFileSystem.normalizePath(path), data);
|
|
68
68
|
}
|
|
@@ -47,7 +47,7 @@ exports.realFileSystem = {
|
|
|
47
47
|
return getRealPath(path);
|
|
48
48
|
},
|
|
49
49
|
normalizePath(path) {
|
|
50
|
-
return path_1.normalize(path);
|
|
50
|
+
return (0, path_1.normalize)(path);
|
|
51
51
|
},
|
|
52
52
|
writeFile(path, data) {
|
|
53
53
|
writeFile(getRealPath(path), data);
|
|
@@ -71,14 +71,14 @@ exports.realFileSystem = {
|
|
|
71
71
|
};
|
|
72
72
|
// read methods
|
|
73
73
|
function exists(path) {
|
|
74
|
-
const normalizedPath = path_1.normalize(path);
|
|
74
|
+
const normalizedPath = (0, path_1.normalize)(path);
|
|
75
75
|
if (!existsCache.has(normalizedPath)) {
|
|
76
76
|
existsCache.set(normalizedPath, fs.existsSync(normalizedPath));
|
|
77
77
|
}
|
|
78
78
|
return !!existsCache.get(normalizedPath);
|
|
79
79
|
}
|
|
80
80
|
function readStats(path) {
|
|
81
|
-
const normalizedPath = path_1.normalize(path);
|
|
81
|
+
const normalizedPath = (0, path_1.normalize)(path);
|
|
82
82
|
if (!readStatsCache.has(normalizedPath)) {
|
|
83
83
|
if (exists(normalizedPath)) {
|
|
84
84
|
readStatsCache.set(normalizedPath, fs.statSync(normalizedPath));
|
|
@@ -87,7 +87,7 @@ function readStats(path) {
|
|
|
87
87
|
return readStatsCache.get(normalizedPath);
|
|
88
88
|
}
|
|
89
89
|
function readFile(path, encoding) {
|
|
90
|
-
const normalizedPath = path_1.normalize(path);
|
|
90
|
+
const normalizedPath = (0, path_1.normalize)(path);
|
|
91
91
|
if (!readFileCache.has(normalizedPath)) {
|
|
92
92
|
const stats = readStats(normalizedPath);
|
|
93
93
|
if (stats && stats.isFile()) {
|
|
@@ -100,7 +100,7 @@ function readFile(path, encoding) {
|
|
|
100
100
|
return readFileCache.get(normalizedPath);
|
|
101
101
|
}
|
|
102
102
|
function readDir(path) {
|
|
103
|
-
const normalizedPath = path_1.normalize(path);
|
|
103
|
+
const normalizedPath = (0, path_1.normalize)(path);
|
|
104
104
|
if (!readDirCache.has(normalizedPath)) {
|
|
105
105
|
const stats = readStats(normalizedPath);
|
|
106
106
|
if (stats && stats.isDirectory()) {
|
|
@@ -113,43 +113,43 @@ function readDir(path) {
|
|
|
113
113
|
return readDirCache.get(normalizedPath) || [];
|
|
114
114
|
}
|
|
115
115
|
function getRealPath(path) {
|
|
116
|
-
const normalizedPath = path_1.normalize(path);
|
|
116
|
+
const normalizedPath = (0, path_1.normalize)(path);
|
|
117
117
|
if (!realPathCache.has(normalizedPath)) {
|
|
118
118
|
let base = normalizedPath;
|
|
119
119
|
let nested = '';
|
|
120
|
-
while (base !== path_1.dirname(base)) {
|
|
120
|
+
while (base !== (0, path_1.dirname)(base)) {
|
|
121
121
|
if (exists(base)) {
|
|
122
|
-
realPathCache.set(normalizedPath, path_1.normalize(path_1.join(fs.realpathSync(base), nested)));
|
|
122
|
+
realPathCache.set(normalizedPath, (0, path_1.normalize)((0, path_1.join)(fs.realpathSync(base), nested)));
|
|
123
123
|
break;
|
|
124
124
|
}
|
|
125
|
-
nested = path_1.join(path_1.basename(base), nested);
|
|
126
|
-
base = path_1.dirname(base);
|
|
125
|
+
nested = (0, path_1.join)((0, path_1.basename)(base), nested);
|
|
126
|
+
base = (0, path_1.dirname)(base);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
return realPathCache.get(normalizedPath) || normalizedPath;
|
|
130
130
|
}
|
|
131
131
|
function createDir(path) {
|
|
132
|
-
const normalizedPath = path_1.normalize(path);
|
|
132
|
+
const normalizedPath = (0, path_1.normalize)(path);
|
|
133
133
|
fs.mkdirSync(normalizedPath, { recursive: true });
|
|
134
134
|
// update cache
|
|
135
135
|
existsCache.set(normalizedPath, true);
|
|
136
|
-
if (readDirCache.has(path_1.dirname(normalizedPath))) {
|
|
137
|
-
readDirCache.delete(path_1.dirname(normalizedPath));
|
|
136
|
+
if (readDirCache.has((0, path_1.dirname)(normalizedPath))) {
|
|
137
|
+
readDirCache.delete((0, path_1.dirname)(normalizedPath));
|
|
138
138
|
}
|
|
139
139
|
if (readStatsCache.has(normalizedPath)) {
|
|
140
140
|
readStatsCache.delete(normalizedPath);
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
function writeFile(path, data) {
|
|
144
|
-
const normalizedPath = path_1.normalize(path);
|
|
145
|
-
if (!exists(path_1.dirname(normalizedPath))) {
|
|
146
|
-
createDir(path_1.dirname(normalizedPath));
|
|
144
|
+
const normalizedPath = (0, path_1.normalize)(path);
|
|
145
|
+
if (!exists((0, path_1.dirname)(normalizedPath))) {
|
|
146
|
+
createDir((0, path_1.dirname)(normalizedPath));
|
|
147
147
|
}
|
|
148
148
|
fs.writeFileSync(normalizedPath, data);
|
|
149
149
|
// update cache
|
|
150
150
|
existsCache.set(normalizedPath, true);
|
|
151
|
-
if (readDirCache.has(path_1.dirname(normalizedPath))) {
|
|
152
|
-
readDirCache.delete(path_1.dirname(normalizedPath));
|
|
151
|
+
if (readDirCache.has((0, path_1.dirname)(normalizedPath))) {
|
|
152
|
+
readDirCache.delete((0, path_1.dirname)(normalizedPath));
|
|
153
153
|
}
|
|
154
154
|
if (readStatsCache.has(normalizedPath)) {
|
|
155
155
|
readStatsCache.delete(normalizedPath);
|
|
@@ -160,12 +160,12 @@ function writeFile(path, data) {
|
|
|
160
160
|
}
|
|
161
161
|
function deleteFile(path) {
|
|
162
162
|
if (exists(path)) {
|
|
163
|
-
const normalizedPath = path_1.normalize(path);
|
|
163
|
+
const normalizedPath = (0, path_1.normalize)(path);
|
|
164
164
|
fs.unlinkSync(normalizedPath);
|
|
165
165
|
// update cache
|
|
166
166
|
existsCache.set(normalizedPath, false);
|
|
167
|
-
if (readDirCache.has(path_1.dirname(normalizedPath))) {
|
|
168
|
-
readDirCache.delete(path_1.dirname(normalizedPath));
|
|
167
|
+
if (readDirCache.has((0, path_1.dirname)(normalizedPath))) {
|
|
168
|
+
readDirCache.delete((0, path_1.dirname)(normalizedPath));
|
|
169
169
|
}
|
|
170
170
|
if (readStatsCache.has(normalizedPath)) {
|
|
171
171
|
readStatsCache.delete(normalizedPath);
|
|
@@ -177,8 +177,8 @@ function deleteFile(path) {
|
|
|
177
177
|
}
|
|
178
178
|
function updateTimes(path, atime, mtime) {
|
|
179
179
|
if (exists(path)) {
|
|
180
|
-
const normalizedPath = path_1.normalize(path);
|
|
181
|
-
fs.utimesSync(path_1.normalize(path), atime, mtime);
|
|
180
|
+
const normalizedPath = (0, path_1.normalize)(path);
|
|
181
|
+
fs.utimesSync((0, path_1.normalize)(path), atime, mtime);
|
|
182
182
|
// update cache
|
|
183
183
|
if (readStatsCache.has(normalizedPath)) {
|
|
184
184
|
readStatsCache.delete(normalizedPath);
|
|
@@ -6,7 +6,7 @@ const system_1 = require("../system");
|
|
|
6
6
|
const typescript_1 = require("../typescript");
|
|
7
7
|
const watch_compiler_host_1 = require("./watch-compiler-host");
|
|
8
8
|
function createWatchSolutionBuilderHost(parsedConfig, createProgram, reportDiagnostic, reportWatchStatus, reportSolutionBuilderStatus, afterProgramCreate, afterProgramEmitAndDiagnostics) {
|
|
9
|
-
const controlledWatchCompilerHost = watch_compiler_host_1.createWatchCompilerHost(parsedConfig, createProgram, reportDiagnostic, reportWatchStatus, afterProgramCreate);
|
|
9
|
+
const controlledWatchCompilerHost = (0, watch_compiler_host_1.createWatchCompilerHost)(parsedConfig, createProgram, reportDiagnostic, reportWatchStatus, afterProgramCreate);
|
|
10
10
|
let controlledWatchSolutionBuilderHost = Object.assign(Object.assign({}, controlledWatchCompilerHost), { reportDiagnostic(diagnostic) {
|
|
11
11
|
if (reportDiagnostic) {
|
|
12
12
|
reportDiagnostic(diagnostic);
|
|
@@ -8,9 +8,9 @@ const typescript_1 = require("../typescript");
|
|
|
8
8
|
let compilerHost;
|
|
9
9
|
let program;
|
|
10
10
|
function useProgram() {
|
|
11
|
-
const parsedConfig = config_1.getParsedConfig();
|
|
11
|
+
const parsedConfig = (0, config_1.getParsedConfig)();
|
|
12
12
|
if (!compilerHost) {
|
|
13
|
-
compilerHost = compiler_host_1.createCompilerHost(parsedConfig);
|
|
13
|
+
compilerHost = (0, compiler_host_1.createCompilerHost)(parsedConfig);
|
|
14
14
|
}
|
|
15
15
|
if (!program) {
|
|
16
16
|
program = typescript_1.typescript.createProgram({
|
|
@@ -20,7 +20,7 @@ function useProgram() {
|
|
|
20
20
|
host: compilerHost,
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
-
diagnostics_1.updateDiagnostics(config_1.getConfigFilePathFromProgram(program), diagnostics_1.getDiagnosticsOfProgram(program));
|
|
23
|
+
(0, diagnostics_1.updateDiagnostics)((0, config_1.getConfigFilePathFromProgram)(program), (0, diagnostics_1.getDiagnosticsOfProgram)(program));
|
|
24
24
|
}
|
|
25
25
|
exports.useProgram = useProgram;
|
|
26
26
|
function invalidateProgram(withHost = false) {
|
|
@@ -12,16 +12,16 @@ let solutionBuilderHost;
|
|
|
12
12
|
let solutionBuilder;
|
|
13
13
|
function useSolutionBuilder() {
|
|
14
14
|
if (!solutionBuilderHost) {
|
|
15
|
-
const parsedConfig = config_1.getParsedConfig();
|
|
16
|
-
solutionBuilderHost = watch_solution_builder_host_1.createWatchSolutionBuilderHost(parsedConfig, (rootNames, compilerOptions, host, oldProgram, configFileParsingDiagnostics, projectReferences) => {
|
|
15
|
+
const parsedConfig = (0, config_1.getParsedConfig)();
|
|
16
|
+
solutionBuilderHost = (0, watch_solution_builder_host_1.createWatchSolutionBuilderHost)(parsedConfig, (rootNames, compilerOptions, host, oldProgram, configFileParsingDiagnostics, projectReferences) => {
|
|
17
17
|
if (compilerOptions) {
|
|
18
|
-
tracing_1.startTracingIfNeeded(compilerOptions);
|
|
18
|
+
(0, tracing_1.startTracingIfNeeded)(compilerOptions);
|
|
19
19
|
}
|
|
20
20
|
return typescript_1.typescript.createSemanticDiagnosticsBuilderProgram(rootNames, compilerOptions, host, oldProgram, configFileParsingDiagnostics, projectReferences);
|
|
21
21
|
}, undefined, undefined, undefined, undefined, (builderProgram) => {
|
|
22
|
-
diagnostics_1.updateDiagnostics(config_1.getConfigFilePathFromBuilderProgram(builderProgram), diagnostics_1.getDiagnosticsOfProgram(builderProgram));
|
|
23
|
-
tsbuildinfo_1.emitTsBuildInfoIfNeeded(builderProgram);
|
|
24
|
-
tracing_1.stopTracingIfNeeded(builderProgram);
|
|
22
|
+
(0, diagnostics_1.updateDiagnostics)((0, config_1.getConfigFilePathFromBuilderProgram)(builderProgram), (0, diagnostics_1.getDiagnosticsOfProgram)(builderProgram));
|
|
23
|
+
(0, tsbuildinfo_1.emitTsBuildInfoIfNeeded)(builderProgram);
|
|
24
|
+
(0, tracing_1.stopTracingIfNeeded)(builderProgram);
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
if (!solutionBuilder) {
|
|
@@ -13,16 +13,16 @@ let watchProgram;
|
|
|
13
13
|
let shouldUpdateRootFiles = false;
|
|
14
14
|
function useWatchProgram() {
|
|
15
15
|
if (!watchCompilerHost) {
|
|
16
|
-
const parsedConfig = config_1.getParsedConfig();
|
|
17
|
-
watchCompilerHost = watch_compiler_host_1.createWatchCompilerHost(parsedConfig, (rootNames, compilerOptions, host, oldProgram, configFileParsingDiagnostics, projectReferences) => {
|
|
16
|
+
const parsedConfig = (0, config_1.getParsedConfig)();
|
|
17
|
+
watchCompilerHost = (0, watch_compiler_host_1.createWatchCompilerHost)(parsedConfig, (rootNames, compilerOptions, host, oldProgram, configFileParsingDiagnostics, projectReferences) => {
|
|
18
18
|
if (compilerOptions) {
|
|
19
|
-
tracing_1.startTracingIfNeeded(compilerOptions);
|
|
19
|
+
(0, tracing_1.startTracingIfNeeded)(compilerOptions);
|
|
20
20
|
}
|
|
21
21
|
return typescript_1.typescript.createSemanticDiagnosticsBuilderProgram(rootNames, compilerOptions, host, oldProgram, configFileParsingDiagnostics, projectReferences);
|
|
22
22
|
}, undefined, undefined, (builderProgram) => {
|
|
23
|
-
diagnostics_1.updateDiagnostics(config_1.getConfigFilePathFromBuilderProgram(builderProgram), diagnostics_1.getDiagnosticsOfProgram(builderProgram));
|
|
24
|
-
tsbuildinfo_1.emitTsBuildInfoIfNeeded(builderProgram);
|
|
25
|
-
tracing_1.stopTracingIfNeeded(builderProgram);
|
|
23
|
+
(0, diagnostics_1.updateDiagnostics)((0, config_1.getConfigFilePathFromBuilderProgram)(builderProgram), (0, diagnostics_1.getDiagnosticsOfProgram)(builderProgram));
|
|
24
|
+
(0, tsbuildinfo_1.emitTsBuildInfoIfNeeded)(builderProgram);
|
|
25
|
+
(0, tracing_1.stopTracingIfNeeded)(builderProgram);
|
|
26
26
|
});
|
|
27
27
|
watchProgram = undefined;
|
|
28
28
|
}
|
|
@@ -31,7 +31,7 @@ function useWatchProgram() {
|
|
|
31
31
|
}
|
|
32
32
|
if (shouldUpdateRootFiles) {
|
|
33
33
|
// we have to update root files manually as don't use config file as a program input
|
|
34
|
-
watchProgram.updateRootFileNames(dependencies_1.getDependencies().files);
|
|
34
|
+
watchProgram.updateRootFileNames((0, dependencies_1.getDependencies)().files);
|
|
35
35
|
shouldUpdateRootFiles = false;
|
|
36
36
|
}
|
|
37
37
|
}
|