@fuzdev/fuz_gitops 0.78.1 → 0.79.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 +78 -24
- package/dist/ModulesDetail.svelte +15 -22
- package/dist/ModulesDetail.svelte.d.ts.map +1 -1
- package/dist/ModulesNav.svelte +4 -1
- package/dist/ModulesPage.svelte +1 -3
- package/dist/ModulesPage.svelte.d.ts.map +1 -1
- package/dist/PageHeader.svelte +2 -2
- package/dist/PageHeader.svelte.d.ts +0 -3
- package/dist/PageHeader.svelte.d.ts.map +1 -1
- package/dist/PullRequestsDetail.svelte +10 -9
- package/dist/PullRequestsDetail.svelte.d.ts.map +1 -1
- package/dist/PullRequestsPage.svelte +1 -3
- package/dist/PullRequestsPage.svelte.d.ts.map +1 -1
- package/dist/ReposTable.svelte +27 -48
- package/dist/ReposTable.svelte.d.ts.map +1 -1
- package/dist/ReposTree.svelte +5 -19
- package/dist/ReposTree.svelte.d.ts.map +1 -1
- package/dist/ReposTreeNav.svelte +5 -7
- package/dist/ReposTreeNav.svelte.d.ts.map +1 -1
- package/dist/TablePage.svelte +1 -3
- package/dist/TablePage.svelte.d.ts.map +1 -1
- package/dist/TreeItemPage.svelte +1 -3
- package/dist/TreeItemPage.svelte.d.ts.map +1 -1
- package/dist/TreePage.svelte +1 -3
- package/dist/TreePage.svelte.d.ts.map +1 -1
- package/dist/ci_reconcile.d.ts +6 -10
- package/dist/ci_reconcile.d.ts.map +1 -1
- package/dist/ci_reconcile.js +6 -8
- package/dist/dependency_graph.d.ts +26 -49
- package/dist/dependency_graph.d.ts.map +1 -1
- package/dist/dependency_graph.js +37 -80
- package/dist/dependency_updater.d.ts +1 -1
- package/dist/dependency_updater.d.ts.map +1 -1
- package/dist/dependency_updater.js +6 -1
- package/dist/fetch_repo_data.d.ts +34 -8
- package/dist/fetch_repo_data.d.ts.map +1 -1
- package/dist/fetch_repo_data.js +44 -22
- package/dist/fs_fetch_value_cache.d.ts +1 -1
- package/dist/fs_fetch_value_cache.js +1 -1
- package/dist/git_operations.d.ts +6 -49
- package/dist/git_operations.d.ts.map +1 -1
- package/dist/git_operations.js +13 -126
- package/dist/github.d.ts +17 -2
- package/dist/github.d.ts.map +1 -1
- package/dist/github.js +15 -6
- package/dist/github_helpers.d.ts.map +1 -1
- package/dist/github_helpers.js +3 -11
- package/dist/gitops_analyze.task.d.ts +24 -2
- package/dist/gitops_analyze.task.d.ts.map +1 -1
- package/dist/gitops_analyze.task.js +43 -30
- package/dist/gitops_config.d.ts +34 -79
- package/dist/gitops_config.d.ts.map +1 -1
- package/dist/gitops_config.js +76 -53
- package/dist/gitops_constants.d.ts +6 -4
- package/dist/gitops_constants.d.ts.map +1 -1
- package/dist/gitops_constants.js +6 -4
- package/dist/gitops_plan.task.d.ts +29 -3
- package/dist/gitops_plan.task.d.ts.map +1 -1
- package/dist/gitops_plan.task.js +80 -58
- package/dist/gitops_publish.task.d.ts +62 -2
- package/dist/gitops_publish.task.d.ts.map +1 -1
- package/dist/gitops_publish.task.js +187 -102
- package/dist/gitops_run.task.d.ts +74 -0
- package/dist/gitops_run.task.d.ts.map +1 -1
- package/dist/gitops_run.task.js +174 -160
- package/dist/gitops_sync.task.d.ts +65 -3
- package/dist/gitops_sync.task.d.ts.map +1 -1
- package/dist/gitops_sync.task.js +154 -30
- package/dist/gitops_task_helpers.d.ts +86 -59
- package/dist/gitops_task_helpers.d.ts.map +1 -1
- package/dist/gitops_task_helpers.js +120 -79
- package/dist/gitops_validate.task.d.ts +1 -2
- package/dist/gitops_validate.task.d.ts.map +1 -1
- package/dist/gitops_validate.task.js +15 -22
- package/dist/graph_validation.d.ts +16 -27
- package/dist/graph_validation.d.ts.map +1 -1
- package/dist/graph_validation.js +23 -64
- package/dist/local_repo.d.ts +50 -62
- package/dist/local_repo.d.ts.map +1 -1
- package/dist/local_repo.js +80 -193
- package/dist/log_helpers.d.ts +8 -8
- package/dist/log_helpers.d.ts.map +1 -1
- package/dist/multi_repo_publisher.d.ts +10 -0
- package/dist/multi_repo_publisher.d.ts.map +1 -1
- package/dist/multi_repo_publisher.js +115 -51
- package/dist/npm_registry.d.ts +23 -19
- package/dist/npm_registry.d.ts.map +1 -1
- package/dist/npm_registry.js +20 -47
- package/dist/operations.d.ts +75 -180
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +15 -7
- package/dist/operations_defaults.d.ts +17 -2
- package/dist/operations_defaults.d.ts.map +1 -1
- package/dist/operations_defaults.js +104 -121
- package/dist/output_helpers.d.ts +36 -0
- package/dist/output_helpers.d.ts.map +1 -1
- package/dist/output_helpers.js +37 -3
- package/dist/preflight_checks.d.ts +20 -27
- package/dist/preflight_checks.d.ts.map +1 -1
- package/dist/preflight_checks.js +37 -126
- package/dist/publish_steps.d.ts +2 -4
- package/dist/publish_steps.d.ts.map +1 -1
- package/dist/publish_steps.js +2 -6
- package/dist/publishing_event.d.ts +2 -8
- package/dist/publishing_event.d.ts.map +1 -1
- package/dist/publishing_event.js +5 -4
- package/dist/publishing_event_handler.d.ts +10 -8
- package/dist/publishing_event_handler.d.ts.map +1 -1
- package/dist/publishing_event_handler.js +14 -12
- package/dist/publishing_plan.d.ts +16 -1
- package/dist/publishing_plan.d.ts.map +1 -1
- package/dist/publishing_plan.js +328 -250
- 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 +21 -14
- package/dist/repo.svelte.d.ts +7 -0
- package/dist/repo.svelte.d.ts.map +1 -1
- package/dist/repo.svelte.js +3 -0
- package/dist/repo_readiness.d.ts +210 -0
- package/dist/repo_readiness.d.ts.map +1 -0
- package/dist/repo_readiness.js +516 -0
- package/dist/repos_status.d.ts +3340 -0
- package/dist/repos_status.d.ts.map +1 -0
- package/dist/repos_status.js +555 -0
- package/dist/repos_status_load.d.ts +65 -0
- package/dist/repos_status_load.d.ts.map +1 -0
- package/dist/repos_status_load.js +131 -0
- package/package.json +7 -27
- package/src/lib/ci_reconcile.ts +7 -11
- package/src/lib/dependency_graph.ts +45 -97
- package/src/lib/dependency_updater.ts +7 -1
- package/src/lib/fetch_repo_data.ts +66 -29
- package/src/lib/fs_fetch_value_cache.ts +1 -1
- package/src/lib/git_operations.ts +15 -187
- package/src/lib/github.ts +20 -8
- package/src/lib/github_helpers.ts +5 -12
- package/src/lib/gitops_analyze.task.ts +79 -41
- package/src/lib/gitops_config.ts +88 -137
- package/src/lib/gitops_constants.ts +6 -4
- package/src/lib/gitops_plan.task.ts +113 -61
- package/src/lib/gitops_publish.task.ts +255 -122
- package/src/lib/gitops_run.task.ts +250 -178
- package/src/lib/gitops_sync.task.ts +208 -33
- package/src/lib/gitops_task_helpers.ts +166 -110
- package/src/lib/gitops_validate.task.ts +17 -27
- package/src/lib/graph_validation.ts +25 -86
- package/src/lib/local_repo.ts +109 -316
- package/src/lib/log_helpers.ts +8 -18
- package/src/lib/multi_repo_publisher.ts +138 -53
- package/src/lib/npm_registry.ts +37 -62
- package/src/lib/operations.ts +78 -150
- package/src/lib/operations_defaults.ts +108 -154
- package/src/lib/output_helpers.ts +55 -3
- package/src/lib/preflight_checks.ts +47 -183
- package/src/lib/publish_steps.ts +15 -13
- package/src/lib/publishing_event.ts +5 -4
- package/src/lib/publishing_event_handler.ts +18 -16
- package/src/lib/publishing_plan.ts +451 -287
- package/src/lib/publishing_plan_logging.ts +32 -23
- package/src/lib/repo.svelte.ts +8 -0
- package/src/lib/repo_readiness.ts +647 -0
- package/src/lib/repos_status.ts +671 -0
- package/src/lib/repos_status_load.ts +173 -0
- package/dist/config_reconcile.d.ts +0 -46
- package/dist/config_reconcile.d.ts.map +0 -1
- package/dist/config_reconcile.js +0 -64
- package/dist/paths.d.ts +0 -7
- package/dist/paths.d.ts.map +0 -1
- package/dist/paths.js +0 -6
- package/dist/repo_ops.d.ts +0 -59
- package/dist/repo_ops.d.ts.map +0 -1
- package/dist/repo_ops.js +0 -170
- package/dist/resolved_gitops_config.d.ts +0 -9
- package/dist/resolved_gitops_config.d.ts.map +0 -1
- package/dist/resolved_gitops_config.js +0 -12
- package/src/lib/config_reconcile.ts +0 -98
- package/src/lib/paths.ts +0 -6
- package/src/lib/repo_ops.ts +0 -216
- package/src/lib/resolved_gitops_config.ts +0 -27
package/src/lib/repo_ops.ts
DELETED
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generic repository operations for scripts that work across repos.
|
|
3
|
-
*
|
|
4
|
-
* Provides lightweight utilities for:
|
|
5
|
-
* - Getting repo paths from gitops config (without full git sync)
|
|
6
|
-
* - Walking files in repos with sensible exclusions
|
|
7
|
-
* - Common exclusion patterns for node/svelte projects
|
|
8
|
-
*
|
|
9
|
-
* For full git sync/clone functionality, use `get_gitops_ready()` from `gitops_task_helpers`.
|
|
10
|
-
*
|
|
11
|
-
* @module
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { existsSync } from 'node:fs';
|
|
15
|
-
import { readdir, stat } from 'node:fs/promises';
|
|
16
|
-
import { join, resolve, dirname } from 'node:path';
|
|
17
|
-
|
|
18
|
-
import { load_gitops_config } from './gitops_config.ts';
|
|
19
|
-
import { DEFAULT_REPOS_DIR } from './paths.ts';
|
|
20
|
-
import { GITOPS_CONFIG_PATH_DEFAULT } from './gitops_constants.ts';
|
|
21
|
-
|
|
22
|
-
/** Default directories to exclude from file walking */
|
|
23
|
-
export const DEFAULT_EXCLUDE_DIRS = [
|
|
24
|
-
'node_modules',
|
|
25
|
-
'.git',
|
|
26
|
-
'.gro',
|
|
27
|
-
'.svelte-kit',
|
|
28
|
-
'.deno',
|
|
29
|
-
'.vscode',
|
|
30
|
-
'.idea',
|
|
31
|
-
'dist',
|
|
32
|
-
'build',
|
|
33
|
-
'coverage',
|
|
34
|
-
'.cache',
|
|
35
|
-
'.turbo'
|
|
36
|
-
] as const;
|
|
37
|
-
|
|
38
|
-
/** Default binary/non-text extensions to exclude from content processing */
|
|
39
|
-
export const DEFAULT_EXCLUDE_EXTENSIONS = [
|
|
40
|
-
'.png',
|
|
41
|
-
'.jpg',
|
|
42
|
-
'.jpeg',
|
|
43
|
-
'.gif',
|
|
44
|
-
'.svg',
|
|
45
|
-
'.ico',
|
|
46
|
-
'.webp',
|
|
47
|
-
'.woff',
|
|
48
|
-
'.woff2',
|
|
49
|
-
'.ttf',
|
|
50
|
-
'.eot',
|
|
51
|
-
'.mp4',
|
|
52
|
-
'.webm',
|
|
53
|
-
'.mp3',
|
|
54
|
-
'.wav',
|
|
55
|
-
'.ogg',
|
|
56
|
-
'.zip',
|
|
57
|
-
'.tar',
|
|
58
|
-
'.gz',
|
|
59
|
-
'.lock',
|
|
60
|
-
'.pdf'
|
|
61
|
-
] as const;
|
|
62
|
-
|
|
63
|
-
export interface WalkOptions {
|
|
64
|
-
/** Additional directories to exclude (merged with defaults) */
|
|
65
|
-
exclude_dirs?: Array<string>;
|
|
66
|
-
/** Additional extensions to exclude (merged with defaults) */
|
|
67
|
-
exclude_extensions?: Array<string>;
|
|
68
|
-
/** Maximum file size in bytes (default: 10MB) */
|
|
69
|
-
max_file_size?: number;
|
|
70
|
-
/** Include directories in output (default: false) */
|
|
71
|
-
include_dirs?: boolean;
|
|
72
|
-
/** Use only provided exclusions, ignoring defaults */
|
|
73
|
-
no_defaults?: boolean;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export interface RepoPath {
|
|
77
|
-
name: string;
|
|
78
|
-
path: string;
|
|
79
|
-
url: string;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Get repo paths from gitops config without full git sync.
|
|
84
|
-
* Lighter weight than `get_gitops_ready()` - just resolves paths.
|
|
85
|
-
*
|
|
86
|
-
* @param config_path - path to the gitops config file (defaults to `gitops.config.ts`)
|
|
87
|
-
* @returns array of repo info with name, path, and url
|
|
88
|
-
*/
|
|
89
|
-
export const get_repo_paths = async (config_path?: string): Promise<Array<RepoPath>> => {
|
|
90
|
-
const resolved_config_path = resolve(config_path ?? GITOPS_CONFIG_PATH_DEFAULT);
|
|
91
|
-
const config = await load_gitops_config(resolved_config_path);
|
|
92
|
-
|
|
93
|
-
if (!config) {
|
|
94
|
-
throw new Error(`No gitops config found at ${resolved_config_path}`);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const config_dir = dirname(resolved_config_path);
|
|
98
|
-
const repos_dir = resolve(config_dir, config.repos_dir || DEFAULT_REPOS_DIR);
|
|
99
|
-
|
|
100
|
-
const repos: Array<RepoPath> = [];
|
|
101
|
-
|
|
102
|
-
for (const repo_config of config.repos) {
|
|
103
|
-
const url = repo_config.repo_url;
|
|
104
|
-
const name = url.split('/').at(-1);
|
|
105
|
-
if (!name) continue;
|
|
106
|
-
|
|
107
|
-
const path = repo_config.repo_dir
|
|
108
|
-
? resolve(config_dir, repo_config.repo_dir)
|
|
109
|
-
: join(repos_dir, name);
|
|
110
|
-
|
|
111
|
-
if (existsSync(path)) {
|
|
112
|
-
repos.push({ name, path, url });
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return repos;
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Check if a path should be excluded based on options.
|
|
121
|
-
*/
|
|
122
|
-
export const should_exclude_path = (file_path: string, options?: WalkOptions): boolean => {
|
|
123
|
-
const exclude_dirs = options?.no_defaults
|
|
124
|
-
? (options.exclude_dirs ?? [])
|
|
125
|
-
: [...DEFAULT_EXCLUDE_DIRS, ...(options?.exclude_dirs ?? [])];
|
|
126
|
-
|
|
127
|
-
const exclude_extensions = options?.no_defaults
|
|
128
|
-
? (options.exclude_extensions ?? [])
|
|
129
|
-
: [...DEFAULT_EXCLUDE_EXTENSIONS, ...(options?.exclude_extensions ?? [])];
|
|
130
|
-
|
|
131
|
-
const normalized = file_path.toLowerCase();
|
|
132
|
-
|
|
133
|
-
// Check excluded directories
|
|
134
|
-
for (const dir of exclude_dirs) {
|
|
135
|
-
// Must match as a full directory component, not a prefix
|
|
136
|
-
if (normalized.includes(`/${dir}/`) || normalized.endsWith(`/${dir}`)) {
|
|
137
|
-
return true;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// Check excluded extensions
|
|
142
|
-
for (const ext of exclude_extensions) {
|
|
143
|
-
if (normalized.endsWith(ext)) {
|
|
144
|
-
return true;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
return false;
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Walk files in a directory, respecting common exclusions.
|
|
153
|
-
* Yields absolute paths to files (and optionally directories).
|
|
154
|
-
*
|
|
155
|
-
* @param dir - directory to walk
|
|
156
|
-
* @param options - walk options for exclusions and filtering
|
|
157
|
-
*/
|
|
158
|
-
export async function* walk_repo_files(
|
|
159
|
-
dir: string,
|
|
160
|
-
options?: WalkOptions
|
|
161
|
-
): AsyncGenerator<string, void, undefined> {
|
|
162
|
-
const max_file_size = options?.max_file_size ?? 10 * 1024 * 1024;
|
|
163
|
-
const include_dirs = options?.include_dirs ?? false;
|
|
164
|
-
|
|
165
|
-
async function* walk(current_dir: string): AsyncGenerator<string, void, undefined> {
|
|
166
|
-
let entries;
|
|
167
|
-
try {
|
|
168
|
-
entries = await readdir(current_dir, { withFileTypes: true });
|
|
169
|
-
} catch {
|
|
170
|
-
// Skip directories we can't read
|
|
171
|
-
return;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
for (const entry of entries) {
|
|
175
|
-
const full_path = join(current_dir, entry.name);
|
|
176
|
-
|
|
177
|
-
if (should_exclude_path(full_path, options)) {
|
|
178
|
-
continue;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
if (entry.isDirectory()) {
|
|
182
|
-
if (include_dirs) {
|
|
183
|
-
yield full_path;
|
|
184
|
-
}
|
|
185
|
-
yield* walk(full_path);
|
|
186
|
-
} else if (entry.isFile()) {
|
|
187
|
-
// Check file size
|
|
188
|
-
try {
|
|
189
|
-
const file_stat = await stat(full_path);
|
|
190
|
-
if (file_stat.size <= max_file_size) {
|
|
191
|
-
yield full_path;
|
|
192
|
-
}
|
|
193
|
-
} catch {
|
|
194
|
-
// Skip files we can't stat
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
yield* walk(dir);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* Collect all files from `walk_repo_files` into an array.
|
|
205
|
-
* Convenience function for when you need all paths upfront.
|
|
206
|
-
*/
|
|
207
|
-
export const collect_repo_files = async (
|
|
208
|
-
dir: string,
|
|
209
|
-
options?: WalkOptions
|
|
210
|
-
): Promise<Array<string>> => {
|
|
211
|
-
const files: Array<string> = [];
|
|
212
|
-
for await (const file of walk_repo_files(dir, options)) {
|
|
213
|
-
files.push(file);
|
|
214
|
-
}
|
|
215
|
-
return files;
|
|
216
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { GitopsConfig } from './gitops_config.ts';
|
|
2
|
-
import { local_repo_locate, type LocalRepoPath, type LocalRepoMissing } from './local_repo.ts';
|
|
3
|
-
|
|
4
|
-
export interface ResolvedGitopsConfig {
|
|
5
|
-
local_repos: Array<LocalRepoPath | LocalRepoMissing> | null;
|
|
6
|
-
local_repo_paths: Array<LocalRepoPath> | null;
|
|
7
|
-
local_repos_missing: Array<LocalRepoMissing> | null;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const resolve_gitops_config = (
|
|
11
|
-
gitops_config: GitopsConfig,
|
|
12
|
-
repos_dir: string
|
|
13
|
-
): ResolvedGitopsConfig => {
|
|
14
|
-
const local_repos = gitops_config.repos.map((r) =>
|
|
15
|
-
local_repo_locate({ repo_config: r, repos_dir })
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
const local_repo_paths = local_repos.filter((r) => r.type === 'local_repo_path');
|
|
19
|
-
const local_repos_missing = local_repos.filter((r) => r.type === 'local_repo_missing');
|
|
20
|
-
|
|
21
|
-
const config: ResolvedGitopsConfig = {
|
|
22
|
-
local_repos: local_repos.length ? local_repos : null,
|
|
23
|
-
local_repo_paths: local_repo_paths.length ? local_repo_paths : null,
|
|
24
|
-
local_repos_missing: local_repos_missing.length ? local_repos_missing : null
|
|
25
|
-
};
|
|
26
|
-
return config;
|
|
27
|
-
};
|