@docusaurus/core 0.0.0-4791 → 0.0.0-4795
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/client/serverEntry.js +1 -1
- package/lib/commands/serve.js +1 -1
- package/lib/commands/start.js +2 -2
- package/lib/commands/swizzle/actions.js +2 -2
- package/lib/commands/swizzle/index.js +2 -2
- package/lib/server/configValidation.js +1 -1
- package/lib/server/plugins/index.js +1 -1
- package/package.json +10 -10
|
@@ -39,7 +39,7 @@ export default async function render(locals) {
|
|
|
39
39
|
const isNotDefinedErrorRegex = /(?:window|document|localStorage|navigator|alert|location|buffer|self) is not defined/i;
|
|
40
40
|
if (isNotDefinedErrorRegex.test(err.message)) {
|
|
41
41
|
logger.info `It looks like you are using code that should run on the client-side only.
|
|
42
|
-
To get around it, try using code=${'<BrowserOnly>'} (
|
|
42
|
+
To get around it, try using code=${'<BrowserOnly>'} (url=${'https://docusaurus.io/docs/docusaurus-core/#browseronly'}) or code=${'ExecutionEnvironment'} (url=${'https://docusaurus.io/docs/docusaurus-core/#executionenvironment'}).
|
|
43
43
|
It might also require to wrap your client code in code=${'useEffect'} hook and/or import a third-party library dynamically (if any).`;
|
|
44
44
|
}
|
|
45
45
|
throw err;
|
package/lib/commands/serve.js
CHANGED
|
@@ -51,7 +51,7 @@ async function serve(siteDir, cliOptions) {
|
|
|
51
51
|
directoryListing: false,
|
|
52
52
|
});
|
|
53
53
|
});
|
|
54
|
-
logger_1.default.success `Serving path=${cliOptions.dir} directory at
|
|
54
|
+
logger_1.default.success `Serving path=${cliOptions.dir} directory at url=${servingUrl + baseUrl}.`;
|
|
55
55
|
server.listen(port);
|
|
56
56
|
}
|
|
57
57
|
exports.default = serve;
|
package/lib/commands/start.js
CHANGED
|
@@ -46,14 +46,14 @@ async function start(siteDir, cliOptions) {
|
|
|
46
46
|
const { baseUrl, headTags, preBodyTags, postBodyTags } = props;
|
|
47
47
|
const urls = (0, WebpackDevServerUtils_1.prepareUrls)(protocol, host, port);
|
|
48
48
|
const openUrl = (0, utils_1.normalizeUrl)([urls.localUrlForBrowser, baseUrl]);
|
|
49
|
-
logger_1.default.success `Docusaurus website is running at
|
|
49
|
+
logger_1.default.success `Docusaurus website is running at url=${openUrl}.`;
|
|
50
50
|
// Reload files processing.
|
|
51
51
|
const reload = lodash_1.default.debounce(() => {
|
|
52
52
|
loadSite()
|
|
53
53
|
.then(({ baseUrl: newBaseUrl }) => {
|
|
54
54
|
const newOpenUrl = (0, utils_1.normalizeUrl)([urls.localUrlForBrowser, newBaseUrl]);
|
|
55
55
|
if (newOpenUrl !== openUrl) {
|
|
56
|
-
logger_1.default.success `Docusaurus website is running at
|
|
56
|
+
logger_1.default.success `Docusaurus website is running at url=${newOpenUrl}.`;
|
|
57
57
|
}
|
|
58
58
|
})
|
|
59
59
|
.catch((err) => {
|
|
@@ -55,7 +55,7 @@ async function eject({ siteDir, themePath, componentName, }) {
|
|
|
55
55
|
await fs_extra_1.default.outputFile(targetFile, fileContents.trimStart().replace(/^\/\*.+?\*\/\s*/ms, ''));
|
|
56
56
|
}
|
|
57
57
|
catch (err) {
|
|
58
|
-
throw new Error(logger_1.default.interpolate `Could not copy file from
|
|
58
|
+
throw new Error(logger_1.default.interpolate `Could not copy file from path=${sourceFile} to path=${targetFile}`);
|
|
59
59
|
}
|
|
60
60
|
return targetFile;
|
|
61
61
|
}));
|
|
@@ -75,7 +75,7 @@ async function wrap({ siteDir, themePath, componentName: themeComponentName, typ
|
|
|
75
75
|
import type ${componentName}Type from '@theme/${themeComponentName}';
|
|
76
76
|
import ${componentName} from '@theme-${importType}/${themeComponentName}';
|
|
77
77
|
|
|
78
|
-
type Props = ComponentProps<typeof ${componentName}Type
|
|
78
|
+
type Props = ComponentProps<typeof ${componentName}Type>;
|
|
79
79
|
|
|
80
80
|
export default function ${wrapperComponentName}(props: Props): JSX.Element {
|
|
81
81
|
return (
|
|
@@ -90,7 +90,7 @@ async function swizzle(siteDir, themeNameParam, componentNameParam, optionsParam
|
|
|
90
90
|
typescript,
|
|
91
91
|
});
|
|
92
92
|
logger_1.default.success `
|
|
93
|
-
Created wrapper of name=${componentName} from name=${themeName} in path=${result.createdFiles}
|
|
93
|
+
Created wrapper of name=${componentName} from name=${themeName} in path=${result.createdFiles}
|
|
94
94
|
`;
|
|
95
95
|
return result;
|
|
96
96
|
}
|
|
@@ -101,7 +101,7 @@ Created wrapper of name=${componentName} from name=${themeName} in path=${result
|
|
|
101
101
|
componentName,
|
|
102
102
|
});
|
|
103
103
|
logger_1.default.success `
|
|
104
|
-
Ejected name=${componentName} from name=${themeName} to path=${result.createdFiles}
|
|
104
|
+
Ejected name=${componentName} from name=${themeName} to path=${result.createdFiles}
|
|
105
105
|
`;
|
|
106
106
|
return result;
|
|
107
107
|
}
|
|
@@ -195,7 +195,7 @@ function validateConfig(config) {
|
|
|
195
195
|
? `${accumulatedErr}${err.message}\n`
|
|
196
196
|
: accumulatedErr, '');
|
|
197
197
|
formattedError = unknownFields
|
|
198
|
-
? `${formattedError}These field(s) (${unknownFields}) are not recognized in ${utils_1.DEFAULT_CONFIG_FILE_NAME}.\nIf you still want these fields to be in your configuration, put them in the "customFields" field.\nSee https://docusaurus.io/docs/docusaurus
|
|
198
|
+
? `${formattedError}These field(s) (${unknownFields}) are not recognized in ${utils_1.DEFAULT_CONFIG_FILE_NAME}.\nIf you still want these fields to be in your configuration, put them in the "customFields" field.\nSee https://docusaurus.io/docs/api/docusaurus-config/#customfields`
|
|
199
199
|
: formattedError;
|
|
200
200
|
throw new Error(formattedError);
|
|
201
201
|
}
|
|
@@ -153,7 +153,7 @@ async function loadPlugins({ pluginConfigs, context, }) {
|
|
|
153
153
|
// TODO remove this deprecated lifecycle soon
|
|
154
154
|
// deprecated since alpha-60
|
|
155
155
|
// TODO, 1 user reported usage of this lifecycle! https://github.com/facebook/docusaurus/issues/3918
|
|
156
|
-
logger_1.default.error `Plugin code=${'routesLoaded'} lifecycle is deprecated. If you think we should keep this lifecycle, please report here:
|
|
156
|
+
logger_1.default.error `Plugin code=${'routesLoaded'} lifecycle is deprecated. If you think we should keep this lifecycle, please report here: url=${'https://github.com/facebook/docusaurus/issues/3918'}`;
|
|
157
157
|
await plugin.routesLoaded(pluginsRouteConfigs);
|
|
158
158
|
}));
|
|
159
159
|
// Sort the route config. This ensures that route with nested
|
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-4795",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"@babel/runtime": "^7.17.8",
|
|
42
42
|
"@babel/runtime-corejs3": "^7.17.8",
|
|
43
43
|
"@babel/traverse": "^7.17.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-4795",
|
|
45
|
+
"@docusaurus/logger": "0.0.0-4795",
|
|
46
|
+
"@docusaurus/mdx-loader": "0.0.0-4795",
|
|
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-4795",
|
|
49
|
+
"@docusaurus/utils-common": "0.0.0-4795",
|
|
50
|
+
"@docusaurus/utils-validation": "0.0.0-4795",
|
|
51
51
|
"@slorber/static-site-generator-webpack-plugin": "^4.0.4",
|
|
52
52
|
"@svgr/webpack": "^6.2.1",
|
|
53
53
|
"autoprefixer": "^10.4.4",
|
|
@@ -106,8 +106,8 @@
|
|
|
106
106
|
"webpackbar": "^5.0.2"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
110
|
-
"@docusaurus/types": "0.0.0-
|
|
109
|
+
"@docusaurus/module-type-aliases": "0.0.0-4795",
|
|
110
|
+
"@docusaurus/types": "0.0.0-4795",
|
|
111
111
|
"@types/detect-port": "^1.3.2",
|
|
112
112
|
"@types/nprogress": "^0.2.0",
|
|
113
113
|
"@types/react-dom": "^17.0.14",
|
|
@@ -128,5 +128,5 @@
|
|
|
128
128
|
"engines": {
|
|
129
129
|
"node": ">=14"
|
|
130
130
|
},
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "6d8d64febd22e86ef72b2e7de915bb1bab2beead"
|
|
132
132
|
}
|