@rsdoctor/core 1.2.3 → 1.2.4-beta.0
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/dist/build-utils/{common/trans-utils/transStats.js → build/chunks/assetsModules.cjs} +9 -12
- package/dist/build-utils/build/chunks/assetsModules.d.ts +0 -1
- package/dist/build-utils/build/chunks/assetsModules.js +7 -39
- package/dist/build-utils/build/chunks/chunkTransform.cjs +39 -0
- package/dist/build-utils/build/chunks/chunkTransform.d.ts +0 -1
- package/dist/build-utils/build/chunks/chunkTransform.js +5 -37
- package/dist/build-utils/{common/chunks/index.js → build/chunks/index.cjs} +8 -8
- package/dist/build-utils/build/chunks/index.d.ts +0 -1
- package/dist/build-utils/build/chunks/index.js +5 -78
- package/dist/build-utils/build/chunks/rspack/transform.cjs +80 -0
- package/dist/build-utils/build/chunks/rspack/transform.d.ts +0 -1
- package/dist/build-utils/build/chunks/rspack/transform.js +7 -42
- package/dist/build-utils/{common/index.js → build/index.cjs} +14 -14
- package/dist/build-utils/build/index.d.ts +0 -1
- package/dist/build-utils/build/index.js +8 -52
- package/dist/build-utils/build/loader/index.cjs +69 -0
- package/dist/build-utils/build/loader/index.d.ts +1 -1
- package/dist/build-utils/build/loader/index.js +4 -60
- package/dist/build-utils/build/loader/probeLoader.cjs +90 -0
- package/dist/build-utils/build/loader/probeLoader.d.ts +0 -1
- package/dist/build-utils/build/loader/probeLoader.js +12 -57
- package/dist/build-utils/build/loader/probeLoaderPlugin.cjs +65 -0
- package/dist/build-utils/build/loader/probeLoaderPlugin.d.ts +0 -1
- package/dist/build-utils/build/loader/probeLoaderPlugin.js +11 -43
- package/dist/build-utils/build/module-graph/index.cjs +87 -0
- package/dist/build-utils/build/module-graph/index.d.ts +0 -1
- package/dist/build-utils/build/module-graph/index.js +6 -87
- package/dist/build-utils/build/module-graph/parser.cjs +46 -0
- package/dist/build-utils/build/module-graph/parser.d.ts +0 -1
- package/dist/build-utils/build/module-graph/parser.js +7 -39
- package/dist/build-utils/build/module-graph/rspack/transform.cjs +110 -0
- package/dist/build-utils/build/module-graph/rspack/transform.d.ts +0 -1
- package/dist/build-utils/build/module-graph/rspack/transform.js +12 -50
- package/dist/build-utils/build/module-graph/transform.cjs +40 -0
- package/dist/build-utils/build/module-graph/transform.d.ts +0 -1
- package/dist/build-utils/build/module-graph/transform.js +6 -38
- package/dist/build-utils/build/module-graph/treeShaking.cjs +107 -0
- package/dist/build-utils/build/module-graph/treeShaking.d.ts +0 -1
- package/dist/build-utils/build/module-graph/treeShaking.js +15 -49
- package/dist/build-utils/build/module-graph/utils.cjs +97 -0
- package/dist/build-utils/build/module-graph/utils.d.ts +0 -1
- package/dist/build-utils/build/module-graph/utils.js +15 -50
- package/dist/build-utils/build/module-graph/webpack/transform.cjs +171 -0
- package/dist/build-utils/build/module-graph/webpack/transform.d.ts +0 -1
- package/dist/build-utils/build/module-graph/webpack/transform.js +31 -57
- package/dist/build-utils/{common/module-graph/index.js → build/utils/index.cjs} +15 -15
- package/dist/build-utils/build/utils/index.d.ts +0 -2
- package/dist/build-utils/build/utils/index.js +5 -87
- package/dist/build-utils/build/utils/loader.cjs +356 -0
- package/dist/build-utils/build/utils/loader.d.ts +1 -3
- package/dist/build-utils/build/utils/loader.js +44 -90
- package/dist/build-utils/build/utils/parseBundle.cjs +284 -0
- package/dist/build-utils/build/utils/parseBundle.d.ts +1 -2
- package/dist/build-utils/build/utils/parseBundle.js +19 -61
- package/dist/build-utils/build/utils/plugin.cjs +61 -0
- package/dist/build-utils/build/utils/plugin.d.ts +0 -1
- package/dist/build-utils/build/utils/plugin.js +5 -43
- package/dist/build-utils/index.cjs +36 -0
- package/dist/build-utils/index.d.ts +0 -2
- package/dist/build-utils/index.js +4 -40
- package/dist/index.cjs +85 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +6 -85
- package/dist/inner-plugins/constants.cjs +64 -0
- package/dist/inner-plugins/constants.d.ts +0 -1
- package/dist/inner-plugins/constants.js +3 -47
- package/dist/{build-utils/common/trans-utils/index.js → inner-plugins/index.cjs} +14 -5
- package/dist/inner-plugins/index.d.ts +0 -1
- package/dist/inner-plugins/index.js +4 -69
- package/dist/inner-plugins/loaders/proxy.cjs +90 -0
- package/dist/inner-plugins/loaders/proxy.d.ts +4 -2
- package/dist/inner-plugins/loaders/proxy.js +19 -22
- package/dist/inner-plugins/plugins/base.cjs +53 -0
- package/dist/inner-plugins/plugins/base.d.ts +3 -5
- package/dist/inner-plugins/plugins/base.js +6 -38
- package/dist/inner-plugins/plugins/bundle.cjs +121 -0
- package/dist/inner-plugins/plugins/bundle.d.ts +1 -1
- package/dist/inner-plugins/plugins/bundle.js +33 -49
- package/dist/inner-plugins/plugins/bundleTagPlugin.cjs +93 -0
- package/dist/inner-plugins/plugins/bundleTagPlugin.d.ts +0 -1
- package/dist/inner-plugins/plugins/bundleTagPlugin.js +12 -44
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.cjs +166 -0
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.ts +0 -1
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.js +42 -70
- package/dist/inner-plugins/plugins/errors.cjs +98 -0
- package/dist/inner-plugins/plugins/errors.d.ts +0 -1
- package/dist/inner-plugins/plugins/errors.js +20 -52
- package/dist/inner-plugins/plugins/index.cjs +141 -0
- package/dist/inner-plugins/plugins/index.d.ts +0 -1
- package/dist/inner-plugins/plugins/index.js +12 -141
- package/dist/inner-plugins/plugins/loader.cjs +155 -0
- package/dist/inner-plugins/plugins/loader.d.ts +0 -1
- package/dist/inner-plugins/plugins/loader.js +29 -57
- package/dist/inner-plugins/plugins/plugins.cjs +73 -0
- package/dist/inner-plugins/plugins/plugins.d.ts +0 -1
- package/dist/inner-plugins/plugins/plugins.js +18 -50
- package/dist/inner-plugins/plugins/progress.cjs +70 -0
- package/dist/inner-plugins/plugins/progress.d.ts +0 -1
- package/dist/inner-plugins/plugins/progress.js +9 -41
- package/dist/inner-plugins/plugins/rspack.cjs +117 -0
- package/dist/inner-plugins/plugins/rspack.d.ts +0 -1
- package/dist/inner-plugins/plugins/rspack.js +24 -56
- package/dist/inner-plugins/plugins/rules.cjs +97 -0
- package/dist/inner-plugins/plugins/rules.d.ts +0 -1
- package/dist/inner-plugins/plugins/rules.js +19 -51
- package/dist/inner-plugins/plugins/sourcemapTool.cjs +213 -0
- package/dist/inner-plugins/plugins/sourcemapTool.d.ts +0 -1
- package/dist/inner-plugins/plugins/sourcemapTool.js +23 -67
- package/dist/inner-plugins/plugins/summary.cjs +125 -0
- package/dist/inner-plugins/plugins/summary.d.ts +0 -1
- package/dist/inner-plugins/plugins/summary.js +28 -60
- package/dist/inner-plugins/utils/circleDetect.cjs +49 -0
- package/dist/inner-plugins/utils/circleDetect.d.ts +0 -1
- package/dist/inner-plugins/utils/circleDetect.js +3 -35
- package/dist/inner-plugins/utils/config.cjs +177 -0
- package/dist/inner-plugins/utils/config.d.ts +3 -8
- package/dist/inner-plugins/utils/config.js +43 -116
- package/dist/inner-plugins/utils/index.cjs +124 -0
- package/dist/inner-plugins/utils/index.d.ts +4 -1
- package/dist/inner-plugins/utils/index.js +9 -96
- package/dist/inner-plugins/utils/loader.cjs +231 -0
- package/dist/inner-plugins/utils/loader.d.ts +4 -4
- package/dist/inner-plugins/utils/loader.js +39 -97
- package/dist/inner-plugins/utils/normalize-config.cjs +122 -0
- package/dist/inner-plugins/utils/normalize-config.d.ts +40 -0
- package/dist/inner-plugins/utils/normalize-config.js +78 -0
- package/dist/inner-plugins/utils/plugin-common.cjs +73 -0
- package/dist/inner-plugins/utils/plugin-common.d.ts +6 -0
- package/dist/inner-plugins/utils/plugin-common.js +28 -0
- package/dist/inner-plugins/utils/plugin.cjs +107 -0
- package/dist/inner-plugins/utils/plugin.d.ts +2 -4
- package/dist/inner-plugins/utils/plugin.js +5 -40
- package/dist/inner-plugins/utils/sdk.cjs +55 -0
- package/dist/inner-plugins/utils/sdk.d.ts +8 -4
- package/dist/inner-plugins/utils/sdk.js +9 -42
- package/dist/rules/index.cjs +85 -0
- package/dist/rules/index.d.ts +0 -1
- package/dist/rules/index.js +6 -85
- package/dist/rules/linter.cjs +71 -0
- package/dist/rules/linter.d.ts +0 -1
- package/dist/rules/linter.js +11 -46
- package/dist/rules/rule.cjs +137 -0
- package/dist/rules/rule.d.ts +1 -2
- package/dist/rules/rule.js +20 -55
- package/dist/rules/rules/cross-chunks-package/index.cjs +73 -0
- package/dist/rules/rules/cross-chunks-package/index.d.ts +0 -1
- package/dist/rules/rules/cross-chunks-package/index.js +10 -42
- package/dist/rules/rules/cross-chunks-package/types.d.ts +0 -1
- package/dist/rules/rules/cross-chunks-package/types.js +2 -18
- package/dist/rules/rules/cross-chunks-package/utils.cjs +40 -0
- package/dist/rules/rules/cross-chunks-package/utils.d.ts +1 -2
- package/dist/rules/rules/cross-chunks-package/utils.js +4 -36
- package/dist/rules/rules/default-import-check/index.cjs +116 -0
- package/dist/rules/rules/default-import-check/index.d.ts +0 -1
- package/dist/rules/rules/default-import-check/index.js +17 -49
- package/dist/rules/rules/default-import-check/types.cjs +18 -0
- package/dist/rules/rules/default-import-check/types.d.ts +0 -1
- package/dist/rules/rules/default-import-check/types.js +2 -18
- package/dist/rules/rules/default-import-check/utils.cjs +98 -0
- package/dist/rules/rules/default-import-check/utils.d.ts +0 -1
- package/dist/rules/rules/default-import-check/utils.js +9 -53
- package/dist/rules/rules/duplicate-package/index.cjs +71 -0
- package/dist/rules/rules/duplicate-package/index.d.ts +0 -1
- package/dist/rules/rules/duplicate-package/index.js +15 -47
- package/dist/rules/rules/duplicate-package/types.cjs +60 -0
- package/dist/rules/rules/duplicate-package/types.d.ts +0 -1
- package/dist/rules/rules/duplicate-package/types.js +5 -40
- package/dist/rules/rules/duplicate-package/utils.cjs +84 -0
- package/dist/rules/rules/duplicate-package/utils.d.ts +0 -1
- package/dist/rules/rules/duplicate-package/utils.js +6 -51
- package/dist/rules/rules/ecma-version-check/index.cjs +97 -0
- package/dist/rules/rules/ecma-version-check/index.d.ts +0 -1
- package/dist/rules/rules/ecma-version-check/index.js +16 -58
- package/dist/rules/rules/ecma-version-check/types.cjs +18 -0
- package/dist/rules/rules/ecma-version-check/types.d.ts +0 -1
- package/dist/rules/rules/ecma-version-check/types.js +2 -18
- package/dist/rules/rules/ecma-version-check/utils.cjs +39 -0
- package/dist/rules/rules/ecma-version-check/utils.d.ts +0 -1
- package/dist/rules/rules/ecma-version-check/utils.js +3 -35
- package/dist/rules/rules/index.cjs +47 -0
- package/dist/rules/rules/index.d.ts +0 -1
- package/dist/rules/rules/index.js +13 -45
- package/dist/rules/rules/loader-performance-optimization/index.cjs +119 -0
- package/dist/rules/rules/loader-performance-optimization/index.d.ts +0 -1
- package/dist/rules/rules/loader-performance-optimization/index.js +14 -46
- package/dist/rules/rules/loader-performance-optimization/types.cjs +18 -0
- package/dist/rules/rules/loader-performance-optimization/types.d.ts +0 -1
- package/dist/rules/rules/loader-performance-optimization/types.js +2 -18
- package/dist/{build-utils/common/chunks/assetsContent.js → rules/rules/loader-performance-optimization/utils.cjs} +9 -10
- package/dist/rules/rules/loader-performance-optimization/utils.d.ts +0 -1
- package/dist/rules/rules/loader-performance-optimization/utils.js +3 -35
- package/dist/rules/utils.cjs +46 -0
- package/dist/rules/utils.d.ts +0 -1
- package/dist/rules/utils.js +6 -41
- package/dist/types/chunks.cjs +18 -0
- package/dist/types/chunks.d.ts +1 -7
- package/dist/types/chunks.js +2 -18
- package/dist/types/index.cjs +87 -0
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.js +6 -96
- package/dist/types/loader.cjs +18 -0
- package/dist/types/loader.d.ts +0 -1
- package/dist/types/loader.js +2 -18
- package/dist/types/plugin.cjs +18 -0
- package/dist/types/plugin.d.ts +7 -108
- package/dist/types/plugin.js +2 -18
- package/dist/types/rules.cjs +18 -0
- package/dist/types/rules.d.ts +0 -1
- package/dist/types/rules.js +2 -18
- package/package.json +29 -32
- package/dist/build-utils/build/chunks/assetsModules.d.ts.map +0 -1
- package/dist/build-utils/build/chunks/chunkTransform.d.ts.map +0 -1
- package/dist/build-utils/build/chunks/index.d.ts.map +0 -1
- package/dist/build-utils/build/chunks/rspack/transform.d.ts.map +0 -1
- package/dist/build-utils/build/index.d.ts.map +0 -1
- package/dist/build-utils/build/loader/index.d.ts.map +0 -1
- package/dist/build-utils/build/loader/probeLoader.d.ts.map +0 -1
- package/dist/build-utils/build/loader/probeLoaderPlugin.d.ts.map +0 -1
- package/dist/build-utils/build/module-graph/index.d.ts.map +0 -1
- package/dist/build-utils/build/module-graph/parser.d.ts.map +0 -1
- package/dist/build-utils/build/module-graph/rspack/transform.d.ts.map +0 -1
- package/dist/build-utils/build/module-graph/transform.d.ts.map +0 -1
- package/dist/build-utils/build/module-graph/treeShaking.d.ts.map +0 -1
- package/dist/build-utils/build/module-graph/utils.d.ts.map +0 -1
- package/dist/build-utils/build/module-graph/webpack/transform.d.ts.map +0 -1
- package/dist/build-utils/build/utils/index.d.ts.map +0 -1
- package/dist/build-utils/build/utils/loader.d.ts.map +0 -1
- package/dist/build-utils/build/utils/parseBundle.d.ts.map +0 -1
- package/dist/build-utils/build/utils/plugin.d.ts.map +0 -1
- package/dist/build-utils/common/chunks/assetsContent.d.ts +0 -6
- package/dist/build-utils/common/chunks/assetsContent.d.ts.map +0 -1
- package/dist/build-utils/common/chunks/assetsModules.d.ts +0 -23
- package/dist/build-utils/common/chunks/assetsModules.d.ts.map +0 -1
- package/dist/build-utils/common/chunks/assetsModules.js +0 -155
- package/dist/build-utils/common/chunks/chunkTransform.d.ts +0 -6
- package/dist/build-utils/common/chunks/chunkTransform.d.ts.map +0 -1
- package/dist/build-utils/common/chunks/chunkTransform.js +0 -74
- package/dist/build-utils/common/chunks/index.d.ts +0 -4
- package/dist/build-utils/common/chunks/index.d.ts.map +0 -1
- package/dist/build-utils/common/index.d.ts +0 -6
- package/dist/build-utils/common/index.d.ts.map +0 -1
- package/dist/build-utils/common/module-graph/compatible.d.ts +0 -9
- package/dist/build-utils/common/module-graph/compatible.d.ts.map +0 -1
- package/dist/build-utils/common/module-graph/compatible.js +0 -73
- package/dist/build-utils/common/module-graph/index.d.ts +0 -4
- package/dist/build-utils/common/module-graph/index.d.ts.map +0 -1
- package/dist/build-utils/common/module-graph/transform.d.ts +0 -8
- package/dist/build-utils/common/module-graph/transform.d.ts.map +0 -1
- package/dist/build-utils/common/module-graph/transform.js +0 -181
- package/dist/build-utils/common/module-graph/utils.d.ts +0 -14
- package/dist/build-utils/common/module-graph/utils.d.ts.map +0 -1
- package/dist/build-utils/common/module-graph/utils.js +0 -58
- package/dist/build-utils/common/trans-utils/index.d.ts +0 -2
- package/dist/build-utils/common/trans-utils/index.d.ts.map +0 -1
- package/dist/build-utils/common/trans-utils/transStats.d.ts +0 -11
- package/dist/build-utils/common/trans-utils/transStats.d.ts.map +0 -1
- package/dist/build-utils/common/webpack/compatible.d.ts +0 -18
- package/dist/build-utils/common/webpack/compatible.d.ts.map +0 -1
- package/dist/build-utils/common/webpack/compatible.js +0 -156
- package/dist/build-utils/index.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/inner-plugins/constants.d.ts.map +0 -1
- package/dist/inner-plugins/index.d.ts.map +0 -1
- package/dist/inner-plugins/loaders/proxy.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/base.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/bundle.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/bundleTagPlugin.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/errors.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/index.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/loader.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/plugins.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/progress.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/rspack.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/rules.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/sourcemapTool.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/summary.d.ts.map +0 -1
- package/dist/inner-plugins/utils/circleDetect.d.ts.map +0 -1
- package/dist/inner-plugins/utils/config.d.ts.map +0 -1
- package/dist/inner-plugins/utils/index.d.ts.map +0 -1
- package/dist/inner-plugins/utils/loader.d.ts.map +0 -1
- package/dist/inner-plugins/utils/plugin.d.ts.map +0 -1
- package/dist/inner-plugins/utils/sdk.d.ts.map +0 -1
- package/dist/rules/index.d.ts.map +0 -1
- package/dist/rules/linter.d.ts.map +0 -1
- package/dist/rules/rule.d.ts.map +0 -1
- package/dist/rules/rules/cross-chunks-package/index.d.ts.map +0 -1
- package/dist/rules/rules/cross-chunks-package/types.d.ts.map +0 -1
- package/dist/rules/rules/cross-chunks-package/utils.d.ts.map +0 -1
- package/dist/rules/rules/default-import-check/index.d.ts.map +0 -1
- package/dist/rules/rules/default-import-check/types.d.ts.map +0 -1
- package/dist/rules/rules/default-import-check/utils.d.ts.map +0 -1
- package/dist/rules/rules/duplicate-package/index.d.ts.map +0 -1
- package/dist/rules/rules/duplicate-package/types.d.ts.map +0 -1
- package/dist/rules/rules/duplicate-package/utils.d.ts.map +0 -1
- package/dist/rules/rules/ecma-version-check/index.d.ts.map +0 -1
- package/dist/rules/rules/ecma-version-check/types.d.ts.map +0 -1
- package/dist/rules/rules/ecma-version-check/utils.d.ts.map +0 -1
- package/dist/rules/rules/index.d.ts.map +0 -1
- package/dist/rules/rules/loader-performance-optimization/index.d.ts.map +0 -1
- package/dist/rules/rules/loader-performance-optimization/types.d.ts.map +0 -1
- package/dist/rules/rules/loader-performance-optimization/utils.d.ts.map +0 -1
- package/dist/rules/utils.d.ts.map +0 -1
- package/dist/types/chunks.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/loader.d.ts.map +0 -1
- package/dist/types/plugin.d.ts.map +0 -1
- package/dist/types/rules.d.ts.map +0 -1
- package/dist/types/webpack.d.ts +0 -15
- package/dist/types/webpack.d.ts.map +0 -1
- /package/dist/{types/webpack.js → rules/rules/cross-chunks-package/types.cjs} +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
InternalPluginsPlugin: ()=>InternalPluginsPlugin
|
|
28
|
+
});
|
|
29
|
+
const types_namespaceObject = require("@rsdoctor/types");
|
|
30
|
+
const index_cjs_namespaceObject = require("../../build-utils/build/index.cjs");
|
|
31
|
+
const external_utils_index_cjs_namespaceObject = require("../utils/index.cjs");
|
|
32
|
+
const external_base_cjs_namespaceObject = require("./base.cjs");
|
|
33
|
+
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
34
|
+
class InternalPluginsPlugin extends external_base_cjs_namespaceObject.InternalBasePlugin {
|
|
35
|
+
apply(compiler) {
|
|
36
|
+
(0, logger_namespaceObject.time)('InternalPluginsPlugin.apply');
|
|
37
|
+
try {
|
|
38
|
+
compiler.hooks.afterPlugins.tap(this.tapPostOptions, this.afterPlugins.bind(this, compiler));
|
|
39
|
+
compiler.hooks.compilation.tap(this.tapPostOptions, this.compilation);
|
|
40
|
+
} finally{
|
|
41
|
+
(0, logger_namespaceObject.timeEnd)('InternalPluginsPlugin.apply');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
constructor(...args){
|
|
45
|
+
super(...args), this.name = 'plugins', this.afterPlugins = (compiler)=>{
|
|
46
|
+
(0, logger_namespaceObject.time)('InternalPluginsPlugin.afterPlugins');
|
|
47
|
+
try {
|
|
48
|
+
if (compiler.isChild()) return;
|
|
49
|
+
index_cjs_namespaceObject.Utils.interceptCompilerHooks(compiler, (name, hook)=>(0, external_utils_index_cjs_namespaceObject.interceptPluginHook)(this.sdk, name, hook));
|
|
50
|
+
this.sdk.addClientRoutes([
|
|
51
|
+
types_namespaceObject.Manifest.RsdoctorManifestClientRoutes.WebpackPlugins
|
|
52
|
+
]);
|
|
53
|
+
} finally{
|
|
54
|
+
(0, logger_namespaceObject.timeEnd)('InternalPluginsPlugin.afterPlugins');
|
|
55
|
+
}
|
|
56
|
+
}, this.compilation = (compilation)=>{
|
|
57
|
+
(0, logger_namespaceObject.time)('InternalPluginsPlugin.compilation');
|
|
58
|
+
try {
|
|
59
|
+
if (compilation.compiler.isChild()) return;
|
|
60
|
+
index_cjs_namespaceObject.Utils.interceptCompilationHooks(compilation, (name, hook)=>(0, external_utils_index_cjs_namespaceObject.interceptPluginHook)(this.sdk, name, hook));
|
|
61
|
+
} finally{
|
|
62
|
+
(0, logger_namespaceObject.timeEnd)('InternalPluginsPlugin.compilation');
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.InternalPluginsPlugin = __webpack_exports__.InternalPluginsPlugin;
|
|
68
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
69
|
+
"InternalPluginsPlugin"
|
|
70
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
71
|
+
Object.defineProperty(exports, '__esModule', {
|
|
72
|
+
value: true
|
|
73
|
+
});
|
|
@@ -1,73 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
InternalPluginsPlugin: ()=>InternalPluginsPlugin
|
|
28
|
-
});
|
|
29
|
-
const types_namespaceObject = require("@rsdoctor/types");
|
|
30
|
-
const index_js_namespaceObject = require("../../build-utils/build/index.js");
|
|
31
|
-
const external_utils_index_js_namespaceObject = require("../utils/index.js");
|
|
32
|
-
const external_base_js_namespaceObject = require("./base.js");
|
|
33
|
-
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
34
|
-
class InternalPluginsPlugin extends external_base_js_namespaceObject.InternalBasePlugin {
|
|
1
|
+
import 'module';
|
|
2
|
+
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
import { Manifest } from "@rsdoctor/types";
|
|
4
|
+
import { Utils } from "../../build-utils/build/index.js";
|
|
5
|
+
import { interceptPluginHook } from "../utils/index.js";
|
|
6
|
+
import { InternalBasePlugin } from "./base.js";
|
|
7
|
+
import { time, timeEnd } from "@rsdoctor/utils/logger";
|
|
8
|
+
class InternalPluginsPlugin extends InternalBasePlugin {
|
|
35
9
|
apply(compiler) {
|
|
36
|
-
|
|
10
|
+
time('InternalPluginsPlugin.apply');
|
|
37
11
|
try {
|
|
38
12
|
compiler.hooks.afterPlugins.tap(this.tapPostOptions, this.afterPlugins.bind(this, compiler));
|
|
39
13
|
compiler.hooks.compilation.tap(this.tapPostOptions, this.compilation);
|
|
40
14
|
} finally{
|
|
41
|
-
|
|
15
|
+
timeEnd('InternalPluginsPlugin.apply');
|
|
42
16
|
}
|
|
43
17
|
}
|
|
44
18
|
constructor(...args){
|
|
45
19
|
super(...args), this.name = 'plugins', this.afterPlugins = (compiler)=>{
|
|
46
|
-
|
|
20
|
+
time('InternalPluginsPlugin.afterPlugins');
|
|
47
21
|
try {
|
|
48
22
|
if (compiler.isChild()) return;
|
|
49
|
-
|
|
23
|
+
Utils.interceptCompilerHooks(compiler, (name, hook)=>interceptPluginHook(this.sdk, name, hook));
|
|
50
24
|
this.sdk.addClientRoutes([
|
|
51
|
-
|
|
25
|
+
Manifest.RsdoctorManifestClientRoutes.WebpackPlugins
|
|
52
26
|
]);
|
|
53
27
|
} finally{
|
|
54
|
-
|
|
28
|
+
timeEnd('InternalPluginsPlugin.afterPlugins');
|
|
55
29
|
}
|
|
56
30
|
}, this.compilation = (compilation)=>{
|
|
57
|
-
|
|
31
|
+
time('InternalPluginsPlugin.compilation');
|
|
58
32
|
try {
|
|
59
33
|
if (compilation.compiler.isChild()) return;
|
|
60
|
-
|
|
34
|
+
Utils.interceptCompilationHooks(compilation, (name, hook)=>interceptPluginHook(this.sdk, name, hook));
|
|
61
35
|
} finally{
|
|
62
|
-
|
|
36
|
+
timeEnd('InternalPluginsPlugin.compilation');
|
|
63
37
|
}
|
|
64
38
|
};
|
|
65
39
|
}
|
|
66
40
|
}
|
|
67
|
-
|
|
68
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
69
|
-
"InternalPluginsPlugin"
|
|
70
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
71
|
-
Object.defineProperty(exports, '__esModule', {
|
|
72
|
-
value: true
|
|
73
|
-
});
|
|
41
|
+
export { InternalPluginsPlugin };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
InternalProgressPlugin: ()=>InternalProgressPlugin
|
|
28
|
+
});
|
|
29
|
+
const types_namespaceObject = require("@rsdoctor/types");
|
|
30
|
+
const external_base_cjs_namespaceObject = require("./base.cjs");
|
|
31
|
+
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
32
|
+
class InternalProgressPlugin extends external_base_cjs_namespaceObject.InternalBasePlugin {
|
|
33
|
+
apply(compiler) {
|
|
34
|
+
const { sdk, currentProgress } = this;
|
|
35
|
+
if (compiler.webpack && compiler.webpack.ProgressPlugin) {
|
|
36
|
+
const progress = new compiler.webpack.ProgressPlugin({
|
|
37
|
+
handler (percentage, msg) {
|
|
38
|
+
currentProgress.percentage = percentage;
|
|
39
|
+
currentProgress.message = msg || '';
|
|
40
|
+
const api = types_namespaceObject.SDK.ServerAPI.APIExtends.GetCompileProgress;
|
|
41
|
+
try {
|
|
42
|
+
sdk.server.sendAPIDataToClient(api, {
|
|
43
|
+
req: {
|
|
44
|
+
api,
|
|
45
|
+
body: void 0
|
|
46
|
+
},
|
|
47
|
+
res: currentProgress
|
|
48
|
+
});
|
|
49
|
+
} catch (e) {
|
|
50
|
+
logger_namespaceObject.logger.debug(e);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
progress.apply(compiler);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
constructor(...args){
|
|
58
|
+
super(...args), this.name = 'progress', this.currentProgress = {
|
|
59
|
+
percentage: 100,
|
|
60
|
+
message: ''
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.InternalProgressPlugin = __webpack_exports__.InternalProgressPlugin;
|
|
65
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
66
|
+
"InternalProgressPlugin"
|
|
67
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
68
|
+
Object.defineProperty(exports, '__esModule', {
|
|
69
|
+
value: true
|
|
70
|
+
});
|
|
@@ -1,35 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
InternalProgressPlugin: ()=>InternalProgressPlugin
|
|
28
|
-
});
|
|
29
|
-
const types_namespaceObject = require("@rsdoctor/types");
|
|
30
|
-
const external_base_js_namespaceObject = require("./base.js");
|
|
31
|
-
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
32
|
-
class InternalProgressPlugin extends external_base_js_namespaceObject.InternalBasePlugin {
|
|
1
|
+
import 'module';
|
|
2
|
+
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
import { SDK } from "@rsdoctor/types";
|
|
4
|
+
import { InternalBasePlugin } from "./base.js";
|
|
5
|
+
import { logger } from "@rsdoctor/utils/logger";
|
|
6
|
+
class InternalProgressPlugin extends InternalBasePlugin {
|
|
33
7
|
apply(compiler) {
|
|
34
8
|
const { sdk, currentProgress } = this;
|
|
35
9
|
if (compiler.webpack && compiler.webpack.ProgressPlugin) {
|
|
@@ -37,7 +11,7 @@ class InternalProgressPlugin extends external_base_js_namespaceObject.InternalBa
|
|
|
37
11
|
handler (percentage, msg) {
|
|
38
12
|
currentProgress.percentage = percentage;
|
|
39
13
|
currentProgress.message = msg || '';
|
|
40
|
-
const api =
|
|
14
|
+
const api = SDK.ServerAPI.APIExtends.GetCompileProgress;
|
|
41
15
|
try {
|
|
42
16
|
sdk.server.sendAPIDataToClient(api, {
|
|
43
17
|
req: {
|
|
@@ -47,7 +21,7 @@ class InternalProgressPlugin extends external_base_js_namespaceObject.InternalBa
|
|
|
47
21
|
res: currentProgress
|
|
48
22
|
});
|
|
49
23
|
} catch (e) {
|
|
50
|
-
|
|
24
|
+
logger.debug(e);
|
|
51
25
|
}
|
|
52
26
|
}
|
|
53
27
|
});
|
|
@@ -61,10 +35,4 @@ class InternalProgressPlugin extends external_base_js_namespaceObject.InternalBa
|
|
|
61
35
|
};
|
|
62
36
|
}
|
|
63
37
|
}
|
|
64
|
-
|
|
65
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
66
|
-
"InternalProgressPlugin"
|
|
67
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
68
|
-
Object.defineProperty(exports, '__esModule', {
|
|
69
|
-
value: true
|
|
70
|
-
});
|
|
38
|
+
export { InternalProgressPlugin };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
applyRspackNativePlugin: ()=>applyRspackNativePlugin
|
|
28
|
+
});
|
|
29
|
+
const graph_namespaceObject = require("@rsdoctor/graph");
|
|
30
|
+
const index_cjs_namespaceObject = require("../../build-utils/build/index.cjs");
|
|
31
|
+
const external_constants_cjs_namespaceObject = require("../constants.cjs");
|
|
32
|
+
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
33
|
+
function applyRspackNativePlugin(compiler, plugin, RsdoctorRspackPlugin) {
|
|
34
|
+
logger_namespaceObject.logger.debug('[RspackNativePlugin] Apply hooks');
|
|
35
|
+
compiler.hooks.compilation.tap('RsdoctorRspackPlugin', (compilation)=>{
|
|
36
|
+
const hooks = RsdoctorRspackPlugin.getCompilationHooks(compilation);
|
|
37
|
+
const cached = {};
|
|
38
|
+
const dependOn = {
|
|
39
|
+
chunkGraphData: [],
|
|
40
|
+
moduleGraphData: [
|
|
41
|
+
'chunkGraphData'
|
|
42
|
+
],
|
|
43
|
+
assetPatchData: [
|
|
44
|
+
'chunkGraphData'
|
|
45
|
+
],
|
|
46
|
+
moduleIdsPatchData: [
|
|
47
|
+
'moduleGraphData'
|
|
48
|
+
],
|
|
49
|
+
moduleSourcesPatchData: [
|
|
50
|
+
'moduleGraphData'
|
|
51
|
+
]
|
|
52
|
+
};
|
|
53
|
+
const consumer = {
|
|
54
|
+
chunkGraphData: (data)=>{
|
|
55
|
+
plugin.chunkGraph = new graph_namespaceObject.ChunkGraph();
|
|
56
|
+
index_cjs_namespaceObject.Chunks.patchNativeChunkGraph(plugin.chunkGraph, data);
|
|
57
|
+
},
|
|
58
|
+
moduleGraphData: (data)=>{
|
|
59
|
+
index_cjs_namespaceObject.ModuleGraph.patchNativeModuleGraph(plugin.modulesGraph, plugin.chunkGraph, data);
|
|
60
|
+
},
|
|
61
|
+
moduleIdsPatchData: (data)=>{
|
|
62
|
+
index_cjs_namespaceObject.ModuleGraph.patchNativeModuleIds(plugin.modulesGraph, data);
|
|
63
|
+
},
|
|
64
|
+
moduleSourcesPatchData: (data)=>{
|
|
65
|
+
index_cjs_namespaceObject.ModuleGraph.patchNativeModuleSources(plugin.modulesGraph, data);
|
|
66
|
+
},
|
|
67
|
+
assetPatchData: (data)=>{
|
|
68
|
+
index_cjs_namespaceObject.Chunks.patchNativeAssets(plugin.chunkGraph, data);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const tryConsumeData = (key, data)=>{
|
|
72
|
+
if (true === cached[key]) return;
|
|
73
|
+
cached[key] = data;
|
|
74
|
+
while(true){
|
|
75
|
+
let hasConsumed = false;
|
|
76
|
+
for (const [_task, deps] of Object.entries(dependOn)){
|
|
77
|
+
const task = _task;
|
|
78
|
+
if (true === cached[task] || void 0 === cached[task]) continue;
|
|
79
|
+
const prepared = deps.every((dep)=>true === cached[dep]);
|
|
80
|
+
if (prepared) {
|
|
81
|
+
consumer[task](cached[task]);
|
|
82
|
+
cached[task] = true;
|
|
83
|
+
hasConsumed = true;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (!hasConsumed) break;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
hooks.chunkGraph.tap((0, external_constants_cjs_namespaceObject.internalPluginTapPreOptions)('nativeChunkGraph'), (rawChunkGraph)=>{
|
|
90
|
+
logger_namespaceObject.logger.debug('[RspackNativePlugin] Called chunkGraph hook');
|
|
91
|
+
tryConsumeData('chunkGraphData', rawChunkGraph);
|
|
92
|
+
});
|
|
93
|
+
hooks.moduleGraph.tap((0, external_constants_cjs_namespaceObject.internalPluginTapPreOptions)('nativeModuleGraph'), (rawModuleGraph)=>{
|
|
94
|
+
logger_namespaceObject.logger.debug('[RspackNativePlugin] Called moduleGraph hook');
|
|
95
|
+
tryConsumeData('moduleGraphData', rawModuleGraph);
|
|
96
|
+
});
|
|
97
|
+
hooks.moduleIds.tap((0, external_constants_cjs_namespaceObject.internalPluginTapPreOptions)('nativeSourcePatch'), (rawModuleIdsPatch)=>{
|
|
98
|
+
logger_namespaceObject.logger.debug('[RspackNativePlugin] Called moduleIds hook');
|
|
99
|
+
tryConsumeData('moduleIdsPatchData', rawModuleIdsPatch);
|
|
100
|
+
});
|
|
101
|
+
hooks.moduleSources.tap((0, external_constants_cjs_namespaceObject.internalPluginTapPreOptions)('nativeModuleSourcesPatch'), (rawModuleSourcesPatch)=>{
|
|
102
|
+
logger_namespaceObject.logger.debug('[RspackNativePlugin] Called moduleSources hook');
|
|
103
|
+
tryConsumeData('moduleSourcesPatchData', rawModuleSourcesPatch);
|
|
104
|
+
});
|
|
105
|
+
hooks.assets.tap((0, external_constants_cjs_namespaceObject.internalPluginTapPreOptions)('nativeAssetPatch'), (rawAssetPatch)=>{
|
|
106
|
+
logger_namespaceObject.logger.debug('[RspackNativePlugin] Called assets hook');
|
|
107
|
+
tryConsumeData('assetPatchData', rawAssetPatch);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
exports.applyRspackNativePlugin = __webpack_exports__.applyRspackNativePlugin;
|
|
112
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
113
|
+
"applyRspackNativePlugin"
|
|
114
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
115
|
+
Object.defineProperty(exports, '__esModule', {
|
|
116
|
+
value: true
|
|
117
|
+
});
|
|
@@ -2,4 +2,3 @@ import { Linter, Plugin } from '@rsdoctor/types';
|
|
|
2
2
|
import type { experiments } from '@rspack/core';
|
|
3
3
|
import { RsdoctorPluginInstance } from '../../types';
|
|
4
4
|
export declare function applyRspackNativePlugin(compiler: Plugin.BaseCompiler, plugin: RsdoctorPluginInstance<Plugin.BaseCompiler, Linter.ExtendRuleData[]>, RsdoctorRspackPlugin: typeof experiments.RsdoctorPlugin): void;
|
|
5
|
-
//# sourceMappingURL=rspack.d.ts.map
|
|
@@ -1,37 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
applyRspackNativePlugin: ()=>applyRspackNativePlugin
|
|
28
|
-
});
|
|
29
|
-
const graph_namespaceObject = require("@rsdoctor/graph");
|
|
30
|
-
const index_js_namespaceObject = require("../../build-utils/build/index.js");
|
|
31
|
-
const external_constants_js_namespaceObject = require("../constants.js");
|
|
32
|
-
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
1
|
+
import 'module';
|
|
2
|
+
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
import { ChunkGraph } from "@rsdoctor/graph";
|
|
4
|
+
import { Chunks, ModuleGraph } from "../../build-utils/build/index.js";
|
|
5
|
+
import { internalPluginTapPreOptions } from "../constants.js";
|
|
6
|
+
import { logger } from "@rsdoctor/utils/logger";
|
|
33
7
|
function applyRspackNativePlugin(compiler, plugin, RsdoctorRspackPlugin) {
|
|
34
|
-
|
|
8
|
+
logger.debug('[RspackNativePlugin] Apply hooks');
|
|
35
9
|
compiler.hooks.compilation.tap('RsdoctorRspackPlugin', (compilation)=>{
|
|
36
10
|
const hooks = RsdoctorRspackPlugin.getCompilationHooks(compilation);
|
|
37
11
|
const cached = {};
|
|
@@ -52,20 +26,20 @@ function applyRspackNativePlugin(compiler, plugin, RsdoctorRspackPlugin) {
|
|
|
52
26
|
};
|
|
53
27
|
const consumer = {
|
|
54
28
|
chunkGraphData: (data)=>{
|
|
55
|
-
plugin.chunkGraph = new
|
|
56
|
-
|
|
29
|
+
plugin.chunkGraph = new ChunkGraph();
|
|
30
|
+
Chunks.patchNativeChunkGraph(plugin.chunkGraph, data);
|
|
57
31
|
},
|
|
58
32
|
moduleGraphData: (data)=>{
|
|
59
|
-
|
|
33
|
+
ModuleGraph.patchNativeModuleGraph(plugin.modulesGraph, plugin.chunkGraph, data);
|
|
60
34
|
},
|
|
61
35
|
moduleIdsPatchData: (data)=>{
|
|
62
|
-
|
|
36
|
+
ModuleGraph.patchNativeModuleIds(plugin.modulesGraph, data);
|
|
63
37
|
},
|
|
64
38
|
moduleSourcesPatchData: (data)=>{
|
|
65
|
-
|
|
39
|
+
ModuleGraph.patchNativeModuleSources(plugin.modulesGraph, data);
|
|
66
40
|
},
|
|
67
41
|
assetPatchData: (data)=>{
|
|
68
|
-
|
|
42
|
+
Chunks.patchNativeAssets(plugin.chunkGraph, data);
|
|
69
43
|
}
|
|
70
44
|
};
|
|
71
45
|
const tryConsumeData = (key, data)=>{
|
|
@@ -86,32 +60,26 @@ function applyRspackNativePlugin(compiler, plugin, RsdoctorRspackPlugin) {
|
|
|
86
60
|
if (!hasConsumed) break;
|
|
87
61
|
}
|
|
88
62
|
};
|
|
89
|
-
hooks.chunkGraph.tap(
|
|
90
|
-
|
|
63
|
+
hooks.chunkGraph.tap(internalPluginTapPreOptions('nativeChunkGraph'), (rawChunkGraph)=>{
|
|
64
|
+
logger.debug('[RspackNativePlugin] Called chunkGraph hook');
|
|
91
65
|
tryConsumeData('chunkGraphData', rawChunkGraph);
|
|
92
66
|
});
|
|
93
|
-
hooks.moduleGraph.tap(
|
|
94
|
-
|
|
67
|
+
hooks.moduleGraph.tap(internalPluginTapPreOptions('nativeModuleGraph'), (rawModuleGraph)=>{
|
|
68
|
+
logger.debug('[RspackNativePlugin] Called moduleGraph hook');
|
|
95
69
|
tryConsumeData('moduleGraphData', rawModuleGraph);
|
|
96
70
|
});
|
|
97
|
-
hooks.moduleIds.tap(
|
|
98
|
-
|
|
71
|
+
hooks.moduleIds.tap(internalPluginTapPreOptions('nativeSourcePatch'), (rawModuleIdsPatch)=>{
|
|
72
|
+
logger.debug('[RspackNativePlugin] Called moduleIds hook');
|
|
99
73
|
tryConsumeData('moduleIdsPatchData', rawModuleIdsPatch);
|
|
100
74
|
});
|
|
101
|
-
hooks.moduleSources.tap(
|
|
102
|
-
|
|
75
|
+
hooks.moduleSources.tap(internalPluginTapPreOptions('nativeModuleSourcesPatch'), (rawModuleSourcesPatch)=>{
|
|
76
|
+
logger.debug('[RspackNativePlugin] Called moduleSources hook');
|
|
103
77
|
tryConsumeData('moduleSourcesPatchData', rawModuleSourcesPatch);
|
|
104
78
|
});
|
|
105
|
-
hooks.assets.tap(
|
|
106
|
-
|
|
79
|
+
hooks.assets.tap(internalPluginTapPreOptions('nativeAssetPatch'), (rawAssetPatch)=>{
|
|
80
|
+
logger.debug('[RspackNativePlugin] Called assets hook');
|
|
107
81
|
tryConsumeData('assetPatchData', rawAssetPatch);
|
|
108
82
|
});
|
|
109
83
|
});
|
|
110
84
|
}
|
|
111
|
-
|
|
112
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
113
|
-
"applyRspackNativePlugin"
|
|
114
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
115
|
-
Object.defineProperty(exports, '__esModule', {
|
|
116
|
-
value: true
|
|
117
|
-
});
|
|
85
|
+
export { applyRspackNativePlugin };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
InternalRulesPlugin: ()=>InternalRulesPlugin
|
|
28
|
+
});
|
|
29
|
+
const external_base_cjs_namespaceObject = require("./base.cjs");
|
|
30
|
+
const index_cjs_namespaceObject = require("../../rules/index.cjs");
|
|
31
|
+
const error_namespaceObject = require("@rsdoctor/utils/error");
|
|
32
|
+
const external_lodash_es_namespaceObject = require("lodash-es");
|
|
33
|
+
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
34
|
+
class InternalRulesPlugin extends external_base_cjs_namespaceObject.InternalBasePlugin {
|
|
35
|
+
apply(compiler) {
|
|
36
|
+
(0, logger_namespaceObject.time)('InternalRulesPlugin.apply');
|
|
37
|
+
try {
|
|
38
|
+
compiler.hooks.done.tapPromise(this.tapPreOptions, this.done);
|
|
39
|
+
} finally{
|
|
40
|
+
(0, logger_namespaceObject.timeEnd)('InternalRulesPlugin.apply');
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async lint(compilation) {
|
|
44
|
+
(0, logger_namespaceObject.time)('InternalRulesPlugin.lint');
|
|
45
|
+
try {
|
|
46
|
+
const options = this.options ?? {};
|
|
47
|
+
const linter = new index_cjs_namespaceObject.Linter(options.linter);
|
|
48
|
+
const result = await linter.validate(this.sdk.getRuleContext({}));
|
|
49
|
+
const validateErrors = result.errors.map((err)=>error_namespaceObject.DevToolError.from(err, {
|
|
50
|
+
detail: err.detail,
|
|
51
|
+
controller: {
|
|
52
|
+
noColor: true
|
|
53
|
+
}
|
|
54
|
+
}));
|
|
55
|
+
const errors = validateErrors.filter((item)=>'Error' === item.level);
|
|
56
|
+
const warnings = validateErrors.filter((item)=>'Warn' === item.level);
|
|
57
|
+
const toWebpackError = (err)=>err.toError();
|
|
58
|
+
result.replace.forEach((item)=>{
|
|
59
|
+
if (Array.isArray(compilation.errors) && compilation.errors.includes(item)) (0, external_lodash_es_namespaceObject.pull)(compilation.errors, item);
|
|
60
|
+
if (Array.isArray(compilation.warnings) && compilation.warnings.includes(item)) (0, external_lodash_es_namespaceObject.pull)(compilation.warnings, item);
|
|
61
|
+
});
|
|
62
|
+
if (Array.isArray(compilation.errors)) errors.forEach((err)=>{
|
|
63
|
+
compilation.warnings.push(toWebpackError(err));
|
|
64
|
+
});
|
|
65
|
+
if (Array.isArray(compilation.warnings)) warnings.forEach((err)=>{
|
|
66
|
+
compilation.warnings.push(toWebpackError(err));
|
|
67
|
+
});
|
|
68
|
+
this.sdk.reportError(validateErrors);
|
|
69
|
+
await linter.afterValidate({
|
|
70
|
+
data: this.sdk.getRuleContext({}),
|
|
71
|
+
validateResult: result,
|
|
72
|
+
hooks: {
|
|
73
|
+
afterSaveManifest: this.sdk.hooks.afterSaveManifest
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
} finally{
|
|
77
|
+
(0, logger_namespaceObject.timeEnd)('InternalRulesPlugin.lint');
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
constructor(...args){
|
|
81
|
+
super(...args), this.name = 'rules', this.done = async (stats)=>{
|
|
82
|
+
(0, logger_namespaceObject.time)('InternalRulesPlugin.done');
|
|
83
|
+
try {
|
|
84
|
+
await this.lint(stats.compilation);
|
|
85
|
+
} finally{
|
|
86
|
+
(0, logger_namespaceObject.timeEnd)('InternalRulesPlugin.done');
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.InternalRulesPlugin = __webpack_exports__.InternalRulesPlugin;
|
|
92
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
93
|
+
"InternalRulesPlugin"
|
|
94
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
95
|
+
Object.defineProperty(exports, '__esModule', {
|
|
96
|
+
value: true
|
|
97
|
+
});
|