Skip to content

Commit 7012e65

Browse files
moroineantongolub
authored andcommitted
feat: add ignore-private-packages option
1 parent 6943150 commit 7012e65

File tree

4 files changed

+275
-135
lines changed

4 files changed

+275
-135
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ There are several tweaks to adapt **msr** to some corner cases:
120120
|`--deps.release`|string| Define release type for dependent package if any of its deps changes. `patch`, `minor`, `major` — strictly declare the release type that occurs when any dependency is updated; `inherit` — applies the "highest" release of updated deps to the package. For example, if any dep has a breaking change, `major` release will be applied to the all dependants up the chain. **Experimental feat** | `patch`
121121
|`--dry-run`|bool |Dry run mode| `false`
122122
|`--ignore-packages`|string|Packages list to be ignored on bumping process (append to the ones that already exist at package.json workspaces)|`null`
123+
|`--ignore-private-packages`|bool |Private packages will be ignored |`false`
123124

124125
Examples:
125126

bin/cli.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ const cli = meow(
1515
--first-parent Apply commit filtering to current branch only.
1616
--deps.bump Define deps version updating rule. Allowed: override, satisfy, inherit.
1717
--deps.release Define release type for dependent package if any of its deps changes. Supported values: patch, minor, major, inherit.
18-
--ignore-packages Packages' list to be ignored on bumping process
19-
--help Help info.
18+
--ignore-packages Packages' list to be ignored on bumping process
19+
--ignore-private-packages Ignore private packages
20+
--help Help info.
2021
2122
Examples
2223
$ multi-semantic-release --debug
@@ -45,6 +46,9 @@ const cli = meow(
4546
ignorePackages: {
4647
type: "string",
4748
},
49+
ignorePrivatePackages: {
50+
type: "boolean",
51+
},
4852
dryRun: {
4953
type: "boolean",
5054
},

lib/multiSemanticRelease.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ async function multiSemanticRelease(
6969
// Load packages from paths.
7070
const allPackages = await Promise.all(paths.map((path) => getPackage(path, multiContext)));
7171
const packages = allPackages.filter((p) => {
72-
// if (p.manifest.private === true) {
73-
// logger.warn(`[${p.name}] is private, will be ignored`);
74-
// return false;
75-
// }
72+
if (flags.ignorePrivatePackages && p.manifest.private === true) {
73+
logger.warn(`[${p.name}] is private, will be ignored`);
74+
return false;
75+
}
7676

7777
return true;
7878
});

0 commit comments

Comments
 (0)