Skip to content

Commit

Permalink
Fixes pack when a workspace dependency has no version (#2479)
Browse files Browse the repository at this point in the history
* Uses 0.0.0 when no workspace version is configured

* Adds versions
  • Loading branch information
arcanis authored Feb 15, 2021
1 parent 0edf724 commit cb4eede
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
23 changes: 23 additions & 0 deletions .yarn/versions/08c52146.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
releases:
"@yarnpkg/cli": patch
"@yarnpkg/plugin-pack": patch

declined:
- "@yarnpkg/plugin-compat"
- "@yarnpkg/plugin-constraints"
- "@yarnpkg/plugin-dlx"
- "@yarnpkg/plugin-essentials"
- "@yarnpkg/plugin-init"
- "@yarnpkg/plugin-interactive-tools"
- "@yarnpkg/plugin-node-modules"
- "@yarnpkg/plugin-npm"
- "@yarnpkg/plugin-npm-cli"
- "@yarnpkg/plugin-patch"
- "@yarnpkg/plugin-pnp"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/plugin-version"
- "@yarnpkg/plugin-workspace-tools"
- "@yarnpkg/builder"
- "@yarnpkg/core"
- "@yarnpkg/doctor"
3 changes: 1 addition & 2 deletions packages/plugin-pack/sources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,11 @@ const beforeWorkspacePacking = (workspace: Workspace, rawManifest: any) => {

// For workspace:path/to/workspace and workspace:* we look up the workspace version
if (structUtils.areDescriptorsEqual(descriptor, matchingWorkspace.anchoredDescriptor) || range.selector === `*`)
versionToWrite = matchingWorkspace.manifest.version!;
versionToWrite = matchingWorkspace.manifest.version ?? `0.0.0`;
else
// for workspace:version we simply strip the protocol
versionToWrite = range.selector;


rawManifest[dependencyType][structUtils.stringifyIdent(descriptor)] = versionToWrite;
}
}
Expand Down

0 comments on commit cb4eede

Please sign in to comment.