@umijs/plugins 4.0.0-canary.20220506.3 → 4.0.0-canary.20220507.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.
@@ -113,13 +113,16 @@ export const setMasterOptions = (newOpts) => options = ({ ...options, ...newOpts
113
113
  });
114
114
  }
115
115
  else {
116
+ let content = getFileContent(file);
117
+ if (!api.config.qiankun.externalQiankun) {
118
+ content = content.replace(/from 'qiankun'/g, `from '${(0, plugin_utils_1.winPath)((0, path_1.dirname)(require.resolve('qiankun/package')))}'`);
119
+ }
116
120
  api.writeTmpFile({
117
121
  path: file.replace(/\.tpl$/, ''),
118
- content: getFileContent(file)
122
+ content: content
119
123
  .replace('__USE_MODEL__', api.isPluginEnable('model')
120
124
  ? `import { useModel } from '@@/plugin-model'`
121
125
  : `const useModel = null;`)
122
- .replace(/from 'qiankun'/g, `from '${(0, plugin_utils_1.winPath)((0, path_1.dirname)(require.resolve('qiankun/package')))}'`)
123
126
  .replace(/from 'lodash\//g, `from '${(0, plugin_utils_1.winPath)((0, path_1.dirname)(require.resolve('lodash/package')))}/`),
124
127
  });
125
128
  }
package/dist/qiankun.js CHANGED
@@ -7,6 +7,7 @@ exports.default = (api) => {
7
7
  return joi.object().keys({
8
8
  slave: joi.object(),
9
9
  master: joi.object(),
10
+ externalQiankun: joi.boolean(),
10
11
  });
11
12
  },
12
13
  },
@@ -105,8 +105,8 @@ const recursiveSearch = (
105
105
  if (routes[i].path === path) {
106
106
  return routes[i];
107
107
  }
108
- if (routes[i].chidlren && routes[i].chidlren?.length) {
109
- const found = recursiveSearch(routes[i].chidlren || [], path);
108
+ if (routes[i].children && routes[i].children?.length) {
109
+ const found = recursiveSearch(routes[i].children || [], path);
110
110
  if (found) {
111
111
  return found;
112
112
  }
@@ -128,8 +128,8 @@ export function insertRoute(routes: IRouteProps[], microAppRoute: IRouteProps) {
128
128
  );
129
129
  }
130
130
  found.exact = false;
131
- found.chidlren = found.chidlren || [];
132
- found.chidlren.push(microAppRoute);
131
+ found.children = found.children || [];
132
+ found.children.push(microAppRoute);
133
133
  } else {
134
134
  throw new Error(
135
135
  `[plugin-qiankun]: path "${microAppRoute.insert}" not found`,
@@ -34,10 +34,10 @@ function patchMicroAppRouteComponent(routes: any[]) {
34
34
  const rootRoute = routes.find((route) => route.path === '/');
35
35
  if (rootRoute) {
36
36
  // 如果根路由是叶子节点,则直接返回其父节点
37
- if (!rootRoute.chidlren) {
37
+ if (!rootRoute.children) {
38
38
  return routes;
39
39
  }
40
- return getRootRoutes(rootRoute.chidlren);
40
+ return getRootRoutes(rootRoute.children);
41
41
  }
42
42
  return routes;
43
43
  };
@@ -54,8 +54,8 @@ function patchMicroAppRouteComponent(routes: any[]) {
54
54
  masterHistoryType,
55
55
  routeBindingAlias,
56
56
  });
57
- if (route.chidlren?.length) {
58
- route.chidlren.forEach(patchRoute);
57
+ if (route.children?.length) {
58
+ route.children.forEach(patchRoute);
59
59
  }
60
60
  };
61
61
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/plugins",
3
- "version": "4.0.0-canary.20220506.3",
3
+ "version": "4.0.0-canary.20220507.2",
4
4
  "description": "@umijs/plugins",
5
5
  "homepage": "https://github.com/umijs/umi-next/tree/master/packages/plugins#readme",
6
6
  "bugs": "https://github.com/umijs/umi-next/issues",
@@ -24,12 +24,12 @@
24
24
  "dependencies": {
25
25
  "@ahooksjs/use-request": "^2.0.0",
26
26
  "@ant-design/icons": "^4.7.0",
27
- "@ant-design/pro-layout": "^6.35.1",
28
- "@umijs/bundler-utils": "4.0.0-canary.20220506.3",
27
+ "@ant-design/pro-layout": "^6.38.0",
28
+ "@umijs/bundler-utils": "4.0.0-canary.20220507.2",
29
29
  "antd-dayjs-webpack-plugin": "^1.0.6",
30
- "axios": "^0.26.1",
30
+ "axios": "^0.27.2",
31
31
  "babel-plugin-import": "^1.13.3",
32
- "dayjs": "^1.11.0",
32
+ "dayjs": "^1.11.2",
33
33
  "dva-core": "^2.0.4",
34
34
  "dva-immer": "^1.0.0",
35
35
  "dva-loading": "^3.0.22",
@@ -39,12 +39,12 @@
39
39
  "moment": "^2.29.3",
40
40
  "qiankun": "^2.7.0",
41
41
  "react-intl": "3.12.1",
42
- "react-redux": "^8.0.0",
42
+ "react-redux": "^8.0.1",
43
43
  "redux": "^4.2.0",
44
44
  "warning": "^4.0.3"
45
45
  },
46
46
  "devDependencies": {
47
- "umi": "4.0.0-canary.20220506.3"
47
+ "umi": "4.0.0-canary.20220507.2"
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public"