-
Notifications
You must be signed in to change notification settings - Fork 4k
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
chore: master version in lerna.json (instead of root package.json) #6445
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"skip": { "tag": true }, | ||
"packageFiles": [ { "filename": "lerna.json", "type": "json" } ], | ||
"bumpFiles": [ { "filename": "lerna.json", "type": "json" } ] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,12 +19,5 @@ echo "Starting ${version} version bump" | |
|
||
# /bin/bash ./install.sh | ||
|
||
# Generate CHANGELOG and create a commit | ||
# --skip.tag because we create the tag as part of creating the github release | ||
npx standard-version \ | ||
--bumpFiles package.json \ | ||
--release-as ${version} \ | ||
--skip.tag=true \ | ||
--releaseCommitMessageFormat="chore(release): v{{currentTag}}" \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not in the .versionrc.json file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the default. |
||
--commit-all | ||
|
||
# Generate CHANGELOG and create a commit (see .versionrc.json) | ||
npx standard-version --release-as ${version} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,5 @@ | |
"tools/*" | ||
], | ||
"rejectCycles": "true", | ||
"version": "999.0.0" | ||
"version": "1.25.0" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,11 +9,11 @@ scriptdir=$(cd $(dirname $0) && pwd) | |
# go to repo root | ||
cd ${scriptdir}/.. | ||
|
||
files="lerna.json $(find . -name package.json | grep -v node_modules | grep -v "^./package.json" | xargs)" | ||
files="$(find . -name package.json | grep -v node_modules | xargs)" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm. I guess I had assumed this would just be a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lerna version doesn’t take care of peer dependencies and occasionally misses things. This is more straightforward I believe. |
||
${scriptdir}/align-version.js ${files} | ||
|
||
# validation | ||
if find . -name package.json | grep -v node_modules | xargs grep "999.0.0"; then | ||
echo "ERROR: unexpected version marker 999.0.0 in a package.json file" | ||
exit 1 | ||
fi | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Returns the current repo version. | ||
* | ||
* Usage: | ||
* | ||
* const version = require('./get-version'); | ||
* | ||
* Or from the command line: | ||
* | ||
* node -p require('./get-version') | ||
* | ||
*/ | ||
const versionFile = require('../.versionrc.json').packageFiles[0].filename; | ||
if (!versionFile) { | ||
throw new Error(`unable to determine version filename from .versionrc.json at the root of the repo`); | ||
} | ||
|
||
module.exports = require(`../${versionFile}`).version; |
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.
Personally prefer the command line flags version, but whatever suits you.
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.
Me too, but I couldn’t find a way to specify the packageFiles type through the command line so I had to revert to this abomination.