@aspruyt/xfg 4.0.0 → 4.0.2
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 +1 -2
- package/dist/cli/index.d.ts +1 -2
- package/dist/cli/index.js +0 -1
- package/dist/cli/program.js +7 -2
- package/dist/cli/{settings/results-collector.d.ts → results-collector.d.ts} +1 -1
- package/dist/cli/{settings/results-collector.js → results-collector.js} +2 -1
- package/dist/cli/settings-report-builder.d.ts +1 -3
- package/dist/cli/sync-command.d.ts +2 -24
- package/dist/cli/sync-command.js +295 -301
- package/dist/cli/types.d.ts +60 -40
- package/dist/cli/types.js +1 -12
- package/dist/config/errors.d.ts +9 -0
- package/dist/config/errors.js +11 -0
- package/dist/config/file-reference-resolver.d.ts +2 -1
- package/dist/config/file-reference-resolver.js +10 -8
- package/dist/config/formatter.d.ts +3 -2
- package/dist/config/index.d.ts +4 -6
- package/dist/config/index.js +4 -8
- package/dist/config/loader.js +4 -2
- package/dist/config/merge.d.ts +0 -9
- package/dist/config/merge.js +2 -7
- package/dist/config/normalizer.d.ts +4 -0
- package/dist/config/normalizer.js +61 -110
- package/dist/config/types.d.ts +15 -19
- package/dist/config/types.js +1 -1
- package/dist/config/validator.d.ts +0 -4
- package/dist/config/validator.js +286 -363
- package/dist/config/validators/file-validator.d.ts +2 -8
- package/dist/config/validators/file-validator.js +6 -17
- package/dist/config/validators/index.d.ts +3 -3
- package/dist/config/validators/index.js +3 -3
- package/dist/config/validators/repo-settings-validator.d.ts +0 -6
- package/dist/config/validators/repo-settings-validator.js +9 -9
- package/dist/config/validators/ruleset-validator.d.ts +0 -14
- package/dist/config/validators/ruleset-validator.js +28 -28
- package/dist/lifecycle/ado-migration-source.js +2 -1
- package/dist/lifecycle/github-lifecycle-provider.d.ts +6 -5
- package/dist/lifecycle/github-lifecycle-provider.js +79 -90
- package/dist/lifecycle/index.d.ts +2 -6
- package/dist/lifecycle/index.js +0 -4
- package/dist/lifecycle/lifecycle-formatter.d.ts +2 -1
- package/dist/lifecycle/lifecycle-formatter.js +4 -0
- package/dist/lifecycle/lifecycle-helpers.d.ts +3 -2
- package/dist/lifecycle/repo-lifecycle-manager.js +4 -11
- package/dist/lifecycle/types.d.ts +0 -8
- package/dist/output/github-summary.d.ts +5 -0
- package/dist/output/github-summary.js +9 -2
- package/dist/output/index.d.ts +2 -2
- package/dist/output/index.js +1 -1
- package/dist/output/lifecycle-report.js +5 -23
- package/dist/output/settings-report.d.ts +14 -3
- package/dist/output/settings-report.js +137 -197
- package/dist/output/summary-utils.d.ts +1 -1
- package/dist/output/summary-utils.js +2 -1
- package/dist/output/sync-report.js +5 -8
- package/dist/output/unified-summary.d.ts +2 -1
- package/dist/output/unified-summary.js +71 -133
- package/dist/settings/base-processor.d.ts +67 -0
- package/dist/settings/base-processor.js +91 -0
- package/dist/settings/index.d.ts +4 -3
- package/dist/settings/index.js +3 -3
- package/dist/settings/labels/converter.d.ts +2 -1
- package/dist/settings/labels/github-labels-strategy.d.ts +9 -18
- package/dist/settings/labels/github-labels-strategy.js +17 -73
- package/dist/settings/labels/index.d.ts +2 -6
- package/dist/settings/labels/index.js +1 -9
- package/dist/settings/labels/processor.d.ts +6 -30
- package/dist/settings/labels/processor.js +62 -152
- package/dist/settings/labels/types.d.ts +5 -8
- package/dist/settings/repo-settings/formatter.d.ts +2 -2
- package/dist/settings/repo-settings/formatter.js +6 -6
- package/dist/settings/repo-settings/github-repo-settings-strategy.d.ts +11 -12
- package/dist/settings/repo-settings/github-repo-settings-strategy.js +32 -79
- package/dist/settings/repo-settings/index.d.ts +2 -5
- package/dist/settings/repo-settings/index.js +1 -9
- package/dist/settings/repo-settings/processor.d.ts +6 -27
- package/dist/settings/repo-settings/processor.js +51 -104
- package/dist/settings/repo-settings/types.d.ts +7 -9
- package/dist/settings/rulesets/diff-algorithm.d.ts +0 -4
- package/dist/settings/rulesets/diff-algorithm.js +1 -10
- package/dist/settings/rulesets/diff.d.ts +1 -1
- package/dist/settings/rulesets/diff.js +2 -21
- package/dist/settings/rulesets/formatter.d.ts +1 -3
- package/dist/settings/rulesets/formatter.js +1 -8
- package/dist/settings/rulesets/github-ruleset-strategy.d.ts +11 -51
- package/dist/settings/rulesets/github-ruleset-strategy.js +24 -85
- package/dist/settings/rulesets/index.d.ts +3 -6
- package/dist/settings/rulesets/index.js +5 -9
- package/dist/settings/rulesets/processor.d.ts +8 -33
- package/dist/settings/rulesets/processor.js +58 -151
- package/dist/settings/rulesets/types.d.ts +35 -6
- package/dist/shared/command-executor.d.ts +2 -22
- package/dist/shared/command-executor.js +8 -7
- package/dist/shared/env.d.ts +0 -8
- package/dist/shared/env.js +14 -70
- package/dist/shared/file-status.d.ts +2 -0
- package/dist/shared/file-status.js +13 -0
- package/dist/shared/gh-api-utils.d.ts +46 -0
- package/dist/shared/gh-api-utils.js +107 -0
- package/dist/shared/index.d.ts +5 -5
- package/dist/shared/index.js +3 -3
- package/dist/shared/interpolation-engine.d.ts +31 -0
- package/dist/shared/interpolation-engine.js +50 -0
- package/dist/shared/logger.d.ts +3 -7
- package/dist/shared/logger.js +4 -1
- package/dist/shared/repo-detector.d.ts +17 -2
- package/dist/shared/repo-detector.js +27 -0
- package/dist/shared/retry-utils.d.ts +9 -17
- package/dist/shared/retry-utils.js +22 -28
- package/dist/shared/sanitize-utils.d.ts +0 -7
- package/dist/shared/sanitize-utils.js +0 -7
- package/dist/shared/shell-utils.d.ts +1 -0
- package/dist/shared/shell-utils.js +3 -0
- package/dist/shared/string-utils.d.ts +4 -0
- package/dist/shared/string-utils.js +6 -0
- package/dist/shared/type-guards.d.ts +17 -0
- package/dist/shared/type-guards.js +26 -0
- package/dist/shared/workspace-utils.d.ts +0 -4
- package/dist/shared/workspace-utils.js +0 -4
- package/dist/{sync → shared}/xfg-template.d.ts +3 -2
- package/dist/{sync → shared}/xfg-template.js +13 -54
- package/dist/sync/auth-options-builder.d.ts +4 -5
- package/dist/sync/auth-options-builder.js +15 -26
- package/dist/sync/branch-manager.d.ts +5 -0
- package/dist/sync/branch-manager.js +12 -10
- package/dist/sync/commit-push-manager.d.ts +1 -1
- package/dist/sync/commit-push-manager.js +22 -18
- package/dist/sync/diff-utils.d.ts +4 -9
- package/dist/sync/diff-utils.js +2 -19
- package/dist/sync/file-sync-orchestrator.js +9 -8
- package/dist/sync/file-writer.d.ts +2 -1
- package/dist/sync/file-writer.js +3 -6
- package/dist/sync/index.d.ts +2 -15
- package/dist/sync/index.js +0 -19
- package/dist/sync/manifest-manager.d.ts +4 -0
- package/dist/sync/manifest-manager.js +5 -1
- package/dist/sync/manifest.d.ts +10 -41
- package/dist/sync/manifest.js +11 -56
- package/dist/sync/pr-merge-handler.d.ts +2 -6
- package/dist/sync/pr-merge-handler.js +6 -3
- package/dist/sync/repository-processor.d.ts +1 -2
- package/dist/sync/repository-processor.js +20 -12
- package/dist/sync/repository-session.js +5 -14
- package/dist/sync/sync-workflow.js +31 -38
- package/dist/sync/types.d.ts +43 -178
- package/dist/vcs/authenticated-git-ops.d.ts +27 -70
- package/dist/vcs/authenticated-git-ops.js +70 -96
- package/dist/vcs/azure-pr-strategy.d.ts +6 -4
- package/dist/vcs/azure-pr-strategy.js +34 -82
- package/dist/vcs/branch-utils.d.ts +6 -0
- package/dist/vcs/branch-utils.js +29 -0
- package/dist/vcs/commit-strategy-selector.d.ts +5 -0
- package/dist/vcs/commit-strategy-selector.js +10 -0
- package/dist/vcs/git-commit-strategy.js +1 -2
- package/dist/vcs/git-ops.d.ts +15 -59
- package/dist/vcs/git-ops.js +46 -110
- package/dist/vcs/github-app-token-manager.d.ts +0 -6
- package/dist/vcs/github-app-token-manager.js +5 -12
- package/dist/vcs/github-pr-strategy.d.ts +5 -5
- package/dist/vcs/github-pr-strategy.js +44 -122
- package/dist/vcs/gitlab-pr-strategy.d.ts +6 -4
- package/dist/vcs/gitlab-pr-strategy.js +39 -87
- package/dist/vcs/graphql-commit-strategy.d.ts +3 -4
- package/dist/vcs/graphql-commit-strategy.js +31 -63
- package/dist/vcs/index.d.ts +3 -16
- package/dist/vcs/index.js +2 -33
- package/dist/vcs/pr-creator.d.ts +9 -9
- package/dist/vcs/pr-creator.js +11 -10
- package/dist/vcs/pr-strategy-factory.d.ts +5 -0
- package/dist/vcs/pr-strategy-factory.js +17 -0
- package/dist/vcs/pr-strategy.d.ts +13 -26
- package/dist/vcs/pr-strategy.js +20 -25
- package/dist/vcs/types.d.ts +87 -21
- package/package.json +2 -1
package/dist/config/types.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export type BypassActorType = "Team" | "User" | "Integration";
|
|
|
17
17
|
/** Bypass mode - always bypass or only for PRs */
|
|
18
18
|
export type BypassMode = "always" | "pull_request";
|
|
19
19
|
/** Pattern operator for pattern-based rules */
|
|
20
|
-
|
|
20
|
+
type PatternOperator = "starts_with" | "ends_with" | "contains" | "regex";
|
|
21
21
|
/** Allowed merge methods */
|
|
22
22
|
export type MergeMethod = "merge" | "squash" | "rebase";
|
|
23
23
|
/** Code scanning alerts threshold */
|
|
@@ -29,7 +29,7 @@ export interface BypassActor {
|
|
|
29
29
|
actorType: BypassActorType;
|
|
30
30
|
bypassMode?: BypassMode;
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
interface RefNameCondition {
|
|
33
33
|
include?: string[];
|
|
34
34
|
exclude?: string[];
|
|
35
35
|
}
|
|
@@ -57,7 +57,7 @@ export interface CodeScanningTool {
|
|
|
57
57
|
securityAlertsThreshold: SecurityAlertsThreshold;
|
|
58
58
|
}
|
|
59
59
|
/** Workflow configuration */
|
|
60
|
-
|
|
60
|
+
interface WorkflowConfig {
|
|
61
61
|
path: string;
|
|
62
62
|
repositoryId: number;
|
|
63
63
|
ref?: string;
|
|
@@ -72,43 +72,43 @@ export interface PullRequestRuleParameters {
|
|
|
72
72
|
allowedMergeMethods?: MergeMethod[];
|
|
73
73
|
requiredReviewers?: RequiredReviewer[];
|
|
74
74
|
}
|
|
75
|
-
|
|
75
|
+
interface RequiredStatusChecksParameters {
|
|
76
76
|
strictRequiredStatusChecksPolicy?: boolean;
|
|
77
77
|
doNotEnforceOnCreate?: boolean;
|
|
78
78
|
requiredStatusChecks?: StatusCheckConfig[];
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
interface UpdateRuleParameters {
|
|
81
81
|
updateAllowsFetchAndMerge?: boolean;
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
interface RequiredDeploymentsParameters {
|
|
84
84
|
requiredDeploymentEnvironments?: string[];
|
|
85
85
|
}
|
|
86
|
-
|
|
86
|
+
interface CodeScanningParameters {
|
|
87
87
|
codeScanningTools?: CodeScanningTool[];
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
interface CodeQualityParameters {
|
|
90
90
|
severity?: "errors" | "errors_and_warnings" | "all";
|
|
91
91
|
}
|
|
92
|
-
|
|
92
|
+
interface WorkflowsParameters {
|
|
93
93
|
doNotEnforceOnCreate?: boolean;
|
|
94
94
|
workflows?: WorkflowConfig[];
|
|
95
95
|
}
|
|
96
|
-
|
|
96
|
+
interface PatternRuleParameters {
|
|
97
97
|
name?: string;
|
|
98
98
|
negate?: boolean;
|
|
99
99
|
operator: PatternOperator;
|
|
100
100
|
pattern: string;
|
|
101
101
|
}
|
|
102
|
-
|
|
102
|
+
interface FilePathRestrictionParameters {
|
|
103
103
|
restrictedFilePaths?: string[];
|
|
104
104
|
}
|
|
105
|
-
|
|
105
|
+
interface FileExtensionRestrictionParameters {
|
|
106
106
|
restrictedFileExtensions?: string[];
|
|
107
107
|
}
|
|
108
|
-
|
|
108
|
+
interface MaxFilePathLengthParameters {
|
|
109
109
|
maxFilePathLength?: number;
|
|
110
110
|
}
|
|
111
|
-
|
|
111
|
+
interface MaxFileSizeParameters {
|
|
112
112
|
maxFileSize?: number;
|
|
113
113
|
}
|
|
114
114
|
export interface PullRequestRule {
|
|
@@ -208,11 +208,6 @@ export interface Ruleset {
|
|
|
208
208
|
/** Rules to enforce */
|
|
209
209
|
rules?: RulesetRule[];
|
|
210
210
|
}
|
|
211
|
-
/**
|
|
212
|
-
* Maps Ruleset config keys (camelCase) to GitHub API keys (snake_case).
|
|
213
|
-
* TypeScript enforces this stays in sync with the Ruleset interface.
|
|
214
|
-
*/
|
|
215
|
-
export declare const RULESET_FIELD_MAP: Record<keyof Ruleset, string>;
|
|
216
211
|
/**
|
|
217
212
|
* Set of snake_case field names that are comparable between config and API.
|
|
218
213
|
* Used as an allowlist — any API response field not in this set is ignored.
|
|
@@ -381,3 +376,4 @@ export interface Config {
|
|
|
381
376
|
deleteOrphaned?: boolean;
|
|
382
377
|
settings?: RepoSettings;
|
|
383
378
|
}
|
|
379
|
+
export {};
|
package/dist/config/types.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Maps Ruleset config keys (camelCase) to GitHub API keys (snake_case).
|
|
3
3
|
* TypeScript enforces this stays in sync with the Ruleset interface.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
const RULESET_FIELD_MAP = {
|
|
6
6
|
target: "target",
|
|
7
7
|
enforcement: "enforcement",
|
|
8
8
|
bypassActors: "bypass_actors",
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import type { RawConfig, RawRepoSettings, RawRootSettings } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Validates settings object containing rulesets, labels, and repo settings.
|
|
4
|
-
*/
|
|
5
|
-
export declare function validateSettings(settings: unknown, context: string, rootRulesetNames?: string[], hasRootRepoSettings?: boolean, rootLabelNames?: string[]): void;
|
|
6
2
|
/**
|
|
7
3
|
* Validates raw config structure before normalization.
|
|
8
4
|
* @throws Error if validation fails
|