@fuzdev/fuz_gitops 0.77.0 → 0.78.1
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.
- package/README.md +25 -5
- package/dist/ModulesDetail.svelte +14 -12
- package/dist/ModulesDetail.svelte.d.ts.map +1 -1
- package/dist/ModulesNav.svelte +6 -6
- package/dist/ModulesNav.svelte.d.ts.map +1 -1
- package/dist/ModulesPage.svelte +2 -2
- package/dist/ModulesPage.svelte.d.ts.map +1 -1
- package/dist/PageFooter.svelte +2 -2
- package/dist/PageHeader.svelte +5 -5
- package/dist/PageHeader.svelte.d.ts +1 -1
- package/dist/PageHeader.svelte.d.ts.map +1 -1
- package/dist/PullRequestsDetail.svelte +25 -17
- package/dist/PullRequestsDetail.svelte.d.ts.map +1 -1
- package/dist/PullRequestsPage.svelte +3 -3
- package/dist/PullRequestsPage.svelte.d.ts.map +1 -1
- package/dist/ReposTable.svelte +24 -15
- package/dist/ReposTable.svelte.d.ts.map +1 -1
- package/dist/ReposTree.svelte +8 -6
- package/dist/ReposTree.svelte.d.ts.map +1 -1
- package/dist/ReposTreeNav.svelte +10 -11
- package/dist/ReposTreeNav.svelte.d.ts.map +1 -1
- package/dist/TablePage.svelte +2 -2
- package/dist/TablePage.svelte.d.ts.map +1 -1
- package/dist/TreeItemPage.svelte +2 -2
- package/dist/TreeItemPage.svelte.d.ts.map +1 -1
- package/dist/TreePage.svelte +2 -2
- package/dist/TreePage.svelte.d.ts.map +1 -1
- package/dist/cargo_toml.d.ts +33 -0
- package/dist/cargo_toml.d.ts.map +1 -0
- package/dist/cargo_toml.js +74 -0
- package/dist/changeset_generator.d.ts +1 -1
- package/dist/changeset_generator.d.ts.map +1 -1
- package/dist/changeset_generator.js +2 -2
- package/dist/changeset_reader.d.ts +1 -1
- package/dist/changeset_reader.d.ts.map +1 -1
- package/dist/changeset_reader.js +3 -3
- package/dist/config_reconcile.d.ts.map +1 -1
- package/dist/config_reconcile.js +6 -2
- package/dist/dependency_graph.d.ts +2 -2
- package/dist/dependency_graph.d.ts.map +1 -1
- package/dist/dependency_graph.js +9 -9
- package/dist/dependency_updater.d.ts +1 -1
- package/dist/dependency_updater.d.ts.map +1 -1
- package/dist/dependency_updater.js +8 -8
- package/dist/fetch_repo_data.d.ts +2 -2
- package/dist/fetch_repo_data.d.ts.map +1 -1
- package/dist/fetch_repo_data.js +4 -4
- package/dist/fs_fetch_value_cache.d.ts +1 -1
- package/dist/fs_fetch_value_cache.d.ts.map +1 -1
- package/dist/fs_fetch_value_cache.js +5 -5
- package/dist/git_operations.d.ts +1 -1
- package/dist/git_operations.d.ts.map +1 -1
- package/dist/git_operations.js +2 -2
- package/dist/github.d.ts +2 -2
- package/dist/github.d.ts.map +1 -1
- package/dist/github.js +7 -7
- package/dist/github_helpers.d.ts.map +1 -1
- package/dist/github_helpers.js +1 -1
- package/dist/gitops_analyze.task.d.ts.map +1 -1
- package/dist/gitops_analyze.task.js +21 -14
- package/dist/gitops_config.d.ts +2 -2
- package/dist/gitops_config.d.ts.map +1 -1
- package/dist/gitops_config.js +5 -5
- package/dist/gitops_plan.task.d.ts.map +1 -1
- package/dist/gitops_plan.task.js +8 -8
- package/dist/gitops_publish.task.d.ts.map +1 -1
- package/dist/gitops_publish.task.js +15 -12
- package/dist/gitops_run.task.d.ts.map +1 -1
- package/dist/gitops_run.task.js +10 -10
- package/dist/gitops_sync.task.d.ts.map +1 -1
- package/dist/gitops_sync.task.js +15 -13
- package/dist/gitops_task_helpers.d.ts +1 -1
- package/dist/gitops_task_helpers.d.ts.map +1 -1
- package/dist/gitops_task_helpers.js +4 -4
- package/dist/gitops_validate.task.d.ts.map +1 -1
- package/dist/gitops_validate.task.js +14 -14
- package/dist/graph_validation.d.ts +2 -2
- package/dist/graph_validation.d.ts.map +1 -1
- package/dist/graph_validation.js +5 -3
- package/dist/local_repo.d.ts +21 -7
- package/dist/local_repo.d.ts.map +1 -1
- package/dist/local_repo.js +64 -16
- package/dist/log_helpers.d.ts +1 -1
- package/dist/log_helpers.d.ts.map +1 -1
- package/dist/multi_repo_publisher.d.ts +3 -3
- package/dist/multi_repo_publisher.d.ts.map +1 -1
- package/dist/multi_repo_publisher.js +24 -20
- package/dist/npm_registry.d.ts +1 -1
- package/dist/npm_registry.d.ts.map +1 -1
- package/dist/npm_registry.js +4 -4
- package/dist/operations.d.ts +4 -4
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations_defaults.d.ts.map +1 -1
- package/dist/operations_defaults.js +16 -16
- package/dist/output_helpers.d.ts +1 -1
- package/dist/output_helpers.d.ts.map +1 -1
- package/dist/preflight_checks.d.ts +2 -2
- package/dist/preflight_checks.d.ts.map +1 -1
- package/dist/preflight_checks.js +5 -5
- package/dist/publish_gate.d.ts.map +1 -1
- package/dist/publish_steps.d.ts.map +1 -1
- package/dist/publish_steps.js +4 -4
- package/dist/publishing_event.d.ts.map +1 -1
- package/dist/publishing_event.js +16 -14
- package/dist/publishing_event_handler.d.ts.map +1 -1
- package/dist/publishing_event_handler.js +6 -6
- package/dist/publishing_plan.d.ts +3 -3
- package/dist/publishing_plan.d.ts.map +1 -1
- package/dist/publishing_plan.js +25 -15
- package/dist/publishing_plan_helpers.d.ts.map +1 -1
- package/dist/publishing_plan_helpers.js +3 -3
- package/dist/publishing_plan_logging.d.ts +1 -1
- package/dist/publishing_plan_logging.d.ts.map +1 -1
- package/dist/publishing_plan_logging.js +2 -2
- package/dist/repo.svelte.d.ts +5 -5
- package/dist/repo.svelte.d.ts.map +1 -1
- package/dist/repo.svelte.js +2 -2
- package/dist/repo_ops.js +2 -2
- package/dist/resolved_gitops_config.d.ts.map +1 -1
- package/dist/resolved_gitops_config.js +1 -1
- package/dist/version_utils.js +1 -1
- package/package.json +16 -15
- package/src/lib/cargo_toml.ts +82 -0
- package/src/lib/changeset_generator.ts +20 -20
- package/src/lib/changeset_reader.ts +18 -18
- package/src/lib/ci_reconcile.ts +5 -5
- package/src/lib/config_reconcile.ts +8 -4
- package/src/lib/dependency_graph.ts +28 -28
- package/src/lib/dependency_updater.ts +30 -30
- package/src/lib/fetch_repo_data.ts +11 -11
- package/src/lib/fs_fetch_value_cache.ts +14 -10
- package/src/lib/git_operations.ts +31 -31
- package/src/lib/github.ts +19 -19
- package/src/lib/github_helpers.ts +6 -6
- package/src/lib/gitops_analyze.task.ts +56 -48
- package/src/lib/gitops_config.ts +14 -14
- package/src/lib/gitops_plan.task.ts +32 -32
- package/src/lib/gitops_publish.task.ts +52 -49
- package/src/lib/gitops_run.task.ts +29 -29
- package/src/lib/gitops_sync.task.ts +39 -30
- package/src/lib/gitops_task_helpers.ts +21 -21
- package/src/lib/gitops_validate.task.ts +38 -38
- package/src/lib/graph_validation.ts +14 -13
- package/src/lib/local_repo.ts +130 -64
- package/src/lib/log_helpers.ts +15 -15
- package/src/lib/multi_repo_publisher.ts +75 -74
- package/src/lib/npm_registry.ts +13 -13
- package/src/lib/operations.ts +50 -39
- package/src/lib/operations_defaults.ts +108 -106
- package/src/lib/output_helpers.ts +4 -4
- package/src/lib/preflight_checks.ts +28 -28
- package/src/lib/publish_gate.ts +7 -9
- package/src/lib/publish_steps.ts +15 -15
- package/src/lib/publishing_event.ts +22 -20
- package/src/lib/publishing_event_handler.ts +8 -8
- package/src/lib/publishing_plan.ts +69 -57
- package/src/lib/publishing_plan_helpers.ts +16 -12
- package/src/lib/publishing_plan_logging.ts +23 -23
- package/src/lib/repo.svelte.ts +8 -8
- package/src/lib/repo_ops.ts +12 -12
- package/src/lib/resolved_gitops_config.ts +5 -5
- package/src/lib/version_utils.ts +3 -3
package/dist/publishing_plan.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { styleText as st } from 'node:util';
|
|
2
|
+
import { repo_is_npm } from './local_repo.js';
|
|
2
3
|
import { validate_dependency_graph } from './graph_validation.js';
|
|
3
|
-
import { is_breaking_change, compare_bump_types, calculate_next_version
|
|
4
|
+
import { is_breaking_change, compare_bump_types, calculate_next_version } from './version_utils.js';
|
|
4
5
|
import { default_changeset_operations } from './operations_defaults.js';
|
|
5
6
|
import { GITOPS_MAX_ITERATIONS_DEFAULT } from './gitops_constants.js';
|
|
6
|
-
import { calculate_dependency_updates, get_required_bump_for_dependencies
|
|
7
|
+
import { calculate_dependency_updates, get_required_bump_for_dependencies } from './publishing_plan_helpers.js';
|
|
7
8
|
// Re-export logging functions
|
|
8
9
|
export { log_publishing_plan } from './publishing_plan_logging.js';
|
|
9
10
|
/**
|
|
@@ -11,12 +12,21 @@ export { log_publishing_plan } from './publishing_plan_logging.js';
|
|
|
11
12
|
* Shows version changes, dependency updates, and breaking change cascades.
|
|
12
13
|
* Uses fixed-point iteration to resolve transitive cascades.
|
|
13
14
|
*/
|
|
14
|
-
export const generate_publishing_plan = async (
|
|
15
|
+
export const generate_publishing_plan = async (all_repos, options = {}) => {
|
|
15
16
|
const { log, ops = default_changeset_operations, verbose } = options;
|
|
16
17
|
log?.info(st('cyan', 'Generating publishing plan...'));
|
|
17
18
|
const warnings = [];
|
|
18
19
|
const info = []; // Informational status (not warnings)
|
|
19
20
|
const errors = [];
|
|
21
|
+
// Publishing concerns only npm packages. Non-npm repos (e.g. Rust cargo repos) are
|
|
22
|
+
// loaded for the dashboard but have no npm identity in the changeset cascade — drop them
|
|
23
|
+
// before building the graph so they never appear in the plan or publishing order.
|
|
24
|
+
const non_npm_repos = all_repos.filter((r) => !repo_is_npm(r));
|
|
25
|
+
if (non_npm_repos.length > 0) {
|
|
26
|
+
info.push(`Excluded ${non_npm_repos.length} non-npm repo(s) from publishing: ` +
|
|
27
|
+
non_npm_repos.map((r) => r.library.name).join(', '));
|
|
28
|
+
}
|
|
29
|
+
const repos = all_repos.filter(repo_is_npm);
|
|
20
30
|
// Verbose data collection
|
|
21
31
|
const verbose_changeset_details = [];
|
|
22
32
|
const verbose_iterations = [];
|
|
@@ -29,7 +39,7 @@ export const generate_publishing_plan = async (repos, options = {}) => {
|
|
|
29
39
|
const validation = validate_dependency_graph(repos, {
|
|
30
40
|
throw_on_prod_cycles: false, // Collect errors instead of throwing
|
|
31
41
|
log_cycles: false, // We'll handle our own error collection
|
|
32
|
-
log_order: false
|
|
42
|
+
log_order: false // Plan generation doesn't need to log order
|
|
33
43
|
});
|
|
34
44
|
publishing_order = validation.publishing_order;
|
|
35
45
|
production_cycles = validation.production_cycles;
|
|
@@ -49,7 +59,7 @@ export const generate_publishing_plan = async (repos, options = {}) => {
|
|
|
49
59
|
breaking_cascades: new Map(),
|
|
50
60
|
warnings,
|
|
51
61
|
info,
|
|
52
|
-
errors
|
|
62
|
+
errors
|
|
53
63
|
};
|
|
54
64
|
}
|
|
55
65
|
// Collect cycle errors
|
|
@@ -109,7 +119,7 @@ export const generate_publishing_plan = async (repos, options = {}) => {
|
|
|
109
119
|
return {
|
|
110
120
|
filename: cs.filename,
|
|
111
121
|
bump_type: pkg_entry?.bump_type || prediction.bump_type,
|
|
112
|
-
summary: cs.summary
|
|
122
|
+
summary: cs.summary
|
|
113
123
|
};
|
|
114
124
|
});
|
|
115
125
|
if (files.length > 0) {
|
|
@@ -130,7 +140,7 @@ export const generate_publishing_plan = async (repos, options = {}) => {
|
|
|
130
140
|
to: prediction.version,
|
|
131
141
|
bump_type: prediction.bump_type,
|
|
132
142
|
breaking: is_breaking,
|
|
133
|
-
has_changesets: true
|
|
143
|
+
has_changesets: true
|
|
134
144
|
});
|
|
135
145
|
}
|
|
136
146
|
}
|
|
@@ -190,7 +200,7 @@ export const generate_publishing_plan = async (repos, options = {}) => {
|
|
|
190
200
|
triggering_dep,
|
|
191
201
|
action: 'escalation',
|
|
192
202
|
version_to: new_version,
|
|
193
|
-
is_breaking: is_breaking_change(old_version, required_bump)
|
|
203
|
+
is_breaking: is_breaking_change(old_version, required_bump)
|
|
194
204
|
});
|
|
195
205
|
}
|
|
196
206
|
existing_entry.needs_bump_escalation = true;
|
|
@@ -226,7 +236,7 @@ export const generate_publishing_plan = async (repos, options = {}) => {
|
|
|
226
236
|
triggering_dep,
|
|
227
237
|
action: 'auto_changeset',
|
|
228
238
|
version_to: new_version,
|
|
229
|
-
is_breaking
|
|
239
|
+
is_breaking
|
|
230
240
|
});
|
|
231
241
|
}
|
|
232
242
|
if (is_breaking) {
|
|
@@ -239,7 +249,7 @@ export const generate_publishing_plan = async (repos, options = {}) => {
|
|
|
239
249
|
bump_type: required_bump,
|
|
240
250
|
breaking: is_breaking,
|
|
241
251
|
has_changesets: false,
|
|
242
|
-
will_generate_changeset: true
|
|
252
|
+
will_generate_changeset: true
|
|
243
253
|
});
|
|
244
254
|
// Update predicted versions
|
|
245
255
|
predicted_versions.set(pkg_name, new_version);
|
|
@@ -251,7 +261,7 @@ export const generate_publishing_plan = async (repos, options = {}) => {
|
|
|
251
261
|
verbose_iterations.push({
|
|
252
262
|
iteration,
|
|
253
263
|
packages: verbose_iteration_packages,
|
|
254
|
-
new_changes: verbose_new_changes
|
|
264
|
+
new_changes: verbose_new_changes
|
|
255
265
|
});
|
|
256
266
|
}
|
|
257
267
|
}
|
|
@@ -336,7 +346,7 @@ export const generate_publishing_plan = async (repos, options = {}) => {
|
|
|
336
346
|
prod_peer_edges.push({
|
|
337
347
|
from: pkg_name,
|
|
338
348
|
to: dep_name,
|
|
339
|
-
type: spec.type === 'peer' ? 'peer' : 'prod'
|
|
349
|
+
type: spec.type === 'peer' ? 'peer' : 'prod'
|
|
340
350
|
});
|
|
341
351
|
}
|
|
342
352
|
}
|
|
@@ -352,9 +362,9 @@ export const generate_publishing_plan = async (repos, options = {}) => {
|
|
|
352
362
|
prod_peer_edges,
|
|
353
363
|
dev_edges,
|
|
354
364
|
prod_cycle_count: production_cycles.length,
|
|
355
|
-
dev_cycle_count: dev_cycles.length
|
|
365
|
+
dev_cycle_count: dev_cycles.length
|
|
356
366
|
},
|
|
357
|
-
total_iterations: iteration
|
|
367
|
+
total_iterations: iteration
|
|
358
368
|
};
|
|
359
369
|
}
|
|
360
370
|
return {
|
|
@@ -365,6 +375,6 @@ export const generate_publishing_plan = async (repos, options = {}) => {
|
|
|
365
375
|
warnings,
|
|
366
376
|
info,
|
|
367
377
|
errors,
|
|
368
|
-
verbose_data
|
|
378
|
+
verbose_data
|
|
369
379
|
};
|
|
370
380
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publishing_plan_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/publishing_plan_helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"publishing_plan_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/publishing_plan_helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAGN,KAAK,QAAQ,EACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,GACxC,OAAO,KAAK,CAAC,SAAS,CAAC,EACvB,oBAAoB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACvC,mBAAmB,GAAG,CAAC,MAAM,CAAC,KAC5B;IACF,kBAAkB,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC5C,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;CAwE9C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kCAAkC,GAC9C,MAAM,SAAS,EACf,oBAAoB,KAAK,CAAC,gBAAgB,CAAC,EAC3C,mBAAmB,GAAG,CAAC,MAAM,CAAC,KAC5B,QAAQ,GAAG,IAqBb,CAAC"}
|
|
@@ -28,7 +28,7 @@ export const calculate_dependency_updates = (repos, predicted_versions, breaking
|
|
|
28
28
|
updated_dependency: dep_name,
|
|
29
29
|
current_version,
|
|
30
30
|
new_version,
|
|
31
|
-
type: 'dependencies'
|
|
31
|
+
type: 'dependencies'
|
|
32
32
|
});
|
|
33
33
|
if (breaking_packages.has(dep_name)) {
|
|
34
34
|
const cascades = breaking_cascades.get(dep_name) || [];
|
|
@@ -50,7 +50,7 @@ export const calculate_dependency_updates = (repos, predicted_versions, breaking
|
|
|
50
50
|
updated_dependency: dep_name,
|
|
51
51
|
current_version,
|
|
52
52
|
new_version,
|
|
53
|
-
type: 'peerDependencies'
|
|
53
|
+
type: 'peerDependencies'
|
|
54
54
|
});
|
|
55
55
|
if (breaking_packages.has(dep_name)) {
|
|
56
56
|
const cascades = breaking_cascades.get(dep_name) || [];
|
|
@@ -72,7 +72,7 @@ export const calculate_dependency_updates = (repos, predicted_versions, breaking
|
|
|
72
72
|
updated_dependency: dep_name,
|
|
73
73
|
current_version,
|
|
74
74
|
new_version,
|
|
75
|
-
type: 'devDependencies'
|
|
75
|
+
type: 'devDependencies'
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publishing_plan_logging.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/publishing_plan_logging.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"publishing_plan_logging.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/publishing_plan_logging.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,KAAK,EACX,cAAc,EAQd,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,cAAc;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AA2GD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC/B,MAAM,cAAc,EACpB,KAAK,MAAM,EACX,UAAS,cAAmB,KAC1B,IA6IF,CAAC"}
|
|
@@ -22,7 +22,7 @@ const log_section_header = (title, log) => {
|
|
|
22
22
|
const format_dep_diff = (dep_name, current, next) => {
|
|
23
23
|
return [
|
|
24
24
|
st('red', ` - "${dep_name}": "${current}"`),
|
|
25
|
-
st('green', ` + "${dep_name}": "${next}"`)
|
|
25
|
+
st('green', ` + "${dep_name}": "${next}"`)
|
|
26
26
|
];
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
@@ -93,7 +93,7 @@ const log_version_change_with_diffs = (change, index, total, dependency_updates,
|
|
|
93
93
|
* dependency-only updates, warnings, and a summary.
|
|
94
94
|
*/
|
|
95
95
|
export const log_publishing_plan = (plan, log, options = {}) => {
|
|
96
|
-
const { publishing_order, version_changes, dependency_updates, breaking_cascades, warnings, info, errors
|
|
96
|
+
const { publishing_order, version_changes, dependency_updates, breaking_cascades, warnings, info, errors } = plan;
|
|
97
97
|
// Errors first (blocking issues)
|
|
98
98
|
if (errors.length > 0) {
|
|
99
99
|
log.error(st('red', 'Errors:'));
|
package/dist/repo.svelte.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { LibraryJson, SourceJson } from '@fuzdev/fuz_util/library_json.
|
|
2
|
-
import type { PkgJson } from '@fuzdev/fuz_util/pkg_json.
|
|
3
|
-
import type { PackageJson } from '@fuzdev/fuz_util/package_json.
|
|
4
|
-
import type { Url } from '@fuzdev/fuz_util/url.
|
|
5
|
-
import { Library } from '@fuzdev/fuz_ui/library.svelte.
|
|
1
|
+
import type { LibraryJson, SourceJson } from '@fuzdev/fuz_util/library_json.ts';
|
|
2
|
+
import type { PkgJson } from '@fuzdev/fuz_util/pkg_json.ts';
|
|
3
|
+
import type { PackageJson } from '@fuzdev/fuz_util/package_json.ts';
|
|
4
|
+
import type { Url } from '@fuzdev/fuz_util/url.ts';
|
|
5
|
+
import { Library } from '@fuzdev/fuz_ui/library.svelte.ts';
|
|
6
6
|
import { GithubCheckRunsItem, type GithubPullRequest } from './github.js';
|
|
7
7
|
/**
|
|
8
8
|
* Serialized repo data as stored in `repos.ts` (JSON).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/repo.svelte.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"repo.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/repo.svelte.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE1E;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACxB,YAAY,EAAE,WAAW,CAAC;IAC1B,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,8EAA8E;IAC9E,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC;IACnC,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,YAAY,IAAI,GAAG,GAAG,IAAI,CAE7B;IACD,IAAI,QAAQ,IAAI,GAAG,GAAG,IAAI,CAEzB;IACD,IAAI,QAAQ,IAAI,MAAM,CAErB;IACD,IAAI,OAAO,IAAI,GAAG,GAAG,IAAI,CAExB;IACD,IAAI,aAAa,IAAI,GAAG,GAAG,IAAI,CAE9B;IACD,gGAAgG;IAChG,IAAI,QAAQ,IAAI,OAAO,CAEtB;IACD,IAAI,WAAW,IAAI,UAAU,CAE5B;gBAEW,SAAS,EAAE,QAAQ;CAM/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"}
|
package/dist/repo.svelte.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { create_context } from '@fuzdev/fuz_ui/context_helpers.
|
|
2
|
-
import { Library } from '@fuzdev/fuz_ui/library.svelte.
|
|
1
|
+
import { create_context } from '@fuzdev/fuz_ui/context_helpers.ts';
|
|
2
|
+
import { Library } from '@fuzdev/fuz_ui/library.svelte.ts';
|
|
3
3
|
import { GithubCheckRunsItem } from './github.js';
|
|
4
4
|
/**
|
|
5
5
|
* Runtime repo with `Library` composition for package metadata.
|
package/dist/repo_ops.js
CHANGED
|
@@ -29,7 +29,7 @@ export const DEFAULT_EXCLUDE_DIRS = [
|
|
|
29
29
|
'build',
|
|
30
30
|
'coverage',
|
|
31
31
|
'.cache',
|
|
32
|
-
'.turbo'
|
|
32
|
+
'.turbo'
|
|
33
33
|
];
|
|
34
34
|
/** Default binary/non-text extensions to exclude from content processing */
|
|
35
35
|
export const DEFAULT_EXCLUDE_EXTENSIONS = [
|
|
@@ -53,7 +53,7 @@ export const DEFAULT_EXCLUDE_EXTENSIONS = [
|
|
|
53
53
|
'.tar',
|
|
54
54
|
'.gz',
|
|
55
55
|
'.lock',
|
|
56
|
-
'.pdf'
|
|
56
|
+
'.pdf'
|
|
57
57
|
];
|
|
58
58
|
/**
|
|
59
59
|
* Get repo paths from gitops config without full git sync.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolved_gitops_config.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/resolved_gitops_config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"resolved_gitops_config.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/resolved_gitops_config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAqB,KAAK,aAAa,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE/F,MAAM,WAAW,oBAAoB;IACpC,WAAW,EAAE,KAAK,CAAC,aAAa,GAAG,gBAAgB,CAAC,GAAG,IAAI,CAAC;IAC5D,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC;IAC9C,mBAAmB,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;CACpD;AAED,eAAO,MAAM,qBAAqB,GACjC,eAAe,YAAY,EAC3B,WAAW,MAAM,KACf,oBAcF,CAAC"}
|
|
@@ -6,7 +6,7 @@ export const resolve_gitops_config = (gitops_config, repos_dir) => {
|
|
|
6
6
|
const config = {
|
|
7
7
|
local_repos: local_repos.length ? local_repos : null,
|
|
8
8
|
local_repo_paths: local_repo_paths.length ? local_repo_paths : null,
|
|
9
|
-
local_repos_missing: local_repos_missing.length ? local_repos_missing : null
|
|
9
|
+
local_repos_missing: local_repos_missing.length ? local_repos_missing : null
|
|
10
10
|
};
|
|
11
11
|
return config;
|
|
12
12
|
};
|
package/dist/version_utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuzdev/fuz_gitops",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.78.1",
|
|
4
4
|
"description": "a tool for managing many repos",
|
|
5
5
|
"glyph": "🪄",
|
|
6
6
|
"logo": "logo.svg",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"@fuzdev/fuz_css": ">=0.62.0",
|
|
33
33
|
"@fuzdev/fuz_ui": ">=0.205.1",
|
|
34
|
-
"@fuzdev/fuz_util": ">=0.65.
|
|
34
|
+
"@fuzdev/fuz_util": ">=0.65.2",
|
|
35
35
|
"@fuzdev/gro": ">=0.204.0",
|
|
36
36
|
"@sveltejs/kit": "^2",
|
|
37
37
|
"svelte": "^5",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@changesets/changelog-git": "^0.2.1",
|
|
42
42
|
"@fuzdev/blake3_wasm": "^0.1.1",
|
|
43
|
-
"@fuzdev/fuz_code": "^0.
|
|
44
|
-
"@fuzdev/fuz_css": "^0.63.
|
|
45
|
-
"@fuzdev/fuz_ui": "^0.
|
|
46
|
-
"@fuzdev/fuz_util": "^0.
|
|
47
|
-
"@fuzdev/gro": "^0.
|
|
48
|
-
"@fuzdev/mdz": "^0.
|
|
49
|
-
"@ryanatkn/eslint-config": "^0.12.
|
|
43
|
+
"@fuzdev/fuz_code": "^0.48.0",
|
|
44
|
+
"@fuzdev/fuz_css": "^0.63.3",
|
|
45
|
+
"@fuzdev/fuz_ui": "^0.208.0",
|
|
46
|
+
"@fuzdev/fuz_util": "^0.68.0",
|
|
47
|
+
"@fuzdev/gro": "^0.210.1",
|
|
48
|
+
"@fuzdev/mdz": "^0.3.0",
|
|
49
|
+
"@ryanatkn/eslint-config": "^0.12.2",
|
|
50
50
|
"@sveltejs/acorn-typescript": "^1.0.9",
|
|
51
51
|
"@sveltejs/adapter-static": "^3.0.10",
|
|
52
52
|
"@sveltejs/kit": "^2.63.0",
|
|
@@ -59,17 +59,17 @@
|
|
|
59
59
|
"eslint-plugin-svelte": "^3.13.1",
|
|
60
60
|
"esm-env": "^1.2.2",
|
|
61
61
|
"magic-string": "^0.30.21",
|
|
62
|
-
"prettier": "^3.
|
|
63
|
-
"prettier-plugin-svelte": "^
|
|
62
|
+
"prettier": "^3.9.6",
|
|
63
|
+
"prettier-plugin-svelte": "^4.1.1",
|
|
64
64
|
"svelte": "^5.56.2",
|
|
65
65
|
"svelte-check": "^4.6.0",
|
|
66
|
-
"svelte-docinfo": "^0.
|
|
66
|
+
"svelte-docinfo": "^0.7.0",
|
|
67
67
|
"svelte2tsx": "^0.7.52",
|
|
68
68
|
"tslib": "^2.8.1",
|
|
69
69
|
"typescript": "^5.9.3",
|
|
70
70
|
"typescript-eslint": "^8.48.1",
|
|
71
|
-
"vite": "^7.3.
|
|
72
|
-
"vitest": "^
|
|
71
|
+
"vite": "^7.3.6",
|
|
72
|
+
"vitest": "^5.0.0",
|
|
73
73
|
"zimmerframe": "^1.1.4",
|
|
74
74
|
"zod": "^4.3.6"
|
|
75
75
|
},
|
|
@@ -80,7 +80,8 @@
|
|
|
80
80
|
"useTabs": true,
|
|
81
81
|
"printWidth": 100,
|
|
82
82
|
"singleQuote": true,
|
|
83
|
-
"bracketSpacing":
|
|
83
|
+
"bracketSpacing": true,
|
|
84
|
+
"trailingComma": "none",
|
|
84
85
|
"overrides": [
|
|
85
86
|
{
|
|
86
87
|
"files": "package.json",
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { readFile } from 'node:fs/promises';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The handful of identity fields gitops reads from a Rust repo's `Cargo.toml`
|
|
7
|
+
* to render it on the dashboard. Everything is optional — a workspace root has
|
|
8
|
+
* no `name`, and any field may be absent or inherited.
|
|
9
|
+
*/
|
|
10
|
+
export interface CargoMetadata {
|
|
11
|
+
name?: string;
|
|
12
|
+
version?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
repository?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** The `Cargo.toml` tables that carry package identity (single-crate vs workspace root). */
|
|
18
|
+
const CARGO_METADATA_SECTIONS: ReadonlySet<string> = new Set(['package', 'workspace.package']);
|
|
19
|
+
const CARGO_METADATA_KEYS = ['name', 'version', 'description', 'repository'] as const;
|
|
20
|
+
type CargoMetadataKey = (typeof CARGO_METADATA_KEYS)[number];
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Best-effort read of a repo's root `Cargo.toml` for the identity fields the
|
|
24
|
+
* gitops dashboard renders. Returns `null` when there's no `Cargo.toml`.
|
|
25
|
+
*
|
|
26
|
+
* @param repo_dir - absolute path to the repo
|
|
27
|
+
*/
|
|
28
|
+
export const cargo_toml_load = async (repo_dir: string): Promise<CargoMetadata | null> => {
|
|
29
|
+
const cargo_toml_path = join(repo_dir, 'Cargo.toml');
|
|
30
|
+
if (!existsSync(cargo_toml_path)) return null;
|
|
31
|
+
return cargo_toml_parse(await readFile(cargo_toml_path, 'utf8'));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Extracts `name`/`version`/`description`/`repository` from the `[package]` and
|
|
36
|
+
* `[workspace.package]` tables of a `Cargo.toml`.
|
|
37
|
+
*
|
|
38
|
+
* Deliberately not a full TOML parser: it scans for simple `key = "value"`
|
|
39
|
+
* string entries in those two tables, which covers both a single-crate manifest
|
|
40
|
+
* and a workspace root. Inline-table values like `version = { workspace = true }`
|
|
41
|
+
* (and the equivalent `version.workspace = true`) are ignored — a member crate
|
|
42
|
+
* inheriting from the workspace has no literal here, and gitops only ever reads a
|
|
43
|
+
* repo's root manifest, where these are concrete. The first non-empty value for a
|
|
44
|
+
* key wins, so a top-level `[package]` takes precedence over `[workspace.package]`
|
|
45
|
+
* when both appear.
|
|
46
|
+
*/
|
|
47
|
+
export const cargo_toml_parse = (contents: string): CargoMetadata => {
|
|
48
|
+
const metadata: CargoMetadata = {};
|
|
49
|
+
let in_metadata_section = false;
|
|
50
|
+
for (const raw_line of contents.split('\n')) {
|
|
51
|
+
const line = raw_line.trim();
|
|
52
|
+
if (line === '' || line.startsWith('#')) continue;
|
|
53
|
+
// Section header — only `[package]`/`[workspace.package]` arm value capture.
|
|
54
|
+
if (line.startsWith('[')) {
|
|
55
|
+
const end = line.indexOf(']');
|
|
56
|
+
in_metadata_section = end !== -1 && CARGO_METADATA_SECTIONS.has(line.slice(1, end).trim());
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (!in_metadata_section) continue;
|
|
60
|
+
const eq = line.indexOf('=');
|
|
61
|
+
if (eq === -1) continue;
|
|
62
|
+
const key = line.slice(0, eq).trim();
|
|
63
|
+
if (!CARGO_METADATA_KEYS.includes(key as CargoMetadataKey)) continue;
|
|
64
|
+
if (metadata[key as CargoMetadataKey] !== undefined) continue; // first value wins
|
|
65
|
+
const value = cargo_toml_string_value(line.slice(eq + 1).trim());
|
|
66
|
+
if (value !== null) metadata[key as CargoMetadataKey] = value;
|
|
67
|
+
}
|
|
68
|
+
return metadata;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Reads a simple single- or double-quoted TOML string, ignoring any trailing
|
|
73
|
+
* inline comment. Returns `null` for non-string values (inline tables, arrays,
|
|
74
|
+
* booleans, numbers), which the caller skips.
|
|
75
|
+
*/
|
|
76
|
+
const cargo_toml_string_value = (raw: string): string | null => {
|
|
77
|
+
const quote = raw[0];
|
|
78
|
+
if (quote !== '"' && quote !== "'") return null;
|
|
79
|
+
const end = raw.indexOf(quote, 1);
|
|
80
|
+
if (end === -1) return null;
|
|
81
|
+
return raw.slice(1, end);
|
|
82
|
+
};
|
|
@@ -7,17 +7,17 @@
|
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import {join} from 'node:path';
|
|
11
|
-
import type {Logger} from '@fuzdev/fuz_util/log.
|
|
12
|
-
import type {LocalRepo} from './local_repo.
|
|
13
|
-
import type {PublishedVersion} from './multi_repo_publisher.
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import type { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
12
|
+
import type { LocalRepo } from './local_repo.ts';
|
|
13
|
+
import type { PublishedVersion } from './multi_repo_publisher.ts';
|
|
14
14
|
import {
|
|
15
15
|
strip_version_prefix,
|
|
16
16
|
required_bump_for_dependency_update,
|
|
17
|
-
type BumpType
|
|
18
|
-
} from './version_utils.
|
|
19
|
-
import type {FsOperations} from './operations.
|
|
20
|
-
import {default_fs_operations} from './operations_defaults.
|
|
17
|
+
type BumpType
|
|
18
|
+
} from './version_utils.ts';
|
|
19
|
+
import type { FsOperations } from './operations.ts';
|
|
20
|
+
import { default_fs_operations } from './operations_defaults.ts';
|
|
21
21
|
|
|
22
22
|
export interface DependencyVersionChange {
|
|
23
23
|
package_name: string;
|
|
@@ -34,14 +34,14 @@ export interface DependencyVersionChange {
|
|
|
34
34
|
export const create_changeset_for_dependency_updates = async (
|
|
35
35
|
repo: LocalRepo,
|
|
36
36
|
updates: Array<DependencyVersionChange>,
|
|
37
|
-
options: {log?: Logger; fs_ops?: FsOperations} = {}
|
|
37
|
+
options: { log?: Logger; fs_ops?: FsOperations } = {}
|
|
38
38
|
): Promise<string> => {
|
|
39
|
-
const {log, fs_ops = default_fs_operations} = options;
|
|
39
|
+
const { log, fs_ops = default_fs_operations } = options;
|
|
40
40
|
const changesets_dir = join(repo.repo_dir, '.changeset');
|
|
41
41
|
|
|
42
42
|
// Ensure .changeset directory exists
|
|
43
|
-
if (!(await fs_ops.exists({path: changesets_dir}))) {
|
|
44
|
-
const mkdir_result = await fs_ops.mkdir({path: changesets_dir, recursive: true});
|
|
43
|
+
if (!(await fs_ops.exists({ path: changesets_dir }))) {
|
|
44
|
+
const mkdir_result = await fs_ops.mkdir({ path: changesets_dir, recursive: true });
|
|
45
45
|
if (!mkdir_result.ok) {
|
|
46
46
|
throw new Error(`Failed to create .changeset directory: ${mkdir_result.message}`);
|
|
47
47
|
}
|
|
@@ -60,7 +60,7 @@ export const create_changeset_for_dependency_updates = async (
|
|
|
60
60
|
const content = generate_changeset_content(repo.library.name, updates, required_bump);
|
|
61
61
|
|
|
62
62
|
// Write the changeset file
|
|
63
|
-
const write_result = await fs_ops.writeFile({path: filepath, content});
|
|
63
|
+
const write_result = await fs_ops.writeFile({ path: filepath, content });
|
|
64
64
|
if (!write_result.ok) {
|
|
65
65
|
throw new Error(`Failed to write changeset file: ${write_result.message}`);
|
|
66
66
|
}
|
|
@@ -72,11 +72,11 @@ export const create_changeset_for_dependency_updates = async (
|
|
|
72
72
|
|
|
73
73
|
const calculate_required_bump = (
|
|
74
74
|
repo: LocalRepo,
|
|
75
|
-
updates: Array<DependencyVersionChange
|
|
75
|
+
updates: Array<DependencyVersionChange>
|
|
76
76
|
): BumpType =>
|
|
77
77
|
required_bump_for_dependency_update(
|
|
78
78
|
repo.package_json.version || '0.0.0',
|
|
79
|
-
updates.some((u) => u.breaking)
|
|
79
|
+
updates.some((u) => u.breaking)
|
|
80
80
|
);
|
|
81
81
|
|
|
82
82
|
/**
|
|
@@ -94,7 +94,7 @@ const calculate_required_bump = (
|
|
|
94
94
|
export const generate_changeset_content = (
|
|
95
95
|
package_name: string,
|
|
96
96
|
updates: Array<DependencyVersionChange>,
|
|
97
|
-
bump_type: 'major' | 'minor' | 'patch'
|
|
97
|
+
bump_type: 'major' | 'minor' | 'patch'
|
|
98
98
|
): string => {
|
|
99
99
|
// Group updates by type
|
|
100
100
|
const breaking_updates = updates.filter((u) => u.breaking);
|
|
@@ -112,7 +112,7 @@ export const generate_changeset_content = (
|
|
|
112
112
|
lines.push('Breaking dependency changes:');
|
|
113
113
|
for (const update of breaking_updates) {
|
|
114
114
|
lines.push(
|
|
115
|
-
`- ${update.package_name}: ${update.from_version} → ${update.to_version} (${update.bump_type})
|
|
115
|
+
`- ${update.package_name}: ${update.from_version} → ${update.to_version} (${update.bump_type})`
|
|
116
116
|
);
|
|
117
117
|
}
|
|
118
118
|
lines.push('');
|
|
@@ -126,7 +126,7 @@ export const generate_changeset_content = (
|
|
|
126
126
|
}
|
|
127
127
|
for (const update of regular_updates) {
|
|
128
128
|
lines.push(
|
|
129
|
-
`- ${update.package_name}: ${update.from_version} → ${update.to_version} (${update.bump_type})
|
|
129
|
+
`- ${update.package_name}: ${update.from_version} → ${update.to_version} (${update.bump_type})`
|
|
130
130
|
);
|
|
131
131
|
}
|
|
132
132
|
lines.push('');
|
|
@@ -137,7 +137,7 @@ export const generate_changeset_content = (
|
|
|
137
137
|
|
|
138
138
|
export const create_dependency_updates = (
|
|
139
139
|
dependencies: Map<string, string>,
|
|
140
|
-
published_versions: Map<string, PublishedVersion
|
|
140
|
+
published_versions: Map<string, PublishedVersion>
|
|
141
141
|
): Array<DependencyVersionChange> => {
|
|
142
142
|
const updates: Array<DependencyVersionChange> = [];
|
|
143
143
|
|
|
@@ -152,7 +152,7 @@ export const create_dependency_updates = (
|
|
|
152
152
|
from_version: clean_current,
|
|
153
153
|
to_version: published.new_version,
|
|
154
154
|
bump_type: published.bump_type,
|
|
155
|
-
breaking: published.breaking
|
|
155
|
+
breaking: published.breaking
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
158
|
}
|
|
@@ -7,17 +7,17 @@
|
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type {Logger} from '@fuzdev/fuz_util/log.
|
|
11
|
-
import {existsSync} from 'node:fs';
|
|
12
|
-
import {readdir, readFile} from 'node:fs/promises';
|
|
13
|
-
import {join} from 'node:path';
|
|
10
|
+
import type { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
11
|
+
import { existsSync } from 'node:fs';
|
|
12
|
+
import { readdir, readFile } from 'node:fs/promises';
|
|
13
|
+
import { join } from 'node:path';
|
|
14
14
|
|
|
15
|
-
import type {LocalRepo} from './local_repo.
|
|
16
|
-
import {compare_bump_types, calculate_next_version, type BumpType} from './version_utils.
|
|
15
|
+
import type { LocalRepo } from './local_repo.ts';
|
|
16
|
+
import { compare_bump_types, calculate_next_version, type BumpType } from './version_utils.ts';
|
|
17
17
|
|
|
18
18
|
export interface ChangesetInfo {
|
|
19
19
|
filename: string;
|
|
20
|
-
packages: Array<{name: string; bump_type: BumpType}>;
|
|
20
|
+
packages: Array<{ name: string; bump_type: BumpType }>;
|
|
21
21
|
summary: string;
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -44,7 +44,7 @@ export interface ChangesetInfo {
|
|
|
44
44
|
*/
|
|
45
45
|
export const parse_changeset_content = (
|
|
46
46
|
content: string,
|
|
47
|
-
filename = 'changeset.md'
|
|
47
|
+
filename = 'changeset.md'
|
|
48
48
|
): ChangesetInfo | null => {
|
|
49
49
|
// Match frontmatter between --- markers
|
|
50
50
|
const frontmatter_match = /^---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*)/.exec(content);
|
|
@@ -56,7 +56,7 @@ export const parse_changeset_content = (
|
|
|
56
56
|
const summary = frontmatter_match[2]!.trim();
|
|
57
57
|
|
|
58
58
|
// Parse package entries
|
|
59
|
-
const packages: Array<{name: string; bump_type: BumpType}> = [];
|
|
59
|
+
const packages: Array<{ name: string; bump_type: BumpType }> = [];
|
|
60
60
|
|
|
61
61
|
// Match lines like: "package-name": patch
|
|
62
62
|
// or: '@scope/package': minor
|
|
@@ -67,7 +67,7 @@ export const parse_changeset_content = (
|
|
|
67
67
|
while ((match = package_regex.exec(frontmatter)) !== null) {
|
|
68
68
|
packages.push({
|
|
69
69
|
name: match[1]!,
|
|
70
|
-
bump_type: match[2]! as BumpType
|
|
70
|
+
bump_type: match[2]! as BumpType
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -78,13 +78,13 @@ export const parse_changeset_content = (
|
|
|
78
78
|
return {
|
|
79
79
|
filename,
|
|
80
80
|
packages,
|
|
81
|
-
summary
|
|
81
|
+
summary
|
|
82
82
|
};
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
export const parse_changeset_file = async (
|
|
86
86
|
filepath: string,
|
|
87
|
-
log?: Logger
|
|
87
|
+
log?: Logger
|
|
88
88
|
): Promise<ChangesetInfo | null> => {
|
|
89
89
|
try {
|
|
90
90
|
const content = await readFile(filepath, 'utf8');
|
|
@@ -105,7 +105,7 @@ export const parse_changeset_file = async (
|
|
|
105
105
|
|
|
106
106
|
export const read_changesets = async (
|
|
107
107
|
repo: LocalRepo,
|
|
108
|
-
log?: Logger
|
|
108
|
+
log?: Logger
|
|
109
109
|
): Promise<Array<ChangesetInfo>> => {
|
|
110
110
|
const changesets_dir = join(repo.repo_dir, '.changeset');
|
|
111
111
|
|
|
@@ -141,7 +141,7 @@ export const read_changesets = async (
|
|
|
141
141
|
*/
|
|
142
142
|
export const determine_bump_from_changesets = (
|
|
143
143
|
changesets: Array<ChangesetInfo>,
|
|
144
|
-
package_name: string
|
|
144
|
+
package_name: string
|
|
145
145
|
): BumpType | null => {
|
|
146
146
|
let highest_bump: BumpType | null = null;
|
|
147
147
|
|
|
@@ -195,8 +195,8 @@ export const has_changesets = async (repo: LocalRepo): Promise<boolean> => {
|
|
|
195
195
|
*/
|
|
196
196
|
export const predict_next_version = async (
|
|
197
197
|
repo: LocalRepo,
|
|
198
|
-
log?: Logger
|
|
199
|
-
): Promise<{version: string; bump_type: BumpType} | null> => {
|
|
198
|
+
log?: Logger
|
|
199
|
+
): Promise<{ version: string; bump_type: BumpType } | null> => {
|
|
200
200
|
const changesets = await read_changesets(repo, log);
|
|
201
201
|
if (changesets.length === 0) {
|
|
202
202
|
return null;
|
|
@@ -211,11 +211,11 @@ export const predict_next_version = async (
|
|
|
211
211
|
const next_version = calculate_next_version(current_version, bump_type);
|
|
212
212
|
|
|
213
213
|
log?.debug(
|
|
214
|
-
` Predicted ${repo.library.name}: ${current_version} → ${next_version} (${bump_type})
|
|
214
|
+
` Predicted ${repo.library.name}: ${current_version} → ${next_version} (${bump_type})`
|
|
215
215
|
);
|
|
216
216
|
|
|
217
217
|
return {
|
|
218
218
|
version: next_version,
|
|
219
|
-
bump_type
|
|
219
|
+
bump_type
|
|
220
220
|
};
|
|
221
221
|
};
|