@pgpmjs/core 7.3.0 → 7.5.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/slice/types.d.ts DELETED
@@ -1,148 +0,0 @@
1
- import { Change, Tag, ExtendedPlanFile } from '@pgpmjs/ast/files/types';
2
- /**
3
- * Configuration for slicing a plan into multiple packages
4
- */
5
- export interface SliceConfig {
6
- /** Source plan file path */
7
- sourcePlan: string;
8
- /** Output directory for packages */
9
- outputDir: string;
10
- /** Grouping strategy */
11
- strategy: GroupingStrategy;
12
- /** Package for changes that don't match any group */
13
- defaultPackage?: string;
14
- /** Whether to use tags for cross-package deps */
15
- useTagsForCrossPackageDeps?: boolean;
16
- /**
17
- * How cross-package dependencies are recorded in sliced plans:
18
- * - 'change' (default): per-change refs (`{package}:{change}`)
19
- * - 'tag': per-change tag refs (`{package}:@tag`) when available
20
- * (equivalent to `useTagsForCrossPackageDeps: true`)
21
- * - 'control-only': drop per-change cross-package refs from plan lines
22
- * entirely; the dependency is carried only by the control file's
23
- * `requires` (extension install ordering deploys the whole dependency
24
- * package first, which subsumes any per-change ordering constraint)
25
- */
26
- crossPackageDepMode?: CrossPackageDepMode;
27
- /** Minimum changes per package (merge smaller groups) */
28
- minChangesPerPackage?: number;
29
- /** Author for generated plan files */
30
- author?: string;
31
- }
32
- /**
33
- * How cross-package dependencies are represented in sliced plan files
34
- */
35
- export type CrossPackageDepMode = 'change' | 'tag' | 'control-only';
36
- /**
37
- * Grouping strategy for slicing
38
- */
39
- export type GroupingStrategy = FolderStrategy | PatternStrategy | ExplicitStrategy;
40
- export interface FolderStrategy {
41
- type: 'folder';
42
- /** Depth in path to extract package name (default: 1) */
43
- depth?: number;
44
- /** Prefix to strip from paths (default: 'schemas') */
45
- prefixToStrip?: string;
46
- }
47
- /**
48
- * Pattern-based strategy using glob patterns to match changes to packages.
49
- * Each slice defines a package name and an array of glob patterns.
50
- * Changes matching any pattern in a slice are assigned to that package.
51
- */
52
- export interface PatternStrategy {
53
- type: 'pattern';
54
- /** Array of slice definitions with package names and patterns */
55
- slices: PatternSlice[];
56
- }
57
- /**
58
- * A single slice definition for pattern-based grouping
59
- */
60
- export interface PatternSlice {
61
- /** Name of the output package */
62
- packageName: string;
63
- /** Glob patterns to match change paths (e.g., "schemas/auth/**") */
64
- patterns: string[];
65
- }
66
- export interface ExplicitStrategy {
67
- type: 'explicit';
68
- /** Mapping of change name to package name */
69
- mapping: Record<string, string>;
70
- }
71
- /**
72
- * Dependency graph representation
73
- */
74
- export interface DependencyGraph {
75
- /** Map of change name to Change object */
76
- nodes: Map<string, Change>;
77
- /** Map of change name to its dependencies */
78
- edges: Map<string, Set<string>>;
79
- /** Map of change name to changes that depend on it */
80
- reverseEdges: Map<string, Set<string>>;
81
- /** Map of change name to its tags */
82
- tags: Map<string, Tag[]>;
83
- /** Original plan metadata */
84
- plan: ExtendedPlanFile;
85
- }
86
- /**
87
- * Result of slicing operation
88
- */
89
- export interface SliceResult {
90
- /** Generated packages */
91
- packages: PackageOutput[];
92
- /** Workspace manifest */
93
- workspace: WorkspaceManifest;
94
- /** Warnings/issues encountered */
95
- warnings: SliceWarning[];
96
- /** Statistics */
97
- stats: SliceStats;
98
- }
99
- /**
100
- * Output for a single package
101
- */
102
- export interface PackageOutput {
103
- /** Package name */
104
- name: string;
105
- /** Plan file content */
106
- planContent: string;
107
- /** Control file content */
108
- controlContent: string;
109
- /** Changes in this package */
110
- changes: Change[];
111
- /** Dependencies on other packages */
112
- packageDependencies: string[];
113
- }
114
- /**
115
- * Workspace manifest describing package relationships
116
- */
117
- export interface WorkspaceManifest {
118
- /** List of package names */
119
- packages: string[];
120
- /** Order in which packages should be deployed */
121
- deployOrder: string[];
122
- /** Map of package name to its package dependencies */
123
- dependencies: Record<string, string[]>;
124
- }
125
- /**
126
- * Warning generated during slicing
127
- */
128
- export interface SliceWarning {
129
- type: 'heavy_cross_deps' | 'cycle_detected' | 'orphan_change' | 'merge_required';
130
- message: string;
131
- affectedChanges?: string[];
132
- suggestedAction?: string;
133
- }
134
- /**
135
- * Statistics about the slicing operation
136
- */
137
- export interface SliceStats {
138
- /** Total number of changes processed */
139
- totalChanges: number;
140
- /** Number of packages created */
141
- packagesCreated: number;
142
- /** Number of internal dependency edges */
143
- internalEdges: number;
144
- /** Number of cross-package dependency edges */
145
- crossPackageEdges: number;
146
- /** Ratio of cross-package to total edges */
147
- crossPackageRatio: number;
148
- }
package/slice/types.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });