Skip to content

Commit

Permalink
Merge pull request #1997 from 10hendersonm/canary_double_dash
Browse files Browse the repository at this point in the history
fix(npm): Prevents canary releases with double dashed version numbers
  • Loading branch information
hipstersmoothie authored May 25, 2021
2 parents 1f27b91 + f1ffa23 commit 1e83684
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions plugins/npm/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,9 @@ export default class NPMPlugin implements IPlugin {
}
};

canaryIdentifier = canaryIdentifier.replace(/^-/, "")


if (isMonorepo()) {
const isIndependent = getLernaJson().version === "independent";
auto.logger.verbose.info("Detected monorepo, using lerna");
Expand Down Expand Up @@ -1054,7 +1057,7 @@ export default class NPMPlugin implements IPlugin {
"--exact",
"--ignore-scripts",
"--preid",
canaryIdentifier.replace(/^-/, ""),
canaryIdentifier,
...verboseArgs,
]);

Expand All @@ -1080,7 +1083,7 @@ export default class NPMPlugin implements IPlugin {
"--no-git-tag-version", // no need to tag and commit,
"--exact", // do not add ^ to canary versions, this can result in `npm i` resolving the wrong canary version
...(isIndependent
? ["--preid", canaryIdentifier.replace(/^-/, "")]
? ["--preid", canaryIdentifier]
: []),
...verboseArgs,
]);
Expand Down

0 comments on commit 1e83684

Please sign in to comment.