Skip to content

create-wmr: template dep versions automatically kept up-to-date#582

Merged
marvinhagemeister merged 1 commit intomainfrom
fix/dep-version-autowrite
May 3, 2021
Merged

create-wmr: template dep versions automatically kept up-to-date#582
marvinhagemeister merged 1 commit intomainfrom
fix/dep-version-autowrite

Conversation

@rschristian
Copy link
Copy Markdown
Member

So as it turns out, pkg-install does in fact write to the package.json file.... so long as you remember to scaffold your project before installing 🙃

create-wmr now installs the very latest versions of the deps and it will end up in the user's package file in the form of "^x.x.x"

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 3, 2021

⚠️ No Changeset found

Latest commit: 3c49394

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment on lines -56 to -60
// @ts-ignore-next
await getPackageManager({ prefer: packageManager }).catch(() => {
process.stderr.write(`\n${red(`${packageManager} cannot be found`)}\n`);
process.exit(1);
});
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I believe I wrote this because installing with yarn was originally a flag, like used in preact-cli. This is irrelevant though with the current set up. You can't run npm init / yarn create without having npm/yarn available. NPX comes with NPM, so it too isn't an potential issue.

Copy link
Copy Markdown
Member

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

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

Sweeeet 🙌 🎉 Let's add a changeset and merge this 👍

@rschristian
Copy link
Copy Markdown
Member Author

Does this need a changeset? Shouldn''t actually change anything for users, just reduces maintenance burden.

I'm still not clear on the lines between needing a changeset vs not 😅

@marvinhagemeister
Copy link
Copy Markdown
Member

Good point, I don't really have a strong opinion on this 😬

@marvinhagemeister marvinhagemeister merged commit d18987b into main May 3, 2021
@marvinhagemeister marvinhagemeister deleted the fix/dep-version-autowrite branch May 3, 2021 20:53
@rschristian
Copy link
Copy Markdown
Member Author

I suppose it does alter user code but idk where the distinction is there

@marvinhagemeister
Copy link
Copy Markdown
Member

Yeah it's pretty blurry and I don't think there is a right or wrong approach here. It's more of an opinion which way we pick.

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

Successfully merging this pull request may close these issues.

2 participants