dumi 2.3.3 → 2.3.5

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.
@@ -144,7 +144,7 @@ async function parseBlockAsset(opts) {
144
144
  }
145
145
  );
146
146
  ["description", "title"].forEach((key) => {
147
- frontmatter[key] || (frontmatter[key] = frontmatter[`${key}.${opts.fileLocale}`]);
147
+ frontmatter[key] = frontmatter[`${key}.${opts.fileLocale}`] || frontmatter[key];
148
148
  });
149
149
  result.frontmatter = frontmatter;
150
150
  }
@@ -4,6 +4,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
4
4
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
5
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import deepmerge from 'deepmerge';
7
8
  import { getRouteMetaById, matchRoutes, useAppData, useLocation, useRouteData } from 'dumi';
8
9
  import { useCallback, useState } from 'react';
9
10
  import { useIsomorphicLayoutEffect } from "./utils";
@@ -26,6 +27,7 @@ function getCachedRouteMeta(route) {
26
27
  var _ref, _ref$key;
27
28
  (_ref$key = (_ref = meta)[key]) !== null && _ref$key !== void 0 ? _ref$key : _ref[key] = route.meta[key];
28
29
  });
30
+ meta.frontmatter = deepmerge(meta.frontmatter, route.meta.frontmatter);
29
31
  }
30
32
  return meta;
31
33
  };
@@ -26,7 +26,9 @@ function babelLoaderCustomize() {
26
26
  return {
27
27
  config(config) {
28
28
  const context = this;
29
- if (config.options.filename && context.resourceQuery.includes("type=meta")) {
29
+ if (config.options.filename && ["type=demo", "type=frontmatter", "type=demo-index", "type=text"].some(
30
+ (v) => context.resourceQuery.includes(v)
31
+ )) {
30
32
  config.options.filename += context.resourceQuery;
31
33
  }
32
34
  return config.options;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dumi",
3
- "version": "2.3.3",
3
+ "version": "2.3.5",
4
4
  "description": "📖 Documentation Generator of React Component",
5
5
  "keywords": [
6
6
  "generator",
@@ -163,7 +163,7 @@
163
163
  "typescript": "~5.0.4",
164
164
  "vitest": "^0.33.0",
165
165
  "zx": "^7.2.3",
166
- "dumi-theme-mobile": "2.3.0"
166
+ "dumi-theme-mobile": "2.3.5"
167
167
  },
168
168
  "peerDependencies": {
169
169
  "react": ">=16.8",