@rsdoctor/types 1.5.12 → 2.0.0-alpha.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.
package/dist/client.d.cts CHANGED
@@ -7,10 +7,10 @@ export declare enum RsdoctorClientUrlQuery {
7
7
  export declare enum RsdoctorClientRoutes {
8
8
  Home = "/",
9
9
  Overall = "/overall",
10
- WebpackLoaderOverall = "/webpack/loaders/overall",
11
- WebpackLoaderAnalysis = "/webpack/loaders/analysis",
10
+ LoaderOverall = "/loaders/overall",
11
+ LoaderAnalysis = "/loaders/analysis",
12
12
  ModuleResolve = "/module/resolve",
13
- WebpackPlugins = "/webpack/plugins",
13
+ Plugins = "/plugins",
14
14
  BundleSize = "/bundle/size",
15
15
  ModuleAnalyze = "/module/analyze",
16
16
  TreeShaking = "/treeshaking",
package/dist/client.d.ts CHANGED
@@ -7,10 +7,10 @@ export declare enum RsdoctorClientUrlQuery {
7
7
  export declare enum RsdoctorClientRoutes {
8
8
  Home = "/",
9
9
  Overall = "/overall",
10
- WebpackLoaderOverall = "/webpack/loaders/overall",
11
- WebpackLoaderAnalysis = "/webpack/loaders/analysis",
10
+ LoaderOverall = "/loaders/overall",
11
+ LoaderAnalysis = "/loaders/analysis",
12
12
  ModuleResolve = "/module/resolve",
13
- WebpackPlugins = "/webpack/plugins",
13
+ Plugins = "/plugins",
14
14
  BundleSize = "/bundle/size",
15
15
  ModuleAnalyze = "/module/analyze",
16
16
  TreeShaking = "/treeshaking",
package/dist/index.cjs CHANGED
@@ -131,9 +131,9 @@ var config_namespaceObject = {};
131
131
  __webpack_require__.r(config_namespaceObject);
132
132
  var manifest_RsdoctorManifestClientRoutes = /*#__PURE__*/ function(RsdoctorManifestClientRoutes) {
133
133
  RsdoctorManifestClientRoutes["Overall"] = "Overall";
134
- RsdoctorManifestClientRoutes["WebpackLoaders"] = "Compile.WebpackLoaders";
134
+ RsdoctorManifestClientRoutes["Loaders"] = "Compile.Loaders";
135
135
  RsdoctorManifestClientRoutes["ModuleResolve"] = "Compile.ModuleResolve";
136
- RsdoctorManifestClientRoutes["WebpackPlugins"] = "Compile.WebpackPlugins";
136
+ RsdoctorManifestClientRoutes["Plugins"] = "Compile.Plugins";
137
137
  RsdoctorManifestClientRoutes["BundleSize"] = "Bundle.BundleSize";
138
138
  RsdoctorManifestClientRoutes["ModuleGraph"] = "Bundle.ModuleGraph";
139
139
  RsdoctorManifestClientRoutes["TreeShaking"] = "Bundle.TreeShaking";
@@ -277,7 +277,7 @@ This negatively impacts the bundle size of your application.
277
277
 
278
278
  #### General Solution
279
279
 
280
- Add an entry in \`resolve.alias\` to configure Webpack to route any package references to a single specified path.
280
+ Add an entry in \`resolve.alias\` to configure Rspack to route any package references to a single specified path.
281
281
 
282
282
  For example, if \`lodash\` is duplicated in your bundle, the following configuration would make all Lodash imports refer to the \`lodash\` instance found at \`./node_modules/lodash\`:
283
283
 
@@ -305,7 +305,7 @@ There is a package with the same version that is duplicated across different chu
305
305
 
306
306
  To address this issue, you can use Rspack's **SplitChunksPlugin** to extract common dependencies into a separate chunk. This ensures that the same package is not duplicated across multiple chunks, thereby reducing the bundle size.
307
307
 
308
- For example, if **lodash** is being duplicated across different chunks, you can configure the **optimization.splitChunks** option in your Webpack configuration to extract **lodash** into a separate chunk:
308
+ For example, if **lodash** is being duplicated across different chunks, you can configure the **optimization.splitChunks** option in your Rspack configuration to extract **lodash** into a separate chunk:
309
309
 
310
310
  \`\`\`
311
311
  module.exports = {
@@ -341,7 +341,7 @@ And the loaders always pre-process many unnecessary files, such as \`node_module
341
341
 
342
342
  #### General Solution
343
343
 
344
- Set \`exclude\` to the \`module.rules\` of webpack configuration for target loader.
344
+ Set \`exclude\` to the \`module.rules\` of Rspack configuration for target loader.
345
345
 
346
346
  For example, if \`node_modules/lodash\` is processed by the \`babel-loader\` that make the compile slowly:
347
347
 
@@ -383,7 +383,7 @@ const E1005_message = {
383
383
  description: `
384
384
  #### Description
385
385
 
386
- Usually webpack will automatically compatible different modules that has different types, but in a special case, the operation of compatibility will fail.
386
+ Usually the bundler will automatically compatible different modules that has different types, but in a special case, the operation of compatibility will fail.
387
387
  That is, when you use \`Default Import\` to import a cjs module, and this cjs module do not have the compatible statement, such as \`exports.default = \`.
388
388
 
389
389
  #### General Solution
@@ -408,7 +408,7 @@ const E1006_message = {
408
408
  title: 'Module Mixed Chunks',
409
409
  type: 'markdown',
410
410
  category: 'bundle',
411
- description: "\n#### Description\n\nWhen a module is included in both **initial chunks** and **async chunks**, the same module code is bundled into multiple chunks, increasing output size and potentially affecting first-screen load and cache efficiency.\n\n- **Initial chunks**: Chunks loaded with the main entry (e.g. entry points, synchronous `import` in the main bundle).\n- **Async chunks**: Chunks loaded on demand via dynamic `import()` or similar.\n\nIn the **Module Mixed Chunks** tab of Bundle Alerts, each entry shows the module path, **Initial Chunks** list, and **Async Chunks** list so you can locate duplicated modules.\n\n#### Common Causes\n\n- **Same module referenced in two ways**: The module is both synchronously imported in the main bundle or entry and dynamically `import()`ed elsewhere, so the bundler emits it in both initial and async chunks.\n- **A file is both an entry and an async chunk**: e.g. a utility module is configured as an entry and also `import()`ed in app code, so it appears in the entry's initial chunk and in a dynamically loaded async chunk.\n- **splitChunks overlapping with entry**: A path is split into an async chunk via `splitChunks` / `chunkSplit`, but that path is also an entry or a main-bundle dependency, leading to mixed chunk types.\n\n#### General Solution\n\n1. **Use a single import style**: Prefer one way to reference a module—either all synchronous imports (initial) or all dynamic `import()` (async). Avoid the same file being both synchronously imported in the main bundle and dynamically imported elsewhere.\n2. **Review entry vs dynamic loading**: If a file is both an entry and part of an async chunk, remove one of those usages or extract it into a single shared chunk via build config so both initial and async chunks reference it instead of duplicating it.\n3. **Adjust splitChunks**: Check rules for that module path in `optimization.splitChunks` (Rspack/Webpack) or `performance.chunkSplit` (Rsbuild), and avoid the same module being split into both initial and async chunks. Use `chunks: 'async'` or `chunks: 'initial'` where appropriate, or control which chunk type it goes into via `cacheGroups` and `test` / `chunks`.\n4. **Trace dependencies**: From the reported module path and chunk list, search the codebase for references to that module, distinguish sync vs dynamic imports, then converge to a single chunk type or extract a common chunk.\n"
411
+ description: "\n#### Description\n\nWhen a module is included in both **initial chunks** and **async chunks**, the same module code is bundled into multiple chunks, increasing output size and potentially affecting first-screen load and cache efficiency.\n\n- **Initial chunks**: Chunks loaded with the main entry (e.g. entry points, synchronous `import` in the main bundle).\n- **Async chunks**: Chunks loaded on demand via dynamic `import()` or similar.\n\nIn the **Module Mixed Chunks** tab of Bundle Alerts, each entry shows the module path, **Initial Chunks** list, and **Async Chunks** list so you can locate duplicated modules.\n\n#### Common Causes\n\n- **Same module referenced in two ways**: The module is both synchronously imported in the main bundle or entry and dynamically `import()`ed elsewhere, so the bundler emits it in both initial and async chunks.\n- **A file is both an entry and an async chunk**: e.g. a utility module is configured as an entry and also `import()`ed in app code, so it appears in the entry's initial chunk and in a dynamically loaded async chunk.\n- **splitChunks overlapping with entry**: A path is split into an async chunk via `splitChunks` / `chunkSplit`, but that path is also an entry or a main-bundle dependency, leading to mixed chunk types.\n\n#### General Solution\n\n1. **Use a single import style**: Prefer one way to reference a module—either all synchronous imports (initial) or all dynamic `import()` (async). Avoid the same file being both synchronously imported in the main bundle and dynamically imported elsewhere.\n2. **Review entry vs dynamic loading**: If a file is both an entry and part of an async chunk, remove one of those usages or extract it into a single shared chunk via build config so both initial and async chunks reference it instead of duplicating it.\n3. **Adjust splitChunks**: Check rules for that module path in `optimization.splitChunks` (Rspack) or `performance.chunkSplit` (Rsbuild), and avoid the same module being split into both initial and async chunks. Use `chunks: 'async'` or `chunks: 'initial'` where appropriate, or control which chunk type it goes into via `cacheGroups` and `test` / `chunks`.\n4. **Trace dependencies**: From the reported module path and chunk list, search the codebase for references to that module, distinguish sync vs dynamic imports, then converge to a single chunk type or extract a common chunk.\n"
412
412
  };
413
413
  const E1007_code = 'E1007';
414
414
  const E1007_message = {
@@ -432,7 +432,7 @@ const E1009_message = {
432
432
  title: 'ESM Import Resolved to CJS',
433
433
  type: 'markdown',
434
434
  category: 'bundle',
435
- description: '\n#### Description\n\nThis rule detects cases where a package provides both **ESM** and **CJS** formats (via the `module` field or `exports["."]["import"]` in `package.json`), but the bundler resolved the ESM `import` statement to the **CJS** entry instead.\n\nThis prevents tree-shaking of the package, leading to larger bundle sizes than necessary.\n\n#### Common Causes\n\n- The bundler\'s `resolve.mainFields` does not include `module`, so it falls back to `main` (CJS).\n- The `resolve.conditionNames` does not include `import`, so `exports` conditions are resolved as `require`.\n- The package uses `exports` field but the bundler version does not support conditional exports.\n\n#### General Solution\n\n1. **Add `module` to `resolve.mainFields`**: Ensure your bundler config includes `"module"` before `"main"`.\n2. **Add `import` to `resolve.conditionNames`**: For packages using the `exports` field, ensure the `import` condition is listed.\n3. **Check bundler version**: Older versions of webpack/rspack may not support `exports` conditional resolution. Upgrade if necessary.\n'
435
+ description: '\n#### Description\n\nThis rule detects cases where a package provides both **ESM** and **CJS** formats (via the `module` field or `exports["."]["import"]` in `package.json`), but the bundler resolved the ESM `import` statement to the **CJS** entry instead.\n\nThis prevents tree-shaking of the package, leading to larger bundle sizes than necessary.\n\n#### Common Causes\n\n- The bundler\'s `resolve.mainFields` does not include `module`, so it falls back to `main` (CJS).\n- The `resolve.conditionNames` does not include `import`, so `exports` conditions are resolved as `require`.\n- The package uses `exports` field but the bundler version does not support conditional exports.\n\n#### General Solution\n\n1. **Add `module` to `resolve.mainFields`**: Ensure your bundler config includes `"module"` before `"main"`.\n2. **Add `import` to `resolve.conditionNames`**: For packages using the `exports` field, ensure the `import` condition is listed.\n3. **Check bundler version**: Older Rspack versions may not support `exports` conditional resolution. Upgrade if necessary.\n'
436
436
  };
437
437
  var type_RuleMessageCodeEnumerated = /*#__PURE__*/ function(RuleMessageCodeEnumerated) {
438
438
  RuleMessageCodeEnumerated["Extend"] = "EXTEND";
@@ -469,10 +469,10 @@ var client_RsdoctorClientUrlQuery = /*#__PURE__*/ function(RsdoctorClientUrlQuer
469
469
  var client_RsdoctorClientRoutes = /*#__PURE__*/ function(RsdoctorClientRoutes) {
470
470
  RsdoctorClientRoutes["Home"] = "/";
471
471
  RsdoctorClientRoutes["Overall"] = "/overall";
472
- RsdoctorClientRoutes["WebpackLoaderOverall"] = "/webpack/loaders/overall";
473
- RsdoctorClientRoutes["WebpackLoaderAnalysis"] = "/webpack/loaders/analysis";
472
+ RsdoctorClientRoutes["LoaderOverall"] = "/loaders/overall";
473
+ RsdoctorClientRoutes["LoaderAnalysis"] = "/loaders/analysis";
474
474
  RsdoctorClientRoutes["ModuleResolve"] = "/module/resolve";
475
- RsdoctorClientRoutes["WebpackPlugins"] = "/webpack/plugins";
475
+ RsdoctorClientRoutes["Plugins"] = "/plugins";
476
476
  RsdoctorClientRoutes["BundleSize"] = "/bundle/size";
477
477
  RsdoctorClientRoutes["ModuleAnalyze"] = "/module/analyze";
478
478
  RsdoctorClientRoutes["TreeShaking"] = "/treeshaking";
package/dist/index.js CHANGED
@@ -111,9 +111,9 @@ var thirdparty_namespaceObject = {};
111
111
  __webpack_require__.r(thirdparty_namespaceObject);
112
112
  var manifest_RsdoctorManifestClientRoutes = /*#__PURE__*/ function(RsdoctorManifestClientRoutes) {
113
113
  RsdoctorManifestClientRoutes["Overall"] = "Overall";
114
- RsdoctorManifestClientRoutes["WebpackLoaders"] = "Compile.WebpackLoaders";
114
+ RsdoctorManifestClientRoutes["Loaders"] = "Compile.Loaders";
115
115
  RsdoctorManifestClientRoutes["ModuleResolve"] = "Compile.ModuleResolve";
116
- RsdoctorManifestClientRoutes["WebpackPlugins"] = "Compile.WebpackPlugins";
116
+ RsdoctorManifestClientRoutes["Plugins"] = "Compile.Plugins";
117
117
  RsdoctorManifestClientRoutes["BundleSize"] = "Bundle.BundleSize";
118
118
  RsdoctorManifestClientRoutes["ModuleGraph"] = "Bundle.ModuleGraph";
119
119
  RsdoctorManifestClientRoutes["TreeShaking"] = "Bundle.TreeShaking";
@@ -257,7 +257,7 @@ This negatively impacts the bundle size of your application.
257
257
 
258
258
  #### General Solution
259
259
 
260
- Add an entry in \`resolve.alias\` to configure Webpack to route any package references to a single specified path.
260
+ Add an entry in \`resolve.alias\` to configure Rspack to route any package references to a single specified path.
261
261
 
262
262
  For example, if \`lodash\` is duplicated in your bundle, the following configuration would make all Lodash imports refer to the \`lodash\` instance found at \`./node_modules/lodash\`:
263
263
 
@@ -285,7 +285,7 @@ There is a package with the same version that is duplicated across different chu
285
285
 
286
286
  To address this issue, you can use Rspack's **SplitChunksPlugin** to extract common dependencies into a separate chunk. This ensures that the same package is not duplicated across multiple chunks, thereby reducing the bundle size.
287
287
 
288
- For example, if **lodash** is being duplicated across different chunks, you can configure the **optimization.splitChunks** option in your Webpack configuration to extract **lodash** into a separate chunk:
288
+ For example, if **lodash** is being duplicated across different chunks, you can configure the **optimization.splitChunks** option in your Rspack configuration to extract **lodash** into a separate chunk:
289
289
 
290
290
  \`\`\`
291
291
  module.exports = {
@@ -321,7 +321,7 @@ And the loaders always pre-process many unnecessary files, such as \`node_module
321
321
 
322
322
  #### General Solution
323
323
 
324
- Set \`exclude\` to the \`module.rules\` of webpack configuration for target loader.
324
+ Set \`exclude\` to the \`module.rules\` of Rspack configuration for target loader.
325
325
 
326
326
  For example, if \`node_modules/lodash\` is processed by the \`babel-loader\` that make the compile slowly:
327
327
 
@@ -363,7 +363,7 @@ const E1005_message = {
363
363
  description: `
364
364
  #### Description
365
365
 
366
- Usually webpack will automatically compatible different modules that has different types, but in a special case, the operation of compatibility will fail.
366
+ Usually the bundler will automatically compatible different modules that has different types, but in a special case, the operation of compatibility will fail.
367
367
  That is, when you use \`Default Import\` to import a cjs module, and this cjs module do not have the compatible statement, such as \`exports.default = \`.
368
368
 
369
369
  #### General Solution
@@ -388,7 +388,7 @@ const E1006_message = {
388
388
  title: 'Module Mixed Chunks',
389
389
  type: 'markdown',
390
390
  category: 'bundle',
391
- description: "\n#### Description\n\nWhen a module is included in both **initial chunks** and **async chunks**, the same module code is bundled into multiple chunks, increasing output size and potentially affecting first-screen load and cache efficiency.\n\n- **Initial chunks**: Chunks loaded with the main entry (e.g. entry points, synchronous `import` in the main bundle).\n- **Async chunks**: Chunks loaded on demand via dynamic `import()` or similar.\n\nIn the **Module Mixed Chunks** tab of Bundle Alerts, each entry shows the module path, **Initial Chunks** list, and **Async Chunks** list so you can locate duplicated modules.\n\n#### Common Causes\n\n- **Same module referenced in two ways**: The module is both synchronously imported in the main bundle or entry and dynamically `import()`ed elsewhere, so the bundler emits it in both initial and async chunks.\n- **A file is both an entry and an async chunk**: e.g. a utility module is configured as an entry and also `import()`ed in app code, so it appears in the entry's initial chunk and in a dynamically loaded async chunk.\n- **splitChunks overlapping with entry**: A path is split into an async chunk via `splitChunks` / `chunkSplit`, but that path is also an entry or a main-bundle dependency, leading to mixed chunk types.\n\n#### General Solution\n\n1. **Use a single import style**: Prefer one way to reference a module—either all synchronous imports (initial) or all dynamic `import()` (async). Avoid the same file being both synchronously imported in the main bundle and dynamically imported elsewhere.\n2. **Review entry vs dynamic loading**: If a file is both an entry and part of an async chunk, remove one of those usages or extract it into a single shared chunk via build config so both initial and async chunks reference it instead of duplicating it.\n3. **Adjust splitChunks**: Check rules for that module path in `optimization.splitChunks` (Rspack/Webpack) or `performance.chunkSplit` (Rsbuild), and avoid the same module being split into both initial and async chunks. Use `chunks: 'async'` or `chunks: 'initial'` where appropriate, or control which chunk type it goes into via `cacheGroups` and `test` / `chunks`.\n4. **Trace dependencies**: From the reported module path and chunk list, search the codebase for references to that module, distinguish sync vs dynamic imports, then converge to a single chunk type or extract a common chunk.\n"
391
+ description: "\n#### Description\n\nWhen a module is included in both **initial chunks** and **async chunks**, the same module code is bundled into multiple chunks, increasing output size and potentially affecting first-screen load and cache efficiency.\n\n- **Initial chunks**: Chunks loaded with the main entry (e.g. entry points, synchronous `import` in the main bundle).\n- **Async chunks**: Chunks loaded on demand via dynamic `import()` or similar.\n\nIn the **Module Mixed Chunks** tab of Bundle Alerts, each entry shows the module path, **Initial Chunks** list, and **Async Chunks** list so you can locate duplicated modules.\n\n#### Common Causes\n\n- **Same module referenced in two ways**: The module is both synchronously imported in the main bundle or entry and dynamically `import()`ed elsewhere, so the bundler emits it in both initial and async chunks.\n- **A file is both an entry and an async chunk**: e.g. a utility module is configured as an entry and also `import()`ed in app code, so it appears in the entry's initial chunk and in a dynamically loaded async chunk.\n- **splitChunks overlapping with entry**: A path is split into an async chunk via `splitChunks` / `chunkSplit`, but that path is also an entry or a main-bundle dependency, leading to mixed chunk types.\n\n#### General Solution\n\n1. **Use a single import style**: Prefer one way to reference a module—either all synchronous imports (initial) or all dynamic `import()` (async). Avoid the same file being both synchronously imported in the main bundle and dynamically imported elsewhere.\n2. **Review entry vs dynamic loading**: If a file is both an entry and part of an async chunk, remove one of those usages or extract it into a single shared chunk via build config so both initial and async chunks reference it instead of duplicating it.\n3. **Adjust splitChunks**: Check rules for that module path in `optimization.splitChunks` (Rspack) or `performance.chunkSplit` (Rsbuild), and avoid the same module being split into both initial and async chunks. Use `chunks: 'async'` or `chunks: 'initial'` where appropriate, or control which chunk type it goes into via `cacheGroups` and `test` / `chunks`.\n4. **Trace dependencies**: From the reported module path and chunk list, search the codebase for references to that module, distinguish sync vs dynamic imports, then converge to a single chunk type or extract a common chunk.\n"
392
392
  };
393
393
  const E1007_code = 'E1007';
394
394
  const E1007_message = {
@@ -412,7 +412,7 @@ const E1009_message = {
412
412
  title: 'ESM Import Resolved to CJS',
413
413
  type: 'markdown',
414
414
  category: 'bundle',
415
- description: '\n#### Description\n\nThis rule detects cases where a package provides both **ESM** and **CJS** formats (via the `module` field or `exports["."]["import"]` in `package.json`), but the bundler resolved the ESM `import` statement to the **CJS** entry instead.\n\nThis prevents tree-shaking of the package, leading to larger bundle sizes than necessary.\n\n#### Common Causes\n\n- The bundler\'s `resolve.mainFields` does not include `module`, so it falls back to `main` (CJS).\n- The `resolve.conditionNames` does not include `import`, so `exports` conditions are resolved as `require`.\n- The package uses `exports` field but the bundler version does not support conditional exports.\n\n#### General Solution\n\n1. **Add `module` to `resolve.mainFields`**: Ensure your bundler config includes `"module"` before `"main"`.\n2. **Add `import` to `resolve.conditionNames`**: For packages using the `exports` field, ensure the `import` condition is listed.\n3. **Check bundler version**: Older versions of webpack/rspack may not support `exports` conditional resolution. Upgrade if necessary.\n'
415
+ description: '\n#### Description\n\nThis rule detects cases where a package provides both **ESM** and **CJS** formats (via the `module` field or `exports["."]["import"]` in `package.json`), but the bundler resolved the ESM `import` statement to the **CJS** entry instead.\n\nThis prevents tree-shaking of the package, leading to larger bundle sizes than necessary.\n\n#### Common Causes\n\n- The bundler\'s `resolve.mainFields` does not include `module`, so it falls back to `main` (CJS).\n- The `resolve.conditionNames` does not include `import`, so `exports` conditions are resolved as `require`.\n- The package uses `exports` field but the bundler version does not support conditional exports.\n\n#### General Solution\n\n1. **Add `module` to `resolve.mainFields`**: Ensure your bundler config includes `"module"` before `"main"`.\n2. **Add `import` to `resolve.conditionNames`**: For packages using the `exports` field, ensure the `import` condition is listed.\n3. **Check bundler version**: Older Rspack versions may not support `exports` conditional resolution. Upgrade if necessary.\n'
416
416
  };
417
417
  var type_RuleMessageCodeEnumerated = /*#__PURE__*/ function(RuleMessageCodeEnumerated) {
418
418
  RuleMessageCodeEnumerated["Extend"] = "EXTEND";
@@ -449,10 +449,10 @@ var client_RsdoctorClientUrlQuery = /*#__PURE__*/ function(RsdoctorClientUrlQuer
449
449
  var client_RsdoctorClientRoutes = /*#__PURE__*/ function(RsdoctorClientRoutes) {
450
450
  RsdoctorClientRoutes["Home"] = "/";
451
451
  RsdoctorClientRoutes["Overall"] = "/overall";
452
- RsdoctorClientRoutes["WebpackLoaderOverall"] = "/webpack/loaders/overall";
453
- RsdoctorClientRoutes["WebpackLoaderAnalysis"] = "/webpack/loaders/analysis";
452
+ RsdoctorClientRoutes["LoaderOverall"] = "/loaders/overall";
453
+ RsdoctorClientRoutes["LoaderAnalysis"] = "/loaders/analysis";
454
454
  RsdoctorClientRoutes["ModuleResolve"] = "/module/resolve";
455
- RsdoctorClientRoutes["WebpackPlugins"] = "/webpack/plugins";
455
+ RsdoctorClientRoutes["Plugins"] = "/plugins";
456
456
  RsdoctorClientRoutes["BundleSize"] = "/bundle/size";
457
457
  RsdoctorClientRoutes["ModuleAnalyze"] = "/module/analyze";
458
458
  RsdoctorClientRoutes["TreeShaking"] = "/treeshaking";
@@ -44,9 +44,9 @@ export interface RsdoctorManifestData extends StoreData {
44
44
  }
45
45
  export declare enum RsdoctorManifestClientRoutes {
46
46
  Overall = "Overall",
47
- WebpackLoaders = "Compile.WebpackLoaders",
47
+ Loaders = "Compile.Loaders",
48
48
  ModuleResolve = "Compile.ModuleResolve",
49
- WebpackPlugins = "Compile.WebpackPlugins",
49
+ Plugins = "Compile.Plugins",
50
50
  BundleSize = "Bundle.BundleSize",
51
51
  ModuleGraph = "Bundle.ModuleGraph",
52
52
  TreeShaking = "Bundle.TreeShaking"
@@ -44,9 +44,9 @@ export interface RsdoctorManifestData extends StoreData {
44
44
  }
45
45
  export declare enum RsdoctorManifestClientRoutes {
46
46
  Overall = "Overall",
47
- WebpackLoaders = "Compile.WebpackLoaders",
47
+ Loaders = "Compile.Loaders",
48
48
  ModuleResolve = "Compile.ModuleResolve",
49
- WebpackPlugins = "Compile.WebpackPlugins",
49
+ Plugins = "Compile.Plugins",
50
50
  BundleSize = "Bundle.BundleSize",
51
51
  ModuleGraph = "Bundle.ModuleGraph",
52
52
  TreeShaking = "Bundle.TreeShaking"
@@ -1,13 +1,12 @@
1
- import type { Compiler, Compilation, Stats, StatsError, RuleSetRule } from 'webpack';
2
- import type { Compiler as RspackCompiler, Compilation as RspackCompilation, Stats as RspackStats, RuleSetRule as RspackRuleSetRule, MultiCompiler } from '@rspack/core';
1
+ import type { Compiler as RspackCompiler, Compilation as RspackCompilation, Stats as RspackStats, StatsError as RspackStatsError, RuleSetRule as RspackRuleSetRule, MultiCompiler } from '@rspack/core';
3
2
  type RspackCompilerWrapper = RspackCompiler & Pick<MultiCompiler, keyof Omit<MultiCompiler, 'hooks' | 'options' | 'isChild'>>;
4
3
  type RspackStatsWrapper = any extends RspackStats ? never : RspackStats;
5
4
  type RspackRuleSetRuleWrapper = any extends RspackRuleSetRule ? never : RspackRuleSetRule;
6
- export type BaseCompilerType<T extends 'rspack' | 'webpack' = 'webpack'> = T extends 'rspack' ? RspackCompilerWrapper : Compiler;
7
- export type BaseCompiler = BaseCompilerType | BaseCompilerType<'rspack'>;
8
- export type BaseCompilationType<T extends 'rspack' | 'webpack' = 'webpack'> = T extends 'rspack' ? Compilation : RspackCompilation;
9
- export type BaseCompilation = BaseCompilationType | BaseCompilationType<'rspack'>;
10
- export type BaseStats = Stats | RspackStatsWrapper;
5
+ export type BaseCompilerType<T extends 'rspack' = 'rspack'> = T extends 'rspack' ? RspackCompilerWrapper : never;
6
+ export type BaseCompiler = BaseCompilerType;
7
+ export type BaseCompilationType<T extends 'rspack' = 'rspack'> = T extends 'rspack' ? RspackCompilation : never;
8
+ export type BaseCompilation = BaseCompilationType;
9
+ export type BaseStats = RspackStatsWrapper;
11
10
  export interface JsStatsError {
12
11
  message: string;
13
12
  formatted?: string;
@@ -26,8 +25,8 @@ export interface JsRspackError {
26
25
  stack?: string;
27
26
  hideStack?: boolean;
28
27
  }
29
- export type BuildError = JsStatsError | StatsError;
30
- export type BuildWarning = JsStatsWarning | StatsError;
31
- export type BuildRuleSetRules = (false | '' | 0 | RuleSetRule | '...' | null | undefined)[];
32
- export type BuildRuleSetRule = RuleSetRule | RspackRuleSetRuleWrapper;
28
+ export type BuildError = JsStatsError | RspackStatsError;
29
+ export type BuildWarning = JsStatsWarning | RspackStatsError;
30
+ export type BuildRuleSetRules = (false | '' | 0 | RspackRuleSetRuleWrapper | '...' | null | undefined)[];
31
+ export type BuildRuleSetRule = RspackRuleSetRuleWrapper;
33
32
  export {};
@@ -1,13 +1,12 @@
1
- import type { Compiler, Compilation, Stats, StatsError, RuleSetRule } from 'webpack';
2
- import type { Compiler as RspackCompiler, Compilation as RspackCompilation, Stats as RspackStats, RuleSetRule as RspackRuleSetRule, MultiCompiler } from '@rspack/core';
1
+ import type { Compiler as RspackCompiler, Compilation as RspackCompilation, Stats as RspackStats, StatsError as RspackStatsError, RuleSetRule as RspackRuleSetRule, MultiCompiler } from '@rspack/core';
3
2
  type RspackCompilerWrapper = RspackCompiler & Pick<MultiCompiler, keyof Omit<MultiCompiler, 'hooks' | 'options' | 'isChild'>>;
4
3
  type RspackStatsWrapper = any extends RspackStats ? never : RspackStats;
5
4
  type RspackRuleSetRuleWrapper = any extends RspackRuleSetRule ? never : RspackRuleSetRule;
6
- export type BaseCompilerType<T extends 'rspack' | 'webpack' = 'webpack'> = T extends 'rspack' ? RspackCompilerWrapper : Compiler;
7
- export type BaseCompiler = BaseCompilerType | BaseCompilerType<'rspack'>;
8
- export type BaseCompilationType<T extends 'rspack' | 'webpack' = 'webpack'> = T extends 'rspack' ? Compilation : RspackCompilation;
9
- export type BaseCompilation = BaseCompilationType | BaseCompilationType<'rspack'>;
10
- export type BaseStats = Stats | RspackStatsWrapper;
5
+ export type BaseCompilerType<T extends 'rspack' = 'rspack'> = T extends 'rspack' ? RspackCompilerWrapper : never;
6
+ export type BaseCompiler = BaseCompilerType;
7
+ export type BaseCompilationType<T extends 'rspack' = 'rspack'> = T extends 'rspack' ? RspackCompilation : never;
8
+ export type BaseCompilation = BaseCompilationType;
9
+ export type BaseStats = RspackStatsWrapper;
11
10
  export interface JsStatsError {
12
11
  message: string;
13
12
  formatted?: string;
@@ -26,8 +25,8 @@ export interface JsRspackError {
26
25
  stack?: string;
27
26
  hideStack?: boolean;
28
27
  }
29
- export type BuildError = JsStatsError | StatsError;
30
- export type BuildWarning = JsStatsWarning | StatsError;
31
- export type BuildRuleSetRules = (false | '' | 0 | RuleSetRule | '...' | null | undefined)[];
32
- export type BuildRuleSetRule = RuleSetRule | RspackRuleSetRuleWrapper;
28
+ export type BuildError = JsStatsError | RspackStatsError;
29
+ export type BuildWarning = JsStatsWarning | RspackStatsError;
30
+ export type BuildRuleSetRules = (false | '' | 0 | RspackRuleSetRuleWrapper | '...' | null | undefined)[];
31
+ export type BuildRuleSetRule = RspackRuleSetRuleWrapper;
33
32
  export {};
@@ -1,4 +1,3 @@
1
- import type { RuleSetRule as WebpackRuleSetRule, Configuration as WebpackConfiguration } from 'webpack';
2
1
  import type { Configuration as RspackConfiguration, RuleSetRule as RspackRuleSetRule } from '@rspack/core';
3
2
  export interface SourceMap {
4
3
  version: number;
@@ -11,11 +10,11 @@ export interface SourceMap {
11
10
  }
12
11
  type RspackConfigurationWrapper = any extends RspackConfiguration ? never : RspackConfiguration;
13
12
  type RspackRuleSetRuleWrapper = any extends RspackRuleSetRule ? never : RspackRuleSetRule;
14
- export type RuleSetRule = RspackRuleSetRuleWrapper | WebpackRuleSetRule;
15
- export type Configuration = WebpackConfiguration | RspackConfigurationWrapper;
13
+ export type RuleSetRule = RspackRuleSetRuleWrapper;
14
+ export type Configuration = RspackConfigurationWrapper;
16
15
  declare interface AdditionalData {
17
16
  [index: string]: any;
18
- webpackAST: object;
17
+ bundlerAST: object;
19
18
  }
20
19
  export interface LoaderDefinitionFunction<OptionsType = {}, ContextAdditions = {}> {
21
20
  (this: LoaderContext<OptionsType> & ContextAdditions, content: string, sourceMap?: string | SourceMap): string | void | Buffer | Promise<string | Buffer>;
@@ -1,4 +1,3 @@
1
- import type { RuleSetRule as WebpackRuleSetRule, Configuration as WebpackConfiguration } from 'webpack';
2
1
  import type { Configuration as RspackConfiguration, RuleSetRule as RspackRuleSetRule } from '@rspack/core';
3
2
  export interface SourceMap {
4
3
  version: number;
@@ -11,11 +10,11 @@ export interface SourceMap {
11
10
  }
12
11
  type RspackConfigurationWrapper = any extends RspackConfiguration ? never : RspackConfiguration;
13
12
  type RspackRuleSetRuleWrapper = any extends RspackRuleSetRule ? never : RspackRuleSetRule;
14
- export type RuleSetRule = RspackRuleSetRuleWrapper | WebpackRuleSetRule;
15
- export type Configuration = WebpackConfiguration | RspackConfigurationWrapper;
13
+ export type RuleSetRule = RspackRuleSetRuleWrapper;
14
+ export type Configuration = RspackConfigurationWrapper;
16
15
  declare interface AdditionalData {
17
16
  [index: string]: any;
18
- webpackAST: object;
17
+ bundlerAST: object;
19
18
  }
20
19
  export interface LoaderDefinitionFunction<OptionsType = {}, ContextAdditions = {}> {
21
20
  (this: LoaderContext<OptionsType> & ContextAdditions, content: string, sourceMap?: string | SourceMap): string | void | Buffer | Promise<string | Buffer>;
@@ -27,7 +27,7 @@ interface StatsOptionsObj {
27
27
  groupAssetsByExtension?: boolean;
28
28
  groupAssetsByEmitStatus?: boolean;
29
29
  }
30
- /** webpack not support boolean or string */
30
+ /** Boolean or string stats options are intentionally narrowed here. */
31
31
  type StatsOptions = StatsOptionsObj;
32
32
  interface StatsAssetInfo {
33
33
  development?: boolean;
@@ -27,7 +27,7 @@ interface StatsOptionsObj {
27
27
  groupAssetsByExtension?: boolean;
28
28
  groupAssetsByEmitStatus?: boolean;
29
29
  }
30
- /** webpack not support boolean or string */
30
+ /** Boolean or string stats options are intentionally narrowed here. */
31
31
  type StatsOptions = StatsOptionsObj;
32
32
  interface StatsAssetInfo {
33
33
  development?: boolean;
@@ -4,4 +4,3 @@ export * from './plugin';
4
4
  export * from './baseLoader';
5
5
  export * from './rspack';
6
6
  export * from './internal-rules';
7
- export * from './webpack';
@@ -4,4 +4,3 @@ export * from './plugin.js';
4
4
  export * from './baseLoader.js';
5
5
  export * from './rspack.js';
6
6
  export * from './internal-rules.js';
7
- export * from './webpack.js';
@@ -1,13 +1,13 @@
1
1
  import { Common, Config, Linter as LinterType, SDK } from '..';
2
2
  import { InternalRules } from './internal-rules';
3
- export interface RsdoctorWebpackPluginFeatures {
3
+ export interface RsdoctorRspackPluginFeatures {
4
4
  /**
5
- * turn off it if you need not to analyze the executions of webpack loaders.
5
+ * Turn it off if you do not need to analyze the executions of bundler loaders.
6
6
  * @default true
7
7
  */
8
8
  loader?: boolean;
9
9
  /**
10
- * turn off it if you need not to analyze the executions of webpack plugins.
10
+ * Turn it off if you do not need to analyze the executions of bundler plugins.
11
11
  * @default true
12
12
  */
13
13
  plugins?: boolean;
@@ -22,7 +22,7 @@ export interface RsdoctorWebpackPluginFeatures {
22
22
  */
23
23
  bundle?: boolean;
24
24
  /**
25
- * turn off it if you need not to analyze the result of tree shaking.
25
+ * Turn it on if you need to analyze tree-shaking side effects.
26
26
  * @default false
27
27
  */
28
28
  treeShaking?: boolean;
@@ -32,8 +32,8 @@ export interface RsdoctorWebpackPluginFeatures {
32
32
  */
33
33
  lite?: boolean;
34
34
  }
35
- export interface RsdoctorPluginOptionsNormalized<Rules extends LinterType.ExtendRuleData[] = []> extends Common.DeepRequired<Omit<RsdoctorWebpackPluginOptions<Rules>, 'sdkInstance' | 'linter' | 'output' | 'supports' | 'port' | 'brief' | 'mode'>> {
36
- features: Common.DeepRequired<RsdoctorWebpackPluginFeatures>;
35
+ export interface RsdoctorPluginOptionsNormalized<Rules extends LinterType.ExtendRuleData[] = []> extends Common.DeepRequired<Omit<RsdoctorRspackPluginOptions<Rules>, 'sdkInstance' | 'linter' | 'output' | 'supports' | 'port' | 'brief' | 'mode'>> {
36
+ features: Common.DeepRequired<RsdoctorRspackPluginFeatures>;
37
37
  linter: Required<LinterType.Options<Rules, InternalRules>>;
38
38
  sdkInstance?: SDK.RsdoctorBuilderSDKInstance;
39
39
  output: {
@@ -46,7 +46,6 @@ export interface RsdoctorPluginOptionsNormalized<Rules extends LinterType.Extend
46
46
  supports: ISupport;
47
47
  }
48
48
  interface ISupport {
49
- banner?: boolean;
50
49
  parseBundle?: boolean;
51
50
  generateTileGraph?: boolean;
52
51
  gzip?: boolean;
@@ -74,13 +73,13 @@ export type IReportCodeType = {
74
73
  noCode?: boolean;
75
74
  };
76
75
  export type NewReportCodeType = 'noModuleSource' | 'noAssetsAndModuleSource' | 'noCode';
77
- export interface RsdoctorWebpackPluginOptions<Rules extends LinterType.ExtendRuleData[]> {
76
+ export interface RsdoctorRspackPluginOptions<Rules extends LinterType.ExtendRuleData[]> {
78
77
  /** Checker configuration */
79
78
  linter?: LinterType.Options<Rules, InternalRules>;
80
79
  /**
81
80
  * the switch for the Rsdoctor features.
82
81
  */
83
- features?: RsdoctorWebpackPluginFeatures | Array<keyof RsdoctorWebpackPluginFeatures>;
82
+ features?: RsdoctorRspackPluginFeatures | Array<keyof RsdoctorRspackPluginFeatures>;
84
83
  /**
85
84
  * @deprecated Use `output.mode` instead, if you're using `lite` mode, please use `output.reportCodeType: 'noCode' or 'noAssetsAndModuleSource'` instead.
86
85
  * Rsdoctor mode option:
@@ -90,12 +89,12 @@ export interface RsdoctorWebpackPluginOptions<Rules extends LinterType.ExtendRul
90
89
  */
91
90
  mode?: 'brief' | 'normal' | 'lite';
92
91
  /**
93
- * configuration of the interceptor for webpack loaders. TODO: delete this options.
92
+ * Configuration for the bundler loader interceptor. TODO: delete this option.
94
93
  * @description worked when the `features.loader === true`.
95
94
  */
96
95
  loaderInterceptorOptions?: {
97
96
  /**
98
- * loaders which you want to skip it (will not report the target loader data when webpack compile).
97
+ * Loaders that should be skipped and not reported when the bundler compiles.
99
98
  */
100
99
  skipLoaders?: string[];
101
100
  };
@@ -108,9 +107,7 @@ export interface RsdoctorWebpackPluginOptions<Rules extends LinterType.ExtendRul
108
107
  * sdk instance of outside.
109
108
  */
110
109
  sdkInstance?: SDK.RsdoctorBuilderSDKInstance;
111
- /**
112
- * Whether to turn on some characteristic analysis capabilities, such as: the support for the BannerPlugin.
113
- */
110
+ /** Whether to turn on specific analysis capabilities. */
114
111
  supports?: ISupport;
115
112
  /**
116
113
  * The port of the Rsdoctor server.
@@ -1,13 +1,13 @@
1
1
  import { Common, Config, Linter as LinterType, SDK } from '../index.js';
2
2
  import { InternalRules } from './internal-rules.js';
3
- export interface RsdoctorWebpackPluginFeatures {
3
+ export interface RsdoctorRspackPluginFeatures {
4
4
  /**
5
- * turn off it if you need not to analyze the executions of webpack loaders.
5
+ * Turn it off if you do not need to analyze the executions of bundler loaders.
6
6
  * @default true
7
7
  */
8
8
  loader?: boolean;
9
9
  /**
10
- * turn off it if you need not to analyze the executions of webpack plugins.
10
+ * Turn it off if you do not need to analyze the executions of bundler plugins.
11
11
  * @default true
12
12
  */
13
13
  plugins?: boolean;
@@ -22,7 +22,7 @@ export interface RsdoctorWebpackPluginFeatures {
22
22
  */
23
23
  bundle?: boolean;
24
24
  /**
25
- * turn off it if you need not to analyze the result of tree shaking.
25
+ * Turn it on if you need to analyze tree-shaking side effects.
26
26
  * @default false
27
27
  */
28
28
  treeShaking?: boolean;
@@ -32,8 +32,8 @@ export interface RsdoctorWebpackPluginFeatures {
32
32
  */
33
33
  lite?: boolean;
34
34
  }
35
- export interface RsdoctorPluginOptionsNormalized<Rules extends LinterType.ExtendRuleData[] = []> extends Common.DeepRequired<Omit<RsdoctorWebpackPluginOptions<Rules>, 'sdkInstance' | 'linter' | 'output' | 'supports' | 'port' | 'brief' | 'mode'>> {
36
- features: Common.DeepRequired<RsdoctorWebpackPluginFeatures>;
35
+ export interface RsdoctorPluginOptionsNormalized<Rules extends LinterType.ExtendRuleData[] = []> extends Common.DeepRequired<Omit<RsdoctorRspackPluginOptions<Rules>, 'sdkInstance' | 'linter' | 'output' | 'supports' | 'port' | 'brief' | 'mode'>> {
36
+ features: Common.DeepRequired<RsdoctorRspackPluginFeatures>;
37
37
  linter: Required<LinterType.Options<Rules, InternalRules>>;
38
38
  sdkInstance?: SDK.RsdoctorBuilderSDKInstance;
39
39
  output: {
@@ -46,7 +46,6 @@ export interface RsdoctorPluginOptionsNormalized<Rules extends LinterType.Extend
46
46
  supports: ISupport;
47
47
  }
48
48
  interface ISupport {
49
- banner?: boolean;
50
49
  parseBundle?: boolean;
51
50
  generateTileGraph?: boolean;
52
51
  gzip?: boolean;
@@ -74,13 +73,13 @@ export type IReportCodeType = {
74
73
  noCode?: boolean;
75
74
  };
76
75
  export type NewReportCodeType = 'noModuleSource' | 'noAssetsAndModuleSource' | 'noCode';
77
- export interface RsdoctorWebpackPluginOptions<Rules extends LinterType.ExtendRuleData[]> {
76
+ export interface RsdoctorRspackPluginOptions<Rules extends LinterType.ExtendRuleData[]> {
78
77
  /** Checker configuration */
79
78
  linter?: LinterType.Options<Rules, InternalRules>;
80
79
  /**
81
80
  * the switch for the Rsdoctor features.
82
81
  */
83
- features?: RsdoctorWebpackPluginFeatures | Array<keyof RsdoctorWebpackPluginFeatures>;
82
+ features?: RsdoctorRspackPluginFeatures | Array<keyof RsdoctorRspackPluginFeatures>;
84
83
  /**
85
84
  * @deprecated Use `output.mode` instead, if you're using `lite` mode, please use `output.reportCodeType: 'noCode' or 'noAssetsAndModuleSource'` instead.
86
85
  * Rsdoctor mode option:
@@ -90,12 +89,12 @@ export interface RsdoctorWebpackPluginOptions<Rules extends LinterType.ExtendRul
90
89
  */
91
90
  mode?: 'brief' | 'normal' | 'lite';
92
91
  /**
93
- * configuration of the interceptor for webpack loaders. TODO: delete this options.
92
+ * Configuration for the bundler loader interceptor. TODO: delete this option.
94
93
  * @description worked when the `features.loader === true`.
95
94
  */
96
95
  loaderInterceptorOptions?: {
97
96
  /**
98
- * loaders which you want to skip it (will not report the target loader data when webpack compile).
97
+ * Loaders that should be skipped and not reported when the bundler compiles.
99
98
  */
100
99
  skipLoaders?: string[];
101
100
  };
@@ -108,9 +107,7 @@ export interface RsdoctorWebpackPluginOptions<Rules extends LinterType.ExtendRul
108
107
  * sdk instance of outside.
109
108
  */
110
109
  sdkInstance?: SDK.RsdoctorBuilderSDKInstance;
111
- /**
112
- * Whether to turn on some characteristic analysis capabilities, such as: the support for the BannerPlugin.
113
- */
110
+ /** Whether to turn on specific analysis capabilities. */
114
111
  supports?: ISupport;
115
112
  /**
116
113
  * The port of the Rsdoctor server.
@@ -1,5 +1,6 @@
1
- import type { RsdoctorPluginData, NormalModuleFactory, LoaderDefinitionFunction, ModuleGraph, Dependency } from '@rspack/core';
2
- export type RspackNormalModuleFactory = NormalModuleFactory;
1
+ import type { RsdoctorPluginData, NormalModuleFactory as RspackCoreNormalModuleFactory, LoaderDefinitionFunction, ModuleGraph, Dependency } from '@rspack/core';
2
+ export type RspackNormalModuleFactory = RspackCoreNormalModuleFactory;
3
+ export type NormalModuleFactory = RspackNormalModuleFactory;
3
4
  export type RspackNativeAsset = RsdoctorPluginData.RsdoctorAsset;
4
5
  export type RspackNativeChunkGraph = RsdoctorPluginData.RsdoctorChunkGraph;
5
6
  export type RspackNativeModuleGraph = RsdoctorPluginData.RsdoctorModuleGraph;
@@ -22,7 +23,11 @@ export type RspackNativeModuleSourcePatch = RsdoctorPluginData.RsdoctorModuleSou
22
23
  import rspack from '@rspack/core';
23
24
  export type RspackExportsExperiments = typeof rspack.experiments;
24
25
  export type RspackSourceMapInput = Parameters<LoaderDefinitionFunction>[1];
26
+ export type SourceMapInput = RspackSourceMapInput;
25
27
  export type RspackEntryPoint = boolean | 'auto';
28
+ export interface EntryPoint {
29
+ getRuntimeChunk(): any;
30
+ }
26
31
  export interface RspackExportInfo {
27
32
  used: boolean;
28
33
  provideInfo: boolean | null | undefined;
@@ -30,8 +35,15 @@ export interface RspackExportInfo {
30
35
  canMangle: boolean;
31
36
  }
32
37
  export type RspackExportsInfo = ReturnType<ModuleGraph['getExportsInfo']>;
38
+ export interface ExportInfo {
39
+ name?: string;
40
+ findTarget(graph: any, filter: () => boolean): any;
41
+ }
42
+ export type ExportsInfo = RspackExportsInfo;
33
43
  export interface RspackHarmonyImportSpecifierDependency extends Dependency {
34
44
  getIds(graph: ModuleGraph): string[];
35
45
  name: string;
36
46
  userRequest: string;
37
47
  }
48
+ export interface HarmonyImportSpecifierDependency extends RspackHarmonyImportSpecifierDependency {
49
+ }
@@ -1,5 +1,6 @@
1
- import type { RsdoctorPluginData, NormalModuleFactory, LoaderDefinitionFunction, ModuleGraph, Dependency } from '@rspack/core';
2
- export type RspackNormalModuleFactory = NormalModuleFactory;
1
+ import type { RsdoctorPluginData, NormalModuleFactory as RspackCoreNormalModuleFactory, LoaderDefinitionFunction, ModuleGraph, Dependency } from '@rspack/core';
2
+ export type RspackNormalModuleFactory = RspackCoreNormalModuleFactory;
3
+ export type NormalModuleFactory = RspackNormalModuleFactory;
3
4
  export type RspackNativeAsset = RsdoctorPluginData.RsdoctorAsset;
4
5
  export type RspackNativeChunkGraph = RsdoctorPluginData.RsdoctorChunkGraph;
5
6
  export type RspackNativeModuleGraph = RsdoctorPluginData.RsdoctorModuleGraph;
@@ -22,7 +23,11 @@ export type RspackNativeModuleSourcePatch = RsdoctorPluginData.RsdoctorModuleSou
22
23
  import rspack from '@rspack/core';
23
24
  export type RspackExportsExperiments = typeof rspack.experiments;
24
25
  export type RspackSourceMapInput = Parameters<LoaderDefinitionFunction>[1];
26
+ export type SourceMapInput = RspackSourceMapInput;
25
27
  export type RspackEntryPoint = boolean | 'auto';
28
+ export interface EntryPoint {
29
+ getRuntimeChunk(): any;
30
+ }
26
31
  export interface RspackExportInfo {
27
32
  used: boolean;
28
33
  provideInfo: boolean | null | undefined;
@@ -30,8 +35,15 @@ export interface RspackExportInfo {
30
35
  canMangle: boolean;
31
36
  }
32
37
  export type RspackExportsInfo = ReturnType<ModuleGraph['getExportsInfo']>;
38
+ export interface ExportInfo {
39
+ name?: string;
40
+ findTarget(graph: any, filter: () => boolean): any;
41
+ }
42
+ export type ExportsInfo = RspackExportsInfo;
33
43
  export interface RspackHarmonyImportSpecifierDependency extends Dependency {
34
44
  getIds(graph: ModuleGraph): string[];
35
45
  name: string;
36
46
  userRequest: string;
37
47
  }
48
+ export interface HarmonyImportSpecifierDependency extends RspackHarmonyImportSpecifierDependency {
49
+ }
@@ -22,7 +22,7 @@ export type RuleErrorCodes = {
22
22
  /**
23
23
  * The format is E + "4 digits".
24
24
  * - The first number represents the category:
25
- * - 1 for Webpack build related indexes
25
+ * - 1 for Rspack build related indexes
26
26
  * - ...
27
27
  * - The rest of the numbers can be increased by adding zeros
28
28
  */
@@ -22,7 +22,7 @@ export type RuleErrorCodes = {
22
22
  /**
23
23
  * The format is E + "4 digits".
24
24
  * - The first number represents the category:
25
- * - 1 for Webpack build related indexes
25
+ * - 1 for Rspack build related indexes
26
26
  * - ...
27
27
  * - The rest of the numbers can be increased by adding zeros
28
28
  */
@@ -8,7 +8,7 @@ export declare enum RuleMessageCodeEnumerated {
8
8
  */
9
9
  Extend = "EXTEND",
10
10
  /**
11
- * errors show in the overlay at the client, such as Webpack compile errors in development
11
+ * errors show in the overlay at the client, such as Rspack compile errors in development
12
12
  */
13
13
  Overlay = "OVERLAY"
14
14
  }
@@ -8,7 +8,7 @@ export declare enum RuleMessageCodeEnumerated {
8
8
  */
9
9
  Extend = "EXTEND",
10
10
  /**
11
- * errors show in the overlay at the client, such as Webpack compile errors in development
11
+ * errors show in the overlay at the client, such as Rspack compile errors in development
12
12
  */
13
13
  Overlay = "OVERLAY"
14
14
  }
@@ -138,7 +138,7 @@ export interface ModuleMixedChunksRuleStoreData extends BaseRuleStoreData {
138
138
  module: {
139
139
  id: number | string;
140
140
  path: string;
141
- webpackId?: string | number;
141
+ identifier?: string | number;
142
142
  };
143
143
  initialChunks: Array<{
144
144
  id: string;
@@ -158,7 +158,7 @@ export interface ConnectionsOnlyImportsRuleStoreData extends BaseRuleStoreData {
158
158
  module: {
159
159
  id: number | string;
160
160
  path: string;
161
- webpackId?: string | number;
161
+ identifier?: string | number;
162
162
  };
163
163
  connections: Array<{
164
164
  originModule: number;
@@ -176,13 +176,13 @@ export interface CjsRequireRuleStoreData extends BaseRuleStoreData {
176
176
  issuerModule: {
177
177
  id: number | string;
178
178
  path: string;
179
- webpackId?: string | number;
179
+ identifier?: string | number;
180
180
  };
181
181
  /** The module being required */
182
182
  requiredModule: {
183
183
  id: number | string;
184
184
  path: string;
185
- webpackId?: string | number;
185
+ identifier?: string | number;
186
186
  };
187
187
  /** The original require string (e.g. 'lodash') */
188
188
  request: string;
@@ -203,7 +203,7 @@ export interface EsmResolvedToCjsRuleStoreData extends BaseRuleStoreData {
203
203
  resolvedModule: {
204
204
  id: number | string;
205
205
  path: string;
206
- webpackId?: string | number;
206
+ identifier?: string | number;
207
207
  };
208
208
  /** All issuer modules that imported this package via ESM import */
209
209
  issuers: Array<{
@@ -138,7 +138,7 @@ export interface ModuleMixedChunksRuleStoreData extends BaseRuleStoreData {
138
138
  module: {
139
139
  id: number | string;
140
140
  path: string;
141
- webpackId?: string | number;
141
+ identifier?: string | number;
142
142
  };
143
143
  initialChunks: Array<{
144
144
  id: string;
@@ -158,7 +158,7 @@ export interface ConnectionsOnlyImportsRuleStoreData extends BaseRuleStoreData {
158
158
  module: {
159
159
  id: number | string;
160
160
  path: string;
161
- webpackId?: string | number;
161
+ identifier?: string | number;
162
162
  };
163
163
  connections: Array<{
164
164
  originModule: number;
@@ -176,13 +176,13 @@ export interface CjsRequireRuleStoreData extends BaseRuleStoreData {
176
176
  issuerModule: {
177
177
  id: number | string;
178
178
  path: string;
179
- webpackId?: string | number;
179
+ identifier?: string | number;
180
180
  };
181
181
  /** The module being required */
182
182
  requiredModule: {
183
183
  id: number | string;
184
184
  path: string;
185
- webpackId?: string | number;
185
+ identifier?: string | number;
186
186
  };
187
187
  /** The original require string (e.g. 'lodash') */
188
188
  request: string;
@@ -203,7 +203,7 @@ export interface EsmResolvedToCjsRuleStoreData extends BaseRuleStoreData {
203
203
  resolvedModule: {
204
204
  id: number | string;
205
205
  path: string;
206
- webpackId?: string | number;
206
+ identifier?: string | number;
207
207
  };
208
208
  /** All issuer modules that imported this package via ESM import */
209
209
  issuers: Array<{
@@ -1,12 +1,11 @@
1
- import type { Configuration } from 'webpack';
2
1
  import type { Configuration as RspackConfiguration } from '@rspack/core';
3
2
  type RspackConfigurationWrapper = any extends RspackConfiguration ? never : RspackConfiguration;
4
- export interface WebpackConfigData {
3
+ export interface BundlerConfigData {
5
4
  name: string;
6
5
  version: string | number;
7
6
  bin?: string;
8
- config: Configuration | RspackConfigurationWrapper;
7
+ config: RspackConfigurationWrapper;
9
8
  root: string;
10
9
  }
11
- export type ConfigData = WebpackConfigData[];
10
+ export type ConfigData = BundlerConfigData[];
12
11
  export {};
@@ -1,12 +1,11 @@
1
- import type { Configuration } from 'webpack';
2
1
  import type { Configuration as RspackConfiguration } from '@rspack/core';
3
2
  type RspackConfigurationWrapper = any extends RspackConfiguration ? never : RspackConfiguration;
4
- export interface WebpackConfigData {
3
+ export interface BundlerConfigData {
5
4
  name: string;
6
5
  version: string | number;
7
6
  bin?: string;
8
- config: Configuration | RspackConfigurationWrapper;
7
+ config: RspackConfigurationWrapper;
9
8
  root: string;
10
9
  }
11
- export type ConfigData = WebpackConfigData[];
10
+ export type ConfigData = BundlerConfigData[];
12
11
  export {};
@@ -111,10 +111,10 @@ export declare enum ToDataType {
111
111
  export interface ModuleInstance {
112
112
  /** Module identifier */
113
113
  readonly id: number;
114
- /** webpack render identifier */
114
+ /** Bundler render identifier */
115
115
  readonly renderId?: string;
116
- /** webpack identifier */
117
- readonly webpackId: string;
116
+ /** Bundler identifier */
117
+ readonly identifier: string;
118
118
  /** Module path */
119
119
  readonly path: string;
120
120
  readonly isEntry: boolean;
@@ -209,10 +209,7 @@ export interface ModuleInstance {
209
209
  export interface DependencyBuildMeta {
210
210
  /**
211
211
  * Types of dependencies between modules
212
- * - The basis for webpack to add runtime to modules.
213
- *
214
- * @link https://github.com/webpack/webpack/blob/v5.75.0/lib/Module.js#L428
215
- * @link https://github.com/webpack/webpack/blob/v4.46.0/lib/RuntimeTemplate.js#L215
212
+ * - The basis for the bundler to add runtime to modules.
216
213
  */
217
214
  exportsType: 'namespace' | 'default-only' | 'default-with-named' | 'dynamic';
218
215
  }
@@ -302,8 +299,8 @@ export interface ModuleGraphInstance {
302
299
  getSubGraphByModule(module: ModuleInstance): ModuleInstance[];
303
300
  /** Get module by id */
304
301
  getModuleById(id: number): ModuleInstance | undefined;
305
- /** get module by webpackId */
306
- getModuleByWebpackId(webpackId: string): ModuleInstance | undefined;
302
+ /** get module by identifier */
303
+ getModuleByIdentifier(identifier: string): ModuleInstance | undefined;
307
304
  /** Get module by path */
308
305
  getModuleByFile(file: string, layer?: string): ModuleInstance[] | [];
309
306
  /** Add Module */
@@ -358,7 +355,7 @@ export interface ModuleData extends Omit<NonFunctionProperties<ModuleInstance>,
358
355
  /** Affiliated aggregation module number */
359
356
  concatenationModules?: number[];
360
357
  /** Module Id */
361
- webpackId: string;
358
+ identifier: string;
362
359
  /** Build original attributes */
363
360
  meta?: Partial<Omit<ModuleBuildMeta, 'packageData'>>;
364
361
  /** Issuer path */
@@ -111,10 +111,10 @@ export declare enum ToDataType {
111
111
  export interface ModuleInstance {
112
112
  /** Module identifier */
113
113
  readonly id: number;
114
- /** webpack render identifier */
114
+ /** Bundler render identifier */
115
115
  readonly renderId?: string;
116
- /** webpack identifier */
117
- readonly webpackId: string;
116
+ /** Bundler identifier */
117
+ readonly identifier: string;
118
118
  /** Module path */
119
119
  readonly path: string;
120
120
  readonly isEntry: boolean;
@@ -209,10 +209,7 @@ export interface ModuleInstance {
209
209
  export interface DependencyBuildMeta {
210
210
  /**
211
211
  * Types of dependencies between modules
212
- * - The basis for webpack to add runtime to modules.
213
- *
214
- * @link https://github.com/webpack/webpack/blob/v5.75.0/lib/Module.js#L428
215
- * @link https://github.com/webpack/webpack/blob/v4.46.0/lib/RuntimeTemplate.js#L215
212
+ * - The basis for the bundler to add runtime to modules.
216
213
  */
217
214
  exportsType: 'namespace' | 'default-only' | 'default-with-named' | 'dynamic';
218
215
  }
@@ -302,8 +299,8 @@ export interface ModuleGraphInstance {
302
299
  getSubGraphByModule(module: ModuleInstance): ModuleInstance[];
303
300
  /** Get module by id */
304
301
  getModuleById(id: number): ModuleInstance | undefined;
305
- /** get module by webpackId */
306
- getModuleByWebpackId(webpackId: string): ModuleInstance | undefined;
302
+ /** get module by identifier */
303
+ getModuleByIdentifier(identifier: string): ModuleInstance | undefined;
307
304
  /** Get module by path */
308
305
  getModuleByFile(file: string, layer?: string): ModuleInstance[] | [];
309
306
  /** Add Module */
@@ -358,7 +355,7 @@ export interface ModuleData extends Omit<NonFunctionProperties<ModuleInstance>,
358
355
  /** Affiliated aggregation module number */
359
356
  concatenationModules?: number[];
360
357
  /** Module Id */
361
- webpackId: string;
358
+ identifier: string;
362
359
  /** Build original attributes */
363
360
  meta?: Partial<Omit<ModuleBuildMeta, 'packageData'>>;
364
361
  /** Issuer path */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsdoctor/types",
3
- "version": "1.5.12",
3
+ "version": "2.0.0-alpha.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/web-infra-dev/rsdoctor",
@@ -32,22 +32,18 @@
32
32
  "source-map": "^0.7.6"
33
33
  },
34
34
  "devDependencies": {
35
- "@rspack/core": "2.0.3",
35
+ "@rspack/core": "2.0.4",
36
36
  "@types/node": "^24.12.3",
37
- "@types/react": "^19.2.14",
37
+ "@types/react": "^19.2.15",
38
38
  "tslib": "2.8.1",
39
39
  "typescript": "^6.0.3"
40
40
  },
41
41
  "peerDependencies": {
42
- "@rspack/core": "*",
43
- "webpack": "5.x"
42
+ "@rspack/core": "*"
44
43
  },
45
44
  "peerDependenciesMeta": {
46
45
  "@rspack/core": {
47
46
  "optional": true
48
- },
49
- "webpack": {
50
- "optional": true
51
47
  }
52
48
  },
53
49
  "publishConfig": {
@@ -1,13 +0,0 @@
1
- import { Compiler, Compilation, LoaderDefinitionFunction, ModuleGraph, Dependency } from 'webpack';
2
- type GetMapValue<M extends Map<any, any>> = M extends Map<string, infer V> ? V : never;
3
- export type NormalModuleFactory = ReturnType<Compiler['createNormalModuleFactory']>;
4
- export type SourceMapInput = Parameters<LoaderDefinitionFunction>[1];
5
- export type EntryPoint = GetMapValue<Compilation['entrypoints']>;
6
- export type ExportInfo = ReturnType<ModuleGraph['getExportInfo']>;
7
- export type ExportsInfo = ReturnType<ModuleGraph['getExportsInfo']>;
8
- export interface HarmonyImportSpecifierDependency extends Dependency {
9
- getIds(graph: ModuleGraph): string[];
10
- name: string;
11
- userRequest: string;
12
- }
13
- export {};
@@ -1,13 +0,0 @@
1
- import { Compiler, Compilation, LoaderDefinitionFunction, ModuleGraph, Dependency } from 'webpack';
2
- type GetMapValue<M extends Map<any, any>> = M extends Map<string, infer V> ? V : never;
3
- export type NormalModuleFactory = ReturnType<Compiler['createNormalModuleFactory']>;
4
- export type SourceMapInput = Parameters<LoaderDefinitionFunction>[1];
5
- export type EntryPoint = GetMapValue<Compilation['entrypoints']>;
6
- export type ExportInfo = ReturnType<ModuleGraph['getExportInfo']>;
7
- export type ExportsInfo = ReturnType<ModuleGraph['getExportsInfo']>;
8
- export interface HarmonyImportSpecifierDependency extends Dependency {
9
- getIds(graph: ModuleGraph): string[];
10
- name: string;
11
- userRequest: string;
12
- }
13
- export {};