@ohos-ports/rsbuild-core 2.2.9-beta.0

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 (269) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +27 -0
  3. package/bin/rsbuild.js +20 -0
  4. package/compiled/@rstackjs/load-config/index.d.ts +87 -0
  5. package/compiled/@rstackjs/load-config/license +21 -0
  6. package/compiled/@rstackjs/load-config/package.json +1 -0
  7. package/compiled/chokidar/index.d.ts +385 -0
  8. package/compiled/chokidar/license +21 -0
  9. package/compiled/chokidar/package.json +1 -0
  10. package/compiled/connect-next/index.d.ts +57 -0
  11. package/compiled/connect-next/license +26 -0
  12. package/compiled/connect-next/package.json +1 -0
  13. package/compiled/cors/index.d.ts +56 -0
  14. package/compiled/cors/license +22 -0
  15. package/compiled/cors/package.json +1 -0
  16. package/compiled/css-loader/api.js +85 -0
  17. package/compiled/css-loader/getUrl.js +26 -0
  18. package/compiled/css-loader/index.d.ts +1 -0
  19. package/compiled/css-loader/index.js +2 -0
  20. package/compiled/css-loader/license +20 -0
  21. package/compiled/css-loader/noSourceMaps.js +5 -0
  22. package/compiled/css-loader/package.json +1 -0
  23. package/compiled/css-loader/sourceMaps.js +16 -0
  24. package/compiled/html-rspack-plugin/default_index.ejs +9 -0
  25. package/compiled/html-rspack-plugin/htmlLoader.js +157 -0
  26. package/compiled/html-rspack-plugin/index.d.ts +395 -0
  27. package/compiled/html-rspack-plugin/index.js +2400 -0
  28. package/compiled/html-rspack-plugin/license +20 -0
  29. package/compiled/html-rspack-plugin/package.json +1 -0
  30. package/compiled/http-proxy-middleware/index.d.ts +455 -0
  31. package/compiled/http-proxy-middleware/license +22 -0
  32. package/compiled/http-proxy-middleware/package.json +1 -0
  33. package/compiled/jiti/LICENSE +21 -0
  34. package/compiled/jiti/README.md +258 -0
  35. package/compiled/jiti/dist/babel.cjs +47446 -0
  36. package/compiled/jiti/dist/jiti.cjs +5990 -0
  37. package/compiled/jiti/lib/jiti-cli.mjs +19 -0
  38. package/compiled/jiti/lib/jiti-hooks.mjs +89 -0
  39. package/compiled/jiti/lib/jiti-native.mjs +76 -0
  40. package/compiled/jiti/lib/jiti-register.d.mts +1 -0
  41. package/compiled/jiti/lib/jiti-register.mjs +2 -0
  42. package/compiled/jiti/lib/jiti-static.mjs +19 -0
  43. package/compiled/jiti/lib/jiti.cjs +24 -0
  44. package/compiled/jiti/lib/jiti.d.cts +8 -0
  45. package/compiled/jiti/lib/jiti.d.mts +8 -0
  46. package/compiled/jiti/lib/jiti.mjs +23 -0
  47. package/compiled/jiti/lib/types.d.ts +420 -0
  48. package/compiled/jiti/package.json +146 -0
  49. package/compiled/postcss/index.js +1 -0
  50. package/compiled/postcss/lib/at-rule.d.ts +139 -0
  51. package/compiled/postcss/lib/comment.d.ts +67 -0
  52. package/compiled/postcss/lib/container.d.ts +474 -0
  53. package/compiled/postcss/lib/css-syntax-error.d.ts +247 -0
  54. package/compiled/postcss/lib/declaration.d.ts +150 -0
  55. package/compiled/postcss/lib/document.d.ts +68 -0
  56. package/compiled/postcss/lib/fromJSON.d.ts +9 -0
  57. package/compiled/postcss/lib/input.d.ts +226 -0
  58. package/compiled/postcss/lib/lazy-result.d.ts +189 -0
  59. package/compiled/postcss/lib/list.d.ts +60 -0
  60. package/compiled/postcss/lib/no-work-result.d.ts +45 -0
  61. package/compiled/postcss/lib/node.d.ts +555 -0
  62. package/compiled/postcss/lib/parse.d.ts +9 -0
  63. package/compiled/postcss/lib/postcss.d.ts +464 -0
  64. package/compiled/postcss/lib/previous-map.d.ts +80 -0
  65. package/compiled/postcss/lib/processor.d.ts +114 -0
  66. package/compiled/postcss/lib/result.d.ts +204 -0
  67. package/compiled/postcss/lib/root.d.ts +86 -0
  68. package/compiled/postcss/lib/rule.d.ts +126 -0
  69. package/compiled/postcss/lib/source-map-js.d.ts +4 -0
  70. package/compiled/postcss/lib/stringifier.d.ts +45 -0
  71. package/compiled/postcss/lib/stringify.d.ts +9 -0
  72. package/compiled/postcss/lib/warning.d.ts +146 -0
  73. package/compiled/postcss/license +20 -0
  74. package/compiled/postcss/package.json +1 -0
  75. package/compiled/postcss-loader/index.d.ts +1 -0
  76. package/compiled/postcss-loader/index.js +721 -0
  77. package/compiled/postcss-loader/license +20 -0
  78. package/compiled/postcss-loader/package.json +1 -0
  79. package/compiled/rslog/index.d.ts +98 -0
  80. package/compiled/rslog/license +21 -0
  81. package/compiled/rslog/package.json +1 -0
  82. package/compiled/rspack-chain/license +22 -0
  83. package/compiled/rspack-chain/package.json +1 -0
  84. package/compiled/rspack-chain/types/index.d.ts +515 -0
  85. package/compiled/rspack-manifest-plugin/index.d.ts +52 -0
  86. package/compiled/rspack-manifest-plugin/license +21 -0
  87. package/compiled/rspack-manifest-plugin/package.json +1 -0
  88. package/compiled/style-loader/index.d.ts +1 -0
  89. package/compiled/style-loader/index.js +370 -0
  90. package/compiled/style-loader/license +20 -0
  91. package/compiled/style-loader/package.json +1 -0
  92. package/compiled/style-loader/runtime/injectStylesIntoLinkTag.js +29 -0
  93. package/compiled/style-loader/runtime/injectStylesIntoStyleTag.js +84 -0
  94. package/compiled/style-loader/runtime/insertBySelector.js +34 -0
  95. package/compiled/style-loader/runtime/insertStyleElement.js +10 -0
  96. package/compiled/style-loader/runtime/isEqualLocals.js +28 -0
  97. package/compiled/style-loader/runtime/isOldIE.js +17 -0
  98. package/compiled/style-loader/runtime/setAttributesWithAttributes.js +13 -0
  99. package/compiled/style-loader/runtime/setAttributesWithAttributesAndNonce.js +9 -0
  100. package/compiled/style-loader/runtime/setAttributesWithoutAttributes.js +10 -0
  101. package/compiled/style-loader/runtime/singletonStyleDomAPI.js +86 -0
  102. package/compiled/style-loader/runtime/styleDomAPI.js +61 -0
  103. package/compiled/style-loader/runtime/styleTagTransform.js +14 -0
  104. package/compiled/ws/index.d.ts +445 -0
  105. package/compiled/ws/license +21 -0
  106. package/compiled/ws/package.json +1 -0
  107. package/dist/build.d.ts +4 -0
  108. package/dist/c.js +10 -0
  109. package/dist/chokidar.js +2 -0
  110. package/dist/chokidar.js.LICENSE.txt +1 -0
  111. package/dist/cli/commands.d.ts +31 -0
  112. package/dist/cli/index.d.ts +7 -0
  113. package/dist/cli/init.d.ts +7 -0
  114. package/dist/client/f~0.js +22 -0
  115. package/dist/client/hmr.js +267 -0
  116. package/dist/client/overlay.js +214 -0
  117. package/dist/configChain.d.ts +84 -0
  118. package/dist/connect-next.js +2 -0
  119. package/dist/connect-next.js.LICENSE.txt +57 -0
  120. package/dist/constants.d.ts +67 -0
  121. package/dist/cors.js +188 -0
  122. package/dist/cors.js.LICENSE.txt +11 -0
  123. package/dist/createCompiler.d.ts +6 -0
  124. package/dist/createContext.d.ts +12 -0
  125. package/dist/createRsbuild.d.ts +4 -0
  126. package/dist/cssUrlLoader.mjs +34 -0
  127. package/dist/defaultConfig.d.ts +23 -0
  128. package/dist/freshImport.js +90 -0
  129. package/dist/helpers/cachedImport.d.ts +2 -0
  130. package/dist/helpers/compiler.d.ts +5 -0
  131. package/dist/helpers/css.d.ts +3 -0
  132. package/dist/helpers/exitHook.d.ts +3 -0
  133. package/dist/helpers/format.d.ts +4 -0
  134. package/dist/helpers/fs.d.ts +16 -0
  135. package/dist/helpers/html.d.ts +2 -0
  136. package/dist/helpers/index.d.ts +29 -0
  137. package/dist/helpers/overlayConfig.d.ts +4 -0
  138. package/dist/helpers/packageJson.d.ts +9 -0
  139. package/dist/helpers/path.d.ts +22 -0
  140. package/dist/helpers/restartManager.d.ts +15 -0
  141. package/dist/helpers/stats.d.ts +17 -0
  142. package/dist/helpers/url.d.ts +11 -0
  143. package/dist/helpers/vendors.d.ts +12 -0
  144. package/dist/helpers/version.d.ts +7 -0
  145. package/dist/hooks.d.ts +41 -0
  146. package/dist/http-proxy-middleware.js +14 -0
  147. package/dist/http-proxy-middleware.js.LICENSE.txt +34 -0
  148. package/dist/ignoreCssLoader.mjs +9 -0
  149. package/dist/index.d.ts +28 -0
  150. package/dist/index.js +1 -0
  151. package/dist/initConfigs.d.ts +18 -0
  152. package/dist/initPlugins.d.ts +7 -0
  153. package/dist/inspectConfig.d.ts +7 -0
  154. package/dist/launch-editor-middleware.js +1 -0
  155. package/dist/loadConfig.d.ts +31 -0
  156. package/dist/loadEnv.d.ts +54 -0
  157. package/dist/loader/cssUrlLoader.d.ts +9 -0
  158. package/dist/loader/ignoreCssLoader.d.ts +10 -0
  159. package/dist/loader/transformLoader.d.ts +8 -0
  160. package/dist/loader/transformRawLoader.d.ts +4 -0
  161. package/dist/loader/workerLoader.d.ts +6 -0
  162. package/dist/logger.d.ts +24 -0
  163. package/dist/m.js +10348 -0
  164. package/dist/m.js.LICENSE.txt +26 -0
  165. package/dist/manifest-plugin.js +1 -0
  166. package/dist/memfs.js +1 -0
  167. package/dist/mergeConfig.d.ts +7 -0
  168. package/dist/open.js +2 -0
  169. package/dist/pluginHelper.d.ts +4 -0
  170. package/dist/pluginManager.d.ts +19 -0
  171. package/dist/plugins/appIcon.d.ts +2 -0
  172. package/dist/plugins/asset.d.ts +3 -0
  173. package/dist/plugins/basic.d.ts +4 -0
  174. package/dist/plugins/cache.d.ts +2 -0
  175. package/dist/plugins/cleanOutput.d.ts +2 -0
  176. package/dist/plugins/css.d.ts +8 -0
  177. package/dist/plugins/define.d.ts +2 -0
  178. package/dist/plugins/entry.d.ts +2 -0
  179. package/dist/plugins/externals.d.ts +9 -0
  180. package/dist/plugins/fileSize.d.ts +7 -0
  181. package/dist/plugins/html.d.ts +9 -0
  182. package/dist/plugins/inlineChunk.d.ts +6 -0
  183. package/dist/plugins/lazyCompilation.d.ts +2 -0
  184. package/dist/plugins/manifest.d.ts +2 -0
  185. package/dist/plugins/minimize.d.ts +10 -0
  186. package/dist/plugins/moduleFederation.d.ts +2 -0
  187. package/dist/plugins/nodeAddons.d.ts +2 -0
  188. package/dist/plugins/nonce.d.ts +2 -0
  189. package/dist/plugins/output.d.ts +2 -0
  190. package/dist/plugins/progress.d.ts +2 -0
  191. package/dist/plugins/resolve.d.ts +2 -0
  192. package/dist/plugins/resourceHints.d.ts +2 -0
  193. package/dist/plugins/rsdoctor.d.ts +2 -0
  194. package/dist/plugins/rspackProfile.d.ts +4 -0
  195. package/dist/plugins/server.d.ts +3 -0
  196. package/dist/plugins/sourceMap.d.ts +2 -0
  197. package/dist/plugins/splitChunks.d.ts +4 -0
  198. package/dist/plugins/sri.d.ts +2 -0
  199. package/dist/plugins/swc.d.ts +4 -0
  200. package/dist/plugins/target.d.ts +2 -0
  201. package/dist/plugins/wasm.d.ts +2 -0
  202. package/dist/plugins/worker.d.ts +2 -0
  203. package/dist/r.js +7 -0
  204. package/dist/range-parser.js +55 -0
  205. package/dist/range-parser.js.LICENSE.txt +6 -0
  206. package/dist/remapping.js +201 -0
  207. package/dist/restart.d.ts +15 -0
  208. package/dist/rslib-runtime.js +49 -0
  209. package/dist/rspack-plugins/RsbuildHtmlPlugin.d.ts +37 -0
  210. package/dist/rspack-plugins/resource-hints/HtmlResourceHintsPlugin.d.ts +36 -0
  211. package/dist/rspack-plugins/resource-hints/doesChunkBelongToHtml.d.ts +27 -0
  212. package/dist/rspack-plugins/resource-hints/extractChunks.d.ts +22 -0
  213. package/dist/rspack-plugins/resource-hints/getResourceType.d.ts +21 -0
  214. package/dist/rspackConfig.d.ts +8 -0
  215. package/dist/server/ansiHTML.d.ts +3 -0
  216. package/dist/server/assets-middleware/getFileFromUrl.d.ts +11 -0
  217. package/dist/server/assets-middleware/index.d.ts +35 -0
  218. package/dist/server/assets-middleware/memoryFileSystem.d.ts +2 -0
  219. package/dist/server/assets-middleware/middleware.d.ts +7 -0
  220. package/dist/server/assets-middleware/parseTokenList.d.ts +1 -0
  221. package/dist/server/assets-middleware/setupOutputFileSystem.d.ts +3 -0
  222. package/dist/server/assets-middleware/setupWriteToDisk.d.ts +15 -0
  223. package/dist/server/browserLogs.d.ts +8 -0
  224. package/dist/server/buildManager.d.ts +32 -0
  225. package/dist/server/cliShortcuts.d.ts +19 -0
  226. package/dist/server/compileState.d.ts +5 -0
  227. package/dist/server/devMiddlewares.d.ts +18 -0
  228. package/dist/server/devServer.d.ts +47 -0
  229. package/dist/server/environment.d.ts +8 -0
  230. package/dist/server/gracefulShutdown.d.ts +8 -0
  231. package/dist/server/gzipMiddleware.d.ts +2 -0
  232. package/dist/server/helper.d.ts +118 -0
  233. package/dist/server/historyApiFallback.d.ts +10 -0
  234. package/dist/server/hmrFallback.d.ts +1 -0
  235. package/dist/server/httpServer.d.ts +7 -0
  236. package/dist/server/middlewares.d.ts +31 -0
  237. package/dist/server/open.d.ts +12 -0
  238. package/dist/server/overlay.d.ts +3 -0
  239. package/dist/server/previewServer.d.ts +4 -0
  240. package/dist/server/proxy.d.ts +7 -0
  241. package/dist/server/publicPathnames.d.ts +2 -0
  242. package/dist/server/runner/asModule.d.ts +2 -0
  243. package/dist/server/runner/basic.d.ts +25 -0
  244. package/dist/server/runner/cjs.d.ts +10 -0
  245. package/dist/server/runner/esm.d.ts +6 -0
  246. package/dist/server/runner/index.d.ts +6 -0
  247. package/dist/server/runner/type.d.ts +42 -0
  248. package/dist/server/serverSetup.d.ts +2 -0
  249. package/dist/server/socketServer.d.ts +113 -0
  250. package/dist/server/watchFiles.d.ts +15 -0
  251. package/dist/sirv.js +122 -0
  252. package/dist/tinyglobby.js +1 -0
  253. package/dist/trace-mapping.js +548 -0
  254. package/dist/transformLoader.mjs +36 -0
  255. package/dist/transformRawLoader.mjs +4 -0
  256. package/dist/types/config.d.ts +1796 -0
  257. package/dist/types/context.d.ts +89 -0
  258. package/dist/types/hooks.d.ts +261 -0
  259. package/dist/types/index.d.ts +8 -0
  260. package/dist/types/plugin.d.ts +479 -0
  261. package/dist/types/rsbuild.d.ts +241 -0
  262. package/dist/types/rspack.d.ts +10 -0
  263. package/dist/types/thirdParty.d.ts +161 -0
  264. package/dist/types/utils.d.ts +16 -0
  265. package/dist/workerLoader.mjs +94 -0
  266. package/dist/ws.js +2 -0
  267. package/package.json +107 -0
  268. package/static/openChrome.applescript +95 -0
  269. package/types.d.ts +422 -0
@@ -0,0 +1,36 @@
1
+ /**
2
+ * This method is modified based on source found in
3
+ * https://github.com/vuejs/preload-webpack-plugin/blob/master/src/index.js
4
+ *
5
+ * Copyright 2018 Google Inc.
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */ import type { Compiler, RspackPluginInstance } from '@rspack/core';
18
+ import type { HtmlRspackPlugin, ResourceHintsOptions } from '../../types/index.js';
19
+ type LinkType = 'preload' | 'prefetch';
20
+ type ResourceHintsInputOptions = ResourceHintsOptions | ResourceHintsOptions[];
21
+ interface ResourceHintGroup {
22
+ links: HtmlRspackPlugin.HtmlTagObject[];
23
+ dedupe: boolean;
24
+ }
25
+ export declare class HtmlResourceHintsPlugin implements RspackPluginInstance {
26
+ readonly options: ResourceHintsOptions[];
27
+ name: string;
28
+ resourceHints: ResourceHintGroup[];
29
+ type: LinkType;
30
+ HTMLCount: number;
31
+ isDev: boolean;
32
+ getHTMLPlugin: () => typeof HtmlRspackPlugin;
33
+ constructor(options: ResourceHintsInputOptions, type: LinkType, HTMLCount: number, isDev: boolean, getHTMLPlugin: () => typeof HtmlRspackPlugin);
34
+ apply(compiler: Compiler): void;
35
+ }
36
+ export { };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * This method is modified based on source found in
3
+ * https://github.com/vuejs/preload-webpack-plugin/blob/master/src/lib/does-chunk-belong-to-html.js
4
+ *
5
+ * Copyright 2018 Google Inc.
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */ import type { Chunk, Compilation } from '@rspack/core';
18
+ import type { HtmlRspackPlugin, ResourceHintsOptions } from '../../types/index.js';
19
+ interface DoesChunkBelongToHtmlOptions {
20
+ chunk: Chunk;
21
+ compilation?: Compilation;
22
+ htmlPluginData: HtmlRspackPlugin.BeforeAssetTagGenerationData;
23
+ pluginOptions?: ResourceHintsOptions;
24
+ }
25
+ export declare function recursiveChunkEntryNames(chunk: Chunk): string[];
26
+ export declare function doesChunkBelongToHtml({ chunk, htmlPluginData }: DoesChunkBelongToHtmlOptions): boolean;
27
+ export { };
@@ -0,0 +1,22 @@
1
+ /**
2
+ * This method is modified based on source found in
3
+ * https://github.com/vuejs/preload-webpack-plugin/blob/master/src/lib/extract-chunks.js
4
+ *
5
+ * Copyright 2018 Google Inc.
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */ import type { Chunk, Compilation } from '@rspack/core';
18
+ import type { ResourceHintsIncludeType } from '../../types/index.js';
19
+ export declare function extractChunks(compilation: Compilation, includeType?: ResourceHintsIncludeType): Chunk[] | {
20
+ files: string[];
21
+ auxiliaryFiles?: string[];
22
+ }[];
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This method is modified based on source found in
3
+ * https://github.com/vuejs/preload-webpack-plugin/blob/master/src/lib/determine-as-value.js
4
+ *
5
+ * Copyright 2018 Google Inc.
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */ export type ResourceType = 'audio' | 'document' | 'embed' | 'fetch' | 'font' | 'image' | 'object' | 'script' | 'style' | 'track' | 'worker' | 'video';
18
+ export declare function getResourceType({ href, file }: {
19
+ href: string;
20
+ file: string;
21
+ }): ResourceType;
@@ -0,0 +1,8 @@
1
+ import type { EnvironmentContext, InternalContext, ModifyChainUtils, ModifyRspackConfigUtils, RsbuildTarget, Rspack } from './types/index.js';
2
+ export declare function getConfigUtils(getCurrentConfig: () => Rspack.Configuration, chainUtils: ModifyChainUtils): ModifyRspackConfigUtils;
3
+ export declare function getChainUtils(target: RsbuildTarget, environment: EnvironmentContext, environments: Record<string, EnvironmentContext>): ModifyChainUtils;
4
+ export declare function generateRspackConfig({ target, context, environmentName }: {
5
+ target: RsbuildTarget;
6
+ context: InternalContext;
7
+ environmentName: string;
8
+ }): Promise<Rspack.Configuration>;
@@ -0,0 +1,3 @@
1
+ /**
2
+ * Converts text with ANSI color codes to HTML markup
3
+ */ export declare function ansiHTML(text: string): string;
@@ -0,0 +1,11 @@
1
+ import type { Stats as FSStats } from 'node:fs';
2
+ import type { InternalContext, Rspack } from '../../types/index.js';
3
+ /**
4
+ * Resolves URL to file path with security checks and retrieves file from
5
+ * the build output directories.
6
+ */ export declare function getFileFromUrl(url: string, outputFileSystem: Rspack.OutputFileSystem, context: InternalContext): Promise<{
7
+ filename: string;
8
+ fsStats: FSStats;
9
+ } | {
10
+ errorCode: number;
11
+ } | undefined>;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * The assets middleware is modified based on
3
+ * https://github.com/webpack/webpack-dev-middleware
4
+ *
5
+ * MIT Licensed
6
+ * Copyright JS Foundation and other contributors
7
+ * https://github.com/webpack/webpack-dev-middleware/blob/master/LICENSE
8
+ */ import { type Compiler, type MultiCompiler } from '@rspack/core';
9
+ import type { InternalContext, LiveReload, NormalizedConfig, RequestHandler } from '../../types/index.js';
10
+ import type { SocketServer } from '../socketServer.js';
11
+ export type MultiWatching = ReturnType<MultiCompiler['watch']>;
12
+ export type AssetsMiddlewareClose = (callback: (err?: Error | null) => void) => void;
13
+ export type AssetsMiddleware = RequestHandler & {
14
+ watch: () => void;
15
+ close: AssetsMiddlewareClose;
16
+ };
17
+ export declare const setupServerHooks: ({ context, compiler, token, socketServer, liveReload }: {
18
+ context: InternalContext;
19
+ compiler: Compiler;
20
+ token: string;
21
+ socketServer: SocketServer;
22
+ liveReload: LiveReload;
23
+ }) => void;
24
+ /**
25
+ * The assets middleware handles compiler setup for development:
26
+ * - Call `compiler.watch`
27
+ * - Inject the HMR client path into page
28
+ * - Notify server when compiler hooks are triggered
29
+ */ export declare const assetsMiddleware: ({ config, compiler, context, socketServer, resolvedPort }: {
30
+ config: NormalizedConfig;
31
+ compiler: Compiler | MultiCompiler;
32
+ context: InternalContext;
33
+ socketServer: SocketServer;
34
+ resolvedPort: number;
35
+ }) => Promise<AssetsMiddleware>;
@@ -0,0 +1,2 @@
1
+ import { type IFs } from 'memfs';
2
+ export declare function createMemoryFileSystem(): IFs;
@@ -0,0 +1,7 @@
1
+ import type { InternalContext, RequestHandler, Rspack } from '../../types/index.js';
2
+ /**
3
+ * Filters environments to those whose outputs may be exposed by the HTTP assets
4
+ * middleware. Node-targeted outputs are intended for server-side execution,
5
+ * such as through `loadBundle`, and must not participate in URL resolution.
6
+ */ export declare const filterWebEnvironments: (environmentList: InternalContext['environmentList']) => InternalContext['environmentList'];
7
+ export declare function createAssetsMiddleware(context: InternalContext, ready: (callback: () => void) => void, outputFileSystem: Rspack.OutputFileSystem): RequestHandler;
@@ -0,0 +1 @@
1
+ export declare function parseTokenList(str: string): string[];
@@ -0,0 +1,3 @@
1
+ import type { Compiler, OutputFileSystem } from '@rspack/core';
2
+ import type { ResolvedWriteToDisk } from './setupWriteToDisk.js';
3
+ export declare function setupOutputFileSystem(writeToDisk: ResolvedWriteToDisk, compilers: Compiler[]): Promise<OutputFileSystem>;
@@ -0,0 +1,15 @@
1
+ import type { Compiler } from '@rspack/core';
2
+ import type { Logger } from '../../logger.js';
3
+ import type { EnvironmentContext, NormalizedDevConfig } from '../../types/index.js';
4
+ declare module '@rspack/core' {
5
+ interface Compiler {
6
+ __hasRsbuildAssetEmittedCallback?: boolean;
7
+ }
8
+ }
9
+ export type ResolvedWriteToDisk = boolean | ((filePath: string, name?: string) => boolean);
10
+ /**
11
+ * Resolve writeToDisk config across multiple environments.
12
+ * Returns the unified config if all environments have the same value,
13
+ * otherwise returns a function that resolves config based on compilation.
14
+ */ export declare const resolveWriteToDiskConfig: (config: NormalizedDevConfig, environments: Record<string, EnvironmentContext>, environmentList: EnvironmentContext[]) => ResolvedWriteToDisk;
15
+ export declare function setupWriteToDisk(compilers: Compiler[], writeToDisk: ResolvedWriteToDisk, logger: Logger): void;
@@ -0,0 +1,8 @@
1
+ import type { TraceMap } from '@jridgewell/trace-mapping';
2
+ import type { StackFrame } from 'stacktrace-parser';
3
+ import type { BrowserLogsStackTrace, InternalContext, Rspack } from '../types/index.js';
4
+ export type CachedTraceMap = Map<string, TraceMap>;
5
+ /**
6
+ * Formats error messages received from the browser into a log string with
7
+ * source location information.
8
+ */ export declare const formatBrowserErrorLog: (message: string, context: InternalContext, fs: Rspack.OutputFileSystem, stackTrace: BrowserLogsStackTrace, stackFrames: StackFrame[] | null, cachedTraceMap: CachedTraceMap) => Promise<string>;
@@ -0,0 +1,32 @@
1
+ import type { InternalContext, NormalizedConfig, Rspack } from '../types/index.js';
2
+ import { type AssetsMiddleware } from './assets-middleware/index.js';
3
+ import { type SocketConnectionListener, SocketServer } from './socketServer.js';
4
+ type Options = {
5
+ context: InternalContext;
6
+ config: NormalizedConfig;
7
+ compiler: Rspack.Compiler | Rspack.MultiCompiler;
8
+ resolvedPort: number;
9
+ onSocketConnect?: SocketConnectionListener;
10
+ };
11
+ /**
12
+ * Setup compiler related logic:
13
+ * 1. setup assets middleware
14
+ * 2. establish webSocket connect
15
+ */ export declare class BuildManager {
16
+ assetsMiddleware: AssetsMiddleware;
17
+ outputFileSystem: Rspack.OutputFileSystem;
18
+ socketServer: SocketServer;
19
+ compiler: Rspack.Compiler | Rspack.MultiCompiler;
20
+ private config;
21
+ private resolvedPort;
22
+ private context;
23
+ constructor({ config, context, compiler, resolvedPort, onSocketConnect }: Options);
24
+ init(): Promise<void>;
25
+ /**
26
+ * Call `compiler.watch()` to start compiling.
27
+ */ watch(): void;
28
+ close(): Promise<void>;
29
+ readFileSync: (fileName: string) => string;
30
+ private setupCompilationMiddleware;
31
+ }
32
+ export { };
@@ -0,0 +1,19 @@
1
+ import type { Logger } from '../logger.js';
2
+ import type { CliShortcut, NormalizedConfig } from '../types/config.js';
3
+ type PrintUrlsHandler = (options?: {
4
+ showAllRoutes?: boolean;
5
+ }) => void;
6
+ export declare const isCliShortcutsEnabled: (config: NormalizedConfig) => boolean;
7
+ // Normalize user input so shortcuts are case-insensitive
8
+ // and still work with accidental surrounding whitespace.
9
+ export declare const normalizeShortcutInput: (input: string) => string;
10
+ export declare function setupCliShortcuts({ help, openPage, closeServer, printUrls, restartServer, customShortcuts, logger }: {
11
+ help?: boolean | string;
12
+ openPage: () => Promise<void>;
13
+ closeServer: () => Promise<void>;
14
+ printUrls: PrintUrlsHandler;
15
+ restartServer?: () => Promise<boolean>;
16
+ customShortcuts?: (shortcuts: CliShortcut[]) => CliShortcut[];
17
+ logger: Logger;
18
+ }): Promise<() => void>;
19
+ export { };
@@ -0,0 +1,5 @@
1
+ export declare const createCompileState: (environmentCount: number) => {
2
+ reset(index: number): void;
3
+ done(index: number, nextStats: Rspack.Stats): void;
4
+ wait(index: number): Promise<Rspack.Stats>;
5
+ };
@@ -0,0 +1,18 @@
1
+ import type { InternalContext, NormalizedConfig } from '../types/index.js';
2
+ import type { BuildManager } from './buildManager.js';
3
+ import type { RsbuildDevServer } from './devServer.js';
4
+ import type { UpgradeEvent } from './helper.js';
5
+ export type RsbuildDevMiddlewareOptions = {
6
+ config: NormalizedConfig;
7
+ context: InternalContext;
8
+ buildManager?: BuildManager;
9
+ devServer: RsbuildDevServer;
10
+ /**
11
+ * Callbacks returned by `onBeforeStartDevServer` hook and `server.setup` config
12
+ */ postCallbacks: (() => Promise<void> | void)[];
13
+ };
14
+ export type GetDevMiddlewaresResult = {
15
+ close: () => Promise<void>;
16
+ onUpgrade: UpgradeEvent;
17
+ };
18
+ export declare const getDevMiddlewares: (options: RsbuildDevMiddlewareOptions) => Promise<GetDevMiddlewaresResult>;
@@ -0,0 +1,47 @@
1
+ import type { Server } from 'node:http';
2
+ import type { Http2SecureServer } from 'node:http2';
3
+ import type { CreateCompiler, CreateDevServerOptions, EnvironmentAPI, InternalContext, NormalizedConfig } from '../types/index.js';
4
+ import { type RsbuildServerBase, type StartDevServerResult } from './helper.js';
5
+ import type { ServerMessage } from './socketServer.js';
6
+ type HTTPServer = Server | Http2SecureServer;
7
+ type ExtractSocketMessageData<T extends ServerMessage['type']> = 'data' extends keyof Extract<ServerMessage, {
8
+ type: T;
9
+ }> ? Extract<ServerMessage, {
10
+ type: T;
11
+ }>['data'] : undefined;
12
+ export type HotSend = <T extends ServerMessage['type']>(type: T, data?: ExtractSocketMessageData<T>) => void;
13
+ export type HotClient = {
14
+ /** Send an HMR message to this connection only. */ send: HotSend;
15
+ };
16
+ type HotConnectCallback = (client: HotClient) => void | Promise<void>;
17
+ export type HotOnConnect = (callback: HotConnectCallback) => () => void;
18
+ export type RsbuildDevServer = RsbuildServerBase & {
19
+ /**
20
+ * Notifies Rsbuild that the custom server has successfully started.
21
+ * Rsbuild will trigger the `onAfterStartDevServer` hook at this stage.
22
+ */ afterListen: () => Promise<void>;
23
+ /**
24
+ * Activate socket connection.
25
+ * This ensures that HMR works properly.
26
+ */ connectWebSocket: (options: {
27
+ server: HTTPServer;
28
+ }) => void;
29
+ /**
30
+ * Environment API of Rsbuild server.
31
+ */ environments: EnvironmentAPI;
32
+ /**
33
+ * Start listening on the Rsbuild dev server.
34
+ * Do not call this method if you are using a custom server.
35
+ */ listen: () => Promise<StartDevServerResult>;
36
+ /**
37
+ * Allows middleware to send some message to HMR client, and then the HMR
38
+ * client will take different actions depending on the message type.
39
+ * - `full-reload`: The page will reload.
40
+ * - `static-changed`: Alias of `full-reload` for backward compatibility.
41
+ * - `custom`: Send custom messages via `custom` type with optional data to the browser and handle them via HMR events.
42
+ */ sockWrite: HotSend;
43
+ };
44
+ export declare function createDevServer<Options extends {
45
+ context: InternalContext;
46
+ }>(options: Options, createCompiler: CreateCompiler, config: NormalizedConfig, devServerOptions?: CreateDevServerOptions): Promise<RsbuildDevServer>;
47
+ export { };
@@ -0,0 +1,8 @@
1
+ import type { EnvironmentContext, Rspack } from '../types/index.js';
2
+ export type ServerUtils = {
3
+ readFileSync: (fileName: string) => string;
4
+ environment: EnvironmentContext;
5
+ };
6
+ export declare const loadBundle: <T>(stats: Rspack.Stats, entryName: string, utils: ServerUtils) => Promise<T>;
7
+ export declare const getTransformedHtml: (entryName: string, utils: ServerUtils) => string;
8
+ export declare const createCacheableFunction: <T>(getter: (stats: Rspack.Stats, entryName: string, utils: ServerUtils) => Promise<T> | T) => (stats: Rspack.Stats, entryName: string, utils: ServerUtils) => Promise<T>;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Registers a cleanup callback to be executed before process termination
3
+ */ export declare const registerCleanup: (callback: () => Promise<void>) => void;
4
+ export declare const removeCleanup: (callback: () => Promise<void>) => void;
5
+ /**
6
+ * Sets up listeners for termination signals and stdin end event
7
+ * This should be called once during application initialization
8
+ */ export declare const setupGracefulShutdown: () => (() => void);
@@ -0,0 +1,2 @@
1
+ import type { CompressOptions, RequestHandler } from '../types/index.js';
2
+ export declare function gzipMiddleware({ filter, level }?: CompressOptions): RequestHandler;
@@ -0,0 +1,118 @@
1
+ import type { IncomingMessage, Server } from 'node:http';
2
+ import type { Http2SecureServer } from 'node:http2';
3
+ import type { Socket } from 'node:net';
4
+ import type { Logger } from '../logger.js';
5
+ import type { Connect, InternalContext, NormalizedConfig, OutputStructure, PrintUrls, Routes, RsbuildConfig, RsbuildEntry } from '../types/index.js';
6
+ import type { RsbuildDevServer } from './devServer.js';
7
+ import type { RsbuildPreviewServer } from './previewServer.js';
8
+ /**
9
+ * It used to subscribe http upgrade event
10
+ */ export type UpgradeEvent = (req: IncomingMessage, socket: Socket, head: Buffer) => void;
11
+ export type ServerStartResult<T> = {
12
+ /**
13
+ * The URLs that server is listening on.
14
+ */ urls: string[];
15
+ /**
16
+ * The actual port used by the server.
17
+ */ port: number;
18
+ /**
19
+ * The dev server or preview server instance.
20
+ */ server: T;
21
+ };
22
+ export type StartDevServerResult = ServerStartResult<RsbuildDevServer>;
23
+ export type StartPreviewServerResult = ServerStartResult<RsbuildPreviewServer>;
24
+ // remove repeat '/'
25
+ export declare const normalizeUrl: (url: string) => string;
26
+ // /a + /b => /a/b
27
+ export declare const joinUrlPath: (basePath: string, pathname: string) => string;
28
+ export declare const isUrlPathUnderBase: (pathname: string, base: string) => boolean;
29
+ export declare const removeBasePath: (url: string, base: string) => string;
30
+ export declare const getRoutes: (context: InternalContext) => Routes;
31
+ /*
32
+ * format route by entry and adjust the index route to be the first
33
+ */ export declare const formatRoutes: (entry: RsbuildEntry, base: string, distPathPrefix: string | undefined, outputStructure: OutputStructure | undefined) => Routes;
34
+ type AddressUrl = {
35
+ label: string;
36
+ name?: string;
37
+ url: string;
38
+ };
39
+ export declare function printServerURLs({ urls: originalUrls, port, routes, protocol, printUrls, fallbackPathname, showAllRoutes, cliShortcutsEnabled, originalConfig, logger }: {
40
+ urls: AddressUrl[];
41
+ port: number;
42
+ routes: Routes;
43
+ protocol: string;
44
+ printUrls?: PrintUrls;
45
+ fallbackPathname?: string;
46
+ showAllRoutes?: boolean;
47
+ cliShortcutsEnabled: boolean;
48
+ originalConfig?: Readonly<RsbuildConfig>;
49
+ logger: Logger;
50
+ }): string | null;
51
+ /**
52
+ * Get available free port.
53
+ * @param port - Current port want to use.
54
+ * @param tryLimits - Maximum number of retries.
55
+ * @param strictPort - Whether to throw an error when the port is occupied.
56
+ * @returns Available port number.
57
+ */ export declare const getPort: ({ host, port, strictPort, tryLimits }: {
58
+ host: string;
59
+ port: string | number;
60
+ strictPort: boolean;
61
+ tryLimits?: number;
62
+ }) => Promise<number>;
63
+ export declare const resolvePort: (config: NormalizedConfig, lastPort?: number) => Promise<{
64
+ port: number;
65
+ portTip: string | undefined;
66
+ }>;
67
+ export declare const isWildcardHost: (host: string) => boolean;
68
+ export declare const getHostInUrl: (host: string) => Promise<string>;
69
+ export declare const getAddressUrls: ({ protocol, port, host }: {
70
+ protocol: string;
71
+ port: number;
72
+ host?: string;
73
+ }) => Promise<AddressUrl[]>;
74
+ export declare function getServerTerminator(server: Server | Http2SecureServer): () => Promise<void>;
75
+ /**
76
+ * Escape HTML characters
77
+ * @example
78
+ * escapeHtml('<div>Hello</div>') // '&lt;div&gt;Hello&lt;/div&gt;'
79
+ */ export declare function escapeHtml(text: string | null | undefined): string;
80
+ export declare const HttpCode: {
81
+ readonly Ok: 200;
82
+ readonly NotModified: 304;
83
+ readonly BadRequest: 400;
84
+ readonly Forbidden: 403;
85
+ readonly NotFound: 404;
86
+ readonly PreconditionFailed: 412;
87
+ readonly RangeNotSatisfiable: 416;
88
+ readonly InternalServerError: 500;
89
+ };
90
+ /**
91
+ * The public server API shared by both the dev and preview servers.
92
+ */ export type RsbuildServerBase = {
93
+ /**
94
+ * Close the server.
95
+ * In the dev server, this will call the `onCloseDevServer` hook.
96
+ */ close: () => Promise<void>;
97
+ /**
98
+ * The Node.js HTTP server instance.
99
+ * - Will be `Http2SecureServer` if `server.https` config is used.
100
+ * - Will be `null` if `server.middlewareMode` is enabled.
101
+ */ httpServer: import('node:http').Server | import('node:http2').Http2SecureServer | null;
102
+ /**
103
+ * The `connect` app instance.
104
+ * Can be used to attach custom middlewares to the server.
105
+ */ middlewares: Connect.Server;
106
+ /**
107
+ * Open URL in the browser after starting the server.
108
+ */ open: () => Promise<void>;
109
+ /**
110
+ * The resolved port.
111
+ * By default, Rsbuild server listens on port `3000` and automatically increments
112
+ * the port number if the port is occupied.
113
+ */ port: number;
114
+ /**
115
+ * Print the server URLs.
116
+ */ printUrls: () => void;
117
+ };
118
+ export { };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This module is modified based on source found in
3
+ * https://github.com/bripkens/connect-history-api-fallback
4
+ *
5
+ * MIT Licensed
6
+ * Copyright (c) 2022 Ben Blackmore and contributors
7
+ * https://github.com/bripkens/connect-history-api-fallback/blob/master/LICENSE
8
+ */ import type { Logger } from '../logger.js';
9
+ import type { HistoryApiFallbackOptions, RequestHandler } from '../types/index.js';
10
+ export declare function historyApiFallbackMiddleware(logger: Logger, options?: HistoryApiFallbackOptions): RequestHandler;
@@ -0,0 +1 @@
1
+ export declare function resolveHostname(host?: string | undefined): Promise<string>;
@@ -0,0 +1,7 @@
1
+ import type { Server } from 'node:http';
2
+ import type { Http2SecureServer } from 'node:http2';
3
+ import type { Connect, ServerConfig } from '../types/index.js';
4
+ export declare const createHttpServer: ({ serverConfig, middlewares }: {
5
+ serverConfig: ServerConfig;
6
+ middlewares: Connect.Server;
7
+ }) => Promise<Http2SecureServer | Server>;
@@ -0,0 +1,31 @@
1
+ import { type Logger } from '../logger.js';
2
+ import type { Connect, EnvironmentAPI, RequestHandler, Rspack } from '../types/index.js';
3
+ export declare const faviconFallbackMiddleware: RequestHandler;
4
+ export declare const getRequestLoggerMiddleware: (logger: Logger) => Connect.NextHandleFunction;
5
+ export declare const notFoundMiddleware: RequestHandler;
6
+ export declare const optionsFallbackMiddleware: RequestHandler;
7
+ type HtmlAssetsMiddlewareOptions = {
8
+ distPaths: string[];
9
+ assetsMiddleware: RequestHandler;
10
+ outputFileSystem: Rspack.OutputFileSystem;
11
+ };
12
+ /**
13
+ * Support access HTML without suffix
14
+ */ export declare const getHtmlCompletionMiddleware: (params: HtmlAssetsMiddlewareOptions) => RequestHandler;
15
+ /**
16
+ * handle `server.base`
17
+ */ export declare const getBaseUrlMiddleware: (params: {
18
+ base: string;
19
+ }) => RequestHandler;
20
+ /**
21
+ * support HTML fallback in some edge cases
22
+ */ export declare const getHtmlFallbackMiddleware: (params: HtmlAssetsMiddlewareOptions & {
23
+ logger: Logger;
24
+ }) => RequestHandler;
25
+ /**
26
+ * Support viewing served files via `/rsbuild-dev-server` route
27
+ */ export declare const viewingServedFilesMiddleware: (params: {
28
+ environments: EnvironmentAPI;
29
+ logger: Logger;
30
+ }) => RequestHandler;
31
+ export { };
@@ -0,0 +1,12 @@
1
+ import type { Logger } from '../logger.js';
2
+ import type { NormalizedConfig, ReadonlyRoutes } from '../types/index.js';
3
+ export declare const replacePortPlaceholder: (url: string, port: number) => string;
4
+ export declare function resolveUrl(str: string, base: string): string;
5
+ export declare function open({ port, routes, config, protocol, clearCache, logger }: {
6
+ port: number;
7
+ routes: ReadonlyRoutes;
8
+ config: NormalizedConfig;
9
+ protocol: string;
10
+ clearCache?: boolean;
11
+ logger: Logger;
12
+ }): Promise<void>;
@@ -0,0 +1,3 @@
1
+ export declare function formatDisplayPath(filePath: string, isAbsolute: boolean, root?: string): string;
2
+ export declare function convertLinksInHtml(text: string, root?: string): string;
3
+ export declare function renderErrorToHtml(error: string, root?: string): string;
@@ -0,0 +1,4 @@
1
+ import type { InternalContext, NormalizedConfig, PreviewOptions } from '../types/index.js';
2
+ import { type RsbuildServerBase, type StartPreviewServerResult } from './helper.js';
3
+ export type RsbuildPreviewServer = RsbuildServerBase;
4
+ export declare function startPreviewServer(context: InternalContext, config: NormalizedConfig, { getPortSilently }?: PreviewOptions): Promise<StartPreviewServerResult>;
@@ -0,0 +1,7 @@
1
+ import type { Logger } from '../logger.js';
2
+ import type { RequestHandler as Middleware, ProxyConfig } from '../types/index.js';
3
+ import { type UpgradeEvent } from './helper.js';
4
+ export declare function createProxyMiddleware(proxyOptions: ProxyConfig, logger: Logger): Promise<{
5
+ middlewares: Middleware[];
6
+ upgrade: UpgradeEvent;
7
+ }>;
@@ -0,0 +1,2 @@
1
+ export declare const getPublicPathname: (publicPath: string) => string;
2
+ export declare const getPublicPathnames: (publicPaths: string[], base: string) => string[];
@@ -0,0 +1,2 @@
1
+ import type { Module, SyntheticModule } from 'node:vm';
2
+ export declare const asModule: (vm: typeof import('node:vm'), moduleExports: unknown, context: Record<string, unknown>, unlinked?: boolean) => Promise<Module | SyntheticModule>;
@@ -0,0 +1,25 @@
1
+ import type { BasicGlobalContext, BasicModuleScope, BasicRunnerFile, ModuleObject, Runner, RunnerFactoryOptions, RunnerRequirer } from './type.js';
2
+ export interface BasicRunnerOptions extends RunnerFactoryOptions {
3
+ name: string;
4
+ }
5
+ export declare abstract class BasicRunner implements Runner {
6
+ protected readonly options: BasicRunnerOptions;
7
+ protected globalContext: BasicGlobalContext | null;
8
+ protected baseModuleScope: BasicModuleScope | null;
9
+ protected requirers: Map<string, RunnerRequirer>;
10
+ constructor(options: BasicRunnerOptions);
11
+ run(file: string): Promise<unknown>;
12
+ getRequire(): RunnerRequirer;
13
+ protected abstract createGlobalContext(): BasicGlobalContext;
14
+ protected abstract createBaseModuleScope(): BasicModuleScope;
15
+ protected abstract createModuleScope(requireFn: RunnerRequirer, m: ModuleObject, file: BasicRunnerFile): BasicModuleScope;
16
+ /**
17
+ * Resolve a module path without reading its content.
18
+ *
19
+ * @returns File information, or null if the module is not an rspack output.
20
+ */ protected getFile(modulePath: string[] | string, currentDirectory: string): BasicRunnerFile | null;
21
+ protected getFileContent(file: BasicRunnerFile): string;
22
+ protected preExecute(_code: string, _file: BasicRunnerFile): void;
23
+ protected postExecute(_m: ModuleObject, _file: BasicRunnerFile): void;
24
+ protected createRunner(): void;
25
+ }
@@ -0,0 +1,10 @@
1
+ import { BasicRunner } from './basic.js';
2
+ import type { BasicGlobalContext, BasicModuleScope, BasicRunnerFile, ModuleObject, RunnerRequirer } from './type.js';
3
+ export declare class CommonJsRunner extends BasicRunner {
4
+ protected createGlobalContext(): BasicGlobalContext;
5
+ protected createBaseModuleScope(): BasicModuleScope;
6
+ protected createModuleScope(requireFn: RunnerRequirer, m: ModuleObject, file: BasicRunnerFile): BasicModuleScope;
7
+ protected createRunner(): void;
8
+ protected createMissRequirer(): RunnerRequirer;
9
+ protected createCjsRequirer(): RunnerRequirer;
10
+ }
@@ -0,0 +1,6 @@
1
+ import { CommonJsRunner } from './cjs.js';
2
+ import { type RunnerRequirer } from './type.js';
3
+ export declare class EsmRunner extends CommonJsRunner {
4
+ protected createRunner(): void;
5
+ protected createEsmRequirer(): RunnerRequirer;
6
+ }