@umijs/preset-umi 4.6.46 → 4.6.48
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.
|
@@ -86,12 +86,18 @@ import { ${interfaceName} } from "./pluginConfigJoi.d";
|
|
|
86
86
|
|
|
87
87
|
interface ${typeName} ${typeString};
|
|
88
88
|
|
|
89
|
+
type UtoopackConfigOverride = {
|
|
90
|
+
utoopack?: boolean | Partial<import('umi').IUtoopackUserConfig>;
|
|
91
|
+
};
|
|
92
|
+
|
|
89
93
|
type PrettifyWithCloseable<T> = {
|
|
90
94
|
[K in keyof T]: T[K] | false;
|
|
91
95
|
} & {};
|
|
92
96
|
|
|
93
97
|
export type IConfigFromPlugins = PrettifyWithCloseable<
|
|
94
|
-
${interfaceName} &
|
|
98
|
+
${interfaceName} &
|
|
99
|
+
Omit<Partial<${typeName}>, keyof UtoopackConfigOverride> &
|
|
100
|
+
UtoopackConfigOverride
|
|
95
101
|
>;
|
|
96
102
|
`;
|
|
97
103
|
api.writeTmpFile({
|
|
@@ -29,20 +29,40 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
// src/features/utoopack/utoopack.ts
|
|
30
30
|
var utoopack_exports = {};
|
|
31
31
|
__export(utoopack_exports, {
|
|
32
|
-
default: () => utoopack_default
|
|
32
|
+
default: () => utoopack_default,
|
|
33
|
+
getPackVersionFromBundler: () => getPackVersionFromBundler
|
|
33
34
|
});
|
|
34
35
|
module.exports = __toCommonJS(utoopack_exports);
|
|
35
36
|
var import_utils = require("@umijs/utils");
|
|
36
37
|
var import_path = require("path");
|
|
37
38
|
var import_extractEntryAssets = require("../../utils/extractEntryAssets");
|
|
39
|
+
function getPackVersionFromBundler(bundlerEntry) {
|
|
40
|
+
var _a, _b;
|
|
41
|
+
const packageJsonCandidates = [
|
|
42
|
+
(0, import_path.join)((0, import_path.dirname)(bundlerEntry), "../package.json"),
|
|
43
|
+
(0, import_path.join)(bundlerEntry, "../package.json"),
|
|
44
|
+
(0, import_path.join)(bundlerEntry, "package.json")
|
|
45
|
+
];
|
|
46
|
+
for (const packageJsonPath of packageJsonCandidates) {
|
|
47
|
+
try {
|
|
48
|
+
const pkg = require(packageJsonPath);
|
|
49
|
+
return (_b = (_a = pkg.dependencies) == null ? void 0 : _a["@utoo/pack"]) == null ? void 0 : _b.replace(/^[^\d]*/, "");
|
|
50
|
+
} catch {
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return void 0;
|
|
54
|
+
}
|
|
38
55
|
var utoopack_default = (api) => {
|
|
39
56
|
api.describe({
|
|
40
57
|
key: "utoopack",
|
|
41
58
|
config: {
|
|
42
59
|
schema({ zod }) {
|
|
43
|
-
return zod.
|
|
44
|
-
|
|
45
|
-
|
|
60
|
+
return zod.union([
|
|
61
|
+
zod.boolean(),
|
|
62
|
+
zod.object({
|
|
63
|
+
root: zod.string()
|
|
64
|
+
}).partial()
|
|
65
|
+
]);
|
|
46
66
|
}
|
|
47
67
|
},
|
|
48
68
|
enableBy: () => Boolean(api.userConfig.utoopack) || Boolean(process.env.FORCE_UTOOPACK)
|
|
@@ -74,14 +94,12 @@ var utoopack_default = (api) => {
|
|
|
74
94
|
};
|
|
75
95
|
});
|
|
76
96
|
api.onStart(() => {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
process.env.UTOOPACK_VERSION = pkg.version;
|
|
84
|
-
} catch {
|
|
97
|
+
const bundlerEntry = process.env.UTOOPACK || require.resolve("@umijs/bundler-utoopack");
|
|
98
|
+
process.env.UTOOPACK = bundlerEntry;
|
|
99
|
+
const packVersion = getPackVersionFromBundler(bundlerEntry);
|
|
100
|
+
if (packVersion) {
|
|
101
|
+
process.env.UTOOPACK_VERSION = packVersion;
|
|
102
|
+
} else {
|
|
85
103
|
delete process.env.UTOOPACK_VERSION;
|
|
86
104
|
}
|
|
87
105
|
});
|
|
@@ -134,3 +152,7 @@ var utoopack_default = (api) => {
|
|
|
134
152
|
});
|
|
135
153
|
});
|
|
136
154
|
};
|
|
155
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
156
|
+
0 && (module.exports = {
|
|
157
|
+
getPackVersionFromBundler
|
|
158
|
+
});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { UmiApiRequest, UmiApiResponse } from './features/apiRoute';
|
|
2
|
-
export type { IApi, IConfig, IRoute, webpack } from './types';
|
|
2
|
+
export type { IApi, IConfig, IRoute, IUtoopackUserConfig, webpack, } from './types';
|
|
3
3
|
declare const _default: () => {
|
|
4
4
|
plugins: (string | false)[];
|
|
5
5
|
};
|
package/dist/types.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import type { InlineConfig as ViteInlineConfig } from 'vite';
|
|
|
13
13
|
import type { getMarkupArgs } from './commands/dev/getMarkupArgs';
|
|
14
14
|
import type { IOnDemandInstallDep } from './features/depsOnDemand/depsOnDemand';
|
|
15
15
|
import type CodeFrameError from './features/transform/CodeFrameError';
|
|
16
|
+
export type { IUtoopackUserConfig } from '@umijs/bundler-utoopack';
|
|
16
17
|
export { UmiApiRequest, UmiApiResponse } from './features/apiRoute';
|
|
17
18
|
export { webpack, IConfig };
|
|
18
19
|
export declare type IScript = Partial<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/preset-umi",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.48",
|
|
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/
|
|
47
|
-
"@umijs/
|
|
48
|
-
"@umijs/
|
|
49
|
-
"@umijs/
|
|
50
|
-
"@umijs/bundler-
|
|
51
|
-
"@umijs/
|
|
52
|
-
"@umijs/
|
|
53
|
-
"@umijs/
|
|
54
|
-
"@umijs/core": "4.6.
|
|
55
|
-
"@umijs/
|
|
56
|
-
"@umijs/
|
|
57
|
-
"@umijs/
|
|
58
|
-
"@umijs/
|
|
59
|
-
"@umijs/mfsu": "4.6.
|
|
46
|
+
"@umijs/babel-preset-umi": "4.6.48",
|
|
47
|
+
"@umijs/ast": "4.6.48",
|
|
48
|
+
"@umijs/bundler-esbuild": "4.6.48",
|
|
49
|
+
"@umijs/bundler-vite": "4.6.48",
|
|
50
|
+
"@umijs/bundler-utils": "4.6.48",
|
|
51
|
+
"@umijs/bundler-webpack": "4.6.48",
|
|
52
|
+
"@umijs/bundler-utoopack": "4.6.48",
|
|
53
|
+
"@umijs/plugin-run": "4.6.48",
|
|
54
|
+
"@umijs/core": "4.6.48",
|
|
55
|
+
"@umijs/renderer-react": "4.6.48",
|
|
56
|
+
"@umijs/zod2ts": "4.6.48",
|
|
57
|
+
"@umijs/server": "4.6.48",
|
|
58
|
+
"@umijs/utils": "4.6.48",
|
|
59
|
+
"@umijs/mfsu": "4.6.48",
|
|
60
60
|
"@umijs/ui": "3.0.1"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|