Skip to content

Configure website Yarn node_modules linker#847

Open
maxliebscher wants to merge 2 commits into
ScrollPrize:mainfrom
maxliebscher:codex-website-yarn-node-linker
Open

Configure website Yarn node_modules linker#847
maxliebscher wants to merge 2 commits into
ScrollPrize:mainfrom
maxliebscher:codex-website-yarn-node-linker

Conversation

@maxliebscher

@maxliebscher maxliebscher commented Apr 29, 2026

Copy link
Copy Markdown

Summary

Configure the ScrollPrize website workspace to use Yarn's node-modules linker and ignore the Yarn state files generated by that install mode.

Why

The repo pins Yarn 4.6.0 via packageManager, but in a clean local WSL2 install without a .yarnrc.yml, Yarn 4 used Plug'n'Play. In that local setup, the Docusaurus production build failed while resolving several peer/transitive imports used by the current dependency tree, including @docusaurus/plugin-content-docs, katex/dist/katex.min.css, and vscode-languageserver-types.

With nodeLinker: node-modules, the same lockfile installs and the Docusaurus production build completes. The PR also ignores generated Yarn state such as .yarn/install-state.gz, unplugged packages, and .pnp.*, while preserving the usual Yarn project directories if they are added later.

Validation

Ran in WSL2 Ubuntu 24.04 from scrollprize.org:

AGENTS_AGENT_MODE=1 AGENTS_ALLOW_INSTALL=1 yarn install --immutable
yarn build

Result:

[SUCCESS] Generated static files in "build".

Notes:

  • The install still reports the existing @types/react peer warning.
  • Browserslist still reports stale caniuse-lite data. This PR does not change dependency versions or the lockfile.

@vercel

vercel Bot commented Apr 29, 2026

Copy link
Copy Markdown

@maxliebscher is attempting to deploy a commit to the scroll Team on Vercel.

A member of the Team first needs to authorize it.

@maxliebscher

maxliebscher commented Apr 29, 2026

Copy link
Copy Markdown
Author

Quick note on the Vercel check: this PR only changes the website Yarn configuration. I validated it locally in WSL2 with yarn install --immutable followed by yarn build, which completed with [SUCCESS] Generated static files in "build". The Vercel preview is blocked because this comes from a fork and needs team authorization.

@maxliebscher maxliebscher force-pushed the codex-website-yarn-node-linker branch from c6d23ae to 62f1fca Compare May 7, 2026 07:14
@vercel

vercel Bot commented May 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
scrollprize-org Ready Ready Preview, Comment May 23, 2026 3:10pm

Request Review

@giorgioangel

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 62f1fca317

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -0,0 +1 @@
nodeLinker: node-modules

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 Badge Ignore Yarn node-modules state artifacts

With this linker, the documented yarn/yarn install workflow now writes Yarn state under .yarn/ (for example .yarn/install-state.gz and unplugged packages), but scrollprize.org/.gitignore only ignores node_modules and build outputs. In a clean checkout this leaves generated dependency artifacts untracked, and a routine git add . can accidentally stage thousands of files; add the corresponding .yarn/ ignores alongside this config change.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in cef84924 by adding Yarn generated-state ignores under scrollprize.org/.gitignore: .yarn/* with the standard Yarn project directories left unignored, plus .pnp.*.

@jrudolph

Copy link
Copy Markdown
Member

The repo pins Yarn 4.6.0 via packageManager, but without a .yarnrc.yml Yarn defaults to Plug'n'Play. In that mode the Docusaurus build fails resolving several peer/transitive imports used by the current dependency tree, including @docusaurus/plugin-content-docs, katex/dist/katex.min.css, and vscode-languageserver-types.

@maxliebscher was that happening for you? "The Docusaurus build fails" seems like a strong claim, is that something that started failing recently (since we are actively deploying the site regularly)?

maxliebscher commented May 21, 2026

Copy link
Copy Markdown
Author

@jrudolph yes, this was from my local clean-install check on 2026-04-29 in WSL2 Ubuntu 24.04. I agree the original wording was too broad, so I updated the PR description to scope it to that local setup.

What I saw was: without .yarnrc.yml, Yarn 4 used Plug'n'Play and the local yarn build failed resolving imports including @docusaurus/plugin-content-docs, katex/dist/katex.min.css, vscode-languageserver-types / related langium / vscode-jsonrpc imports, plus an image-size / PnP read issue. With the same lockfile and YARN_NODE_LINKER=node-modules, the install and production build completed.

I also reran the validation on the current PR head after the follow-up .gitignore commit:

AGENTS_AGENT_MODE=1 AGENTS_ALLOW_INSTALL=1 yarn install --immutable
yarn build

Result: [SUCCESS] Generated static files in "build". If the latest Vercel status is waiting on fork authorization again, that is separate from the local build result; this PR is mainly making the local Yarn behavior explicit and repeatable.

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.

3 participants