@docusaurus/core 2.4.1 → 3.0.0-beta.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.
Files changed (55) hide show
  1. package/bin/beforeCli.mjs +35 -10
  2. package/bin/docusaurus.mjs +9 -1
  3. package/lib/babel/preset.js +6 -1
  4. package/lib/client/App.js +2 -0
  5. package/lib/client/BaseUrlIssueBanner/index.d.ts +0 -7
  6. package/lib/client/BaseUrlIssueBanner/index.js +7 -19
  7. package/lib/client/ClientLifecyclesDispatcher.js +2 -2
  8. package/lib/client/LinksCollector.d.ts +2 -2
  9. package/lib/client/PendingNavigation.d.ts +2 -2
  10. package/lib/client/clientEntry.js +27 -13
  11. package/lib/client/exports/ErrorBoundary.d.ts +1 -1
  12. package/lib/client/exports/Link.d.ts +1 -1
  13. package/lib/client/exports/Link.js +1 -1
  14. package/lib/client/exports/useIsomorphicLayoutEffect.d.ts +21 -0
  15. package/lib/client/exports/useIsomorphicLayoutEffect.js +24 -0
  16. package/lib/{webpack/plugins/LogPlugin.d.ts → client/hasHydratedDataAttribute.d.ts} +2 -5
  17. package/lib/client/hasHydratedDataAttribute.js +17 -0
  18. package/lib/client/serverEntry.js +26 -18
  19. package/lib/client/serverRenderer.d.ts +8 -0
  20. package/lib/client/serverRenderer.js +61 -0
  21. package/lib/commands/build.d.ts +2 -1
  22. package/lib/commands/build.js +9 -3
  23. package/lib/commands/deploy.d.ts +1 -1
  24. package/lib/commands/deploy.js +8 -0
  25. package/lib/commands/serve.d.ts +1 -1
  26. package/lib/commands/start.d.ts +1 -1
  27. package/lib/commands/start.js +15 -5
  28. package/lib/commands/swizzle/actions.d.ts +2 -2
  29. package/lib/commands/swizzle/common.d.ts +3 -3
  30. package/lib/commands/swizzle/components.d.ts +1 -1
  31. package/lib/commands/writeTranslations.d.ts +1 -1
  32. package/lib/server/configValidation.js +23 -1
  33. package/lib/server/getHostPort.d.ts +1 -1
  34. package/lib/server/index.d.ts +1 -1
  35. package/lib/server/index.js +4 -2
  36. package/lib/server/plugins/configs.d.ts +2 -2
  37. package/lib/server/plugins/routeConfig.js +3 -1
  38. package/lib/server/plugins/synthetic.js +1 -2
  39. package/lib/server/routes.d.ts +1 -1
  40. package/lib/server/routes.js +2 -18
  41. package/lib/server/translations/translations.d.ts +2 -2
  42. package/lib/server/translations/translationsExtractor.d.ts +1 -1
  43. package/lib/webpack/aliases/index.d.ts +1 -1
  44. package/lib/webpack/client.d.ts +1 -1
  45. package/lib/webpack/client.js +10 -4
  46. package/lib/webpack/plugins/CleanWebpackPlugin.d.ts +1 -1
  47. package/lib/webpack/plugins/CleanWebpackPlugin.js +8 -0
  48. package/lib/webpack/plugins/WaitPlugin.d.ts +1 -1
  49. package/lib/webpack/server.js +2 -2
  50. package/lib/webpack/templates/ssr.html.template.d.ts +1 -1
  51. package/lib/webpack/templates/ssr.html.template.js +2 -7
  52. package/lib/webpack/utils.d.ts +3 -1
  53. package/lib/webpack/utils.js +31 -9
  54. package/package.json +57 -57
  55. package/lib/webpack/plugins/LogPlugin.js +0 -33
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@docusaurus/core",
3
3
  "description": "Easy to Maintain Open Source Documentation Websites",
4
- "version": "2.4.1",
4
+ "version": "3.0.0-beta.0",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -33,99 +33,99 @@
33
33
  "url": "https://github.com/facebook/docusaurus/issues"
34
34
  },
35
35
  "dependencies": {
36
- "@babel/core": "^7.18.6",
37
- "@babel/generator": "^7.18.7",
36
+ "@babel/core": "^7.22.9",
37
+ "@babel/generator": "^7.22.9",
38
38
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
39
- "@babel/plugin-transform-runtime": "^7.18.6",
40
- "@babel/preset-env": "^7.18.6",
41
- "@babel/preset-react": "^7.18.6",
42
- "@babel/preset-typescript": "^7.18.6",
43
- "@babel/runtime": "^7.18.6",
44
- "@babel/runtime-corejs3": "^7.18.6",
45
- "@babel/traverse": "^7.18.8",
46
- "@docusaurus/cssnano-preset": "2.4.1",
47
- "@docusaurus/logger": "2.4.1",
48
- "@docusaurus/mdx-loader": "2.4.1",
39
+ "@babel/plugin-transform-runtime": "^7.22.9",
40
+ "@babel/preset-env": "^7.22.9",
41
+ "@babel/preset-react": "^7.22.5",
42
+ "@babel/preset-typescript": "^7.22.5",
43
+ "@babel/runtime": "^7.22.6",
44
+ "@babel/runtime-corejs3": "^7.22.6",
45
+ "@babel/traverse": "^7.22.8",
46
+ "@docusaurus/cssnano-preset": "3.0.0-beta.0",
47
+ "@docusaurus/logger": "3.0.0-beta.0",
48
+ "@docusaurus/mdx-loader": "3.0.0-beta.0",
49
49
  "@docusaurus/react-loadable": "5.5.2",
50
- "@docusaurus/utils": "2.4.1",
51
- "@docusaurus/utils-common": "2.4.1",
52
- "@docusaurus/utils-validation": "2.4.1",
50
+ "@docusaurus/utils": "3.0.0-beta.0",
51
+ "@docusaurus/utils-common": "3.0.0-beta.0",
52
+ "@docusaurus/utils-validation": "3.0.0-beta.0",
53
53
  "@slorber/static-site-generator-webpack-plugin": "^4.0.7",
54
- "@svgr/webpack": "^6.2.1",
55
- "autoprefixer": "^10.4.7",
56
- "babel-loader": "^8.2.5",
54
+ "@svgr/webpack": "^6.5.1",
55
+ "autoprefixer": "^10.4.14",
56
+ "babel-loader": "^9.1.3",
57
57
  "babel-plugin-dynamic-import-node": "^2.3.3",
58
58
  "boxen": "^6.2.1",
59
59
  "chalk": "^4.1.2",
60
60
  "chokidar": "^3.5.3",
61
- "clean-css": "^5.3.0",
62
- "cli-table3": "^0.6.2",
61
+ "clean-css": "^5.3.2",
62
+ "cli-table3": "^0.6.3",
63
63
  "combine-promises": "^1.1.0",
64
64
  "commander": "^5.1.0",
65
65
  "copy-webpack-plugin": "^11.0.0",
66
- "core-js": "^3.23.3",
67
- "css-loader": "^6.7.1",
68
- "css-minimizer-webpack-plugin": "^4.0.0",
69
- "cssnano": "^5.1.12",
66
+ "core-js": "^3.31.1",
67
+ "css-loader": "^6.8.1",
68
+ "css-minimizer-webpack-plugin": "^4.2.2",
69
+ "cssnano": "^5.1.15",
70
70
  "del": "^6.1.1",
71
- "detect-port": "^1.3.0",
71
+ "detect-port": "^1.5.1",
72
72
  "escape-html": "^1.0.3",
73
- "eta": "^2.0.0",
73
+ "eta": "^2.2.0",
74
74
  "file-loader": "^6.2.0",
75
- "fs-extra": "^10.1.0",
76
- "html-minifier-terser": "^6.1.0",
77
- "html-tags": "^3.2.0",
78
- "html-webpack-plugin": "^5.5.0",
75
+ "fs-extra": "^11.1.1",
76
+ "html-minifier-terser": "^7.2.0",
77
+ "html-tags": "^3.3.1",
78
+ "html-webpack-plugin": "^5.5.3",
79
79
  "import-fresh": "^3.3.0",
80
80
  "leven": "^3.1.0",
81
81
  "lodash": "^4.17.21",
82
- "mini-css-extract-plugin": "^2.6.1",
83
- "postcss": "^8.4.14",
84
- "postcss-loader": "^7.0.0",
82
+ "mini-css-extract-plugin": "^2.7.6",
83
+ "postcss": "^8.4.26",
84
+ "postcss-loader": "^7.3.3",
85
85
  "prompts": "^2.4.2",
86
86
  "react-dev-utils": "^12.0.1",
87
87
  "react-helmet-async": "^1.3.0",
88
88
  "react-loadable": "npm:@docusaurus/react-loadable@5.5.2",
89
89
  "react-loadable-ssr-addon-v5-slorber": "^1.0.1",
90
- "react-router": "^5.3.3",
90
+ "react-router": "^5.3.4",
91
91
  "react-router-config": "^5.1.1",
92
- "react-router-dom": "^5.3.3",
92
+ "react-router-dom": "^5.3.4",
93
93
  "rtl-detect": "^1.0.4",
94
- "semver": "^7.3.7",
95
- "serve-handler": "^6.1.3",
94
+ "semver": "^7.5.4",
95
+ "serve-handler": "^6.1.5",
96
96
  "shelljs": "^0.8.5",
97
- "terser-webpack-plugin": "^5.3.3",
98
- "tslib": "^2.4.0",
99
- "update-notifier": "^5.1.0",
97
+ "terser-webpack-plugin": "^5.3.9",
98
+ "tslib": "^2.6.0",
99
+ "update-notifier": "^6.0.2",
100
100
  "url-loader": "^4.1.1",
101
- "wait-on": "^6.0.1",
102
- "webpack": "^5.73.0",
103
- "webpack-bundle-analyzer": "^4.5.0",
104
- "webpack-dev-server": "^4.9.3",
105
- "webpack-merge": "^5.8.0",
101
+ "wait-on": "^7.0.1",
102
+ "webpack": "^5.88.1",
103
+ "webpack-bundle-analyzer": "^4.9.0",
104
+ "webpack-dev-server": "^4.15.1",
105
+ "webpack-merge": "^5.9.0",
106
106
  "webpackbar": "^5.0.2"
107
107
  },
108
108
  "devDependencies": {
109
- "@docusaurus/module-type-aliases": "2.4.1",
110
- "@docusaurus/types": "2.4.1",
111
- "@types/detect-port": "^1.3.2",
112
- "@types/react-dom": "^18.0.6",
113
- "@types/react-router-config": "^5.0.6",
109
+ "@docusaurus/module-type-aliases": "3.0.0-beta.0",
110
+ "@docusaurus/types": "3.0.0-beta.0",
111
+ "@types/detect-port": "^1.3.3",
112
+ "@types/react-dom": "^18.2.7",
113
+ "@types/react-router-config": "^5.0.7",
114
114
  "@types/rtl-detect": "^1.0.0",
115
115
  "@types/serve-handler": "^6.1.1",
116
- "@types/update-notifier": "^5.1.0",
116
+ "@types/update-notifier": "^6.0.4",
117
117
  "@types/wait-on": "^5.3.1",
118
- "@types/webpack-bundle-analyzer": "^4.4.1",
119
- "react-test-renderer": "^17.0.2",
118
+ "@types/webpack-bundle-analyzer": "^4.6.0",
119
+ "react-test-renderer": "^18.0.0",
120
120
  "tmp-promise": "^3.0.3",
121
121
  "tree-node-cli": "^1.6.0"
122
122
  },
123
123
  "peerDependencies": {
124
- "react": "^16.8.4 || ^17.0.0",
125
- "react-dom": "^16.8.4 || ^17.0.0"
124
+ "react": "^18.0.0",
125
+ "react-dom": "^18.0.0"
126
126
  },
127
127
  "engines": {
128
128
  "node": ">=16.14"
129
129
  },
130
- "gitHead": "60e657d8ae5a4a9ed1c2d777f9defd882cc12681"
130
+ "gitHead": "27a1e90d9fff88af90ecad35bea16d4d7230482a"
131
131
  }
@@ -1,33 +0,0 @@
1
- "use strict";
2
- /**
3
- * Copyright (c) Facebook, Inc. and its affiliates.
4
- *
5
- * This source code is licensed under the MIT license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const tslib_1 = require("tslib");
10
- const webpackbar_1 = tslib_1.__importDefault(require("webpackbar"));
11
- const formatWebpackMessages_1 = tslib_1.__importDefault(require("react-dev-utils/formatWebpackMessages"));
12
- function showError(arr) {
13
- console.log(`\n\n${arr.join('\n')}`);
14
- }
15
- class LogPlugin extends webpackbar_1.default {
16
- apply(compiler) {
17
- super.apply(compiler);
18
- // TODO can't this be done in compile(configs) alongside the warnings???
19
- compiler.hooks.done.tap('DocusaurusLogPlugin', (stats) => {
20
- if (stats.hasErrors()) {
21
- const errorsWarnings = stats.toJson('errors-warnings');
22
- // TODO do we really want to keep this legacy logic?
23
- // let's wait and see how the react-dev-utils support Webpack5
24
- // we probably want to print the error stacktraces here
25
- const messages = (0, formatWebpackMessages_1.default)(errorsWarnings);
26
- if (messages.errors.length) {
27
- showError(messages.errors);
28
- }
29
- }
30
- });
31
- }
32
- }
33
- exports.default = LogPlugin;