@docusaurus/core 2.4.0 → 3.0.0-alpha.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 (50) hide show
  1. package/bin/beforeCli.mjs +31 -5
  2. package/bin/docusaurus.mjs +9 -1
  3. package/lib/babel/preset.js +6 -1
  4. package/lib/client/BaseUrlIssueBanner/index.d.ts +0 -7
  5. package/lib/client/BaseUrlIssueBanner/index.js +12 -22
  6. package/lib/client/BaseUrlIssueBanner/styles.module.css +1 -1
  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/client/serverEntry.js +26 -18
  17. package/lib/{webpack/plugins/LogPlugin.d.ts → client/serverRenderer.d.ts} +2 -5
  18. package/lib/client/serverRenderer.js +61 -0
  19. package/lib/commands/build.d.ts +2 -1
  20. package/lib/commands/build.js +9 -3
  21. package/lib/commands/deploy.d.ts +1 -1
  22. package/lib/commands/serve.d.ts +1 -1
  23. package/lib/commands/start.d.ts +1 -1
  24. package/lib/commands/start.js +15 -5
  25. package/lib/commands/swizzle/actions.d.ts +2 -2
  26. package/lib/commands/swizzle/common.d.ts +3 -3
  27. package/lib/commands/swizzle/components.d.ts +1 -1
  28. package/lib/commands/writeTranslations.d.ts +1 -1
  29. package/lib/server/configValidation.js +19 -1
  30. package/lib/server/getHostPort.d.ts +1 -1
  31. package/lib/server/index.d.ts +1 -1
  32. package/lib/server/plugins/configs.d.ts +2 -2
  33. package/lib/server/plugins/routeConfig.js +3 -1
  34. package/lib/server/plugins/synthetic.js +1 -2
  35. package/lib/server/routes.d.ts +1 -1
  36. package/lib/server/routes.js +2 -18
  37. package/lib/server/translations/translations.d.ts +2 -2
  38. package/lib/server/translations/translationsExtractor.d.ts +1 -1
  39. package/lib/webpack/aliases/index.d.ts +1 -1
  40. package/lib/webpack/client.d.ts +1 -1
  41. package/lib/webpack/client.js +10 -4
  42. package/lib/webpack/plugins/CleanWebpackPlugin.d.ts +1 -1
  43. package/lib/webpack/plugins/WaitPlugin.d.ts +1 -1
  44. package/lib/webpack/server.js +2 -2
  45. package/lib/webpack/templates/ssr.html.template.d.ts +1 -1
  46. package/lib/webpack/templates/ssr.html.template.js +2 -7
  47. package/lib/webpack/utils.d.ts +3 -1
  48. package/lib/webpack/utils.js +26 -8
  49. package/package.json +51 -51
  50. package/lib/webpack/plugins/LogPlugin.js +0 -33
@@ -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;