From b29ad42544ea30ba62264ac9dfd8457fcdb7d16e Mon Sep 17 00:00:00 2001 From: Curtis Man Date: Fri, 5 May 2023 12:57:13 -0700 Subject: [PATCH] build: support workspace as dependency version (#15474) The repo switch to use "workspace:" as the monorepo dependency version. Add `fluid-build` support for that. --- .../packages/build-tools/src/fluidBuild/buildGraph.ts | 5 ++++- .../packages/build-tools/src/fluidBuild/symlinkUtils.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/build-tools/packages/build-tools/src/fluidBuild/buildGraph.ts b/build-tools/packages/build-tools/src/fluidBuild/buildGraph.ts index 02d8ad6782c7..6091ed8c6918 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/buildGraph.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/buildGraph.ts @@ -219,7 +219,10 @@ export class BuildGraph { const child = this.buildPackages.get(name); if (child) { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - if (semver.satisfies(child.pkg.version, version!)) { + const satisfied = + version!.startsWith("workspace:") || + semver.satisfies(child.pkg.version, version!); + if (satisfied) { if (depFilter(child.pkg)) { verbose( `Package dependency: ${node.pkg.nameColored} => ${child.pkg.nameColored}`, diff --git a/build-tools/packages/build-tools/src/fluidBuild/symlinkUtils.ts b/build-tools/packages/build-tools/src/fluidBuild/symlinkUtils.ts index 570ef98fe471..6836cf171104 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/symlinkUtils.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/symlinkUtils.ts @@ -159,7 +159,7 @@ export async function symlinkPackage( for (const { name: dep, version } of pkg.combinedDependencies) { const depBuildPackage = buildPackages.get(dep); // Check and fix link if it is a known package and version satisfy the version. - // TODO: check of extranous symlinks + // TODO: check of extraneous symlinks if (depBuildPackage) { const sameMonoRepo = MonoRepo.isSame(pkg.monoRepo, depBuildPackage.monoRepo); const satisfied =