Skip to content

test: check the toolkit install ignores the caller's pnpm config - #23

Merged
chhoumann merged 1 commit into
mainfrom
test/toolkit-install-isolation
Oct 24, 2026
Merged

chhoumann merged 1 commit into
mainfrom
test/toolkit-install-isolation

Conversation

@chhoumann

Copy link
Copy Markdown
Owner

The release workflows install the toolkit with pnpm --dir .release-toolkit install from inside the caller's checkout. quickadd and MetaEdit have now merged a pnpm-workspace.yaml, and notetweet_obsidian #77 adds one. On ebcf84b (today's v4), that breaks the toolkit install in two ways:

Caller config On ebcf84b On main (33a397a)
quickadd (pnpm 11.28.7, workspace file + lockfile) Installs quickadd's 155 packages and none of the toolkit's. Exit 0. Toolkit's pnpm 10.34.7, toolkit deps installed
MetaEdit (pnpm 12.14.0, minimumReleaseAge, trustPolicy) Runs under the caller's pnpm 12.14.0 Same
notetweet #77 (pnpm 12.14.0, minimumReleaseAge) Runs under the caller's pnpm 12.14.0 Same

main already fixes both cases. The toolkit's own pnpm-workspace.yaml from #22 makes the toolkit its own workspace root. I checked that the caller's pnpm-workspace.yaml and .npmrc settings no longer reach the toolkit install, using a nodeLinker: hoisted canary in each:

  • The same setting placed inside the toolkit directory does hoist.
  • The caller's own install does read its config (its .npmrc and workspace file).

--ignore-workspace is not a safe alternative. It also drops the toolkit's own autoInstallPeers: false, so the frozen install fails with ERR_PNPM_LOCKFILE_CONFIG_MISMATCH.

This PR changes no workflow behavior. It adds a Self test step that builds a hostile caller and runs the exact toolkit install command:

  • The caller pins pnpm 12, sets a hoisted linker in both pnpm-workspace.yaml and .npmrc, and sets an impossible minimumReleaseAge.
  • The step asserts the toolkit's pnpm ran, the toolkit's deps are installed, and nothing was hoisted.

Run locally, the step passes on main. It fails on ebcf84b (wrong pnpm version) and on main with pnpm-workspace.yaml deleted (lockfile config mismatch).

The release workflows run `pnpm --dir .release-toolkit install` from inside
the caller's checkout. On ebcf84b a caller pnpm-workspace.yaml made that
install run the caller's pnpm (12.14.0 for MetaEdit and notetweet) under
its policy, or install the caller's packages instead of the toolkit's (exit
0, for quickadd). The toolkit's own pnpm-workspace.yaml fixed that in #22,
but nothing would catch its removal.

Self test now installs the toolkit inside a caller pinned to pnpm 12 with a
hoisted node linker in both pnpm-workspace.yaml and .npmrc and an impossible
minimumReleaseAge, then asserts the toolkit's pnpm ran, the toolkit's deps
are installed and nothing was hoisted. It passes on main and fails on
ebcf84b and on main without pnpm-workspace.yaml.
@chhoumann
chhoumann merged commit 149e378 into main Oct 24, 2026
3 checks passed
@chhoumann
chhoumann deleted the test/toolkit-install-isolation branch October 24, 2026 12:40
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.

1 participant