@umijs/plugins 4.0.0-canary.20220429.1 → 4.0.0-canary.20220429.4

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.
package/dist/dva.js CHANGED
@@ -180,6 +180,7 @@ function getModelUtil(api) {
180
180
  exports.getModelUtil = getModelUtil;
181
181
  function getAllModels(api) {
182
182
  return getModelUtil(api).getAllModels({
183
+ extraModelsPre: [],
183
184
  extraModels: [...(api.config.dva.extraModels || [])],
184
185
  });
185
186
  }
@@ -13,7 +13,7 @@ exports.default = (api) => {
13
13
  enableBy: api.EnableBy.config,
14
14
  });
15
15
  api.register({
16
- key: 'addExtraModels',
16
+ key: 'addExtraModelsPre',
17
17
  fn: () => [(0, withTmpPath_1.withTmpPath)({ api, path: '@@initialState.ts' })],
18
18
  });
19
19
  api.addRuntimePluginKey(() => ['getInitialState']);
package/dist/layout.js CHANGED
@@ -39,7 +39,7 @@ exports.default = (api) => {
39
39
  schema(joi) {
40
40
  return joi.object();
41
41
  },
42
- // onChange: api.ConfigChangeType.regenerateTmpFiles,
42
+ onChange: api.ConfigChangeType.regenerateTmpFiles,
43
43
  },
44
44
  enableBy: api.EnableBy.config,
45
45
  });
package/dist/model.js CHANGED
@@ -104,6 +104,11 @@ export function dataflowProvider(container, opts) {
104
104
  };
105
105
  function getAllModels(api) {
106
106
  return __awaiter(this, void 0, void 0, function* () {
107
+ const extraModelsPre = yield api.applyPlugins({
108
+ key: 'addExtraModelsPre',
109
+ type: api.ApplyPluginsType.add,
110
+ initialValue: [],
111
+ });
107
112
  const extraModels = yield api.applyPlugins({
108
113
  key: 'addExtraModels',
109
114
  type: api.ApplyPluginsType.add,
@@ -114,6 +119,10 @@ function getAllModels(api) {
114
119
  return t.isArrowFunctionExpression(node) || t.isFunctionDeclaration(node);
115
120
  },
116
121
  }).getAllModels({
122
+ extraModelsPre: [
123
+ ...extraModelsPre,
124
+ ...(api.config.model.extraModelsPre || []),
125
+ ],
117
126
  extraModels: [...extraModels, ...(api.config.model.extraModels || [])],
118
127
  });
119
128
  });
@@ -20,6 +20,7 @@ export declare class ModelUtils {
20
20
  count: number;
21
21
  constructor(api: IApi | null, opts: IOpts);
22
22
  getAllModels(opts: {
23
+ extraModelsPre: string[];
23
24
  extraModels: string[];
24
25
  }): Model[];
25
26
  getModels(opts: {
@@ -62,6 +62,7 @@ class ModelUtils {
62
62
  // reset count
63
63
  this.count = 1;
64
64
  return [
65
+ ...opts.extraModelsPre,
65
66
  ...this.getModels({
66
67
  base: (0, path_1.join)(this.api.paths.absSrcPath, 'models'),
67
68
  pattern: '**/*.{ts,tsx,js,jsx}',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/plugins",
3
- "version": "4.0.0-canary.20220429.1",
3
+ "version": "4.0.0-canary.20220429.4",
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",
@@ -25,7 +25,7 @@
25
25
  "@ahooksjs/use-request": "^2.0.0",
26
26
  "@ant-design/icons": "^4.7.0",
27
27
  "@ant-design/pro-layout": "^6.35.1",
28
- "@umijs/bundler-utils": "4.0.0-canary.20220429.1",
28
+ "@umijs/bundler-utils": "4.0.0-canary.20220429.4",
29
29
  "antd-dayjs-webpack-plugin": "^1.0.6",
30
30
  "axios": "^0.26.1",
31
31
  "babel-plugin-import": "^1.13.3",
@@ -44,7 +44,7 @@
44
44
  "warning": "^4.0.3"
45
45
  },
46
46
  "devDependencies": {
47
- "umi": "4.0.0-canary.20220429.1"
47
+ "umi": "4.0.0-canary.20220429.4"
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public"