create-message-kit 1.1.7-beta.30 → 1.1.7-beta.32
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +3 -3
- package/index.js +11 -9
- package/package.json +1 -1
package/README.md
CHANGED
@@ -9,13 +9,13 @@ bun create message-kit
|
|
9
9
|
```
|
10
10
|
|
11
11
|
```bash
|
12
|
-
npx create-message-kit
|
12
|
+
npx create-message-kit
|
13
13
|
```
|
14
14
|
|
15
15
|
```bash
|
16
|
-
yarn create message-kit
|
16
|
+
yarn create message-kit
|
17
17
|
```
|
18
18
|
|
19
19
|
```bash [npm]
|
20
|
-
npm init message-kit
|
20
|
+
npm init message-kit
|
21
21
|
```
|
package/index.js
CHANGED
@@ -83,7 +83,7 @@ async function addPackagejson(destDir, name, pkgManager) {
|
|
83
83
|
};
|
84
84
|
|
85
85
|
if (pkgManager.startsWith("yarn")) {
|
86
|
-
packageTemplate.packageManager = `${pkgManager}
|
86
|
+
packageTemplate.packageManager = `${pkgManager}`;
|
87
87
|
// Add .yarnrc.yml to disable PnP mode
|
88
88
|
fs.writeFileSync(
|
89
89
|
resolve(destDir, ".yarnrc.yml"),
|
@@ -203,15 +203,17 @@ yarn-error.log*
|
|
203
203
|
async function detectPackageManager() {
|
204
204
|
try {
|
205
205
|
const pkgManager = await detect();
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
206
|
+
const userAgent = process.env.npm_config_user_agent;
|
207
|
+
let version = "";
|
208
|
+
|
209
|
+
if (userAgent && pkgManager === "yarn") {
|
210
|
+
const parts = userAgent.split(" ")[0]?.split("/");
|
211
|
+
if (parts && parts.length > 1) {
|
212
|
+
version = `@${parts[1]}`;
|
213
|
+
}
|
213
214
|
}
|
214
|
-
|
215
|
+
|
216
|
+
return pkgManager + version;
|
215
217
|
} catch (error) {
|
216
218
|
// Fallback to npm if detection fails
|
217
219
|
return "npm";
|