@umijs/preset-umi 4.0.33 → 4.0.34

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.
@@ -1,2 +1,2 @@
1
1
  import { IApi } from '../../types';
2
- export declare function set(api: IApi, name: string, value: any): void;
2
+ export declare function set(api: IApi, name: string, value: string): void;
@@ -80,7 +80,9 @@ var precommit_default = (api) => {
80
80
  npx --no-install ${cliName} verify-commit $1
81
81
  `.trimStart());
82
82
  import_utils.logger.info("Write commit-msg");
83
- import_utils.execa.execaCommandSync("chmod +x .husky/commit-msg");
83
+ if (process.platform !== "win32") {
84
+ import_utils.execa.execaCommandSync("chmod +x .husky/commit-msg");
85
+ }
84
86
  }
85
87
  if (!(0, import_fs.existsSync)((0, import_path.join)(api.cwd, ".husky/pre-commit"))) {
86
88
  (0, import_fs.writeFileSync)((0, import_path.join)(api.cwd, ".husky/pre-commit"), `
@@ -90,7 +92,9 @@ npx --no-install ${cliName} verify-commit $1
90
92
  npx --no-install lint-staged --quiet
91
93
  `.trimStart());
92
94
  import_utils.logger.info("Write pre-commit");
93
- import_utils.execa.execaCommandSync("chmod +x .husky/pre-commit");
95
+ if (process.platform !== "win32") {
96
+ import_utils.execa.execaCommandSync("chmod +x .husky/pre-commit");
97
+ }
94
98
  }
95
99
  h.installDeps();
96
100
  }
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import type { IncomingMessage } from 'http';
3
4
  import type { IRoute } from '../../types';
4
5
  declare class UmiApiRequest {
@@ -99,12 +99,13 @@ var codeSplitting_default = (api) => {
99
99
  },
100
100
  lib: {
101
101
  test(module2) {
102
- return module2.size() > 16e4 && /node_modules[/\\]/.test(module2.identifier());
102
+ return !isModuleCSS(module2) && module2.size() > 16e4 && /node_modules[/\\]/.test(module2.identifier());
103
103
  },
104
104
  name(module2) {
105
105
  const rawRequest = module2.rawRequest && module2.rawRequest.replace(/^@(\w+)[/\\]/, "$1-");
106
- if (rawRequest)
107
- return `${rawRequest}-lib`;
106
+ if (rawRequest) {
107
+ return `${rawRequest.replace(/\./g, "_").replace(/\//g, "-")}-lib`;
108
+ }
108
109
  const identifier = module2.identifier();
109
110
  const trimmedIdentifier = /(?:^|[/\\])node_modules[/\\](.*)/.exec(identifier);
110
111
  const processedIdentifier = trimmedIdentifier && trimmedIdentifier[1].replace(/^@(\w+)[/\\]/, "$1-");
@@ -136,5 +137,8 @@ var codeSplitting_default = (api) => {
136
137
  return memo;
137
138
  });
138
139
  };
140
+ function isModuleCSS(module2) {
141
+ return module2.type === `css/mini-extract` || module2.type === `css/extract-chunks` || module2.type === `css/extract-css-chunks`;
142
+ }
139
143
  // Annotate the CommonJS export names for ESM import in node:
140
144
  0 && (module.exports = {});
@@ -65,7 +65,9 @@ export {};
65
65
  ],
66
66
  plugins: [
67
67
  require.resolve("@umijs/babel-preset-umi/dist/plugins/lockCoreJS")
68
- ]
68
+ ],
69
+ babelrc: false,
70
+ configFile: false
69
71
  });
70
72
  api.writeTmpFile({
71
73
  path: "core/polyfill.ts",
@@ -163,7 +163,8 @@ async function esbuildTransform(files, opts) {
163
163
  ".js": "tsx",
164
164
  ".jsx": "tsx"
165
165
  },
166
- logLevel: "error"
166
+ logLevel: "error",
167
+ tsconfig: (0, import_path.join)(__dirname, "empty.tsconfig.json")
167
168
  });
168
169
  } catch (e) {
169
170
  if (((_a = e.errors) == null ? void 0 : _a.length) || ((_b = e.warnings) == null ? void 0 : _b.length)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/preset-umi",
3
- "version": "4.0.33",
3
+ "version": "4.0.34",
4
4
  "description": "@umijs/preset-umi",
5
5
  "homepage": "https://github.com/umijs/umi/tree/master/packages/preset-umi#readme",
6
6
  "bugs": "https://github.com/umijs/umi/issues",
@@ -25,19 +25,19 @@
25
25
  "test": "umi-scripts jest-turbo"
26
26
  },
27
27
  "dependencies": {
28
- "@umijs/ast": "4.0.33",
29
- "@umijs/babel-preset-umi": "4.0.33",
30
- "@umijs/bundler-utils": "4.0.33",
31
- "@umijs/bundler-vite": "4.0.33",
32
- "@umijs/bundler-webpack": "4.0.33",
33
- "@umijs/core": "4.0.33",
28
+ "@umijs/ast": "4.0.34",
29
+ "@umijs/babel-preset-umi": "4.0.34",
30
+ "@umijs/bundler-utils": "4.0.34",
31
+ "@umijs/bundler-vite": "4.0.34",
32
+ "@umijs/bundler-webpack": "4.0.34",
33
+ "@umijs/core": "4.0.34",
34
34
  "@umijs/did-you-know": "^1.0.0",
35
35
  "@umijs/history": "5.3.1",
36
- "@umijs/mfsu": "4.0.33",
37
- "@umijs/plugin-run": "4.0.33",
38
- "@umijs/renderer-react": "4.0.33",
39
- "@umijs/server": "4.0.33",
40
- "@umijs/utils": "4.0.33",
36
+ "@umijs/mfsu": "4.0.34",
37
+ "@umijs/plugin-run": "4.0.34",
38
+ "@umijs/renderer-react": "4.0.34",
39
+ "@umijs/server": "4.0.34",
40
+ "@umijs/utils": "4.0.34",
41
41
  "babel-plugin-dynamic-import-node": "2.3.3",
42
42
  "click-to-react-component": "^1.0.8",
43
43
  "core-js": "3.22.4",
package/templates/umi.tpl CHANGED
@@ -59,6 +59,7 @@ async function render() {
59
59
  ...contextOpts.historyOpts,
60
60
  }),
61
61
  basename,
62
+ callback: contextOpts.callback,
62
63
  };
63
64
  const modifiedContext = pluginManager.applyPlugins({
64
65
  key: 'modifyClientRenderOpts',