@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,218 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.n = (module)=>{
|
|
5
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
-
__webpack_require__.d(getter, {
|
|
7
|
-
a: getter
|
|
8
|
-
});
|
|
9
|
-
return getter;
|
|
10
|
-
};
|
|
11
|
-
})();
|
|
12
|
-
(()=>{
|
|
13
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: definition[key]
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
})();
|
|
20
|
-
(()=>{
|
|
21
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
-
})();
|
|
23
|
-
(()=>{
|
|
24
|
-
__webpack_require__.r = (exports1)=>{
|
|
25
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
-
value: 'Module'
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
-
value: true
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
})();
|
|
33
|
-
var __webpack_exports__ = {};
|
|
34
|
-
__webpack_require__.r(__webpack_exports__);
|
|
35
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
-
getInternalLoaderOptions: ()=>getInternalLoaderOptions,
|
|
37
|
-
getLoaderOptionsWithoutInternalKeys: ()=>getLoaderOptionsWithoutInternalKeys,
|
|
38
|
-
getOriginLoaderModule: ()=>getOriginLoaderModule,
|
|
39
|
-
interceptLoader: ()=>interceptLoader,
|
|
40
|
-
reportLoader: ()=>reportLoader,
|
|
41
|
-
shouldSkipLoader: ()=>shouldSkipLoader
|
|
42
|
-
});
|
|
43
|
-
const resolver_namespaceObject = require("@rspack/resolver");
|
|
44
|
-
const compat_namespaceObject = require("es-toolkit/compat");
|
|
45
|
-
const external_path_namespaceObject = require("path");
|
|
46
|
-
var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
|
|
47
|
-
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
48
|
-
const common_namespaceObject = require("@rsdoctor/utils/common");
|
|
49
|
-
const types_namespaceObject = require("@rsdoctor/types");
|
|
50
|
-
const error_namespaceObject = require("@rsdoctor/utils/error");
|
|
51
|
-
const external_sdk_cjs_namespaceObject = require("./sdk.cjs");
|
|
52
|
-
const external_circleDetect_cjs_namespaceObject = require("./circleDetect.cjs");
|
|
53
|
-
const index_cjs_namespaceObject = require("../../build-utils/build/index.cjs");
|
|
54
|
-
const utils_index_cjs_namespaceObject = require("../../build-utils/build/utils/index.cjs");
|
|
55
|
-
function getInternalLoaderOptions(loaderContext) {
|
|
56
|
-
const options = loaderContext.getOptions();
|
|
57
|
-
return options[common_namespaceObject.Loader.LoaderInternalPropertyName];
|
|
58
|
-
}
|
|
59
|
-
function getLoaderOptionsWithoutInternalKeys(loaderContext) {
|
|
60
|
-
const options = loaderContext.getOptions();
|
|
61
|
-
const circlePaths = [];
|
|
62
|
-
const loaderOptions = (0, compat_namespaceObject.omit)(options, [
|
|
63
|
-
common_namespaceObject.Loader.LoaderInternalPropertyName
|
|
64
|
-
]);
|
|
65
|
-
(0, external_circleDetect_cjs_namespaceObject.checkCirclePath)(loaderOptions, [], circlePaths, 0);
|
|
66
|
-
if (circlePaths.length > 0) circlePaths.forEach((_path)=>{
|
|
67
|
-
if (_path?.length > 0 && '[Circular]' !== loaderOptions[_path[0]]) loaderOptions[_path[0]] = '[Circular]';
|
|
68
|
-
});
|
|
69
|
-
return loaderOptions;
|
|
70
|
-
}
|
|
71
|
-
function getOriginLoaderModule(loaderContext) {
|
|
72
|
-
const { loader, cwd } = getInternalLoaderOptions(loaderContext);
|
|
73
|
-
return index_cjs_namespaceObject.Utils.loadLoaderModule(loader, cwd);
|
|
74
|
-
}
|
|
75
|
-
function shouldSkipLoader(loaderContext) {
|
|
76
|
-
const { skipLoaders, cwd, loader } = getInternalLoaderOptions(loaderContext) || {};
|
|
77
|
-
if (!loader) return true;
|
|
78
|
-
if (Array.isArray(skipLoaders) && skipLoaders.length) {
|
|
79
|
-
if (skipLoaders.includes(loader)) return true;
|
|
80
|
-
const loaderName = index_cjs_namespaceObject.Utils.extractLoaderName(loader, cwd);
|
|
81
|
-
if (skipLoaders.includes(loaderName)) return true;
|
|
82
|
-
}
|
|
83
|
-
return false;
|
|
84
|
-
}
|
|
85
|
-
function interceptLoader(rules, loaderPath, options, cwd = process.cwd(), resolveLoader) {
|
|
86
|
-
const loaderResolver = new resolver_namespaceObject.ResolverFactory({
|
|
87
|
-
conditionNames: [
|
|
88
|
-
'loader',
|
|
89
|
-
'require',
|
|
90
|
-
'node'
|
|
91
|
-
],
|
|
92
|
-
exportsFields: [
|
|
93
|
-
'exports'
|
|
94
|
-
],
|
|
95
|
-
mainFiles: [
|
|
96
|
-
'index'
|
|
97
|
-
],
|
|
98
|
-
mainFields: [
|
|
99
|
-
'loader',
|
|
100
|
-
'main'
|
|
101
|
-
],
|
|
102
|
-
extensions: [
|
|
103
|
-
'js',
|
|
104
|
-
'.json'
|
|
105
|
-
],
|
|
106
|
-
modules: [
|
|
107
|
-
'node_modules'
|
|
108
|
-
],
|
|
109
|
-
...resolveLoader
|
|
110
|
-
});
|
|
111
|
-
const resolve = (target)=>{
|
|
112
|
-
try {
|
|
113
|
-
const result = loaderResolver.sync(cwd, target);
|
|
114
|
-
if (result.path) return result.path;
|
|
115
|
-
} catch {}
|
|
116
|
-
return target;
|
|
117
|
-
};
|
|
118
|
-
return index_cjs_namespaceObject.Utils.mapEachRules(rules, (rule)=>{
|
|
119
|
-
if (rule.loader?.startsWith('builtin:') || rule.loader?.endsWith('.mjs') || (0, utils_index_cjs_namespaceObject.isESMLoader)(rule)) return rule;
|
|
120
|
-
const opts = {
|
|
121
|
-
...'options' in rule ? 'string' == typeof rule.options ? JSON.parse(rule.options) : rule.options : {}
|
|
122
|
-
};
|
|
123
|
-
opts[common_namespaceObject.Loader.LoaderInternalPropertyName] = rule.loader && /proxy\.(js|cjs)/.test(rule.loader) && 'options' in rule && 'object' == typeof rule.options ? rule.options[common_namespaceObject.Loader.LoaderInternalPropertyName] : {
|
|
124
|
-
...options,
|
|
125
|
-
hasOptions: 'options' in rule && Boolean(rule.options),
|
|
126
|
-
loader: 'loader' in rule ? resolve(rule.loader) : ''
|
|
127
|
-
};
|
|
128
|
-
return {
|
|
129
|
-
...rule,
|
|
130
|
-
loader: loaderPath,
|
|
131
|
-
options: opts
|
|
132
|
-
};
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
async function reportLoader(ctx, start, startHRTime, isPitch, sync, code, err, res, sourceMap) {
|
|
136
|
-
const end = common_namespaceObject.Time.getCurrentTimestamp(start, startHRTime);
|
|
137
|
-
const { loader, host } = getInternalLoaderOptions(ctx);
|
|
138
|
-
const loaderData = [
|
|
139
|
-
{
|
|
140
|
-
resource: {
|
|
141
|
-
path: ctx._module?.layer ? `${ctx.resourcePath}[${ctx._module.layer}]` : ctx.resourcePath,
|
|
142
|
-
query: (0, utils_index_cjs_namespaceObject.parseQuery)(ctx.resourceQuery || '?'),
|
|
143
|
-
queryRaw: ctx.resourceQuery,
|
|
144
|
-
ext: external_path_default().extname(ctx.resourcePath).slice(1),
|
|
145
|
-
...ctx._module?.layer ? {
|
|
146
|
-
layer: ctx._module.layer
|
|
147
|
-
} : {}
|
|
148
|
-
},
|
|
149
|
-
loaders: [
|
|
150
|
-
{
|
|
151
|
-
loader: index_cjs_namespaceObject.Utils.extractLoaderName(loader),
|
|
152
|
-
loaderIndex: ctx.loaderIndex,
|
|
153
|
-
path: loader,
|
|
154
|
-
input: code,
|
|
155
|
-
result: 'string' == typeof res || Buffer.isBuffer(res) ? res.toString() : res,
|
|
156
|
-
startAt: start,
|
|
157
|
-
endAt: end,
|
|
158
|
-
options: getLoaderOptionsWithoutInternalKeys(ctx),
|
|
159
|
-
isPitch,
|
|
160
|
-
sync,
|
|
161
|
-
errors: err ? [
|
|
162
|
-
new error_namespaceObject.DevToolError(code, err.message, {
|
|
163
|
-
controller: {
|
|
164
|
-
noStack: false,
|
|
165
|
-
noColor: true
|
|
166
|
-
},
|
|
167
|
-
stack: err.stack
|
|
168
|
-
})
|
|
169
|
-
] : [],
|
|
170
|
-
pid: process.pid,
|
|
171
|
-
ppid: process.ppid
|
|
172
|
-
}
|
|
173
|
-
]
|
|
174
|
-
}
|
|
175
|
-
];
|
|
176
|
-
const data = sourceMap ? common_namespaceObject.Lodash.isString(sourceMap) ? JSON.parse(sourceMap) : sourceMap : {};
|
|
177
|
-
const sourceMapData = {
|
|
178
|
-
version: data.version ?? -1,
|
|
179
|
-
sources: data.sources ?? [],
|
|
180
|
-
names: data.names ?? [],
|
|
181
|
-
sourceRoot: data.sourceRoot,
|
|
182
|
-
sourcesContent: data.sourcesContent,
|
|
183
|
-
mappings: data.mappings,
|
|
184
|
-
file: loaderData[0].resource.path
|
|
185
|
-
};
|
|
186
|
-
const sdk = (0, external_sdk_cjs_namespaceObject.getSDK)(ctx._compilation?.name);
|
|
187
|
-
if (sdk?.reportLoader && !('parent' in sdk && sdk.parent)) {
|
|
188
|
-
sdk.reportLoader(loaderData);
|
|
189
|
-
sdk.reportSourceMap(sourceMapData);
|
|
190
|
-
return loaderData;
|
|
191
|
-
}
|
|
192
|
-
await Promise.all([
|
|
193
|
-
common_namespaceObject.Fetch.postJSON(`${host}${types_namespaceObject.SDK.ServerAPI.API.ReportLoader}`, loaderData, 8888).catch((err)=>{
|
|
194
|
-
logger_namespaceObject.logger.debug(`${err.message}`, '[RspackPlugin.ReportLoader][error]');
|
|
195
|
-
}),
|
|
196
|
-
common_namespaceObject.Fetch.postJSON(`${host}${types_namespaceObject.SDK.ServerAPI.API.ReportSourceMap}`, sourceMapData, 8888).catch((err)=>{
|
|
197
|
-
logger_namespaceObject.logger.debug(`${err.message}`, '[RspackPlugin.ReportSourceMap][error]');
|
|
198
|
-
})
|
|
199
|
-
]);
|
|
200
|
-
return loaderData;
|
|
201
|
-
}
|
|
202
|
-
exports.getInternalLoaderOptions = __webpack_exports__.getInternalLoaderOptions;
|
|
203
|
-
exports.getLoaderOptionsWithoutInternalKeys = __webpack_exports__.getLoaderOptionsWithoutInternalKeys;
|
|
204
|
-
exports.getOriginLoaderModule = __webpack_exports__.getOriginLoaderModule;
|
|
205
|
-
exports.interceptLoader = __webpack_exports__.interceptLoader;
|
|
206
|
-
exports.reportLoader = __webpack_exports__.reportLoader;
|
|
207
|
-
exports.shouldSkipLoader = __webpack_exports__.shouldSkipLoader;
|
|
208
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
209
|
-
"getInternalLoaderOptions",
|
|
210
|
-
"getLoaderOptionsWithoutInternalKeys",
|
|
211
|
-
"getOriginLoaderModule",
|
|
212
|
-
"interceptLoader",
|
|
213
|
-
"reportLoader",
|
|
214
|
-
"shouldSkipLoader"
|
|
215
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
216
|
-
Object.defineProperty(exports, '__esModule', {
|
|
217
|
-
value: true
|
|
218
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Loader } from '@rsdoctor/utils/common';
|
|
2
|
-
import { SDK, Plugin } from '@rsdoctor/types';
|
|
3
|
-
import { ProxyLoaderInternalOptions, ProxyLoaderOptions } from '../../types';
|
|
4
|
-
import { Utils as BuildUtils } from '../../build-utils/build';
|
|
5
|
-
export declare function getInternalLoaderOptions(loaderContext: Plugin.LoaderContext<ProxyLoaderOptions>): ProxyLoaderInternalOptions;
|
|
6
|
-
export declare function getLoaderOptionsWithoutInternalKeys(loaderContext: Plugin.LoaderContext<ProxyLoaderOptions>): Omit<ProxyLoaderOptions, typeof Loader.LoaderInternalPropertyName>;
|
|
7
|
-
export declare function getOriginLoaderModule(loaderContext: Plugin.LoaderContext<ProxyLoaderOptions>): ReturnType<typeof BuildUtils.loadLoaderModule>;
|
|
8
|
-
export declare function shouldSkipLoader(loaderContext: Plugin.LoaderContext<ProxyLoaderOptions>): boolean;
|
|
9
|
-
export type CompatibleResolve = Omit<Plugin.Configuration['resolve'], 'mainFields'> & {
|
|
10
|
-
mainFields?: string[];
|
|
11
|
-
};
|
|
12
|
-
export declare function interceptLoader<T extends Plugin.BuildRuleSetRule>(rules: T[], loaderPath: string, options: Omit<ProxyLoaderInternalOptions, 'loader' | 'hasOptions'>, cwd?: string, resolveLoader?: CompatibleResolve): T[];
|
|
13
|
-
export declare function reportLoader(ctx: Plugin.LoaderContext<ProxyLoaderOptions>, start: number, startHRTime: [number, number], isPitch: boolean, sync: boolean, code: string, err: Error | null | undefined, res: string | Buffer | null, sourceMap?: Plugin.SourceMapInput): Promise<SDK.LoaderData>;
|
|
@@ -1,122 +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
|
-
convertReportCodeTypeObject: ()=>convertReportCodeTypeObject,
|
|
28
|
-
makeRuleSetSerializable: ()=>makeRuleSetSerializable,
|
|
29
|
-
makeRulesSerializable: ()=>makeRulesSerializable,
|
|
30
|
-
processBriefHtmlModeConfig: ()=>processBriefHtmlModeConfig,
|
|
31
|
-
processModeConfigurations: ()=>processModeConfigurations
|
|
32
|
-
});
|
|
33
|
-
function processModeConfigurations(finalMode, output, brief) {
|
|
34
|
-
let finalBrief = {};
|
|
35
|
-
let finalNormalOptions = {};
|
|
36
|
-
if ('brief' === finalMode) finalBrief = processBriefHtmlModeConfig(output, brief);
|
|
37
|
-
else if ('normal' === finalMode) finalNormalOptions = {};
|
|
38
|
-
return {
|
|
39
|
-
finalBrief,
|
|
40
|
-
finalNormalOptions
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
function processBriefHtmlModeConfig(output, brief) {
|
|
44
|
-
let htmlOptions = {
|
|
45
|
-
reportHtmlName: void 0,
|
|
46
|
-
writeDataJson: false
|
|
47
|
-
};
|
|
48
|
-
let jsonOptions = {};
|
|
49
|
-
const briefOptions = output?.options || {};
|
|
50
|
-
if ('type' in briefOptions && briefOptions.type?.includes('json')) jsonOptions = briefOptions.jsonOptions || {
|
|
51
|
-
fileName: 'rsdoctor-data.json',
|
|
52
|
-
sections: {
|
|
53
|
-
moduleGraph: true,
|
|
54
|
-
chunkGraph: true,
|
|
55
|
-
rules: true
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
if ('type' in briefOptions && briefOptions.type?.includes('html') || !briefOptions.type) {
|
|
59
|
-
const outputBriefOptions = briefOptions?.htmlOptions;
|
|
60
|
-
const outputBrief = brief;
|
|
61
|
-
htmlOptions = {
|
|
62
|
-
reportHtmlName: outputBriefOptions?.reportHtmlName || outputBrief?.reportHtmlName || void 0,
|
|
63
|
-
writeDataJson: outputBriefOptions?.writeDataJson || outputBrief?.writeDataJson || false
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
return {
|
|
67
|
-
type: output.options?.type || [
|
|
68
|
-
'html'
|
|
69
|
-
],
|
|
70
|
-
htmlOptions,
|
|
71
|
-
jsonOptions
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
function convertReportCodeTypeObject(reportCodeType) {
|
|
75
|
-
if (!reportCodeType) return;
|
|
76
|
-
if (reportCodeType.noCode) return 'noCode';
|
|
77
|
-
if (reportCodeType.noAssetsAndModuleSource) return 'noAssetsAndModuleSource';
|
|
78
|
-
if (reportCodeType.noModuleSource) return 'noModuleSource';
|
|
79
|
-
}
|
|
80
|
-
function makeRuleSetSerializable(item) {
|
|
81
|
-
if (!item) return;
|
|
82
|
-
if (item instanceof RegExp) item.toJSON = item.toString;
|
|
83
|
-
else if (Array.isArray(item)) item.forEach((i)=>makeRuleSetSerializable(i));
|
|
84
|
-
else if ('object' == typeof item) {
|
|
85
|
-
makeRuleSetSerializable(item.and);
|
|
86
|
-
makeRuleSetSerializable(item.or);
|
|
87
|
-
makeRuleSetSerializable(item.not);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
function makeRulesSerializable(rules) {
|
|
91
|
-
if (!Array.isArray(rules)) return;
|
|
92
|
-
if (!rules.length) return;
|
|
93
|
-
rules.forEach((rule)=>{
|
|
94
|
-
if (!rule) return;
|
|
95
|
-
makeRuleSetSerializable(rule.test);
|
|
96
|
-
makeRuleSetSerializable(rule.resourceQuery);
|
|
97
|
-
makeRuleSetSerializable(rule.resource);
|
|
98
|
-
makeRuleSetSerializable(rule.resourceFragment);
|
|
99
|
-
makeRuleSetSerializable(rule.scheme);
|
|
100
|
-
makeRuleSetSerializable(rule.issuer);
|
|
101
|
-
if ('issuerLayer' in rule) makeRuleSetSerializable(rule.issuerLayer);
|
|
102
|
-
makeRuleSetSerializable(rule.include);
|
|
103
|
-
makeRuleSetSerializable(rule.exclude);
|
|
104
|
-
if (rule.oneOf) makeRulesSerializable(rule.oneOf);
|
|
105
|
-
if ('rules' in rule && rule.rules) makeRulesSerializable(rule.rules);
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
exports.convertReportCodeTypeObject = __webpack_exports__.convertReportCodeTypeObject;
|
|
109
|
-
exports.makeRuleSetSerializable = __webpack_exports__.makeRuleSetSerializable;
|
|
110
|
-
exports.makeRulesSerializable = __webpack_exports__.makeRulesSerializable;
|
|
111
|
-
exports.processBriefHtmlModeConfig = __webpack_exports__.processBriefHtmlModeConfig;
|
|
112
|
-
exports.processModeConfigurations = __webpack_exports__.processModeConfigurations;
|
|
113
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
114
|
-
"convertReportCodeTypeObject",
|
|
115
|
-
"makeRuleSetSerializable",
|
|
116
|
-
"makeRulesSerializable",
|
|
117
|
-
"processBriefHtmlModeConfig",
|
|
118
|
-
"processModeConfigurations"
|
|
119
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
120
|
-
Object.defineProperty(exports, '__esModule', {
|
|
121
|
-
value: true
|
|
122
|
-
});
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Config, Plugin, SDK } from '@rsdoctor/types';
|
|
2
|
-
import type { RuleSetCondition as RspackRuleSetCondition, RuleSetRule as RspackRuleSetRule } from '@rspack/core';
|
|
3
|
-
/**
|
|
4
|
-
* Process mode-specific configurations with priority logic
|
|
5
|
-
*/
|
|
6
|
-
export declare function processModeConfigurations(finalMode: keyof typeof SDK.IMode, output: Config.IOutput<'brief' | 'normal'>, brief: Config.BriefConfig | undefined): {
|
|
7
|
-
finalBrief: {};
|
|
8
|
-
finalNormalOptions: Config.NormalModeOptions;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Process brief mode configuration with priority logic
|
|
12
|
-
* Priority: output.options.briefOptions > output.brief > default
|
|
13
|
-
*/
|
|
14
|
-
export declare function processBriefHtmlModeConfig(output: Config.BriefModeConfig, brief: Config.BriefConfig | undefined): Config.BriefModeOptions;
|
|
15
|
-
/**
|
|
16
|
-
* Convert reportCodeType object to NewReportCodeType enum value
|
|
17
|
-
*/
|
|
18
|
-
export declare function convertReportCodeTypeObject(reportCodeType: any): Config.NewReportCodeType | undefined;
|
|
19
|
-
/**
|
|
20
|
-
* This function recursively processes rule set conditions to ensure they can be
|
|
21
|
-
* properly serialized to JSON.
|
|
22
|
-
*
|
|
23
|
-
* @param item - The rule set condition to make serializable. Can be:
|
|
24
|
-
* - RspackRuleSetCondition: Rspack rule conditions
|
|
25
|
-
* - void: Undefined or null values
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* ```typescript
|
|
29
|
-
* const condition = /\.js$/;
|
|
30
|
-
* JSON.stringify(condition); // Error: Converting circular structure to JSON
|
|
31
|
-
*
|
|
32
|
-
* makeRuleSetSerializable(condition);
|
|
33
|
-
* JSON.stringify(condition); // '"/\\.js$/"'
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
export declare function makeRuleSetSerializable(item: RspackRuleSetCondition | void): void;
|
|
37
|
-
export declare function makeRulesSerializable(rules: Plugin.RuleSetRule[] | RspackRuleSetRule['oneOf']): void;
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.n = (module)=>{
|
|
5
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
-
__webpack_require__.d(getter, {
|
|
7
|
-
a: getter
|
|
8
|
-
});
|
|
9
|
-
return getter;
|
|
10
|
-
};
|
|
11
|
-
})();
|
|
12
|
-
(()=>{
|
|
13
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: definition[key]
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
})();
|
|
20
|
-
(()=>{
|
|
21
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
-
})();
|
|
23
|
-
(()=>{
|
|
24
|
-
__webpack_require__.r = (exports1)=>{
|
|
25
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
-
value: 'Module'
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
-
value: true
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
})();
|
|
33
|
-
var __webpack_exports__ = {};
|
|
34
|
-
__webpack_require__.r(__webpack_exports__);
|
|
35
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
-
handleBriefModeReport: ()=>handleBriefModeReport,
|
|
37
|
-
processCompilerConfig: ()=>processCompilerConfig,
|
|
38
|
-
safeCloneDeep: ()=>safeCloneDeep
|
|
39
|
-
});
|
|
40
|
-
const sdk_namespaceObject = require("@rsdoctor/sdk");
|
|
41
|
-
const plugins_namespaceObject = require("@rsdoctor/core/plugins");
|
|
42
|
-
const types_namespaceObject = require("@rsdoctor/types");
|
|
43
|
-
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
44
|
-
const external_path_namespaceObject = require("path");
|
|
45
|
-
var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
|
|
46
|
-
function safeCloneDeep(value, visited = new WeakMap()) {
|
|
47
|
-
if (null == value) return value;
|
|
48
|
-
if ('object' != typeof value) return value;
|
|
49
|
-
if (value instanceof Date) return new Date(value.getTime());
|
|
50
|
-
if (value instanceof RegExp) return new RegExp(value.source, value.flags);
|
|
51
|
-
if (visited.has(value)) return visited.get(value);
|
|
52
|
-
if (Array.isArray(value)) {
|
|
53
|
-
const len = value.length;
|
|
54
|
-
const cloned = new Array(len);
|
|
55
|
-
visited.set(value, cloned);
|
|
56
|
-
for(let i = 0; i < len; i++)cloned[i] = safeCloneDeep(value[i], visited);
|
|
57
|
-
return cloned;
|
|
58
|
-
}
|
|
59
|
-
const cloned = {};
|
|
60
|
-
visited.set(value, cloned);
|
|
61
|
-
const ownPropertyNames = Object.getOwnPropertyNames(value);
|
|
62
|
-
const ownSymbols = Object.getOwnPropertySymbols(value);
|
|
63
|
-
const enumerableKeys = Object.keys(value);
|
|
64
|
-
const enumerableKeysSet = new Set(enumerableKeys);
|
|
65
|
-
const obj = value;
|
|
66
|
-
for(let i = 0; i < enumerableKeys.length; i++){
|
|
67
|
-
const key = enumerableKeys[i];
|
|
68
|
-
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
69
|
-
if (!descriptor || !descriptor.get || descriptor.set) try {
|
|
70
|
-
const propValue = obj[key];
|
|
71
|
-
cloned[key] = safeCloneDeep(propValue, visited);
|
|
72
|
-
} catch {
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
for(let i = 0; i < ownPropertyNames.length; i++){
|
|
77
|
-
const key = ownPropertyNames[i];
|
|
78
|
-
if (enumerableKeysSet.has(key)) continue;
|
|
79
|
-
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
80
|
-
if (descriptor) {
|
|
81
|
-
if (!descriptor.get || descriptor.set) {
|
|
82
|
-
if (void 0 !== descriptor.set) try {
|
|
83
|
-
const propValue = obj[key];
|
|
84
|
-
cloned[key] = safeCloneDeep(propValue, visited);
|
|
85
|
-
} catch {
|
|
86
|
-
continue;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
for(let i = 0; i < ownSymbols.length; i++){
|
|
92
|
-
const key = ownSymbols[i];
|
|
93
|
-
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
94
|
-
if (descriptor) {
|
|
95
|
-
if (!descriptor.get || descriptor.set) {
|
|
96
|
-
if (descriptor.enumerable || void 0 !== descriptor.set) try {
|
|
97
|
-
const propValue = obj[key];
|
|
98
|
-
cloned[key] = safeCloneDeep(propValue, visited);
|
|
99
|
-
} catch {
|
|
100
|
-
continue;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return cloned;
|
|
106
|
-
}
|
|
107
|
-
function processCompilerConfig(config) {
|
|
108
|
-
const { plugins, infrastructureLogging: _infrastructureLogging, ...rest } = config;
|
|
109
|
-
const _rest = safeCloneDeep(rest);
|
|
110
|
-
if (_rest.module?.defaultRules) (0, plugins_namespaceObject.makeRulesSerializable)(_rest.module.defaultRules);
|
|
111
|
-
if (_rest.module?.rules) (0, plugins_namespaceObject.makeRulesSerializable)(_rest.module.rules);
|
|
112
|
-
return {
|
|
113
|
-
..._rest,
|
|
114
|
-
plugins: plugins.map((e)=>e?.constructor.name)
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
async function handleBriefModeReport(sdk, options, disableClientServer) {
|
|
118
|
-
if (!disableClientServer && options.output.mode === types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.brief]) {
|
|
119
|
-
const outputTypes = options.output.options?.type || [];
|
|
120
|
-
const isJsonOnly = Array.isArray(outputTypes) && 1 === outputTypes.length && 'json' === outputTypes[0];
|
|
121
|
-
if (isJsonOnly) {
|
|
122
|
-
const jsonFileName = options.output.options?.jsonOptions?.fileName || 'rsdoctor-data.json';
|
|
123
|
-
const jsonFilePath = external_path_default().resolve(sdk.outputDir, jsonFileName);
|
|
124
|
-
console.log(`${logger_namespaceObject.chalk.green('[RSDOCTOR] generated JSON data')}: ${jsonFilePath}`);
|
|
125
|
-
} else {
|
|
126
|
-
const htmlOptions = 'htmlOptions' in options.output.options && options.output.options.htmlOptions || void 0;
|
|
127
|
-
const outputFilePath = external_path_default().resolve(sdk.outputDir, htmlOptions?.reportHtmlName || 'rsdoctor-report.html');
|
|
128
|
-
console.log(`${logger_namespaceObject.chalk.green('[RSDOCTOR] generated brief report')}: ${outputFilePath}`);
|
|
129
|
-
(0, sdk_namespaceObject.openBrowser)(`file:///${outputFilePath}`);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
exports.handleBriefModeReport = __webpack_exports__.handleBriefModeReport;
|
|
134
|
-
exports.processCompilerConfig = __webpack_exports__.processCompilerConfig;
|
|
135
|
-
exports.safeCloneDeep = __webpack_exports__.safeCloneDeep;
|
|
136
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
137
|
-
"handleBriefModeReport",
|
|
138
|
-
"processCompilerConfig",
|
|
139
|
-
"safeCloneDeep"
|
|
140
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
141
|
-
Object.defineProperty(exports, '__esModule', {
|
|
142
|
-
value: true
|
|
143
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Configuration } from '@rspack/core';
|
|
2
|
-
/**
|
|
3
|
-
* Safe cloneDeep implementation that skips read-only properties (getters without setters)
|
|
4
|
-
* to avoid errors when cloning objects like AppContext that have read-only properties
|
|
5
|
-
*/
|
|
6
|
-
export declare function safeCloneDeep<T>(value: T, visited?: WeakMap<WeakKey, any>): T;
|
|
7
|
-
/**
|
|
8
|
-
* Process compiler configuration to make it serializable
|
|
9
|
-
*/
|
|
10
|
-
export declare function processCompilerConfig(config: any): Configuration;
|
|
11
|
-
export declare function handleBriefModeReport(sdk: any, options: any, disableClientServer: boolean): Promise<void>;
|
|
@@ -1,106 +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
|
-
interceptPluginHook: ()=>interceptPluginHook,
|
|
28
|
-
reportPluginData: ()=>reportPluginData
|
|
29
|
-
});
|
|
30
|
-
const error_namespaceObject = require("@rsdoctor/utils/error");
|
|
31
|
-
function reportPluginData(sdk, hook, tapName, start, type, _res, err) {
|
|
32
|
-
const end = Date.now();
|
|
33
|
-
sdk.reportPlugin({
|
|
34
|
-
[hook]: [
|
|
35
|
-
{
|
|
36
|
-
tapName,
|
|
37
|
-
costs: end - start,
|
|
38
|
-
startAt: start,
|
|
39
|
-
endAt: end,
|
|
40
|
-
type,
|
|
41
|
-
result: null,
|
|
42
|
-
error: err ? [
|
|
43
|
-
new error_namespaceObject.DevToolError(`${tapName} ${hook} Error`, err.message, {
|
|
44
|
-
controller: {
|
|
45
|
-
noStack: false,
|
|
46
|
-
noColor: true
|
|
47
|
-
},
|
|
48
|
-
stack: err.stack
|
|
49
|
-
})
|
|
50
|
-
] : []
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
function interceptPluginHook(sdk, name, hook) {
|
|
56
|
-
if (!hook?.intercept) return;
|
|
57
|
-
hook.intercept({
|
|
58
|
-
register (tap) {
|
|
59
|
-
const o = tap.fn;
|
|
60
|
-
if ('sync' === tap.type) tap.fn = function(...args) {
|
|
61
|
-
const start = Date.now();
|
|
62
|
-
try {
|
|
63
|
-
const res = o.apply(this, args);
|
|
64
|
-
reportPluginData(sdk, name, tap.name, start, tap.type, res);
|
|
65
|
-
return res;
|
|
66
|
-
} catch (error) {
|
|
67
|
-
reportPluginData(sdk, name, tap.name, start, tap.type, null, error);
|
|
68
|
-
throw error;
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
else if ('async' === tap.type) tap.fn = async function(...args) {
|
|
72
|
-
const start = Date.now();
|
|
73
|
-
try {
|
|
74
|
-
const res = await o.apply(this, args);
|
|
75
|
-
reportPluginData(sdk, name, tap.name, start, tap.type, res);
|
|
76
|
-
return res;
|
|
77
|
-
} catch (error) {
|
|
78
|
-
reportPluginData(sdk, name, tap.name, start, tap.type, null, error);
|
|
79
|
-
throw error;
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
else if ('promise' === tap.type) tap.fn = function(...args) {
|
|
83
|
-
const start = Date.now();
|
|
84
|
-
const isChild = args?.[0]?.compiler?.isChild();
|
|
85
|
-
return o.apply(this, args).then((res)=>{
|
|
86
|
-
if (isChild) return res;
|
|
87
|
-
reportPluginData(sdk, name, tap.name, start, tap.type, res);
|
|
88
|
-
return res;
|
|
89
|
-
}).catch((error)=>{
|
|
90
|
-
reportPluginData(sdk, name, tap.name, start, tap.type, null, error);
|
|
91
|
-
throw error;
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
return tap;
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
exports.interceptPluginHook = __webpack_exports__.interceptPluginHook;
|
|
99
|
-
exports.reportPluginData = __webpack_exports__.reportPluginData;
|
|
100
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
101
|
-
"interceptPluginHook",
|
|
102
|
-
"reportPluginData"
|
|
103
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
104
|
-
Object.defineProperty(exports, '__esModule', {
|
|
105
|
-
value: true
|
|
106
|
-
});
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { SDK } from '@rsdoctor/types';
|
|
2
|
-
import { IHook } from '../../build-utils/build/utils';
|
|
3
|
-
export declare function reportPluginData(sdk: SDK.RsdoctorBuilderSDKInstance, hook: string, tapName: string, start: number, type: SDK.PluginHookData['type'], _res: unknown, err?: Error): void;
|
|
4
|
-
export declare function interceptPluginHook(sdk: SDK.RsdoctorBuilderSDKInstance, name: string, hook: IHook): void;
|