Skip to content

Commit 0b0d17a

Browse files
authored
fix: ensure CLI bin directory is included in published package with executable permissions (#1183)
1 parent a86654b commit 0b0d17a

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

packages/cli/bin/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env node
2+
3+
/**
4+
* This file serves as the CLI entry point.
5+
*
6+
* We use a separate bin file (instead of pointing directly to src/index.js)
7+
* because TypeScript build processes don't preserve file permissions.
8+
* By tracking this file in git with executable permissions (+x), we ensure
9+
* the CLI remains executable after npm publish without needing post-install scripts.
10+
*/
11+
import '../src/index.js';

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
},
4040
"type": "module",
4141
"bin": {
42-
"code-pushup": "./src/index.js"
42+
"code-pushup": "./bin/index.js"
4343
},
4444
"engines": {
4545
"node": ">=20"

packages/cli/project.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
"sourceRoot": "packages/cli/src",
55
"projectType": "library",
66
"targets": {
7-
"build": {},
7+
"build": {
8+
"options": {
9+
"assets": ["{projectRoot}/*.md", "{projectRoot}/bin/*"]
10+
}
11+
},
812
"lint": {},
913
"unit-test": {},
1014
"int-test": {},

0 commit comments

Comments
 (0)