@docusaurus/core 0.0.0-4378 → 0.0.0-4388
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.
|
@@ -19,7 +19,7 @@ function addBaseUrl(siteUrl, baseUrl, url, { forcePrependBaseUrl = false, absolu
|
|
|
19
19
|
return url;
|
|
20
20
|
}
|
|
21
21
|
if (forcePrependBaseUrl) {
|
|
22
|
-
return baseUrl + url;
|
|
22
|
+
return baseUrl + url.replace(/^\//, '');
|
|
23
23
|
}
|
|
24
24
|
// We should avoid adding the baseurl twice if it's already there
|
|
25
25
|
const shouldAddBaseUrl = !url.startsWith(baseUrl);
|
|
@@ -27,7 +27,7 @@ function addBaseUrl(siteUrl, baseUrl, url, { forcePrependBaseUrl = false, absolu
|
|
|
27
27
|
return absolute ? siteUrl + basePath : basePath;
|
|
28
28
|
}
|
|
29
29
|
export function useBaseUrlUtils() {
|
|
30
|
-
const { siteConfig: { baseUrl
|
|
30
|
+
const { siteConfig: { baseUrl, url: siteUrl }, } = useDocusaurusContext();
|
|
31
31
|
return {
|
|
32
32
|
withBaseUrl: (url, options) => addBaseUrl(siteUrl, baseUrl, url, options),
|
|
33
33
|
};
|
|
@@ -9,7 +9,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.handleBrokenLinks = exports.filterExistingFileLinks = exports.getBrokenLinksErrorMessage = exports.getAllBrokenLinks = void 0;
|
|
10
10
|
const tslib_1 = require("tslib");
|
|
11
11
|
const react_router_config_1 = require("react-router-config");
|
|
12
|
-
const resolve_pathname_1 = (0, tslib_1.__importDefault)(require("resolve-pathname"));
|
|
13
12
|
const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
|
|
14
13
|
const lodash_1 = require("lodash");
|
|
15
14
|
const utils_1 = require("@docusaurus/utils");
|
|
@@ -29,7 +28,7 @@ function getPageBrokenLinks({ pagePath, pageLinks, routes, }) {
|
|
|
29
28
|
// we must resolve the links before using matchRoutes
|
|
30
29
|
// resolvePathname is used internally by ReactRouter
|
|
31
30
|
function resolveLink(link) {
|
|
32
|
-
const resolvedLink = (0,
|
|
31
|
+
const resolvedLink = (0, utils_1.resolvePathname)(onlyPathname(link), pagePath);
|
|
33
32
|
return { link, resolvedLink };
|
|
34
33
|
}
|
|
35
34
|
function isBrokenLink(link) {
|
package/lib/server/i18n.js
CHANGED
|
@@ -13,14 +13,8 @@ const utils_1 = require("@docusaurus/utils");
|
|
|
13
13
|
const rtl_detect_1 = require("rtl-detect");
|
|
14
14
|
const logger_1 = (0, tslib_1.__importDefault)(require("@docusaurus/logger"));
|
|
15
15
|
function getDefaultLocaleLabel(locale) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (typeof Intl.DisplayNames !== 'undefined') {
|
|
19
|
-
const languageName = new Intl.DisplayNames(locale, { type: 'language' }).of(locale);
|
|
20
|
-
return (languageName.charAt(0).toLocaleUpperCase(locale) +
|
|
21
|
-
languageName.substring(1));
|
|
22
|
-
}
|
|
23
|
-
return locale;
|
|
16
|
+
const languageName = new Intl.DisplayNames(locale, { type: 'language' }).of(locale);
|
|
17
|
+
return (languageName.charAt(0).toLocaleUpperCase(locale) + languageName.substring(1));
|
|
24
18
|
}
|
|
25
19
|
function getDefaultLocaleConfig(locale) {
|
|
26
20
|
return {
|
|
@@ -6,18 +6,19 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const tslib_1 = require("tslib");
|
|
9
10
|
const __1 = require("..");
|
|
10
|
-
const path_1 = require("path");
|
|
11
|
+
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
11
12
|
describe('getPluginVersion', () => {
|
|
12
13
|
it('Can detect external packages plugins versions of correctly.', () => {
|
|
13
|
-
expect((0, __1.getPluginVersion)(
|
|
14
|
+
expect((0, __1.getPluginVersion)(path_1.default.join(__dirname, '..', '__fixtures__', 'dummy-plugin.js'),
|
|
14
15
|
// Make the plugin appear external.
|
|
15
|
-
|
|
16
|
+
path_1.default.join(__dirname, '..', '..', '..', '..', '..', '..', 'website'))).toEqual({ type: 'package', version: 'random-version' });
|
|
16
17
|
});
|
|
17
18
|
it('Can detect project plugins versions correctly.', () => {
|
|
18
|
-
expect((0, __1.getPluginVersion)(
|
|
19
|
+
expect((0, __1.getPluginVersion)(path_1.default.join(__dirname, '..', '__fixtures__', 'dummy-plugin.js'),
|
|
19
20
|
// Make the plugin appear project local.
|
|
20
|
-
|
|
21
|
+
path_1.default.join(__dirname, '..', '__fixtures__'))).toEqual({ type: 'project' });
|
|
21
22
|
});
|
|
22
23
|
it('Can detect local packages versions correctly.', () => {
|
|
23
24
|
expect((0, __1.getPluginVersion)('/', '/')).toEqual({ type: 'local' });
|
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-
|
|
4
|
+
"version": "0.0.0-4388",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"docusaurus": "bin/docusaurus.js"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
|
-
"build": "tsc && tsc -p tsconfig.client.json && node copyUntypedFiles.
|
|
28
|
-
"watch": "node copyUntypedFiles.
|
|
27
|
+
"build": "tsc && tsc -p tsconfig.client.json && node copyUntypedFiles.mjs",
|
|
28
|
+
"watch": "node copyUntypedFiles.mjs && concurrently -n \"server,client\" --kill-others \"tsc --watch\" \"tsc -p tsconfig.client.json --watch\""
|
|
29
29
|
},
|
|
30
30
|
"bugs": {
|
|
31
31
|
"url": "https://github.com/facebook/docusaurus/issues"
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"@babel/runtime": "^7.16.3",
|
|
42
42
|
"@babel/runtime-corejs3": "^7.16.3",
|
|
43
43
|
"@babel/traverse": "^7.16.3",
|
|
44
|
-
"@docusaurus/cssnano-preset": "0.0.0-
|
|
45
|
-
"@docusaurus/logger": "0.0.0-
|
|
46
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
44
|
+
"@docusaurus/cssnano-preset": "0.0.0-4388",
|
|
45
|
+
"@docusaurus/logger": "0.0.0-4388",
|
|
46
|
+
"@docusaurus/mdx-loader": "0.0.0-4388",
|
|
47
47
|
"@docusaurus/react-loadable": "5.5.2",
|
|
48
|
-
"@docusaurus/utils": "0.0.0-
|
|
49
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
50
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
48
|
+
"@docusaurus/utils": "0.0.0-4388",
|
|
49
|
+
"@docusaurus/utils-common": "0.0.0-4388",
|
|
50
|
+
"@docusaurus/utils-validation": "0.0.0-4388",
|
|
51
51
|
"@slorber/static-site-generator-webpack-plugin": "^4.0.0",
|
|
52
52
|
"@svgr/webpack": "^6.0.0",
|
|
53
53
|
"autoprefixer": "^10.3.5",
|
|
@@ -108,8 +108,8 @@
|
|
|
108
108
|
"webpackbar": "^5.0.0-3"
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
112
|
-
"@docusaurus/types": "0.0.0-
|
|
111
|
+
"@docusaurus/module-type-aliases": "0.0.0-4388",
|
|
112
|
+
"@docusaurus/types": "0.0.0-4388",
|
|
113
113
|
"@types/copy-webpack-plugin": "^8.0.1",
|
|
114
114
|
"@types/css-minimizer-webpack-plugin": "^3.0.2",
|
|
115
115
|
"@types/detect-port": "^1.3.0",
|
|
@@ -128,5 +128,5 @@
|
|
|
128
128
|
"engines": {
|
|
129
129
|
"node": ">=14"
|
|
130
130
|
},
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "73aaa086302e31cf9e6dd3c95b55ab91c1961f2f"
|
|
132
132
|
}
|