feat(init): reify on init new workspace#4892
Conversation
| * Default: true | ||
| * Type: Boolean | ||
|
|
||
| If set to true, the npm cli will run an update after operations that may |
There was a problem hiding this comment.
what does "run an update" mean?
There was a problem hiding this comment.
it means the npm cli will run a npm update <workspace-name> cmd behind the scenes, to be clear this text is already there, ref: https://docs.npmjs.com/cli/v8/using-npm/config#workspaces-update - in case you want to propose improvements here, I'm due to a follow up PR improving docs and would appreciate the feedback 😊
There was a problem hiding this comment.
sure, but it doesn't seem clear that "run an update" means this. Perhaps:
| If set to true, the npm cli will run an update after operations that may | |
| If set to true, the npm cli will run an update (`npm update <workspace-name>`) after operations that may |
?
There was a problem hiding this comment.
I think that's very close to what I want, I'll follow up with a docs PR once this lands 😊 thanks!
Adds a minimalistic reify step that updates the installed tree after initializing a new workspace. Moved the shared update logic from `lib/commands/version.js` to a `lib/workspaces/update-workspaces.js` module that is reused between both `npm version` and `npm init`. Relates to: npm/rfcs#556 Relates to: npm#4588
c459a76 to
974d1ce
Compare
| }) | ||
| const init = new Init(npm) | ||
| await init.execWorkspaces([], ['a']) | ||
| const output = npm._mockOutputs.map(arr => arr.map(i => i.replace(/[0-9]*ms$/, '100ms'))) |
There was a problem hiding this comment.
nit: this could be a t.cleanSnapshot
Adds a minimalistic reify step that updates the installed tree after
initializing a new workspace.
Moved the shared update logic from
lib/commands/version.jsto alib/workspaces/update-workspaces.jsmodule that is reused betweenboth
npm versionandnpm init.References
Relates to: npm/rfcs#556
Relates to: #4588