fork-ts-checker-webpack-plugin 7.0.0-alpha.11 → 7.0.0-alpha.12
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 +1 -1
- 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-config.d.ts +10 -0
- package/lib/logger/logger-config.js +12 -0
- package/lib/logger/{LoggerFactory.d.ts → logger-factory.d.ts} +1 -1
- package/lib/logger/{LoggerFactory.js → logger-factory.js} +5 -5
- package/lib/logger/{LoggerOptions.d.ts → logger-options.d.ts} +2 -2
- package/lib/{issue/IssueOptions.js → logger/logger-options.js} +0 -0
- package/lib/logger/{Logger.d.ts → logger.d.ts} +0 -0
- package/lib/logger/{Logger.js → logger.js} +0 -0
- package/lib/logger/{PartialLogger.d.ts → partial-logger.d.ts} +1 -1
- package/lib/logger/{PartialLogger.js → partial-logger.js} +0 -0
- package/lib/logger/{WebpackInfrastructureLogger.d.ts → webpack-infrastructure-logger.d.ts} +1 -1
- package/lib/logger/{WebpackInfrastructureLogger.js → webpack-infrastructure-logger.js} +0 -0
- package/lib/plugin-config.d.ts +15 -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/{ForkTsCheckerWebpackPluginOptions.d.ts → plugin-options.d.ts} +4 -4
- package/lib/{logger/LoggerOptions.js → plugin-options.js} +0 -0
- package/lib/{ForkTsCheckerWebpackPluginOptions.json → plugin-options.json} +0 -0
- 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/typescript/{TypeScriptConfigurationOverwrite.js → 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/{TypeScriptDiagnosticsOptions.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/{TypeScriptReporterOptions.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/{extension/TypeScriptExtension.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/{TypeScriptReporterOptions.d.ts → type-script-worker-options.d.ts} +6 -6
- package/lib/typescript/{extension/vue/TypeScriptVueExtensionOptions.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 +1 -1
- 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 +6 -9
- 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/watch/{WatchFileSystem.js → watch-file-system.js} +0 -0
- package/package.json +1 -1
- package/lib/ForkTsCheckerWebpackPlugin.js +0 -84
- package/lib/ForkTsCheckerWebpackPluginConfiguration.d.ts +0 -15
- package/lib/ForkTsCheckerWebpackPluginConfiguration.js +0 -17
- 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/typescript/TypeScriptReporterConfiguration.d.ts +0 -22
- 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
|
@@ -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
|
package/lib/typescript/{TypeScriptConfigurationOverwrite.js → extension/type-script-extension.js}
RENAMED
|
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
|
package/lib/typescript/{extension/TypeScriptExtension.js → type-script-diagnostics-options.js}
RENAMED
|
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-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;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { TypeScriptVueExtensionOptions } from './extension/vue/
|
|
2
|
-
import type {
|
|
3
|
-
import type { TypeScriptDiagnosticsOptions } from './
|
|
4
|
-
declare type
|
|
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
5
|
memoryLimit?: number;
|
|
6
6
|
configFile?: string;
|
|
7
|
-
configOverwrite?:
|
|
7
|
+
configOverwrite?: TypeScriptConfigOverwrite;
|
|
8
8
|
context?: string;
|
|
9
9
|
build?: boolean;
|
|
10
10
|
mode?: 'readonly' | 'write-tsbuildinfo' | 'write-references';
|
|
@@ -15,4 +15,4 @@ declare type TypeScriptReporterOptions = {
|
|
|
15
15
|
profile?: boolean;
|
|
16
16
|
typescriptPath?: string;
|
|
17
17
|
};
|
|
18
|
-
export {
|
|
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");
|
|
@@ -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
|
}
|
|
@@ -8,13 +8,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.system = void 0;
|
|
16
13
|
const path_1 = require("path");
|
|
17
|
-
const
|
|
14
|
+
const forward_slash_1 = require("../../../utils/path/forward-slash");
|
|
18
15
|
const mem_file_system_1 = require("./file-system/mem-file-system");
|
|
19
16
|
const passive_file_system_1 = require("./file-system/passive-file-system");
|
|
20
17
|
const real_file_system_1 = require("./file-system/real-file-system");
|
|
@@ -168,24 +165,24 @@ function invokeFileWatchers(path, event) {
|
|
|
168
165
|
const fileWatcherCallbacks = fileWatcherCallbacksMap.get(normalizedPath);
|
|
169
166
|
if (fileWatcherCallbacks) {
|
|
170
167
|
// typescript expects normalized paths with posix forward slash
|
|
171
|
-
fileWatcherCallbacks.forEach((fileWatcherCallback) => fileWatcherCallback(
|
|
168
|
+
fileWatcherCallbacks.forEach((fileWatcherCallback) => fileWatcherCallback(forward_slash_1.forwardSlash(normalizedPath), event));
|
|
172
169
|
}
|
|
173
170
|
}
|
|
174
171
|
function invokeDirectoryWatchers(path) {
|
|
175
172
|
const normalizedPath = real_file_system_1.realFileSystem.normalizePath(path);
|
|
176
173
|
const directory = path_1.dirname(normalizedPath);
|
|
177
|
-
if (ignoredPaths.some((ignoredPath) =>
|
|
174
|
+
if (ignoredPaths.some((ignoredPath) => forward_slash_1.forwardSlash(normalizedPath).includes(ignoredPath))) {
|
|
178
175
|
return;
|
|
179
176
|
}
|
|
180
177
|
const directoryWatcherCallbacks = directoryWatcherCallbacksMap.get(directory);
|
|
181
178
|
if (directoryWatcherCallbacks) {
|
|
182
|
-
directoryWatcherCallbacks.forEach((directoryWatcherCallback) => directoryWatcherCallback(
|
|
179
|
+
directoryWatcherCallbacks.forEach((directoryWatcherCallback) => directoryWatcherCallback(forward_slash_1.forwardSlash(normalizedPath)));
|
|
183
180
|
}
|
|
184
181
|
recursiveDirectoryWatcherCallbacksMap.forEach((recursiveDirectoryWatcherCallbacks, watchedDirectory) => {
|
|
185
182
|
if (watchedDirectory === directory ||
|
|
186
183
|
(directory.startsWith(watchedDirectory) &&
|
|
187
|
-
|
|
188
|
-
recursiveDirectoryWatcherCallbacks.forEach((recursiveDirectoryWatcherCallback) => recursiveDirectoryWatcherCallback(
|
|
184
|
+
forward_slash_1.forwardSlash(directory)[watchedDirectory.length] === '/')) {
|
|
185
|
+
recursiveDirectoryWatcherCallbacks.forEach((recursiveDirectoryWatcherCallback) => recursiveDirectoryWatcherCallback(forward_slash_1.forwardSlash(normalizedPath)));
|
|
189
186
|
}
|
|
190
187
|
});
|
|
191
188
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const config:
|
|
1
|
+
import type { TypeScriptWorkerConfig } from '../../type-script-worker-config';
|
|
2
|
+
export declare const config: TypeScriptWorkerConfig;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
declare function isPending(promise: Promise<unknown>, timeout?: number): Promise<unknown>;
|
|
2
|
-
export
|
|
2
|
+
export { isPending };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isPending = void 0;
|
|
3
4
|
function isPending(promise, timeout = 100) {
|
|
4
5
|
return Promise.race([
|
|
5
6
|
promise.then(() => false).catch(() => false),
|
|
6
7
|
new Promise((resolve) => setTimeout(() => resolve(true), timeout)),
|
|
7
8
|
]);
|
|
8
9
|
}
|
|
9
|
-
exports.
|
|
10
|
+
exports.isPending = isPending;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
declare function wait(timeout: number): Promise<unknown>;
|
|
2
|
-
export
|
|
2
|
+
export { wait };
|
package/lib/utils/async/wait.js
CHANGED
|
@@ -3,6 +3,7 @@ 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.forwardSlash = void 0;
|
|
6
7
|
const path_1 = __importDefault(require("path"));
|
|
7
8
|
/**
|
|
8
9
|
* Replaces backslashes with one forward slash
|
|
@@ -11,4 +12,4 @@ const path_1 = __importDefault(require("path"));
|
|
|
11
12
|
function forwardSlash(input) {
|
|
12
13
|
return path_1.default.normalize(input).replace(/\\+/g, '/');
|
|
13
14
|
}
|
|
14
|
-
exports.
|
|
15
|
+
exports.forwardSlash = forwardSlash;
|
|
File without changes
|
|
@@ -5,9 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.relativeToContext = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const
|
|
8
|
+
const forward_slash_1 = require("./forward-slash");
|
|
9
9
|
function relativeToContext(file, context) {
|
|
10
|
-
let fileInContext =
|
|
10
|
+
let fileInContext = forward_slash_1.forwardSlash(path_1.default.relative(context, file));
|
|
11
11
|
if (!fileInContext.startsWith('../')) {
|
|
12
12
|
fileInContext = './' + fileInContext;
|
|
13
13
|
}
|
package/lib/watch/{InclusiveNodeWatchFileSystem.d.ts → inclusive-node-watch-file-system.d.ts}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { FSWatcher } from 'chokidar';
|
|
2
1
|
import type { Compiler } from 'webpack';
|
|
3
|
-
import type { ForkTsCheckerWebpackPluginState } from '../
|
|
4
|
-
import type { WatchFileSystem } from './
|
|
2
|
+
import type { ForkTsCheckerWebpackPluginState } from '../plugin-state';
|
|
3
|
+
import type { WatchFileSystem } from './watch-file-system';
|
|
5
4
|
declare class InclusiveNodeWatchFileSystem implements WatchFileSystem {
|
|
6
5
|
private watchFileSystem;
|
|
7
6
|
private compiler;
|
|
8
7
|
private pluginState;
|
|
9
|
-
get watcher(): import("./
|
|
10
|
-
readonly dirsWatchers
|
|
11
|
-
constructor(watchFileSystem: WatchFileSystem, compiler: Compiler, pluginState: ForkTsCheckerWebpackPluginState);
|
|
8
|
+
get watcher(): import("./watch-file-system").Watchpack | undefined;
|
|
9
|
+
private readonly dirsWatchers;
|
|
12
10
|
private paused;
|
|
11
|
+
private deletedFiles;
|
|
12
|
+
constructor(watchFileSystem: WatchFileSystem, compiler: Compiler, pluginState: ForkTsCheckerWebpackPluginState);
|
|
13
13
|
watch: WatchFileSystem['watch'];
|
|
14
14
|
}
|
|
15
15
|
export { InclusiveNodeWatchFileSystem };
|
|
@@ -8,6 +8,7 @@ const path_1 = require("path");
|
|
|
8
8
|
const chokidar_1 = __importDefault(require("chokidar"));
|
|
9
9
|
const minimatch_1 = __importDefault(require("minimatch"));
|
|
10
10
|
const files_change_1 = require("../files-change");
|
|
11
|
+
const infrastructure_logger_1 = require("../infrastructure-logger");
|
|
11
12
|
const BUILTIN_IGNORED_DIRS = ['node_modules', '.git', '.yarn', '.pnp'];
|
|
12
13
|
function createIsIgnored(ignored, excluded) {
|
|
13
14
|
const ignoredPatterns = ignored ? (Array.isArray(ignored) ? ignored : [ignored]) : [];
|
|
@@ -38,19 +39,40 @@ class InclusiveNodeWatchFileSystem {
|
|
|
38
39
|
this.paused = true;
|
|
39
40
|
this.watch = (files, dirs, missing, startTime, options, callback, callbackUndelayed) => {
|
|
40
41
|
var _a, _b, _c, _d;
|
|
42
|
+
const { debug } = infrastructure_logger_1.getInfrastructureLogger(this.compiler);
|
|
41
43
|
files_change_1.clearFilesChange(this.compiler);
|
|
42
44
|
const isIgnored = createIsIgnored(options === null || options === void 0 ? void 0 : options.ignored, ((_a = this.pluginState.lastDependencies) === null || _a === void 0 ? void 0 : _a.excluded) || []);
|
|
43
45
|
// use standard watch file system for files and missing
|
|
44
46
|
const standardWatcher = this.watchFileSystem.watch(files, dirs, missing, startTime, options, callback, callbackUndelayed);
|
|
45
47
|
(_b = this.watcher) === null || _b === void 0 ? void 0 : _b.on('change', (file) => {
|
|
46
|
-
if (typeof file
|
|
48
|
+
if (typeof file !== 'string') {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (!isIgnored(file)) {
|
|
52
|
+
debug('Detected file change', file);
|
|
53
|
+
this.deletedFiles.delete(file);
|
|
47
54
|
files_change_1.updateFilesChange(this.compiler, { changedFiles: [file] });
|
|
48
55
|
}
|
|
56
|
+
else {
|
|
57
|
+
debug("Detected file change but it's ignored", file);
|
|
58
|
+
}
|
|
49
59
|
});
|
|
50
60
|
(_c = this.watcher) === null || _c === void 0 ? void 0 : _c.on('remove', (file) => {
|
|
51
|
-
if (typeof file
|
|
61
|
+
if (typeof file !== 'string') {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (this.deletedFiles.has(file)) {
|
|
65
|
+
debug('Skipping duplicated remove event.');
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (!isIgnored(file)) {
|
|
69
|
+
debug('Detected file remove', file);
|
|
70
|
+
this.deletedFiles.add(file);
|
|
52
71
|
files_change_1.updateFilesChange(this.compiler, { deletedFiles: [file] });
|
|
53
72
|
}
|
|
73
|
+
else {
|
|
74
|
+
debug("Detected file remove but it's ignored", file);
|
|
75
|
+
}
|
|
54
76
|
});
|
|
55
77
|
// calculate what to change
|
|
56
78
|
const prevDirs = Array.from(this.dirsWatchers.keys());
|
|
@@ -84,11 +106,13 @@ class InclusiveNodeWatchFileSystem {
|
|
|
84
106
|
const extension = path_1.extname(file);
|
|
85
107
|
const supportedExtensions = ((_a = this.pluginState.lastDependencies) === null || _a === void 0 ? void 0 : _a.extensions) || [];
|
|
86
108
|
if (!supportedExtensions.includes(extension)) {
|
|
109
|
+
debug('Detected new file add but extension is not supported', file);
|
|
87
110
|
return;
|
|
88
111
|
}
|
|
112
|
+
debug('Detected new file add', file);
|
|
113
|
+
this.deletedFiles.delete(file);
|
|
89
114
|
files_change_1.updateFilesChange(this.compiler, { changedFiles: [file] });
|
|
90
|
-
|
|
91
|
-
(_b = this.watcher) === null || _b === void 0 ? void 0 : _b._onChange(dirToWatch, mtime, file, 'rename');
|
|
115
|
+
(_b = this.watcher) === null || _b === void 0 ? void 0 : _b._onChange(dirToWatch, (stats === null || stats === void 0 ? void 0 : stats.mtimeMs) || (stats === null || stats === void 0 ? void 0 : stats.ctimeMs) || 1, file, 'rename');
|
|
92
116
|
});
|
|
93
117
|
dirWatcher.on('unlink', (file) => {
|
|
94
118
|
var _a, _b;
|
|
@@ -98,8 +122,15 @@ class InclusiveNodeWatchFileSystem {
|
|
|
98
122
|
const extension = path_1.extname(file);
|
|
99
123
|
const supportedExtensions = ((_a = this.pluginState.lastDependencies) === null || _a === void 0 ? void 0 : _a.extensions) || [];
|
|
100
124
|
if (!supportedExtensions.includes(extension)) {
|
|
125
|
+
debug('Detected new file remove but extension is not supported', file);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (this.deletedFiles.has(file)) {
|
|
129
|
+
debug('Skipping duplicated unlink event.');
|
|
101
130
|
return;
|
|
102
131
|
}
|
|
132
|
+
debug('Detected new file remove', file);
|
|
133
|
+
this.deletedFiles.add(file);
|
|
103
134
|
files_change_1.updateFilesChange(this.compiler, { deletedFiles: [file] });
|
|
104
135
|
(_b = this.watcher) === null || _b === void 0 ? void 0 : _b._onRemove(dirToWatch, file, 'rename');
|
|
105
136
|
});
|
|
@@ -124,6 +155,7 @@ class InclusiveNodeWatchFileSystem {
|
|
|
124
155
|
} });
|
|
125
156
|
};
|
|
126
157
|
this.dirsWatchers = new Map();
|
|
158
|
+
this.deletedFiles = new Set();
|
|
127
159
|
}
|
|
128
160
|
get watcher() {
|
|
129
161
|
var _a;
|