dumi 2.4.17 → 2.4.19-beta.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.
@@ -4,7 +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 { getParameters } from 'codesandbox/lib/api/define';
7
+ import { getParameters } from 'codesandbox-import-utils/lib/api/define';
8
8
  import { ApplyPluginsType } from 'dumi';
9
9
  import { genReactRenderCode, pluginManager } from "./utils";
10
10
  var CSB_API_ENDPOINT = 'https://codesandbox.io/api/v1/sandboxes/define';
@@ -140,14 +140,14 @@ var routes_default = (api) => {
140
140
  };
141
141
  }
142
142
  Object.entries(pages).forEach(([, route]) => {
143
- const { base } = api.config.conventionRoutes;
144
- route.file = (0, import_plugin_utils.winPath)(import_path.default.resolve(base, route.file));
143
+ const { base: base2 } = api.config.conventionRoutes;
144
+ route.file = (0, import_plugin_utils.winPath)(import_path.default.resolve(base2, route.file));
145
145
  routes[route.id] = route;
146
146
  });
147
147
  docDirs.map(normalizeDocDir).forEach(({ type, dir }) => {
148
- const base = import_path.default.join(api.cwd, dir);
148
+ const base2 = import_path.default.join(api.cwd, dir);
149
149
  const dirRoutes = (0, import_core.getConventionRoutes)({
150
- base,
150
+ base: base2,
151
151
  exclude: [/.*(?<!md)$/, /(\/|^)(\.|_)/]
152
152
  });
153
153
  Object.entries(dirRoutes).forEach(([key, route]) => {
@@ -157,15 +157,15 @@ var routes_default = (api) => {
157
157
  route.path = `${pluralType}/${route.path}`.replace(/\/+$/, "/");
158
158
  route.absPath = `/${route.path}`;
159
159
  }
160
- route.file = (0, import_plugin_utils.winPath)(import_path.default.resolve(base, route.file));
160
+ route.file = (0, import_plugin_utils.winPath)(import_path.default.resolve(base2, route.file));
161
161
  routes[route.id] = route;
162
162
  });
163
163
  });
164
164
  atomDirs.forEach(({ type, subType = "", dir }) => {
165
- const base = import_path.default.join(api.cwd, dir);
165
+ const base2 = import_path.default.join(api.cwd, dir);
166
166
  const atomFiles = import_plugin_utils.glob.sync(
167
167
  "{*,*/index,*/index.*,*/README,*/README.*}.md",
168
- { cwd: base }
168
+ { cwd: base2 }
169
169
  );
170
170
  atomFiles.forEach((file) => {
171
171
  const routeFile = (0, import_plugin_utils.winPath)(import_path.default.join((0, import_pluralize.plural)(type), subType, file));
@@ -176,7 +176,7 @@ var routes_default = (api) => {
176
176
  path: routePath,
177
177
  absPath: `/${routePath}`,
178
178
  parentId: docLayoutId,
179
- file: (0, import_plugin_utils.winPath)(import_path.default.resolve(base, file)),
179
+ file: (0, import_plugin_utils.winPath)(import_path.default.resolve(base2, file)),
180
180
  meta: { _atom_route: true }
181
181
  };
182
182
  });
@@ -205,10 +205,11 @@ var routes_default = (api) => {
205
205
  file: require.resolve("../client/pages/404")
206
206
  };
207
207
  }
208
+ const base = api.config.base;
208
209
  routes["demo-render"] = {
209
210
  id: "demo-render",
210
211
  path: `${import_constants.SP_ROUTE_PREFIX}demos/:id`,
211
- absPath: `/${import_constants.SP_ROUTE_PREFIX}demos/:id`,
212
+ absPath: `${base}${import_constants.SP_ROUTE_PREFIX}demos/:id`,
212
213
  parentId: demoLayoutId,
213
214
  file: require.resolve("../client/pages/Demo")
214
215
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dumi",
3
- "version": "2.4.17",
3
+ "version": "2.4.19-beta.0",
4
4
  "description": "📖 Documentation Generator of React Component",
5
5
  "keywords": [
6
6
  "generator",
@@ -70,7 +70,7 @@
70
70
  "@umijs/utils": "^4.3.0",
71
71
  "animated-scroll-to": "^2.3.0",
72
72
  "classnames": "2.3.2",
73
- "codesandbox": "^2.2.3",
73
+ "codesandbox-import-utils": "^2.2.3",
74
74
  "comlink": "^4.4.1",
75
75
  "copy-to-clipboard": "^3.3.3",
76
76
  "deepmerge": "^4.3.1",
@@ -144,7 +144,6 @@
144
144
  "@types/react-dom": "^18.2.7",
145
145
  "@umijs/lint": "^4.3.0",
146
146
  "@umijs/plugins": "4.0.32",
147
- "codesandbox-import-utils": "^2.2.3",
148
147
  "eslint": "^8.46.0",
149
148
  "esno": "^4.7.0",
150
149
  "fast-glob": "^3.3.1",