Repository navigation
docs(graphql-codegen-client-preset): document monorepo artifactDirectory with Turbopack - #694
Conversation
…ory with Turbopack In a monorepo, Turbopack passes its root directory (by default, the directory that contains the lockfile) to SWC as the `cwd`. The plugin resolves a relative `artifactDirectory` from that `cwd`, so the README's Next.js example (`./src/gql`) points to the workspace root instead of the Next.js app directory, and the build fails with "Module not found". Add a note after the Next.js example that tells users to write `artifactDirectory` as a path from the workspace root in this case, and show an example. Closes #693 Co-authored-by: Jakub Kopřiva <6573164+koprivajakub@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
In a monorepo (for example, Turborepo with pnpm or Yarn workspaces), the Next.js app is often in a subdirectory of the workspace root. Turbopack passes its root directory to SWC as the
cwd. By default, this is the directory that contains the lockfile. The plugin resolves a relativeartifactDirectoryfrom thatcwd. Thus the value./src/gqlfrom the README's Next.js example points to<workspace-root>/src/gql, and the build fails with:This PR adds a note after the Next.js example in
contrib/graphql-codegen-client-preset/README.tmpl.md. The note tells users to writeartifactDirectoryas a path from the workspace root when the app is below the Turbopack root. It also shows an example configuration. The note says that this does not apply to webpack builds, or whenturbopack.rootis the app directory. The text comes from the proposal in the issue.Only the template changes.
scripts/bump-npm.shgeneratesREADME.mdfrom the template at the next release.Local validation:
git diff --checkpassed. No other local validation was performed.Closes #693