@fuzdev/fuz_gitops 0.68.0 → 0.70.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 +3 -3
- package/dist/ModulesDetail.svelte +14 -14
- package/dist/ModulesNav.svelte +2 -2
- package/dist/PageFooter.svelte +1 -1
- package/dist/ReposTable.svelte +1 -1
- package/dist/ReposTree.svelte +7 -7
- package/dist/TablePage.svelte +1 -7
- package/dist/TreeItemPage.svelte +3 -3
- package/dist/TreePage.svelte +3 -3
- package/dist/changeset_generator.d.ts +4 -4
- package/dist/changeset_generator.js +5 -5
- package/dist/changeset_reader.d.ts +6 -4
- package/dist/changeset_reader.d.ts.map +1 -1
- package/dist/changeset_reader.js +7 -5
- package/dist/dependency_graph.d.ts +3 -3
- package/dist/dependency_graph.js +3 -3
- package/dist/dependency_updater.d.ts +4 -4
- package/dist/dependency_updater.js +5 -5
- package/dist/fetch_repo_data.d.ts +4 -4
- package/dist/fetch_repo_data.d.ts.map +1 -1
- package/dist/fetch_repo_data.js +4 -5
- package/dist/fs_fetch_value_cache.d.ts +4 -4
- package/dist/fs_fetch_value_cache.js +4 -4
- package/dist/git_operations.d.ts +5 -5
- package/dist/git_operations.d.ts.map +1 -1
- package/dist/git_operations.js +18 -18
- package/dist/github.d.ts +1 -1
- package/dist/github.js +0 -1
- package/dist/gitops_analyze.task.d.ts +1 -1
- package/dist/gitops_plan.task.d.ts +4 -4
- package/dist/gitops_plan.task.js +3 -3
- package/dist/gitops_publish.task.d.ts +1 -1
- package/dist/gitops_run.task.d.ts +1 -1
- package/dist/gitops_run.task.js +2 -2
- package/dist/gitops_task_helpers.d.ts +5 -5
- package/dist/gitops_task_helpers.js +5 -5
- package/dist/graph_validation.d.ts +5 -5
- package/dist/graph_validation.js +5 -5
- package/dist/local_repo.d.ts +6 -6
- package/dist/local_repo.d.ts.map +1 -1
- package/dist/local_repo.js +22 -26
- package/dist/multi_repo_publisher.d.ts.map +1 -1
- package/dist/multi_repo_publisher.js +4 -4
- package/dist/npm_install_helpers.d.ts +3 -3
- package/dist/npm_install_helpers.js +3 -3
- package/dist/npm_registry.d.ts +4 -4
- package/dist/npm_registry.js +5 -6
- package/dist/operations.d.ts +19 -17
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +1 -1
- package/dist/operations_defaults.d.ts.map +1 -1
- package/dist/operations_defaults.js +49 -14
- package/dist/output_helpers.d.ts +2 -2
- package/dist/output_helpers.js +2 -2
- package/dist/paths.d.ts +1 -1
- package/dist/paths.js +1 -1
- package/dist/preflight_checks.d.ts +2 -2
- package/dist/preflight_checks.js +7 -7
- package/dist/publishing_plan.js +4 -4
- package/dist/publishing_plan_helpers.d.ts +1 -1
- package/dist/publishing_plan_helpers.js +1 -1
- package/dist/repo.svelte.d.ts +4 -5
- package/dist/repo.svelte.d.ts.map +1 -1
- package/dist/repo.svelte.js +2 -2
- package/dist/repo_ops.d.ts +6 -6
- package/dist/repo_ops.js +7 -7
- package/dist/version_utils.d.ts +2 -2
- package/dist/version_utils.js +2 -2
- package/package.json +18 -16
- package/src/lib/changeset_generator.ts +5 -5
- package/src/lib/changeset_reader.ts +7 -5
- package/src/lib/dependency_graph.ts +3 -3
- package/src/lib/dependency_updater.ts +5 -5
- package/src/lib/fetch_repo_data.ts +4 -6
- package/src/lib/fs_fetch_value_cache.ts +4 -4
- package/src/lib/git_operations.ts +32 -18
- package/src/lib/github.ts +1 -2
- package/src/lib/gitops_plan.task.ts +3 -3
- package/src/lib/gitops_run.task.ts +2 -2
- package/src/lib/gitops_task_helpers.ts +5 -5
- package/src/lib/graph_validation.ts +5 -5
- package/src/lib/local_repo.ts +28 -30
- package/src/lib/multi_repo_publisher.ts +4 -6
- package/src/lib/npm_install_helpers.ts +3 -3
- package/src/lib/npm_registry.ts +6 -6
- package/src/lib/operations.ts +19 -17
- package/src/lib/operations_defaults.ts +47 -16
- package/src/lib/output_helpers.ts +2 -2
- package/src/lib/paths.ts +1 -1
- package/src/lib/preflight_checks.ts +7 -7
- package/src/lib/publishing_plan.ts +4 -4
- package/src/lib/publishing_plan_helpers.ts +1 -1
- package/src/lib/repo.svelte.ts +4 -5
- package/src/lib/repo_ops.ts +7 -7
- package/src/lib/version_utils.ts +2 -2
package/src/lib/operations.ts
CHANGED
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
* ```
|
|
30
30
|
*
|
|
31
31
|
* See `operations_defaults.ts` for real implementations.
|
|
32
|
-
* See test files (
|
|
32
|
+
* See test files (`*.test.ts`) for mock implementations.
|
|
33
33
|
*
|
|
34
34
|
* @module
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
37
|
import type {Result} from '@fuzdev/fuz_util/result.js';
|
|
38
|
+
import type {FsError} from '@fuzdev/fuz_util/fs.js';
|
|
38
39
|
import type {Logger} from '@fuzdev/fuz_util/log.js';
|
|
39
|
-
import type {SpawnOptions} from 'node:child_process';
|
|
40
40
|
import type {LocalRepo} from './local_repo.js';
|
|
41
41
|
import type {ChangesetInfo} from './changeset_reader.js';
|
|
42
42
|
import type {BumpType} from './semver.js';
|
|
@@ -67,7 +67,7 @@ export interface ChangesetOperations {
|
|
|
67
67
|
/**
|
|
68
68
|
* Predicts the next version based on changesets.
|
|
69
69
|
* Returns null if no changesets found (expected, not an error).
|
|
70
|
-
* Returns error Result if changesets exist but can't be read/parsed.
|
|
70
|
+
* Returns error `Result` if changesets exist but can't be read/parsed.
|
|
71
71
|
*/
|
|
72
72
|
predict_next_version: (options: {
|
|
73
73
|
repo: LocalRepo;
|
|
@@ -161,9 +161,13 @@ export interface GitOperations {
|
|
|
161
161
|
has_changes: (options?: {cwd?: string}) => Promise<Result<{value: boolean}, {message: string}>>;
|
|
162
162
|
|
|
163
163
|
/**
|
|
164
|
-
*
|
|
164
|
+
* Lists uncommitted files in the working tree (`git diff --name-only HEAD`).
|
|
165
|
+
*
|
|
166
|
+
* Renamed from `get_changed_files` in 2026-04 because "changed files" collided
|
|
167
|
+
* with mageguild's `get_changed_files` which diffs two refs. This one reports
|
|
168
|
+
* uncommitted working-tree changes relative to HEAD.
|
|
165
169
|
*/
|
|
166
|
-
|
|
170
|
+
list_uncommitted_files: (options?: {
|
|
167
171
|
cwd?: string;
|
|
168
172
|
}) => Promise<Result<{value: Array<string>}, {message: string}>>;
|
|
169
173
|
|
|
@@ -216,7 +220,7 @@ export interface ProcessOperations {
|
|
|
216
220
|
spawn: (options: {
|
|
217
221
|
cmd: string;
|
|
218
222
|
args: Array<string>;
|
|
219
|
-
|
|
223
|
+
cwd?: string;
|
|
220
224
|
}) => Promise<Result<{stdout?: string; stderr?: string}, {message: string; stderr?: string}>>;
|
|
221
225
|
}
|
|
222
226
|
|
|
@@ -225,7 +229,7 @@ export interface ProcessOperations {
|
|
|
225
229
|
*/
|
|
226
230
|
export interface BuildOperations {
|
|
227
231
|
/**
|
|
228
|
-
* Builds a package using gro build
|
|
232
|
+
* Builds a package using `gro build`.
|
|
229
233
|
*/
|
|
230
234
|
build_package: (options: {
|
|
231
235
|
repo: LocalRepo;
|
|
@@ -302,6 +306,10 @@ export interface PreflightOperations {
|
|
|
302
306
|
|
|
303
307
|
/**
|
|
304
308
|
* File system operations for reading and writing files.
|
|
309
|
+
*
|
|
310
|
+
* Errors are typed via `FsError` (`not_found | permission_denied |
|
|
311
|
+
* already_exists | io_error`) so callers can branch on `kind` instead of
|
|
312
|
+
* regex-matching `message`. See `@fuzdev/fuz_util/fs.js`.
|
|
305
313
|
*/
|
|
306
314
|
export interface FsOperations {
|
|
307
315
|
/**
|
|
@@ -310,28 +318,22 @@ export interface FsOperations {
|
|
|
310
318
|
readFile: (options: {
|
|
311
319
|
path: string;
|
|
312
320
|
encoding: BufferEncoding;
|
|
313
|
-
}) => Promise<Result<{value: string},
|
|
321
|
+
}) => Promise<Result<{value: string}, FsError>>;
|
|
314
322
|
|
|
315
323
|
/**
|
|
316
324
|
* Writes a file to the file system.
|
|
317
325
|
*/
|
|
318
|
-
writeFile: (options: {
|
|
319
|
-
path: string;
|
|
320
|
-
content: string;
|
|
321
|
-
}) => Promise<Result<object, {message: string}>>;
|
|
326
|
+
writeFile: (options: {path: string; content: string}) => Promise<Result<object, FsError>>;
|
|
322
327
|
|
|
323
328
|
/**
|
|
324
329
|
* Creates a directory, optionally with recursive creation.
|
|
325
330
|
*/
|
|
326
|
-
mkdir: (options: {
|
|
327
|
-
path: string;
|
|
328
|
-
recursive?: boolean;
|
|
329
|
-
}) => Promise<Result<object, {message: string}>>;
|
|
331
|
+
mkdir: (options: {path: string; recursive?: boolean}) => Promise<Result<object, FsError>>;
|
|
330
332
|
|
|
331
333
|
/**
|
|
332
334
|
* Checks if a path exists on the file system.
|
|
333
335
|
*/
|
|
334
|
-
exists: (options: {path: string}) => boolean
|
|
336
|
+
exists: (options: {path: string}) => Promise<boolean>;
|
|
335
337
|
}
|
|
336
338
|
|
|
337
339
|
/**
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
import {readFile, writeFile, mkdir} from 'node:fs/promises';
|
|
12
|
-
import {existsSync} from 'node:fs';
|
|
10
|
+
import {spawn_out} from '@fuzdev/fuz_util/process.js';
|
|
11
|
+
import {readFile, writeFile, mkdir, stat} from 'node:fs/promises';
|
|
13
12
|
import {git_checkout, type GitBranch, type GitOrigin} from '@fuzdev/fuz_util/git.js';
|
|
13
|
+
import {fs_classify_error} from '@fuzdev/fuz_util/fs.js';
|
|
14
14
|
import {EMPTY_OBJECT} from '@fuzdev/fuz_util/object.js';
|
|
15
15
|
|
|
16
16
|
import {has_changesets, read_changesets, predict_next_version} from './changeset_reader.js';
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
git_tag,
|
|
24
24
|
git_push_tag,
|
|
25
25
|
git_has_changes,
|
|
26
|
-
|
|
26
|
+
git_list_uncommitted_files,
|
|
27
27
|
git_has_file_changed,
|
|
28
28
|
git_stash,
|
|
29
29
|
git_stash_pop,
|
|
@@ -118,9 +118,20 @@ export const default_git_operations: GitOperations = {
|
|
|
118
118
|
|
|
119
119
|
pull: async (options) => {
|
|
120
120
|
const {origin, branch, cwd} = options ?? EMPTY_OBJECT;
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
try {
|
|
122
|
+
const spawned = await spawn_out(
|
|
123
|
+
'git',
|
|
124
|
+
['pull', origin || 'origin', branch || ''],
|
|
125
|
+
cwd ? {cwd} : undefined,
|
|
126
|
+
);
|
|
127
|
+
if (spawned.result.ok) {
|
|
128
|
+
return {ok: true};
|
|
129
|
+
} else {
|
|
130
|
+
return {ok: false, message: spawned.stderr || 'Pull failed'};
|
|
131
|
+
}
|
|
132
|
+
} catch (error) {
|
|
133
|
+
return {ok: false, message: String(error)};
|
|
134
|
+
}
|
|
124
135
|
},
|
|
125
136
|
|
|
126
137
|
switch_branch: async (options) => {
|
|
@@ -154,9 +165,9 @@ export const default_git_operations: GitOperations = {
|
|
|
154
165
|
return wrap_with_value(() => git_has_changes(cwd ? {cwd} : undefined));
|
|
155
166
|
},
|
|
156
167
|
|
|
157
|
-
|
|
168
|
+
list_uncommitted_files: async (options) => {
|
|
158
169
|
const {cwd} = options ?? EMPTY_OBJECT;
|
|
159
|
-
return wrap_with_value(() =>
|
|
170
|
+
return wrap_with_value(() => git_list_uncommitted_files(cwd ? {cwd} : undefined));
|
|
160
171
|
},
|
|
161
172
|
|
|
162
173
|
// Tagging
|
|
@@ -192,9 +203,9 @@ export const default_git_operations: GitOperations = {
|
|
|
192
203
|
|
|
193
204
|
export const default_process_operations: ProcessOperations = {
|
|
194
205
|
spawn: async (options) => {
|
|
195
|
-
const {cmd, args,
|
|
206
|
+
const {cmd, args, cwd} = options;
|
|
196
207
|
try {
|
|
197
|
-
const spawned = await spawn_out(cmd, args,
|
|
208
|
+
const spawned = await spawn_out(cmd, args, cwd ? {cwd} : undefined);
|
|
198
209
|
if (spawned.result.ok) {
|
|
199
210
|
return {
|
|
200
211
|
ok: true,
|
|
@@ -294,21 +305,41 @@ export const default_preflight_operations: PreflightOperations = {
|
|
|
294
305
|
export const default_fs_operations: FsOperations = {
|
|
295
306
|
readFile: async (options) => {
|
|
296
307
|
const {path, encoding} = options;
|
|
297
|
-
|
|
308
|
+
try {
|
|
309
|
+
const value = await readFile(path, encoding);
|
|
310
|
+
return {ok: true, value};
|
|
311
|
+
} catch (error) {
|
|
312
|
+
return {ok: false, ...fs_classify_error(error)};
|
|
313
|
+
}
|
|
298
314
|
},
|
|
299
315
|
|
|
300
316
|
writeFile: async (options) => {
|
|
301
317
|
const {path, content} = options;
|
|
302
|
-
|
|
318
|
+
try {
|
|
319
|
+
await writeFile(path, content);
|
|
320
|
+
return {ok: true};
|
|
321
|
+
} catch (error) {
|
|
322
|
+
return {ok: false, ...fs_classify_error(error)};
|
|
323
|
+
}
|
|
303
324
|
},
|
|
304
325
|
|
|
305
326
|
mkdir: async (options) => {
|
|
306
327
|
const {path, recursive} = options;
|
|
307
|
-
|
|
328
|
+
try {
|
|
329
|
+
await mkdir(path, {recursive});
|
|
330
|
+
return {ok: true};
|
|
331
|
+
} catch (error) {
|
|
332
|
+
return {ok: false, ...fs_classify_error(error)};
|
|
333
|
+
}
|
|
308
334
|
},
|
|
309
335
|
|
|
310
|
-
exists: (options) => {
|
|
311
|
-
|
|
336
|
+
exists: async (options) => {
|
|
337
|
+
try {
|
|
338
|
+
await stat(options.path);
|
|
339
|
+
return true;
|
|
340
|
+
} catch {
|
|
341
|
+
return false;
|
|
342
|
+
}
|
|
312
343
|
},
|
|
313
344
|
};
|
|
314
345
|
|
|
@@ -22,11 +22,11 @@ export interface OutputFormatters<T> {
|
|
|
22
22
|
* Formats data and outputs to file or stdout based on options.
|
|
23
23
|
*
|
|
24
24
|
* Supports three formats:
|
|
25
|
-
* - stdout: Uses logger for colored/styled output (cannot use with
|
|
25
|
+
* - stdout: Uses logger for colored/styled output (cannot use with `--outfile`)
|
|
26
26
|
* - json: Stringified JSON
|
|
27
27
|
* - markdown: Formatted markdown text
|
|
28
28
|
*
|
|
29
|
-
* @throws {Error} if stdout format used with outfile
|
|
29
|
+
* @throws {Error} if stdout format used with `outfile`, or if logger missing for stdout
|
|
30
30
|
*/
|
|
31
31
|
export const format_and_output = async <T>(
|
|
32
32
|
data: T,
|
package/src/lib/paths.ts
CHANGED
|
@@ -6,6 +6,6 @@ export const GITOPS_OUTPUT_DIR = '.gro/fuz_gitops';
|
|
|
6
6
|
/**
|
|
7
7
|
* Default repos directory relative to gitops config file.
|
|
8
8
|
* Resolves to the parent of the directory with the config
|
|
9
|
-
* (e.g.,
|
|
9
|
+
* (e.g., `~/dev/repo/gitops.config.ts` resolves to `~/dev/`).
|
|
10
10
|
*/
|
|
11
11
|
export const DEFAULT_REPOS_DIR = '..';
|
|
@@ -51,7 +51,7 @@ export interface RunPreflightChecksOptions {
|
|
|
51
51
|
* Performs comprehensive pre-flight validation:
|
|
52
52
|
* - Clean workspaces (100% clean required - no uncommitted changes)
|
|
53
53
|
* - Correct branch (usually main)
|
|
54
|
-
* - Changesets present (unless skip_changesets
|
|
54
|
+
* - Changesets present (unless `skip_changesets`=true)
|
|
55
55
|
* - Builds successful (fail-fast to prevent broken state)
|
|
56
56
|
* - Git remote reachability
|
|
57
57
|
* - NPM authentication with username
|
|
@@ -60,7 +60,7 @@ export interface RunPreflightChecksOptions {
|
|
|
60
60
|
* Build validation runs BEFORE any publishing to prevent the scenario where
|
|
61
61
|
* version is bumped but build fails, leaving repo in broken state.
|
|
62
62
|
*
|
|
63
|
-
* @returns result with ok
|
|
63
|
+
* @returns result with `ok`=false if any errors, plus warnings and detailed status
|
|
64
64
|
*/
|
|
65
65
|
export const run_preflight_checks = async ({
|
|
66
66
|
repos,
|
|
@@ -91,7 +91,7 @@ export const run_preflight_checks = async ({
|
|
|
91
91
|
// 1. Check clean workspaces - must be 100% clean before publishing
|
|
92
92
|
log?.info(' Checking workspace cleanliness...');
|
|
93
93
|
for (const repo of repos) {
|
|
94
|
-
const clean_result = await git_ops.check_clean_workspace({cwd: repo.repo_dir});
|
|
94
|
+
const clean_result = await git_ops.check_clean_workspace({cwd: repo.repo_dir});
|
|
95
95
|
if (!clean_result.ok) {
|
|
96
96
|
errors.push(`${repo.library.name} failed workspace check: ${clean_result.message}`);
|
|
97
97
|
continue;
|
|
@@ -99,7 +99,7 @@ export const run_preflight_checks = async ({
|
|
|
99
99
|
|
|
100
100
|
if (!clean_result.value) {
|
|
101
101
|
// Get list of changed files for better error message
|
|
102
|
-
const files_result = await git_ops.
|
|
102
|
+
const files_result = await git_ops.list_uncommitted_files({cwd: repo.repo_dir});
|
|
103
103
|
if (files_result.ok) {
|
|
104
104
|
// No filtering - workspace must be 100% clean
|
|
105
105
|
const unexpected_files = files_result.value;
|
|
@@ -118,7 +118,7 @@ export const run_preflight_checks = async ({
|
|
|
118
118
|
// 2. Check correct branch
|
|
119
119
|
log?.info(` Checking branches (expecting ${required_branch})...`);
|
|
120
120
|
for (const repo of repos) {
|
|
121
|
-
const branch_result = await git_ops.current_branch_name({cwd: repo.repo_dir});
|
|
121
|
+
const branch_result = await git_ops.current_branch_name({cwd: repo.repo_dir});
|
|
122
122
|
if (!branch_result.ok) {
|
|
123
123
|
errors.push(`${repo.library.name} failed branch check: ${branch_result.message}`);
|
|
124
124
|
continue;
|
|
@@ -135,7 +135,7 @@ export const run_preflight_checks = async ({
|
|
|
135
135
|
if (!skip_changesets) {
|
|
136
136
|
log?.info(' Checking for changesets...');
|
|
137
137
|
for (const repo of repos) {
|
|
138
|
-
const has_result = await changeset_ops.has_changesets({repo});
|
|
138
|
+
const has_result = await changeset_ops.has_changesets({repo});
|
|
139
139
|
if (!has_result.ok) {
|
|
140
140
|
errors.push(`${repo.library.name} failed changeset check: ${has_result.message}`);
|
|
141
141
|
continue;
|
|
@@ -164,7 +164,7 @@ export const run_preflight_checks = async ({
|
|
|
164
164
|
log?.info(
|
|
165
165
|
st('dim', ` [${i + 1}/${repos_to_build.length}] Building ${repo.library.name}...`),
|
|
166
166
|
);
|
|
167
|
-
const build_result = await build_ops.build_package({repo, log});
|
|
167
|
+
const build_result = await build_ops.build_package({repo, log});
|
|
168
168
|
if (!build_result.ok) {
|
|
169
169
|
errors.push(
|
|
170
170
|
`${repo.library.name} failed to build: ${build_result.output || build_result.message || 'unknown error'}`,
|
|
@@ -179,7 +179,7 @@ export const generate_publishing_plan = async (
|
|
|
179
179
|
if (!repo) continue;
|
|
180
180
|
|
|
181
181
|
// Check for changesets
|
|
182
|
-
const has_result = await ops.has_changesets({repo});
|
|
182
|
+
const has_result = await ops.has_changesets({repo});
|
|
183
183
|
|
|
184
184
|
if (!has_result.ok) {
|
|
185
185
|
errors.push(`Failed to check changesets for ${pkg_name}: ${has_result.message}`);
|
|
@@ -188,7 +188,7 @@ export const generate_publishing_plan = async (
|
|
|
188
188
|
|
|
189
189
|
if (has_result.value) {
|
|
190
190
|
// Predict version from changesets
|
|
191
|
-
const prediction = await ops.predict_next_version({repo, log});
|
|
191
|
+
const prediction = await ops.predict_next_version({repo, log});
|
|
192
192
|
|
|
193
193
|
if (!prediction) {
|
|
194
194
|
// No changesets found - this shouldn't happen since has_changesets returned true
|
|
@@ -202,7 +202,7 @@ export const generate_publishing_plan = async (
|
|
|
202
202
|
|
|
203
203
|
// Capture changeset details for verbose output
|
|
204
204
|
if (verbose) {
|
|
205
|
-
const changesets_result = await ops.read_changesets({repo, log});
|
|
205
|
+
const changesets_result = await ops.read_changesets({repo, log});
|
|
206
206
|
if (changesets_result.ok) {
|
|
207
207
|
const files = changesets_result.value
|
|
208
208
|
.filter((cs) => cs.packages.some((p) => p.name === pkg_name))
|
|
@@ -445,7 +445,7 @@ export const generate_publishing_plan = async (
|
|
|
445
445
|
for (const repo of repos) {
|
|
446
446
|
const has_version_change = version_changes.some((vc) => vc.package_name === repo.library.name);
|
|
447
447
|
if (!has_version_change) {
|
|
448
|
-
const has_result = await ops.has_changesets({repo});
|
|
448
|
+
const has_result = await ops.has_changesets({repo});
|
|
449
449
|
if (has_result.ok && !has_result.value) {
|
|
450
450
|
info.push(repo.library.name);
|
|
451
451
|
}
|
package/src/lib/repo.svelte.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {create_context} from '@fuzdev/fuz_ui/context_helpers.js';
|
|
2
|
-
import type {LibraryJson} from '@fuzdev/fuz_util/library_json.js';
|
|
2
|
+
import type {LibraryJson, SourceJson} from '@fuzdev/fuz_util/library_json.js';
|
|
3
3
|
import type {PackageJson} from '@fuzdev/fuz_util/package_json.js';
|
|
4
|
-
import type {SourceJson} from '@fuzdev/fuz_util/source_json.js';
|
|
5
4
|
import type {Url} from '@fuzdev/fuz_util/url.js';
|
|
6
5
|
import {Library} from '@fuzdev/fuz_ui/library.svelte.js';
|
|
7
6
|
import type {Module} from '@fuzdev/fuz_ui/module.svelte.js';
|
|
@@ -9,7 +8,7 @@ import type {Module} from '@fuzdev/fuz_ui/module.svelte.js';
|
|
|
9
8
|
import {GithubCheckRunsItem, type GithubPullRequest} from './github.js';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
|
-
* Serialized repo data as stored in repos.ts (JSON).
|
|
11
|
+
* Serialized repo data as stored in `repos.ts` (JSON).
|
|
13
12
|
*/
|
|
14
13
|
export interface RepoJson {
|
|
15
14
|
library_json: LibraryJson;
|
|
@@ -18,9 +17,9 @@ export interface RepoJson {
|
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
/**
|
|
21
|
-
* Runtime repo with Library composition for package metadata.
|
|
20
|
+
* Runtime repo with `Library` composition for package metadata.
|
|
22
21
|
*
|
|
23
|
-
* Wraps a Library instance and adds GitHub-specific data (CI status, PRs).
|
|
22
|
+
* Wraps a `Library` instance and adds GitHub-specific data (CI status, PRs).
|
|
24
23
|
* Convenience getters delegate to `this.library.*` for common properties.
|
|
25
24
|
*/
|
|
26
25
|
export class Repo {
|
package/src/lib/repo_ops.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - Walking files in repos with sensible exclusions
|
|
7
7
|
* - Common exclusion patterns for node/svelte projects
|
|
8
8
|
*
|
|
9
|
-
* For full git sync/clone functionality, use `get_gitops_ready()` from gitops_task_helpers
|
|
9
|
+
* For full git sync/clone functionality, use `get_gitops_ready()` from `gitops_task_helpers`.
|
|
10
10
|
*
|
|
11
11
|
* @module
|
|
12
12
|
*/
|
|
@@ -83,8 +83,8 @@ export interface RepoPath {
|
|
|
83
83
|
* Get repo paths from gitops config without full git sync.
|
|
84
84
|
* Lighter weight than `get_gitops_ready()` - just resolves paths.
|
|
85
85
|
*
|
|
86
|
-
* @param config_path
|
|
87
|
-
* @returns
|
|
86
|
+
* @param config_path - path to `gitops.config.ts` (defaults to `./gitops.config.ts`)
|
|
87
|
+
* @returns array of repo info with name, path, and url
|
|
88
88
|
*/
|
|
89
89
|
export const get_repo_paths = async (config_path?: string): Promise<Array<RepoPath>> => {
|
|
90
90
|
const resolved_config_path = resolve(config_path ?? GITOPS_CONFIG_PATH_DEFAULT);
|
|
@@ -152,8 +152,8 @@ export const should_exclude_path = (file_path: string, options?: WalkOptions): b
|
|
|
152
152
|
* Walk files in a directory, respecting common exclusions.
|
|
153
153
|
* Yields absolute paths to files (and optionally directories).
|
|
154
154
|
*
|
|
155
|
-
* @param dir
|
|
156
|
-
* @param options
|
|
155
|
+
* @param dir - directory to walk
|
|
156
|
+
* @param options - walk options for exclusions and filtering
|
|
157
157
|
*/
|
|
158
158
|
export async function* walk_repo_files(
|
|
159
159
|
dir: string,
|
|
@@ -186,7 +186,7 @@ export async function* walk_repo_files(
|
|
|
186
186
|
} else if (entry.isFile()) {
|
|
187
187
|
// Check file size
|
|
188
188
|
try {
|
|
189
|
-
const file_stat = await stat(full_path);
|
|
189
|
+
const file_stat = await stat(full_path);
|
|
190
190
|
if (file_stat.size <= max_file_size) {
|
|
191
191
|
yield full_path;
|
|
192
192
|
}
|
|
@@ -201,7 +201,7 @@ export async function* walk_repo_files(
|
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
/**
|
|
204
|
-
* Collect all files from walk_repo_files into an array.
|
|
204
|
+
* Collect all files from `walk_repo_files` into an array.
|
|
205
205
|
* Convenience function for when you need all paths upfront.
|
|
206
206
|
*/
|
|
207
207
|
export const collect_repo_files = async (
|
package/src/lib/version_utils.ts
CHANGED
|
@@ -25,7 +25,7 @@ export const get_version_prefix = (version: string): string => {
|
|
|
25
25
|
* Normalizes version string for comparison.
|
|
26
26
|
*
|
|
27
27
|
* Strips prefixes (^, ~, >=) to get bare version number.
|
|
28
|
-
* Handles wildcards as-is. Used by needs_update to compare versions.
|
|
28
|
+
* Handles wildcards as-is. Used by `needs_update` to compare versions.
|
|
29
29
|
*
|
|
30
30
|
* @example
|
|
31
31
|
* ```ts
|
|
@@ -74,7 +74,7 @@ export const needs_update = (current: string, new_version: string): boolean => {
|
|
|
74
74
|
*
|
|
75
75
|
* This preserves user intent while handling wildcard replacements sensibly.
|
|
76
76
|
*
|
|
77
|
-
* @param default_strategy prefix to use when no existing prefix found
|
|
77
|
+
* @param default_strategy - prefix to use when no existing prefix found
|
|
78
78
|
*/
|
|
79
79
|
export const get_update_prefix = (
|
|
80
80
|
current_version: string,
|