@fern-api/replay 0.6.0 → 0.6.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.
Files changed (78) hide show
  1. package/dist/cli.cjs +16642 -0
  2. package/dist/cli.cjs.map +1 -0
  3. package/dist/index.cjs +2014 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +463 -0
  6. package/dist/index.d.ts +463 -12
  7. package/dist/index.js +1968 -10
  8. package/dist/index.js.map +1 -1
  9. package/package.json +16 -6
  10. package/dist/FernignoreMigrator.d.ts +0 -38
  11. package/dist/FernignoreMigrator.d.ts.map +0 -1
  12. package/dist/FernignoreMigrator.js +0 -210
  13. package/dist/FernignoreMigrator.js.map +0 -1
  14. package/dist/LockfileManager.d.ts +0 -31
  15. package/dist/LockfileManager.d.ts.map +0 -1
  16. package/dist/LockfileManager.js +0 -124
  17. package/dist/LockfileManager.js.map +0 -1
  18. package/dist/ReplayApplicator.d.ts +0 -30
  19. package/dist/ReplayApplicator.d.ts.map +0 -1
  20. package/dist/ReplayApplicator.js +0 -544
  21. package/dist/ReplayApplicator.js.map +0 -1
  22. package/dist/ReplayCommitter.d.ts +0 -19
  23. package/dist/ReplayCommitter.d.ts.map +0 -1
  24. package/dist/ReplayCommitter.js +0 -64
  25. package/dist/ReplayCommitter.js.map +0 -1
  26. package/dist/ReplayDetector.d.ts +0 -22
  27. package/dist/ReplayDetector.d.ts.map +0 -1
  28. package/dist/ReplayDetector.js +0 -147
  29. package/dist/ReplayDetector.js.map +0 -1
  30. package/dist/ReplayService.d.ts +0 -100
  31. package/dist/ReplayService.d.ts.map +0 -1
  32. package/dist/ReplayService.js +0 -596
  33. package/dist/ReplayService.js.map +0 -1
  34. package/dist/ThreeWayMerge.d.ts +0 -11
  35. package/dist/ThreeWayMerge.d.ts.map +0 -1
  36. package/dist/ThreeWayMerge.js +0 -48
  37. package/dist/ThreeWayMerge.js.map +0 -1
  38. package/dist/cli.d.ts +0 -3
  39. package/dist/cli.d.ts.map +0 -1
  40. package/dist/cli.js +0 -462
  41. package/dist/cli.js.map +0 -1
  42. package/dist/commands/bootstrap.d.ts +0 -46
  43. package/dist/commands/bootstrap.d.ts.map +0 -1
  44. package/dist/commands/bootstrap.js +0 -237
  45. package/dist/commands/bootstrap.js.map +0 -1
  46. package/dist/commands/forget.d.ts +0 -16
  47. package/dist/commands/forget.d.ts.map +0 -1
  48. package/dist/commands/forget.js +0 -27
  49. package/dist/commands/forget.js.map +0 -1
  50. package/dist/commands/index.d.ts +0 -6
  51. package/dist/commands/index.d.ts.map +0 -1
  52. package/dist/commands/index.js +0 -6
  53. package/dist/commands/index.js.map +0 -1
  54. package/dist/commands/reset.d.ts +0 -16
  55. package/dist/commands/reset.d.ts.map +0 -1
  56. package/dist/commands/reset.js +0 -25
  57. package/dist/commands/reset.js.map +0 -1
  58. package/dist/commands/resolve.d.ts +0 -16
  59. package/dist/commands/resolve.d.ts.map +0 -1
  60. package/dist/commands/resolve.js +0 -28
  61. package/dist/commands/resolve.js.map +0 -1
  62. package/dist/commands/status.d.ts +0 -26
  63. package/dist/commands/status.d.ts.map +0 -1
  64. package/dist/commands/status.js +0 -24
  65. package/dist/commands/status.js.map +0 -1
  66. package/dist/git/CommitDetection.d.ts +0 -7
  67. package/dist/git/CommitDetection.d.ts.map +0 -1
  68. package/dist/git/CommitDetection.js +0 -26
  69. package/dist/git/CommitDetection.js.map +0 -1
  70. package/dist/git/GitClient.d.ts +0 -22
  71. package/dist/git/GitClient.d.ts.map +0 -1
  72. package/dist/git/GitClient.js +0 -109
  73. package/dist/git/GitClient.js.map +0 -1
  74. package/dist/index.d.ts.map +0 -1
  75. package/dist/types.d.ts +0 -80
  76. package/dist/types.d.ts.map +0 -1
  77. package/dist/types.js +0 -3
  78. package/dist/types.js.map +0 -1
@@ -1,237 +0,0 @@
1
- import { createHash } from "node:crypto";
2
- import { existsSync, readFileSync, writeFileSync } from "node:fs";
3
- import { join } from "node:path";
4
- import { FernignoreMigrator } from "../FernignoreMigrator.js";
5
- import { isGenerationCommit, isReplayCommit } from "../git/CommitDetection.js";
6
- import { GitClient } from "../git/GitClient.js";
7
- import { LockfileManager } from "../LockfileManager.js";
8
- /**
9
- * Bootstrap Replay for an existing SDK repository.
10
- *
11
- * Scans git history to find all generation commits, identifies
12
- * user customization patches between them, and creates the initial replay.lock.
13
- *
14
- * This is a one-time migration step for SDKs that existed before Replay.
15
- */
16
- export async function bootstrap(outputDir, options) {
17
- const git = new GitClient(outputDir);
18
- const lockManager = new LockfileManager(outputDir);
19
- const maxCommits = options?.maxCommitsToScan ?? 500;
20
- const warnings = [];
21
- // Check for existing lockfile
22
- if (lockManager.exists() && !options?.force) {
23
- return {
24
- generationCommit: null,
25
- patchesDetected: 0,
26
- patchesCreated: 0,
27
- patches: [],
28
- fernignorePatterns: [],
29
- fernignoreUpdated: false,
30
- warnings: ["Replay lockfile already exists. Use --force to overwrite."],
31
- staleGenerationsSkipped: 0,
32
- scannedSinceGeneration: ""
33
- };
34
- }
35
- // 1. Find ALL generation commits (newest first, excluding replay commits)
36
- const genCommits = await findAllGenerationCommits(git, maxCommits);
37
- if (genCommits.length === 0) {
38
- return {
39
- generationCommit: null,
40
- patchesDetected: 0,
41
- patchesCreated: 0,
42
- patches: [],
43
- fernignorePatterns: [],
44
- fernignoreUpdated: false,
45
- warnings: [
46
- "No generation commits found in the last " +
47
- maxCommits +
48
- " commits. " +
49
- "Run 'fern generate' first to establish a baseline."
50
- ],
51
- staleGenerationsSkipped: 0,
52
- scannedSinceGeneration: ""
53
- };
54
- }
55
- const latestGen = genCommits[0];
56
- // 2. Set up in-memory lockfile (don't write to disk yet — we may be in dry-run mode)
57
- // For clean start (no importHistory), use HEAD as current_generation so that
58
- // the next fern generate detects 0 old commits. When importing history, use
59
- // the actual generation commit as the base for patch detection.
60
- const anchorSha = options?.importHistory ? latestGen.sha : (await git.exec(["rev-parse", "HEAD"])).trim();
61
- const treeHash = await git.getTreeHash(anchorSha);
62
- const genRecord = {
63
- commit_sha: anchorSha,
64
- tree_hash: treeHash,
65
- timestamp: new Date().toISOString(),
66
- cli_version: "unknown",
67
- generator_versions: {}
68
- };
69
- lockManager.initializeInMemory(genRecord);
70
- // 3. Scan for user patches (only when importing history)
71
- const patches = options?.importHistory ? await findAllUserPatches(git, genCommits) : [];
72
- // 4. Handle .fernignore if present (only when importing history)
73
- const migrator = new FernignoreMigrator(git, lockManager, outputDir);
74
- const fernignorePatterns = migrator.readFernignorePatterns();
75
- let fernignoreAnalysis;
76
- if (options?.importHistory && migrator.fernignoreExists() && fernignorePatterns.length > 0) {
77
- fernignoreAnalysis = await migrator.analyzeMigration();
78
- // Add synthetic patches from .fernignore analysis
79
- if (fernignoreAnalysis.syntheticPatches.length > 0) {
80
- patches.push(...fernignoreAnalysis.syntheticPatches);
81
- }
82
- if (fernignoreAnalysis.fernignoreOnly.length > 0) {
83
- for (const file of fernignoreAnalysis.fernignoreOnly) {
84
- warnings.push(`${file}: in .fernignore but no recent commits found since last generation. ` +
85
- "File may be stale, matches generated output, or does not exist. No customization to track.");
86
- }
87
- }
88
- }
89
- // In dry-run mode, don't persist anything
90
- if (options?.dryRun) {
91
- return {
92
- generationCommit: latestGen,
93
- patchesDetected: patches.length,
94
- patchesCreated: 0,
95
- patches,
96
- fernignorePatterns,
97
- fernignoreAnalysis,
98
- fernignoreUpdated: false,
99
- warnings,
100
- staleGenerationsSkipped: genCommits.length - 1,
101
- scannedSinceGeneration: latestGen.sha
102
- };
103
- }
104
- // 5. Persist patches to lockfile
105
- for (const patch of patches) {
106
- lockManager.addPatch(patch);
107
- }
108
- lockManager.save();
109
- // 6. Ensure .fernignore protects replay files from generation wipe
110
- const fernignoreUpdated = ensureFernignoreEntries(outputDir);
111
- // 7. Handle .fernignore migration
112
- if (migrator.fernignoreExists() && fernignorePatterns.length > 0) {
113
- const action = options?.fernignoreAction ?? "skip";
114
- if (action === "migrate") {
115
- // Move truly untrackable patterns (no diff from generated) to replay.yml exclude list
116
- const patternsToExclude = fernignoreAnalysis?.fernignoreOnly ?? [];
117
- if (patternsToExclude.length > 0) {
118
- migrator.movePatternsToReplayYml(patternsToExclude);
119
- }
120
- }
121
- }
122
- return {
123
- generationCommit: latestGen,
124
- patchesDetected: patches.length,
125
- patchesCreated: patches.length,
126
- patches,
127
- fernignorePatterns,
128
- fernignoreAnalysis,
129
- fernignoreUpdated,
130
- warnings,
131
- staleGenerationsSkipped: genCommits.length - 1,
132
- scannedSinceGeneration: latestGen.sha
133
- };
134
- }
135
- async function findAllGenerationCommits(git, maxCommits) {
136
- const log = await git.exec(["log", "--format=%H%x00%an%x00%ae%x00%s", `-${maxCommits}`]);
137
- if (!log.trim()) {
138
- return [];
139
- }
140
- const genCommits = [];
141
- for (const line of log.trim().split("\n")) {
142
- if (!line)
143
- continue;
144
- const [sha, authorName, authorEmail, message] = line.split("\0");
145
- const commit = { sha, authorName, authorEmail, message };
146
- if (isGenerationCommit(commit) && !isReplayCommit(commit)) {
147
- genCommits.push(commit);
148
- }
149
- }
150
- return genCommits;
151
- }
152
- async function findAllUserPatches(git, genCommits // newest first
153
- ) {
154
- const patches = [];
155
- const seenHashes = new Set();
156
- // Only scan since the LAST (most recent) generation commit to HEAD
157
- // This ignores "stale" commits that were regenerated over before the customer activated replay
158
- const latestGen = genCommits[0];
159
- const recentPatches = await extractUserPatches(git, latestGen.sha, "HEAD", latestGen.sha, seenHashes);
160
- patches.push(...recentPatches);
161
- return patches;
162
- }
163
- async function extractUserPatches(git, fromSha, toRef, baseGeneration, seenHashes) {
164
- const log = await git.exec(["log", "--format=%H%x00%an%x00%ae%x00%s", `${fromSha}..${toRef}`]);
165
- if (!log.trim()) {
166
- return [];
167
- }
168
- const commits = parseGitLog(log);
169
- const patches = [];
170
- // Process in reverse (oldest first) for chronological order
171
- for (const commit of commits.reverse()) {
172
- if (isGenerationCommit(commit))
173
- continue;
174
- const parents = await git.getCommitParents(commit.sha);
175
- if (parents.length > 1)
176
- continue;
177
- const patchContent = await git.formatPatch(commit.sha);
178
- const contentHash = computeContentHash(patchContent);
179
- if (seenHashes.has(contentHash))
180
- continue;
181
- seenHashes.add(contentHash);
182
- const filesOutput = await git.exec(["diff-tree", "--no-commit-id", "--name-only", "-r", commit.sha]);
183
- patches.push({
184
- id: `patch-${commit.sha.slice(0, 8)}`,
185
- content_hash: contentHash,
186
- original_commit: commit.sha,
187
- original_message: commit.message,
188
- original_author: `${commit.authorName} <${commit.authorEmail}>`,
189
- base_generation: baseGeneration,
190
- files: filesOutput.trim().split("\n").filter(Boolean),
191
- patch_content: patchContent
192
- });
193
- }
194
- return patches;
195
- }
196
- function parseGitLog(log) {
197
- return log
198
- .trim()
199
- .split("\n")
200
- .filter(Boolean)
201
- .map((line) => {
202
- const [sha, authorName, authorEmail, message] = line.split("\0");
203
- return { sha, authorName, authorEmail, message };
204
- });
205
- }
206
- const REPLAY_FERNIGNORE_ENTRIES = [".fern/replay.lock", ".fern/replay.yml"];
207
- function ensureFernignoreEntries(outputDir) {
208
- const fernignorePath = join(outputDir, ".fernignore");
209
- let content = "";
210
- if (existsSync(fernignorePath)) {
211
- content = readFileSync(fernignorePath, "utf-8");
212
- }
213
- const lines = content.split("\n");
214
- const toAdd = [];
215
- for (const entry of REPLAY_FERNIGNORE_ENTRIES) {
216
- if (!lines.some((line) => line.trim() === entry)) {
217
- toAdd.push(entry);
218
- }
219
- }
220
- if (toAdd.length === 0) {
221
- return false;
222
- }
223
- if (content && !content.endsWith("\n")) {
224
- content += "\n";
225
- }
226
- content += toAdd.join("\n") + "\n";
227
- writeFileSync(fernignorePath, content, "utf-8");
228
- return true;
229
- }
230
- function computeContentHash(patchContent) {
231
- const normalized = patchContent
232
- .split("\n")
233
- .filter((line) => !line.startsWith("From ") && !line.startsWith("index ") && !line.startsWith("Date: "))
234
- .join("\n");
235
- return `sha256:${createHash("sha256").update(normalized).digest("hex")}`;
236
- }
237
- //# sourceMappingURL=bootstrap.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":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,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACnC,aAAa,CAAC,cAAc,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAChD,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,kBAAkB,CAAC,YAAoB;IAC5C,MAAM,UAAU,GAAG,YAAY;SAC1B,KAAK,CAAC,IAAI,CAAC;SACX,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;SACvG,IAAI,CAAC,IAAI,CAAC,CAAC;IAEhB,OAAO,UAAU,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AAC7E,CAAC"}
@@ -1,16 +0,0 @@
1
- export interface ForgetOptions {
2
- /** Don't actually remove, just show what would be removed */
3
- dryRun?: boolean;
4
- }
5
- export interface ForgetResult {
6
- /** Patches that were (or would be) removed */
7
- removed: Array<{
8
- id: string;
9
- message: string;
10
- files: string[];
11
- }>;
12
- /** True if no patches matched the pattern */
13
- notFound: boolean;
14
- }
15
- export declare function forget(outputDir: string, filePattern: string, options?: ForgetOptions): ForgetResult;
16
- //# sourceMappingURL=forget.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"forget.d.ts","sourceRoot":"","sources":["../../src/commands/forget.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,aAAa;IAC1B,6DAA6D;IAC7D,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IACzB,8CAA8C;IAC9C,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IACjE,6CAA6C;IAC7C,QAAQ,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,YAAY,CAgCpG"}
@@ -1,27 +0,0 @@
1
- import { minimatch } from "minimatch";
2
- import { LockfileManager } from "../LockfileManager.js";
3
- export function forget(outputDir, filePattern, options) {
4
- const lockManager = new LockfileManager(outputDir);
5
- if (!lockManager.exists()) {
6
- return { removed: [], notFound: true };
7
- }
8
- const lock = lockManager.read();
9
- // Find patches that match the pattern
10
- const matchingPatches = lock.patches.filter((patch) => patch.files.some((file) => file === filePattern || minimatch(file, filePattern)));
11
- if (matchingPatches.length === 0) {
12
- return { removed: [], notFound: true };
13
- }
14
- const removed = matchingPatches.map((p) => ({
15
- id: p.id,
16
- message: p.original_message,
17
- files: p.files
18
- }));
19
- if (!options?.dryRun) {
20
- for (const patch of matchingPatches) {
21
- lockManager.removePatch(patch.id);
22
- }
23
- lockManager.save();
24
- }
25
- return { removed, notFound: false };
26
- }
27
- //# sourceMappingURL=forget.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"forget.js","sourceRoot":"","sources":["../../src/commands/forget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAcxD,MAAM,UAAU,MAAM,CAAC,SAAiB,EAAE,WAAmB,EAAE,OAAuB;IAClF,MAAM,WAAW,GAAG,IAAI,eAAe,CAAC,SAAS,CAAC,CAAC;IAEnD,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC;QACxB,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,CAAC;IAED,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC;IAEhC,sCAAsC;IACtC,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAClD,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,WAAW,IAAI,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CACnF,CAAC;IAEF,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,CAAC;IAED,MAAM,OAAO,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACxC,EAAE,EAAE,CAAC,CAAC,EAAE;QACR,OAAO,EAAE,CAAC,CAAC,gBAAgB;QAC3B,KAAK,EAAE,CAAC,CAAC,KAAK;KACjB,CAAC,CAAC,CAAC;IAEJ,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;QACnB,KAAK,MAAM,KAAK,IAAI,eAAe,EAAE,CAAC;YAClC,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACtC,CAAC;QACD,WAAW,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACxC,CAAC"}
@@ -1,6 +0,0 @@
1
- export { bootstrap, type BootstrapOptions, type BootstrapResult } from "./bootstrap.js";
2
- export { forget, type ForgetOptions, type ForgetResult } from "./forget.js";
3
- export { reset, type ResetOptions, type ResetResult } from "./reset.js";
4
- export { resolve, type ResolveOptions, type ResolveResult } from "./resolve.js";
5
- export { status, type StatusResult, type StatusPatch, type StatusGeneration } from "./status.js";
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACxF,OAAO,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC"}
@@ -1,6 +0,0 @@
1
- export { bootstrap } from "./bootstrap.js";
2
- export { forget } from "./forget.js";
3
- export { reset } from "./reset.js";
4
- export { resolve } from "./resolve.js";
5
- export { status } from "./status.js";
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA+C,MAAM,gBAAgB,CAAC;AACxF,OAAO,EAAE,MAAM,EAAyC,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAuC,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,OAAO,EAA2C,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,MAAM,EAA8D,MAAM,aAAa,CAAC"}
@@ -1,16 +0,0 @@
1
- export interface ResetOptions {
2
- /** Don't actually delete, just show what would happen */
3
- dryRun?: boolean;
4
- }
5
- export interface ResetResult {
6
- /** Whether reset was successful (or would be) */
7
- success: boolean;
8
- /** Number of patches that were (or would be) removed */
9
- patchesRemoved: number;
10
- /** Whether the lockfile was (or would be) deleted */
11
- lockfileDeleted: boolean;
12
- /** True if there was nothing to reset */
13
- nothingToReset: boolean;
14
- }
15
- export declare function reset(outputDir: string, options?: ResetOptions): ResetResult;
16
- //# sourceMappingURL=reset.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reset.d.ts","sourceRoot":"","sources":["../../src/commands/reset.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IACzB,yDAAyD;IACzD,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IACxB,iDAAiD;IACjD,OAAO,EAAE,OAAO,CAAC;IACjB,wDAAwD;IACxD,cAAc,EAAE,MAAM,CAAC;IACvB,qDAAqD;IACrD,eAAe,EAAE,OAAO,CAAC;IACzB,yCAAyC;IACzC,cAAc,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAgB,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,WAAW,CAyB5E"}
@@ -1,25 +0,0 @@
1
- import { unlinkSync } from "node:fs";
2
- import { LockfileManager } from "../LockfileManager.js";
3
- export function reset(outputDir, options) {
4
- const lockManager = new LockfileManager(outputDir);
5
- if (!lockManager.exists()) {
6
- return {
7
- success: true,
8
- patchesRemoved: 0,
9
- lockfileDeleted: false,
10
- nothingToReset: true
11
- };
12
- }
13
- const lock = lockManager.read();
14
- const patchCount = lock.patches.length;
15
- if (!options?.dryRun) {
16
- unlinkSync(lockManager.lockfilePath);
17
- }
18
- return {
19
- success: true,
20
- patchesRemoved: patchCount,
21
- lockfileDeleted: true,
22
- nothingToReset: false
23
- };
24
- }
25
- //# sourceMappingURL=reset.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reset.js","sourceRoot":"","sources":["../../src/commands/reset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAkBxD,MAAM,UAAU,KAAK,CAAC,SAAiB,EAAE,OAAsB;IAC3D,MAAM,WAAW,GAAG,IAAI,eAAe,CAAC,SAAS,CAAC,CAAC;IAEnD,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC;QACxB,OAAO;YACH,OAAO,EAAE,IAAI;YACb,cAAc,EAAE,CAAC;YACjB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;SACvB,CAAC;IACN,CAAC;IAED,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC;IAChC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;IAEvC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;QACnB,UAAU,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IACzC,CAAC;IAED,OAAO;QACH,OAAO,EAAE,IAAI;QACb,cAAc,EAAE,UAAU;QAC1B,eAAe,EAAE,IAAI;QACrB,cAAc,EAAE,KAAK;KACxB,CAAC;AACN,CAAC"}
@@ -1,16 +0,0 @@
1
- export interface ResolveOptions {
2
- /** Check for remaining conflict markers before committing. Default: true */
3
- checkMarkers?: boolean;
4
- }
5
- export interface ResolveResult {
6
- /** Whether the resolve succeeded */
7
- success: boolean;
8
- /** Commit SHA of the [fern-replay] commit, if created */
9
- commitSha?: string;
10
- /** Reason for failure */
11
- reason?: string;
12
- /** Files that still have conflict markers */
13
- unresolvedFiles?: string[];
14
- }
15
- export declare function resolve(outputDir: string, options?: ResolveOptions): Promise<ResolveResult>;
16
- //# sourceMappingURL=resolve.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/commands/resolve.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,cAAc;IAC3B,4EAA4E;IAC5E,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC1B,oCAAoC;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yBAAyB;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,wBAAsB,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CA6BjG"}
@@ -1,28 +0,0 @@
1
- import { GitClient } from "../git/GitClient.js";
2
- import { LockfileManager } from "../LockfileManager.js";
3
- import { ReplayCommitter } from "../ReplayCommitter.js";
4
- export async function resolve(outputDir, options) {
5
- const lockManager = new LockfileManager(outputDir);
6
- if (!lockManager.exists()) {
7
- return { success: false, reason: "no-lockfile" };
8
- }
9
- const lock = lockManager.read();
10
- if (lock.patches.length === 0) {
11
- return { success: false, reason: "no-patches" };
12
- }
13
- const git = new GitClient(outputDir);
14
- // Check for remaining conflict markers
15
- if (options?.checkMarkers !== false) {
16
- const markerFiles = await git.exec(["grep", "-l", "<<<<<<<", "--", "."]).catch(() => "");
17
- if (markerFiles.trim()) {
18
- const files = markerFiles.trim().split("\n").filter(Boolean);
19
- return { success: false, reason: "unresolved-conflicts", unresolvedFiles: files };
20
- }
21
- }
22
- // Stage all changes and create [fern-replay] commit
23
- const committer = new ReplayCommitter(git, outputDir);
24
- await committer.stageAll();
25
- const commitSha = await committer.commitReplay(lock.patches.length, lock.patches);
26
- return { success: true, commitSha };
27
- }
28
- //# sourceMappingURL=resolve.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/commands/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAkBxD,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,SAAiB,EAAE,OAAwB;IACrE,MAAM,WAAW,GAAG,IAAI,eAAe,CAAC,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AE,IAAI,EAAE,SAAS,EAAE,CAAC;AACxC,CAAC"}
@@ -1,26 +0,0 @@
1
- export interface StatusResult {
2
- /** Whether replay is initialized (lockfile exists) */
3
- initialized: boolean;
4
- /** Tracked customization patches */
5
- patches: StatusPatch[];
6
- /** Last generation info, if available */
7
- lastGeneration: StatusGeneration | undefined;
8
- }
9
- export interface StatusPatch {
10
- /** Short SHA of the original commit */
11
- sha: string;
12
- /** Author name (without email) */
13
- author: string;
14
- /** Original commit message */
15
- message: string;
16
- /** Files touched by this patch */
17
- files: string[];
18
- }
19
- export interface StatusGeneration {
20
- /** Full commit SHA */
21
- sha: string;
22
- /** Generation timestamp */
23
- timestamp: string;
24
- }
25
- export declare function status(outputDir: string): StatusResult;
26
- //# sourceMappingURL=status.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IACzB,sDAAsD;IACtD,WAAW,EAAE,OAAO,CAAC;IACrB,oCAAoC;IACpC,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,yCAAyC;IACzC,cAAc,EAAE,gBAAgB,GAAG,SAAS,CAAC;CAChD;AAED,MAAM,WAAW,WAAW;IACxB,uCAAuC;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,KAAK,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC7B,sBAAsB;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,2BAA2B;IAC3B,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY,CA0BtD"}
@@ -1,24 +0,0 @@
1
- import { LockfileManager } from "../LockfileManager.js";
2
- export function status(outputDir) {
3
- const lockManager = new LockfileManager(outputDir);
4
- if (!lockManager.exists()) {
5
- return { initialized: false, patches: [], lastGeneration: undefined };
6
- }
7
- const lock = lockManager.read();
8
- const patches = lock.patches.map((patch) => ({
9
- sha: patch.original_commit.slice(0, 7),
10
- author: patch.original_author.split("<")[0]?.trim() ?? "unknown",
11
- message: patch.original_message,
12
- files: patch.files
13
- }));
14
- let lastGeneration;
15
- const lastGen = lock.generations.find((g) => g.commit_sha === lock.current_generation);
16
- if (lastGen) {
17
- lastGeneration = {
18
- sha: lastGen.commit_sha,
19
- timestamp: lastGen.timestamp
20
- };
21
- }
22
- return { initialized: true, patches, lastGeneration };
23
- }
24
- //# sourceMappingURL=status.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AA6BxD,MAAM,UAAU,MAAM,CAAC,SAAiB;IACpC,MAAM,WAAW,GAAG,IAAI,eAAe,CAAC,SAAS,CAAC,CAAC;IAEnD,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC;QACxB,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC;IAC1E,CAAC;IAED,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC;IAEhC,MAAM,OAAO,GAAkB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACxD,GAAG,EAAE,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;QACtC,MAAM,EAAE,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,SAAS;QAChE,OAAO,EAAE,KAAK,CAAC,gBAAgB;QAC/B,KAAK,EAAE,KAAK,CAAC,KAAK;KACrB,CAAC,CAAC,CAAC;IAEJ,IAAI,cAA4C,CAAC;IACjD,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACvF,IAAI,OAAO,EAAE,CAAC;QACV,cAAc,GAAG;YACb,GAAG,EAAE,OAAO,CAAC,UAAU;YACvB,SAAS,EAAE,OAAO,CAAC,SAAS;SAC/B,CAAC;IACN,CAAC;IAED,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1D,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { CommitInfo } from "../types.js";
2
- export declare const FERN_BOT_NAME = "fern-api";
3
- export declare const FERN_BOT_EMAIL = "115122769+fern-api[bot]@users.noreply.github.com";
4
- export declare const FERN_BOT_LOGIN = "fern-api[bot]";
5
- export declare function isGenerationCommit(commit: CommitInfo): boolean;
6
- export declare function isReplayCommit(commit: CommitInfo): boolean;
7
- //# sourceMappingURL=CommitDetection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommitDetection.d.ts","sourceRoot":"","sources":["../../src/git/CommitDetection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG9C,eAAO,MAAM,aAAa,aAAa,CAAC;AACxC,eAAO,MAAM,cAAc,qDAAqD,CAAC;AACjF,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAK9C,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAoB9D;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAE1D"}
@@ -1,26 +0,0 @@
1
- // Constants from Fern's PR #11502
2
- export const FERN_BOT_NAME = "fern-api";
3
- export const FERN_BOT_EMAIL = "115122769+fern-api[bot]@users.noreply.github.com";
4
- export const FERN_BOT_LOGIN = "fern-api[bot]";
5
- // Fern-support commits (via bot account) are excluded from generation detection.
6
- const FERN_SUPPORT_NAMES = ["fern-support", "Fern Support"];
7
- export function isGenerationCommit(commit) {
8
- const isFernSupport = FERN_SUPPORT_NAMES.includes(commit.authorName);
9
- const isBotAuthor = !isFernSupport &&
10
- (commit.authorLogin === FERN_BOT_LOGIN ||
11
- commit.authorEmail === FERN_BOT_EMAIL ||
12
- commit.authorName === FERN_BOT_NAME);
13
- const hasGenerationMarker = commit.message.startsWith("[fern-generated]") ||
14
- commit.message.startsWith("[fern-replay]") ||
15
- commit.message.includes("Generated by Fern") ||
16
- commit.message.includes("\u{1F916} Generated with Fern") ||
17
- // Squash merge of a Fern-generated PR uses the PR title as commit message.
18
- // The default PR title is "SDK Generation" (from GithubStep's commitMessage default).
19
- // GitHub appends "(#N)" for the PR number, e.g. "SDK Generation (#70)".
20
- commit.message.startsWith("SDK Generation");
21
- return isBotAuthor || hasGenerationMarker;
22
- }
23
- export function isReplayCommit(commit) {
24
- return commit.message.startsWith("[fern-replay]");
25
- }
26
- //# sourceMappingURL=CommitDetection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommitDetection.js","sourceRoot":"","sources":["../../src/git/CommitDetection.ts"],"names":[],"mappings":"AAEA,kCAAkC;AAClC,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC;AACxC,MAAM,CAAC,MAAM,cAAc,GAAG,kDAAkD,CAAC;AACjF,MAAM,CAAC,MAAM,cAAc,GAAG,eAAe,CAAC;AAE9C,iFAAiF;AACjF,MAAM,kBAAkB,GAAG,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;AAE5D,MAAM,UAAU,kBAAkB,CAAC,MAAkB;IACjD,MAAM,aAAa,GAAG,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAErE,MAAM,WAAW,GACb,CAAC,aAAa;QACd,CAAC,MAAM,CAAC,WAAW,KAAK,cAAc;YAClC,MAAM,CAAC,WAAW,KAAK,cAAc;YACrC,MAAM,CAAC,UAAU,KAAK,aAAa,CAAC,CAAC;IAE7C,MAAM,mBAAmB,GACrB,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC;QAC7C,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,eAAe,CAAC;QAC1C,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC;QAC5C,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,+BAA+B,CAAC;QACxD,2EAA2E;QAC3E,sFAAsF;QACtF,wEAAwE;QACxE,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAEhD,OAAO,WAAW,IAAI,mBAAmB,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAAkB;IAC7C,OAAO,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AACtD,CAAC"}
@@ -1,22 +0,0 @@
1
- import type { CommitInfo } from "../types.js";
2
- export declare class GitClient {
3
- private git;
4
- private repoPath;
5
- constructor(repoPath: string);
6
- exec(args: string[]): Promise<string>;
7
- execWithInput(args: string[], input: string): Promise<string>;
8
- formatPatch(commitSha: string): Promise<string>;
9
- applyPatch(patchContent: string): Promise<void>;
10
- getTreeHash(commitSha: string): Promise<string>;
11
- showFile(treeish: string, filePath: string): Promise<string | null>;
12
- getCommitInfo(commitSha: string): Promise<CommitInfo>;
13
- getCommitParents(commitSha: string): Promise<string[]>;
14
- detectRenames(fromTree: string, toTree: string): Promise<Array<{
15
- from: string;
16
- to: string;
17
- }>>;
18
- isAncestor(commit: string, descendant: string): Promise<boolean>;
19
- commitExists(sha: string): Promise<boolean>;
20
- getRepoPath(): string;
21
- }
22
- //# sourceMappingURL=GitClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GitClient.d.ts","sourceRoot":"","sources":["../../src/git/GitClient.ts"],"names":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