dumi 2.3.0-beta.1 → 2.3.0-beta.2

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.
@@ -86,7 +86,7 @@ function checkMinor2ByPkg(pkg) {
86
86
  if ((_a = pkg.name) == null ? void 0 : _a.startsWith("@examples/"))
87
87
  return true;
88
88
  const ver = ((_b = pkg.peerDependencies) == null ? void 0 : _b.dumi) || ((_c = pkg.devDependencies) == null ? void 0 : _c.dumi) || "^2.0.0";
89
- return import_plugin_utils.semver.subset(ver, import_constants.VERSION_2_LEVEL_NAV);
89
+ return import_plugin_utils.semver.subset(ver, import_constants.VERSION_2_LEVEL_NAV, { includePrerelease: true });
90
90
  }
91
91
  var theme_default = (api) => {
92
92
  const defaultThemeData = (0, import_loader.default)(DEFAULT_THEME_PATH);
@@ -56,7 +56,9 @@ function keepSoftBreak(pkg) {
56
56
  if (((_a = pkg == null ? void 0 : pkg.name) == null ? void 0 : _a.startsWith("@examples/")) || (pkg == null ? void 0 : pkg.name) === "dumi")
57
57
  return false;
58
58
  const ver = ((_b = pkg == null ? void 0 : pkg.devDependencies) == null ? void 0 : _b.dumi) ?? ((_c = pkg == null ? void 0 : pkg.dependencies) == null ? void 0 : _c.dumi) ?? "^2.0.0";
59
- return !import_plugin_utils.semver.subset(ver, import_constants.VERSION_2_DEPRECATE_SOFT_BREAKS);
59
+ return !import_plugin_utils.semver.subset(ver, import_constants.VERSION_2_DEPRECATE_SOFT_BREAKS, {
60
+ includePrerelease: true
61
+ });
60
62
  }
61
63
  async function applyUnifiedPlugin(opts) {
62
64
  const [plugin, options] = Array.isArray(opts.plugin) ? opts.plugin : [opts.plugin];
@@ -109,7 +109,7 @@ export function getRouteMetaById<T extends { syncOnly?: boolean }>(
109
109
  ? undefined | IRouteMeta
110
110
  : Promise<undefined | IRouteMeta> | undefined {
111
111
  if (filesMeta[id]) {
112
- const { frontmatter, toc, textGetter, tabs = [] } = filesMeta[id];
112
+ const { frontmatter, toc, textGetter, tabs } = filesMeta[id];
113
113
  const routeMeta: IRouteMeta = {
114
114
  frontmatter,
115
115
  toc: toc,
@@ -117,25 +117,30 @@ export function getRouteMetaById<T extends { syncOnly?: boolean }>(
117
117
  };
118
118
 
119
119
  if (opts?.syncOnly) {
120
- routeMeta.tabs = tabs.map((tabId) =>
121
- genTab(tabId, getRouteMetaById(tabId, opts)),
122
- );
120
+ if (tabs) {
121
+ routeMeta.tabs = tabs.map((tabId) =>
122
+ genTab(tabId, getRouteMetaById(tabId, opts)),
123
+ );
124
+ }
125
+
126
+ return routeMeta;
123
127
  } else {
124
128
  return new Promise(async (resolve) => {
125
129
  if (textGetter) {
126
130
  ({ texts: routeMeta.texts } = await textGetter());
127
131
  }
128
132
 
129
- routeMeta.tabs = await Promise.all(
130
- tabs.map(async (tabId) =>
131
- genTab(tabId, await getRouteMetaById(tabId, opts)),
132
- ),
133
- );
133
+ if (tabs) {
134
+ routeMeta.tabs = await Promise.all(
135
+ tabs.map(async (tabId) =>
136
+ genTab(tabId, await getRouteMetaById(tabId, opts)),
137
+ ),
138
+ );
139
+ }
140
+
134
141
  resolve(routeMeta);
135
142
  });
136
143
  }
137
-
138
- return routeMeta;
139
144
  }
140
145
  }
141
146
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dumi",
3
- "version": "2.3.0-beta.1",
3
+ "version": "2.3.0-beta.2",
4
4
  "description": "📖 Documentation Generator of React Component",
5
5
  "keywords": [
6
6
  "generator",