@rsdoctor/core 2.0.0-alpha.1 → 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.
Files changed (167) hide show
  1. package/dist/26.js +26163 -0
  2. package/dist/630.js +1269 -0
  3. package/dist/630.js.LICENSE.txt +7 -0
  4. package/dist/build-utils/build/chunks/assetsModules.d.ts +7 -1
  5. package/dist/build-utils/build/loader/probeLoader.d.ts +7 -2
  6. package/dist/build-utils/build/utils/parseBundle.d.ts +1 -1
  7. package/dist/index.d.ts +5 -5
  8. package/dist/index.js +1725 -7
  9. package/dist/inner-plugins/constants.d.ts +1 -1
  10. package/dist/inner-plugins/plugins/base.d.ts +2 -2
  11. package/dist/logger.d.ts +2 -2
  12. package/dist/probe-loader.js +2 -0
  13. package/dist/proxy-loader.d.ts +1 -0
  14. package/dist/proxy-loader.js +48 -0
  15. package/dist/rslib-runtime.js +28 -0
  16. package/dist/rspack-plugin/constants.d.ts +1 -1
  17. package/dist/rules/rules/ecma-version-check/htmlParserStub.d.ts +3 -0
  18. package/dist/rules/rules/ecma-version-check/types.d.ts +13 -2
  19. package/dist/sdk/server/apis/base.d.ts +1 -1
  20. package/dist/sdk/server/socket/api.d.ts +1 -1
  21. package/dist/sdk/utils/date.d.ts +1 -0
  22. package/dist/types/loader.d.ts +1 -1
  23. package/package.json +20 -113
  24. package/dist/build-utils/build/chunks/assetsModules.js +0 -9
  25. package/dist/build-utils/build/chunks/index.js +0 -3
  26. package/dist/build-utils/build/chunks/rspack/transform.js +0 -44
  27. package/dist/build-utils/build/envinfo.js +0 -60
  28. package/dist/build-utils/build/file/cache.js +0 -24
  29. package/dist/build-utils/build/file/index.js +0 -5
  30. package/dist/build-utils/build/file/sharding.js +0 -38
  31. package/dist/build-utils/build/index.js +0 -12
  32. package/dist/build-utils/build/json.js +0 -67
  33. package/dist/build-utils/build/loader/index.js +0 -3
  34. package/dist/build-utils/build/loader/probeLoader.js +0 -44
  35. package/dist/build-utils/build/loader/probeLoaderPlugin.js +0 -32
  36. package/dist/build-utils/build/module-graph/index.js +0 -2
  37. package/dist/build-utils/build/module-graph/parser.js +0 -13
  38. package/dist/build-utils/build/module-graph/rspack/transform.js +0 -111
  39. package/dist/build-utils/build/module-graph/utils.js +0 -60
  40. package/dist/build-utils/build/process.js +0 -18
  41. package/dist/build-utils/build/server.js +0 -107
  42. package/dist/build-utils/build/utils/index.js +0 -4
  43. package/dist/build-utils/build/utils/loader.js +0 -267
  44. package/dist/build-utils/build/utils/parseBundle.js +0 -238
  45. package/dist/build-utils/build/utils/plugin.js +0 -21
  46. package/dist/build-utils/index.js +0 -13
  47. package/dist/collection.d.ts +0 -1
  48. package/dist/collection.js +0 -2
  49. package/dist/common/file.js +0 -8
  50. package/dist/common/global-config.js +0 -33
  51. package/dist/common/index.d.ts +0 -4
  52. package/dist/common/index.js +0 -6
  53. package/dist/common-browser.d.ts +0 -1
  54. package/dist/common-browser.js +0 -2
  55. package/dist/error/error.js +0 -143
  56. package/dist/error/index.js +0 -3
  57. package/dist/error/transform.js +0 -138
  58. package/dist/error/utils.js +0 -23
  59. package/dist/graph/index.d.ts +0 -1
  60. package/dist/graph/index.js +0 -2
  61. package/dist/inner-plugins/constants.js +0 -19
  62. package/dist/inner-plugins/index.js +0 -3
  63. package/dist/inner-plugins/loaders/proxy.js +0 -65
  64. package/dist/inner-plugins/plugins/base.js +0 -20
  65. package/dist/inner-plugins/plugins/bundle.js +0 -63
  66. package/dist/inner-plugins/plugins/ensureModulesChunkGraph.js +0 -74
  67. package/dist/inner-plugins/plugins/errors.js +0 -65
  68. package/dist/inner-plugins/plugins/index.js +0 -11
  69. package/dist/inner-plugins/plugins/loader.js +0 -108
  70. package/dist/inner-plugins/plugins/plugins.js +0 -40
  71. package/dist/inner-plugins/plugins/progress.js +0 -35
  72. package/dist/inner-plugins/plugins/resolver.js +0 -57
  73. package/dist/inner-plugins/plugins/rspack.js +0 -99
  74. package/dist/inner-plugins/plugins/rules.js +0 -64
  75. package/dist/inner-plugins/plugins/sourcemapTool.js +0 -230
  76. package/dist/inner-plugins/plugins/summary.js +0 -92
  77. package/dist/inner-plugins/utils/circleDetect.js +0 -16
  78. package/dist/inner-plugins/utils/config.js +0 -141
  79. package/dist/inner-plugins/utils/index.js +0 -8
  80. package/dist/inner-plugins/utils/loader.js +0 -134
  81. package/dist/inner-plugins/utils/normalize-config.js +0 -77
  82. package/dist/inner-plugins/utils/openBrowser.js +0 -55
  83. package/dist/inner-plugins/utils/plugin-common.js +0 -94
  84. package/dist/inner-plugins/utils/plugin.js +0 -70
  85. package/dist/inner-plugins/utils/sdk.js +0 -19
  86. package/dist/logger.js +0 -51
  87. package/dist/rspack-plugin/constants.js +0 -23
  88. package/dist/rspack-plugin/index.js +0 -3
  89. package/dist/rspack-plugin/multiple.js +0 -39
  90. package/dist/rspack-plugin/plugin.js +0 -133
  91. package/dist/rule-utils/document/document.js +0 -46
  92. package/dist/rule-utils/document/index.js +0 -4
  93. package/dist/rule-utils/document/server.js +0 -13
  94. package/dist/rule-utils/document/types.js +0 -1
  95. package/dist/rule-utils/index.js +0 -3
  96. package/dist/rule-utils/parser/asserts.js +0 -105
  97. package/dist/rule-utils/parser/index.js +0 -5
  98. package/dist/rule-utils/parser/parser.js +0 -24
  99. package/dist/rule-utils/parser/types.js +0 -8
  100. package/dist/rule-utils/parser/utils.js +0 -106
  101. package/dist/rules/index.js +0 -4
  102. package/dist/rules/linter.js +0 -36
  103. package/dist/rules/rule.js +0 -101
  104. package/dist/rules/rules/cjs-require/index.js +0 -50
  105. package/dist/rules/rules/cjs-require/types.js +0 -1
  106. package/dist/rules/rules/cross-chunks-package/index.js +0 -41
  107. package/dist/rules/rules/cross-chunks-package/types.js +0 -1
  108. package/dist/rules/rules/cross-chunks-package/utils.js +0 -7
  109. package/dist/rules/rules/default-import-check/index.js +0 -83
  110. package/dist/rules/rules/default-import-check/types.js +0 -1
  111. package/dist/rules/rules/default-import-check/utils.js +0 -52
  112. package/dist/rules/rules/duplicate-package/index.js +0 -39
  113. package/dist/rules/rules/duplicate-package/types.js +0 -24
  114. package/dist/rules/rules/duplicate-package/utils.js +0 -38
  115. package/dist/rules/rules/ecma-version-check/index.js +0 -53
  116. package/dist/rules/rules/ecma-version-check/types.js +0 -1
  117. package/dist/rules/rules/ecma-version-check/utils.js +0 -6
  118. package/dist/rules/rules/esm-resolved-to-cjs/index.js +0 -193
  119. package/dist/rules/rules/esm-resolved-to-cjs/types.js +0 -1
  120. package/dist/rules/rules/index.js +0 -22
  121. package/dist/rules/rules/loader-performance-optimization/index.js +0 -86
  122. package/dist/rules/rules/loader-performance-optimization/types.js +0 -1
  123. package/dist/rules/rules/loader-performance-optimization/utils.js +0 -10
  124. package/dist/rules/rules/module-mixed-chunks/index.js +0 -52
  125. package/dist/rules/rules/module-mixed-chunks/types.js +0 -1
  126. package/dist/rules/rules/side-effects-only-imports/index.js +0 -81
  127. package/dist/rules/rules/side-effects-only-imports/types.js +0 -1
  128. package/dist/rules/utils.js +0 -10
  129. package/dist/sdk/index.js +0 -3
  130. package/dist/sdk/multiple/controller.js +0 -42
  131. package/dist/sdk/multiple/index.js +0 -3
  132. package/dist/sdk/multiple/primary.js +0 -64
  133. package/dist/sdk/multiple/server.js +0 -14
  134. package/dist/sdk/sdk/core.js +0 -163
  135. package/dist/sdk/sdk/index.js +0 -435
  136. package/dist/sdk/sdk/types.js +0 -1
  137. package/dist/sdk/server/apis/alerts.js +0 -30
  138. package/dist/sdk/server/apis/base.js +0 -22
  139. package/dist/sdk/server/apis/bundle-diff.js +0 -51
  140. package/dist/sdk/server/apis/data.js +0 -44
  141. package/dist/sdk/server/apis/fs.js +0 -28
  142. package/dist/sdk/server/apis/graph.js +0 -116
  143. package/dist/sdk/server/apis/index.js +0 -11
  144. package/dist/sdk/server/apis/loader.js +0 -120
  145. package/dist/sdk/server/apis/plugin.js +0 -39
  146. package/dist/sdk/server/apis/project.js +0 -59
  147. package/dist/sdk/server/apis/renderer.js +0 -33
  148. package/dist/sdk/server/apis/resolver.js +0 -38
  149. package/dist/sdk/server/client.js +0 -8
  150. package/dist/sdk/server/fakeServer.js +0 -12
  151. package/dist/sdk/server/index.js +0 -292
  152. package/dist/sdk/server/json-body.js +0 -150
  153. package/dist/sdk/server/router.js +0 -83
  154. package/dist/sdk/server/security.js +0 -47
  155. package/dist/sdk/server/socket/api.js +0 -22
  156. package/dist/sdk/server/socket/index.js +0 -166
  157. package/dist/sdk/server/utils.js +0 -19
  158. package/dist/sdk/utils/base.js +0 -22
  159. package/dist/sdk/utils/constant.js +0 -4
  160. package/dist/sdk/utils/index.js +0 -4
  161. package/dist/sdk/utils/openBrowser.js +0 -53
  162. package/dist/sdk/utils/upload.js +0 -6
  163. package/dist/sdk.js +0 -2
  164. package/dist/types/index.js +0 -4
  165. package/dist/types/loader.js +0 -1
  166. package/dist/types/plugin.js +0 -1
  167. package/dist/types/rules.js +0 -1
@@ -1,116 +0,0 @@
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 };
@@ -1,11 +0,0 @@
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";
@@ -1,120 +0,0 @@
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 };
@@ -1,39 +0,0 @@
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 };
@@ -1,59 +0,0 @@
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 };
@@ -1,33 +0,0 @@
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 };
@@ -1,38 +0,0 @@
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 };
@@ -1,8 +0,0 @@
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 };
@@ -1,12 +0,0 @@
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 };