create-umi 4.0.64 → 4.0.66
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/index.js
CHANGED
|
@@ -166,7 +166,15 @@ var src_default = async ({
|
|
|
166
166
|
const projectRoot = inMonorepo ? monorepoRoot : target;
|
|
167
167
|
const shouldInitGit = args.git !== false;
|
|
168
168
|
const withHusky = shouldInitGit && !inMonorepo;
|
|
169
|
+
let pnpmExtraNpmrc = "";
|
|
169
170
|
const isPnpm = npmClient === "pnpm" /* pnpm */;
|
|
171
|
+
let pnpmMajorVersion;
|
|
172
|
+
if (isPnpm) {
|
|
173
|
+
pnpmMajorVersion = await getPnpmMajorVersion();
|
|
174
|
+
if (pnpmMajorVersion === 7) {
|
|
175
|
+
pnpmExtraNpmrc = `strict-peer-dependencies=false`;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
170
178
|
const injectInternalTemplateFiles = async () => {
|
|
171
179
|
const generator = new import_utils.BaseGenerator({
|
|
172
180
|
path: (0, import_path.join)(__dirname, "..", "templates", appTemplate),
|
|
@@ -179,10 +187,7 @@ var src_default = async ({
|
|
|
179
187
|
author,
|
|
180
188
|
email,
|
|
181
189
|
withHusky,
|
|
182
|
-
|
|
183
|
-
// No need when `pnpm` > v7.13.5 , but we are forward compatible
|
|
184
|
-
// https://pnpm.io/npmrc#strict-peer-dependencies
|
|
185
|
-
extraNpmrc: isPnpm ? `strict-peer-dependencies=false` : "",
|
|
190
|
+
extraNpmrc: isPnpm ? pnpmExtraNpmrc : "",
|
|
186
191
|
pluginName
|
|
187
192
|
}
|
|
188
193
|
});
|
|
@@ -207,10 +212,29 @@ var src_default = async ({
|
|
|
207
212
|
} else {
|
|
208
213
|
import_utils.logger.info(`Skip Git init`);
|
|
209
214
|
}
|
|
215
|
+
const isPnpm8 = pnpmMajorVersion === 8;
|
|
210
216
|
if (!useDefaultData && args.install !== false) {
|
|
211
|
-
(
|
|
217
|
+
if (isPnpm8) {
|
|
218
|
+
await installWithPnpm8(target);
|
|
219
|
+
} else {
|
|
220
|
+
(0, import_utils.installWithNpmClient)({ npmClient, cwd: target });
|
|
221
|
+
}
|
|
212
222
|
} else {
|
|
213
223
|
import_utils.logger.info(`Skip install deps`);
|
|
224
|
+
if (isPnpm8) {
|
|
225
|
+
import_utils.logger.warn(
|
|
226
|
+
import_utils.chalk.yellow(
|
|
227
|
+
`You current using pnpm v8, it will install minimal version of dependencies`
|
|
228
|
+
)
|
|
229
|
+
);
|
|
230
|
+
import_utils.logger.warn(
|
|
231
|
+
import_utils.chalk.green(
|
|
232
|
+
`Recommended that you run ${import_utils.chalk.bold.cyan(
|
|
233
|
+
"pnpm up -L"
|
|
234
|
+
)} to install latest version of dependencies`
|
|
235
|
+
)
|
|
236
|
+
);
|
|
237
|
+
}
|
|
214
238
|
}
|
|
215
239
|
};
|
|
216
240
|
async function detectMonorepoRoot(opts) {
|
|
@@ -254,5 +278,16 @@ async function removeHusky(opts) {
|
|
|
254
278
|
await import_utils.fsExtra.remove(dir);
|
|
255
279
|
}
|
|
256
280
|
}
|
|
281
|
+
async function installWithPnpm8(cwd) {
|
|
282
|
+
await import_utils.execa.execa("pnpm", ["up", "-L"], { cwd, stdio: "inherit" });
|
|
283
|
+
}
|
|
284
|
+
async function getPnpmMajorVersion() {
|
|
285
|
+
try {
|
|
286
|
+
const { stdout } = await import_utils.execa.execa("pnpm", ["--version"]);
|
|
287
|
+
return parseInt(stdout.trim().split(".")[0], 10);
|
|
288
|
+
} catch (e) {
|
|
289
|
+
throw new Error("Please install pnpm first", { cause: e });
|
|
290
|
+
}
|
|
291
|
+
}
|
|
257
292
|
// Annotate the CommonJS export names for ESM import in node:
|
|
258
293
|
0 && (module.exports = {});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-umi",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.66",
|
|
4
4
|
"description": "create-umi",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi/tree/master/packages/create-umi#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi/issues",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"templates"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@umijs/utils": "4.0.
|
|
22
|
+
"@umijs/utils": "4.0.66"
|
|
23
23
|
},
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public"
|
|
@@ -11,19 +11,19 @@
|
|
|
11
11
|
"start": "npm run dev"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@ant-design/icons": "^
|
|
15
|
-
"@ant-design/pro-components": "^2.
|
|
14
|
+
"@ant-design/icons": "^5.0.1",
|
|
15
|
+
"@ant-design/pro-components": "^2.4.4",
|
|
16
16
|
"@umijs/max": "{{{ version }}}",
|
|
17
|
-
"antd": "^5.
|
|
17
|
+
"antd": "^5.4.0"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@types/react": "^18.0.
|
|
21
|
-
"@types/react-dom": "^18.0.
|
|
22
|
-
"husky": "^8.0.
|
|
23
|
-
"lint-staged": "^13.0
|
|
24
|
-
"prettier": "^2.7
|
|
25
|
-
"prettier-plugin-organize-imports": "^2",
|
|
26
|
-
"prettier-plugin-packagejson": "^2",
|
|
27
|
-
"typescript": "^5.0.
|
|
20
|
+
"@types/react": "^18.0.33",
|
|
21
|
+
"@types/react-dom": "^18.0.11",{{#withHusky}}
|
|
22
|
+
"husky": "^8.0.3",{{/withHusky}}
|
|
23
|
+
"lint-staged": "^13.2.0",
|
|
24
|
+
"prettier": "^2.8.7",
|
|
25
|
+
"prettier-plugin-organize-imports": "^3.2.2",
|
|
26
|
+
"prettier-plugin-packagejson": "^2.4.3",
|
|
27
|
+
"typescript": "^5.0.3"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
"start": "npm run dev"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"vue": "^3.2.
|
|
11
|
+
"vue": "^3.2.47",
|
|
12
12
|
"umi": "{{{ version }}}"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"typescript": "^5.0.
|
|
15
|
+
"typescript": "^5.0.3",
|
|
16
16
|
"@umijs/preset-vue": "{{{ version }}}"
|
|
17
17
|
}
|
|
18
18
|
}
|