Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add preliminary support for Bun#490

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Strengthless wants to merge8 commits intods300:master
base:master
Choose a base branch
Loading
fromStrengthless:master

Conversation

@Strengthless
Copy link

@StrengthlessStrengthless commentedSep 10, 2023
edited
Loading

Closes#489.

Changelogs:

  • Added--use-bun flag, similar to the current--use-yarn flag.
  • AddedparseBunLockfile.ts to convert bun.lockb into yarn v1 lockfiles.
  • UpdatedgetPackageResolution.ts to handle bun conversions before parsing.
  • UpdateddetectPackageManager.ts to detect bun, bun workspaces and multiple lockfiles.
  • Updated README with setup instructions for Bun.

Caveats:

  • If user has multiple lockfiles, patch-package uses npm by default. However, in the rare case where only bun.lockb and yarn.lock files exist, we have to resort to using yarn. This behaviour has been documented in the CLI and README (see0491b91).
  • Currently awaiting confirmation on how Bun handles postinstalls, for writing up the README about bun setup. (Willbun remove execute postinstall scripts? If not, bun users should also installpostinstall-postinstall just like yarn v1 users.)
  • Currently awaiting confirmation on how Bun workspaces work, for writing up the README about bun workspaces setup (Is it similar to yarn workspaces, where users need to "repeat the setup process for the child package" if they want to patch un-hoisted packages?)

Temporary workaround (while this PR is unmerged):

  • Citingsupport patching dependencies, similar topnpm patch/patch-package oven-sh/bun#2336 (comment),

    Attempting to create a patch usingbunx patch-package <package-name> fails.

    However, if you have pre-existing patches in the./patches directory, you can successfully apply them using thebunx patch-package command (or via package.json -> scripts ->"postinstall": "patch-package")

    As a temporary workaround to generate apatches/package+name+version.patch file

    • runbun install --yarnit just converts bun.lockb into a yarn.lock. (orbun ./bun.lockb > ./yarn.lock)
    • make the necessary modifications insidenode-modules/<package-name>
    • bunx patch-package <package-name>
    • rm yarn.lock
    • package.json -> scripts ->"postinstall": "bunx patch-package"
      https://github.com/ds300/patch-package

AminoffZ, ashbuilds, royriojas-rivian, michaelhays, gestion-procesos, ild0tt0re, reeko, genesisxyz, controversial, jasons42, and 5 more reacted with thumbs up emojiOnurGvnc, noomly, chadgauth, benallfree, sarveshraj, venables, cayter, ashbuilds, michaelhays, kurisubrooks, and 7 more reacted with hooray emojipvinis, controversial, hminhman, ild0tt0re, robertherber, and karlhorky reacted with heart emojiwhatyoubendoing, Thinkscape, gestion-procesos, rdnsan, ild0tt0re, Mitch528, and robertherber reacted with eyes emoji
@OnurGvnc
Copy link

I triedbun remove <package-name> and saw that it executes the postinstall script.

❯ bun remove zodbun remove v1.0.0 (822a00c4)patch-package 8.0.0Applying patches...@remix-run/dev@1.19.3 ✔@remix-run/react@1.19.3 ✔ - zod 1 packages removed [38.00ms]

@Strengthless
Copy link
Author

Strengthless commentedSep 10, 2023
edited
Loading

This PR is now ready to merge, with only two caveats as mentioned in#490 (comment).

@ds300 Can you please review this PR? :)

OnurGvnc, petermm, akshay5995, cloydlau, AminoffZ, ashbuilds, Voldemat, robertherber, kalempster, Thinkscape, and 3 more reacted with hooray emojiAminoffZ, ashbuilds, and robertherber reacted with heart emoji

@robertherber
Copy link

Looking forward to this :) Been using pnpm for a while and been missing patch-package - so having it work with bun will be yummy!

Hoping this will work in monorepos as well!

medv reacted with heart emoji

@lovlyx
Copy link

any news on this?

@rikur
Copy link

Wish I could use patch-package to patch patch-package with this patch 😂 I guess I just need to fork the repo.

gustavopch and hassankhan reacted with laugh emoji

@robertherber
Copy link

Until this is merged, would you consider publishing this fork on npm@Strengthless?

gustavopch and the-simian reacted with eyes emoji

@erickreutz
Copy link

LGTM!

@medv
Copy link

medv commentedFeb 9, 2024
edited
Loading

It's happening!

Using this method for nowoven-sh/bun#2336 (comment)

robertherber reacted with eyes emoji

@robertherber
Copy link

@ds300 I understand you probably have lots going on - but having this merged would be a key enabler! 🙏🙂

nobkd, miblanchard, etcd, rikur, and valerius21 reacted with thumbs up emoji

@miblanchard
Copy link

Until this is merged, would you consider publishing this fork on npm@Strengthless?

@robertherber I am trying to use this method right now and published it under @miblanchard/patch-package@8.0.12 until this is merged and published.

robertherber, the-simian, and JustinRohweller reacted with rocket emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Support for Bun

8 participants

@Strengthless@OnurGvnc@robertherber@lovlyx@rikur@erickreutz@medv@miblanchard

[8]ページ先頭

©2009-2025 Movatter.jp