From 25bdda688eee9f52de3db5d0bfae886184f942bf Mon Sep 17 00:00:00 2001 From: Victor Korzunin <5180700+floydspace@users.noreply.github.com> Date: Tue, 31 Oct 2023 20:33:43 +0000 Subject: [PATCH] fix(monorepo): consistent path for windows users --- .../monorepo/src/components/nx-project/index.ts | 14 +++++++++----- .../src/projects/typescript/monorepo-ts.ts | 3 ++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/monorepo/src/components/nx-project/index.ts b/packages/monorepo/src/components/nx-project/index.ts index cfe2c112f..561bd8318 100644 --- a/packages/monorepo/src/components/nx-project/index.ts +++ b/packages/monorepo/src/components/nx-project/index.ts @@ -106,7 +106,11 @@ export class NxProject extends Component { const _obj: Record any> = { name: () => this.project.name, - root: () => path.relative(this.project.root.outdir, this.project.outdir), + root: () => + path + .relative(this.project.root.outdir, this.project.outdir) + .split(path.sep) + .join("/"), namedInputs: () => asUndefinedIfEmpty(this.namedInputs), targets: () => asUndefinedIfEmpty(this.targets), tags: () => asUndefinedIfEmpty(this.tags), @@ -313,10 +317,10 @@ export class NxProject extends Component { /** @interface */ synthesize() { - const projectPath = path.relative( - this.project.root.outdir, - this.project.outdir - ); + const projectPath = path + .relative(this.project.root.outdir, this.project.outdir) + .split(path.sep) + .join("/"); const isNodeProject = NodePackageUtils.isNodeProject(this.project); diff --git a/packages/monorepo/src/projects/typescript/monorepo-ts.ts b/packages/monorepo/src/projects/typescript/monorepo-ts.ts index 47b92e5d7..c6cb2f979 100644 --- a/packages/monorepo/src/projects/typescript/monorepo-ts.ts +++ b/packages/monorepo/src/projects/typescript/monorepo-ts.ts @@ -401,7 +401,8 @@ export class MonorepoTsProject // Any subprojects that were added since the last call to this method need to be added first, in order to ensure // we add the workspace packages in a sane order. const relativeSubProjectWorkspacePackages = this.sortedSubProjects.map( - (project) => path.relative(this.outdir, project.outdir) + (project) => + path.relative(this.outdir, project.outdir).split(path.sep).join("/") ); const existingWorkspacePackages = new Set(this.workspacePackages); this.workspacePackages.push(