Skip to content

Commit

Permalink
🩹 (┛ಠ_ಠ)┛彡┻━┻) NICE-126 patch commit-analyzer@13 [b] (#1493)
Browse files Browse the repository at this point in the history
Seems to be skipping upgrades, which, you know are important.

# (┛ಠ_ಠ)┛彡┻━┻

At the risk of coming off as rude, this is a hack patch.

Please move away from `semantic-release`.

## (┛ಠ_ಠ)┛彡┻━┻

## (┛ಠ_ಠ)┛彡┻━┻

## (┛ಠ_ಠ)┛彡┻━┻

## (┛ಠ_ಠ)┛彡┻━┻

## (┛ಠ_ಠ)┛彡┻━┻


## Example:

⬆️ (deps) @radix-ui/themes@3.1.1

Would not trigger a build (in a non-packages repo).
  • Loading branch information
JeromeFitz committed Jun 23, 2024
1 parent 048bce0 commit 1c35c6a
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 11 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
"registry": "https://registry.npmjs.org/"
},
"pnpm": {
"patchedDependencies": {
"@semantic-release/commit-analyzer@13.0.0": "patches/@semantic-release__commit-analyzer@13.0.0.patch"
},
"overrides": {
"micromatch": "4.0.5"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ccommit/release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const { name } = pkg

const branches = [
...configDefault.branches,
{ name: 'NICE-70', prerelease: 'canary' },
{ name: 'NICE-126', prerelease: 'canary' },
]

const configPassed = {
Expand Down
2 changes: 1 addition & 1 deletion packages/ccommit/src/data/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ const types = [
},
{
code: ':package:',
description: 'Add or update compiled files or packages',
description: 'Add or Update Compiled Files or Packages',
emoji: '📦️',
emojiLength: 1,
semver: SEMVER.PATCH,
Expand Down
2 changes: 1 addition & 1 deletion packages/conventional-gitmoji/release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const { name } = pkg

const branches = [
...configDefault.branches,
{ name: 'NICE-70', prerelease: 'canary' },
{ name: 'NICE-126', prerelease: 'canary' },
]

const configPassed = {
Expand Down
3 changes: 1 addition & 2 deletions packages/release-notes-generator/release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ const { name } = pkg

const branches = [
...configDefault.branches,
{ name: 'NICE-70', prerelease: 'canary' },
{ name: 'fix/semantic-workspace-check', prerelease: 'canary' },
{ name: 'NICE-126', prerelease: 'canary' },
]

const configPassed = {
Expand Down
4 changes: 3 additions & 1 deletion packages/semantic/.gitkeep
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
If `conventional-gitmoji` updated and this package has not
modify this file to force a build (until automation)
modify this file to force a build (until automation)

Testing
1 change: 1 addition & 0 deletions packages/semantic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@jeromefitz/conventional-gitmoji": "^4.0.0"
},
"dependencies": {
"@semantic-release/commit-analyzer": "13.0.0",
"@semantic-release/git": "10.0.1",
"semantic-release": "24.0.0",
"semantic-release-commit-filter": "1.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/semantic/release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const { name } = pkg

const branches = [
...configDefault.branches,
{ name: 'fix/semantic-workspace-check', prerelease: 'canary' },
{ name: 'NICE-126', prerelease: 'canary' },
]

const configPassed = {
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const { name } = pkg

const branches = [
...configDefault.branches,
{ name: 'fix/semantic-workspace-check', prerelease: 'canary' },
{ name: 'NICE-126', prerelease: 'canary' },
]

const configPassed = {
Expand Down
41 changes: 41 additions & 0 deletions patches/@semantic-release__commit-analyzer@13.0.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
diff --git a/lib/analyze-commit.js b/lib/analyze-commit.js
index 35a4e7d1aa4acc25a5dbeb36d7d58db23b50b7e7..90c8663686db553974e8fca342d73a4a59d8639f 100644
--- a/lib/analyze-commit.js
+++ b/lib/analyze-commit.js
@@ -18,14 +18,28 @@ export default (releaseRules, commit) => {
releaseRules
.filter(
({ breaking, revert, release, ...rule }) =>
- // If the rule is not `breaking` or the commit doesn't have a breaking change note
- (!breaking || (commit.notes && commit.notes.length > 0)) &&
- // If the rule is not `revert` or the commit is not a revert
- (!revert || commit.revert) &&
- // Otherwise match the regular rules
- isMatchWith(commit, rule, (object, src) =>
- isString(src) && isString(object) ? micromatch.isMatch(object, src) : undefined
- )
+ // // If the rule is not `breaking` or the commit doesn't have a breaking change note
+ // (!breaking || (commit.notes && commit.notes.length > 0)) &&
+ // // If the rule is not `revert` or the commit is not a revert
+ // (!revert || commit.revert) &&
+ // // Otherwise match the regular rules
+ // isMatchWith(commit, rule, (object, src) =>
+ // isString(src) && isString(object) ? micromatch.isMatch(object, src) : undefined
+ // )
+
+ {
+ if (
+ (!breaking || (commit.notes && commit.notes.length > 0)) &&
+ (!revert || commit.revert) &&
+ isString(commit.subject) && isString(rule.type) &&
+ micromatch.contains(commit.subject, rule.type)
+ ) {
+ return {
+ ...commit,
+ ...rule
+ }
+ }
+ }
)
.every((match) => {
if (compareReleaseTypes(releaseType, match.release)) {
30 changes: 27 additions & 3 deletions pnpm-lock.yaml

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

0 comments on commit 1c35c6a

Please sign in to comment.