@umijs/core 4.0.0-canary.20220729.1 → 4.0.0-canary.20220810.1

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.
@@ -82,7 +82,7 @@ function transformRoute(opts) {
82
82
  let absPath = opts.route.path;
83
83
  if ((absPath == null ? void 0 : absPath.charAt(0)) !== "/") {
84
84
  const parentAbsPath = opts.parentId ? opts.memo.ret[opts.parentId].absPath.replace(/\/+$/, "/") : "/";
85
- absPath = parentAbsPath + absPath;
85
+ absPath = `${parentAbsPath}${endsWithStar(parentAbsPath) ? "" : absPath}`;
86
86
  }
87
87
  opts.memo.ret[id] = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, routeProps), {
88
88
  path: opts.route.path
@@ -98,15 +98,20 @@ function transformRoute(opts) {
98
98
  if (wrappers == null ? void 0 : wrappers.length) {
99
99
  let parentId = opts.parentId;
100
100
  let path = opts.route.path;
101
+ let layout = opts.route.layout;
101
102
  wrappers.forEach((wrapper) => {
102
103
  const { id: id2 } = transformRoute({
103
- route: { path, component: wrapper, isWrapper: true },
104
+ route: __spreadValues({
105
+ path,
106
+ component: wrapper,
107
+ isWrapper: true
108
+ }, layout === false ? { layout: false } : {}),
104
109
  parentId,
105
110
  memo: opts.memo,
106
111
  onResolveComponent: opts.onResolveComponent
107
112
  });
108
113
  parentId = id2;
109
- path = "";
114
+ path = endsWithStar(path) ? "*" : "";
110
115
  });
111
116
  opts.memo.ret[id].parentId = parentId;
112
117
  opts.memo.ret[id].path = path;
@@ -122,6 +127,9 @@ function transformRoute(opts) {
122
127
  }
123
128
  return { id };
124
129
  }
130
+ function endsWithStar(str) {
131
+ return str.endsWith("*");
132
+ }
125
133
  // Annotate the CommonJS export names for ESM import in node:
126
134
  0 && (module.exports = {
127
135
  getConfigRoutes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/core",
3
- "version": "4.0.0-canary.20220729.1",
3
+ "version": "4.0.0-canary.20220810.1",
4
4
  "homepage": "https://github.com/umijs/umi/tree/master/packages/core#readme",
5
5
  "bugs": "https://github.com/umijs/umi/issues",
6
6
  "repository": {
@@ -21,8 +21,8 @@
21
21
  "test": "umi-scripts jest-turbo"
22
22
  },
23
23
  "dependencies": {
24
- "@umijs/bundler-utils": "4.0.0-canary.20220729.1",
25
- "@umijs/utils": "4.0.0-canary.20220729.1"
24
+ "@umijs/bundler-utils": "4.0.0-canary.20220810.1",
25
+ "@umijs/utils": "4.0.0-canary.20220810.1"
26
26
  },
27
27
  "devDependencies": {
28
28
  "dotenv": "16.0.0",