@fuzdev/fuz_gitops 0.78.1 → 0.79.0

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.
Files changed (179) hide show
  1. package/README.md +78 -24
  2. package/dist/ModulesDetail.svelte +15 -22
  3. package/dist/ModulesDetail.svelte.d.ts.map +1 -1
  4. package/dist/ModulesNav.svelte +4 -1
  5. package/dist/ModulesPage.svelte +1 -3
  6. package/dist/ModulesPage.svelte.d.ts.map +1 -1
  7. package/dist/PageHeader.svelte +2 -2
  8. package/dist/PageHeader.svelte.d.ts +0 -3
  9. package/dist/PageHeader.svelte.d.ts.map +1 -1
  10. package/dist/PullRequestsDetail.svelte +10 -9
  11. package/dist/PullRequestsDetail.svelte.d.ts.map +1 -1
  12. package/dist/PullRequestsPage.svelte +1 -3
  13. package/dist/PullRequestsPage.svelte.d.ts.map +1 -1
  14. package/dist/ReposTable.svelte +27 -48
  15. package/dist/ReposTable.svelte.d.ts.map +1 -1
  16. package/dist/ReposTree.svelte +5 -19
  17. package/dist/ReposTree.svelte.d.ts.map +1 -1
  18. package/dist/ReposTreeNav.svelte +5 -7
  19. package/dist/ReposTreeNav.svelte.d.ts.map +1 -1
  20. package/dist/TablePage.svelte +1 -3
  21. package/dist/TablePage.svelte.d.ts.map +1 -1
  22. package/dist/TreeItemPage.svelte +1 -3
  23. package/dist/TreeItemPage.svelte.d.ts.map +1 -1
  24. package/dist/TreePage.svelte +1 -3
  25. package/dist/TreePage.svelte.d.ts.map +1 -1
  26. package/dist/ci_reconcile.d.ts +6 -10
  27. package/dist/ci_reconcile.d.ts.map +1 -1
  28. package/dist/ci_reconcile.js +6 -8
  29. package/dist/dependency_graph.d.ts +26 -49
  30. package/dist/dependency_graph.d.ts.map +1 -1
  31. package/dist/dependency_graph.js +37 -80
  32. package/dist/dependency_updater.d.ts +1 -1
  33. package/dist/dependency_updater.d.ts.map +1 -1
  34. package/dist/dependency_updater.js +6 -1
  35. package/dist/fetch_repo_data.d.ts +34 -8
  36. package/dist/fetch_repo_data.d.ts.map +1 -1
  37. package/dist/fetch_repo_data.js +44 -22
  38. package/dist/fs_fetch_value_cache.d.ts +1 -1
  39. package/dist/fs_fetch_value_cache.js +1 -1
  40. package/dist/git_operations.d.ts +6 -49
  41. package/dist/git_operations.d.ts.map +1 -1
  42. package/dist/git_operations.js +13 -126
  43. package/dist/github.d.ts +17 -2
  44. package/dist/github.d.ts.map +1 -1
  45. package/dist/github.js +15 -6
  46. package/dist/github_helpers.d.ts.map +1 -1
  47. package/dist/github_helpers.js +3 -11
  48. package/dist/gitops_analyze.task.d.ts +24 -2
  49. package/dist/gitops_analyze.task.d.ts.map +1 -1
  50. package/dist/gitops_analyze.task.js +43 -30
  51. package/dist/gitops_config.d.ts +34 -79
  52. package/dist/gitops_config.d.ts.map +1 -1
  53. package/dist/gitops_config.js +76 -53
  54. package/dist/gitops_constants.d.ts +6 -4
  55. package/dist/gitops_constants.d.ts.map +1 -1
  56. package/dist/gitops_constants.js +6 -4
  57. package/dist/gitops_plan.task.d.ts +29 -3
  58. package/dist/gitops_plan.task.d.ts.map +1 -1
  59. package/dist/gitops_plan.task.js +80 -58
  60. package/dist/gitops_publish.task.d.ts +62 -2
  61. package/dist/gitops_publish.task.d.ts.map +1 -1
  62. package/dist/gitops_publish.task.js +187 -102
  63. package/dist/gitops_run.task.d.ts +74 -0
  64. package/dist/gitops_run.task.d.ts.map +1 -1
  65. package/dist/gitops_run.task.js +174 -160
  66. package/dist/gitops_sync.task.d.ts +65 -3
  67. package/dist/gitops_sync.task.d.ts.map +1 -1
  68. package/dist/gitops_sync.task.js +154 -30
  69. package/dist/gitops_task_helpers.d.ts +86 -59
  70. package/dist/gitops_task_helpers.d.ts.map +1 -1
  71. package/dist/gitops_task_helpers.js +120 -79
  72. package/dist/gitops_validate.task.d.ts +1 -2
  73. package/dist/gitops_validate.task.d.ts.map +1 -1
  74. package/dist/gitops_validate.task.js +15 -22
  75. package/dist/graph_validation.d.ts +16 -27
  76. package/dist/graph_validation.d.ts.map +1 -1
  77. package/dist/graph_validation.js +23 -64
  78. package/dist/local_repo.d.ts +50 -62
  79. package/dist/local_repo.d.ts.map +1 -1
  80. package/dist/local_repo.js +80 -193
  81. package/dist/log_helpers.d.ts +8 -8
  82. package/dist/log_helpers.d.ts.map +1 -1
  83. package/dist/multi_repo_publisher.d.ts +10 -0
  84. package/dist/multi_repo_publisher.d.ts.map +1 -1
  85. package/dist/multi_repo_publisher.js +115 -51
  86. package/dist/npm_registry.d.ts +23 -19
  87. package/dist/npm_registry.d.ts.map +1 -1
  88. package/dist/npm_registry.js +20 -47
  89. package/dist/operations.d.ts +75 -180
  90. package/dist/operations.d.ts.map +1 -1
  91. package/dist/operations.js +15 -7
  92. package/dist/operations_defaults.d.ts +17 -2
  93. package/dist/operations_defaults.d.ts.map +1 -1
  94. package/dist/operations_defaults.js +104 -121
  95. package/dist/output_helpers.d.ts +36 -0
  96. package/dist/output_helpers.d.ts.map +1 -1
  97. package/dist/output_helpers.js +37 -3
  98. package/dist/preflight_checks.d.ts +20 -27
  99. package/dist/preflight_checks.d.ts.map +1 -1
  100. package/dist/preflight_checks.js +37 -126
  101. package/dist/publish_steps.d.ts +2 -4
  102. package/dist/publish_steps.d.ts.map +1 -1
  103. package/dist/publish_steps.js +2 -6
  104. package/dist/publishing_event.d.ts +2 -8
  105. package/dist/publishing_event.d.ts.map +1 -1
  106. package/dist/publishing_event.js +5 -4
  107. package/dist/publishing_event_handler.d.ts +10 -8
  108. package/dist/publishing_event_handler.d.ts.map +1 -1
  109. package/dist/publishing_event_handler.js +14 -12
  110. package/dist/publishing_plan.d.ts +16 -1
  111. package/dist/publishing_plan.d.ts.map +1 -1
  112. package/dist/publishing_plan.js +328 -250
  113. package/dist/publishing_plan_logging.d.ts +1 -1
  114. package/dist/publishing_plan_logging.d.ts.map +1 -1
  115. package/dist/publishing_plan_logging.js +21 -14
  116. package/dist/repo.svelte.d.ts +7 -0
  117. package/dist/repo.svelte.d.ts.map +1 -1
  118. package/dist/repo.svelte.js +3 -0
  119. package/dist/repo_readiness.d.ts +210 -0
  120. package/dist/repo_readiness.d.ts.map +1 -0
  121. package/dist/repo_readiness.js +516 -0
  122. package/dist/repos_status.d.ts +3340 -0
  123. package/dist/repos_status.d.ts.map +1 -0
  124. package/dist/repos_status.js +555 -0
  125. package/dist/repos_status_load.d.ts +65 -0
  126. package/dist/repos_status_load.d.ts.map +1 -0
  127. package/dist/repos_status_load.js +131 -0
  128. package/package.json +7 -27
  129. package/src/lib/ci_reconcile.ts +7 -11
  130. package/src/lib/dependency_graph.ts +45 -97
  131. package/src/lib/dependency_updater.ts +7 -1
  132. package/src/lib/fetch_repo_data.ts +66 -29
  133. package/src/lib/fs_fetch_value_cache.ts +1 -1
  134. package/src/lib/git_operations.ts +15 -187
  135. package/src/lib/github.ts +20 -8
  136. package/src/lib/github_helpers.ts +5 -12
  137. package/src/lib/gitops_analyze.task.ts +79 -41
  138. package/src/lib/gitops_config.ts +88 -137
  139. package/src/lib/gitops_constants.ts +6 -4
  140. package/src/lib/gitops_plan.task.ts +113 -61
  141. package/src/lib/gitops_publish.task.ts +255 -122
  142. package/src/lib/gitops_run.task.ts +250 -178
  143. package/src/lib/gitops_sync.task.ts +208 -33
  144. package/src/lib/gitops_task_helpers.ts +166 -110
  145. package/src/lib/gitops_validate.task.ts +17 -27
  146. package/src/lib/graph_validation.ts +25 -86
  147. package/src/lib/local_repo.ts +109 -316
  148. package/src/lib/log_helpers.ts +8 -18
  149. package/src/lib/multi_repo_publisher.ts +138 -53
  150. package/src/lib/npm_registry.ts +37 -62
  151. package/src/lib/operations.ts +78 -150
  152. package/src/lib/operations_defaults.ts +108 -154
  153. package/src/lib/output_helpers.ts +55 -3
  154. package/src/lib/preflight_checks.ts +47 -183
  155. package/src/lib/publish_steps.ts +15 -13
  156. package/src/lib/publishing_event.ts +5 -4
  157. package/src/lib/publishing_event_handler.ts +18 -16
  158. package/src/lib/publishing_plan.ts +451 -287
  159. package/src/lib/publishing_plan_logging.ts +32 -23
  160. package/src/lib/repo.svelte.ts +8 -0
  161. package/src/lib/repo_readiness.ts +647 -0
  162. package/src/lib/repos_status.ts +671 -0
  163. package/src/lib/repos_status_load.ts +173 -0
  164. package/dist/config_reconcile.d.ts +0 -46
  165. package/dist/config_reconcile.d.ts.map +0 -1
  166. package/dist/config_reconcile.js +0 -64
  167. package/dist/paths.d.ts +0 -7
  168. package/dist/paths.d.ts.map +0 -1
  169. package/dist/paths.js +0 -6
  170. package/dist/repo_ops.d.ts +0 -59
  171. package/dist/repo_ops.d.ts.map +0 -1
  172. package/dist/repo_ops.js +0 -170
  173. package/dist/resolved_gitops_config.d.ts +0 -9
  174. package/dist/resolved_gitops_config.d.ts.map +0 -1
  175. package/dist/resolved_gitops_config.js +0 -12
  176. package/src/lib/config_reconcile.ts +0 -98
  177. package/src/lib/paths.ts +0 -6
  178. package/src/lib/repo_ops.ts +0 -216
  179. package/src/lib/resolved_gitops_config.ts +0 -27
@@ -9,15 +9,16 @@
9
9
  import type { Logger } from '@fuzdev/fuz_util/log.ts';
10
10
  import { styleText as st } from 'node:util';
11
11
 
12
- import type {
13
- PublishingPlan,
14
- VersionChange,
15
- DependencyUpdate,
16
- VerboseData,
17
- VerboseChangesetDetail,
18
- VerboseIteration,
19
- VerbosePropagationChain,
20
- VerboseGraphSummary
12
+ import {
13
+ version_change_kind,
14
+ type PublishingPlan,
15
+ type VersionChange,
16
+ type DependencyUpdate,
17
+ type VerboseData,
18
+ type VerboseChangesetDetail,
19
+ type VerboseIteration,
20
+ type VerbosePropagationChain,
21
+ type VerboseGraphSummary
21
22
  } from './publishing_plan.ts';
22
23
 
23
24
  export interface LogPlanOptions {
@@ -78,11 +79,13 @@ const log_version_change_with_diffs = (
78
79
  const breaking_indicator = change.breaking ? st('red', ' BREAKING') : '';
79
80
  const position = st('dim', `[${index + 1}/${total}]`);
80
81
 
82
+ const kind = version_change_kind(change);
83
+
81
84
  // Determine scenario label
82
85
  let scenario_label = '';
83
- if (change.needs_bump_escalation) {
86
+ if (kind === 'escalation') {
84
87
  scenario_label = st('yellow', ` [${change.existing_bump} → ${change.required_bump}]`);
85
- } else if (change.will_generate_changeset) {
88
+ } else if (kind === 'auto') {
86
89
  scenario_label = st('cyan', ' [auto-changeset]');
87
90
  }
88
91
 
@@ -93,7 +96,7 @@ const log_version_change_with_diffs = (
93
96
  );
94
97
 
95
98
  // Show escalation reason
96
- if (change.needs_bump_escalation) {
99
+ if (kind === 'escalation') {
97
100
  log.info(
98
101
  st(
99
102
  'dim',
@@ -103,7 +106,7 @@ const log_version_change_with_diffs = (
103
106
  }
104
107
 
105
108
  // Show trigger reason for auto-changesets
106
- if (change.will_generate_changeset) {
109
+ if (kind === 'auto') {
107
110
  // Find what triggered this
108
111
  const triggers: Array<string> = [];
109
112
  for (const [pkg, affected] of breaking_cascades) {
@@ -147,6 +150,7 @@ export const log_publishing_plan = (
147
150
  breaking_cascades,
148
151
  warnings,
149
152
  info,
153
+ no_changes,
150
154
  errors
151
155
  } = plan;
152
156
 
@@ -175,17 +179,17 @@ export const log_publishing_plan = (
175
179
  return idx_a - idx_b;
176
180
  });
177
181
 
178
- // Separate into groups for headers
179
- const with_changesets = ordered_changes.filter(
180
- (vc) => vc.has_changesets && !vc.needs_bump_escalation
182
+ // Separate into groups for headers; each change lands in exactly one
183
+ const with_changesets = ordered_changes.filter((vc) => version_change_kind(vc) === 'explicit');
184
+ const with_escalation = ordered_changes.filter(
185
+ (vc) => version_change_kind(vc) === 'escalation'
181
186
  );
182
- const with_escalation = ordered_changes.filter((vc) => vc.needs_bump_escalation);
183
- const with_auto_changesets = ordered_changes.filter((vc) => vc.will_generate_changeset);
187
+ const with_auto_changesets = ordered_changes.filter((vc) => version_change_kind(vc) === 'auto');
184
188
 
185
189
  // A single running counter across all groups so positions read 1..N with no
186
190
  // gaps. (Numbering per-group index would make the first group skip the numbers
187
191
  // that land in a later group, e.g. jump from `[9/12]` to `[11/12]`.)
188
- const total = with_changesets.length + with_escalation.length + with_auto_changesets.length;
192
+ const total = ordered_changes.length;
189
193
  let position = 0;
190
194
  const log_change_group = (
191
195
  title: string,
@@ -251,15 +255,20 @@ export const log_publishing_plan = (
251
255
  log.info('');
252
256
  }
253
257
 
254
- // Info (packages with no changes)
255
- if (info.length > 0) {
256
- log.info(st('dim', `No changes: ${info.join(', ')}`));
258
+ // Info sentences, then the packages with nothing to publish
259
+ for (const line of info) {
260
+ log.info(st('dim', line));
261
+ }
262
+ if (no_changes.length > 0) {
263
+ log.info(st('dim', `No changes: ${no_changes.join(', ')}`));
264
+ }
265
+ if (info.length > 0 || no_changes.length > 0) {
257
266
  log.info('');
258
267
  }
259
268
 
260
269
  // Summary
261
270
  const major_count = version_changes.filter((vc) => vc.breaking).length;
262
- const auto_count = version_changes.filter((vc) => vc.will_generate_changeset).length;
271
+ const auto_count = version_changes.filter((vc) => version_change_kind(vc) === 'auto').length;
263
272
  log.info(st('cyan', 'Summary:'));
264
273
  log.info(` ${version_changes.length} packages to publish`);
265
274
  if (auto_count > 0) {
@@ -17,6 +17,11 @@ import { GithubCheckRunsItem, type GithubPullRequest } from './github.ts';
17
17
  export interface RepoJson {
18
18
  library_json: LibraryJson;
19
19
  package_json: PackageJson;
20
+ /**
21
+ * The branch the repo's registry entry follows, which `check_runs` was
22
+ * fetched for. `Repo.branch` reads `main` when it's absent.
23
+ */
24
+ branch?: string;
20
25
  check_runs: GithubCheckRunsItem | null;
21
26
  pull_requests: Array<GithubPullRequest> | null;
22
27
  }
@@ -31,6 +36,8 @@ export class Repo {
31
36
  readonly library: Library;
32
37
  /** The repo's full `package.json` (with `dependencies`/`devDependencies`). */
33
38
  readonly package_json: PackageJson;
39
+ /** The branch CI status was fetched for and the dashboard links to. */
40
+ readonly branch: string;
34
41
  check_runs: GithubCheckRunsItem | null;
35
42
  pull_requests: Array<GithubPullRequest> | null;
36
43
 
@@ -70,6 +77,7 @@ export class Repo {
70
77
  constructor(repo_json: RepoJson) {
71
78
  this.library = new Library(repo_json.library_json);
72
79
  this.package_json = repo_json.package_json;
80
+ this.branch = repo_json.branch ?? 'main';
73
81
  this.check_runs = repo_json.check_runs;
74
82
  this.pull_requests = repo_json.pull_requests;
75
83
  }