-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Prelease Version Strategies #147
Comments
Looking at specific version numbers for prereleases, we could use Snippets below from the semver package. const semver = require(`semver`);
const testabunch = (pre) =>
[
`2.0.0-alpha.1`,
`2.0.0-beta.1`,
`2.0.0-${pre}feat/preview-release.1`,
`2.0.0-${pre}feat/preview-release.2`,
`2.0.0-${pre}feat/preview-release.3`,
`2.0.0-${pre}feat/preview_release.3`,
`2.0.0-${pre}feat/xreview-release.1`,
`2.0.0-${pre}feat/preview-release.9`,
`2.0.0-${pre}feat/seview>release.1`,
].map((v) => v.replace(`/`, `-`).replace(`_`, `-`).replace(`>`, `-`));
const range = `^2.0.0-alpha.1`;
const list1 = testabunch("PR-").map((test) => {
console.log(test, semver.satisfies(test, range));
return test;
});
console.log(`%%%%%%%%%%`);
console.log(semver.maxSatisfying(list1, range));
console.log(semver.minSatisfying(list1, range));
console.log(`*****************************`);
const list2 = testabunch("").map((test) => {
console.log(test, semver.satisfies(test, range));
return test;
});
console.log(`%%%%%%%%%%`);
console.log(semver.maxSatisfying(list2, range));
console.log(`%%%%%%%%%%`);
console.log(`%%%%%block%%%%%`);
console.log(semver.inc("0.4.0-boop.10", "prepatch", "boop"));
console.log(semver.inc("0.4.0-boop.10", "preminor", "boop"));
console.log(semver.inc("0.4.0-boop.10", "premajor", "boop"));
console.log(semver.inc("0.4.0-boop.10", "prerelease", "boop"));
console.log(`%%%%%block%%%%%`);
console.log(semver.inc("0.4.0", "prepatch", "boop"));
console.log(semver.inc("0.4.0", "preminor", "boop"));
console.log(semver.inc("0.4.0", "premajor", "boop"));
console.log(semver.inc("0.4.0", "prerelease", "boop"));
console.log(`%%%%%block%%%%%`);
console.log(semver.inc("0.4.0-boop.10", "patch"));
console.log(semver.inc("0.4.0-boop.10", "minor"));
console.log(semver.inc("0.4.0-boop.10", "major"));
console.log(`%%%%%block%%%%%`);
console.log(semver.inc("0.4.0", "patch"));
console.log(semver.inc("0.4.0", "minor"));
console.log(semver.inc("0.4.0", "major")); returns: ❯ node test.js
2.0.0-alpha.1 true
2.0.0-beta.1 true
2.0.0-PR-feat-preview-release.1 false
2.0.0-PR-feat-preview-release.2 false
2.0.0-PR-feat-preview-release.3 false
2.0.0-PR-feat-preview-release.3 false
2.0.0-PR-feat-xreview-release.1 false
2.0.0-PR-feat-preview-release.9 false
2.0.0-PR-feat-seview-release.1 false
%%%%%%%%%%
2.0.0-beta.1
2.0.0-alpha.1
*****************************
2.0.0-alpha.1 true
2.0.0-beta.1 true
2.0.0-feat-preview-release.1 true
2.0.0-feat-preview-release.2 true
2.0.0-feat-preview-release.3 true
2.0.0-feat-preview-release.3 true
2.0.0-feat-xreview-release.1 true
2.0.0-feat-preview-release.9 true
2.0.0-feat-seview-release.1 true
%%%%%%%%%%
2.0.0-feat-xreview-release.1
2.0.0-alpha.1
%%%%%%%%%%
%%%%%block%%%%%
0.4.1-boop.0
0.5.0-boop.0
1.0.0-boop.0
0.4.0-boop.11
%%%%%block%%%%%
0.4.1-boop.0
0.5.0-boop.0
1.0.0-boop.0
0.4.1-boop.0
%%%%%block%%%%%
0.4.0
0.4.0
1.0.0
%%%%%block%%%%%
0.4.1
0.5.0
1.0.0 |
Preleases and Preview PackagesTerminologyA typical release includes running the A prerelease is the same release process except using a version number that includes a prerelease identifier such as A preview package has some similarities except we do not expect a commit. The Using PreleasesThis is a mode that you toggled on. It creates a {
"tag": "next",
"changes": [
"this-is-a-change-file",
"another-change-file"
]
} Note: For those familiar with Implementation Notes (only put this as comments within the code)Using the semver package, the So the sequencing is to accumulate all of the changes and compare applied vs new. If the applied < new changes, then bump with Using PreviewsRaw Chat NotesDates could work:
I do wish we could get a clean integer, but the next is the first use cases that matters to us because several kinds of projects already use it. Preview packages are nice to have and are better understood in Node.js projects but not known or expected by others I suspect the happy path for implementation will be some sort of templating of the version number. It may open up the option where we could allow some configuration of the template that would enable a consumer to do something special for npm if they choose to. Especially if we have some kind of configuration package mechanism like babel. This would allow us to define a convertor configuration for each ecosystem and then use that configuration on all sites. If we need to change it, it'd change in one place or override in a specific repo. |
These are raw notes from a few collaboration meetings I have had on the subject.
Prelease
We want a way to configure it that every time a commit is created, we publish on that tag.
prereleases
main branch is 2.1.0
=> open feat A branch with a minor bump => 2.2.0-feat-a.0 (dirty publish with the tag name, hit registry to get existing tags)
=> open feat B branch with a minor bump => 2.2.0-feat-b.0 (dirty publish with the tag name, hit registry to get existing tags)
main branch could get a prelease on
next
or similar off of HEADmajor version bump
process into using this
semver: https://semver.org/
Language Version Numbering
dotnet
Parsing: https://www.npmjs.com/package/xml-js
dart/flutter
Parsing: https://www.npmjs.com/package/js-yaml
The text was updated successfully, but these errors were encountered: