Skip to content

Commit 89ddc63

Browse files
committed
feat(core): extraScopes monorepo bump parameter
1 parent 82ed916 commit 89ddc63

File tree

7 files changed

+67
-50
lines changed

7 files changed

+67
-50
lines changed

.simple-release.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ export const releaser = {
88
verbose: true
99
}
1010

11+
export const bump = {
12+
extraScopes: ['deps']
13+
}
14+
1115
export const publish = {
1216
access: 'public'
1317
}

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"@simple-libs/hosted-git-info": "^1.0.1",
6565
"@simple-libs/stream-utils": "^1.0.0",
6666
"conventional-changelog": "^7.1.0",
67-
"conventional-changelog-conventionalcommits": "^9.0.0",
67+
"conventional-changelog-conventionalcommits": "^9.1.0",
6868
"conventional-changelog-preset-loader": "^5.0.0",
6969
"conventional-recommended-bump": "^11.2.0",
7070
"semver": "^7.5.2"

packages/core/src/project/monorepo.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ export abstract class MonorepoProject extends Project {
202202
) {
203203
const {
204204
preset = bumpDefaultOptions.preset,
205+
extraScopes = [],
205206
byProject,
206207
...bumpOptions
207208
} = options
@@ -215,7 +216,7 @@ export abstract class MonorepoProject extends Project {
215216
name: preset
216217
}
217218
: preset,
218-
scope
219+
scope: [scope, ...extraScopes]
219220
}
220221
const projectBumpOptions = {
221222
...bumpOptions,
@@ -299,7 +300,7 @@ export abstract class MonorepoProject extends Project {
299300
if (fixedVersion) {
300301
hasBump = await super.bump({
301302
...options,
302-
force: true,
303+
forcePrivate: true,
303304
version: fixedVersion,
304305
tagPrefix: await this.getTagPrefix('')
305306
})

packages/core/src/project/monorepo.types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ export interface MonorepoProjectBumpOptions extends Omit<ProjectBumpOptions, 'ta
5252
* Force bump projects without changes in the monorepo with fixed mode.
5353
*/
5454
force?: boolean
55+
/**
56+
* Extra scopes to include in the project's changelog.
57+
* For example, to include commits like "fix(deps): voulnerability in dependency fix" you can add "deps" to the extraScopes.
58+
*/
59+
extraScopes?: string[]
5560
/**
5661
* Bump options for specific projects.
5762
*/

packages/core/src/project/project.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export abstract class Project {
180180
manifest
181181
} = this
182182

183-
if (options.skip || !options.force && await manifest.isPrivate()) {
183+
if (options.skip || !options.forcePrivate && await manifest.isPrivate()) {
184184
return null
185185
}
186186

packages/core/src/project/project.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export interface ProjectBumpOptions {
6464
/**
6565
* Ignore that project is private.
6666
*/
67-
force?: boolean
67+
forcePrivate?: boolean
6868
preset?: PresetParams
6969
/**
7070
* The prefix to use for the tag.

pnpm-lock.yaml

Lines changed: 52 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)