Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions understand-anything-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"packageManager": "pnpm@10.6.2+sha512.47870716bea1572b53df34ad8647b42962bc790ce2bf4562ba0f643237d7302a3d6a8ecef9e4bdfc01d23af1969aa90485d4cebb0b9638fa5ef1daef656f6c1b",
"scripts": {
"build": "tsc",
"test": "node -e \"console.log('skill tests live at <repo-root>/tests/skill — run via root \\`pnpm test\\`')\""
Expand Down
6 changes: 5 additions & 1 deletion understand-anything-plugin/skills/understand/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,14 @@ Determine whether to run a full analysis or incremental update.
fi

if [ ! -f "$PLUGIN_ROOT/packages/core/dist/index.js" ]; then
cd "$PLUGIN_ROOT" && (pnpm install --frozen-lockfile 2>/dev/null || pnpm install) && pnpm --filter @understand-anything/core build
(cd "$PLUGIN_ROOT" && COREPACK_ENABLE_PROJECT_SPEC=0 pnpm install --frozen-lockfile 2>/dev/null \
|| (cd "$PLUGIN_ROOT" && COREPACK_ENABLE_PROJECT_SPEC=0 pnpm install)) \
&& (cd "$PLUGIN_ROOT" && COREPACK_ENABLE_PROJECT_SPEC=0 pnpm --filter @understand-anything/core build)
fi
```

**Why the subshell + `COREPACK_ENABLE_PROJECT_SPEC=0`?** When `/understand` runs from a host project whose `package.json` pins `"packageManager": "yarn@x"` or `"npm@x"`, corepack reads the **shell CWD's** `packageManager` field (not the `-C` / `--dir` target) and refuses to launch pnpm — failing the build with errors like `This project is configured to use yarn`. The fix is two-pronged: (1) `cd "$PLUGIN_ROOT"` inside a subshell so corepack's CWD-based lookup hits the plugin's own `packageManager` pin (`pnpm@…`); (2) `COREPACK_ENABLE_PROJECT_SPEC=0` to disable corepack's project-spec enforcement entirely as a belt-and-suspenders backstop in case the plugin's `packageManager` field is missing or stripped (e.g., during installation). Do **not** simplify this to `pnpm -C "$PLUGIN_ROOT" install` — `pnpm -C` does not change the CWD that corepack inspects, so the host pin still wins and the build still fails. See issue #315.

If `pnpm` is missing, report to the user: "Install Node.js ≥ 22 and pnpm ≥ 10, then re-run `/understand`."

2. Get the current git commit hash:
Expand Down
Loading