@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 +2 -2
- package/lib/index.js +8 -3
- package/package.json +11 -11
- package/src/index.ts +18 -5
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
|
-
|
|
10
|
-
|
|
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
|
|
13
|
-
|
|
12
|
+
function getRsdoctorPlugin(currentBundlerName) {
|
|
13
|
+
return currentBundlerName === 'rspack'
|
|
14
14
|
? rspack_plugin_1.RsdoctorRspackMultiplePlugin
|
|
15
|
-
:
|
|
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
|
+
"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": "
|
|
22
|
-
"@docusaurus/types": "
|
|
23
|
-
"@docusaurus/utils-validation": "
|
|
24
|
-
"@rsdoctor/rspack-plugin": "^
|
|
25
|
-
"@rsdoctor/webpack-plugin": "^
|
|
26
|
-
"tslib": "^2.
|
|
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": "^
|
|
30
|
-
"react-dom": "^
|
|
29
|
+
"react": "^19.3.0",
|
|
30
|
+
"react-dom": "^19.3.0"
|
|
31
31
|
},
|
|
32
32
|
"engines": {
|
|
33
|
-
"node": ">=
|
|
33
|
+
"node": ">=24.14"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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(
|