Skip to content

Commit 8a2b490

Browse files
authored
[ CLI ] Rename CLI binaries in @php-wasm/cli and @wp-playground/cli (#2441)
## Motivation for the change, related issues Currently, when NPM installs `@php-wasm/cli`, it creates a binary named `cli` in the `node_modules/.bin`. However, if there is an already existing `cli` binary in the `node_modules/.bin` directory, the action is ignored. That is what is happening when trying to install both `@php-wasm/cli` and `@wp-playground/cli` in the same project. This pull request aims to rename these generic binaries into : - `cli` > `php-wasm-cli` - `cli` > `wp-playground-cli` ## Implementation details `@php-wasm/cli/package.json` ```diff - "bin": "php-wasm.js" + "bin": { + "php-wasm-cli": "php-wasm.js" + }, ``` `@wp-playground-cli/package.json` ```diff - "bin": "wp-playground.js" + "bin": { + "wp-playground-cli": "wp-playground.js" + }, ``` ## Testing Instructions (or ideally a Blueprint) Run `npm install` in a empty directory : ``` npm install @php-wasm/cli @wp-playground/cli ``` ### Before ``` > ls -1A node_modules/.bin cli crc32 mime semver sha.js xdebug-bridge ``` ### After ``` > ls -1A node_modules/.bin crc32 mime php-wasm-cli semver sha.js wp-playground-cli xdebug-bridge ```
1 parent 3e97dc6 commit 8a2b490

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/php-wasm/cli/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
"license": "GPL-2.0-or-later",
2323
"type": "module",
2424
"main": "main.js",
25-
"bin": "php-wasm.js",
25+
"bin": {
26+
"php-wasm-cli": "php-wasm.js"
27+
},
2628
"gitHead": "2f8d8f3cea548fbd75111e8659a92f601cddc593"
2729
}

packages/playground/cli/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
"main": "./index.cjs",
3232
"module": "./index.js",
3333
"types": "index.d.ts",
34-
"bin": "wp-playground.js",
34+
"bin": {
35+
"wp-playground-cli": "wp-playground.js"
36+
},
3537
"gitHead": "2f8d8f3cea548fbd75111e8659a92f601cddc593"
3638
}

0 commit comments

Comments
 (0)