Skip to content

v0.0.2

Choose a tag to compare

@github-actions github-actions released this 25 Jun 23:29
613d682
Fix broken npm install + release v0.0.2 (#14)

## Problem

`npm install -g @kdrrr/overcast@0.0.1` **fails for everyone**:

```
npm error Error: Cannot find module '.../@kdrrr/overcast/scripts/brand-pi.mjs'
npm error code: 'MODULE_NOT_FOUND'
```

The `postinstall` runs `node scripts/brand-pi.mjs`, but `scripts/` was
never in
the `files` whitelist, so the script isn't in the published tarball →
the
postinstall errors and npm rolls the whole install back. The dev `npm
link`
masked this because the working tree has `scripts/` on disk.

## Fixes

**1. Ship the script** — add `scripts/brand-pi.mjs` to `files` (just
that one
file; the dev-only `bun-sidecar.mjs` / `sync-version.mjs` stay
unpublished).

**2. Make the rebrand actually work, and never block install** — the
postinstall
was *also* silently no-op'ing on normal installs:

- The resolver called
`require.resolve("@earendil-works/pi-coding-agent/package.json")`,
which throws `ERR_PACKAGE_PATH_NOT_EXPORTED` (pi's `exports` map only
exposes
`"."`). It fell back to a single *nested* path, so it found nothing
whenever pi
is **hoisted**. Replaced with a raw-fs walk up the `node_modules` chain
(immune
to `exports`) covering nested + hoisted layouts, plus a resolve-based
fallback
  for symlinked (pnpm) stores.
- Wrapped `main()` so a cosmetic branding failure (e.g. read-only global
  `node_modules`) warns and exits 0 instead of aborting the install.

## Release

This PR also **cuts `v0.0.2`** (the patch that ships the fix) by folding
the
version bump into the same PR — `npm version 0.0.2
--no-git-tag-version`, which
syncs every surface (`package.json`, `package-lock.json`,
`src/version.ts`, both
`.claude-plugin/*.json`). After merge, push the `v0.0.2` tag to trigger
`release.yml`. `RELEASING.md` documents this fold-into-PR pattern.

## Verification

Packed the tarball and ran a clean `npm install` (scripts **enabled**)
into a
fresh dir:

- install exits `0` (previously aborted)
- `scripts/brand-pi.mjs` is present in the tarball
- the **hoisted** pi gets `piConfig.name="overcast"` (previously stayed
unbranded)
- `npm run typecheck` clean; `npm test` → 150/150 pass; `sync-version
--check` clean

---------

Co-authored-by: KDR <kdr@KDRs-MacBook-Pro.local>