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:
committed by
GitHub
parent
332bfbd965
commit
9a83d09ffd
@@ -90,11 +90,10 @@ cd frontend
|
||||
pnpm build
|
||||
```
|
||||
|
||||
### Build from source
|
||||
### Build from source (macOS)
|
||||
|
||||
1. Run `build-npm-package.sh`
|
||||
2. In the `npx-cli` folder run `npm pack`
|
||||
3. You can run your build with `npx [GENERATED FILE].tgz`
|
||||
1. Run `./local-build.sh`
|
||||
2. Test with `cd npx-cli && node bin/cli.js`
|
||||
|
||||
|
||||
### Environment Variables
|
||||
|
||||
Reference in New Issue
Block a user