@fuzdev/fuz_gitops 0.78.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 +20 -0
- 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.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/changeset_generator.d.ts.map +1 -1
- package/dist/changeset_generator.js +2 -2
- 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.map +1 -1
- package/dist/dependency_graph.js +5 -5
- package/dist/dependency_updater.d.ts.map +1 -1
- package/dist/dependency_updater.js +8 -8
- package/dist/fetch_repo_data.d.ts.map +1 -1
- package/dist/fetch_repo_data.js +3 -3
- package/dist/fs_fetch_value_cache.d.ts.map +1 -1
- package/dist/fs_fetch_value_cache.js +2 -2
- package/dist/git_operations.d.ts.map +1 -1
- package/dist/git_operations.js +1 -1
- package/dist/github.d.ts.map +1 -1
- package/dist/github.js +6 -6
- package/dist/github_helpers.d.ts.map +1 -1
- package/dist/gitops_analyze.task.d.ts.map +1 -1
- package/dist/gitops_analyze.task.js +7 -7
- package/dist/gitops_config.d.ts.map +1 -1
- package/dist/gitops_config.js +4 -4
- 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 +8 -8
- package/dist/gitops_sync.task.d.ts.map +1 -1
- package/dist/gitops_sync.task.js +11 -9
- package/dist/gitops_task_helpers.d.ts.map +1 -1
- package/dist/gitops_task_helpers.js +3 -3
- package/dist/gitops_validate.task.d.ts.map +1 -1
- package/dist/gitops_validate.task.js +14 -14
- package/dist/graph_validation.d.ts.map +1 -1
- package/dist/graph_validation.js +2 -2
- package/dist/local_repo.d.ts +4 -4
- package/dist/local_repo.d.ts.map +1 -1
- package/dist/local_repo.js +13 -13
- package/dist/log_helpers.d.ts.map +1 -1
- package/dist/multi_repo_publisher.d.ts.map +1 -1
- package/dist/multi_repo_publisher.js +19 -19
- package/dist/npm_registry.d.ts.map +1 -1
- package/dist/npm_registry.js +2 -2
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations_defaults.d.ts.map +1 -1
- package/dist/operations_defaults.js +12 -12
- package/dist/output_helpers.d.ts.map +1 -1
- package/dist/preflight_checks.d.ts +1 -1
- package/dist/preflight_checks.d.ts.map +1 -1
- package/dist/preflight_checks.js +4 -4
- package/dist/publish_gate.d.ts.map +1 -1
- package/dist/publish_steps.d.ts.map +1 -1
- package/dist/publish_steps.js +3 -3
- 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.map +1 -1
- package/dist/publishing_plan.js +14 -14
- 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.map +1 -1
- package/dist/publishing_plan_logging.js +2 -2
- package/dist/repo.svelte.d.ts.map +1 -1
- 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 +3 -3
- package/src/lib/changeset_generator.ts +19 -19
- 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 +26 -26
- package/src/lib/dependency_updater.ts +29 -29
- 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 +30 -30
- package/src/lib/github.ts +19 -19
- package/src/lib/github_helpers.ts +6 -6
- package/src/lib/gitops_analyze.task.ts +40 -40
- package/src/lib/gitops_config.ts +14 -14
- package/src/lib/gitops_plan.task.ts +31 -31
- package/src/lib/gitops_publish.task.ts +51 -48
- 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 +37 -37
- package/src/lib/graph_validation.ts +13 -13
- package/src/lib/local_repo.ts +70 -70
- package/src/lib/log_helpers.ts +15 -15
- package/src/lib/multi_repo_publisher.ts +67 -70
- package/src/lib/npm_registry.ts +13 -13
- package/src/lib/operations.ts +49 -38
- package/src/lib/operations_defaults.ts +106 -104
- package/src/lib/output_helpers.ts +4 -4
- package/src/lib/preflight_checks.ts +26 -26
- 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 +55 -55
- package/src/lib/publishing_plan_helpers.ts +16 -12
- package/src/lib/publishing_plan_logging.ts +22 -22
- 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/config_reconcile.js
CHANGED
|
@@ -37,7 +37,11 @@ export const reconcile_configs = (canonical, subsets) => {
|
|
|
37
37
|
for (const repo of subset.repos) {
|
|
38
38
|
const canon = canonical_by_url.get(repo.repo_url);
|
|
39
39
|
if (!canon) {
|
|
40
|
-
drift.push({
|
|
40
|
+
drift.push({
|
|
41
|
+
repo_url: repo.repo_url,
|
|
42
|
+
config: subset.name,
|
|
43
|
+
kind: 'missing_from_canonical'
|
|
44
|
+
});
|
|
41
45
|
continue;
|
|
42
46
|
}
|
|
43
47
|
for (const field of INTRINSIC_FIELDS) {
|
|
@@ -50,7 +54,7 @@ export const reconcile_configs = (canonical, subsets) => {
|
|
|
50
54
|
kind: 'field_mismatch',
|
|
51
55
|
field,
|
|
52
56
|
canonical_value,
|
|
53
|
-
config_value
|
|
57
|
+
config_value
|
|
54
58
|
});
|
|
55
59
|
}
|
|
56
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency_graph.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/dependency_graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"dependency_graph.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/dependency_graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,eAAO,MAAM,eAAe;;;;CAIlB,CAAC;AAEX,MAAM,M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AM,GAAG,GAAG,CAAC,MAAM,CAAC;IAIzC,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC;IAK3D;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,WAAW,UAAQ,GAAG,KAAK,CAAC,MAAM,CAAC;IAiBpD;;;;;;;;;;OAUG;IACH,qBAAqB,IAAI;QACxB,iBAAiB,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QACxC,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;KACjC;IAkDD,MAAM,IAAI,mBAAmB;CAqB7B;AAED;;GAEG;AACH,qBAAa,sBAAsB;IAClC;;;;;;;;OAQG;IACH,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,eAAe;IAM1D;;;;;;;;;OASG;IACH,wBAAwB,CAAC,KAAK,EAAE,eAAe,GAAG,KAAK,CAAC,MAAM,CAAC;IAI/D,OAAO,CAAC,KAAK,EAAE,eAAe,GAAG;QAChC,iBAAiB,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QACxC,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QACjC,aAAa,EAAE,KAAK,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACpE,aAAa,EAAE,KAAK,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACnD;CAmBD"}
|
package/dist/dependency_graph.js
CHANGED
|
@@ -12,7 +12,7 @@ import { topological_sort as topological_sort_generic } from '@fuzdev/fuz_util/s
|
|
|
12
12
|
export const DEPENDENCY_TYPE = {
|
|
13
13
|
PROD: 'prod',
|
|
14
14
|
PEER: 'peer',
|
|
15
|
-
DEV: 'dev'
|
|
15
|
+
DEV: 'dev'
|
|
16
16
|
};
|
|
17
17
|
export class DependencyGraph {
|
|
18
18
|
nodes;
|
|
@@ -31,7 +31,7 @@ export class DependencyGraph {
|
|
|
31
31
|
repo,
|
|
32
32
|
dependencies: new Map(),
|
|
33
33
|
dependents: new Set(),
|
|
34
|
-
publishable: !package_json.private
|
|
34
|
+
publishable: !package_json.private
|
|
35
35
|
};
|
|
36
36
|
// Extract dependencies
|
|
37
37
|
const deps = package_json.dependencies || EMPTY_OBJECT;
|
|
@@ -96,7 +96,7 @@ export class DependencyGraph {
|
|
|
96
96
|
return false;
|
|
97
97
|
return this.nodes.has(dep_name);
|
|
98
98
|
})
|
|
99
|
-
.map(([dep_name]) => dep_name)
|
|
99
|
+
.map(([dep_name]) => dep_name)
|
|
100
100
|
}));
|
|
101
101
|
const result = topological_sort_generic(items, 'package');
|
|
102
102
|
if (!result.ok) {
|
|
@@ -165,10 +165,10 @@ export class DependencyGraph {
|
|
|
165
165
|
version: node.version,
|
|
166
166
|
dependencies: Array.from(node.dependencies.entries()).map(([name, spec]) => ({
|
|
167
167
|
name,
|
|
168
|
-
spec
|
|
168
|
+
spec
|
|
169
169
|
})),
|
|
170
170
|
dependents: Array.from(node.dependents),
|
|
171
|
-
publishable: node.publishable
|
|
171
|
+
publishable: node.publishable
|
|
172
172
|
}));
|
|
173
173
|
const edges = [];
|
|
174
174
|
for (const [from, tos] of this.edges) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency_updater.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/dependency_updater.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"dependency_updater.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/dependency_updater.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,KAAK,EAA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E,MAAM,CAAC,KAC5B,GAAG,CACL,MAAM,EACN;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,cAAc,GAAG,iBAAiB,GAAG,kBAAkB,CAAA;CAAE,CAkD/F,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
|
-
import { create_changeset_for_dependency_updates, create_dependency_updates
|
|
2
|
+
import { create_changeset_for_dependency_updates, create_dependency_updates } from './changeset_generator.js';
|
|
3
3
|
import { needs_update, get_update_prefix } from './version_utils.js';
|
|
4
4
|
import { default_git_operations, default_fs_operations } from './operations_defaults.js';
|
|
5
5
|
/**
|
|
@@ -17,7 +17,7 @@ import { default_git_operations, default_fs_operations } from './operations_defa
|
|
|
17
17
|
* @throws {Error} if file operations or git operations fail
|
|
18
18
|
*/
|
|
19
19
|
export const update_package_json = async (repo, updates, options = {}) => {
|
|
20
|
-
const { strategy = 'caret', published_versions, log, git_ops = default_git_operations, fs_ops = default_fs_operations
|
|
20
|
+
const { strategy = 'caret', published_versions, log, git_ops = default_git_operations, fs_ops = default_fs_operations } = options;
|
|
21
21
|
if (updates.size === 0)
|
|
22
22
|
return;
|
|
23
23
|
const package_json_path = join(repo.repo_dir, 'package.json');
|
|
@@ -68,7 +68,7 @@ export const update_package_json = async (repo, updates, options = {}) => {
|
|
|
68
68
|
// Write updated package.json
|
|
69
69
|
const write_result = await fs_ops.writeFile({
|
|
70
70
|
path: package_json_path,
|
|
71
|
-
content: JSON.stringify(package_json, null, '\t') + '\n'
|
|
71
|
+
content: JSON.stringify(package_json, null, '\t') + '\n'
|
|
72
72
|
});
|
|
73
73
|
if (!write_result.ok) {
|
|
74
74
|
throw new Error(`Failed to write package.json: ${write_result.message}`);
|
|
@@ -116,14 +116,14 @@ export const update_package_json = async (repo, updates, options = {}) => {
|
|
|
116
116
|
}
|
|
117
117
|
const commit_result = await git_ops.commit({
|
|
118
118
|
message: `update dependencies after publishing`,
|
|
119
|
-
cwd: repo.repo_dir
|
|
119
|
+
cwd: repo.repo_dir
|
|
120
120
|
});
|
|
121
121
|
if (!commit_result.ok) {
|
|
122
122
|
throw new Error(`Failed to commit: ${commit_result.message}`);
|
|
123
123
|
}
|
|
124
124
|
};
|
|
125
125
|
export const update_all_repos = async (repos, published, options = {}) => {
|
|
126
|
-
const { strategy = 'caret', log, git_ops = default_git_operations, fs_ops = default_fs_operations
|
|
126
|
+
const { strategy = 'caret', log, git_ops = default_git_operations, fs_ops = default_fs_operations } = options;
|
|
127
127
|
let updated_count = 0;
|
|
128
128
|
const failed = [];
|
|
129
129
|
for (const repo of repos) {
|
|
@@ -178,7 +178,7 @@ export const find_updates_needed = (repo, published) => {
|
|
|
178
178
|
updates.set(dep_name, {
|
|
179
179
|
current: current_version,
|
|
180
180
|
new: new_version,
|
|
181
|
-
type: 'dependencies'
|
|
181
|
+
type: 'dependencies'
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
184
|
}
|
|
@@ -191,7 +191,7 @@ export const find_updates_needed = (repo, published) => {
|
|
|
191
191
|
updates.set(dep_name, {
|
|
192
192
|
current: current_version,
|
|
193
193
|
new: new_version,
|
|
194
|
-
type: 'devDependencies'
|
|
194
|
+
type: 'devDependencies'
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
197
|
}
|
|
@@ -204,7 +204,7 @@ export const find_updates_needed = (repo, published) => {
|
|
|
204
204
|
updates.set(dep_name, {
|
|
205
205
|
current: current_version,
|
|
206
206
|
new: new_version,
|
|
207
|
-
type: 'peerDependencies'
|
|
207
|
+
type: 'peerDependencies'
|
|
208
208
|
});
|
|
209
209
|
}
|
|
210
210
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch_repo_data.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/fetch_repo_data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"fetch_repo_data.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/fetch_repo_data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAGjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,GAC3B,gBAAgB,KAAK,CAAC,SAAS,CAAC,EAChC,QAAQ,MAAM,EACd,QAAQ,eAAe,EACvB,MAAM,MAAM,EACZ,cAAU,EACV,qBAAqB,MAAM,KACzB,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAkCzB,CAAC"}
|
package/dist/fetch_repo_data.js
CHANGED
|
@@ -24,7 +24,7 @@ export const fetch_repo_data = async (resolved_repos, token, cache, log, delay =
|
|
|
24
24
|
log,
|
|
25
25
|
token,
|
|
26
26
|
api_version: github_api_version,
|
|
27
|
-
ref: repo_config.branch
|
|
27
|
+
ref: repo_config.branch
|
|
28
28
|
});
|
|
29
29
|
if (!check_runs)
|
|
30
30
|
log?.error('failed to fetch CI status: ' + repo_url);
|
|
@@ -34,7 +34,7 @@ export const fetch_repo_data = async (resolved_repos, token, cache, log, delay =
|
|
|
34
34
|
cache,
|
|
35
35
|
log,
|
|
36
36
|
token,
|
|
37
|
-
api_version: github_api_version
|
|
37
|
+
api_version: github_api_version
|
|
38
38
|
});
|
|
39
39
|
if (!pull_requests)
|
|
40
40
|
log?.error('failed to fetch issues: ' + repo_url);
|
|
@@ -42,7 +42,7 @@ export const fetch_repo_data = async (resolved_repos, token, cache, log, delay =
|
|
|
42
42
|
library_json: library.library_json,
|
|
43
43
|
package_json,
|
|
44
44
|
check_runs,
|
|
45
|
-
pull_requests
|
|
45
|
+
pull_requests
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
return repos;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs_fetch_value_cache.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/fs_fetch_value_cache.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"fs_fetch_value_cache.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/fs_fetch_value_cache.ts"],"names":[],"mappings":"AAIA,OAAO,EAGN,KAAK,eAAe,EACpB,MAAM,2BAA2B,CAAC;AAKnC,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,eAAe,CAAC;IACtB;;OAEG;IACH,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7B;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,2BAA2B,GACvC,MAAM,MAAM,EACZ,YAAgC,KAC9B,OAAO,CAAC,UAAU,CA2BpB,CAAC"}
|
|
@@ -42,9 +42,9 @@ export const create_fs_fetch_value_cache = async (name, dir = join(paths.build,
|
|
|
42
42
|
return false; // no changes to save
|
|
43
43
|
}
|
|
44
44
|
await mkdir(dirname(data_path), { recursive: true });
|
|
45
|
-
await writeFile(data_path,
|
|
45
|
+
await writeFile(data_path, format_file(serialize_cache(data), { lang: 'json' }));
|
|
46
46
|
return true;
|
|
47
|
-
}
|
|
47
|
+
}
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
50
|
// TODO this is quick and dirty, but fine because it's only expected to be called during development
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git_operations.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/git_operations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"git_operations.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/git_operations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,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G,OAAO,CAAC,IAAI,CAOxE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC7B,QAAQ,SAAS,EACjB,OAAM,OAAc,EACpB,UAAU,YAAY,KACpB,OAAO,CAAC,IAAI,CAoBd,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gCAAgC,GAAU,UAAU,YAAY,KAAG,OAAO,CAAC,MAAM,CAM7F,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gCAAgC,GAC5C,SAAS,MAAM,EACf,UAAU,YAAY,KACpB,OAAO,CAAC,MAAM,CAMhB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oCAAoC,GAChD,UAAU,YAAY,KACpB,OAAO,CAAC,OAAO,CAGjB,CAAC;AAEF,eAAO,MAAM,cAAc,GAC1B,SAAQ,MAAiB,EACzB,UAAU,YAAY,KACpB,OAAO,CAAC,OAAO,CAQjB,CAAC"}
|
package/dist/git_operations.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spawn_out, spawn_result_to_message } from '@fuzdev/fuz_util/process.ts';
|
|
2
|
-
import { git_check_clean_workspace as gro_git_check_clean_workspace, git_checkout as gro_git_checkout, git_pull as gro_git_pull, git_current_branch_name as gro_git_current_branch_name, git_current_commit_hash as gro_git_current_commit_hash
|
|
2
|
+
import { git_check_clean_workspace as gro_git_check_clean_workspace, git_checkout as gro_git_checkout, git_pull as gro_git_pull, git_current_branch_name as gro_git_current_branch_name, git_current_commit_hash as gro_git_current_commit_hash } from '@fuzdev/fuz_util/git.ts';
|
|
3
3
|
/**
|
|
4
4
|
* Adds files to git staging area and throws if anything goes wrong.
|
|
5
5
|
*/
|
package/dist/github.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/github.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"github.d.ts","sourceRoot":"../src/lib/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AE,eAAe,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;CACR,KACJ,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAoBpC,CAAC"}
|
package/dist/github.js
CHANGED
|
@@ -7,9 +7,9 @@ export const GithubPullRequest = z.object({
|
|
|
7
7
|
number: z.number(),
|
|
8
8
|
title: z.string(),
|
|
9
9
|
user: z.object({
|
|
10
|
-
login: z.string()
|
|
10
|
+
login: z.string()
|
|
11
11
|
}),
|
|
12
|
-
draft: z.boolean()
|
|
12
|
+
draft: z.boolean()
|
|
13
13
|
});
|
|
14
14
|
export const GithubPullRequests = z.array(GithubPullRequest);
|
|
15
15
|
/**
|
|
@@ -26,7 +26,7 @@ export const fetch_github_pull_requests = async (repo_info, options = {}) => {
|
|
|
26
26
|
parse: GithubPullRequests.parse,
|
|
27
27
|
token,
|
|
28
28
|
cache,
|
|
29
|
-
log
|
|
29
|
+
log
|
|
30
30
|
});
|
|
31
31
|
if (!fetched.ok) {
|
|
32
32
|
// TODO @many this is messy but I think it's the main case we need to worry about?
|
|
@@ -44,11 +44,11 @@ export const GithubCheckRunsItem = z.object({
|
|
|
44
44
|
status: z.enum(['queued', 'in_progress', 'completed']),
|
|
45
45
|
conclusion: z
|
|
46
46
|
.enum(['success', 'failure', 'neutral', 'cancelled', 'skipped', 'timed_out', 'action_required'])
|
|
47
|
-
.nullable()
|
|
47
|
+
.nullable()
|
|
48
48
|
});
|
|
49
49
|
export const GithubCheckRuns = z.object({
|
|
50
50
|
total_count: z.number(),
|
|
51
|
-
check_runs: z.array(GithubCheckRunsItem)
|
|
51
|
+
check_runs: z.array(GithubCheckRunsItem)
|
|
52
52
|
});
|
|
53
53
|
/**
|
|
54
54
|
* @see https://docs.github.com/en/rest/checks/runs?apiVersion=2022-11-28#list-check-runs-for-a-git-reference
|
|
@@ -64,7 +64,7 @@ export const fetch_github_check_runs = async (repo_info, options = {}) => {
|
|
|
64
64
|
parse: (v) => reduce_check_runs(GithubCheckRuns.parse(v).check_runs),
|
|
65
65
|
token,
|
|
66
66
|
cache,
|
|
67
|
-
log
|
|
67
|
+
log
|
|
68
68
|
});
|
|
69
69
|
if (!fetched.ok) {
|
|
70
70
|
// TODO @many this is messy but I think it's the main case we need to worry about?
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/github_helpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"github_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/github_helpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,MAAM,MAAM,iBAAiB,GAAG,CAAC,YAAY,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;AAEzF,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,IAAI,CAAC;IACX,YAAY,EAAE,iBAAiB,CAAC;CAChC;AAED,eAAO,MAAM,gBAAgB,GAC5B,OAAO,KAAK,CAAC,IAAI,CAAC,EAClB,sBAAsB,iBAAiB,KACrC,KAAK,CAAC,eAAe,CAYI,CAAC;AAE7B,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,EAAE,MAAM,iBAAiB,KAAG,MACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitops_analyze.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gitops_analyze.task.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"gitops_analyze.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gitops_analyze.task.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,cAAc;AACd,eAAO,MAAM,IAAI;;;;;;;;;;kBAqBf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAkC3B,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { styleText as st } from 'node:util';
|
|
|
3
3
|
import { get_gitops_ready } from './gitops_task_helpers.js';
|
|
4
4
|
import { repo_is_npm } from './local_repo.js';
|
|
5
5
|
import { analyze_repos } from './graph_validation.js';
|
|
6
|
-
import { format_wildcard_dependencies, format_dev_cycles, format_production_cycles
|
|
6
|
+
import { format_wildcard_dependencies, format_dev_cycles, format_production_cycles } from './log_helpers.js';
|
|
7
7
|
import { format_and_output } from './output_helpers.js';
|
|
8
8
|
import { GITOPS_CONFIG_PATH_DEFAULT } from './gitops_constants.js';
|
|
9
9
|
/** @nodocs */
|
|
@@ -24,9 +24,9 @@ export const Args = z.strictObject({
|
|
|
24
24
|
sync: z
|
|
25
25
|
.boolean()
|
|
26
26
|
.meta({
|
|
27
|
-
description: 'sync repos (switch branch, pull, install) before analyzing instead of reading the working tree as-is'
|
|
27
|
+
description: 'sync repos (switch branch, pull, install) before analyzing instead of reading the working tree as-is'
|
|
28
28
|
})
|
|
29
|
-
.default(false)
|
|
29
|
+
.default(false)
|
|
30
30
|
});
|
|
31
31
|
/** @nodocs */
|
|
32
32
|
export const task = {
|
|
@@ -49,16 +49,16 @@ export const task = {
|
|
|
49
49
|
const data = {
|
|
50
50
|
graph,
|
|
51
51
|
analysis,
|
|
52
|
-
publishing_order
|
|
52
|
+
publishing_order
|
|
53
53
|
};
|
|
54
54
|
await format_and_output(data, create_formatters(), { format, outfile, log });
|
|
55
|
-
}
|
|
55
|
+
}
|
|
56
56
|
};
|
|
57
57
|
// Create formatters for output_helpers
|
|
58
58
|
const create_formatters = () => ({
|
|
59
59
|
json: (data) => format_json(data.graph, data.analysis, data.publishing_order),
|
|
60
60
|
markdown: (data) => format_markdown(data.graph, data.analysis, data.publishing_order),
|
|
61
|
-
stdout: (data, log) => format_stdout(data.graph, data.analysis, data.publishing_order, log)
|
|
61
|
+
stdout: (data, log) => format_stdout(data.graph, data.analysis, data.publishing_order, log)
|
|
62
62
|
});
|
|
63
63
|
// Helper to calculate common statistics
|
|
64
64
|
const calculate_stats = (graph) => {
|
|
@@ -70,7 +70,7 @@ const format_json = (graph, analysis, publishing_order) => {
|
|
|
70
70
|
const output = {
|
|
71
71
|
graph: graph.toJSON(),
|
|
72
72
|
analysis,
|
|
73
|
-
publishing_order
|
|
73
|
+
publishing_order
|
|
74
74
|
};
|
|
75
75
|
return JSON.stringify(output, null, 2);
|
|
76
76
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitops_config.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gitops_config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"gitops_config.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gitops_config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAGnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAIzD,MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,kBAAkB,GAAG,CAChC,WAAW,EAAE,YAAY,KACrB,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAEhD,MAAM,WAAW,eAAe;IAC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}
|
package/dist/gitops_config.js
CHANGED
|
@@ -15,7 +15,7 @@ import { strip_end } from '@fuzdev/fuz_util/string.ts';
|
|
|
15
15
|
import { DEFAULT_REPOS_DIR } from './paths.js';
|
|
16
16
|
export const create_empty_gitops_config = () => ({
|
|
17
17
|
repos: [],
|
|
18
|
-
repos_dir: DEFAULT_REPOS_DIR
|
|
18
|
+
repos_dir: DEFAULT_REPOS_DIR
|
|
19
19
|
});
|
|
20
20
|
/**
|
|
21
21
|
* Transforms a `RawGitopsConfig` to the more strict `GitopsConfig`.
|
|
@@ -29,7 +29,7 @@ export const normalize_gitops_config = (raw_config) => {
|
|
|
29
29
|
return {
|
|
30
30
|
repos: repos ? repos.map((r) => parse_fuz_repo_config(r)) : empty_config.repos,
|
|
31
31
|
// Default to two dirs up from config if not specified
|
|
32
|
-
repos_dir: repos_dir ?? DEFAULT_REPOS_DIR
|
|
32
|
+
repos_dir: repos_dir ?? DEFAULT_REPOS_DIR
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
35
|
const parse_fuz_repo_config = (r) => {
|
|
@@ -40,7 +40,7 @@ const parse_fuz_repo_config = (r) => {
|
|
|
40
40
|
branch: 'main', // TODO @zts use flavored for GitBranch
|
|
41
41
|
visibility: 'public',
|
|
42
42
|
ci: true,
|
|
43
|
-
archived: false
|
|
43
|
+
archived: false
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
const visibility = r.visibility ?? 'public';
|
|
@@ -50,7 +50,7 @@ const parse_fuz_repo_config = (r) => {
|
|
|
50
50
|
branch: r.branch ?? 'main', // TODO @zts use flavored for GitBranch
|
|
51
51
|
visibility,
|
|
52
52
|
ci: r.ci ?? visibility === 'public',
|
|
53
|
-
archived: r.archived ?? false
|
|
53
|
+
archived: r.archived ?? false
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
56
|
export const load_gitops_config = async (config_path) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitops_plan.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gitops_plan.task.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"gitops_plan.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gitops_plan.task.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,cAAc;AACd,eAAO,MAAM,IAAI;;;;;;;;;;;kBAsBf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAmC3B,CAAC"}
|
package/dist/gitops_plan.task.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { styleText as st } from 'node:util';
|
|
3
3
|
import { get_gitops_ready } from './gitops_task_helpers.js';
|
|
4
|
-
import { generate_publishing_plan, log_publishing_plan
|
|
4
|
+
import { generate_publishing_plan, log_publishing_plan } from './publishing_plan.js';
|
|
5
5
|
import { format_and_output } from './output_helpers.js';
|
|
6
6
|
import { GITOPS_CONFIG_PATH_DEFAULT } from './gitops_constants.js';
|
|
7
7
|
/** @nodocs */
|
|
@@ -23,9 +23,9 @@ export const Args = z.strictObject({
|
|
|
23
23
|
sync: z
|
|
24
24
|
.boolean()
|
|
25
25
|
.meta({
|
|
26
|
-
description: 'sync repos (switch branch, pull, install) before planning instead of reading the working tree as-is'
|
|
26
|
+
description: 'sync repos (switch branch, pull, install) before planning instead of reading the working tree as-is'
|
|
27
27
|
})
|
|
28
|
-
.default(false)
|
|
28
|
+
.default(false)
|
|
29
29
|
});
|
|
30
30
|
/**
|
|
31
31
|
* Generate a publishing plan showing what would happen during multi-repo publishing.
|
|
@@ -50,7 +50,7 @@ export const task = {
|
|
|
50
50
|
dir,
|
|
51
51
|
download: false, // Don't download if missing
|
|
52
52
|
sync,
|
|
53
|
-
log
|
|
53
|
+
log
|
|
54
54
|
});
|
|
55
55
|
if (local_repos.length === 0) {
|
|
56
56
|
log.error('No local repos found');
|
|
@@ -65,7 +65,7 @@ export const task = {
|
|
|
65
65
|
if (plan.errors.length > 0) {
|
|
66
66
|
throw new Error('Publishing plan found errors that would block publishing');
|
|
67
67
|
}
|
|
68
|
-
}
|
|
68
|
+
}
|
|
69
69
|
};
|
|
70
70
|
const create_plan_formatters = (options = {}) => ({
|
|
71
71
|
json: (plan) => {
|
|
@@ -76,16 +76,16 @@ const create_plan_formatters = (options = {}) => ({
|
|
|
76
76
|
breaking_cascades: Object.fromEntries(plan.breaking_cascades),
|
|
77
77
|
warnings: plan.warnings,
|
|
78
78
|
info: plan.info,
|
|
79
|
-
errors: plan.errors
|
|
79
|
+
errors: plan.errors
|
|
80
80
|
};
|
|
81
81
|
return JSON.stringify(output, null, 2);
|
|
82
82
|
},
|
|
83
83
|
markdown: (plan) => format_plan_as_markdown(plan),
|
|
84
|
-
stdout: (plan, log) => log_publishing_plan(plan, log, options)
|
|
84
|
+
stdout: (plan, log) => log_publishing_plan(plan, log, options)
|
|
85
85
|
});
|
|
86
86
|
const format_plan_as_markdown = (plan) => {
|
|
87
87
|
const lines = [];
|
|
88
|
-
const { publishing_order, version_changes, dependency_updates, breaking_cascades, warnings, info, errors
|
|
88
|
+
const { publishing_order, version_changes, dependency_updates, breaking_cascades, warnings, info, errors } = plan;
|
|
89
89
|
lines.push('# Publishing Plan');
|
|
90
90
|
lines.push('');
|
|
91
91
|
// Errors
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitops_publish.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gitops_publish.task.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"gitops_publish.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gitops_publish.task.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,cAAc;AACd,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;kBA+Cf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAiH3B,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { createInterface } from 'node:readline/promises';
|
|
3
3
|
import { styleText as st } from 'node:util';
|
|
4
4
|
import { get_gitops_ready } from './gitops_task_helpers.js';
|
|
5
|
-
import { execute_publishing_plan
|
|
5
|
+
import { execute_publishing_plan } from './multi_repo_publisher.js';
|
|
6
6
|
import { stdout_handler } from './publishing_event_handler.js';
|
|
7
7
|
import { generate_publishing_plan, log_publishing_plan } from './publishing_plan.js';
|
|
8
8
|
import { derive_publish_steps, format_publish_steps } from './publish_steps.js';
|
|
@@ -42,24 +42,27 @@ export const Args = z.strictObject({
|
|
|
42
42
|
.meta({ description: 'stream structured publishing events as JSON-lines to stdout' })
|
|
43
43
|
.default(false),
|
|
44
44
|
outfile: z.string().meta({ description: 'write output to file instead of logging' }).optional(),
|
|
45
|
-
verbose: z
|
|
45
|
+
verbose: z
|
|
46
|
+
.boolean()
|
|
47
|
+
.meta({ description: 'show additional details in plan output' })
|
|
48
|
+
.default(false),
|
|
46
49
|
sync: z
|
|
47
50
|
.boolean()
|
|
48
51
|
.meta({
|
|
49
|
-
description: 'sync repos (switch branch, pull, install) before the dry run instead of reading the working tree as-is; always on for --wetrun'
|
|
52
|
+
description: 'sync repos (switch branch, pull, install) before the dry run instead of reading the working tree as-is; always on for --wetrun'
|
|
50
53
|
})
|
|
51
54
|
.default(false),
|
|
52
55
|
preview: z
|
|
53
56
|
.boolean()
|
|
54
57
|
.meta({ description: 'show the ordered side-effects a --wetrun would perform' })
|
|
55
|
-
.default(false)
|
|
58
|
+
.default(false)
|
|
56
59
|
});
|
|
57
60
|
/** @nodocs */
|
|
58
61
|
export const task = {
|
|
59
62
|
summary: 'publish all repos in dependency order',
|
|
60
63
|
Args,
|
|
61
64
|
run: async ({ args, log }) => {
|
|
62
|
-
const { config, dir, peer_strategy, wetrun, format, deploy, plan, max_wait, emit_json, outfile, verbose, sync, preview
|
|
65
|
+
const { config, dir, peer_strategy, wetrun, format, deploy, plan, max_wait, emit_json, outfile, verbose, sync, preview } = args;
|
|
63
66
|
// Load repos. A dry run reads the working tree as-is unless `--sync`;
|
|
64
67
|
// a real publish (`--wetrun`) always syncs so preflight sees the canonical branches.
|
|
65
68
|
const { local_repos: repos } = await get_gitops_ready({
|
|
@@ -67,7 +70,7 @@ export const task = {
|
|
|
67
70
|
dir,
|
|
68
71
|
download: false, // Don't download if missing
|
|
69
72
|
sync: sync || wetrun,
|
|
70
|
-
log
|
|
73
|
+
log
|
|
71
74
|
});
|
|
72
75
|
// Generate the plan once; the executor consumes this exact plan (no second pass).
|
|
73
76
|
const publishing_plan = await generate_publishing_plan(repos, { verbose });
|
|
@@ -110,7 +113,7 @@ export const task = {
|
|
|
110
113
|
max_wait,
|
|
111
114
|
log,
|
|
112
115
|
// Live JSON-lines stream when requested; events also surface on the result.
|
|
113
|
-
events: emit_json ? stdout_handler() : undefined
|
|
116
|
+
events: emit_json ? stdout_handler() : undefined
|
|
114
117
|
};
|
|
115
118
|
// Execute publishing (may throw on fatal errors like circular dependencies)
|
|
116
119
|
let result;
|
|
@@ -130,7 +133,7 @@ export const task = {
|
|
|
130
133
|
events: [],
|
|
131
134
|
summary: { total: 0, published: 0, failed: 1, skipped: 0, duration: 0 },
|
|
132
135
|
plan_errors: publishing_plan.errors,
|
|
133
|
-
plan_warnings: publishing_plan.warnings
|
|
136
|
+
plan_warnings: publishing_plan.warnings
|
|
134
137
|
};
|
|
135
138
|
}
|
|
136
139
|
// Format and output result (always runs, even on fatal errors)
|
|
@@ -139,14 +142,14 @@ export const task = {
|
|
|
139
142
|
await format_and_output({ result, fatal_error, preview_steps }, create_publish_formatters(), {
|
|
140
143
|
format,
|
|
141
144
|
outfile,
|
|
142
|
-
log
|
|
145
|
+
log
|
|
143
146
|
});
|
|
144
147
|
}
|
|
145
148
|
// Exit with error if failed
|
|
146
149
|
if (publish_run_failed(result, fatal_error)) {
|
|
147
150
|
process.exit(1);
|
|
148
151
|
}
|
|
149
|
-
}
|
|
152
|
+
}
|
|
150
153
|
};
|
|
151
154
|
const create_publish_formatters = () => ({
|
|
152
155
|
json: (data) => JSON.stringify(data.preview_steps ? { ...data.result, preview: data.preview_steps } : data.result, null, 2),
|
|
@@ -154,7 +157,7 @@ const create_publish_formatters = () => ({
|
|
|
154
157
|
stdout: () => {
|
|
155
158
|
// stdout format is handled by the executor's logging
|
|
156
159
|
// This should never be called due to early return in task
|
|
157
|
-
}
|
|
160
|
+
}
|
|
158
161
|
});
|
|
159
162
|
/** Logs the ordered side-effect preview to stdout. */
|
|
160
163
|
const log_preview = (steps, log) => {
|
|
@@ -232,7 +235,7 @@ const format_result_markdown = (result, fatal_error, preview_steps) => {
|
|
|
232
235
|
const prompt_for_confirmation = async () => {
|
|
233
236
|
const rl = createInterface({
|
|
234
237
|
input: process.stdin,
|
|
235
|
-
output: process.stdout
|
|
238
|
+
output: process.stdout
|
|
236
239
|
});
|
|
237
240
|
const answer = await rl.question('');
|
|
238
241
|
rl.close();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitops_run.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gitops_run.task.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"gitops_run.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gitops_run.task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,IAAI;;;;;;;;;kBAmBf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAaxC,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAyM3B,CAAC"}
|
package/dist/gitops_run.task.js
CHANGED
|
@@ -25,7 +25,7 @@ export const Args = z.strictObject({
|
|
|
25
25
|
outfile: z
|
|
26
26
|
.string()
|
|
27
27
|
.meta({ description: 'with --format json, write clean JSON to this file instead of stdout' })
|
|
28
|
-
.optional()
|
|
28
|
+
.optional()
|
|
29
29
|
});
|
|
30
30
|
export const task = {
|
|
31
31
|
Args,
|
|
@@ -53,7 +53,7 @@ export const task = {
|
|
|
53
53
|
// Parse command into cmd + args for spawn
|
|
54
54
|
// For now, we use shell mode to support pipes/redirects/etc
|
|
55
55
|
const spawned = await spawn_out('sh', ['-c', command], {
|
|
56
|
-
cwd: repo_dir
|
|
56
|
+
cwd: repo_dir
|
|
57
57
|
});
|
|
58
58
|
const duration_ms = performance.now() - repo_start;
|
|
59
59
|
const success = spawned.result.ok;
|
|
@@ -64,7 +64,7 @@ export const task = {
|
|
|
64
64
|
exit_code: spawned.result.kind === 'exited' ? spawned.result.code : 0,
|
|
65
65
|
stdout: spawned.stdout || '',
|
|
66
66
|
stderr: spawned.stderr || '',
|
|
67
|
-
duration_ms
|
|
67
|
+
duration_ms
|
|
68
68
|
};
|
|
69
69
|
return result;
|
|
70
70
|
}
|
|
@@ -78,7 +78,7 @@ export const task = {
|
|
|
78
78
|
stdout: '',
|
|
79
79
|
stderr: '',
|
|
80
80
|
duration_ms,
|
|
81
|
-
error: String(error)
|
|
81
|
+
error: String(error)
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
84
|
});
|
|
@@ -107,7 +107,7 @@ export const task = {
|
|
|
107
107
|
stdout: '',
|
|
108
108
|
stderr: '',
|
|
109
109
|
duration_ms: 0,
|
|
110
|
-
error: String(result.reason)
|
|
110
|
+
error: String(result.reason)
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
}
|
|
@@ -121,8 +121,8 @@ export const task = {
|
|
|
121
121
|
total: repos.length,
|
|
122
122
|
success: successes.length,
|
|
123
123
|
failure: failures.length,
|
|
124
|
-
duration_ms: Math.round(total_duration_ms)
|
|
125
|
-
}
|
|
124
|
+
duration_ms: Math.round(total_duration_ms)
|
|
125
|
+
}
|
|
126
126
|
};
|
|
127
127
|
const json = JSON.stringify(json_output, null, 2);
|
|
128
128
|
if (outfile) {
|
|
@@ -202,5 +202,5 @@ export const task = {
|
|
|
202
202
|
if (failures.length > 0) {
|
|
203
203
|
throw new TaskError(`${failures.length} repos failed`);
|
|
204
204
|
}
|
|
205
|
-
}
|
|
205
|
+
}
|
|
206
206
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitops_sync.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gitops_sync.task.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"gitops_sync.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/gitops_sync.task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,cAAc;AACd,eAAO,MAAM,IAAI;;;;;;;kBAyBf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAsG3B,CAAC"}
|