@docusaurus/core 0.0.0-4645 → 0.0.0-4653

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.
@@ -15,6 +15,7 @@ const utils_1 = require("@docusaurus/utils");
15
15
  const utils_2 = require("./utils");
16
16
  const path_1 = tslib_1.__importDefault(require("path"));
17
17
  const combine_promises_1 = tslib_1.__importDefault(require("combine-promises"));
18
+ const logger_1 = tslib_1.__importDefault(require("@docusaurus/logger"));
18
19
  function toReactRouterRoutes(routes) {
19
20
  // @ts-expect-error: types incompatible???
20
21
  return routes;
@@ -66,7 +67,9 @@ function getBrokenLinksErrorMessage(allBrokenLinks) {
66
67
  return `${brokenLink.link}${showResolvedLink ? ` (resolved as: ${brokenLink.resolvedLink})` : ''}`;
67
68
  }
68
69
  function pageBrokenLinksMessage(pagePath, brokenLinks) {
69
- return `\n- On source page path = ${pagePath}:\n -> linking to ${brokenLinks
70
+ return `
71
+ - On source page path = ${pagePath}:
72
+ -> linking to ${brokenLinks
70
73
  .map(brokenLinkMessage)
71
74
  .join('\n -> linking to ')}`;
72
75
  }
@@ -85,13 +88,24 @@ function getBrokenLinksErrorMessage(allBrokenLinks) {
85
88
  if (frequentLinks.length === 0) {
86
89
  return '';
87
90
  }
88
- return `\n\nIt looks like some of the broken links we found appear in many pages of your site.\nMaybe those broken links appear on all pages through your site layout?\nWe recommend that you check your theme configuration for such links (particularly, theme navbar and footer).\nFrequent broken links are linking to:\n- ${frequentLinks.join(`\n- `)}\n`;
91
+ return logger_1.default.interpolate `
92
+
93
+ It looks like some of the broken links we found appear in many pages of your site.
94
+ Maybe those broken links appear on all pages through your site layout?
95
+ We recommend that you check your theme configuration for such links (particularly, theme navbar and footer).
96
+ Frequent broken links are linking to:${frequentLinks}
97
+ `;
89
98
  }
90
- return (`Docusaurus found broken links!\n\nPlease check the pages of your site in the list below, and make sure you don't reference any path that does not exist.\nNote: it's possible to ignore broken links with the 'onBrokenLinks' Docusaurus configuration, and let the build pass.${getLayoutBrokenLinksHelpMessage()}` +
91
- `\n\nExhaustive list of all broken links found:\n${Object.entries(allBrokenLinks)
92
- .map(([pagePath, brokenLinks]) => pageBrokenLinksMessage(pagePath, brokenLinks))
93
- .join('\n')}
94
- `);
99
+ return `Docusaurus found broken links!
100
+
101
+ Please check the pages of your site in the list below, and make sure you don't reference any path that does not exist.
102
+ Note: it's possible to ignore broken links with the 'onBrokenLinks' Docusaurus configuration, and let the build pass.${getLayoutBrokenLinksHelpMessage()}
103
+
104
+ Exhaustive list of all broken links found:
105
+ ${Object.entries(allBrokenLinks)
106
+ .map(([pagePath, brokenLinks]) => pageBrokenLinksMessage(pagePath, brokenLinks))
107
+ .join('\n')}
108
+ `;
95
109
  }
96
110
  exports.getBrokenLinksErrorMessage = getBrokenLinksErrorMessage;
97
111
  async function isExistingFile(filePath) {
@@ -107,7 +121,7 @@ async function isExistingFile(filePath) {
107
121
  async function filterExistingFileLinks({ baseUrl, outDir, allCollectedLinks, }) {
108
122
  async function linkFileExists(link) {
109
123
  // /baseUrl/javadoc/ -> /outDir/javadoc
110
- const baseFilePath = (0, utils_1.removeSuffix)(`${outDir}/${(0, utils_1.removePrefix)(link, baseUrl)}`, '/');
124
+ const baseFilePath = onlyPathname((0, utils_1.removeSuffix)(`${outDir}/${(0, utils_1.removePrefix)(link, baseUrl)}`, '/'));
111
125
  // -> /outDir/javadoc
112
126
  // -> /outDir/javadoc.html
113
127
  // -> /outDir/javadoc/index.html
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": "0.0.0-4645",
4
+ "version": "0.0.0-4653",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -41,13 +41,13 @@
41
41
  "@babel/runtime": "^7.17.2",
42
42
  "@babel/runtime-corejs3": "^7.17.2",
43
43
  "@babel/traverse": "^7.17.3",
44
- "@docusaurus/cssnano-preset": "0.0.0-4645",
45
- "@docusaurus/logger": "0.0.0-4645",
46
- "@docusaurus/mdx-loader": "0.0.0-4645",
44
+ "@docusaurus/cssnano-preset": "0.0.0-4653",
45
+ "@docusaurus/logger": "0.0.0-4653",
46
+ "@docusaurus/mdx-loader": "0.0.0-4653",
47
47
  "@docusaurus/react-loadable": "5.5.2",
48
- "@docusaurus/utils": "0.0.0-4645",
49
- "@docusaurus/utils-common": "0.0.0-4645",
50
- "@docusaurus/utils-validation": "0.0.0-4645",
48
+ "@docusaurus/utils": "0.0.0-4653",
49
+ "@docusaurus/utils-common": "0.0.0-4653",
50
+ "@docusaurus/utils-validation": "0.0.0-4653",
51
51
  "@slorber/static-site-generator-webpack-plugin": "^4.0.1",
52
52
  "@svgr/webpack": "^6.2.1",
53
53
  "autoprefixer": "^10.4.2",
@@ -106,8 +106,8 @@
106
106
  "webpackbar": "^5.0.2"
107
107
  },
108
108
  "devDependencies": {
109
- "@docusaurus/module-type-aliases": "0.0.0-4645",
110
- "@docusaurus/types": "0.0.0-4645",
109
+ "@docusaurus/module-type-aliases": "0.0.0-4653",
110
+ "@docusaurus/types": "0.0.0-4653",
111
111
  "@types/detect-port": "^1.3.2",
112
112
  "@types/nprogress": "^0.2.0",
113
113
  "@types/react-dom": "^17.0.11",
@@ -128,5 +128,5 @@
128
128
  "engines": {
129
129
  "node": ">=14"
130
130
  },
131
- "gitHead": "4eb744d0323996e14e1e1cc164fc925b0a9280fd"
131
+ "gitHead": "b1363d934842c24098ee8a95413af95c33af8271"
132
132
  }