@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
|
@@ -2,7 +2,7 @@ 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
4
|
import { analyze_repos } from './graph_validation.js';
|
|
5
|
-
import { generate_publishing_plan, log_publishing_plan
|
|
5
|
+
import { generate_publishing_plan, log_publishing_plan } from './publishing_plan.js';
|
|
6
6
|
import { execute_publishing_plan } from './multi_repo_publisher.js';
|
|
7
7
|
import { log_dependency_analysis } from './log_helpers.js';
|
|
8
8
|
import { GITOPS_CONFIG_PATH_DEFAULT } from './gitops_constants.js';
|
|
@@ -21,9 +21,9 @@ export const Args = z.strictObject({
|
|
|
21
21
|
sync: z
|
|
22
22
|
.boolean()
|
|
23
23
|
.meta({
|
|
24
|
-
description: 'sync repos (switch branch, pull, install) before validating instead of reading the working tree as-is'
|
|
24
|
+
description: 'sync repos (switch branch, pull, install) before validating instead of reading the working tree as-is'
|
|
25
25
|
})
|
|
26
|
-
.default(false)
|
|
26
|
+
.default(false)
|
|
27
27
|
});
|
|
28
28
|
/** @nodocs */
|
|
29
29
|
export const task = {
|
|
@@ -65,7 +65,7 @@ export const task = {
|
|
|
65
65
|
duration: analyze_duration,
|
|
66
66
|
warning_details,
|
|
67
67
|
info_details,
|
|
68
|
-
analysis
|
|
68
|
+
analysis
|
|
69
69
|
});
|
|
70
70
|
log.info(st('green', ` ✓ gitops_analyze completed in ${analyze_duration}ms`));
|
|
71
71
|
// Print detailed analysis
|
|
@@ -81,7 +81,7 @@ export const task = {
|
|
|
81
81
|
success: false,
|
|
82
82
|
warnings: 0,
|
|
83
83
|
errors: 1,
|
|
84
|
-
duration: analyze_duration
|
|
84
|
+
duration: analyze_duration
|
|
85
85
|
});
|
|
86
86
|
log.error(st('red', ` ✗ gitops_analyze failed: ${error}`));
|
|
87
87
|
}
|
|
@@ -100,7 +100,7 @@ export const task = {
|
|
|
100
100
|
success: errors === 0,
|
|
101
101
|
warnings,
|
|
102
102
|
errors,
|
|
103
|
-
duration: plan_duration
|
|
103
|
+
duration: plan_duration
|
|
104
104
|
});
|
|
105
105
|
log.info(st('green', ` ✓ gitops_plan completed in ${plan_duration}ms`));
|
|
106
106
|
if (verbose) {
|
|
@@ -120,7 +120,7 @@ export const task = {
|
|
|
120
120
|
success: false,
|
|
121
121
|
warnings: 0,
|
|
122
122
|
errors: 1,
|
|
123
|
-
duration: plan_duration
|
|
123
|
+
duration: plan_duration
|
|
124
124
|
});
|
|
125
125
|
log.error(st('red', ` ✗ gitops_plan failed: ${error}`));
|
|
126
126
|
}
|
|
@@ -130,7 +130,7 @@ export const task = {
|
|
|
130
130
|
try {
|
|
131
131
|
const options = {
|
|
132
132
|
wetrun: false,
|
|
133
|
-
log: undefined
|
|
133
|
+
log: undefined // Silent for validation
|
|
134
134
|
};
|
|
135
135
|
// Reuse the plan from step 2 (regenerate only if that step failed to produce one).
|
|
136
136
|
const result = await execute_publishing_plan(local_repos, publishing_plan ?? (await generate_publishing_plan(local_repos, { verbose })), options);
|
|
@@ -143,7 +143,7 @@ export const task = {
|
|
|
143
143
|
success: result.ok,
|
|
144
144
|
warnings: 0,
|
|
145
145
|
errors,
|
|
146
|
-
duration: dry_duration
|
|
146
|
+
duration: dry_duration
|
|
147
147
|
});
|
|
148
148
|
log.info(st('green', ` ✓ gitops_publish (dry run) completed in ${dry_duration}ms`));
|
|
149
149
|
if (errors > 0) {
|
|
@@ -157,7 +157,7 @@ export const task = {
|
|
|
157
157
|
success: false,
|
|
158
158
|
warnings: 0,
|
|
159
159
|
errors: 1,
|
|
160
|
-
duration: dry_duration
|
|
160
|
+
duration: dry_duration
|
|
161
161
|
});
|
|
162
162
|
log.error(st('red', ` ✗ gitops_publish (dry run) failed: ${error}`));
|
|
163
163
|
}
|
|
@@ -174,7 +174,7 @@ export const task = {
|
|
|
174
174
|
// always `true` today. The gate exists for a future caller that loads a
|
|
175
175
|
// partial set; until then the skip path is inert and untested.
|
|
176
176
|
checkable: true,
|
|
177
|
-
archived: r.repo_config.archived
|
|
177
|
+
archived: r.repo_config.archived
|
|
178
178
|
})));
|
|
179
179
|
const ci_duration = Date.now() - ci_start;
|
|
180
180
|
const drift_details = ci_drift.map((d) => d.kind === 'missing_ci'
|
|
@@ -185,7 +185,7 @@ export const task = {
|
|
|
185
185
|
success: ci_drift.length === 0,
|
|
186
186
|
warnings: 0,
|
|
187
187
|
errors: ci_drift.length,
|
|
188
|
-
duration: ci_duration
|
|
188
|
+
duration: ci_duration
|
|
189
189
|
});
|
|
190
190
|
if (ci_drift.length === 0) {
|
|
191
191
|
log.info(st('green', ` ✓ ci_reconcile completed in ${ci_duration}ms`));
|
|
@@ -204,7 +204,7 @@ export const task = {
|
|
|
204
204
|
success: false,
|
|
205
205
|
warnings: 0,
|
|
206
206
|
errors: 1,
|
|
207
|
-
duration: ci_duration
|
|
207
|
+
duration: ci_duration
|
|
208
208
|
});
|
|
209
209
|
log.error(st('red', ` ✗ ci_reconcile failed: ${error}`));
|
|
210
210
|
}
|
|
@@ -255,5 +255,5 @@ export const task = {
|
|
|
255
255
|
log.error(st('red', '❌ Validation failed - review the errors above.'));
|
|
256
256
|
throw new Error('Validation failed');
|
|
257
257
|
}
|
|
258
|
-
}
|
|
258
|
+
}
|
|
259
259
|
};
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @module
|
|
14
14
|
*/
|
|
15
|
-
import type { Logger } from '@fuzdev/fuz_util/log.
|
|
15
|
+
import type { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
16
16
|
import { DependencyGraph, DependencyGraphBuilder } from './dependency_graph.js';
|
|
17
|
-
import type
|
|
17
|
+
import { type LocalRepo } from './local_repo.js';
|
|
18
18
|
export interface GraphValidationResult {
|
|
19
19
|
graph: DependencyGraph;
|
|
20
20
|
publishing_order: Array<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph_validation.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/graph_validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"graph_validation.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/graph_validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAItD,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE9D,MAAM,WAAW,qBAAqB;IACrC,KAAK,EAAE,eAAe,CAAC;IACvB,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC,iBAAiB,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACxC,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB,GACrC,OAAO,KAAK,CAAC,SAAS,CAAC,EACvB,UAAS;IACR,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;CACf,KACJ,qBA8DF,CAAC;AAEF,6FAA6F;AAC7F,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC,CAAC;AAE/E,MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,sFAAsF;IACtF,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;CACvC;AAED;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,KAAK,CAAC,SAAS,CAAC,KAAG,YASvD,CAAC"}
|
package/dist/graph_validation.js
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
import { TaskError } from '@fuzdev/gro';
|
|
16
16
|
import { styleText as st } from 'node:util';
|
|
17
17
|
import { DependencyGraph, DependencyGraphBuilder } from './dependency_graph.js';
|
|
18
|
+
import { repo_is_npm } from './local_repo.js';
|
|
18
19
|
/**
|
|
19
20
|
* Shared utility for building dependency graph, detecting cycles, and computing publishing order.
|
|
20
21
|
* This centralizes logic that was duplicated across `multi_repo_publisher`, `publishing_plan`, and `gitops_analyze`.
|
|
@@ -76,7 +77,7 @@ export const validate_dependency_graph = (repos, options = {}) => {
|
|
|
76
77
|
publishing_order,
|
|
77
78
|
production_cycles,
|
|
78
79
|
dev_cycles,
|
|
79
|
-
sort_error
|
|
80
|
+
sort_error
|
|
80
81
|
};
|
|
81
82
|
};
|
|
82
83
|
/**
|
|
@@ -86,10 +87,11 @@ export const validate_dependency_graph = (repos, options = {}) => {
|
|
|
86
87
|
* (no `log`) to avoid emitting a redundant "Analyzing dependencies" line.
|
|
87
88
|
*/
|
|
88
89
|
export const analyze_repos = (repos) => {
|
|
89
|
-
|
|
90
|
+
// Only npm packages form the dependency graph; non-npm repos (e.g. cargo) are excluded.
|
|
91
|
+
const { graph, publishing_order: order } = validate_dependency_graph(repos.filter(repo_is_npm), {
|
|
90
92
|
throw_on_prod_cycles: false, // report, don't throw
|
|
91
93
|
log_cycles: false, // callers format their own cycle output
|
|
92
|
-
log_order: false
|
|
94
|
+
log_order: false
|
|
93
95
|
});
|
|
94
96
|
const analysis = new DependencyGraphBuilder().analyze(graph);
|
|
95
97
|
return { graph, analysis, publishing_order: order.length > 0 ? order : null };
|
package/dist/local_repo.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { PackageJson } from '@fuzdev/fuz_util/package_json.
|
|
2
|
-
import { Library } from '@fuzdev/fuz_ui/library.svelte.
|
|
3
|
-
import type { Logger } from '@fuzdev/fuz_util/log.
|
|
1
|
+
import type { PackageJson } from '@fuzdev/fuz_util/package_json.ts';
|
|
2
|
+
import { Library } from '@fuzdev/fuz_ui/library.svelte.ts';
|
|
3
|
+
import type { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
4
4
|
import type { GitOperations, NpmOperations } from './operations.js';
|
|
5
5
|
import type { GitopsConfig, GitopsRepoConfig } from './gitops_config.js';
|
|
6
6
|
import type { ResolvedGitopsConfig } from './resolved_gitops_config.js';
|
|
@@ -9,6 +9,14 @@ import type { ResolvedGitopsConfig } from './resolved_gitops_config.js';
|
|
|
9
9
|
* Does not extend `LocalRepoPath` - `Library` is source of truth for name/repo_url/etc.
|
|
10
10
|
*/
|
|
11
11
|
export interface LocalRepo {
|
|
12
|
+
/**
|
|
13
|
+
* Which packaging ecosystem the repo belongs to. `npm` repos (with a
|
|
14
|
+
* `package.json`) take part in the changeset publishing cascade; `cargo` repos
|
|
15
|
+
* (a Rust `Cargo.toml`, no `package.json`) are dashboard-only — fetched and
|
|
16
|
+
* rendered like any repo but excluded from publishing/analysis. See
|
|
17
|
+
* `repo_is_npm`.
|
|
18
|
+
*/
|
|
19
|
+
kind: 'npm' | 'cargo';
|
|
12
20
|
library: Library;
|
|
13
21
|
/** The repo's full `package.json` (with `dependencies`/`devDependencies`). */
|
|
14
22
|
package_json: PackageJson;
|
|
@@ -66,7 +74,7 @@ export interface LocalRepoMissing {
|
|
|
66
74
|
* @param allow_dirty - when syncing, tolerate uncommitted changes instead of throwing (default `false`)
|
|
67
75
|
* @throws {TaskError} if syncing fails (dirty workspace, branch switch, install) or analysis fails
|
|
68
76
|
*/
|
|
69
|
-
export declare const local_repo_load: ({ local_repo_path, log: _log, git_ops, npm_ops, sync, allow_dirty
|
|
77
|
+
export declare const local_repo_load: ({ local_repo_path, log: _log, git_ops, npm_ops, sync, allow_dirty }: {
|
|
70
78
|
local_repo_path: LocalRepoPath;
|
|
71
79
|
log?: Logger;
|
|
72
80
|
git_ops?: GitOperations;
|
|
@@ -74,7 +82,13 @@ export declare const local_repo_load: ({ local_repo_path, log: _log, git_ops, np
|
|
|
74
82
|
sync?: boolean;
|
|
75
83
|
allow_dirty?: boolean;
|
|
76
84
|
}) => Promise<LocalRepo>;
|
|
77
|
-
|
|
85
|
+
/**
|
|
86
|
+
* Whether a repo is an npm package and so participates in publishing and
|
|
87
|
+
* dependency analysis. Non-npm repos (e.g. Rust `cargo` repos) are still synced
|
|
88
|
+
* and rendered on the dashboard, but excluded from the changeset cascade.
|
|
89
|
+
*/
|
|
90
|
+
export declare const repo_is_npm: (repo: LocalRepo) => boolean;
|
|
91
|
+
export declare const local_repos_ensure: ({ resolved_config, repos_dir, gitops_config, download, log, npm_ops }: {
|
|
78
92
|
resolved_config: ResolvedGitopsConfig;
|
|
79
93
|
repos_dir: string;
|
|
80
94
|
gitops_config: GitopsConfig;
|
|
@@ -82,7 +96,7 @@ export declare const local_repos_ensure: ({ resolved_config, repos_dir, gitops_c
|
|
|
82
96
|
log?: Logger;
|
|
83
97
|
npm_ops?: NpmOperations;
|
|
84
98
|
}) => Promise<Array<LocalRepoPath>>;
|
|
85
|
-
export declare const local_repos_load: ({ local_repo_paths, log, git_ops, npm_ops, parallel, concurrency, sync, allow_dirty
|
|
99
|
+
export declare const local_repos_load: ({ local_repo_paths, log, git_ops, npm_ops, parallel, concurrency, sync, allow_dirty }: {
|
|
86
100
|
local_repo_paths: Array<LocalRepoPath>;
|
|
87
101
|
log?: Logger;
|
|
88
102
|
git_ops?: GitOperations;
|
|
@@ -92,7 +106,7 @@ export declare const local_repos_load: ({ local_repo_paths, log, git_ops, npm_op
|
|
|
92
106
|
sync?: boolean;
|
|
93
107
|
allow_dirty?: boolean;
|
|
94
108
|
}) => Promise<Array<LocalRepo>>;
|
|
95
|
-
export declare const local_repo_locate: ({ repo_config, repos_dir
|
|
109
|
+
export declare const local_repo_locate: ({ repo_config, repos_dir }: {
|
|
96
110
|
repo_config: GitopsRepoConfig;
|
|
97
111
|
repos_dir: string;
|
|
98
112
|
}) => LocalRepoPath | LocalRepoMissing;
|
package/dist/local_repo.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local_repo.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/local_repo.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"local_repo.d.ts","sourceRoot":"../src/lib/","sources":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G/B;IACF,WAAW,EAAE,gBAAgB,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;CAClB,KAAG,aAAa,GAAG,gBAoBnB,CAAC"}
|
package/dist/local_repo.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { strip_end } from '@fuzdev/fuz_util/string.
|
|
2
|
-
import {
|
|
1
|
+
import { strip_end } from '@fuzdev/fuz_util/string.ts';
|
|
2
|
+
import { to_error_message } from '@fuzdev/fuz_util/error.ts';
|
|
3
|
+
import { library_json_from_modules } from '@fuzdev/fuz_util/library_json.ts';
|
|
4
|
+
import { Library } from '@fuzdev/fuz_ui/library.svelte.ts';
|
|
3
5
|
import { existsSync } from 'node:fs';
|
|
4
6
|
import { join } from 'node:path';
|
|
5
7
|
import { TaskError } from '@fuzdev/gro';
|
|
6
|
-
import { library_load_from_repo } from '@fuzdev/gro/library_load.
|
|
7
|
-
import { spawn_out } from '@fuzdev/fuz_util/process.
|
|
8
|
-
import { map_concurrent_settled } from '@fuzdev/fuz_util/async.
|
|
8
|
+
import { library_load_from_repo } from '@fuzdev/gro/library_load.ts';
|
|
9
|
+
import { spawn_out } from '@fuzdev/fuz_util/process.ts';
|
|
10
|
+
import { map_concurrent_settled } from '@fuzdev/fuz_util/async.ts';
|
|
9
11
|
import { default_git_operations, default_npm_operations } from './operations_defaults.js';
|
|
10
12
|
import { GITOPS_CONCURRENCY_DEFAULT } from './gitops_constants.js';
|
|
13
|
+
import { cargo_toml_load } from './cargo_toml.js';
|
|
11
14
|
/**
|
|
12
15
|
* Loads repo data, optionally syncing the working tree first.
|
|
13
16
|
*
|
|
@@ -33,7 +36,7 @@ import { GITOPS_CONCURRENCY_DEFAULT } from './gitops_constants.js';
|
|
|
33
36
|
* @param allow_dirty - when syncing, tolerate uncommitted changes instead of throwing (default `false`)
|
|
34
37
|
* @throws {TaskError} if syncing fails (dirty workspace, branch switch, install) or analysis fails
|
|
35
38
|
*/
|
|
36
|
-
export const local_repo_load = async ({ local_repo_path, log: _log, git_ops = default_git_operations, npm_ops = default_npm_operations, sync = true, allow_dirty = false
|
|
39
|
+
export const local_repo_load = async ({ local_repo_path, log: _log, git_ops = default_git_operations, npm_ops = default_npm_operations, sync = true, allow_dirty = false }) => {
|
|
37
40
|
const { repo_config, repo_dir, repo_name, repo_git_ssh_url } = local_repo_path;
|
|
38
41
|
if (sync) {
|
|
39
42
|
// Record commit hash before any changes
|
|
@@ -104,7 +107,7 @@ export const local_repo_load = async ({ local_repo_path, log: _log, git_ops = de
|
|
|
104
107
|
from_commit: commit_before,
|
|
105
108
|
to_commit: commit_after,
|
|
106
109
|
file_path: 'package.json',
|
|
107
|
-
cwd: repo_dir
|
|
110
|
+
cwd: repo_dir
|
|
108
111
|
});
|
|
109
112
|
if (!changed_result.ok) {
|
|
110
113
|
throw new TaskError(`Failed to check if package.json changed in ${repo_dir}: ${changed_result.message}`);
|
|
@@ -117,6 +120,13 @@ export const local_repo_load = async ({ local_repo_path, log: _log, git_ops = de
|
|
|
117
120
|
}
|
|
118
121
|
}
|
|
119
122
|
}
|
|
123
|
+
// A repo with no `package.json` but a Rust `Cargo.toml` isn't an npm package and can't be
|
|
124
|
+
// analyzed as a library. Load it as a dashboard-only `cargo` repo (CI, PRs, identity) that
|
|
125
|
+
// publishing/analysis skips. Anything else falls through to the npm loader below, whose
|
|
126
|
+
// error covers a genuinely missing or unreadable manifest.
|
|
127
|
+
if (!existsSync(join(repo_dir, 'package.json')) && existsSync(join(repo_dir, 'Cargo.toml'))) {
|
|
128
|
+
return local_repo_load_cargo({ local_repo_path });
|
|
129
|
+
}
|
|
120
130
|
// Load library metadata via svelte-docinfo analysis (cached under `.gro/library.json`).
|
|
121
131
|
let library_json;
|
|
122
132
|
let package_json;
|
|
@@ -124,17 +134,18 @@ export const local_repo_load = async ({ local_repo_path, log: _log, git_ops = de
|
|
|
124
134
|
({ library_json, package_json } = await library_load_from_repo(repo_dir, { log: _log }));
|
|
125
135
|
}
|
|
126
136
|
catch (err) {
|
|
127
|
-
const message =
|
|
137
|
+
const message = to_error_message(err);
|
|
128
138
|
_log?.warn(`Failed to load library metadata for repo "${repo_name}" in ${repo_dir}: ${message}`);
|
|
129
139
|
throw new TaskError(`Failed to load library metadata for repo "${repo_name}" in ${repo_dir}: ${message}`);
|
|
130
140
|
}
|
|
131
141
|
const library = new Library(library_json);
|
|
132
142
|
const local_repo = {
|
|
143
|
+
kind: 'npm',
|
|
133
144
|
library,
|
|
134
145
|
package_json,
|
|
135
146
|
repo_dir,
|
|
136
147
|
repo_git_ssh_url,
|
|
137
|
-
repo_config
|
|
148
|
+
repo_config
|
|
138
149
|
};
|
|
139
150
|
// Extract dependencies from the full package_json
|
|
140
151
|
if (package_json.dependencies) {
|
|
@@ -148,7 +159,44 @@ export const local_repo_load = async ({ local_repo_path, log: _log, git_ops = de
|
|
|
148
159
|
}
|
|
149
160
|
return local_repo;
|
|
150
161
|
};
|
|
151
|
-
|
|
162
|
+
/**
|
|
163
|
+
* Whether a repo is an npm package and so participates in publishing and
|
|
164
|
+
* dependency analysis. Non-npm repos (e.g. Rust `cargo` repos) are still synced
|
|
165
|
+
* and rendered on the dashboard, but excluded from the changeset cascade.
|
|
166
|
+
*/
|
|
167
|
+
export const repo_is_npm = (repo) => repo.kind === 'npm';
|
|
168
|
+
/**
|
|
169
|
+
* Loads a non-npm Rust repo as a dashboard-only `LocalRepo`. It has no
|
|
170
|
+
* `package.json`, so there's no `svelte-docinfo` analysis and no npm dependency
|
|
171
|
+
* graph — a lightweight `Library` is synthesized from the repo's `Cargo.toml`
|
|
172
|
+
* (best-effort name/version/description) and its configured repo URL, which is
|
|
173
|
+
* what the dashboard renders (CI status, PRs, identity). Marked `private` so it
|
|
174
|
+
* never reads as an npm publish target, and tagged `cargo` so the publishing and
|
|
175
|
+
* analysis paths skip it (see `repo_is_npm`).
|
|
176
|
+
*/
|
|
177
|
+
const local_repo_load_cargo = async ({ local_repo_path }) => {
|
|
178
|
+
const { repo_config, repo_dir, repo_name, repo_url, repo_git_ssh_url } = local_repo_path;
|
|
179
|
+
const cargo = await cargo_toml_load(repo_dir);
|
|
180
|
+
// A Cargo workspace root has no `name`, so fall back to the repo name parsed from
|
|
181
|
+
// the URL; the config's `repo_url` is the authoritative `repository`.
|
|
182
|
+
const package_json = {
|
|
183
|
+
name: cargo?.name ?? repo_name,
|
|
184
|
+
version: cargo?.version ?? '0.0.0',
|
|
185
|
+
repository: cargo?.repository ?? repo_url,
|
|
186
|
+
private: true,
|
|
187
|
+
...(cargo?.description ? { description: cargo.description } : null)
|
|
188
|
+
};
|
|
189
|
+
const library = new Library(library_json_from_modules(package_json, []));
|
|
190
|
+
return {
|
|
191
|
+
kind: 'cargo',
|
|
192
|
+
library,
|
|
193
|
+
package_json,
|
|
194
|
+
repo_dir,
|
|
195
|
+
repo_git_ssh_url,
|
|
196
|
+
repo_config
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
export const local_repos_ensure = async ({ resolved_config, repos_dir, gitops_config, download, log, npm_ops = default_npm_operations }) => {
|
|
152
200
|
let local_repo_paths = null;
|
|
153
201
|
if (!resolved_config.local_repos_missing) {
|
|
154
202
|
local_repo_paths = resolved_config.local_repo_paths;
|
|
@@ -159,7 +207,7 @@ export const local_repos_ensure = async ({ resolved_config, repos_dir, gitops_co
|
|
|
159
207
|
repos_dir,
|
|
160
208
|
local_repos_missing: resolved_config.local_repos_missing,
|
|
161
209
|
log,
|
|
162
|
-
npm_ops
|
|
210
|
+
npm_ops
|
|
163
211
|
});
|
|
164
212
|
local_repo_paths = (resolved_config.local_repo_paths ?? [])
|
|
165
213
|
.concat(downloaded)
|
|
@@ -177,7 +225,7 @@ export const local_repos_ensure = async ({ resolved_config, repos_dir, gitops_co
|
|
|
177
225
|
}
|
|
178
226
|
return local_repo_paths;
|
|
179
227
|
};
|
|
180
|
-
export const local_repos_load = async ({ local_repo_paths, log, git_ops = default_git_operations, npm_ops = default_npm_operations, parallel = true, concurrency = GITOPS_CONCURRENCY_DEFAULT, sync = true, allow_dirty = false
|
|
228
|
+
export const local_repos_load = async ({ local_repo_paths, log, git_ops = default_git_operations, npm_ops = default_npm_operations, parallel = true, concurrency = GITOPS_CONCURRENCY_DEFAULT, sync = true, allow_dirty = false }) => {
|
|
181
229
|
if (!parallel) {
|
|
182
230
|
// Sequential loading (original behavior)
|
|
183
231
|
const loaded = [];
|
|
@@ -202,7 +250,7 @@ export const local_repos_load = async ({ local_repo_paths, log, git_ops = defaul
|
|
|
202
250
|
const repo_path = local_repo_paths[i];
|
|
203
251
|
errors.push({
|
|
204
252
|
repo_name: repo_path.repo_name,
|
|
205
|
-
error: String(result.reason)
|
|
253
|
+
error: String(result.reason)
|
|
206
254
|
});
|
|
207
255
|
}
|
|
208
256
|
}
|
|
@@ -213,7 +261,7 @@ export const local_repos_load = async ({ local_repo_paths, log, git_ops = defaul
|
|
|
213
261
|
}
|
|
214
262
|
return loaded;
|
|
215
263
|
};
|
|
216
|
-
export const local_repo_locate = ({ repo_config, repos_dir
|
|
264
|
+
export const local_repo_locate = ({ repo_config, repos_dir }) => {
|
|
217
265
|
const { repo_url } = repo_config;
|
|
218
266
|
const repo_name = strip_end(repo_url, '/').split('/').at(-1);
|
|
219
267
|
if (!repo_name)
|
|
@@ -229,14 +277,14 @@ export const local_repo_locate = ({ repo_config, repos_dir, }) => {
|
|
|
229
277
|
repo_dir,
|
|
230
278
|
repo_url,
|
|
231
279
|
repo_git_ssh_url,
|
|
232
|
-
repo_config
|
|
280
|
+
repo_config
|
|
233
281
|
};
|
|
234
282
|
};
|
|
235
283
|
const to_repo_git_ssh_url = (repo_url) => {
|
|
236
284
|
const url = new URL(repo_url);
|
|
237
285
|
return `git@${url.hostname}:${url.pathname.substring(1)}`;
|
|
238
286
|
};
|
|
239
|
-
const download_repos = async ({ repos_dir, local_repos_missing, log, npm_ops = default_npm_operations
|
|
287
|
+
const download_repos = async ({ repos_dir, local_repos_missing, log, npm_ops = default_npm_operations }) => {
|
|
240
288
|
const resolved = [];
|
|
241
289
|
for (const { repo_config, repo_git_ssh_url } of local_repos_missing) {
|
|
242
290
|
log?.info(`cloning repo ${repo_git_ssh_url} to ${repos_dir}`);
|
package/dist/log_helpers.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/log_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"log_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/log_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,4BAA4B,GACxC,UAAU,UAAU,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC,KACrD,KAAK,CAAC,MAAM,CAYd,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC7B,UAAU,UAAU,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC,KACrD,KAAK,CAAC,MAAM,CAed,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GACpC,UAAU,UAAU,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC,KACrD,KAAK,CAAC,MAAM,CAed,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,GACrC,UAAU,UAAU,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC,EACvD,KAAK,MAAM,EACX,eAAW,KACT,IAKF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,GAC1B,UAAU,UAAU,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC,EACvD,KAAK,MAAM,EACX,eAAW,KACT,IAKF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GACjC,UAAU,UAAU,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC,EACvD,KAAK,MAAM,EACX,eAAW,KACT,IAKF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GACnC,UAAU,UAAU,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC,EACvD,KAAK,MAAM,EACX,eAAW,KACT,IAIF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Logger } from '@fuzdev/fuz_util/log.
|
|
2
|
-
import type
|
|
1
|
+
import type { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
2
|
+
import { type LocalRepo } from './local_repo.js';
|
|
3
3
|
import { type VersionStrategy } from './dependency_updater.js';
|
|
4
4
|
import { type DependencyUpdate, type PublishingPlan } from './publishing_plan.js';
|
|
5
5
|
import type { GitopsOperations } from './operations.js';
|
|
@@ -50,7 +50,7 @@ export declare const publish_repos: (repos: Array<LocalRepo>, options: Publishin
|
|
|
50
50
|
* before any side effect, a dry run still reports the partial cascade but returns
|
|
51
51
|
* `ok: false`. This is the single error gate — `--no-plan` can't bypass it.
|
|
52
52
|
*/
|
|
53
|
-
export declare const execute_publishing_plan: (
|
|
53
|
+
export declare const execute_publishing_plan: (all_repos: Array<LocalRepo>, plan: PublishingPlan, options: PublishingOptions) => Promise<PublishingResult>;
|
|
54
54
|
/**
|
|
55
55
|
* Groups dependency updates by dependent package — `dependent → (dependency → new
|
|
56
56
|
* version)`, the shape `update_package_json` consumes. Restricted by `predicate` (e.g.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi_repo_publisher.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/multi_repo_publisher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"multi_repo_publisher.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/multi_repo_publisher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAKtD,OAAO,EAAe,KAAK,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AAC,CAAC;IAC/B,8CAA8C;IAC9C,OAAO,EAAE,oBAAoB,CAAC;IAC9B,+FAA+F;IAC/F,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3B,yEAAyE;IACzE,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED,eAAO,MAAM,aAAa,GACzB,OAAO,KAAK,CAAC,SAAS,CAAC,EACvB,SAAS,iBAAiB,KACxB,OAAO,CAAC,gBAAgB,CAO1B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GACnC,WAAW,KAAK,CAAC,SAAS,CAAC,EAC3B,MAAM,cAAc,EACpB,SAAS,iBAAiB,KACxB,OAAO,CAAC,gBAAgB,CAyX1B,CAAC;AA+EF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GACpC,SAAS,KAAK,CAAC,gBAAgB,CAAC,EAChC,WAAW,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,EACxC,WAAW,CAAC,MAAM,EAAE,gBAAgB,KAAK,OAAO,KAC9C,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAcjC,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { TaskError } from '@fuzdev/gro';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { styleText as st } from 'node:util';
|
|
4
|
+
import { repo_is_npm } from './local_repo.js';
|
|
4
5
|
import { update_package_json } from './dependency_updater.js';
|
|
5
|
-
import { generate_publishing_plan
|
|
6
|
+
import { generate_publishing_plan } from './publishing_plan.js';
|
|
6
7
|
import { default_gitops_operations } from './operations_defaults.js';
|
|
7
8
|
import { GITOPS_NPM_WAIT_TIMEOUT_DEFAULT } from './gitops_constants.js';
|
|
8
|
-
import { summarize_events
|
|
9
|
-
import { capture_handler, multi_handler
|
|
9
|
+
import { summarize_events } from './publishing_event.js';
|
|
10
|
+
import { capture_handler, multi_handler } from './publishing_event_handler.js';
|
|
10
11
|
export const publish_repos = async (repos, options) => {
|
|
11
12
|
const { log, ops = default_gitops_operations } = options;
|
|
12
13
|
// Convenience entry: generate the plan, then execute it. Callers that already hold a
|
|
@@ -23,9 +24,12 @@ export const publish_repos = async (repos, options) => {
|
|
|
23
24
|
* before any side effect, a dry run still reports the partial cascade but returns
|
|
24
25
|
* `ok: false`. This is the single error gate — `--no-plan` can't bypass it.
|
|
25
26
|
*/
|
|
26
|
-
export const execute_publishing_plan = async (
|
|
27
|
+
export const execute_publishing_plan = async (all_repos, plan, options) => {
|
|
27
28
|
const start_time = Date.now();
|
|
28
29
|
const { wetrun, log, ops = default_gitops_operations } = options;
|
|
30
|
+
// Only npm repos publish; drop any non-npm repos (e.g. cargo) so preflight and the
|
|
31
|
+
// executor's name lookup never touch them. The plan already excludes them too.
|
|
32
|
+
const repos = all_repos.filter(repo_is_npm);
|
|
29
33
|
// Fail loud on an incomplete plan. Executing one with errors would silently skip the
|
|
30
34
|
// affected packages. A wetrun aborts before touching npm or git; a dry run proceeds
|
|
31
35
|
// (no side effects) but the result is not ok (see the summary below).
|
|
@@ -43,7 +47,7 @@ export const execute_publishing_plan = async (repos, plan, options) => {
|
|
|
43
47
|
const preflight_options = {
|
|
44
48
|
skip_changesets: false, // Always check for changesets
|
|
45
49
|
required_branch: 'main',
|
|
46
|
-
log
|
|
50
|
+
log
|
|
47
51
|
};
|
|
48
52
|
const preflight = await ops.preflight.run_preflight_checks({
|
|
49
53
|
repos,
|
|
@@ -51,7 +55,7 @@ export const execute_publishing_plan = async (repos, plan, options) => {
|
|
|
51
55
|
git_ops: ops.git,
|
|
52
56
|
npm_ops: ops.npm,
|
|
53
57
|
build_ops: ops.build,
|
|
54
|
-
changeset_ops: ops.changeset
|
|
58
|
+
changeset_ops: ops.changeset
|
|
55
59
|
});
|
|
56
60
|
if (!preflight.ok) {
|
|
57
61
|
throw new TaskError(`Preflight checks failed: ${preflight.errors.join(', ')}`);
|
|
@@ -122,7 +126,7 @@ export const execute_publishing_plan = async (repos, plan, options) => {
|
|
|
122
126
|
bump_type: version.bump_type,
|
|
123
127
|
breaking: version.breaking,
|
|
124
128
|
commit: version.commit,
|
|
125
|
-
tag: version.tag
|
|
129
|
+
tag: version.tag
|
|
126
130
|
});
|
|
127
131
|
log?.info(wetrun
|
|
128
132
|
? st('green', ` ✅ Published ${pkg_name}@${version.new_version}`)
|
|
@@ -137,9 +141,9 @@ export const execute_publishing_plan = async (repos, plan, options) => {
|
|
|
137
141
|
max_attempts: 30,
|
|
138
142
|
initial_delay: 1000,
|
|
139
143
|
max_delay: 60000,
|
|
140
|
-
timeout: options.max_wait ?? GITOPS_NPM_WAIT_TIMEOUT_DEFAULT
|
|
144
|
+
timeout: options.max_wait ?? GITOPS_NPM_WAIT_TIMEOUT_DEFAULT
|
|
141
145
|
},
|
|
142
|
-
log
|
|
146
|
+
log
|
|
143
147
|
});
|
|
144
148
|
if (!wait_result.ok) {
|
|
145
149
|
// Handle inline (don't throw into the generic catch): the npm-wait failure
|
|
@@ -176,7 +180,7 @@ export const execute_publishing_plan = async (repos, plan, options) => {
|
|
|
176
180
|
dependency: dep_name,
|
|
177
181
|
version: dep_version,
|
|
178
182
|
dep_type: dependency_update_type(plan, dependent_name, dep_name),
|
|
179
|
-
creates_changeset: republishes
|
|
183
|
+
creates_changeset: republishes
|
|
180
184
|
});
|
|
181
185
|
}
|
|
182
186
|
changed_repos.add(dependent_name); // Mark as changed for deployment
|
|
@@ -186,7 +190,7 @@ export const execute_publishing_plan = async (repos, plan, options) => {
|
|
|
186
190
|
published_versions: published, // creates the auto-changeset
|
|
187
191
|
log,
|
|
188
192
|
git_ops: ops.git,
|
|
189
|
-
fs_ops: ops.fs
|
|
193
|
+
fs_ops: ops.fs
|
|
190
194
|
});
|
|
191
195
|
}
|
|
192
196
|
else {
|
|
@@ -195,7 +199,7 @@ export const execute_publishing_plan = async (repos, plan, options) => {
|
|
|
195
199
|
strategy: options.version_strategy || 'caret',
|
|
196
200
|
log,
|
|
197
201
|
git_ops: ops.git,
|
|
198
|
-
fs_ops: ops.fs
|
|
202
|
+
fs_ops: ops.fs
|
|
199
203
|
});
|
|
200
204
|
}
|
|
201
205
|
}
|
|
@@ -211,7 +215,7 @@ export const execute_publishing_plan = async (repos, plan, options) => {
|
|
|
211
215
|
// TODO: emit a precise code once the npm/process ops return typed errors —
|
|
212
216
|
// today a publish-step cause lives in unstructured stderr, so use the honest
|
|
213
217
|
// coarse bucket rather than guessing 'auth'/'network'/'build' from the message.
|
|
214
|
-
code: 'publish'
|
|
218
|
+
code: 'publish'
|
|
215
219
|
});
|
|
216
220
|
log?.error(st('red', ` ❌ Failed to publish ${pkg_name}: ${err.message}`));
|
|
217
221
|
break; // Always fail fast on error
|
|
@@ -240,7 +244,7 @@ export const execute_publishing_plan = async (repos, plan, options) => {
|
|
|
240
244
|
dependency: dep_name,
|
|
241
245
|
version: dep_version,
|
|
242
246
|
dep_type: 'dev',
|
|
243
|
-
creates_changeset: false
|
|
247
|
+
creates_changeset: false // dev-dep updates redeploy without republishing
|
|
244
248
|
});
|
|
245
249
|
}
|
|
246
250
|
changed_repos.add(repo_name); // Mark as changed for deployment
|
|
@@ -251,7 +255,7 @@ export const execute_publishing_plan = async (repos, plan, options) => {
|
|
|
251
255
|
strategy: options.version_strategy || 'caret',
|
|
252
256
|
log,
|
|
253
257
|
git_ops: ops.git,
|
|
254
|
-
fs_ops: ops.fs
|
|
258
|
+
fs_ops: ops.fs
|
|
255
259
|
});
|
|
256
260
|
}
|
|
257
261
|
}
|
|
@@ -274,7 +278,7 @@ export const execute_publishing_plan = async (repos, plan, options) => {
|
|
|
274
278
|
const deploy_result = await ops.process.spawn({
|
|
275
279
|
cmd: 'gro',
|
|
276
280
|
args: ['deploy'],
|
|
277
|
-
cwd: repo.repo_dir
|
|
281
|
+
cwd: repo.repo_dir
|
|
278
282
|
});
|
|
279
283
|
if (deploy_result.ok) {
|
|
280
284
|
emit({ event: 'deploy_completed', name: repo.library.name });
|
|
@@ -340,7 +344,7 @@ export const execute_publishing_plan = async (repos, plan, options) => {
|
|
|
340
344
|
events: capture.events,
|
|
341
345
|
summary,
|
|
342
346
|
plan_errors: plan.errors,
|
|
343
|
-
plan_warnings: plan.warnings
|
|
347
|
+
plan_warnings: plan.warnings
|
|
344
348
|
};
|
|
345
349
|
};
|
|
346
350
|
/**
|
|
@@ -366,14 +370,14 @@ const publish_single_repo = async (repo, options, ops, planned) => {
|
|
|
366
370
|
bump_type: planned.bump_type,
|
|
367
371
|
breaking: planned.breaking,
|
|
368
372
|
commit: 'simulated',
|
|
369
|
-
tag: `v${planned.to}
|
|
373
|
+
tag: `v${planned.to}`
|
|
370
374
|
};
|
|
371
375
|
}
|
|
372
376
|
// Run gro publish with --no-build (builds were validated in preflight checks)
|
|
373
377
|
const publish_result = await ops.process.spawn({
|
|
374
378
|
cmd: 'gro',
|
|
375
379
|
args: ['publish', '--no-build'],
|
|
376
|
-
cwd: repo.repo_dir
|
|
380
|
+
cwd: repo.repo_dir
|
|
377
381
|
});
|
|
378
382
|
if (!publish_result.ok) {
|
|
379
383
|
throw new Error(`Failed to publish ${repo.library.name}: ${publish_result.message}`);
|
|
@@ -401,7 +405,7 @@ const publish_single_repo = async (repo, options, ops, planned) => {
|
|
|
401
405
|
bump_type: planned.bump_type,
|
|
402
406
|
breaking: planned.breaking,
|
|
403
407
|
commit,
|
|
404
|
-
tag: `v${new_version}
|
|
408
|
+
tag: `v${new_version}`
|
|
405
409
|
};
|
|
406
410
|
};
|
|
407
411
|
/**
|
package/dist/npm_registry.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"npm_registry.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/npm_registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"npm_registry.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/npm_registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAKtD,MAAM,WAAW,WAAW;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,uBAAuB,GACnC,KAAK,MAAM,EACX,SAAS,MAAM,EACf,UAAS;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,KAC5B,OAAO,CAAC,OAAO,CAiBjB,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,GAC5B,KAAK,MAAM,EACX,SAAS,MAAM,EACf,UAAS,WAAgB,KACvB,OAAO,CAAC,IAAI,CA2Cd,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,GAC5B,KAAK,MAAM,EACX,UAAS;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,KAC5B,OAAO,CAAC,WAAW,GAAG,IAAI,CAkB5B,CAAC;AAEF,eAAO,MAAM,cAAc,GAC1B,KAAK,MAAM,EACX,UAAS;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,KAC5B,OAAO,CAAC,OAAO,CAGjB,CAAC"}
|