@docusaurus/plugin-rsdoctor 3.10.2 → 4.0.0-canary-6809

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/lib/index.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import type { LoadContext, Plugin } from '@docusaurus/types';
8
8
  import type { PluginOptions, Options } from './options';
9
- declare const _default: (context: LoadContext, options: PluginOptions) => Promise<Plugin | null>;
10
- export default _default;
9
+ export default pluginRsdoctor;
10
+ declare function pluginRsdoctor(context: LoadContext, options: PluginOptions): Promise<Plugin | null>;
11
11
  export { validateOptions } from './options';
12
12
  export type { PluginOptions, Options };
package/lib/index.js CHANGED
@@ -9,10 +9,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.validateOptions = void 0;
10
10
  const rspack_plugin_1 = require("@rsdoctor/rspack-plugin");
11
11
  const webpack_plugin_1 = require("@rsdoctor/webpack-plugin");
12
- function createRsdoctorBundlerPlugin({ isServer, currentBundler, options, }) {
13
- const RsdoctorPlugin = currentBundler.name === 'rspack'
12
+ function getRsdoctorPlugin(currentBundlerName) {
13
+ return currentBundlerName === 'rspack'
14
14
  ? rspack_plugin_1.RsdoctorRspackMultiplePlugin
15
- : webpack_plugin_1.RsdoctorWebpackMultiplePlugin;
15
+ : // Cast fixes "error TS2321: Excessive stack depth"
16
+ // This may be a temporary TS 7.0 issue?
17
+ webpack_plugin_1.RsdoctorWebpackMultiplePlugin;
18
+ }
19
+ function createRsdoctorBundlerPlugin({ isServer, currentBundler, options, }) {
20
+ const RsdoctorPlugin = getRsdoctorPlugin(currentBundler.name);
16
21
  return new RsdoctorPlugin({
17
22
  name: isServer ? 'server' : 'client',
18
23
  ...options.rsdoctorOptions,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/plugin-rsdoctor",
3
- "version": "3.10.2",
3
+ "version": "4.0.0-canary-6809",
4
4
  "description": "Rsdoctor plugin for Docusaurus.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -18,19 +18,19 @@
18
18
  },
19
19
  "license": "MIT",
20
20
  "dependencies": {
21
- "@docusaurus/core": "3.10.2",
22
- "@docusaurus/types": "3.10.2",
23
- "@docusaurus/utils-validation": "3.10.2",
24
- "@rsdoctor/rspack-plugin": "^0.4.6",
25
- "@rsdoctor/webpack-plugin": "^0.4.6",
26
- "tslib": "^2.6.0"
21
+ "@docusaurus/core": "4.0.0-canary-6809",
22
+ "@docusaurus/types": "4.0.0-canary-6809",
23
+ "@docusaurus/utils-validation": "4.0.0-canary-6809",
24
+ "@rsdoctor/rspack-plugin": "^1.6.3",
25
+ "@rsdoctor/webpack-plugin": "^1.6.3",
26
+ "tslib": "^2.8.1"
27
27
  },
28
28
  "peerDependencies": {
29
- "react": "^18.0.0 || ^19.0.0",
30
- "react-dom": "^18.0.0 || ^19.0.0"
29
+ "react": "^19.3.0",
30
+ "react-dom": "^19.3.0"
31
31
  },
32
32
  "engines": {
33
- "node": ">=20.0"
33
+ "node": ">=24.14"
34
34
  },
35
- "gitHead": "f37f9035584917a97a260b91fc2842cba4f8b94f"
35
+ "gitHead": "db942b07f3529b5359bcae27ab3796cb07dec10e"
36
36
  }
package/src/index.ts CHANGED
@@ -7,9 +7,22 @@
7
7
 
8
8
  import {RsdoctorRspackMultiplePlugin} from '@rsdoctor/rspack-plugin';
9
9
  import {RsdoctorWebpackMultiplePlugin} from '@rsdoctor/webpack-plugin';
10
+ import type {ConfigureWebpackResult} from '@docusaurus/types/src/plugin';
10
11
  import type {CurrentBundler, LoadContext, Plugin} from '@docusaurus/types';
11
12
  import type {PluginOptions, Options} from './options';
12
13
 
14
+ type RsdoctorPluginType = typeof RsdoctorRspackMultiplePlugin;
15
+
16
+ function getRsdoctorPlugin(
17
+ currentBundlerName: CurrentBundler['name'],
18
+ ): RsdoctorPluginType {
19
+ return currentBundlerName === 'rspack'
20
+ ? RsdoctorRspackMultiplePlugin
21
+ : // Cast fixes "error TS2321: Excessive stack depth"
22
+ // This may be a temporary TS 7.0 issue?
23
+ (RsdoctorWebpackMultiplePlugin as unknown as RsdoctorPluginType);
24
+ }
25
+
13
26
  function createRsdoctorBundlerPlugin({
14
27
  isServer,
15
28
  currentBundler,
@@ -19,15 +32,15 @@ function createRsdoctorBundlerPlugin({
19
32
  currentBundler: CurrentBundler;
20
33
  options: PluginOptions;
21
34
  }) {
22
- const RsdoctorPlugin =
23
- currentBundler.name === 'rspack'
24
- ? RsdoctorRspackMultiplePlugin
25
- : RsdoctorWebpackMultiplePlugin;
35
+ const RsdoctorPlugin = getRsdoctorPlugin(currentBundler.name);
36
+
37
+ // Little type incompatibility?
38
+ type WebpackPlugin = NonNullable<ConfigureWebpackResult['plugins']>[number];
26
39
 
27
40
  return new RsdoctorPlugin({
28
41
  name: isServer ? 'server' : 'client',
29
42
  ...options.rsdoctorOptions,
30
- });
43
+ }) as unknown as WebpackPlugin;
31
44
  }
32
45
 
33
46
  export default (async function pluginRsdoctor(