@fuzdev/fuz_gitops 0.57.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 (190) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +119 -0
  3. package/dist/ModulesDetail.svelte +180 -0
  4. package/dist/ModulesDetail.svelte.d.ts +10 -0
  5. package/dist/ModulesDetail.svelte.d.ts.map +1 -0
  6. package/dist/ModulesNav.svelte +43 -0
  7. package/dist/ModulesNav.svelte.d.ts +11 -0
  8. package/dist/ModulesNav.svelte.d.ts.map +1 -0
  9. package/dist/ModulesPage.svelte +50 -0
  10. package/dist/ModulesPage.svelte.d.ts +9 -0
  11. package/dist/ModulesPage.svelte.d.ts.map +1 -0
  12. package/dist/PageFooter.svelte +15 -0
  13. package/dist/PageFooter.svelte.d.ts +19 -0
  14. package/dist/PageFooter.svelte.d.ts.map +1 -0
  15. package/dist/PageHeader.svelte +35 -0
  16. package/dist/PageHeader.svelte.d.ts +19 -0
  17. package/dist/PageHeader.svelte.d.ts.map +1 -0
  18. package/dist/PullRequestsDetail.svelte +53 -0
  19. package/dist/PullRequestsDetail.svelte.d.ts +10 -0
  20. package/dist/PullRequestsDetail.svelte.d.ts.map +1 -0
  21. package/dist/PullRequestsPage.svelte +47 -0
  22. package/dist/PullRequestsPage.svelte.d.ts +11 -0
  23. package/dist/PullRequestsPage.svelte.d.ts.map +1 -0
  24. package/dist/ReposTable.svelte +189 -0
  25. package/dist/ReposTable.svelte.d.ts +9 -0
  26. package/dist/ReposTable.svelte.d.ts.map +1 -0
  27. package/dist/ReposTree.svelte +88 -0
  28. package/dist/ReposTree.svelte.d.ts +11 -0
  29. package/dist/ReposTree.svelte.d.ts.map +1 -0
  30. package/dist/ReposTreeNav.svelte +55 -0
  31. package/dist/ReposTreeNav.svelte.d.ts +11 -0
  32. package/dist/ReposTreeNav.svelte.d.ts.map +1 -0
  33. package/dist/TablePage.svelte +46 -0
  34. package/dist/TablePage.svelte.d.ts +9 -0
  35. package/dist/TablePage.svelte.d.ts.map +1 -0
  36. package/dist/TreeItemPage.svelte +75 -0
  37. package/dist/TreeItemPage.svelte.d.ts +10 -0
  38. package/dist/TreeItemPage.svelte.d.ts.map +1 -0
  39. package/dist/TreePage.svelte +64 -0
  40. package/dist/TreePage.svelte.d.ts +9 -0
  41. package/dist/TreePage.svelte.d.ts.map +1 -0
  42. package/dist/changeset_generator.d.ts +38 -0
  43. package/dist/changeset_generator.d.ts.map +1 -0
  44. package/dist/changeset_generator.js +110 -0
  45. package/dist/changeset_reader.d.ts +75 -0
  46. package/dist/changeset_reader.d.ts.map +1 -0
  47. package/dist/changeset_reader.js +167 -0
  48. package/dist/constants.d.ts +9 -0
  49. package/dist/constants.d.ts.map +1 -0
  50. package/dist/constants.js +8 -0
  51. package/dist/dependency_graph.d.ts +120 -0
  52. package/dist/dependency_graph.d.ts.map +1 -0
  53. package/dist/dependency_graph.js +341 -0
  54. package/dist/dependency_updater.d.ts +46 -0
  55. package/dist/dependency_updater.d.ts.map +1 -0
  56. package/dist/dependency_updater.js +213 -0
  57. package/dist/fetch_repo_data.d.ts +19 -0
  58. package/dist/fetch_repo_data.d.ts.map +1 -0
  59. package/dist/fetch_repo_data.js +49 -0
  60. package/dist/fs_fetch_value_cache.d.ts +24 -0
  61. package/dist/fs_fetch_value_cache.d.ts.map +1 -0
  62. package/dist/fs_fetch_value_cache.js +61 -0
  63. package/dist/git_operations.d.ts +54 -0
  64. package/dist/git_operations.d.ts.map +1 -0
  65. package/dist/git_operations.js +144 -0
  66. package/dist/github.d.ts +91 -0
  67. package/dist/github.d.ts.map +1 -0
  68. package/dist/github.js +94 -0
  69. package/dist/github_helpers.d.ts +10 -0
  70. package/dist/github_helpers.d.ts.map +1 -0
  71. package/dist/github_helpers.js +13 -0
  72. package/dist/gitops_analyze.task.d.ts +17 -0
  73. package/dist/gitops_analyze.task.d.ts.map +1 -0
  74. package/dist/gitops_analyze.task.js +188 -0
  75. package/dist/gitops_config.d.ts +56 -0
  76. package/dist/gitops_config.d.ts.map +1 -0
  77. package/dist/gitops_config.js +63 -0
  78. package/dist/gitops_plan.task.d.ts +28 -0
  79. package/dist/gitops_plan.task.d.ts.map +1 -0
  80. package/dist/gitops_plan.task.js +217 -0
  81. package/dist/gitops_publish.task.d.ts +29 -0
  82. package/dist/gitops_publish.task.d.ts.map +1 -0
  83. package/dist/gitops_publish.task.js +178 -0
  84. package/dist/gitops_sync.task.d.ts +18 -0
  85. package/dist/gitops_sync.task.d.ts.map +1 -0
  86. package/dist/gitops_sync.task.js +95 -0
  87. package/dist/gitops_task_helpers.d.ts +63 -0
  88. package/dist/gitops_task_helpers.d.ts.map +1 -0
  89. package/dist/gitops_task_helpers.js +84 -0
  90. package/dist/gitops_validate.task.d.ts +12 -0
  91. package/dist/gitops_validate.task.d.ts.map +1 -0
  92. package/dist/gitops_validate.task.js +210 -0
  93. package/dist/graph_validation.d.ts +39 -0
  94. package/dist/graph_validation.d.ts.map +1 -0
  95. package/dist/graph_validation.js +79 -0
  96. package/dist/local_repo.d.ts +84 -0
  97. package/dist/local_repo.d.ts.map +1 -0
  98. package/dist/local_repo.js +213 -0
  99. package/dist/log_helpers.d.ts +43 -0
  100. package/dist/log_helpers.d.ts.map +1 -0
  101. package/dist/log_helpers.js +98 -0
  102. package/dist/multi_repo_publisher.d.ts +34 -0
  103. package/dist/multi_repo_publisher.d.ts.map +1 -0
  104. package/dist/multi_repo_publisher.js +364 -0
  105. package/dist/npm_install_helpers.d.ts +23 -0
  106. package/dist/npm_install_helpers.d.ts.map +1 -0
  107. package/dist/npm_install_helpers.js +60 -0
  108. package/dist/npm_registry.d.ts +46 -0
  109. package/dist/npm_registry.d.ts.map +1 -0
  110. package/dist/npm_registry.js +96 -0
  111. package/dist/operations.d.ts +409 -0
  112. package/dist/operations.d.ts.map +1 -0
  113. package/dist/operations.js +34 -0
  114. package/dist/operations_defaults.d.ts +19 -0
  115. package/dist/operations_defaults.d.ts.map +1 -0
  116. package/dist/operations_defaults.js +279 -0
  117. package/dist/output_helpers.d.ts +27 -0
  118. package/dist/output_helpers.d.ts.map +1 -0
  119. package/dist/output_helpers.js +39 -0
  120. package/dist/paths.d.ts +11 -0
  121. package/dist/paths.d.ts.map +1 -0
  122. package/dist/paths.js +10 -0
  123. package/dist/preflight_checks.d.ts +47 -0
  124. package/dist/preflight_checks.d.ts.map +1 -0
  125. package/dist/preflight_checks.js +181 -0
  126. package/dist/publishing_plan.d.ts +100 -0
  127. package/dist/publishing_plan.d.ts.map +1 -0
  128. package/dist/publishing_plan.js +353 -0
  129. package/dist/publishing_plan_helpers.d.ts +30 -0
  130. package/dist/publishing_plan_helpers.d.ts.map +1 -0
  131. package/dist/publishing_plan_helpers.js +112 -0
  132. package/dist/publishing_plan_logging.d.ts +18 -0
  133. package/dist/publishing_plan_logging.d.ts.map +1 -0
  134. package/dist/publishing_plan_logging.js +342 -0
  135. package/dist/repo.svelte.d.ts +52 -0
  136. package/dist/repo.svelte.d.ts.map +1 -0
  137. package/dist/repo.svelte.js +70 -0
  138. package/dist/repo_ops.d.ts +57 -0
  139. package/dist/repo_ops.d.ts.map +1 -0
  140. package/dist/repo_ops.js +167 -0
  141. package/dist/resolved_gitops_config.d.ts +9 -0
  142. package/dist/resolved_gitops_config.d.ts.map +1 -0
  143. package/dist/resolved_gitops_config.js +12 -0
  144. package/dist/semver.d.ts +24 -0
  145. package/dist/semver.d.ts.map +1 -0
  146. package/dist/semver.js +140 -0
  147. package/dist/serialization_types.d.ts +57 -0
  148. package/dist/serialization_types.d.ts.map +1 -0
  149. package/dist/serialization_types.js +40 -0
  150. package/dist/version_utils.d.ts +48 -0
  151. package/dist/version_utils.d.ts.map +1 -0
  152. package/dist/version_utils.js +125 -0
  153. package/package.json +107 -0
  154. package/src/lib/changeset_generator.ts +162 -0
  155. package/src/lib/changeset_reader.ts +218 -0
  156. package/src/lib/constants.ts +8 -0
  157. package/src/lib/dependency_graph.ts +423 -0
  158. package/src/lib/dependency_updater.ts +297 -0
  159. package/src/lib/fetch_repo_data.ts +64 -0
  160. package/src/lib/fs_fetch_value_cache.ts +75 -0
  161. package/src/lib/git_operations.ts +208 -0
  162. package/src/lib/github.ts +128 -0
  163. package/src/lib/github_helpers.ts +31 -0
  164. package/src/lib/gitops_analyze.task.ts +261 -0
  165. package/src/lib/gitops_config.ts +123 -0
  166. package/src/lib/gitops_plan.task.ts +272 -0
  167. package/src/lib/gitops_publish.task.ts +227 -0
  168. package/src/lib/gitops_sync.task.ts +109 -0
  169. package/src/lib/gitops_task_helpers.ts +126 -0
  170. package/src/lib/gitops_validate.task.ts +248 -0
  171. package/src/lib/graph_validation.ts +109 -0
  172. package/src/lib/local_repo.ts +359 -0
  173. package/src/lib/log_helpers.ts +147 -0
  174. package/src/lib/multi_repo_publisher.ts +464 -0
  175. package/src/lib/npm_install_helpers.ts +85 -0
  176. package/src/lib/npm_registry.ts +143 -0
  177. package/src/lib/operations.ts +334 -0
  178. package/src/lib/operations_defaults.ts +335 -0
  179. package/src/lib/output_helpers.ts +64 -0
  180. package/src/lib/paths.ts +11 -0
  181. package/src/lib/preflight_checks.ts +269 -0
  182. package/src/lib/publishing_plan.ts +531 -0
  183. package/src/lib/publishing_plan_helpers.ts +145 -0
  184. package/src/lib/publishing_plan_logging.ts +470 -0
  185. package/src/lib/repo.svelte.ts +95 -0
  186. package/src/lib/repo_ops.ts +213 -0
  187. package/src/lib/resolved_gitops_config.ts +27 -0
  188. package/src/lib/semver.ts +166 -0
  189. package/src/lib/serialization_types.ts +90 -0
  190. package/src/lib/version_utils.ts +150 -0
@@ -0,0 +1,342 @@
1
+ /**
2
+ * Logging and formatting functions for publishing plans.
3
+ *
4
+ * Includes both regular plan output and verbose diagnostic sections.
5
+ */
6
+ import { styleText as st } from 'node:util';
7
+ const SEPARATOR = '────────────────────────────────────────';
8
+ /**
9
+ * Logs a section header with separators.
10
+ */
11
+ const log_section_header = (title, log) => {
12
+ log.info(st('dim', SEPARATOR));
13
+ log.info(st('dim', title));
14
+ log.info(st('dim', SEPARATOR));
15
+ };
16
+ /**
17
+ * Formats a dependency update as diff-style output.
18
+ * Shows - old / + new for the dependency version.
19
+ */
20
+ const format_dep_diff = (dep_name, current, next) => {
21
+ return [
22
+ st('red', ` - "${dep_name}": "${current}"`),
23
+ st('green', ` + "${dep_name}": "${next}"`),
24
+ ];
25
+ };
26
+ /**
27
+ * Gets dependency updates for a specific package, grouped by dependency name.
28
+ */
29
+ const get_updates_for_package = (pkg_name, dependency_updates) => {
30
+ const updates = new Map();
31
+ for (const update of dependency_updates) {
32
+ if (update.dependent_package === pkg_name) {
33
+ const dep_updates = updates.get(update.updated_dependency) || [];
34
+ dep_updates.push(update);
35
+ updates.set(update.updated_dependency, dep_updates);
36
+ }
37
+ }
38
+ return updates;
39
+ };
40
+ /**
41
+ * Logs a single version change with diff-style dependency updates.
42
+ */
43
+ const log_version_change_with_diffs = (change, index, total, dependency_updates, breaking_cascades, log) => {
44
+ const breaking_indicator = change.breaking ? st('red', ' BREAKING') : '';
45
+ const position = st('dim', `[${index + 1}/${total}]`);
46
+ // Determine scenario label
47
+ let scenario_label = '';
48
+ if (change.needs_bump_escalation) {
49
+ scenario_label = st('yellow', ` [${change.existing_bump} → ${change.required_bump}]`);
50
+ }
51
+ else if (change.will_generate_changeset) {
52
+ scenario_label = st('cyan', ' [auto-changeset]');
53
+ }
54
+ // Main version line
55
+ log.info(`${position} ${change.package_name}: ${change.from} → ${st('green', change.to)} ` +
56
+ `(${change.bump_type})${scenario_label}${breaking_indicator}`);
57
+ // Show escalation reason
58
+ if (change.needs_bump_escalation) {
59
+ log.info(st('dim', ` changesets specify ${change.existing_bump}, dependencies require ${change.required_bump}`));
60
+ }
61
+ // Show trigger reason for auto-changesets
62
+ if (change.will_generate_changeset) {
63
+ // Find what triggered this
64
+ const triggers = [];
65
+ for (const [pkg, affected] of breaking_cascades) {
66
+ if (affected.includes(change.package_name)) {
67
+ triggers.push(`${pkg} (BREAKING)`);
68
+ }
69
+ }
70
+ if (triggers.length > 0) {
71
+ log.info(st('dim', ` triggered by: ${triggers.join(', ')}`));
72
+ }
73
+ }
74
+ // Show dependency diffs for this package
75
+ const pkg_updates = get_updates_for_package(change.package_name, dependency_updates);
76
+ if (pkg_updates.size > 0) {
77
+ for (const [dep_name, updates] of pkg_updates) {
78
+ if (updates.length === 0)
79
+ continue;
80
+ const update = updates[0];
81
+ for (const line of format_dep_diff(dep_name, update.current_version, update.new_version)) {
82
+ log.info(line);
83
+ }
84
+ }
85
+ }
86
+ };
87
+ /**
88
+ * Logs a complete publishing plan to the console.
89
+ *
90
+ * Displays errors, publishing order, version changes grouped by scenario,
91
+ * dependency-only updates, warnings, and a summary.
92
+ */
93
+ export const log_publishing_plan = (plan, log, options = {}) => {
94
+ const { publishing_order, version_changes, dependency_updates, breaking_cascades, warnings, info, errors, } = plan;
95
+ // Errors first (blocking issues)
96
+ if (errors.length > 0) {
97
+ log.error(st('red', 'Errors:'));
98
+ for (const error of errors) {
99
+ log.error(` ${error}`);
100
+ }
101
+ log.info('');
102
+ }
103
+ // Publishing order
104
+ if (publishing_order.length > 0) {
105
+ log.info(st('cyan', 'Publishing Order:'));
106
+ log.info(` ${publishing_order.join(' → ')}`);
107
+ log.info('');
108
+ }
109
+ // Version changes with diffs
110
+ if (version_changes.length > 0) {
111
+ // Sort by publishing order
112
+ const ordered_changes = [...version_changes].sort((a, b) => {
113
+ const idx_a = publishing_order.indexOf(a.package_name);
114
+ const idx_b = publishing_order.indexOf(b.package_name);
115
+ return idx_a - idx_b;
116
+ });
117
+ // Separate into groups for headers
118
+ const with_changesets = ordered_changes.filter((vc) => vc.has_changesets && !vc.needs_bump_escalation);
119
+ const with_escalation = ordered_changes.filter((vc) => vc.needs_bump_escalation);
120
+ const with_auto_changesets = ordered_changes.filter((vc) => vc.will_generate_changeset);
121
+ // Log each group with diff-style output
122
+ if (with_changesets.length > 0) {
123
+ log.info(st('cyan', 'Version Changes (from changesets):'));
124
+ for (const change of with_changesets) {
125
+ const idx = ordered_changes.indexOf(change);
126
+ log_version_change_with_diffs(change, idx, ordered_changes.length, dependency_updates, breaking_cascades, log);
127
+ }
128
+ log.info('');
129
+ }
130
+ if (with_escalation.length > 0) {
131
+ log.info(st('yellow', 'Version Changes (bump escalation):'));
132
+ for (const change of with_escalation) {
133
+ const idx = ordered_changes.indexOf(change);
134
+ log_version_change_with_diffs(change, idx, ordered_changes.length, dependency_updates, breaking_cascades, log);
135
+ }
136
+ log.info('');
137
+ }
138
+ if (with_auto_changesets.length > 0) {
139
+ log.info(st('cyan', 'Version Changes (auto-generated):'));
140
+ for (const change of with_auto_changesets) {
141
+ const idx = ordered_changes.indexOf(change);
142
+ log_version_change_with_diffs(change, idx, ordered_changes.length, dependency_updates, breaking_cascades, log);
143
+ }
144
+ log.info('');
145
+ }
146
+ }
147
+ else {
148
+ log.info(st('dim', 'No packages to publish'));
149
+ log.info('');
150
+ }
151
+ // Dependency-only updates (no republish) - packages getting dep updates but not publishing
152
+ const dep_only_packages = new Set();
153
+ for (const update of dependency_updates) {
154
+ const has_version_change = version_changes.some((vc) => vc.package_name === update.dependent_package);
155
+ if (!has_version_change) {
156
+ dep_only_packages.add(update.dependent_package);
157
+ }
158
+ }
159
+ if (dep_only_packages.size > 0) {
160
+ log.info(st('dim', 'Dependency Updates (no republish):'));
161
+ for (const pkg of dep_only_packages) {
162
+ log.info(st('dim', ` ${pkg}:`));
163
+ const pkg_updates = get_updates_for_package(pkg, dependency_updates);
164
+ for (const [dep_name, updates] of pkg_updates) {
165
+ if (updates.length === 0)
166
+ continue;
167
+ const update = updates[0];
168
+ // Use dim styling for non-publishing packages
169
+ log.info(st('dim', ` - "${dep_name}": "${update.current_version}"`));
170
+ log.info(st('dim', ` + "${dep_name}": "${update.new_version}"`));
171
+ }
172
+ }
173
+ log.info('');
174
+ }
175
+ // Warnings
176
+ if (warnings.length > 0) {
177
+ log.warn(st('yellow', 'Warnings:'));
178
+ for (const warning of warnings) {
179
+ log.warn(` ${warning}`);
180
+ }
181
+ log.info('');
182
+ }
183
+ // Info (packages with no changes)
184
+ if (info.length > 0) {
185
+ log.info(st('dim', `No changes: ${info.join(', ')}`));
186
+ log.info('');
187
+ }
188
+ // Summary
189
+ const major_count = version_changes.filter((vc) => vc.breaking).length;
190
+ const auto_count = version_changes.filter((vc) => vc.will_generate_changeset).length;
191
+ log.info(st('cyan', 'Summary:'));
192
+ log.info(` ${version_changes.length} packages to publish`);
193
+ if (auto_count > 0) {
194
+ log.info(` ${auto_count} auto-generated changesets`);
195
+ }
196
+ if (major_count > 0) {
197
+ log.info(st('yellow', ` ${major_count} breaking changes`));
198
+ }
199
+ log.info(` ${dep_only_packages.size} packages with dependency-only updates`);
200
+ if (warnings.length > 0) {
201
+ log.info(st('yellow', ` ${warnings.length} warnings`));
202
+ }
203
+ if (errors.length > 0) {
204
+ log.info(st('red', ` ${errors.length} errors`));
205
+ }
206
+ // Verbose output
207
+ if (options.verbose && plan.verbose_data) {
208
+ log_verbose(plan.verbose_data, log);
209
+ }
210
+ };
211
+ // ============================================================================
212
+ // Verbose logging functions
213
+ // ============================================================================
214
+ /**
215
+ * Logs all verbose sections in order.
216
+ */
217
+ const log_verbose = (data, log) => {
218
+ log.info(''); // Blank line before verbose sections
219
+ log_verbose_changeset_details(data.changeset_details, log);
220
+ log_verbose_iteration_details(data.iterations, data.total_iterations, log);
221
+ log_verbose_propagation_chains(data.propagation_chains, log);
222
+ log_verbose_graph_summary(data.graph_summary, log);
223
+ };
224
+ /**
225
+ * Logs changeset file details per package.
226
+ */
227
+ const log_verbose_changeset_details = (details, log) => {
228
+ if (details.length === 0)
229
+ return;
230
+ log_section_header('Changeset Details', log);
231
+ for (const pkg of details) {
232
+ log.info(st('dim', `${pkg.package_name}:`));
233
+ for (const file of pkg.files) {
234
+ const summary_text = file.summary ? `: "${file.summary}"` : '';
235
+ log.info(st('dim', ` .changeset/${file.filename} (${file.bump_type})${summary_text}`));
236
+ }
237
+ }
238
+ log.info('');
239
+ };
240
+ /**
241
+ * Logs fixed-point iteration details.
242
+ */
243
+ const log_verbose_iteration_details = (iterations, total, log) => {
244
+ if (iterations.length === 0)
245
+ return;
246
+ log_section_header('Fixed-Point Iteration', log);
247
+ for (const iter of iterations) {
248
+ if (iter.new_changes === 0 && iter.packages.length === 0) {
249
+ log.info(st('dim', `Iteration ${iter.iteration}:`));
250
+ log.info(st('dim', ' No new changes'));
251
+ continue;
252
+ }
253
+ log.info(st('dim', `Iteration ${iter.iteration}:`));
254
+ for (const pkg of iter.packages) {
255
+ const parts = [];
256
+ // Changeset info
257
+ if (pkg.changeset_count > 0) {
258
+ parts.push(`changesets=${pkg.changeset_count}`);
259
+ if (pkg.bump_from_changesets) {
260
+ parts.push(`bump=${pkg.bump_from_changesets}`);
261
+ }
262
+ }
263
+ else {
264
+ parts.push('no changesets');
265
+ }
266
+ // Required bump from deps
267
+ if (pkg.required_bump && pkg.triggering_dep) {
268
+ parts.push(`required=${pkg.required_bump} (from ${pkg.triggering_dep})`);
269
+ }
270
+ // Action
271
+ if (pkg.action === 'auto_changeset') {
272
+ parts.push('→ auto-generate');
273
+ }
274
+ else if (pkg.action === 'escalation') {
275
+ parts.push('→ escalation');
276
+ }
277
+ else if (pkg.action === 'publish') {
278
+ // Regular publish, no special label needed
279
+ }
280
+ // Version
281
+ if (pkg.version_to) {
282
+ const breaking_label = pkg.is_breaking ? ' (BREAKING)' : '';
283
+ parts.push(`→ ${pkg.version_to}${breaking_label}`);
284
+ }
285
+ log.info(st('dim', ` ${pkg.name}: ${parts.join(', ')}`));
286
+ }
287
+ if (iter.new_changes > 0) {
288
+ log.info(st('dim', ` New changes: ${iter.new_changes}`));
289
+ }
290
+ }
291
+ log.info(st('dim', `Converged after ${total} iteration(s)`));
292
+ log.info('');
293
+ };
294
+ /**
295
+ * Logs breaking change propagation chains as tree structure.
296
+ */
297
+ const log_verbose_propagation_chains = (chains, log) => {
298
+ if (chains.length === 0)
299
+ return;
300
+ log_section_header('Breaking Change Propagation', log);
301
+ for (const chain of chains) {
302
+ log.info(st('dim', `${chain.source} (source)`));
303
+ for (let i = 0; i < chain.chain.length; i++) {
304
+ const item = chain.chain[i];
305
+ const indent = ' '.repeat(i);
306
+ const connector = '└─';
307
+ log.info(st('dim', `${indent}${connector} ${item.pkg} (${item.dep_type} dep) → ${item.action}`));
308
+ }
309
+ }
310
+ log.info('');
311
+ };
312
+ /**
313
+ * Logs dependency graph summary.
314
+ */
315
+ const log_verbose_graph_summary = (summary, log) => {
316
+ log_section_header('Dependency Graph', log);
317
+ log.info(st('dim', `${summary.package_count} packages, ${summary.internal_dep_count} internal dependencies`));
318
+ log.info('');
319
+ // Production/Peer edges
320
+ if (summary.prod_peer_edges.length > 0) {
321
+ log.info(st('dim', 'Production/Peer:'));
322
+ for (const edge of summary.prod_peer_edges) {
323
+ log.info(st('dim', ` ${edge.from} → ${edge.to} (${edge.type})`));
324
+ }
325
+ }
326
+ else {
327
+ log.info(st('dim', 'Production/Peer: (none)'));
328
+ }
329
+ // Dev edges
330
+ if (summary.dev_edges.length > 0) {
331
+ log.info(st('dim', 'Dev:'));
332
+ for (const edge of summary.dev_edges) {
333
+ log.info(st('dim', ` ${edge.from} → ${edge.to}`));
334
+ }
335
+ }
336
+ else {
337
+ log.info(st('dim', 'Dev: (none)'));
338
+ }
339
+ log.info('');
340
+ log.info(st('dim', `Cycles: ${summary.prod_cycle_count} production, ${summary.dev_cycle_count} dev`));
341
+ log.info('');
342
+ };
@@ -0,0 +1,52 @@
1
+ import type { LibraryJson } from '@fuzdev/fuz_util/library_json.js';
2
+ import type { PackageJson } from '@fuzdev/fuz_util/package_json.js';
3
+ import type { SourceJson } from '@fuzdev/fuz_util/source_json.js';
4
+ import type { Url } from '@fuzdev/fuz_util/url.js';
5
+ import { Library } from '@fuzdev/fuz_ui/library.svelte.js';
6
+ import type { Module } from '@fuzdev/fuz_ui/module.svelte.js';
7
+ import { GithubCheckRunsItem, type GithubPullRequest } from './github.js';
8
+ /**
9
+ * Serialized repo data as stored in repos.ts (JSON).
10
+ */
11
+ export interface RepoJson {
12
+ library_json: LibraryJson;
13
+ check_runs: GithubCheckRunsItem | null;
14
+ pull_requests: Array<GithubPullRequest> | null;
15
+ }
16
+ /**
17
+ * Runtime repo with Library composition for package metadata.
18
+ *
19
+ * Wraps a Library instance and adds GitHub-specific data (CI status, PRs).
20
+ * Convenience getters delegate to `this.library.*` for common properties.
21
+ */
22
+ export declare class Repo {
23
+ readonly library: Library;
24
+ check_runs: GithubCheckRunsItem | null;
25
+ pull_requests: Array<GithubPullRequest> | null;
26
+ get name(): string;
27
+ get repo_name(): string;
28
+ get repo_url(): Url;
29
+ get owner_name(): string | null;
30
+ get homepage_url(): Url | null;
31
+ get logo_url(): Url | null;
32
+ get logo_alt(): string;
33
+ get published(): boolean;
34
+ get npm_url(): Url | null;
35
+ get changelog_url(): Url | null;
36
+ get package_json(): PackageJson;
37
+ get source_json(): SourceJson;
38
+ get modules(): Array<Module>;
39
+ get org_url(): string | null;
40
+ constructor(repo_json: RepoJson);
41
+ }
42
+ export interface Repos {
43
+ repo: Repo;
44
+ repos: Array<Repo>;
45
+ }
46
+ export declare const repos_context: {
47
+ get: (error_message?: string) => Repos;
48
+ get_maybe: () => Repos | undefined;
49
+ set: (value: Repos) => Repos;
50
+ };
51
+ export declare const repos_parse: (repos: Array<Repo>, homepage_url: string) => Repos;
52
+ //# sourceMappingURL=repo.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repo.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/repo.svelte.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,iCAAiC,CAAC;AAChE,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAC,OAAO,EAAC,MAAM,kCAAkC,CAAC;AACzD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,iCAAiC,CAAC;AAE5D,OAAO,EAAC,mBAAmB,EAAE,KAAK,iBAAiB,EAAC,MAAM,aAAa,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,QAAQ;IACxB,YAAY,EAAE,WAAW,CAAC;IAC1B,UAAU,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACvC,aAAa,EAAE,KAAK,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;CAC/C;AAED;;;;;GAKG;AACH,qBAAa,IAAI;IAChB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACvC,aAAa,EAAE,KAAK,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;IAG/C,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,SAAS,IAAI,MAAM,CAEtB;IACD,IAAI,QAAQ,IAAI,GAAG,CAElB;IACD,IAAI,UAAU,IAAI,MAAM,GAAG,IAAI,CAE9B;IACD,IAAI,YAAY,IAAI,GAAG,GAAG,IAAI,CAE7B;IACD,IAAI,QAAQ,IAAI,GAAG,GAAG,IAAI,CAEzB;IACD,IAAI,QAAQ,IAAI,MAAM,CAErB;IACD,IAAI,SAAS,IAAI,OAAO,CAEvB;IACD,IAAI,OAAO,IAAI,GAAG,GAAG,IAAI,CAExB;IACD,IAAI,aAAa,IAAI,GAAG,GAAG,IAAI,CAE9B;IACD,IAAI,YAAY,IAAI,WAAW,CAE9B;IACD,IAAI,WAAW,IAAI,UAAU,CAE5B;IACD,IAAI,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,CAE3B;IACD,IAAI,OAAO,IAAI,MAAM,GAAG,IAAI,CAE3B;gBAEW,SAAS,EAAE,QAAQ;CAK/B;AAED,MAAM,WAAW,KAAK;IACrB,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;CACnB;AAED,eAAO,MAAM,aAAa;;;;CAA0B,CAAC;AAErD,eAAO,MAAM,WAAW,GAAI,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,cAAc,MAAM,KAAG,KAMtE,CAAC"}
@@ -0,0 +1,70 @@
1
+ import { create_context } from '@fuzdev/fuz_ui/context_helpers.js';
2
+ import { Library } from '@fuzdev/fuz_ui/library.svelte.js';
3
+ import { GithubCheckRunsItem } from './github.js';
4
+ /**
5
+ * Runtime repo with Library composition for package metadata.
6
+ *
7
+ * Wraps a Library instance and adds GitHub-specific data (CI status, PRs).
8
+ * Convenience getters delegate to `this.library.*` for common properties.
9
+ */
10
+ export class Repo {
11
+ library;
12
+ check_runs;
13
+ pull_requests;
14
+ // Convenience getters delegating to library
15
+ get name() {
16
+ return this.library.name;
17
+ }
18
+ get repo_name() {
19
+ return this.library.repo_name;
20
+ }
21
+ get repo_url() {
22
+ return this.library.repo_url;
23
+ }
24
+ get owner_name() {
25
+ return this.library.owner_name;
26
+ }
27
+ get homepage_url() {
28
+ return this.library.homepage_url;
29
+ }
30
+ get logo_url() {
31
+ return this.library.logo_url;
32
+ }
33
+ get logo_alt() {
34
+ return this.library.logo_alt;
35
+ }
36
+ get published() {
37
+ return this.library.published;
38
+ }
39
+ get npm_url() {
40
+ return this.library.npm_url;
41
+ }
42
+ get changelog_url() {
43
+ return this.library.changelog_url;
44
+ }
45
+ get package_json() {
46
+ return this.library.package_json;
47
+ }
48
+ get source_json() {
49
+ return this.library.source_json;
50
+ }
51
+ get modules() {
52
+ return this.library.modules;
53
+ }
54
+ get org_url() {
55
+ return this.library.org_url;
56
+ }
57
+ constructor(repo_json) {
58
+ this.library = new Library(repo_json.library_json);
59
+ this.check_runs = repo_json.check_runs;
60
+ this.pull_requests = repo_json.pull_requests;
61
+ }
62
+ }
63
+ export const repos_context = create_context();
64
+ export const repos_parse = (repos, homepage_url) => {
65
+ // We expect to find this because it's sourced from the local package.json
66
+ const repo = repos.find((d) => d.homepage_url === homepage_url);
67
+ if (!repo)
68
+ throw Error(`Cannot find repo with homepage_url: ${homepage_url}`);
69
+ return { repo, repos };
70
+ };
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Generic repository operations for scripts that work across repos.
3
+ *
4
+ * Provides lightweight utilities for:
5
+ * - Getting repo paths from gitops config (without full git sync)
6
+ * - Walking files in repos with sensible exclusions
7
+ * - Common exclusion patterns for node/svelte projects
8
+ *
9
+ * For full git sync/clone functionality, use `get_gitops_ready()` from gitops_task_helpers.
10
+ */
11
+ /** Default directories to exclude from file walking */
12
+ export declare const DEFAULT_EXCLUDE_DIRS: readonly ["node_modules", ".git", ".gro", ".svelte-kit", ".deno", ".vscode", ".idea", "dist", "build", "coverage", ".cache", ".turbo"];
13
+ /** Default binary/non-text extensions to exclude from content processing */
14
+ export declare const DEFAULT_EXCLUDE_EXTENSIONS: readonly [".png", ".jpg", ".jpeg", ".gif", ".svg", ".ico", ".webp", ".woff", ".woff2", ".ttf", ".eot", ".mp4", ".webm", ".mp3", ".wav", ".ogg", ".zip", ".tar", ".gz", ".lock", ".pdf"];
15
+ export interface WalkOptions {
16
+ /** Additional directories to exclude (merged with defaults) */
17
+ exclude_dirs?: Array<string>;
18
+ /** Additional extensions to exclude (merged with defaults) */
19
+ exclude_extensions?: Array<string>;
20
+ /** Maximum file size in bytes (default: 10MB) */
21
+ max_file_size?: number;
22
+ /** Include directories in output (default: false) */
23
+ include_dirs?: boolean;
24
+ /** Use only provided exclusions, ignoring defaults */
25
+ no_defaults?: boolean;
26
+ }
27
+ export interface RepoPath {
28
+ name: string;
29
+ path: string;
30
+ url: string;
31
+ }
32
+ /**
33
+ * Get repo paths from gitops config without full git sync.
34
+ * Lighter weight than `get_gitops_ready()` - just resolves paths.
35
+ *
36
+ * @param config_path Path to gitops.config.ts (defaults to ./gitops.config.ts)
37
+ * @returns Array of repo info with name, path, and url
38
+ */
39
+ export declare const get_repo_paths: (config_path?: string) => Promise<Array<RepoPath>>;
40
+ /**
41
+ * Check if a path should be excluded based on options.
42
+ */
43
+ export declare const should_exclude_path: (file_path: string, options?: WalkOptions) => boolean;
44
+ /**
45
+ * Walk files in a directory, respecting common exclusions.
46
+ * Yields absolute paths to files (and optionally directories).
47
+ *
48
+ * @param dir Directory to walk
49
+ * @param options Walk options for exclusions and filtering
50
+ */
51
+ export declare function walk_repo_files(dir: string, options?: WalkOptions): AsyncGenerator<string, void, undefined>;
52
+ /**
53
+ * Collect all files from walk_repo_files into an array.
54
+ * Convenience function for when you need all paths upfront.
55
+ */
56
+ export declare const collect_repo_files: (dir: string, options?: WalkOptions) => Promise<Array<string>>;
57
+ //# sourceMappingURL=repo_ops.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repo_ops.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/repo_ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AASH,uDAAuD;AACvD,eAAO,MAAM,oBAAoB,wIAavB,CAAC;AAEX,4EAA4E;AAC5E,eAAO,MAAM,0BAA0B,yLAsB7B,CAAC;AAEX,MAAM,WAAW,WAAW;IAC3B,+DAA+D;IAC/D,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B,8DAA8D;IAC9D,kBAAkB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACnC,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qDAAqD;IACrD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,sDAAsD;IACtD,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,QAAQ;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAU,cAAc,MAAM,KAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CA4BlF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,WAAW,MAAM,EAAE,UAAU,WAAW,KAAG,OA2B9E,CAAC;AAEF;;;;;;GAMG;AACH,wBAAuB,eAAe,CACrC,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,WAAW,GACnB,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,CAwCzC;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAC9B,KAAK,MAAM,EACX,UAAU,WAAW,KACnB,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAMvB,CAAC"}