Skip to content

fix(cli): honor workspace package manager during init - #2176

Open
yinbowen-dc wants to merge 1 commit into
graphprotocol:mainfrom
yinbowen-dc:codex/fix-2004-workspace-package-manager
Open

yinbowen-dc wants to merge 1 commit into
graphprotocol:mainfrom
yinbowen-dc:codex/fix-2004-workspace-package-manager

Conversation

@yinbowen-dc

Copy link
Copy Markdown

graph init now respects a project or ancestor workspace's packageManager declaration instead of selecting any installed Yarn ahead of pnpm.

Fixes #2004

The selected manager is used consistently for install, codegen, deploy guidance, and the test-only link command. Explicitly configured Yarn/npm/pnpm must be available; without a recognized declaration, the existing Yarn-before-npm fallback remains, with pnpm also usable on its own. Command strings only use known manager names, never the raw manifest value. Includes a patch changeset.

Validation:

  • 9 focused tests passed using real temporary workspace manifests, including nested packages, npm/Yarn declarations, a missing declared executable, fallback behavior, and pnpm-only installations. The extracted original selection failed 5 of the first 8 cases.
  • pnpm --filter @graphprotocol/graph-cli build passed, including TypeScript, oclif manifest/readme, and GraphQL copies.
  • Scoped ESLint, Prettier, and git diff --check passed.

The focused suite uses an ignored local Vitest config to avoid the unrelated global CLI linking setup. The network-dependent scaffold/install integration suite was not run.

Prepared with Codex AI assistance; no human review is claimed.

@changeset-bot

changeset-bot Bot commented Nov 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8665921

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@graphprotocol/graph-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

yarn install fails in graph init in pnpm workspace

1 participant