diff --git a/packages/cli/bin/index.js b/packages/cli/bin/index.js new file mode 100755 index 000000000..59c545050 --- /dev/null +++ b/packages/cli/bin/index.js @@ -0,0 +1,11 @@ +#!/usr/bin/env node + +/** + * This file serves as the CLI entry point. + * + * We use a separate bin file (instead of pointing directly to src/index.js) + * because TypeScript build processes don't preserve file permissions. + * By tracking this file in git with executable permissions (+x), we ensure + * the CLI remains executable after npm publish without needing post-install scripts. + */ +import '../src/index.js'; diff --git a/packages/cli/package.json b/packages/cli/package.json index abff6f389..d8daee1cc 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -39,7 +39,7 @@ }, "type": "module", "bin": { - "code-pushup": "./src/index.js" + "code-pushup": "./bin/index.js" }, "engines": { "node": ">=20" diff --git a/packages/cli/project.json b/packages/cli/project.json index c92b12115..e96eb2e2e 100644 --- a/packages/cli/project.json +++ b/packages/cli/project.json @@ -4,7 +4,11 @@ "sourceRoot": "packages/cli/src", "projectType": "library", "targets": { - "build": {}, + "build": { + "options": { + "assets": ["{projectRoot}/*.md", "{projectRoot}/bin/*"] + } + }, "lint": {}, "unit-test": {}, "int-test": {},