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.
Files changed (3) hide show
  1. package/README.md +3 -3
  2. package/index.js +10 -9
  3. 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@latest
12
+ npx create-message-kit
13
13
  ```
14
14
 
15
15
  ```bash
16
- yarn create message-kit@latest
16
+ yarn create message-kit
17
17
  ```
18
18
 
19
19
  ```bash [npm]
20
- npm init message-kit@latest
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
- // Still maintain the Yarn 4 check if needed
207
- if (
208
- pkgManager === "yarn" &&
209
- process.env.npm_config_user_agent?.includes("yarn/4")
210
- ) {
211
- //yarn/4.5.1 npm/? node/v20.15.0 darwin arm64
212
- const version = process.env.npm_config_user_agent?.split("/")[1];
213
- return `yarn@${version}`;
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
- return pkgManager;
215
+
216
+ return pkgManager + version;
216
217
  } catch (error) {
217
218
  // Fallback to npm if detection fails
218
219
  return "npm";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-message-kit",
3
- "version": "1.1.7-beta.31",
3
+ "version": "1.1.7-beta.32",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "index.js",