@alauda/doom 1.20.5 → 1.21.0

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.
@@ -216,7 +216,7 @@ const getCommonConfig = async ({ config, root, configFilePath, base, version, do
216
216
  return mergeConfig(rspackConfig, {
217
217
  ignoreWarnings: [
218
218
  {
219
- module: /\bflexsearch\b/,
219
+ module: /\b(flexsearch|vscode-languageserver-types)\b/,
220
220
  },
221
221
  ],
222
222
  resolve: {
@@ -323,18 +323,29 @@ export async function loadConfig(root, { config: configFile, base, prefix, v: ve
323
323
  lang,
324
324
  });
325
325
  base = commonConfig.base;
326
+ lang = commonConfig.lang;
327
+ root = commonConfig.root;
326
328
  const mergedConfig = mergeRsbuildConfig(commonConfig, config, {
327
329
  base,
328
- lang: commonConfig.lang,
329
- root: commonConfig.root,
330
+ lang,
331
+ root,
330
332
  });
331
- mergedConfig.export =
332
- config.export &&
333
- (await Promise.all(config.export.map(async (item) => ({
334
- ...item,
335
- scope: Array.isArray(item.scope) ? item.scope : [item.scope],
336
- flattenScope: (await glob(item.scope, { cwd: commonConfig.root })).filter(isDoc),
337
- }))));
333
+ if (export_) {
334
+ const hasLocales = !!commonConfig.themeConfig.locales?.length;
335
+ const apiEntries = await glob(`${hasLocales ? commonConfig.lang + '/' : ''}apis/{advanced_apis,crds,kubernetes_apis}/*/index.{md,mdx}`, { cwd: root });
336
+ const apiExports = apiEntries.map((entry) => {
337
+ const scope = entry.replace(/index\.mdx?$/, '');
338
+ return {
339
+ name: path.basename(path.dirname(entry)) + '_apis',
340
+ scope: hasLocales ? scope.replace(lang, '*') : scope,
341
+ };
342
+ });
343
+ mergedConfig.export = await Promise.all([...(config.export ?? []), ...apiExports].map(async (item) => ({
344
+ ...item,
345
+ scope: Array.isArray(item.scope) ? item.scope : [item.scope],
346
+ flattenScope: (await glob(item.scope, { cwd: root })).filter(isDoc),
347
+ })));
348
+ }
338
349
  if (base && prefix) {
339
350
  mergedConfig.base = (mergedConfig.prefix = normalizeSlash(prefix)) + base;
340
351
  }
@@ -24,7 +24,7 @@ const getClosestSidebar_ = (sidebarItems, pathname, exportItem, matched, depth =
24
24
  if (depth === 0) {
25
25
  matched = undefined;
26
26
  }
27
- if (exportItem.flattenScope.includes(sidebar._fileKey)) {
27
+ if (exportItem.flattenScope?.includes(sidebar._fileKey)) {
28
28
  matched = {
29
29
  sidebar,
30
30
  exportItem,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alauda/doom",
3
- "version": "1.20.5",
3
+ "version": "1.21.0",
4
4
  "type": "module",
5
5
  "description": "Doctor Doom making docs.",
6
6
  "repository": {
@@ -95,7 +95,6 @@
95
95
  "remark-mdx": "^3.1.1",
96
96
  "remark-message-control": "^8.0.0",
97
97
  "remark-stringify": "^11.0.0",
98
- "shiki": "^4.0.1",
99
98
  "simple-git": "^3.32.3",
100
99
  "string-width": "^8.2.0",
101
100
  "swagger2openapi": "^7.0.8",
@@ -129,7 +129,7 @@ td {
129
129
  }
130
130
 
131
131
  .rp {
132
- &-hover-group__item--active a[target='_blank']:after {
132
+ &-nav-menu .rp-hover-group__item--active a[target='_blank']:after {
133
133
  display: none;
134
134
  }
135
135