-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat(nx): allow text lockfile for bun #29423
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
View your CI Pipeline Execution ↗ for commit 7e78976.
☁️ Nx Cloud last updated this comment at |
cc @Jordan-Hall |
e2e/utils/get-env-info.ts
Outdated
return existsSync(join(dir, 'bun.lockb')) | ||
? 'bun' | ||
: existsSync(join(dir, 'yarn.lock')) | ||
return existsSync(join(dir, 'yarn.lock')) | ||
? 'yarn' |
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.
made yarn the first lockfile just to make the bun/pnpm indentation identical for multiple lockfiles
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.
e bun/pnpm indentation identical for multiple lockfiles
Doesnt bun current support to yarn lock still, This is why bun came frist
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.
right, great point, will reverse
@ludicast This is a good start but personally I would change the interface. We need to keep bun lock first because bun still goes to yarn with additional parm. I think its best to include a parser and writer as part of this PR. I did some work on this in preparation a while ago. Feel free to take a look at interface changes It also a branch from #27820 to add bun pack @ludicast can you add pack support too. |
Added the PR back for pack as their no breaking change. #29426 I should of never pulled the PR tbf |
thanks for info - changed the ordering back
we could but was thinking for that as a follow-on. I believe the format is jsonc (which isn't compatible with json.parse in vanilla js) so might want to avoid dealing with that in this PR (though now thinking that nx does parse a similar style in schemas anyways). esp the part of writing that lockfile (since .lock is a few days old and might surprise folks).
thanks @Jordan-Hall - gave it a look update - guess I prob can use the json-c parser if installed then nx/packages/nx/src/utils/json.ts Line 1 in ba1641d
|
@Jordan-Hall - if by parser you mean writing something in the vein of https://github.com/nrwl/nx/blob/master/packages/nx/src/plugins/js/lock-file/yarn-parser.ts it def would need to be a follow-on (it's enough code to get caught up in PR purgatory) |
Yes i was because as you can see from the PR i did their loads of work needs to be done. I dont think just adding new vars is the right idea. If not can you at least do the grunt work without that section |
Current Behavior
Nx does not respect a
bun.lock
, which is the new lockfile for bun (currently available and to be the default in bun1.2
)The text-lockfile will allow dependabot to run, as well as prevent the merge conflicts caused with a binary lockfile.
Expected Behavior
Nx will respect a
bun.lock
Note that we are still defaulting to the
bun.lockb
style here for generators, this is just to allow repos containingbun.lock
. Afterbun.lock
becomes the default there should be a second PR to make it the default for generators.Related Issue(s)
Fixes #29422