@docusaurus/preset-classic 3.10.1 → 4.0.0-canary-6808
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.js +9 -6
- package/lib/options.d.ts +0 -6
- package/package.json +19 -20
- package/src/index.ts +9 -8
- package/src/options.ts +0 -6
package/lib/index.js
CHANGED
|
@@ -18,7 +18,7 @@ function preset(context, opts = {}) {
|
|
|
18
18
|
const { themeConfig } = siteConfig;
|
|
19
19
|
const { algolia } = themeConfig;
|
|
20
20
|
const isProd = process.env.NODE_ENV === 'production';
|
|
21
|
-
const { debug, docs, blog, pages, sitemap, svgr, theme,
|
|
21
|
+
const { debug, docs, blog, pages, sitemap, svgr, theme, gtag, googleTagManager, ...rest } = opts;
|
|
22
22
|
const themes = [];
|
|
23
23
|
themes.push(makePluginConfig('@docusaurus/theme-classic', theme));
|
|
24
24
|
if (algolia) {
|
|
@@ -27,8 +27,14 @@ function preset(context, opts = {}) {
|
|
|
27
27
|
if ('gtag' in themeConfig) {
|
|
28
28
|
throw new Error('The "gtag" field in themeConfig should now be specified as option for plugin-google-gtag. For preset-classic, simply move themeConfig.gtag to preset options. More information at https://github.com/facebook/docusaurus/pull/5832.');
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
// TODO Docusaurus v5: remove
|
|
31
|
+
if ('googleAnalytics' in opts || 'googleAnalytics' in themeConfig) {
|
|
32
|
+
throw new Error(`In Docusaurus v4, the Google Analytics plugin has been removed.
|
|
33
|
+
You can now use either:
|
|
34
|
+
- @docusaurus/plugin-google-gtag - presetOptions.gtag
|
|
35
|
+
- @docusaurus/plugin-google-tag-manager - presetOptions.googleTagManager
|
|
36
|
+
|
|
37
|
+
See also: https://github.com/facebook/docusaurus/issues/7221`);
|
|
32
38
|
}
|
|
33
39
|
const plugins = [];
|
|
34
40
|
// TODO Docusaurus v4: temporary due to the opt-in flag
|
|
@@ -45,9 +51,6 @@ function preset(context, opts = {}) {
|
|
|
45
51
|
if (pages !== false) {
|
|
46
52
|
plugins.push(makePluginConfig('@docusaurus/plugin-content-pages', pages));
|
|
47
53
|
}
|
|
48
|
-
if (googleAnalytics) {
|
|
49
|
-
plugins.push(makePluginConfig('@docusaurus/plugin-google-analytics', googleAnalytics));
|
|
50
|
-
}
|
|
51
54
|
if (debug || (debug === undefined && !isProd)) {
|
|
52
55
|
plugins.push(require.resolve('@docusaurus/plugin-debug'));
|
|
53
56
|
}
|
package/lib/options.d.ts
CHANGED
|
@@ -9,7 +9,6 @@ import type { Options as BlogPluginOptions } from '@docusaurus/plugin-content-bl
|
|
|
9
9
|
import type { Options as PagesPluginOptions } from '@docusaurus/plugin-content-pages';
|
|
10
10
|
import type { Options as SitemapPluginOptions } from '@docusaurus/plugin-sitemap';
|
|
11
11
|
import type { Options as SVGRPluginOptions } from '@docusaurus/plugin-svgr';
|
|
12
|
-
import type { Options as GAPluginOptions } from '@docusaurus/plugin-google-analytics';
|
|
13
12
|
import type { Options as GtagPluginOptions } from '@docusaurus/plugin-google-gtag';
|
|
14
13
|
import type { Options as GTMPluginOptions } from '@docusaurus/plugin-google-tag-manager';
|
|
15
14
|
import type { Options as ThemeOptions } from '@docusaurus/theme-classic';
|
|
@@ -34,11 +33,6 @@ export type Options = {
|
|
|
34
33
|
svgr?: false | SVGRPluginOptions;
|
|
35
34
|
/** Options for `@docusaurus/theme-classic`. */
|
|
36
35
|
theme?: ThemeOptions;
|
|
37
|
-
/**
|
|
38
|
-
* Options for `@docusaurus/plugin-google-analytics`. Only enabled when the
|
|
39
|
-
* key is present.
|
|
40
|
-
*/
|
|
41
|
-
googleAnalytics?: GAPluginOptions;
|
|
42
36
|
/**
|
|
43
37
|
* Options for `@docusaurus/plugin-google-gtag`. Only enabled when the key
|
|
44
38
|
* is present.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/preset-classic",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-canary-6808",
|
|
4
4
|
"description": "Classic preset for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -18,28 +18,27 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@docusaurus/core": "
|
|
22
|
-
"@docusaurus/plugin-content-blog": "
|
|
23
|
-
"@docusaurus/plugin-content-docs": "
|
|
24
|
-
"@docusaurus/plugin-content-pages": "
|
|
25
|
-
"@docusaurus/plugin-css-cascade-layers": "
|
|
26
|
-
"@docusaurus/plugin-debug": "
|
|
27
|
-
"@docusaurus/plugin-google-
|
|
28
|
-
"@docusaurus/plugin-google-
|
|
29
|
-
"@docusaurus/plugin-
|
|
30
|
-
"@docusaurus/plugin-
|
|
31
|
-
"@docusaurus/
|
|
32
|
-
"@docusaurus/theme-
|
|
33
|
-
"@docusaurus/theme-
|
|
34
|
-
"@docusaurus/
|
|
35
|
-
"@docusaurus/types": "3.10.1"
|
|
21
|
+
"@docusaurus/core": "4.0.0-canary-6808",
|
|
22
|
+
"@docusaurus/plugin-content-blog": "4.0.0-canary-6808",
|
|
23
|
+
"@docusaurus/plugin-content-docs": "4.0.0-canary-6808",
|
|
24
|
+
"@docusaurus/plugin-content-pages": "4.0.0-canary-6808",
|
|
25
|
+
"@docusaurus/plugin-css-cascade-layers": "4.0.0-canary-6808",
|
|
26
|
+
"@docusaurus/plugin-debug": "4.0.0-canary-6808",
|
|
27
|
+
"@docusaurus/plugin-google-gtag": "4.0.0-canary-6808",
|
|
28
|
+
"@docusaurus/plugin-google-tag-manager": "4.0.0-canary-6808",
|
|
29
|
+
"@docusaurus/plugin-sitemap": "4.0.0-canary-6808",
|
|
30
|
+
"@docusaurus/plugin-svgr": "4.0.0-canary-6808",
|
|
31
|
+
"@docusaurus/theme-classic": "4.0.0-canary-6808",
|
|
32
|
+
"@docusaurus/theme-common": "4.0.0-canary-6808",
|
|
33
|
+
"@docusaurus/theme-search-algolia": "4.0.0-canary-6808",
|
|
34
|
+
"@docusaurus/types": "4.0.0-canary-6808"
|
|
36
35
|
},
|
|
37
36
|
"peerDependencies": {
|
|
38
|
-
"react": "^
|
|
39
|
-
"react-dom": "^
|
|
37
|
+
"react": "^19.3.0",
|
|
38
|
+
"react-dom": "^19.3.0"
|
|
40
39
|
},
|
|
41
40
|
"engines": {
|
|
42
|
-
"node": ">=
|
|
41
|
+
"node": ">=24.14"
|
|
43
42
|
},
|
|
44
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "91e445730a91fbe20dd5fefae560303a0c655aa7"
|
|
45
44
|
}
|
package/src/index.ts
CHANGED
|
@@ -39,7 +39,6 @@ export default function preset(
|
|
|
39
39
|
sitemap,
|
|
40
40
|
svgr,
|
|
41
41
|
theme,
|
|
42
|
-
googleAnalytics,
|
|
43
42
|
gtag,
|
|
44
43
|
googleTagManager,
|
|
45
44
|
...rest
|
|
@@ -55,9 +54,16 @@ export default function preset(
|
|
|
55
54
|
'The "gtag" field in themeConfig should now be specified as option for plugin-google-gtag. For preset-classic, simply move themeConfig.gtag to preset options. More information at https://github.com/facebook/docusaurus/pull/5832.',
|
|
56
55
|
);
|
|
57
56
|
}
|
|
58
|
-
|
|
57
|
+
|
|
58
|
+
// TODO Docusaurus v5: remove
|
|
59
|
+
if ('googleAnalytics' in opts || 'googleAnalytics' in themeConfig) {
|
|
59
60
|
throw new Error(
|
|
60
|
-
|
|
61
|
+
`In Docusaurus v4, the Google Analytics plugin has been removed.
|
|
62
|
+
You can now use either:
|
|
63
|
+
- @docusaurus/plugin-google-gtag - presetOptions.gtag
|
|
64
|
+
- @docusaurus/plugin-google-tag-manager - presetOptions.googleTagManager
|
|
65
|
+
|
|
66
|
+
See also: https://github.com/facebook/docusaurus/issues/7221`,
|
|
61
67
|
);
|
|
62
68
|
}
|
|
63
69
|
|
|
@@ -78,11 +84,6 @@ export default function preset(
|
|
|
78
84
|
if (pages !== false) {
|
|
79
85
|
plugins.push(makePluginConfig('@docusaurus/plugin-content-pages', pages));
|
|
80
86
|
}
|
|
81
|
-
if (googleAnalytics) {
|
|
82
|
-
plugins.push(
|
|
83
|
-
makePluginConfig('@docusaurus/plugin-google-analytics', googleAnalytics),
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
87
|
if (debug || (debug === undefined && !isProd)) {
|
|
87
88
|
plugins.push(require.resolve('@docusaurus/plugin-debug'));
|
|
88
89
|
}
|
package/src/options.ts
CHANGED
|
@@ -10,7 +10,6 @@ import type {Options as BlogPluginOptions} from '@docusaurus/plugin-content-blog
|
|
|
10
10
|
import type {Options as PagesPluginOptions} from '@docusaurus/plugin-content-pages';
|
|
11
11
|
import type {Options as SitemapPluginOptions} from '@docusaurus/plugin-sitemap';
|
|
12
12
|
import type {Options as SVGRPluginOptions} from '@docusaurus/plugin-svgr';
|
|
13
|
-
import type {Options as GAPluginOptions} from '@docusaurus/plugin-google-analytics';
|
|
14
13
|
import type {Options as GtagPluginOptions} from '@docusaurus/plugin-google-gtag';
|
|
15
14
|
import type {Options as GTMPluginOptions} from '@docusaurus/plugin-google-tag-manager';
|
|
16
15
|
import type {Options as ThemeOptions} from '@docusaurus/theme-classic';
|
|
@@ -36,11 +35,6 @@ export type Options = {
|
|
|
36
35
|
svgr?: false | SVGRPluginOptions;
|
|
37
36
|
/** Options for `@docusaurus/theme-classic`. */
|
|
38
37
|
theme?: ThemeOptions;
|
|
39
|
-
/**
|
|
40
|
-
* Options for `@docusaurus/plugin-google-analytics`. Only enabled when the
|
|
41
|
-
* key is present.
|
|
42
|
-
*/
|
|
43
|
-
googleAnalytics?: GAPluginOptions;
|
|
44
38
|
/**
|
|
45
39
|
* Options for `@docusaurus/plugin-google-gtag`. Only enabled when the key
|
|
46
40
|
* is present.
|