Skip to content

fix(skill): bypass host packageManager pin in Phase 0 build (#315)#390

Open
tirth8205 wants to merge 1 commit into
Egonex-AI:mainfrom
tirth8205:fix/corepack-host-pin-bypass
Open

fix(skill): bypass host packageManager pin in Phase 0 build (#315)#390
tirth8205 wants to merge 1 commit into
Egonex-AI:mainfrom
tirth8205:fix/corepack-host-pin-bypass

Conversation

@tirth8205

Copy link
Copy Markdown
Contributor

Summary

Closes #315.

When /understand runs from a host project whose package.json pins "packageManager": "yarn@x" or "npm@x", corepack reads the shell CWD's pin (not pnpm's -C / --dir target) and refuses to launch pnpm — failing the Phase 0 plugin build before any analysis can begin.

  • SKILL.md Phase 0 — wrap each pnpm invocation in (cd "$PLUGIN_ROOT" && COREPACK_ENABLE_PROJECT_SPEC=0 pnpm …). The subshell cd makes corepack's CWD-based lookup hit the plugin's own packageManager pin; the env var disables corepack project-spec enforcement entirely as a backstop. Added a maintainer note inline so future cleanups don't strip the guards.
  • understand-anything-plugin/package.json — add the same "packageManager": "pnpm@10.6.2+sha512.…" value used by the root package.json, so corepack inside the plugin dir always picks pnpm (e.g., when running from the marketplace cache copy where the root package.json isn't a parent).
  • pnpm-lock.yaml — regenerate. The shipped lockfile was missing the graphology / graphology-communities-louvain importer entries (added in earlier PRs to the plugin's package.json) plus a stale vite pin in the dashboard workspace, so pnpm install --frozen-lockfile was already failing with ERR_PNPM_OUTDATED_LOCKFILE before the corepack issue could even surface — the issue's second papercut.

Test plan

  • pnpm install --frozen-lockfile from understand-anything-plugin/ succeeds (was failing before with ERR_PNPM_OUTDATED_LOCKFILE).
  • pnpm --filter @understand-anything/core build from understand-anything-plugin/ succeeds.
  • Manual repro: run /understand from a project whose package.json pins "packageManager": "yarn@4.x" and confirm Phase 0 build no longer fails with This project is configured to use yarn.

🤖 Generated with Claude Code

…I#315)

When `/understand` runs from a host project whose `package.json` pins
`"packageManager": "yarn@x"` or `"npm@x"`, corepack consults the shell
CWD's pin (not pnpm's `-C` / `--dir` target) and refuses to launch pnpm
— failing the Phase 0 plugin build before any analysis can begin.

Three changes:

1. SKILL.md Phase 0 — wrap each pnpm invocation in `(cd "$PLUGIN_ROOT"
   && COREPACK_ENABLE_PROJECT_SPEC=0 pnpm …)`. The subshell `cd` makes
   corepack's CWD-based lookup hit the plugin's own packageManager pin;
   the env var disables corepack project-spec enforcement entirely as a
   backstop. Add a maintainer note explaining why so future cleanups
   don't strip the guards.

2. understand-anything-plugin/package.json — add the same
   `packageManager: "pnpm@10.6.2+sha512.…"` value used by the root
   package.json, so corepack inside the plugin dir always picks pnpm
   even when launched standalone (e.g., from the marketplace cache copy).

3. pnpm-lock.yaml — regenerate. The shipped lockfile was missing the
   `graphology` and `graphology-communities-louvain` importers (plus a
   stale vite pin), causing `pnpm install --frozen-lockfile` to fail
   from the plugin dir with `ERR_PNPM_OUTDATED_LOCKFILE` before the
   corepack issue could even be reached.

Verified: `pnpm install --frozen-lockfile` and
`pnpm --filter @understand-anything/core build` both succeed from the
plugin dir after the changes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plugin build fails under corepack when /understand runs from a project that pins a different packageManager

1 participant