Skip to content

Commit d59624f

Browse files
committed
fix: local workspaces resolution
1 parent 70f46a2 commit d59624f

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,5 @@
5151
"ts-node": "^10.9.2",
5252
"typescript": "^5.8.2",
5353
"yaml": "^2.7.0"
54-
},
55-
"dependencies": {
56-
"@crossplane-js/sdk": "workspace:^"
5754
}
5855
}

pkg/node/dependency.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ func (dr *DependencyResolver) ResolveDependencies(inputDependencies map[string]s
2929
for k, v := range inputDependencies {
3030
resolvedDep := v
3131

32+
if strings.HasPrefix(k, "@crossplane-js/") {
33+
// Resolve crossplane package dependencies
34+
if resolved, _, resolveErr := ResolveWorkspacePackage(k, workspaceRoot, workspaceMap, logger); resolveErr != nil {
35+
logger.WithField("dependency", k).
36+
WithField("value", v).
37+
WithField("error", resolveErr.Error()).
38+
Warn("Failed to resolve crossplane dependency, using original value")
39+
} else {
40+
resolvedDep = resolved
41+
}
42+
}
43+
3244
if strings.HasPrefix(v, "link:") {
3345
// Resolve workspace package dependencies
3446
if resolved, _, resolveErr := ResolveWorkspacePackage(k, workspaceRoot, workspaceMap, logger); resolveErr != nil {

pkg/node/yarn.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func (yq *YarnQueue) executeYarnInstall(job *YarnInstallJob) error {
7777
jobLogger.Info("Starting queued yarn install")
7878

7979
// Create yarn command
80-
yarnCmd := exec.CommandContext(job.Context, "yarn", "install")
80+
yarnCmd := exec.CommandContext(job.Context, "yarn", "workspaces", "focus")
8181
yarnCmd.Dir = job.WorkDir
8282
yarnCmd.Env = os.Environ()
8383

317 Bytes
Binary file not shown.

yarn.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,6 @@ __metadata:
287287
version: 0.0.0-use.local
288288
resolution: "@crossplane-js/dev@workspace:."
289289
dependencies:
290-
"@crossplane-js/sdk": "workspace:^"
291290
"@eslint/compat": "npm:^1.2.7"
292291
"@eslint/eslintrc": "npm:^3.3.1"
293292
"@eslint/js": "npm:^9.23.0"

0 commit comments

Comments
 (0)