@rsdoctor/core 1.6.1 → 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 -3
- package/dist/build-utils/build/module-graph/index.js +0 -3
- 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 +7 -5
- 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/build/utils/plugin.js +1 -2
- 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/constants.d.ts +1 -1
- package/dist/inner-plugins/constants.js +1 -1
- 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 +4 -20
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.ts +6 -8
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.js +12 -77
- package/dist/inner-plugins/plugins/errors.d.ts +3 -3
- package/dist/inner-plugins/plugins/errors.js +6 -6
- package/dist/inner-plugins/plugins/index.d.ts +0 -1
- package/dist/inner-plugins/plugins/index.js +0 -1
- package/dist/inner-plugins/plugins/loader.d.ts +1 -1
- package/dist/inner-plugins/plugins/loader.js +8 -20
- package/dist/inner-plugins/plugins/plugins.d.ts +1 -1
- package/dist/inner-plugins/plugins/plugins.js +3 -3
- package/dist/inner-plugins/plugins/progress.d.ts +3 -3
- package/dist/inner-plugins/plugins/progress.js +16 -18
- package/dist/inner-plugins/plugins/resolver.d.ts +2 -3
- 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 +6 -6
- 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 +3 -4
- package/dist/inner-plugins/utils/config.js +4 -17
- package/dist/inner-plugins/utils/loader.d.ts +4 -7
- package/dist/inner-plugins/utils/loader.js +10 -36
- package/dist/inner-plugins/utils/normalize-config.d.ts +4 -7
- 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} +4 -1
- 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 +3 -3
- 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 +3 -18
- 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 +3 -3
- 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 +2 -2
- package/dist/rules/rules/side-effects-only-imports/index.d.ts +1 -1
- package/dist/rules/rules/side-effects-only-imports/index.js +2 -2
- 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/dist/types/rules.d.ts +4 -4
- package/package.json +123 -55
- package/static/openChrome.applescript +95 -0
- package/dist/build-utils/build/chunks/assetsModules.cjs +0 -46
- package/dist/build-utils/build/chunks/assetsModules.d.cts +0 -17
- package/dist/build-utils/build/chunks/chunkTransform.cjs +0 -43
- 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 -76
- package/dist/build-utils/build/chunks/index.d.cts +0 -3
- package/dist/build-utils/build/chunks/rspack/transform.cjs +0 -84
- package/dist/build-utils/build/chunks/rspack/transform.d.cts +0 -13
- package/dist/build-utils/build/index.cjs +0 -56
- package/dist/build-utils/build/index.d.cts +0 -5
- package/dist/build-utils/build/loader/index.cjs +0 -69
- package/dist/build-utils/build/loader/index.d.cts +0 -2
- package/dist/build-utils/build/loader/probeLoader.cjs +0 -93
- package/dist/build-utils/build/loader/probeLoader.d.cts +0 -4
- package/dist/build-utils/build/loader/probeLoaderPlugin.cjs +0 -69
- package/dist/build-utils/build/loader/probeLoaderPlugin.d.cts +0 -5
- package/dist/build-utils/build/module-graph/index.cjs +0 -83
- package/dist/build-utils/build/module-graph/index.d.cts +0 -4
- package/dist/build-utils/build/module-graph/parser.cjs +0 -50
- package/dist/build-utils/build/module-graph/parser.d.cts +0 -2
- package/dist/build-utils/build/module-graph/rspack/transform.cjs +0 -155
- package/dist/build-utils/build/module-graph/rspack/transform.d.cts +0 -26
- package/dist/build-utils/build/module-graph/transform.cjs +0 -44
- package/dist/build-utils/build/module-graph/transform.d.cts +0 -4
- package/dist/build-utils/build/module-graph/transform.d.ts +0 -4
- package/dist/build-utils/build/module-graph/transform.js +0 -7
- package/dist/build-utils/build/module-graph/treeShaking.cjs +0 -110
- package/dist/build-utils/build/module-graph/treeShaking.d.cts +0 -2
- package/dist/build-utils/build/module-graph/treeShaking.d.ts +0 -2
- package/dist/build-utils/build/module-graph/treeShaking.js +0 -73
- package/dist/build-utils/build/module-graph/utils.cjs +0 -99
- package/dist/build-utils/build/module-graph/utils.d.cts +0 -3
- package/dist/build-utils/build/module-graph/webpack/transform.cjs +0 -174
- package/dist/build-utils/build/module-graph/webpack/transform.d.cts +0 -16
- package/dist/build-utils/build/module-graph/webpack/transform.d.ts +0 -16
- package/dist/build-utils/build/module-graph/webpack/transform.js +0 -124
- package/dist/build-utils/build/utils/index.cjs +0 -76
- package/dist/build-utils/build/utils/index.d.cts +0 -3
- package/dist/build-utils/build/utils/loader.cjs +0 -358
- package/dist/build-utils/build/utils/loader.d.cts +0 -20
- package/dist/build-utils/build/utils/parseBundle.cjs +0 -287
- package/dist/build-utils/build/utils/parseBundle.d.cts +0 -12
- package/dist/build-utils/build/utils/plugin.cjs +0 -65
- package/dist/build-utils/build/utils/plugin.d.cts +0 -5
- package/dist/build-utils/index.cjs +0 -40
- package/dist/build-utils/index.d.cts +0 -1
- package/dist/index.cjs +0 -85
- package/dist/index.d.cts +0 -3
- package/dist/inner-plugins/constants.cjs +0 -68
- package/dist/inner-plugins/index.cjs +0 -69
- package/dist/inner-plugins/index.d.cts +0 -2
- package/dist/inner-plugins/loaders/proxy.cjs +0 -108
- package/dist/inner-plugins/loaders/proxy.d.cts +0 -7
- package/dist/inner-plugins/plugins/base.cjs +0 -57
- package/dist/inner-plugins/plugins/base.d.cts +0 -12
- package/dist/inner-plugins/plugins/bundle.cjs +0 -116
- package/dist/inner-plugins/plugins/bundle.d.cts +0 -15
- package/dist/inner-plugins/plugins/bundleTagPlugin.cjs +0 -88
- package/dist/inner-plugins/plugins/bundleTagPlugin.d.cts +0 -6
- package/dist/inner-plugins/plugins/bundleTagPlugin.d.ts +0 -6
- package/dist/inner-plugins/plugins/bundleTagPlugin.js +0 -51
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.cjs +0 -182
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.cts +0 -36
- package/dist/inner-plugins/plugins/errors.cjs +0 -102
- package/dist/inner-plugins/plugins/errors.d.cts +0 -11
- package/dist/inner-plugins/plugins/index.cjs +0 -132
- package/dist/inner-plugins/plugins/index.d.cts +0 -11
- package/dist/inner-plugins/plugins/loader.cjs +0 -169
- package/dist/inner-plugins/plugins/loader.d.cts +0 -10
- package/dist/inner-plugins/plugins/plugins.cjs +0 -77
- package/dist/inner-plugins/plugins/plugins.d.cts +0 -8
- package/dist/inner-plugins/plugins/progress.cjs +0 -74
- package/dist/inner-plugins/plugins/progress.d.cts +0 -8
- package/dist/inner-plugins/plugins/resolver.cjs +0 -94
- package/dist/inner-plugins/plugins/resolver.d.cts +0 -13
- package/dist/inner-plugins/plugins/rspack.cjs +0 -122
- package/dist/inner-plugins/plugins/rspack.d.cts +0 -4
- package/dist/inner-plugins/plugins/rules.cjs +0 -101
- package/dist/inner-plugins/plugins/rules.d.cts +0 -8
- package/dist/inner-plugins/plugins/sourcemapTool.cjs +0 -279
- package/dist/inner-plugins/plugins/sourcemapTool.d.cts +0 -52
- package/dist/inner-plugins/plugins/summary.cjs +0 -129
- package/dist/inner-plugins/plugins/summary.d.cts +0 -14
- package/dist/inner-plugins/utils/circleDetect.cjs +0 -53
- package/dist/inner-plugins/utils/circleDetect.d.cts +0 -4
- package/dist/inner-plugins/utils/config.cjs +0 -207
- package/dist/inner-plugins/utils/config.d.cts +0 -5
- package/dist/inner-plugins/utils/index.cjs +0 -110
- package/dist/inner-plugins/utils/index.d.cts +0 -9
- package/dist/inner-plugins/utils/loader.cjs +0 -222
- package/dist/inner-plugins/utils/loader.d.cts +0 -13
- package/dist/inner-plugins/utils/normalize-config.cjs +0 -126
- package/dist/inner-plugins/utils/normalize-config.d.cts +0 -40
- package/dist/inner-plugins/utils/plugin-common.cjs +0 -147
- package/dist/inner-plugins/utils/plugin-common.d.cts +0 -11
- package/dist/inner-plugins/utils/plugin.cjs +0 -110
- package/dist/inner-plugins/utils/plugin.d.cts +0 -4
- package/dist/inner-plugins/utils/sdk.cjs +0 -59
- package/dist/inner-plugins/utils/sdk.d.cts +0 -8
- package/dist/rslib-runtime.js +0 -19
- package/dist/rules/index.cjs +0 -85
- package/dist/rules/index.d.cts +0 -3
- package/dist/rules/linter.cjs +0 -76
- package/dist/rules/linter.d.cts +0 -9
- package/dist/rules/rule.cjs +0 -141
- package/dist/rules/rule.d.cts +0 -27
- package/dist/rules/rules/cjs-require/index.cjs +0 -87
- 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 -78
- 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 -44
- package/dist/rules/rules/cross-chunks-package/utils.d.cts +0 -1
- package/dist/rules/rules/default-import-check/index.cjs +0 -120
- 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 -101
- package/dist/rules/rules/default-import-check/utils.d.cts +0 -10
- package/dist/rules/rules/duplicate-package/index.cjs +0 -76
- package/dist/rules/rules/duplicate-package/index.d.cts +0 -4
- package/dist/rules/rules/duplicate-package/types.cjs +0 -64
- package/dist/rules/rules/duplicate-package/types.d.cts +0 -24
- package/dist/rules/rules/duplicate-package/utils.cjs +0 -88
- package/dist/rules/rules/duplicate-package/utils.d.cts +0 -3
- package/dist/rules/rules/ecma-version-check/index.cjs +0 -100
- 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 -43
- package/dist/rules/rules/ecma-version-check/utils.d.cts +0 -2
- package/dist/rules/rules/esm-resolved-to-cjs/index.cjs +0 -256
- 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 -59
- package/dist/rules/rules/index.d.cts +0 -2
- package/dist/rules/rules/loader-performance-optimization/index.cjs +0 -123
- 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 -47
- package/dist/rules/rules/loader-performance-optimization/utils.d.cts +0 -1
- package/dist/rules/rules/module-mixed-chunks/index.cjs +0 -89
- 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 -118
- 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 -50
- 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 -83
- 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,52 +0,0 @@
|
|
|
1
|
-
import { RsdoctorPluginInstance } from '../../types';
|
|
2
|
-
import { Linter, Plugin } from '@rsdoctor/types';
|
|
3
|
-
export declare const UNASSIGNED = "[unassigned]";
|
|
4
|
-
/**
|
|
5
|
-
* Options for handling source map assets.
|
|
6
|
-
* @param compilation - The current compilation object.
|
|
7
|
-
* @param pluginInstance - The Rsdoctor plugin instance.
|
|
8
|
-
* @param sourceMapFilenameRegex - Regex to extract file paths from source map sources.
|
|
9
|
-
* @param namespace - Optional namespace for resolving sources.
|
|
10
|
-
*/
|
|
11
|
-
interface SourceMapAssetOptions {
|
|
12
|
-
compilation: Plugin.BaseCompilation;
|
|
13
|
-
pluginInstance: RsdoctorPluginInstance<Plugin.BaseCompiler, Linter.ExtendRuleData<any, string>[]>;
|
|
14
|
-
sourceMapFilenameRegex: RegExp;
|
|
15
|
-
namespace?: string;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Binds a context cache to a source path resolver.
|
|
19
|
-
* @param context - The base context directory.
|
|
20
|
-
* @param namespace - Optional namespace for resolving sources.
|
|
21
|
-
* @param cache - The cache map to store resolved paths.
|
|
22
|
-
* @param sourceMapDir - The directory containing source maps.
|
|
23
|
-
* @param sourceRoot - The source root directory.
|
|
24
|
-
* @returns A function that resolves source paths based on the given context.
|
|
25
|
-
*/
|
|
26
|
-
export declare function bindContextCache(context: string, namespace?: string, cache?: Map<string, string>, sourceMapDir?: string, sourceRoot?: string): (source: string, sourceMapFilenameRegex?: RegExp) => string;
|
|
27
|
-
/**
|
|
28
|
-
* Collects and processes source map information for a given asset.
|
|
29
|
-
* Groups mappings by line, sorts them, and reconstructs the original source code segments.
|
|
30
|
-
* @param map - The raw source map object.
|
|
31
|
-
* @param assetLinesCodeList - The code lines of the asset.
|
|
32
|
-
* @param _compilation - The current compilation object.
|
|
33
|
-
* @param _this - The Rsdoctor plugin instance.
|
|
34
|
-
* @param sourceMapFilenameRegex - Regex to extract file paths from source map sources.
|
|
35
|
-
* @param namespace - Optional namespace for resolving sources.
|
|
36
|
-
*/
|
|
37
|
-
export declare function collectSourceMaps(map: any, assetLinesCodeList: string[], _compilation: Plugin.BaseCompilation, _this: RsdoctorPluginInstance<Plugin.BaseCompiler, Linter.ExtendRuleData[]>, sourceMapFilenameRegex?: RegExp, namespace?: string, skipSources?: Set<string>, sourceMapPath?: string): Promise<void>;
|
|
38
|
-
/**
|
|
39
|
-
* Handles the afterEmit event for assets to collect source map information.
|
|
40
|
-
* @param compilation - The current compilation object.
|
|
41
|
-
* @param _this - The Rsdoctor plugin instance.
|
|
42
|
-
* @param sourceMapFilenameRegex - Regex to extract file paths from source map sources.
|
|
43
|
-
* @param namespace - Optional namespace for resolving sources.
|
|
44
|
-
*/
|
|
45
|
-
export declare function handleAfterEmitAssets(compilation: Plugin.BaseCompilation, _this: RsdoctorPluginInstance<Plugin.BaseCompiler, Linter.ExtendRuleData<any, string>[]>, sourceMapFilenameRegex?: RegExp, namespace?: string): Promise<void>;
|
|
46
|
-
/**
|
|
47
|
-
* Handles the emit event for assets to collect source map information.
|
|
48
|
-
* @param options - The options for handling source map assets.
|
|
49
|
-
* @returns A promise that resolves when the source map information is collected.
|
|
50
|
-
*/
|
|
51
|
-
export declare function handleEmitAssets(options: SourceMapAssetOptions): Promise<void>;
|
|
52
|
-
export {};
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
-
var define = (defs, kind)=>{
|
|
6
|
-
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
[kind]: defs[key]
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
define(getters, "get");
|
|
12
|
-
define(values, "value");
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
(()=>{
|
|
16
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
-
})();
|
|
18
|
-
(()=>{
|
|
19
|
-
__webpack_require__.r = (exports1)=>{
|
|
20
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
-
value: 'Module'
|
|
22
|
-
});
|
|
23
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
-
value: true
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
})();
|
|
28
|
-
var __webpack_exports__ = {};
|
|
29
|
-
__webpack_require__.r(__webpack_exports__);
|
|
30
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
-
InternalSummaryPlugin: ()=>InternalSummaryPlugin
|
|
32
|
-
});
|
|
33
|
-
const common_namespaceObject = require("@rsdoctor/utils/common");
|
|
34
|
-
const compat_namespaceObject = require("es-toolkit/compat");
|
|
35
|
-
const external_base_cjs_namespaceObject = require("./base.cjs");
|
|
36
|
-
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
37
|
-
class InternalSummaryPlugin extends external_base_cjs_namespaceObject.InternalBasePlugin {
|
|
38
|
-
apply(compiler) {
|
|
39
|
-
(0, logger_namespaceObject.time)('InternalSummaryPlugin.apply');
|
|
40
|
-
try {
|
|
41
|
-
compiler.hooks.beforeCompile.tapPromise(this.tapPostOptions, this.beforeCompile);
|
|
42
|
-
compiler.hooks.afterCompile.tapPromise(this.tapPreOptions, this.afterCompile);
|
|
43
|
-
compiler.hooks.done.tapPromise(this.tapPostOptions, this.done.bind(this, compiler));
|
|
44
|
-
} finally{
|
|
45
|
-
(0, logger_namespaceObject.timeEnd)('InternalSummaryPlugin.apply');
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
mark(key, type) {
|
|
49
|
-
const now = Date.now();
|
|
50
|
-
switch(type){
|
|
51
|
-
case 'pre':
|
|
52
|
-
this.preTimes.set(key, now);
|
|
53
|
-
break;
|
|
54
|
-
case 'post':
|
|
55
|
-
this.postTimes.set(key, now);
|
|
56
|
-
break;
|
|
57
|
-
default:
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
report(name, start) {
|
|
62
|
-
this.times.set(name, start);
|
|
63
|
-
this.sdk.reportSummaryData({
|
|
64
|
-
costs: [
|
|
65
|
-
{
|
|
66
|
-
name,
|
|
67
|
-
startAt: start,
|
|
68
|
-
costs: Date.now() - start
|
|
69
|
-
}
|
|
70
|
-
]
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
constructor(...args){
|
|
74
|
-
super(...args), this.name = 'summary', this.times = new Map(), this.preTimes = new Map(), this.postTimes = new Map(), this.beforeCompile = async ()=>{
|
|
75
|
-
(0, logger_namespaceObject.time)('InternalSummaryPlugin.beforeCompile');
|
|
76
|
-
try {
|
|
77
|
-
if (!this.times.has(common_namespaceObject.Summary.SummaryCostsDataName.Bootstrap)) {
|
|
78
|
-
const costs = Math.floor(1000 * process.uptime());
|
|
79
|
-
const startAt = Date.now() - costs;
|
|
80
|
-
this.report(common_namespaceObject.Summary.SummaryCostsDataName.Bootstrap, startAt);
|
|
81
|
-
this.mark(common_namespaceObject.Summary.SummaryCostsDataName.Bootstrap, 'post');
|
|
82
|
-
}
|
|
83
|
-
} finally{
|
|
84
|
-
(0, logger_namespaceObject.timeEnd)('InternalSummaryPlugin.beforeCompile');
|
|
85
|
-
}
|
|
86
|
-
}, this.afterCompile = async (compilation)=>{
|
|
87
|
-
(0, logger_namespaceObject.time)('InternalSummaryPlugin.afterCompile');
|
|
88
|
-
try {
|
|
89
|
-
if (!this.times.has(common_namespaceObject.Summary.SummaryCostsDataName.Compile) && !compilation.compiler.isChild()) {
|
|
90
|
-
const start = this.postTimes.get(common_namespaceObject.Summary.SummaryCostsDataName.Bootstrap);
|
|
91
|
-
this.report(common_namespaceObject.Summary.SummaryCostsDataName.Compile, start);
|
|
92
|
-
this.mark(common_namespaceObject.Summary.SummaryCostsDataName.Compile, 'post');
|
|
93
|
-
}
|
|
94
|
-
} finally{
|
|
95
|
-
(0, logger_namespaceObject.timeEnd)('InternalSummaryPlugin.afterCompile');
|
|
96
|
-
}
|
|
97
|
-
}, this.done = async (compiler)=>{
|
|
98
|
-
(0, logger_namespaceObject.time)('InternalSummaryPlugin.done');
|
|
99
|
-
try {
|
|
100
|
-
const start = this.postTimes.get(common_namespaceObject.Summary.SummaryCostsDataName.Compile);
|
|
101
|
-
this.report(common_namespaceObject.Summary.SummaryCostsDataName.Done, start);
|
|
102
|
-
if (false !== compiler.options.optimization.minimize) {
|
|
103
|
-
const pluginData = this.sdk.getStoreData().plugin;
|
|
104
|
-
const minifyHookData = [
|
|
105
|
-
...pluginData.processAssets || []
|
|
106
|
-
];
|
|
107
|
-
if (minifyHookData.length) this.sdk.reportSummaryData({
|
|
108
|
-
costs: [
|
|
109
|
-
{
|
|
110
|
-
name: common_namespaceObject.Summary.SummaryCostsDataName.Minify,
|
|
111
|
-
startAt: (0, compat_namespaceObject.minBy)(minifyHookData, (e)=>e.startAt).startAt,
|
|
112
|
-
costs: (0, compat_namespaceObject.sumBy)(minifyHookData, (e)=>e.costs)
|
|
113
|
-
}
|
|
114
|
-
]
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
} finally{
|
|
118
|
-
(0, logger_namespaceObject.timeEnd)('InternalSummaryPlugin.done');
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
exports.InternalSummaryPlugin = __webpack_exports__.InternalSummaryPlugin;
|
|
124
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
125
|
-
"InternalSummaryPlugin"
|
|
126
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
127
|
-
Object.defineProperty(exports, '__esModule', {
|
|
128
|
-
value: true
|
|
129
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from '@rsdoctor/types';
|
|
2
|
-
import { InternalBasePlugin } from './base';
|
|
3
|
-
export declare class InternalSummaryPlugin<T extends Plugin.BaseCompiler> extends InternalBasePlugin<T> {
|
|
4
|
-
readonly name = "summary";
|
|
5
|
-
private times;
|
|
6
|
-
private preTimes;
|
|
7
|
-
private postTimes;
|
|
8
|
-
apply(compiler: T): void;
|
|
9
|
-
private mark;
|
|
10
|
-
beforeCompile: () => Promise<void>;
|
|
11
|
-
afterCompile: (compilation: Plugin.BaseCompilation) => Promise<void>;
|
|
12
|
-
done: (compiler: T) => Promise<void>;
|
|
13
|
-
private report;
|
|
14
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
-
var define = (defs, kind)=>{
|
|
6
|
-
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
[kind]: defs[key]
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
define(getters, "get");
|
|
12
|
-
define(values, "value");
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
(()=>{
|
|
16
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
-
})();
|
|
18
|
-
(()=>{
|
|
19
|
-
__webpack_require__.r = (exports1)=>{
|
|
20
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
-
value: 'Module'
|
|
22
|
-
});
|
|
23
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
-
value: true
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
})();
|
|
28
|
-
var __webpack_exports__ = {};
|
|
29
|
-
__webpack_require__.r(__webpack_exports__);
|
|
30
|
-
const checkCirclePath = (obj, record, res, level, maxLevel = 3)=>{
|
|
31
|
-
const idx = record.slice(0, record.length - 1).findIndex((v)=>v.ref === obj);
|
|
32
|
-
if (-1 !== idx) {
|
|
33
|
-
const key = record.map((v)=>v.prop);
|
|
34
|
-
if (res.indexOf(key) < 0) return void res.push(key);
|
|
35
|
-
}
|
|
36
|
-
if ('object' == typeof obj && null !== obj && level < maxLevel) for (const [k, v] of Object.entries(obj))checkCirclePath(v, [
|
|
37
|
-
...record,
|
|
38
|
-
{
|
|
39
|
-
prop: k,
|
|
40
|
-
ref: v
|
|
41
|
-
}
|
|
42
|
-
], res, level + 1);
|
|
43
|
-
};
|
|
44
|
-
__webpack_require__.d(__webpack_exports__, {}, {
|
|
45
|
-
checkCirclePath: checkCirclePath
|
|
46
|
-
});
|
|
47
|
-
exports.checkCirclePath = __webpack_exports__.checkCirclePath;
|
|
48
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
49
|
-
"checkCirclePath"
|
|
50
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
51
|
-
Object.defineProperty(exports, '__esModule', {
|
|
52
|
-
value: true
|
|
53
|
-
});
|
|
@@ -1,207 +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, getters, values)=>{
|
|
14
|
-
var define = (defs, kind)=>{
|
|
15
|
-
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
[kind]: defs[key]
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
define(getters, "get");
|
|
21
|
-
define(values, "value");
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
(()=>{
|
|
25
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
26
|
-
})();
|
|
27
|
-
(()=>{
|
|
28
|
-
__webpack_require__.r = (exports1)=>{
|
|
29
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
30
|
-
value: 'Module'
|
|
31
|
-
});
|
|
32
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
33
|
-
value: true
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
})();
|
|
37
|
-
var __webpack_exports__ = {};
|
|
38
|
-
__webpack_require__.r(__webpack_exports__);
|
|
39
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
40
|
-
normalizeReportType: ()=>normalizeReportType,
|
|
41
|
-
normalizeRspackUserOptions: ()=>normalizeRspackUserOptions,
|
|
42
|
-
normalizeUserConfig: ()=>normalizeUserConfig
|
|
43
|
-
});
|
|
44
|
-
const types_namespaceObject = require("@rsdoctor/types");
|
|
45
|
-
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
46
|
-
const external_assert_namespaceObject = require("assert");
|
|
47
|
-
var external_assert_default = /*#__PURE__*/ __webpack_require__.n(external_assert_namespaceObject);
|
|
48
|
-
const external_normalize_config_cjs_namespaceObject = require("./normalize-config.cjs");
|
|
49
|
-
function defaultBoolean(v, dft) {
|
|
50
|
-
return 'boolean' == typeof v ? v : dft;
|
|
51
|
-
}
|
|
52
|
-
function getDefaultOutput() {
|
|
53
|
-
return {
|
|
54
|
-
mode: void 0,
|
|
55
|
-
reportCodeType: {
|
|
56
|
-
noModuleSource: false,
|
|
57
|
-
noAssetsAndModuleSource: false,
|
|
58
|
-
noCode: false
|
|
59
|
-
},
|
|
60
|
-
options: void 0,
|
|
61
|
-
reportDir: '',
|
|
62
|
-
compressData: void 0
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
function getDefaultSupports() {
|
|
66
|
-
return {
|
|
67
|
-
parseBundle: true,
|
|
68
|
-
banner: void 0,
|
|
69
|
-
gzip: true
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
function isJsonOutputEnv(value) {
|
|
73
|
-
return 'json' === value;
|
|
74
|
-
}
|
|
75
|
-
function normalizeFeatures(features, mode) {
|
|
76
|
-
if (Array.isArray(features)) return {
|
|
77
|
-
loader: features.includes('loader'),
|
|
78
|
-
plugins: features.includes('plugins'),
|
|
79
|
-
resolver: features.includes('resolver'),
|
|
80
|
-
bundle: features.includes('bundle'),
|
|
81
|
-
treeShaking: features.includes('treeShaking'),
|
|
82
|
-
lite: features.includes('lite') || mode === types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.lite]
|
|
83
|
-
};
|
|
84
|
-
return {
|
|
85
|
-
loader: defaultBoolean(features.loader, true),
|
|
86
|
-
plugins: defaultBoolean(features.plugins, true),
|
|
87
|
-
resolver: defaultBoolean(features.resolver, false),
|
|
88
|
-
bundle: defaultBoolean(features.bundle, true),
|
|
89
|
-
treeShaking: defaultBoolean(features.treeShaking, false),
|
|
90
|
-
lite: defaultBoolean(features.lite, false) || mode === types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.lite]
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
function normalizeLinter(linter) {
|
|
94
|
-
return {
|
|
95
|
-
rules: {},
|
|
96
|
-
extends: [],
|
|
97
|
-
level: 'Error',
|
|
98
|
-
...linter
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
function isValidMode(mode) {
|
|
102
|
-
return 'string' == typeof mode && [
|
|
103
|
-
'brief',
|
|
104
|
-
'normal',
|
|
105
|
-
'lite'
|
|
106
|
-
].includes(mode);
|
|
107
|
-
}
|
|
108
|
-
function normalizeUserConfig(config = {}) {
|
|
109
|
-
const userOutput = config.output;
|
|
110
|
-
const defaultOutput = getDefaultOutput();
|
|
111
|
-
const outputConfig = isJsonOutputEnv(process.env.RSDOCTOR_OUTPUT) ? {
|
|
112
|
-
reportDir: userOutput?.reportDir,
|
|
113
|
-
compressData: userOutput?.compressData,
|
|
114
|
-
mode: 'brief',
|
|
115
|
-
options: {
|
|
116
|
-
type: [
|
|
117
|
-
'json'
|
|
118
|
-
]
|
|
119
|
-
}
|
|
120
|
-
} : userOutput ?? defaultOutput;
|
|
121
|
-
const normalizedConfig = {
|
|
122
|
-
...config,
|
|
123
|
-
output: outputConfig
|
|
124
|
-
};
|
|
125
|
-
const { linter = {}, features = {}, loaderInterceptorOptions = {}, disableClientServer: userDisableClientServer = false, sdkInstance, innerClientPath = '', output = outputConfig, supports: userSupports = {}, port, server: userServer = {}, printLog = {
|
|
126
|
-
serverUrls: true
|
|
127
|
-
}, mode, brief } = normalizedConfig;
|
|
128
|
-
const supports = {
|
|
129
|
-
...getDefaultSupports(),
|
|
130
|
-
...userSupports
|
|
131
|
-
};
|
|
132
|
-
const disableClientServer = 'true' === process.env.RSTEST ? false : process.env.CI ? true : userDisableClientServer;
|
|
133
|
-
external_assert_default()('object' == typeof linter);
|
|
134
|
-
external_assert_default()('object' == typeof features || Array.isArray(features));
|
|
135
|
-
external_assert_default()('object' == typeof loaderInterceptorOptions);
|
|
136
|
-
external_assert_default()('boolean' == typeof disableClientServer);
|
|
137
|
-
external_assert_default()(void 0 === port || 'number' == typeof port);
|
|
138
|
-
external_assert_default()('object' == typeof userServer && null !== userServer);
|
|
139
|
-
const server = {
|
|
140
|
-
...userServer
|
|
141
|
-
};
|
|
142
|
-
if (void 0 === server.port && void 0 !== port) server.port = port;
|
|
143
|
-
let finalMode = ('mode' in output && isValidMode(output.mode) ? 'lite' === output.mode ? types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.normal] : output.mode : void 0) || mode || types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.normal];
|
|
144
|
-
if (mode) logger_namespaceObject.logger.info(logger_namespaceObject.chalk.yellow("The 'mode' configuration will be deprecated in a future version. Please use 'output.mode' instead."));
|
|
145
|
-
const _features = normalizeFeatures(features, finalMode);
|
|
146
|
-
const _linter = normalizeLinter(linter);
|
|
147
|
-
if (_features.lite || finalMode === types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.lite]) logger_namespaceObject.logger.info(logger_namespaceObject.chalk.yellow("Lite features will be deprecated in a future version. Please use 'output: { reportCodeType: { noAssetsAndModuleSource: true }}' instead."));
|
|
148
|
-
const { finalBrief, finalNormalOptions } = (0, external_normalize_config_cjs_namespaceObject.processModeConfigurations)(finalMode, output, brief);
|
|
149
|
-
if (_features.lite && finalMode !== types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.brief]) finalMode = types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.lite];
|
|
150
|
-
const reportCodeType = output.reportCodeType ? normalizeReportType(output.reportCodeType, finalMode) : normalizeReportType(getDefaultOutput().reportCodeType, finalMode);
|
|
151
|
-
const res = {
|
|
152
|
-
linter: _linter,
|
|
153
|
-
features: _features,
|
|
154
|
-
loaderInterceptorOptions: {
|
|
155
|
-
skipLoaders: Array.isArray(loaderInterceptorOptions.skipLoaders) ? loaderInterceptorOptions.skipLoaders : []
|
|
156
|
-
},
|
|
157
|
-
disableClientServer,
|
|
158
|
-
sdkInstance,
|
|
159
|
-
output: {
|
|
160
|
-
mode: finalMode,
|
|
161
|
-
options: 'brief' === finalMode ? finalBrief : finalNormalOptions,
|
|
162
|
-
reportCodeType,
|
|
163
|
-
reportDir: output.reportDir || ''
|
|
164
|
-
},
|
|
165
|
-
innerClientPath,
|
|
166
|
-
supports,
|
|
167
|
-
port,
|
|
168
|
-
server,
|
|
169
|
-
printLog
|
|
170
|
-
};
|
|
171
|
-
if (void 0 !== output.compressData) logger_namespaceObject.logger.info(logger_namespaceObject.chalk.yellow("The 'compressData' configuration will be deprecated in a future version."));
|
|
172
|
-
return res;
|
|
173
|
-
}
|
|
174
|
-
const normalizeReportType = (reportCodeType, mode)=>{
|
|
175
|
-
const convertedReportCodeType = 'object' == typeof reportCodeType ? (0, external_normalize_config_cjs_namespaceObject.convertReportCodeTypeObject)(reportCodeType) : reportCodeType;
|
|
176
|
-
if ('noCode' === convertedReportCodeType) return types_namespaceObject.SDK.ToDataType.NoCode;
|
|
177
|
-
if (mode === types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.brief]) return types_namespaceObject.SDK.ToDataType.NoCode;
|
|
178
|
-
if (mode === types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.lite]) return types_namespaceObject.SDK.ToDataType.NoSourceAndAssets;
|
|
179
|
-
if ('noAssetsAndModuleSource' === convertedReportCodeType) return types_namespaceObject.SDK.ToDataType.NoSourceAndAssets;
|
|
180
|
-
if ('noModuleSource' === convertedReportCodeType) return types_namespaceObject.SDK.ToDataType.NoSource;
|
|
181
|
-
return types_namespaceObject.SDK.ToDataType.Normal;
|
|
182
|
-
};
|
|
183
|
-
function normalizeRspackUserOptions(options) {
|
|
184
|
-
const config = normalizeUserConfig(options);
|
|
185
|
-
config.experiments ??= {
|
|
186
|
-
enableNativePlugin: {
|
|
187
|
-
moduleGraph: true,
|
|
188
|
-
chunkGraph: true
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
if ('boolean' == typeof options.experiments?.enableNativePlugin && options.experiments?.enableNativePlugin === false) config.experiments.enableNativePlugin = {
|
|
192
|
-
moduleGraph: false,
|
|
193
|
-
chunkGraph: false
|
|
194
|
-
};
|
|
195
|
-
return config;
|
|
196
|
-
}
|
|
197
|
-
exports.normalizeReportType = __webpack_exports__.normalizeReportType;
|
|
198
|
-
exports.normalizeRspackUserOptions = __webpack_exports__.normalizeRspackUserOptions;
|
|
199
|
-
exports.normalizeUserConfig = __webpack_exports__.normalizeUserConfig;
|
|
200
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
201
|
-
"normalizeReportType",
|
|
202
|
-
"normalizeRspackUserOptions",
|
|
203
|
-
"normalizeUserConfig"
|
|
204
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
205
|
-
Object.defineProperty(exports, '__esModule', {
|
|
206
|
-
value: true
|
|
207
|
-
});
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { RsdoctorRspackPluginOptions, RsdoctorRspackPluginOptionsNormalized } from '../../types';
|
|
2
|
-
import { Linter, Plugin, SDK } from '@rsdoctor/types';
|
|
3
|
-
export declare function normalizeUserConfig<Rules extends Linter.ExtendRuleData[]>(config?: Plugin.RsdoctorWebpackPluginOptions<Rules>): Plugin.RsdoctorPluginOptionsNormalized<Rules>;
|
|
4
|
-
export declare const normalizeReportType: (reportCodeType: Plugin.IReportCodeType | Plugin.NewReportCodeType, mode: keyof typeof SDK.IMode) => SDK.ToDataType;
|
|
5
|
-
export declare function normalizeRspackUserOptions<Rules extends Linter.ExtendRuleData[]>(options: RsdoctorRspackPluginOptions<Rules>): RsdoctorRspackPluginOptionsNormalized<Rules>;
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_modules__ = {
|
|
3
|
-
"./circleDetect" (module) {
|
|
4
|
-
module.exports = require("./circleDetect.cjs");
|
|
5
|
-
},
|
|
6
|
-
"./config" (module) {
|
|
7
|
-
module.exports = require("./config.cjs");
|
|
8
|
-
},
|
|
9
|
-
"./loader" (module) {
|
|
10
|
-
module.exports = require("./loader.cjs");
|
|
11
|
-
},
|
|
12
|
-
"./normalize-config" (module) {
|
|
13
|
-
module.exports = require("./normalize-config.cjs");
|
|
14
|
-
},
|
|
15
|
-
"./plugin-common" (module) {
|
|
16
|
-
module.exports = require("./plugin-common.cjs");
|
|
17
|
-
},
|
|
18
|
-
"./plugin" (module) {
|
|
19
|
-
module.exports = require("./plugin.cjs");
|
|
20
|
-
},
|
|
21
|
-
"./sdk" (module) {
|
|
22
|
-
module.exports = require("./sdk.cjs");
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
var __webpack_module_cache__ = {};
|
|
26
|
-
function __webpack_require__(moduleId) {
|
|
27
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
28
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
29
|
-
var module = __webpack_module_cache__[moduleId] = {
|
|
30
|
-
exports: {}
|
|
31
|
-
};
|
|
32
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
33
|
-
return module.exports;
|
|
34
|
-
}
|
|
35
|
-
(()=>{
|
|
36
|
-
__webpack_require__.n = (module)=>{
|
|
37
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
38
|
-
__webpack_require__.d(getter, {
|
|
39
|
-
a: getter
|
|
40
|
-
});
|
|
41
|
-
return getter;
|
|
42
|
-
};
|
|
43
|
-
})();
|
|
44
|
-
(()=>{
|
|
45
|
-
__webpack_require__.d = (exports1, getters, values)=>{
|
|
46
|
-
var define = (defs, kind)=>{
|
|
47
|
-
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
48
|
-
enumerable: true,
|
|
49
|
-
[kind]: defs[key]
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
define(getters, "get");
|
|
53
|
-
define(values, "value");
|
|
54
|
-
};
|
|
55
|
-
})();
|
|
56
|
-
(()=>{
|
|
57
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
58
|
-
})();
|
|
59
|
-
(()=>{
|
|
60
|
-
__webpack_require__.r = (exports1)=>{
|
|
61
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
62
|
-
value: 'Module'
|
|
63
|
-
});
|
|
64
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
65
|
-
value: true
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
})();
|
|
69
|
-
var __webpack_exports__ = {};
|
|
70
|
-
(()=>{
|
|
71
|
-
__webpack_require__.r(__webpack_exports__);
|
|
72
|
-
var _loader__rspack_import_0 = __webpack_require__("./loader");
|
|
73
|
-
var __rspack_reexport = {};
|
|
74
|
-
for(const __rspack_import_key in _loader__rspack_import_0)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_loader__rspack_import_0[__rspack_import_key];
|
|
75
|
-
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
76
|
-
var _plugin__rspack_import_1 = __webpack_require__("./plugin");
|
|
77
|
-
var __rspack_reexport = {};
|
|
78
|
-
for(const __rspack_import_key in _plugin__rspack_import_1)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_plugin__rspack_import_1[__rspack_import_key];
|
|
79
|
-
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
80
|
-
var _sdk__rspack_import_2 = __webpack_require__("./sdk");
|
|
81
|
-
var __rspack_reexport = {};
|
|
82
|
-
for(const __rspack_import_key in _sdk__rspack_import_2)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_sdk__rspack_import_2[__rspack_import_key];
|
|
83
|
-
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
84
|
-
var _config__rspack_import_3 = __webpack_require__("./config");
|
|
85
|
-
var __rspack_reexport = {};
|
|
86
|
-
for(const __rspack_import_key in _config__rspack_import_3)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_config__rspack_import_3[__rspack_import_key];
|
|
87
|
-
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
88
|
-
var _circleDetect__rspack_import_4 = __webpack_require__("./circleDetect");
|
|
89
|
-
var __rspack_reexport = {};
|
|
90
|
-
for(const __rspack_import_key in _circleDetect__rspack_import_4)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_circleDetect__rspack_import_4[__rspack_import_key];
|
|
91
|
-
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
92
|
-
var _plugin_common__rspack_import_5 = __webpack_require__("./plugin-common");
|
|
93
|
-
var __rspack_reexport = {};
|
|
94
|
-
for(const __rspack_import_key in _plugin_common__rspack_import_5)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_plugin_common__rspack_import_5[__rspack_import_key];
|
|
95
|
-
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
96
|
-
var _normalize_config__rspack_import_6 = __webpack_require__("./normalize-config");
|
|
97
|
-
var __rspack_reexport = {};
|
|
98
|
-
for(const __rspack_import_key in _normalize_config__rspack_import_6)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_normalize_config__rspack_import_6[__rspack_import_key];
|
|
99
|
-
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
100
|
-
var __rspack_reexport = {};
|
|
101
|
-
for(const __rspack_import_key in _plugin_common__rspack_import_5)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_plugin_common__rspack_import_5[__rspack_import_key];
|
|
102
|
-
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
103
|
-
var __rspack_reexport = {};
|
|
104
|
-
for(const __rspack_import_key in _normalize_config__rspack_import_6)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_normalize_config__rspack_import_6[__rspack_import_key];
|
|
105
|
-
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
106
|
-
})();
|
|
107
|
-
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
108
|
-
Object.defineProperty(exports, '__esModule', {
|
|
109
|
-
value: true
|
|
110
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './loader';
|
|
2
|
-
export * from './plugin';
|
|
3
|
-
export * from './sdk';
|
|
4
|
-
export * from './config';
|
|
5
|
-
export * from './circleDetect';
|
|
6
|
-
export * from './plugin-common';
|
|
7
|
-
export * from './normalize-config';
|
|
8
|
-
export * from './plugin-common';
|
|
9
|
-
export * from './normalize-config';
|