UNPKG

everything-dev

Version:

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

1 lines • 2.77 kB
{"version":3,"file":"sync.mjs","names":[],"sources":["../../../src/cli/render/sync.ts"],"sourcesContent":["import { colors } from \"../../utils/theme\";\n\n/**\n * The protocol for local edits to framework-owned files (ADR 0032): editing is\n * allowed, sync backs the divergent copy up, and an upstream issue makes the\n * change permanent.\n */\nexport const UPSTREAM_ISSUE_URL = \"https://github.com/NEARBuilders/everything-dev/issues\";\n\nexport function printUpstreamIssueProtocol(backupDir?: string | null) {\n console.log(\n colors.dim(\n ` Framework-owned files: local edits are allowed — template versions were applied; backups at ${backupDir || \".bos/sync-backup/\"}.`,\n ),\n );\n console.log(\n colors.dim(\n ` To make a local change permanent, file an issue: ${UPSTREAM_ISSUE_URL} (or open a PR).`,\n ),\n );\n}\n\ninterface SyncOutcomeShape {\n updated: string[];\n added: string[];\n conflicted: string[];\n backupDir?: string | null;\n}\n\n/**\n * The sync-outcome block shared by the `bos upgrade` renderer: counts,\n * per-file listings, and the upstream-issue protocol line.\n */\nexport function printSyncOutcome(sync: SyncOutcomeShape) {\n if (sync.updated.length > 0 || sync.added.length > 0 || sync.conflicted.length > 0) {\n console.log(\n ` ${sync.updated.length} updated, ${sync.added.length} added, ${sync.conflicted.length} conflicted`,\n );\n for (const f of sync.updated) console.log(` ${colors.dim(f)}`);\n for (const f of sync.added) console.log(` ${colors.dim(f)}`);\n if (sync.conflicted.length > 0) {\n console.log(` ${colors.yellow(\"Conflicted\")} (template applied, your changes backed up):`);\n if (sync.backupDir) console.log(` ${colors.dim(sync.backupDir)}`);\n for (const f of sync.conflicted) console.log(` ${colors.dim(f)}`);\n printUpstreamIssueProtocol(sync.backupDir);\n }\n } else {\n console.log(` ${colors.dim(\"Already up to date\")}`);\n }\n}\n"],"mappings":";;;;;;;;AAOA,MAAa,qBAAqB;AAElC,SAAgB,2BAA2B,WAA2B;CACpE,QAAQ,IACN,OAAO,IACL,iGAAiG,aAAa,oBAAoB,EACpI,CACF;CACA,QAAQ,IACN,OAAO,IACL,sDAAsD,mBAAmB,iBAC3E,CACF;AACF;;;;;AAaA,SAAgB,iBAAiB,MAAwB;CACvD,IAAI,KAAK,QAAQ,SAAS,KAAK,KAAK,MAAM,SAAS,KAAK,KAAK,WAAW,SAAS,GAAG;EAClF,QAAQ,IACN,KAAK,KAAK,QAAQ,OAAO,YAAY,KAAK,MAAM,OAAO,UAAU,KAAK,WAAW,OAAO,YAC1F;EACA,KAAK,MAAM,KAAK,KAAK,SAAS,QAAQ,IAAI,OAAO,OAAO,IAAI,CAAC,GAAG;EAChE,KAAK,MAAM,KAAK,KAAK,OAAO,QAAQ,IAAI,OAAO,OAAO,IAAI,CAAC,GAAG;EAC9D,IAAI,KAAK,WAAW,SAAS,GAAG;GAC9B,QAAQ,IAAI,KAAK,OAAO,OAAO,YAAY,EAAE,6CAA6C;GAC1F,IAAI,KAAK,WAAW,QAAQ,IAAI,OAAO,OAAO,IAAI,KAAK,SAAS,GAAG;GACnE,KAAK,MAAM,KAAK,KAAK,YAAY,QAAQ,IAAI,OAAO,OAAO,IAAI,CAAC,GAAG;GACnE,2BAA2B,KAAK,SAAS;EAC3C;CACF,OACE,QAAQ,IAAI,KAAK,OAAO,IAAI,oBAAoB,GAAG;AAEvD"}