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

Yarn 4 replaces patched typescript on every install #166

Open
AlCalzone opened this issue Jul 25, 2024 · 0 comments
Open

Yarn 4 replaces patched typescript on every install #166

AlCalzone opened this issue Jul 25, 2024 · 0 comments

Comments

@AlCalzone
Copy link

I recently noticed that ts-patch was uninstalled often, after upgrading to Yarn 4. I'm often switching branches with different dependencies and therefore invoking yarn install often. It seems that every time I do this, the modifications to TypeScript get undone:

dominic@X1:~/Repositories/node-zwave-js$ yarn
➤ YN0000: · Yarn 4.3.1
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Post-resolution validation
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 2s 537ms
➤ YN0000: · Done with warnings in 2s 874ms


dominic@X1:~/Repositories/node-zwave-js$ yarn ts-patch check
Checking TypeScript v5.5.3 installation in /home/dominic/Repositories/node-zwave-js/node_modules/typescript

[-] tsc.js is not patched.
[-] tsserver.js is not patched.
[-] tsserverlibrary.js is not patched.
[-] typescript.js is not patched.


dominic@X1:~/Repositories/node-zwave-js$ yarn ts-patch install
[+] ts-patch installed!


dominic@X1:~/Repositories/node-zwave-js$ yarn
➤ YN0000: · Yarn 4.3.1
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Post-resolution validation
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 2s 509ms
➤ YN0000: · Done with warnings in 2s 857ms


dominic@X1:~/Repositories/node-zwave-js$ yarn ts-patch check
Checking TypeScript v5.5.3 installation in /home/dominic/Repositories/node-zwave-js/node_modules/typescript

[-] tsc.js is not patched.
[-] tsserver.js is not patched.
[-] tsserverlibrary.js is not patched.
[-] typescript.js is not patched.

I'm using the pnpm linker setting in Yarn, but I don't think this makes a difference. My postinstall script contains ts-patch install -s, but it seems this isn't executed every time.

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

1 participant