@jcoreio/toolchain-semantic-release 4.8.0 → 4.9.1

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/package.json +2 -2
  2. package/release.config.cjs +17 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jcoreio/toolchain-semantic-release",
3
- "version": "4.8.0",
3
+ "version": "4.9.1",
4
4
  "description": "toolchain for running semantic-release",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,7 @@
16
16
  "dependencies": {
17
17
  "dedent-js": "^1.0.1",
18
18
  "resolve-bin": "^1.0.0",
19
- "@jcoreio/toolchain": "4.8.0"
19
+ "@jcoreio/toolchain": "4.9.1"
20
20
  },
21
21
  "bin": {
22
22
  "semantic-release": "./bin/semantic-release"
@@ -1,6 +1,6 @@
1
1
  const {
2
2
  projectDir,
3
- packageJson: { name: pkg, private },
3
+ packageJson: { name: pkg, private: _private },
4
4
  monorepoSubpackageJsonFiles,
5
5
  monorepoPackageJson,
6
6
  } = require('@jcoreio/toolchain/util/findUps.cjs')
@@ -38,6 +38,7 @@ module.exports =
38
38
  monorepoPackageJson.name !== '@jcoreio/toolchains'
39
39
  ? {
40
40
  ...base,
41
+ // use separate git tags for each subpackage
41
42
  tagFormat: `${pkg}-v\${version}`,
42
43
  plugins: [
43
44
  [
@@ -45,17 +46,24 @@ module.exports =
45
46
  {
46
47
  preset: 'conventionalcommits',
47
48
  releaseRules: [
49
+ // don't let commits scoped to other packages like fix(otherPackageName): ... trigger a release in this package
48
50
  ...otherPackages.flatMap((scope) => ({
49
51
  scope,
50
52
  release: false,
51
53
  })),
52
- ...[pkg, undefined].flatMap((scope) => [
54
+ ...[
55
+ // make commits scoped to this package like fix(packageName): ... trigger a release in this package
56
+ pkg,
57
+ // make unscoped commits like fix: ... trigger a release in all packages
58
+ undefined,
59
+ ].flatMap((scope) => [
53
60
  { breaking: true, scope, release: 'major' },
54
61
  { revert: true, scope, release: 'patch' },
55
62
  { type: 'feat', scope, release: 'minor' },
56
63
  { type: 'fix', scope, release: 'patch' },
57
64
  { type: 'perf', scope, release: 'patch' },
58
65
  ]),
66
+ // don't let any other types of commits trigger a release
59
67
  { scope: undefined, release: false },
60
68
  ],
61
69
  },
@@ -82,22 +90,27 @@ module.exports =
82
90
  { type: 'perf', section: 'Performance Improvements' },
83
91
  { type: 'refactor', section: 'Code Refactoring' },
84
92
  ].flatMap((cfg) => [
93
+ // include commits scoped to this package like fix(packageName): ... in the release notes for this package
85
94
  { ...cfg, scope: pkg, hidden: false },
95
+ // exclude commits scoped to other packages like fix(otherPackageName): ... from the release notes for this package
86
96
  ...otherPackages.map((otherPkg) => ({
87
97
  ...cfg,
88
98
  scope: otherPkg,
89
99
  hidden: true,
90
100
  })),
101
+ // include unscoped commits like fix: ... in the release notes for all packages
91
102
  { ...cfg, hidden: false },
92
103
  ]),
93
104
  ],
94
105
  },
95
106
  },
96
107
  ],
97
- ...(private
108
+ ...(_private
98
109
  ? []
99
110
  : [
100
111
  [
112
+ // this fork of @semantic-release/npm includes a patch that is necessary to fix an issue with monorepos
113
+ // https://github.com/semantic-release/npm/pull/531
101
114
  require.resolve('@jcoreio/semantic-release-npm'),
102
115
  {
103
116
  pkgRoot: path.join(projectDir, 'dist'),
@@ -113,7 +126,7 @@ module.exports =
113
126
  plugins: [
114
127
  require.resolve('@semantic-release/commit-analyzer'),
115
128
  require.resolve('@semantic-release/release-notes-generator'),
116
- ...(private
129
+ ...(_private
117
130
  ? []
118
131
  : [
119
132
  [