Skip to content

Commit

Permalink
Improve support for windows (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
0x80 authored Jun 9, 2024
1 parent 5dbd60b commit 877b05a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/isolate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/lib/registry/create-packages-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<PackageManifest>(
path.join(absoluteDir, "package.json")
Expand Down
10 changes: 4 additions & 6 deletions src/lib/utils/get-relative-path.ts
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit 877b05a

Please sign in to comment.