@srcroot/ui 0.0.35 → 0.0.36
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 +5 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -147,18 +147,17 @@ export default config
|
|
|
147
147
|
import fs2 from "fs";
|
|
148
148
|
import path2 from "path";
|
|
149
149
|
function getPackageManager(cwd) {
|
|
150
|
+
const dir = cwd || process.cwd();
|
|
151
|
+
if (fs2.existsSync(path2.join(dir, "bun.lockb"))) return "bun";
|
|
152
|
+
if (fs2.existsSync(path2.join(dir, "pnpm-lock.yaml"))) return "pnpm";
|
|
153
|
+
if (fs2.existsSync(path2.join(dir, "yarn.lock"))) return "yarn";
|
|
154
|
+
if (fs2.existsSync(path2.join(dir, "package-lock.json"))) return "npm";
|
|
150
155
|
const userAgent = process.env.npm_config_user_agent;
|
|
151
156
|
if (userAgent) {
|
|
152
157
|
if (userAgent.startsWith("yarn")) return "yarn";
|
|
153
158
|
if (userAgent.startsWith("pnpm")) return "pnpm";
|
|
154
159
|
if (userAgent.startsWith("bun")) return "bun";
|
|
155
|
-
if (userAgent.startsWith("npm")) return "npm";
|
|
156
160
|
}
|
|
157
|
-
const dir = cwd || process.cwd();
|
|
158
|
-
if (fs2.existsSync(path2.join(dir, "bun.lockb"))) return "bun";
|
|
159
|
-
if (fs2.existsSync(path2.join(dir, "pnpm-lock.yaml"))) return "pnpm";
|
|
160
|
-
if (fs2.existsSync(path2.join(dir, "yarn.lock"))) return "yarn";
|
|
161
|
-
if (fs2.existsSync(path2.join(dir, "package-lock.json"))) return "npm";
|
|
162
161
|
return "npm";
|
|
163
162
|
}
|
|
164
163
|
|