Skip to content

Commit de2e37e

Browse files
committed
ci(react): use patch-commit-filter and cap at minor for upstream changes
Replace semantic-release-commit-filter with patch-commit-filter so react sees superdoc/layout-engine/super-editor commits. Add capped releaseRules to prevent accidental major bumps from upstream breaking changes.
1 parent c61f9cd commit de2e37e

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

packages/react/.releaserc.cjs

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
11
/* eslint-env node */
2+
/*
3+
* Commit filter: react wraps superdoc, so git log must include
4+
* commits touching superdoc's sub-packages. This shared helper patches
5+
* git-log-parser to expand path coverage. It REPLACES
6+
* semantic-release-commit-filter — do not use both (the filter restricts
7+
* to CWD, which undoes the expansion).
8+
*
9+
* Keep in sync with .github/workflows/release-react.yml paths: trigger.
10+
*/
11+
require('../../scripts/semantic-release/patch-commit-filter.cjs')([
12+
'packages/react',
13+
'packages/superdoc',
14+
'packages/super-editor',
15+
'packages/layout-engine',
16+
'packages/ai',
17+
'packages/word-layout',
18+
'packages/preset-geometry',
19+
'pnpm-workspace.yaml',
20+
]);
21+
222
const branch = process.env.GITHUB_REF_NAME || process.env.CI_COMMIT_BRANCH;
323

424
const branches = [
@@ -19,8 +39,21 @@ const config = {
1939
branches,
2040
tagFormat: 'react-v${version}',
2141
plugins: [
22-
'semantic-release-commit-filter',
23-
'@semantic-release/commit-analyzer',
42+
[
43+
'@semantic-release/commit-analyzer',
44+
{
45+
// Cap at minor — react wraps superdoc, so upstream breaking
46+
// changes don't break react's own public API.
47+
// Prevents accidental major bumps from superdoc feat!/BREAKING CHANGE commits.
48+
releaseRules: [
49+
{ breaking: true, release: 'minor' },
50+
{ type: 'feat', release: 'minor' },
51+
{ type: 'fix', release: 'patch' },
52+
{ type: 'perf', release: 'patch' },
53+
{ type: 'revert', release: 'patch' },
54+
],
55+
},
56+
],
2457
notesPlugin,
2558
['semantic-release-pnpm', { npmPublish: false }],
2659
'../../scripts/publish-react.cjs',

0 commit comments

Comments
 (0)