@fuzdev/fuz_gitops 0.78.0 → 0.78.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- package/dist/ModulesDetail.svelte +14 -12
- package/dist/ModulesDetail.svelte.d.ts.map +1 -1
- package/dist/ModulesNav.svelte +6 -6
- package/dist/ModulesNav.svelte.d.ts.map +1 -1
- package/dist/ModulesPage.svelte +2 -2
- package/dist/ModulesPage.svelte.d.ts.map +1 -1
- package/dist/PageFooter.svelte +2 -2
- package/dist/PageHeader.svelte +5 -5
- package/dist/PageHeader.svelte.d.ts.map +1 -1
- package/dist/PullRequestsDetail.svelte +25 -17
- package/dist/PullRequestsDetail.svelte.d.ts.map +1 -1
- package/dist/PullRequestsPage.svelte +3 -3
- package/dist/PullRequestsPage.svelte.d.ts.map +1 -1
- package/dist/ReposTable.svelte +24 -15
- package/dist/ReposTable.svelte.d.ts.map +1 -1
- package/dist/ReposTree.svelte +8 -6
- package/dist/ReposTree.svelte.d.ts.map +1 -1
- package/dist/ReposTreeNav.svelte +10 -11
- package/dist/ReposTreeNav.svelte.d.ts.map +1 -1
- package/dist/TablePage.svelte +2 -2
- package/dist/TablePage.svelte.d.ts.map +1 -1
- package/dist/TreeItemPage.svelte +2 -2
- package/dist/TreeItemPage.svelte.d.ts.map +1 -1
- package/dist/TreePage.svelte +2 -2
- package/dist/TreePage.svelte.d.ts.map +1 -1
- package/dist/changeset_generator.d.ts.map +1 -1
- package/dist/changeset_generator.js +2 -2
- package/dist/changeset_reader.d.ts.map +1 -1
- package/dist/changeset_reader.js +3 -3
- package/dist/config_reconcile.d.ts.map +1 -1
- package/dist/config_reconcile.js +6 -2
- package/dist/dependency_graph.d.ts.map +1 -1
- package/dist/dependency_graph.js +5 -5
- package/dist/dependency_updater.d.ts.map +1 -1
- package/dist/dependency_updater.js +8 -8
- package/dist/fetch_repo_data.d.ts.map +1 -1
- package/dist/fetch_repo_data.js +3 -3
- package/dist/fs_fetch_value_cache.d.ts.map +1 -1
- package/dist/fs_fetch_value_cache.js +2 -2
- package/dist/git_operations.d.ts.map +1 -1
- package/dist/git_operations.js +1 -1
- package/dist/github.d.ts.map +1 -1
- package/dist/github.js +6 -6
- package/dist/github_helpers.d.ts.map +1 -1
- package/dist/gitops_analyze.task.d.ts.map +1 -1
- package/dist/gitops_analyze.task.js +7 -7
- package/dist/gitops_config.d.ts.map +1 -1
- package/dist/gitops_config.js +4 -4
- package/dist/gitops_plan.task.d.ts.map +1 -1
- package/dist/gitops_plan.task.js +8 -8
- package/dist/gitops_publish.task.d.ts.map +1 -1
- package/dist/gitops_publish.task.js +15 -12
- package/dist/gitops_run.task.d.ts.map +1 -1
- package/dist/gitops_run.task.js +8 -8
- package/dist/gitops_sync.task.d.ts.map +1 -1
- package/dist/gitops_sync.task.js +11 -9
- package/dist/gitops_task_helpers.d.ts.map +1 -1
- package/dist/gitops_task_helpers.js +3 -3
- package/dist/gitops_validate.task.d.ts.map +1 -1
- package/dist/gitops_validate.task.js +14 -14
- package/dist/graph_validation.d.ts.map +1 -1
- package/dist/graph_validation.js +2 -2
- package/dist/local_repo.d.ts +4 -4
- package/dist/local_repo.d.ts.map +1 -1
- package/dist/local_repo.js +13 -13
- package/dist/log_helpers.d.ts.map +1 -1
- package/dist/multi_repo_publisher.d.ts.map +1 -1
- package/dist/multi_repo_publisher.js +19 -19
- package/dist/npm_registry.d.ts.map +1 -1
- package/dist/npm_registry.js +2 -2
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations_defaults.d.ts.map +1 -1
- package/dist/operations_defaults.js +12 -12
- package/dist/output_helpers.d.ts.map +1 -1
- package/dist/preflight_checks.d.ts +1 -1
- package/dist/preflight_checks.d.ts.map +1 -1
- package/dist/preflight_checks.js +4 -4
- package/dist/publish_gate.d.ts.map +1 -1
- package/dist/publish_steps.d.ts.map +1 -1
- package/dist/publish_steps.js +3 -3
- package/dist/publishing_event.d.ts.map +1 -1
- package/dist/publishing_event.js +16 -14
- package/dist/publishing_event_handler.d.ts.map +1 -1
- package/dist/publishing_event_handler.js +6 -6
- package/dist/publishing_plan.d.ts.map +1 -1
- package/dist/publishing_plan.js +14 -14
- package/dist/publishing_plan_helpers.d.ts.map +1 -1
- package/dist/publishing_plan_helpers.js +3 -3
- package/dist/publishing_plan_logging.d.ts.map +1 -1
- package/dist/publishing_plan_logging.js +2 -2
- package/dist/repo.svelte.d.ts.map +1 -1
- package/dist/repo_ops.js +2 -2
- package/dist/resolved_gitops_config.d.ts.map +1 -1
- package/dist/resolved_gitops_config.js +1 -1
- package/dist/version_utils.js +1 -1
- package/package.json +16 -15
- package/src/lib/cargo_toml.ts +3 -3
- package/src/lib/changeset_generator.ts +19 -19
- package/src/lib/changeset_reader.ts +18 -18
- package/src/lib/ci_reconcile.ts +5 -5
- package/src/lib/config_reconcile.ts +8 -4
- package/src/lib/dependency_graph.ts +26 -26
- package/src/lib/dependency_updater.ts +29 -29
- package/src/lib/fetch_repo_data.ts +11 -11
- package/src/lib/fs_fetch_value_cache.ts +14 -10
- package/src/lib/git_operations.ts +30 -30
- package/src/lib/github.ts +19 -19
- package/src/lib/github_helpers.ts +6 -6
- package/src/lib/gitops_analyze.task.ts +40 -40
- package/src/lib/gitops_config.ts +14 -14
- package/src/lib/gitops_plan.task.ts +31 -31
- package/src/lib/gitops_publish.task.ts +51 -48
- package/src/lib/gitops_run.task.ts +29 -29
- package/src/lib/gitops_sync.task.ts +39 -30
- package/src/lib/gitops_task_helpers.ts +21 -21
- package/src/lib/gitops_validate.task.ts +37 -37
- package/src/lib/graph_validation.ts +13 -13
- package/src/lib/local_repo.ts +70 -70
- package/src/lib/log_helpers.ts +15 -15
- package/src/lib/multi_repo_publisher.ts +67 -70
- package/src/lib/npm_registry.ts +13 -13
- package/src/lib/operations.ts +49 -38
- package/src/lib/operations_defaults.ts +106 -104
- package/src/lib/output_helpers.ts +4 -4
- package/src/lib/preflight_checks.ts +26 -26
- package/src/lib/publish_gate.ts +7 -9
- package/src/lib/publish_steps.ts +15 -15
- package/src/lib/publishing_event.ts +22 -20
- package/src/lib/publishing_event_handler.ts +8 -8
- package/src/lib/publishing_plan.ts +55 -55
- package/src/lib/publishing_plan_helpers.ts +16 -12
- package/src/lib/publishing_plan_logging.ts +22 -22
- package/src/lib/repo.svelte.ts +8 -8
- package/src/lib/repo_ops.ts +12 -12
- package/src/lib/resolved_gitops_config.ts +5 -5
- package/src/lib/version_utils.ts +3 -3
|
@@ -6,7 +6,7 @@ export const resolve_gitops_config = (gitops_config, repos_dir) => {
|
|
|
6
6
|
const config = {
|
|
7
7
|
local_repos: local_repos.length ? local_repos : null,
|
|
8
8
|
local_repo_paths: local_repo_paths.length ? local_repo_paths : null,
|
|
9
|
-
local_repos_missing: local_repos_missing.length ? local_repos_missing : null
|
|
9
|
+
local_repos_missing: local_repos_missing.length ? local_repos_missing : null
|
|
10
10
|
};
|
|
11
11
|
return config;
|
|
12
12
|
};
|
package/dist/version_utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuzdev/fuz_gitops",
|
|
3
|
-
"version": "0.78.
|
|
3
|
+
"version": "0.78.1",
|
|
4
4
|
"description": "a tool for managing many repos",
|
|
5
5
|
"glyph": "🪄",
|
|
6
6
|
"logo": "logo.svg",
|
|
@@ -40,18 +40,18 @@
|
|
|
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.63.
|
|
45
|
-
"@fuzdev/fuz_ui": "^0.
|
|
46
|
-
"@fuzdev/fuz_util": "^0.
|
|
47
|
-
"@fuzdev/gro": "^0.
|
|
48
|
-
"@fuzdev/mdz": "^0.
|
|
49
|
-
"@ryanatkn/eslint-config": "^0.12.
|
|
43
|
+
"@fuzdev/fuz_code": "^0.48.0",
|
|
44
|
+
"@fuzdev/fuz_css": "^0.63.3",
|
|
45
|
+
"@fuzdev/fuz_ui": "^0.208.0",
|
|
46
|
+
"@fuzdev/fuz_util": "^0.68.0",
|
|
47
|
+
"@fuzdev/gro": "^0.210.1",
|
|
48
|
+
"@fuzdev/mdz": "^0.3.0",
|
|
49
|
+
"@ryanatkn/eslint-config": "^0.12.2",
|
|
50
50
|
"@sveltejs/acorn-typescript": "^1.0.9",
|
|
51
51
|
"@sveltejs/adapter-static": "^3.0.10",
|
|
52
52
|
"@sveltejs/kit": "^2.63.0",
|
|
53
53
|
"@sveltejs/package": "^2.5.7",
|
|
54
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
54
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
55
55
|
"@types/estree": "^1.0.8",
|
|
56
56
|
"@types/node": "^24.10.1",
|
|
57
57
|
"@webref/css": "^8.2.0",
|
|
@@ -59,17 +59,17 @@
|
|
|
59
59
|
"eslint-plugin-svelte": "^3.13.1",
|
|
60
60
|
"esm-env": "^1.2.2",
|
|
61
61
|
"magic-string": "^0.30.21",
|
|
62
|
-
"prettier": "^3.
|
|
63
|
-
"prettier-plugin-svelte": "^
|
|
62
|
+
"prettier": "^3.9.6",
|
|
63
|
+
"prettier-plugin-svelte": "^4.1.1",
|
|
64
64
|
"svelte": "^5.56.2",
|
|
65
65
|
"svelte-check": "^4.6.0",
|
|
66
|
-
"svelte-docinfo": "^0.
|
|
66
|
+
"svelte-docinfo": "^0.7.0",
|
|
67
67
|
"svelte2tsx": "^0.7.52",
|
|
68
68
|
"tslib": "^2.8.1",
|
|
69
69
|
"typescript": "^5.9.3",
|
|
70
70
|
"typescript-eslint": "^8.48.1",
|
|
71
|
-
"vite": "^
|
|
72
|
-
"vitest": "^
|
|
71
|
+
"vite": "^7.3.6",
|
|
72
|
+
"vitest": "^5.0.0",
|
|
73
73
|
"zimmerframe": "^1.1.4",
|
|
74
74
|
"zod": "^4.3.6"
|
|
75
75
|
},
|
|
@@ -80,7 +80,8 @@
|
|
|
80
80
|
"useTabs": true,
|
|
81
81
|
"printWidth": 100,
|
|
82
82
|
"singleQuote": true,
|
|
83
|
-
"bracketSpacing":
|
|
83
|
+
"bracketSpacing": true,
|
|
84
|
+
"trailingComma": "none",
|
|
84
85
|
"overrides": [
|
|
85
86
|
{
|
|
86
87
|
"files": "package.json",
|
package/src/lib/cargo_toml.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {existsSync} from 'node:fs';
|
|
2
|
-
import {readFile} from 'node:fs/promises';
|
|
3
|
-
import {join} from 'node:path';
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { readFile } from 'node:fs/promises';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The handful of identity fields gitops reads from a Rust repo's `Cargo.toml`
|
|
@@ -7,17 +7,17 @@
|
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import {join} from 'node:path';
|
|
11
|
-
import type {Logger} from '@fuzdev/fuz_util/log.ts';
|
|
12
|
-
import type {LocalRepo} from './local_repo.ts';
|
|
13
|
-
import type {PublishedVersion} from './multi_repo_publisher.ts';
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import type { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
12
|
+
import type { LocalRepo } from './local_repo.ts';
|
|
13
|
+
import type { PublishedVersion } from './multi_repo_publisher.ts';
|
|
14
14
|
import {
|
|
15
15
|
strip_version_prefix,
|
|
16
16
|
required_bump_for_dependency_update,
|
|
17
|
-
type BumpType
|
|
17
|
+
type BumpType
|
|
18
18
|
} from './version_utils.ts';
|
|
19
|
-
import type {FsOperations} from './operations.ts';
|
|
20
|
-
import {default_fs_operations} from './operations_defaults.ts';
|
|
19
|
+
import type { FsOperations } from './operations.ts';
|
|
20
|
+
import { default_fs_operations } from './operations_defaults.ts';
|
|
21
21
|
|
|
22
22
|
export interface DependencyVersionChange {
|
|
23
23
|
package_name: string;
|
|
@@ -34,14 +34,14 @@ export interface DependencyVersionChange {
|
|
|
34
34
|
export const create_changeset_for_dependency_updates = async (
|
|
35
35
|
repo: LocalRepo,
|
|
36
36
|
updates: Array<DependencyVersionChange>,
|
|
37
|
-
options: {log?: Logger; fs_ops?: FsOperations} = {}
|
|
37
|
+
options: { log?: Logger; fs_ops?: FsOperations } = {}
|
|
38
38
|
): Promise<string> => {
|
|
39
|
-
const {log, fs_ops = default_fs_operations} = options;
|
|
39
|
+
const { log, fs_ops = default_fs_operations } = options;
|
|
40
40
|
const changesets_dir = join(repo.repo_dir, '.changeset');
|
|
41
41
|
|
|
42
42
|
// Ensure .changeset directory exists
|
|
43
|
-
if (!(await fs_ops.exists({path: changesets_dir}))) {
|
|
44
|
-
const mkdir_result = await fs_ops.mkdir({path: changesets_dir, recursive: true});
|
|
43
|
+
if (!(await fs_ops.exists({ path: changesets_dir }))) {
|
|
44
|
+
const mkdir_result = await fs_ops.mkdir({ path: changesets_dir, recursive: true });
|
|
45
45
|
if (!mkdir_result.ok) {
|
|
46
46
|
throw new Error(`Failed to create .changeset directory: ${mkdir_result.message}`);
|
|
47
47
|
}
|
|
@@ -60,7 +60,7 @@ export const create_changeset_for_dependency_updates = async (
|
|
|
60
60
|
const content = generate_changeset_content(repo.library.name, updates, required_bump);
|
|
61
61
|
|
|
62
62
|
// Write the changeset file
|
|
63
|
-
const write_result = await fs_ops.writeFile({path: filepath, content});
|
|
63
|
+
const write_result = await fs_ops.writeFile({ path: filepath, content });
|
|
64
64
|
if (!write_result.ok) {
|
|
65
65
|
throw new Error(`Failed to write changeset file: ${write_result.message}`);
|
|
66
66
|
}
|
|
@@ -72,11 +72,11 @@ export const create_changeset_for_dependency_updates = async (
|
|
|
72
72
|
|
|
73
73
|
const calculate_required_bump = (
|
|
74
74
|
repo: LocalRepo,
|
|
75
|
-
updates: Array<DependencyVersionChange
|
|
75
|
+
updates: Array<DependencyVersionChange>
|
|
76
76
|
): BumpType =>
|
|
77
77
|
required_bump_for_dependency_update(
|
|
78
78
|
repo.package_json.version || '0.0.0',
|
|
79
|
-
updates.some((u) => u.breaking)
|
|
79
|
+
updates.some((u) => u.breaking)
|
|
80
80
|
);
|
|
81
81
|
|
|
82
82
|
/**
|
|
@@ -94,7 +94,7 @@ const calculate_required_bump = (
|
|
|
94
94
|
export const generate_changeset_content = (
|
|
95
95
|
package_name: string,
|
|
96
96
|
updates: Array<DependencyVersionChange>,
|
|
97
|
-
bump_type: 'major' | 'minor' | 'patch'
|
|
97
|
+
bump_type: 'major' | 'minor' | 'patch'
|
|
98
98
|
): string => {
|
|
99
99
|
// Group updates by type
|
|
100
100
|
const breaking_updates = updates.filter((u) => u.breaking);
|
|
@@ -112,7 +112,7 @@ export const generate_changeset_content = (
|
|
|
112
112
|
lines.push('Breaking dependency changes:');
|
|
113
113
|
for (const update of breaking_updates) {
|
|
114
114
|
lines.push(
|
|
115
|
-
`- ${update.package_name}: ${update.from_version} → ${update.to_version} (${update.bump_type})
|
|
115
|
+
`- ${update.package_name}: ${update.from_version} → ${update.to_version} (${update.bump_type})`
|
|
116
116
|
);
|
|
117
117
|
}
|
|
118
118
|
lines.push('');
|
|
@@ -126,7 +126,7 @@ export const generate_changeset_content = (
|
|
|
126
126
|
}
|
|
127
127
|
for (const update of regular_updates) {
|
|
128
128
|
lines.push(
|
|
129
|
-
`- ${update.package_name}: ${update.from_version} → ${update.to_version} (${update.bump_type})
|
|
129
|
+
`- ${update.package_name}: ${update.from_version} → ${update.to_version} (${update.bump_type})`
|
|
130
130
|
);
|
|
131
131
|
}
|
|
132
132
|
lines.push('');
|
|
@@ -137,7 +137,7 @@ export const generate_changeset_content = (
|
|
|
137
137
|
|
|
138
138
|
export const create_dependency_updates = (
|
|
139
139
|
dependencies: Map<string, string>,
|
|
140
|
-
published_versions: Map<string, PublishedVersion
|
|
140
|
+
published_versions: Map<string, PublishedVersion>
|
|
141
141
|
): Array<DependencyVersionChange> => {
|
|
142
142
|
const updates: Array<DependencyVersionChange> = [];
|
|
143
143
|
|
|
@@ -152,7 +152,7 @@ export const create_dependency_updates = (
|
|
|
152
152
|
from_version: clean_current,
|
|
153
153
|
to_version: published.new_version,
|
|
154
154
|
bump_type: published.bump_type,
|
|
155
|
-
breaking: published.breaking
|
|
155
|
+
breaking: published.breaking
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
158
|
}
|
|
@@ -7,17 +7,17 @@
|
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type {Logger} from '@fuzdev/fuz_util/log.ts';
|
|
11
|
-
import {existsSync} from 'node:fs';
|
|
12
|
-
import {readdir, readFile} from 'node:fs/promises';
|
|
13
|
-
import {join} from 'node:path';
|
|
10
|
+
import type { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
11
|
+
import { existsSync } from 'node:fs';
|
|
12
|
+
import { readdir, readFile } from 'node:fs/promises';
|
|
13
|
+
import { join } from 'node:path';
|
|
14
14
|
|
|
15
|
-
import type {LocalRepo} from './local_repo.ts';
|
|
16
|
-
import {compare_bump_types, calculate_next_version, type BumpType} from './version_utils.ts';
|
|
15
|
+
import type { LocalRepo } from './local_repo.ts';
|
|
16
|
+
import { compare_bump_types, calculate_next_version, type BumpType } from './version_utils.ts';
|
|
17
17
|
|
|
18
18
|
export interface ChangesetInfo {
|
|
19
19
|
filename: string;
|
|
20
|
-
packages: Array<{name: string; bump_type: BumpType}>;
|
|
20
|
+
packages: Array<{ name: string; bump_type: BumpType }>;
|
|
21
21
|
summary: string;
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -44,7 +44,7 @@ export interface ChangesetInfo {
|
|
|
44
44
|
*/
|
|
45
45
|
export const parse_changeset_content = (
|
|
46
46
|
content: string,
|
|
47
|
-
filename = 'changeset.md'
|
|
47
|
+
filename = 'changeset.md'
|
|
48
48
|
): ChangesetInfo | null => {
|
|
49
49
|
// Match frontmatter between --- markers
|
|
50
50
|
const frontmatter_match = /^---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*)/.exec(content);
|
|
@@ -56,7 +56,7 @@ export const parse_changeset_content = (
|
|
|
56
56
|
const summary = frontmatter_match[2]!.trim();
|
|
57
57
|
|
|
58
58
|
// Parse package entries
|
|
59
|
-
const packages: Array<{name: string; bump_type: BumpType}> = [];
|
|
59
|
+
const packages: Array<{ name: string; bump_type: BumpType }> = [];
|
|
60
60
|
|
|
61
61
|
// Match lines like: "package-name": patch
|
|
62
62
|
// or: '@scope/package': minor
|
|
@@ -67,7 +67,7 @@ export const parse_changeset_content = (
|
|
|
67
67
|
while ((match = package_regex.exec(frontmatter)) !== null) {
|
|
68
68
|
packages.push({
|
|
69
69
|
name: match[1]!,
|
|
70
|
-
bump_type: match[2]! as BumpType
|
|
70
|
+
bump_type: match[2]! as BumpType
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -78,13 +78,13 @@ export const parse_changeset_content = (
|
|
|
78
78
|
return {
|
|
79
79
|
filename,
|
|
80
80
|
packages,
|
|
81
|
-
summary
|
|
81
|
+
summary
|
|
82
82
|
};
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
export const parse_changeset_file = async (
|
|
86
86
|
filepath: string,
|
|
87
|
-
log?: Logger
|
|
87
|
+
log?: Logger
|
|
88
88
|
): Promise<ChangesetInfo | null> => {
|
|
89
89
|
try {
|
|
90
90
|
const content = await readFile(filepath, 'utf8');
|
|
@@ -105,7 +105,7 @@ export const parse_changeset_file = async (
|
|
|
105
105
|
|
|
106
106
|
export const read_changesets = async (
|
|
107
107
|
repo: LocalRepo,
|
|
108
|
-
log?: Logger
|
|
108
|
+
log?: Logger
|
|
109
109
|
): Promise<Array<ChangesetInfo>> => {
|
|
110
110
|
const changesets_dir = join(repo.repo_dir, '.changeset');
|
|
111
111
|
|
|
@@ -141,7 +141,7 @@ export const read_changesets = async (
|
|
|
141
141
|
*/
|
|
142
142
|
export const determine_bump_from_changesets = (
|
|
143
143
|
changesets: Array<ChangesetInfo>,
|
|
144
|
-
package_name: string
|
|
144
|
+
package_name: string
|
|
145
145
|
): BumpType | null => {
|
|
146
146
|
let highest_bump: BumpType | null = null;
|
|
147
147
|
|
|
@@ -195,8 +195,8 @@ export const has_changesets = async (repo: LocalRepo): Promise<boolean> => {
|
|
|
195
195
|
*/
|
|
196
196
|
export const predict_next_version = async (
|
|
197
197
|
repo: LocalRepo,
|
|
198
|
-
log?: Logger
|
|
199
|
-
): Promise<{version: string; bump_type: BumpType} | null> => {
|
|
198
|
+
log?: Logger
|
|
199
|
+
): Promise<{ version: string; bump_type: BumpType } | null> => {
|
|
200
200
|
const changesets = await read_changesets(repo, log);
|
|
201
201
|
if (changesets.length === 0) {
|
|
202
202
|
return null;
|
|
@@ -211,11 +211,11 @@ export const predict_next_version = async (
|
|
|
211
211
|
const next_version = calculate_next_version(current_version, bump_type);
|
|
212
212
|
|
|
213
213
|
log?.debug(
|
|
214
|
-
` Predicted ${repo.library.name}: ${current_version} → ${next_version} (${bump_type})
|
|
214
|
+
` Predicted ${repo.library.name}: ${current_version} → ${next_version} (${bump_type})`
|
|
215
215
|
);
|
|
216
216
|
|
|
217
217
|
return {
|
|
218
218
|
version: next_version,
|
|
219
|
-
bump_type
|
|
219
|
+
bump_type
|
|
220
220
|
};
|
|
221
221
|
};
|
package/src/lib/ci_reconcile.ts
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* @module
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {existsSync, readdirSync} from 'node:fs';
|
|
18
|
-
import {join} from 'node:path';
|
|
17
|
+
import { existsSync, readdirSync } from 'node:fs';
|
|
18
|
+
import { join } from 'node:path';
|
|
19
19
|
|
|
20
20
|
/** How a repo's declared `ci` diverges from its workflow files on disk. */
|
|
21
21
|
export type CiDriftKind =
|
|
@@ -52,11 +52,11 @@ export const reconcile_ci = (repos: Array<CiReconcileInput>): Array<CiDrift> =>
|
|
|
52
52
|
const drift: Array<CiDrift> = [];
|
|
53
53
|
for (const repo of repos) {
|
|
54
54
|
if (!repo.checkable || repo.archived) continue;
|
|
55
|
-
const {repo_url, ci, has_workflows} = repo;
|
|
55
|
+
const { repo_url, ci, has_workflows } = repo;
|
|
56
56
|
if (ci && !has_workflows) {
|
|
57
|
-
drift.push({repo_url, ci, has_workflows, kind: 'missing_ci'});
|
|
57
|
+
drift.push({ repo_url, ci, has_workflows, kind: 'missing_ci' });
|
|
58
58
|
} else if (!ci && has_workflows) {
|
|
59
|
-
drift.push({repo_url, ci, has_workflows, kind: 'stray_ci'});
|
|
59
|
+
drift.push({ repo_url, ci, has_workflows, kind: 'stray_ci' });
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
return drift;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* @module
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import type {GitopsRepoConfig} from './gitops_config.ts';
|
|
14
|
+
import type { GitopsRepoConfig } from './gitops_config.ts';
|
|
15
15
|
|
|
16
16
|
/** Repo fields that must agree across every config that lists the repo. */
|
|
17
17
|
const INTRINSIC_FIELDS = ['visibility', 'ci', 'archived', 'branch'] as const;
|
|
@@ -63,7 +63,7 @@ const field_value = (repo: GitopsRepoConfig, field: IntrinsicField): string => {
|
|
|
63
63
|
*/
|
|
64
64
|
export const reconcile_configs = (
|
|
65
65
|
canonical: NamedRepos,
|
|
66
|
-
subsets: Array<NamedRepos
|
|
66
|
+
subsets: Array<NamedRepos>
|
|
67
67
|
): Array<ConfigDrift> => {
|
|
68
68
|
const drift: Array<ConfigDrift> = [];
|
|
69
69
|
const canonical_by_url = new Map(canonical.repos.map((r) => [r.repo_url, r] as const));
|
|
@@ -71,7 +71,11 @@ export const reconcile_configs = (
|
|
|
71
71
|
for (const repo of subset.repos) {
|
|
72
72
|
const canon = canonical_by_url.get(repo.repo_url);
|
|
73
73
|
if (!canon) {
|
|
74
|
-
drift.push({
|
|
74
|
+
drift.push({
|
|
75
|
+
repo_url: repo.repo_url,
|
|
76
|
+
config: subset.name,
|
|
77
|
+
kind: 'missing_from_canonical'
|
|
78
|
+
});
|
|
75
79
|
continue;
|
|
76
80
|
}
|
|
77
81
|
for (const field of INTRINSIC_FIELDS) {
|
|
@@ -84,7 +88,7 @@ export const reconcile_configs = (
|
|
|
84
88
|
kind: 'field_mismatch',
|
|
85
89
|
field,
|
|
86
90
|
canonical_value,
|
|
87
|
-
config_value
|
|
91
|
+
config_value
|
|
88
92
|
});
|
|
89
93
|
}
|
|
90
94
|
}
|
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
* @module
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import {EMPTY_OBJECT} from '@fuzdev/fuz_util/object.ts';
|
|
12
|
-
import {topological_sort as topological_sort_generic} from '@fuzdev/fuz_util/sort.ts';
|
|
11
|
+
import { EMPTY_OBJECT } from '@fuzdev/fuz_util/object.ts';
|
|
12
|
+
import { topological_sort as topological_sort_generic } from '@fuzdev/fuz_util/sort.ts';
|
|
13
13
|
|
|
14
|
-
import type {LocalRepo} from './local_repo.ts';
|
|
14
|
+
import type { LocalRepo } from './local_repo.ts';
|
|
15
15
|
|
|
16
16
|
export const DEPENDENCY_TYPE = {
|
|
17
17
|
PROD: 'prod',
|
|
18
18
|
PEER: 'peer',
|
|
19
|
-
DEV: 'dev'
|
|
19
|
+
DEV: 'dev'
|
|
20
20
|
} as const;
|
|
21
21
|
|
|
22
22
|
export type DependencyType = (typeof DEPENDENCY_TYPE)[keyof typeof DEPENDENCY_TYPE];
|
|
@@ -31,11 +31,11 @@ export interface DependencyGraphJson {
|
|
|
31
31
|
nodes: Array<{
|
|
32
32
|
name: string;
|
|
33
33
|
version: string;
|
|
34
|
-
dependencies: Array<{name: string; spec: DependencySpec}>;
|
|
34
|
+
dependencies: Array<{ name: string; spec: DependencySpec }>;
|
|
35
35
|
dependents: Array<string>;
|
|
36
36
|
publishable: boolean;
|
|
37
37
|
}>;
|
|
38
|
-
edges: Array<{from: string; to: string}>;
|
|
38
|
+
edges: Array<{ from: string; to: string }>;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export interface DependencyNode {
|
|
@@ -59,14 +59,14 @@ 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, package_json} = repo;
|
|
62
|
+
const { library, package_json } = repo;
|
|
63
63
|
const node: DependencyNode = {
|
|
64
64
|
name: library.name,
|
|
65
65
|
version: package_json.version || '0.0.0',
|
|
66
66
|
repo,
|
|
67
67
|
dependencies: new Map(),
|
|
68
68
|
dependents: new Set(),
|
|
69
|
-
publishable: !package_json.private
|
|
69
|
+
publishable: !package_json.private
|
|
70
70
|
};
|
|
71
71
|
|
|
72
72
|
// Extract dependencies
|
|
@@ -77,15 +77,15 @@ export class DependencyGraph {
|
|
|
77
77
|
// Add dependencies, prioritizing prod/peer over dev
|
|
78
78
|
// (if a package appears in multiple dep types, use the stronger constraint)
|
|
79
79
|
for (const [name, version] of Object.entries(deps)) {
|
|
80
|
-
node.dependencies.set(name, {type: DEPENDENCY_TYPE.PROD, version});
|
|
80
|
+
node.dependencies.set(name, { type: DEPENDENCY_TYPE.PROD, version });
|
|
81
81
|
}
|
|
82
82
|
for (const [name, version] of Object.entries(peer_deps)) {
|
|
83
|
-
node.dependencies.set(name, {type: DEPENDENCY_TYPE.PEER, version});
|
|
83
|
+
node.dependencies.set(name, { type: DEPENDENCY_TYPE.PEER, version });
|
|
84
84
|
}
|
|
85
85
|
for (const [name, version] of Object.entries(dev_deps)) {
|
|
86
86
|
// Only add dev deps if not already present as prod/peer
|
|
87
87
|
if (!node.dependencies.has(name)) {
|
|
88
|
-
node.dependencies.set(name, {type: DEPENDENCY_TYPE.DEV, version});
|
|
88
|
+
node.dependencies.set(name, { type: DEPENDENCY_TYPE.DEV, version });
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -138,7 +138,7 @@ export class DependencyGraph {
|
|
|
138
138
|
if (exclude_dev && spec.type === DEPENDENCY_TYPE.DEV) return false;
|
|
139
139
|
return this.nodes.has(dep_name);
|
|
140
140
|
})
|
|
141
|
-
.map(([dep_name]) => dep_name)
|
|
141
|
+
.map(([dep_name]) => dep_name)
|
|
142
142
|
}));
|
|
143
143
|
const result = topological_sort_generic(items, 'package');
|
|
144
144
|
if (!result.ok) {
|
|
@@ -164,7 +164,7 @@ export class DependencyGraph {
|
|
|
164
164
|
} {
|
|
165
165
|
const production_cycles = this.#find_cycles((spec) => spec.type !== DEPENDENCY_TYPE.DEV);
|
|
166
166
|
const dev_cycles = this.#find_cycles((spec) => spec.type === DEPENDENCY_TYPE.DEV);
|
|
167
|
-
return {production_cycles, dev_cycles};
|
|
167
|
+
return { production_cycles, dev_cycles };
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
/** DFS cycle detection following only edges that match the filter. */
|
|
@@ -217,20 +217,20 @@ export class DependencyGraph {
|
|
|
217
217
|
version: node.version,
|
|
218
218
|
dependencies: Array.from(node.dependencies.entries()).map(([name, spec]) => ({
|
|
219
219
|
name,
|
|
220
|
-
spec
|
|
220
|
+
spec
|
|
221
221
|
})),
|
|
222
222
|
dependents: Array.from(node.dependents),
|
|
223
|
-
publishable: node.publishable
|
|
223
|
+
publishable: node.publishable
|
|
224
224
|
}));
|
|
225
225
|
|
|
226
|
-
const edges: Array<{from: string; to: string}> = [];
|
|
226
|
+
const edges: Array<{ from: string; to: string }> = [];
|
|
227
227
|
for (const [from, tos] of this.edges) {
|
|
228
228
|
for (const to of tos) {
|
|
229
|
-
edges.push({from, to});
|
|
229
|
+
edges.push({ from, to });
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
return {nodes, edges};
|
|
233
|
+
return { nodes, edges };
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
|
|
@@ -270,25 +270,25 @@ export class DependencyGraphBuilder {
|
|
|
270
270
|
analyze(graph: DependencyGraph): {
|
|
271
271
|
production_cycles: Array<Array<string>>;
|
|
272
272
|
dev_cycles: Array<Array<string>>;
|
|
273
|
-
wildcard_deps: Array<{pkg: string; dep: string; version: string}>;
|
|
274
|
-
missing_peers: Array<{pkg: string; dep: string}>;
|
|
273
|
+
wildcard_deps: Array<{ pkg: string; dep: string; version: string }>;
|
|
274
|
+
missing_peers: Array<{ pkg: string; dep: string }>;
|
|
275
275
|
} {
|
|
276
|
-
const {production_cycles, dev_cycles} = graph.detect_cycles_by_type();
|
|
277
|
-
const wildcard_deps: Array<{pkg: string; dep: string; version: string}> = [];
|
|
278
|
-
const missing_peers: Array<{pkg: string; dep: string}> = [];
|
|
276
|
+
const { production_cycles, dev_cycles } = graph.detect_cycles_by_type();
|
|
277
|
+
const wildcard_deps: Array<{ pkg: string; dep: string; version: string }> = [];
|
|
278
|
+
const missing_peers: Array<{ pkg: string; dep: string }> = [];
|
|
279
279
|
|
|
280
280
|
for (const node of graph.nodes.values()) {
|
|
281
281
|
for (const [dep_name, spec] of node.dependencies) {
|
|
282
282
|
if (spec.version === '*') {
|
|
283
|
-
wildcard_deps.push({pkg: node.name, dep: dep_name, version: spec.version});
|
|
283
|
+
wildcard_deps.push({ pkg: node.name, dep: dep_name, version: spec.version });
|
|
284
284
|
}
|
|
285
285
|
if (spec.type === DEPENDENCY_TYPE.PEER && !graph.nodes.has(dep_name)) {
|
|
286
286
|
// External peer dependency
|
|
287
|
-
missing_peers.push({pkg: node.name, dep: dep_name});
|
|
287
|
+
missing_peers.push({ pkg: node.name, dep: dep_name });
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
-
return {production_cycles, dev_cycles, wildcard_deps, missing_peers};
|
|
292
|
+
return { production_cycles, dev_cycles, wildcard_deps, missing_peers };
|
|
293
293
|
}
|
|
294
294
|
}
|