From 2239117f2660be095236be5ff8fe5763da53da3c Mon Sep 17 00:00:00 2001 From: Kazuki Yamada Date: Wed, 31 Dec 2025 18:30:44 +0900 Subject: [PATCH 1/2] feat(build): Add prepare script for GitHub-based npm install Enable building repomix when installed directly from GitHub repository. The prepare script runs `npm run build` which is triggered when: - Installing from GitHub (e.g., `npm install github:yamadashy/repomix#main`) - Running `npm install` locally for development This does not affect npm registry installs since the published tarball already includes the pre-built lib/ directory. --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index fbe614517..284896770 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ }, "bin": "./bin/repomix.cjs", "scripts": { + "prepare": "npm run build", "build": "rimraf lib && tsc -p tsconfig.build.json --sourceMap --declaration", "build-bun": "bun run build", "lint": "node --run lint-biome && node --run lint-oxlint && node --run lint-ts && node --run lint-secretlint", From 5e194e10b2a29bcde9d6c6072689b71347424bc7 Mon Sep 17 00:00:00 2001 From: Kazuki Yamada Date: Wed, 31 Dec 2025 18:34:08 +0900 Subject: [PATCH 2/2] fix(ci): Skip scripts when installing production dependencies Add --ignore-scripts to npm ci --omit=dev to prevent prepare script from running, which would fail due to missing devDependencies (rimraf). --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a01e34425..a55e00ae3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -227,7 +227,7 @@ jobs: # Run build directly instead of using npm scripts with node --run which is not supported in older Node versions - run: ./node_modules/.bin/rimraf lib && ./node_modules/.bin/tsc -p tsconfig.build.json --sourceMap --declaration - name: Install only production dependencies - run: npm ci --omit=dev + run: npm ci --omit=dev --ignore-scripts - run: node bin/repomix.cjs - run: node bin/repomix.cjs --version - run: node bin/repomix.cjs --help