@docusaurus/core 0.0.0-4591 → 0.0.0-4595
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/{beforeCli.js → beforeCli.mjs} +14 -11
- package/bin/{docusaurus.js → docusaurus.mjs} +13 -8
- package/lib/index.d.ts +10 -9
- package/lib/index.js +20 -19
- package/package.json +11 -11
|
@@ -7,21 +7,24 @@
|
|
|
7
7
|
|
|
8
8
|
// @ts-check
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
import logger from '@docusaurus/logger';
|
|
11
|
+
import fs from 'fs-extra';
|
|
12
|
+
import semver from 'semver';
|
|
13
|
+
import path from 'path';
|
|
14
|
+
import updateNotifier from 'update-notifier';
|
|
15
|
+
import boxen from 'boxen';
|
|
16
|
+
import {createRequire} from 'module';
|
|
17
|
+
|
|
18
|
+
const packageJson = createRequire(import.meta.url)('../package.json');
|
|
19
|
+
const sitePkg = createRequire(path.join(process.cwd(), 'package.json'))(
|
|
20
|
+
'./package.json',
|
|
21
|
+
);
|
|
16
22
|
|
|
17
23
|
const {
|
|
18
24
|
name,
|
|
19
25
|
version,
|
|
20
26
|
engines: {node: requiredVersion},
|
|
21
|
-
} =
|
|
22
|
-
|
|
23
|
-
// eslint-disable-next-line import/no-dynamic-require
|
|
24
|
-
const sitePkg = require(path.resolve(process.cwd(), 'package.json'));
|
|
27
|
+
} = packageJson;
|
|
25
28
|
|
|
26
29
|
/**
|
|
27
30
|
* Notify user if `@docusaurus` packages are outdated
|
|
@@ -130,4 +133,4 @@ function beforeCli() {
|
|
|
130
133
|
}
|
|
131
134
|
}
|
|
132
135
|
|
|
133
|
-
|
|
136
|
+
export default beforeCli;
|
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
// @ts-check
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
import logger from '@docusaurus/logger';
|
|
12
|
+
import fs from 'fs';
|
|
13
|
+
import cli from 'commander';
|
|
14
|
+
import {createRequire} from 'module';
|
|
15
|
+
import {
|
|
15
16
|
build,
|
|
16
17
|
swizzle,
|
|
17
18
|
deploy,
|
|
@@ -21,15 +22,16 @@ const {
|
|
|
21
22
|
clear,
|
|
22
23
|
writeTranslations,
|
|
23
24
|
writeHeadingIds,
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const beforeCli = require('./beforeCli');
|
|
25
|
+
} from '../lib/index.js';
|
|
26
|
+
import beforeCli from './beforeCli.mjs';
|
|
27
27
|
|
|
28
28
|
beforeCli();
|
|
29
29
|
|
|
30
30
|
const resolveDir = (dir = '.') => fs.realpathSync(dir);
|
|
31
31
|
|
|
32
|
-
cli
|
|
32
|
+
cli
|
|
33
|
+
.version(createRequire(import.meta.url)('../package.json').version)
|
|
34
|
+
.usage('<command> [options]');
|
|
33
35
|
|
|
34
36
|
cli
|
|
35
37
|
.command('build [siteDir]')
|
|
@@ -226,6 +228,9 @@ cli.arguments('<command>').action((cmd) => {
|
|
|
226
228
|
logger.error` Unknown command name=${cmd}.`;
|
|
227
229
|
});
|
|
228
230
|
|
|
231
|
+
/**
|
|
232
|
+
* @param {string} command
|
|
233
|
+
*/
|
|
229
234
|
function isInternalCommand(command) {
|
|
230
235
|
return [
|
|
231
236
|
'start',
|
package/lib/index.d.ts
CHANGED
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
import build from './commands/build';
|
|
8
|
+
import clear from './commands/clear';
|
|
9
|
+
import deploy from './commands/deploy';
|
|
10
|
+
import externalCommand from './commands/external';
|
|
11
|
+
import serve from './commands/serve';
|
|
12
|
+
import start from './commands/start';
|
|
13
|
+
import swizzle from './commands/swizzle';
|
|
14
|
+
import writeHeadingIds from './commands/writeHeadingIds';
|
|
15
|
+
import writeTranslations from './commands/writeTranslations';
|
|
16
|
+
export { build, clear, deploy, externalCommand, serve, start, swizzle, writeHeadingIds, writeTranslations, };
|
package/lib/index.js
CHANGED
|
@@ -6,22 +6,23 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
9
|
+
exports.writeTranslations = exports.writeHeadingIds = exports.swizzle = exports.start = exports.serve = exports.externalCommand = exports.deploy = exports.clear = exports.build = void 0;
|
|
10
|
+
const tslib_1 = require("tslib");
|
|
11
|
+
const build_1 = (0, tslib_1.__importDefault)(require("./commands/build"));
|
|
12
|
+
exports.build = build_1.default;
|
|
13
|
+
const clear_1 = (0, tslib_1.__importDefault)(require("./commands/clear"));
|
|
14
|
+
exports.clear = clear_1.default;
|
|
15
|
+
const deploy_1 = (0, tslib_1.__importDefault)(require("./commands/deploy"));
|
|
16
|
+
exports.deploy = deploy_1.default;
|
|
17
|
+
const external_1 = (0, tslib_1.__importDefault)(require("./commands/external"));
|
|
18
|
+
exports.externalCommand = external_1.default;
|
|
19
|
+
const serve_1 = (0, tslib_1.__importDefault)(require("./commands/serve"));
|
|
20
|
+
exports.serve = serve_1.default;
|
|
21
|
+
const start_1 = (0, tslib_1.__importDefault)(require("./commands/start"));
|
|
22
|
+
exports.start = start_1.default;
|
|
23
|
+
const swizzle_1 = (0, tslib_1.__importDefault)(require("./commands/swizzle"));
|
|
24
|
+
exports.swizzle = swizzle_1.default;
|
|
25
|
+
const writeHeadingIds_1 = (0, tslib_1.__importDefault)(require("./commands/writeHeadingIds"));
|
|
26
|
+
exports.writeHeadingIds = writeHeadingIds_1.default;
|
|
27
|
+
const writeTranslations_1 = (0, tslib_1.__importDefault)(require("./commands/writeTranslations"));
|
|
28
|
+
exports.writeTranslations = writeTranslations_1.default;
|
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-4595",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"directory": "packages/docusaurus"
|
|
22
22
|
},
|
|
23
23
|
"bin": {
|
|
24
|
-
"docusaurus": "bin/docusaurus.
|
|
24
|
+
"docusaurus": "bin/docusaurus.mjs"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "tsc && tsc -p tsconfig.client.json && node copyUntypedFiles.mjs",
|
|
@@ -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.0",
|
|
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-4595",
|
|
45
|
+
"@docusaurus/logger": "0.0.0-4595",
|
|
46
|
+
"@docusaurus/mdx-loader": "0.0.0-4595",
|
|
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-4595",
|
|
49
|
+
"@docusaurus/utils-common": "0.0.0-4595",
|
|
50
|
+
"@docusaurus/utils-validation": "0.0.0-4595",
|
|
51
51
|
"@slorber/static-site-generator-webpack-plugin": "^4.0.1",
|
|
52
52
|
"@svgr/webpack": "^6.2.1",
|
|
53
53
|
"autoprefixer": "^10.4.2",
|
|
@@ -104,8 +104,8 @@
|
|
|
104
104
|
"webpackbar": "^5.0.2"
|
|
105
105
|
},
|
|
106
106
|
"devDependencies": {
|
|
107
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
108
|
-
"@docusaurus/types": "0.0.0-
|
|
107
|
+
"@docusaurus/module-type-aliases": "0.0.0-4595",
|
|
108
|
+
"@docusaurus/types": "0.0.0-4595",
|
|
109
109
|
"@types/detect-port": "^1.3.2",
|
|
110
110
|
"@types/nprogress": "^0.2.0",
|
|
111
111
|
"@types/react-dom": "^17.0.11",
|
|
@@ -125,5 +125,5 @@
|
|
|
125
125
|
"engines": {
|
|
126
126
|
"node": ">=14"
|
|
127
127
|
},
|
|
128
|
-
"gitHead": "
|
|
128
|
+
"gitHead": "3bd73b49c00b9438753da2f060eba352b1f8536b"
|
|
129
129
|
}
|