fork-ts-checker-webpack-plugin 6.4.2 → 6.5.2
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/ForkTsCheckerWebpackPlugin.js +1 -1
- package/lib/ForkTsCheckerWebpackPluginOptions.json +2 -2
- package/lib/reporter/FilesChange.js +11 -1
- package/lib/typescript-reporter/TypeScriptReporterConfiguration.d.ts +1 -1
- package/lib/typescript-reporter/TypeScriptReporterOptions.d.ts +1 -1
- package/lib/typescript-reporter/reporter/ControlledTypeScriptSystem.d.ts +1 -1
- package/lib/typescript-reporter/reporter/ControlledTypeScriptSystem.js +3 -1
- package/lib/watch/InclusiveNodeWatchFileSystem.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -157,7 +157,7 @@ Options for the TypeScript checker (`typescript` option object).
|
|
|
157
157
|
| `configOverwrite` | `object` | `{ compilerOptions: { skipLibCheck: true, sourceMap: false, inlineSourceMap: false, declarationMap: false } }` | This configuration will overwrite configuration from the `tsconfig.json` file. Supported fields are: `extends`, `compilerOptions`, `include`, `exclude`, `files`, and `references`. |
|
|
158
158
|
| `context` | `string` | `dirname(configuration.configFile)` | The base path for finding files specified in the `tsconfig.json`. Same as the `context` option from the [ts-loader](https://github.com/TypeStrong/ts-loader#context). Useful if you want to keep your `tsconfig.json` in an external package. Keep in mind that **not** having a `tsconfig.json` in your project root can cause different behaviour between `fork-ts-checker-webpack-plugin` and `tsc`. When using editors like `VS Code` it is advised to add a `tsconfig.json` file to the root of the project and extend the config file referenced in option `configFile`. |
|
|
159
159
|
| `build` | `boolean` | `false` | The equivalent of the `--build` flag for the `tsc` command. |
|
|
160
|
-
| `mode` | `'readonly'` or `'write-tsbuildinfo'` or `'write-references'` | `'write-tsbuildinfo'` | If you use the `babel-loader`, it's recommended to use `write-references` mode to improve initial compilation time. If you use `ts-loader`, it's recommended to use `write-tsbuildinfo` mode to not overwrite files emitted by the `ts-loader`. |
|
|
160
|
+
| `mode` | `'readonly'` or `'write-tsbuildinfo'` or `'write-dts'` or `'write-references'` | `'write-tsbuildinfo'` | If you use the `babel-loader`, it's recommended to use `write-references` mode to improve initial compilation time. If you use `ts-loader`, it's recommended to use `write-tsbuildinfo` mode to not overwrite files emitted by the `ts-loader`. If you use `ts-loader` with `transpileOnly` flag set to `true`, use `'write-dts` to emit the type definition files. |
|
|
161
161
|
| `diagnosticOptions` | `object` | `{ syntactic: false, semantic: true, declaration: false, global: false }` | Settings to select which diagnostics do we want to perform. |
|
|
162
162
|
| `extensions` | `object` | `{}` | See [TypeScript extensions options](#typescript-extensions-options). |
|
|
163
163
|
| `profile` | `boolean` | `false` | Measures and prints timings related to the TypeScript performance. |
|
|
@@ -76,7 +76,7 @@ exports.ForkTsCheckerWebpackPlugin = ForkTsCheckerWebpackPlugin;
|
|
|
76
76
|
/**
|
|
77
77
|
* Current version of the plugin
|
|
78
78
|
*/
|
|
79
|
-
ForkTsCheckerWebpackPlugin.version = '6.
|
|
79
|
+
ForkTsCheckerWebpackPlugin.version = '6.5.2'; // will be replaced by the @semantic-release/exec
|
|
80
80
|
/**
|
|
81
81
|
* Default pools for the plugin concurrency limit
|
|
82
82
|
*/
|
|
@@ -138,8 +138,8 @@
|
|
|
138
138
|
},
|
|
139
139
|
"mode": {
|
|
140
140
|
"type": "string",
|
|
141
|
-
"enum": ["readonly", "write-tsbuildinfo", "write-references"],
|
|
142
|
-
"description": "`readonly` keeps all emitted files in memory, `write-tsbuildinfo` which writes only .tsbuildinfo files and `write-references` which writes both .tsbuildinfo and referenced projects output"
|
|
141
|
+
"enum": ["readonly", "write-tsbuildinfo", "write-dts", "write-references"],
|
|
142
|
+
"description": "`readonly` keeps all emitted files in memory, `write-tsbuildinfo` which writes only .tsbuildinfo files, `write-dts` writes .tsbuildinfo and type definition files, and `write-references` which writes both .tsbuildinfo and referenced projects output"
|
|
143
143
|
},
|
|
144
144
|
"compilerOptions": {
|
|
145
145
|
"type": "object",
|
|
@@ -5,9 +5,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const substract_1 = __importDefault(require("../utils/array/substract"));
|
|
7
7
|
const unique_1 = __importDefault(require("../utils/array/unique"));
|
|
8
|
+
// we ignore package.json file because of https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/issues/674
|
|
9
|
+
const IGNORED_FILES = ['package.json'];
|
|
10
|
+
const isIgnoredFile = (file) => IGNORED_FILES.some((ignoredFile) => file.endsWith(`/${ignoredFile}`) || file.endsWith(`\\${ignoredFile}`));
|
|
8
11
|
const compilerFilesChangeMap = new WeakMap();
|
|
9
12
|
function getFilesChange(compiler) {
|
|
10
|
-
|
|
13
|
+
const { changedFiles = [], deletedFiles = [] } = compilerFilesChangeMap.get(compiler) || {
|
|
14
|
+
changedFiles: [],
|
|
15
|
+
deletedFiles: [],
|
|
16
|
+
};
|
|
17
|
+
return {
|
|
18
|
+
changedFiles: changedFiles.filter((changedFile) => !isIgnoredFile(changedFile)),
|
|
19
|
+
deletedFiles: deletedFiles.filter((deletedFile) => !isIgnoredFile(deletedFile)),
|
|
20
|
+
};
|
|
11
21
|
}
|
|
12
22
|
exports.getFilesChange = getFilesChange;
|
|
13
23
|
function updateFilesChange(compiler, change) {
|
|
@@ -10,7 +10,7 @@ interface TypeScriptReporterConfiguration {
|
|
|
10
10
|
configOverwrite: TypeScriptConfigurationOverwrite;
|
|
11
11
|
build: boolean;
|
|
12
12
|
context: string;
|
|
13
|
-
mode: 'readonly' | 'write-tsbuildinfo' | 'write-references';
|
|
13
|
+
mode: 'readonly' | 'write-tsbuildinfo' | 'write-dts' | 'write-references';
|
|
14
14
|
diagnosticOptions: TypeScriptDiagnosticsOptions;
|
|
15
15
|
extensions: {
|
|
16
16
|
vue: TypeScriptVueExtensionConfiguration;
|
|
@@ -8,7 +8,7 @@ declare type TypeScriptReporterOptions = boolean | {
|
|
|
8
8
|
configOverwrite?: TypeScriptConfigurationOverwrite;
|
|
9
9
|
context?: string;
|
|
10
10
|
build?: boolean;
|
|
11
|
-
mode?: 'readonly' | 'write-tsbuildinfo' | 'write-references';
|
|
11
|
+
mode?: 'readonly' | 'write-tsbuildinfo' | 'write-dts' | 'write-references';
|
|
12
12
|
diagnosticOptions?: Partial<TypeScriptDiagnosticsOptions>;
|
|
13
13
|
extensions?: {
|
|
14
14
|
vue?: TypeScriptVueExtensionOptions;
|
|
@@ -16,6 +16,6 @@ interface ControlledTypeScriptSystem extends ts.System {
|
|
|
16
16
|
waitForQueued(): Promise<void>;
|
|
17
17
|
setArtifacts(artifacts: FilesMatch): void;
|
|
18
18
|
}
|
|
19
|
-
declare type FileSystemMode = 'readonly' | 'write-tsbuildinfo' | 'write-references';
|
|
19
|
+
declare type FileSystemMode = 'readonly' | 'write-tsbuildinfo' | 'write-dts' | 'write-references';
|
|
20
20
|
declare function createControlledTypeScriptSystem(typescript: typeof ts, mode?: FileSystemMode): ControlledTypeScriptSystem;
|
|
21
21
|
export { createControlledTypeScriptSystem, ControlledTypeScriptSystem };
|
|
@@ -113,7 +113,9 @@ function createControlledTypeScriptSystem(typescript, mode = 'readonly') {
|
|
|
113
113
|
}
|
|
114
114
|
function getWriteFileSystem(path) {
|
|
115
115
|
if (mode === 'write-references' ||
|
|
116
|
-
(mode === 'write-tsbuildinfo' && path.endsWith('.tsbuildinfo'))
|
|
116
|
+
(mode === 'write-tsbuildinfo' && path.endsWith('.tsbuildinfo')) ||
|
|
117
|
+
(mode === 'write-dts' &&
|
|
118
|
+
['.tsbuildinfo', '.d.ts', '.d.ts.map'].some((prefix) => path.endsWith(prefix)))) {
|
|
117
119
|
return realFileSystem;
|
|
118
120
|
}
|
|
119
121
|
return passiveFileSystem;
|
|
@@ -27,7 +27,7 @@ function createIsIgnored(ignored, excluded) {
|
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
ignoredFunctions.push((path) => excluded.some((excludedPath) => path.startsWith(excludedPath)));
|
|
30
|
-
ignoredFunctions.push((path) => BUILTIN_IGNORED_DIRS.some((ignoredDir) => path.includes(`/${ignoredDir}/`)));
|
|
30
|
+
ignoredFunctions.push((path) => BUILTIN_IGNORED_DIRS.some((ignoredDir) => path.includes(`/${ignoredDir}/`) || path.includes(`\\${ignoredDir}\\`)));
|
|
31
31
|
return function isIgnored(path) {
|
|
32
32
|
return ignoredFunctions.some((ignoredFunction) => ignoredFunction(path));
|
|
33
33
|
};
|