forked from CarnegieLearningWeb/UpGrade
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package-scripts.js
28 lines (26 loc) · 1.17 KB
/
package-scripts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
* Version bump will bump the version of all packages in the monorepo
* It also will tag the commit with the new version, commit, and push the tag to remote
*/
function versionBump(bumpType) {
return `
echo "root:" && npm version ${bumpType} --git-tag-version=false &&
NEW_VERSION=$(jq -r '.version' package.json) &&
echo "types:" && cd types && npm version ${bumpType} --git-tag-version=false &&
echo "frontend:" && cd ../frontend && npm version ${bumpType} --git-tag-version=false &&
echo "backend-root:" && cd ../backend && npm version ${bumpType} --git-tag-version=false &&
echo "scheduler:" && cd packages/Scheduler && npm version ${bumpType} --git-tag-version=false &&
echo "backend:" && cd ../Upgrade && npm version ${bumpType} --git-tag-version=false &&
echo "js clientlib:" && cd ../../../clientlibs/js && npm version ${bumpType} --git-tag-version=false &&
echo "java clientlib:" && cd ../java && mvn versions:set -DnewVersion=$NEW_VERSION`;
}
module.exports = {
scripts: {
default: 'nps',
version: {
patch: versionBump('patch'),
minor: versionBump('minor'),
major: versionBump('major'),
},
},
};