x-package-manager 1.0.1 → 1.1.0
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 +4 -3
- package/bin/xpm.sh +4 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# xpm
|
|
2
2
|
|
|
3
|
-
Cross-package-manager executor - automatically detects and runs the right package manager (npm, yarn, or
|
|
3
|
+
Cross-package-manager executor - automatically detects and runs the right package manager (npm, yarn, pnpm, or bun) based on your project's lock files.
|
|
4
4
|
|
|
5
5
|
## Why?
|
|
6
6
|
|
|
@@ -24,7 +24,7 @@ mv xpm /usr/local/bin/
|
|
|
24
24
|
|
|
25
25
|
## Usage
|
|
26
26
|
|
|
27
|
-
Use `xpm` exactly as you would use npm, yarn, or
|
|
27
|
+
Use `xpm` exactly as you would use npm, yarn, pnpm, or bun:
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
30
|
# Install dependencies
|
|
@@ -45,6 +45,7 @@ xpm --version
|
|
|
45
45
|
|
|
46
46
|
`xpm` walks up the directory tree from your current location looking for lock files:
|
|
47
47
|
|
|
48
|
+
- `bun.lockb` → uses **bun**
|
|
48
49
|
- `pnpm-lock.yaml` → uses **pnpm**
|
|
49
50
|
- `yarn.lock` → uses **yarn**
|
|
50
51
|
- `package-lock.json` → uses **npm**
|
|
@@ -54,7 +55,7 @@ If no lock file is found, it defaults to **npm**.
|
|
|
54
55
|
## Requirements
|
|
55
56
|
|
|
56
57
|
- Bash (included on macOS and Linux)
|
|
57
|
-
- At least one of: npm, yarn, or
|
|
58
|
+
- At least one of: npm, yarn, pnpm, or bun installed
|
|
58
59
|
|
|
59
60
|
## License
|
|
60
61
|
|
package/bin/xpm.sh
CHANGED
|
@@ -7,7 +7,10 @@ detect_package_manager() {
|
|
|
7
7
|
|
|
8
8
|
# Walk up the directory tree looking for lock files
|
|
9
9
|
while [[ "$dir" != "/" ]]; do
|
|
10
|
-
if [[ -f "$dir/
|
|
10
|
+
if [[ -f "$dir/bun.lockb" ]]; then
|
|
11
|
+
echo "bun"
|
|
12
|
+
return
|
|
13
|
+
elif [[ -f "$dir/pnpm-lock.yaml" ]]; then
|
|
11
14
|
echo "pnpm"
|
|
12
15
|
return
|
|
13
16
|
elif [[ -f "$dir/yarn.lock" ]]; then
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x-package-manager",
|
|
3
|
-
"version": "1.0
|
|
4
|
-
"description": "Cross-package-manager executor - automatically detects and runs npm, yarn, or
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Cross-package-manager executor - automatically detects and runs npm, yarn, pnpm, or bun based on your project",
|
|
5
5
|
"bin": {
|
|
6
|
-
"xpm": "
|
|
6
|
+
"xpm": "bin/xpm.sh"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
9
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"npm",
|
|
14
14
|
"yarn",
|
|
15
15
|
"pnpm",
|
|
16
|
+
"bun",
|
|
16
17
|
"executor",
|
|
17
18
|
"wrapper"
|
|
18
19
|
],
|