@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,6 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/shared/types';
|
|
2
|
+
import { BaseAPI } from './base.js';
|
|
3
|
+
export declare class ResolverAPI extends BaseAPI {
|
|
4
|
+
getResolverFileTree(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetResolverFileTree>>;
|
|
5
|
+
getResolverFileDetails(): Promise<SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetResolverFileDetails>>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/shared/types';
|
|
2
|
+
import { RsdoctorServer } from './index.js';
|
|
3
|
+
export declare class RsdoctorFakeServer extends RsdoctorServer {
|
|
4
|
+
protected sdk: SDK.RsdoctorBuilderSDKInstance;
|
|
5
|
+
constructor(sdk: SDK.RsdoctorBuilderSDKInstance, port?: number);
|
|
6
|
+
bootstrap(): Promise<void>;
|
|
7
|
+
openClientPage(): Promise<void>;
|
|
8
|
+
dispose: () => Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Common, SDK, Thirdparty, Client } from '@rsdoctor/shared/types';
|
|
2
|
+
export * from './utils.js';
|
|
3
|
+
export type ISocketType = {
|
|
4
|
+
port: number;
|
|
5
|
+
socketUrl: string;
|
|
6
|
+
token: string;
|
|
7
|
+
};
|
|
8
|
+
export type RsdoctorServerOptions = {
|
|
9
|
+
innerClientPath?: string;
|
|
10
|
+
printServerUrl?: boolean;
|
|
11
|
+
cors?: SDK.RsdoctorServerConfig['cors'];
|
|
12
|
+
};
|
|
13
|
+
export declare class RsdoctorServer implements SDK.RsdoctorServerInstance {
|
|
14
|
+
protected sdk: SDK.RsdoctorBuilderSDKInstance;
|
|
15
|
+
private _server;
|
|
16
|
+
port: number;
|
|
17
|
+
private _socket?;
|
|
18
|
+
private disposed;
|
|
19
|
+
private _router;
|
|
20
|
+
private _innerClientPath;
|
|
21
|
+
private _printServerUrl;
|
|
22
|
+
private _cors;
|
|
23
|
+
private _socketToken;
|
|
24
|
+
constructor(sdk: SDK.RsdoctorBuilderSDKInstance, port?: number, config?: RsdoctorServerOptions);
|
|
25
|
+
get app(): SDK.RsdoctorServerInstance['app'];
|
|
26
|
+
get host(): string;
|
|
27
|
+
get origin(): string;
|
|
28
|
+
get socketUrl(): ISocketType;
|
|
29
|
+
get innerClientPath(): string;
|
|
30
|
+
private createInnerServer;
|
|
31
|
+
private resolveCorsOptions;
|
|
32
|
+
bootstrap(): Promise<void>;
|
|
33
|
+
protected wrapNextHandleFunction(method: 'GET' | 'POST', cb: (...args: Parameters<Thirdparty.connect.NextHandleFunction>) => Common.PlainObject | string): Thirdparty.connect.NextHandleFunction;
|
|
34
|
+
proxy(api: SDK.ServerAPI.API, method: 'GET' | 'POST', cb: (...args: Parameters<Thirdparty.connect.NextHandleFunction>) => Common.PlainObject | string): void;
|
|
35
|
+
get: SDK.RsdoctorServerInstance['get'];
|
|
36
|
+
post: SDK.RsdoctorServerInstance['post'];
|
|
37
|
+
getClientUrl(route: Client.RsdoctorClientRoutes, baselineUrl: string, currentUrl: string): string;
|
|
38
|
+
getClientUrl(route?: 'homepage'): string;
|
|
39
|
+
openClientPage(route: Client.RsdoctorClientRoutes, baselineUrl: string, currentUrl: string): Promise<void>;
|
|
40
|
+
openClientPage(route?: 'homepage'): Promise<void>;
|
|
41
|
+
sendAPIDataToClient<T extends SDK.ServerAPI.API | SDK.ServerAPI.APIExtends>(api: T, msg: SDK.ServerAPI.SocketResponseType<T>): void;
|
|
42
|
+
broadcast(): Promise<void>;
|
|
43
|
+
dispose: (exitCode?: number) => Promise<void>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Thirdparty } from '@rsdoctor/shared/types';
|
|
2
|
+
interface JsonBodyParserOptions {
|
|
3
|
+
limit?: number | string | ((req: Thirdparty.connect.IncomingMessage) => number | string);
|
|
4
|
+
}
|
|
5
|
+
export declare function jsonBodyParser(options?: JsonBodyParserOptions): Thirdparty.connect.NextHandleFunction;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ServerResponse } from 'http';
|
|
2
|
+
import { Common, SDK, Thirdparty } from '@rsdoctor/shared/types';
|
|
3
|
+
import { BaseAPI } from './apis/base.js';
|
|
4
|
+
interface RouterOptions {
|
|
5
|
+
apis: Common.Constructor<typeof BaseAPI>[];
|
|
6
|
+
sdk: SDK.RsdoctorBuilderSDKInstance;
|
|
7
|
+
server: SDK.RsdoctorServerInstance;
|
|
8
|
+
}
|
|
9
|
+
export declare class Router {
|
|
10
|
+
protected options: RouterOptions;
|
|
11
|
+
static routes: {
|
|
12
|
+
/**
|
|
13
|
+
* - `key` is the constructor of object which used to match the API class
|
|
14
|
+
*/
|
|
15
|
+
get: Map<new (sdk: SDK.RsdoctorSDKInstance, server: SDK.RsdoctorServerInstance) => BaseAPI, [apiKey: PropertyKey, pathname: string][]>;
|
|
16
|
+
post: Map<new (sdk: SDK.RsdoctorSDKInstance, server: SDK.RsdoctorServerInstance) => BaseAPI, [apiKey: PropertyKey, pathname: string][]>;
|
|
17
|
+
};
|
|
18
|
+
static get(pathname: string): MethodDecorator;
|
|
19
|
+
static post(pathname: string): MethodDecorator;
|
|
20
|
+
constructor(options: RouterOptions);
|
|
21
|
+
setup(): Promise<void>;
|
|
22
|
+
wrapAPIFunction<T extends BaseAPI>(api: T, key: PropertyKey): (req: Thirdparty.connect.IncomingMessage, res: ServerResponse) => Promise<unknown>;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const DEFAULT_ALLOWED_CORS_ORIGINS: RegExp;
|
|
2
|
+
export declare function isAllowedRequestOrigin(origin: string | string[] | undefined): boolean;
|
|
3
|
+
export declare function isAllowedRequestHost(host: string | string[] | undefined): boolean;
|
|
4
|
+
export declare function isAllowedCorsRequest(origin: string | string[] | undefined, host: string | string[] | undefined): boolean;
|
|
5
|
+
export declare function isAllowedOpenInEditorToken(token: string | null, expectedToken: string): boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Data } from '@rsdoctor/shared/common-browser';
|
|
2
|
+
import { Manifest, SDK } from '@rsdoctor/shared/types';
|
|
3
|
+
interface SocketAPILoaderOptions {
|
|
4
|
+
sdk: SDK.RsdoctorBuilderSDKInstance;
|
|
5
|
+
}
|
|
6
|
+
export declare class SocketAPILoader implements Manifest.ManifestDataLoader {
|
|
7
|
+
protected options: SocketAPILoaderOptions;
|
|
8
|
+
protected dataLoader: Data.APIDataLoader;
|
|
9
|
+
constructor(options: SocketAPILoaderOptions);
|
|
10
|
+
loadManifest(): Promise<Manifest.RsdoctorManifestWithShardingFiles>;
|
|
11
|
+
loadData<T extends Manifest.RsdoctorManifestMappingKeys>(key: T): Promise<Manifest.InferManifestDataValue<T>>;
|
|
12
|
+
loadData(key: string): Promise<void>;
|
|
13
|
+
get loadAPIData(): <T extends SDK.ServerAPI.API | SDK.ServerAPI.APIExtends>(api: T, body: SDK.ServerAPI.InferRequestBodyType<T>) => Promise<SDK.ServerAPI.InferResponseType<T>>;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Common, SDK } from '@rsdoctor/shared/types';
|
|
2
|
+
import type { Server } from 'http';
|
|
3
|
+
import WebSocket, { WebSocketServer } from 'ws';
|
|
4
|
+
import { SocketAPILoader } from './api.js';
|
|
5
|
+
interface SocketOptions {
|
|
6
|
+
sdk: SDK.RsdoctorBuilderSDKInstance;
|
|
7
|
+
server: Server;
|
|
8
|
+
port: number;
|
|
9
|
+
token: string;
|
|
10
|
+
}
|
|
11
|
+
type Subscription = {
|
|
12
|
+
api: SDK.ServerAPI.API;
|
|
13
|
+
body: Common.PlainObject | null;
|
|
14
|
+
};
|
|
15
|
+
type SubscriptionRecord = Subscription & {
|
|
16
|
+
count: number;
|
|
17
|
+
};
|
|
18
|
+
type ClientMessage = {
|
|
19
|
+
type?: string;
|
|
20
|
+
id?: string;
|
|
21
|
+
api?: SDK.ServerAPI.API;
|
|
22
|
+
body?: Common.PlainObject | null;
|
|
23
|
+
};
|
|
24
|
+
export declare class Socket {
|
|
25
|
+
protected options: SocketOptions;
|
|
26
|
+
protected server?: WebSocketServer;
|
|
27
|
+
protected clients: Set<WebSocket>;
|
|
28
|
+
protected loader: SocketAPILoader;
|
|
29
|
+
protected map: Map<string, SubscriptionRecord>;
|
|
30
|
+
protected clientSubscriptions: Map<WebSocket, Set<string>>;
|
|
31
|
+
constructor(options: SocketOptions);
|
|
32
|
+
bootstrap(): void;
|
|
33
|
+
attachClient(client: WebSocket): void;
|
|
34
|
+
handleClientMessage(raw: string, client?: WebSocket): Promise<void>;
|
|
35
|
+
protected handleAPIRequestMessage(message: ClientMessage, client?: WebSocket): Promise<void>;
|
|
36
|
+
getSubscriptions(): Subscription[];
|
|
37
|
+
protected saveRequestToMap<T extends SDK.ServerAPI.API>(api: T, body?: SDK.ServerAPI.InferRequestBodyType<T, null> | null, client?: WebSocket): void;
|
|
38
|
+
protected removeRequestFromMap<T extends SDK.ServerAPI.API>(api: T, body?: SDK.ServerAPI.InferRequestBodyType<T, null> | null, client?: WebSocket): void;
|
|
39
|
+
protected removeClientSubscriptions(client: WebSocket): void;
|
|
40
|
+
protected removeSubscriptionKey(key: string): void;
|
|
41
|
+
protected getSubscriptionKey(api: SDK.ServerAPI.API, body: Common.PlainObject | null): string;
|
|
42
|
+
protected getAPIResponse<T extends SDK.ServerAPI.API>(api: T, body: SDK.ServerAPI.InferRequestBodyType<T>): Promise<SDK.ServerAPI.SocketResponseType<SDK.ServerAPI.API>>;
|
|
43
|
+
protected timer: NodeJS.Immediate | undefined;
|
|
44
|
+
broadcast(): Promise<void>;
|
|
45
|
+
sendAPIData<T extends SDK.ServerAPI.API | SDK.ServerAPI.APIExtends>(api: T, payload: SDK.ServerAPI.SocketResponseType<T>): void;
|
|
46
|
+
dispose(): void;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/shared/types';
|
|
2
|
+
export declare function getDataByPagination<T>(data: T[], pagination: SDK.ServerAPI.PaginationRequest): {
|
|
3
|
+
data: T[];
|
|
4
|
+
pagination: SDK.ServerAPI.PaginationResponse;
|
|
5
|
+
};
|
|
6
|
+
export declare function getLocalIpAddress(): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function findRoot(startDir?: string): string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CLOUD_DIR: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatLocalDate: (date: Date) => string;
|
package/dist/sdk.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sdk/index.js';
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/loader.d.ts
CHANGED
package/dist/types/plugin.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { Linter, Linter as LinterType, Plugin, SDK } from '@rsdoctor/shared/types';
|
|
2
|
+
export interface RsdoctorMultiplePluginOptions<Rules extends LinterType.ExtendRuleData[] = LinterType.ExtendRuleData[]> extends Omit<Plugin.RsdoctorRspackPluginOptions<Rules>, 'sdkInstance'>, Pick<{
|
|
3
|
+
stage?: number;
|
|
4
|
+
}, 'stage'> {
|
|
4
5
|
/**
|
|
5
6
|
* name of builder
|
|
6
7
|
*/
|
|
@@ -24,28 +25,6 @@ export interface RsdoctorPluginInstance<T extends Plugin.BaseCompiler, Rules ext
|
|
|
24
25
|
modulesGraph: SDK.ModuleGraphInstance;
|
|
25
26
|
ensureModulesChunksGraphApplied(compiler: T): void;
|
|
26
27
|
}
|
|
27
|
-
export
|
|
28
|
-
|
|
29
|
-
export
|
|
30
|
-
moduleGraph?: boolean;
|
|
31
|
-
chunkGraph?: boolean;
|
|
32
|
-
}
|
|
33
|
-
export interface RsdoctorRspackPluginExperiments {
|
|
34
|
-
/**
|
|
35
|
-
* Whether to enable the native plugin to improve the performance.
|
|
36
|
-
* @default true
|
|
37
|
-
*/
|
|
38
|
-
enableNativePlugin?: boolean;
|
|
39
|
-
}
|
|
40
|
-
export interface RsdoctorRspackPluginExperimentsNormalized {
|
|
41
|
-
enableNativePlugin?: NativePluginConfig;
|
|
42
|
-
}
|
|
43
|
-
export interface RsdoctorRspackPluginOptions<Rules extends LinterType.ExtendRuleData[]> extends Plugin.RsdoctorRspackPluginOptions<Rules> {
|
|
44
|
-
/**
|
|
45
|
-
* The experiments of the Rsdoctor Rspack plugin.
|
|
46
|
-
*/
|
|
47
|
-
experiments?: RsdoctorRspackPluginExperiments;
|
|
48
|
-
}
|
|
49
|
-
export type RsdoctorRspackPluginOptionsNormalized<Rules extends Linter.ExtendRuleData[]> = Plugin.RsdoctorPluginOptionsNormalized<Rules> & {
|
|
50
|
-
experiments?: RsdoctorRspackPluginExperimentsNormalized;
|
|
51
|
-
};
|
|
28
|
+
export type RsdoctorRspackPluginInstance<Rules extends LinterType.ExtendRuleData[] = []> = RsdoctorPluginInstance<Plugin.BaseCompilerType<'rspack'>, Rules>;
|
|
29
|
+
export type RsdoctorRspackPluginOptions<Rules extends LinterType.ExtendRuleData[]> = Plugin.RsdoctorRspackPluginOptions<Rules>;
|
|
30
|
+
export type RsdoctorRspackPluginOptionsNormalized<Rules extends Linter.ExtendRuleData[]> = Plugin.RsdoctorPluginOptionsNormalized<Rules>;
|
package/package.json
CHANGED
|
@@ -1,69 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/core",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
7
7
|
"directory": "packages/core"
|
|
8
8
|
},
|
|
9
9
|
"license": "MIT",
|
|
10
|
-
"
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=22.18.0"
|
|
12
|
+
},
|
|
13
|
+
"main": "dist/index.js",
|
|
11
14
|
"types": "dist/index.d.ts",
|
|
12
15
|
"files": [
|
|
13
16
|
"dist",
|
|
14
|
-
"
|
|
17
|
+
"static"
|
|
15
18
|
],
|
|
16
19
|
"type": "module",
|
|
17
20
|
"exports": {
|
|
18
21
|
".": {
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
"default": "./dist/index.js"
|
|
22
|
-
},
|
|
23
|
-
"require": {
|
|
24
|
-
"types": "./dist/index.d.cts",
|
|
25
|
-
"default": "./dist/index.cjs"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
"./build-utils": {
|
|
29
|
-
"import": {
|
|
30
|
-
"types": "./dist/build-utils/build/index.d.ts",
|
|
31
|
-
"default": "./dist/build-utils/build/index.js"
|
|
32
|
-
},
|
|
33
|
-
"require": {
|
|
34
|
-
"types": "./dist/build-utils/build/index.d.cts",
|
|
35
|
-
"default": "./dist/build-utils/build/index.cjs"
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
"./plugins": {
|
|
39
|
-
"import": {
|
|
40
|
-
"types": "./dist/inner-plugins/index.d.ts",
|
|
41
|
-
"default": "./dist/inner-plugins/index.js"
|
|
42
|
-
},
|
|
43
|
-
"require": {
|
|
44
|
-
"types": "./dist/inner-plugins/index.d.cts",
|
|
45
|
-
"default": "./dist/inner-plugins/index.cjs"
|
|
46
|
-
}
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"default": "./dist/index.js"
|
|
47
24
|
},
|
|
48
|
-
"./
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
"default": "./dist/rules/index.js"
|
|
52
|
-
},
|
|
53
|
-
"require": {
|
|
54
|
-
"types": "./dist/rules/index.d.cts",
|
|
55
|
-
"default": "./dist/rules/index.cjs"
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
"./types": {
|
|
59
|
-
"import": {
|
|
60
|
-
"types": "./dist/types/index.d.ts",
|
|
61
|
-
"default": "./dist/types/index.js"
|
|
62
|
-
},
|
|
63
|
-
"require": {
|
|
64
|
-
"types": "./dist/types/index.d.cts",
|
|
65
|
-
"default": "./dist/types/index.cjs"
|
|
66
|
-
}
|
|
25
|
+
"./proxy-loader": {
|
|
26
|
+
"types": "./dist/proxy-loader.d.ts",
|
|
27
|
+
"default": "./dist/proxy-loader.js"
|
|
67
28
|
}
|
|
68
29
|
},
|
|
69
30
|
"typesVersions": {
|
|
@@ -71,58 +32,73 @@
|
|
|
71
32
|
".": [
|
|
72
33
|
"./dist/index.d.ts"
|
|
73
34
|
],
|
|
74
|
-
"
|
|
75
|
-
"./dist/
|
|
76
|
-
],
|
|
77
|
-
"plugins": [
|
|
78
|
-
"./dist/inner-plugins/index.d.ts"
|
|
79
|
-
],
|
|
80
|
-
"rules": [
|
|
81
|
-
"./dist/rules/index.d.ts"
|
|
82
|
-
],
|
|
83
|
-
"types": [
|
|
84
|
-
"./dist/types/index.d.ts"
|
|
35
|
+
"proxy-loader": [
|
|
36
|
+
"./dist/proxy-loader.d.ts"
|
|
85
37
|
]
|
|
86
38
|
}
|
|
87
39
|
},
|
|
88
40
|
"dependencies": {
|
|
89
|
-
"
|
|
90
|
-
"@
|
|
91
|
-
"@
|
|
92
|
-
"
|
|
93
|
-
"
|
|
41
|
+
"@babel/code-frame": "7.26.2",
|
|
42
|
+
"@rspack/lite-tapable": "^1.1.5",
|
|
43
|
+
"@types/estree": "1.0.5",
|
|
44
|
+
"acorn": "^8.10.0",
|
|
45
|
+
"acorn-import-attributes": "^1.9.5",
|
|
46
|
+
"acorn-walk": "8.3.5",
|
|
47
|
+
"browserslist-load-config": "^1.0.3",
|
|
48
|
+
"caniuse-lite": "^1.0.30001792",
|
|
49
|
+
"connect": "3.7.0",
|
|
50
|
+
"envinfo": "7.21.0",
|
|
94
51
|
"fs-extra": "^11.1.1",
|
|
95
|
-
"
|
|
52
|
+
"get-port": "5.1.1",
|
|
53
|
+
"lines-and-columns": "2.0.4",
|
|
54
|
+
"open": "^11.0.0",
|
|
55
|
+
"raw-body": "3.0.2",
|
|
56
|
+
"rslog": "^2.1.3",
|
|
57
|
+
"semver": "^7.8.5",
|
|
96
58
|
"source-map": "^0.7.6",
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
59
|
+
"cors": "2.8.6",
|
|
60
|
+
"launch-editor": "^2.14.1",
|
|
61
|
+
"sirv": "3.0.2",
|
|
62
|
+
"ws": "8.21.1",
|
|
63
|
+
"@rsdoctor/shared": "2.0.0-alpha.2",
|
|
64
|
+
"@rsdoctor/client": "2.0.0-alpha.2"
|
|
101
65
|
},
|
|
102
66
|
"devDependencies": {
|
|
103
|
-
"@
|
|
67
|
+
"@rsbuild/plugin-check-syntax": "^1.6.1",
|
|
68
|
+
"@rspack/core": "^2.1.7",
|
|
69
|
+
"@types/babel__code-frame": "7.27.0",
|
|
70
|
+
"@types/connect": "3.4.38",
|
|
71
|
+
"@types/envinfo": "7.8.4",
|
|
104
72
|
"@types/fs-extra": "^11.0.4",
|
|
105
73
|
"@types/node": "^24.12.3",
|
|
106
|
-
"@types/node-fetch": "^2.6.13",
|
|
107
74
|
"@types/semver": "^7.7.1",
|
|
108
|
-
"@types/tapable": "2.3.0",
|
|
109
75
|
"babel-loader": "10.1.1",
|
|
110
|
-
"
|
|
76
|
+
"filesize": "^11.0.22",
|
|
77
|
+
"json-stream-stringify": "3.0.1",
|
|
111
78
|
"string-loader": "0.0.1",
|
|
112
|
-
"ts-loader": "^9.
|
|
79
|
+
"ts-loader": "^9.6.2",
|
|
113
80
|
"tslib": "2.8.1",
|
|
114
|
-
"typescript": "^
|
|
81
|
+
"typescript": "^7.0.2",
|
|
82
|
+
"@types/cors": "2.8.19",
|
|
83
|
+
"@types/ws": "^8.18.1",
|
|
115
84
|
"@scripts/test-helper": "0.1.1"
|
|
116
85
|
},
|
|
86
|
+
"peerDependencies": {
|
|
87
|
+
"@rspack/core": "^2.0.0"
|
|
88
|
+
},
|
|
89
|
+
"peerDependenciesMeta": {
|
|
90
|
+
"@rspack/core": {
|
|
91
|
+
"optional": true
|
|
92
|
+
}
|
|
93
|
+
},
|
|
117
94
|
"publishConfig": {
|
|
118
95
|
"access": "public",
|
|
119
96
|
"registry": "https://registry.npmjs.org/"
|
|
120
97
|
},
|
|
121
98
|
"scripts": {
|
|
122
99
|
"dev": "npm run start",
|
|
123
|
-
"build": "
|
|
100
|
+
"build": "rslib build",
|
|
124
101
|
"start": "rslib build -w",
|
|
125
|
-
"test": "rstest run"
|
|
126
|
-
"prebundle": "prebundle"
|
|
102
|
+
"test": "rstest run"
|
|
127
103
|
}
|
|
128
104
|
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
(*
|
|
2
|
+
Copyright (c) 2015-present, Facebook, Inc.
|
|
3
|
+
|
|
4
|
+
This source code is licensed under the MIT license found in the
|
|
5
|
+
LICENSE file at
|
|
6
|
+
https://github.com/facebookincubator/create-react-app/blob/master/LICENSE
|
|
7
|
+
*)
|
|
8
|
+
|
|
9
|
+
property targetTab: null
|
|
10
|
+
property targetTabIndex: -1
|
|
11
|
+
property targetWindow: null
|
|
12
|
+
property theProgram: "Google Chrome"
|
|
13
|
+
|
|
14
|
+
on run argv
|
|
15
|
+
set theURL to item 1 of argv
|
|
16
|
+
|
|
17
|
+
-- Allow requested program to be optional,
|
|
18
|
+
-- default to Google Chrome
|
|
19
|
+
if (count of argv) > 1 then
|
|
20
|
+
set theProgram to item 2 of argv
|
|
21
|
+
end if
|
|
22
|
+
|
|
23
|
+
using terms from application "Google Chrome"
|
|
24
|
+
tell application theProgram
|
|
25
|
+
|
|
26
|
+
if (count every window) = 0 then
|
|
27
|
+
make new window
|
|
28
|
+
end if
|
|
29
|
+
|
|
30
|
+
-- 1: Looking for tab running debugger
|
|
31
|
+
-- then, Reload debugging tab if found
|
|
32
|
+
-- then return
|
|
33
|
+
set found to my lookupTabWithUrl(theURL)
|
|
34
|
+
if found then
|
|
35
|
+
set targetWindow's active tab index to targetTabIndex
|
|
36
|
+
tell targetTab to reload
|
|
37
|
+
tell targetWindow to activate
|
|
38
|
+
set index of targetWindow to 1
|
|
39
|
+
return
|
|
40
|
+
end if
|
|
41
|
+
|
|
42
|
+
-- 2: Looking for Empty tab
|
|
43
|
+
-- In case debugging tab was not found
|
|
44
|
+
-- We try to find an empty tab instead
|
|
45
|
+
set found to my lookupTabWithUrl("chrome://newtab/")
|
|
46
|
+
if found then
|
|
47
|
+
set targetWindow's active tab index to targetTabIndex
|
|
48
|
+
set URL of targetTab to theURL
|
|
49
|
+
tell targetWindow to activate
|
|
50
|
+
return
|
|
51
|
+
end if
|
|
52
|
+
|
|
53
|
+
-- 3: Create new tab
|
|
54
|
+
-- both debugging and empty tab were not found
|
|
55
|
+
-- make a new tab with url
|
|
56
|
+
tell window 1
|
|
57
|
+
activate
|
|
58
|
+
make new tab with properties {URL:theURL}
|
|
59
|
+
end tell
|
|
60
|
+
end tell
|
|
61
|
+
end using terms from
|
|
62
|
+
end run
|
|
63
|
+
|
|
64
|
+
-- Function:
|
|
65
|
+
-- Lookup tab with given url
|
|
66
|
+
-- if found, store tab, index, and window in properties
|
|
67
|
+
-- (properties were declared on top of file)
|
|
68
|
+
on lookupTabWithUrl(lookupUrl)
|
|
69
|
+
using terms from application "Google Chrome"
|
|
70
|
+
tell application theProgram
|
|
71
|
+
-- Find a tab with the given url
|
|
72
|
+
set found to false
|
|
73
|
+
set theTabIndex to -1
|
|
74
|
+
repeat with theWindow in every window
|
|
75
|
+
set theTabIndex to 0
|
|
76
|
+
repeat with theTab in every tab of theWindow
|
|
77
|
+
set theTabIndex to theTabIndex + 1
|
|
78
|
+
if (theTab's URL as string) contains lookupUrl then
|
|
79
|
+
-- assign tab, tab index, and window to properties
|
|
80
|
+
set targetTab to theTab
|
|
81
|
+
set targetTabIndex to theTabIndex
|
|
82
|
+
set targetWindow to theWindow
|
|
83
|
+
set found to true
|
|
84
|
+
exit repeat
|
|
85
|
+
end if
|
|
86
|
+
end repeat
|
|
87
|
+
|
|
88
|
+
if found then
|
|
89
|
+
exit repeat
|
|
90
|
+
end if
|
|
91
|
+
end repeat
|
|
92
|
+
end tell
|
|
93
|
+
end using terms from
|
|
94
|
+
return found
|
|
95
|
+
end lookupTabWithUrl
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
getAssetsModulesData: ()=>getAssetsModulesData
|
|
28
|
-
});
|
|
29
|
-
const graph_namespaceObject = require("@rsdoctor/graph");
|
|
30
|
-
const index_cjs_namespaceObject = require("../utils/index.cjs");
|
|
31
|
-
async function getAssetsModulesData(moduleGraph, chunkGraph, bundleDir, sourceMapSets, hasParseBundle = true, assetsWithoutSourceMap) {
|
|
32
|
-
return graph_namespaceObject.Chunks.getAssetsModulesData(moduleGraph, chunkGraph, bundleDir, hasParseBundle ? {
|
|
33
|
-
parseBundle: index_cjs_namespaceObject.parseBundle
|
|
34
|
-
} : {}, sourceMapSets, assetsWithoutSourceMap);
|
|
35
|
-
}
|
|
36
|
-
exports.getAssetsModulesData = __webpack_exports__.getAssetsModulesData;
|
|
37
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
38
|
-
"getAssetsModulesData"
|
|
39
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
40
|
-
Object.defineProperty(exports, '__esModule', {
|
|
41
|
-
value: true
|
|
42
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { SDK } from '@rsdoctor/types';
|
|
2
|
-
/**
|
|
3
|
-
* Collects module size data from bundle assets, using source maps when available
|
|
4
|
-
* and falling back to AST parsing for assets without source maps.
|
|
5
|
-
*
|
|
6
|
-
* @param moduleGraph - The module graph instance
|
|
7
|
-
* @param chunkGraph - The chunk graph instance
|
|
8
|
-
* @param bundleDir - Directory containing the bundle assets
|
|
9
|
-
* @param sourceMapSets - Map of module paths to their source code (from source maps)
|
|
10
|
-
* @param hasParseBundle - Whether to enable AST parsing fallback
|
|
11
|
-
* @param assetsWithoutSourceMap - Optional set of asset paths that don't have source maps.
|
|
12
|
-
* When provided, these assets will be parsed using AST parsing instead of source map data.
|
|
13
|
-
* This is used as a fallback mechanism when source maps are unavailable for specific assets.
|
|
14
|
-
* If not provided and no source maps exist (sourceMapSets is empty), all assets will be parsed via AST.
|
|
15
|
-
* @returns Promise that resolves when module data collection is complete
|
|
16
|
-
*/
|
|
17
|
-
export declare function getAssetsModulesData(moduleGraph: SDK.ModuleGraphInstance, chunkGraph: SDK.ChunkGraphInstance, bundleDir: string, sourceMapSets: Map<string, string>, hasParseBundle?: boolean, assetsWithoutSourceMap?: Set<string>): Promise<void>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import "node:module";
|
|
2
|
-
import { Chunks } from "@rsdoctor/graph";
|
|
3
|
-
import { parseBundle } from "../utils/index.js";
|
|
4
|
-
async function getAssetsModulesData(moduleGraph, chunkGraph, bundleDir, sourceMapSets, hasParseBundle = true, assetsWithoutSourceMap) {
|
|
5
|
-
return Chunks.getAssetsModulesData(moduleGraph, chunkGraph, bundleDir, hasParseBundle ? {
|
|
6
|
-
parseBundle: parseBundle
|
|
7
|
-
} : {}, sourceMapSets, assetsWithoutSourceMap);
|
|
8
|
-
}
|
|
9
|
-
export { getAssetsModulesData };
|