@docusaurus/core 0.0.0-6016 → 0.0.0-6019

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.
Files changed (2) hide show
  1. package/bin/docusaurus.mjs +13 -12
  2. package/package.json +10 -10
@@ -222,7 +222,8 @@ cli
222
222
 
223
223
  cli.arguments('<command>').action((cmd) => {
224
224
  cli.outputHelp();
225
- logger.error` Unknown command name=${cmd}.`;
225
+ logger.error`Unknown Docusaurus CLI command name=${cmd}.`;
226
+ process.exit(1);
226
227
  });
227
228
 
228
229
  // === The above is the commander configuration ===
@@ -247,24 +248,24 @@ function isInternalCommand(command) {
247
248
  );
248
249
  }
249
250
 
250
- // process.argv always looks like this:
251
- // [
252
- // '/path/to/node',
253
- // '/path/to/docusaurus.mjs',
254
- // '<subcommand>',
255
- // ...subcommandArgs
256
- // ]
251
+ /**
252
+ * @param {string | undefined} command
253
+ */
254
+ function isExternalCommand(command) {
255
+ return !!(command && !isInternalCommand(command) && !command.startsWith('-'));
256
+ }
257
257
 
258
- // There is no subcommand
259
- // TODO: can we use commander to handle this case?
260
- if (process.argv.length < 3 || process.argv[2]?.startsWith('--')) {
258
+ // No command? We print the help message because Commander doesn't
259
+ // Note argv looks like this: ['../node','../docusaurus.mjs','<command>',...rest]
260
+ if (process.argv.length < 3) {
261
261
  cli.outputHelp();
262
+ logger.error`Please provide a Docusaurus CLI command.`;
262
263
  process.exit(1);
263
264
  }
264
265
 
265
266
  // There is an unrecognized subcommand
266
267
  // Let plugins extend the CLI before parsing
267
- if (!isInternalCommand(process.argv[2])) {
268
+ if (isExternalCommand(process.argv[2])) {
268
269
  // TODO: in this step, we must assume default site structure because there's
269
270
  // no way to know the siteDir/config yet. Maybe the root cli should be
270
271
  // responsible for parsing these arguments?
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-6016",
4
+ "version": "0.0.0-6019",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -43,12 +43,12 @@
43
43
  "@babel/runtime": "^7.22.6",
44
44
  "@babel/runtime-corejs3": "^7.22.6",
45
45
  "@babel/traverse": "^7.22.8",
46
- "@docusaurus/cssnano-preset": "0.0.0-6016",
47
- "@docusaurus/logger": "0.0.0-6016",
48
- "@docusaurus/mdx-loader": "0.0.0-6016",
49
- "@docusaurus/utils": "0.0.0-6016",
50
- "@docusaurus/utils-common": "0.0.0-6016",
51
- "@docusaurus/utils-validation": "0.0.0-6016",
46
+ "@docusaurus/cssnano-preset": "0.0.0-6019",
47
+ "@docusaurus/logger": "0.0.0-6019",
48
+ "@docusaurus/mdx-loader": "0.0.0-6019",
49
+ "@docusaurus/utils": "0.0.0-6019",
50
+ "@docusaurus/utils-common": "0.0.0-6019",
51
+ "@docusaurus/utils-validation": "0.0.0-6019",
52
52
  "autoprefixer": "^10.4.14",
53
53
  "babel-loader": "^9.1.3",
54
54
  "babel-plugin-dynamic-import-node": "^2.3.3",
@@ -103,8 +103,8 @@
103
103
  "webpackbar": "^5.0.2"
104
104
  },
105
105
  "devDependencies": {
106
- "@docusaurus/module-type-aliases": "0.0.0-6016",
107
- "@docusaurus/types": "0.0.0-6016",
106
+ "@docusaurus/module-type-aliases": "0.0.0-6019",
107
+ "@docusaurus/types": "0.0.0-6019",
108
108
  "@total-typescript/shoehorn": "^0.1.2",
109
109
  "@types/detect-port": "^1.3.3",
110
110
  "@types/react-dom": "^18.2.7",
@@ -124,5 +124,5 @@
124
124
  "engines": {
125
125
  "node": ">=18.0"
126
126
  },
127
- "gitHead": "c51435db0c58b94667da1c745f1635de65240c63"
127
+ "gitHead": "9b3ca6607004589c61b00374dcf694bdbee1c844"
128
128
  }