Skip to content

Commit 60cc9a2

Browse files
committed
fix(create-cli): add bin entry point wrapper
1 parent 9a288ee commit 60cc9a2

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

packages/create-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/create-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@code-pushup/create-cli",
33
"version": "0.119.0",
44
"license": "MIT",
5-
"bin": "index.js",
5+
"bin": "./bin/index.js",
66
"homepage": "https://github.com/code-pushup/cli/tree/main/packages/create-cli#readme",
77
"bugs": {
88
"url": "https://github.com/code-pushup/cli/issues?q=is%3Aissue%20state%3Aopen%20type%3ABug%20label%3A\"🧩%20create-cli\""

packages/create-cli/project.json

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

1014
"unit-test": {},

0 commit comments

Comments
 (0)