UNPKG

everything-dev

Version:

A consolidated product package for building Module Federation apps with oRPC APIs.

36 lines (34 loc) • 1.91 kB
const require_theme = require('../../utils/theme.cjs'); //#region src/cli/render/sync.ts /** * The protocol for local edits to framework-owned files (ADR 0032): editing is * allowed, sync backs the divergent copy up, and an upstream issue makes the * change permanent. */ const UPSTREAM_ISSUE_URL = "https://github.com/NEARBuilders/everything-dev/issues"; function printUpstreamIssueProtocol(backupDir) { console.log(require_theme.colors.dim(` Framework-owned files: local edits are allowed — template versions were applied; backups at ${backupDir || ".bos/sync-backup/"}.`)); console.log(require_theme.colors.dim(` To make a local change permanent, file an issue: ${UPSTREAM_ISSUE_URL} (or open a PR).`)); } /** * The sync-outcome block shared by the `bos upgrade` renderer: counts, * per-file listings, and the upstream-issue protocol line. */ function printSyncOutcome(sync) { if (sync.updated.length > 0 || sync.added.length > 0 || sync.conflicted.length > 0) { console.log(` ${sync.updated.length} updated, ${sync.added.length} added, ${sync.conflicted.length} conflicted`); for (const f of sync.updated) console.log(` ${require_theme.colors.dim(f)}`); for (const f of sync.added) console.log(` ${require_theme.colors.dim(f)}`); if (sync.conflicted.length > 0) { console.log(` ${require_theme.colors.yellow("Conflicted")} (template applied, your changes backed up):`); if (sync.backupDir) console.log(` ${require_theme.colors.dim(sync.backupDir)}`); for (const f of sync.conflicted) console.log(` ${require_theme.colors.dim(f)}`); printUpstreamIssueProtocol(sync.backupDir); } } else console.log(` ${require_theme.colors.dim("Already up to date")}`); } //#endregion exports.UPSTREAM_ISSUE_URL = UPSTREAM_ISSUE_URL; exports.printSyncOutcome = printSyncOutcome; exports.printUpstreamIssueProtocol = printUpstreamIssueProtocol; //# sourceMappingURL=sync.cjs.map