-
Notifications
You must be signed in to change notification settings - Fork 47
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
Use SnarkyJS version of 0.9.* #376
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think just using 0.9.*
doesn't achieve what we want. We want the CLI to install the latest snarkyjs version in new projects. It currently doesn't do that because package-lock.json
locks the precise version.
So, what we need is to remove template/project-ts/package-lock.json
. With that change, npm will determine the snarkyjs version to install from the version string in package.json
.
The syntax of the version string is explained here: https://docs.npmjs.com/about-semantic-versioning#using-semantic-versioning-to-specify-update-types-your-package-can-accept
These are popular styles used:
^0.9.2
- what we have currently. npm will install any version that is newer than0.9.2
but has the same major version0
~0.9.2
- npm will install any newer version that has the same minor version0.9
.- documented alternatives without minimum patch version:
0.9
,0.9.x
- I assume
0.9.*
is the same as those, but not documented in the link above
- documented alternatives without minimum patch version:
If we want the second, ~
behavior, then I'd double-check the version string that you are using: the caret in ^0.9.*
suggests to me that any higher minor version can be used. Also, the .*
syntax is not documented on the npm page so I wouldn't use it.
I'd recommend to use ~0.9.2
, since we actually want a version higher than 0.9.2
(both 0.9.1
and 0.9.2
had important bug fixes). Alternatively, just 0.9
should achieve the same (because npm will pick the latest version that starts with 0.9
, so will be at least 0.9.2
anyway)
Actually, I'm not sure why we'd want to prevent installing a higher minor version, so would prefer EDIT: I guess it provides a more stable experience to the user if we make npm stick to a minor version on commands like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 the package-lock.json
files will need to be untracked from git too.
Actually, I'm not sure why we'd want to prevent installing a higher minor version
@mitschabaude B/c we're in v0 and minor is breaking. Breaking upgrades should always be an intentional choice for devs and we should only update the patch version automatically for now.
however, we didn't do that so far and no-one has complained, also it would be inconsistent with our current recommentation of running npm update snarkyjs in order to update to any newer version
Our written text to devs guiding during a breaking upgrade will just need to be updated. We're entering a new phase of maturity here network wise and SnarkyJS wise, and it's the right time to start providing more predictability around version upgrades for devs.
0.9.*
will work; confirmed with NPM's version calculator (screenshot below).
@ymekuria Let's remove ^
please, given the version calculator shows this works and it's the form that will be understood by the most devs, which is our goal here, agree?
@jasongitmail and @mitschabaude I updated the version to |
@ymekuria Good catch. DMing to talk through because there are a bunch of aspects to consider here. Updated with the summary of my thoughts:
Reasoning:
Would that reasoning make sense? |
3756793
to
df13070
Compare
Closes #374 & #317
This PR updates the template projects to use the SnarkyJS version of 0.9.* to avoid needing to update the SnarkyJS version in the CLI for bug releases.
This was tested manually to confirm the correct SnarkyJS version in generated projects. It was also confirmed that the correct SnarkyJS version was displayed when running
zk system
.