@rsdoctor/core 2.0.0-alpha.0 → 2.0.0-alpha.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/dist/build-utils/build/chunks/assetsModules.d.ts +1 -1
- package/dist/build-utils/build/chunks/assetsModules.js +1 -1
- package/dist/build-utils/build/chunks/index.d.ts +0 -1
- package/dist/build-utils/build/chunks/index.js +0 -1
- package/dist/build-utils/build/chunks/rspack/transform.d.ts +1 -1
- package/dist/build-utils/build/chunks/rspack/transform.js +1 -1
- package/dist/build-utils/build/envinfo.d.ts +13 -0
- package/dist/build-utils/build/envinfo.js +60 -0
- package/dist/build-utils/build/file/cache.d.ts +5 -0
- package/dist/build-utils/build/file/cache.js +24 -0
- package/dist/build-utils/build/file/index.d.ts +3 -0
- package/dist/build-utils/build/file/index.js +5 -0
- package/dist/build-utils/build/file/sharding.d.ts +21 -0
- package/dist/build-utils/build/file/sharding.js +38 -0
- package/dist/build-utils/build/index.d.ts +5 -0
- package/dist/build-utils/build/index.js +11 -6
- package/dist/build-utils/build/json.d.ts +3 -0
- package/dist/build-utils/build/json.js +67 -0
- package/dist/build-utils/build/loader/probeLoader.d.ts +2 -2
- package/dist/build-utils/build/loader/probeLoader.js +4 -4
- package/dist/build-utils/build/loader/probeLoaderPlugin.d.ts +1 -1
- package/dist/build-utils/build/loader/probeLoaderPlugin.js +1 -1
- package/dist/build-utils/build/module-graph/index.d.ts +0 -1
- package/dist/build-utils/build/module-graph/index.js +0 -1
- package/dist/build-utils/build/module-graph/parser.d.ts +1 -1
- package/dist/build-utils/build/module-graph/parser.js +1 -1
- package/dist/build-utils/build/module-graph/rspack/transform.d.ts +1 -1
- package/dist/build-utils/build/module-graph/rspack/transform.js +6 -4
- package/dist/build-utils/build/module-graph/utils.d.ts +1 -1
- package/dist/build-utils/build/module-graph/utils.js +5 -4
- package/dist/build-utils/build/process.d.ts +2 -0
- package/dist/build-utils/build/process.js +18 -0
- package/dist/build-utils/build/server.d.ts +15 -0
- package/dist/build-utils/build/server.js +107 -0
- package/dist/build-utils/build/utils/loader.d.ts +2 -2
- package/dist/build-utils/build/utils/loader.js +10 -19
- package/dist/build-utils/build/utils/parseBundle.d.ts +1 -1
- package/dist/build-utils/build/utils/parseBundle.js +6 -8
- package/dist/build-utils/build/utils/plugin.d.ts +1 -1
- package/dist/build-utils/index.d.ts +10 -0
- package/dist/build-utils/index.js +12 -2
- package/dist/collection.d.ts +1 -0
- package/dist/collection.js +2 -0
- package/dist/common/file.d.ts +2 -0
- package/dist/common/file.js +8 -0
- package/dist/common/global-config.d.ts +21 -0
- package/dist/common/global-config.js +33 -0
- package/dist/common/index.d.ts +4 -0
- package/dist/common/index.js +6 -0
- package/dist/common-browser.d.ts +1 -0
- package/dist/common-browser.js +2 -0
- package/dist/error/error.d.ts +35 -0
- package/dist/error/error.js +143 -0
- package/dist/error/index.d.ts +2 -0
- package/dist/error/index.js +3 -0
- package/dist/error/transform.d.ts +3 -0
- package/dist/error/transform.js +138 -0
- package/dist/error/utils.d.ts +4 -0
- package/dist/error/utils.js +23 -0
- package/dist/graph/index.d.ts +1 -0
- package/dist/graph/index.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -2
- package/dist/inner-plugins/loaders/proxy.d.ts +4 -4
- package/dist/inner-plugins/plugins/base.d.ts +1 -1
- package/dist/inner-plugins/plugins/bundle.d.ts +1 -1
- package/dist/inner-plugins/plugins/bundle.js +3 -3
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.ts +3 -3
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.js +11 -39
- package/dist/inner-plugins/plugins/errors.d.ts +2 -2
- package/dist/inner-plugins/plugins/errors.js +3 -3
- package/dist/inner-plugins/plugins/loader.d.ts +1 -1
- package/dist/inner-plugins/plugins/loader.js +7 -19
- package/dist/inner-plugins/plugins/plugins.d.ts +1 -1
- package/dist/inner-plugins/plugins/plugins.js +2 -2
- package/dist/inner-plugins/plugins/progress.d.ts +2 -2
- package/dist/inner-plugins/plugins/progress.js +2 -2
- package/dist/inner-plugins/plugins/resolver.d.ts +1 -1
- package/dist/inner-plugins/plugins/resolver.js +2 -2
- package/dist/inner-plugins/plugins/rspack.d.ts +8 -3
- package/dist/inner-plugins/plugins/rspack.js +18 -4
- package/dist/inner-plugins/plugins/rules.d.ts +1 -1
- package/dist/inner-plugins/plugins/rules.js +3 -3
- package/dist/inner-plugins/plugins/sourcemapTool.d.ts +2 -2
- package/dist/inner-plugins/plugins/sourcemapTool.js +2 -2
- package/dist/inner-plugins/plugins/summary.d.ts +1 -1
- package/dist/inner-plugins/plugins/summary.js +3 -3
- package/dist/inner-plugins/utils/config.d.ts +2 -3
- package/dist/inner-plugins/utils/config.js +16 -17
- package/dist/inner-plugins/utils/loader.d.ts +4 -7
- package/dist/inner-plugins/utils/loader.js +8 -34
- package/dist/inner-plugins/utils/normalize-config.d.ts +1 -1
- package/dist/inner-plugins/utils/openBrowser.d.ts +1 -0
- package/dist/inner-plugins/utils/openBrowser.js +55 -0
- package/dist/inner-plugins/utils/plugin-common.js +4 -4
- package/dist/inner-plugins/utils/plugin.d.ts +1 -1
- package/dist/inner-plugins/utils/plugin.js +1 -1
- package/dist/inner-plugins/utils/sdk.d.ts +2 -3
- package/dist/inner-plugins/utils/sdk.js +2 -2
- package/dist/logger.d.ts +9 -0
- package/dist/logger.js +51 -0
- package/dist/{inner-plugins/constants.d.cts → rspack-plugin/constants.d.ts} +3 -0
- package/dist/rspack-plugin/constants.js +23 -0
- package/dist/rspack-plugin/index.d.ts +2 -0
- package/dist/rspack-plugin/index.js +3 -0
- package/dist/rspack-plugin/multiple.d.ts +8 -0
- package/dist/rspack-plugin/multiple.js +39 -0
- package/dist/rspack-plugin/plugin.d.ts +25 -0
- package/dist/rspack-plugin/plugin.js +133 -0
- package/dist/rule-utils/document/document.d.ts +16 -0
- package/dist/rule-utils/document/document.js +46 -0
- package/dist/rule-utils/document/index.d.ts +3 -0
- package/dist/rule-utils/document/index.js +4 -0
- package/dist/rule-utils/document/server.d.ts +4 -0
- package/dist/rule-utils/document/server.js +13 -0
- package/dist/rule-utils/document/types.d.ts +31 -0
- package/dist/rule-utils/index.d.ts +2 -0
- package/dist/rule-utils/index.js +3 -0
- package/dist/rule-utils/parser/asserts.d.ts +81 -0
- package/dist/rule-utils/parser/asserts.js +105 -0
- package/dist/rule-utils/parser/index.d.ts +4 -0
- package/dist/rule-utils/parser/index.js +5 -0
- package/dist/rule-utils/parser/parser.d.ts +118 -0
- package/dist/rule-utils/parser/parser.js +24 -0
- package/dist/rule-utils/parser/types.d.ts +30 -0
- package/dist/rule-utils/parser/types.js +8 -0
- package/dist/rule-utils/parser/utils.d.ts +30 -0
- package/dist/rule-utils/parser/utils.js +106 -0
- package/dist/rules/linter.d.ts +1 -1
- package/dist/rules/linter.js +1 -1
- package/dist/rules/rule.d.ts +2 -2
- package/dist/rules/rule.js +2 -2
- package/dist/rules/rules/cjs-require/index.d.ts +1 -1
- package/dist/rules/rules/cjs-require/index.js +1 -1
- package/dist/rules/rules/cross-chunks-package/index.d.ts +1 -1
- package/dist/rules/rules/cross-chunks-package/index.js +2 -2
- package/dist/rules/rules/default-import-check/index.d.ts +1 -1
- package/dist/rules/rules/default-import-check/index.js +2 -2
- package/dist/rules/rules/default-import-check/utils.d.ts +2 -2
- package/dist/rules/rules/default-import-check/utils.js +2 -2
- package/dist/rules/rules/duplicate-package/index.d.ts +3 -3
- package/dist/rules/rules/duplicate-package/index.js +3 -3
- package/dist/rules/rules/duplicate-package/utils.d.ts +1 -1
- package/dist/rules/rules/ecma-version-check/index.d.ts +3 -2
- package/dist/rules/rules/ecma-version-check/index.js +1 -1
- package/dist/rules/rules/ecma-version-check/types.d.ts +1 -2
- package/dist/rules/rules/ecma-version-check/utils.d.ts +1 -1
- package/dist/rules/rules/esm-resolved-to-cjs/index.d.ts +1 -1
- package/dist/rules/rules/esm-resolved-to-cjs/index.js +1 -1
- package/dist/rules/rules/index.d.ts +1 -1
- package/dist/rules/rules/loader-performance-optimization/index.d.ts +1 -1
- package/dist/rules/rules/loader-performance-optimization/index.js +2 -2
- package/dist/rules/rules/loader-performance-optimization/types.d.ts +1 -1
- package/dist/rules/rules/module-mixed-chunks/index.d.ts +1 -1
- package/dist/rules/rules/module-mixed-chunks/index.js +1 -1
- package/dist/rules/rules/side-effects-only-imports/index.d.ts +1 -1
- package/dist/rules/rules/side-effects-only-imports/index.js +1 -1
- package/dist/rules/utils.d.ts +1 -1
- package/dist/rules/utils.js +1 -1
- package/dist/sdk/index.d.ts +2 -0
- package/dist/sdk/index.js +3 -0
- package/dist/sdk/multiple/controller.d.ts +12 -0
- package/dist/sdk/multiple/controller.js +42 -0
- package/dist/sdk/multiple/index.d.ts +2 -0
- package/dist/sdk/multiple/index.js +3 -0
- package/dist/sdk/multiple/primary.d.ts +32 -0
- package/dist/sdk/multiple/primary.js +64 -0
- package/dist/sdk/multiple/server.d.ts +7 -0
- package/dist/sdk/multiple/server.js +14 -0
- package/dist/sdk/sdk/core.d.ts +33 -0
- package/dist/sdk/sdk/core.js +163 -0
- package/dist/sdk/sdk/index.d.ts +52 -0
- package/dist/sdk/sdk/index.js +435 -0
- package/dist/sdk/sdk/types.d.ts +26 -0
- package/dist/sdk/sdk/types.js +1 -0
- package/dist/sdk/server/apis/alerts.d.ts +5 -0
- package/dist/sdk/server/apis/alerts.js +30 -0
- package/dist/sdk/server/apis/base.d.ts +11 -0
- package/dist/sdk/server/apis/base.js +22 -0
- package/dist/sdk/server/apis/bundle-diff.d.ts +6 -0
- package/dist/sdk/server/apis/bundle-diff.js +51 -0
- package/dist/sdk/server/apis/data.d.ts +6 -0
- package/dist/sdk/server/apis/data.js +44 -0
- package/dist/sdk/server/apis/fs.d.ts +5 -0
- package/dist/sdk/server/apis/fs.js +28 -0
- package/dist/sdk/server/apis/graph.d.ts +12 -0
- package/dist/sdk/server/apis/graph.js +116 -0
- package/dist/sdk/server/apis/index.d.ts +10 -0
- package/dist/sdk/server/apis/index.js +11 -0
- package/dist/sdk/server/apis/loader.d.ts +15 -0
- package/dist/sdk/server/apis/loader.js +120 -0
- package/dist/sdk/server/apis/plugin.d.ts +6 -0
- package/dist/sdk/server/apis/plugin.js +39 -0
- package/dist/sdk/server/apis/project.d.ts +8 -0
- package/dist/sdk/server/apis/project.js +59 -0
- package/dist/sdk/server/apis/renderer.d.ts +6 -0
- package/dist/sdk/server/apis/renderer.js +33 -0
- package/dist/sdk/server/apis/resolver.d.ts +6 -0
- package/dist/sdk/server/apis/resolver.js +38 -0
- package/dist/sdk/server/client.d.ts +3 -0
- package/dist/sdk/server/client.js +8 -0
- package/dist/sdk/server/fakeServer.d.ts +9 -0
- package/dist/sdk/server/fakeServer.js +12 -0
- package/dist/sdk/server/index.d.ts +44 -0
- package/dist/sdk/server/index.js +292 -0
- package/dist/sdk/server/json-body.d.ts +6 -0
- package/dist/sdk/server/json-body.js +150 -0
- package/dist/sdk/server/router.d.ts +24 -0
- package/dist/sdk/server/router.js +83 -0
- package/dist/sdk/server/security.d.ts +5 -0
- package/dist/sdk/server/security.js +47 -0
- package/dist/sdk/server/socket/api.d.ts +15 -0
- package/dist/sdk/server/socket/api.js +22 -0
- package/dist/sdk/server/socket/index.d.ts +48 -0
- package/dist/sdk/server/socket/index.js +166 -0
- package/dist/sdk/server/utils.d.ts +6 -0
- package/dist/sdk/server/utils.js +19 -0
- package/dist/sdk/utils/base.d.ts +1 -0
- package/dist/sdk/utils/base.js +22 -0
- package/dist/sdk/utils/constant.d.ts +1 -0
- package/dist/sdk/utils/constant.js +4 -0
- package/dist/sdk/utils/index.d.ts +3 -0
- package/dist/sdk/utils/index.js +4 -0
- package/dist/sdk/utils/openBrowser.d.ts +4 -0
- package/dist/sdk/utils/openBrowser.js +53 -0
- package/dist/sdk/utils/upload.d.ts +2 -0
- package/dist/sdk/utils/upload.js +6 -0
- package/dist/sdk.d.ts +1 -0
- package/dist/sdk.js +2 -0
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.js +0 -1
- package/dist/types/loader.d.ts +1 -1
- package/dist/types/plugin.d.ts +7 -28
- package/package.json +127 -58
- package/static/openChrome.applescript +95 -0
- package/dist/build-utils/build/chunks/assetsModules.cjs +0 -42
- package/dist/build-utils/build/chunks/assetsModules.d.cts +0 -17
- package/dist/build-utils/build/chunks/chunkTransform.cjs +0 -39
- package/dist/build-utils/build/chunks/chunkTransform.d.cts +0 -4
- package/dist/build-utils/build/chunks/chunkTransform.d.ts +0 -4
- package/dist/build-utils/build/chunks/chunkTransform.js +0 -6
- package/dist/build-utils/build/chunks/index.cjs +0 -72
- package/dist/build-utils/build/chunks/index.d.cts +0 -3
- package/dist/build-utils/build/chunks/rspack/transform.cjs +0 -80
- package/dist/build-utils/build/chunks/rspack/transform.d.cts +0 -13
- package/dist/build-utils/build/index.cjs +0 -52
- package/dist/build-utils/build/index.d.cts +0 -5
- package/dist/build-utils/build/loader/index.cjs +0 -65
- package/dist/build-utils/build/loader/index.d.cts +0 -2
- package/dist/build-utils/build/loader/probeLoader.cjs +0 -89
- package/dist/build-utils/build/loader/probeLoader.d.cts +0 -4
- package/dist/build-utils/build/loader/probeLoaderPlugin.cjs +0 -65
- package/dist/build-utils/build/loader/probeLoaderPlugin.d.cts +0 -5
- package/dist/build-utils/build/module-graph/index.cjs +0 -65
- package/dist/build-utils/build/module-graph/index.d.cts +0 -2
- package/dist/build-utils/build/module-graph/parser.cjs +0 -46
- package/dist/build-utils/build/module-graph/parser.d.cts +0 -2
- package/dist/build-utils/build/module-graph/rspack/transform.cjs +0 -151
- package/dist/build-utils/build/module-graph/rspack/transform.d.cts +0 -26
- package/dist/build-utils/build/module-graph/transform.cjs +0 -39
- package/dist/build-utils/build/module-graph/transform.d.cts +0 -3
- package/dist/build-utils/build/module-graph/transform.d.ts +0 -3
- package/dist/build-utils/build/module-graph/transform.js +0 -6
- package/dist/build-utils/build/module-graph/utils.cjs +0 -95
- package/dist/build-utils/build/module-graph/utils.d.cts +0 -3
- package/dist/build-utils/build/utils/index.cjs +0 -72
- package/dist/build-utils/build/utils/index.d.cts +0 -3
- package/dist/build-utils/build/utils/loader.cjs +0 -354
- package/dist/build-utils/build/utils/loader.d.cts +0 -20
- package/dist/build-utils/build/utils/parseBundle.cjs +0 -283
- package/dist/build-utils/build/utils/parseBundle.d.cts +0 -12
- package/dist/build-utils/build/utils/plugin.cjs +0 -60
- package/dist/build-utils/build/utils/plugin.d.cts +0 -5
- package/dist/build-utils/index.cjs +0 -36
- package/dist/build-utils/index.d.cts +0 -1
- package/dist/index.cjs +0 -81
- package/dist/index.d.cts +0 -3
- package/dist/inner-plugins/constants.cjs +0 -64
- package/dist/inner-plugins/index.cjs +0 -65
- package/dist/inner-plugins/index.d.cts +0 -2
- package/dist/inner-plugins/loaders/proxy.cjs +0 -104
- package/dist/inner-plugins/loaders/proxy.d.cts +0 -7
- package/dist/inner-plugins/plugins/base.cjs +0 -53
- package/dist/inner-plugins/plugins/base.d.cts +0 -12
- package/dist/inner-plugins/plugins/bundle.cjs +0 -96
- package/dist/inner-plugins/plugins/bundle.d.cts +0 -15
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.cjs +0 -141
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.cts +0 -34
- package/dist/inner-plugins/plugins/errors.cjs +0 -98
- package/dist/inner-plugins/plugins/errors.d.cts +0 -11
- package/dist/inner-plugins/plugins/index.cjs +0 -121
- package/dist/inner-plugins/plugins/index.d.cts +0 -10
- package/dist/inner-plugins/plugins/loader.cjs +0 -165
- package/dist/inner-plugins/plugins/loader.d.cts +0 -10
- package/dist/inner-plugins/plugins/plugins.cjs +0 -73
- package/dist/inner-plugins/plugins/plugins.d.cts +0 -8
- package/dist/inner-plugins/plugins/progress.cjs +0 -68
- package/dist/inner-plugins/plugins/progress.d.cts +0 -8
- package/dist/inner-plugins/plugins/resolver.cjs +0 -90
- package/dist/inner-plugins/plugins/resolver.d.cts +0 -12
- package/dist/inner-plugins/plugins/rspack.cjs +0 -118
- package/dist/inner-plugins/plugins/rspack.d.cts +0 -4
- package/dist/inner-plugins/plugins/rules.cjs +0 -97
- package/dist/inner-plugins/plugins/rules.d.cts +0 -8
- package/dist/inner-plugins/plugins/sourcemapTool.cjs +0 -275
- package/dist/inner-plugins/plugins/sourcemapTool.d.cts +0 -52
- package/dist/inner-plugins/plugins/summary.cjs +0 -125
- package/dist/inner-plugins/plugins/summary.d.cts +0 -14
- package/dist/inner-plugins/utils/circleDetect.cjs +0 -49
- package/dist/inner-plugins/utils/circleDetect.d.cts +0 -4
- package/dist/inner-plugins/utils/config.cjs +0 -191
- package/dist/inner-plugins/utils/config.d.cts +0 -5
- package/dist/inner-plugins/utils/index.cjs +0 -106
- package/dist/inner-plugins/utils/index.d.cts +0 -9
- package/dist/inner-plugins/utils/loader.cjs +0 -218
- package/dist/inner-plugins/utils/loader.d.cts +0 -13
- package/dist/inner-plugins/utils/normalize-config.cjs +0 -122
- package/dist/inner-plugins/utils/normalize-config.d.cts +0 -37
- package/dist/inner-plugins/utils/plugin-common.cjs +0 -143
- package/dist/inner-plugins/utils/plugin-common.d.cts +0 -11
- package/dist/inner-plugins/utils/plugin.cjs +0 -106
- package/dist/inner-plugins/utils/plugin.d.cts +0 -4
- package/dist/inner-plugins/utils/sdk.cjs +0 -55
- package/dist/inner-plugins/utils/sdk.d.cts +0 -8
- package/dist/rslib-runtime.js +0 -19
- package/dist/rules/index.cjs +0 -81
- package/dist/rules/index.d.cts +0 -3
- package/dist/rules/linter.cjs +0 -72
- package/dist/rules/linter.d.cts +0 -9
- package/dist/rules/rule.cjs +0 -137
- package/dist/rules/rule.d.cts +0 -27
- package/dist/rules/rules/cjs-require/index.cjs +0 -83
- package/dist/rules/rules/cjs-require/index.d.cts +0 -4
- package/dist/rules/rules/cjs-require/types.cjs +0 -18
- package/dist/rules/rules/cjs-require/types.d.cts +0 -7
- package/dist/rules/rules/cross-chunks-package/index.cjs +0 -74
- package/dist/rules/rules/cross-chunks-package/index.d.cts +0 -4
- package/dist/rules/rules/cross-chunks-package/types.cjs +0 -18
- package/dist/rules/rules/cross-chunks-package/types.d.cts +0 -3
- package/dist/rules/rules/cross-chunks-package/utils.cjs +0 -40
- package/dist/rules/rules/cross-chunks-package/utils.d.cts +0 -1
- package/dist/rules/rules/default-import-check/index.cjs +0 -116
- package/dist/rules/rules/default-import-check/index.d.cts +0 -4
- package/dist/rules/rules/default-import-check/types.cjs +0 -18
- package/dist/rules/rules/default-import-check/types.d.cts +0 -4
- package/dist/rules/rules/default-import-check/utils.cjs +0 -97
- package/dist/rules/rules/default-import-check/utils.d.cts +0 -10
- package/dist/rules/rules/duplicate-package/index.cjs +0 -72
- package/dist/rules/rules/duplicate-package/index.d.cts +0 -4
- package/dist/rules/rules/duplicate-package/types.cjs +0 -60
- package/dist/rules/rules/duplicate-package/types.d.cts +0 -24
- package/dist/rules/rules/duplicate-package/utils.cjs +0 -84
- package/dist/rules/rules/duplicate-package/utils.d.cts +0 -3
- package/dist/rules/rules/ecma-version-check/index.cjs +0 -96
- package/dist/rules/rules/ecma-version-check/index.d.cts +0 -4
- package/dist/rules/rules/ecma-version-check/types.cjs +0 -18
- package/dist/rules/rules/ecma-version-check/types.d.cts +0 -3
- package/dist/rules/rules/ecma-version-check/utils.cjs +0 -39
- package/dist/rules/rules/ecma-version-check/utils.d.cts +0 -2
- package/dist/rules/rules/esm-resolved-to-cjs/index.cjs +0 -237
- package/dist/rules/rules/esm-resolved-to-cjs/index.d.cts +0 -4
- package/dist/rules/rules/esm-resolved-to-cjs/types.cjs +0 -18
- package/dist/rules/rules/esm-resolved-to-cjs/types.d.cts +0 -8
- package/dist/rules/rules/index.cjs +0 -55
- package/dist/rules/rules/index.d.cts +0 -2
- package/dist/rules/rules/loader-performance-optimization/index.cjs +0 -119
- package/dist/rules/rules/loader-performance-optimization/index.d.cts +0 -4
- package/dist/rules/rules/loader-performance-optimization/types.cjs +0 -18
- package/dist/rules/rules/loader-performance-optimization/types.d.cts +0 -22
- package/dist/rules/rules/loader-performance-optimization/utils.cjs +0 -43
- package/dist/rules/rules/loader-performance-optimization/utils.d.cts +0 -1
- package/dist/rules/rules/module-mixed-chunks/index.cjs +0 -85
- package/dist/rules/rules/module-mixed-chunks/index.d.cts +0 -4
- package/dist/rules/rules/module-mixed-chunks/types.cjs +0 -18
- package/dist/rules/rules/module-mixed-chunks/types.d.cts +0 -3
- package/dist/rules/rules/side-effects-only-imports/index.cjs +0 -114
- package/dist/rules/rules/side-effects-only-imports/index.d.cts +0 -4
- package/dist/rules/rules/side-effects-only-imports/types.cjs +0 -18
- package/dist/rules/rules/side-effects-only-imports/types.d.cts +0 -9
- package/dist/rules/utils.cjs +0 -46
- package/dist/rules/utils.d.cts +0 -3
- package/dist/types/chunks.cjs +0 -18
- package/dist/types/chunks.d.cts +0 -6
- package/dist/types/chunks.d.ts +0 -6
- package/dist/types/index.cjs +0 -79
- package/dist/types/index.d.cts +0 -4
- package/dist/types/loader.cjs +0 -18
- package/dist/types/loader.d.cts +0 -19
- package/dist/types/plugin.cjs +0 -18
- package/dist/types/plugin.d.cts +0 -51
- package/dist/types/rules.cjs +0 -18
- package/dist/types/rules.d.cts +0 -7
- /package/dist/{types/chunks.js → rule-utils/document/types.js} +0 -0
|
@@ -1,104 +0,0 @@
|
|
|
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 ("u" > 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
|
-
default: ()=>proxy,
|
|
28
|
-
pitch: ()=>pitch,
|
|
29
|
-
raw: ()=>raw
|
|
30
|
-
});
|
|
31
|
-
const index_cjs_namespaceObject = require("../../build-utils/build/index.cjs");
|
|
32
|
-
const external_utils_index_cjs_namespaceObject = require("../utils/index.cjs");
|
|
33
|
-
const loaderModule = function(...args) {
|
|
34
|
-
if ((0, external_utils_index_cjs_namespaceObject.shouldSkipLoader)(this)) return void this.callback(null, ...args);
|
|
35
|
-
this.cacheable(false);
|
|
36
|
-
const mod = (0, external_utils_index_cjs_namespaceObject.getOriginLoaderModule)(this);
|
|
37
|
-
if (mod.default) {
|
|
38
|
-
if (false === mod.raw && Buffer.isBuffer(args[0])) args[0] = args[0].toString();
|
|
39
|
-
let start = 0;
|
|
40
|
-
let startHRTime = [
|
|
41
|
-
0,
|
|
42
|
-
0
|
|
43
|
-
];
|
|
44
|
-
const trap = index_cjs_namespaceObject.Utils.createLoaderContextTrap.call(this, (err, res, sourceMap)=>{
|
|
45
|
-
(0, external_utils_index_cjs_namespaceObject.reportLoader)(this, start, startHRTime, false, false, args[0].toString(), err, res, sourceMap);
|
|
46
|
-
});
|
|
47
|
-
start = Date.now();
|
|
48
|
-
startHRTime = process.hrtime();
|
|
49
|
-
try {
|
|
50
|
-
const result = mod.default.apply(trap, args);
|
|
51
|
-
if (result) {
|
|
52
|
-
if (!(result instanceof Promise)) (0, external_utils_index_cjs_namespaceObject.reportLoader)(this, start, startHRTime, false, true, args[0].toString(), null, result);
|
|
53
|
-
}
|
|
54
|
-
return result || '';
|
|
55
|
-
} catch (error) {
|
|
56
|
-
(0, external_utils_index_cjs_namespaceObject.reportLoader)(this, start, startHRTime, false, true, args[0].toString(), error, null);
|
|
57
|
-
throw error;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
this.callback(null, ...args);
|
|
61
|
-
};
|
|
62
|
-
const pitch = function() {
|
|
63
|
-
if ((0, external_utils_index_cjs_namespaceObject.shouldSkipLoader)(this)) return;
|
|
64
|
-
this.cacheable(false);
|
|
65
|
-
const mod = (0, external_utils_index_cjs_namespaceObject.getOriginLoaderModule)(this);
|
|
66
|
-
if (mod.pitch && 'function' == typeof mod.pitch) {
|
|
67
|
-
let start = 0;
|
|
68
|
-
let startHRTime = [
|
|
69
|
-
0,
|
|
70
|
-
0
|
|
71
|
-
];
|
|
72
|
-
const trap = index_cjs_namespaceObject.Utils.createLoaderContextTrap.call(this, (err, res)=>{
|
|
73
|
-
(0, external_utils_index_cjs_namespaceObject.reportLoader)(this, start, startHRTime, true, false, err ? 'Loader Pitch Async Error' : '', err, res);
|
|
74
|
-
});
|
|
75
|
-
start = Date.now();
|
|
76
|
-
startHRTime = process.hrtime();
|
|
77
|
-
try {
|
|
78
|
-
const res = mod.pitch.apply(trap, arguments);
|
|
79
|
-
if (res) {
|
|
80
|
-
if (!(res instanceof Promise)) (0, external_utils_index_cjs_namespaceObject.reportLoader)(this, start, startHRTime, true, true, '', null, res);
|
|
81
|
-
}
|
|
82
|
-
return res;
|
|
83
|
-
} catch (error) {
|
|
84
|
-
(0, external_utils_index_cjs_namespaceObject.reportLoader)(this, start, startHRTime, true, true, 'Loader Pitch Sync Error', error, null);
|
|
85
|
-
throw error;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
loaderModule.raw = true;
|
|
90
|
-
loaderModule.pitch = pitch;
|
|
91
|
-
const raw = true;
|
|
92
|
-
const proxy = loaderModule;
|
|
93
|
-
exports["default"] = __webpack_exports__["default"];
|
|
94
|
-
exports.pitch = __webpack_exports__.pitch;
|
|
95
|
-
exports.raw = __webpack_exports__.raw;
|
|
96
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
97
|
-
"default",
|
|
98
|
-
"pitch",
|
|
99
|
-
"raw"
|
|
100
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
101
|
-
Object.defineProperty(exports, '__esModule', {
|
|
102
|
-
value: true
|
|
103
|
-
});
|
|
104
|
-
module.exports = loaderModule;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Plugin as PluginType } from '@rsdoctor/types';
|
|
2
|
-
import { Plugin } from '@rsdoctor/types';
|
|
3
|
-
import type { ProxyLoaderOptions } from '../../types';
|
|
4
|
-
declare const loaderModule: Plugin.LoaderDefinition<ProxyLoaderOptions, {}>;
|
|
5
|
-
export declare const pitch: (this: PluginType.LoaderContext<ProxyLoaderOptions>) => string | void | Buffer<ArrayBufferLike> | Promise<string | Buffer<ArrayBufferLike>>;
|
|
6
|
-
export declare const raw = true;
|
|
7
|
-
export default loaderModule;
|
|
@@ -1,53 +0,0 @@
|
|
|
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 ("u" > 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
|
-
InternalBasePlugin: ()=>InternalBasePlugin
|
|
28
|
-
});
|
|
29
|
-
const external_constants_cjs_namespaceObject = require("../constants.cjs");
|
|
30
|
-
class InternalBasePlugin {
|
|
31
|
-
get options() {
|
|
32
|
-
return this.scheduler.options;
|
|
33
|
-
}
|
|
34
|
-
get sdk() {
|
|
35
|
-
return this.scheduler.sdk;
|
|
36
|
-
}
|
|
37
|
-
get tapPostOptions() {
|
|
38
|
-
return (0, external_constants_cjs_namespaceObject.internalPluginTapPostOptions)(this.name);
|
|
39
|
-
}
|
|
40
|
-
get tapPreOptions() {
|
|
41
|
-
return (0, external_constants_cjs_namespaceObject.internalPluginTapPreOptions)(this.name);
|
|
42
|
-
}
|
|
43
|
-
constructor(scheduler){
|
|
44
|
-
this.scheduler = scheduler;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.InternalBasePlugin = __webpack_exports__.InternalBasePlugin;
|
|
48
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
49
|
-
"InternalBasePlugin"
|
|
50
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
51
|
-
Object.defineProperty(exports, '__esModule', {
|
|
52
|
-
value: true
|
|
53
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Linter, Plugin, SDK } from '@rsdoctor/types';
|
|
2
|
-
import type { InternalPlugin, RsdoctorPluginInstance } from '../../types';
|
|
3
|
-
export declare abstract class InternalBasePlugin<T extends Plugin.BaseCompiler> implements InternalPlugin<T, Linter.ExtendRuleData[]> {
|
|
4
|
-
readonly scheduler: RsdoctorPluginInstance<T, Linter.ExtendRuleData[]>;
|
|
5
|
-
abstract name: string;
|
|
6
|
-
constructor(scheduler: RsdoctorPluginInstance<T, Linter.ExtendRuleData[]>);
|
|
7
|
-
abstract apply(compiler: T): void;
|
|
8
|
-
get options(): Plugin.RsdoctorPluginOptionsNormalized<Linter.ExtendRuleData<any, string>[]>;
|
|
9
|
-
get sdk(): SDK.RsdoctorBuilderSDKInstance;
|
|
10
|
-
get tapPostOptions(): import("tapable").Tap;
|
|
11
|
-
get tapPreOptions(): import("tapable").Tap;
|
|
12
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
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 ("u" > 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
|
-
InternalBundlePlugin: ()=>InternalBundlePlugin
|
|
28
|
-
});
|
|
29
|
-
const types_namespaceObject = require("@rsdoctor/types");
|
|
30
|
-
const external_base_cjs_namespaceObject = require("./base.cjs");
|
|
31
|
-
const graph_namespaceObject = require("@rsdoctor/graph");
|
|
32
|
-
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
33
|
-
class InternalBundlePlugin extends external_base_cjs_namespaceObject.InternalBasePlugin {
|
|
34
|
-
apply(compiler) {
|
|
35
|
-
(0, logger_namespaceObject.time)('InternalBundlePlugin.apply');
|
|
36
|
-
try {
|
|
37
|
-
this.scheduler.ensureModulesChunksGraphApplied(compiler);
|
|
38
|
-
this.changeDevtoolModuleFilename(compiler);
|
|
39
|
-
compiler.hooks.compilation.tap(this.tapPostOptions, this.thisCompilation);
|
|
40
|
-
compiler.hooks.done.tapPromise(this.tapPreOptions, this.done.bind(this));
|
|
41
|
-
} finally{
|
|
42
|
-
(0, logger_namespaceObject.timeEnd)('InternalBundlePlugin.apply');
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
changeDevtoolModuleFilename(compiler) {
|
|
46
|
-
const devtool = compiler.options.devtool;
|
|
47
|
-
if (devtool) {
|
|
48
|
-
if (!compiler.options.output) compiler.options.output = {};
|
|
49
|
-
compiler.options.output.devtoolModuleFilenameTemplate = '[absolute-resource-path]';
|
|
50
|
-
logger_namespaceObject.logger.warn("output.devtoolModuleFilenameTemplate has been changed to [absolute-resource-path], this is for bundle analysis.");
|
|
51
|
-
if ('string' == typeof devtool && devtool.includes('source-map')) compiler.options.output.devtoolFallbackModuleFilenameTemplate = ()=>'[absolute-resource-path]';
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
ensureAssetContent(name) {
|
|
55
|
-
const asset = this.map.get(name);
|
|
56
|
-
if (asset) return asset;
|
|
57
|
-
const v = {
|
|
58
|
-
content: ''
|
|
59
|
-
};
|
|
60
|
-
this.map.set(name, v);
|
|
61
|
-
return v;
|
|
62
|
-
}
|
|
63
|
-
constructor(...args){
|
|
64
|
-
super(...args), this.name = 'bundle', this.map = new Map(), this.thisCompilation = (compilation)=>{
|
|
65
|
-
(0, logger_namespaceObject.time)('InternalBundlePlugin.thisCompilation');
|
|
66
|
-
try {
|
|
67
|
-
if (compilation.hooks.processAssets) compilation.hooks.afterProcessAssets.tap(this.tapPostOptions, (assets)=>{
|
|
68
|
-
Object.keys(assets).forEach((file)=>{
|
|
69
|
-
const v = this.ensureAssetContent(file);
|
|
70
|
-
v.content = assets[file].source().toString();
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
} finally{
|
|
74
|
-
(0, logger_namespaceObject.timeEnd)('InternalBundlePlugin.thisCompilation');
|
|
75
|
-
}
|
|
76
|
-
}, this.done = async ()=>{
|
|
77
|
-
(0, logger_namespaceObject.time)('InternalBundlePlugin.done');
|
|
78
|
-
try {
|
|
79
|
-
if (this.scheduler.chunkGraph) graph_namespaceObject.Chunks.assetsContents(this.map, this.scheduler.chunkGraph, this.scheduler.options?.supports);
|
|
80
|
-
this.sdk.addClientRoutes([
|
|
81
|
-
types_namespaceObject.Manifest.RsdoctorManifestClientRoutes.ModuleGraph,
|
|
82
|
-
types_namespaceObject.Manifest.RsdoctorManifestClientRoutes.BundleSize
|
|
83
|
-
]);
|
|
84
|
-
} finally{
|
|
85
|
-
(0, logger_namespaceObject.timeEnd)('InternalBundlePlugin.done');
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
exports.InternalBundlePlugin = __webpack_exports__.InternalBundlePlugin;
|
|
91
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
92
|
-
"InternalBundlePlugin"
|
|
93
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
94
|
-
Object.defineProperty(exports, '__esModule', {
|
|
95
|
-
value: true
|
|
96
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Plugin } from '@rsdoctor/types';
|
|
2
|
-
import { InternalBasePlugin } from './base';
|
|
3
|
-
export declare class InternalBundlePlugin<T extends Plugin.BaseCompiler> extends InternalBasePlugin<T> {
|
|
4
|
-
readonly name = "bundle";
|
|
5
|
-
map: Map<string, {
|
|
6
|
-
content: string;
|
|
7
|
-
}>;
|
|
8
|
-
apply(compiler: T): void;
|
|
9
|
-
changeDevtoolModuleFilename(compiler: Plugin.BaseCompiler): void;
|
|
10
|
-
ensureAssetContent(name: string): {
|
|
11
|
-
content: string;
|
|
12
|
-
};
|
|
13
|
-
thisCompilation: (compilation: Plugin.BaseCompilation) => void;
|
|
14
|
-
done: () => Promise<void>;
|
|
15
|
-
}
|
|
@@ -1,141 +0,0 @@
|
|
|
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 ("u" > 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
|
-
calculateNamespaceAndRegex: ()=>calculateNamespaceAndRegex,
|
|
28
|
-
ensureDevtools: ()=>ensureDevtools,
|
|
29
|
-
ensureModulesChunksGraphFn: ()=>ensureModulesChunksGraphFn
|
|
30
|
-
});
|
|
31
|
-
const build_namespaceObject = require("@rsdoctor/utils/build");
|
|
32
|
-
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
33
|
-
const index_cjs_namespaceObject = require("../../build-utils/build/index.cjs");
|
|
34
|
-
const external_constants_cjs_namespaceObject = require("../constants.cjs");
|
|
35
|
-
const external_rspack_cjs_namespaceObject = require("./rspack.cjs");
|
|
36
|
-
const external_sourcemapTool_cjs_namespaceObject = require("./sourcemapTool.cjs");
|
|
37
|
-
let hasConsole = false;
|
|
38
|
-
const ensureModulesChunksGraphFn = (compiler, _this)=>{
|
|
39
|
-
if (_this._modulesGraphApplied) return;
|
|
40
|
-
_this._modulesGraphApplied = true;
|
|
41
|
-
const RsdoctorRspackPlugin = compiler.webpack.experiments?.RsdoctorPlugin;
|
|
42
|
-
if (RsdoctorRspackPlugin) (0, external_rspack_cjs_namespaceObject.applyRspackNativePlugin)(compiler, _this, RsdoctorRspackPlugin);
|
|
43
|
-
if (!_this._realSourcePathCache) _this._realSourcePathCache = new Map();
|
|
44
|
-
compiler.hooks.done.tapPromise((0, external_constants_cjs_namespaceObject.internalPluginTapPreOptions)('moduleGraph'), async (_stats)=>{
|
|
45
|
-
await doneHandler(_stats, _this, compiler);
|
|
46
|
-
});
|
|
47
|
-
compiler.hooks.compilation.tap({
|
|
48
|
-
...external_constants_cjs_namespaceObject.pluginTapPostOptions,
|
|
49
|
-
name: 'RsdoctorSourceMapCollector'
|
|
50
|
-
}, (compilation)=>{
|
|
51
|
-
if (compilation.hooks.processAssets) compilation.hooks.processAssets.tapPromise({
|
|
52
|
-
name: 'RsdoctorSourceMapCollector',
|
|
53
|
-
stage: 2400
|
|
54
|
-
}, async ()=>{
|
|
55
|
-
if (!ensureDevtools(compiler)) return;
|
|
56
|
-
const { namespace, sourceMapFilenameRegex } = calculateNamespaceAndRegex(compiler);
|
|
57
|
-
await (0, external_sourcemapTool_cjs_namespaceObject.handleAfterEmitAssets)(compilation, _this, sourceMapFilenameRegex, namespace);
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
async function doneHandler(_stats, _this, compiler) {
|
|
62
|
-
const stats = _stats;
|
|
63
|
-
const getStatsJson = (()=>{
|
|
64
|
-
let cached = null;
|
|
65
|
-
return ()=>{
|
|
66
|
-
if (cached) return cached;
|
|
67
|
-
cached = stats.toJson({
|
|
68
|
-
all: false,
|
|
69
|
-
chunks: true,
|
|
70
|
-
modules: true,
|
|
71
|
-
chunkModules: true,
|
|
72
|
-
assets: true,
|
|
73
|
-
ids: true,
|
|
74
|
-
hash: true,
|
|
75
|
-
errors: true,
|
|
76
|
-
warnings: true,
|
|
77
|
-
nestedModules: true,
|
|
78
|
-
cachedModules: true,
|
|
79
|
-
orphanModules: true,
|
|
80
|
-
runtimeModules: true,
|
|
81
|
-
optimizationBailout: true
|
|
82
|
-
});
|
|
83
|
-
return cached;
|
|
84
|
-
};
|
|
85
|
-
})();
|
|
86
|
-
logger_namespaceObject.logger.debug(`${(build_namespaceObject.Process.getMemoryUsageMessage(), '[Before Generate ModuleGraph]')}`);
|
|
87
|
-
if (!_this.chunkGraph?.getChunks().length) _this.chunkGraph = index_cjs_namespaceObject.Chunks.chunkTransform(new Map(), getStatsJson());
|
|
88
|
-
if (!_this.modulesGraph.getModules().length) _this.modulesGraph = await index_cjs_namespaceObject.ModuleGraph.getModuleGraphByStats(stats.compilation, getStatsJson(), process.cwd(), _this.chunkGraph, _this.options.features);
|
|
89
|
-
logger_namespaceObject.logger.debug(`${(build_namespaceObject.Process.getMemoryUsageMessage(), '[After Generate ModuleGraph]')}`);
|
|
90
|
-
const shouldParseBundle = false !== _this.options.supports.parseBundle;
|
|
91
|
-
await getModulesInfos(compiler, _this.modulesGraph, _this.chunkGraph, shouldParseBundle, _this.sourceMapSets, _this.assetsWithoutSourceMap);
|
|
92
|
-
logger_namespaceObject.logger.debug(`${build_namespaceObject.Process.getMemoryUsageMessage()}, '[After Transform ModuleGraph]'`);
|
|
93
|
-
logger_namespaceObject.logger.debug('reportModuleGraph start');
|
|
94
|
-
if (_this.modulesGraph) await _this.sdk.reportModuleGraph(_this.modulesGraph);
|
|
95
|
-
logger_namespaceObject.logger.debug('reportModuleGraph done');
|
|
96
|
-
logger_namespaceObject.logger.debug('reportChunkGraph start');
|
|
97
|
-
await _this.sdk.reportChunkGraph(_this.chunkGraph);
|
|
98
|
-
logger_namespaceObject.logger.debug('reportChunkGraph done');
|
|
99
|
-
if (_this.options.supports.generateTileGraph) logger_namespaceObject.logger.warn(logger_namespaceObject.chalk.yellow('The option generateTileGraph is deprecated. Treemap (i.e. Tile Graph) is now supported by default.'));
|
|
100
|
-
logger_namespaceObject.logger.debug('doneHandler done');
|
|
101
|
-
}
|
|
102
|
-
const ensureDevtools = (compiler)=>{
|
|
103
|
-
const devtool = compiler.options.devtool;
|
|
104
|
-
if ('string' == typeof devtool && /eval/i.test(devtool)) {
|
|
105
|
-
if (!hasConsole) logger_namespaceObject.logger.warn('SourceMap with eval is not supported. Please use other sourcemap options.');
|
|
106
|
-
hasConsole = true;
|
|
107
|
-
return false;
|
|
108
|
-
}
|
|
109
|
-
return true;
|
|
110
|
-
};
|
|
111
|
-
async function getModulesInfos(compiler, moduleGraph, chunkGraph, parseBundle, sourceMapSets, assetsWithoutSourceMap) {
|
|
112
|
-
if (!moduleGraph) return;
|
|
113
|
-
try {
|
|
114
|
-
await index_cjs_namespaceObject.Chunks.getAssetsModulesData(moduleGraph, chunkGraph, compiler.outputPath, sourceMapSets, parseBundle, assetsWithoutSourceMap);
|
|
115
|
-
} catch {}
|
|
116
|
-
}
|
|
117
|
-
function escapeRegExp(str) {
|
|
118
|
-
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
119
|
-
}
|
|
120
|
-
function calculateNamespaceAndRegex(compiler) {
|
|
121
|
-
let namespace = compiler.options.output.devtoolNamespace || compiler.options.output.library?.name || '[^/]+/';
|
|
122
|
-
if (Array.isArray(namespace)) namespace = namespace[0];
|
|
123
|
-
else if ('object' == typeof namespace && 'name' in namespace) namespace = namespace.name;
|
|
124
|
-
const safeNamespace = escapeRegExp(namespace);
|
|
125
|
-
const sourceMapFilenameRegex = new RegExp(`(?:webpack://)?(?:${safeNamespace})?([^?]*)`);
|
|
126
|
-
return {
|
|
127
|
-
namespace: namespace,
|
|
128
|
-
sourceMapFilenameRegex
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
exports.calculateNamespaceAndRegex = __webpack_exports__.calculateNamespaceAndRegex;
|
|
132
|
-
exports.ensureDevtools = __webpack_exports__.ensureDevtools;
|
|
133
|
-
exports.ensureModulesChunksGraphFn = __webpack_exports__.ensureModulesChunksGraphFn;
|
|
134
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
135
|
-
"calculateNamespaceAndRegex",
|
|
136
|
-
"ensureDevtools",
|
|
137
|
-
"ensureModulesChunksGraphFn"
|
|
138
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
139
|
-
Object.defineProperty(exports, '__esModule', {
|
|
140
|
-
value: true
|
|
141
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { RsdoctorPluginInstance } from '../../types';
|
|
2
|
-
import { Linter, Plugin } from '@rsdoctor/types';
|
|
3
|
-
/**
|
|
4
|
-
* Represents a mapping item from a source map.
|
|
5
|
-
*/
|
|
6
|
-
export interface MappingItem {
|
|
7
|
-
source: string | null;
|
|
8
|
-
generatedLine: number;
|
|
9
|
-
generatedColumn: number;
|
|
10
|
-
originalLine: number | null;
|
|
11
|
-
originalColumn: number | null;
|
|
12
|
-
name: string | null;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Main function to generate ModuleGraph and ChunkGraph from Rspack native data
|
|
16
|
-
* or stats fallback, and collect source maps.
|
|
17
|
-
*/
|
|
18
|
-
export declare const ensureModulesChunksGraphFn: (compiler: Plugin.BaseCompiler, _this: RsdoctorPluginInstance<Plugin.BaseCompiler, Linter.ExtendRuleData[]>) => void;
|
|
19
|
-
/**
|
|
20
|
-
* Checks if source map processing is enabled and supported by the current compiler configuration.
|
|
21
|
-
* Warns if eval-based source maps are used (unsupported).
|
|
22
|
-
* @param compiler - The Rspack compiler instance.
|
|
23
|
-
* @returns true if source maps are enabled and supported, false otherwise.
|
|
24
|
-
*/
|
|
25
|
-
export declare const ensureDevtools: (compiler: Plugin.BaseCompiler) => boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Calculates namespace and source map filename regex for source map resolution.
|
|
28
|
-
* @param compiler - The Rspack compiler instance.
|
|
29
|
-
* @returns An object containing namespace and sourceMapFilenameRegex.
|
|
30
|
-
*/
|
|
31
|
-
export declare function calculateNamespaceAndRegex(compiler: Plugin.BaseCompiler): {
|
|
32
|
-
namespace: string;
|
|
33
|
-
sourceMapFilenameRegex: RegExp;
|
|
34
|
-
};
|
|
@@ -1,98 +0,0 @@
|
|
|
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 ("u" > 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
|
-
InternalErrorReporterPlugin: ()=>InternalErrorReporterPlugin
|
|
28
|
-
});
|
|
29
|
-
const types_namespaceObject = require("@rsdoctor/types");
|
|
30
|
-
const external_base_cjs_namespaceObject = require("./base.cjs");
|
|
31
|
-
const error_namespaceObject = require("@rsdoctor/utils/error");
|
|
32
|
-
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
33
|
-
class InternalErrorReporterPlugin extends external_base_cjs_namespaceObject.InternalBasePlugin {
|
|
34
|
-
apply(compiler) {
|
|
35
|
-
(0, logger_namespaceObject.time)('InternalErrorReporterPlugin.apply');
|
|
36
|
-
try {
|
|
37
|
-
compiler.hooks.done.tapPromise(this.tapPreOptions, this.done);
|
|
38
|
-
} finally{
|
|
39
|
-
(0, logger_namespaceObject.timeEnd)('InternalErrorReporterPlugin.apply');
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
handleBundlerError(err, category, level) {
|
|
43
|
-
return error_namespaceObject.DevToolError.from(err, {
|
|
44
|
-
category,
|
|
45
|
-
code: types_namespaceObject.Rule.RuleMessageCodeEnumerated.Overlay,
|
|
46
|
-
controller: {
|
|
47
|
-
noStack: false
|
|
48
|
-
},
|
|
49
|
-
detail: {
|
|
50
|
-
stack: 'stack' in err ? err.stack : err.message
|
|
51
|
-
},
|
|
52
|
-
level
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
async reportWarnings(warnings) {
|
|
56
|
-
(0, logger_namespaceObject.time)('InternalErrorReporterPlugin.reportWarnings');
|
|
57
|
-
try {
|
|
58
|
-
const arr = warnings.map((warning)=>this.handleBundlerError(warning, types_namespaceObject.Rule.RuleMessageCategory.Compile, 'Warn'));
|
|
59
|
-
this.sdk.reportError(arr);
|
|
60
|
-
} finally{
|
|
61
|
-
(0, logger_namespaceObject.timeEnd)('InternalErrorReporterPlugin.reportWarnings');
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
async reportErrors(errors) {
|
|
65
|
-
(0, logger_namespaceObject.time)('InternalErrorReporterPlugin.reportErrors');
|
|
66
|
-
try {
|
|
67
|
-
const arr = errors.map((err)=>this.handleBundlerError(err, types_namespaceObject.Rule.RuleMessageCategory.Bundle, 'Error'));
|
|
68
|
-
this.sdk.reportError(arr);
|
|
69
|
-
} finally{
|
|
70
|
-
(0, logger_namespaceObject.timeEnd)('InternalErrorReporterPlugin.reportErrors');
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
constructor(...args){
|
|
74
|
-
super(...args), this.name = 'error-reporter', this.done = async (stats)=>{
|
|
75
|
-
(0, logger_namespaceObject.time)('InternalErrorReporterPlugin.done');
|
|
76
|
-
try {
|
|
77
|
-
const tasks = [];
|
|
78
|
-
const statsData = stats.toJson({
|
|
79
|
-
all: false,
|
|
80
|
-
errors: true,
|
|
81
|
-
warnings: true
|
|
82
|
-
});
|
|
83
|
-
if (stats.hasErrors()) tasks.push(this.reportErrors(statsData.errors || []));
|
|
84
|
-
if (stats.hasWarnings()) tasks.push(this.reportWarnings(statsData.warnings || []));
|
|
85
|
-
await Promise.all(tasks);
|
|
86
|
-
} finally{
|
|
87
|
-
(0, logger_namespaceObject.timeEnd)('InternalErrorReporterPlugin.done');
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
exports.InternalErrorReporterPlugin = __webpack_exports__.InternalErrorReporterPlugin;
|
|
93
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
94
|
-
"InternalErrorReporterPlugin"
|
|
95
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
96
|
-
Object.defineProperty(exports, '__esModule', {
|
|
97
|
-
value: true
|
|
98
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Rule, Err, Plugin } from '@rsdoctor/types';
|
|
2
|
-
import { InternalBasePlugin } from './base';
|
|
3
|
-
import { DevToolError } from '@rsdoctor/utils/error';
|
|
4
|
-
export declare class InternalErrorReporterPlugin<T extends Plugin.BaseCompiler> extends InternalBasePlugin<T> {
|
|
5
|
-
readonly name = "error-reporter";
|
|
6
|
-
apply(compiler: T): void;
|
|
7
|
-
done: (stats: Plugin.BaseStats) => Promise<void>;
|
|
8
|
-
handleBundlerError(err: Plugin.BuildError, category: Rule.RuleMessageCategory, level: keyof typeof Err.ErrorLevel): DevToolError;
|
|
9
|
-
reportWarnings(warnings: Plugin.BuildError[]): Promise<void>;
|
|
10
|
-
reportErrors(errors: Plugin.BuildWarning[]): Promise<void>;
|
|
11
|
-
}
|