@umijs/preset-umi 4.0.67 → 4.0.68
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/features/tmpFiles/tmpFiles.js +51 -52
- package/dist/registerMethods.js +2 -1
- package/dist/types.d.ts +1 -0
- package/package.json +14 -14
|
@@ -68,65 +68,64 @@ var tmpFiles_default = (api) => {
|
|
|
68
68
|
initialValue: (0, import_path.join)(rendererPath, "dist/server.js")
|
|
69
69
|
})
|
|
70
70
|
);
|
|
71
|
+
const frameworkName = api.service.frameworkName;
|
|
71
72
|
const srcPrefix = api.appData.hasSrcDir ? "src/" : "";
|
|
72
|
-
const umiTempDir = `${srcPrefix}
|
|
73
|
+
const umiTempDir = `${srcPrefix}.${frameworkName}`;
|
|
73
74
|
const baseUrl = api.appData.hasSrcDir ? "../../" : "../";
|
|
74
75
|
const isTs5 = (_a = api.appData.typescript.tsVersion) == null ? void 0 : _a.startsWith("5");
|
|
75
76
|
const isTslibInstalled = !!api.appData.typescript.tslibVersion;
|
|
77
|
+
let umiTsConfig = {
|
|
78
|
+
compilerOptions: {
|
|
79
|
+
target: "esnext",
|
|
80
|
+
module: "esnext",
|
|
81
|
+
lib: ["dom", "dom.iterable", "esnext"],
|
|
82
|
+
allowJs: true,
|
|
83
|
+
skipLibCheck: true,
|
|
84
|
+
moduleResolution: isTs5 ? "bundler" : "node",
|
|
85
|
+
importHelpers: isTslibInstalled,
|
|
86
|
+
noEmit: true,
|
|
87
|
+
jsx: api.appData.framework === "vue" ? "preserve" : "react-jsx",
|
|
88
|
+
esModuleInterop: true,
|
|
89
|
+
sourceMap: true,
|
|
90
|
+
baseUrl,
|
|
91
|
+
strict: true,
|
|
92
|
+
resolveJsonModule: true,
|
|
93
|
+
allowSyntheticDefaultImports: true,
|
|
94
|
+
// Supported by vue only
|
|
95
|
+
...api.appData.framework === "vue" ? {
|
|
96
|
+
// TODO Actually, it should be vite mode, but here it is written as vue only
|
|
97
|
+
// Required in Vite https://vitejs.dev/guide/features.html#typescript
|
|
98
|
+
isolatedModules: true
|
|
99
|
+
} : {},
|
|
100
|
+
paths: {
|
|
101
|
+
"@/*": [`${srcPrefix}*`],
|
|
102
|
+
"@@/*": [`${umiTempDir}/*`],
|
|
103
|
+
[`${api.appData.umi.importSource}`]: [umiDir],
|
|
104
|
+
[`${api.appData.umi.importSource}/typings`]: [
|
|
105
|
+
`${umiTempDir}/typings`
|
|
106
|
+
],
|
|
107
|
+
...api.config.vite ? {
|
|
108
|
+
"@fs/*": ["*"]
|
|
109
|
+
} : {}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
include: [
|
|
113
|
+
`${baseUrl}.${frameworkName}rc.ts`,
|
|
114
|
+
`${baseUrl}**/*.d.ts`,
|
|
115
|
+
`${baseUrl}**/*.ts`,
|
|
116
|
+
`${baseUrl}**/*.tsx`,
|
|
117
|
+
api.appData.framework === "vue" && `${baseUrl}**/*.vue`
|
|
118
|
+
].filter(Boolean)
|
|
119
|
+
};
|
|
120
|
+
umiTsConfig = await api.applyPlugins({
|
|
121
|
+
key: "modifyTSConfig",
|
|
122
|
+
type: api.ApplyPluginsType.modify,
|
|
123
|
+
initialValue: umiTsConfig
|
|
124
|
+
});
|
|
76
125
|
api.writeTmpFile({
|
|
77
126
|
noPluginDir: true,
|
|
78
127
|
path: "tsconfig.json",
|
|
79
|
-
|
|
80
|
-
// x 2、alias
|
|
81
|
-
// 3、language service platform
|
|
82
|
-
// 4、typing
|
|
83
|
-
content: JSON.stringify(
|
|
84
|
-
{
|
|
85
|
-
compilerOptions: {
|
|
86
|
-
target: "esnext",
|
|
87
|
-
module: "esnext",
|
|
88
|
-
lib: ["dom", "dom.iterable", "esnext"],
|
|
89
|
-
allowJs: true,
|
|
90
|
-
skipLibCheck: true,
|
|
91
|
-
moduleResolution: isTs5 ? "bundler" : "node",
|
|
92
|
-
importHelpers: isTslibInstalled,
|
|
93
|
-
noEmit: true,
|
|
94
|
-
jsx: api.appData.framework === "vue" ? "preserve" : "react-jsx",
|
|
95
|
-
esModuleInterop: true,
|
|
96
|
-
sourceMap: true,
|
|
97
|
-
baseUrl,
|
|
98
|
-
strict: true,
|
|
99
|
-
resolveJsonModule: true,
|
|
100
|
-
allowSyntheticDefaultImports: true,
|
|
101
|
-
// Supported by vue only
|
|
102
|
-
...api.appData.framework === "vue" ? {
|
|
103
|
-
// TODO Actually, it should be vite mode, but here it is written as vue only
|
|
104
|
-
// Required in Vite https://vitejs.dev/guide/features.html#typescript
|
|
105
|
-
isolatedModules: true
|
|
106
|
-
} : {},
|
|
107
|
-
paths: {
|
|
108
|
-
"@/*": [`${srcPrefix}*`],
|
|
109
|
-
"@@/*": [`${umiTempDir}/*`],
|
|
110
|
-
[`${api.appData.umi.importSource}`]: [umiDir],
|
|
111
|
-
[`${api.appData.umi.importSource}/typings`]: [
|
|
112
|
-
`${umiTempDir}/typings`
|
|
113
|
-
],
|
|
114
|
-
...api.config.vite ? {
|
|
115
|
-
"@fs/*": ["*"]
|
|
116
|
-
} : {}
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
include: [
|
|
120
|
-
`${baseUrl}.umirc.ts`,
|
|
121
|
-
`${baseUrl}**/*.d.ts`,
|
|
122
|
-
`${baseUrl}**/*.ts`,
|
|
123
|
-
`${baseUrl}**/*.tsx`,
|
|
124
|
-
api.appData.framework === "vue" && `${baseUrl}**/*.vue`
|
|
125
|
-
].filter(Boolean)
|
|
126
|
-
},
|
|
127
|
-
null,
|
|
128
|
-
2
|
|
129
|
-
)
|
|
128
|
+
content: JSON.stringify(umiTsConfig, null, 2)
|
|
130
129
|
});
|
|
131
130
|
api.writeTmpFile({
|
|
132
131
|
noPluginDir: true,
|
package/dist/registerMethods.js
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -137,6 +137,7 @@ export declare type IApi = PluginAPI & IServicePluginAPI & {
|
|
|
137
137
|
modifyRendererPath: IModify<string, {}>;
|
|
138
138
|
modifyRoutes: IModify<Record<string, IRoute>, {}>;
|
|
139
139
|
modifyServerRendererPath: IModify<string, {}>;
|
|
140
|
+
modifyTSConfig: IModify<Record<string, any>, {}>;
|
|
140
141
|
modifyViteConfig: IModify<ViteInlineConfig, {
|
|
141
142
|
env: Env;
|
|
142
143
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/preset-umi",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.68",
|
|
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",
|
|
@@ -37,20 +37,20 @@
|
|
|
37
37
|
"react-router": "6.3.0",
|
|
38
38
|
"react-router-dom": "6.3.0",
|
|
39
39
|
"regenerator-runtime": "0.13.11",
|
|
40
|
-
"@umijs/ast": "4.0.
|
|
41
|
-
"@umijs/
|
|
42
|
-
"@umijs/bundler-
|
|
43
|
-
"@umijs/bundler-
|
|
44
|
-
"@umijs/
|
|
45
|
-
"@umijs/core": "4.0.
|
|
46
|
-
"@umijs/mfsu": "4.0.
|
|
47
|
-
"@umijs/renderer-react": "4.0.
|
|
48
|
-
"@umijs/plugin-run": "4.0.67",
|
|
49
|
-
"@umijs/server": "4.0.67",
|
|
50
|
-
"@umijs/utils": "4.0.67",
|
|
51
|
-
"@umijs/zod2ts": "4.0.67",
|
|
40
|
+
"@umijs/ast": "4.0.68",
|
|
41
|
+
"@umijs/bundler-utils": "4.0.68",
|
|
42
|
+
"@umijs/bundler-webpack": "4.0.68",
|
|
43
|
+
"@umijs/bundler-vite": "4.0.68",
|
|
44
|
+
"@umijs/plugin-run": "4.0.68",
|
|
45
|
+
"@umijs/core": "4.0.68",
|
|
46
|
+
"@umijs/mfsu": "4.0.68",
|
|
47
|
+
"@umijs/renderer-react": "4.0.68",
|
|
52
48
|
"@umijs/did-you-know": "1.0.3",
|
|
53
|
-
"@umijs/
|
|
49
|
+
"@umijs/babel-preset-umi": "4.0.68",
|
|
50
|
+
"@umijs/server": "4.0.68",
|
|
51
|
+
"@umijs/ui": "3.0.0-alpha.0",
|
|
52
|
+
"@umijs/utils": "4.0.68",
|
|
53
|
+
"@umijs/zod2ts": "4.0.68"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@manypkg/get-packages": "1.1.3",
|