mirror of
https://github.com/RaisFast/raisfast-frontend-sdk.git
synced 2026-09-27 16:02:28 +00:00
21 lines
802 B
JavaScript
21 lines
802 B
JavaScript
import { cpSync, mkdirSync, rmSync } from "node:fs";
|
|
import { dirname, resolve } from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
import { spawnSync } from "node:child_process";
|
|
|
|
const sdkDir = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
const tsupBin = resolve(sdkDir, "node_modules/.bin/tsup");
|
|
const distDir = resolve(sdkDir, "dist");
|
|
const targetDir = resolve(sdkDir, "../admin/node_modules/@raisfast/sdk/dist");
|
|
|
|
const build = spawnSync(tsupBin, [], { stdio: "inherit", shell: process.platform === "win32" });
|
|
if (build.status !== 0) {
|
|
process.exit(build.status ?? 1);
|
|
}
|
|
|
|
rmSync(targetDir, { recursive: true, force: true });
|
|
mkdirSync(targetDir, { recursive: true });
|
|
cpSync(distDir, targetDir, { recursive: true });
|
|
|
|
console.log(`Linked @raisfast/sdk → ${targetDir}`);
|