From 17a0669c4b4f00f952eb410defa9db8971777187 Mon Sep 17 00:00:00 2001 From: Nicolas Beaussart Date: Wed, 10 Dec 2025 21:31:01 +0100 Subject: [PATCH 1/2] fix: make code-pushup bin +x stable --- packages/cli/bin/index.js | 2 ++ packages/cli/package.json | 2 +- packages/cli/project.json | 6 +++++- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100755 packages/cli/bin/index.js diff --git a/packages/cli/bin/index.js b/packages/cli/bin/index.js new file mode 100755 index 000000000..db1da1b7f --- /dev/null +++ b/packages/cli/bin/index.js @@ -0,0 +1,2 @@ +#! /usr/bin/env node +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": {}, From a586dcd3db258d35f0a40c8a8ce6f18cb4f8903b Mon Sep 17 00:00:00 2001 From: Nicolas Beaussart Date: Wed, 10 Dec 2025 21:45:24 +0100 Subject: [PATCH 2/2] chore: add comment --- packages/cli/bin/index.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/cli/bin/index.js b/packages/cli/bin/index.js index db1da1b7f..59c545050 100755 --- a/packages/cli/bin/index.js +++ b/packages/cli/bin/index.js @@ -1,2 +1,11 @@ -#! /usr/bin/env node +#!/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';