Skip to content

Commit

Permalink
fix: ignore patch without no BREAKING CHANGES and features
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoban committed Feb 16, 2024
1 parent 4a6f7fa commit 9d4ad8e
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 6 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
public-hoist-pattern=[]
ignore-workspace-root-check=true
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
"directory": "packages/release-it-pnpm"
},
"bugs": "https://github.com/hyoban/release-it-pnpm/issues",
"keywords": ["release", "release-it", "release-it-plugin"],
"keywords": [

Check failure on line 16 in package.json

View workflow job for this annotation

GitHub Actions / release

Replace `⏎····"release",⏎····"release-it",⏎····"release-it-plugin"⏎··` with `"release",·"release-it",·"release-it-plugin"`

Check failure on line 16 in package.json

View workflow job for this annotation

GitHub Actions / release

Replace `⏎····"release",⏎····"release-it",⏎····"release-it-plugin"⏎··` with `"release",·"release-it",·"release-it-plugin"`
"release",
"release-it",
"release-it-plugin"
],
"sideEffects": false,
"exports": {
".": {
Expand All @@ -28,7 +32,10 @@
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"files": ["dist", "package.json"],
"files": [

Check failure on line 35 in package.json

View workflow job for this annotation

GitHub Actions / release

Replace `⏎····"dist",⏎····"package.json"⏎··` with `"dist",·"package.json"`

Check failure on line 35 in package.json

View workflow job for this annotation

GitHub Actions / release

Replace `⏎····"dist",⏎····"package.json"⏎··` with `"dist",·"package.json"`
"dist",
"package.json"
],
"scripts": {
"build": "bunchee",
"dev": "bunchee -w",
Expand Down Expand Up @@ -60,6 +67,7 @@
"conventional-recommended-bump": "^9.0.0",
"fast-glob": "^3.3.2",
"semver": "^7.6.0",
"should-semantic-release": "^0.2.1",
"yaml": "^2.3.4"
},
"devDependencies": {
Expand Down
18 changes: 14 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import conventionalRecommendedBump from 'conventional-recommended-bump'
import fg from 'fast-glob'
import { Plugin } from 'release-it'
import semver from 'semver'
import { shouldSemanticRelease } from 'should-semantic-release'
import { parse } from 'yaml'

function hasAccess(path) {
Expand Down Expand Up @@ -143,6 +144,10 @@ class ReleaseItPnpmPlugin extends Plugin {
async getRecommendedVersion({ latestVersion, increment, isPreRelease, preReleaseId }) {
this.debug({ latestVersion, increment, isPreRelease, preReleaseId })
// we don not respect the increment option, only prerelease related options are respected
const { version } = this.getContext()
if (version) {
this.setContext({ version: null })
}
try {
const result = await conventionalRecommendedBump({
preset: {
Expand All @@ -151,6 +156,14 @@ class ReleaseItPnpmPlugin extends Plugin {
},
})
this.debug({ result })

if (
result.releaseType === 'patch'
&& !await shouldSemanticRelease({ verbose: false })
) {
return null
}

let { releaseType } = result
if (isPreRelease) {
const type
Expand Down

0 comments on commit 9d4ad8e

Please sign in to comment.