Lines 3580-3620javascript
3581 const req = createRequire(import.meta.url);
3582 const pkg = req("@chrisluyi/daas-template/package.json");
3583 return pkg.version ?? "1.0.0";
3588function getPackageName(cwd) {
3589 const pkgPath = resolve8(cwd, "package.json");
3590 if (!existsSync7(pkgPath))
3593 const pkg = JSON.parse(readFileSync6(pkgPath, "utf8"));
3594 return (pkg.name ?? "mfe-app").replace(/^@[^/]+\//, "");
3601import { spawnSync } from "child_process";
3602import { existsSync as existsSync8, readdirSync as readdirSync2, readFileSync as readFileSync7, writeFileSync as writeFileSync5 } from "fs";
3603import { relative as relative2, resolve as resolve9 } from "path";
3605class RegionError extends Error {
3606 constructor(message) {
3608 this.name = "RegionError";
3611var DEFAULT_ALIASES = {
3612 "@region-config": "./src/config/regions/{region}/config",
3613 "@regional": "./src/config/regions/{region}/index"
3615function readRegionalConfig(cwd = process.cwd()) {
3616 const pkgPath = resolve9(cwd, "package.json");
3617 if (!existsSync8(pkgPath)) {
3618 throw new RegionError("No package.json found. Run from the project root (the daas.regional block lives there).");
3620 const pkg = JSON.parse(readFileSync7(pkgPath, "utf8"));