fork-ts-checker-webpack-plugin 7.0.0-alpha.11 → 7.0.0-alpha.15
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 +39 -24
- package/lib/files-change.d.ts +2 -1
- package/lib/files-change.js +20 -13
- package/lib/formatter/{BasicFormatter.d.ts → basic-formatter.d.ts} +1 -1
- package/lib/formatter/{BasicFormatter.js → basic-formatter.js} +0 -0
- package/lib/formatter/{CodeFrameFormatter.d.ts → code-frame-formatter.d.ts} +1 -1
- package/lib/formatter/{CodeFrameFormatter.js → code-frame-formatter.js} +2 -2
- package/lib/formatter/formatter-config.d.ts +5 -0
- package/lib/formatter/{FormatterConfiguration.js → formatter-config.js} +8 -8
- package/lib/formatter/{FormatterOptions.d.ts → formatter-options.d.ts} +1 -1
- package/lib/{ForkTsCheckerWebpackPluginOptions.js → formatter/formatter-options.js} +0 -0
- package/lib/formatter/{Formatter.d.ts → formatter.d.ts} +0 -0
- package/lib/formatter/{Formatter.js → formatter.js} +0 -0
- package/lib/formatter/index.d.ts +6 -6
- package/lib/formatter/index.js +6 -6
- package/lib/formatter/{WebpackFormatter.d.ts → webpack-formatter.d.ts} +1 -1
- package/lib/formatter/{WebpackFormatter.js → webpack-formatter.js} +2 -2
- package/lib/hooks/intercept-done-to-get-dev-server-tap.d.ts +5 -0
- package/lib/hooks/{interceptDoneToGetWebpackDevServerTap.js → intercept-done-to-get-dev-server-tap.js} +4 -6
- package/lib/hooks/tap-after-compile-to-add-dependencies.d.ts +5 -0
- package/lib/hooks/{tapAfterCompileToAddDependencies.js → tap-after-compile-to-add-dependencies.js} +1 -1
- package/lib/hooks/tap-after-compile-to-get-issues.d.ts +5 -0
- package/lib/hooks/{tapAfterCompileToGetIssues.js → tap-after-compile-to-get-issues.js} +6 -6
- package/lib/hooks/{tapAfterEnvironmentToPatchWatching.d.ts → tap-after-environment-to-patch-watching.d.ts} +1 -1
- package/lib/hooks/{tapAfterEnvironmentToPatchWatching.js → tap-after-environment-to-patch-watching.js} +2 -2
- package/lib/hooks/tap-done-to-async-get-issues.d.ts +5 -0
- package/lib/hooks/{tapDoneToAsyncGetIssues.js → tap-done-to-async-get-issues.js} +15 -15
- package/lib/hooks/tap-error-to-log-message.d.ts +4 -0
- package/lib/hooks/{tapErrorToLogMessage.js → tap-error-to-log-message.js} +7 -7
- package/lib/hooks/{tapStartToRunWorkers.d.ts → tap-start-to-run-workers.d.ts} +4 -4
- package/lib/hooks/{tapStartToRunWorkers.js → tap-start-to-run-workers.js} +13 -13
- package/lib/hooks/{tapStopToTerminateWorkers.d.ts → tap-stop-to-terminate-workers.d.ts} +2 -2
- package/lib/hooks/{tapStopToTerminateWorkers.js → tap-stop-to-terminate-workers.js} +0 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/infrastructure-logger.d.ts +1 -2
- package/lib/issue/index.d.ts +3 -3
- package/lib/issue/index.js +3 -3
- package/lib/issue/issue-config.d.ts +8 -0
- package/lib/issue/issue-config.js +29 -0
- package/lib/issue/{IssueLocation.d.ts → issue-location.d.ts} +1 -1
- package/lib/issue/{IssueLocation.js → issue-location.js} +3 -3
- package/lib/issue/{IssueMatch.d.ts → issue-match.d.ts} +1 -1
- package/lib/issue/{IssueMatch.js → issue-match.js} +2 -2
- package/lib/issue/{IssueOptions.d.ts → issue-options.d.ts} +2 -2
- package/lib/{formatter/FormatterOptions.js → issue/issue-options.js} +0 -0
- package/lib/issue/{IssuePosition.d.ts → issue-position.d.ts} +0 -0
- package/lib/issue/{IssuePosition.js → issue-position.js} +0 -0
- package/lib/issue/{IssuePredicate.d.ts → issue-predicate.d.ts} +0 -0
- package/lib/issue/{IssuePredicate.js → issue-predicate.js} +0 -0
- package/lib/issue/{IssueSeverity.d.ts → issue-severity.d.ts} +0 -0
- package/lib/issue/{IssueSeverity.js → issue-severity.js} +0 -0
- package/lib/issue/{IssueWebpackError.d.ts → issue-webpack-error.d.ts} +1 -1
- package/lib/issue/{IssueWebpackError.js → issue-webpack-error.js} +4 -4
- package/lib/issue/{Issue.d.ts → issue.d.ts} +2 -2
- package/lib/issue/{Issue.js → issue.js} +5 -5
- package/lib/{logger/Logger.d.ts → logger.d.ts} +1 -2
- package/lib/{issue/IssueOptions.js → logger.js} +0 -0
- package/lib/plugin-config.d.ts +16 -0
- package/lib/plugin-config.js +17 -0
- package/lib/{hooks/pluginHooks.d.ts → plugin-hooks.d.ts} +6 -6
- package/lib/{hooks/pluginHooks.js → plugin-hooks.js} +8 -8
- package/lib/plugin-options.d.ts +13 -0
- package/lib/{logger/Logger.js → plugin-options.js} +0 -0
- package/lib/{ForkTsCheckerWebpackPluginOptions.json → plugin-options.json} +9 -44
- package/lib/{hooks/pluginPools.d.ts → plugin-pools.d.ts} +1 -1
- package/lib/{hooks/pluginPools.js → plugin-pools.js} +1 -1
- package/lib/{ForkTsCheckerWebpackPluginState.d.ts → plugin-state.d.ts} +2 -2
- package/lib/{ForkTsCheckerWebpackPluginState.js → plugin-state.js} +3 -3
- package/lib/{ForkTsCheckerWebpackPlugin.d.ts → plugin.d.ts} +2 -2
- package/lib/plugin.js +82 -0
- package/lib/{utils/rpc/expose.d.ts → rpc/expose-rpc.d.ts} +0 -0
- package/lib/{utils/rpc/expose.js → rpc/expose-rpc.js} +0 -0
- package/lib/rpc/index.d.ts +5 -0
- package/lib/{utils/rpc → rpc}/index.js +9 -9
- package/lib/{utils/rpc/error.d.ts → rpc/rpc-error.d.ts} +0 -0
- package/lib/{utils/rpc/error.js → rpc/rpc-error.js} +0 -0
- package/lib/{utils/rpc/worker.d.ts → rpc/rpc-worker.d.ts} +0 -0
- package/lib/{utils/rpc/worker.js → rpc/rpc-worker.js} +2 -2
- package/lib/{utils/rpc → rpc}/types.d.ts +0 -0
- package/lib/{utils/rpc → rpc}/types.js +0 -0
- package/lib/{utils/rpc/wrap.d.ts → rpc/wrap-rpc.d.ts} +0 -0
- package/lib/{utils/rpc/wrap.js → rpc/wrap-rpc.js} +2 -2
- package/lib/typescript/extension/{TypeScriptEmbeddedExtension.d.ts → type-script-embedded-extension.d.ts} +1 -1
- package/lib/typescript/extension/{TypeScriptEmbeddedExtension.js → type-script-embedded-extension.js} +0 -0
- package/lib/typescript/extension/{TypeScriptExtension.d.ts → type-script-extension.d.ts} +0 -0
- package/lib/{logger/LoggerOptions.js → typescript/extension/type-script-extension.js} +0 -0
- package/lib/typescript/extension/vue/type-script-vue-extension-config.d.ts +7 -0
- package/lib/typescript/extension/vue/{TypeScriptVueExtensionConfiguration.js → type-script-vue-extension-config.js} +3 -3
- package/lib/typescript/extension/vue/{TypeScriptVueExtensionOptions.d.ts → type-script-vue-extension-options.d.ts} +0 -0
- package/lib/typescript/{TypeScriptConfigurationOverwrite.js → extension/vue/type-script-vue-extension-options.js} +0 -0
- package/lib/typescript/extension/vue/type-script-vue-extension-support.d.ts +3 -0
- package/lib/typescript/extension/vue/{TypeScriptVueExtensionSupport.js → type-script-vue-extension-support.js} +2 -2
- package/lib/typescript/extension/vue/type-script-vue-extension.d.ts +4 -0
- package/lib/typescript/extension/vue/{TypeScriptVueExtension.js → type-script-vue-extension.js} +4 -4
- package/lib/typescript/{TypeScriptConfigurationOverwrite.d.ts → type-script-config-overwrite.d.ts} +2 -2
- package/lib/typescript/{TypeScriptDiagnosticsOptions.js → type-script-config-overwrite.js} +0 -0
- package/lib/typescript/{TypeScriptDiagnosticsOptions.d.ts → type-script-diagnostics-options.d.ts} +0 -0
- package/lib/typescript/{TypeScriptReporterOptions.js → type-script-diagnostics-options.js} +0 -0
- package/lib/typescript/type-script-support.d.ts +3 -0
- package/lib/typescript/{TypeScriptSupport.js → type-script-support.js} +8 -8
- package/lib/typescript/type-script-worker-config.d.ts +22 -0
- package/lib/typescript/{TypeScriptReporterConfiguration.js → type-script-worker-config.js} +5 -5
- package/lib/typescript/type-script-worker-options.d.ts +18 -0
- package/lib/typescript/{extension/TypeScriptExtension.js → type-script-worker-options.js} +0 -0
- package/lib/typescript/worker/get-dependencies-worker.js +1 -1
- package/lib/typescript/worker/get-issues-worker.js +2 -3
- package/lib/typescript/worker/lib/artifacts.js +2 -2
- package/lib/typescript/worker/lib/config.d.ts +2 -2
- package/lib/typescript/worker/lib/config.js +3 -6
- package/lib/typescript/worker/lib/dependencies.js +2 -2
- package/lib/typescript/worker/lib/extensions.d.ts +1 -1
- package/lib/typescript/worker/lib/extensions.js +2 -2
- package/lib/typescript/worker/lib/system.js +26 -13
- package/lib/typescript/worker/lib/worker-config.d.ts +2 -2
- package/lib/typescript/worker/lib/worker-config.js +1 -1
- package/lib/utils/async/{isPending.d.ts → is-pending.d.ts} +1 -1
- package/lib/utils/async/{isPending.js → is-pending.js} +2 -1
- package/lib/utils/async/wait.d.ts +1 -1
- package/lib/utils/async/wait.js +2 -1
- package/lib/utils/path/{forwardSlash.d.ts → forward-slash.d.ts} +1 -1
- package/lib/utils/path/{forwardSlash.js → forward-slash.js} +2 -1
- package/lib/utils/path/{relativeToContext.d.ts → relative-to-context.d.ts} +0 -0
- package/lib/utils/path/{relativeToContext.js → relative-to-context.js} +2 -2
- package/lib/watch/{InclusiveNodeWatchFileSystem.d.ts → inclusive-node-watch-file-system.d.ts} +6 -6
- package/lib/watch/{InclusiveNodeWatchFileSystem.js → inclusive-node-watch-file-system.js} +36 -4
- package/lib/watch/{WatchFileSystem.d.ts → watch-file-system.d.ts} +1 -1
- package/lib/{typescript/extension/vue/TypeScriptVueExtensionOptions.js → watch/watch-file-system.js} +0 -0
- package/package.json +8 -2
- package/lib/ForkTsCheckerWebpackPlugin.js +0 -84
- package/lib/ForkTsCheckerWebpackPluginConfiguration.d.ts +0 -15
- package/lib/ForkTsCheckerWebpackPluginConfiguration.js +0 -17
- package/lib/ForkTsCheckerWebpackPluginOptions.d.ts +0 -12
- package/lib/formatter/FormatterConfiguration.d.ts +0 -5
- package/lib/hooks/interceptDoneToGetWebpackDevServerTap.d.ts +0 -5
- package/lib/hooks/tapAfterCompileToAddDependencies.d.ts +0 -5
- package/lib/hooks/tapAfterCompileToGetIssues.d.ts +0 -5
- package/lib/hooks/tapDoneToAsyncGetIssues.d.ts +0 -5
- package/lib/hooks/tapErrorToLogMessage.d.ts +0 -4
- package/lib/issue/IssueConfiguration.d.ts +0 -8
- package/lib/issue/IssueConfiguration.js +0 -29
- package/lib/logger/LoggerConfiguration.d.ts +0 -10
- package/lib/logger/LoggerConfiguration.js +0 -12
- package/lib/logger/LoggerFactory.d.ts +0 -5
- package/lib/logger/LoggerFactory.js +0 -21
- package/lib/logger/LoggerOptions.d.ts +0 -8
- package/lib/logger/PartialLogger.d.ts +0 -4
- package/lib/logger/PartialLogger.js +0 -11
- package/lib/logger/WebpackInfrastructureLogger.d.ts +0 -4
- package/lib/logger/WebpackInfrastructureLogger.js +0 -13
- package/lib/typescript/TypeScriptReporterConfiguration.d.ts +0 -22
- package/lib/typescript/TypeScriptReporterOptions.d.ts +0 -18
- package/lib/typescript/TypeScriptSupport.d.ts +0 -3
- package/lib/typescript/extension/vue/TypeScriptVueExtension.d.ts +0 -4
- package/lib/typescript/extension/vue/TypeScriptVueExtensionConfiguration.d.ts +0 -7
- package/lib/typescript/extension/vue/TypeScriptVueExtensionSupport.d.ts +0 -3
- package/lib/utils/array/flatten.d.ts +0 -2
- package/lib/utils/array/flatten.js +0 -6
- package/lib/utils/array/intersect.d.ts +0 -2
- package/lib/utils/array/intersect.js +0 -6
- package/lib/utils/array/substract.d.ts +0 -2
- package/lib/utils/array/substract.js +0 -6
- package/lib/utils/array/unique.d.ts +0 -2
- package/lib/utils/array/unique.js +0 -6
- package/lib/utils/rpc/index.d.ts +0 -5
- package/lib/watch/WatchFileSystem.js +0 -2
package/lib/plugin.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.ForkTsCheckerWebpackPlugin = void 0;
|
|
26
|
+
const path = __importStar(require("path"));
|
|
27
|
+
const cosmiconfig_1 = require("cosmiconfig");
|
|
28
|
+
const deepmerge_1 = __importDefault(require("deepmerge"));
|
|
29
|
+
const schema_utils_1 = require("schema-utils");
|
|
30
|
+
const tap_after_compile_to_add_dependencies_1 = require("./hooks/tap-after-compile-to-add-dependencies");
|
|
31
|
+
const tap_after_environment_to_patch_watching_1 = require("./hooks/tap-after-environment-to-patch-watching");
|
|
32
|
+
const tap_error_to_log_message_1 = require("./hooks/tap-error-to-log-message");
|
|
33
|
+
const tap_start_to_run_workers_1 = require("./hooks/tap-start-to-run-workers");
|
|
34
|
+
const tap_stop_to_terminate_workers_1 = require("./hooks/tap-stop-to-terminate-workers");
|
|
35
|
+
const plugin_config_1 = require("./plugin-config");
|
|
36
|
+
const plugin_hooks_1 = require("./plugin-hooks");
|
|
37
|
+
const plugin_options_json_1 = __importDefault(require("./plugin-options.json"));
|
|
38
|
+
const plugin_pools_1 = require("./plugin-pools");
|
|
39
|
+
const plugin_state_1 = require("./plugin-state");
|
|
40
|
+
const rpc_1 = require("./rpc");
|
|
41
|
+
const type_script_support_1 = require("./typescript/type-script-support");
|
|
42
|
+
class ForkTsCheckerWebpackPlugin {
|
|
43
|
+
constructor(options = {}) {
|
|
44
|
+
const explorerSync = cosmiconfig_1.cosmiconfigSync('fork-ts-checker');
|
|
45
|
+
const { config: externalOptions } = explorerSync.search() || {};
|
|
46
|
+
// first validate options directly passed to the constructor
|
|
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 || {});
|
|
50
|
+
// then validate merged options
|
|
51
|
+
schema_utils_1.validate(plugin_options_json_1.default, this.options, config);
|
|
52
|
+
}
|
|
53
|
+
static getCompilerHooks(compiler) {
|
|
54
|
+
return plugin_hooks_1.getPluginHooks(compiler);
|
|
55
|
+
}
|
|
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);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.ForkTsCheckerWebpackPlugin = ForkTsCheckerWebpackPlugin;
|
|
70
|
+
/**
|
|
71
|
+
* Current version of the plugin
|
|
72
|
+
*/
|
|
73
|
+
ForkTsCheckerWebpackPlugin.version = '7.0.0-alpha.15'; // will be replaced by the @semantic-release/exec
|
|
74
|
+
/**
|
|
75
|
+
* Default pools for the plugin concurrency limit
|
|
76
|
+
*/
|
|
77
|
+
ForkTsCheckerWebpackPlugin.issuesPool = plugin_pools_1.issuesPool;
|
|
78
|
+
ForkTsCheckerWebpackPlugin.dependenciesPool = plugin_pools_1.dependenciesPool;
|
|
79
|
+
/**
|
|
80
|
+
* @deprecated Use ForkTsCheckerWebpackPlugin.issuesPool instead
|
|
81
|
+
*/
|
|
82
|
+
ForkTsCheckerWebpackPlugin.pool = plugin_pools_1.issuesPool;
|
|
File without changes
|
|
File without changes
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RpcExitError = exports.getRpcWorkerData = exports.createRpcWorker = exports.wrapRpc = exports.exposeRpc = void 0;
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "exposeRpc", { enumerable: true, get: function () { return
|
|
6
|
-
var
|
|
7
|
-
Object.defineProperty(exports, "wrapRpc", { enumerable: true, get: function () { return
|
|
8
|
-
var
|
|
9
|
-
Object.defineProperty(exports, "createRpcWorker", { enumerable: true, get: function () { return
|
|
10
|
-
Object.defineProperty(exports, "getRpcWorkerData", { enumerable: true, get: function () { return
|
|
11
|
-
var
|
|
12
|
-
Object.defineProperty(exports, "RpcExitError", { enumerable: true, get: function () { return
|
|
4
|
+
var expose_rpc_1 = require("./expose-rpc");
|
|
5
|
+
Object.defineProperty(exports, "exposeRpc", { enumerable: true, get: function () { return expose_rpc_1.exposeRpc; } });
|
|
6
|
+
var wrap_rpc_1 = require("./wrap-rpc");
|
|
7
|
+
Object.defineProperty(exports, "wrapRpc", { enumerable: true, get: function () { return wrap_rpc_1.wrapRpc; } });
|
|
8
|
+
var rpc_worker_1 = require("./rpc-worker");
|
|
9
|
+
Object.defineProperty(exports, "createRpcWorker", { enumerable: true, get: function () { return rpc_worker_1.createRpcWorker; } });
|
|
10
|
+
Object.defineProperty(exports, "getRpcWorkerData", { enumerable: true, get: function () { return rpc_worker_1.getRpcWorkerData; } });
|
|
11
|
+
var rpc_error_1 = require("./rpc-error");
|
|
12
|
+
Object.defineProperty(exports, "RpcExitError", { enumerable: true, get: function () { return rpc_error_1.RpcExitError; } });
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -22,7 +22,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
exports.getRpcWorkerData = exports.createRpcWorker = void 0;
|
|
23
23
|
const child_process = __importStar(require("child_process"));
|
|
24
24
|
const process = __importStar(require("process"));
|
|
25
|
-
const
|
|
25
|
+
const wrap_rpc_1 = require("./wrap-rpc");
|
|
26
26
|
const WORKER_DATA_ENV_KEY = 'WORKER_DATA';
|
|
27
27
|
function createRpcWorker(modulePath, data, memoryLimit) {
|
|
28
28
|
const options = {
|
|
@@ -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 =
|
|
47
|
+
remoteMethod = wrap_rpc_1.wrapRpc(childProcess);
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
terminate() {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -30,7 +30,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
30
30
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
31
|
exports.wrapRpc = void 0;
|
|
32
32
|
const process = __importStar(require("process"));
|
|
33
|
-
const
|
|
33
|
+
const rpc_error_1 = require("./rpc-error");
|
|
34
34
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
35
35
|
function wrapRpc(childProcess) {
|
|
36
36
|
return ((...args) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -55,7 +55,7 @@ function wrapRpc(childProcess) {
|
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
const handleClose = (code, signal) => {
|
|
58
|
-
reject(new
|
|
58
|
+
reject(new rpc_error_1.RpcExitError(code
|
|
59
59
|
? `Process ${process.pid} exited with code "${code}" [${signal}]`
|
|
60
60
|
: `Process ${process.pid} exited [${signal}].`, code, signal));
|
|
61
61
|
unsubscribe();
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TypeScriptVueExtensionOptions } from './type-script-vue-extension-options';
|
|
2
|
+
interface TypeScriptVueExtensionConfig {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
compiler: string;
|
|
5
|
+
}
|
|
6
|
+
declare function createTypeScriptVueExtensionConfig(options: TypeScriptVueExtensionOptions | undefined): TypeScriptVueExtensionConfig;
|
|
7
|
+
export { TypeScriptVueExtensionConfig, createTypeScriptVueExtensionConfig };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
function
|
|
3
|
+
exports.createTypeScriptVueExtensionConfig = void 0;
|
|
4
|
+
function createTypeScriptVueExtensionConfig(options) {
|
|
5
5
|
return Object.assign({ enabled: options === true, compiler: 'vue-template-compiler' }, (typeof options === 'object' ? options : {}));
|
|
6
6
|
}
|
|
7
|
-
exports.
|
|
7
|
+
exports.createTypeScriptVueExtensionConfig = createTypeScriptVueExtensionConfig;
|
|
File without changes
|
|
File without changes
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.assertTypeScriptVueExtensionSupport = void 0;
|
|
4
|
-
function assertTypeScriptVueExtensionSupport(
|
|
4
|
+
function assertTypeScriptVueExtensionSupport(config) {
|
|
5
5
|
// We need to import template compiler for vue lazily because it cannot be included it
|
|
6
6
|
// as direct dependency because it is an optional dependency of fork-ts-checker-webpack-plugin.
|
|
7
7
|
// Since its version must not mismatch with user-installed Vue.js,
|
|
8
8
|
// we should let the users install template compiler for vue by themselves.
|
|
9
|
-
const compilerName =
|
|
9
|
+
const compilerName = config.compiler;
|
|
10
10
|
try {
|
|
11
11
|
require(compilerName);
|
|
12
12
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TypeScriptExtension } from '../type-script-extension';
|
|
2
|
+
import type { TypeScriptVueExtensionConfig } from './type-script-vue-extension-config';
|
|
3
|
+
declare function createTypeScriptVueExtension(config: TypeScriptVueExtensionConfig): TypeScriptExtension;
|
|
4
|
+
export { createTypeScriptVueExtension };
|
package/lib/typescript/extension/vue/{TypeScriptVueExtension.js → type-script-vue-extension.js}
RENAMED
|
@@ -5,10 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createTypeScriptVueExtension = void 0;
|
|
7
7
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
-
const
|
|
9
|
-
function createTypeScriptVueExtension(
|
|
8
|
+
const type_script_embedded_extension_1 = require("../type-script-embedded-extension");
|
|
9
|
+
function createTypeScriptVueExtension(config) {
|
|
10
10
|
function loadVueTemplateCompiler() {
|
|
11
|
-
return require(
|
|
11
|
+
return require(config.compiler);
|
|
12
12
|
}
|
|
13
13
|
function isVueTemplateCompilerV2(compiler) {
|
|
14
14
|
return typeof compiler.parseComponent === 'function';
|
|
@@ -108,7 +108,7 @@ function createTypeScriptVueExtension(configuration) {
|
|
|
108
108
|
return createVueInlineScriptEmbeddedSource(paddedSourceText, script.attrs.lang);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
return
|
|
111
|
+
return type_script_embedded_extension_1.createTypeScriptEmbeddedExtension({
|
|
112
112
|
embeddedExtensions: ['.vue'],
|
|
113
113
|
getEmbeddedSource: getVueEmbeddedSource,
|
|
114
114
|
});
|
package/lib/typescript/{TypeScriptConfigurationOverwrite.d.ts → type-script-config-overwrite.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface
|
|
1
|
+
interface TypeScriptConfigOverwrite {
|
|
2
2
|
extends?: string;
|
|
3
3
|
compilerOptions?: any;
|
|
4
4
|
include?: string[];
|
|
@@ -9,4 +9,4 @@ interface TypeScriptConfigurationOverwrite {
|
|
|
9
9
|
prepend?: boolean;
|
|
10
10
|
}[];
|
|
11
11
|
}
|
|
12
|
-
export {
|
|
12
|
+
export { TypeScriptConfigOverwrite };
|
|
File without changes
|
package/lib/typescript/{TypeScriptDiagnosticsOptions.d.ts → type-script-diagnostics-options.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
@@ -26,12 +26,12 @@ exports.assertTypeScriptSupport = void 0;
|
|
|
26
26
|
const os_1 = __importDefault(require("os"));
|
|
27
27
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
28
28
|
const semver = __importStar(require("semver"));
|
|
29
|
-
const
|
|
30
|
-
function assertTypeScriptSupport(
|
|
29
|
+
const type_script_vue_extension_support_1 = require("./extension/vue/type-script-vue-extension-support");
|
|
30
|
+
function assertTypeScriptSupport(config) {
|
|
31
31
|
let typescriptVersion;
|
|
32
32
|
try {
|
|
33
33
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
34
|
-
typescriptVersion = require(
|
|
34
|
+
typescriptVersion = require(config.typescriptPath).version;
|
|
35
35
|
}
|
|
36
36
|
catch (error) {
|
|
37
37
|
// silent catch
|
|
@@ -45,23 +45,23 @@ function assertTypeScriptSupport(configuration) {
|
|
|
45
45
|
'The minimum required version is 3.6.0.',
|
|
46
46
|
].join(os_1.default.EOL));
|
|
47
47
|
}
|
|
48
|
-
if (
|
|
48
|
+
if (config.build && semver.lt(typescriptVersion, '3.8.0')) {
|
|
49
49
|
throw new Error([
|
|
50
50
|
`ForkTsCheckerWebpackPlugin doesn't support build option for the current typescript version of ${typescriptVersion}.`,
|
|
51
51
|
'The minimum required version is 3.8.0.',
|
|
52
52
|
].join(os_1.default.EOL));
|
|
53
53
|
}
|
|
54
|
-
if (!fs_extra_1.default.existsSync(
|
|
54
|
+
if (!fs_extra_1.default.existsSync(config.configFile)) {
|
|
55
55
|
throw new Error([
|
|
56
|
-
`Cannot find the "${
|
|
56
|
+
`Cannot find the "${config.configFile}" file.`,
|
|
57
57
|
`Please check webpack and ForkTsCheckerWebpackPlugin configuration.`,
|
|
58
58
|
`Possible errors:`,
|
|
59
59
|
' - wrong `context` directory in webpack configuration (if `configFile` is not set or is a relative path in the fork plugin configuration)',
|
|
60
60
|
' - wrong `typescript.configFile` path in the plugin configuration (should be a relative or absolute path)',
|
|
61
61
|
].join(os_1.default.EOL));
|
|
62
62
|
}
|
|
63
|
-
if (
|
|
64
|
-
|
|
63
|
+
if (config.extensions.vue.enabled) {
|
|
64
|
+
type_script_vue_extension_support_1.assertTypeScriptVueExtensionSupport(config.extensions.vue);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
exports.assertTypeScriptSupport = assertTypeScriptSupport;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type webpack from 'webpack';
|
|
2
|
+
import type { TypeScriptVueExtensionConfig } from './extension/vue/type-script-vue-extension-config';
|
|
3
|
+
import type { TypeScriptConfigOverwrite } from './type-script-config-overwrite';
|
|
4
|
+
import type { TypeScriptDiagnosticsOptions } from './type-script-diagnostics-options';
|
|
5
|
+
import type { TypeScriptWorkerOptions } from './type-script-worker-options';
|
|
6
|
+
interface TypeScriptWorkerConfig {
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
memoryLimit: number;
|
|
9
|
+
configFile: string;
|
|
10
|
+
configOverwrite: TypeScriptConfigOverwrite;
|
|
11
|
+
build: boolean;
|
|
12
|
+
context: string;
|
|
13
|
+
mode: 'readonly' | 'write-tsbuildinfo' | 'write-dts' | 'write-references';
|
|
14
|
+
diagnosticOptions: TypeScriptDiagnosticsOptions;
|
|
15
|
+
extensions: {
|
|
16
|
+
vue: TypeScriptVueExtensionConfig;
|
|
17
|
+
};
|
|
18
|
+
profile: boolean;
|
|
19
|
+
typescriptPath: string;
|
|
20
|
+
}
|
|
21
|
+
declare function createTypeScriptWorkerConfig(compiler: webpack.Compiler, options: TypeScriptWorkerOptions | undefined): TypeScriptWorkerConfig;
|
|
22
|
+
export { createTypeScriptWorkerConfig, TypeScriptWorkerConfig };
|
|
@@ -3,11 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.createTypeScriptWorkerConfig = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const semver_1 = __importDefault(require("semver"));
|
|
9
|
-
const
|
|
10
|
-
function
|
|
9
|
+
const type_script_vue_extension_config_1 = require("./extension/vue/type-script-vue-extension-config");
|
|
10
|
+
function createTypeScriptWorkerConfig(compiler, options) {
|
|
11
11
|
let configFile = typeof options === 'object' ? options.configFile || 'tsconfig.json' : 'tsconfig.json';
|
|
12
12
|
// ensure that `configFile` is an absolute normalized path
|
|
13
13
|
configFile = path_1.default.normalize(path_1.default.isAbsolute(configFile)
|
|
@@ -25,7 +25,7 @@ function createTypeScriptReporterConfiguration(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:
|
|
28
|
+
vue: 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
|
-
exports.
|
|
31
|
+
exports.createTypeScriptWorkerConfig = createTypeScriptWorkerConfig;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TypeScriptVueExtensionOptions } from './extension/vue/type-script-vue-extension-options';
|
|
2
|
+
import type { TypeScriptConfigOverwrite } from './type-script-config-overwrite';
|
|
3
|
+
import type { TypeScriptDiagnosticsOptions } from './type-script-diagnostics-options';
|
|
4
|
+
declare type TypeScriptWorkerOptions = {
|
|
5
|
+
memoryLimit?: number;
|
|
6
|
+
configFile?: string;
|
|
7
|
+
configOverwrite?: TypeScriptConfigOverwrite;
|
|
8
|
+
context?: string;
|
|
9
|
+
build?: boolean;
|
|
10
|
+
mode?: 'readonly' | 'write-tsbuildinfo' | 'write-dts' | 'write-references';
|
|
11
|
+
diagnosticOptions?: Partial<TypeScriptDiagnosticsOptions>;
|
|
12
|
+
extensions?: {
|
|
13
|
+
vue?: TypeScriptVueExtensionOptions;
|
|
14
|
+
};
|
|
15
|
+
profile?: boolean;
|
|
16
|
+
typescriptPath?: string;
|
|
17
|
+
};
|
|
18
|
+
export { TypeScriptWorkerOptions };
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const rpc_1 = require("../../
|
|
3
|
+
const rpc_1 = require("../../rpc");
|
|
4
4
|
const config_1 = require("./lib/config");
|
|
5
5
|
const dependencies_1 = require("./lib/dependencies");
|
|
6
6
|
const system_1 = require("./lib/system");
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const rpc_1 = require("../../
|
|
12
|
+
const rpc_1 = require("../../rpc");
|
|
13
13
|
const artifacts_1 = require("./lib/artifacts");
|
|
14
14
|
const config_1 = require("./lib/config");
|
|
15
15
|
const dependencies_1 = require("./lib/dependencies");
|
|
@@ -24,9 +24,9 @@ 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
|
+
dependencies_1.invalidateDependencies();
|
|
27
28
|
if (config_1.didConfigFileChanged({ changedFiles, deletedFiles })) {
|
|
28
29
|
config_1.invalidateConfig();
|
|
29
|
-
dependencies_1.invalidateDependencies();
|
|
30
30
|
artifacts_1.invalidateArtifacts();
|
|
31
31
|
diagnostics_1.invalidateDiagnostics();
|
|
32
32
|
program_1.invalidateProgram(true);
|
|
@@ -35,7 +35,6 @@ const getIssuesWorker = ({ changedFiles = [], deletedFiles = [] }, watching) =>
|
|
|
35
35
|
tsbuildinfo_1.invalidateTsBuildInfo();
|
|
36
36
|
}
|
|
37
37
|
else if (config_1.didRootFilesChanged()) {
|
|
38
|
-
dependencies_1.invalidateDependencies();
|
|
39
38
|
artifacts_1.invalidateArtifacts();
|
|
40
39
|
watch_program_1.invalidateWatchProgramRootFileNames();
|
|
41
40
|
solution_builder_1.invalidateSolutionBuilder();
|
|
@@ -64,8 +64,8 @@ function getArtifactsWorker(parsedConfig, configFileContext, processedConfigFile
|
|
|
64
64
|
// handle circular dependencies
|
|
65
65
|
continue;
|
|
66
66
|
}
|
|
67
|
-
const
|
|
68
|
-
const childArtifacts = getArtifactsWorker(
|
|
67
|
+
const parsedConfig = config_1.parseConfig(configFile, path.dirname(configFile));
|
|
68
|
+
const childArtifacts = getArtifactsWorker(parsedConfig, configFileContext, [
|
|
69
69
|
...processedConfigFiles,
|
|
70
70
|
configFile,
|
|
71
71
|
]);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type * as ts from 'typescript';
|
|
2
2
|
import type { FilesChange } from '../../../files-change';
|
|
3
3
|
import type { Issue } from '../../../issue';
|
|
4
|
-
import type {
|
|
5
|
-
export declare function parseConfig(configFileName: string, configFileContext: string, configOverwriteJSON?:
|
|
4
|
+
import type { TypeScriptConfigOverwrite } from '../../type-script-config-overwrite';
|
|
5
|
+
export declare function parseConfig(configFileName: string, configFileContext: string, configOverwriteJSON?: TypeScriptConfigOverwrite): ts.ParsedCommandLine;
|
|
6
6
|
export declare function getParseConfigIssues(): Issue[];
|
|
7
7
|
export declare function getParsedConfig(force?: boolean): ts.ParsedCommandLine;
|
|
8
8
|
export declare function parseNextConfig(): readonly [ts.ParsedCommandLine | undefined, ts.ParsedCommandLine];
|
|
@@ -18,13 +18,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
-
};
|
|
24
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
22
|
exports.didRootFilesChanged = exports.didConfigFileChanged = exports.getConfigFilePathFromBuilderProgram = exports.getConfigFilePathFromProgram = exports.getConfigFilePathFromCompilerOptions = exports.invalidateConfig = exports.parseNextConfig = exports.getParsedConfig = exports.getParseConfigIssues = exports.parseConfig = void 0;
|
|
26
23
|
const path = __importStar(require("path"));
|
|
27
|
-
const
|
|
24
|
+
const forward_slash_1 = require("../../../utils/path/forward-slash");
|
|
28
25
|
const diagnostics_1 = require("./diagnostics");
|
|
29
26
|
const extensions_1 = require("./extensions");
|
|
30
27
|
const system_1 = require("./system");
|
|
@@ -42,7 +39,7 @@ for (const extension of extensions_1.extensions) {
|
|
|
42
39
|
}
|
|
43
40
|
}
|
|
44
41
|
function parseConfig(configFileName, configFileContext, configOverwriteJSON = {}) {
|
|
45
|
-
const configFilePath =
|
|
42
|
+
const configFilePath = forward_slash_1.forwardSlash(configFileName);
|
|
46
43
|
const parsedConfigFileJSON = typescript_1.typescript.readConfigFile(configFilePath, parseConfigFileHost.readFile);
|
|
47
44
|
const overwrittenConfigFileJSON = Object.assign(Object.assign(Object.assign({}, (parsedConfigFileJSON.config || {})), configOverwriteJSON), { compilerOptions: Object.assign(Object.assign({}, ((parsedConfigFileJSON.config || {}).compilerOptions || {})), (configOverwriteJSON.compilerOptions || {})) });
|
|
48
45
|
const parsedConfigFile = typescript_1.typescript.parseJsonConfigFileContent(overwrittenConfigFileJSON, parseConfigFileHost, configFileContext);
|
|
@@ -63,7 +60,7 @@ function getParsedConfig(force = false) {
|
|
|
63
60
|
if (!parsedConfig || force) {
|
|
64
61
|
parseConfigDiagnostics = [];
|
|
65
62
|
parsedConfig = parseConfig(worker_config_1.config.configFile, worker_config_1.config.context, worker_config_1.config.configOverwrite);
|
|
66
|
-
const configFilePath =
|
|
63
|
+
const configFilePath = forward_slash_1.forwardSlash(worker_config_1.config.configFile);
|
|
67
64
|
const parsedConfigFileJSON = typescript_1.typescript.readConfigFile(configFilePath, parseConfigFileHost.readFile);
|
|
68
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 || {})) });
|
|
69
66
|
parsedConfig = typescript_1.typescript.parseJsonConfigFileContent(overwrittenConfigFileJSON, parseConfigFileHost, worker_config_1.config.context);
|
|
@@ -59,8 +59,8 @@ function getDependenciesWorker(parsedConfig, configFileContext, processedConfigF
|
|
|
59
59
|
// handle circular dependencies
|
|
60
60
|
continue;
|
|
61
61
|
}
|
|
62
|
-
const
|
|
63
|
-
const childDependencies = getDependenciesWorker(
|
|
62
|
+
const childParsedConfig = config_1.parseConfig(childConfigFilePath, childConfigContext);
|
|
63
|
+
const childDependencies = getDependenciesWorker(childParsedConfig, childConfigContext, [
|
|
64
64
|
...processedConfigFiles,
|
|
65
65
|
childConfigFilePath,
|
|
66
66
|
]);
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
var _a, _b;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.extensions = void 0;
|
|
5
|
-
const
|
|
5
|
+
const type_script_vue_extension_1 = require("../../extension/vue/type-script-vue-extension");
|
|
6
6
|
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(
|
|
10
|
+
extensions.push(type_script_vue_extension_1.createTypeScriptVueExtension(worker_config_1.config.extensions.vue));
|
|
11
11
|
}
|