@umijs/plugins 4.0.0-rc.1 → 4.0.0-rc.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.
package/dist/layout.js CHANGED
@@ -187,7 +187,7 @@ const { formatMessage } = useIntl();
187
187
  return memo;
188
188
  }, {});
189
189
  const icons = Object.keys(iconsMap);
190
- const antIconsPath = (0, path_1.dirname)(require.resolve('@ant-design/icons/package'));
190
+ const antIconsPath = (0, plugin_utils_1.winPath)((0, path_1.dirname)(require.resolve('@ant-design/icons/package')));
191
191
  api.writeTmpFile({
192
192
  path: 'icons.tsx',
193
193
  content: `
package/dist/locale.js CHANGED
@@ -10,9 +10,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.packageNormalize = void 0;
13
- const utils_1 = require("@umijs/utils");
14
13
  const fs_1 = require("fs");
15
14
  const path_1 = require("path");
15
+ const plugin_utils_1 = require("umi/plugin-utils");
16
16
  const localeUtils_1 = require("./utils/localeUtils");
17
17
  const withTmpPath_1 = require("./utils/withTmpPath");
18
18
  const packageNormalize = (packageName) => packageName.replace(/[@\/\-.]/g, '_');
@@ -50,7 +50,7 @@ exports.default = (api) => {
50
50
  },
51
51
  enableBy: api.EnableBy.config,
52
52
  });
53
- const reactIntlPkgPath = (0, path_1.dirname)(require.resolve('react-intl/package'));
53
+ const reactIntlPkgPath = (0, plugin_utils_1.winPath)((0, path_1.dirname)(require.resolve('react-intl/package')));
54
54
  // polyfill
55
55
  if ((0, localeUtils_1.isNeedPolyfill)(((_a = api.userConfig) === null || _a === void 0 ? void 0 : _a.targets) || {})) {
56
56
  api.addEntryImportsAhead(() => [
@@ -87,8 +87,8 @@ exports.default = (api) => {
87
87
  const localeTpl = (0, fs_1.readFileSync)((0, path_1.join)(__dirname, '../libs/locale/locale.tpl'), 'utf-8');
88
88
  // moment2dayjs
89
89
  const resolveKey = api.config.moment2dayjs ? 'dayjs' : 'moment';
90
- const momentPkgPath = (0, path_1.dirname)(require.resolve(`${resolveKey}/package.json`));
91
- const EventEmitterPkg = (0, path_1.dirname)(require.resolve('event-emitter/package'));
90
+ const momentPkgPath = (0, plugin_utils_1.winPath)((0, path_1.dirname)(require.resolve(`${resolveKey}/package.json`)));
91
+ const EventEmitterPkg = (0, plugin_utils_1.winPath)((0, path_1.dirname)(require.resolve('event-emitter/package')));
92
92
  const { baseSeparator, baseNavigator, antd, title, useLocalStorage } = api
93
93
  .config.locale;
94
94
  const defaultLocale = ((_e = api.config.locale) === null || _e === void 0 ? void 0 : _e.default) || `zh${baseSeparator}CN`;
@@ -114,7 +114,7 @@ exports.default = (api) => {
114
114
  // set antd default locale
115
115
  if (!antdLocales.length && ((_g = api.config.locale) === null || _g === void 0 ? void 0 : _g.antd)) {
116
116
  const [lang, country = ''] = defaultLocale.split(baseSeparator);
117
- DefaultAntdLocales = utils_1.lodash.uniq(yield addAntdLocales({
117
+ DefaultAntdLocales = plugin_utils_1.lodash.uniq(yield addAntdLocales({
118
118
  lang,
119
119
  country,
120
120
  }));
@@ -124,7 +124,7 @@ exports.default = (api) => {
124
124
  return (0, exports.packageNormalize)(this);
125
125
  };
126
126
  api.writeTmpFile({
127
- content: utils_1.Mustache.render(localeTpl, {
127
+ content: plugin_utils_1.Mustache.render(localeTpl, {
128
128
  MomentLocales,
129
129
  DefaultMomentLocale,
130
130
  NormalizeAntdLocalesName,
@@ -143,7 +143,7 @@ exports.default = (api) => {
143
143
  const localeDirPath = (0, path_1.join)(api.paths.absSrcPath, localeDirName);
144
144
  api.writeTmpFile({
145
145
  path: 'localeExports.ts',
146
- content: utils_1.Mustache.render(localeExportsTpl, {
146
+ content: plugin_utils_1.Mustache.render(localeExportsTpl, {
147
147
  EventEmitterPkg,
148
148
  BaseSeparator: baseSeparator,
149
149
  BaseNavigator: baseNavigator,
@@ -159,7 +159,7 @@ exports.default = (api) => {
159
159
  })) }))),
160
160
  Antd: !!antd,
161
161
  DefaultLocale: JSON.stringify(defaultLocale),
162
- warningPkgPath: require.resolve('warning/package'),
162
+ warningPkgPath: (0, plugin_utils_1.winPath)(require.resolve('warning/package')),
163
163
  reactIntlPkgPath,
164
164
  }),
165
165
  });
@@ -167,7 +167,7 @@ exports.default = (api) => {
167
167
  const runtimeTpl = (0, fs_1.readFileSync)((0, path_1.join)(__dirname, '../libs/locale/runtime.tpl'), 'utf-8');
168
168
  api.writeTmpFile({
169
169
  path: 'runtime.tsx',
170
- content: utils_1.Mustache.render(runtimeTpl, {
170
+ content: plugin_utils_1.Mustache.render(runtimeTpl, {
171
171
  Title: !!title,
172
172
  }),
173
173
  });
@@ -175,7 +175,7 @@ exports.default = (api) => {
175
175
  const selectLang = (0, fs_1.readFileSync)((0, path_1.join)(__dirname, '../libs/locale/SelectLang.tpl'), 'utf-8');
176
176
  api.writeTmpFile({
177
177
  path: 'SelectLang.tsx',
178
- content: utils_1.Mustache.render(selectLang, {
178
+ content: plugin_utils_1.Mustache.render(selectLang, {
179
179
  Antd: !!antd,
180
180
  LocaleList: localeList,
181
181
  ShowSelectLang: localeList.length > 1 && !!antd,
package/dist/request.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const utils_1 = require("@umijs/utils");
4
3
  const path_1 = require("path");
4
+ const plugin_utils_1 = require("umi/plugin-utils");
5
5
  exports.default = (api) => {
6
6
  api.describe({
7
7
  key: 'request',
@@ -276,15 +276,15 @@ export type {
276
276
  `;
277
277
  api.onGenerateFiles(() => {
278
278
  var _a;
279
- const umiRequestPath = (0, path_1.dirname)(require.resolve('@ahooksjs/use-request/package.json'));
280
- const axiosPath = (0, path_1.dirname)(require.resolve('axios/package.json'));
281
- const antdPkg =
279
+ const umiRequestPath = (0, plugin_utils_1.winPath)((0, path_1.dirname)(require.resolve('@ahooksjs/use-request/package.json')));
280
+ const axiosPath = (0, plugin_utils_1.winPath)((0, path_1.dirname)(require.resolve('axios/package.json')));
281
+ const antdPkg = (0, plugin_utils_1.winPath)(
282
282
  // use path from antd plugin first
283
283
  ((_a = api.appData.antd) === null || _a === void 0 ? void 0 : _a.pkgPath) ||
284
- (0, path_1.dirname)(require.resolve('antd/package.json'));
284
+ (0, path_1.dirname)(require.resolve('antd/package.json')));
285
285
  api.writeTmpFile({
286
286
  path: 'request.ts',
287
- content: utils_1.Mustache.render(requestTpl, {
287
+ content: plugin_utils_1.Mustache.render(requestTpl, {
288
288
  umiRequestPath,
289
289
  axiosPath,
290
290
  antdPkg,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/plugins",
3
- "version": "4.0.0-rc.1",
3
+ "version": "4.0.0-rc.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",
@@ -23,11 +23,11 @@
23
23
  "dependencies": {
24
24
  "@ahooksjs/use-request": "^2.0.0",
25
25
  "@ant-design/icons": "^4.7.0",
26
- "@ant-design/pro-layout": "^6.31.7",
27
- "@umijs/bundler-utils": "4.0.0-rc.1",
28
- "antd": "^4.17.3",
26
+ "@ant-design/pro-layout": "^6.32.14",
27
+ "@umijs/bundler-utils": "4.0.0-rc.2",
28
+ "antd": "^4.18.7",
29
29
  "antd-dayjs-webpack-plugin": "^1.0.6",
30
- "axios": "^0.24.0",
30
+ "axios": "^0.26.0",
31
31
  "babel-plugin-import": "^1.13.3",
32
32
  "dayjs": "^1.10.7",
33
33
  "dva-core": "^2.0.4",
@@ -42,7 +42,7 @@
42
42
  "warning": "^4.0.3"
43
43
  },
44
44
  "devDependencies": {
45
- "umi": "4.0.0-rc.1"
45
+ "umi": "4.0.0-rc.2"
46
46
  },
47
47
  "publishConfig": {
48
48
  "access": "public"