Fix local build for macOS e2e testing (Vibe Kanban) (#1679)

* Done! Here's a summary of the changes:

## Changes Made

### `npx-cli/bin/download.js`
- Added `LOCAL_DEV_MODE` detection - automatically enabled when R2 placeholders aren't replaced or `VIBE_KANBAN_LOCAL=1` env var is set
- Modified `ensureBinary()` to use local binaries from `npx-cli/dist/{platform}/` in local dev mode
- Exported `LOCAL_DEV_MODE` and `LOCAL_DIST_DIR` for use by `cli.js`

### `npx-cli/bin/cli.js`
- In local dev mode, extracts binaries directly to `npx-cli/dist/{platform}/` instead of global cache
- Skips version update check in local dev mode
- Shows "(local dev)" label in startup message when running locally

### `local-build.sh`
- Added instructions at the end showing how to run the local build

## How to test
```bash
cd vibe-kanban
./local-build.sh
cd npx-cli && node bin/cli.js
```

* Updated the README to reflect the correct local build instructions.

* Fixed. Now `LOCAL_DEV_MODE` only activates when the `dist/` directory actually exists, which means:

1. **Local dev** (after `./local-build.sh` creates `npx-cli/dist/`): local mode works
2. **npx** (npm cache has no `dist/` folder): normal R2 download works

* Done! The fixes are:

1. **`npx-cli/package.json`**: Added `dist` to the `files` array so local binaries get included in the tarball
2. **`npx-cli/bin/cli.js`**: Added a guard to skip `getLatestVersion()` when R2 URL is a placeholder (starts with `__`)

Now the workflow should work:
```bash
cd vibe-kanban
./local-build.sh
cd npx-cli
npm pack
npx vibe-kanban-0.0.142.tgz
```
This commit is contained in:
Louis Knight-Webb
2025-12-29 18:00:23 +00:00
committed by GitHub
parent 332bfbd965
commit 9a83d09ffd
5 changed files with 37 additions and 12 deletions

View File

@@ -14,6 +14,7 @@
"adm-zip": "^0.5.16"
},
"files": [
"bin"
"bin",
"dist"
]
}