yalc icon indicating copy to clipboard operation
yalc copied to clipboard

Support option to not modify package.json

Open Jlg1128 opened this issue 2 months ago • 5 comments

My package dosen't compile scss, repush the package lead to my main project recompile the package scss files all becasuse package.json changed.

Jlg1128 avatar Oct 13 '25 03:10 Jlg1128

Use yarn link instead of yarn add to create a node_modules symlink. This avoids modifying package.json and copying packages to .yalc/**

Be aware, though, that using symlinks may lead to issues; specifically, running npm install will overwrite the linked project's dist folders. This means you would need to unlink the projects first (using yalc remove — I'm not certain about yalc retreat --all), then run npm install, and then link them back using yalc link.

slavbar avatar Oct 13 '25 08:10 slavbar

Sorry for not being clear, the package.json I was referring to package's which i using yalc added, yalc will add yalcSig to it.

Jlg1128 avatar Oct 13 '25 12:10 Jlg1128

Ah, so you’re annoyed by this field.

Image

I bet it was added intentionally to count as a file change that can trigger rebuilds/watchers.

As a solution, you could:

  • Configure your watcher to ignore changes inside .yalc/**
  • Use yalc/yarn/npm/pnpm link instead (symlink workflow)

But I’m also curious to hear the yalc author’s stance.

slavbar avatar Oct 13 '25 13:10 slavbar

Yes, I was annoyed at this several days🤣.

yalcSig does not make sense, I don't find any usage in yalc source code, and It should not be used to trigger updates.

  • I think it's right but I don't want to write configure in main project because there is a little coupling.
  • yarn/npm link does not work because of dependency resolution problem

Thanks for your reply, i'm also want the yalc author’s stance.

Jlg1128 avatar Oct 13 '25 14:10 Jlg1128

I will fork it and remove related code about modify package.json if the author has no better way

Jlg1128 avatar Oct 13 '25 14:10 Jlg1128