-
Notifications
You must be signed in to change notification settings - Fork 43
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: create script for updating RELEASE.md before PR #232
Conversation
✅ Deploy Preview for astro-reactive canceled.
|
✅ Deploy Preview for astro-reactive-docs canceled.
|
packages/pr-updater.js
Outdated
console.log(`What package is changed? | ||
1. Common | ||
2. Form | ||
3. Validator`); | ||
const noChanged = prompt(": "); | ||
|
||
console.log(`What is the type of PR? | ||
1. Fix | ||
2. Minor Release/Feat | ||
3. Major Release/Feat`); | ||
const type = prompt(": "); | ||
|
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 it should check the input from the prompt before going to the next step. This should prevent someone accidentally (or intentionally) type an invalid option.
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.
@NeilAn99 since the bump of version will not be needed per PR, you can remove adding the version for now in your script. Just focus on the change and type. Where the type could either be "fix" or "feature"
So no need to add the big text for version but just items like:
Features
- Feature description text
Fixes
- Change description text
- dix description 2
packages/pr-updater.js
Outdated
if (type == '1') { | ||
version = semver.inc(formJSON.version, 'patch'); | ||
} | ||
else if (type == '2') { | ||
version = semver.inc(formJSON.version, 'minor'); | ||
} | ||
else { | ||
version = semver.inc(formJSON.version, 'major'); | ||
} |
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 prefer to use switch-case here since type
value should be only '1'
, '2'
and '3'
. Also, this else
here will let other value than '1'
and '2'
make a major change. 😅
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.
As I mentioned above we can remove this versioning as we will only bump the version when releasing, and not per PR.
However I think we want to ask the contributors if the change will break the existing examples/demo apps and if they have also ipdated them.
After typing a code change description, we ask:
"Will this code change break existing examples and/or demo applications? Y/N"
Then we can just add a text (BREAKING CHANGE)
beside the code change items
Features
- Change description text (BREAKING CHANGE)
...
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.
Thanks @NeilAn99, this is great progress for the project. We want to get this in! Can you go through a couple of suggestions first?
Please ignore this comment ☝️ and focus on the first comments. Bumping versions will only be done on release, and not per PR, so I will work on this after your pr is merged @NeilAn99 |
I have updated the code so that it doesn't deal with versioning, added some input checking and focused on features/fixes. Now running the script will look 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.
LGTM! 🚀 However, please fix a conflict on a package.json
. I think it was a line in the publish
script. Make sure to use it from our latest main branch and it'll be safe to merge. 🦺
I have resolved the conflict. |
Thanks @Icyscools and @NeilAn99 -- I'm merging this now! :) |
chore: create script for updating RELEASE.md before PR
Fixes #148
Description of changes:
pr-updater.js
located in thepackages
directory that can be run usingnpm run release
. This script will prompt the contributor for the package changed, the type of PR, and the description(s) of changes made. Then, the script will find the corresponding RELEASE.md file and update it.For example, the running the script:
![image](https://user-images.githubusercontent.com/54966170/206618095-687c8b71-16a9-4be8-a570-30e288281baa.png)
![image](https://user-images.githubusercontent.com/54966170/206618219-07ac7f54-3010-45fd-b31c-c57665c1301e.png)
Will produce the following RELEASE.md:
Tag a reviewer: @ayoayco
Tasks:
npm run build
npm run test
npm run lint