@docusaurus/preset-classic 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.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, googleAnalytics, gtag, googleTagManager, ...rest } = opts;
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
- if ('googleAnalytics' in themeConfig) {
31
- throw new Error('The "googleAnalytics" field in themeConfig should now be specified as option for plugin-google-analytics. For preset-classic, simply move themeConfig.googleAnalytics to preset options. More information at https://github.com/facebook/docusaurus/pull/5832.');
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.10.2",
3
+ "version": "4.0.0-canary-6809",
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": "3.10.2",
22
- "@docusaurus/plugin-content-blog": "3.10.2",
23
- "@docusaurus/plugin-content-docs": "3.10.2",
24
- "@docusaurus/plugin-content-pages": "3.10.2",
25
- "@docusaurus/plugin-css-cascade-layers": "3.10.2",
26
- "@docusaurus/plugin-debug": "3.10.2",
27
- "@docusaurus/plugin-google-analytics": "3.10.2",
28
- "@docusaurus/plugin-google-gtag": "3.10.2",
29
- "@docusaurus/plugin-google-tag-manager": "3.10.2",
30
- "@docusaurus/plugin-sitemap": "3.10.2",
31
- "@docusaurus/plugin-svgr": "3.10.2",
32
- "@docusaurus/theme-classic": "3.10.2",
33
- "@docusaurus/theme-common": "3.10.2",
34
- "@docusaurus/theme-search-algolia": "3.10.2",
35
- "@docusaurus/types": "3.10.2"
21
+ "@docusaurus/core": "4.0.0-canary-6809",
22
+ "@docusaurus/plugin-content-blog": "4.0.0-canary-6809",
23
+ "@docusaurus/plugin-content-docs": "4.0.0-canary-6809",
24
+ "@docusaurus/plugin-content-pages": "4.0.0-canary-6809",
25
+ "@docusaurus/plugin-css-cascade-layers": "4.0.0-canary-6809",
26
+ "@docusaurus/plugin-debug": "4.0.0-canary-6809",
27
+ "@docusaurus/plugin-google-gtag": "4.0.0-canary-6809",
28
+ "@docusaurus/plugin-google-tag-manager": "4.0.0-canary-6809",
29
+ "@docusaurus/plugin-sitemap": "4.0.0-canary-6809",
30
+ "@docusaurus/plugin-svgr": "4.0.0-canary-6809",
31
+ "@docusaurus/theme-classic": "4.0.0-canary-6809",
32
+ "@docusaurus/theme-common": "4.0.0-canary-6809",
33
+ "@docusaurus/theme-search-algolia": "4.0.0-canary-6809",
34
+ "@docusaurus/types": "4.0.0-canary-6809"
36
35
  },
37
36
  "peerDependencies": {
38
- "react": "^18.0.0 || ^19.0.0",
39
- "react-dom": "^18.0.0 || ^19.0.0"
37
+ "react": "^19.3.0",
38
+ "react-dom": "^19.3.0"
40
39
  },
41
40
  "engines": {
42
- "node": ">=20.0"
41
+ "node": ">=24.14"
43
42
  },
44
- "gitHead": "f37f9035584917a97a260b91fc2842cba4f8b94f"
43
+ "gitHead": "db942b07f3529b5359bcae27ab3796cb07dec10e"
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
- if ('googleAnalytics' in themeConfig) {
57
+
58
+ // TODO Docusaurus v5: remove
59
+ if ('googleAnalytics' in opts || 'googleAnalytics' in themeConfig) {
59
60
  throw new Error(
60
- 'The "googleAnalytics" field in themeConfig should now be specified as option for plugin-google-analytics. For preset-classic, simply move themeConfig.googleAnalytics to preset options. More information at https://github.com/facebook/docusaurus/pull/5832.',
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.