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
|
@@ -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");
|
|
@@ -37,7 +34,10 @@ const deletedFiles = new Map();
|
|
|
37
34
|
const timeoutCallbacks = new Set();
|
|
38
35
|
// based on the ts.ignorePaths
|
|
39
36
|
const ignoredPaths = ['/node_modules/.', '/.git', '/.#'];
|
|
40
|
-
exports.system = Object.assign(Object.assign({}, typescript_1.typescript.sys), { useCaseSensitiveFileNames: true,
|
|
37
|
+
exports.system = Object.assign(Object.assign({}, typescript_1.typescript.sys), { useCaseSensitiveFileNames: true, realpath(path) {
|
|
38
|
+
return getReadFileSystem(path).realPath(path);
|
|
39
|
+
},
|
|
40
|
+
fileExists(path) {
|
|
41
41
|
const stats = getReadFileSystem(path).readStats(path);
|
|
42
42
|
return !!stats && stats.isFile();
|
|
43
43
|
},
|
|
@@ -168,24 +168,24 @@ function invokeFileWatchers(path, event) {
|
|
|
168
168
|
const fileWatcherCallbacks = fileWatcherCallbacksMap.get(normalizedPath);
|
|
169
169
|
if (fileWatcherCallbacks) {
|
|
170
170
|
// typescript expects normalized paths with posix forward slash
|
|
171
|
-
fileWatcherCallbacks.forEach((fileWatcherCallback) => fileWatcherCallback(
|
|
171
|
+
fileWatcherCallbacks.forEach((fileWatcherCallback) => fileWatcherCallback(forward_slash_1.forwardSlash(normalizedPath), event));
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
function invokeDirectoryWatchers(path) {
|
|
175
175
|
const normalizedPath = real_file_system_1.realFileSystem.normalizePath(path);
|
|
176
176
|
const directory = path_1.dirname(normalizedPath);
|
|
177
|
-
if (ignoredPaths.some((ignoredPath) =>
|
|
177
|
+
if (ignoredPaths.some((ignoredPath) => forward_slash_1.forwardSlash(normalizedPath).includes(ignoredPath))) {
|
|
178
178
|
return;
|
|
179
179
|
}
|
|
180
180
|
const directoryWatcherCallbacks = directoryWatcherCallbacksMap.get(directory);
|
|
181
181
|
if (directoryWatcherCallbacks) {
|
|
182
|
-
directoryWatcherCallbacks.forEach((directoryWatcherCallback) => directoryWatcherCallback(
|
|
182
|
+
directoryWatcherCallbacks.forEach((directoryWatcherCallback) => directoryWatcherCallback(forward_slash_1.forwardSlash(normalizedPath)));
|
|
183
183
|
}
|
|
184
184
|
recursiveDirectoryWatcherCallbacksMap.forEach((recursiveDirectoryWatcherCallbacks, watchedDirectory) => {
|
|
185
185
|
if (watchedDirectory === directory ||
|
|
186
186
|
(directory.startsWith(watchedDirectory) &&
|
|
187
|
-
|
|
188
|
-
recursiveDirectoryWatcherCallbacks.forEach((recursiveDirectoryWatcherCallback) => recursiveDirectoryWatcherCallback(
|
|
187
|
+
forward_slash_1.forwardSlash(directory)[watchedDirectory.length] === '/')) {
|
|
188
|
+
recursiveDirectoryWatcherCallbacks.forEach((recursiveDirectoryWatcherCallback) => recursiveDirectoryWatcherCallback(forward_slash_1.forwardSlash(normalizedPath)));
|
|
189
189
|
}
|
|
190
190
|
});
|
|
191
191
|
}
|
|
@@ -195,14 +195,27 @@ function isArtifact(path) {
|
|
|
195
195
|
artifacts.extensions.some((extension) => path.endsWith(extension)));
|
|
196
196
|
}
|
|
197
197
|
function getReadFileSystem(path) {
|
|
198
|
-
if (
|
|
199
|
-
|
|
198
|
+
if ((mode === 'readonly' || mode === 'write-tsbuildinfo') && isArtifact(path)) {
|
|
199
|
+
if (isInitialRun && !mem_file_system_1.memFileSystem.exists(path) && passive_file_system_1.passiveFileSystem.exists(path)) {
|
|
200
|
+
// copy file to memory on initial run
|
|
201
|
+
const stats = passive_file_system_1.passiveFileSystem.readStats(path);
|
|
202
|
+
if (stats === null || stats === void 0 ? void 0 : stats.isFile()) {
|
|
203
|
+
const content = passive_file_system_1.passiveFileSystem.readFile(path);
|
|
204
|
+
if (content) {
|
|
205
|
+
mem_file_system_1.memFileSystem.writeFile(path, content);
|
|
206
|
+
mem_file_system_1.memFileSystem.updateTimes(path, stats.atime, stats.mtime);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return mem_file_system_1.memFileSystem;
|
|
210
|
+
}
|
|
200
211
|
}
|
|
201
212
|
return passive_file_system_1.passiveFileSystem;
|
|
202
213
|
}
|
|
203
214
|
function getWriteFileSystem(path) {
|
|
204
215
|
if (mode === 'write-references' ||
|
|
205
|
-
(mode === 'write-tsbuildinfo' && path.endsWith('.tsbuildinfo'))
|
|
216
|
+
(mode === 'write-tsbuildinfo' && path.endsWith('.tsbuildinfo')) ||
|
|
217
|
+
(mode === 'write-dts' &&
|
|
218
|
+
['.tsbuildinfo', '.d.ts', '.d.ts.map'].some((suffix) => path.endsWith(suffix)))) {
|
|
206
219
|
return real_file_system_1.realFileSystem;
|
|
207
220
|
}
|
|
208
221
|
return passive_file_system_1.passiveFileSystem;
|
|
@@ -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;
|
package/lib/{typescript/extension/vue/TypeScriptVueExtensionOptions.js → watch/watch-file-system.js}
RENAMED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fork-ts-checker-webpack-plugin",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.15",
|
|
4
4
|
"description": "Runs typescript type checker and linter on separate process.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fast",
|
|
@@ -70,7 +70,13 @@
|
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"typescript": ">3.6.0",
|
|
73
|
-
"webpack": "^5.11.0"
|
|
73
|
+
"webpack": "^5.11.0",
|
|
74
|
+
"vue-template-compiler": "*"
|
|
75
|
+
},
|
|
76
|
+
"peerDependenciesMeta": {
|
|
77
|
+
"vue-template-compiler": {
|
|
78
|
+
"optional": true
|
|
79
|
+
}
|
|
74
80
|
},
|
|
75
81
|
"devDependencies": {
|
|
76
82
|
"@commitlint/config-conventional": "^13.1.0",
|
|
@@ -1,84 +0,0 @@
|
|
|
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
|
-
// type only dependency
|
|
31
|
-
// eslint-disable-next-line node/no-extraneous-import
|
|
32
|
-
const ForkTsCheckerWebpackPluginConfiguration_1 = require("./ForkTsCheckerWebpackPluginConfiguration");
|
|
33
|
-
const ForkTsCheckerWebpackPluginOptions_json_1 = __importDefault(require("./ForkTsCheckerWebpackPluginOptions.json"));
|
|
34
|
-
const ForkTsCheckerWebpackPluginState_1 = require("./ForkTsCheckerWebpackPluginState");
|
|
35
|
-
const pluginHooks_1 = require("./hooks/pluginHooks");
|
|
36
|
-
const pluginPools_1 = require("./hooks/pluginPools");
|
|
37
|
-
const tapAfterCompileToAddDependencies_1 = require("./hooks/tapAfterCompileToAddDependencies");
|
|
38
|
-
const tapAfterEnvironmentToPatchWatching_1 = require("./hooks/tapAfterEnvironmentToPatchWatching");
|
|
39
|
-
const tapErrorToLogMessage_1 = require("./hooks/tapErrorToLogMessage");
|
|
40
|
-
const tapStartToRunWorkers_1 = require("./hooks/tapStartToRunWorkers");
|
|
41
|
-
const tapStopToTerminateWorkers_1 = require("./hooks/tapStopToTerminateWorkers");
|
|
42
|
-
const TypeScriptSupport_1 = require("./typescript/TypeScriptSupport");
|
|
43
|
-
const rpc_1 = require("./utils/rpc");
|
|
44
|
-
class ForkTsCheckerWebpackPlugin {
|
|
45
|
-
constructor(options = {}) {
|
|
46
|
-
const explorerSync = cosmiconfig_1.cosmiconfigSync('fork-ts-checker');
|
|
47
|
-
const { config: externalOptions } = explorerSync.search() || {};
|
|
48
|
-
// first validate options directly passed to the constructor
|
|
49
|
-
const configuration = { name: 'ForkTsCheckerWebpackPlugin' };
|
|
50
|
-
schema_utils_1.validate(ForkTsCheckerWebpackPluginOptions_json_1.default, options, configuration);
|
|
51
|
-
this.options = deepmerge_1.default(externalOptions || {}, options || {});
|
|
52
|
-
// then validate merged options
|
|
53
|
-
schema_utils_1.validate(ForkTsCheckerWebpackPluginOptions_json_1.default, this.options, configuration);
|
|
54
|
-
}
|
|
55
|
-
static getCompilerHooks(compiler) {
|
|
56
|
-
return pluginHooks_1.getForkTsCheckerWebpackPluginHooks(compiler);
|
|
57
|
-
}
|
|
58
|
-
apply(compiler) {
|
|
59
|
-
const configuration = ForkTsCheckerWebpackPluginConfiguration_1.createForkTsCheckerWebpackPluginConfiguration(compiler, this.options);
|
|
60
|
-
const state = ForkTsCheckerWebpackPluginState_1.createForkTsCheckerWebpackPluginState();
|
|
61
|
-
TypeScriptSupport_1.assertTypeScriptSupport(configuration.typescript);
|
|
62
|
-
const getIssuesWorker = rpc_1.createRpcWorker(path.resolve(__dirname, './typescript/worker/get-issues-worker.js'), configuration.typescript, configuration.typescript.memoryLimit);
|
|
63
|
-
const getDependenciesWorker = rpc_1.createRpcWorker(path.resolve(__dirname, './typescript/worker/get-dependencies-worker.js'), configuration.typescript);
|
|
64
|
-
tapAfterEnvironmentToPatchWatching_1.tapAfterEnvironmentToPatchWatching(compiler, state);
|
|
65
|
-
tapStartToRunWorkers_1.tapStartToRunWorkers(compiler, getIssuesWorker, getDependenciesWorker, configuration, state);
|
|
66
|
-
tapAfterCompileToAddDependencies_1.tapAfterCompileToAddDependencies(compiler, configuration, state);
|
|
67
|
-
tapStopToTerminateWorkers_1.tapStopToTerminateWorkers(compiler, getIssuesWorker, getDependenciesWorker, state);
|
|
68
|
-
tapErrorToLogMessage_1.tapErrorToLogMessage(compiler, configuration);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
exports.ForkTsCheckerWebpackPlugin = ForkTsCheckerWebpackPlugin;
|
|
72
|
-
/**
|
|
73
|
-
* Current version of the plugin
|
|
74
|
-
*/
|
|
75
|
-
ForkTsCheckerWebpackPlugin.version = '7.0.0-alpha.11'; // will be replaced by the @semantic-release/exec
|
|
76
|
-
/**
|
|
77
|
-
* Default pools for the plugin concurrency limit
|
|
78
|
-
*/
|
|
79
|
-
ForkTsCheckerWebpackPlugin.issuesPool = pluginPools_1.issuesPool;
|
|
80
|
-
ForkTsCheckerWebpackPlugin.dependenciesPool = pluginPools_1.dependenciesPool;
|
|
81
|
-
/**
|
|
82
|
-
* @deprecated Use ForkTsCheckerWebpackPlugin.issuesPool instead
|
|
83
|
-
*/
|
|
84
|
-
ForkTsCheckerWebpackPlugin.pool = pluginPools_1.issuesPool;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type webpack from 'webpack';
|
|
2
|
-
import type { ForkTsCheckerWebpackPluginOptions } from './ForkTsCheckerWebpackPluginOptions';
|
|
3
|
-
import type { FormatterConfiguration } from './formatter';
|
|
4
|
-
import type { IssueConfiguration } from './issue/IssueConfiguration';
|
|
5
|
-
import type { LoggerConfiguration } from './logger/LoggerConfiguration';
|
|
6
|
-
import type { TypeScriptReporterConfiguration } from './typescript/TypeScriptReporterConfiguration';
|
|
7
|
-
interface ForkTsCheckerWebpackPluginConfiguration {
|
|
8
|
-
async: boolean;
|
|
9
|
-
typescript: TypeScriptReporterConfiguration;
|
|
10
|
-
issue: IssueConfiguration;
|
|
11
|
-
formatter: FormatterConfiguration;
|
|
12
|
-
logger: LoggerConfiguration;
|
|
13
|
-
}
|
|
14
|
-
declare function createForkTsCheckerWebpackPluginConfiguration(compiler: webpack.Compiler, options?: ForkTsCheckerWebpackPluginOptions): ForkTsCheckerWebpackPluginConfiguration;
|
|
15
|
-
export { ForkTsCheckerWebpackPluginConfiguration, createForkTsCheckerWebpackPluginConfiguration };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createForkTsCheckerWebpackPluginConfiguration = void 0;
|
|
4
|
-
const formatter_1 = require("./formatter");
|
|
5
|
-
const IssueConfiguration_1 = require("./issue/IssueConfiguration");
|
|
6
|
-
const LoggerConfiguration_1 = require("./logger/LoggerConfiguration");
|
|
7
|
-
const TypeScriptReporterConfiguration_1 = require("./typescript/TypeScriptReporterConfiguration");
|
|
8
|
-
function createForkTsCheckerWebpackPluginConfiguration(compiler, options = {}) {
|
|
9
|
-
return {
|
|
10
|
-
async: options.async === undefined ? compiler.options.mode === 'development' : options.async,
|
|
11
|
-
typescript: TypeScriptReporterConfiguration_1.createTypeScriptReporterConfiguration(compiler, options.typescript),
|
|
12
|
-
issue: IssueConfiguration_1.createIssueConfiguration(compiler, options.issue),
|
|
13
|
-
formatter: formatter_1.createFormatterConfiguration(options.formatter),
|
|
14
|
-
logger: LoggerConfiguration_1.createLoggerConfiguration(compiler, options.logger),
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
exports.createForkTsCheckerWebpackPluginConfiguration = createForkTsCheckerWebpackPluginConfiguration;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { FormatterOptions } from './formatter';
|
|
2
|
-
import type { IssueOptions } from './issue/IssueOptions';
|
|
3
|
-
import type LoggerOptions from './logger/LoggerOptions';
|
|
4
|
-
import type { TypeScriptReporterOptions } from './typescript/TypeScriptReporterOptions';
|
|
5
|
-
interface ForkTsCheckerWebpackPluginOptions {
|
|
6
|
-
async?: boolean;
|
|
7
|
-
typescript?: TypeScriptReporterOptions;
|
|
8
|
-
formatter?: FormatterOptions;
|
|
9
|
-
issue?: IssueOptions;
|
|
10
|
-
logger?: LoggerOptions;
|
|
11
|
-
}
|
|
12
|
-
export { ForkTsCheckerWebpackPluginOptions };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Formatter } from './Formatter';
|
|
2
|
-
import type { FormatterOptions } from './FormatterOptions';
|
|
3
|
-
declare type FormatterConfiguration = Formatter;
|
|
4
|
-
declare function createFormatterConfiguration(options: FormatterOptions | undefined): FormatterConfiguration;
|
|
5
|
-
export { FormatterConfiguration, createFormatterConfiguration };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type webpack from 'webpack';
|
|
2
|
-
import type { ForkTsCheckerWebpackPluginConfiguration } from '../ForkTsCheckerWebpackPluginConfiguration';
|
|
3
|
-
import type { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState';
|
|
4
|
-
declare function interceptDoneToGetWebpackDevServerTap(compiler: webpack.Compiler, configuration: ForkTsCheckerWebpackPluginConfiguration, state: ForkTsCheckerWebpackPluginState): void;
|
|
5
|
-
export { interceptDoneToGetWebpackDevServerTap };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type webpack from 'webpack';
|
|
2
|
-
import type { ForkTsCheckerWebpackPluginConfiguration } from '../ForkTsCheckerWebpackPluginConfiguration';
|
|
3
|
-
import type { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState';
|
|
4
|
-
declare function tapAfterCompileToAddDependencies(compiler: webpack.Compiler, configuration: ForkTsCheckerWebpackPluginConfiguration, state: ForkTsCheckerWebpackPluginState): void;
|
|
5
|
-
export { tapAfterCompileToAddDependencies };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type webpack from 'webpack';
|
|
2
|
-
import type { ForkTsCheckerWebpackPluginConfiguration } from '../ForkTsCheckerWebpackPluginConfiguration';
|
|
3
|
-
import type { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState';
|
|
4
|
-
declare function tapAfterCompileToGetIssues(compiler: webpack.Compiler, configuration: ForkTsCheckerWebpackPluginConfiguration, state: ForkTsCheckerWebpackPluginState): void;
|
|
5
|
-
export { tapAfterCompileToGetIssues };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type webpack from 'webpack';
|
|
2
|
-
import type { ForkTsCheckerWebpackPluginConfiguration } from '../ForkTsCheckerWebpackPluginConfiguration';
|
|
3
|
-
import type { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState';
|
|
4
|
-
declare function tapDoneToAsyncGetIssues(compiler: webpack.Compiler, configuration: ForkTsCheckerWebpackPluginConfiguration, state: ForkTsCheckerWebpackPluginState): void;
|
|
5
|
-
export { tapDoneToAsyncGetIssues };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type webpack from 'webpack';
|
|
2
|
-
import type { ForkTsCheckerWebpackPluginConfiguration } from '../ForkTsCheckerWebpackPluginConfiguration';
|
|
3
|
-
declare function tapErrorToLogMessage(compiler: webpack.Compiler, configuration: ForkTsCheckerWebpackPluginConfiguration): void;
|
|
4
|
-
export { tapErrorToLogMessage };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type webpack from 'webpack';
|
|
2
|
-
import type { IssueOptions } from './IssueOptions';
|
|
3
|
-
import type { IssuePredicate } from './IssuePredicate';
|
|
4
|
-
interface IssueConfiguration {
|
|
5
|
-
predicate: IssuePredicate;
|
|
6
|
-
}
|
|
7
|
-
declare function createIssueConfiguration(compiler: webpack.Compiler, options: IssueOptions | undefined): IssueConfiguration;
|
|
8
|
-
export { IssueConfiguration, createIssueConfiguration };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createIssueConfiguration = void 0;
|
|
4
|
-
const IssueMatch_1 = require("./IssueMatch");
|
|
5
|
-
const IssuePredicate_1 = require("./IssuePredicate");
|
|
6
|
-
function createIssuePredicateFromOption(context, option) {
|
|
7
|
-
if (Array.isArray(option)) {
|
|
8
|
-
return IssuePredicate_1.composeIssuePredicates(option.map((option) => typeof option === 'function' ? option : IssueMatch_1.createIssuePredicateFromIssueMatch(context, option)));
|
|
9
|
-
}
|
|
10
|
-
return typeof option === 'function'
|
|
11
|
-
? option
|
|
12
|
-
: IssueMatch_1.createIssuePredicateFromIssueMatch(context, option);
|
|
13
|
-
}
|
|
14
|
-
function createIssueConfiguration(compiler, options) {
|
|
15
|
-
const context = compiler.options.context || process.cwd();
|
|
16
|
-
if (!options) {
|
|
17
|
-
options = {};
|
|
18
|
-
}
|
|
19
|
-
const include = options.include
|
|
20
|
-
? createIssuePredicateFromOption(context, options.include)
|
|
21
|
-
: IssuePredicate_1.createTrivialIssuePredicate(true);
|
|
22
|
-
const exclude = options.exclude
|
|
23
|
-
? createIssuePredicateFromOption(context, options.exclude)
|
|
24
|
-
: IssuePredicate_1.createTrivialIssuePredicate(false);
|
|
25
|
-
return {
|
|
26
|
-
predicate: (issue) => include(issue) && !exclude(issue),
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
exports.createIssueConfiguration = createIssueConfiguration;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type webpack from 'webpack';
|
|
2
|
-
import type Logger from './Logger';
|
|
3
|
-
import type LoggerOptions from './LoggerOptions';
|
|
4
|
-
interface LoggerConfiguration {
|
|
5
|
-
infrastructure: Logger;
|
|
6
|
-
issues: Logger;
|
|
7
|
-
devServer: boolean;
|
|
8
|
-
}
|
|
9
|
-
declare function createLoggerConfiguration(compiler: webpack.Compiler, options: LoggerOptions | undefined): LoggerConfiguration;
|
|
10
|
-
export { LoggerConfiguration, createLoggerConfiguration };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createLoggerConfiguration = void 0;
|
|
4
|
-
const LoggerFactory_1 = require("./LoggerFactory");
|
|
5
|
-
function createLoggerConfiguration(compiler, options) {
|
|
6
|
-
return {
|
|
7
|
-
infrastructure: LoggerFactory_1.createLogger((options && options.infrastructure) || 'webpack-infrastructure', compiler),
|
|
8
|
-
issues: LoggerFactory_1.createLogger((options && options.issues) || 'console', compiler),
|
|
9
|
-
devServer: (options === null || options === void 0 ? void 0 : options.devServer) !== false,
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
exports.createLoggerConfiguration = createLoggerConfiguration;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type webpack from 'webpack';
|
|
2
|
-
import type Logger from './Logger';
|
|
3
|
-
declare type LoggerType = 'console' | 'webpack-infrastructure' | 'silent';
|
|
4
|
-
declare function createLogger(type: LoggerType | Logger, compiler: webpack.Compiler): Logger;
|
|
5
|
-
export { createLogger, LoggerType };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createLogger = void 0;
|
|
4
|
-
const PartialLogger_1 = require("./PartialLogger");
|
|
5
|
-
const WebpackInfrastructureLogger_1 = require("./WebpackInfrastructureLogger");
|
|
6
|
-
function createLogger(type, compiler) {
|
|
7
|
-
if (typeof type !== 'string') {
|
|
8
|
-
return type;
|
|
9
|
-
}
|
|
10
|
-
switch (type) {
|
|
11
|
-
case 'webpack-infrastructure':
|
|
12
|
-
return (WebpackInfrastructureLogger_1.createWebpackInfrastructureLogger(compiler) ||
|
|
13
|
-
PartialLogger_1.createPartialLogger(['log', 'error'], console));
|
|
14
|
-
case 'silent':
|
|
15
|
-
return PartialLogger_1.createPartialLogger([], console);
|
|
16
|
-
case 'console':
|
|
17
|
-
default:
|
|
18
|
-
return console;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.createLogger = createLogger;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createPartialLogger = void 0;
|
|
4
|
-
function createPartialLogger(methods, logger) {
|
|
5
|
-
return {
|
|
6
|
-
info: (message) => (methods.includes('info') ? logger.info(message) : undefined),
|
|
7
|
-
log: (message) => (methods.includes('log') ? logger.log(message) : undefined),
|
|
8
|
-
error: (message) => (methods.includes('error') ? logger.error(message) : undefined),
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
exports.createPartialLogger = createPartialLogger;
|