@docusaurus/core 0.0.0-4731 → 0.0.0-4732

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.mjs CHANGED
@@ -72,8 +72,7 @@ export default async function beforeCli() {
72
72
  * @param {import('update-notifier').UpdateInfo} update
73
73
  */
74
74
  function ignoreUpdate(update) {
75
- const isCanaryRelease =
76
- update && update.current && update.current.startsWith('0.0.0');
75
+ const isCanaryRelease = update?.current?.startsWith('0.0.0');
77
76
  return isCanaryRelease;
78
77
  }
79
78
 
@@ -43,8 +43,7 @@ export default function ComponentCreator(path, hash) {
43
43
  if (chunkRegistry) {
44
44
  // eslint-disable-next-line prefer-destructuring
45
45
  optsLoader[key] = chunkRegistry[0];
46
- optsModules.push(chunkRegistry[1]);
47
- optsWebpack.push(chunkRegistry[2]);
46
+ optsModules.push(chunkRegistry[1], chunkRegistry[2]);
48
47
  }
49
48
  });
50
49
  return Loadable.Map({
@@ -63,7 +62,7 @@ export default function ComponentCreator(path, hash) {
63
62
  });
64
63
  val[keyPath[keyPath.length - 1]] = loaded[key].default;
65
64
  const nonDefaultKeys = Object.keys(loaded[key]).filter((k) => k !== 'default');
66
- if (nonDefaultKeys && nonDefaultKeys.length) {
65
+ if (nonDefaultKeys?.length) {
67
66
  nonDefaultKeys.forEach((nonDefaultKey) => {
68
67
  val[keyPath[keyPath.length - 1]][nonDefaultKey] =
69
68
  loaded[key][nonDefaultKey];
@@ -31,8 +31,7 @@ This component is safe to swizzle and was designed for this purpose.
31
31
  The swizzled component is retro-compatible with minor version upgrades.
32
32
  `,
33
33
  ],
34
- });
35
- table.push({
34
+ }, {
36
35
  [tableStatusLabel('unsafe')]: [
37
36
  logger_1.default.code('--danger'),
38
37
  `
@@ -44,8 +43,7 @@ ${logger_1.default.green('Tip')}: your customization can't be done in a ${tableS
44
43
  Report it here: https://github.com/facebook/docusaurus/discussions/5468
45
44
  `,
46
45
  ],
47
- });
48
- table.push({
46
+ }, {
49
47
  [tableStatusLabel('forbidden')]: [
50
48
  '',
51
49
  `
@@ -69,8 +67,7 @@ Allows rendering other components before/after the original theme component.
69
67
  ${logger_1.default.green('Tip')}: prefer ${logger_1.default.code('--wrap')} whenever possible to reduce the amount of code to maintain.
70
68
  `,
71
69
  ],
72
- });
73
- table.push({
70
+ }, {
74
71
  [logger_1.default.bold('Eject')]: [
75
72
  logger_1.default.code('--eject'),
76
73
  `
@@ -122,8 +122,7 @@ async function filterExistingFileLinks({ baseUrl, outDir, allCollectedLinks, })
122
122
  // -> /outDir/javadoc/index.html
123
123
  const filePathsToTry = [baseFilePath];
124
124
  if (!path_1.default.extname(baseFilePath)) {
125
- filePathsToTry.push(`${baseFilePath}.html`);
126
- filePathsToTry.push(path_1.default.join(baseFilePath, 'index.html'));
125
+ filePathsToTry.push(`${baseFilePath}.html`, path_1.default.join(baseFilePath, 'index.html'));
127
126
  }
128
127
  for (const file of filePathsToTry) {
129
128
  if (await isExistingFile(file)) {
@@ -184,7 +184,7 @@ function createMDXFallbackPlugin({ siteDir, siteConfig, }) {
184
184
  options: {
185
185
  staticDirs: siteConfig.staticDirectories.map((dir) => path_1.default.resolve(siteDir, dir)),
186
186
  siteDir,
187
- isMDXPartial: (_filename) => true,
187
+ isMDXPartial: () => true,
188
188
  isMDXPartialFrontMatterWarningDisabled: true,
189
189
  remarkPlugins: [remark_admonitions_1.default],
190
190
  },
@@ -222,8 +222,7 @@ next build. You can clear all build artifacts (including this folder) with the
222
222
  */
223
223
  export default ${JSON.stringify(siteConfig, null, 2)};
224
224
  `);
225
- plugins.push(createBootstrapPlugin({ siteDir, siteConfig }));
226
- plugins.push(createMDXFallbackPlugin({ siteDir, siteConfig }));
225
+ plugins.push(createBootstrapPlugin({ siteDir, siteConfig }), createMDXFallbackPlugin({ siteDir, siteConfig }));
227
226
  // Load client modules.
228
227
  const clientModules = (0, client_modules_1.default)(plugins);
229
228
  const genClientModules = (0, utils_1.generate)(generatedFilesDir, 'client-modules.js', `export default [
@@ -203,9 +203,8 @@ ${sourceWarningPart(path.node)}`);
203
203
  .filter((children) => !(children.isJSXText() &&
204
204
  children.node.value.replace('\n', '').trim() === ''))
205
205
  .pop();
206
- const isJSXText = singleChildren && singleChildren.isJSXText();
207
- const isJSXExpressionContainer = singleChildren &&
208
- singleChildren.isJSXExpressionContainer() &&
206
+ const isJSXText = singleChildren?.isJSXText();
207
+ const isJSXExpressionContainer = singleChildren?.isJSXExpressionContainer() &&
209
208
  singleChildren.get('expression').evaluate().confident;
210
209
  if (isJSXText || isJSXExpressionContainer) {
211
210
  message = isJSXText
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-4731",
4
+ "version": "0.0.0-4732",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -41,13 +41,13 @@
41
41
  "@babel/runtime": "^7.17.7",
42
42
  "@babel/runtime-corejs3": "^7.17.7",
43
43
  "@babel/traverse": "^7.17.3",
44
- "@docusaurus/cssnano-preset": "0.0.0-4731",
45
- "@docusaurus/logger": "0.0.0-4731",
46
- "@docusaurus/mdx-loader": "0.0.0-4731",
44
+ "@docusaurus/cssnano-preset": "0.0.0-4732",
45
+ "@docusaurus/logger": "0.0.0-4732",
46
+ "@docusaurus/mdx-loader": "0.0.0-4732",
47
47
  "@docusaurus/react-loadable": "5.5.2",
48
- "@docusaurus/utils": "0.0.0-4731",
49
- "@docusaurus/utils-common": "0.0.0-4731",
50
- "@docusaurus/utils-validation": "0.0.0-4731",
48
+ "@docusaurus/utils": "0.0.0-4732",
49
+ "@docusaurus/utils-common": "0.0.0-4732",
50
+ "@docusaurus/utils-validation": "0.0.0-4732",
51
51
  "@slorber/static-site-generator-webpack-plugin": "^4.0.1",
52
52
  "@svgr/webpack": "^6.2.1",
53
53
  "autoprefixer": "^10.4.2",
@@ -106,8 +106,8 @@
106
106
  "webpackbar": "^5.0.2"
107
107
  },
108
108
  "devDependencies": {
109
- "@docusaurus/module-type-aliases": "0.0.0-4731",
110
- "@docusaurus/types": "0.0.0-4731",
109
+ "@docusaurus/module-type-aliases": "0.0.0-4732",
110
+ "@docusaurus/types": "0.0.0-4732",
111
111
  "@types/detect-port": "^1.3.2",
112
112
  "@types/nprogress": "^0.2.0",
113
113
  "@types/react-dom": "^17.0.13",
@@ -128,5 +128,5 @@
128
128
  "engines": {
129
129
  "node": ">=14"
130
130
  },
131
- "gitHead": "f3787c5cd81d0d934005814e3038d897f5ba58aa"
131
+ "gitHead": "da1dfdadc386a446278acd3922f327b291b7b7f1"
132
132
  }