@rsdoctor/core 0.0.0-next-20240620044732
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 +21 -0
- package/README.md +22 -0
- package/dist/build-utils/build/chunks/assetsModules.d.ts +4 -0
- package/dist/build-utils/build/chunks/assetsModules.d.ts.map +1 -0
- package/dist/build-utils/build/chunks/assetsModules.js +36 -0
- package/dist/build-utils/build/chunks/chunkTransform.d.ts +5 -0
- package/dist/build-utils/build/chunks/chunkTransform.d.ts.map +1 -0
- package/dist/build-utils/build/chunks/chunkTransform.js +31 -0
- package/dist/build-utils/build/chunks/generateTileGraph.d.ts +11 -0
- package/dist/build-utils/build/chunks/generateTileGraph.d.ts.map +1 -0
- package/dist/build-utils/build/chunks/generateTileGraph.js +71 -0
- package/dist/build-utils/build/chunks/index.d.ts +4 -0
- package/dist/build-utils/build/chunks/index.d.ts.map +1 -0
- package/dist/build-utils/build/chunks/index.js +26 -0
- package/dist/build-utils/build/index.d.ts +5 -0
- package/dist/build-utils/build/index.d.ts.map +1 -0
- package/dist/build-utils/build/index.js +47 -0
- package/dist/build-utils/build/module-graph/index.d.ts +4 -0
- package/dist/build-utils/build/module-graph/index.d.ts.map +1 -0
- package/dist/build-utils/build/module-graph/index.js +26 -0
- package/dist/build-utils/build/module-graph/parser.d.ts +3 -0
- package/dist/build-utils/build/module-graph/parser.d.ts.map +1 -0
- package/dist/build-utils/build/module-graph/parser.js +44 -0
- package/dist/build-utils/build/module-graph/transform.d.ts +5 -0
- package/dist/build-utils/build/module-graph/transform.d.ts.map +1 -0
- package/dist/build-utils/build/module-graph/transform.js +37 -0
- package/dist/build-utils/build/module-graph/treeShaking.d.ts +4 -0
- package/dist/build-utils/build/module-graph/treeShaking.d.ts.map +1 -0
- package/dist/build-utils/build/module-graph/treeShaking.js +132 -0
- package/dist/build-utils/build/module-graph/utils.d.ts +4 -0
- package/dist/build-utils/build/module-graph/utils.d.ts.map +1 -0
- package/dist/build-utils/build/module-graph/utils.js +113 -0
- package/dist/build-utils/build/module-graph/webpack/transform.d.ts +12 -0
- package/dist/build-utils/build/module-graph/webpack/transform.d.ts.map +1 -0
- package/dist/build-utils/build/module-graph/webpack/transform.js +195 -0
- package/dist/build-utils/build/utils/index.d.ts +4 -0
- package/dist/build-utils/build/utils/index.d.ts.map +1 -0
- package/dist/build-utils/build/utils/index.js +26 -0
- package/dist/build-utils/build/utils/loader.d.ts +19 -0
- package/dist/build-utils/build/utils/loader.d.ts.map +1 -0
- package/dist/build-utils/build/utils/loader.js +299 -0
- package/dist/build-utils/build/utils/parseBundle.d.ts +13 -0
- package/dist/build-utils/build/utils/parseBundle.d.ts.map +1 -0
- package/dist/build-utils/build/utils/parseBundle.js +367 -0
- package/dist/build-utils/build/utils/plugin.d.ts +6 -0
- package/dist/build-utils/build/utils/plugin.d.ts.map +1 -0
- package/dist/build-utils/build/utils/plugin.js +63 -0
- package/dist/build-utils/common/chunks/assetsContent.d.ts +5 -0
- package/dist/build-utils/common/chunks/assetsContent.d.ts.map +1 -0
- package/dist/build-utils/common/chunks/assetsContent.js +34 -0
- package/dist/build-utils/common/chunks/assetsModules.d.ts +24 -0
- package/dist/build-utils/common/chunks/assetsModules.d.ts.map +1 -0
- package/dist/build-utils/common/chunks/assetsModules.js +107 -0
- package/dist/build-utils/common/chunks/chunkTransform.d.ts +6 -0
- package/dist/build-utils/common/chunks/chunkTransform.d.ts.map +1 -0
- package/dist/build-utils/common/chunks/chunkTransform.js +73 -0
- package/dist/build-utils/common/chunks/index.d.ts +4 -0
- package/dist/build-utils/common/chunks/index.d.ts.map +1 -0
- package/dist/build-utils/common/chunks/index.js +26 -0
- package/dist/build-utils/common/index.d.ts +6 -0
- package/dist/build-utils/common/index.d.ts.map +1 -0
- package/dist/build-utils/common/index.js +50 -0
- package/dist/build-utils/common/module-graph/compatible.d.ts +10 -0
- package/dist/build-utils/common/module-graph/compatible.d.ts.map +1 -0
- package/dist/build-utils/common/module-graph/compatible.js +63 -0
- package/dist/build-utils/common/module-graph/index.d.ts +4 -0
- package/dist/build-utils/common/module-graph/index.d.ts.map +1 -0
- package/dist/build-utils/common/module-graph/index.js +26 -0
- package/dist/build-utils/common/module-graph/transform.d.ts +8 -0
- package/dist/build-utils/common/module-graph/transform.d.ts.map +1 -0
- package/dist/build-utils/common/module-graph/transform.js +200 -0
- package/dist/build-utils/common/module-graph/utils.d.ts +16 -0
- package/dist/build-utils/common/module-graph/utils.d.ts.map +1 -0
- package/dist/build-utils/common/module-graph/utils.js +62 -0
- package/dist/build-utils/common/trans-utils/index.d.ts +2 -0
- package/dist/build-utils/common/trans-utils/index.d.ts.map +1 -0
- package/dist/build-utils/common/trans-utils/index.js +22 -0
- package/dist/build-utils/common/trans-utils/transStats.d.ts +7 -0
- package/dist/build-utils/common/trans-utils/transStats.d.ts.map +1 -0
- package/dist/build-utils/common/trans-utils/transStats.js +35 -0
- package/dist/build-utils/common/webpack/compatible.d.ts +27 -0
- package/dist/build-utils/common/webpack/compatible.d.ts.map +1 -0
- package/dist/build-utils/common/webpack/compatible.js +181 -0
- package/dist/build-utils/index.d.ts +3 -0
- package/dist/build-utils/index.d.ts.map +1 -0
- package/dist/build-utils/index.js +41 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/inner-plugins/constants.d.ts +7 -0
- package/dist/inner-plugins/constants.d.ts.map +1 -0
- package/dist/inner-plugins/constants.js +52 -0
- package/dist/inner-plugins/index.d.ts +3 -0
- package/dist/inner-plugins/index.d.ts.map +1 -0
- package/dist/inner-plugins/index.js +24 -0
- package/dist/inner-plugins/loaders/proxy.d.ts +5 -0
- package/dist/inner-plugins/loaders/proxy.d.ts.map +1 -0
- package/dist/inner-plugins/loaders/proxy.js +115 -0
- package/dist/inner-plugins/plugins/base.d.ts +14 -0
- package/dist/inner-plugins/plugins/base.d.ts.map +1 -0
- package/dist/inner-plugins/plugins/base.js +45 -0
- package/dist/inner-plugins/plugins/bundle.d.ts +15 -0
- package/dist/inner-plugins/plugins/bundle.d.ts.map +1 -0
- package/dist/inner-plugins/plugins/bundle.js +92 -0
- package/dist/inner-plugins/plugins/bundleTagPlugin.d.ts +7 -0
- package/dist/inner-plugins/plugins/bundleTagPlugin.d.ts.map +1 -0
- package/dist/inner-plugins/plugins/bundleTagPlugin.js +81 -0
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.ts +10 -0
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.ts.map +1 -0
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.js +126 -0
- package/dist/inner-plugins/plugins/errors.d.ts +12 -0
- package/dist/inner-plugins/plugins/errors.d.ts.map +1 -0
- package/dist/inner-plugins/plugins/errors.js +85 -0
- package/dist/inner-plugins/plugins/index.d.ts +11 -0
- package/dist/inner-plugins/plugins/index.d.ts.map +1 -0
- package/dist/inner-plugins/plugins/index.js +40 -0
- package/dist/inner-plugins/plugins/loader.d.ts +12 -0
- package/dist/inner-plugins/plugins/loader.d.ts.map +1 -0
- package/dist/inner-plugins/plugins/loader.js +161 -0
- package/dist/inner-plugins/plugins/plugins.d.ts +9 -0
- package/dist/inner-plugins/plugins/plugins.d.ts.map +1 -0
- package/dist/inner-plugins/plugins/plugins.js +60 -0
- package/dist/inner-plugins/plugins/progress.d.ts +9 -0
- package/dist/inner-plugins/plugins/progress.d.ts.map +1 -0
- package/dist/inner-plugins/plugins/progress.js +59 -0
- package/dist/inner-plugins/plugins/rules.d.ts +9 -0
- package/dist/inner-plugins/plugins/rules.d.ts.map +1 -0
- package/dist/inner-plugins/plugins/rules.js +85 -0
- package/dist/inner-plugins/plugins/summary.d.ts +15 -0
- package/dist/inner-plugins/plugins/summary.d.ts.map +1 -0
- package/dist/inner-plugins/plugins/summary.js +115 -0
- package/dist/inner-plugins/utils/circleDetect.d.ts +5 -0
- package/dist/inner-plugins/utils/circleDetect.d.ts.map +1 -0
- package/dist/inner-plugins/utils/circleDetect.js +42 -0
- package/dist/inner-plugins/utils/config.d.ts +8 -0
- package/dist/inner-plugins/utils/config.d.ts.map +1 -0
- package/dist/inner-plugins/utils/config.js +151 -0
- package/dist/inner-plugins/utils/index.d.ts +6 -0
- package/dist/inner-plugins/utils/index.d.ts.map +1 -0
- package/dist/inner-plugins/utils/index.js +30 -0
- package/dist/inner-plugins/utils/loader.d.ts +12 -0
- package/dist/inner-plugins/utils/loader.d.ts.map +1 -0
- package/dist/inner-plugins/utils/loader.js +201 -0
- package/dist/inner-plugins/utils/plugin.d.ts +6 -0
- package/dist/inner-plugins/utils/plugin.d.ts.map +1 -0
- package/dist/inner-plugins/utils/plugin.js +126 -0
- package/dist/inner-plugins/utils/sdk.d.ts +4 -0
- package/dist/inner-plugins/utils/sdk.d.ts.map +1 -0
- package/dist/inner-plugins/utils/sdk.js +43 -0
- package/dist/rules/index.d.ts +4 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +33 -0
- package/dist/rules/linter.d.ts +10 -0
- package/dist/rules/linter.d.ts.map +1 -0
- package/dist/rules/linter.js +74 -0
- package/dist/rules/rule.d.ts +28 -0
- package/dist/rules/rule.d.ts.map +1 -0
- package/dist/rules/rule.js +143 -0
- package/dist/rules/rules/default-import-check/index.d.ts +5 -0
- package/dist/rules/rules/default-import-check/index.d.ts.map +1 -0
- package/dist/rules/rules/default-import-check/index.js +124 -0
- package/dist/rules/rules/default-import-check/types.d.ts +5 -0
- package/dist/rules/rules/default-import-check/types.d.ts.map +1 -0
- package/dist/rules/rules/default-import-check/types.js +16 -0
- package/dist/rules/rules/default-import-check/utils.d.ts +11 -0
- package/dist/rules/rules/default-import-check/utils.d.ts.map +1 -0
- package/dist/rules/rules/default-import-check/utils.js +93 -0
- package/dist/rules/rules/duplicate-package/index.d.ts +5 -0
- package/dist/rules/rules/duplicate-package/index.d.ts.map +1 -0
- package/dist/rules/rules/duplicate-package/index.js +71 -0
- package/dist/rules/rules/duplicate-package/types.d.ts +25 -0
- package/dist/rules/rules/duplicate-package/types.d.ts.map +1 -0
- package/dist/rules/rules/duplicate-package/types.js +51 -0
- package/dist/rules/rules/duplicate-package/utils.d.ts +4 -0
- package/dist/rules/rules/duplicate-package/utils.d.ts.map +1 -0
- package/dist/rules/rules/duplicate-package/utils.js +89 -0
- package/dist/rules/rules/ecma-version-check/index.d.ts +5 -0
- package/dist/rules/rules/ecma-version-check/index.d.ts.map +1 -0
- package/dist/rules/rules/ecma-version-check/index.js +82 -0
- package/dist/rules/rules/ecma-version-check/types.d.ts +8 -0
- package/dist/rules/rules/ecma-version-check/types.d.ts.map +1 -0
- package/dist/rules/rules/ecma-version-check/types.js +16 -0
- package/dist/rules/rules/ecma-version-check/utils.d.ts +3 -0
- package/dist/rules/rules/ecma-version-check/utils.d.ts.map +1 -0
- package/dist/rules/rules/ecma-version-check/utils.js +31 -0
- package/dist/rules/rules/index.d.ts +2 -0
- package/dist/rules/rules/index.d.ts.map +1 -0
- package/dist/rules/rules/index.js +37 -0
- package/dist/rules/rules/loader-performance-optimization/index.d.ts +5 -0
- package/dist/rules/rules/loader-performance-optimization/index.d.ts.map +1 -0
- package/dist/rules/rules/loader-performance-optimization/index.js +124 -0
- package/dist/rules/rules/loader-performance-optimization/types.d.ts +23 -0
- package/dist/rules/rules/loader-performance-optimization/types.d.ts.map +1 -0
- package/dist/rules/rules/loader-performance-optimization/types.js +16 -0
- package/dist/rules/rules/loader-performance-optimization/utils.d.ts +2 -0
- package/dist/rules/rules/loader-performance-optimization/utils.d.ts.map +1 -0
- package/dist/rules/rules/loader-performance-optimization/utils.js +38 -0
- package/dist/rules/utils.d.ts +4 -0
- package/dist/rules/utils.d.ts.map +1 -0
- package/dist/rules/utils.js +44 -0
- package/dist/types/chunks.d.ts +12 -0
- package/dist/types/chunks.d.ts.map +1 -0
- package/dist/types/chunks.js +16 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +30 -0
- package/dist/types/loader.d.ts +20 -0
- package/dist/types/loader.d.ts.map +1 -0
- package/dist/types/loader.js +16 -0
- package/dist/types/plugin.d.ts +96 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/plugin.js +16 -0
- package/dist/types/rules.d.ts +8 -0
- package/dist/types/rules.d.ts.map +1 -0
- package/dist/types/rules.js +16 -0
- package/dist/types/webpack.d.ts +15 -0
- package/dist/types/webpack.d.ts.map +1 -0
- package/dist/types/webpack.js +16 -0
- package/package.json +112 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rules/rules/ecma-version-check/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAItC,eAAO,MAAM,IAAI,+CA2Cf,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var ecma_version_check_exports = {};
|
|
30
|
+
__export(ecma_version_check_exports, {
|
|
31
|
+
rule: () => rule
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(ecma_version_check_exports);
|
|
34
|
+
var import_ruleUtils = require("@rsdoctor/utils/ruleUtils");
|
|
35
|
+
var import_path = __toESM(require("path"));
|
|
36
|
+
var import_rule = require("../../rule");
|
|
37
|
+
var import_utils = require("./utils");
|
|
38
|
+
var import_types2 = require("@rsdoctor/types");
|
|
39
|
+
const title = "ecma-version-check";
|
|
40
|
+
const rule = (0, import_rule.defineRule)(() => {
|
|
41
|
+
return {
|
|
42
|
+
meta: {
|
|
43
|
+
code: "E1004",
|
|
44
|
+
title,
|
|
45
|
+
category: "bundle",
|
|
46
|
+
severity: import_types2.Linter.Severity.Warn,
|
|
47
|
+
defaultConfig: {
|
|
48
|
+
highestVersion: import_ruleUtils.ECMAVersion.ES5,
|
|
49
|
+
ignore: []
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
check({ chunkGraph, report, ruleConfig }) {
|
|
53
|
+
for (const asset of chunkGraph.getAssets()) {
|
|
54
|
+
if (import_path.default.extname(asset.path) !== ".js") {
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (ruleConfig.ignore.includes(asset.path)) {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
const currentVersion = import_ruleUtils.parser.utils.detectECMAVersion(asset.content);
|
|
61
|
+
const currentVersionNumber = (0, import_utils.getVersionNumber)(currentVersion);
|
|
62
|
+
const configVersionNumber = (0, import_utils.getVersionNumber)(ruleConfig.highestVersion);
|
|
63
|
+
if (!configVersionNumber || !currentVersionNumber) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (currentVersionNumber > configVersionNumber) {
|
|
67
|
+
const assetsName = import_path.default.basename(asset.path);
|
|
68
|
+
report({
|
|
69
|
+
message: `The ECMA version used in "${assetsName}" is ${currentVersion}, which exceeds the ${ruleConfig.highestVersion} standard.`,
|
|
70
|
+
detail: {
|
|
71
|
+
type: "link"
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
80
|
+
0 && (module.exports = {
|
|
81
|
+
rule
|
|
82
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/rules/rules/ecma-version-check/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D,MAAM,WAAW,MAAM;IACrB,6BAA6B;IAC7B,cAAc,EAAE,WAAW,CAAC;IAC5B,uCAAuC;IACvC,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var types_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/rules/rules/ecma-version-check/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,WAAW,sBAIvD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var utils_exports = {};
|
|
20
|
+
__export(utils_exports, {
|
|
21
|
+
getVersionNumber: () => getVersionNumber
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(utils_exports);
|
|
24
|
+
function getVersionNumber(ECMAString) {
|
|
25
|
+
const version = ECMAString.match(/\d/);
|
|
26
|
+
return version?.length ? Number(version[0]) : void 0;
|
|
27
|
+
}
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
+
0 && (module.exports = {
|
|
30
|
+
getVersionNumber
|
|
31
|
+
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const rules: (import("@rsdoctor/types/dist/linter").RuleData<import("./duplicate-package").Config, "duplicate-package"> | import("@rsdoctor/types/dist/linter").RuleData<import("./default-import-check").Config, "default-import-check"> | import("@rsdoctor/types/dist/linter").RuleData<import("./loader-performance-optimization").Config, "loader-performance-optimization"> | import("@rsdoctor/types/dist/linter").RuleData<import("./ecma-version-check").Config, "ecma-version-check">)[];
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rules/rules/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,KAAK,udAKjB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var rules_exports = {};
|
|
20
|
+
__export(rules_exports, {
|
|
21
|
+
rules: () => rules
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(rules_exports);
|
|
24
|
+
var import_duplicate_package = require("./duplicate-package");
|
|
25
|
+
var import_default_import_check = require("./default-import-check");
|
|
26
|
+
var import_loader_performance_optimization = require("./loader-performance-optimization");
|
|
27
|
+
var import_ecma_version_check = require("./ecma-version-check");
|
|
28
|
+
const rules = [
|
|
29
|
+
import_duplicate_package.rule,
|
|
30
|
+
import_default_import_check.rule,
|
|
31
|
+
import_loader_performance_optimization.rule,
|
|
32
|
+
import_ecma_version_check.rule
|
|
33
|
+
];
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
rules
|
|
37
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rules/rules/loader-performance-optimization/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAO,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EAAE,MAAM,EAAkB,MAAM,SAAS,CAAC;AAGjD,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAItC,eAAO,MAAM,IAAI,4DAqHf,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var loader_performance_optimization_exports = {};
|
|
20
|
+
__export(loader_performance_optimization_exports, {
|
|
21
|
+
rule: () => rule
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(loader_performance_optimization_exports);
|
|
24
|
+
var import_types = require("@rsdoctor/types");
|
|
25
|
+
var import_common = require("@rsdoctor/utils/common");
|
|
26
|
+
var import_rule = require("../../rule");
|
|
27
|
+
var import_utils = require("./utils");
|
|
28
|
+
const title = "loader-performance-optimization";
|
|
29
|
+
const rule = (0, import_rule.defineRule)(() => {
|
|
30
|
+
return {
|
|
31
|
+
meta: {
|
|
32
|
+
code: "E1003",
|
|
33
|
+
title,
|
|
34
|
+
category: "compile",
|
|
35
|
+
severity: import_types.Linter.Severity.Warn,
|
|
36
|
+
defaultConfig: {
|
|
37
|
+
ignore: [],
|
|
38
|
+
threshold: 5e3,
|
|
39
|
+
extensions: ["js", "css", "jpg", "jpeg", "png", "gif", "webp", "svg"]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
check({ loader, configs, root, ruleConfig, report }) {
|
|
43
|
+
const { extensions, ignore, threshold } = ruleConfig;
|
|
44
|
+
if (extensions.length === 0)
|
|
45
|
+
return;
|
|
46
|
+
if (loader.length === 0)
|
|
47
|
+
return;
|
|
48
|
+
const { config } = configs.find((e) => e.name === "webpack") || { config: void 0 };
|
|
49
|
+
if (!config) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const cwd = config.context || root;
|
|
53
|
+
const nodeModulesPathRegexp = /\/node_modules\//;
|
|
54
|
+
const resultMap = /* @__PURE__ */ new Map();
|
|
55
|
+
const loaders = loader.map((el) => el.loaders).reduce((t, c) => t.concat(c));
|
|
56
|
+
for (const item of loader) {
|
|
57
|
+
const { path, ext } = item.resource;
|
|
58
|
+
if (!(0, import_utils.match)(ext, extensions))
|
|
59
|
+
continue;
|
|
60
|
+
if (nodeModulesPathRegexp.test(path) || !path.startsWith(cwd)) {
|
|
61
|
+
item.loaders.forEach((el) => {
|
|
62
|
+
if ((0, import_utils.match)(el.loader, ignore))
|
|
63
|
+
return;
|
|
64
|
+
const costs = import_common.Loader.getLoaderCosts(el, loaders);
|
|
65
|
+
const v = {
|
|
66
|
+
...el,
|
|
67
|
+
__resource__: item.resource,
|
|
68
|
+
__costs__: costs
|
|
69
|
+
};
|
|
70
|
+
if (resultMap.has(el.loader)) {
|
|
71
|
+
resultMap.get(el.loader).push(v);
|
|
72
|
+
} else {
|
|
73
|
+
resultMap.set(el.loader, [v]);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const sum = (arr) => {
|
|
79
|
+
const v1 = arr.reduce((t, c) => t + c.__costs__, 0);
|
|
80
|
+
const v2 = Math.max.apply(
|
|
81
|
+
null,
|
|
82
|
+
arr.map((e) => e.endAt)
|
|
83
|
+
) - Math.min.apply(arr.map((e) => e.startAt));
|
|
84
|
+
if (v2 >= v1)
|
|
85
|
+
return v1;
|
|
86
|
+
return v2;
|
|
87
|
+
};
|
|
88
|
+
for (const [loaderName, v] of resultMap.entries()) {
|
|
89
|
+
const nodeModulesFiles = v.filter(
|
|
90
|
+
(e) => nodeModulesPathRegexp.test(e.__resource__.path)
|
|
91
|
+
);
|
|
92
|
+
const nodeModulesFilesCosts = sum(nodeModulesFiles);
|
|
93
|
+
const outofCwdFiles = v.filter(
|
|
94
|
+
(e) => !e.__resource__.path.startsWith(cwd)
|
|
95
|
+
);
|
|
96
|
+
const outofCwdFilesCosts = sum(outofCwdFiles);
|
|
97
|
+
const msg = [
|
|
98
|
+
nodeModulesFilesCosts >= threshold && `<b>${nodeModulesFiles.length}</b> node_modules files(costs: <b>${import_common.Time.formatCosts(
|
|
99
|
+
nodeModulesFilesCosts
|
|
100
|
+
)}</b>)`,
|
|
101
|
+
outofCwdFilesCosts >= threshold && `<b>${outofCwdFiles.length}</b> outof project files(costs: <b>${import_common.Time.formatCosts(
|
|
102
|
+
outofCwdFilesCosts
|
|
103
|
+
)}</b>)`
|
|
104
|
+
].filter(Boolean).join(" and ");
|
|
105
|
+
if (msg) {
|
|
106
|
+
const message = `<b>${loaderName}</b> has process ${msg}.`;
|
|
107
|
+
report({
|
|
108
|
+
message,
|
|
109
|
+
detail: {
|
|
110
|
+
description: message,
|
|
111
|
+
type: "link"
|
|
112
|
+
// nodeModulesFiles,
|
|
113
|
+
// outofCwdFiles,
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
});
|
|
121
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
122
|
+
0 && (module.exports = {
|
|
123
|
+
rule
|
|
124
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SDK } from '@rsdoctor/types';
|
|
2
|
+
export interface Config {
|
|
3
|
+
/**
|
|
4
|
+
* loaders which should be ignore.
|
|
5
|
+
*/
|
|
6
|
+
ignore: (string | RegExp)[];
|
|
7
|
+
/**
|
|
8
|
+
* threshold which the loader total costs.
|
|
9
|
+
* @unit millisecond
|
|
10
|
+
* @default 5000
|
|
11
|
+
*/
|
|
12
|
+
threshold: number;
|
|
13
|
+
/**
|
|
14
|
+
* the file extensions which will be match in rule check.
|
|
15
|
+
* @default ["js", "css", "jpg", "jpeg", "png", "gif", "webp", "svg"]
|
|
16
|
+
*/
|
|
17
|
+
extensions: (string | RegExp)[];
|
|
18
|
+
}
|
|
19
|
+
export interface LoaderMapValue extends SDK.LoaderTransformData {
|
|
20
|
+
__resource__: SDK.ResourceData;
|
|
21
|
+
__costs__: number;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/rules/rules/loader-performance-optimization/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAE3C,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC5B;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,cAAe,SAAQ,GAAG,CAAC,mBAAmB;IAC7D,YAAY,EAAE,GAAG,CAAC,YAAY,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var types_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/rules/rules/loader-performance-optimization/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,WAQhE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var utils_exports = {};
|
|
20
|
+
__export(utils_exports, {
|
|
21
|
+
match: () => match
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(utils_exports);
|
|
24
|
+
function match(str, partterns) {
|
|
25
|
+
if (partterns.length === 0)
|
|
26
|
+
return false;
|
|
27
|
+
return partterns.some((p) => {
|
|
28
|
+
if (typeof p === "string")
|
|
29
|
+
return str === p;
|
|
30
|
+
if (p instanceof RegExp)
|
|
31
|
+
return p.test(str);
|
|
32
|
+
return false;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
+
0 && (module.exports = {
|
|
37
|
+
match
|
|
38
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/rules/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,wBAAgB,UAAU,CACxB,KAAK,EAAE,MAAM,CAAC,aAAa,EAC3B,YAAY,EAAE,MAAM,CAAC,QAAQ,GAC5B,MAAM,CAAC,QAAQ,CAajB;AAED,wBAAgB,IAAI,SAAK"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var utils_exports = {};
|
|
20
|
+
__export(utils_exports, {
|
|
21
|
+
noop: () => noop,
|
|
22
|
+
toSeverity: () => toSeverity
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(utils_exports);
|
|
25
|
+
var import_types = require("@rsdoctor/types");
|
|
26
|
+
function toSeverity(input, defaultLevel) {
|
|
27
|
+
if (input === "off") {
|
|
28
|
+
return import_types.Linter.Severity.Ignore;
|
|
29
|
+
}
|
|
30
|
+
if (input === "on") {
|
|
31
|
+
return defaultLevel;
|
|
32
|
+
}
|
|
33
|
+
const key = `${input[0].toUpperCase()}${input.slice(
|
|
34
|
+
1
|
|
35
|
+
)}`;
|
|
36
|
+
return import_types.Linter.Severity[key];
|
|
37
|
+
}
|
|
38
|
+
function noop() {
|
|
39
|
+
}
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
noop,
|
|
43
|
+
toSeverity
|
|
44
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Plugin } from '@rsdoctor/types';
|
|
2
|
+
export type AssetsModules = {
|
|
3
|
+
label?: string;
|
|
4
|
+
isAsset?: boolean;
|
|
5
|
+
modules?: Plugin.StatsModule[];
|
|
6
|
+
};
|
|
7
|
+
export type ParseBundle = (assetFile: string, modules: Plugin.StatsModule[]) => {
|
|
8
|
+
modules?: Record<string, any>;
|
|
9
|
+
src?: string;
|
|
10
|
+
runtimeSrc?: string;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=chunks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunks.d.ts","sourceRoot":"","sources":["../../src/types/chunks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,CACxB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,CAAC,WAAW,EAAE,KAC1B;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var chunks_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(chunks_exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var types_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(types_exports);
|
|
18
|
+
__reExport(types_exports, require("./chunks"), module.exports);
|
|
19
|
+
__reExport(types_exports, require("./rules"), module.exports);
|
|
20
|
+
__reExport(types_exports, require("./webpack"), module.exports);
|
|
21
|
+
__reExport(types_exports, require("./loader"), module.exports);
|
|
22
|
+
__reExport(types_exports, require("./plugin"), module.exports);
|
|
23
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
24
|
+
0 && (module.exports = {
|
|
25
|
+
...require("./chunks"),
|
|
26
|
+
...require("./rules"),
|
|
27
|
+
...require("./webpack"),
|
|
28
|
+
...require("./loader"),
|
|
29
|
+
...require("./plugin")
|
|
30
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Loader } from '@rsdoctor/utils/common';
|
|
2
|
+
export interface ProxyLoaderInternalOptions {
|
|
3
|
+
cwd: string;
|
|
4
|
+
/**
|
|
5
|
+
* the url host of http server(which used to collect data).
|
|
6
|
+
*/
|
|
7
|
+
host: string;
|
|
8
|
+
/**
|
|
9
|
+
* correct loader path.
|
|
10
|
+
*/
|
|
11
|
+
loader: string;
|
|
12
|
+
/** include the loader option */
|
|
13
|
+
hasOptions: boolean;
|
|
14
|
+
skipLoaders: string[];
|
|
15
|
+
}
|
|
16
|
+
export interface ProxyLoaderOptions {
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
[Loader.LoaderInternalPropertyName]: ProxyLoaderInternalOptions;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/types/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,MAAM,WAAW,0BAA0B;IACzC,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,CAAC,MAAM,CAAC,0BAA0B,CAAC,EAAE,0BAA0B,CAAC;CACjE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var loader_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(loader_exports);
|