Use pnpm v11#20094
Conversation
| "pnpm": { | ||
| "patchedDependencies": { | ||
| "@parcel/[email protected]": "patches/@[email protected]", | ||
| "[email protected]": "patches/[email protected]" | ||
| } | ||
| } |
There was a problem hiding this comment.
This is moved to the pnpm-workspace.yaml file
| '@parcel/watcher': true | ||
| bun: true | ||
| esbuild: true | ||
| sharp: false |
There was a problem hiding this comment.
Only used in the Next.js playground where we don't work with images so no need to allow the build for this.
| @@ -1 +0,0 @@ | |||
| node-linker=hoisted | |||
There was a problem hiding this comment.
This was hoisted to the pnpm-workspace.yaml file
| # TODO: Scope this just for the oxide-wasm32-wasi package | ||
| nodeLinker: hoisted | ||
| # packageConfigs: | ||
| # '@tailwindcss/oxide-wasm32-wasi': | ||
| # nodeLinker: hoisted |
There was a problem hiding this comment.
Ideally we scope nodeLinker just for the @tailwindcss/oxide-wasm32-wasi package, but that causes issues during pnpm install
The initial setup was done using pnpx codemod run pnpm-v10-to-v11, but turns out that's invalid.
| "prettier-plugin-organize-imports": "^4.3.0", | ||
| "tsup": "^8.5.1", | ||
| "turbo": "^2.9.6", | ||
| "turbo": "^2.9.14", |
There was a problem hiding this comment.
Necessary for pnpm v11 compatibility. See: https://github.com/vercel/turborepo/releases/tag/v2.9.7
We only needed to bump 1 patch version, but using the latest version to get other fixes.
The issue is sthat for `require` in exports, the file has to be in CommonJS syntax. But that only happens once we compile. We can try to modify the the .cts file directly to get it into a more CommonJS-style file. But I think it's safer to just rely on the build files. This is only necessary for our Next.js playground where we require CommonJS. Other spots that use `@tailwindcss/node` during tests will still use the src file in TypeScript / ESM format.
Because of the `nodeLinker: hoisted`, resolutions of dependencies start from the root where `tailwindcss` couldn't be found. I don't like this, I don't like the top-level `nodeLinker` setup. But going to see if we can get further with this setup in CI.
We do need the workspace for the overrides to work
Was introduced by `pnpm i` ✓ Lockfile passes supply-chain policies (561 entries in 6.1s) Lockfile is up to date, resolution step is skipped [ERR_PNPM_LOCKFILE_MISSING_DEPENDENCY] The lockfile is broken! Resolution step will be performed to fix it. [WARN] Issues with peer dependencies found. Run "pnpm peers check" to list them. Packages: +8 -194 ++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Progress: resolved 562, reused 201, downloaded 0, added 8, done packages/@tailwindcss-cli/node_modules/@parcel/watcher: Running install script, done in 24ms Done in 9.5s using pnpm v11.1.3
15e65a0 to
48aedf6
Compare
We changed this on `main` on purpose. Let's keep it this way.
This PR upgrades the repo to use pnpm v11
This also includes some cleanup to make sure all builds work. For example the Next.js playground uses
@tailwindcss/nodebut it requires CommonJS syntax. The.ctsfile is in ESM and is later converted to CommonJS during a build step. For that reason we changed theexportsfield to use thedist/files for CommonJS instead.This also cleans up the
pnpm-lock.yamlfile found in thewasm32-wasipackage. It also hoists thenodeLinkerto the rootpnpm-workspace.ymlfile as required by pnpm v11. That said, I noticed a weird bug withpnpm packthat it looks for a top-levelnodeLinkerbut not for a specific package. For that we use the nodeLinker flag during our pack command.Pnpm 11 (maybe even 10) moves a lot of information to the
pnpm-workspace.yamlfile. In our integration tests we often rely on thepnpm.overridesfield of thepackage.jsonfiles. So this PR also makes some changes there to make sure that we do move overrides to the yaml file.Test plan