@docusaurus/core 0.0.0-5064 → 0.0.0-5065
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/bin/docusaurus.mjs +4 -0
- package/lib/commands/serve.d.ts +1 -0
- package/lib/commands/serve.js +6 -1
- package/package.json +10 -10
package/bin/docusaurus.mjs
CHANGED
|
@@ -148,6 +148,10 @@ cli
|
|
|
148
148
|
.option('-p, --port <port>', 'use specified port (default: 3000)')
|
|
149
149
|
.option('--build', 'build website before serving (default: false)')
|
|
150
150
|
.option('-h, --host <host>', 'use specified host (default: localhost)')
|
|
151
|
+
.option(
|
|
152
|
+
'--no-open',
|
|
153
|
+
'do not open page in the browser (default: false, or true in CI)',
|
|
154
|
+
)
|
|
151
155
|
.action(async (siteDir, options) =>
|
|
152
156
|
serve(await resolveDir(siteDir), options),
|
|
153
157
|
);
|
package/lib/commands/serve.d.ts
CHANGED
|
@@ -9,5 +9,6 @@ import type { LoadContextOptions } from '../server';
|
|
|
9
9
|
export declare type ServeCLIOptions = HostPortOptions & Pick<LoadContextOptions, 'config'> & {
|
|
10
10
|
dir?: string;
|
|
11
11
|
build?: boolean;
|
|
12
|
+
open?: boolean;
|
|
12
13
|
};
|
|
13
14
|
export declare function serve(siteDir: string, cliOptions: Partial<ServeCLIOptions>): Promise<void>;
|
package/lib/commands/serve.js
CHANGED
|
@@ -13,6 +13,7 @@ const path_1 = tslib_1.__importDefault(require("path"));
|
|
|
13
13
|
const logger_1 = tslib_1.__importDefault(require("@docusaurus/logger"));
|
|
14
14
|
const utils_1 = require("@docusaurus/utils");
|
|
15
15
|
const serve_handler_1 = tslib_1.__importDefault(require("serve-handler"));
|
|
16
|
+
const openBrowser_1 = tslib_1.__importDefault(require("react-dev-utils/openBrowser"));
|
|
16
17
|
const config_1 = require("../server/config");
|
|
17
18
|
const build_1 = require("./build");
|
|
18
19
|
const getHostPort_1 = require("../server/getHostPort");
|
|
@@ -53,7 +54,11 @@ async function serve(siteDir, cliOptions) {
|
|
|
53
54
|
directoryListing: false,
|
|
54
55
|
});
|
|
55
56
|
});
|
|
56
|
-
|
|
57
|
+
const url = servingUrl + baseUrl;
|
|
58
|
+
logger_1.default.success `Serving path=${buildDir} directory at: url=${url}`;
|
|
57
59
|
server.listen(port);
|
|
60
|
+
if (cliOptions.open && !process.env.CI) {
|
|
61
|
+
(0, openBrowser_1.default)(url);
|
|
62
|
+
}
|
|
58
63
|
}
|
|
59
64
|
exports.serve = serve;
|
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-5065",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"@babel/runtime": "^7.18.0",
|
|
44
44
|
"@babel/runtime-corejs3": "^7.18.0",
|
|
45
45
|
"@babel/traverse": "^7.18.0",
|
|
46
|
-
"@docusaurus/cssnano-preset": "0.0.0-
|
|
47
|
-
"@docusaurus/logger": "0.0.0-
|
|
48
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
46
|
+
"@docusaurus/cssnano-preset": "0.0.0-5065",
|
|
47
|
+
"@docusaurus/logger": "0.0.0-5065",
|
|
48
|
+
"@docusaurus/mdx-loader": "0.0.0-5065",
|
|
49
49
|
"@docusaurus/react-loadable": "5.5.2",
|
|
50
|
-
"@docusaurus/utils": "0.0.0-
|
|
51
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
52
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
50
|
+
"@docusaurus/utils": "0.0.0-5065",
|
|
51
|
+
"@docusaurus/utils-common": "0.0.0-5065",
|
|
52
|
+
"@docusaurus/utils-validation": "0.0.0-5065",
|
|
53
53
|
"@slorber/static-site-generator-webpack-plugin": "^4.0.4",
|
|
54
54
|
"@svgr/webpack": "^6.2.1",
|
|
55
55
|
"autoprefixer": "^10.4.7",
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
"webpackbar": "^5.0.2"
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
110
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
111
|
-
"@docusaurus/types": "0.0.0-
|
|
110
|
+
"@docusaurus/module-type-aliases": "0.0.0-5065",
|
|
111
|
+
"@docusaurus/types": "0.0.0-5065",
|
|
112
112
|
"@types/detect-port": "^1.3.2",
|
|
113
113
|
"@types/react-dom": "^18.0.4",
|
|
114
114
|
"@types/react-router-config": "^5.0.6",
|
|
@@ -128,5 +128,5 @@
|
|
|
128
128
|
"engines": {
|
|
129
129
|
"node": ">=16.14"
|
|
130
130
|
},
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "aea52e586d5b585549e65c6fbcd8c1d7c6a21939"
|
|
132
132
|
}
|