should-release-it
Advanced tools
Comparing version 1.0.3 to 1.1.0
@@ -18,2 +18,3 @@ #!/usr/bin/env node | ||
const exec_async_1 = require("./utils/exec-async"); | ||
const get_conventional_config_types_1 = require("./utils/get-conventional-config-types"); | ||
const get_package_json_1 = require("./utils/get-package.json"); | ||
@@ -48,4 +49,10 @@ const get_release_it_config_1 = require("./utils/get-release-it-config"); | ||
const messages = stdout.split('\n'); | ||
const types = (0, get_conventional_config_types_1.getConventionConfigTypes)(releaseItConfig); | ||
if (!types) { | ||
logger_1.logger.error('Could not parse preset types and did not find any custom types.'); | ||
process.exitCode = 1; | ||
return; | ||
} | ||
// Parse release-it config file and get types that are not hidden | ||
const typesThatShouldRelease = releaseItConfig.plugins['@release-it/conventional-changelog'].types.reduce((str, type) => { | ||
const typesThatShouldRelease = types.reduce((str, type) => { | ||
if (!type.hidden) { | ||
@@ -52,0 +59,0 @@ const separator = str.length ? '|' : ''; |
{ | ||
"name": "should-release-it", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "Check if should release new version by looking at the commits using conventional commits", | ||
@@ -38,39 +38,40 @@ "repository": "https://github.com/DiogoAbu/should-release-it.git", | ||
"dependencies": { | ||
"@iarna/toml": "^2.2.5", | ||
"cosmiconfig": "^8.1.2", | ||
"@iarna/toml": "2.2.5", | ||
"conventional-changelog-preset-loader": "4.1.0", | ||
"cosmiconfig": "9.0.0", | ||
"figures": "3.2.0", | ||
"lodash.isplainobject": "^4.0.6", | ||
"minimist": "^1.2.8", | ||
"lodash.isplainobject": "4.0.6", | ||
"minimist": "1.2.8", | ||
"signale": "1.4.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "7.20.5", | ||
"@babel/eslint-parser": "7.19.1", | ||
"@commitlint/cli": "17.3.0", | ||
"@commitlint/config-conventional": "17.3.0", | ||
"@release-it/conventional-changelog": "^5.1.1", | ||
"@types/lodash.isplainobject": "^4.0.7", | ||
"@babel/core": "7.23.5", | ||
"@babel/eslint-parser": "7.23.3", | ||
"@commitlint/cli": "18.4.3", | ||
"@commitlint/config-conventional": "18.4.3", | ||
"@release-it/conventional-changelog": "8.0.1", | ||
"@types/lodash.isplainobject": "4.0.9", | ||
"@types/node": "18.11.10", | ||
"@types/signale": "1.4.4", | ||
"@typescript-eslint/eslint-plugin": "5.45.0", | ||
"@typescript-eslint/parser": "5.45.0", | ||
"@typescript-eslint/eslint-plugin": "6.13.1", | ||
"@typescript-eslint/parser": "6.13.1", | ||
"babel-eslint": "10.1.0", | ||
"eslint": "8.28.0", | ||
"eslint-config-prettier": "8.5.0", | ||
"eslint-config-superop": "1.4.4", | ||
"eslint-import-resolver-typescript": "3.5.2", | ||
"eslint": "8.54.0", | ||
"eslint-config-prettier": "9.0.0", | ||
"eslint-config-superop": "1.5.0", | ||
"eslint-import-resolver-typescript": "3.6.1", | ||
"eslint-plugin-eslint-comments": "3.2.0", | ||
"eslint-plugin-import": "2.26.0", | ||
"eslint-plugin-jest": "27.1.6", | ||
"eslint-plugin-prettier": "4.2.1", | ||
"eslint-plugin-simple-import-sort": "8.0.0", | ||
"eslint-plugin-unused-imports": "2.0.0", | ||
"husky": "8.0.2", | ||
"lint-staged": "13.0.4", | ||
"patch-package": "6.5.0", | ||
"eslint-plugin-import": "2.29.0", | ||
"eslint-plugin-jest": "27.6.0", | ||
"eslint-plugin-prettier": "5.0.1", | ||
"eslint-plugin-simple-import-sort": "10.0.0", | ||
"eslint-plugin-unused-imports": "3.0.0", | ||
"husky": "8.0.3", | ||
"lint-staged": "15.1.0", | ||
"patch-package": "8.0.0", | ||
"postinstall-postinstall": "2.1.0", | ||
"prettier": "2.8.0", | ||
"release-it": "^15.9.0", | ||
"ts-node": "^10.9.1", | ||
"tsc-files": "1.1.3", | ||
"prettier": "3.1.0", | ||
"release-it": "15.11.0", | ||
"ts-node": "10.9.1", | ||
"tsc-files": "1.1.4", | ||
"typescript": "4.9.3" | ||
@@ -77,0 +78,0 @@ }, |
@@ -62,4 +62,2 @@ <h1 align="center">Should Release-It</h1><br> | ||
To run any command the working tree on the source folders must be clean. | ||
```sh | ||
@@ -73,5 +71,21 @@ npx should-release-it <options> | ||
Output with no meaningful commits | ||
```sh | ||
$ npx should-release-it | ||
» [6:08:53 PM] [should-release-it] › ℹ Should NOT trigger a release: ci: update workflow | ||
» [6:08:53 PM] [should-release-it] › ℹ No meaningful commits found, we should not release | ||
``` | ||
Output that should trigger release | ||
```sh | ||
$ npx should-release-it | ||
» [11:27:49 PM] [should-release-it] › ℹ Should NOT trigger a release: ci: clean up workflow | ||
» [11:27:49 PM] [should-release-it] › ℹ Should trigger a release: feat: update dashboard | ||
» [11:27:49 PM] [should-release-it] › ℹ Found at least one commit that require a release, we should release | ||
``` | ||
Use on CI: | ||
```yml | ||
- run: | | ||
- name: Check if should release | ||
run: | | ||
npx should-release-it || exit 0 | ||
@@ -81,2 +95,13 @@ npm run release | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# OR | ||
- name: Check if should release | ||
id: should-release | ||
run: | | ||
if npx should-release-it; then | ||
echo "value=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "value=false" >> $GITHUB_OUTPUT | ||
fi | ||
``` | ||
@@ -83,0 +108,0 @@ |
18185
10
211
121
7
+ Addedconventional-changelog-preset-loader@4.1.0(transitive)
+ Addedcosmiconfig@9.0.0(transitive)
+ Addedenv-paths@2.2.1(transitive)
- Removedcosmiconfig@8.3.6(transitive)
- Removedpath-type@4.0.0(transitive)
Updated@iarna/toml@2.2.5
Updatedcosmiconfig@9.0.0
Updatedlodash.isplainobject@4.0.6
Updatedminimist@1.2.8