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

feat(init): reify on init new workspace #4892

Merged
merged 1 commit into from
Jun 1, 2022

Conversation

ruyadorno
Copy link
Contributor

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.

References

Relates to: npm/rfcs#556
Relates to: #4588

@ruyadorno ruyadorno requested a review from a team as a code owner May 12, 2022 21:27
@ruyadorno ruyadorno added the semver:minor new backwards-compatible feature label May 12, 2022
* Default: true
* Type: Boolean

If set to true, the npm cli will run an update after operations that may
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does "run an update" mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 😊

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, but it doesn't seem clear that "run an update" means this. Perhaps:

Suggested change
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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@ruyadorno ruyadorno force-pushed the fead-add-update-post-init branch from c459a76 to 974d1ce Compare May 19, 2022 13:47
})
const init = new Init(npm)
await init.execWorkspaces([], ['a'])
const output = npm._mockOutputs.map(arr => arr.map(i => i.replace(/[0-9]*ms$/, '100ms')))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this could be a t.cleanSnapshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:minor new backwards-compatible feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants