-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #460 from VisActor/release/0.14.8
[Auto release] release 0.14.8
- Loading branch information
Showing
44 changed files
with
1,159 additions
and
635 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,102 +1,8 @@ | ||
/** | ||
* This is configuration file is used for advanced publishing configurations with Rush. | ||
* More documentation is available on the Rush website: https://rushjs.io | ||
*/ | ||
|
||
/** | ||
* A list of version policy definitions. A "version policy" is a custom package versioning | ||
* strategy that affects "rush change", "rush version", and "rush publish". The strategy applies | ||
* to a set of projects that are specified using the "versionPolicyName" field in rush.json. | ||
*/ | ||
[ | ||
// { | ||
// /** | ||
// * (Required) Indicates the kind of version policy being defined ("lockStepVersion" or "individualVersion"). | ||
// * | ||
// * The "lockStepVersion" mode specifies that the projects will use "lock-step versioning". This | ||
// * strategy is appropriate for a set of packages that act as selectable components of a | ||
// * unified product. The entire set of packages are always published together, and always share | ||
// * the same NPM version number. When the packages depend on other packages in the set, the | ||
// * SemVer range is usually restricted to a single version. | ||
// */ | ||
// "definitionName": "lockStepVersion", | ||
// | ||
// /** | ||
// * (Required) The name that will be used for the "versionPolicyName" field in rush.json. | ||
// * This name is also used command-line parameters such as "--version-policy" | ||
// * and "--to-version-policy". | ||
// */ | ||
// "policyName": "MyBigFramework", | ||
// | ||
// /** | ||
// * (Required) The current version. All packages belonging to the set should have this version | ||
// * in the current branch. When bumping versions, Rush uses this to determine the next version. | ||
// * (The "version" field in package.json is NOT considered.) | ||
// */ | ||
// "version": "1.0.0", | ||
// | ||
// /** | ||
// * (Required) The type of bump that will be performed when publishing the next release. | ||
// * When creating a release branch in Git, this field should be updated according to the | ||
// * type of release. | ||
// * | ||
// * Valid values are: "prerelease", "release", "minor", "patch", "major" | ||
// */ | ||
// "nextBump": "prerelease", | ||
// | ||
// /** | ||
// * (Optional) If specified, all packages in the set share a common CHANGELOG.md file. | ||
// * This file is stored with the specified "main" project, which must be a member of the set. | ||
// * | ||
// * If this field is omitted, then a separate CHANGELOG.md file will be maintained for each | ||
// * package in the set. | ||
// */ | ||
// "mainProject": "my-app", | ||
// | ||
// /** | ||
// * (Optional) If enabled, the "rush change" command will prompt the user for their email address | ||
// * and include it in the JSON change files. If an organization maintains multiple repos, tracking | ||
// * this contact information may be useful for a service that automatically upgrades packages and | ||
// * needs to notify engineers whose change may be responsible for a downstream build break. It might | ||
// * also be useful for crediting contributors. Rush itself does not do anything with the collected | ||
// * email addresses. The default value is "false". | ||
// */ | ||
// // "includeEmailInChangeFile": true | ||
// }, | ||
// | ||
// { | ||
// /** | ||
// * (Required) Indicates the kind of version policy being defined ("lockStepVersion" or "individualVersion"). | ||
// * | ||
// * The "individualVersion" mode specifies that the projects will use "individual versioning". | ||
// * This is the typical NPM model where each package has an independent version number | ||
// * and CHANGELOG.md file. Although a single CI definition is responsible for publishing the | ||
// * packages, they otherwise don't have any special relationship. The version bumping will | ||
// * depend on how developers answer the "rush change" questions for each package that | ||
// * is changed. | ||
// */ | ||
// "definitionName": "individualVersion", | ||
// | ||
// "policyName": "MyRandomLibraries", | ||
// | ||
// /** | ||
// * (Optional) This can be used to enforce that all packages in the set must share a common | ||
// * major version number, e.g. because they are from the same major release branch. | ||
// * It can also be used to discourage people from accidentally making "MAJOR" SemVer changes | ||
// * inappropriately. The minor/patch version parts will be bumped independently according | ||
// * to the types of changes made to each project, according to the "rush change" command. | ||
// */ | ||
// "lockedMajor": 3, | ||
// | ||
// /** | ||
// * (Optional) When publishing is managed by Rush, by default the "rush change" command will | ||
// * request changes for any projects that are modified by a pull request. These change entries | ||
// * will produce a CHANGELOG.md file. If you author your CHANGELOG.md manually or announce updates | ||
// * in some other way, set "exemptFromRushChange" to true to tell "rush change" to ignore the projects | ||
// * belonging to this version policy. | ||
// */ | ||
// "exemptFromRushChange": false, | ||
// | ||
// // "includeEmailInChangeFile": true | ||
// } | ||
{ | ||
"definitionName": "lockStepVersion", | ||
"policyName": "vrenderMain", | ||
"version": "0.14.8", | ||
"nextBump": "patch" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const writePrereleaseVersion = require('./set-prerelease-version'); | ||
const checkAndUpdateNextBump = require('./version-policies'); | ||
|
||
|
||
function run() { | ||
const preReleaseName = process.argv.slice(2)[0]; | ||
const nextBump = checkAndUpdateNextBump(process.argv.slice(2)[1]); | ||
|
||
console.log('[apply prerelease version]: ', preReleaseName, nextBump); | ||
|
||
writePrereleaseVersion(nextBump, preReleaseName); | ||
} | ||
|
||
run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const fs = require('fs') | ||
|
||
function getPackageJson(pkgJsonPath) { | ||
const pkgJson = fs.readFileSync(pkgJsonPath, { encoding: 'utf-8' }) | ||
return JSON.parse(pkgJson); | ||
} | ||
|
||
module.exports = getPackageJson; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,20 @@ | ||
// see more about the regex here: https://semver.org/lang/zh-CN/ | ||
// reg test: https://regex101.com/r/vkijKf/1/ | ||
const SEMVER_REG = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/gm; | ||
|
||
function parseVersion() { | ||
const branchName = process.argv.slice(2)[0]; | ||
function parseVersion(version) { | ||
const res = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/gm.exec(version); | ||
|
||
|
||
if (branchName) { | ||
const versionName = branchName.includes('release/') ? branchName.replace('release/', '') : branchName; | ||
const res = SEMVER_REG.exec(versionName); | ||
|
||
if (res) { | ||
return { | ||
major: res[1], | ||
minor: res[2], | ||
patch: res[3], | ||
preReleaseName: res[4], | ||
preReleaseType: res[4].includes('.') ? res[4].split('.')[0] : res[4] | ||
}; | ||
} | ||
if (res) { | ||
return { | ||
major: +res[1], | ||
minor: +res[2], | ||
patch: +res[3], | ||
preReleaseName: res[4], | ||
preReleaseType: res[4] && res[4].includes('.') ? res[4].split('.')[0] : res[4] | ||
}; | ||
} | ||
|
||
return null; | ||
} | ||
} | ||
|
||
module.exports = parseVersion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.