@teambit/ci 1.0.523 → 1.0.525

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,6 +39,13 @@ function _workspaceLane() {
39
39
  };
40
40
  return data;
41
41
  }
42
+ function _healMissingMainFiles() {
43
+ const data = require("./heal-missing-main-files");
44
+ _healMissingMainFiles = function () {
45
+ return data;
46
+ };
47
+ return data;
48
+ }
42
49
  function _laneSyncExecutor() {
43
50
  const data = require("./lane-sync-executor");
44
51
  _laneSyncExecutor = function () {
@@ -114,6 +121,11 @@ class MainSyncExecutor {
114
121
  return `${_laneSyncExecutor().HALT_SUMMARY_PREFIX} main -> the .bitmap on ${startPoint} points at lane ` + `"${currentLane}" rather than main, so the main-scope drift cannot be computed`;
115
122
  }
116
123
 
124
+ // An entry whose recorded main file is gone cannot be loaded, and one of those fails the whole
125
+ // checkout below. Heal them first (repoint the entry, or untrack it so `includeNewFromScope`
126
+ // re-imports it). Reported so the sync PR explains the `.bitmap` lines it carries.
127
+ const healedMainFiles = await (0, _healMissingMainFiles().healMissingMainFiles)(this.deps.workspace, logger);
128
+
117
129
  // `checkoutByCLIValues` rather than `checkout`: it imports current objects first (so `head`
118
130
  // resolves to the remote scope's versions) and persists `.bitmap` on destroy.
119
131
  // `includeNewFromScope`: a component exported to the scope's main but never in this repo's
@@ -177,7 +189,8 @@ class MainSyncExecutor {
177
189
  const prUrl = await this.ensureSyncPr({
178
190
  branch,
179
191
  driftCount: drift.length,
180
- newFromScope
192
+ newFromScope,
193
+ healedMainFiles
181
194
  });
182
195
  return `main -> pushed sync commit to ${branch}${prUrl ? ` (PR ${prUrl})` : ''}`;
183
196
  } catch (e) {
@@ -280,7 +293,8 @@ class MainSyncExecutor {
280
293
  async ensureSyncPr({
281
294
  branch,
282
295
  driftCount,
283
- newFromScope
296
+ newFromScope,
297
+ healedMainFiles
284
298
  }) {
285
299
  const {
286
300
  gitHost,
@@ -303,7 +317,8 @@ class MainSyncExecutor {
303
317
  title: 'Bit sync: update to latest main scope versions',
304
318
  body: mainSyncPrBody({
305
319
  driftCount,
306
- newFromScope
320
+ newFromScope,
321
+ healedMainFiles
307
322
  })
308
323
  });
309
324
  logger.console(_chalk().default.green(`Opened sync PR ${created.htmlUrl}`));
@@ -348,7 +363,8 @@ function mainSyncCommitMessage(driftCount) {
348
363
  }
349
364
  function mainSyncPrBody({
350
365
  driftCount,
351
- newFromScope
366
+ newFromScope,
367
+ healedMainFiles = []
352
368
  }) {
353
369
  const lines = ['Automated sync PR: the Bit scope moved ahead of this repository. This PR checks the workspace out to the ' + 'latest exported versions (`bit checkout head --auto-merge-resolve theirs`).', '', `- files changed: ${driftCount}`, '- conflicts between this repository and the scope were resolved **in favour of the scope** — if a file here ' + 'held changes that were never exported to Bit, this PR reverts them. Review the diff and close the PR ' + 'instead of merging if that is not what you want.'];
354
370
  if (newFromScope.length) {
@@ -356,6 +372,9 @@ function mainSyncPrBody({
356
372
  // Bounded like the lane PR body: an over-long body is rejected by the host outright.
357
373
  ...(0, _laneSyncExecutor().capEntries)(newFromScope.map(id => ` - \`${id}\``), ' - '));
358
374
  }
375
+ if (healedMainFiles.length) {
376
+ lines.push(`- components whose \`.bitmap\` entry named a main file that no longer exists here ` + `(${healedMainFiles.length}); the entry was repaired so the component can be loaded again:`, ...(0, _laneSyncExecutor().capEntries)(healedMainFiles.map(heal => heal.retargetedTo ? ` - \`${heal.id}\` — main file repointed to \`${heal.retargetedTo}\`` : ` - \`${heal.id}\` — re-imported from the scope (no usable main file was left here)`), ' - '));
377
+ }
359
378
  lines.push('', 'This PR is maintained by `bit ci sync` — re-running the command pushes any further drift onto the same branch.');
360
379
  return lines.join('\n');
361
380
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_cli","_git","_syncState","_workspaceLane","_laneSyncExecutor","_gitOps","e","__esModule","default","CONVERGED_SUMMARY","MainSyncExecutor","constructor","deps","syncMain","opts","cfg","defaultBranch","defaultScope","logger","directPush","mainSync","branch","mainSyncBranch","autoMergeMainSyncPr","consoleWarning","fetchRemoteHeads","syncBranchExists","branchExistsOnRemote","startPoint","console","chalk","blue","resetToStartPoint","catchUpErr","catchUpWithDefaultBranch","refork","reforkIfMachineOwned","HALT_SUMMARY_PREFIX","racedMainSummary","currentLane","currentLaneIdStr","lanes","results","checkout","checkoutByCLIValues","head","skipNpmInstall","includeNewFromScope","mergeStrategy","newFromScope","length","join","drift","driftFiles","convergedSummary","formatWarningSummary","slice","dryRun","addAllExceptScopeAndModules","commitWithIdentity","mainSyncCommitMessage","baseSha","git","revparse","then","sha","trim","undefined","catch","push","message","String","confirmPushRace","dropErr","dropLocalBranchToRemoteTip","redactUrlCredentials","green","shortSha","prUrl","ensureSyncPr","driftCount","restoreWorkspace","checkoutPristine","ci","reloadWorkspaceFromDisk","out","gitWithIdentity","SYNC_COMMIT_MARKER","conflicted","status","Error","raw","staleTip","log","messages","split","map","filter","Boolean","machineOwned","every","isSyncAuthoredMessage","isStaleLeaseRejection","gitHost","pr","findPrByBranch","number","paths","files","file","path","isNonContentPath","Set","existing","htmlUrl","created","createPr","base","title","body","mainSyncPrBody","switchErr","switchToLaneForSync","checkoutPristineRestore","exports","lines","capEntries","id"],"sources":["main-sync-executor.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { formatWarningSummary } from '@teambit/cli';\nimport type { Logger } from '@teambit/logger';\nimport type { LanesMain } from '@teambit/lanes';\nimport type { CheckoutMain } from '@teambit/checkout';\nimport { git } from '../git';\nimport type { CiMain } from '../ci.main.runtime';\nimport type { CiSyncConfig } from './sync-config';\nimport { SYNC_COMMIT_MARKER, isSyncAuthoredMessage } from './sync-state';\nimport { currentLaneIdStr } from './workspace-lane';\nimport type { GitHostProvider } from './git-host-provider';\nimport { HALT_SUMMARY_PREFIX, capEntries } from './lane-sync-executor';\nimport {\n addAllExceptScopeAndModules,\n branchExistsOnRemote,\n checkoutPristine,\n checkoutPristineRestore,\n commitWithIdentity,\n confirmPushRace,\n dropLocalBranchToRemoteTip,\n fetchRemoteHeads,\n gitWithIdentity,\n isNonContentPath,\n isStaleLeaseRejection,\n redactUrlCredentials,\n} from './git-ops';\n\nexport type MainSyncDeps = {\n checkout: CheckoutMain;\n lanes: LanesMain;\n /** for reloadWorkspaceFromDisk + switchToLaneForSync */\n ci: CiMain;\n logger: Logger;\n /** undefined => PR operations are logged and skipped; the git half of the sync still runs. */\n gitHost?: GitHostProvider;\n cfg: Required<CiSyncConfig>;\n defaultBranch: string;\n defaultScope: string;\n};\n\n/**\n * Reconcile the main scope with the repository's default branch. Stateless: `bit checkout head`\n * writes the latest exported versions, so an empty `git status` IS convergence and any diff IS the\n * drift. Under 'pr' the convergence is proposed via `mainSyncBranch`; under 'direct-push' it lands on\n * the default branch with a plain push. One force push exists: a machine-owned sync branch that\n * conflicts with the default branch is re-forked under a tip lease (`reforkIfMachineOwned`).\n */\n/** the \"nothing to do\" line, shared by both modes */\nconst CONVERGED_SUMMARY = 'main -> converged (checkout head produced no changes)';\n\nexport class MainSyncExecutor {\n constructor(private deps: MainSyncDeps) {}\n\n /**\n * Returns a summary line (HALT-prefixed on failure) and, like `syncLane`, does not throw — a\n * main-sync failure must not erase the lane results collected before it.\n */\n async syncMain(opts: { dryRun?: boolean } = {}): Promise<string> {\n const { cfg, defaultBranch, defaultScope, logger } = this.deps;\n const directPush = cfg.mainSync === 'direct-push';\n // In direct-push mode the sync branch (and its PR) is not consulted, moved or deleted.\n const branch = directPush ? defaultBranch : cfg.mainSyncBranch;\n\n if (cfg.autoMergeMainSyncPr && !directPush) {\n // Enabling auto-merge is host-specific and not part of the GitHostProvider contract.\n logger.consoleWarning(\n `sync.autoMergeMainSyncPr is enabled in the config, but enabling auto-merge is not implemented yet — ` +\n `the sync PR is opened without it. Use a repository auto-merge rule instead.`\n );\n }\n\n try {\n await fetchRemoteHeads();\n // Direct-push always starts from `origin/<defaultBranch>` — the very tip the plain push must\n // fast-forward. In 'pr' mode an existing sync branch is reused so its PR history survives.\n const syncBranchExists = directPush ? false : await branchExistsOnRemote(branch);\n const startPoint = syncBranchExists ? `origin/${branch}` : `origin/${defaultBranch}`;\n logger.console(\n chalk.blue(\n directPush\n ? `main -> checking the main scope against ${defaultBranch} (direct-push)`\n : `main -> checking the main scope against ${defaultBranch} (sync branch ${branch})`\n )\n );\n\n await this.resetToStartPoint(branch, startPoint);\n\n if (syncBranchExists) {\n // Catch up with the default branch: the PR must stay mergeable, and `checkout head` on a stale\n // tree would re-commit pre-merge content over the default branch's changes.\n const catchUpErr = await this.catchUpWithDefaultBranch(branch);\n if (catchUpErr) {\n const refork = await this.reforkIfMachineOwned(branch);\n if (refork === 'human-owned') return `${HALT_SUMMARY_PREFIX} main -> ${catchUpErr}`;\n if (refork === 'raced') return racedMainSummary(branch);\n }\n }\n\n // `checkout head` resolves versions against the CURRENT lane; a lane pointer on this branch\n // would make the \"drift\" the lane's content. Refuse rather than open a wildly wrong PR.\n // `.bitmap`-derived read: the scope-object read answers \"main\" on a fresh runner and the guard\n // would silently stop refusing exactly where it ships (see `workspace-lane.ts`).\n const currentLane = currentLaneIdStr(this.deps.lanes);\n if (currentLane) {\n return (\n `${HALT_SUMMARY_PREFIX} main -> the .bitmap on ${startPoint} points at lane ` +\n `\"${currentLane}\" rather than main, so the main-scope drift cannot be computed`\n );\n }\n\n // `checkoutByCLIValues` rather than `checkout`: it imports current objects first (so `head`\n // resolves to the remote scope's versions) and persists `.bitmap` on destroy.\n // `includeNewFromScope`: a component exported to the scope's main but never in this repo's\n // `.bitmap` would otherwise be invisible to every sync run forever.\n // `mergeStrategy: 'theirs'` is required: unexported source drift makes components \"modified\",\n // and with no strategy the checkout throws. 'theirs' materializes the exported truth — any\n // reversion of unexported drift is visible in the PR diff. 'ours' is forbidden: it would advance\n // `.bitmap` while keeping the old files, a commit asserting a state the tree does not have.\n const results = await this.deps.checkout.checkoutByCLIValues('', {\n head: true,\n skipNpmInstall: true,\n includeNewFromScope: true,\n mergeStrategy: 'theirs',\n });\n const newFromScope = results.newFromScope ?? [];\n if (newFromScope.length) {\n logger.console(\n chalk.blue(\n `Added ${newFromScope.length} component(s) that exist on ${defaultScope}'s main but not in this ` +\n `workspace: ${newFromScope.join(', ')}`\n )\n );\n }\n\n const drift = await this.driftFiles();\n // Direct-push stays bare: asking the host about `mainSyncBranch`'s PR would be the one\n // interaction with it this mode promises not to make.\n if (!drift.length) return directPush ? CONVERGED_SUMMARY : await this.convergedSummary(branch);\n\n logger.console(\n formatWarningSummary(`main -> drift in ${drift.length} file(s): ${drift.slice(0, 20).join(', ')}`)\n );\n\n if (opts.dryRun) {\n // The working tree WAS written (a diff-based check has no other way); `finally` restores it. Safe\n // only because a dry run over a dirty tree is refused before anything runs — the restore rewinds\n // to HEAD, so an uncommitted change here would be gone (`assertCleanForDryRun`).\n logger.console(\n formatWarningSummary(\n directPush\n ? `Dry-run: main -> would push the drift directly onto ${branch}`\n : `Dry-run: main -> would push ${branch} and open a sync PR`\n )\n );\n return directPush\n ? `main -> drift detected in ${drift.length} file(s) — would push ${branch} directly`\n : `main -> drift detected in ${drift.length} file(s) — would open sync PR`;\n }\n\n await addAllExceptScopeAndModules();\n await commitWithIdentity(mainSyncCommitMessage(drift.length));\n // The local knowledge of `origin/<branch>` — the tip this run built on; after a rejection it is\n // the baseline `confirmPushRace` checks the re-fetched remote against.\n const baseSha = await git\n .revparse([`origin/${branch}`])\n .then((sha) => sha.trim() || undefined)\n .catch(() => undefined);\n // Never force. Unambiguous refspec — see `lane-sync-executor.commitAllAndPush`. A rejection means\n // a concurrent run pushed in between; what happens next depends on the mode. Direct-push: the\n // rejection IS the default branch's safety story — stay loud, never swallow. 'pr' mode: the push\n // targets the machine-owned sync branch, where a concurrent-run overlap is the same benign race\n // the lane executor tolerates (`reforkIfMachineOwned` already defers the same way) — confirm it\n // and defer.\n try {\n await git.push(['origin', `HEAD:refs/heads/${branch}`]);\n } catch (e: any) {\n const message = String(e?.message || e);\n if (directPush || (await confirmPushRace(branch, baseSha, message)) !== 'confirmed-race') throw e;\n // Drop the losing commit: left on the local sync branch, its orphan sibling would trip the\n // next run's `checkoutPristine` guard. The original rejection text is kept for diagnosability.\n const dropErr = await dropLocalBranchToRemoteTip(branch);\n if (dropErr) {\n logger.consoleWarning(`Could not drop the unpushed sync commit on ${branch}: ${dropErr}`);\n }\n logger.console(\n formatWarningSummary(`main -> push to ${branch} lost to a concurrent run: ${redactUrlCredentials(message)}`)\n );\n return racedMainSummary(branch);\n }\n logger.console(chalk.green(`Pushed ${branch}`));\n\n if (directPush) {\n const shortSha = (await git.revparse(['--short', 'HEAD'])).trim();\n return `main -> direct-push (pushed ${branch} @ ${shortSha})`;\n }\n const prUrl = await this.ensureSyncPr({ branch, driftCount: drift.length, newFromScope });\n return `main -> pushed sync commit to ${branch}${prUrl ? ` (PR ${prUrl})` : ''}`;\n } catch (e: any) {\n // Same contract as the lane executor: a HALTED line, never a throw mid-run.\n return `${HALT_SUMMARY_PREFIX} main -> ${e?.message || e}`;\n } finally {\n await this.restoreWorkspace();\n }\n }\n\n /**\n * Put the working tree on the sync branch at a pristine copy of `startPoint`. Pristine is\n * load-bearing for a diff-based reconciler: any stray modification would be indistinguishable from\n * main-scope drift. The reload makes `checkout head` read this branch's `.bitmap`.\n */\n private async resetToStartPoint(branch: string, startPoint: string) {\n await checkoutPristine(branch, startPoint, () => this.deps.ci.reloadWorkspaceFromDisk());\n }\n\n /**\n * Merge the default branch into the sync branch so drift is computed against the repository's\n * current state. Returns a reason string on failure; a conflict needs a human (or deleting the sync\n * branch, which the next run re-forks).\n */\n private async catchUpWithDefaultBranch(branch: string): Promise<string | undefined> {\n const { defaultBranch, logger } = this.deps;\n try {\n // the marker line keeps the branch machine-owned across catch-up merges\n const out = await gitWithIdentity([\n 'merge',\n '-m',\n `merge origin/${defaultBranch} into ${branch}\\n\\n${SYNC_COMMIT_MARKER}`,\n `origin/${defaultBranch}`,\n ]);\n // simple-git resolves on some non-zero exits — judge the merge by state, not by rejection\n const conflicted = (await git.status()).conflicted;\n if (conflicted.length) throw new Error(`merge conflicts in: ${conflicted.join(', ')}`);\n logger.console(chalk.blue(`Brought ${branch} up to date with origin/${defaultBranch}: ${out.trim()}`));\n } catch (e: any) {\n await git.raw(['merge', '--abort']).catch(() => undefined);\n return (\n `could not bring the sync branch ${branch} up to date with origin/${defaultBranch}: ${e?.message || e}. ` +\n `Resolve or delete ${branch} (a deleted sync branch is re-forked from ${defaultBranch} on the next run)`\n );\n }\n // The merge may have brought a new `.bitmap` in from the default branch.\n await this.deps.ci.reloadWorkspaceFromDisk();\n return undefined;\n }\n\n /**\n * Re-fork the sync branch from the default branch when every commit it holds beyond it passes\n * `isSyncAuthoredMessage` — machine state is recomputable from the scope. The force push is\n * leased on the tip the ownership was read from, so a concurrent run's push wins the race.\n */\n private async reforkIfMachineOwned(branch: string): Promise<'re-forked' | 'raced' | 'human-owned'> {\n const { defaultBranch, logger } = this.deps;\n const staleTip = (await git.revparse([`origin/${branch}`])).trim();\n const log = await git.raw(['log', `origin/${defaultBranch}..${staleTip}`, '--format=%B%x1e']);\n const messages = log\n .split('\\x1e')\n .map((message) => message.trim())\n .filter(Boolean);\n const machineOwned = messages.length > 0 && messages.every((message) => isSyncAuthoredMessage(message));\n if (!machineOwned) return 'human-owned';\n logger.console(\n formatWarningSummary(\n `main -> ${branch} conflicts with ${defaultBranch} and carries only ${SYNC_COMMIT_MARKER} commits — ` +\n `re-forking it from origin/${defaultBranch}`\n )\n );\n await this.resetToStartPoint(branch, `origin/${defaultBranch}`);\n try {\n await git.push([`--force-with-lease=refs/heads/${branch}:${staleTip}`, 'origin', `HEAD:refs/heads/${branch}`]);\n } catch (e: any) {\n if (!isStaleLeaseRejection(e?.message || String(e))) throw e;\n logger.console(formatWarningSummary(`main -> ${branch} moved while re-forking — another run owns it now`));\n return 'raced';\n }\n return 're-forked';\n }\n\n /**\n * The \"nothing to do\" line — plus the open sync PR, if any: converged means the SYNC branch matches\n * the scope, and the default branch may still differ until that PR merges.\n */\n private async convergedSummary(branch: string): Promise<string> {\n const { gitHost } = this.deps;\n if (!gitHost) return CONVERGED_SUMMARY;\n const pr = await gitHost.findPrByBranch(branch).catch(() => undefined);\n return pr ? `${CONVERGED_SUMMARY} — open sync PR #${pr.number} still awaits review/merge` : CONVERGED_SUMMARY;\n }\n\n /**\n * The files `bit checkout head` changed, i.e. the drift. Excludes `.bit`/`node_modules` — the same\n * set the commit paths refuse to touch, keeping \"counts as drift\" and \"gets committed\" identical.\n */\n private async driftFiles(): Promise<string[]> {\n const status = await git.status();\n const paths = status.files.map((file) => file.path).filter((path) => !isNonContentPath(path));\n return [...new Set(paths)];\n }\n\n /**\n * Make sure the pushed branch has an open PR. A git-host failure only warns: the branch is pushed,\n * which is the load-bearing half, and the next run retries the PR.\n */\n private async ensureSyncPr({\n branch,\n driftCount,\n newFromScope,\n }: {\n branch: string;\n driftCount: number;\n newFromScope: string[];\n }): Promise<string | undefined> {\n const { gitHost, logger, defaultBranch } = this.deps;\n if (!gitHost) {\n logger.consoleWarning(\n 'No configured git host provider (for GitHub: BIT_GITHUB_TOKEN or GITHUB_TOKEN, plus a repository) — ' +\n 'pushed sync branch, skipping PR operations'\n );\n return undefined;\n }\n try {\n const existing = await gitHost.findPrByBranch(branch);\n if (existing) {\n logger.console(chalk.blue(`Sync PR ${existing.htmlUrl} is already open — pushed the new commit onto it`));\n return existing.htmlUrl;\n }\n const created = await gitHost.createPr({\n head: branch,\n base: defaultBranch,\n title: 'Bit sync: update to latest main scope versions',\n body: mainSyncPrBody({ driftCount, newFromScope }),\n });\n logger.console(chalk.green(`Opened sync PR ${created.htmlUrl}`));\n return created.htmlUrl;\n } catch (e: any) {\n logger.consoleWarning(`Could not open or find the sync PR for ${branch}: ${e?.message || e}`);\n return undefined;\n }\n }\n\n /**\n * Leave git on the default branch and bit on main. Mirrors `LaneSyncExecutor.restoreWorkspace`:\n * best-effort and warn-only so a restore hiccup can't throw out of a `finally` and mask the real\n * error; the clean discards untracked files `checkout head` wrote on the converged/dry-run paths.\n */\n private async restoreWorkspace() {\n const { logger, defaultBranch } = this.deps;\n try {\n if (currentLaneIdStr(this.deps.lanes)) {\n const switchErr = await this.deps.ci.switchToLaneForSync('main');\n if (switchErr) logger.consoleWarning(`Could not switch the workspace back to main: ${switchErr.message}`);\n }\n await checkoutPristineRestore(defaultBranch, () => this.deps.ci.reloadWorkspaceFromDisk());\n } catch (e: any) {\n logger.consoleWarning(`Could not restore the workspace after the main sync: ${e?.message || e}`);\n }\n }\n}\n\n/** The deferral line both raced shapes share: the catch-up refork race and the sync-branch push race. */\nfunction racedMainSummary(branch: string): string {\n return `main -> ${branch} was updated by a concurrent run — deferring to it`;\n}\n\n/** The sync commit message: no `Bit-Lane-Head` trailer — main sync keeps no state. */\nfunction mainSyncCommitMessage(driftCount: number): string {\n return [\n `chore(bit-sync): sync git to latest main scope versions (${driftCount} file(s))`,\n '',\n SYNC_COMMIT_MARKER,\n ].join('\\n');\n}\n\nfunction mainSyncPrBody({ driftCount, newFromScope }: { driftCount: number; newFromScope: string[] }): string {\n const lines = [\n 'Automated sync PR: the Bit scope moved ahead of this repository. This PR checks the workspace out to the ' +\n 'latest exported versions (`bit checkout head --auto-merge-resolve theirs`).',\n '',\n `- files changed: ${driftCount}`,\n '- conflicts between this repository and the scope were resolved **in favour of the scope** — if a file here ' +\n 'held changes that were never exported to Bit, this PR reverts them. Review the diff and close the PR ' +\n 'instead of merging if that is not what you want.',\n ];\n if (newFromScope.length) {\n lines.push(\n `- components added from the scope (${newFromScope.length}, not previously in this repository's \\`.bitmap\\`):`,\n // Bounded like the lane PR body: an over-long body is rejected by the host outright.\n ...capEntries(\n newFromScope.map((id) => ` - \\`${id}\\``),\n ' - '\n )\n );\n }\n lines.push(\n '',\n 'This PR is maintained by `bit ci sync` — re-running the command pushes any further drift onto the same branch.'\n );\n return lines.join('\\n');\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OA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;AAC9E;;AAEA;AACA,SAASuC,qBAAqBA,CAACoB,UAAkB,EAAU;EACzD,OAAO,CACL,4DAA4DA,UAAU,WAAW,EACjF,EAAE,EACFO,+BAAkB,CACnB,CAACpC,IAAI,CAAC,IAAI,CAAC;AACd;AAEA,SAASqE,cAAcA,CAAC;EAAExC,UAAU;EAAE/B;AAA6D,CAAC,EAAU;EAC5G,MAAM4E,KAAK,GAAG,CACZ,2GAA2G,GACzG,6EAA6E,EAC/E,EAAE,EACF,oBAAoB7C,UAAU,EAAE,EAChC,8GAA8G,GAC5G,uGAAuG,GACvG,kDAAkD,CACrD;EACD,IAAI/B,YAAY,CAACC,MAAM,EAAE;IACvB2E,KAAK,CAACxD,IAAI,CACR,sCAAsCpB,YAAY,CAACC,MAAM,qDAAqD;IAC9G;IACA,GAAG,IAAA4E,8BAAU,EACX7E,YAAY,CAAC+C,GAAG,CAAE+B,EAAE,IAAK,SAASA,EAAE,IAAI,CAAC,EACzC,MACF,CACF,CAAC;EACH;EACAF,KAAK,CAACxD,IAAI,CACR,EAAE,EACF,gHACF,CAAC;EACD,OAAOwD,KAAK,CAAC1E,IAAI,CAAC,IAAI,CAAC;AACzB","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_cli","_git","_syncState","_workspaceLane","_healMissingMainFiles","_laneSyncExecutor","_gitOps","e","__esModule","default","CONVERGED_SUMMARY","MainSyncExecutor","constructor","deps","syncMain","opts","cfg","defaultBranch","defaultScope","logger","directPush","mainSync","branch","mainSyncBranch","autoMergeMainSyncPr","consoleWarning","fetchRemoteHeads","syncBranchExists","branchExistsOnRemote","startPoint","console","chalk","blue","resetToStartPoint","catchUpErr","catchUpWithDefaultBranch","refork","reforkIfMachineOwned","HALT_SUMMARY_PREFIX","racedMainSummary","currentLane","currentLaneIdStr","lanes","healedMainFiles","healMissingMainFiles","workspace","results","checkout","checkoutByCLIValues","head","skipNpmInstall","includeNewFromScope","mergeStrategy","newFromScope","length","join","drift","driftFiles","convergedSummary","formatWarningSummary","slice","dryRun","addAllExceptScopeAndModules","commitWithIdentity","mainSyncCommitMessage","baseSha","git","revparse","then","sha","trim","undefined","catch","push","message","String","confirmPushRace","dropErr","dropLocalBranchToRemoteTip","redactUrlCredentials","green","shortSha","prUrl","ensureSyncPr","driftCount","restoreWorkspace","checkoutPristine","ci","reloadWorkspaceFromDisk","out","gitWithIdentity","SYNC_COMMIT_MARKER","conflicted","status","Error","raw","staleTip","log","messages","split","map","filter","Boolean","machineOwned","every","isSyncAuthoredMessage","isStaleLeaseRejection","gitHost","pr","findPrByBranch","number","paths","files","file","path","isNonContentPath","Set","existing","htmlUrl","created","createPr","base","title","body","mainSyncPrBody","switchErr","switchToLaneForSync","checkoutPristineRestore","exports","lines","capEntries","id","heal","retargetedTo"],"sources":["main-sync-executor.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { formatWarningSummary } from '@teambit/cli';\nimport type { Logger } from '@teambit/logger';\nimport type { LanesMain } from '@teambit/lanes';\nimport type { CheckoutMain } from '@teambit/checkout';\nimport type { Workspace } from '@teambit/workspace';\nimport { git } from '../git';\nimport type { CiMain } from '../ci.main.runtime';\nimport type { CiSyncConfig } from './sync-config';\nimport { SYNC_COMMIT_MARKER, isSyncAuthoredMessage } from './sync-state';\nimport { currentLaneIdStr } from './workspace-lane';\nimport type { MainFileHeal } from './heal-missing-main-files';\nimport { healMissingMainFiles } from './heal-missing-main-files';\nimport type { GitHostProvider } from './git-host-provider';\nimport { HALT_SUMMARY_PREFIX, capEntries } from './lane-sync-executor';\nimport {\n addAllExceptScopeAndModules,\n branchExistsOnRemote,\n checkoutPristine,\n checkoutPristineRestore,\n commitWithIdentity,\n confirmPushRace,\n dropLocalBranchToRemoteTip,\n fetchRemoteHeads,\n gitWithIdentity,\n isNonContentPath,\n isStaleLeaseRejection,\n redactUrlCredentials,\n} from './git-ops';\n\nexport type MainSyncDeps = {\n checkout: CheckoutMain;\n lanes: LanesMain;\n /** for the pre-checkout `.bitmap` heal (see `heal-missing-main-files`) */\n workspace: Workspace;\n /** for reloadWorkspaceFromDisk + switchToLaneForSync */\n ci: CiMain;\n logger: Logger;\n /** undefined => PR operations are logged and skipped; the git half of the sync still runs. */\n gitHost?: GitHostProvider;\n cfg: Required<CiSyncConfig>;\n defaultBranch: string;\n defaultScope: string;\n};\n\n/**\n * Reconcile the main scope with the repository's default branch. Stateless: `bit checkout head`\n * writes the latest exported versions, so an empty `git status` IS convergence and any diff IS the\n * drift. Under 'pr' the convergence is proposed via `mainSyncBranch`; under 'direct-push' it lands on\n * the default branch with a plain push. One force push exists: a machine-owned sync branch that\n * conflicts with the default branch is re-forked under a tip lease (`reforkIfMachineOwned`).\n */\n/** the \"nothing to do\" line, shared by both modes */\nconst CONVERGED_SUMMARY = 'main -> converged (checkout head produced no changes)';\n\nexport class MainSyncExecutor {\n constructor(private deps: MainSyncDeps) {}\n\n /**\n * Returns a summary line (HALT-prefixed on failure) and, like `syncLane`, does not throw — a\n * main-sync failure must not erase the lane results collected before it.\n */\n async syncMain(opts: { dryRun?: boolean } = {}): Promise<string> {\n const { cfg, defaultBranch, defaultScope, logger } = this.deps;\n const directPush = cfg.mainSync === 'direct-push';\n // In direct-push mode the sync branch (and its PR) is not consulted, moved or deleted.\n const branch = directPush ? defaultBranch : cfg.mainSyncBranch;\n\n if (cfg.autoMergeMainSyncPr && !directPush) {\n // Enabling auto-merge is host-specific and not part of the GitHostProvider contract.\n logger.consoleWarning(\n `sync.autoMergeMainSyncPr is enabled in the config, but enabling auto-merge is not implemented yet — ` +\n `the sync PR is opened without it. Use a repository auto-merge rule instead.`\n );\n }\n\n try {\n await fetchRemoteHeads();\n // Direct-push always starts from `origin/<defaultBranch>` — the very tip the plain push must\n // fast-forward. In 'pr' mode an existing sync branch is reused so its PR history survives.\n const syncBranchExists = directPush ? false : await branchExistsOnRemote(branch);\n const startPoint = syncBranchExists ? `origin/${branch}` : `origin/${defaultBranch}`;\n logger.console(\n chalk.blue(\n directPush\n ? `main -> checking the main scope against ${defaultBranch} (direct-push)`\n : `main -> checking the main scope against ${defaultBranch} (sync branch ${branch})`\n )\n );\n\n await this.resetToStartPoint(branch, startPoint);\n\n if (syncBranchExists) {\n // Catch up with the default branch: the PR must stay mergeable, and `checkout head` on a stale\n // tree would re-commit pre-merge content over the default branch's changes.\n const catchUpErr = await this.catchUpWithDefaultBranch(branch);\n if (catchUpErr) {\n const refork = await this.reforkIfMachineOwned(branch);\n if (refork === 'human-owned') return `${HALT_SUMMARY_PREFIX} main -> ${catchUpErr}`;\n if (refork === 'raced') return racedMainSummary(branch);\n }\n }\n\n // `checkout head` resolves versions against the CURRENT lane; a lane pointer on this branch\n // would make the \"drift\" the lane's content. Refuse rather than open a wildly wrong PR.\n // `.bitmap`-derived read: the scope-object read answers \"main\" on a fresh runner and the guard\n // would silently stop refusing exactly where it ships (see `workspace-lane.ts`).\n const currentLane = currentLaneIdStr(this.deps.lanes);\n if (currentLane) {\n return (\n `${HALT_SUMMARY_PREFIX} main -> the .bitmap on ${startPoint} points at lane ` +\n `\"${currentLane}\" rather than main, so the main-scope drift cannot be computed`\n );\n }\n\n // An entry whose recorded main file is gone cannot be loaded, and one of those fails the whole\n // checkout below. Heal them first (repoint the entry, or untrack it so `includeNewFromScope`\n // re-imports it). Reported so the sync PR explains the `.bitmap` lines it carries.\n const healedMainFiles = await healMissingMainFiles(this.deps.workspace, logger);\n\n // `checkoutByCLIValues` rather than `checkout`: it imports current objects first (so `head`\n // resolves to the remote scope's versions) and persists `.bitmap` on destroy.\n // `includeNewFromScope`: a component exported to the scope's main but never in this repo's\n // `.bitmap` would otherwise be invisible to every sync run forever.\n // `mergeStrategy: 'theirs'` is required: unexported source drift makes components \"modified\",\n // and with no strategy the checkout throws. 'theirs' materializes the exported truth — any\n // reversion of unexported drift is visible in the PR diff. 'ours' is forbidden: it would advance\n // `.bitmap` while keeping the old files, a commit asserting a state the tree does not have.\n const results = await this.deps.checkout.checkoutByCLIValues('', {\n head: true,\n skipNpmInstall: true,\n includeNewFromScope: true,\n mergeStrategy: 'theirs',\n });\n const newFromScope = results.newFromScope ?? [];\n if (newFromScope.length) {\n logger.console(\n chalk.blue(\n `Added ${newFromScope.length} component(s) that exist on ${defaultScope}'s main but not in this ` +\n `workspace: ${newFromScope.join(', ')}`\n )\n );\n }\n\n const drift = await this.driftFiles();\n // Direct-push stays bare: asking the host about `mainSyncBranch`'s PR would be the one\n // interaction with it this mode promises not to make.\n if (!drift.length) return directPush ? CONVERGED_SUMMARY : await this.convergedSummary(branch);\n\n logger.console(\n formatWarningSummary(`main -> drift in ${drift.length} file(s): ${drift.slice(0, 20).join(', ')}`)\n );\n\n if (opts.dryRun) {\n // The working tree WAS written (a diff-based check has no other way); `finally` restores it. Safe\n // only because a dry run over a dirty tree is refused before anything runs — the restore rewinds\n // to HEAD, so an uncommitted change here would be gone (`assertCleanForDryRun`).\n logger.console(\n formatWarningSummary(\n directPush\n ? `Dry-run: main -> would push the drift directly onto ${branch}`\n : `Dry-run: main -> would push ${branch} and open a sync PR`\n )\n );\n return directPush\n ? `main -> drift detected in ${drift.length} file(s) — would push ${branch} directly`\n : `main -> drift detected in ${drift.length} file(s) — would open sync PR`;\n }\n\n await addAllExceptScopeAndModules();\n await commitWithIdentity(mainSyncCommitMessage(drift.length));\n // The local knowledge of `origin/<branch>` — the tip this run built on; after a rejection it is\n // the baseline `confirmPushRace` checks the re-fetched remote against.\n const baseSha = await git\n .revparse([`origin/${branch}`])\n .then((sha) => sha.trim() || undefined)\n .catch(() => undefined);\n // Never force. Unambiguous refspec — see `lane-sync-executor.commitAllAndPush`. A rejection means\n // a concurrent run pushed in between; what happens next depends on the mode. Direct-push: the\n // rejection IS the default branch's safety story — stay loud, never swallow. 'pr' mode: the push\n // targets the machine-owned sync branch, where a concurrent-run overlap is the same benign race\n // the lane executor tolerates (`reforkIfMachineOwned` already defers the same way) — confirm it\n // and defer.\n try {\n await git.push(['origin', `HEAD:refs/heads/${branch}`]);\n } catch (e: any) {\n const message = String(e?.message || e);\n if (directPush || (await confirmPushRace(branch, baseSha, message)) !== 'confirmed-race') throw e;\n // Drop the losing commit: left on the local sync branch, its orphan sibling would trip the\n // next run's `checkoutPristine` guard. The original rejection text is kept for diagnosability.\n const dropErr = await dropLocalBranchToRemoteTip(branch);\n if (dropErr) {\n logger.consoleWarning(`Could not drop the unpushed sync commit on ${branch}: ${dropErr}`);\n }\n logger.console(\n formatWarningSummary(`main -> push to ${branch} lost to a concurrent run: ${redactUrlCredentials(message)}`)\n );\n return racedMainSummary(branch);\n }\n logger.console(chalk.green(`Pushed ${branch}`));\n\n if (directPush) {\n const shortSha = (await git.revparse(['--short', 'HEAD'])).trim();\n return `main -> direct-push (pushed ${branch} @ ${shortSha})`;\n }\n const prUrl = await this.ensureSyncPr({ branch, driftCount: drift.length, newFromScope, healedMainFiles });\n return `main -> pushed sync commit to ${branch}${prUrl ? ` (PR ${prUrl})` : ''}`;\n } catch (e: any) {\n // Same contract as the lane executor: a HALTED line, never a throw mid-run.\n return `${HALT_SUMMARY_PREFIX} main -> ${e?.message || e}`;\n } finally {\n await this.restoreWorkspace();\n }\n }\n\n /**\n * Put the working tree on the sync branch at a pristine copy of `startPoint`. Pristine is\n * load-bearing for a diff-based reconciler: any stray modification would be indistinguishable from\n * main-scope drift. The reload makes `checkout head` read this branch's `.bitmap`.\n */\n private async resetToStartPoint(branch: string, startPoint: string) {\n await checkoutPristine(branch, startPoint, () => this.deps.ci.reloadWorkspaceFromDisk());\n }\n\n /**\n * Merge the default branch into the sync branch so drift is computed against the repository's\n * current state. Returns a reason string on failure; a conflict needs a human (or deleting the sync\n * branch, which the next run re-forks).\n */\n private async catchUpWithDefaultBranch(branch: string): Promise<string | undefined> {\n const { defaultBranch, logger } = this.deps;\n try {\n // the marker line keeps the branch machine-owned across catch-up merges\n const out = await gitWithIdentity([\n 'merge',\n '-m',\n `merge origin/${defaultBranch} into ${branch}\\n\\n${SYNC_COMMIT_MARKER}`,\n `origin/${defaultBranch}`,\n ]);\n // simple-git resolves on some non-zero exits — judge the merge by state, not by rejection\n const conflicted = (await git.status()).conflicted;\n if (conflicted.length) throw new Error(`merge conflicts in: ${conflicted.join(', ')}`);\n logger.console(chalk.blue(`Brought ${branch} up to date with origin/${defaultBranch}: ${out.trim()}`));\n } catch (e: any) {\n await git.raw(['merge', '--abort']).catch(() => undefined);\n return (\n `could not bring the sync branch ${branch} up to date with origin/${defaultBranch}: ${e?.message || e}. ` +\n `Resolve or delete ${branch} (a deleted sync branch is re-forked from ${defaultBranch} on the next run)`\n );\n }\n // The merge may have brought a new `.bitmap` in from the default branch.\n await this.deps.ci.reloadWorkspaceFromDisk();\n return undefined;\n }\n\n /**\n * Re-fork the sync branch from the default branch when every commit it holds beyond it passes\n * `isSyncAuthoredMessage` — machine state is recomputable from the scope. The force push is\n * leased on the tip the ownership was read from, so a concurrent run's push wins the race.\n */\n private async reforkIfMachineOwned(branch: string): Promise<'re-forked' | 'raced' | 'human-owned'> {\n const { defaultBranch, logger } = this.deps;\n const staleTip = (await git.revparse([`origin/${branch}`])).trim();\n const log = await git.raw(['log', `origin/${defaultBranch}..${staleTip}`, '--format=%B%x1e']);\n const messages = log\n .split('\\x1e')\n .map((message) => message.trim())\n .filter(Boolean);\n const machineOwned = messages.length > 0 && messages.every((message) => isSyncAuthoredMessage(message));\n if (!machineOwned) return 'human-owned';\n logger.console(\n formatWarningSummary(\n `main -> ${branch} conflicts with ${defaultBranch} and carries only ${SYNC_COMMIT_MARKER} commits — ` +\n `re-forking it from origin/${defaultBranch}`\n )\n );\n await this.resetToStartPoint(branch, `origin/${defaultBranch}`);\n try {\n await git.push([`--force-with-lease=refs/heads/${branch}:${staleTip}`, 'origin', `HEAD:refs/heads/${branch}`]);\n } catch (e: any) {\n if (!isStaleLeaseRejection(e?.message || String(e))) throw e;\n logger.console(formatWarningSummary(`main -> ${branch} moved while re-forking — another run owns it now`));\n return 'raced';\n }\n return 're-forked';\n }\n\n /**\n * The \"nothing to do\" line — plus the open sync PR, if any: converged means the SYNC branch matches\n * the scope, and the default branch may still differ until that PR merges.\n */\n private async convergedSummary(branch: string): Promise<string> {\n const { gitHost } = this.deps;\n if (!gitHost) return CONVERGED_SUMMARY;\n const pr = await gitHost.findPrByBranch(branch).catch(() => undefined);\n return pr ? `${CONVERGED_SUMMARY} — open sync PR #${pr.number} still awaits review/merge` : CONVERGED_SUMMARY;\n }\n\n /**\n * The files `bit checkout head` changed, i.e. the drift. Excludes `.bit`/`node_modules` — the same\n * set the commit paths refuse to touch, keeping \"counts as drift\" and \"gets committed\" identical.\n */\n private async driftFiles(): Promise<string[]> {\n const status = await git.status();\n const paths = status.files.map((file) => file.path).filter((path) => !isNonContentPath(path));\n return [...new Set(paths)];\n }\n\n /**\n * Make sure the pushed branch has an open PR. A git-host failure only warns: the branch is pushed,\n * which is the load-bearing half, and the next run retries the PR.\n */\n private async ensureSyncPr({\n branch,\n driftCount,\n newFromScope,\n healedMainFiles,\n }: {\n branch: string;\n driftCount: number;\n newFromScope: string[];\n /** `.bitmap` entries whose stale main file this run repaired; see the PR body */\n healedMainFiles: MainFileHeal[];\n }): Promise<string | undefined> {\n const { gitHost, logger, defaultBranch } = this.deps;\n if (!gitHost) {\n logger.consoleWarning(\n 'No configured git host provider (for GitHub: BIT_GITHUB_TOKEN or GITHUB_TOKEN, plus a repository) — ' +\n 'pushed sync branch, skipping PR operations'\n );\n return undefined;\n }\n try {\n const existing = await gitHost.findPrByBranch(branch);\n if (existing) {\n logger.console(chalk.blue(`Sync PR ${existing.htmlUrl} is already open — pushed the new commit onto it`));\n return existing.htmlUrl;\n }\n const created = await gitHost.createPr({\n head: branch,\n base: defaultBranch,\n title: 'Bit sync: update to latest main scope versions',\n body: mainSyncPrBody({ driftCount, newFromScope, healedMainFiles }),\n });\n logger.console(chalk.green(`Opened sync PR ${created.htmlUrl}`));\n return created.htmlUrl;\n } catch (e: any) {\n logger.consoleWarning(`Could not open or find the sync PR for ${branch}: ${e?.message || e}`);\n return undefined;\n }\n }\n\n /**\n * Leave git on the default branch and bit on main. Mirrors `LaneSyncExecutor.restoreWorkspace`:\n * best-effort and warn-only so a restore hiccup can't throw out of a `finally` and mask the real\n * error; the clean discards untracked files `checkout head` wrote on the converged/dry-run paths.\n */\n private async restoreWorkspace() {\n const { logger, defaultBranch } = this.deps;\n try {\n if (currentLaneIdStr(this.deps.lanes)) {\n const switchErr = await this.deps.ci.switchToLaneForSync('main');\n if (switchErr) logger.consoleWarning(`Could not switch the workspace back to main: ${switchErr.message}`);\n }\n await checkoutPristineRestore(defaultBranch, () => this.deps.ci.reloadWorkspaceFromDisk());\n } catch (e: any) {\n logger.consoleWarning(`Could not restore the workspace after the main sync: ${e?.message || e}`);\n }\n }\n}\n\n/** The deferral line both raced shapes share: the catch-up refork race and the sync-branch push race. */\nfunction racedMainSummary(branch: string): string {\n return `main -> ${branch} was updated by a concurrent run — deferring to it`;\n}\n\n/** The sync commit message: no `Bit-Lane-Head` trailer — main sync keeps no state. */\nfunction mainSyncCommitMessage(driftCount: number): string {\n return [\n `chore(bit-sync): sync git to latest main scope versions (${driftCount} file(s))`,\n '',\n SYNC_COMMIT_MARKER,\n ].join('\\n');\n}\n\nfunction mainSyncPrBody({\n driftCount,\n newFromScope,\n healedMainFiles = [],\n}: {\n driftCount: number;\n newFromScope: string[];\n healedMainFiles?: MainFileHeal[];\n}): string {\n const lines = [\n 'Automated sync PR: the Bit scope moved ahead of this repository. This PR checks the workspace out to the ' +\n 'latest exported versions (`bit checkout head --auto-merge-resolve theirs`).',\n '',\n `- files changed: ${driftCount}`,\n '- conflicts between this repository and the scope were resolved **in favour of the scope** — if a file here ' +\n 'held changes that were never exported to Bit, this PR reverts them. Review the diff and close the PR ' +\n 'instead of merging if that is not what you want.',\n ];\n if (newFromScope.length) {\n lines.push(\n `- components added from the scope (${newFromScope.length}, not previously in this repository's \\`.bitmap\\`):`,\n // Bounded like the lane PR body: an over-long body is rejected by the host outright.\n ...capEntries(\n newFromScope.map((id) => ` - \\`${id}\\``),\n ' - '\n )\n );\n }\n if (healedMainFiles.length) {\n lines.push(\n `- components whose \\`.bitmap\\` entry named a main file that no longer exists here ` +\n `(${healedMainFiles.length}); the entry was repaired so the component can be loaded again:`,\n ...capEntries(\n healedMainFiles.map((heal) =>\n heal.retargetedTo\n ? ` - \\`${heal.id}\\` — main file repointed to \\`${heal.retargetedTo}\\``\n : ` - \\`${heal.id}\\` — re-imported from the scope (no usable main file was left here)`\n ),\n ' - '\n )\n );\n }\n lines.push(\n '',\n 'This PR is maintained by `bit ci sync` — re-running the command pushes any further drift onto the same branch.'\n );\n return lines.join('\\n');\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,KAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA,SAAAI,KAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,IAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,eAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,cAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,sBAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,qBAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAQ,kBAAA;EAAA,MAAAR,IAAA,GAAAE,OA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CAACC,MAAM,qDAAqD;IAC9G;IACA,GAAG,IAAA4E,8BAAU,EACX7E,YAAY,CAAC+C,GAAG,CAAE+B,EAAE,IAAK,SAASA,EAAE,IAAI,CAAC,EACzC,MACF,CACF,CAAC;EACH;EACA,IAAIxF,eAAe,CAACW,MAAM,EAAE;IAC1B2E,KAAK,CAACxD,IAAI,CACR,oFAAoF,GAClF,IAAI9B,eAAe,CAACW,MAAM,iEAAiE,EAC7F,GAAG,IAAA4E,8BAAU,EACXvF,eAAe,CAACyD,GAAG,CAAEgC,IAAI,IACvBA,IAAI,CAACC,YAAY,GACb,SAASD,IAAI,CAACD,EAAE,iCAAiCC,IAAI,CAACC,YAAY,IAAI,GACtE,SAASD,IAAI,CAACD,EAAE,qEACtB,CAAC,EACD,MACF,CACF,CAAC;EACH;EACAF,KAAK,CAACxD,IAAI,CACR,EAAE,EACF,gHACF,CAAC;EACD,OAAOwD,KAAK,CAAC1E,IAAI,CAAC,IAAI,CAAC;AACzB","ignoreList":[]}
@@ -165,6 +165,7 @@ class SyncOrchestrator {
165
165
  const mainSync = new (_mainSyncExecutor().MainSyncExecutor)({
166
166
  checkout: this.deps.checkout,
167
167
  lanes: this.deps.lanes,
168
+ workspace: this.deps.workspace,
168
169
  ci: this.deps.ci,
169
170
  logger: this.deps.logger,
170
171
  gitHost,
@@ -1 +1 @@
1
- {"version":3,"names":["_cli","data","require","path","_interopRequireWildcard","_bitError","_ci","_git","_syncConfig","_laneSyncExecutor","_mainSyncExecutor","_gitHostProvider","_gitOps","_initScaffold","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","assertCleanForDryRun","dirtyFiles","length","named","slice","join","BitError","SyncOrchestrator","constructor","deps","sync","opts","init","lane","branch","all","main","dryRun","syncInit","narrower","undefined","selectors","filter","selector","Boolean","winner","cfg","resolveSyncConfig","config","defaultScope","workspace","defaultBranch","ci","getDefaultBranchName","mainLaneName","lanes","getDefaultLaneId","name","statusAtStart","git","status","catch","files","map","file","isNonContentPath","logger","consoleWarning","remoteUrl","remote","provider","gitHost","reason","noGitHostReason","selectGitHostProvider","listGitHostProviders","trim","debug","laneSync","LaneSyncExecutor","mainSync","MainSyncExecutor","checkout","summarizeSync","syncMain","mainSyncBranch","laneName","syncableLaneNameForBranch","skipReason","laneNotSyncableReason","syncLane","hostScope","target","parseLaneTarget","explicitTarget","lines","lanesToSync","errors","listLanesToSync","push","console","formatTitle","repoRoot","gitRepoRoot","scaffoldRoot","fileOutcomes","scaffoldWorkflowFiles","displayPath","relativePath","abs","fromCwd","relative","process","cwd","startsWith","fileLines","outcome","configAdded","ensureSyncConfigBlock","configLine","ownerRepo","deriveOwnerRepo","summary","renderInitChecklist","wsConfig","getWorkspaceConfig","existing","extension","CiAspect","id","setExtension","mergeIntoExisting","ignoreVersion","write","reasonForChange","laneNameToBranch","shouldSyncLane","JSON","stringify","formatWarningSummary","names","Set","getLanes","forEach","add","msg","toString","includes","HALT_SUMMARY_PREFIX","listRemoteBranches","branchToLaneName","message","sort","halted","line","refusals","REFUSED_SUMMARY_PREFIX","exports"],"sources":["sync-orchestrator.ts"],"sourcesContent":["import { formatTitle, formatWarningSummary } from '@teambit/cli';\nimport * as path from 'path';\nimport { BitError } from '@teambit/bit-error';\nimport type { Logger } from '@teambit/logger';\nimport type { Workspace } from '@teambit/workspace';\nimport type { LanesMain } from '@teambit/lanes';\nimport type { CheckoutMain } from '@teambit/checkout';\nimport { CiAspect } from '../ci.aspect';\nimport type { CiMain, CiWorkspaceConfig } from '../ci.main.runtime';\nimport { git } from '../git';\nimport type { CiSyncConfig } from './sync-config';\nimport {\n branchToLaneName,\n laneNameToBranch,\n parseLaneTarget,\n resolveSyncConfig,\n shouldSyncLane,\n syncableLaneNameForBranch,\n} from './sync-config';\nimport { HALT_SUMMARY_PREFIX, REFUSED_SUMMARY_PREFIX, LaneSyncExecutor } from './lane-sync-executor';\nimport { MainSyncExecutor } from './main-sync-executor';\nimport { selectGitHostProvider } from './git-host-provider';\nimport { gitRepoRoot, isNonContentPath, listRemoteBranches } from './git-ops';\nimport { deriveOwnerRepo, renderInitChecklist, scaffoldWorkflowFiles } from './init-scaffold';\n\n/**\n * Refuse a `--dry-run` whose plan would be computed by force-checking-out branches over uncommitted\n * work: the main-scope drift is a diff, so the tree IS written before the dry-run return. A dry run\n * promises to write nothing, so it may not discard either — with a clean tree the write-then-restore\n * loses nothing.\n */\nexport function assertCleanForDryRun(dirtyFiles: string[]): void {\n if (!dirtyFiles.length) return;\n const named = `${dirtyFiles.slice(0, 10).join(', ')}${dirtyFiles.length > 10 ? ', …' : ''}`;\n throw new BitError(\n `bit ci sync --dry-run refuses to run: the working tree has ${dirtyFiles.length} uncommitted change(s), ` +\n `and computing the plan force-checkouts branches and removes untracked files, which would discard ` +\n `them. Commit or stash them first: ${named}`\n );\n}\n\n/** Everything the sync orchestration needs from `CiMain`, passed explicitly. */\nexport type SyncOrchestratorDeps = {\n ci: CiMain;\n workspace: Workspace;\n logger: Logger;\n lanes: LanesMain;\n checkout: CheckoutMain;\n config: CiWorkspaceConfig;\n};\n\n/**\n * Routing and aggregation for `bit ci sync`: decides which targets a run visits and how their\n * summaries combine. What reconciling a target means lives in the two executors, both stateless and\n * idempotent, so the trigger only ever decides when the reconciler runs.\n */\nexport class SyncOrchestrator {\n constructor(private deps: SyncOrchestratorDeps) {}\n\n /**\n * `bit ci sync` — reconcile Bit lanes and the main scope with git branches and pull requests.\n * Returns the per-target summary lines; throws the joined summary after the loop when any target\n * halted or was refused, so CI exits non-zero while every other target was still attempted. A skip\n * is neither — it reports itself and leaves the run green.\n */\n async sync(\n opts: { lane?: string; branch?: string; all?: boolean; main?: boolean; dryRun?: boolean; init?: boolean } = {}\n ): Promise<string> {\n if (opts.init) {\n if (opts.lane || opts.branch || opts.all || opts.main || opts.dryRun) {\n throw new BitError(\n 'bit ci sync --init cannot be combined with a lane argument, --branch, --all, --main or ' +\n '--dry-run: it only scaffolds onboarding files (workflows + workspace.jsonc config) and exits ' +\n '— it never reconciles'\n );\n }\n return this.syncInit();\n }\n\n // Refuse contradictory flag combinations rather than silently letting one target win.\n const narrower = opts.lane\n ? `a lane argument (\"${opts.lane}\")`\n : (opts.branch && `--branch (\"${opts.branch}\")`) || (opts.main && '--main') || undefined;\n if (opts.all && narrower) {\n throw new BitError(\n `--all cannot be combined with ${narrower}: --all reconciles every mapped lane plus the main ` +\n `scope, and is what runs when no target is given`\n );\n }\n\n // A lane argument, `--branch` and `--main` each select the single target; any two contradict.\n const selectors = [\n opts.lane && `a lane argument (\"${opts.lane}\")`,\n opts.branch && `--branch (\"${opts.branch}\")`,\n opts.main && '--main',\n ].filter((selector): selector is string => Boolean(selector));\n if (selectors.length > 1) {\n const winner = opts.main ? '--main' : `--branch (\"${opts.branch}\")`;\n throw new BitError(\n `${selectors[0]} cannot be combined with ${selectors.slice(1).join(' or with ')}: each selects ` +\n `the single target this run reconciles, and only ${winner} would have run — the rest would be ` +\n `silently dropped, leaving a run that reports success while a target you named was never visited`\n );\n }\n\n const cfg = resolveSyncConfig(this.deps.config.sync);\n const defaultScope = this.deps.workspace.defaultScope;\n const defaultBranch = await this.deps.ci.getDefaultBranchName();\n const mainLaneName = this.deps.lanes.getDefaultLaneId().name;\n\n // The executors force-checkout branches and remove untracked files; warn up front, naming the\n // files at stake, before an interactive run discards anything.\n const statusAtStart = await git.status().catch(() => undefined);\n const dirtyFiles = (statusAtStart?.files ?? []).map((file) => file.path).filter((file) => !isNonContentPath(file));\n if (opts.dryRun) assertCleanForDryRun(dirtyFiles);\n if (dirtyFiles.length) {\n this.deps.logger.consoleWarning(\n `the working tree has ${dirtyFiles.length} uncommitted change(s). \"bit ci sync\" force-checkouts branches ` +\n `and removes untracked files (except .bit/ and node_modules/), so these will be discarded: ` +\n `${dirtyFiles.slice(0, 10).join(', ')}${dirtyFiles.length > 10 ? ', …' : ''}`\n );\n }\n\n const remoteUrl = await git.remote(['get-url', 'origin']).catch(() => undefined);\n const { provider: gitHost, reason: noGitHostReason } = selectGitHostProvider(\n this.deps.ci.listGitHostProviders(),\n typeof remoteUrl === 'string' ? remoteUrl.trim() : undefined\n );\n if (gitHost) this.deps.logger.debug(`bit ci sync: using the \"${gitHost.name}\" git host provider`);\n // Warn once, up front — the executors' per-action lines can only say PRs were skipped, not why.\n else if (noGitHostReason) this.deps.logger.consoleWarning(noGitHostReason);\n\n const laneSync = new LaneSyncExecutor({\n lanes: this.deps.lanes,\n ci: this.deps.ci,\n logger: this.deps.logger,\n gitHost,\n cfg,\n defaultScope,\n });\n const mainSync = new MainSyncExecutor({\n checkout: this.deps.checkout,\n lanes: this.deps.lanes,\n ci: this.deps.ci,\n logger: this.deps.logger,\n gitHost,\n cfg,\n defaultBranch,\n defaultScope,\n });\n\n if (opts.main) {\n return this.summarizeSync([await mainSync.syncMain({ dryRun: opts.dryRun })]);\n }\n\n if (opts.branch) {\n const branch = opts.branch;\n // Under the default `branchPrefix: ''` these two would resolve to the bogus lanes \"main\" /\n // \"bit-sync/main\"; both are reconciled by the main-scope path, never as lanes.\n if (branch === defaultBranch) {\n return `branch ${branch} is the default branch — reconcile it with \"bit ci sync --main\"; nothing to do`;\n }\n if (branch === cfg.mainSyncBranch) {\n return `branch ${branch} is the main sync branch maintained by this command; nothing to do`;\n }\n const laneName = syncableLaneNameForBranch(branch, cfg);\n if (!laneName) return `branch ${branch} does not map to a valid lane name; nothing to do`;\n const skipReason = this.laneNotSyncableReason(laneName, cfg, mainLaneName, defaultBranch);\n if (skipReason) return `${skipReason} (branch ${branch})`;\n // A branch name carries no scope, so this path can only resolve the lane against `defaultScope`;\n // resolving a foreign-hosted lane to the wrong scope is safe (no-op, never a deletion).\n return this.summarizeSync([\n await laneSync.syncLane({ hostScope: defaultScope, name: laneName }, { dryRun: opts.dryRun }),\n ]);\n }\n\n if (opts.lane) {\n // Every guard below is asked about the NAME: \"main\" is not a lane whichever scope hosts it, and\n // the `lanes` patterns match lane names, not lane ids.\n const target = parseLaneTarget(opts.lane, defaultScope);\n const skipReason = this.laneNotSyncableReason(target.name, cfg, mainLaneName, defaultBranch);\n if (skipReason) return skipReason;\n return this.summarizeSync([await laneSync.syncLane(target, { dryRun: opts.dryRun, explicitTarget: true })]);\n }\n\n // `--all` (also the no-arguments default): every mapped lane, then the main scope. Sequential on\n // purpose — the lanes share one workspace and one git checkout.\n const lines: string[] = [];\n const { lanes: lanesToSync, errors } = await this.listLanesToSync(cfg, mainLaneName, defaultBranch);\n lines.push(...errors);\n this.deps.logger.console(\n formatTitle(\n `Reconciling ${lanesToSync.length} mapped lane(s) of ${defaultScope}` +\n `${lanesToSync.length ? `: ${lanesToSync.join(', ')}` : ''}`\n )\n );\n for (const laneName of lanesToSync) {\n // Every enumerated target is hosted on `defaultScope` by construction; foreign-hosted lanes are\n // explicit-target only.\n // oxlint-disable-next-line no-await-in-loop\n lines.push(await laneSync.syncLane({ hostScope: defaultScope, name: laneName }, { dryRun: opts.dryRun }));\n }\n lines.push(await mainSync.syncMain({ dryRun: opts.dryRun }));\n return this.summarizeSync(lines);\n }\n\n /**\n * `bit ci sync --init` — one-command onboarding: scaffolds the two workflow files, adds the sync\n * config block to workspace.jsonc if missing, and prints the manual-steps checklist. Safe to\n * re-run: existing files are skipped, an existing config block is left alone; it never reconciles.\n */\n private async syncInit(): Promise<string> {\n const defaultBranch = await this.deps.ci.getDefaultBranchName();\n\n // Workflows belong to the repository, not the workspace: GitHub only discovers them at\n // `<repo-root>/.github/workflows`, and a bit workspace may be a subdirectory.\n const repoRoot = await gitRepoRoot();\n const scaffoldRoot = repoRoot ?? this.deps.workspace.path;\n if (!repoRoot) {\n this.deps.logger.consoleWarning(\n `could not resolve the git repository root (\"git rev-parse --show-toplevel\" failed — is this a git ` +\n `repository?). Writing the workflow files under the workspace instead: ${scaffoldRoot}. If that is ` +\n `not the repository root, GitHub will not discover them — move .github/workflows there by hand.`\n );\n }\n\n const fileOutcomes = scaffoldWorkflowFiles(scaffoldRoot, defaultBranch);\n // Report the path relative to where the user is standing, not to the workspace.\n const displayPath = (relativePath: string) => {\n const abs = path.join(scaffoldRoot, relativePath);\n const fromCwd = path.relative(process.cwd(), abs);\n return fromCwd && !fromCwd.startsWith('..') ? fromCwd : abs;\n };\n const fileLines = fileOutcomes.map((outcome) =>\n outcome.status === 'written'\n ? `wrote ${displayPath(outcome.relativePath)} (default branch: ${defaultBranch})`\n : `skipped ${displayPath(outcome.relativePath)} (already exists — bit ci sync --init never overwrites)`\n );\n\n const configAdded = await this.ensureSyncConfigBlock();\n const configLine = configAdded\n ? 'added \"teambit.git/ci\": { \"sync\": {} } to workspace.jsonc'\n : 'workspace.jsonc already configures \"teambit.git/ci\".sync — left untouched';\n\n const remoteUrl = await git.remote(['get-url', 'origin']).catch(() => undefined);\n const ownerRepo = deriveOwnerRepo(typeof remoteUrl === 'string' ? remoteUrl.trim() : undefined);\n\n const summary = ['bit ci sync --init', ...fileLines, configLine, renderInitChecklist(ownerRepo)].join('\\n');\n this.deps.logger.console(summary);\n return summary;\n }\n\n /**\n * Add `\"sync\": {}` under `\"teambit.git/ci\"` in workspace.jsonc if that key isn't there yet; returns\n * whether it wrote. The comment-preserving `WorkspaceConfig` API merges into existing\n * `teambit.git/ci` config rather than clobbering it.\n */\n private async ensureSyncConfigBlock(): Promise<boolean> {\n const wsConfig = this.deps.workspace.getWorkspaceConfig();\n const existing = wsConfig.extension(CiAspect.id, true) as CiWorkspaceConfig | undefined;\n if (existing?.sync) return false;\n wsConfig.setExtension(CiAspect.id, { sync: {} }, { mergeIntoExisting: true, ignoreVersion: true });\n await wsConfig.write({ reasonForChange: 'bit ci sync --init: add the sync config block' });\n return true;\n }\n\n /**\n * Why this lane name must not be handed to the lane executor, or undefined when it's syncable. The\n * mapped branch is checked too — the lane path must never write the two branches the main-scope\n * path owns.\n */\n private laneNotSyncableReason(\n laneName: string,\n cfg: Required<CiSyncConfig>,\n mainLaneName: string,\n defaultBranch: string\n ): string | undefined {\n if (laneName === mainLaneName) {\n return `\"${mainLaneName}\" is not a lane — reconcile the main scope with \"bit ci sync --main\"; nothing to do`;\n }\n const branch = laneNameToBranch(laneName, cfg);\n if (branch === defaultBranch) {\n return (\n `lane ${laneName} maps to the default branch ${branch} — reconcile it with \"bit ci sync --main\"; ` +\n `nothing to do`\n );\n }\n if (branch === cfg.mainSyncBranch) {\n return `lane ${laneName} maps to ${branch}, the main sync branch maintained by this command; nothing to do`;\n }\n if (!shouldSyncLane(laneName, cfg)) {\n return `lane ${laneName} is not matched by the sync config (lanes: ${JSON.stringify(cfg.lanes)}); nothing to do`;\n }\n return undefined;\n }\n\n /**\n * The lane names to reconcile on an `--all` run (sorted), plus one HALTED line per enumeration\n * failure. The list is the union of the remote's lanes AND the lane-mapped branches on `origin` —\n * a lane deleted on bit.cloud is gone from the first source, and only the branch side can make\n * `close-pr` fire for it. An enumeration failure is reported rather than thrown, so the half that\n * did enumerate is still reconciled while the run exits non-zero.\n */\n private async listLanesToSync(\n cfg: Required<CiSyncConfig>,\n mainLaneName: string,\n defaultBranch: string\n ): Promise<{ lanes: string[]; errors: string[] }> {\n if (!cfg.lanes.length) {\n this.deps.logger.console(\n formatWarningSummary('sync.lanes is empty — lane mirroring is disabled, reconciling the main scope only')\n );\n return { lanes: [], errors: [] };\n }\n const errors: string[] = [];\n const names = new Set<string>();\n const remote = this.deps.workspace.defaultScope;\n\n try {\n const lanes = await this.deps.lanes.getLanes({ remote });\n lanes.forEach((lane) => {\n const name = lane.id?.name ?? lane.name;\n if (name) names.add(name);\n });\n } catch (e: any) {\n const msg = e?.toString() ?? '';\n // A scope with no lanes at all: the remote answers \"not found\" rather than an empty list.\n if (msg.includes('was not found') || msg.includes('not found')) {\n this.deps.logger.console(\n formatWarningSummary(`No lanes found on ${remote} — reconciling lane-mapped branches and the main scope only`)\n );\n } else {\n errors.push(`${HALT_SUMMARY_PREFIX} lanes -> could not list the lanes of ${remote}: ${msg}`);\n }\n }\n\n try {\n for (const branch of await listRemoteBranches()) {\n // Reconciled by the main-scope path, never as lanes — under the default `branchPrefix: ''`\n // they would otherwise resolve to the bogus lanes \"main\" / \"bit-sync/main\".\n if (branch === defaultBranch || branch === cfg.mainSyncBranch) continue;\n // Ordinary developer branches are skipped at debug level, never as a summary line.\n const laneName = syncableLaneNameForBranch(branch, cfg);\n if (!laneName) {\n this.deps.logger.debug(\n `bit ci sync: branch \"${branch}\" does not map to a name any lane could have ` +\n `(mapped to \"${branchToLaneName(branch, cfg) ?? '<not lane-mapped>'}\") — skipping it`\n );\n continue;\n }\n names.add(laneName);\n }\n } catch (e: any) {\n errors.push(\n `${HALT_SUMMARY_PREFIX} lanes -> could not list the branches of \"origin\", so a lane deleted on ` +\n `bit.cloud may have kept an orphan branch and an open PR: ${e?.message || e}`\n );\n }\n\n const lanes = [...names]\n .filter((name) => name !== mainLaneName)\n .filter((name) => shouldSyncLane(name, cfg))\n .sort();\n return { lanes, errors };\n }\n\n /**\n * Join the per-target summary lines, and turn any halt into a non-zero exit — the executors never\n * throw, so this is the single place \"needs a human\" becomes visible to CI. `BitError` rather than\n * `Error`: bit reports a plain `Error` as an internal failure (stack trace, Sentry FATAL).\n */\n private summarizeSync(lines: string[]): string {\n const summary = lines.join('\\n');\n const halted = lines.filter((line) => line.startsWith(HALT_SUMMARY_PREFIX));\n if (halted.length) {\n throw new BitError(`bit ci sync could not reconcile ${halted.length} target(s):\\n${summary}`);\n }\n // A refusal is not a halt: the repository is healthy, the reconciler simply will not do what was\n // asked — exit non-zero saying that, rather than reporting a sync conflict.\n const refusals = lines.filter((line) => line.startsWith(REFUSED_SUMMARY_PREFIX));\n if (refusals.length) {\n throw new BitError(refusals.map((line) => line.slice(REFUSED_SUMMARY_PREFIX.length).trim()).join('\\n'));\n }\n return summary;\n }\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;A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sB,CAACtI,MAAM,CAAC,CAACsD,IAAI,CAAC,CAAC,CAAC,CAACnD,IAAI,CAAC,IAAI,CAAC,CAAC;IACzG;IACA,OAAOiG,OAAO;EAChB;AACF;AAACmC,OAAA,CAAAlI,gBAAA,GAAAA,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_cli","data","require","path","_interopRequireWildcard","_bitError","_ci","_git","_syncConfig","_laneSyncExecutor","_mainSyncExecutor","_gitHostProvider","_gitOps","_initScaffold","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","assertCleanForDryRun","dirtyFiles","length","named","slice","join","BitError","SyncOrchestrator","constructor","deps","sync","opts","init","lane","branch","all","main","dryRun","syncInit","narrower","undefined","selectors","filter","selector","Boolean","winner","cfg","resolveSyncConfig","config","defaultScope","workspace","defaultBranch","ci","getDefaultBranchName","mainLaneName","lanes","getDefaultLaneId","name","statusAtStart","git","status","catch","files","map","file","isNonContentPath","logger","consoleWarning","remoteUrl","remote","provider","gitHost","reason","noGitHostReason","selectGitHostProvider","listGitHostProviders","trim","debug","laneSync","LaneSyncExecutor","mainSync","MainSyncExecutor","checkout","summarizeSync","syncMain","mainSyncBranch","laneName","syncableLaneNameForBranch","skipReason","laneNotSyncableReason","syncLane","hostScope","target","parseLaneTarget","explicitTarget","lines","lanesToSync","errors","listLanesToSync","push","console","formatTitle","repoRoot","gitRepoRoot","scaffoldRoot","fileOutcomes","scaffoldWorkflowFiles","displayPath","relativePath","abs","fromCwd","relative","process","cwd","startsWith","fileLines","outcome","configAdded","ensureSyncConfigBlock","configLine","ownerRepo","deriveOwnerRepo","summary","renderInitChecklist","wsConfig","getWorkspaceConfig","existing","extension","CiAspect","id","setExtension","mergeIntoExisting","ignoreVersion","write","reasonForChange","laneNameToBranch","shouldSyncLane","JSON","stringify","formatWarningSummary","names","Set","getLanes","forEach","add","msg","toString","includes","HALT_SUMMARY_PREFIX","listRemoteBranches","branchToLaneName","message","sort","halted","line","refusals","REFUSED_SUMMARY_PREFIX","exports"],"sources":["sync-orchestrator.ts"],"sourcesContent":["import { formatTitle, formatWarningSummary } from '@teambit/cli';\nimport * as path from 'path';\nimport { BitError } from '@teambit/bit-error';\nimport type { Logger } from '@teambit/logger';\nimport type { Workspace } from '@teambit/workspace';\nimport type { LanesMain } from '@teambit/lanes';\nimport type { CheckoutMain } from '@teambit/checkout';\nimport { CiAspect } from '../ci.aspect';\nimport type { CiMain, CiWorkspaceConfig } from '../ci.main.runtime';\nimport { git } from '../git';\nimport type { CiSyncConfig } from './sync-config';\nimport {\n branchToLaneName,\n laneNameToBranch,\n parseLaneTarget,\n resolveSyncConfig,\n shouldSyncLane,\n syncableLaneNameForBranch,\n} from './sync-config';\nimport { HALT_SUMMARY_PREFIX, REFUSED_SUMMARY_PREFIX, LaneSyncExecutor } from './lane-sync-executor';\nimport { MainSyncExecutor } from './main-sync-executor';\nimport { selectGitHostProvider } from './git-host-provider';\nimport { gitRepoRoot, isNonContentPath, listRemoteBranches } from './git-ops';\nimport { deriveOwnerRepo, renderInitChecklist, scaffoldWorkflowFiles } from './init-scaffold';\n\n/**\n * Refuse a `--dry-run` whose plan would be computed by force-checking-out branches over uncommitted\n * work: the main-scope drift is a diff, so the tree IS written before the dry-run return. A dry run\n * promises to write nothing, so it may not discard either — with a clean tree the write-then-restore\n * loses nothing.\n */\nexport function assertCleanForDryRun(dirtyFiles: string[]): void {\n if (!dirtyFiles.length) return;\n const named = `${dirtyFiles.slice(0, 10).join(', ')}${dirtyFiles.length > 10 ? ', …' : ''}`;\n throw new BitError(\n `bit ci sync --dry-run refuses to run: the working tree has ${dirtyFiles.length} uncommitted change(s), ` +\n `and computing the plan force-checkouts branches and removes untracked files, which would discard ` +\n `them. Commit or stash them first: ${named}`\n );\n}\n\n/** Everything the sync orchestration needs from `CiMain`, passed explicitly. */\nexport type SyncOrchestratorDeps = {\n ci: CiMain;\n workspace: Workspace;\n logger: Logger;\n lanes: LanesMain;\n checkout: CheckoutMain;\n config: CiWorkspaceConfig;\n};\n\n/**\n * Routing and aggregation for `bit ci sync`: decides which targets a run visits and how their\n * summaries combine. What reconciling a target means lives in the two executors, both stateless and\n * idempotent, so the trigger only ever decides when the reconciler runs.\n */\nexport class SyncOrchestrator {\n constructor(private deps: SyncOrchestratorDeps) {}\n\n /**\n * `bit ci sync` — reconcile Bit lanes and the main scope with git branches and pull requests.\n * Returns the per-target summary lines; throws the joined summary after the loop when any target\n * halted or was refused, so CI exits non-zero while every other target was still attempted. A skip\n * is neither — it reports itself and leaves the run green.\n */\n async sync(\n opts: { lane?: string; branch?: string; all?: boolean; main?: boolean; dryRun?: boolean; init?: boolean } = {}\n ): Promise<string> {\n if (opts.init) {\n if (opts.lane || opts.branch || opts.all || opts.main || opts.dryRun) {\n throw new BitError(\n 'bit ci sync --init cannot be combined with a lane argument, --branch, --all, --main or ' +\n '--dry-run: it only scaffolds onboarding files (workflows + workspace.jsonc config) and exits ' +\n '— it never reconciles'\n );\n }\n return this.syncInit();\n }\n\n // Refuse contradictory flag combinations rather than silently letting one target win.\n const narrower = opts.lane\n ? `a lane argument (\"${opts.lane}\")`\n : (opts.branch && `--branch (\"${opts.branch}\")`) || (opts.main && '--main') || undefined;\n if (opts.all && narrower) {\n throw new BitError(\n `--all cannot be combined with ${narrower}: --all reconciles every mapped lane plus the main ` +\n `scope, and is what runs when no target is given`\n );\n }\n\n // A lane argument, `--branch` and `--main` each select the single target; any two contradict.\n const selectors = [\n opts.lane && `a lane argument (\"${opts.lane}\")`,\n opts.branch && `--branch (\"${opts.branch}\")`,\n opts.main && '--main',\n ].filter((selector): selector is string => Boolean(selector));\n if (selectors.length > 1) {\n const winner = opts.main ? '--main' : `--branch (\"${opts.branch}\")`;\n throw new BitError(\n `${selectors[0]} cannot be combined with ${selectors.slice(1).join(' or with ')}: each selects ` +\n `the single target this run reconciles, and only ${winner} would have run — the rest would be ` +\n `silently dropped, leaving a run that reports success while a target you named was never visited`\n );\n }\n\n const cfg = resolveSyncConfig(this.deps.config.sync);\n const defaultScope = this.deps.workspace.defaultScope;\n const defaultBranch = await this.deps.ci.getDefaultBranchName();\n const mainLaneName = this.deps.lanes.getDefaultLaneId().name;\n\n // The executors force-checkout branches and remove untracked files; warn up front, naming the\n // files at stake, before an interactive run discards anything.\n const statusAtStart = await git.status().catch(() => undefined);\n const dirtyFiles = (statusAtStart?.files ?? []).map((file) => file.path).filter((file) => !isNonContentPath(file));\n if (opts.dryRun) assertCleanForDryRun(dirtyFiles);\n if (dirtyFiles.length) {\n this.deps.logger.consoleWarning(\n `the working tree has ${dirtyFiles.length} uncommitted change(s). \"bit ci sync\" force-checkouts branches ` +\n `and removes untracked files (except .bit/ and node_modules/), so these will be discarded: ` +\n `${dirtyFiles.slice(0, 10).join(', ')}${dirtyFiles.length > 10 ? ', …' : ''}`\n );\n }\n\n const remoteUrl = await git.remote(['get-url', 'origin']).catch(() => undefined);\n const { provider: gitHost, reason: noGitHostReason } = selectGitHostProvider(\n this.deps.ci.listGitHostProviders(),\n typeof remoteUrl === 'string' ? remoteUrl.trim() : undefined\n );\n if (gitHost) this.deps.logger.debug(`bit ci sync: using the \"${gitHost.name}\" git host provider`);\n // Warn once, up front — the executors' per-action lines can only say PRs were skipped, not why.\n else if (noGitHostReason) this.deps.logger.consoleWarning(noGitHostReason);\n\n const laneSync = new LaneSyncExecutor({\n lanes: this.deps.lanes,\n ci: this.deps.ci,\n logger: this.deps.logger,\n gitHost,\n cfg,\n defaultScope,\n });\n const mainSync = new MainSyncExecutor({\n checkout: this.deps.checkout,\n lanes: this.deps.lanes,\n workspace: this.deps.workspace,\n ci: this.deps.ci,\n logger: this.deps.logger,\n gitHost,\n cfg,\n defaultBranch,\n defaultScope,\n });\n\n if (opts.main) {\n return this.summarizeSync([await mainSync.syncMain({ dryRun: opts.dryRun })]);\n }\n\n if (opts.branch) {\n const branch = opts.branch;\n // Under the default `branchPrefix: ''` these two would resolve to the bogus lanes \"main\" /\n // \"bit-sync/main\"; both are reconciled by the main-scope path, never as lanes.\n if (branch === defaultBranch) {\n return `branch ${branch} is the default branch — reconcile it with \"bit ci sync --main\"; nothing to do`;\n }\n if (branch === cfg.mainSyncBranch) {\n return `branch ${branch} is the main sync branch maintained by this command; nothing to do`;\n }\n const laneName = syncableLaneNameForBranch(branch, cfg);\n if (!laneName) return `branch ${branch} does not map to a valid lane name; nothing to do`;\n const skipReason = this.laneNotSyncableReason(laneName, cfg, mainLaneName, defaultBranch);\n if (skipReason) return `${skipReason} (branch ${branch})`;\n // A branch name carries no scope, so this path can only resolve the lane against `defaultScope`;\n // resolving a foreign-hosted lane to the wrong scope is safe (no-op, never a deletion).\n return this.summarizeSync([\n await laneSync.syncLane({ hostScope: defaultScope, name: laneName }, { dryRun: opts.dryRun }),\n ]);\n }\n\n if (opts.lane) {\n // Every guard below is asked about the NAME: \"main\" is not a lane whichever scope hosts it, and\n // the `lanes` patterns match lane names, not lane ids.\n const target = parseLaneTarget(opts.lane, defaultScope);\n const skipReason = this.laneNotSyncableReason(target.name, cfg, mainLaneName, defaultBranch);\n if (skipReason) return skipReason;\n return this.summarizeSync([await laneSync.syncLane(target, { dryRun: opts.dryRun, explicitTarget: true })]);\n }\n\n // `--all` (also the no-arguments default): every mapped lane, then the main scope. Sequential on\n // purpose — the lanes share one workspace and one git checkout.\n const lines: string[] = [];\n const { lanes: lanesToSync, errors } = await this.listLanesToSync(cfg, mainLaneName, defaultBranch);\n lines.push(...errors);\n this.deps.logger.console(\n formatTitle(\n `Reconciling ${lanesToSync.length} mapped lane(s) of ${defaultScope}` +\n `${lanesToSync.length ? `: ${lanesToSync.join(', ')}` : ''}`\n )\n );\n for (const laneName of lanesToSync) {\n // Every enumerated target is hosted on `defaultScope` by construction; foreign-hosted lanes are\n // explicit-target only.\n // oxlint-disable-next-line no-await-in-loop\n lines.push(await laneSync.syncLane({ hostScope: defaultScope, name: laneName }, { dryRun: opts.dryRun }));\n }\n lines.push(await mainSync.syncMain({ dryRun: opts.dryRun }));\n return this.summarizeSync(lines);\n }\n\n /**\n * `bit ci sync --init` — one-command onboarding: scaffolds the two workflow files, adds the sync\n * config block to workspace.jsonc if missing, and prints the manual-steps checklist. Safe to\n * re-run: existing files are skipped, an existing config block is left alone; it never reconciles.\n */\n private async syncInit(): Promise<string> {\n const defaultBranch = await this.deps.ci.getDefaultBranchName();\n\n // Workflows belong to the repository, not the workspace: GitHub only discovers them at\n // `<repo-root>/.github/workflows`, and a bit workspace may be a subdirectory.\n const repoRoot = await gitRepoRoot();\n const scaffoldRoot = repoRoot ?? this.deps.workspace.path;\n if (!repoRoot) {\n this.deps.logger.consoleWarning(\n `could not resolve the git repository root (\"git rev-parse --show-toplevel\" failed — is this a git ` +\n `repository?). Writing the workflow files under the workspace instead: ${scaffoldRoot}. If that is ` +\n `not the repository root, GitHub will not discover them — move .github/workflows there by hand.`\n );\n }\n\n const fileOutcomes = scaffoldWorkflowFiles(scaffoldRoot, defaultBranch);\n // Report the path relative to where the user is standing, not to the workspace.\n const displayPath = (relativePath: string) => {\n const abs = path.join(scaffoldRoot, relativePath);\n const fromCwd = path.relative(process.cwd(), abs);\n return fromCwd && !fromCwd.startsWith('..') ? fromCwd : abs;\n };\n const fileLines = fileOutcomes.map((outcome) =>\n outcome.status === 'written'\n ? `wrote ${displayPath(outcome.relativePath)} (default branch: ${defaultBranch})`\n : `skipped ${displayPath(outcome.relativePath)} (already exists — bit ci sync --init never overwrites)`\n );\n\n const configAdded = await this.ensureSyncConfigBlock();\n const configLine = configAdded\n ? 'added \"teambit.git/ci\": { \"sync\": {} } to workspace.jsonc'\n : 'workspace.jsonc already configures \"teambit.git/ci\".sync — left untouched';\n\n const remoteUrl = await git.remote(['get-url', 'origin']).catch(() => undefined);\n const ownerRepo = deriveOwnerRepo(typeof remoteUrl === 'string' ? remoteUrl.trim() : undefined);\n\n const summary = ['bit ci sync --init', ...fileLines, configLine, renderInitChecklist(ownerRepo)].join('\\n');\n this.deps.logger.console(summary);\n return summary;\n }\n\n /**\n * Add `\"sync\": {}` under `\"teambit.git/ci\"` in workspace.jsonc if that key isn't there yet; returns\n * whether it wrote. The comment-preserving `WorkspaceConfig` API merges into existing\n * `teambit.git/ci` config rather than clobbering it.\n */\n private async ensureSyncConfigBlock(): Promise<boolean> {\n const wsConfig = this.deps.workspace.getWorkspaceConfig();\n const existing = wsConfig.extension(CiAspect.id, true) as CiWorkspaceConfig | undefined;\n if (existing?.sync) return false;\n wsConfig.setExtension(CiAspect.id, { sync: {} }, { mergeIntoExisting: true, ignoreVersion: true });\n await wsConfig.write({ reasonForChange: 'bit ci sync --init: add the sync config block' });\n return true;\n }\n\n /**\n * Why this lane name must not be handed to the lane executor, or undefined when it's syncable. The\n * mapped branch is checked too — the lane path must never write the two branches the main-scope\n * path owns.\n */\n private laneNotSyncableReason(\n laneName: string,\n cfg: Required<CiSyncConfig>,\n mainLaneName: string,\n defaultBranch: string\n ): string | undefined {\n if (laneName === mainLaneName) {\n return `\"${mainLaneName}\" is not a lane — reconcile the main scope with \"bit ci sync --main\"; nothing to do`;\n }\n const branch = laneNameToBranch(laneName, cfg);\n if (branch === defaultBranch) {\n return (\n `lane ${laneName} maps to the default branch ${branch} — reconcile it with \"bit ci sync --main\"; ` +\n `nothing to do`\n );\n }\n if (branch === cfg.mainSyncBranch) {\n return `lane ${laneName} maps to ${branch}, the main sync branch maintained by this command; nothing to do`;\n }\n if (!shouldSyncLane(laneName, cfg)) {\n return `lane ${laneName} is not matched by the sync config (lanes: ${JSON.stringify(cfg.lanes)}); nothing to do`;\n }\n return undefined;\n }\n\n /**\n * The lane names to reconcile on an `--all` run (sorted), plus one HALTED line per enumeration\n * failure. The list is the union of the remote's lanes AND the lane-mapped branches on `origin` —\n * a lane deleted on bit.cloud is gone from the first source, and only the branch side can make\n * `close-pr` fire for it. An enumeration failure is reported rather than thrown, so the half that\n * did enumerate is still reconciled while the run exits non-zero.\n */\n private async listLanesToSync(\n cfg: Required<CiSyncConfig>,\n mainLaneName: string,\n defaultBranch: string\n ): Promise<{ lanes: string[]; errors: string[] }> {\n if (!cfg.lanes.length) {\n this.deps.logger.console(\n formatWarningSummary('sync.lanes is empty — lane mirroring is disabled, reconciling the main scope only')\n );\n return { lanes: [], errors: [] };\n }\n const errors: string[] = [];\n const names = new Set<string>();\n const remote = this.deps.workspace.defaultScope;\n\n try {\n const lanes = await this.deps.lanes.getLanes({ remote });\n lanes.forEach((lane) => {\n const name = lane.id?.name ?? lane.name;\n if (name) names.add(name);\n });\n } catch (e: any) {\n const msg = e?.toString() ?? '';\n // A scope with no lanes at all: the remote answers \"not found\" rather than an empty list.\n if (msg.includes('was not found') || msg.includes('not found')) {\n this.deps.logger.console(\n formatWarningSummary(`No lanes found on ${remote} — reconciling lane-mapped branches and the main scope only`)\n );\n } else {\n errors.push(`${HALT_SUMMARY_PREFIX} lanes -> could not list the lanes of ${remote}: ${msg}`);\n }\n }\n\n try {\n for (const branch of await listRemoteBranches()) {\n // Reconciled by the main-scope path, never as lanes — under the default `branchPrefix: ''`\n // they would otherwise resolve to the bogus lanes \"main\" / \"bit-sync/main\".\n if (branch === defaultBranch || branch === cfg.mainSyncBranch) continue;\n // Ordinary developer branches are skipped at debug level, never as a summary line.\n const laneName = syncableLaneNameForBranch(branch, cfg);\n if (!laneName) {\n this.deps.logger.debug(\n `bit ci sync: branch \"${branch}\" does not map to a name any lane could have ` +\n `(mapped to \"${branchToLaneName(branch, cfg) ?? '<not lane-mapped>'}\") — skipping it`\n );\n continue;\n }\n names.add(laneName);\n }\n } catch (e: any) {\n errors.push(\n `${HALT_SUMMARY_PREFIX} lanes -> could not list the branches of \"origin\", so a lane deleted on ` +\n `bit.cloud may have kept an orphan branch and an open PR: ${e?.message || e}`\n );\n }\n\n const lanes = [...names]\n .filter((name) => name !== mainLaneName)\n .filter((name) => shouldSyncLane(name, cfg))\n .sort();\n return { lanes, errors };\n }\n\n /**\n * Join the per-target summary lines, and turn any halt into a non-zero exit — the executors never\n * throw, so this is the single place \"needs a human\" becomes visible to CI. `BitError` rather than\n * `Error`: bit reports a plain `Error` as an internal failure (stack trace, Sentry FATAL).\n */\n private summarizeSync(lines: string[]): string {\n const summary = lines.join('\\n');\n const halted = lines.filter((line) => line.startsWith(HALT_SUMMARY_PREFIX));\n if (halted.length) {\n throw new BitError(`bit ci sync could not reconcile ${halted.length} target(s):\\n${summary}`);\n }\n // A refusal is not a halt: the repository is healthy, the reconciler simply will not do what was\n // asked — exit non-zero saying that, rather than reporting a sync conflict.\n const refusals = lines.filter((line) => line.startsWith(REFUSED_SUMMARY_PREFIX));\n if (refusals.length) {\n throw new BitError(refusals.map((line) => line.slice(REFUSED_SUMMARY_PREFIX.length).trim()).join('\\n'));\n }\n return summary;\n }\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,KAAA;EAAA,MAAAF,IAAA,GAAAG,uBAAA,CAAAF,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA,SAAAK,IAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,GAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,KAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,IAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,YAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,WAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;E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AEA;AACF;AACA;AACA;AACA;EACUd,aAAaA,CAACY,KAAe,EAAU;IAC7C,MAAM2B,OAAO,GAAG3B,KAAK,CAACtE,IAAI,CAAC,IAAI,CAAC;IAChC,MAAMgI,MAAM,GAAG1D,KAAK,CAACrD,MAAM,CAAEgH,IAAI,IAAKA,IAAI,CAACxC,UAAU,CAACkC,uCAAmB,CAAC,CAAC;IAC3E,IAAIK,MAAM,CAACnI,MAAM,EAAE;MACjB,MAAM,KAAII,oBAAQ,EAAC,mCAAmC+H,MAAM,CAACnI,MAAM,gBAAgBoG,OAAO,EAAE,CAAC;IAC/F;IACA;IACA;IACA,MAAMiC,QAAQ,GAAG5D,KAAK,CAACrD,MAAM,CAAEgH,IAAI,IAAKA,IAAI,CAACxC,UAAU,CAAC0C,0CAAsB,CAAC,CAAC;IAChF,IAAID,QAAQ,CAACrI,MAAM,EAAE;MACnB,MAAM,KAAII,oBAAQ,EAACiI,QAAQ,CAAC5F,GAAG,CAAE2F,IAAI,IAAKA,IAAI,CAAClI,KAAK,CAACoI,0CAAsB,CAACtI,MAAM,CAAC,CAACsD,IAAI,CAAC,CAAC,CAAC,CAACnD,IAAI,CAAC,IAAI,CAAC,CAAC;IACzG;IACA,OAAOiG,OAAO;EAChB;AACF;AAACmC,OAAA,CAAAlI,gBAAA,GAAAA,gBAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/ci",
3
- "version": "1.0.523",
3
+ "version": "1.0.525",
4
4
  "homepage": "https://bit.cloud/teambit/git/ci",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.git",
8
8
  "name": "ci",
9
- "version": "1.0.523"
9
+ "version": "1.0.525"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "4.1.2",
@@ -14,37 +14,39 @@
14
14
  "lodash": "4.17.21",
15
15
  "semver": "7.7.1",
16
16
  "simple-git": "^3.28.0",
17
+ "fs-extra": "10.0.0",
17
18
  "@teambit/harmony": "0.4.12",
18
- "@teambit/cli": "0.0.1375",
19
- "@teambit/logger": "0.0.1468",
20
19
  "@teambit/component-id": "1.2.4",
21
- "@teambit/component.modules.merge-helper": "0.0.91",
22
- "@teambit/component.snap-distance": "0.0.149",
23
20
  "@teambit/harmony.modules.concurrency": "0.0.42",
24
21
  "@teambit/lane-id": "0.0.312",
25
- "@teambit/legacy.consumer-component": "0.0.149",
26
22
  "@teambit/toolbox.promise.map-pool": "0.0.19",
27
23
  "@teambit/toolbox.string.random": "0.0.18",
28
24
  "@teambit/bit-error": "0.0.404",
29
25
  "@teambit/legacy.constants": "0.0.41",
30
- "@teambit/legacy.scope": "0.0.148",
31
- "@teambit/legacy.bit-map": "0.0.205",
32
26
  "@teambit/toolbox.crypto.sha1": "0.0.20",
33
- "@teambit/workspace": "1.0.1128",
34
- "@teambit/builder": "1.0.1128",
35
- "@teambit/checkout": "1.0.1129",
36
- "@teambit/config-merger": "0.0.995",
37
- "@teambit/dependency-resolver": "1.0.1128",
38
- "@teambit/export": "1.0.1128",
39
- "@teambit/importer": "1.0.1128",
40
- "@teambit/lanes": "1.0.1149",
41
- "@teambit/objects": "0.0.635",
42
- "@teambit/snapping": "1.0.1128",
43
- "@teambit/status": "1.0.1153"
27
+ "@teambit/cli": "0.0.1376",
28
+ "@teambit/logger": "0.0.1469",
29
+ "@teambit/workspace": "1.0.1129",
30
+ "@teambit/builder": "1.0.1129",
31
+ "@teambit/checkout": "1.0.1131",
32
+ "@teambit/component.modules.merge-helper": "0.0.92",
33
+ "@teambit/component.snap-distance": "0.0.150",
34
+ "@teambit/config-merger": "0.0.996",
35
+ "@teambit/dependency-resolver": "1.0.1129",
36
+ "@teambit/export": "1.0.1129",
37
+ "@teambit/importer": "1.0.1129",
38
+ "@teambit/lanes": "1.0.1151",
39
+ "@teambit/legacy.consumer-component": "0.0.150",
40
+ "@teambit/objects": "0.0.636",
41
+ "@teambit/snapping": "1.0.1129",
42
+ "@teambit/status": "1.0.1155",
43
+ "@teambit/legacy.scope": "0.0.149",
44
+ "@teambit/legacy.bit-map": "0.0.206"
44
45
  },
45
46
  "devDependencies": {
46
47
  "@types/lodash": "4.14.165",
47
48
  "@types/semver": "7.5.8",
49
+ "@types/fs-extra": "9.0.7",
48
50
  "yaml": "1.10.2",
49
51
  "@teambit/harmony.envs.core-aspect-env": "2.0.6"
50
52
  },