Skip to content

Not working on yarn@v3 (berry) #119

Open

Description

@samchon

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.

Activity

  1. AlCalzone commented on Aug 9, 2023

    @AlCalzone

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

  2. nonara commented on Aug 11, 2023

    @nonara
    Owner

    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.

  3. tsengia commented on Sep 17, 2023

    @tsengia

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions