-
Notifications
You must be signed in to change notification settings - Fork 11
Migrate to pnpm
for package management
#461
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
Conversation
🦋 Changeset detectedLatest commit: 8e886f9 The changes in this PR will be included in the next version bump. This PR includes no changesetsWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types 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 |
- name: Setup pnpm | ||
uses: pnpm/action-setup@v4 | ||
|
||
- name: Setup node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'pnpm' | ||
registry-url: 'https://registry.npmjs.org' |
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.
Could we maybe extract this to one of our custom actions (e.g. setup-pnpm
) given it's used in a few places?
See the ./.github/actions/setup-antlr4
for inspiration
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.
Also that way we'd just need to tweak the node version in one centralized place
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.
yes for sure!
"lodash.debounce": "^4.0.8", | ||
"neo4j-driver": "^5.3.0", | ||
"neo4j-driver": "catalog:", |
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.
What does this mean?
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 is so that we only set the version number in one place (in the pnpm-workspaces.yaml) file, there's some more info in the docs/ pr description
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.
LGTM!
Only comment is probably we want a clean script similar to the one in the upx repo to clean up everything including dependencies, because at some point I had a sticky error compiling which did not solve until I nuked down all of the node_modules
folders.
│ tests/generated/WhiteboxParser.ts(841,15): error TS2339: Property 'getToken' does not exist on type 'Test3Context'.
│ tests/generated/WhiteboxParser.ts(844,15): error TS2339: Property 'getToken' does not exist on type 'Test3Context'.
│ tests/generated/WhiteboxParser.ts(847,19): error TS2339: Property 'getTokens' does not exist on type 'Test3Context'.
│ tests/generated/WhiteboxParser.ts(850,15): error TS2339: Property 'getToken' does not exist on type 'Test3Context'.
│ tests/generated/WhiteboxParser.ts(861,11): error TS2339: Property 'parser' does not exist on type 'Rule13Context'.
│ tests/generated/WhiteboxParser.ts(864,19): error TS2339: Property 'getTokens' does not exist on type 'Rule13Context'.
│ tests/generated/WhiteboxParser.ts(867,15): error TS2339: Property 'getToken' does not exist on type 'Rule13Context'.
│ tests/generated/WhiteboxParser.ts(870,19): error TS2339: Property 'getTokens' does not exist on type 'Rule13Context'.
│ tests/generated/WhiteboxParser.ts(873,15): error TS2339: Property 'getToken' does not exist on type 'Rule13Context'.
│ ELIFECYCLE Command failed with exit code 2.
└─ Failed in 4.1s at /Users/ncordon/neo4j/cypher-language-support/vendor/antlr4-c3
/Users/ncordon/neo4j/cypher-language-support/vendor/antlr4-c3:
ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL [email protected] build: `pnpm generate && pnpm build-esm && pnpm build-commonjs`
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.
@OskarDamkjaer just realized pnpm publish
does not seem to be distributing things correctly so we need to fix that before merging
95bf87c
to
8a72d8a
Compare
ba487e2
to
f0bb21d
Compare
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.
Umm, there's still a few rough edges I think:
All of the packages seem to have the wrong version for the canary releases: 0.0.0?!

I'd suggest reverting to the release-canary.js
script if we cannot make it work with changeset.
Apart from that I can see the react-codemirror distributed package has fewer files? Are you sure that works? I'm trying to see whether that would work in the upx repo but I find it strange:
How did you check this? When I looked at what was published in verdaccio, those files were present. I only tried out if it'd install / import properly of the language-support package though. Tried running the react editor in a new toy project and it's struggling a little bit with the worker but the rest works. I'll look into it |
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.
I imported this from upx and it was working and it looked differently the second time I downloaded it, so I'm happy to leave it as is 🚀
Moving to PNPM has a number of benefits over npm:
react
installed byreact-codemirror
)run
every time, just plainpnpm build
works)npm
turbo
anymore to make sure packages get build in the right order. We can use--filter
to build a given package and it's dependencies and--recursive
to run the whole project.incremental: true
I had problems getting our old
Benchmark.js
benchmarks to work properly, it's unmaintained and it seems to do some very odd import / exports. I found however that benchmarking is built in tovitest
! So I got rid of that dependency all together 👍For publishing, I've renamed the

schema-poller
package to a more generic name. I've also set up antrl4-c3 to be bundled without being part of the depencency list in package json. Here's how a new published version looks on verdaccio: