@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
|
@@ -6,9 +6,13 @@
|
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type {LocalRepo} from './local_repo.
|
|
10
|
-
import {
|
|
11
|
-
|
|
9
|
+
import type { LocalRepo } from './local_repo.ts';
|
|
10
|
+
import {
|
|
11
|
+
needs_update,
|
|
12
|
+
required_bump_for_dependency_update,
|
|
13
|
+
type BumpType
|
|
14
|
+
} from './version_utils.ts';
|
|
15
|
+
import type { DependencyUpdate } from './publishing_plan.ts';
|
|
12
16
|
|
|
13
17
|
/**
|
|
14
18
|
* Calculates all dependency updates between packages based on predicted versions.
|
|
@@ -21,7 +25,7 @@ import type {DependencyUpdate} from './publishing_plan.js';
|
|
|
21
25
|
export const calculate_dependency_updates = (
|
|
22
26
|
repos: Array<LocalRepo>,
|
|
23
27
|
predicted_versions: Map<string, string>,
|
|
24
|
-
breaking_packages: Set<string
|
|
28
|
+
breaking_packages: Set<string>
|
|
25
29
|
): {
|
|
26
30
|
dependency_updates: Array<DependencyUpdate>;
|
|
27
31
|
breaking_cascades: Map<string, Array<string>>;
|
|
@@ -40,7 +44,7 @@ export const calculate_dependency_updates = (
|
|
|
40
44
|
updated_dependency: dep_name,
|
|
41
45
|
current_version,
|
|
42
46
|
new_version,
|
|
43
|
-
type: 'dependencies'
|
|
47
|
+
type: 'dependencies'
|
|
44
48
|
});
|
|
45
49
|
|
|
46
50
|
if (breaking_packages.has(dep_name)) {
|
|
@@ -64,7 +68,7 @@ export const calculate_dependency_updates = (
|
|
|
64
68
|
updated_dependency: dep_name,
|
|
65
69
|
current_version,
|
|
66
70
|
new_version,
|
|
67
|
-
type: 'peerDependencies'
|
|
71
|
+
type: 'peerDependencies'
|
|
68
72
|
});
|
|
69
73
|
|
|
70
74
|
if (breaking_packages.has(dep_name)) {
|
|
@@ -88,14 +92,14 @@ export const calculate_dependency_updates = (
|
|
|
88
92
|
updated_dependency: dep_name,
|
|
89
93
|
current_version,
|
|
90
94
|
new_version,
|
|
91
|
-
type: 'devDependencies'
|
|
95
|
+
type: 'devDependencies'
|
|
92
96
|
});
|
|
93
97
|
}
|
|
94
98
|
}
|
|
95
99
|
}
|
|
96
100
|
}
|
|
97
101
|
|
|
98
|
-
return {dependency_updates, breaking_cascades};
|
|
102
|
+
return { dependency_updates, breaking_cascades };
|
|
99
103
|
};
|
|
100
104
|
|
|
101
105
|
/**
|
|
@@ -109,13 +113,13 @@ export const calculate_dependency_updates = (
|
|
|
109
113
|
export const get_required_bump_for_dependencies = (
|
|
110
114
|
repo: LocalRepo,
|
|
111
115
|
dependency_updates: Array<DependencyUpdate>,
|
|
112
|
-
breaking_packages: Set<string
|
|
116
|
+
breaking_packages: Set<string>
|
|
113
117
|
): BumpType | null => {
|
|
114
118
|
// Check if this repo has any prod/peer dependency updates
|
|
115
119
|
const relevant_updates = dependency_updates.filter(
|
|
116
120
|
(update) =>
|
|
117
121
|
update.dependent_package === repo.library.name &&
|
|
118
|
-
(update.type === 'dependencies' || update.type === 'peerDependencies')
|
|
122
|
+
(update.type === 'dependencies' || update.type === 'peerDependencies')
|
|
119
123
|
);
|
|
120
124
|
|
|
121
125
|
if (relevant_updates.length === 0) {
|
|
@@ -124,11 +128,11 @@ export const get_required_bump_for_dependencies = (
|
|
|
124
128
|
|
|
125
129
|
// Check if any of these dependencies have breaking changes
|
|
126
130
|
const has_breaking_deps = relevant_updates.some((update) =>
|
|
127
|
-
breaking_packages.has(update.updated_dependency)
|
|
131
|
+
breaking_packages.has(update.updated_dependency)
|
|
128
132
|
);
|
|
129
133
|
|
|
130
134
|
return required_bump_for_dependency_update(
|
|
131
135
|
repo.package_json.version || '0.0.0',
|
|
132
|
-
has_breaking_deps
|
|
136
|
+
has_breaking_deps
|
|
133
137
|
);
|
|
134
138
|
};
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type {Logger} from '@fuzdev/fuz_util/log.
|
|
10
|
-
import {styleText as st} from 'node:util';
|
|
9
|
+
import type { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
10
|
+
import { styleText as st } from 'node:util';
|
|
11
11
|
|
|
12
12
|
import type {
|
|
13
13
|
PublishingPlan,
|
|
@@ -17,8 +17,8 @@ import type {
|
|
|
17
17
|
VerboseChangesetDetail,
|
|
18
18
|
VerboseIteration,
|
|
19
19
|
VerbosePropagationChain,
|
|
20
|
-
VerboseGraphSummary
|
|
21
|
-
} from './publishing_plan.
|
|
20
|
+
VerboseGraphSummary
|
|
21
|
+
} from './publishing_plan.ts';
|
|
22
22
|
|
|
23
23
|
export interface LogPlanOptions {
|
|
24
24
|
verbose?: boolean;
|
|
@@ -42,7 +42,7 @@ const log_section_header = (title: string, log: Logger): void => {
|
|
|
42
42
|
const format_dep_diff = (dep_name: string, current: string, next: string): Array<string> => {
|
|
43
43
|
return [
|
|
44
44
|
st('red', ` - "${dep_name}": "${current}"`),
|
|
45
|
-
st('green', ` + "${dep_name}": "${next}"`)
|
|
45
|
+
st('green', ` + "${dep_name}": "${next}"`)
|
|
46
46
|
];
|
|
47
47
|
};
|
|
48
48
|
|
|
@@ -51,7 +51,7 @@ const format_dep_diff = (dep_name: string, current: string, next: string): Array
|
|
|
51
51
|
*/
|
|
52
52
|
const get_updates_for_package = (
|
|
53
53
|
pkg_name: string,
|
|
54
|
-
dependency_updates: Array<DependencyUpdate
|
|
54
|
+
dependency_updates: Array<DependencyUpdate>
|
|
55
55
|
): Map<string, Array<DependencyUpdate>> => {
|
|
56
56
|
const updates: Map<string, Array<DependencyUpdate>> = new Map();
|
|
57
57
|
for (const update of dependency_updates) {
|
|
@@ -73,7 +73,7 @@ const log_version_change_with_diffs = (
|
|
|
73
73
|
total: number,
|
|
74
74
|
dependency_updates: Array<DependencyUpdate>,
|
|
75
75
|
breaking_cascades: Map<string, Array<string>>,
|
|
76
|
-
log: Logger
|
|
76
|
+
log: Logger
|
|
77
77
|
): void => {
|
|
78
78
|
const breaking_indicator = change.breaking ? st('red', ' BREAKING') : '';
|
|
79
79
|
const position = st('dim', `[${index + 1}/${total}]`);
|
|
@@ -89,7 +89,7 @@ const log_version_change_with_diffs = (
|
|
|
89
89
|
// Main version line
|
|
90
90
|
log.info(
|
|
91
91
|
`${position} ${change.package_name}: ${change.from} → ${st('green', change.to)} ` +
|
|
92
|
-
`(${change.bump_type})${scenario_label}${breaking_indicator}
|
|
92
|
+
`(${change.bump_type})${scenario_label}${breaking_indicator}`
|
|
93
93
|
);
|
|
94
94
|
|
|
95
95
|
// Show escalation reason
|
|
@@ -97,8 +97,8 @@ const log_version_change_with_diffs = (
|
|
|
97
97
|
log.info(
|
|
98
98
|
st(
|
|
99
99
|
'dim',
|
|
100
|
-
` changesets specify ${change.existing_bump}, dependencies require ${change.required_bump}
|
|
101
|
-
)
|
|
100
|
+
` changesets specify ${change.existing_bump}, dependencies require ${change.required_bump}`
|
|
101
|
+
)
|
|
102
102
|
);
|
|
103
103
|
}
|
|
104
104
|
|
|
@@ -138,7 +138,7 @@ const log_version_change_with_diffs = (
|
|
|
138
138
|
export const log_publishing_plan = (
|
|
139
139
|
plan: PublishingPlan,
|
|
140
140
|
log: Logger,
|
|
141
|
-
options: LogPlanOptions = {}
|
|
141
|
+
options: LogPlanOptions = {}
|
|
142
142
|
): void => {
|
|
143
143
|
const {
|
|
144
144
|
publishing_order,
|
|
@@ -147,7 +147,7 @@ export const log_publishing_plan = (
|
|
|
147
147
|
breaking_cascades,
|
|
148
148
|
warnings,
|
|
149
149
|
info,
|
|
150
|
-
errors
|
|
150
|
+
errors
|
|
151
151
|
} = plan;
|
|
152
152
|
|
|
153
153
|
// Errors first (blocking issues)
|
|
@@ -177,7 +177,7 @@ export const log_publishing_plan = (
|
|
|
177
177
|
|
|
178
178
|
// Separate into groups for headers
|
|
179
179
|
const with_changesets = ordered_changes.filter(
|
|
180
|
-
(vc) => vc.has_changesets && !vc.needs_bump_escalation
|
|
180
|
+
(vc) => vc.has_changesets && !vc.needs_bump_escalation
|
|
181
181
|
);
|
|
182
182
|
const with_escalation = ordered_changes.filter((vc) => vc.needs_bump_escalation);
|
|
183
183
|
const with_auto_changesets = ordered_changes.filter((vc) => vc.will_generate_changeset);
|
|
@@ -190,7 +190,7 @@ export const log_publishing_plan = (
|
|
|
190
190
|
const log_change_group = (
|
|
191
191
|
title: string,
|
|
192
192
|
color: 'cyan' | 'yellow',
|
|
193
|
-
changes: Array<VersionChange
|
|
193
|
+
changes: Array<VersionChange>
|
|
194
194
|
): void => {
|
|
195
195
|
if (changes.length === 0) return;
|
|
196
196
|
log.info(st(color, title));
|
|
@@ -201,7 +201,7 @@ export const log_publishing_plan = (
|
|
|
201
201
|
total,
|
|
202
202
|
dependency_updates,
|
|
203
203
|
breaking_cascades,
|
|
204
|
-
log
|
|
204
|
+
log
|
|
205
205
|
);
|
|
206
206
|
}
|
|
207
207
|
log.info('');
|
|
@@ -219,7 +219,7 @@ export const log_publishing_plan = (
|
|
|
219
219
|
const dep_only_packages: Set<string> = new Set();
|
|
220
220
|
for (const update of dependency_updates) {
|
|
221
221
|
const has_version_change = version_changes.some(
|
|
222
|
-
(vc) => vc.package_name === update.dependent_package
|
|
222
|
+
(vc) => vc.package_name === update.dependent_package
|
|
223
223
|
);
|
|
224
224
|
if (!has_version_change) {
|
|
225
225
|
dep_only_packages.add(update.dependent_package);
|
|
@@ -303,7 +303,7 @@ const log_verbose = (data: VerboseData, log: Logger): void => {
|
|
|
303
303
|
*/
|
|
304
304
|
const log_verbose_changeset_details = (
|
|
305
305
|
details: Array<VerboseChangesetDetail>,
|
|
306
|
-
log: Logger
|
|
306
|
+
log: Logger
|
|
307
307
|
): void => {
|
|
308
308
|
if (details.length === 0) return;
|
|
309
309
|
|
|
@@ -325,7 +325,7 @@ const log_verbose_changeset_details = (
|
|
|
325
325
|
const log_verbose_iteration_details = (
|
|
326
326
|
iterations: Array<VerboseIteration>,
|
|
327
327
|
total: number,
|
|
328
|
-
log: Logger
|
|
328
|
+
log: Logger
|
|
329
329
|
): void => {
|
|
330
330
|
if (iterations.length === 0) return;
|
|
331
331
|
|
|
@@ -389,7 +389,7 @@ const log_verbose_iteration_details = (
|
|
|
389
389
|
*/
|
|
390
390
|
const log_verbose_propagation_chains = (
|
|
391
391
|
chains: Array<VerbosePropagationChain>,
|
|
392
|
-
log: Logger
|
|
392
|
+
log: Logger
|
|
393
393
|
): void => {
|
|
394
394
|
if (chains.length === 0) return;
|
|
395
395
|
|
|
@@ -403,7 +403,7 @@ const log_verbose_propagation_chains = (
|
|
|
403
403
|
const indent = ' '.repeat(i);
|
|
404
404
|
const connector = '└─';
|
|
405
405
|
log.info(
|
|
406
|
-
st('dim', `${indent}${connector} ${item.pkg} (${item.dep_type} dep) → ${item.action}`)
|
|
406
|
+
st('dim', `${indent}${connector} ${item.pkg} (${item.dep_type} dep) → ${item.action}`)
|
|
407
407
|
);
|
|
408
408
|
}
|
|
409
409
|
}
|
|
@@ -419,8 +419,8 @@ const log_verbose_graph_summary = (summary: VerboseGraphSummary, log: Logger): v
|
|
|
419
419
|
log.info(
|
|
420
420
|
st(
|
|
421
421
|
'dim',
|
|
422
|
-
`${summary.package_count} packages, ${summary.internal_dep_count} internal dependencies
|
|
423
|
-
)
|
|
422
|
+
`${summary.package_count} packages, ${summary.internal_dep_count} internal dependencies`
|
|
423
|
+
)
|
|
424
424
|
);
|
|
425
425
|
log.info('');
|
|
426
426
|
|
|
@@ -446,7 +446,7 @@ const log_verbose_graph_summary = (summary: VerboseGraphSummary, log: Logger): v
|
|
|
446
446
|
|
|
447
447
|
log.info('');
|
|
448
448
|
log.info(
|
|
449
|
-
st('dim', `Cycles: ${summary.prod_cycle_count} production, ${summary.dev_cycle_count} dev`)
|
|
449
|
+
st('dim', `Cycles: ${summary.prod_cycle_count} production, ${summary.dev_cycle_count} dev`)
|
|
450
450
|
);
|
|
451
451
|
log.info('');
|
|
452
452
|
};
|
package/src/lib/repo.svelte.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {create_context} from '@fuzdev/fuz_ui/context_helpers.
|
|
2
|
-
import type {LibraryJson, SourceJson} from '@fuzdev/fuz_util/library_json.
|
|
3
|
-
import type {PkgJson} from '@fuzdev/fuz_util/pkg_json.
|
|
4
|
-
import type {PackageJson} from '@fuzdev/fuz_util/package_json.
|
|
5
|
-
import type {Url} from '@fuzdev/fuz_util/url.
|
|
6
|
-
import {Library} from '@fuzdev/fuz_ui/library.svelte.
|
|
1
|
+
import { create_context } from '@fuzdev/fuz_ui/context_helpers.ts';
|
|
2
|
+
import type { LibraryJson, SourceJson } from '@fuzdev/fuz_util/library_json.ts';
|
|
3
|
+
import type { PkgJson } from '@fuzdev/fuz_util/pkg_json.ts';
|
|
4
|
+
import type { PackageJson } from '@fuzdev/fuz_util/package_json.ts';
|
|
5
|
+
import type { Url } from '@fuzdev/fuz_util/url.ts';
|
|
6
|
+
import { Library } from '@fuzdev/fuz_ui/library.svelte.ts';
|
|
7
7
|
|
|
8
|
-
import {GithubCheckRunsItem, type GithubPullRequest} from './github.
|
|
8
|
+
import { GithubCheckRunsItem, type GithubPullRequest } from './github.ts';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Serialized repo data as stored in `repos.ts` (JSON).
|
|
@@ -87,5 +87,5 @@ export const repos_parse = (repos: Array<Repo>, homepage_url: string): Repos =>
|
|
|
87
87
|
const repo = repos.find((d) => d.homepage_url === homepage_url);
|
|
88
88
|
if (!repo) throw Error(`Cannot find repo with homepage_url: ${homepage_url}`);
|
|
89
89
|
|
|
90
|
-
return {repo, repos};
|
|
90
|
+
return { repo, repos };
|
|
91
91
|
};
|
package/src/lib/repo_ops.ts
CHANGED
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
* @module
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import {existsSync} from 'node:fs';
|
|
15
|
-
import {readdir, stat} from 'node:fs/promises';
|
|
16
|
-
import {join, resolve, dirname} from 'node:path';
|
|
14
|
+
import { existsSync } from 'node:fs';
|
|
15
|
+
import { readdir, stat } from 'node:fs/promises';
|
|
16
|
+
import { join, resolve, dirname } from 'node:path';
|
|
17
17
|
|
|
18
|
-
import {load_gitops_config} from './gitops_config.
|
|
19
|
-
import {DEFAULT_REPOS_DIR} from './paths.
|
|
20
|
-
import {GITOPS_CONFIG_PATH_DEFAULT} from './gitops_constants.
|
|
18
|
+
import { load_gitops_config } from './gitops_config.ts';
|
|
19
|
+
import { DEFAULT_REPOS_DIR } from './paths.ts';
|
|
20
|
+
import { GITOPS_CONFIG_PATH_DEFAULT } from './gitops_constants.ts';
|
|
21
21
|
|
|
22
22
|
/** Default directories to exclude from file walking */
|
|
23
23
|
export const DEFAULT_EXCLUDE_DIRS = [
|
|
@@ -32,7 +32,7 @@ export const DEFAULT_EXCLUDE_DIRS = [
|
|
|
32
32
|
'build',
|
|
33
33
|
'coverage',
|
|
34
34
|
'.cache',
|
|
35
|
-
'.turbo'
|
|
35
|
+
'.turbo'
|
|
36
36
|
] as const;
|
|
37
37
|
|
|
38
38
|
/** Default binary/non-text extensions to exclude from content processing */
|
|
@@ -57,7 +57,7 @@ export const DEFAULT_EXCLUDE_EXTENSIONS = [
|
|
|
57
57
|
'.tar',
|
|
58
58
|
'.gz',
|
|
59
59
|
'.lock',
|
|
60
|
-
'.pdf'
|
|
60
|
+
'.pdf'
|
|
61
61
|
] as const;
|
|
62
62
|
|
|
63
63
|
export interface WalkOptions {
|
|
@@ -109,7 +109,7 @@ export const get_repo_paths = async (config_path?: string): Promise<Array<RepoPa
|
|
|
109
109
|
: join(repos_dir, name);
|
|
110
110
|
|
|
111
111
|
if (existsSync(path)) {
|
|
112
|
-
repos.push({name, path, url});
|
|
112
|
+
repos.push({ name, path, url });
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
@@ -157,7 +157,7 @@ export const should_exclude_path = (file_path: string, options?: WalkOptions): b
|
|
|
157
157
|
*/
|
|
158
158
|
export async function* walk_repo_files(
|
|
159
159
|
dir: string,
|
|
160
|
-
options?: WalkOptions
|
|
160
|
+
options?: WalkOptions
|
|
161
161
|
): AsyncGenerator<string, void, undefined> {
|
|
162
162
|
const max_file_size = options?.max_file_size ?? 10 * 1024 * 1024;
|
|
163
163
|
const include_dirs = options?.include_dirs ?? false;
|
|
@@ -165,7 +165,7 @@ export async function* walk_repo_files(
|
|
|
165
165
|
async function* walk(current_dir: string): AsyncGenerator<string, void, undefined> {
|
|
166
166
|
let entries;
|
|
167
167
|
try {
|
|
168
|
-
entries = await readdir(current_dir, {withFileTypes: true});
|
|
168
|
+
entries = await readdir(current_dir, { withFileTypes: true });
|
|
169
169
|
} catch {
|
|
170
170
|
// Skip directories we can't read
|
|
171
171
|
return;
|
|
@@ -206,7 +206,7 @@ export async function* walk_repo_files(
|
|
|
206
206
|
*/
|
|
207
207
|
export const collect_repo_files = async (
|
|
208
208
|
dir: string,
|
|
209
|
-
options?: WalkOptions
|
|
209
|
+
options?: WalkOptions
|
|
210
210
|
): Promise<Array<string>> => {
|
|
211
211
|
const files: Array<string> = [];
|
|
212
212
|
for await (const file of walk_repo_files(dir, options)) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {GitopsConfig} from './gitops_config.
|
|
2
|
-
import {local_repo_locate, type LocalRepoPath, type LocalRepoMissing} from './local_repo.
|
|
1
|
+
import type { GitopsConfig } from './gitops_config.ts';
|
|
2
|
+
import { local_repo_locate, type LocalRepoPath, type LocalRepoMissing } from './local_repo.ts';
|
|
3
3
|
|
|
4
4
|
export interface ResolvedGitopsConfig {
|
|
5
5
|
local_repos: Array<LocalRepoPath | LocalRepoMissing> | null;
|
|
@@ -9,10 +9,10 @@ export interface ResolvedGitopsConfig {
|
|
|
9
9
|
|
|
10
10
|
export const resolve_gitops_config = (
|
|
11
11
|
gitops_config: GitopsConfig,
|
|
12
|
-
repos_dir: string
|
|
12
|
+
repos_dir: string
|
|
13
13
|
): ResolvedGitopsConfig => {
|
|
14
14
|
const local_repos = gitops_config.repos.map((r) =>
|
|
15
|
-
local_repo_locate({repo_config: r, repos_dir})
|
|
15
|
+
local_repo_locate({ repo_config: r, repos_dir })
|
|
16
16
|
);
|
|
17
17
|
|
|
18
18
|
const local_repo_paths = local_repos.filter((r) => r.type === 'local_repo_path');
|
|
@@ -21,7 +21,7 @@ export const resolve_gitops_config = (
|
|
|
21
21
|
const config: ResolvedGitopsConfig = {
|
|
22
22
|
local_repos: local_repos.length ? local_repos : null,
|
|
23
23
|
local_repo_paths: local_repo_paths.length ? local_repo_paths : null,
|
|
24
|
-
local_repos_missing: local_repos_missing.length ? local_repos_missing : null
|
|
24
|
+
local_repos_missing: local_repos_missing.length ? local_repos_missing : null
|
|
25
25
|
};
|
|
26
26
|
return config;
|
|
27
27
|
};
|
package/src/lib/version_utils.ts
CHANGED
|
@@ -79,7 +79,7 @@ export const needs_update = (current: string, new_version: string): boolean => {
|
|
|
79
79
|
*/
|
|
80
80
|
export const get_update_prefix = (
|
|
81
81
|
current_version: string,
|
|
82
|
-
default_strategy: '^' | '~' | '' | '>=' = '^'
|
|
82
|
+
default_strategy: '^' | '~' | '' | '>=' = '^'
|
|
83
83
|
): string => {
|
|
84
84
|
// Use caret for wildcard replacements
|
|
85
85
|
if (is_wildcard(current_version)) {
|
|
@@ -128,7 +128,7 @@ export const is_breaking_change = (old_version: string, bump_type: BumpType): bo
|
|
|
128
128
|
*/
|
|
129
129
|
export const required_bump_for_dependency_update = (
|
|
130
130
|
current_version: string,
|
|
131
|
-
has_breaking_deps: boolean
|
|
131
|
+
has_breaking_deps: boolean
|
|
132
132
|
): BumpType => {
|
|
133
133
|
const [major] = current_version.split('.').map(Number);
|
|
134
134
|
const is_pre_1_0 = major === 0;
|
|
@@ -156,7 +156,7 @@ export const compare_bump_types = (a: BumpType, b: BumpType): number => {
|
|
|
156
156
|
const order: Record<BumpType, number> = {
|
|
157
157
|
major: 3,
|
|
158
158
|
minor: 2,
|
|
159
|
-
patch: 1
|
|
159
|
+
patch: 1
|
|
160
160
|
};
|
|
161
161
|
return order[a] - order[b];
|
|
162
162
|
};
|