npm-safe-install
npm-safe-install copied to clipboard
Fixed inconsistency for unlinking of pre-symlinked deps, and added option to toggle it
- Fixed that pre-symlinked dependencies were only unlinked (prior to npm install), if there was no ".nsi.json" file. (unexpected inconsistency)
- Added new option "keep-prelinked". This option tells nsi to disable the "unlink any pre-symlinked dependencies before npm install" protection feature. (restoring functionality prior to my first pull-request)
Benefits of using the new option:
- Increases the speed of nsi. (since the "npm install" command doesn't need to freshly-install those libraries)
- Avoids the need for some IDEs to reload. (some IDEs only notice the file deletions, not their re-adding through new symlinks at the end)
However, the option also has this major negative:
- Because the pre-symlinked folders are not unlinked prior to "npm install", the npm-install process can (and will -- at least in some cases) tunnel into those symlinked folders and modify them (since it doesn't fully account for their being in external folders). Depending on the dependency-trees between the user project, and the symlinked folders, this can cause a number of subtle errors later on. (as I've experienced multiple times)
Because of that one major negative, I currently have "keep-prelinked" disabled by default.
@UD-UD If you'd like this option enabled by default, let me know, and I'll make the change. However, in that case I think the Readme should at least contain mention of the potential drawbacks of it. (I just got bit by it this morning, hence my making the changes, and putting it into a pull-request)
Will review this.
@UD-UD - any news on this? new -k
flag that @Venryx introduces will make this a great developer experience in a new repo. This helps with shorter environment setup.
@UD-UD - any news on this? new
-k
flag that @Venryx introduces will make this a great developer experience in a new repo. This helps with shorter environment setup.
@UXnomaan Will merge this PR as soon possible.