@rsdoctor/core 2.0.0-alpha.0 → 2.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-utils/build/chunks/assetsModules.d.ts +1 -1
- package/dist/build-utils/build/chunks/assetsModules.js +1 -1
- package/dist/build-utils/build/chunks/index.d.ts +0 -1
- package/dist/build-utils/build/chunks/index.js +0 -1
- package/dist/build-utils/build/chunks/rspack/transform.d.ts +1 -1
- package/dist/build-utils/build/chunks/rspack/transform.js +1 -1
- package/dist/build-utils/build/envinfo.d.ts +13 -0
- package/dist/build-utils/build/envinfo.js +60 -0
- package/dist/build-utils/build/file/cache.d.ts +5 -0
- package/dist/build-utils/build/file/cache.js +24 -0
- package/dist/build-utils/build/file/index.d.ts +3 -0
- package/dist/build-utils/build/file/index.js +5 -0
- package/dist/build-utils/build/file/sharding.d.ts +21 -0
- package/dist/build-utils/build/file/sharding.js +38 -0
- package/dist/build-utils/build/index.d.ts +5 -0
- package/dist/build-utils/build/index.js +11 -6
- package/dist/build-utils/build/json.d.ts +3 -0
- package/dist/build-utils/build/json.js +67 -0
- package/dist/build-utils/build/loader/probeLoader.d.ts +2 -2
- package/dist/build-utils/build/loader/probeLoader.js +4 -4
- package/dist/build-utils/build/loader/probeLoaderPlugin.d.ts +1 -1
- package/dist/build-utils/build/loader/probeLoaderPlugin.js +1 -1
- package/dist/build-utils/build/module-graph/index.d.ts +0 -1
- package/dist/build-utils/build/module-graph/index.js +0 -1
- package/dist/build-utils/build/module-graph/parser.d.ts +1 -1
- package/dist/build-utils/build/module-graph/parser.js +1 -1
- package/dist/build-utils/build/module-graph/rspack/transform.d.ts +1 -1
- package/dist/build-utils/build/module-graph/rspack/transform.js +6 -4
- package/dist/build-utils/build/module-graph/utils.d.ts +1 -1
- package/dist/build-utils/build/module-graph/utils.js +5 -4
- package/dist/build-utils/build/process.d.ts +2 -0
- package/dist/build-utils/build/process.js +18 -0
- package/dist/build-utils/build/server.d.ts +15 -0
- package/dist/build-utils/build/server.js +107 -0
- package/dist/build-utils/build/utils/loader.d.ts +2 -2
- package/dist/build-utils/build/utils/loader.js +10 -19
- package/dist/build-utils/build/utils/parseBundle.d.ts +1 -1
- package/dist/build-utils/build/utils/parseBundle.js +6 -8
- package/dist/build-utils/build/utils/plugin.d.ts +1 -1
- package/dist/build-utils/index.d.ts +10 -0
- package/dist/build-utils/index.js +12 -2
- package/dist/collection.d.ts +1 -0
- package/dist/collection.js +2 -0
- package/dist/common/file.d.ts +2 -0
- package/dist/common/file.js +8 -0
- package/dist/common/global-config.d.ts +21 -0
- package/dist/common/global-config.js +33 -0
- package/dist/common/index.d.ts +4 -0
- package/dist/common/index.js +6 -0
- package/dist/common-browser.d.ts +1 -0
- package/dist/common-browser.js +2 -0
- package/dist/error/error.d.ts +35 -0
- package/dist/error/error.js +143 -0
- package/dist/error/index.d.ts +2 -0
- package/dist/error/index.js +3 -0
- package/dist/error/transform.d.ts +3 -0
- package/dist/error/transform.js +138 -0
- package/dist/error/utils.d.ts +4 -0
- package/dist/error/utils.js +23 -0
- package/dist/graph/index.d.ts +1 -0
- package/dist/graph/index.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -2
- package/dist/inner-plugins/loaders/proxy.d.ts +4 -4
- package/dist/inner-plugins/plugins/base.d.ts +1 -1
- package/dist/inner-plugins/plugins/bundle.d.ts +1 -1
- package/dist/inner-plugins/plugins/bundle.js +3 -3
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.ts +3 -3
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.js +11 -39
- package/dist/inner-plugins/plugins/errors.d.ts +2 -2
- package/dist/inner-plugins/plugins/errors.js +3 -3
- package/dist/inner-plugins/plugins/loader.d.ts +1 -1
- package/dist/inner-plugins/plugins/loader.js +7 -19
- package/dist/inner-plugins/plugins/plugins.d.ts +1 -1
- package/dist/inner-plugins/plugins/plugins.js +2 -2
- package/dist/inner-plugins/plugins/progress.d.ts +2 -2
- package/dist/inner-plugins/plugins/progress.js +2 -2
- package/dist/inner-plugins/plugins/resolver.d.ts +1 -1
- package/dist/inner-plugins/plugins/resolver.js +2 -2
- package/dist/inner-plugins/plugins/rspack.d.ts +8 -3
- package/dist/inner-plugins/plugins/rspack.js +18 -4
- package/dist/inner-plugins/plugins/rules.d.ts +1 -1
- package/dist/inner-plugins/plugins/rules.js +3 -3
- package/dist/inner-plugins/plugins/sourcemapTool.d.ts +2 -2
- package/dist/inner-plugins/plugins/sourcemapTool.js +2 -2
- package/dist/inner-plugins/plugins/summary.d.ts +1 -1
- package/dist/inner-plugins/plugins/summary.js +3 -3
- package/dist/inner-plugins/utils/config.d.ts +2 -3
- package/dist/inner-plugins/utils/config.js +16 -17
- package/dist/inner-plugins/utils/loader.d.ts +4 -7
- package/dist/inner-plugins/utils/loader.js +8 -34
- package/dist/inner-plugins/utils/normalize-config.d.ts +1 -1
- package/dist/inner-plugins/utils/openBrowser.d.ts +1 -0
- package/dist/inner-plugins/utils/openBrowser.js +55 -0
- package/dist/inner-plugins/utils/plugin-common.js +4 -4
- package/dist/inner-plugins/utils/plugin.d.ts +1 -1
- package/dist/inner-plugins/utils/plugin.js +1 -1
- package/dist/inner-plugins/utils/sdk.d.ts +2 -3
- package/dist/inner-plugins/utils/sdk.js +2 -2
- package/dist/logger.d.ts +9 -0
- package/dist/logger.js +51 -0
- package/dist/{inner-plugins/constants.d.cts → rspack-plugin/constants.d.ts} +3 -0
- package/dist/rspack-plugin/constants.js +23 -0
- package/dist/rspack-plugin/index.d.ts +2 -0
- package/dist/rspack-plugin/index.js +3 -0
- package/dist/rspack-plugin/multiple.d.ts +8 -0
- package/dist/rspack-plugin/multiple.js +39 -0
- package/dist/rspack-plugin/plugin.d.ts +25 -0
- package/dist/rspack-plugin/plugin.js +133 -0
- package/dist/rule-utils/document/document.d.ts +16 -0
- package/dist/rule-utils/document/document.js +46 -0
- package/dist/rule-utils/document/index.d.ts +3 -0
- package/dist/rule-utils/document/index.js +4 -0
- package/dist/rule-utils/document/server.d.ts +4 -0
- package/dist/rule-utils/document/server.js +13 -0
- package/dist/rule-utils/document/types.d.ts +31 -0
- package/dist/rule-utils/index.d.ts +2 -0
- package/dist/rule-utils/index.js +3 -0
- package/dist/rule-utils/parser/asserts.d.ts +81 -0
- package/dist/rule-utils/parser/asserts.js +105 -0
- package/dist/rule-utils/parser/index.d.ts +4 -0
- package/dist/rule-utils/parser/index.js +5 -0
- package/dist/rule-utils/parser/parser.d.ts +118 -0
- package/dist/rule-utils/parser/parser.js +24 -0
- package/dist/rule-utils/parser/types.d.ts +30 -0
- package/dist/rule-utils/parser/types.js +8 -0
- package/dist/rule-utils/parser/utils.d.ts +30 -0
- package/dist/rule-utils/parser/utils.js +106 -0
- package/dist/rules/linter.d.ts +1 -1
- package/dist/rules/linter.js +1 -1
- package/dist/rules/rule.d.ts +2 -2
- package/dist/rules/rule.js +2 -2
- package/dist/rules/rules/cjs-require/index.d.ts +1 -1
- package/dist/rules/rules/cjs-require/index.js +1 -1
- package/dist/rules/rules/cross-chunks-package/index.d.ts +1 -1
- package/dist/rules/rules/cross-chunks-package/index.js +2 -2
- package/dist/rules/rules/default-import-check/index.d.ts +1 -1
- package/dist/rules/rules/default-import-check/index.js +2 -2
- package/dist/rules/rules/default-import-check/utils.d.ts +2 -2
- package/dist/rules/rules/default-import-check/utils.js +2 -2
- package/dist/rules/rules/duplicate-package/index.d.ts +3 -3
- package/dist/rules/rules/duplicate-package/index.js +3 -3
- package/dist/rules/rules/duplicate-package/utils.d.ts +1 -1
- package/dist/rules/rules/ecma-version-check/index.d.ts +3 -2
- package/dist/rules/rules/ecma-version-check/index.js +1 -1
- package/dist/rules/rules/ecma-version-check/types.d.ts +1 -2
- package/dist/rules/rules/ecma-version-check/utils.d.ts +1 -1
- package/dist/rules/rules/esm-resolved-to-cjs/index.d.ts +1 -1
- package/dist/rules/rules/esm-resolved-to-cjs/index.js +1 -1
- package/dist/rules/rules/index.d.ts +1 -1
- package/dist/rules/rules/loader-performance-optimization/index.d.ts +1 -1
- package/dist/rules/rules/loader-performance-optimization/index.js +2 -2
- package/dist/rules/rules/loader-performance-optimization/types.d.ts +1 -1
- package/dist/rules/rules/module-mixed-chunks/index.d.ts +1 -1
- package/dist/rules/rules/module-mixed-chunks/index.js +1 -1
- package/dist/rules/rules/side-effects-only-imports/index.d.ts +1 -1
- package/dist/rules/rules/side-effects-only-imports/index.js +1 -1
- package/dist/rules/utils.d.ts +1 -1
- package/dist/rules/utils.js +1 -1
- package/dist/sdk/index.d.ts +2 -0
- package/dist/sdk/index.js +3 -0
- package/dist/sdk/multiple/controller.d.ts +12 -0
- package/dist/sdk/multiple/controller.js +42 -0
- package/dist/sdk/multiple/index.d.ts +2 -0
- package/dist/sdk/multiple/index.js +3 -0
- package/dist/sdk/multiple/primary.d.ts +32 -0
- package/dist/sdk/multiple/primary.js +64 -0
- package/dist/sdk/multiple/server.d.ts +7 -0
- package/dist/sdk/multiple/server.js +14 -0
- package/dist/sdk/sdk/core.d.ts +33 -0
- package/dist/sdk/sdk/core.js +163 -0
- package/dist/sdk/sdk/index.d.ts +52 -0
- package/dist/sdk/sdk/index.js +435 -0
- package/dist/sdk/sdk/types.d.ts +26 -0
- package/dist/sdk/sdk/types.js +1 -0
- package/dist/sdk/server/apis/alerts.d.ts +5 -0
- package/dist/sdk/server/apis/alerts.js +30 -0
- package/dist/sdk/server/apis/base.d.ts +11 -0
- package/dist/sdk/server/apis/base.js +22 -0
- package/dist/sdk/server/apis/bundle-diff.d.ts +6 -0
- package/dist/sdk/server/apis/bundle-diff.js +51 -0
- package/dist/sdk/server/apis/data.d.ts +6 -0
- package/dist/sdk/server/apis/data.js +44 -0
- package/dist/sdk/server/apis/fs.d.ts +5 -0
- package/dist/sdk/server/apis/fs.js +28 -0
- package/dist/sdk/server/apis/graph.d.ts +12 -0
- package/dist/sdk/server/apis/graph.js +116 -0
- package/dist/sdk/server/apis/index.d.ts +10 -0
- package/dist/sdk/server/apis/index.js +11 -0
- package/dist/sdk/server/apis/loader.d.ts +15 -0
- package/dist/sdk/server/apis/loader.js +120 -0
- package/dist/sdk/server/apis/plugin.d.ts +6 -0
- package/dist/sdk/server/apis/plugin.js +39 -0
- package/dist/sdk/server/apis/project.d.ts +8 -0
- package/dist/sdk/server/apis/project.js +59 -0
- package/dist/sdk/server/apis/renderer.d.ts +6 -0
- package/dist/sdk/server/apis/renderer.js +33 -0
- package/dist/sdk/server/apis/resolver.d.ts +6 -0
- package/dist/sdk/server/apis/resolver.js +38 -0
- package/dist/sdk/server/client.d.ts +3 -0
- package/dist/sdk/server/client.js +8 -0
- package/dist/sdk/server/fakeServer.d.ts +9 -0
- package/dist/sdk/server/fakeServer.js +12 -0
- package/dist/sdk/server/index.d.ts +44 -0
- package/dist/sdk/server/index.js +292 -0
- package/dist/sdk/server/json-body.d.ts +6 -0
- package/dist/sdk/server/json-body.js +150 -0
- package/dist/sdk/server/router.d.ts +24 -0
- package/dist/sdk/server/router.js +83 -0
- package/dist/sdk/server/security.d.ts +5 -0
- package/dist/sdk/server/security.js +47 -0
- package/dist/sdk/server/socket/api.d.ts +15 -0
- package/dist/sdk/server/socket/api.js +22 -0
- package/dist/sdk/server/socket/index.d.ts +48 -0
- package/dist/sdk/server/socket/index.js +166 -0
- package/dist/sdk/server/utils.d.ts +6 -0
- package/dist/sdk/server/utils.js +19 -0
- package/dist/sdk/utils/base.d.ts +1 -0
- package/dist/sdk/utils/base.js +22 -0
- package/dist/sdk/utils/constant.d.ts +1 -0
- package/dist/sdk/utils/constant.js +4 -0
- package/dist/sdk/utils/index.d.ts +3 -0
- package/dist/sdk/utils/index.js +4 -0
- package/dist/sdk/utils/openBrowser.d.ts +4 -0
- package/dist/sdk/utils/openBrowser.js +53 -0
- package/dist/sdk/utils/upload.d.ts +2 -0
- package/dist/sdk/utils/upload.js +6 -0
- package/dist/sdk.d.ts +1 -0
- package/dist/sdk.js +2 -0
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.js +0 -1
- package/dist/types/loader.d.ts +1 -1
- package/dist/types/plugin.d.ts +7 -28
- package/package.json +127 -58
- package/static/openChrome.applescript +95 -0
- package/dist/build-utils/build/chunks/assetsModules.cjs +0 -42
- package/dist/build-utils/build/chunks/assetsModules.d.cts +0 -17
- package/dist/build-utils/build/chunks/chunkTransform.cjs +0 -39
- package/dist/build-utils/build/chunks/chunkTransform.d.cts +0 -4
- package/dist/build-utils/build/chunks/chunkTransform.d.ts +0 -4
- package/dist/build-utils/build/chunks/chunkTransform.js +0 -6
- package/dist/build-utils/build/chunks/index.cjs +0 -72
- package/dist/build-utils/build/chunks/index.d.cts +0 -3
- package/dist/build-utils/build/chunks/rspack/transform.cjs +0 -80
- package/dist/build-utils/build/chunks/rspack/transform.d.cts +0 -13
- package/dist/build-utils/build/index.cjs +0 -52
- package/dist/build-utils/build/index.d.cts +0 -5
- package/dist/build-utils/build/loader/index.cjs +0 -65
- package/dist/build-utils/build/loader/index.d.cts +0 -2
- package/dist/build-utils/build/loader/probeLoader.cjs +0 -89
- package/dist/build-utils/build/loader/probeLoader.d.cts +0 -4
- package/dist/build-utils/build/loader/probeLoaderPlugin.cjs +0 -65
- package/dist/build-utils/build/loader/probeLoaderPlugin.d.cts +0 -5
- package/dist/build-utils/build/module-graph/index.cjs +0 -65
- package/dist/build-utils/build/module-graph/index.d.cts +0 -2
- package/dist/build-utils/build/module-graph/parser.cjs +0 -46
- package/dist/build-utils/build/module-graph/parser.d.cts +0 -2
- package/dist/build-utils/build/module-graph/rspack/transform.cjs +0 -151
- package/dist/build-utils/build/module-graph/rspack/transform.d.cts +0 -26
- package/dist/build-utils/build/module-graph/transform.cjs +0 -39
- package/dist/build-utils/build/module-graph/transform.d.cts +0 -3
- package/dist/build-utils/build/module-graph/transform.d.ts +0 -3
- package/dist/build-utils/build/module-graph/transform.js +0 -6
- package/dist/build-utils/build/module-graph/utils.cjs +0 -95
- package/dist/build-utils/build/module-graph/utils.d.cts +0 -3
- package/dist/build-utils/build/utils/index.cjs +0 -72
- package/dist/build-utils/build/utils/index.d.cts +0 -3
- package/dist/build-utils/build/utils/loader.cjs +0 -354
- package/dist/build-utils/build/utils/loader.d.cts +0 -20
- package/dist/build-utils/build/utils/parseBundle.cjs +0 -283
- package/dist/build-utils/build/utils/parseBundle.d.cts +0 -12
- package/dist/build-utils/build/utils/plugin.cjs +0 -60
- package/dist/build-utils/build/utils/plugin.d.cts +0 -5
- package/dist/build-utils/index.cjs +0 -36
- package/dist/build-utils/index.d.cts +0 -1
- package/dist/index.cjs +0 -81
- package/dist/index.d.cts +0 -3
- package/dist/inner-plugins/constants.cjs +0 -64
- package/dist/inner-plugins/index.cjs +0 -65
- package/dist/inner-plugins/index.d.cts +0 -2
- package/dist/inner-plugins/loaders/proxy.cjs +0 -104
- package/dist/inner-plugins/loaders/proxy.d.cts +0 -7
- package/dist/inner-plugins/plugins/base.cjs +0 -53
- package/dist/inner-plugins/plugins/base.d.cts +0 -12
- package/dist/inner-plugins/plugins/bundle.cjs +0 -96
- package/dist/inner-plugins/plugins/bundle.d.cts +0 -15
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.cjs +0 -141
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.cts +0 -34
- package/dist/inner-plugins/plugins/errors.cjs +0 -98
- package/dist/inner-plugins/plugins/errors.d.cts +0 -11
- package/dist/inner-plugins/plugins/index.cjs +0 -121
- package/dist/inner-plugins/plugins/index.d.cts +0 -10
- package/dist/inner-plugins/plugins/loader.cjs +0 -165
- package/dist/inner-plugins/plugins/loader.d.cts +0 -10
- package/dist/inner-plugins/plugins/plugins.cjs +0 -73
- package/dist/inner-plugins/plugins/plugins.d.cts +0 -8
- package/dist/inner-plugins/plugins/progress.cjs +0 -68
- package/dist/inner-plugins/plugins/progress.d.cts +0 -8
- package/dist/inner-plugins/plugins/resolver.cjs +0 -90
- package/dist/inner-plugins/plugins/resolver.d.cts +0 -12
- package/dist/inner-plugins/plugins/rspack.cjs +0 -118
- package/dist/inner-plugins/plugins/rspack.d.cts +0 -4
- package/dist/inner-plugins/plugins/rules.cjs +0 -97
- package/dist/inner-plugins/plugins/rules.d.cts +0 -8
- package/dist/inner-plugins/plugins/sourcemapTool.cjs +0 -275
- package/dist/inner-plugins/plugins/sourcemapTool.d.cts +0 -52
- package/dist/inner-plugins/plugins/summary.cjs +0 -125
- package/dist/inner-plugins/plugins/summary.d.cts +0 -14
- package/dist/inner-plugins/utils/circleDetect.cjs +0 -49
- package/dist/inner-plugins/utils/circleDetect.d.cts +0 -4
- package/dist/inner-plugins/utils/config.cjs +0 -191
- package/dist/inner-plugins/utils/config.d.cts +0 -5
- package/dist/inner-plugins/utils/index.cjs +0 -106
- package/dist/inner-plugins/utils/index.d.cts +0 -9
- package/dist/inner-plugins/utils/loader.cjs +0 -218
- package/dist/inner-plugins/utils/loader.d.cts +0 -13
- package/dist/inner-plugins/utils/normalize-config.cjs +0 -122
- package/dist/inner-plugins/utils/normalize-config.d.cts +0 -37
- package/dist/inner-plugins/utils/plugin-common.cjs +0 -143
- package/dist/inner-plugins/utils/plugin-common.d.cts +0 -11
- package/dist/inner-plugins/utils/plugin.cjs +0 -106
- package/dist/inner-plugins/utils/plugin.d.cts +0 -4
- package/dist/inner-plugins/utils/sdk.cjs +0 -55
- package/dist/inner-plugins/utils/sdk.d.cts +0 -8
- package/dist/rslib-runtime.js +0 -19
- package/dist/rules/index.cjs +0 -81
- package/dist/rules/index.d.cts +0 -3
- package/dist/rules/linter.cjs +0 -72
- package/dist/rules/linter.d.cts +0 -9
- package/dist/rules/rule.cjs +0 -137
- package/dist/rules/rule.d.cts +0 -27
- package/dist/rules/rules/cjs-require/index.cjs +0 -83
- package/dist/rules/rules/cjs-require/index.d.cts +0 -4
- package/dist/rules/rules/cjs-require/types.cjs +0 -18
- package/dist/rules/rules/cjs-require/types.d.cts +0 -7
- package/dist/rules/rules/cross-chunks-package/index.cjs +0 -74
- package/dist/rules/rules/cross-chunks-package/index.d.cts +0 -4
- package/dist/rules/rules/cross-chunks-package/types.cjs +0 -18
- package/dist/rules/rules/cross-chunks-package/types.d.cts +0 -3
- package/dist/rules/rules/cross-chunks-package/utils.cjs +0 -40
- package/dist/rules/rules/cross-chunks-package/utils.d.cts +0 -1
- package/dist/rules/rules/default-import-check/index.cjs +0 -116
- package/dist/rules/rules/default-import-check/index.d.cts +0 -4
- package/dist/rules/rules/default-import-check/types.cjs +0 -18
- package/dist/rules/rules/default-import-check/types.d.cts +0 -4
- package/dist/rules/rules/default-import-check/utils.cjs +0 -97
- package/dist/rules/rules/default-import-check/utils.d.cts +0 -10
- package/dist/rules/rules/duplicate-package/index.cjs +0 -72
- package/dist/rules/rules/duplicate-package/index.d.cts +0 -4
- package/dist/rules/rules/duplicate-package/types.cjs +0 -60
- package/dist/rules/rules/duplicate-package/types.d.cts +0 -24
- package/dist/rules/rules/duplicate-package/utils.cjs +0 -84
- package/dist/rules/rules/duplicate-package/utils.d.cts +0 -3
- package/dist/rules/rules/ecma-version-check/index.cjs +0 -96
- package/dist/rules/rules/ecma-version-check/index.d.cts +0 -4
- package/dist/rules/rules/ecma-version-check/types.cjs +0 -18
- package/dist/rules/rules/ecma-version-check/types.d.cts +0 -3
- package/dist/rules/rules/ecma-version-check/utils.cjs +0 -39
- package/dist/rules/rules/ecma-version-check/utils.d.cts +0 -2
- package/dist/rules/rules/esm-resolved-to-cjs/index.cjs +0 -237
- package/dist/rules/rules/esm-resolved-to-cjs/index.d.cts +0 -4
- package/dist/rules/rules/esm-resolved-to-cjs/types.cjs +0 -18
- package/dist/rules/rules/esm-resolved-to-cjs/types.d.cts +0 -8
- package/dist/rules/rules/index.cjs +0 -55
- package/dist/rules/rules/index.d.cts +0 -2
- package/dist/rules/rules/loader-performance-optimization/index.cjs +0 -119
- package/dist/rules/rules/loader-performance-optimization/index.d.cts +0 -4
- package/dist/rules/rules/loader-performance-optimization/types.cjs +0 -18
- package/dist/rules/rules/loader-performance-optimization/types.d.cts +0 -22
- package/dist/rules/rules/loader-performance-optimization/utils.cjs +0 -43
- package/dist/rules/rules/loader-performance-optimization/utils.d.cts +0 -1
- package/dist/rules/rules/module-mixed-chunks/index.cjs +0 -85
- package/dist/rules/rules/module-mixed-chunks/index.d.cts +0 -4
- package/dist/rules/rules/module-mixed-chunks/types.cjs +0 -18
- package/dist/rules/rules/module-mixed-chunks/types.d.cts +0 -3
- package/dist/rules/rules/side-effects-only-imports/index.cjs +0 -114
- package/dist/rules/rules/side-effects-only-imports/index.d.cts +0 -4
- package/dist/rules/rules/side-effects-only-imports/types.cjs +0 -18
- package/dist/rules/rules/side-effects-only-imports/types.d.cts +0 -9
- package/dist/rules/utils.cjs +0 -46
- package/dist/rules/utils.d.cts +0 -3
- package/dist/types/chunks.cjs +0 -18
- package/dist/types/chunks.d.cts +0 -6
- package/dist/types/chunks.d.ts +0 -6
- package/dist/types/index.cjs +0 -79
- package/dist/types/index.d.cts +0 -4
- package/dist/types/loader.cjs +0 -18
- package/dist/types/loader.d.cts +0 -19
- package/dist/types/plugin.cjs +0 -18
- package/dist/types/plugin.d.cts +0 -51
- package/dist/types/rules.cjs +0 -18
- package/dist/types/rules.d.cts +0 -7
- /package/dist/{types/chunks.js → rule-utils/document/types.js} +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import { SDK } from "@rsdoctor/shared/types";
|
|
3
|
+
import { BaseAPI } from "./base.js";
|
|
4
|
+
import { Router } from "../router.js";
|
|
5
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
6
|
+
var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
|
|
8
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
|
+
}
|
|
11
|
+
function _ts_metadata(k, v) {
|
|
12
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
13
|
+
}
|
|
14
|
+
class FileSystemAPI extends BaseAPI {
|
|
15
|
+
async applyErrorFix() {
|
|
16
|
+
const { body } = this.ctx.req;
|
|
17
|
+
const data = body;
|
|
18
|
+
await this.ctx.sdk.applyErrorFix(data.id);
|
|
19
|
+
return 'success';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
_ts_decorate([
|
|
23
|
+
Router.post(SDK.ServerAPI.API.ApplyErrorFix),
|
|
24
|
+
_ts_metadata("design:type", Function),
|
|
25
|
+
_ts_metadata("design:paramtypes", []),
|
|
26
|
+
_ts_metadata("design:returntype", Promise)
|
|
27
|
+
], FileSystemAPI.prototype, "applyErrorFix", null);
|
|
28
|
+
export { FileSystemAPI };
|
|
@@ -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,116 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import { SDK } from "@rsdoctor/shared/types";
|
|
3
|
+
import { BaseAPI } from "./base.js";
|
|
4
|
+
import { Router } from "../router.js";
|
|
5
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
6
|
+
var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
|
|
8
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
|
+
}
|
|
11
|
+
function _ts_metadata(k, v) {
|
|
12
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
13
|
+
}
|
|
14
|
+
class GraphAPI extends BaseAPI {
|
|
15
|
+
async getAssetsSummary() {
|
|
16
|
+
const { req } = this.ctx;
|
|
17
|
+
const { withFileContent } = req.body;
|
|
18
|
+
return this.dataLoader.loadAPI(SDK.ServerAPI.API.GetAssetsSummary, {
|
|
19
|
+
withFileContent
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
async getModuleGraphForAsset() {
|
|
23
|
+
const { req } = this.ctx;
|
|
24
|
+
const { assetPath } = req.body;
|
|
25
|
+
return this.dataLoader.loadAPI(SDK.ServerAPI.API.GetAssetDetails, {
|
|
26
|
+
assetPath
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
async getChunksByModuleId() {
|
|
30
|
+
const { req } = this.ctx;
|
|
31
|
+
const { moduleId } = req.body;
|
|
32
|
+
return this.dataLoader.loadAPI(SDK.ServerAPI.API.GetChunksByModuleId, {
|
|
33
|
+
moduleId
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
async getModuleDetails() {
|
|
37
|
+
const { req } = this.ctx;
|
|
38
|
+
const { moduleId } = req.body;
|
|
39
|
+
return this.dataLoader.loadAPI(SDK.ServerAPI.API.GetModuleDetails, {
|
|
40
|
+
moduleId
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
async getDependencyByResolvedRequest() {
|
|
44
|
+
const { req } = this.ctx;
|
|
45
|
+
const { moduleIds = [] } = req.body;
|
|
46
|
+
return this.dataLoader.loadAPI(SDK.ServerAPI.API.GetModulesByModuleIds, {
|
|
47
|
+
moduleIds
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
async getModuleCodeByModuleId() {
|
|
51
|
+
const { req } = this.ctx;
|
|
52
|
+
const { moduleId } = req.body;
|
|
53
|
+
return this.dataLoader.loadAPI(SDK.ServerAPI.API.GetModuleCodeByModuleId, {
|
|
54
|
+
moduleId
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
async getModuleCodeByModuleIds() {
|
|
58
|
+
const { req } = this.ctx;
|
|
59
|
+
const { moduleIds } = req.body;
|
|
60
|
+
return this.dataLoader.loadAPI(SDK.ServerAPI.API.GetModuleCodeByModuleIds, {
|
|
61
|
+
moduleIds
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
async getEntryModulesSummary() {
|
|
65
|
+
return this.dataLoader.loadAPI(SDK.ServerAPI.API.GetEntryPoints);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
_ts_decorate([
|
|
69
|
+
Router.post(SDK.ServerAPI.API.GetAssetsSummary),
|
|
70
|
+
_ts_metadata("design:type", Function),
|
|
71
|
+
_ts_metadata("design:paramtypes", []),
|
|
72
|
+
_ts_metadata("design:returntype", Promise)
|
|
73
|
+
], GraphAPI.prototype, "getAssetsSummary", null);
|
|
74
|
+
_ts_decorate([
|
|
75
|
+
Router.post(SDK.ServerAPI.API.GetAssetDetails),
|
|
76
|
+
_ts_metadata("design:type", Function),
|
|
77
|
+
_ts_metadata("design:paramtypes", []),
|
|
78
|
+
_ts_metadata("design:returntype", Promise)
|
|
79
|
+
], GraphAPI.prototype, "getModuleGraphForAsset", null);
|
|
80
|
+
_ts_decorate([
|
|
81
|
+
Router.post(SDK.ServerAPI.API.GetChunksByModuleId),
|
|
82
|
+
_ts_metadata("design:type", Function),
|
|
83
|
+
_ts_metadata("design:paramtypes", []),
|
|
84
|
+
_ts_metadata("design:returntype", Promise)
|
|
85
|
+
], GraphAPI.prototype, "getChunksByModuleId", null);
|
|
86
|
+
_ts_decorate([
|
|
87
|
+
Router.post(SDK.ServerAPI.API.GetModuleDetails),
|
|
88
|
+
_ts_metadata("design:type", Function),
|
|
89
|
+
_ts_metadata("design:paramtypes", []),
|
|
90
|
+
_ts_metadata("design:returntype", Promise)
|
|
91
|
+
], GraphAPI.prototype, "getModuleDetails", null);
|
|
92
|
+
_ts_decorate([
|
|
93
|
+
Router.post(SDK.ServerAPI.API.GetModulesByModuleIds),
|
|
94
|
+
_ts_metadata("design:type", Function),
|
|
95
|
+
_ts_metadata("design:paramtypes", []),
|
|
96
|
+
_ts_metadata("design:returntype", Promise)
|
|
97
|
+
], GraphAPI.prototype, "getDependencyByResolvedRequest", null);
|
|
98
|
+
_ts_decorate([
|
|
99
|
+
Router.post(SDK.ServerAPI.API.GetModuleCodeByModuleId),
|
|
100
|
+
_ts_metadata("design:type", Function),
|
|
101
|
+
_ts_metadata("design:paramtypes", []),
|
|
102
|
+
_ts_metadata("design:returntype", Promise)
|
|
103
|
+
], GraphAPI.prototype, "getModuleCodeByModuleId", null);
|
|
104
|
+
_ts_decorate([
|
|
105
|
+
Router.post(SDK.ServerAPI.API.GetModuleCodeByModuleIds),
|
|
106
|
+
_ts_metadata("design:type", Function),
|
|
107
|
+
_ts_metadata("design:paramtypes", []),
|
|
108
|
+
_ts_metadata("design:returntype", Promise)
|
|
109
|
+
], GraphAPI.prototype, "getModuleCodeByModuleIds", null);
|
|
110
|
+
_ts_decorate([
|
|
111
|
+
Router.post(SDK.ServerAPI.API.GetEntryPoints),
|
|
112
|
+
_ts_metadata("design:type", Function),
|
|
113
|
+
_ts_metadata("design:paramtypes", []),
|
|
114
|
+
_ts_metadata("design:returntype", Promise)
|
|
115
|
+
], GraphAPI.prototype, "getEntryModulesSummary", null);
|
|
116
|
+
export { GraphAPI };
|
|
@@ -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,11 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
export * from "./alerts.js";
|
|
3
|
+
export * from "./bundle-diff.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";
|
|
11
|
+
export { DataAPI } from "./data.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,120 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import { SDK } from "@rsdoctor/shared/types";
|
|
3
|
+
import { BaseAPI } from "./base.js";
|
|
4
|
+
import { Router } from "../router.js";
|
|
5
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
6
|
+
var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
|
|
8
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
|
+
}
|
|
11
|
+
function _ts_metadata(k, v) {
|
|
12
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
13
|
+
}
|
|
14
|
+
class LoaderAPI extends BaseAPI {
|
|
15
|
+
async reportLoader() {
|
|
16
|
+
const { req, sdk } = this.ctx;
|
|
17
|
+
const { body } = req;
|
|
18
|
+
sdk.reportLoader(body);
|
|
19
|
+
return 'ok';
|
|
20
|
+
}
|
|
21
|
+
async reportSourceMap() {
|
|
22
|
+
const { req: { body }, sdk } = this.ctx;
|
|
23
|
+
sdk.reportSourceMap(body);
|
|
24
|
+
return 'ok';
|
|
25
|
+
}
|
|
26
|
+
async getLoaderNames() {
|
|
27
|
+
return this.dataLoader.loadAPI(SDK.ServerAPI.API.GetLoaderNames);
|
|
28
|
+
}
|
|
29
|
+
async getLoaderChartData() {
|
|
30
|
+
return this.dataLoader.loadAPI(SDK.ServerAPI.API.GetLoaderChartData);
|
|
31
|
+
}
|
|
32
|
+
async getLoaderFileTree() {
|
|
33
|
+
return this.dataLoader.loadAPI(SDK.ServerAPI.API.GetLoaderFileTree);
|
|
34
|
+
}
|
|
35
|
+
async getLoaderFileDetails() {
|
|
36
|
+
const { req } = this.ctx;
|
|
37
|
+
const { path } = req.body;
|
|
38
|
+
return this.dataLoader.loadAPI(SDK.ServerAPI.API.GetLoaderFileDetails, {
|
|
39
|
+
path
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
async getLoaderFolderStatistics() {
|
|
43
|
+
const { req } = this.ctx;
|
|
44
|
+
const { folder } = req.body;
|
|
45
|
+
return this.dataLoader.loadAPI(SDK.ServerAPI.API.GetLoaderFolderStatistics, {
|
|
46
|
+
folder
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
async getLoaderFileFirstInput() {
|
|
50
|
+
const { req } = this.ctx;
|
|
51
|
+
const { file } = req.body;
|
|
52
|
+
return this.dataLoader.loadAPI(SDK.ServerAPI.API.GetLoaderFileFirstInput, {
|
|
53
|
+
file
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
async getLoaderFileInputAndOutput() {
|
|
57
|
+
const { req } = this.ctx;
|
|
58
|
+
const { file, loader, loaderIndex } = req.body;
|
|
59
|
+
return this.dataLoader.loadAPI(SDK.ServerAPI.API.GetLoaderFileInputAndOutput, {
|
|
60
|
+
file,
|
|
61
|
+
loader,
|
|
62
|
+
loaderIndex
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
_ts_decorate([
|
|
67
|
+
Router.post(SDK.ServerAPI.API.ReportLoader),
|
|
68
|
+
_ts_metadata("design:type", Function),
|
|
69
|
+
_ts_metadata("design:paramtypes", []),
|
|
70
|
+
_ts_metadata("design:returntype", Promise)
|
|
71
|
+
], LoaderAPI.prototype, "reportLoader", null);
|
|
72
|
+
_ts_decorate([
|
|
73
|
+
Router.post(SDK.ServerAPI.API.ReportSourceMap),
|
|
74
|
+
_ts_metadata("design:type", Function),
|
|
75
|
+
_ts_metadata("design:paramtypes", []),
|
|
76
|
+
_ts_metadata("design:returntype", Promise)
|
|
77
|
+
], LoaderAPI.prototype, "reportSourceMap", null);
|
|
78
|
+
_ts_decorate([
|
|
79
|
+
Router.post(SDK.ServerAPI.API.GetLoaderNames),
|
|
80
|
+
_ts_metadata("design:type", Function),
|
|
81
|
+
_ts_metadata("design:paramtypes", []),
|
|
82
|
+
_ts_metadata("design:returntype", Promise)
|
|
83
|
+
], LoaderAPI.prototype, "getLoaderNames", null);
|
|
84
|
+
_ts_decorate([
|
|
85
|
+
Router.post(SDK.ServerAPI.API.GetLoaderChartData),
|
|
86
|
+
_ts_metadata("design:type", Function),
|
|
87
|
+
_ts_metadata("design:paramtypes", []),
|
|
88
|
+
_ts_metadata("design:returntype", Promise)
|
|
89
|
+
], LoaderAPI.prototype, "getLoaderChartData", null);
|
|
90
|
+
_ts_decorate([
|
|
91
|
+
Router.post(SDK.ServerAPI.API.GetLoaderFileTree),
|
|
92
|
+
_ts_metadata("design:type", Function),
|
|
93
|
+
_ts_metadata("design:paramtypes", []),
|
|
94
|
+
_ts_metadata("design:returntype", Promise)
|
|
95
|
+
], LoaderAPI.prototype, "getLoaderFileTree", null);
|
|
96
|
+
_ts_decorate([
|
|
97
|
+
Router.post(SDK.ServerAPI.API.GetLoaderFileDetails),
|
|
98
|
+
_ts_metadata("design:type", Function),
|
|
99
|
+
_ts_metadata("design:paramtypes", []),
|
|
100
|
+
_ts_metadata("design:returntype", Promise)
|
|
101
|
+
], LoaderAPI.prototype, "getLoaderFileDetails", null);
|
|
102
|
+
_ts_decorate([
|
|
103
|
+
Router.post(SDK.ServerAPI.API.GetLoaderFolderStatistics),
|
|
104
|
+
_ts_metadata("design:type", Function),
|
|
105
|
+
_ts_metadata("design:paramtypes", []),
|
|
106
|
+
_ts_metadata("design:returntype", Promise)
|
|
107
|
+
], LoaderAPI.prototype, "getLoaderFolderStatistics", null);
|
|
108
|
+
_ts_decorate([
|
|
109
|
+
Router.post(SDK.ServerAPI.API.GetLoaderFileFirstInput),
|
|
110
|
+
_ts_metadata("design:type", Function),
|
|
111
|
+
_ts_metadata("design:paramtypes", []),
|
|
112
|
+
_ts_metadata("design:returntype", Promise)
|
|
113
|
+
], LoaderAPI.prototype, "getLoaderFileFirstInput", null);
|
|
114
|
+
_ts_decorate([
|
|
115
|
+
Router.post(SDK.ServerAPI.API.GetLoaderFileInputAndOutput),
|
|
116
|
+
_ts_metadata("design:type", Function),
|
|
117
|
+
_ts_metadata("design:paramtypes", []),
|
|
118
|
+
_ts_metadata("design:returntype", Promise)
|
|
119
|
+
], LoaderAPI.prototype, "getLoaderFileInputAndOutput", null);
|
|
120
|
+
export { LoaderAPI };
|
|
@@ -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,39 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import { SDK } from "@rsdoctor/shared/types";
|
|
3
|
+
import { BaseAPI } from "./base.js";
|
|
4
|
+
import { Router } from "../router.js";
|
|
5
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
6
|
+
var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
|
|
8
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
|
+
}
|
|
11
|
+
function _ts_metadata(k, v) {
|
|
12
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
13
|
+
}
|
|
14
|
+
class PluginAPI extends BaseAPI {
|
|
15
|
+
async getPluginSummary() {
|
|
16
|
+
return this.dataLoader.loadAPI(SDK.ServerAPI.API.GetPluginSummary);
|
|
17
|
+
}
|
|
18
|
+
async getPluginData() {
|
|
19
|
+
const { req } = this.ctx;
|
|
20
|
+
const { hooks = [], tapNames = [] } = req.body;
|
|
21
|
+
return this.dataLoader.loadAPI(SDK.ServerAPI.API.GetPluginData, {
|
|
22
|
+
hooks,
|
|
23
|
+
tapNames
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
_ts_decorate([
|
|
28
|
+
Router.post(SDK.ServerAPI.API.GetPluginSummary),
|
|
29
|
+
_ts_metadata("design:type", Function),
|
|
30
|
+
_ts_metadata("design:paramtypes", []),
|
|
31
|
+
_ts_metadata("design:returntype", Promise)
|
|
32
|
+
], PluginAPI.prototype, "getPluginSummary", null);
|
|
33
|
+
_ts_decorate([
|
|
34
|
+
Router.post(SDK.ServerAPI.API.GetPluginData),
|
|
35
|
+
_ts_metadata("design:type", Function),
|
|
36
|
+
_ts_metadata("design:paramtypes", []),
|
|
37
|
+
_ts_metadata("design:returntype", Promise)
|
|
38
|
+
], PluginAPI.prototype, "getPluginData", null);
|
|
39
|
+
export { PluginAPI };
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import { SDK } from "@rsdoctor/shared/types";
|
|
3
|
+
import { BaseAPI } from "./base.js";
|
|
4
|
+
import { Router } from "../router.js";
|
|
5
|
+
import { getLocalIpAddress } from "../utils.js";
|
|
6
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
7
|
+
var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
|
|
9
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
10
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11
|
+
}
|
|
12
|
+
function _ts_metadata(k, v) {
|
|
13
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
14
|
+
}
|
|
15
|
+
class ProjectAPI extends BaseAPI {
|
|
16
|
+
async env() {
|
|
17
|
+
const { server } = this.ctx;
|
|
18
|
+
return {
|
|
19
|
+
ip: getLocalIpAddress(),
|
|
20
|
+
port: server.port
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
async manifest() {
|
|
24
|
+
const { sdk } = this.ctx;
|
|
25
|
+
const data = sdk.getManifestData();
|
|
26
|
+
return JSON.stringify(data);
|
|
27
|
+
}
|
|
28
|
+
async getProjectInfo() {
|
|
29
|
+
return this.dataLoader.loadAPI(SDK.ServerAPI.API.GetProjectInfo);
|
|
30
|
+
}
|
|
31
|
+
async getClientRoutes() {
|
|
32
|
+
return this.dataLoader.loadAPI(SDK.ServerAPI.API.GetClientRoutes);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
_ts_decorate([
|
|
36
|
+
Router.get(SDK.ServerAPI.API.Env),
|
|
37
|
+
_ts_metadata("design:type", Function),
|
|
38
|
+
_ts_metadata("design:paramtypes", []),
|
|
39
|
+
_ts_metadata("design:returntype", Promise)
|
|
40
|
+
], ProjectAPI.prototype, "env", null);
|
|
41
|
+
_ts_decorate([
|
|
42
|
+
Router.get(SDK.ServerAPI.API.Manifest),
|
|
43
|
+
_ts_metadata("design:type", Function),
|
|
44
|
+
_ts_metadata("design:paramtypes", []),
|
|
45
|
+
_ts_metadata("design:returntype", Promise)
|
|
46
|
+
], ProjectAPI.prototype, "manifest", null);
|
|
47
|
+
_ts_decorate([
|
|
48
|
+
Router.post(SDK.ServerAPI.API.GetProjectInfo),
|
|
49
|
+
_ts_metadata("design:type", Function),
|
|
50
|
+
_ts_metadata("design:paramtypes", []),
|
|
51
|
+
_ts_metadata("design:returntype", Promise)
|
|
52
|
+
], ProjectAPI.prototype, "getProjectInfo", null);
|
|
53
|
+
_ts_decorate([
|
|
54
|
+
Router.post(SDK.ServerAPI.API.GetClientRoutes),
|
|
55
|
+
_ts_metadata("design:type", Function),
|
|
56
|
+
_ts_metadata("design:paramtypes", []),
|
|
57
|
+
_ts_metadata("design:returntype", Promise)
|
|
58
|
+
], ProjectAPI.prototype, "getClientRoutes", null);
|
|
59
|
+
export { ProjectAPI };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import { SDK } from "@rsdoctor/shared/types";
|
|
3
|
+
import node_fs from "node:fs";
|
|
4
|
+
import { createRequire } from "module";
|
|
5
|
+
import { BaseAPI } from "./base.js";
|
|
6
|
+
import { Router } from "../router.js";
|
|
7
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
8
|
+
var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
|
|
10
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
11
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12
|
+
}
|
|
13
|
+
function _ts_metadata(k, v) {
|
|
14
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
15
|
+
}
|
|
16
|
+
const renderer_require = createRequire(import.meta.url);
|
|
17
|
+
class RendererAPI extends BaseAPI {
|
|
18
|
+
async entryHtml() {
|
|
19
|
+
const { server, res } = this.ctx;
|
|
20
|
+
const clientHtmlPath = server.innerClientPath ? server.innerClientPath : renderer_require.resolve('@rsdoctor/client');
|
|
21
|
+
const clientHtml = node_fs.readFileSync(clientHtmlPath, 'utf-8');
|
|
22
|
+
res.setHeader('Content-Type', 'text/html');
|
|
23
|
+
res.setHeader('Cache-Control', 'no-store');
|
|
24
|
+
return clientHtml;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
_ts_decorate([
|
|
28
|
+
Router.get(SDK.ServerAPI.API.EntryHtml),
|
|
29
|
+
_ts_metadata("design:type", Function),
|
|
30
|
+
_ts_metadata("design:paramtypes", []),
|
|
31
|
+
_ts_metadata("design:returntype", Promise)
|
|
32
|
+
], RendererAPI.prototype, "entryHtml", null);
|
|
33
|
+
export { RendererAPI };
|
|
@@ -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,38 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import { SDK } from "@rsdoctor/shared/types";
|
|
3
|
+
import { BaseAPI } from "./base.js";
|
|
4
|
+
import { Router } from "../router.js";
|
|
5
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
6
|
+
var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
|
|
8
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
|
+
}
|
|
11
|
+
function _ts_metadata(k, v) {
|
|
12
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
13
|
+
}
|
|
14
|
+
class ResolverAPI extends BaseAPI {
|
|
15
|
+
async getResolverFileTree() {
|
|
16
|
+
return this.dataLoader.loadAPI(SDK.ServerAPI.API.GetResolverFileTree);
|
|
17
|
+
}
|
|
18
|
+
async getResolverFileDetails() {
|
|
19
|
+
const { req } = this.ctx;
|
|
20
|
+
const { filepath } = req.body;
|
|
21
|
+
return this.dataLoader.loadAPI(SDK.ServerAPI.API.GetResolverFileDetails, {
|
|
22
|
+
filepath
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
_ts_decorate([
|
|
27
|
+
Router.post(SDK.ServerAPI.API.GetResolverFileTree),
|
|
28
|
+
_ts_metadata("design:type", Function),
|
|
29
|
+
_ts_metadata("design:paramtypes", []),
|
|
30
|
+
_ts_metadata("design:returntype", Promise)
|
|
31
|
+
], ResolverAPI.prototype, "getResolverFileTree", null);
|
|
32
|
+
_ts_decorate([
|
|
33
|
+
Router.post(SDK.ServerAPI.API.GetResolverFileDetails),
|
|
34
|
+
_ts_metadata("design:type", Function),
|
|
35
|
+
_ts_metadata("design:paramtypes", []),
|
|
36
|
+
_ts_metadata("design:returntype", Promise)
|
|
37
|
+
], ResolverAPI.prototype, "getResolverFileDetails", null);
|
|
38
|
+
export { ResolverAPI };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { createRequire } from "module";
|
|
4
|
+
const client_require = createRequire(import.meta.url);
|
|
5
|
+
const resolveClientHtmlPath = (innerClientPath)=>innerClientPath || client_require.resolve('@rsdoctor/client');
|
|
6
|
+
const resolveClientDistPath = (innerClientPath)=>path.dirname(resolveClientHtmlPath(innerClientPath));
|
|
7
|
+
const resolveClientDiffHtmlPath = (innerClientPath)=>path.resolve(resolveClientDistPath(innerClientPath), 'diff.html');
|
|
8
|
+
export { resolveClientDiffHtmlPath, resolveClientDistPath, resolveClientHtmlPath };
|
|
@@ -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,12 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import { Server } from "../../build-utils/index.js";
|
|
3
|
+
import { RsdoctorServer } from "./index.js";
|
|
4
|
+
class RsdoctorFakeServer extends RsdoctorServer {
|
|
5
|
+
async bootstrap() {}
|
|
6
|
+
async openClientPage() {}
|
|
7
|
+
constructor(sdk, port = Server.defaultPort){
|
|
8
|
+
super(sdk, port), this.sdk = sdk, this.dispose = async ()=>{};
|
|
9
|
+
this.sdk = sdk;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export { RsdoctorFakeServer };
|
|
@@ -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
|
+
}
|