Skip to content

Commit 5fcdc42

Browse files
authored
Merge pull request microsoft#1119 from Microsoft/ianc/fixing-issue-with-yarn-pack
[rush] Fix an issue with rush publish --pack with yarn.
2 parents 4b1d1a2 + 3e96fd7 commit 5fcdc42

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

‎apps/rush-lib/src/cli/actions/PublishAction.ts‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,14 @@ export class PublishAction extends BaseRushAction {
473473
private _calculateTarballName(project: RushConfigurationProject): string {
474474
// Same logic as how npm forms the tarball name
475475
const packageName: string = project.packageName;
476-
const name: string = packageName[0] === '@' ?
477-
packageName.substr(1).replace(/\//g, '-') : packageName;
476+
const name: string = packageName[0] === '@' ? packageName.substr(1).replace(/\//g, '-') : packageName;
478477

479-
return `${name}-${project.packageJson.version}.tgz`;
478+
if (this.rushConfiguration.packageManager === 'yarn') {
479+
// yarn tarballs have a "v" before the version number
480+
return `${name}-v${project.packageJson.version}.tgz`;
481+
} else {
482+
return `${name}-${project.packageJson.version}.tgz`;
483+
}
480484
}
481485

482486
private _setDependenciesBeforePublish(): void {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "Fix an issue with \"rush publish --pack\" when using yarn.",
5+
"packageName": "@microsoft/rush",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/rush",
10+
"email": "iclanton@users.noreply.github.com"
11+
}

0 commit comments

Comments
 (0)