Skip to content
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

Not working on yarn@v3 (berry) #119

Open
samchon opened this issue Aug 7, 2023 · 3 comments
Open

Not working on yarn@v3 (berry) #119

samchon opened this issue Aug 7, 2023 · 3 comments

Comments

@samchon
Copy link
Contributor

samchon commented Aug 7, 2023

image

https://github.com/samchon/ts-patch-yarn-v3/actions/runs/5781547560/job/15666822757#step:5:31

Tried to use ts-patch on yarn berry, but readonly problem be happened.

It does not occur runtime error, but patching be failed, so I think it is a bug.

@AlCalzone
Copy link

@samchon try the pnpm or node-modules linker. This works for me with yarn v3.

@nonara
Copy link
Owner

nonara commented Aug 11, 2023

Hi @samchon! Let me know if AlCalzone's solution works for you, please.

I still haven't worked much with yarn3. We have tests in place but not turned on yet. I know others have said it works with the node modules linker.

If so, we should enable those tests and possibly add something to the readme.

@tsengia
Copy link

tsengia commented Sep 17, 2023

Don't know if this helps at all, but Yarn v3 has a yarn patch command that allows users to apply patches to installed packages locally: https://yarnpkg.com/cli/patch

This Yarn patch command utilizes the @yarnpkg/fslib library to access files stored inside of the installed .zip folders: https://yarnpkg.com/advanced/pnpapi#accessing-the-files

I'm not very familiar with this code base, but here's a potential idea:

  1. When ts-patch install is run, detect if Yarn Berry is in use.
  2. If it is in use, then utilize the same API calls that yarn patch uses to apply a patch to the typescript modules.
  3. Once patch is applied, perform the equivalent of a yarn patch-commit to update the package.json to resolve typescript to the patched version of typescript.

The yarn patch and yarn patch-commit commands are performed by the plugin-patch plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants