Skip to content

Commit

Permalink
fix(publish): use updated version with pnpm workspaces (#3606)
Browse files Browse the repository at this point in the history
  • Loading branch information
fahslaj committed Mar 24, 2023
1 parent b826398 commit cd7ad21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libs/commands/publish/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,15 +671,15 @@ class PublishCommand extends Command {
for (const [depName, resolved] of node.localDependencies) {
// only update local dependencies with workspace: links
if (resolved.workspaceSpec) {
let depVersion;
let savePrefix;
let depVersion: string;
let savePrefix: string;
if (resolved.workspaceAlias) {
depVersion = this.updatesVersions.get(depName) || this.packageGraph.get(depName).pkg.version;
savePrefix = resolved.workspaceAlias === "*" ? "" : resolved.workspaceAlias;
} else {
const specMatch = resolved.workspaceSpec.match(/^workspace:([~^]?)(.*)/);
savePrefix = specMatch[1];
depVersion = specMatch[2];
depVersion = this.updatesVersions.get(depName) || this.packageGraph.get(depName).pkg.version;
}

// it no longer matters if we mutate the shared Package instance
Expand Down

0 comments on commit cd7ad21

Please sign in to comment.