@rsdoctor/core 2.0.0-alpha.0 → 2.0.0-alpha.2
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/26.js +26163 -0
- package/dist/630.js +1269 -0
- package/dist/630.js.LICENSE.txt +7 -0
- package/dist/build-utils/build/chunks/assetsModules.d.ts +8 -2
- package/dist/build-utils/build/chunks/index.d.ts +0 -1
- package/dist/build-utils/build/chunks/rspack/transform.d.ts +1 -1
- package/dist/build-utils/build/envinfo.d.ts +13 -0
- package/dist/build-utils/build/file/cache.d.ts +5 -0
- package/dist/build-utils/build/file/index.d.ts +3 -0
- package/dist/build-utils/build/file/sharding.d.ts +21 -0
- package/dist/build-utils/build/index.d.ts +5 -0
- package/dist/build-utils/build/json.d.ts +3 -0
- package/dist/build-utils/build/loader/probeLoader.d.ts +8 -3
- package/dist/build-utils/build/loader/probeLoaderPlugin.d.ts +1 -1
- package/dist/build-utils/build/module-graph/index.d.ts +0 -1
- package/dist/build-utils/build/module-graph/parser.d.ts +1 -1
- package/dist/build-utils/build/module-graph/rspack/transform.d.ts +1 -1
- package/dist/build-utils/build/module-graph/utils.d.ts +1 -1
- package/dist/build-utils/build/process.d.ts +2 -0
- package/dist/build-utils/build/server.d.ts +15 -0
- package/dist/build-utils/build/utils/loader.d.ts +2 -2
- package/dist/build-utils/build/utils/parseBundle.d.ts +1 -1
- package/dist/build-utils/build/utils/plugin.d.ts +1 -1
- package/dist/build-utils/index.d.ts +10 -0
- package/dist/common/file.d.ts +2 -0
- package/dist/common/global-config.d.ts +21 -0
- package/dist/error/error.d.ts +35 -0
- package/dist/error/index.d.ts +2 -0
- package/dist/error/transform.d.ts +3 -0
- package/dist/error/utils.d.ts +4 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +1725 -5
- package/dist/inner-plugins/constants.d.ts +1 -1
- package/dist/inner-plugins/loaders/proxy.d.ts +4 -4
- package/dist/inner-plugins/plugins/base.d.ts +3 -3
- package/dist/inner-plugins/plugins/bundle.d.ts +1 -1
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.ts +3 -3
- package/dist/inner-plugins/plugins/errors.d.ts +2 -2
- package/dist/inner-plugins/plugins/loader.d.ts +1 -1
- package/dist/inner-plugins/plugins/plugins.d.ts +1 -1
- package/dist/inner-plugins/plugins/progress.d.ts +2 -2
- package/dist/inner-plugins/plugins/resolver.d.ts +1 -1
- package/dist/inner-plugins/plugins/rspack.d.ts +8 -3
- package/dist/inner-plugins/plugins/rules.d.ts +1 -1
- package/dist/inner-plugins/plugins/sourcemapTool.d.ts +2 -2
- package/dist/inner-plugins/plugins/summary.d.ts +1 -1
- package/dist/inner-plugins/utils/config.d.ts +2 -3
- package/dist/inner-plugins/utils/loader.d.ts +4 -7
- package/dist/inner-plugins/utils/normalize-config.d.ts +1 -1
- package/dist/inner-plugins/utils/openBrowser.d.ts +1 -0
- package/dist/inner-plugins/utils/plugin.d.ts +1 -1
- package/dist/inner-plugins/utils/sdk.d.ts +2 -3
- package/dist/logger.d.ts +9 -0
- package/dist/probe-loader.js +2 -0
- package/dist/proxy-loader.d.ts +1 -0
- package/dist/proxy-loader.js +48 -0
- package/dist/rslib-runtime.js +18 -9
- package/dist/{inner-plugins/constants.d.cts → rspack-plugin/constants.d.ts} +4 -1
- package/dist/rspack-plugin/index.d.ts +2 -0
- package/dist/rspack-plugin/multiple.d.ts +8 -0
- package/dist/rspack-plugin/plugin.d.ts +25 -0
- package/dist/rule-utils/document/document.d.ts +16 -0
- package/dist/rule-utils/document/index.d.ts +3 -0
- package/dist/rule-utils/document/server.d.ts +4 -0
- package/dist/rule-utils/document/types.d.ts +31 -0
- package/dist/rule-utils/index.d.ts +2 -0
- package/dist/rule-utils/parser/asserts.d.ts +81 -0
- package/dist/rule-utils/parser/index.d.ts +4 -0
- package/dist/rule-utils/parser/parser.d.ts +118 -0
- package/dist/rule-utils/parser/types.d.ts +30 -0
- package/dist/rule-utils/parser/utils.d.ts +30 -0
- package/dist/rules/linter.d.ts +1 -1
- package/dist/rules/rule.d.ts +2 -2
- package/dist/rules/rules/cjs-require/index.d.ts +1 -1
- package/dist/rules/rules/cross-chunks-package/index.d.ts +1 -1
- package/dist/rules/rules/default-import-check/index.d.ts +1 -1
- package/dist/rules/rules/default-import-check/utils.d.ts +2 -2
- package/dist/rules/rules/duplicate-package/index.d.ts +3 -3
- package/dist/rules/rules/duplicate-package/utils.d.ts +1 -1
- package/dist/rules/rules/ecma-version-check/htmlParserStub.d.ts +3 -0
- package/dist/rules/rules/ecma-version-check/index.d.ts +3 -2
- package/dist/rules/rules/ecma-version-check/types.d.ts +13 -3
- 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/index.d.ts +1 -1
- package/dist/rules/rules/loader-performance-optimization/index.d.ts +1 -1
- 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/side-effects-only-imports/index.d.ts +1 -1
- package/dist/rules/utils.d.ts +1 -1
- package/dist/sdk/index.d.ts +2 -0
- package/dist/sdk/multiple/controller.d.ts +12 -0
- package/dist/sdk/multiple/index.d.ts +2 -0
- package/dist/sdk/multiple/primary.d.ts +32 -0
- package/dist/sdk/multiple/server.d.ts +7 -0
- package/dist/sdk/sdk/core.d.ts +33 -0
- package/dist/sdk/sdk/index.d.ts +52 -0
- package/dist/sdk/sdk/types.d.ts +26 -0
- package/dist/sdk/server/apis/alerts.d.ts +5 -0
- package/dist/sdk/server/apis/base.d.ts +11 -0
- package/dist/sdk/server/apis/bundle-diff.d.ts +6 -0
- package/dist/sdk/server/apis/data.d.ts +6 -0
- package/dist/sdk/server/apis/fs.d.ts +5 -0
- package/dist/sdk/server/apis/graph.d.ts +12 -0
- package/dist/sdk/server/apis/index.d.ts +10 -0
- package/dist/sdk/server/apis/loader.d.ts +15 -0
- package/dist/sdk/server/apis/plugin.d.ts +6 -0
- package/dist/sdk/server/apis/project.d.ts +8 -0
- package/dist/sdk/server/apis/renderer.d.ts +6 -0
- package/dist/sdk/server/apis/resolver.d.ts +6 -0
- package/dist/sdk/server/client.d.ts +3 -0
- package/dist/sdk/server/fakeServer.d.ts +9 -0
- package/dist/sdk/server/index.d.ts +44 -0
- package/dist/sdk/server/json-body.d.ts +6 -0
- package/dist/sdk/server/router.d.ts +24 -0
- package/dist/sdk/server/security.d.ts +5 -0
- package/dist/sdk/server/socket/api.d.ts +15 -0
- package/dist/sdk/server/socket/index.d.ts +48 -0
- package/dist/sdk/server/utils.d.ts +6 -0
- package/dist/sdk/utils/base.d.ts +1 -0
- package/dist/sdk/utils/constant.d.ts +1 -0
- package/dist/sdk/utils/date.d.ts +1 -0
- package/dist/sdk/utils/index.d.ts +3 -0
- package/dist/sdk/utils/openBrowser.d.ts +4 -0
- package/dist/sdk/utils/upload.d.ts +2 -0
- package/dist/sdk.d.ts +1 -0
- package/dist/types/index.d.ts +0 -1
- package/dist/types/loader.d.ts +1 -1
- package/dist/types/plugin.d.ts +7 -28
- package/package.json +56 -80
- package/static/openChrome.applescript +95 -0
- package/dist/build-utils/build/chunks/assetsModules.cjs +0 -42
- package/dist/build-utils/build/chunks/assetsModules.d.cts +0 -17
- package/dist/build-utils/build/chunks/assetsModules.js +0 -9
- package/dist/build-utils/build/chunks/chunkTransform.cjs +0 -39
- package/dist/build-utils/build/chunks/chunkTransform.d.cts +0 -4
- package/dist/build-utils/build/chunks/chunkTransform.d.ts +0 -4
- package/dist/build-utils/build/chunks/chunkTransform.js +0 -6
- package/dist/build-utils/build/chunks/index.cjs +0 -72
- package/dist/build-utils/build/chunks/index.d.cts +0 -3
- package/dist/build-utils/build/chunks/index.js +0 -4
- package/dist/build-utils/build/chunks/rspack/transform.cjs +0 -80
- package/dist/build-utils/build/chunks/rspack/transform.d.cts +0 -13
- package/dist/build-utils/build/chunks/rspack/transform.js +0 -44
- package/dist/build-utils/build/index.cjs +0 -52
- package/dist/build-utils/build/index.d.cts +0 -5
- package/dist/build-utils/build/index.js +0 -7
- package/dist/build-utils/build/loader/index.cjs +0 -65
- package/dist/build-utils/build/loader/index.d.cts +0 -2
- package/dist/build-utils/build/loader/index.js +0 -3
- package/dist/build-utils/build/loader/probeLoader.cjs +0 -89
- package/dist/build-utils/build/loader/probeLoader.d.cts +0 -4
- package/dist/build-utils/build/loader/probeLoader.js +0 -44
- package/dist/build-utils/build/loader/probeLoaderPlugin.cjs +0 -65
- package/dist/build-utils/build/loader/probeLoaderPlugin.d.cts +0 -5
- package/dist/build-utils/build/loader/probeLoaderPlugin.js +0 -32
- package/dist/build-utils/build/module-graph/index.cjs +0 -65
- package/dist/build-utils/build/module-graph/index.d.cts +0 -2
- package/dist/build-utils/build/module-graph/index.js +0 -3
- package/dist/build-utils/build/module-graph/parser.cjs +0 -46
- package/dist/build-utils/build/module-graph/parser.d.cts +0 -2
- package/dist/build-utils/build/module-graph/parser.js +0 -13
- package/dist/build-utils/build/module-graph/rspack/transform.cjs +0 -151
- package/dist/build-utils/build/module-graph/rspack/transform.d.cts +0 -26
- package/dist/build-utils/build/module-graph/rspack/transform.js +0 -109
- package/dist/build-utils/build/module-graph/transform.cjs +0 -39
- package/dist/build-utils/build/module-graph/transform.d.cts +0 -3
- package/dist/build-utils/build/module-graph/transform.d.ts +0 -3
- package/dist/build-utils/build/module-graph/transform.js +0 -6
- package/dist/build-utils/build/module-graph/utils.cjs +0 -95
- package/dist/build-utils/build/module-graph/utils.d.cts +0 -3
- package/dist/build-utils/build/module-graph/utils.js +0 -59
- package/dist/build-utils/build/utils/index.cjs +0 -72
- package/dist/build-utils/build/utils/index.d.cts +0 -3
- package/dist/build-utils/build/utils/index.js +0 -4
- package/dist/build-utils/build/utils/loader.cjs +0 -354
- package/dist/build-utils/build/utils/loader.d.cts +0 -20
- package/dist/build-utils/build/utils/loader.js +0 -276
- package/dist/build-utils/build/utils/parseBundle.cjs +0 -283
- package/dist/build-utils/build/utils/parseBundle.d.cts +0 -12
- package/dist/build-utils/build/utils/parseBundle.js +0 -240
- package/dist/build-utils/build/utils/plugin.cjs +0 -60
- package/dist/build-utils/build/utils/plugin.d.cts +0 -5
- package/dist/build-utils/build/utils/plugin.js +0 -21
- package/dist/build-utils/index.cjs +0 -36
- package/dist/build-utils/index.d.cts +0 -1
- package/dist/build-utils/index.js +0 -3
- package/dist/index.cjs +0 -81
- package/dist/index.d.cts +0 -3
- package/dist/inner-plugins/constants.cjs +0 -64
- package/dist/inner-plugins/constants.js +0 -19
- package/dist/inner-plugins/index.cjs +0 -65
- package/dist/inner-plugins/index.d.cts +0 -2
- package/dist/inner-plugins/index.js +0 -3
- package/dist/inner-plugins/loaders/proxy.cjs +0 -104
- package/dist/inner-plugins/loaders/proxy.d.cts +0 -7
- package/dist/inner-plugins/loaders/proxy.js +0 -65
- package/dist/inner-plugins/plugins/base.cjs +0 -53
- package/dist/inner-plugins/plugins/base.d.cts +0 -12
- package/dist/inner-plugins/plugins/base.js +0 -20
- package/dist/inner-plugins/plugins/bundle.cjs +0 -96
- package/dist/inner-plugins/plugins/bundle.d.cts +0 -15
- package/dist/inner-plugins/plugins/bundle.js +0 -63
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.cjs +0 -141
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.cts +0 -34
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.js +0 -102
- package/dist/inner-plugins/plugins/errors.cjs +0 -98
- package/dist/inner-plugins/plugins/errors.d.cts +0 -11
- package/dist/inner-plugins/plugins/errors.js +0 -65
- package/dist/inner-plugins/plugins/index.cjs +0 -121
- package/dist/inner-plugins/plugins/index.d.cts +0 -10
- package/dist/inner-plugins/plugins/index.js +0 -11
- package/dist/inner-plugins/plugins/loader.cjs +0 -165
- package/dist/inner-plugins/plugins/loader.d.cts +0 -10
- package/dist/inner-plugins/plugins/loader.js +0 -120
- package/dist/inner-plugins/plugins/plugins.cjs +0 -73
- package/dist/inner-plugins/plugins/plugins.d.cts +0 -8
- package/dist/inner-plugins/plugins/plugins.js +0 -40
- package/dist/inner-plugins/plugins/progress.cjs +0 -68
- package/dist/inner-plugins/plugins/progress.d.cts +0 -8
- package/dist/inner-plugins/plugins/progress.js +0 -35
- package/dist/inner-plugins/plugins/resolver.cjs +0 -90
- package/dist/inner-plugins/plugins/resolver.d.cts +0 -12
- package/dist/inner-plugins/plugins/resolver.js +0 -57
- package/dist/inner-plugins/plugins/rspack.cjs +0 -118
- package/dist/inner-plugins/plugins/rspack.d.cts +0 -4
- package/dist/inner-plugins/plugins/rspack.js +0 -85
- package/dist/inner-plugins/plugins/rules.cjs +0 -97
- package/dist/inner-plugins/plugins/rules.d.cts +0 -8
- package/dist/inner-plugins/plugins/rules.js +0 -64
- package/dist/inner-plugins/plugins/sourcemapTool.cjs +0 -275
- package/dist/inner-plugins/plugins/sourcemapTool.d.cts +0 -52
- package/dist/inner-plugins/plugins/sourcemapTool.js +0 -230
- package/dist/inner-plugins/plugins/summary.cjs +0 -125
- package/dist/inner-plugins/plugins/summary.d.cts +0 -14
- package/dist/inner-plugins/plugins/summary.js +0 -92
- package/dist/inner-plugins/utils/circleDetect.cjs +0 -49
- package/dist/inner-plugins/utils/circleDetect.d.cts +0 -4
- package/dist/inner-plugins/utils/circleDetect.js +0 -16
- package/dist/inner-plugins/utils/config.cjs +0 -191
- package/dist/inner-plugins/utils/config.d.cts +0 -5
- package/dist/inner-plugins/utils/config.js +0 -142
- package/dist/inner-plugins/utils/index.cjs +0 -106
- package/dist/inner-plugins/utils/index.d.cts +0 -9
- package/dist/inner-plugins/utils/index.js +0 -8
- package/dist/inner-plugins/utils/loader.cjs +0 -218
- package/dist/inner-plugins/utils/loader.d.cts +0 -13
- package/dist/inner-plugins/utils/loader.js +0 -160
- package/dist/inner-plugins/utils/normalize-config.cjs +0 -122
- package/dist/inner-plugins/utils/normalize-config.d.cts +0 -37
- package/dist/inner-plugins/utils/normalize-config.js +0 -77
- package/dist/inner-plugins/utils/plugin-common.cjs +0 -143
- package/dist/inner-plugins/utils/plugin-common.d.cts +0 -11
- package/dist/inner-plugins/utils/plugin-common.js +0 -94
- package/dist/inner-plugins/utils/plugin.cjs +0 -106
- package/dist/inner-plugins/utils/plugin.d.cts +0 -4
- package/dist/inner-plugins/utils/plugin.js +0 -70
- package/dist/inner-plugins/utils/sdk.cjs +0 -55
- package/dist/inner-plugins/utils/sdk.d.cts +0 -8
- package/dist/inner-plugins/utils/sdk.js +0 -19
- package/dist/rules/index.cjs +0 -81
- package/dist/rules/index.d.cts +0 -3
- package/dist/rules/index.js +0 -4
- package/dist/rules/linter.cjs +0 -72
- package/dist/rules/linter.d.cts +0 -9
- package/dist/rules/linter.js +0 -36
- package/dist/rules/rule.cjs +0 -137
- package/dist/rules/rule.d.cts +0 -27
- package/dist/rules/rule.js +0 -101
- package/dist/rules/rules/cjs-require/index.cjs +0 -83
- package/dist/rules/rules/cjs-require/index.d.cts +0 -4
- package/dist/rules/rules/cjs-require/index.js +0 -50
- 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/cjs-require/types.js +0 -1
- package/dist/rules/rules/cross-chunks-package/index.cjs +0 -74
- package/dist/rules/rules/cross-chunks-package/index.d.cts +0 -4
- package/dist/rules/rules/cross-chunks-package/index.js +0 -41
- 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/types.js +0 -1
- package/dist/rules/rules/cross-chunks-package/utils.cjs +0 -40
- package/dist/rules/rules/cross-chunks-package/utils.d.cts +0 -1
- package/dist/rules/rules/cross-chunks-package/utils.js +0 -7
- package/dist/rules/rules/default-import-check/index.cjs +0 -116
- package/dist/rules/rules/default-import-check/index.d.cts +0 -4
- package/dist/rules/rules/default-import-check/index.js +0 -83
- 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/types.js +0 -1
- package/dist/rules/rules/default-import-check/utils.cjs +0 -97
- package/dist/rules/rules/default-import-check/utils.d.cts +0 -10
- package/dist/rules/rules/default-import-check/utils.js +0 -52
- package/dist/rules/rules/duplicate-package/index.cjs +0 -72
- package/dist/rules/rules/duplicate-package/index.d.cts +0 -4
- package/dist/rules/rules/duplicate-package/index.js +0 -39
- package/dist/rules/rules/duplicate-package/types.cjs +0 -60
- package/dist/rules/rules/duplicate-package/types.d.cts +0 -24
- package/dist/rules/rules/duplicate-package/types.js +0 -24
- package/dist/rules/rules/duplicate-package/utils.cjs +0 -84
- package/dist/rules/rules/duplicate-package/utils.d.cts +0 -3
- package/dist/rules/rules/duplicate-package/utils.js +0 -38
- package/dist/rules/rules/ecma-version-check/index.cjs +0 -96
- package/dist/rules/rules/ecma-version-check/index.d.cts +0 -4
- package/dist/rules/rules/ecma-version-check/index.js +0 -53
- 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/types.js +0 -1
- package/dist/rules/rules/ecma-version-check/utils.cjs +0 -39
- package/dist/rules/rules/ecma-version-check/utils.d.cts +0 -2
- package/dist/rules/rules/ecma-version-check/utils.js +0 -6
- package/dist/rules/rules/esm-resolved-to-cjs/index.cjs +0 -237
- package/dist/rules/rules/esm-resolved-to-cjs/index.d.cts +0 -4
- package/dist/rules/rules/esm-resolved-to-cjs/index.js +0 -193
- 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/esm-resolved-to-cjs/types.js +0 -1
- package/dist/rules/rules/index.cjs +0 -55
- package/dist/rules/rules/index.d.cts +0 -2
- package/dist/rules/rules/index.js +0 -22
- package/dist/rules/rules/loader-performance-optimization/index.cjs +0 -119
- package/dist/rules/rules/loader-performance-optimization/index.d.cts +0 -4
- package/dist/rules/rules/loader-performance-optimization/index.js +0 -86
- 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/types.js +0 -1
- package/dist/rules/rules/loader-performance-optimization/utils.cjs +0 -43
- package/dist/rules/rules/loader-performance-optimization/utils.d.cts +0 -1
- package/dist/rules/rules/loader-performance-optimization/utils.js +0 -10
- package/dist/rules/rules/module-mixed-chunks/index.cjs +0 -85
- package/dist/rules/rules/module-mixed-chunks/index.d.cts +0 -4
- package/dist/rules/rules/module-mixed-chunks/index.js +0 -52
- 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/module-mixed-chunks/types.js +0 -1
- package/dist/rules/rules/side-effects-only-imports/index.cjs +0 -114
- package/dist/rules/rules/side-effects-only-imports/index.d.cts +0 -4
- package/dist/rules/rules/side-effects-only-imports/index.js +0 -81
- 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/rules/side-effects-only-imports/types.js +0 -1
- package/dist/rules/utils.cjs +0 -46
- package/dist/rules/utils.d.cts +0 -3
- package/dist/rules/utils.js +0 -10
- 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/chunks.js +0 -1
- package/dist/types/index.cjs +0 -79
- package/dist/types/index.d.cts +0 -4
- package/dist/types/index.js +0 -5
- package/dist/types/loader.cjs +0 -18
- package/dist/types/loader.d.cts +0 -19
- package/dist/types/loader.js +0 -1
- package/dist/types/plugin.cjs +0 -18
- package/dist/types/plugin.d.cts +0 -51
- package/dist/types/plugin.js +0 -1
- package/dist/types/rules.cjs +0 -18
- package/dist/types/rules.d.cts +0 -7
- package/dist/types/rules.js +0 -1
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Parser as AcornParser, Options, Position } from 'acorn';
|
|
2
|
+
import * as walk from 'acorn-walk';
|
|
3
|
+
import * as utils from './utils.js';
|
|
4
|
+
import type { Node } from './types.js';
|
|
5
|
+
export type { Options as ParseOptions } from 'acorn';
|
|
6
|
+
export interface ParseError extends Error {
|
|
7
|
+
loc?: Position;
|
|
8
|
+
pos: number;
|
|
9
|
+
raisedAt: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const parser: {
|
|
12
|
+
/** AST iterator */
|
|
13
|
+
walk: typeof walk;
|
|
14
|
+
/**
|
|
15
|
+
* Compile code
|
|
16
|
+
* - Output root node is `Node.Program`
|
|
17
|
+
*/
|
|
18
|
+
parse: (input: string, options: Options) => Node.Program;
|
|
19
|
+
/**
|
|
20
|
+
* Compile the next first expression
|
|
21
|
+
* - The output root node is `Node.ExpressionStatement`
|
|
22
|
+
*/
|
|
23
|
+
parseExpressionAt: (input: string, pos: number, options: Options) => Node.ExpressionStatement;
|
|
24
|
+
/**
|
|
25
|
+
* add plugins for acorn
|
|
26
|
+
*/
|
|
27
|
+
extend(...args: Parameters<typeof AcornParser.extend>): typeof AcornParser;
|
|
28
|
+
/** Set of assertions */
|
|
29
|
+
asserts: {
|
|
30
|
+
readonly isProgram: (node: unknown) => node is Node.Program;
|
|
31
|
+
readonly isEmptyStatement: (node: unknown) => node is Node.EmptyStatement;
|
|
32
|
+
readonly isBlockStatement: (node: unknown) => node is Node.BlockStatement;
|
|
33
|
+
readonly isStaticBlock: (node: unknown) => node is Node.StaticBlock;
|
|
34
|
+
readonly isExpressionStatement: (node: unknown) => node is Node.ExpressionStatement;
|
|
35
|
+
readonly isIfStatement: (node: unknown) => node is Node.IfStatement;
|
|
36
|
+
readonly isLabeledStatement: (node: unknown) => node is Node.LabeledStatement;
|
|
37
|
+
readonly isBreakStatement: (node: unknown) => node is Node.BreakStatement;
|
|
38
|
+
readonly isContinueStatement: (node: unknown) => node is Node.ContinueStatement;
|
|
39
|
+
readonly isWithStatement: (node: unknown) => node is Node.WithStatement;
|
|
40
|
+
readonly isSwitchStatement: (node: unknown) => node is Node.SwitchStatement;
|
|
41
|
+
readonly isReturnStatement: (node: unknown) => node is Node.ReturnStatement;
|
|
42
|
+
readonly isThrowStatement: (node: unknown) => node is Node.ThrowStatement;
|
|
43
|
+
readonly isTryStatement: (node: unknown) => node is Node.TryStatement;
|
|
44
|
+
readonly isWhileStatement: (node: unknown) => node is Node.WhileStatement;
|
|
45
|
+
readonly isDoWhileStatement: (node: unknown) => node is Node.DoWhileStatement;
|
|
46
|
+
readonly isForStatement: (node: unknown) => node is Node.ForStatement;
|
|
47
|
+
readonly isForInStatement: (node: unknown) => node is Node.ForInStatement;
|
|
48
|
+
readonly isForOfStatement: (node: unknown) => node is Node.ForOfStatement;
|
|
49
|
+
readonly isDebuggerStatement: (node: unknown) => node is Node.DebuggerStatement;
|
|
50
|
+
readonly isFunctionDeclaration: (node: unknown) => node is Node.FunctionDeclaration;
|
|
51
|
+
readonly isVariableDeclaration: (node: unknown) => node is Node.VariableDeclaration;
|
|
52
|
+
readonly isVariableDeclarator: (node: unknown) => node is Node.VariableDeclarator;
|
|
53
|
+
readonly isChainExpression: (node: unknown) => node is Node.ChainExpression;
|
|
54
|
+
readonly isThisExpression: (node: unknown) => node is Node.ThisExpression;
|
|
55
|
+
readonly isArrayExpression: (node: unknown) => node is Node.ArrayExpression;
|
|
56
|
+
readonly isObjectExpression: (node: unknown) => node is Node.ObjectExpression;
|
|
57
|
+
readonly isPrivateIdentifier: (node: unknown) => node is Node.PrivateIdentifier;
|
|
58
|
+
readonly isProperty: (node: unknown) => node is Node.Property;
|
|
59
|
+
readonly isPropertyDefinition: (node: unknown) => node is Node.PropertyDefinition;
|
|
60
|
+
readonly isFunctionExpression: (node: unknown) => node is Node.FunctionExpression;
|
|
61
|
+
readonly isSequenceExpression: (node: unknown) => node is Node.SequenceExpression;
|
|
62
|
+
readonly isUnaryExpression: (node: unknown) => node is Node.UnaryExpression;
|
|
63
|
+
readonly isBinaryExpression: (node: unknown) => node is Node.BinaryExpression;
|
|
64
|
+
readonly isAssignmentExpression: (node: unknown) => node is Node.AssignmentExpression;
|
|
65
|
+
readonly isUpdateExpression: (node: unknown) => node is Node.UpdateExpression;
|
|
66
|
+
readonly isLogicalExpression: (node: unknown) => node is Node.LogicalExpression;
|
|
67
|
+
readonly isConditionalExpression: (node: unknown) => node is Node.ConditionalExpression;
|
|
68
|
+
readonly isNewExpression: (node: unknown) => node is Node.NewExpression;
|
|
69
|
+
readonly isSwitchCase: (node: unknown) => node is Node.SwitchCase;
|
|
70
|
+
readonly isCatchClause: (node: unknown) => node is Node.CatchClause;
|
|
71
|
+
readonly isIdentifier: (node: unknown) => node is Node.Identifier;
|
|
72
|
+
readonly isLiteral: (node: unknown) => node is Node.Literal;
|
|
73
|
+
readonly isSuper: (node: unknown) => node is Node.Super;
|
|
74
|
+
readonly isSpreadElement: (node: unknown) => node is Node.SpreadElement;
|
|
75
|
+
readonly isArrowFunctionExpression: (node: unknown) => node is Node.ArrowFunctionExpression;
|
|
76
|
+
readonly isYieldExpression: (node: unknown) => node is Node.YieldExpression;
|
|
77
|
+
readonly isTemplateLiteral: (node: unknown) => node is Node.TemplateLiteral;
|
|
78
|
+
readonly isTaggedTemplateExpression: (node: unknown) => node is Node.TaggedTemplateExpression;
|
|
79
|
+
readonly isTemplateElement: (node: unknown) => node is Node.TemplateElement;
|
|
80
|
+
readonly isObjectPattern: (node: unknown) => node is Node.ObjectPattern;
|
|
81
|
+
readonly isArrayPattern: (node: unknown) => node is Node.ArrayPattern;
|
|
82
|
+
readonly isRestElement: (node: unknown) => node is Node.RestElement;
|
|
83
|
+
readonly isAssignmentPattern: (node: unknown) => node is Node.AssignmentPattern;
|
|
84
|
+
readonly isClassBody: (node: unknown) => node is Node.ClassBody;
|
|
85
|
+
readonly isClassDeclaration: (node: unknown) => node is Node.ClassDeclaration;
|
|
86
|
+
readonly isClassExpression: (node: unknown) => node is Node.ClassExpression;
|
|
87
|
+
readonly isMetaProperty: (node: unknown) => node is Node.MetaProperty;
|
|
88
|
+
readonly isImportDeclaration: (node: unknown) => node is Node.ImportDeclaration;
|
|
89
|
+
readonly isImportSpecifier: (node: unknown) => node is Node.ImportSpecifier;
|
|
90
|
+
readonly isImportExpression: (node: unknown) => node is Node.ImportExpression;
|
|
91
|
+
readonly isImportDefaultSpecifier: (node: unknown) => node is Node.ImportDefaultSpecifier;
|
|
92
|
+
readonly isImportNamespaceSpecifier: (node: unknown) => node is Node.ImportNamespaceSpecifier;
|
|
93
|
+
readonly isExportNamedDeclaration: (node: unknown) => node is Node.ExportNamedDeclaration;
|
|
94
|
+
readonly isExportSpecifier: (node: unknown) => node is Node.ExportSpecifier;
|
|
95
|
+
readonly isExportDefaultDeclaration: (node: unknown) => node is Node.ExportDefaultDeclaration;
|
|
96
|
+
readonly isExportAllDeclaration: (node: unknown) => node is Node.ExportAllDeclaration;
|
|
97
|
+
readonly isAwaitExpression: (node: unknown) => node is Node.AwaitExpression;
|
|
98
|
+
readonly isMethodDefinition: (node: unknown) => node is Node.MethodDefinition;
|
|
99
|
+
readonly isMemberExpression: (node: unknown) => node is Node.MemberExpression;
|
|
100
|
+
readonly isComment: (node: unknown) => node is Node.Comment;
|
|
101
|
+
readonly isDirective: (node: unknown) => node is Node.Directive;
|
|
102
|
+
readonly isSimpleCallExpression: (node: unknown) => node is Node.SimpleCallExpression;
|
|
103
|
+
readonly isAssignmentProperty: (node: unknown) => node is Node.AssignmentProperty;
|
|
104
|
+
readonly isSimpleLiteral: (node: unknown) => node is Node.SimpleLiteral;
|
|
105
|
+
readonly isRegExpLiteral: (node: unknown) => node is Node.RegExpLiteral;
|
|
106
|
+
readonly isBigIntLiteral: (node: unknown) => node is Node.BigIntLiteral;
|
|
107
|
+
readonly isExportStatement: (node: unknown) => node is Node.ExportStatement;
|
|
108
|
+
};
|
|
109
|
+
utils: typeof utils;
|
|
110
|
+
/**
|
|
111
|
+
* @internal
|
|
112
|
+
* parser for internal packages
|
|
113
|
+
*/
|
|
114
|
+
internal: {
|
|
115
|
+
parse: (input: string, options: Options) => Node.Program;
|
|
116
|
+
parseExpressionAt: (input: string, pos: number, options: Options) => Node.ExpressionStatement;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type * as Node from 'estree';
|
|
2
|
+
export type { Node };
|
|
3
|
+
export declare enum ECMAVersion {
|
|
4
|
+
ES5 = "ES5",
|
|
5
|
+
ES6 = "ES6",
|
|
6
|
+
ES7P = "ES7+"
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* estree supplement type
|
|
10
|
+
* Mainly to match the node type of acorn
|
|
11
|
+
* The main reason for not using the type of acorn directly is that the node type described by acorn itself is too simple
|
|
12
|
+
*/
|
|
13
|
+
declare module 'estree' {
|
|
14
|
+
interface BaseNode {
|
|
15
|
+
start: number;
|
|
16
|
+
end: number;
|
|
17
|
+
loc?: SourceLocation | undefined;
|
|
18
|
+
}
|
|
19
|
+
interface Position {
|
|
20
|
+
offset: number;
|
|
21
|
+
}
|
|
22
|
+
/** all syntax nodes */
|
|
23
|
+
type SyntaxNode = Node.Comment | Node.Program | Node.Directive | Node.EmptyStatement | Node.BlockStatement | Node.StaticBlock | Node.ExpressionStatement | Node.IfStatement | Node.LabeledStatement | Node.BreakStatement | Node.ContinueStatement | Node.WithStatement | Node.SwitchStatement | Node.ReturnStatement | Node.ThrowStatement | Node.TryStatement | Node.WhileStatement | Node.DoWhileStatement | Node.ForStatement | Node.ForInStatement | Node.DebuggerStatement | Node.FunctionDeclaration | Node.VariableDeclaration | Node.VariableDeclarator | Node.ChainExpression | Node.ThisExpression | Node.ArrayExpression | Node.ObjectExpression | Node.PrivateIdentifier | Node.Property | Node.PropertyDefinition | Node.FunctionExpression | Node.SequenceExpression | Node.UnaryExpression | Node.BinaryExpression | Node.AssignmentExpression | Node.UpdateExpression | Node.LogicalExpression | Node.ConditionalExpression | Node.SimpleCallExpression | Node.NewExpression | Node.MemberExpression | Node.SwitchCase | Node.CatchClause | Node.Identifier | Node.SimpleLiteral | Node.RegExpLiteral | Node.BigIntLiteral | Node.ForOfStatement | Node.Super | Node.SpreadElement | Node.ArrowFunctionExpression | Node.YieldExpression | Node.TemplateLiteral | Node.TaggedTemplateExpression | Node.TemplateElement | Node.AssignmentProperty | Node.ObjectPattern | Node.ArrayPattern | Node.RestElement | Node.AssignmentPattern | Node.ClassBody | Node.MethodDefinition | Node.ClassDeclaration | Node.ClassExpression | Node.MetaProperty | Node.ImportDeclaration | Node.ImportSpecifier | Node.ImportExpression | Node.ImportDefaultSpecifier | Node.ImportNamespaceSpecifier | Node.ExportNamedDeclaration | Node.ExportSpecifier | Node.ExportDefaultDeclaration | Node.ExportAllDeclaration | Node.AwaitExpression;
|
|
24
|
+
/** all operators */
|
|
25
|
+
type SyntaxOperator = Node.UnaryOperator | Node.BinaryOperator | Node.LogicalOperator | Node.AssignmentOperator | Node.UpdateOperator;
|
|
26
|
+
/** Block-scoped statement */
|
|
27
|
+
type BlockScopeStatement = Node.StaticBlock | Node.BlockStatement | Node.ForInStatement | Node.ForOfStatement | Node.ForStatement | Node.CatchClause | Node.SwitchStatement;
|
|
28
|
+
/** Export statement */
|
|
29
|
+
type ExportStatement = Node.ExportAllDeclaration | Node.ExportDefaultDeclaration | Node.ExportNamedDeclaration;
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ecmaVersion } from 'acorn';
|
|
2
|
+
import { Node, ECMAVersion } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Is the node semantics the same?
|
|
5
|
+
* @deprecated
|
|
6
|
+
* - Recursively compare whether the content of the node itself is the same
|
|
7
|
+
* - Ignore comments, positions, string symbols (single and double quotation marks)
|
|
8
|
+
* - String templates and string addition will be considered different
|
|
9
|
+
*/
|
|
10
|
+
export declare function isSameSemantics(node1: Node.SyntaxNode, node2: Node.SyntaxNode): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Get all default reference statements
|
|
13
|
+
*/
|
|
14
|
+
export declare function getDefaultImports(node: Node.Program): Node.ImportDeclaration[];
|
|
15
|
+
/** Get the literal in the text. */
|
|
16
|
+
export declare function getIdentifierInPattern(name: string, node: Node.Pattern): Node.Identifier | undefined;
|
|
17
|
+
/** Get the variable declaration statement identifier. */
|
|
18
|
+
export declare function getIdentifierInDeclaration(name: string, node: Node.SyntaxNode): Node.Identifier | undefined;
|
|
19
|
+
/** Get the reference declaration statement identifier. */
|
|
20
|
+
export declare function getIdentifierInImport(name: string, node: Node.SyntaxNode): Node.Identifier | undefined;
|
|
21
|
+
/** Get the export statement identifier. */
|
|
22
|
+
export declare function getIdentifierInExport(name: string, node: Node.SyntaxNode): Node.Identifier | undefined;
|
|
23
|
+
/** Determine that it can be resolved using the specified ECMA version */
|
|
24
|
+
export declare function canParse(code: string, ecmaVersion: ecmaVersion): boolean;
|
|
25
|
+
/** Determine whether it is all ES5 version code. */
|
|
26
|
+
export declare function isES5(code: string): boolean;
|
|
27
|
+
/** Determine whether it is all ES6 version code. */
|
|
28
|
+
export declare function isES6(code: string): boolean;
|
|
29
|
+
/** Detect ECMA version. */
|
|
30
|
+
export declare function detectECMAVersion(code: string): ECMAVersion;
|
package/dist/rules/linter.d.ts
CHANGED
package/dist/rules/rule.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Linter, SDK, Rule as RuleTypes } from '@rsdoctor/types';
|
|
1
|
+
import { Linter, SDK, Rule as RuleTypes } from '@rsdoctor/shared/types';
|
|
2
2
|
import { LinterType } from './linter.js';
|
|
3
3
|
type DefaultRuleConfig = Linter.DefaultRuleConfig;
|
|
4
4
|
export declare class Rule<Config = DefaultRuleConfig> implements Linter.RuleMeta<Config> {
|
|
@@ -16,7 +16,7 @@ export declare class Rule<Config = DefaultRuleConfig> implements Linter.RuleMeta
|
|
|
16
16
|
get title(): string;
|
|
17
17
|
get severity(): Linter.Severity;
|
|
18
18
|
get config(): Config | undefined;
|
|
19
|
-
get category(): "compile" | "
|
|
19
|
+
get category(): "bundle" | "compile" | "emo" | RuleTypes.RuleMessageCategory;
|
|
20
20
|
setOption(opt: Linter.RuleConfigItem): void;
|
|
21
21
|
match(level: Linter.Severity): boolean;
|
|
22
22
|
validate(context: SDK.RuntimeContext): Promise<Linter.ValidateResult>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Node, Range } from '
|
|
2
|
-
import type { SDK, Linter } from '@rsdoctor/types';
|
|
1
|
+
import { Node, Range } from '../../../rule-utils/index.js';
|
|
2
|
+
import type { SDK, Linter } from '@rsdoctor/shared/types';
|
|
3
3
|
export declare function getDefaultImportByRequest(node: Node.Program, request: string): Node.ImportDeclaration | undefined;
|
|
4
4
|
/**
|
|
5
5
|
* Determine that it contains the same left value assignment expression in the enumeration.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Linter } from '@rsdoctor/types';
|
|
2
|
-
import
|
|
1
|
+
import { Linter } from '@rsdoctor/shared/types';
|
|
2
|
+
import type { Config } from './types.js';
|
|
3
3
|
export type { Config, CheckVersion } from './types.js';
|
|
4
|
-
export declare const rule: Linter.RuleData<
|
|
4
|
+
export declare const rule: Linter.RuleData<Config, "duplicate-package">;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { SDK, Rule } from '@rsdoctor/types';
|
|
1
|
+
import type { SDK, Rule } from '@rsdoctor/shared/types';
|
|
2
2
|
export declare function getErrorMsg(packages: SDK.PackageInstance[], root: string): string;
|
|
3
3
|
export declare function getErrorDetail(pkg: SDK.PackageInstance, pkgGraph: SDK.PackageGraphInstance): Rule.PackageRelationData;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Config } from './types.js';
|
|
2
|
-
import { Linter } from '@rsdoctor/types';
|
|
2
|
+
import { Linter } from '@rsdoctor/shared/types';
|
|
3
3
|
export type { Config } from './types.js';
|
|
4
|
-
|
|
4
|
+
declare const title = "ecma-version-check";
|
|
5
|
+
export declare const rule: Linter.RuleData<Config, typeof title>;
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { ecmaVersion as EcmaVersion } from 'acorn';
|
|
2
|
+
type Condition = string | RegExp | ((filepath: string) => boolean);
|
|
3
|
+
type CheckSyntaxExclude = Condition | Condition[];
|
|
4
|
+
type SyntaxErrorKey = 'source' | 'output' | 'reason' | 'code';
|
|
5
|
+
export type Config = {
|
|
6
|
+
targets?: string[];
|
|
7
|
+
exclude?: CheckSyntaxExclude;
|
|
8
|
+
excludeOutput?: CheckSyntaxExclude;
|
|
9
|
+
excludeErrorMessage?: RegExp | RegExp[];
|
|
10
|
+
excludeErrorLogs?: SyntaxErrorKey[];
|
|
11
|
+
ecmaVersion?: EcmaVersion;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ECMAVersion } from '
|
|
1
|
+
import type { ECMAVersion } from '../../../rule-utils/index.js';
|
|
2
2
|
export declare function getVersionNumber(ECMAString: ECMAVersion): number | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Linter } from '@rsdoctor/types';
|
|
1
|
+
import type { Linter } from '@rsdoctor/shared/types';
|
|
2
2
|
export declare const rules: Linter.RuleData[];
|
package/dist/rules/utils.d.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Manifest } from '@rsdoctor/shared/types';
|
|
2
|
+
import { RsdoctorPrimarySDK } from './primary.js';
|
|
3
|
+
export declare class RsdoctorSDKController {
|
|
4
|
+
readonly slaves: RsdoctorPrimarySDK[];
|
|
5
|
+
root: string;
|
|
6
|
+
constructor(root?: string);
|
|
7
|
+
get master(): RsdoctorPrimarySDK;
|
|
8
|
+
getLastSdk(): RsdoctorPrimarySDK;
|
|
9
|
+
hasName(name: string): boolean;
|
|
10
|
+
getSeriesData(serverUrl?: boolean): Manifest.RsdoctorManifestSeriesData[];
|
|
11
|
+
createSlave({ name, stage, extraConfig, type, }: Omit<ConstructorParameters<typeof RsdoctorPrimarySDK>[0], 'controller'>): RsdoctorPrimarySDK;
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Manifest, SDK } from '@rsdoctor/shared/types';
|
|
2
|
+
import { RsdoctorSDK } from '../sdk/index.js';
|
|
3
|
+
import type { RsdoctorSDKController } from './controller.js';
|
|
4
|
+
interface RsdoctorSlaveSDKOptions {
|
|
5
|
+
name: string;
|
|
6
|
+
/**
|
|
7
|
+
* use to sort for display in the client page.
|
|
8
|
+
* the smaller the front.
|
|
9
|
+
* @default 1
|
|
10
|
+
*/
|
|
11
|
+
stage?: number;
|
|
12
|
+
extraConfig?: SDK.SDKOptionsType;
|
|
13
|
+
controller: RsdoctorSDKController;
|
|
14
|
+
type: SDK.ToDataType;
|
|
15
|
+
}
|
|
16
|
+
export declare class RsdoctorPrimarySDK extends RsdoctorSDK implements SDK.RsdoctorBuilderSDKInstance {
|
|
17
|
+
id: number;
|
|
18
|
+
parent: RsdoctorSDKController;
|
|
19
|
+
readonly stage: number;
|
|
20
|
+
dependencies: Array<string> | undefined;
|
|
21
|
+
private uploadPieces;
|
|
22
|
+
private finishUploadPieceSwitch;
|
|
23
|
+
constructor({ name, stage, controller, extraConfig, type, }: RsdoctorSlaveSDKOptions);
|
|
24
|
+
private clearSwitch;
|
|
25
|
+
get isMaster(): boolean;
|
|
26
|
+
protected writePieces(): Promise<void>;
|
|
27
|
+
protected writeManifest(): Promise<string>;
|
|
28
|
+
getSeriesData(serverUrl?: boolean): Manifest.RsdoctorManifestSeriesData[];
|
|
29
|
+
setName(name: string): void;
|
|
30
|
+
getManifestData(): Manifest.RsdoctorManifestWithShardingFiles;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RsdoctorServer, type RsdoctorServerOptions } from '../server/index.js';
|
|
2
|
+
import type { RsdoctorPrimarySDK } from './primary.js';
|
|
3
|
+
export declare class RsdoctorSlaveServer extends RsdoctorServer {
|
|
4
|
+
protected sdk: RsdoctorPrimarySDK;
|
|
5
|
+
constructor(sdk: RsdoctorPrimarySDK, port?: number, config?: RsdoctorServerOptions);
|
|
6
|
+
openClientPage(...args: unknown[]): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Common, Manifest, SDK } from '@rsdoctor/shared/types';
|
|
2
|
+
import { RsdoctorSDKOptions, DataWithUrl } from './types.js';
|
|
3
|
+
export declare abstract class SDKCore<T extends RsdoctorSDKOptions> implements SDK.RsdoctorSDKInstance {
|
|
4
|
+
protected _name: string;
|
|
5
|
+
protected hash: string;
|
|
6
|
+
extraConfig: SDK.SDKOptionsType | undefined;
|
|
7
|
+
readonly root: string;
|
|
8
|
+
readonly pid: number;
|
|
9
|
+
readonly hooks: SDK.Hooks;
|
|
10
|
+
protected _envinfo: SDK.EnvInfo;
|
|
11
|
+
private _clientRoutes;
|
|
12
|
+
private _outputDir;
|
|
13
|
+
diskManifestPath: string;
|
|
14
|
+
cloudData?: Manifest.RsdoctorManifestWithShardingFiles;
|
|
15
|
+
constructor({ name, root }: T);
|
|
16
|
+
get outputDir(): string;
|
|
17
|
+
get name(): string;
|
|
18
|
+
bootstrap(): Promise<void>;
|
|
19
|
+
dispose(): Promise<void>;
|
|
20
|
+
setOutputDir(outputDir: string): void;
|
|
21
|
+
setName(name: string): void;
|
|
22
|
+
setHash(hash: string): void;
|
|
23
|
+
getHash(): string;
|
|
24
|
+
getClientRoutes(): Manifest.RsdoctorManifestClientRoutes[];
|
|
25
|
+
addClientRoutes(routes: Manifest.RsdoctorManifestClientRoutes[]): void;
|
|
26
|
+
/** Upload analysis data pieces */
|
|
27
|
+
protected writePieces(storeData: Common.PlainObject, _options?: SDK.WriteStoreOptionsType): Promise<void>;
|
|
28
|
+
/** Upload manifest file */
|
|
29
|
+
protected writeManifest(): Promise<string>;
|
|
30
|
+
saveManifest(data: Common.PlainObject, options: SDK.WriteStoreOptionsType): Promise<string>;
|
|
31
|
+
protected writeToFolder(jsonStr: string, dir: string, key: string, index?: number): Promise<DataWithUrl>;
|
|
32
|
+
abstract onDataReport(): void | Promise<void>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Manifest, SDK } from '@rsdoctor/shared/types';
|
|
2
|
+
import { RawSourceMap, SourceMapConsumer } from 'source-map';
|
|
3
|
+
import { RsdoctorServer } from '../server/index.js';
|
|
4
|
+
import { RsdoctorRspackSDKOptions } from './types.js';
|
|
5
|
+
import { SDKCore } from './core.js';
|
|
6
|
+
export * from '../utils/openBrowser.js';
|
|
7
|
+
export * from '../utils/base.js';
|
|
8
|
+
export { resolveClientDiffHtmlPath } from '../server/client.js';
|
|
9
|
+
export declare class RsdoctorSDK<T extends RsdoctorRspackSDKOptions = RsdoctorRspackSDKOptions> extends SDKCore<T> implements SDK.RsdoctorBuilderSDKInstance {
|
|
10
|
+
server: RsdoctorServer;
|
|
11
|
+
extraConfig: SDK.SDKOptionsType | undefined;
|
|
12
|
+
type: SDK.ToDataType;
|
|
13
|
+
root: string;
|
|
14
|
+
private _summary;
|
|
15
|
+
private _configs;
|
|
16
|
+
private _errors;
|
|
17
|
+
private _loader;
|
|
18
|
+
private _loaderStart;
|
|
19
|
+
private _resolver;
|
|
20
|
+
private _plugin;
|
|
21
|
+
private _moduleGraph;
|
|
22
|
+
private _chunkGraph;
|
|
23
|
+
private _rawSourceMapCache;
|
|
24
|
+
private _sourceMap;
|
|
25
|
+
private _packageGraph;
|
|
26
|
+
constructor(options: T);
|
|
27
|
+
bootstrap(): Promise<void>;
|
|
28
|
+
dispose(): Promise<void>;
|
|
29
|
+
applyErrorFix(id: number): Promise<void>;
|
|
30
|
+
clear(): void;
|
|
31
|
+
clearSourceMapCache(): void;
|
|
32
|
+
getSourceMap(file: string): Promise<SourceMapConsumer | undefined>;
|
|
33
|
+
reportSourceMap(data: RawSourceMap): void;
|
|
34
|
+
reportConfiguration(config: SDK.ConfigData[0]): void;
|
|
35
|
+
reportError(errors: Error[]): void;
|
|
36
|
+
reportLoader(data: SDK.LoaderData): void;
|
|
37
|
+
reportLoaderStartOrEnd(data: SDK.ResourceLoaderData): void;
|
|
38
|
+
reportResolver(data: SDK.ResolverData): void;
|
|
39
|
+
reportPlugin(data: SDK.PluginData): void;
|
|
40
|
+
reportModuleGraph(data: SDK.ModuleGraphInstance): void;
|
|
41
|
+
reportPackageGraph(data: SDK.PackageGraphInstance): void;
|
|
42
|
+
reportChunkGraph(data: SDK.ChunkGraphInstance): void;
|
|
43
|
+
reportSummaryData(part: Partial<SDK.SummaryData>): void;
|
|
44
|
+
createPackageGraph(): void;
|
|
45
|
+
writeStore(options?: SDK.WriteStoreOptionsType): Promise<string>;
|
|
46
|
+
getStoreData(): SDK.BuilderStoreData;
|
|
47
|
+
getManifestData(): Manifest.RsdoctorManifestWithShardingFiles;
|
|
48
|
+
getRuleContext(_options: SDK.RuntimeContextOptions): SDK.RuntimeContext;
|
|
49
|
+
onDataReport(): void | Promise<void>;
|
|
50
|
+
addRsdoctorDataToHTML(storeData: SDK.BuilderStoreData, htmlContent: string): string;
|
|
51
|
+
inlineScriptsAndStyles(htmlFilePath: string): string;
|
|
52
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/shared/types';
|
|
2
|
+
export interface DataWithUrl {
|
|
3
|
+
name: string;
|
|
4
|
+
files: {
|
|
5
|
+
path: string;
|
|
6
|
+
basename: string;
|
|
7
|
+
content: Buffer;
|
|
8
|
+
}[] | string;
|
|
9
|
+
}
|
|
10
|
+
export interface RsdoctorSDKOptions {
|
|
11
|
+
name: string;
|
|
12
|
+
root: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* sdk options for builder.
|
|
16
|
+
*/
|
|
17
|
+
export interface RsdoctorBuilderSDK extends RsdoctorSDKOptions {
|
|
18
|
+
type?: SDK.ToDataType;
|
|
19
|
+
/**
|
|
20
|
+
* port for client server
|
|
21
|
+
*/
|
|
22
|
+
port?: number;
|
|
23
|
+
config?: SDK.SDKOptionsType;
|
|
24
|
+
}
|
|
25
|
+
export type RsdoctorRspackSDKOptions = RsdoctorBuilderSDK;
|
|
26
|
+
export type RsdoctorEMOSDKOptions = RsdoctorSDKOptions;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Data } from '@rsdoctor/shared/common-browser';
|
|
2
|
+
import { Manifest, SDK } from '@rsdoctor/shared/types';
|
|
3
|
+
export declare class BaseAPI implements Manifest.ManifestDataLoader {
|
|
4
|
+
[key: string | symbol]: any;
|
|
5
|
+
readonly ctx: SDK.ServerAPI.APIContext;
|
|
6
|
+
protected dataLoader: Data.APIDataLoader;
|
|
7
|
+
constructor(sdk: SDK.RsdoctorSDKInstance, server: SDK.RsdoctorServerInstance);
|
|
8
|
+
loadManifest(): Promise<Manifest.RsdoctorManifestWithShardingFiles>;
|
|
9
|
+
loadData<T extends Manifest.RsdoctorManifestMappingKeys>(key: T): Promise<Manifest.InferManifestDataValue<T>>;
|
|
10
|
+
loadData(key: string): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/shared/types';
|
|
2
|
+
import { BaseAPI } from './base.js';
|
|
3
|
+
export declare class BundleDiffAPI extends BaseAPI {
|
|
4
|
+
getBundleDiffSummary(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetBundleDiffSummary>>;
|
|
5
|
+
bundleDiffManifest(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.BundleDiffManifest>>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/shared/types';
|
|
2
|
+
import { BaseAPI } from './base.js';
|
|
3
|
+
export declare class DataAPI extends BaseAPI {
|
|
4
|
+
loadDataByKey(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.LoadDataByKey>>;
|
|
5
|
+
sendMessageToClient(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.SendAPIDataToClient>>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/shared/types';
|
|
2
|
+
import { BaseAPI } from './base.js';
|
|
3
|
+
export declare class GraphAPI extends BaseAPI {
|
|
4
|
+
getAssetsSummary(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetAssetsSummary>>;
|
|
5
|
+
getModuleGraphForAsset(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetAssetDetails>>;
|
|
6
|
+
getChunksByModuleId(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetChunksByModuleId>>;
|
|
7
|
+
getModuleDetails(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetModuleDetails>>;
|
|
8
|
+
getDependencyByResolvedRequest(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetModulesByModuleIds>>;
|
|
9
|
+
getModuleCodeByModuleId(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetModuleCodeByModuleId>>;
|
|
10
|
+
getModuleCodeByModuleIds(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetModuleCodeByModuleIds>>;
|
|
11
|
+
getEntryModulesSummary(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetEntryPoints>>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './alerts.js';
|
|
2
|
+
export * from './bundle-diff.js';
|
|
3
|
+
export { DataAPI } from './data.js';
|
|
4
|
+
export * from './fs.js';
|
|
5
|
+
export * from './loader.js';
|
|
6
|
+
export * from './graph.js';
|
|
7
|
+
export * from './plugin.js';
|
|
8
|
+
export * from './project.js';
|
|
9
|
+
export * from './renderer.js';
|
|
10
|
+
export * from './resolver.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/shared/types';
|
|
2
|
+
import { BaseAPI } from './base.js';
|
|
3
|
+
export declare class LoaderAPI extends BaseAPI {
|
|
4
|
+
/** report loader data api */
|
|
5
|
+
reportLoader(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.ReportLoader>>;
|
|
6
|
+
/** report sourcemap data api */
|
|
7
|
+
reportSourceMap(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.ReportLoader>>;
|
|
8
|
+
getLoaderNames(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderNames>>;
|
|
9
|
+
getLoaderChartData(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderChartData>>;
|
|
10
|
+
getLoaderFileTree(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderFileTree>>;
|
|
11
|
+
getLoaderFileDetails(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderFileDetails>>;
|
|
12
|
+
getLoaderFolderStatistics(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderFolderStatistics>>;
|
|
13
|
+
getLoaderFileFirstInput(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderFileFirstInput>>;
|
|
14
|
+
getLoaderFileInputAndOutput(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderFileInputAndOutput>>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/shared/types';
|
|
2
|
+
import { BaseAPI } from './base.js';
|
|
3
|
+
export declare class PluginAPI extends BaseAPI {
|
|
4
|
+
getPluginSummary(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetPluginSummary>>;
|
|
5
|
+
getPluginData(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetPluginData>>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/shared/types';
|
|
2
|
+
import { BaseAPI } from './base.js';
|
|
3
|
+
export declare class ProjectAPI extends BaseAPI {
|
|
4
|
+
env(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.Env>>;
|
|
5
|
+
manifest(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.Manifest>>;
|
|
6
|
+
getProjectInfo(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>>;
|
|
7
|
+
getClientRoutes(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetClientRoutes>>;
|
|
8
|
+
}
|