Skip to content

Commit d3ff8dc

Browse files
Merge pull request #1427 from intuit/independent-prereleases
don't prefix tags in lerna independent mode
2 parents 1c6615d + cbf088b commit d3ff8dc

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

plugins/npm/__tests__/npm-next.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ describe("next", () => {
313313
remote: "origin",
314314
baseBranch: "master",
315315
logger: dummyLog(),
316-
prefixRelease: (v: string) => v,
316+
prefixRelease: (v: string) => `v${v}`,
317317
git: {
318318
getLatestRelease: () => "@foo/1@0.1.0",
319319
getLastTagNotInBaseBranch: () => "@foo/1@1.0.0-next.0",

plugins/npm/src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ function getLegacyAuthArgs(
211211
/** Get the args to set the registry. Only used with lerna */
212212
async function getRegistryArgs() {
213213
const registry = await getRegistry();
214-
return registry === DEFAULT_REGISTRY || !registry ? [] : ["--registry", registry];
214+
return registry === DEFAULT_REGISTRY || !registry
215+
? []
216+
: ["--registry", registry];
215217
}
216218

217219
const pluginOptions = t.partial({
@@ -945,7 +947,7 @@ export default class NPMPlugin implements IPlugin {
945947

946948
preReleaseVersions = [
947949
...preReleaseVersions,
948-
...tags.map(auto.prefixRelease),
950+
...(isIndependent ? tags : tags.map(auto.prefixRelease)),
949951
];
950952
} else {
951953
auto.logger.verbose.info("Detected single npm package");

0 commit comments

Comments
 (0)