@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,108 +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
|
-
default: ()=>proxy,
|
|
32
|
-
pitch: ()=>pitch,
|
|
33
|
-
raw: ()=>raw
|
|
34
|
-
});
|
|
35
|
-
const index_cjs_namespaceObject = require("../../build-utils/build/index.cjs");
|
|
36
|
-
const external_utils_index_cjs_namespaceObject = require("../utils/index.cjs");
|
|
37
|
-
const loaderModule = function(...args) {
|
|
38
|
-
if ((0, external_utils_index_cjs_namespaceObject.shouldSkipLoader)(this)) return void this.callback(null, ...args);
|
|
39
|
-
this.cacheable(false);
|
|
40
|
-
const mod = (0, external_utils_index_cjs_namespaceObject.getOriginLoaderModule)(this);
|
|
41
|
-
if (mod.default) {
|
|
42
|
-
if (false === mod.raw && Buffer.isBuffer(args[0])) args[0] = args[0].toString();
|
|
43
|
-
let start = 0;
|
|
44
|
-
let startHRTime = [
|
|
45
|
-
0,
|
|
46
|
-
0
|
|
47
|
-
];
|
|
48
|
-
const trap = index_cjs_namespaceObject.Utils.createLoaderContextTrap.call(this, (err, res, sourceMap)=>{
|
|
49
|
-
(0, external_utils_index_cjs_namespaceObject.reportLoader)(this, start, startHRTime, false, false, args[0].toString(), err, res, sourceMap);
|
|
50
|
-
});
|
|
51
|
-
start = Date.now();
|
|
52
|
-
startHRTime = process.hrtime();
|
|
53
|
-
try {
|
|
54
|
-
const result = mod.default.apply(trap, args);
|
|
55
|
-
if (result) {
|
|
56
|
-
if (!(result instanceof Promise)) (0, external_utils_index_cjs_namespaceObject.reportLoader)(this, start, startHRTime, false, true, args[0].toString(), null, result);
|
|
57
|
-
}
|
|
58
|
-
return result || '';
|
|
59
|
-
} catch (error) {
|
|
60
|
-
(0, external_utils_index_cjs_namespaceObject.reportLoader)(this, start, startHRTime, false, true, args[0].toString(), error, null);
|
|
61
|
-
throw error;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
this.callback(null, ...args);
|
|
65
|
-
};
|
|
66
|
-
const pitch = function() {
|
|
67
|
-
if ((0, external_utils_index_cjs_namespaceObject.shouldSkipLoader)(this)) return;
|
|
68
|
-
this.cacheable(false);
|
|
69
|
-
const mod = (0, external_utils_index_cjs_namespaceObject.getOriginLoaderModule)(this);
|
|
70
|
-
if (mod.pitch && 'function' == typeof mod.pitch) {
|
|
71
|
-
let start = 0;
|
|
72
|
-
let startHRTime = [
|
|
73
|
-
0,
|
|
74
|
-
0
|
|
75
|
-
];
|
|
76
|
-
const trap = index_cjs_namespaceObject.Utils.createLoaderContextTrap.call(this, (err, res)=>{
|
|
77
|
-
(0, external_utils_index_cjs_namespaceObject.reportLoader)(this, start, startHRTime, true, false, err ? 'Loader Pitch Async Error' : '', err, res);
|
|
78
|
-
});
|
|
79
|
-
start = Date.now();
|
|
80
|
-
startHRTime = process.hrtime();
|
|
81
|
-
try {
|
|
82
|
-
const res = mod.pitch.apply(trap, arguments);
|
|
83
|
-
if (res) {
|
|
84
|
-
if (!(res instanceof Promise)) (0, external_utils_index_cjs_namespaceObject.reportLoader)(this, start, startHRTime, true, true, '', null, res);
|
|
85
|
-
}
|
|
86
|
-
return res;
|
|
87
|
-
} catch (error) {
|
|
88
|
-
(0, external_utils_index_cjs_namespaceObject.reportLoader)(this, start, startHRTime, true, true, 'Loader Pitch Sync Error', error, null);
|
|
89
|
-
throw error;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
loaderModule.raw = true;
|
|
94
|
-
loaderModule.pitch = pitch;
|
|
95
|
-
const raw = true;
|
|
96
|
-
const proxy = loaderModule;
|
|
97
|
-
exports["default"] = __webpack_exports__["default"];
|
|
98
|
-
exports.pitch = __webpack_exports__.pitch;
|
|
99
|
-
exports.raw = __webpack_exports__.raw;
|
|
100
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
101
|
-
"default",
|
|
102
|
-
"pitch",
|
|
103
|
-
"raw"
|
|
104
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
105
|
-
Object.defineProperty(exports, '__esModule', {
|
|
106
|
-
value: true
|
|
107
|
-
});
|
|
108
|
-
module.exports = loaderModule;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Plugin as PluginType } from '@rsdoctor/types';
|
|
2
|
-
import { Plugin } from '@rsdoctor/types';
|
|
3
|
-
import type { ProxyLoaderOptions } from '../../types';
|
|
4
|
-
declare const loaderModule: Plugin.LoaderDefinition<ProxyLoaderOptions, {}>;
|
|
5
|
-
export declare const pitch: (this: PluginType.LoaderContext<ProxyLoaderOptions>) => string | void | Buffer<ArrayBufferLike> | Promise<string | Buffer<ArrayBufferLike>>;
|
|
6
|
-
export declare const raw = true;
|
|
7
|
-
export default loaderModule;
|
|
@@ -1,57 +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
|
-
InternalBasePlugin: ()=>InternalBasePlugin
|
|
32
|
-
});
|
|
33
|
-
const external_constants_cjs_namespaceObject = require("../constants.cjs");
|
|
34
|
-
class InternalBasePlugin {
|
|
35
|
-
get options() {
|
|
36
|
-
return this.scheduler.options;
|
|
37
|
-
}
|
|
38
|
-
get sdk() {
|
|
39
|
-
return this.scheduler.sdk;
|
|
40
|
-
}
|
|
41
|
-
get tapPostOptions() {
|
|
42
|
-
return (0, external_constants_cjs_namespaceObject.internalPluginTapPostOptions)(this.name);
|
|
43
|
-
}
|
|
44
|
-
get tapPreOptions() {
|
|
45
|
-
return (0, external_constants_cjs_namespaceObject.internalPluginTapPreOptions)(this.name);
|
|
46
|
-
}
|
|
47
|
-
constructor(scheduler){
|
|
48
|
-
this.scheduler = scheduler;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
exports.InternalBasePlugin = __webpack_exports__.InternalBasePlugin;
|
|
52
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
53
|
-
"InternalBasePlugin"
|
|
54
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
55
|
-
Object.defineProperty(exports, '__esModule', {
|
|
56
|
-
value: true
|
|
57
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Linter, Plugin, SDK } from '@rsdoctor/types';
|
|
2
|
-
import type { InternalPlugin, RsdoctorPluginInstance } from '../../types';
|
|
3
|
-
export declare abstract class InternalBasePlugin<T extends Plugin.BaseCompiler> implements InternalPlugin<T, Linter.ExtendRuleData[]> {
|
|
4
|
-
readonly scheduler: RsdoctorPluginInstance<T, Linter.ExtendRuleData[]>;
|
|
5
|
-
abstract name: string;
|
|
6
|
-
constructor(scheduler: RsdoctorPluginInstance<T, Linter.ExtendRuleData[]>);
|
|
7
|
-
abstract apply(compiler: T): void;
|
|
8
|
-
get options(): Plugin.RsdoctorPluginOptionsNormalized<Linter.ExtendRuleData<any, string>[]>;
|
|
9
|
-
get sdk(): SDK.RsdoctorBuilderSDKInstance;
|
|
10
|
-
get tapPostOptions(): import("tapable").Tap;
|
|
11
|
-
get tapPreOptions(): import("tapable").Tap;
|
|
12
|
-
}
|
|
@@ -1,116 +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
|
-
InternalBundlePlugin: ()=>InternalBundlePlugin
|
|
32
|
-
});
|
|
33
|
-
const types_namespaceObject = require("@rsdoctor/types");
|
|
34
|
-
const external_base_cjs_namespaceObject = require("./base.cjs");
|
|
35
|
-
const graph_namespaceObject = require("@rsdoctor/graph");
|
|
36
|
-
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
37
|
-
class InternalBundlePlugin extends external_base_cjs_namespaceObject.InternalBasePlugin {
|
|
38
|
-
apply(compiler) {
|
|
39
|
-
(0, logger_namespaceObject.time)('InternalBundlePlugin.apply');
|
|
40
|
-
try {
|
|
41
|
-
this.scheduler.ensureModulesChunksGraphApplied(compiler);
|
|
42
|
-
this.changeDevtoolModuleFilename(compiler);
|
|
43
|
-
compiler.hooks.compilation.tap(this.tapPostOptions, this.thisCompilation);
|
|
44
|
-
compiler.hooks.done.tapPromise(this.tapPreOptions, this.done.bind(this));
|
|
45
|
-
} finally{
|
|
46
|
-
(0, logger_namespaceObject.timeEnd)('InternalBundlePlugin.apply');
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
changeDevtoolModuleFilename(compiler) {
|
|
50
|
-
const devtool = compiler.options.devtool;
|
|
51
|
-
if (devtool) {
|
|
52
|
-
if (!compiler.options.output) compiler.options.output = {};
|
|
53
|
-
compiler.options.output.devtoolModuleFilenameTemplate = '[absolute-resource-path]';
|
|
54
|
-
logger_namespaceObject.logger.warn("output.devtoolModuleFilenameTemplate has been changed to [absolute-resource-path], this is for bundle analysis.");
|
|
55
|
-
if ('string' == typeof devtool && devtool.includes('source-map')) compiler.options.output.devtoolFallbackModuleFilenameTemplate = ()=>'[absolute-resource-path]';
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
ensureAssetContent(name) {
|
|
59
|
-
const asset = this.map.get(name);
|
|
60
|
-
if (asset) return asset;
|
|
61
|
-
const v = {
|
|
62
|
-
content: ''
|
|
63
|
-
};
|
|
64
|
-
this.map.set(name, v);
|
|
65
|
-
return v;
|
|
66
|
-
}
|
|
67
|
-
constructor(...args){
|
|
68
|
-
super(...args), this.name = 'bundle', this.map = new Map(), this.thisCompilation = (compilation)=>{
|
|
69
|
-
(0, logger_namespaceObject.time)('InternalBundlePlugin.thisCompilation');
|
|
70
|
-
try {
|
|
71
|
-
if (compilation.hooks.processAssets && 'afterOptimizeAssets' in compilation.hooks) compilation.hooks.afterOptimizeAssets.tap(this.tapPostOptions, (assets)=>{
|
|
72
|
-
Object.keys(assets).forEach((file)=>{
|
|
73
|
-
const v = this.ensureAssetContent(file);
|
|
74
|
-
v.content = assets[file].source().toString();
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
else if (compilation.hooks.processAssets && 'afterProcessAssets' in compilation.hooks) compilation.hooks.afterProcessAssets.tap(this.tapPostOptions, ()=>{
|
|
78
|
-
Object.keys(compilation.assets).forEach((file)=>{
|
|
79
|
-
const v = this.ensureAssetContent(file);
|
|
80
|
-
v.content = compilation.assets[file].source().toString();
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
else if ('afterOptimizeChunkAssets' in compilation.hooks) compilation.hooks.afterOptimizeChunkAssets.tap(this.tapPostOptions, (chunks)=>{
|
|
84
|
-
[
|
|
85
|
-
...chunks
|
|
86
|
-
].reduce((t, chunk)=>t.concat([
|
|
87
|
-
...chunk.files
|
|
88
|
-
]), []).forEach((file)=>{
|
|
89
|
-
const v = this.ensureAssetContent(file);
|
|
90
|
-
v.content = compilation.assets[file].source().toString();
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
} finally{
|
|
94
|
-
(0, logger_namespaceObject.timeEnd)('InternalBundlePlugin.thisCompilation');
|
|
95
|
-
}
|
|
96
|
-
}, this.done = async ()=>{
|
|
97
|
-
(0, logger_namespaceObject.time)('InternalBundlePlugin.done');
|
|
98
|
-
try {
|
|
99
|
-
if (this.scheduler.chunkGraph) graph_namespaceObject.Chunks.assetsContents(this.map, this.scheduler.chunkGraph, this.scheduler.options?.supports);
|
|
100
|
-
this.sdk.addClientRoutes([
|
|
101
|
-
types_namespaceObject.Manifest.RsdoctorManifestClientRoutes.ModuleGraph,
|
|
102
|
-
types_namespaceObject.Manifest.RsdoctorManifestClientRoutes.BundleSize
|
|
103
|
-
]);
|
|
104
|
-
} finally{
|
|
105
|
-
(0, logger_namespaceObject.timeEnd)('InternalBundlePlugin.done');
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
exports.InternalBundlePlugin = __webpack_exports__.InternalBundlePlugin;
|
|
111
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
112
|
-
"InternalBundlePlugin"
|
|
113
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
114
|
-
Object.defineProperty(exports, '__esModule', {
|
|
115
|
-
value: true
|
|
116
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Plugin } from '@rsdoctor/types';
|
|
2
|
-
import { InternalBasePlugin } from './base';
|
|
3
|
-
export declare class InternalBundlePlugin<T extends Plugin.BaseCompiler> extends InternalBasePlugin<T> {
|
|
4
|
-
readonly name = "bundle";
|
|
5
|
-
map: Map<string, {
|
|
6
|
-
content: string;
|
|
7
|
-
}>;
|
|
8
|
-
apply(compiler: T): void;
|
|
9
|
-
changeDevtoolModuleFilename(compiler: Plugin.BaseCompiler): void;
|
|
10
|
-
ensureAssetContent(name: string): {
|
|
11
|
-
content: string;
|
|
12
|
-
};
|
|
13
|
-
thisCompilation: (compilation: Plugin.BaseCompilation) => void;
|
|
14
|
-
done: () => Promise<void>;
|
|
15
|
-
}
|
|
@@ -1,88 +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
|
-
InternalBundleTagPlugin: ()=>InternalBundleTagPlugin
|
|
32
|
-
});
|
|
33
|
-
const external_path_namespaceObject = require("path");
|
|
34
|
-
const external_base_cjs_namespaceObject = require("./base.cjs");
|
|
35
|
-
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
36
|
-
class InternalBundleTagPlugin extends external_base_cjs_namespaceObject.InternalBasePlugin {
|
|
37
|
-
apply(compiler) {
|
|
38
|
-
(0, logger_namespaceObject.time)('InternalBundleTagPlugin.apply');
|
|
39
|
-
try {
|
|
40
|
-
const supportBannerPlugin = this.options.supports?.banner;
|
|
41
|
-
compiler.hooks.compilation.tap('RsdoctorTagBannerPlugin', (compilation)=>{
|
|
42
|
-
compilation.hooks.processAssets.tapPromise({
|
|
43
|
-
name: 'RsdoctorTagBannerPlugin',
|
|
44
|
-
stage: -2000
|
|
45
|
-
}, async ()=>{
|
|
46
|
-
if (true !== supportBannerPlugin || 'rspack' in compiler) return;
|
|
47
|
-
logger_namespaceObject.logger.info(logger_namespaceObject.chalk.magenta("Rsdoctor's `supports.banner` option is enabled, this is for debugging only. Do not use it for production."));
|
|
48
|
-
const minimizers = compiler.options.optimization?.minimizer || [];
|
|
49
|
-
const terserPlugin = minimizers.find((plugin)=>plugin?.constructor?.name === 'TerserPlugin');
|
|
50
|
-
const swcPlugin = minimizers.find((plugin)=>plugin?.constructor?.name === 'SwcJsMinimizerRspackPlugin');
|
|
51
|
-
const hasTerserPlugin = !!terserPlugin;
|
|
52
|
-
const hasSwcJsMinimizer = !!swcPlugin;
|
|
53
|
-
if (hasTerserPlugin || hasSwcJsMinimizer) {
|
|
54
|
-
const terserDropConsole = terserPlugin?.options?.minimizer?.options?.compress?.drop_console;
|
|
55
|
-
const swcDropConsole = swcPlugin?._args?.[0]?.minimizerOptions?.compress?.drop_console;
|
|
56
|
-
if (true === terserDropConsole || true === swcDropConsole) logger_namespaceObject.logger.warn(logger_namespaceObject.chalk.yellow('Warning: BannerPlugin detected in project. Please disable drop_console option in TerserPlugin or SwcJsMinimizerRspackPlugin to enable Rsdoctor analysis for BannerPlugin.'));
|
|
57
|
-
}
|
|
58
|
-
const chunks = compilation.chunks;
|
|
59
|
-
for (const chunk of chunks)for (const file of chunk.files){
|
|
60
|
-
if (!file || '.js' !== (0, external_path_namespaceObject.extname)(file)) continue;
|
|
61
|
-
const { ConcatSource } = compiler.webpack.sources;
|
|
62
|
-
compilation.updateAsset(file, (old)=>{
|
|
63
|
-
const concatSource = new ConcatSource();
|
|
64
|
-
const header = "\n console.log('RSDOCTOR_START::');\n";
|
|
65
|
-
const footer = "\n console.log('RSDOCTOR_END::');\n";
|
|
66
|
-
concatSource.add(header);
|
|
67
|
-
concatSource.add(old);
|
|
68
|
-
concatSource.add(footer);
|
|
69
|
-
return concatSource;
|
|
70
|
-
}, ()=>{});
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
} finally{
|
|
75
|
-
(0, logger_namespaceObject.timeEnd)('InternalBundleTagPlugin.apply');
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
constructor(...args){
|
|
79
|
-
super(...args), this.name = 'bundleTag';
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
exports.InternalBundleTagPlugin = __webpack_exports__.InternalBundleTagPlugin;
|
|
83
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
84
|
-
"InternalBundleTagPlugin"
|
|
85
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
86
|
-
Object.defineProperty(exports, '__esModule', {
|
|
87
|
-
value: true
|
|
88
|
-
});
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Plugin } from '@rsdoctor/types';
|
|
2
|
-
import { InternalBasePlugin } from './base';
|
|
3
|
-
export declare class InternalBundleTagPlugin<T extends Plugin.BaseCompiler> extends InternalBasePlugin<T> {
|
|
4
|
-
readonly name = "bundleTag";
|
|
5
|
-
apply(compiler: Plugin.BaseCompiler): void;
|
|
6
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Plugin } from '@rsdoctor/types';
|
|
2
|
-
import { InternalBasePlugin } from './base.js';
|
|
3
|
-
export declare class InternalBundleTagPlugin<T extends Plugin.BaseCompiler> extends InternalBasePlugin<T> {
|
|
4
|
-
readonly name = "bundleTag";
|
|
5
|
-
apply(compiler: Plugin.BaseCompiler): void;
|
|
6
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import "node:module";
|
|
2
|
-
import { extname } from "path";
|
|
3
|
-
import { InternalBasePlugin } from "./base.js";
|
|
4
|
-
import { chalk, logger, time, timeEnd } from "@rsdoctor/utils/logger";
|
|
5
|
-
class InternalBundleTagPlugin extends InternalBasePlugin {
|
|
6
|
-
apply(compiler) {
|
|
7
|
-
time('InternalBundleTagPlugin.apply');
|
|
8
|
-
try {
|
|
9
|
-
const supportBannerPlugin = this.options.supports?.banner;
|
|
10
|
-
compiler.hooks.compilation.tap('RsdoctorTagBannerPlugin', (compilation)=>{
|
|
11
|
-
compilation.hooks.processAssets.tapPromise({
|
|
12
|
-
name: 'RsdoctorTagBannerPlugin',
|
|
13
|
-
stage: -2000
|
|
14
|
-
}, async ()=>{
|
|
15
|
-
if (true !== supportBannerPlugin || 'rspack' in compiler) return;
|
|
16
|
-
logger.info(chalk.magenta("Rsdoctor's `supports.banner` option is enabled, this is for debugging only. Do not use it for production."));
|
|
17
|
-
const minimizers = compiler.options.optimization?.minimizer || [];
|
|
18
|
-
const terserPlugin = minimizers.find((plugin)=>plugin?.constructor?.name === 'TerserPlugin');
|
|
19
|
-
const swcPlugin = minimizers.find((plugin)=>plugin?.constructor?.name === 'SwcJsMinimizerRspackPlugin');
|
|
20
|
-
const hasTerserPlugin = !!terserPlugin;
|
|
21
|
-
const hasSwcJsMinimizer = !!swcPlugin;
|
|
22
|
-
if (hasTerserPlugin || hasSwcJsMinimizer) {
|
|
23
|
-
const terserDropConsole = terserPlugin?.options?.minimizer?.options?.compress?.drop_console;
|
|
24
|
-
const swcDropConsole = swcPlugin?._args?.[0]?.minimizerOptions?.compress?.drop_console;
|
|
25
|
-
if (true === terserDropConsole || true === swcDropConsole) logger.warn(chalk.yellow('Warning: BannerPlugin detected in project. Please disable drop_console option in TerserPlugin or SwcJsMinimizerRspackPlugin to enable Rsdoctor analysis for BannerPlugin.'));
|
|
26
|
-
}
|
|
27
|
-
const chunks = compilation.chunks;
|
|
28
|
-
for (const chunk of chunks)for (const file of chunk.files){
|
|
29
|
-
if (!file || '.js' !== extname(file)) continue;
|
|
30
|
-
const { ConcatSource } = compiler.webpack.sources;
|
|
31
|
-
compilation.updateAsset(file, (old)=>{
|
|
32
|
-
const concatSource = new ConcatSource();
|
|
33
|
-
const header = "\n console.log('RSDOCTOR_START::');\n";
|
|
34
|
-
const footer = "\n console.log('RSDOCTOR_END::');\n";
|
|
35
|
-
concatSource.add(header);
|
|
36
|
-
concatSource.add(old);
|
|
37
|
-
concatSource.add(footer);
|
|
38
|
-
return concatSource;
|
|
39
|
-
}, ()=>{});
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
} finally{
|
|
44
|
-
timeEnd('InternalBundleTagPlugin.apply');
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
constructor(...args){
|
|
48
|
-
super(...args), this.name = 'bundleTag';
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
export { InternalBundleTagPlugin };
|
|
@@ -1,182 +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
|
-
calculateNamespaceAndRegex: ()=>calculateNamespaceAndRegex,
|
|
32
|
-
ensureDevtools: ()=>ensureDevtools,
|
|
33
|
-
ensureModulesChunksGraphFn: ()=>ensureModulesChunksGraphFn
|
|
34
|
-
});
|
|
35
|
-
const types_namespaceObject = require("@rsdoctor/types");
|
|
36
|
-
const build_namespaceObject = require("@rsdoctor/utils/build");
|
|
37
|
-
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
38
|
-
const index_cjs_namespaceObject = require("../../build-utils/build/index.cjs");
|
|
39
|
-
const external_constants_cjs_namespaceObject = require("../constants.cjs");
|
|
40
|
-
const external_rspack_cjs_namespaceObject = require("./rspack.cjs");
|
|
41
|
-
const external_sourcemapTool_cjs_namespaceObject = require("./sourcemapTool.cjs");
|
|
42
|
-
let hasConsole = false;
|
|
43
|
-
const ensureModulesChunksGraphFn = (compiler, _this)=>{
|
|
44
|
-
if (_this._modulesGraphApplied) return;
|
|
45
|
-
_this._modulesGraphApplied = true;
|
|
46
|
-
const context = {
|
|
47
|
-
astCache: new Map(),
|
|
48
|
-
packagePathMap: new Map(),
|
|
49
|
-
getSourceMap: (file)=>_this.sdk.getSourceMap(file)
|
|
50
|
-
};
|
|
51
|
-
const RsdoctorRspackPlugin = compiler.webpack.experiments?.RsdoctorPlugin;
|
|
52
|
-
if (RsdoctorRspackPlugin) (0, external_rspack_cjs_namespaceObject.applyRspackNativePlugin)(compiler, _this, RsdoctorRspackPlugin);
|
|
53
|
-
if (!_this._realSourcePathCache) _this._realSourcePathCache = new Map();
|
|
54
|
-
compiler.hooks.done.tapPromise((0, external_constants_cjs_namespaceObject.internalPluginTapPreOptions)('moduleGraph'), async (_stats)=>{
|
|
55
|
-
await doneHandler(_stats, _this, context, compiler);
|
|
56
|
-
});
|
|
57
|
-
compiler.hooks.compilation.tap({
|
|
58
|
-
...external_constants_cjs_namespaceObject.pluginTapPostOptions,
|
|
59
|
-
name: 'RsdoctorSourceMapCollector'
|
|
60
|
-
}, (compilation)=>{
|
|
61
|
-
if (compilation.hooks.processAssets) compilation.hooks.processAssets.tapPromise({
|
|
62
|
-
name: 'RsdoctorSourceMapCollector',
|
|
63
|
-
stage: 2400
|
|
64
|
-
}, async ()=>{
|
|
65
|
-
if (!ensureDevtools(compiler)) return;
|
|
66
|
-
const { namespace, sourceMapFilenameRegex } = calculateNamespaceAndRegex(compiler);
|
|
67
|
-
await (0, external_sourcemapTool_cjs_namespaceObject.handleAfterEmitAssets)(compilation, _this, sourceMapFilenameRegex, namespace);
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
compiler.hooks.emit.tapAsync({
|
|
71
|
-
...external_constants_cjs_namespaceObject.pluginTapPostOptions,
|
|
72
|
-
stage: external_constants_cjs_namespaceObject.pluginTapPostOptions.stage + 100
|
|
73
|
-
}, emitHandler.bind(null, _this, compiler));
|
|
74
|
-
};
|
|
75
|
-
async function doneHandler(_stats, _this, context, compiler) {
|
|
76
|
-
const stats = _stats;
|
|
77
|
-
const getStatsJson = (()=>{
|
|
78
|
-
let cached = null;
|
|
79
|
-
return ()=>{
|
|
80
|
-
if (cached) return cached;
|
|
81
|
-
cached = stats.toJson({
|
|
82
|
-
all: false,
|
|
83
|
-
chunks: true,
|
|
84
|
-
modules: true,
|
|
85
|
-
chunkModules: true,
|
|
86
|
-
assets: true,
|
|
87
|
-
ids: true,
|
|
88
|
-
hash: true,
|
|
89
|
-
errors: true,
|
|
90
|
-
warnings: true,
|
|
91
|
-
nestedModules: true,
|
|
92
|
-
cachedModules: true,
|
|
93
|
-
orphanModules: true,
|
|
94
|
-
runtimeModules: true,
|
|
95
|
-
optimizationBailout: true
|
|
96
|
-
});
|
|
97
|
-
return cached;
|
|
98
|
-
};
|
|
99
|
-
})();
|
|
100
|
-
logger_namespaceObject.logger.debug(`${(build_namespaceObject.Process.getMemoryUsageMessage(), '[Before Generate ModuleGraph]')}`);
|
|
101
|
-
if (!_this.chunkGraph?.getChunks().length) _this.chunkGraph = index_cjs_namespaceObject.Chunks.chunkTransform(new Map(), getStatsJson());
|
|
102
|
-
if (!_this.modulesGraph.getModules().length) _this.modulesGraph = await index_cjs_namespaceObject.ModuleGraph.getModuleGraphByStats(stats.compilation, getStatsJson(), process.cwd(), _this.chunkGraph, _this.options.features, context);
|
|
103
|
-
logger_namespaceObject.logger.debug(`${(build_namespaceObject.Process.getMemoryUsageMessage(), '[After Generate ModuleGraph]')}`);
|
|
104
|
-
if (_this.options.features.treeShaking) {
|
|
105
|
-
if ('rspackVersion' in compiler.webpack) logger_namespaceObject.logger.info(logger_namespaceObject.chalk.yellow('Rspack currently does not support treeShaking capabilities.'));
|
|
106
|
-
else {
|
|
107
|
-
_this.modulesGraph = index_cjs_namespaceObject.ModuleGraph.appendTreeShaking(_this.modulesGraph, stats.compilation) || _this.modulesGraph;
|
|
108
|
-
_this.sdk.addClientRoutes([
|
|
109
|
-
types_namespaceObject.Manifest.RsdoctorManifestClientRoutes.TreeShaking
|
|
110
|
-
]);
|
|
111
|
-
}
|
|
112
|
-
logger_namespaceObject.logger.debug(`${(build_namespaceObject.Process.getMemoryUsageMessage(), '[After AppendTreeShaking to ModuleGraph]')}`);
|
|
113
|
-
}
|
|
114
|
-
const shouldParseBundle = false !== _this.options.supports.parseBundle;
|
|
115
|
-
await getModulesInfos(compiler, _this.modulesGraph, _this.chunkGraph, shouldParseBundle, _this.sourceMapSets, _this.assetsWithoutSourceMap);
|
|
116
|
-
logger_namespaceObject.logger.debug(`${build_namespaceObject.Process.getMemoryUsageMessage()}, '[After Transform ModuleGraph]'`);
|
|
117
|
-
logger_namespaceObject.logger.debug('reportModuleGraph start');
|
|
118
|
-
if (_this.modulesGraph) await _this.sdk.reportModuleGraph(_this.modulesGraph);
|
|
119
|
-
logger_namespaceObject.logger.debug('reportModuleGraph done');
|
|
120
|
-
logger_namespaceObject.logger.debug('reportChunkGraph start');
|
|
121
|
-
await _this.sdk.reportChunkGraph(_this.chunkGraph);
|
|
122
|
-
logger_namespaceObject.logger.debug('reportChunkGraph done');
|
|
123
|
-
if (_this.options.supports.generateTileGraph) logger_namespaceObject.logger.warn(logger_namespaceObject.chalk.yellow('The option generateTileGraph is deprecated. Treemap (i.e. Tile Graph) is now supported by default.'));
|
|
124
|
-
logger_namespaceObject.logger.debug('doneHandler done');
|
|
125
|
-
}
|
|
126
|
-
const ensureDevtools = (compiler)=>{
|
|
127
|
-
const devtool = compiler.options.devtool;
|
|
128
|
-
if ('string' == typeof devtool && /eval/i.test(devtool)) {
|
|
129
|
-
if (!hasConsole) logger_namespaceObject.logger.warn('SourceMap with eval is not supported. Please use other sourcemap options.');
|
|
130
|
-
hasConsole = true;
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
if ('rspack' in compiler) return true;
|
|
134
|
-
const sourceMapEnabled = 'string' == typeof devtool && /source-?map/i.test(devtool);
|
|
135
|
-
if (!sourceMapEnabled) {
|
|
136
|
-
logger_namespaceObject.logger.debug('SourceMap is not enabled. Skipping sourcemap processing.');
|
|
137
|
-
return false;
|
|
138
|
-
}
|
|
139
|
-
return true;
|
|
140
|
-
};
|
|
141
|
-
async function getModulesInfos(compiler, moduleGraph, chunkGraph, parseBundle, sourceMapSets, assetsWithoutSourceMap) {
|
|
142
|
-
if (!moduleGraph) return;
|
|
143
|
-
try {
|
|
144
|
-
await index_cjs_namespaceObject.Chunks.getAssetsModulesData(moduleGraph, chunkGraph, compiler.outputPath, sourceMapSets, parseBundle, assetsWithoutSourceMap);
|
|
145
|
-
} catch {}
|
|
146
|
-
}
|
|
147
|
-
function escapeRegExp(str) {
|
|
148
|
-
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
149
|
-
}
|
|
150
|
-
function calculateNamespaceAndRegex(compiler) {
|
|
151
|
-
let namespace = compiler.options.output.devtoolNamespace || compiler.options.output.library?.name || '[^/]+/';
|
|
152
|
-
if (Array.isArray(namespace)) namespace = namespace[0];
|
|
153
|
-
else if ('object' == typeof namespace && 'name' in namespace) namespace = namespace.name;
|
|
154
|
-
const safeNamespace = escapeRegExp(namespace);
|
|
155
|
-
const sourceMapFilenameRegex = new RegExp(`(?:webpack://)?(?:${safeNamespace})?([^?]*)`);
|
|
156
|
-
return {
|
|
157
|
-
namespace: namespace,
|
|
158
|
-
sourceMapFilenameRegex
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
async function emitHandler(_this, compiler, compilation, callback) {
|
|
162
|
-
if (!ensureDevtools(compiler)) return void callback();
|
|
163
|
-
const { namespace, sourceMapFilenameRegex } = calculateNamespaceAndRegex(compiler);
|
|
164
|
-
await (0, external_sourcemapTool_cjs_namespaceObject.handleEmitAssets)({
|
|
165
|
-
compilation,
|
|
166
|
-
pluginInstance: _this,
|
|
167
|
-
sourceMapFilenameRegex,
|
|
168
|
-
namespace
|
|
169
|
-
});
|
|
170
|
-
callback();
|
|
171
|
-
}
|
|
172
|
-
exports.calculateNamespaceAndRegex = __webpack_exports__.calculateNamespaceAndRegex;
|
|
173
|
-
exports.ensureDevtools = __webpack_exports__.ensureDevtools;
|
|
174
|
-
exports.ensureModulesChunksGraphFn = __webpack_exports__.ensureModulesChunksGraphFn;
|
|
175
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
176
|
-
"calculateNamespaceAndRegex",
|
|
177
|
-
"ensureDevtools",
|
|
178
|
-
"ensureModulesChunksGraphFn"
|
|
179
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
180
|
-
Object.defineProperty(exports, '__esModule', {
|
|
181
|
-
value: true
|
|
182
|
-
});
|