@docusaurus/core 0.0.0-4593 → 0.0.0-4597

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.
@@ -7,21 +7,24 @@
7
7
 
8
8
  // @ts-check
9
9
 
10
- const logger = require('@docusaurus/logger').default;
11
- const fs = require('fs-extra');
12
- const semver = require('semver');
13
- const path = require('path');
14
- const updateNotifier = require('update-notifier');
15
- const boxen = require('boxen');
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
- } = require('../package.json');
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
- module.exports = beforeCli;
136
+ export default beforeCli;
@@ -8,10 +8,11 @@
8
8
 
9
9
  // @ts-check
10
10
 
11
- const logger = require('@docusaurus/logger').default;
12
- const fs = require('fs');
13
- const cli = require('commander');
14
- const {
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
- } = require('../lib');
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.version(require('../package.json').version).usage('<command> [options]');
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
- export { default as build } from './commands/build';
8
- export { default as start } from './commands/start';
9
- export { default as swizzle } from './commands/swizzle';
10
- export { default as deploy } from './commands/deploy';
11
- export { default as externalCommand } from './commands/external';
12
- export { default as serve } from './commands/serve';
13
- export { default as clear } from './commands/clear';
14
- export { default as writeTranslations } from './commands/writeTranslations';
15
- export { default as writeHeadingIds } from './commands/writeHeadingIds';
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.writeHeadingIds = exports.writeTranslations = exports.clear = exports.serve = exports.externalCommand = exports.deploy = exports.swizzle = exports.start = exports.build = void 0;
10
- var build_1 = require("./commands/build");
11
- Object.defineProperty(exports, "build", { enumerable: true, get: function () { return __importDefault(build_1).default; } });
12
- var start_1 = require("./commands/start");
13
- Object.defineProperty(exports, "start", { enumerable: true, get: function () { return __importDefault(start_1).default; } });
14
- var swizzle_1 = require("./commands/swizzle");
15
- Object.defineProperty(exports, "swizzle", { enumerable: true, get: function () { return __importDefault(swizzle_1).default; } });
16
- var deploy_1 = require("./commands/deploy");
17
- Object.defineProperty(exports, "deploy", { enumerable: true, get: function () { return __importDefault(deploy_1).default; } });
18
- var external_1 = require("./commands/external");
19
- Object.defineProperty(exports, "externalCommand", { enumerable: true, get: function () { return __importDefault(external_1).default; } });
20
- var serve_1 = require("./commands/serve");
21
- Object.defineProperty(exports, "serve", { enumerable: true, get: function () { return __importDefault(serve_1).default; } });
22
- var clear_1 = require("./commands/clear");
23
- Object.defineProperty(exports, "clear", { enumerable: true, get: function () { return __importDefault(clear_1).default; } });
24
- var writeTranslations_1 = require("./commands/writeTranslations");
25
- Object.defineProperty(exports, "writeTranslations", { enumerable: true, get: function () { return __importDefault(writeTranslations_1).default; } });
26
- var writeHeadingIds_1 = require("./commands/writeHeadingIds");
27
- Object.defineProperty(exports, "writeHeadingIds", { enumerable: true, get: function () { return __importDefault(writeHeadingIds_1).default; } });
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-4593",
4
+ "version": "0.0.0-4597",
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.js"
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-4593",
45
- "@docusaurus/logger": "0.0.0-4593",
46
- "@docusaurus/mdx-loader": "0.0.0-4593",
44
+ "@docusaurus/cssnano-preset": "0.0.0-4597",
45
+ "@docusaurus/logger": "0.0.0-4597",
46
+ "@docusaurus/mdx-loader": "0.0.0-4597",
47
47
  "@docusaurus/react-loadable": "5.5.2",
48
- "@docusaurus/utils": "0.0.0-4593",
49
- "@docusaurus/utils-common": "0.0.0-4593",
50
- "@docusaurus/utils-validation": "0.0.0-4593",
48
+ "@docusaurus/utils": "0.0.0-4597",
49
+ "@docusaurus/utils-common": "0.0.0-4597",
50
+ "@docusaurus/utils-validation": "0.0.0-4597",
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-4593",
108
- "@docusaurus/types": "0.0.0-4593",
107
+ "@docusaurus/module-type-aliases": "0.0.0-4597",
108
+ "@docusaurus/types": "0.0.0-4597",
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": "fc32eabcb5fb2b1f75d1582d2ea5aa7a0679f241"
128
+ "gitHead": "635ab60e7cf821111d46dee45baf932c5bf8220f"
129
129
  }