Lines 3584-3624javascript
3585 const req = createRequire(import.meta.url);
3586 const pkg = req("@chrisluyi/daas-template/package.json");
3587 return pkg.version ?? "1.0.0";
3592function getPackageName(cwd) {
3593 const pkgPath = resolve8(cwd, "package.json");
3594 if (!existsSync7(pkgPath))
3597 const pkg = JSON.parse(readFileSync6(pkgPath, "utf8"));
3598 return (pkg.name ?? "mfe-app").replace(/^@[^/]+\//, "");
3605import { spawnSync } from "child_process";
3606import { existsSync as existsSync8, readdirSync as readdirSync2, readFileSync as readFileSync7, writeFileSync as writeFileSync5 } from "fs";
3607import { relative as relative2, resolve as resolve9 } from "path";
3609class RegionError extends Error {
3610 constructor(message) {
3612 this.name = "RegionError";
3615var DEFAULT_ALIASES = {
3616 "@region-config": "./src/config/regions/{region}/config",
3617 "@regional": "./src/config/regions/{region}/index"
3619function readRegionalConfig(cwd = process.cwd()) {
3620 const pkgPath = resolve9(cwd, "package.json");
3621 if (!existsSync8(pkgPath)) {
3622 throw new RegionError("No package.json found. Run from the project root (the daas.regional block lives there).");
3624 const pkg = JSON.parse(readFileSync7(pkgPath, "utf8"));