From 1a66cca9726ba65c843a32814d06115f8cddfe4b Mon Sep 17 00:00:00 2001 From: Greg Soltis Date: Wed, 9 Mar 2022 15:01:18 -0800 Subject: [PATCH] depending on "*" should match everything, even if that doesn't conform to semver --- cli/internal/context/context.go | 4 +++- cli/internal/context/context_test.go | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cli/internal/context/context.go b/cli/internal/context/context.go index c70a40eaf97d6..0cdb7dc319407 100644 --- a/cli/internal/context/context.go +++ b/cli/internal/context/context.go @@ -105,7 +105,9 @@ func isWorkspaceReference(packageVersion string, dependencyVersion string, cwd s } else if isProtocolExternal(protocol) { // Other protocols are assumed to be external references ("github:", "link:", "file:" etc) return false - } + } else if dependencyVersion == "*" { + return true + } // If we got this far, then we need to check the workspace package version to see it satisfies // the dependencies range to determin whether or not its an internal or external dependency. diff --git a/cli/internal/context/context_test.go b/cli/internal/context/context_test.go index 9c3c22a375b9b..5761be9052fbd 100644 --- a/cli/internal/context/context_test.go +++ b/cli/internal/context/context_test.go @@ -113,6 +113,12 @@ func Test_isWorkspaceReference(t *testing.T) { dependencyVersion: "file:../../../otherproject", want: false, // this is not within the repo root }, + { + name: "handles development versions", + packageVersion: "0.0.0-development", + dependencyVersion: "*", + want: true, // "*" should always match + }, } for _, tt := range tests {