-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
feat(infra): adopt pnpm
#7662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(infra): adopt pnpm
#7662
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
running full ci just for fun |
FWIW because this changes the gh workflow run lint-and-tests.yml --ref pnpm Before merging, just remove the trigger. |
Locally with npm: > cd apps/site
> npm install --omit=dev --include-workspace-root
> npm run dev Runs fine |
|
Ugh! What more does Vercel want from us?! I'm going to try to |
Yep, Vercel is definetely going to throw a temper tantrum. I think we need to suck it up and enable pnpm on it right before merge. |
can we add devEngines as a fast-follow? |
I've just had a look, and I didn't see a link/explanation to get the right version of pnpm. |
It's more than that to satisfy Vercel. IIUC, Vercel does the following (among other things): cd apps/site
npm i
npx turbo build You'll see that the steps will fail for various reasons. After doing some (failed) testing, IMHO It's easier to switch Vercel to pnpm, at the risk of a few broken PRs, than to rework this PR to satisfy npm.
What do you mean? The version of pnpm we use is 10.x.
@bmuenzenmeyer I don't understand what this task is? It's really the only thing left to complete (besides Vercel deployments). |
I want to explore what the experience is when someone casually tries to use |
IMO we should prioritize the vote rather than the request. On that note, since everything is working (well, except Vercel), I've marked this Ready for Review. |
@@ -1 +1 @@ | |||
v22 | |||
v22.13.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not just use v22
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have a bunch of @/
shorthand imports been changed to relative imports?
"cross-env": "7.0.3", | ||
"@types/node": "22.14.0", | ||
"@types/react": "^19.1.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be alphabetical?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should
"vfile-matter": "~5.0.1" | ||
"vfile-matter": "~5.0.1", | ||
"cross-env": "7.0.3", | ||
"@types/node": "22.14.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't match the minor version in .nvmrc
(afaik @types/node
should match on major/minor, but patch does not match)
"@types/node": "22.14.0", | ||
"@types/react": "^19.1.0", | ||
"@types/react-dom": "^19.1.1", | ||
"cross-env": "7.0.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this pinned to an exact version, and present here as well as in the site's dependencies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's present b/c we use it in the scripts
section of the package.json
. In pnpm (IIUC), you need to declare dependencies in each package.json
that they are used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay, that's news to me if that's the case -- can we double-check it is? If it is, can we have it reference the parent package's version for it?
And, I'm not sure that was an answer to why it is pinned to a specific version?
"eslint-plugin-react": "~7.37.4", | ||
"eslint-plugin-storybook": "~0.12.0", | ||
"global-jsdom": "^26.0.0", | ||
"postcss-loader": "~8.1.1", | ||
"react": "19.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirming if this is intentionally pinned, when the types for it aren't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use peer dependencies for these cases.
Check out other applications (https://github.com/dubinc/dub/blob/93c76aaf304a10fcf914c1c4dc344f6011e2bc6b/packages/ui/package.json#L35)
On my |
I mean, SGTM, we can always change it if needed. |
import useClientContext from '@/hooks/react-client/useClientContext'; | ||
import { MatterContext } from '@/providers/matterProvider'; | ||
import useClientContext from '../useClientContext'; | ||
import { MatterContext } from '../../../providers/matterProvider'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can’t "@/" be used anymore? pnpm should not affect the path aliases.
onlyBuiltDependencies: | ||
- '@swc/core' | ||
- '@vercel/speed-insights' | ||
- esbuild | ||
- sharp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A comment on why it's necessary would be great.
"@opentelemetry/api-logs": "~0.200.0", | ||
"@opentelemetry/instrumentation": "~0.200.0", | ||
"@opentelemetry/resources": "~1.30.1", | ||
"@opentelemetry/sdk-logs": "~0.200.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have to add all those new dependencies?
Co-authored-by: Matt Cowley <me@mattcowley.co.uk> Signed-off-by: Aviv Keller <me@aviv.sh>
|
Is that from Vercel? That makes sense, the install/build commands for the entire project will need to be changed IIRC. So, I imagine we'll want to flip them for a second to pnpm, deploy this branch, and then flip them back to npm to allow main and other PRs to work. |
Ah, looks like we can add |
next.config.js
,next-intl
, i18n work — commitpnpm build
— import errors resolved, packages cleaned uppnpm build
when installed with--prod
pnpm dev
pnpm dev
when installed with--prod
pnpm test
- subpath import work neededpnpm test:ci
pnpm lint
pnpm lint:fix
pnpm prettier
pnpm prettier:fix
pnpm format
pnpm storybook
pnpm storybook:build
pnpm check-types
pnpm scripts:release-post
npm use casesTasks from Vote
pnpm
to README and docspackage-lock.json
to.gitignore
pnpm
in CIpnpm-lock.yaml
in CIdevEngines
andpackageManager
topackage.json