create-message-kit 1.1.7-beta.31 → 1.1.7-beta.32
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/README.md +3 -3
- package/index.js +10 -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
@@ -203,16 +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
|
-
|
213
|
-
|
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
|
+
}
|
214
214
|
}
|
215
|
-
|
215
|
+
|
216
|
+
return pkgManager + version;
|
216
217
|
} catch (error) {
|
217
218
|
// Fallback to npm if detection fails
|
218
219
|
return "npm";
|