ts-checker-rspack-plugin 1.0.0-beta.0 → 1.0.0-beta.1
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/LICENSE +1 -0
- package/lib/formatter/code-frame-formatter.js +2 -2
- package/lib/formatter/formatter-config.d.ts +1 -1
- package/lib/formatter/formatter-options.d.ts +4 -4
- package/lib/formatter/formatter.d.ts +2 -2
- package/lib/formatter/index.js +5 -1
- package/lib/hooks/tap-start-to-run-workers.js +1 -2
- package/lib/issue/index.js +5 -1
- package/lib/issue/issue-match.d.ts +1 -1
- package/lib/issue/issue-options.d.ts +1 -1
- package/lib/issue/issue-predicate.d.ts +1 -1
- package/lib/issue/issue-severity.d.ts +1 -1
- package/lib/issue/issue-webpack-error.js +5 -1
- package/lib/plugin-hooks.d.ts +26 -10
- package/lib/plugin-hooks.js +6 -6
- package/lib/plugin-pools.js +5 -1
- package/lib/plugin-state.d.ts +2 -3
- package/lib/plugin.d.ts +13 -5
- package/lib/plugin.js +6 -12
- package/lib/rpc/rpc-worker.d.ts +1 -1
- package/lib/rpc/rpc-worker.js +5 -1
- package/lib/rpc/types.d.ts +3 -3
- package/lib/typescript/type-script-support.js +7 -3
- package/lib/typescript/type-script-worker-config.js +1 -1
- package/lib/typescript/type-script-worker-options.d.ts +1 -1
- package/lib/typescript/worker/get-dependencies-worker.d.ts +1 -1
- package/lib/typescript/worker/get-issues-worker.d.ts +1 -1
- package/lib/typescript/worker/lib/artifacts.js +5 -1
- package/lib/typescript/worker/lib/config.js +5 -1
- package/lib/typescript/worker/lib/dependencies.js +5 -1
- package/lib/typescript/worker/lib/diagnostics.js +5 -1
- package/lib/typescript/worker/lib/file-system/real-file-system.js +12 -28
- package/lib/typescript/worker/lib/tsbuildinfo.js +5 -1
- package/lib/utils/async/abort-error.d.ts +1 -1
- package/lib/utils/async/pool.d.ts +2 -2
- package/lib/watch/inclusive-node-watch-file-system.js +4 -4
- package/lib/watch/watch-file-system.d.ts +1 -1
- package/package.json +11 -18
- package/lib/plugin-options.json +0 -197
package/LICENSE
CHANGED
|
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.createCodeFrameFormatter = void 0;
|
|
7
7
|
const os_1 = __importDefault(require("os"));
|
|
8
8
|
const code_frame_1 = require("@babel/code-frame");
|
|
9
|
-
const
|
|
9
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
10
10
|
const basic_formatter_1 = require("./basic-formatter");
|
|
11
11
|
function createCodeFrameFormatter(options) {
|
|
12
12
|
const basicFormatter = (0, basic_formatter_1.createBasicFormatter)();
|
|
13
13
|
return function codeFrameFormatter(issue) {
|
|
14
|
-
const source = issue.file &&
|
|
14
|
+
const source = issue.file && node_fs_1.default.existsSync(issue.file) && node_fs_1.default.readFileSync(issue.file, 'utf-8');
|
|
15
15
|
let frame = '';
|
|
16
16
|
if (source && issue.location) {
|
|
17
17
|
frame = (0, code_frame_1.codeFrameColumns)(source, issue.location, Object.assign({ highlightCode: true }, (options || {})))
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { Formatter, FormatterPathType } from './formatter';
|
|
2
2
|
import type { BabelCodeFrameOptions } from './types/babel__code-frame';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
type FormatterType = 'basic' | 'codeframe';
|
|
4
|
+
type BasicFormatterOptions = {
|
|
5
5
|
type: 'basic';
|
|
6
6
|
pathType?: FormatterPathType;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
type CodeframeFormatterOptions = {
|
|
9
9
|
type: 'codeframe';
|
|
10
10
|
pathType?: FormatterPathType;
|
|
11
11
|
options?: BabelCodeFrameOptions;
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
type FormatterOptions = undefined | FormatterType | BasicFormatterOptions | CodeframeFormatterOptions | Formatter;
|
|
14
14
|
export { FormatterOptions, FormatterType, BasicFormatterOptions, CodeframeFormatterOptions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Issue } from '../issue';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type Formatter = (issue: Issue) => string;
|
|
3
|
+
type FormatterPathType = 'relative' | 'absolute';
|
|
4
4
|
export { Formatter, FormatterPathType };
|
package/lib/formatter/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.tapStartToRunWorkers = void 0;
|
|
13
|
-
const node_abort_controller_1 = require("node-abort-controller");
|
|
14
13
|
const files_change_1 = require("../files-change");
|
|
15
14
|
const infrastructure_logger_1 = require("../infrastructure-logger");
|
|
16
15
|
const plugin_hooks_1 = require("../plugin-hooks");
|
|
@@ -57,7 +56,7 @@ function tapStartToRunWorkers(compiler, getIssuesWorker, getDependenciesWorker,
|
|
|
57
56
|
state.abortController.abort();
|
|
58
57
|
}
|
|
59
58
|
// create new abort controller for the new iteration
|
|
60
|
-
const abortController = new
|
|
59
|
+
const abortController = new AbortController();
|
|
61
60
|
state.abortController = abortController;
|
|
62
61
|
let filesChange = {};
|
|
63
62
|
if (state.watching) {
|
package/lib/issue/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IssuePredicate } from './issue-predicate';
|
|
2
2
|
import type { Issue } from './index';
|
|
3
|
-
|
|
3
|
+
type IssueMatch = Partial<Pick<Issue, 'severity' | 'code' | 'file'>>;
|
|
4
4
|
declare function createIssuePredicateFromIssueMatch(context: string, match: IssueMatch): IssuePredicate;
|
|
5
5
|
export { IssueMatch, createIssuePredicateFromIssueMatch };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IssueMatch } from './issue-match';
|
|
2
2
|
import type { IssuePredicate } from './issue-predicate';
|
|
3
|
-
|
|
3
|
+
type IssuePredicateOption = IssuePredicate | IssueMatch | (IssuePredicate | IssueMatch)[];
|
|
4
4
|
interface IssueOptions {
|
|
5
5
|
include?: IssuePredicateOption;
|
|
6
6
|
exclude?: IssuePredicateOption;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Issue } from './index';
|
|
2
|
-
|
|
2
|
+
type IssuePredicate = (issue: Issue) => boolean;
|
|
3
3
|
declare function createTrivialIssuePredicate(result: boolean): IssuePredicate;
|
|
4
4
|
declare function composeIssuePredicates(predicates: IssuePredicate[]): IssuePredicate;
|
|
5
5
|
export { IssuePredicate, createTrivialIssuePredicate, composeIssuePredicates };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type IssueSeverity = 'error' | 'warning';
|
|
2
2
|
declare function isIssueSeverity(value: unknown): value is IssueSeverity;
|
|
3
3
|
declare function compareIssueSeverities(severityA: IssueSeverity, severityB: IssueSeverity): number;
|
|
4
4
|
export { IssueSeverity, isIssueSeverity, compareIssueSeverities };
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/lib/plugin-hooks.d.ts
CHANGED
|
@@ -1,20 +1,36 @@
|
|
|
1
|
-
import { SyncHook, SyncWaterfallHook, AsyncSeriesWaterfallHook } from 'tapable';
|
|
1
|
+
import { SyncHook, SyncWaterfallHook, AsyncSeriesWaterfallHook } from '@rspack/lite-tapable';
|
|
2
2
|
import type * as rspack from '@rspack/core';
|
|
3
3
|
import type { FilesChange } from './files-change';
|
|
4
4
|
import type { Issue } from './issue';
|
|
5
5
|
declare function createPluginHooks(): {
|
|
6
|
-
start: AsyncSeriesWaterfallHook<[FilesChange, rspack.Compilation],
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
start: AsyncSeriesWaterfallHook<[FilesChange, rspack.Compilation], {
|
|
7
|
+
_UnsetAdditionalOptions: true;
|
|
8
|
+
}>;
|
|
9
|
+
waiting: SyncHook<[rspack.Compilation], void, {
|
|
10
|
+
_UnsetAdditionalOptions: true;
|
|
11
|
+
}>;
|
|
12
|
+
canceled: SyncHook<[rspack.Compilation], void, {
|
|
13
|
+
_UnsetAdditionalOptions: true;
|
|
14
|
+
}>;
|
|
15
|
+
error: SyncHook<[unknown, rspack.Compilation], void, {
|
|
16
|
+
_UnsetAdditionalOptions: true;
|
|
17
|
+
}>;
|
|
10
18
|
issues: SyncWaterfallHook<[Issue[], rspack.Compilation | undefined], void>;
|
|
11
19
|
};
|
|
12
|
-
|
|
20
|
+
type TsCheckerRspackPluginHooks = ReturnType<typeof createPluginHooks>;
|
|
13
21
|
declare function getPluginHooks(compiler: rspack.Compiler | rspack.MultiCompiler): {
|
|
14
|
-
start: AsyncSeriesWaterfallHook<[FilesChange, rspack.Compilation],
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
22
|
+
start: AsyncSeriesWaterfallHook<[FilesChange, rspack.Compilation], {
|
|
23
|
+
_UnsetAdditionalOptions: true;
|
|
24
|
+
}>;
|
|
25
|
+
waiting: SyncHook<[rspack.Compilation], void, {
|
|
26
|
+
_UnsetAdditionalOptions: true;
|
|
27
|
+
}>;
|
|
28
|
+
canceled: SyncHook<[rspack.Compilation], void, {
|
|
29
|
+
_UnsetAdditionalOptions: true;
|
|
30
|
+
}>;
|
|
31
|
+
error: SyncHook<[unknown, rspack.Compilation], void, {
|
|
32
|
+
_UnsetAdditionalOptions: true;
|
|
33
|
+
}>;
|
|
18
34
|
issues: SyncWaterfallHook<[Issue[], rspack.Compilation | undefined], void>;
|
|
19
35
|
};
|
|
20
36
|
export { getPluginHooks, TsCheckerRspackPluginHooks };
|
package/lib/plugin-hooks.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getPluginHooks = void 0;
|
|
4
|
-
const
|
|
4
|
+
const lite_tapable_1 = require("@rspack/lite-tapable");
|
|
5
5
|
const compilerHookMap = new WeakMap();
|
|
6
6
|
function createPluginHooks() {
|
|
7
7
|
return {
|
|
8
|
-
start: new
|
|
8
|
+
start: new lite_tapable_1.AsyncSeriesWaterfallHook([
|
|
9
9
|
'change',
|
|
10
10
|
'compilation',
|
|
11
11
|
]),
|
|
12
|
-
waiting: new
|
|
13
|
-
canceled: new
|
|
14
|
-
error: new
|
|
15
|
-
issues: new
|
|
12
|
+
waiting: new lite_tapable_1.SyncHook(['compilation']),
|
|
13
|
+
canceled: new lite_tapable_1.SyncHook(['compilation']),
|
|
14
|
+
error: new lite_tapable_1.SyncHook(['error', 'compilation']),
|
|
15
|
+
issues: new lite_tapable_1.SyncWaterfallHook([
|
|
16
16
|
'issues',
|
|
17
17
|
'compilation',
|
|
18
18
|
]),
|
package/lib/plugin-pools.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/lib/plugin-state.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import type { FullTap } from 'tapable';
|
|
1
|
+
/// <reference types="node" />
|
|
3
2
|
import type { FilesChange } from './files-change';
|
|
4
3
|
import type { FilesMatch } from './files-match';
|
|
5
4
|
import type { Issue } from './issue';
|
|
@@ -12,7 +11,7 @@ interface TsCheckerRspackPluginState {
|
|
|
12
11
|
watching: boolean;
|
|
13
12
|
initialized: boolean;
|
|
14
13
|
iteration: number;
|
|
15
|
-
webpackDevServerDoneTap:
|
|
14
|
+
webpackDevServerDoneTap: any | undefined;
|
|
16
15
|
}
|
|
17
16
|
declare function createPluginState(): TsCheckerRspackPluginState;
|
|
18
17
|
export { TsCheckerRspackPluginState, createPluginState };
|
package/lib/plugin.d.ts
CHANGED
|
@@ -18,11 +18,19 @@ declare class TsCheckerRspackPlugin {
|
|
|
18
18
|
private readonly options;
|
|
19
19
|
constructor(options?: TsCheckerRspackPluginOptions);
|
|
20
20
|
static getCompilerHooks(compiler: rspack.Compiler): {
|
|
21
|
-
start: import("tapable").AsyncSeriesWaterfallHook<[import("./files-change").FilesChange, rspack.Compilation],
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
start: import("@rspack/lite-tapable").AsyncSeriesWaterfallHook<[import("./files-change").FilesChange, rspack.Compilation], {
|
|
22
|
+
_UnsetAdditionalOptions: true;
|
|
23
|
+
}>;
|
|
24
|
+
waiting: import("@rspack/lite-tapable").SyncHook<[rspack.Compilation], void, {
|
|
25
|
+
_UnsetAdditionalOptions: true;
|
|
26
|
+
}>;
|
|
27
|
+
canceled: import("@rspack/lite-tapable").SyncHook<[rspack.Compilation], void, {
|
|
28
|
+
_UnsetAdditionalOptions: true;
|
|
29
|
+
}>;
|
|
30
|
+
error: import("@rspack/lite-tapable").SyncHook<[unknown, rspack.Compilation], void, {
|
|
31
|
+
_UnsetAdditionalOptions: true;
|
|
32
|
+
}>;
|
|
33
|
+
issues: import("@rspack/lite-tapable").SyncWaterfallHook<[import("./issue/issue").Issue[], rspack.Compilation | undefined], void>;
|
|
26
34
|
};
|
|
27
35
|
apply(compiler: rspack.Compiler): void;
|
|
28
36
|
}
|
package/lib/plugin.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -18,13 +22,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
18
22
|
__setModuleDefault(result, mod);
|
|
19
23
|
return result;
|
|
20
24
|
};
|
|
21
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
-
};
|
|
24
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
26
|
exports.TsCheckerRspackPlugin = void 0;
|
|
26
27
|
const path = __importStar(require("path"));
|
|
27
|
-
const schema_utils_1 = require("schema-utils");
|
|
28
28
|
const tap_after_compile_to_add_dependencies_1 = require("./hooks/tap-after-compile-to-add-dependencies");
|
|
29
29
|
const tap_after_environment_to_patch_watching_1 = require("./hooks/tap-after-environment-to-patch-watching");
|
|
30
30
|
const tap_error_to_log_message_1 = require("./hooks/tap-error-to-log-message");
|
|
@@ -32,19 +32,13 @@ const tap_start_to_run_workers_1 = require("./hooks/tap-start-to-run-workers");
|
|
|
32
32
|
const tap_stop_to_terminate_workers_1 = require("./hooks/tap-stop-to-terminate-workers");
|
|
33
33
|
const plugin_config_1 = require("./plugin-config");
|
|
34
34
|
const plugin_hooks_1 = require("./plugin-hooks");
|
|
35
|
-
const plugin_options_json_1 = __importDefault(require("./plugin-options.json"));
|
|
36
35
|
const plugin_pools_1 = require("./plugin-pools");
|
|
37
36
|
const plugin_state_1 = require("./plugin-state");
|
|
38
37
|
const rpc_1 = require("./rpc");
|
|
39
38
|
const type_script_support_1 = require("./typescript/type-script-support");
|
|
40
39
|
class TsCheckerRspackPlugin {
|
|
41
40
|
constructor(options = {}) {
|
|
42
|
-
// first validate options directly passed to the constructor
|
|
43
|
-
const config = { name: 'TsCheckerRspackPlugin' };
|
|
44
|
-
(0, schema_utils_1.validate)(plugin_options_json_1.default, options, config);
|
|
45
41
|
this.options = options;
|
|
46
|
-
// then validate merged options
|
|
47
|
-
(0, schema_utils_1.validate)(plugin_options_json_1.default, this.options, config);
|
|
48
42
|
}
|
|
49
43
|
static getCompilerHooks(compiler) {
|
|
50
44
|
return (0, plugin_hooks_1.getPluginHooks)(compiler);
|
|
@@ -67,7 +61,7 @@ exports.TsCheckerRspackPlugin = TsCheckerRspackPlugin;
|
|
|
67
61
|
* Current version of the plugin
|
|
68
62
|
* TODO: use `define` to replace it
|
|
69
63
|
*/
|
|
70
|
-
TsCheckerRspackPlugin.version = '1.0.0-beta.
|
|
64
|
+
TsCheckerRspackPlugin.version = '1.0.0-beta.1';
|
|
71
65
|
/**
|
|
72
66
|
* Default pools for the plugin concurrency limit
|
|
73
67
|
*/
|
package/lib/rpc/rpc-worker.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ interface RpcWorkerBase {
|
|
|
7
7
|
readonly connected: boolean;
|
|
8
8
|
readonly process: ChildProcess | undefined;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
type RpcWorker<T extends RpcMethod = RpcMethod> = RpcWorkerBase & RpcRemoteMethod<T>;
|
|
11
11
|
declare function createRpcWorker<T extends RpcMethod>(modulePath: string, data: unknown, memoryLimit?: number): RpcWorker<T>;
|
|
12
12
|
declare function getRpcWorkerData(): unknown;
|
|
13
13
|
export { createRpcWorker, getRpcWorkerData, RpcWorker };
|
package/lib/rpc/rpc-worker.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/lib/rpc/types.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ interface RpcRejectMessage {
|
|
|
13
13
|
id: string;
|
|
14
14
|
error: unknown;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
type RpcMessage = RpcCallMessage | RpcResolveMessage | RpcRejectMessage;
|
|
17
|
+
type RpcMethod = (...args: any[]) => any;
|
|
18
|
+
type RpcRemoteMethod<T extends RpcMethod> = T extends (...args: infer A) => infer R ? R extends Promise<any> ? (...args: A) => R : (...args: A) => Promise<R> : (...args: unknown[]) => Promise<unknown>;
|
|
19
19
|
export { RpcCallMessage, RpcResolveMessage, RpcRejectMessage, RpcMessage, RpcMethod, RpcRemoteMethod, };
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -24,7 +28,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
24
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
29
|
exports.assertTypeScriptSupport = void 0;
|
|
26
30
|
const os_1 = __importDefault(require("os"));
|
|
27
|
-
const
|
|
31
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
28
32
|
const semver = __importStar(require("semver"));
|
|
29
33
|
function assertTypeScriptSupport(config) {
|
|
30
34
|
let typescriptVersion;
|
|
@@ -50,7 +54,7 @@ function assertTypeScriptSupport(config) {
|
|
|
50
54
|
'The minimum required version is 3.8.0.',
|
|
51
55
|
].join(os_1.default.EOL));
|
|
52
56
|
}
|
|
53
|
-
if (!
|
|
57
|
+
if (!node_fs_1.default.existsSync(config.configFile)) {
|
|
54
58
|
throw new Error([
|
|
55
59
|
`Cannot find the "${config.configFile}" file.`,
|
|
56
60
|
`Please check webpack and TsCheckerRspackPlugin configuration.`,
|
|
@@ -13,6 +13,6 @@ function createTypeScriptWorkerConfig(compiler, options) {
|
|
|
13
13
|
: path_1.default.resolve(compiler.options.context || process.cwd(), configFile));
|
|
14
14
|
const optionsAsObject = typeof options === 'object' ? options : {};
|
|
15
15
|
const typescriptPath = optionsAsObject.typescriptPath || require.resolve('typescript');
|
|
16
|
-
return Object.assign(Object.assign({ enabled: options
|
|
16
|
+
return Object.assign(Object.assign({ enabled: Boolean(options) || options === undefined, memoryLimit: 2048, build: false, mode: optionsAsObject.build ? 'write-tsbuildinfo' : 'readonly', profile: false }, optionsAsObject), { configFile: configFile, configOverwrite: optionsAsObject.configOverwrite || {}, context: optionsAsObject.context || path_1.default.dirname(configFile), diagnosticOptions: Object.assign({ syntactic: false, semantic: true, declaration: false, global: false }, (optionsAsObject.diagnosticOptions || {})), typescriptPath: typescriptPath });
|
|
17
17
|
}
|
|
18
18
|
exports.createTypeScriptWorkerConfig = createTypeScriptWorkerConfig;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TypeScriptConfigOverwrite } from './type-script-config-overwrite';
|
|
2
2
|
import type { TypeScriptDiagnosticsOptions } from './type-script-diagnostics-options';
|
|
3
|
-
|
|
3
|
+
type TypeScriptWorkerOptions = {
|
|
4
4
|
memoryLimit?: number;
|
|
5
5
|
configFile?: string;
|
|
6
6
|
configOverwrite?: TypeScriptConfigOverwrite;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FilesChange } from '../../files-change';
|
|
2
2
|
import type { FilesMatch } from '../../files-match';
|
|
3
3
|
declare const getDependenciesWorker: (change: FilesChange) => FilesMatch;
|
|
4
|
-
export
|
|
4
|
+
export type GetDependenciesWorker = typeof getDependenciesWorker;
|
|
5
5
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FilesChange } from '../../files-change';
|
|
2
2
|
import type { Issue } from '../../issue';
|
|
3
3
|
declare const getIssuesWorker: (change: FilesChange, watching: boolean) => Promise<Issue[]>;
|
|
4
|
-
export
|
|
4
|
+
export type GetIssuesWorker = typeof getIssuesWorker;
|
|
5
5
|
export {};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,27 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
20
4
|
};
|
|
21
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
6
|
exports.realFileSystem = void 0;
|
|
23
7
|
const path_1 = require("path");
|
|
24
|
-
const
|
|
8
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
25
9
|
const existsCache = new Map();
|
|
26
10
|
const readStatsCache = new Map();
|
|
27
11
|
const readFileCache = new Map();
|
|
@@ -73,7 +57,7 @@ exports.realFileSystem = {
|
|
|
73
57
|
function exists(path) {
|
|
74
58
|
const normalizedPath = (0, path_1.normalize)(path);
|
|
75
59
|
if (!existsCache.has(normalizedPath)) {
|
|
76
|
-
existsCache.set(normalizedPath,
|
|
60
|
+
existsCache.set(normalizedPath, node_fs_1.default.existsSync(normalizedPath));
|
|
77
61
|
}
|
|
78
62
|
return !!existsCache.get(normalizedPath);
|
|
79
63
|
}
|
|
@@ -81,7 +65,7 @@ function readStats(path) {
|
|
|
81
65
|
const normalizedPath = (0, path_1.normalize)(path);
|
|
82
66
|
if (!readStatsCache.has(normalizedPath)) {
|
|
83
67
|
if (exists(normalizedPath)) {
|
|
84
|
-
readStatsCache.set(normalizedPath,
|
|
68
|
+
readStatsCache.set(normalizedPath, node_fs_1.default.statSync(normalizedPath));
|
|
85
69
|
}
|
|
86
70
|
}
|
|
87
71
|
return readStatsCache.get(normalizedPath);
|
|
@@ -91,7 +75,7 @@ function readFile(path, encoding) {
|
|
|
91
75
|
if (!readFileCache.has(normalizedPath)) {
|
|
92
76
|
const stats = readStats(normalizedPath);
|
|
93
77
|
if (stats && stats.isFile()) {
|
|
94
|
-
readFileCache.set(normalizedPath,
|
|
78
|
+
readFileCache.set(normalizedPath, node_fs_1.default.readFileSync(normalizedPath, { encoding: encoding }).toString());
|
|
95
79
|
}
|
|
96
80
|
else {
|
|
97
81
|
readFileCache.set(normalizedPath, undefined);
|
|
@@ -104,7 +88,7 @@ function readDir(path) {
|
|
|
104
88
|
if (!readDirCache.has(normalizedPath)) {
|
|
105
89
|
const stats = readStats(normalizedPath);
|
|
106
90
|
if (stats && stats.isDirectory()) {
|
|
107
|
-
readDirCache.set(normalizedPath,
|
|
91
|
+
readDirCache.set(normalizedPath, node_fs_1.default.readdirSync(normalizedPath, { withFileTypes: true }));
|
|
108
92
|
}
|
|
109
93
|
else {
|
|
110
94
|
readDirCache.set(normalizedPath, []);
|
|
@@ -119,7 +103,7 @@ function getRealPath(path) {
|
|
|
119
103
|
let nested = '';
|
|
120
104
|
while (base !== (0, path_1.dirname)(base)) {
|
|
121
105
|
if (exists(base)) {
|
|
122
|
-
realPathCache.set(normalizedPath, (0, path_1.normalize)((0, path_1.join)(
|
|
106
|
+
realPathCache.set(normalizedPath, (0, path_1.normalize)((0, path_1.join)(node_fs_1.default.realpathSync(base), nested)));
|
|
123
107
|
break;
|
|
124
108
|
}
|
|
125
109
|
nested = (0, path_1.join)((0, path_1.basename)(base), nested);
|
|
@@ -130,7 +114,7 @@ function getRealPath(path) {
|
|
|
130
114
|
}
|
|
131
115
|
function createDir(path) {
|
|
132
116
|
const normalizedPath = (0, path_1.normalize)(path);
|
|
133
|
-
|
|
117
|
+
node_fs_1.default.mkdirSync(normalizedPath, { recursive: true });
|
|
134
118
|
// update cache
|
|
135
119
|
existsCache.set(normalizedPath, true);
|
|
136
120
|
if (readDirCache.has((0, path_1.dirname)(normalizedPath))) {
|
|
@@ -145,7 +129,7 @@ function writeFile(path, data) {
|
|
|
145
129
|
if (!exists((0, path_1.dirname)(normalizedPath))) {
|
|
146
130
|
createDir((0, path_1.dirname)(normalizedPath));
|
|
147
131
|
}
|
|
148
|
-
|
|
132
|
+
node_fs_1.default.writeFileSync(normalizedPath, data);
|
|
149
133
|
// update cache
|
|
150
134
|
existsCache.set(normalizedPath, true);
|
|
151
135
|
if (readDirCache.has((0, path_1.dirname)(normalizedPath))) {
|
|
@@ -161,7 +145,7 @@ function writeFile(path, data) {
|
|
|
161
145
|
function deleteFile(path) {
|
|
162
146
|
if (exists(path)) {
|
|
163
147
|
const normalizedPath = (0, path_1.normalize)(path);
|
|
164
|
-
|
|
148
|
+
node_fs_1.default.unlinkSync(normalizedPath);
|
|
165
149
|
// update cache
|
|
166
150
|
existsCache.set(normalizedPath, false);
|
|
167
151
|
if (readDirCache.has((0, path_1.dirname)(normalizedPath))) {
|
|
@@ -178,7 +162,7 @@ function deleteFile(path) {
|
|
|
178
162
|
function updateTimes(path, atime, mtime) {
|
|
179
163
|
if (exists(path)) {
|
|
180
164
|
const normalizedPath = (0, path_1.normalize)(path);
|
|
181
|
-
|
|
165
|
+
node_fs_1.default.utimesSync((0, path_1.normalize)(path), atime, mtime);
|
|
182
166
|
// update cache
|
|
183
167
|
if (readStatsCache.has(normalizedPath)) {
|
|
184
168
|
readStatsCache.delete(normalizedPath);
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
type Task<T> = (signal?: AbortSignal) => Promise<T>;
|
|
3
3
|
interface Pool {
|
|
4
4
|
submit<T>(task: Task<T>, signal?: AbortSignal): Promise<T>;
|
|
5
5
|
size: number;
|
|
@@ -33,6 +33,10 @@ function createIsIgnored(ignored, excluded) {
|
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
class InclusiveNodeWatchFileSystem {
|
|
36
|
+
get watcher() {
|
|
37
|
+
var _a;
|
|
38
|
+
return this.watchFileSystem.watcher || ((_a = this.watchFileSystem.wfs) === null || _a === void 0 ? void 0 : _a.watcher);
|
|
39
|
+
}
|
|
36
40
|
constructor(watchFileSystem, compiler, pluginState) {
|
|
37
41
|
this.watchFileSystem = watchFileSystem;
|
|
38
42
|
this.compiler = compiler;
|
|
@@ -158,9 +162,5 @@ class InclusiveNodeWatchFileSystem {
|
|
|
158
162
|
this.dirsWatchers = new Map();
|
|
159
163
|
this.deletedFiles = new Set();
|
|
160
164
|
}
|
|
161
|
-
get watcher() {
|
|
162
|
-
var _a;
|
|
163
|
-
return this.watchFileSystem.watcher || ((_a = this.watchFileSystem.wfs) === null || _a === void 0 ? void 0 : _a.watcher);
|
|
164
|
-
}
|
|
165
165
|
}
|
|
166
166
|
exports.InclusiveNodeWatchFileSystem = InclusiveNodeWatchFileSystem;
|
|
@@ -5,7 +5,7 @@ interface Watchpack extends EventEmitter {
|
|
|
5
5
|
_onChange(item: string, mtime: number, file: string, type?: string): void;
|
|
6
6
|
_onRemove(item: string, file: string, type?: string): void;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
type Watch = NonNullable<rspack.Compiler['watchFileSystem']>['watch'];
|
|
9
9
|
interface WatchFileSystem {
|
|
10
10
|
watcher?: Watchpack;
|
|
11
11
|
wfs?: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-checker-rspack-plugin",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.1",
|
|
4
4
|
"description": "Runs typescript type checker and linter on separate process.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rspack",
|
|
@@ -24,24 +24,21 @@
|
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "cross-env rimraf lib && cross-env tsc --version && cross-env tsc",
|
|
26
26
|
"lint": "echo lint",
|
|
27
|
-
"test": "
|
|
27
|
+
"test": "pnpm build && pnpm test:unit && pnpm test:e2e",
|
|
28
28
|
"test:unit": "cross-env jest --config=test/unit/jest.config.js",
|
|
29
29
|
"test:e2e": "npm pack && cross-env jest --config=test/e2e/jest.config.js --ci -i -b",
|
|
30
|
-
"precommit": "
|
|
31
|
-
"
|
|
32
|
-
"
|
|
30
|
+
"precommit": "pnpm build && pnpm test:unit",
|
|
31
|
+
"prepare": "husky install && pnpm build",
|
|
32
|
+
"bump": "npx bumpp"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@babel/code-frame": "^7.16.7",
|
|
36
|
+
"@rspack/lite-tapable": "^1.0.0",
|
|
36
37
|
"chalk": "^4.1.2",
|
|
37
38
|
"chokidar": "^3.5.3",
|
|
38
|
-
"
|
|
39
|
-
"memfs": "^3.4.1",
|
|
39
|
+
"memfs": "^4.14.0",
|
|
40
40
|
"minimatch": "^3.0.4",
|
|
41
|
-
"
|
|
42
|
-
"schema-utils": "^3.1.1",
|
|
43
|
-
"semver": "^7.3.5",
|
|
44
|
-
"tapable": "^2.2.1"
|
|
41
|
+
"semver": "^7.3.5"
|
|
45
42
|
},
|
|
46
43
|
"peerDependencies": {
|
|
47
44
|
"@rspack/core": "^1.0.0",
|
|
@@ -52,22 +49,18 @@
|
|
|
52
49
|
"@rspack/core": "^1.1.3",
|
|
53
50
|
"@types/babel__code-frame": "^7.0.3",
|
|
54
51
|
"@types/cross-spawn": "^6.0.2",
|
|
55
|
-
"@types/fs-extra": "^9.0.13",
|
|
56
52
|
"@types/jest": "^27.4.0",
|
|
57
|
-
"@types/json-schema": "^7.0.9",
|
|
58
53
|
"@types/minimatch": "^3.0.5",
|
|
59
54
|
"@types/mock-fs": "^4.13.1",
|
|
60
55
|
"@types/node": "^16.4.13",
|
|
61
56
|
"@types/rimraf": "^3.0.2",
|
|
62
57
|
"@types/semver": "^7.3.9",
|
|
63
58
|
"cross-env": "^7.0.3",
|
|
64
|
-
"git-cz": "^4.8.0",
|
|
65
59
|
"husky": "^7.0.4",
|
|
66
60
|
"jest": "^27.4.7",
|
|
67
61
|
"jest-circus": "^27.4.6",
|
|
68
62
|
"jest-environment-node": "^27.4.6",
|
|
69
63
|
"jest-runner": "^27.0.0",
|
|
70
|
-
"json-schema": "^0.4.0",
|
|
71
64
|
"karton": "^0.4.1",
|
|
72
65
|
"mock-fs": "^5.1.2",
|
|
73
66
|
"prettier": "^2.5.1",
|
|
@@ -77,12 +70,12 @@
|
|
|
77
70
|
"typescript": "^4.5.5"
|
|
78
71
|
},
|
|
79
72
|
"engines": {
|
|
80
|
-
"node": ">=
|
|
81
|
-
"
|
|
73
|
+
"node": ">=16.0.0",
|
|
74
|
+
"pnpm": ">=1.0.0"
|
|
82
75
|
},
|
|
83
76
|
"publishConfig": {
|
|
84
77
|
"access": "public",
|
|
85
78
|
"registry": "https://registry.npmjs.org/"
|
|
86
79
|
},
|
|
87
|
-
"packageManager": "
|
|
80
|
+
"packageManager": "pnpm@9.14.2"
|
|
88
81
|
}
|
package/lib/plugin-options.json
DELETED
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"type": "object",
|
|
4
|
-
"properties": {
|
|
5
|
-
"async": {
|
|
6
|
-
"type": "boolean",
|
|
7
|
-
"description": "When true, plugin will not block compilation to finish issues checking"
|
|
8
|
-
},
|
|
9
|
-
"typescript": {
|
|
10
|
-
"$ref": "#/definitions/TypeScriptOptions"
|
|
11
|
-
},
|
|
12
|
-
"formatter": {
|
|
13
|
-
"$ref": "#/definitions/FormatterOptions"
|
|
14
|
-
},
|
|
15
|
-
"issue": {
|
|
16
|
-
"$ref": "#/definitions/IssueOptions"
|
|
17
|
-
},
|
|
18
|
-
"logger": {
|
|
19
|
-
"$ref": "#/definitions/Logger"
|
|
20
|
-
},
|
|
21
|
-
"devServer": {
|
|
22
|
-
"type": "boolean",
|
|
23
|
-
"description": "Enable reporting to Webpack Dev Server."
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"additionalProperties": false,
|
|
27
|
-
"definitions": {
|
|
28
|
-
"Formatter": {
|
|
29
|
-
"instanceof": "Function"
|
|
30
|
-
},
|
|
31
|
-
"ComplexFormatterPreferences": {
|
|
32
|
-
"type": "object",
|
|
33
|
-
"properties": {
|
|
34
|
-
"type": {
|
|
35
|
-
"$ref": "#/definitions/FormatterType"
|
|
36
|
-
},
|
|
37
|
-
"pathType": {
|
|
38
|
-
"$ref": "#/definitions/FormatterPathType"
|
|
39
|
-
},
|
|
40
|
-
"options": {
|
|
41
|
-
"type": "object",
|
|
42
|
-
"additionalProperties": true
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"required": ["type"]
|
|
46
|
-
},
|
|
47
|
-
"FormatterType": {
|
|
48
|
-
"type": "string",
|
|
49
|
-
"enum": ["basic", "codeframe"]
|
|
50
|
-
},
|
|
51
|
-
"FormatterPathType": {
|
|
52
|
-
"type": "string",
|
|
53
|
-
"enum": ["relative", "absolute"]
|
|
54
|
-
},
|
|
55
|
-
"IssueMatch": {
|
|
56
|
-
"type": "object",
|
|
57
|
-
"properties": {
|
|
58
|
-
"severity": {
|
|
59
|
-
"type": "string",
|
|
60
|
-
"enum": ["error", "warning"]
|
|
61
|
-
},
|
|
62
|
-
"code": {
|
|
63
|
-
"type": "string"
|
|
64
|
-
},
|
|
65
|
-
"file": {
|
|
66
|
-
"type": "string"
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
"IssuePredicate": {
|
|
71
|
-
"instanceof": "Function"
|
|
72
|
-
},
|
|
73
|
-
"IssuePredicateOption": {
|
|
74
|
-
"oneOf": [
|
|
75
|
-
{
|
|
76
|
-
"$ref": "#/definitions/IssuePredicate"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"$ref": "#/definitions/IssueMatch"
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"type": "array",
|
|
83
|
-
"items": {
|
|
84
|
-
"oneOf": [
|
|
85
|
-
{
|
|
86
|
-
"$ref": "#/definitions/IssuePredicate"
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
"$ref": "#/definitions/IssueMatch"
|
|
90
|
-
}
|
|
91
|
-
]
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
]
|
|
95
|
-
},
|
|
96
|
-
"Logger": {
|
|
97
|
-
"oneOf": [
|
|
98
|
-
{
|
|
99
|
-
"type": "object",
|
|
100
|
-
"properties": {
|
|
101
|
-
"error": {
|
|
102
|
-
"instanceof": "Function"
|
|
103
|
-
},
|
|
104
|
-
"log": {
|
|
105
|
-
"instanceof": "Function"
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"type": "string",
|
|
111
|
-
"enum": ["webpack-infrastructure"]
|
|
112
|
-
}
|
|
113
|
-
]
|
|
114
|
-
},
|
|
115
|
-
"TypeScriptOptions": {
|
|
116
|
-
"type": "object",
|
|
117
|
-
"properties": {
|
|
118
|
-
"memoryLimit": {
|
|
119
|
-
"type": "number",
|
|
120
|
-
"description": "Memory limit for TypeScript reporter process."
|
|
121
|
-
},
|
|
122
|
-
"configFile": {
|
|
123
|
-
"type": "string",
|
|
124
|
-
"description": "Path to tsconfig.json. By default plugin uses context or process.cwd() to localize tsconfig.json file."
|
|
125
|
-
},
|
|
126
|
-
"context": {
|
|
127
|
-
"type": "string",
|
|
128
|
-
"description": "The base path for finding files specified in the tsconfig.json. Same as context option from the ts-loader."
|
|
129
|
-
},
|
|
130
|
-
"build": {
|
|
131
|
-
"type": "boolean",
|
|
132
|
-
"description": "The equivalent of the `--build` flag from the `tsc`."
|
|
133
|
-
},
|
|
134
|
-
"mode": {
|
|
135
|
-
"type": "string",
|
|
136
|
-
"enum": ["readonly", "write-tsbuildinfo", "write-dts", "write-references"],
|
|
137
|
-
"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"
|
|
138
|
-
},
|
|
139
|
-
"compilerOptions": {
|
|
140
|
-
"type": "object",
|
|
141
|
-
"description": "Custom compilerOptions to be passed to the TypeScript compiler.",
|
|
142
|
-
"additionalProperties": true
|
|
143
|
-
},
|
|
144
|
-
"diagnosticOptions": {
|
|
145
|
-
"type": "object",
|
|
146
|
-
"description": "Types of diagnostics to be reported.",
|
|
147
|
-
"properties": {
|
|
148
|
-
"syntactic": {
|
|
149
|
-
"type": "boolean"
|
|
150
|
-
},
|
|
151
|
-
"semantic": {
|
|
152
|
-
"type": "boolean"
|
|
153
|
-
},
|
|
154
|
-
"declaration": {
|
|
155
|
-
"type": "boolean"
|
|
156
|
-
},
|
|
157
|
-
"global": {
|
|
158
|
-
"type": "boolean"
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
"profile": {
|
|
163
|
-
"type": "boolean",
|
|
164
|
-
"description": "Measures and prints timings related to the TypeScript performance."
|
|
165
|
-
},
|
|
166
|
-
"typescriptPath": {
|
|
167
|
-
"type": "string",
|
|
168
|
-
"description": "If supplied this is a custom path where TypeScript can be found."
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
"FormatterOptions": {
|
|
173
|
-
"oneOf": [
|
|
174
|
-
{
|
|
175
|
-
"$ref": "#/definitions/FormatterType"
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
"$ref": "#/definitions/ComplexFormatterPreferences"
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
"$ref": "#/definitions/Formatter"
|
|
182
|
-
}
|
|
183
|
-
]
|
|
184
|
-
},
|
|
185
|
-
"IssueOptions": {
|
|
186
|
-
"type": "object",
|
|
187
|
-
"properties": {
|
|
188
|
-
"include": {
|
|
189
|
-
"$ref": "#/definitions/IssuePredicateOption"
|
|
190
|
-
},
|
|
191
|
-
"exclude": {
|
|
192
|
-
"$ref": "#/definitions/IssuePredicateOption"
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|