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.
Files changed (3) hide show
  1. package/README.md +3 -3
  2. package/index.js +11 -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
@@ -83,7 +83,7 @@ async function addPackagejson(destDir, name, pkgManager) {
83
83
  };
84
84
 
85
85
  if (pkgManager.startsWith("yarn")) {
86
- packageTemplate.packageManager = `${pkgManager}@${version}`;
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
- // 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
- console.log(process.env.npm_config_user_agent);
212
- return "yarn@4";
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
- return pkgManager;
215
+
216
+ return pkgManager + version;
215
217
  } catch (error) {
216
218
  // Fallback to npm if detection fails
217
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.30",
3
+ "version": "1.1.7-beta.32",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "index.js",