isolate-package
Version:
Isolate monorepo packages to form a self-contained deployable unit
19 lines (16 loc) • 490 B
text/typescript
import fs from "fs-extra";
import path from "node:path";
import type { PackageManifest } from "../types";
import { readTypedJson } from "../utils";
export async function readManifest(packageDir: string) {
return readTypedJson<PackageManifest>(path.join(packageDir, "package.json"));
}
export async function writeManifest(
outputDir: string,
manifest: PackageManifest,
) {
await fs.writeFile(
path.join(outputDir, "package.json"),
JSON.stringify(manifest, null, 2),
);
}