@fuzdev/fuz_gitops 0.72.0 → 0.74.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -8
- package/dist/PageHeader.svelte +3 -3
- package/dist/PageHeader.svelte.d.ts +3 -3
- package/dist/PageHeader.svelte.d.ts.map +1 -1
- package/dist/changeset_generator.d.ts.map +1 -1
- package/dist/changeset_generator.js +2 -16
- package/dist/changeset_reader.d.ts +1 -1
- package/dist/changeset_reader.d.ts.map +1 -1
- package/dist/changeset_reader.js +1 -1
- package/dist/dependency_graph.d.ts.map +1 -1
- package/dist/dependency_graph.js +6 -6
- package/dist/fetch_repo_data.d.ts.map +1 -1
- package/dist/fetch_repo_data.js +3 -2
- package/dist/git_operations.d.ts +5 -0
- package/dist/git_operations.d.ts.map +1 -1
- package/dist/git_operations.js +5 -0
- package/dist/gitops_analyze.task.d.ts +1 -0
- package/dist/gitops_analyze.task.d.ts.map +1 -1
- package/dist/gitops_analyze.task.js +12 -17
- package/dist/gitops_plan.task.d.ts +1 -0
- package/dist/gitops_plan.task.d.ts.map +1 -1
- package/dist/gitops_plan.task.js +9 -2
- package/dist/gitops_publish.task.d.ts +2 -2
- package/dist/gitops_publish.task.d.ts.map +1 -1
- package/dist/gitops_publish.task.js +83 -28
- package/dist/gitops_run.task.d.ts +2 -1
- package/dist/gitops_run.task.d.ts.map +1 -1
- package/dist/gitops_run.task.js +40 -7
- package/dist/gitops_sync.task.d.ts +1 -0
- package/dist/gitops_sync.task.d.ts.map +1 -1
- package/dist/gitops_sync.task.js +16 -2
- package/dist/gitops_task_helpers.d.ts +16 -2
- package/dist/gitops_task_helpers.d.ts.map +1 -1
- package/dist/gitops_task_helpers.js +11 -3
- package/dist/gitops_validate.task.d.ts +1 -0
- package/dist/gitops_validate.task.d.ts.map +1 -1
- package/dist/gitops_validate.task.js +20 -20
- package/dist/graph_validation.d.ts +16 -1
- package/dist/graph_validation.d.ts.map +1 -1
- package/dist/graph_validation.js +15 -0
- package/dist/local_repo.d.ts +25 -12
- package/dist/local_repo.d.ts.map +1 -1
- package/dist/local_repo.js +99 -79
- package/dist/log_helpers.d.ts +0 -5
- package/dist/log_helpers.d.ts.map +1 -1
- package/dist/log_helpers.js +8 -19
- package/dist/multi_repo_publisher.d.ts +21 -2
- package/dist/multi_repo_publisher.d.ts.map +1 -1
- package/dist/multi_repo_publisher.js +279 -287
- package/dist/operations.d.ts +6 -26
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations_defaults.d.ts.map +1 -1
- package/dist/operations_defaults.js +4 -20
- package/dist/output_helpers.d.ts.map +1 -1
- package/dist/output_helpers.js +7 -6
- package/dist/paths.d.ts +0 -4
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +0 -4
- package/dist/publish_gate.d.ts +44 -0
- package/dist/publish_gate.d.ts.map +1 -0
- package/dist/publish_gate.js +32 -0
- package/dist/publish_steps.d.ts +60 -0
- package/dist/publish_steps.d.ts.map +1 -0
- package/dist/publish_steps.js +113 -0
- package/dist/publishing_event.d.ts +12 -19
- package/dist/publishing_event.d.ts.map +1 -1
- package/dist/publishing_event.js +16 -25
- package/dist/publishing_plan.d.ts +1 -2
- package/dist/publishing_plan.d.ts.map +1 -1
- package/dist/publishing_plan.js +21 -4
- package/dist/publishing_plan_helpers.d.ts +1 -1
- package/dist/publishing_plan_helpers.d.ts.map +1 -1
- package/dist/publishing_plan_helpers.js +2 -15
- package/dist/publishing_plan_logging.d.ts.map +1 -1
- package/dist/publishing_plan_logging.js +15 -23
- package/dist/repo.svelte.d.ts +10 -6
- package/dist/repo.svelte.d.ts.map +1 -1
- package/dist/repo.svelte.js +6 -14
- package/dist/version_utils.d.ts +17 -3
- package/dist/version_utils.d.ts.map +1 -1
- package/dist/version_utils.js +22 -0
- package/package.json +14 -15
- package/src/lib/changeset_generator.ts +10 -19
- package/src/lib/changeset_reader.ts +2 -3
- package/src/lib/dependency_graph.ts +6 -8
- package/src/lib/fetch_repo_data.ts +3 -2
- package/src/lib/git_operations.ts +5 -0
- package/src/lib/gitops_analyze.task.ts +18 -23
- package/src/lib/gitops_plan.task.ts +10 -2
- package/src/lib/gitops_publish.task.ts +92 -27
- package/src/lib/gitops_run.task.ts +39 -7
- package/src/lib/gitops_sync.task.ts +18 -3
- package/src/lib/gitops_task_helpers.ts +20 -3
- package/src/lib/gitops_validate.task.ts +30 -22
- package/src/lib/graph_validation.ts +26 -0
- package/src/lib/local_repo.ts +124 -88
- package/src/lib/log_helpers.ts +8 -26
- package/src/lib/multi_repo_publisher.ts +336 -353
- package/src/lib/operations.ts +6 -22
- package/src/lib/operations_defaults.ts +4 -20
- package/src/lib/output_helpers.ts +7 -6
- package/src/lib/paths.ts +0 -5
- package/src/lib/publish_gate.ts +53 -0
- package/src/lib/publish_steps.ts +149 -0
- package/src/lib/publishing_event.ts +16 -25
- package/src/lib/publishing_plan.ts +26 -6
- package/src/lib/publishing_plan_helpers.ts +5 -18
- package/src/lib/publishing_plan_logging.ts +19 -39
- package/src/lib/repo.svelte.ts +12 -15
- package/src/lib/version_utils.ts +30 -9
- package/dist/npm_install_helpers.d.ts +0 -23
- package/dist/npm_install_helpers.d.ts.map +0 -1
- package/dist/npm_install_helpers.js +0 -60
- package/dist/semver.d.ts +0 -26
- package/dist/semver.d.ts.map +0 -1
- package/dist/semver.js +0 -137
- package/dist/serialization_types.d.ts +0 -59
- package/dist/serialization_types.d.ts.map +0 -1
- package/dist/serialization_types.js +0 -42
- package/src/lib/npm_install_helpers.ts +0 -85
- package/src/lib/semver.ts +0 -170
- package/src/lib/serialization_types.ts +0 -92
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publishing_plan.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/publishing_plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAGpD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"publishing_plan.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/publishing_plan.ts"],"names":[],"mappings":"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"}
|
package/dist/publishing_plan.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { styleText as st } from 'node:util';
|
|
2
2
|
import { validate_dependency_graph } from './graph_validation.js';
|
|
3
|
-
import { is_breaking_change, compare_bump_types, calculate_next_version } from './version_utils.js';
|
|
3
|
+
import { is_breaking_change, compare_bump_types, calculate_next_version, } from './version_utils.js';
|
|
4
4
|
import { default_changeset_operations } from './operations_defaults.js';
|
|
5
5
|
import { GITOPS_MAX_ITERATIONS_DEFAULT } from './gitops_constants.js';
|
|
6
6
|
import { calculate_dependency_updates, get_required_bump_for_dependencies, } from './publishing_plan_helpers.js';
|
|
@@ -70,6 +70,17 @@ export const generate_publishing_plan = async (repos, options = {}) => {
|
|
|
70
70
|
const repo = repos.find((r) => r.library.name === pkg_name);
|
|
71
71
|
if (!repo)
|
|
72
72
|
continue;
|
|
73
|
+
// Private packages never publish — exclude them from version changes entirely (no
|
|
74
|
+
// publish step, npm-wait, bump escalation, or auto-changeset). They keep their slot in
|
|
75
|
+
// the topological order. Flag a private package that carries a changeset, since that
|
|
76
|
+
// changeset can't be published.
|
|
77
|
+
if (repo.package_json.private) {
|
|
78
|
+
const private_has_changesets = await ops.has_changesets({ repo });
|
|
79
|
+
if (private_has_changesets.ok && private_has_changesets.value) {
|
|
80
|
+
warnings.push(`${pkg_name} is private — its changeset(s) will not be published`);
|
|
81
|
+
}
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
73
84
|
// Check for changesets
|
|
74
85
|
const has_result = await ops.has_changesets({ repo });
|
|
75
86
|
if (!has_result.ok) {
|
|
@@ -107,7 +118,7 @@ export const generate_publishing_plan = async (repos, options = {}) => {
|
|
|
107
118
|
}
|
|
108
119
|
}
|
|
109
120
|
{
|
|
110
|
-
const old_version = repo.
|
|
121
|
+
const old_version = repo.package_json.version || '0.0.0';
|
|
111
122
|
const is_breaking = is_breaking_change(old_version, prediction.bump_type);
|
|
112
123
|
predicted_versions.set(pkg_name, prediction.version);
|
|
113
124
|
if (is_breaking) {
|
|
@@ -140,6 +151,10 @@ export const generate_publishing_plan = async (repos, options = {}) => {
|
|
|
140
151
|
// Process packages to check for bump escalation and auto-generated changesets
|
|
141
152
|
for (const repo of repos) {
|
|
142
153
|
const pkg_name = repo.library.name;
|
|
154
|
+
// Private packages are excluded from version changes (they never publish), so they
|
|
155
|
+
// never escalate or auto-generate a changeset.
|
|
156
|
+
if (repo.package_json.private)
|
|
157
|
+
continue;
|
|
143
158
|
// Get required bump from dependencies
|
|
144
159
|
const required_bump = get_required_bump_for_dependencies(repo, dependency_updates, breaking_packages);
|
|
145
160
|
// Find triggering dependency for verbose output
|
|
@@ -158,7 +173,7 @@ export const generate_publishing_plan = async (repos, options = {}) => {
|
|
|
158
173
|
// Package has changesets - check if it needs bump escalation
|
|
159
174
|
if (required_bump && compare_bump_types(required_bump, existing_entry.bump_type) > 0) {
|
|
160
175
|
// Dependencies require a larger bump than existing changesets provide
|
|
161
|
-
const old_version = repo.
|
|
176
|
+
const old_version = repo.package_json.version || '0.0.0';
|
|
162
177
|
const new_version = calculate_next_version(old_version, required_bump);
|
|
163
178
|
// Only mark as changed if version actually changed
|
|
164
179
|
if (existing_entry.to !== new_version) {
|
|
@@ -194,7 +209,7 @@ export const generate_publishing_plan = async (repos, options = {}) => {
|
|
|
194
209
|
}
|
|
195
210
|
else if (required_bump) {
|
|
196
211
|
// No existing changesets but needs changeset for dependency updates
|
|
197
|
-
const old_version = repo.
|
|
212
|
+
const old_version = repo.package_json.version || '0.0.0';
|
|
198
213
|
const new_version = calculate_next_version(old_version, required_bump);
|
|
199
214
|
// Check if this is a new version (not already in version_changes)
|
|
200
215
|
if (!predicted_versions.has(pkg_name)) {
|
|
@@ -248,6 +263,8 @@ export const generate_publishing_plan = async (repos, options = {}) => {
|
|
|
248
263
|
const { dependency_updates: pending_updates } = calculate_dependency_updates(repos, predicted_versions, breaking_packages);
|
|
249
264
|
for (const repo of repos) {
|
|
250
265
|
const pkg_name = repo.library.name;
|
|
266
|
+
if (repo.package_json.private)
|
|
267
|
+
continue; // private packages never publish
|
|
251
268
|
const required_bump = get_required_bump_for_dependencies(repo, pending_updates, breaking_packages);
|
|
252
269
|
// Check if this package would need processing
|
|
253
270
|
const existing_entry = version_changes.find((vc) => vc.package_name === pkg_name);
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
8
|
import type { LocalRepo } from './local_repo.js';
|
|
9
|
-
import type
|
|
9
|
+
import { type BumpType } from './version_utils.js';
|
|
10
10
|
import type { DependencyUpdate } from './publishing_plan.js';
|
|
11
11
|
/**
|
|
12
12
|
* Calculates all dependency updates between packages based on predicted versions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publishing_plan_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/publishing_plan_helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"publishing_plan_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/publishing_plan_helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAoD,KAAK,QAAQ,EAAC,MAAM,oBAAoB,CAAC;AACpG,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AAE3D;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,GACxC,OAAO,KAAK,CAAC,SAAS,CAAC,EACvB,oBAAoB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACvC,mBAAmB,GAAG,CAAC,MAAM,CAAC,KAC5B;IACF,kBAAkB,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC5C,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;CAwE9C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kCAAkC,GAC9C,MAAM,SAAS,EACf,oBAAoB,KAAK,CAAC,gBAAgB,CAAC,EAC3C,mBAAmB,GAAG,CAAC,MAAM,CAAC,KAC5B,QAAQ,GAAG,IAqBb,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
|
-
import { needs_update } from './version_utils.js';
|
|
8
|
+
import { needs_update, required_bump_for_dependency_update } from './version_utils.js';
|
|
9
9
|
/**
|
|
10
10
|
* Calculates all dependency updates between packages based on predicted versions.
|
|
11
11
|
*
|
|
@@ -29,7 +29,6 @@ export const calculate_dependency_updates = (repos, predicted_versions, breaking
|
|
|
29
29
|
current_version,
|
|
30
30
|
new_version,
|
|
31
31
|
type: 'dependencies',
|
|
32
|
-
causes_republish: true,
|
|
33
32
|
});
|
|
34
33
|
if (breaking_packages.has(dep_name)) {
|
|
35
34
|
const cascades = breaking_cascades.get(dep_name) || [];
|
|
@@ -52,7 +51,6 @@ export const calculate_dependency_updates = (repos, predicted_versions, breaking
|
|
|
52
51
|
current_version,
|
|
53
52
|
new_version,
|
|
54
53
|
type: 'peerDependencies',
|
|
55
|
-
causes_republish: true,
|
|
56
54
|
});
|
|
57
55
|
if (breaking_packages.has(dep_name)) {
|
|
58
56
|
const cascades = breaking_cascades.get(dep_name) || [];
|
|
@@ -75,7 +73,6 @@ export const calculate_dependency_updates = (repos, predicted_versions, breaking
|
|
|
75
73
|
current_version,
|
|
76
74
|
new_version,
|
|
77
75
|
type: 'devDependencies',
|
|
78
|
-
causes_republish: false,
|
|
79
76
|
});
|
|
80
77
|
}
|
|
81
78
|
}
|
|
@@ -100,15 +97,5 @@ export const get_required_bump_for_dependencies = (repo, dependency_updates, bre
|
|
|
100
97
|
}
|
|
101
98
|
// Check if any of these dependencies have breaking changes
|
|
102
99
|
const has_breaking_deps = relevant_updates.some((update) => breaking_packages.has(update.updated_dependency));
|
|
103
|
-
|
|
104
|
-
const [major] = current_version.split('.').map(Number);
|
|
105
|
-
const is_pre_1_0 = major === 0;
|
|
106
|
-
if (has_breaking_deps) {
|
|
107
|
-
// Breaking changes propagate
|
|
108
|
-
// Pre-1.0: use minor for breaking changes
|
|
109
|
-
// 1.0+: use major for breaking changes
|
|
110
|
-
return is_pre_1_0 ? 'minor' : 'major';
|
|
111
|
-
}
|
|
112
|
-
// For non-breaking dependency updates, use patch
|
|
113
|
-
return 'patch';
|
|
100
|
+
return required_bump_for_dependency_update(repo.package_json.version || '0.0.0', has_breaking_deps);
|
|
114
101
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publishing_plan_logging.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/publishing_plan_logging.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAGpD,OAAO,KAAK,EACX,cAAc,EAQd,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,cAAc;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AA2GD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC/B,MAAM,cAAc,EACpB,KAAK,MAAM,EACX,UAAS,cAAmB,KAC1B,
|
|
1
|
+
{"version":3,"file":"publishing_plan_logging.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/publishing_plan_logging.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAGpD,OAAO,KAAK,EACX,cAAc,EAQd,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,cAAc;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AA2GD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC/B,MAAM,cAAc,EACpB,KAAK,MAAM,EACX,UAAS,cAAmB,KAC1B,IA6IF,CAAC"}
|
|
@@ -120,31 +120,23 @@ export const log_publishing_plan = (plan, log, options = {}) => {
|
|
|
120
120
|
const with_changesets = ordered_changes.filter((vc) => vc.has_changesets && !vc.needs_bump_escalation);
|
|
121
121
|
const with_escalation = ordered_changes.filter((vc) => vc.needs_bump_escalation);
|
|
122
122
|
const with_auto_changesets = ordered_changes.filter((vc) => vc.will_generate_changeset);
|
|
123
|
-
//
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
123
|
+
// A single running counter across all groups so positions read 1..N with no
|
|
124
|
+
// gaps. (Numbering per-group index would make the first group skip the numbers
|
|
125
|
+
// that land in a later group, e.g. jump from `[9/12]` to `[11/12]`.)
|
|
126
|
+
const total = with_changesets.length + with_escalation.length + with_auto_changesets.length;
|
|
127
|
+
let position = 0;
|
|
128
|
+
const log_change_group = (title, color, changes) => {
|
|
129
|
+
if (changes.length === 0)
|
|
130
|
+
return;
|
|
131
|
+
log.info(st(color, title));
|
|
132
|
+
for (const change of changes) {
|
|
133
|
+
log_version_change_with_diffs(change, position++, total, dependency_updates, breaking_cascades, log);
|
|
129
134
|
}
|
|
130
135
|
log.info('');
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
const idx = ordered_changes.indexOf(change);
|
|
136
|
-
log_version_change_with_diffs(change, idx, ordered_changes.length, dependency_updates, breaking_cascades, log);
|
|
137
|
-
}
|
|
138
|
-
log.info('');
|
|
139
|
-
}
|
|
140
|
-
if (with_auto_changesets.length > 0) {
|
|
141
|
-
log.info(st('cyan', 'Version Changes (auto-generated):'));
|
|
142
|
-
for (const change of with_auto_changesets) {
|
|
143
|
-
const idx = ordered_changes.indexOf(change);
|
|
144
|
-
log_version_change_with_diffs(change, idx, ordered_changes.length, dependency_updates, breaking_cascades, log);
|
|
145
|
-
}
|
|
146
|
-
log.info('');
|
|
147
|
-
}
|
|
136
|
+
};
|
|
137
|
+
log_change_group('Version Changes (from changesets):', 'cyan', with_changesets);
|
|
138
|
+
log_change_group('Version Changes (bump escalation):', 'yellow', with_escalation);
|
|
139
|
+
log_change_group('Version Changes (auto-generated):', 'cyan', with_auto_changesets);
|
|
148
140
|
}
|
|
149
141
|
else {
|
|
150
142
|
log.info(st('dim', 'No packages to publish'));
|
package/dist/repo.svelte.d.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import type { LibraryJson, SourceJson } from '@fuzdev/fuz_util/library_json.js';
|
|
2
|
+
import type { PkgJson } from '@fuzdev/fuz_util/pkg_json.js';
|
|
2
3
|
import type { PackageJson } from '@fuzdev/fuz_util/package_json.js';
|
|
3
4
|
import type { Url } from '@fuzdev/fuz_util/url.js';
|
|
4
5
|
import { Library } from '@fuzdev/fuz_ui/library.svelte.js';
|
|
5
|
-
import type { Module } from '@fuzdev/fuz_ui/module.svelte.js';
|
|
6
6
|
import { GithubCheckRunsItem, type GithubPullRequest } from './github.js';
|
|
7
7
|
/**
|
|
8
8
|
* Serialized repo data as stored in `repos.ts` (JSON).
|
|
9
|
+
*
|
|
10
|
+
* `package_json` is the repo's full `package.json`, carried alongside
|
|
11
|
+
* `library_json` because gitops reads `dependencies`/`devDependencies` for the
|
|
12
|
+
* publishing cascade — fields the curated `LibraryJson.pkg_json` omits.
|
|
9
13
|
*/
|
|
10
14
|
export interface RepoJson {
|
|
11
15
|
library_json: LibraryJson;
|
|
16
|
+
package_json: PackageJson;
|
|
12
17
|
check_runs: GithubCheckRunsItem | null;
|
|
13
18
|
pull_requests: Array<GithubPullRequest> | null;
|
|
14
19
|
}
|
|
@@ -20,22 +25,21 @@ export interface RepoJson {
|
|
|
20
25
|
*/
|
|
21
26
|
export declare class Repo {
|
|
22
27
|
readonly library: Library;
|
|
28
|
+
/** The repo's full `package.json` (with `dependencies`/`devDependencies`). */
|
|
29
|
+
readonly package_json: PackageJson;
|
|
23
30
|
check_runs: GithubCheckRunsItem | null;
|
|
24
31
|
pull_requests: Array<GithubPullRequest> | null;
|
|
25
32
|
get name(): string;
|
|
26
33
|
get repo_name(): string;
|
|
27
34
|
get repo_url(): Url;
|
|
28
|
-
get owner_name(): string | null;
|
|
29
35
|
get homepage_url(): Url | null;
|
|
30
36
|
get logo_url(): Url | null;
|
|
31
37
|
get logo_alt(): string;
|
|
32
|
-
get published(): boolean;
|
|
33
38
|
get npm_url(): Url | null;
|
|
34
39
|
get changelog_url(): Url | null;
|
|
35
|
-
|
|
40
|
+
/** Curated package identity, delegating to `library`. Distinct from the full `package_json`. */
|
|
41
|
+
get pkg_json(): PkgJson;
|
|
36
42
|
get source_json(): SourceJson;
|
|
37
|
-
get modules(): Array<Module>;
|
|
38
|
-
get org_url(): string | null;
|
|
39
43
|
constructor(repo_json: RepoJson);
|
|
40
44
|
}
|
|
41
45
|
export interface Repos {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/repo.svelte.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,WAAW,EAAE,UAAU,EAAC,MAAM,kCAAkC,CAAC;AAC9E,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"repo.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/repo.svelte.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,WAAW,EAAE,UAAU,EAAC,MAAM,kCAAkC,CAAC;AAC9E,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,8BAA8B,CAAC;AAC1D,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAC,OAAO,EAAC,MAAM,kCAAkC,CAAC;AAEzD,OAAO,EAAC,mBAAmB,EAAE,KAAK,iBAAiB,EAAC,MAAM,aAAa,CAAC;AAExE;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACxB,YAAY,EAAE,WAAW,CAAC;IAC1B,YAAY,EAAE,WAAW,CAAC;IAC1B,UAAU,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACvC,aAAa,EAAE,KAAK,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;CAC/C;AAED;;;;;GAKG;AACH,qBAAa,IAAI;IAChB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,8EAA8E;IAC9E,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC;IACnC,UAAU,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACvC,aAAa,EAAE,KAAK,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;IAG/C,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,SAAS,IAAI,MAAM,CAEtB;IACD,IAAI,QAAQ,IAAI,GAAG,CAElB;IACD,IAAI,YAAY,IAAI,GAAG,GAAG,IAAI,CAE7B;IACD,IAAI,QAAQ,IAAI,GAAG,GAAG,IAAI,CAEzB;IACD,IAAI,QAAQ,IAAI,MAAM,CAErB;IACD,IAAI,OAAO,IAAI,GAAG,GAAG,IAAI,CAExB;IACD,IAAI,aAAa,IAAI,GAAG,GAAG,IAAI,CAE9B;IACD,gGAAgG;IAChG,IAAI,QAAQ,IAAI,OAAO,CAEtB;IACD,IAAI,WAAW,IAAI,UAAU,CAE5B;gBAEW,SAAS,EAAE,QAAQ;CAM/B;AAED,MAAM,WAAW,KAAK;IACrB,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;CACnB;AAED,eAAO,MAAM,aAAa;;;;CAA0B,CAAC;AAErD,eAAO,MAAM,WAAW,GAAI,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,cAAc,MAAM,KAAG,KAMtE,CAAC"}
|
package/dist/repo.svelte.js
CHANGED
|
@@ -9,6 +9,8 @@ import { GithubCheckRunsItem } from './github.js';
|
|
|
9
9
|
*/
|
|
10
10
|
export class Repo {
|
|
11
11
|
library;
|
|
12
|
+
/** The repo's full `package.json` (with `dependencies`/`devDependencies`). */
|
|
13
|
+
package_json;
|
|
12
14
|
check_runs;
|
|
13
15
|
pull_requests;
|
|
14
16
|
// Convenience getters delegating to library
|
|
@@ -21,9 +23,6 @@ export class Repo {
|
|
|
21
23
|
get repo_url() {
|
|
22
24
|
return this.library.repo_url;
|
|
23
25
|
}
|
|
24
|
-
get owner_name() {
|
|
25
|
-
return this.library.owner_name;
|
|
26
|
-
}
|
|
27
26
|
get homepage_url() {
|
|
28
27
|
return this.library.homepage_url;
|
|
29
28
|
}
|
|
@@ -33,29 +32,22 @@ export class Repo {
|
|
|
33
32
|
get logo_alt() {
|
|
34
33
|
return this.library.logo_alt;
|
|
35
34
|
}
|
|
36
|
-
get published() {
|
|
37
|
-
return this.library.published;
|
|
38
|
-
}
|
|
39
35
|
get npm_url() {
|
|
40
36
|
return this.library.npm_url;
|
|
41
37
|
}
|
|
42
38
|
get changelog_url() {
|
|
43
39
|
return this.library.changelog_url;
|
|
44
40
|
}
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
/** Curated package identity, delegating to `library`. Distinct from the full `package_json`. */
|
|
42
|
+
get pkg_json() {
|
|
43
|
+
return this.library.pkg_json;
|
|
47
44
|
}
|
|
48
45
|
get source_json() {
|
|
49
46
|
return this.library.source_json;
|
|
50
47
|
}
|
|
51
|
-
get modules() {
|
|
52
|
-
return this.library.modules;
|
|
53
|
-
}
|
|
54
|
-
get org_url() {
|
|
55
|
-
return this.library.org_url;
|
|
56
|
-
}
|
|
57
48
|
constructor(repo_json) {
|
|
58
49
|
this.library = new Library(repo_json.library_json);
|
|
50
|
+
this.package_json = repo_json.package_json;
|
|
59
51
|
this.check_runs = repo_json.check_runs;
|
|
60
52
|
this.pull_requests = repo_json.pull_requests;
|
|
61
53
|
}
|
package/dist/version_utils.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/** A semver bump kind: `major`, `minor`, or `patch`. */
|
|
2
|
+
export type BumpType = 'major' | 'minor' | 'patch';
|
|
2
3
|
export declare const is_wildcard: (version: string) => boolean;
|
|
3
4
|
/**
|
|
4
5
|
* Strips version prefix (^, ~, >=, <=, etc) from a version string.
|
|
@@ -47,8 +48,21 @@ export declare const get_update_prefix: (current_version: string, default_strate
|
|
|
47
48
|
* Pre-1.0: minor bumps are breaking
|
|
48
49
|
* 1.0+: major bumps are breaking
|
|
49
50
|
*/
|
|
50
|
-
export declare const is_breaking_change: (old_version: string, bump_type:
|
|
51
|
-
|
|
51
|
+
export declare const is_breaking_change: (old_version: string, bump_type: BumpType) => boolean;
|
|
52
|
+
/**
|
|
53
|
+
* The bump a package must take when one of its prod/peer dependencies updates.
|
|
54
|
+
* Pre-1.0: `minor` for a breaking dependency, otherwise `patch`.
|
|
55
|
+
* 1.0+: `major` for a breaking dependency, otherwise `patch`.
|
|
56
|
+
*
|
|
57
|
+
* Single source of truth for the dependency-driven bump rule, shared by the plan
|
|
58
|
+
* (`get_required_bump_for_dependencies`) and the auto-changeset generator
|
|
59
|
+
* (`calculate_required_bump`) so the two never drift.
|
|
60
|
+
*
|
|
61
|
+
* @param current_version - the package's current version, used to detect the pre-1.0 regime
|
|
62
|
+
* @param has_breaking_deps - whether any updated dependency is a breaking change
|
|
63
|
+
*/
|
|
64
|
+
export declare const required_bump_for_dependency_update: (current_version: string, has_breaking_deps: boolean) => BumpType;
|
|
65
|
+
export declare const detect_bump_type: (old_version: string, new_version: string) => BumpType;
|
|
52
66
|
/**
|
|
53
67
|
* Compares bump types. Returns positive if a > b, negative if a < b, 0 if equal.
|
|
54
68
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version_utils.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/version_utils.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"version_utils.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/version_utils.ts"],"names":[],"mappings":"AAEA,wDAAwD;AACxD,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAEnD,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,KAAG,OAE7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,MAAM,KAAG,MAEtD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,KAAG,MAGpD,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,gCAAgC,GAAI,SAAS,MAAM,KAAG,MAWlE,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,SAAS,MAAM,EAAE,aAAa,MAAM,KAAG,OASnE,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,GAC7B,iBAAiB,MAAM,EACvB,mBAAkB,GAAG,GAAG,GAAG,GAAG,EAAE,GAAG,IAAU,KAC3C,MAcF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,aAAa,MAAM,EAAE,WAAW,QAAQ,KAAG,OAW7E,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mCAAmC,GAC/C,iBAAiB,MAAM,EACvB,mBAAmB,OAAO,KACxB,QASF,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,aAAa,MAAM,EAAE,aAAa,MAAM,KAAG,QAO3E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,GAAG,QAAQ,EAAE,GAAG,QAAQ,KAAG,MAO7D,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,iBAAiB,MAAM,EAAE,WAAW,QAAQ,KAAG,MAkBrF,CAAC"}
|
package/dist/version_utils.js
CHANGED
|
@@ -96,6 +96,28 @@ export const is_breaking_change = (old_version, bump_type) => {
|
|
|
96
96
|
return bump_type === 'major';
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
|
+
/**
|
|
100
|
+
* The bump a package must take when one of its prod/peer dependencies updates.
|
|
101
|
+
* Pre-1.0: `minor` for a breaking dependency, otherwise `patch`.
|
|
102
|
+
* 1.0+: `major` for a breaking dependency, otherwise `patch`.
|
|
103
|
+
*
|
|
104
|
+
* Single source of truth for the dependency-driven bump rule, shared by the plan
|
|
105
|
+
* (`get_required_bump_for_dependencies`) and the auto-changeset generator
|
|
106
|
+
* (`calculate_required_bump`) so the two never drift.
|
|
107
|
+
*
|
|
108
|
+
* @param current_version - the package's current version, used to detect the pre-1.0 regime
|
|
109
|
+
* @param has_breaking_deps - whether any updated dependency is a breaking change
|
|
110
|
+
*/
|
|
111
|
+
export const required_bump_for_dependency_update = (current_version, has_breaking_deps) => {
|
|
112
|
+
const [major] = current_version.split('.').map(Number);
|
|
113
|
+
const is_pre_1_0 = major === 0;
|
|
114
|
+
if (has_breaking_deps) {
|
|
115
|
+
// Breaking changes propagate: pre-1.0 uses minor, 1.0+ uses major
|
|
116
|
+
return is_pre_1_0 ? 'minor' : 'major';
|
|
117
|
+
}
|
|
118
|
+
// Non-breaking dependency updates only need a patch
|
|
119
|
+
return 'patch';
|
|
120
|
+
};
|
|
99
121
|
export const detect_bump_type = (old_version, new_version) => {
|
|
100
122
|
const old_parts = old_version.split('.').map(Number);
|
|
101
123
|
const new_parts = new_version.split('.').map(Number);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuzdev/fuz_gitops",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.74.0",
|
|
4
4
|
"description": "a tool for managing many repos",
|
|
5
5
|
"glyph": "🪄",
|
|
6
6
|
"logo": "logo.svg",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"node": ">=24.14"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@fuzdev/fuz_css": ">=0.
|
|
33
|
-
"@fuzdev/fuz_ui": ">=0.
|
|
34
|
-
"@fuzdev/fuz_util": ">=0.
|
|
35
|
-
"@fuzdev/gro": ">=0.
|
|
32
|
+
"@fuzdev/fuz_css": ">=0.62.0",
|
|
33
|
+
"@fuzdev/fuz_ui": ">=0.199.0",
|
|
34
|
+
"@fuzdev/fuz_util": ">=0.65.1",
|
|
35
|
+
"@fuzdev/gro": ">=0.204.0",
|
|
36
36
|
"@sveltejs/kit": "^2",
|
|
37
37
|
"svelte": "^5",
|
|
38
38
|
"zod": "^4.3.6"
|
|
@@ -40,16 +40,15 @@
|
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@changesets/changelog-git": "^0.2.1",
|
|
42
42
|
"@fuzdev/blake3_wasm": "^0.1.1",
|
|
43
|
-
"@fuzdev/fuz_code": "^0.
|
|
44
|
-
"@fuzdev/fuz_css": "^0.
|
|
45
|
-
"@fuzdev/fuz_ui": "^0.
|
|
46
|
-
"@fuzdev/fuz_util": "^0.
|
|
47
|
-
"@fuzdev/gro": "^0.
|
|
48
|
-
"@jridgewell/trace-mapping": "^0.3.31",
|
|
43
|
+
"@fuzdev/fuz_code": "^0.46.0",
|
|
44
|
+
"@fuzdev/fuz_css": "^0.62.0",
|
|
45
|
+
"@fuzdev/fuz_ui": "^0.199.0",
|
|
46
|
+
"@fuzdev/fuz_util": "^0.65.1",
|
|
47
|
+
"@fuzdev/gro": "^0.204.0",
|
|
49
48
|
"@ryanatkn/eslint-config": "^0.12.1",
|
|
50
49
|
"@sveltejs/acorn-typescript": "^1.0.9",
|
|
51
50
|
"@sveltejs/adapter-static": "^3.0.10",
|
|
52
|
-
"@sveltejs/kit": "^2.
|
|
51
|
+
"@sveltejs/kit": "^2.63.0",
|
|
53
52
|
"@sveltejs/package": "^2.5.7",
|
|
54
53
|
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
55
54
|
"@types/estree": "^1.0.8",
|
|
@@ -61,9 +60,9 @@
|
|
|
61
60
|
"magic-string": "^0.30.21",
|
|
62
61
|
"prettier": "^3.7.4",
|
|
63
62
|
"prettier-plugin-svelte": "^3.5.1",
|
|
64
|
-
"svelte": "^5.56.
|
|
65
|
-
"svelte-check": "^4.
|
|
66
|
-
"svelte-docinfo": "^0.
|
|
63
|
+
"svelte": "^5.56.2",
|
|
64
|
+
"svelte-check": "^4.6.0",
|
|
65
|
+
"svelte-docinfo": "^0.4.0",
|
|
67
66
|
"svelte2tsx": "^0.7.52",
|
|
68
67
|
"tslib": "^2.8.1",
|
|
69
68
|
"typescript": "^5.9.3",
|
|
@@ -11,7 +11,11 @@ import {join} from 'node:path';
|
|
|
11
11
|
import type {Logger} from '@fuzdev/fuz_util/log.js';
|
|
12
12
|
import type {LocalRepo} from './local_repo.js';
|
|
13
13
|
import type {PublishedVersion} from './multi_repo_publisher.js';
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
strip_version_prefix,
|
|
16
|
+
required_bump_for_dependency_update,
|
|
17
|
+
type BumpType,
|
|
18
|
+
} from './version_utils.js';
|
|
15
19
|
import type {FsOperations} from './operations.js';
|
|
16
20
|
import {default_fs_operations} from './operations_defaults.js';
|
|
17
21
|
|
|
@@ -69,24 +73,11 @@ export const create_changeset_for_dependency_updates = async (
|
|
|
69
73
|
const calculate_required_bump = (
|
|
70
74
|
repo: LocalRepo,
|
|
71
75
|
updates: Array<DependencyVersionChange>,
|
|
72
|
-
):
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
// Check if any dependency had breaking changes
|
|
78
|
-
const has_breaking = updates.some((u) => u.breaking);
|
|
79
|
-
|
|
80
|
-
if (has_breaking) {
|
|
81
|
-
// Breaking changes propagate
|
|
82
|
-
// Pre-1.0: use minor for breaking changes
|
|
83
|
-
// 1.0+: use major for breaking changes
|
|
84
|
-
return is_pre_1_0 ? 'minor' : 'major';
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// For non-breaking dependency updates, always use patch
|
|
88
|
-
return 'patch';
|
|
89
|
-
};
|
|
76
|
+
): BumpType =>
|
|
77
|
+
required_bump_for_dependency_update(
|
|
78
|
+
repo.package_json.version || '0.0.0',
|
|
79
|
+
updates.some((u) => u.breaking),
|
|
80
|
+
);
|
|
90
81
|
|
|
91
82
|
/**
|
|
92
83
|
* Generates markdown changeset content for dependency updates.
|
|
@@ -13,8 +13,7 @@ import {readdir, readFile} from 'node:fs/promises';
|
|
|
13
13
|
import {join} from 'node:path';
|
|
14
14
|
|
|
15
15
|
import type {LocalRepo} from './local_repo.js';
|
|
16
|
-
import type
|
|
17
|
-
import {compare_bump_types, calculate_next_version} from './version_utils.js';
|
|
16
|
+
import {compare_bump_types, calculate_next_version, type BumpType} from './version_utils.js';
|
|
18
17
|
|
|
19
18
|
export interface ChangesetInfo {
|
|
20
19
|
filename: string;
|
|
@@ -208,7 +207,7 @@ export const predict_next_version = async (
|
|
|
208
207
|
return null;
|
|
209
208
|
}
|
|
210
209
|
|
|
211
|
-
const current_version = repo.
|
|
210
|
+
const current_version = repo.package_json.version || '0.0.0';
|
|
212
211
|
const next_version = calculate_next_version(current_version, bump_type);
|
|
213
212
|
|
|
214
213
|
log?.debug(
|
|
@@ -59,22 +59,20 @@ export class DependencyGraph {
|
|
|
59
59
|
public init_from_repos(repos: Array<LocalRepo>): void {
|
|
60
60
|
// First pass: create nodes
|
|
61
61
|
for (const repo of repos) {
|
|
62
|
-
const {library} = repo;
|
|
62
|
+
const {library, package_json} = repo;
|
|
63
63
|
const node: DependencyNode = {
|
|
64
64
|
name: library.name,
|
|
65
|
-
version:
|
|
65
|
+
version: package_json.version || '0.0.0',
|
|
66
66
|
repo,
|
|
67
67
|
dependencies: new Map(),
|
|
68
68
|
dependents: new Set(),
|
|
69
|
-
publishable:
|
|
69
|
+
publishable: !package_json.private,
|
|
70
70
|
};
|
|
71
71
|
|
|
72
72
|
// Extract dependencies
|
|
73
|
-
const deps =
|
|
74
|
-
const dev_deps =
|
|
75
|
-
|
|
76
|
-
const peer_deps =
|
|
77
|
-
library.package_json.peerDependencies || (EMPTY_OBJECT as Record<string, string>);
|
|
73
|
+
const deps = package_json.dependencies || (EMPTY_OBJECT as Record<string, string>);
|
|
74
|
+
const dev_deps = package_json.devDependencies || (EMPTY_OBJECT as Record<string, string>);
|
|
75
|
+
const peer_deps = package_json.peerDependencies || (EMPTY_OBJECT as Record<string, string>);
|
|
78
76
|
|
|
79
77
|
// Add dependencies, prioritizing prod/peer over dev
|
|
80
78
|
// (if a package appears in multiple dep types, use the stronger constraint)
|
|
@@ -28,7 +28,7 @@ export const fetch_repo_data = async (
|
|
|
28
28
|
github_api_version?: string,
|
|
29
29
|
): Promise<Array<RepoJson>> => {
|
|
30
30
|
const repos: Array<RepoJson> = [];
|
|
31
|
-
for (const {library,
|
|
31
|
+
for (const {library, package_json, repo_config} of resolved_repos) {
|
|
32
32
|
const repo_url = library.repo_url;
|
|
33
33
|
|
|
34
34
|
// CI status
|
|
@@ -53,7 +53,8 @@ export const fetch_repo_data = async (
|
|
|
53
53
|
if (!pull_requests) log?.error('failed to fetch issues: ' + repo_url);
|
|
54
54
|
|
|
55
55
|
repos.push({
|
|
56
|
-
library_json,
|
|
56
|
+
library_json: library.library_json,
|
|
57
|
+
package_json,
|
|
57
58
|
check_runs,
|
|
58
59
|
pull_requests,
|
|
59
60
|
});
|
|
@@ -84,6 +84,11 @@ export const git_push_tag = async (
|
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Returns `true` if the working tree has any changes — staged, unstaged, or
|
|
89
|
+
* untracked (`git status --porcelain`). Broader than `git_list_uncommitted_files`,
|
|
90
|
+
* which reports only tracked working-tree changes relative to HEAD.
|
|
91
|
+
*/
|
|
87
92
|
export const git_has_changes = async (options?: SpawnOptions): Promise<boolean> => {
|
|
88
93
|
const {stdout} = await spawn_out('git', ['status', '--porcelain'], options);
|
|
89
94
|
return stdout ? stdout.trim().length > 0 : false;
|