@umijs/preset-umi 4.4.13-canary.20250915.3 → 4.4.13-canary.20250917.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.
@@ -59,10 +59,8 @@ var dev_default = (api) => {
59
59
  });
60
60
  api.onStart(() => {
61
61
  var _a, _b;
62
- if (((_a = api.config) == null ? void 0 : _a.mako) || ((_b = api.config) == null ? void 0 : _b.utoopack))
63
- return;
64
- if (process.env.BIGFISH_INFO)
65
- return;
62
+ if (((_a = api.config) == null ? void 0 : _a.mako) || ((_b = api.config) == null ? void 0 : _b.utoopack)) return;
63
+ if (process.env.BIGFISH_INFO) return;
66
64
  });
67
65
  api.registerCommand({
68
66
  name: "dev",
@@ -220,8 +218,7 @@ PORT=8888 umi dev
220
218
  const isPublicAvailable = (0, import_fs.existsSync)(publicDir) && (0, import_fs.readdirSync)(publicDir).length;
221
219
  let restarted = false;
222
220
  const restartServer = () => {
223
- if (restarted)
224
- return;
221
+ if (restarted) return;
225
222
  restarted = true;
226
223
  import_utils.logger.event(`public dir changed, restart server...`);
227
224
  api.restartServer();
@@ -584,36 +584,36 @@ if (process.env.NODE_ENV === 'development') {
584
584
  )
585
585
  })
586
586
  );
587
- const exports = [];
587
+ const exports2 = [];
588
588
  const beforeExports = [];
589
589
  const afterExports = [];
590
590
  const exportMembers = ["default"];
591
- exports.push("// @umijs/renderer-*");
592
- exports.push(
591
+ exports2.push("// @umijs/renderer-*");
592
+ exports2.push(
593
593
  `export { ${(await getExportsAndCheck({
594
594
  path: (0, import_path.join)(rendererPath, "dist/index.js"),
595
595
  exportMembers
596
596
  })).join(", ")} } from '${rendererPath}';`
597
597
  );
598
- exports.push(
598
+ exports2.push(
599
599
  `export type { History, ClientLoader } from '${rendererPath}'`
600
600
  );
601
- exports.push("// umi/client/client/plugin");
601
+ exports2.push("// umi/client/client/plugin");
602
602
  const umiPluginPath = (0, import_utils.winPath)((0, import_path.join)(umiDir, "client/client/plugin.js"));
603
- exports.push(
603
+ exports2.push(
604
604
  `export { ${(await getExportsAndCheck({
605
605
  path: umiPluginPath,
606
606
  exportMembers
607
607
  })).join(", ")} } from '${umiPluginPath}';`
608
608
  );
609
- exports.push(`export { history, createHistory } from './core/history';`);
609
+ exports2.push(`export { history, createHistory } from './core/history';`);
610
610
  checkMembers({
611
611
  members: ["history", "createHistory"],
612
612
  exportMembers,
613
613
  path: "@@/core/history.ts"
614
614
  });
615
615
  if (api.service.config.terminal !== false) {
616
- exports.push(`export { terminal } from './core/terminal';`);
616
+ exports2.push(`export { terminal } from './core/terminal';`);
617
617
  checkMembers({
618
618
  members: ["terminal"],
619
619
  exportMembers,
@@ -630,13 +630,13 @@ if (process.env.NODE_ENV === 'development') {
630
630
  }
631
631
  }
632
632
  if (api.appData.framework === "react") {
633
- exports.push("// react ssr");
633
+ exports2.push("// react ssr");
634
634
  if (api.config.ssr) {
635
- exports.push(
635
+ exports2.push(
636
636
  `export { useServerInsertedHTML } from './core/serverInsertedHTMLContext';`
637
637
  );
638
638
  } else {
639
- exports.push(
639
+ exports2.push(
640
640
  `export const useServerInsertedHTML: Function = () => {};`
641
641
  );
642
642
  }
@@ -674,8 +674,13 @@ if (process.env.NODE_ENV === 'development') {
674
674
  for (const plugin of allPlugins) {
675
675
  const file = (0, import_utils.winPath)((0, import_path.join)(api.paths.absTmpPath, plugin, "types.d.ts"));
676
676
  if ((0, import_fs.existsSync)(file)) {
677
- const noSuffixFile = file.replace(/\.d\.ts$/, "");
678
- beforeExports.push(`export type * from '${noSuffixFile}';`);
677
+ if (api.appData.bundler === "utoopack") {
678
+ const noSuffixFile = file.replace(/\.d\.ts$/, "");
679
+ beforeExports.push(`export type * from '${noSuffixFile}';`);
680
+ } else {
681
+ const noSuffixFile = file.replace(/\.ts$/, "");
682
+ beforeExports.push(`export * from '${noSuffixFile}';`);
683
+ }
679
684
  }
680
685
  }
681
686
  let pluginIndex = 0;
@@ -687,7 +692,7 @@ if (process.env.NODE_ENV === 'development') {
687
692
  );
688
693
  if ((0, import_fs.existsSync)(runtimeConfigFile)) {
689
694
  const noSuffixRuntimeConfigFile = runtimeConfigFile.replace(
690
- /\.d\.ts$/,
695
+ /\.ts$/,
691
696
  ""
692
697
  );
693
698
  beforeImport.push(
@@ -716,7 +721,7 @@ if (process.env.NODE_ENV === 'development') {
716
721
  api.writeTmpFile({
717
722
  noPluginDir: true,
718
723
  path: "exports.ts",
719
- content: [...beforeExports, ...exports, ...afterExports].join("\n")
724
+ content: [...beforeExports, ...exports2, ...afterExports].join("\n")
720
725
  });
721
726
  },
722
727
  stage: 1e4
@@ -58,23 +58,10 @@ var utoopack_default = (api) => {
58
58
  memo.bundler = "utoopack";
59
59
  return memo;
60
60
  });
61
- api.modifyConfig((memo, args) => {
61
+ api.modifyConfig((memo) => {
62
62
  if (!api.userConfig.utoopack) {
63
63
  return memo;
64
64
  }
65
- let rootDir;
66
- try {
67
- const { findRootDir } = require("@umijs/bundler-utoopack");
68
- rootDir = memo.rootDir ? (0, import_path.join)(args.paths.cwd, memo.rootDir).replace(/\/$/, "") : findRootDir(args.paths.cwd).replace(/\/$/, "");
69
- } catch (e) {
70
- rootDir = memo.rootDir ? (0, import_path.join)(args.paths.cwd, memo.rootDir).replace(/\/$/, "") : args.paths.cwd.replace(/\/$/, "");
71
- }
72
- memo.alias = {
73
- ...memo.alias,
74
- "@/*": `${args.paths.absSrcPath}/*`,
75
- "@@/*": `${args.paths.absTmpPath}/*`,
76
- [`${rootDir}/*`]: `${rootDir}/*`
77
- };
78
65
  return {
79
66
  ...memo,
80
67
  mfsu: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/preset-umi",
3
- "version": "4.4.13-canary.20250915.3",
3
+ "version": "4.4.13-canary.20250917.1",
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",
@@ -43,20 +43,20 @@
43
43
  "react-router": "6.3.0",
44
44
  "react-router-dom": "6.3.0",
45
45
  "regenerator-runtime": "0.13.11",
46
- "@umijs/ast": "4.4.13-canary.20250915.3",
47
- "@umijs/babel-preset-umi": "4.4.13-canary.20250915.3",
48
- "@umijs/bundler-utoopack": "4.4.13-canary.20250915.3",
49
- "@umijs/bundler-esbuild": "4.4.13-canary.20250915.3",
50
- "@umijs/bundler-vite": "4.4.13-canary.20250915.3",
51
- "@umijs/bundler-utils": "4.4.13-canary.20250915.3",
52
- "@umijs/plugin-run": "4.4.13-canary.20250915.3",
53
- "@umijs/bundler-webpack": "4.4.13-canary.20250915.3",
54
- "@umijs/mfsu": "4.4.13-canary.20250915.3",
55
- "@umijs/renderer-react": "4.4.13-canary.20250915.3",
56
- "@umijs/core": "4.4.13-canary.20250915.3",
57
- "@umijs/server": "4.4.13-canary.20250915.3",
58
- "@umijs/utils": "4.4.13-canary.20250915.3",
59
- "@umijs/zod2ts": "4.4.13-canary.20250915.3",
46
+ "@umijs/ast": "4.4.13-canary.20250917.1",
47
+ "@umijs/bundler-esbuild": "4.4.13-canary.20250917.1",
48
+ "@umijs/babel-preset-umi": "4.4.13-canary.20250917.1",
49
+ "@umijs/bundler-utils": "4.4.13-canary.20250917.1",
50
+ "@umijs/bundler-webpack": "4.4.13-canary.20250917.1",
51
+ "@umijs/bundler-utoopack": "4.4.13-canary.20250917.1",
52
+ "@umijs/bundler-vite": "4.4.13-canary.20250917.1",
53
+ "@umijs/core": "4.4.13-canary.20250917.1",
54
+ "@umijs/plugin-run": "4.4.13-canary.20250917.1",
55
+ "@umijs/renderer-react": "4.4.13-canary.20250917.1",
56
+ "@umijs/server": "4.4.13-canary.20250917.1",
57
+ "@umijs/mfsu": "4.4.13-canary.20250917.1",
58
+ "@umijs/utils": "4.4.13-canary.20250917.1",
59
+ "@umijs/zod2ts": "4.4.13-canary.20250917.1",
60
60
  "@umijs/ui": "3.0.1"
61
61
  },
62
62
  "devDependencies": {