From 84bee96441e79351b789ee76715df98562a14028 Mon Sep 17 00:00:00 2001 From: Thijs Koerselman Date: Sun, 9 Jun 2024 19:11:23 +0200 Subject: [PATCH 1/3] Fix various paths for windows --- src/lib/registry/create-packages-registry.ts | 4 ++-- src/lib/utils/get-relative-path.ts | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/lib/registry/create-packages-registry.ts b/src/lib/registry/create-packages-registry.ts index 4209f79..8e321a9 100644 --- a/src/lib/registry/create-packages-registry.ts +++ b/src/lib/registry/create-packages-registry.ts @@ -36,11 +36,11 @@ export async function createPackagesRegistry( if (!fs.existsSync(manifestPath)) { log.warn( - `Ignoring directory ./${rootRelativeDir} because it does not contain a package.json file` + `Ignoring directory ${rootRelativeDir} because it does not contain a package.json file` ); return; } else { - log.debug(`Registering package ./${rootRelativeDir}`); + log.debug(`Registering package ${rootRelativeDir}`); const manifest = await readTypedJson( path.join(absoluteDir, "package.json") diff --git a/src/lib/utils/get-relative-path.ts b/src/lib/utils/get-relative-path.ts index ab6e70a..78bb5cb 100644 --- a/src/lib/utils/get-relative-path.ts +++ b/src/lib/utils/get-relative-path.ts @@ -1,15 +1,13 @@ +import { join } from "node:path"; + export function getRootRelativePath(path: string, rootPath: string) { const strippedPath = path.replace(rootPath, ""); - return strippedPath.startsWith("/") - ? `(root)${strippedPath}` - : `(root)/${strippedPath}`; + return join("(root)", strippedPath); } export function getIsolateRelativePath(path: string, isolatePath: string) { const strippedPath = path.replace(isolatePath, ""); - return strippedPath.startsWith("/") - ? `(isolate)${strippedPath}` - : `(isolate)/${strippedPath}`; + return join("(isolate)", strippedPath); } From 76bcc1205ba8d70afb2a593ea947d17dc1d04eb2 Mon Sep 17 00:00:00 2001 From: Thijs Koerselman Date: Sun, 9 Jun 2024 19:11:40 +0200 Subject: [PATCH 2/3] Fix packages mapped paths --- src/isolate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/isolate.ts b/src/isolate.ts index b04ba6f..451c100 100644 --- a/src/isolate.ts +++ b/src/isolate.ts @@ -213,7 +213,7 @@ export async function isolate( log.debug("Generating pnpm-workspace.yaml for Rush workspace"); log.debug("Packages folder names:", packagesFolderNames); - const packages = packagesFolderNames.map((x) => x + "/*"); + const packages = packagesFolderNames.map((x) => path.join(x, "/*")); await writeTypedYamlSync(path.join(isolateDir, "pnpm-workspace.yaml"), { packages, From a2013b90c113dc26d7d3fbb757d54aa65c11ce88 Mon Sep 17 00:00:00 2001 From: Thijs Koerselman Date: Sun, 9 Jun 2024 19:14:46 +0200 Subject: [PATCH 3/3] 1.18.0-0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ab41b16..07fdeac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "isolate-package", - "version": "1.17.0", + "version": "1.18.0-0", "description": "Isolate a monorepo package with its shared dependencies to form a self-contained directory, compatible with Firebase deploy", "author": "Thijs Koerselman", "license": "MIT",