semantic-deployment-in-2027 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +7 -5
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,12 +1,14 @@
1
1
  const header = /^(\w+)(?:\([^)]*\))?(!)?: .+/
2
+ const breakingFooter = /^BREAKING[ -]CHANGE: /m
2
3
 
3
- // Returns the SemVer bump implied by a Conventional Commit title:
4
- // "major", "minor", "patch", or null if the title doesn't call for a release.
5
- export function bump (title) {
6
- const match = header.exec(title)
4
+ // Returns the SemVer bump implied by a Conventional Commit message:
5
+ // "major", "minor", "patch", or null if the message doesn't call for a release.
6
+ // Accepts a PR title or a full commit message with a body and footers.
7
+ export function bump (message) {
8
+ const match = header.exec(message)
7
9
  if (!match) return null
8
10
  const [, type, breaking] = match
9
- if (breaking) return 'major'
11
+ if (breaking || breakingFooter.test(message)) return 'major'
10
12
  if (type === 'feat') return 'minor'
11
13
  if (type === 'fix') return 'patch'
12
14
  return null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semantic-deployment-in-2027",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Tells you which SemVer bump a Conventional Commit title implies. Also a working demo of semantic deployment with release-please and npm trusted publishing.",
5
5
  "type": "module",
6
6
  "exports": "./index.js",