@fern-api/fern-api-dev 5.28.1 → 5.28.3
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/cli.cjs +150 -303
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -11036,9 +11036,9 @@ var require_commonjs = __commonJS({
|
|
|
11036
11036
|
}
|
|
11037
11037
|
});
|
|
11038
11038
|
|
|
11039
|
-
// ../../../node_modules/.pnpm/brace-expansion@5.0.
|
|
11039
|
+
// ../../../node_modules/.pnpm/brace-expansion@5.0.6/node_modules/brace-expansion/dist/commonjs/index.js
|
|
11040
11040
|
var require_commonjs2 = __commonJS({
|
|
11041
|
-
"../../../node_modules/.pnpm/brace-expansion@5.0.
|
|
11041
|
+
"../../../node_modules/.pnpm/brace-expansion@5.0.6/node_modules/brace-expansion/dist/commonjs/index.js"(exports2) {
|
|
11042
11042
|
"use strict";
|
|
11043
11043
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
11044
11044
|
exports2.EXPANSION_MAX = void 0;
|
|
@@ -11162,7 +11162,7 @@ var require_commonjs2 = __commonJS({
|
|
|
11162
11162
|
}
|
|
11163
11163
|
const pad3 = n19.some(isPadded2);
|
|
11164
11164
|
N4 = [];
|
|
11165
|
-
for (let i9 = x5; test2(i9, y7); i9 += incr) {
|
|
11165
|
+
for (let i9 = x5; test2(i9, y7) && N4.length < max; i9 += incr) {
|
|
11166
11166
|
let c6;
|
|
11167
11167
|
if (isAlphaSequence) {
|
|
11168
11168
|
c6 = String.fromCharCode(i9);
|
|
@@ -45171,7 +45171,7 @@ var init_esm9 = __esm({
|
|
|
45171
45171
|
}
|
|
45172
45172
|
});
|
|
45173
45173
|
|
|
45174
|
-
// ../../../node_modules/.pnpm/brace-expansion@5.0.
|
|
45174
|
+
// ../../../node_modules/.pnpm/brace-expansion@5.0.6/node_modules/brace-expansion/dist/esm/index.js
|
|
45175
45175
|
function numeric(str3) {
|
|
45176
45176
|
return !isNaN(str3) ? parseInt(str3, 10) : str3.charCodeAt(0);
|
|
45177
45177
|
}
|
|
@@ -45274,7 +45274,7 @@ function expand_(str3, max, isTop) {
|
|
|
45274
45274
|
}
|
|
45275
45275
|
const pad3 = n19.some(isPadded);
|
|
45276
45276
|
N4 = [];
|
|
45277
|
-
for (let i9 = x5; test2(i9, y7); i9 += incr) {
|
|
45277
|
+
for (let i9 = x5; test2(i9, y7) && N4.length < max; i9 += incr) {
|
|
45278
45278
|
let c6;
|
|
45279
45279
|
if (isAlphaSequence) {
|
|
45280
45280
|
c6 = String.fromCharCode(i9);
|
|
@@ -45316,7 +45316,7 @@ function expand_(str3, max, isTop) {
|
|
|
45316
45316
|
}
|
|
45317
45317
|
var escSlash, escOpen, escClose, escComma, escPeriod, escSlashPattern, escOpenPattern, escClosePattern, escCommaPattern, escPeriodPattern, slashPattern, openPattern, closePattern, commaPattern, periodPattern, EXPANSION_MAX;
|
|
45318
45318
|
var init_esm10 = __esm({
|
|
45319
|
-
"../../../node_modules/.pnpm/brace-expansion@5.0.
|
|
45319
|
+
"../../../node_modules/.pnpm/brace-expansion@5.0.6/node_modules/brace-expansion/dist/esm/index.js"() {
|
|
45320
45320
|
"use strict";
|
|
45321
45321
|
init_esm9();
|
|
45322
45322
|
escSlash = "\0SLASH" + Math.random() + "\0";
|
|
@@ -332299,9 +332299,9 @@ var require_express3 = __commonJS({
|
|
|
332299
332299
|
}
|
|
332300
332300
|
});
|
|
332301
332301
|
|
|
332302
|
-
// ../../../node_modules/.pnpm/ws@8.20.
|
|
332302
|
+
// ../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/constants.js
|
|
332303
332303
|
var require_constants2 = __commonJS({
|
|
332304
|
-
"../../../node_modules/.pnpm/ws@8.20.
|
|
332304
|
+
"../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/constants.js"(exports2, module4) {
|
|
332305
332305
|
"use strict";
|
|
332306
332306
|
var BINARY_TYPES = ["nodebuffer", "arraybuffer", "fragments"];
|
|
332307
332307
|
var hasBlob = typeof Blob !== "undefined";
|
|
@@ -332322,9 +332322,9 @@ var require_constants2 = __commonJS({
|
|
|
332322
332322
|
}
|
|
332323
332323
|
});
|
|
332324
332324
|
|
|
332325
|
-
// ../../../node_modules/.pnpm/ws@8.20.
|
|
332325
|
+
// ../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/buffer-util.js
|
|
332326
332326
|
var require_buffer_util = __commonJS({
|
|
332327
|
-
"../../../node_modules/.pnpm/ws@8.20.
|
|
332327
|
+
"../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/buffer-util.js"(exports2, module4) {
|
|
332328
332328
|
"use strict";
|
|
332329
332329
|
var { EMPTY_BUFFER } = require_constants2();
|
|
332330
332330
|
var FastBuffer = Buffer[Symbol.species];
|
|
@@ -332397,9 +332397,9 @@ var require_buffer_util = __commonJS({
|
|
|
332397
332397
|
}
|
|
332398
332398
|
});
|
|
332399
332399
|
|
|
332400
|
-
// ../../../node_modules/.pnpm/ws@8.20.
|
|
332400
|
+
// ../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/limiter.js
|
|
332401
332401
|
var require_limiter2 = __commonJS({
|
|
332402
|
-
"../../../node_modules/.pnpm/ws@8.20.
|
|
332402
|
+
"../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/limiter.js"(exports2, module4) {
|
|
332403
332403
|
"use strict";
|
|
332404
332404
|
var kDone = /* @__PURE__ */ Symbol("kDone");
|
|
332405
332405
|
var kRun = /* @__PURE__ */ Symbol("kRun");
|
|
@@ -332447,9 +332447,9 @@ var require_limiter2 = __commonJS({
|
|
|
332447
332447
|
}
|
|
332448
332448
|
});
|
|
332449
332449
|
|
|
332450
|
-
// ../../../node_modules/.pnpm/ws@8.20.
|
|
332450
|
+
// ../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/permessage-deflate.js
|
|
332451
332451
|
var require_permessage_deflate = __commonJS({
|
|
332452
|
-
"../../../node_modules/.pnpm/ws@8.20.
|
|
332452
|
+
"../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/permessage-deflate.js"(exports2, module4) {
|
|
332453
332453
|
"use strict";
|
|
332454
332454
|
var zlib4 = require("zlib");
|
|
332455
332455
|
var bufferUtil = require_buffer_util();
|
|
@@ -332830,9 +332830,9 @@ var require_permessage_deflate = __commonJS({
|
|
|
332830
332830
|
}
|
|
332831
332831
|
});
|
|
332832
332832
|
|
|
332833
|
-
// ../../../node_modules/.pnpm/ws@8.20.
|
|
332833
|
+
// ../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/validation.js
|
|
332834
332834
|
var require_validation4 = __commonJS({
|
|
332835
|
-
"../../../node_modules/.pnpm/ws@8.20.
|
|
332835
|
+
"../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/validation.js"(exports2, module4) {
|
|
332836
332836
|
"use strict";
|
|
332837
332837
|
var { isUtf8 } = require("buffer");
|
|
332838
332838
|
var { hasBlob } = require_constants2();
|
|
@@ -333031,9 +333031,9 @@ var require_validation4 = __commonJS({
|
|
|
333031
333031
|
}
|
|
333032
333032
|
});
|
|
333033
333033
|
|
|
333034
|
-
// ../../../node_modules/.pnpm/ws@8.20.
|
|
333034
|
+
// ../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/receiver.js
|
|
333035
333035
|
var require_receiver = __commonJS({
|
|
333036
|
-
"../../../node_modules/.pnpm/ws@8.20.
|
|
333036
|
+
"../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/receiver.js"(exports2, module4) {
|
|
333037
333037
|
"use strict";
|
|
333038
333038
|
var { Writable: Writable2 } = require("stream");
|
|
333039
333039
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
@@ -333623,12 +333623,15 @@ var require_receiver = __commonJS({
|
|
|
333623
333623
|
}
|
|
333624
333624
|
});
|
|
333625
333625
|
|
|
333626
|
-
// ../../../node_modules/.pnpm/ws@8.20.
|
|
333626
|
+
// ../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/sender.js
|
|
333627
333627
|
var require_sender = __commonJS({
|
|
333628
|
-
"../../../node_modules/.pnpm/ws@8.20.
|
|
333628
|
+
"../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/sender.js"(exports2, module4) {
|
|
333629
333629
|
"use strict";
|
|
333630
333630
|
var { Duplex } = require("stream");
|
|
333631
333631
|
var { randomFillSync } = require("crypto");
|
|
333632
|
+
var {
|
|
333633
|
+
types: { isUint8Array: isUint8Array3 }
|
|
333634
|
+
} = require("util");
|
|
333632
333635
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
333633
333636
|
var { EMPTY_BUFFER, kWebSocket, NOOP: NOOP3 } = require_constants2();
|
|
333634
333637
|
var { isBlob: isBlob5, isValidStatusCode } = require_validation4();
|
|
@@ -333782,8 +333785,10 @@ var require_sender = __commonJS({
|
|
|
333782
333785
|
buf.writeUInt16BE(code5, 0);
|
|
333783
333786
|
if (typeof data2 === "string") {
|
|
333784
333787
|
buf.write(data2, 2);
|
|
333785
|
-
} else {
|
|
333788
|
+
} else if (isUint8Array3(data2)) {
|
|
333786
333789
|
buf.set(data2, 2);
|
|
333790
|
+
} else {
|
|
333791
|
+
throw new TypeError("Second argument must be a string or a Uint8Array");
|
|
333787
333792
|
}
|
|
333788
333793
|
}
|
|
333789
333794
|
const options2 = {
|
|
@@ -334111,9 +334116,9 @@ var require_sender = __commonJS({
|
|
|
334111
334116
|
}
|
|
334112
334117
|
});
|
|
334113
334118
|
|
|
334114
|
-
// ../../../node_modules/.pnpm/ws@8.20.
|
|
334119
|
+
// ../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/event-target.js
|
|
334115
334120
|
var require_event_target = __commonJS({
|
|
334116
|
-
"../../../node_modules/.pnpm/ws@8.20.
|
|
334121
|
+
"../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/event-target.js"(exports2, module4) {
|
|
334117
334122
|
"use strict";
|
|
334118
334123
|
var { kForOnEventAttribute, kListener } = require_constants2();
|
|
334119
334124
|
var kCode = /* @__PURE__ */ Symbol("kCode");
|
|
@@ -334340,9 +334345,9 @@ var require_event_target = __commonJS({
|
|
|
334340
334345
|
}
|
|
334341
334346
|
});
|
|
334342
334347
|
|
|
334343
|
-
// ../../../node_modules/.pnpm/ws@8.20.
|
|
334348
|
+
// ../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/extension.js
|
|
334344
334349
|
var require_extension = __commonJS({
|
|
334345
|
-
"../../../node_modules/.pnpm/ws@8.20.
|
|
334350
|
+
"../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/extension.js"(exports2, module4) {
|
|
334346
334351
|
"use strict";
|
|
334347
334352
|
var { tokenChars } = require_validation4();
|
|
334348
334353
|
function push3(dest, name2, elem) {
|
|
@@ -334493,9 +334498,9 @@ var require_extension = __commonJS({
|
|
|
334493
334498
|
}
|
|
334494
334499
|
});
|
|
334495
334500
|
|
|
334496
|
-
// ../../../node_modules/.pnpm/ws@8.20.
|
|
334501
|
+
// ../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/websocket.js
|
|
334497
334502
|
var require_websocket = __commonJS({
|
|
334498
|
-
"../../../node_modules/.pnpm/ws@8.20.
|
|
334503
|
+
"../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/websocket.js"(exports2, module4) {
|
|
334499
334504
|
"use strict";
|
|
334500
334505
|
var EventEmitter9 = require("events");
|
|
334501
334506
|
var https5 = require("https");
|
|
@@ -335379,9 +335384,9 @@ var require_websocket = __commonJS({
|
|
|
335379
335384
|
}
|
|
335380
335385
|
});
|
|
335381
335386
|
|
|
335382
|
-
// ../../../node_modules/.pnpm/ws@8.20.
|
|
335387
|
+
// ../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/stream.js
|
|
335383
335388
|
var require_stream3 = __commonJS({
|
|
335384
|
-
"../../../node_modules/.pnpm/ws@8.20.
|
|
335389
|
+
"../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/stream.js"(exports2, module4) {
|
|
335385
335390
|
"use strict";
|
|
335386
335391
|
var WebSocket3 = require_websocket();
|
|
335387
335392
|
var { Duplex } = require("stream");
|
|
@@ -335477,9 +335482,9 @@ var require_stream3 = __commonJS({
|
|
|
335477
335482
|
}
|
|
335478
335483
|
});
|
|
335479
335484
|
|
|
335480
|
-
// ../../../node_modules/.pnpm/ws@8.20.
|
|
335485
|
+
// ../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/subprotocol.js
|
|
335481
335486
|
var require_subprotocol = __commonJS({
|
|
335482
|
-
"../../../node_modules/.pnpm/ws@8.20.
|
|
335487
|
+
"../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/subprotocol.js"(exports2, module4) {
|
|
335483
335488
|
"use strict";
|
|
335484
335489
|
var { tokenChars } = require_validation4();
|
|
335485
335490
|
function parse19(header) {
|
|
@@ -335522,9 +335527,9 @@ var require_subprotocol = __commonJS({
|
|
|
335522
335527
|
}
|
|
335523
335528
|
});
|
|
335524
335529
|
|
|
335525
|
-
// ../../../node_modules/.pnpm/ws@8.20.
|
|
335530
|
+
// ../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/websocket-server.js
|
|
335526
335531
|
var require_websocket_server = __commonJS({
|
|
335527
|
-
"../../../node_modules/.pnpm/ws@8.20.
|
|
335532
|
+
"../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/websocket-server.js"(exports2, module4) {
|
|
335528
335533
|
"use strict";
|
|
335529
335534
|
var EventEmitter9 = require("events");
|
|
335530
335535
|
var http13 = require("http");
|
|
@@ -335915,10 +335920,10 @@ var require_websocket_server = __commonJS({
|
|
|
335915
335920
|
}
|
|
335916
335921
|
});
|
|
335917
335922
|
|
|
335918
|
-
// ../../../node_modules/.pnpm/ws@8.20.
|
|
335923
|
+
// ../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/wrapper.mjs
|
|
335919
335924
|
var import_stream16, import_extension, import_permessage_deflate, import_receiver, import_sender, import_subprotocol, import_websocket, import_websocket_server, wrapper_default;
|
|
335920
335925
|
var init_wrapper = __esm({
|
|
335921
|
-
"../../../node_modules/.pnpm/ws@8.20.
|
|
335926
|
+
"../../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/wrapper.mjs"() {
|
|
335922
335927
|
"use strict";
|
|
335923
335928
|
import_stream16 = __toESM(require_stream3(), 1);
|
|
335924
335929
|
import_extension = __toESM(require_extension(), 1);
|
|
@@ -360342,9 +360347,9 @@ var require_diff3 = __commonJS({
|
|
|
360342
360347
|
}
|
|
360343
360348
|
});
|
|
360344
360349
|
|
|
360345
|
-
// ../../../node_modules/.pnpm/@fern-api+replay@0.
|
|
360350
|
+
// ../../../node_modules/.pnpm/@fern-api+replay@0.16.0/node_modules/@fern-api/replay/dist/index.cjs
|
|
360346
360351
|
var require_dist14 = __commonJS({
|
|
360347
|
-
"../../../node_modules/.pnpm/@fern-api+replay@0.
|
|
360352
|
+
"../../../node_modules/.pnpm/@fern-api+replay@0.16.0/node_modules/@fern-api/replay/dist/index.cjs"(exports2, module4) {
|
|
360348
360353
|
"use strict";
|
|
360349
360354
|
var __defProp4 = Object.defineProperty;
|
|
360350
360355
|
var __getOwnPropDesc4 = Object.getOwnPropertyDescriptor;
|
|
@@ -360880,9 +360885,22 @@ var require_dist14 = __commonJS({
|
|
|
360880
360885
|
const hasGenerationMarker = commit.message.startsWith("[fern-generated]") || commit.message.startsWith("[fern-replay]") || commit.message.startsWith("[fern-autoversion]") || commit.message.includes("Generated by Fern") || commit.message.includes("\u{1F916} Generated with Fern") || // Squash merge of a Fern-generated PR uses the PR title as commit message.
|
|
360881
360886
|
// The default PR title is "SDK Generation" (from GithubStep's commitMessage default).
|
|
360882
360887
|
// GitHub appends "(#N)" for the PR number, e.g. "SDK Generation (#70)".
|
|
360883
|
-
commit.message.startsWith("SDK Generation")
|
|
360888
|
+
commit.message.startsWith("SDK Generation") || // Merge commit (GitHub's "Create a merge commit" option) of a fern-bot
|
|
360889
|
+
// regen PR. First-parent walking lands on this commit, not on the
|
|
360890
|
+
// generation commit on the side branch, so the classifier must treat
|
|
360891
|
+
// it as a generation boundary. GitHub's default subject is
|
|
360892
|
+
// "Merge pull request #N from <owner>/<branch>"; fern-bot branches are
|
|
360893
|
+
// named "<owner>/fern-bot/<...>".
|
|
360894
|
+
/^Merge pull request #\d+ from [^/]+\/fern-bot\//.test(commit.message);
|
|
360884
360895
|
return isBotAuthor || hasGenerationMarker;
|
|
360885
360896
|
}
|
|
360897
|
+
function isGenerationBoundary(commit) {
|
|
360898
|
+
const isFernSupport = FERN_SUPPORT_NAMES.includes(commit.authorName);
|
|
360899
|
+
const isBotAuthor = !isFernSupport && (commit.authorLogin === FERN_BOT_LOGIN || commit.authorEmail === FERN_BOT_EMAIL || commit.authorName === FERN_BOT_NAME);
|
|
360900
|
+
const isAutoversion = commit.message.startsWith("[fern-autoversion]");
|
|
360901
|
+
const hasBoundaryMarker = commit.message.startsWith("[fern-generated]") || commit.message.startsWith("[fern-replay]") || commit.message.includes("Generated by Fern") || commit.message.includes("\u{1F916} Generated with Fern") || commit.message.startsWith("SDK Generation");
|
|
360902
|
+
return isBotAuthor && !isAutoversion || hasBoundaryMarker;
|
|
360903
|
+
}
|
|
360886
360904
|
function isReplayCommit(commit) {
|
|
360887
360905
|
return commit.message.startsWith("[fern-replay]");
|
|
360888
360906
|
}
|
|
@@ -361202,8 +361220,48 @@ var require_dist14 = __commonJS({
|
|
|
361202
361220
|
this.lockManager = lockManager;
|
|
361203
361221
|
this.sdkOutputDir = sdkOutputDir;
|
|
361204
361222
|
}
|
|
361223
|
+
/**
|
|
361224
|
+
* Derive the previous-generation SHA from git history instead of trusting
|
|
361225
|
+
* `lock.current_generation`.
|
|
361226
|
+
*
|
|
361227
|
+
* Walks `git log HEAD --first-parent` and returns the SHA of the most recent
|
|
361228
|
+
* commit that `isGenerationBoundary` classifies as a customization-baseline
|
|
361229
|
+
* boundary, or null if no such commit is reachable from HEAD on the mainline.
|
|
361230
|
+
*
|
|
361231
|
+
* `isGenerationBoundary` is intentionally narrower than `isGenerationCommit`:
|
|
361232
|
+
* it excludes `[fern-autoversion]` (lightweight bumps that don't reset the
|
|
361233
|
+
* baseline) and the GitHub merge-commit subject for fern-bot regen PRs
|
|
361234
|
+
* (which sits on first-parent but where the customer fix-up commits live
|
|
361235
|
+
* on second-parent — stopping at the merge would hide them).
|
|
361236
|
+
*
|
|
361237
|
+
* See docs/adr/0001-derived-scan-boundary.md.
|
|
361238
|
+
*/
|
|
361239
|
+
async findPreviousGenerationFromHistory() {
|
|
361240
|
+
let log4;
|
|
361241
|
+
try {
|
|
361242
|
+
log4 = await this.git.exec([
|
|
361243
|
+
"log",
|
|
361244
|
+
"--first-parent",
|
|
361245
|
+
"--format=%H%x00%an%x00%ae%x00%s",
|
|
361246
|
+
"HEAD"
|
|
361247
|
+
]);
|
|
361248
|
+
} catch {
|
|
361249
|
+
return null;
|
|
361250
|
+
}
|
|
361251
|
+
for (const commit of this.parseGitLog(log4)) {
|
|
361252
|
+
if (isGenerationBoundary(commit)) {
|
|
361253
|
+
return commit.sha;
|
|
361254
|
+
}
|
|
361255
|
+
}
|
|
361256
|
+
return null;
|
|
361257
|
+
}
|
|
361205
361258
|
async detectNewPatches() {
|
|
361206
361259
|
const lock = this.lockManager.read();
|
|
361260
|
+
const derivedSha = await this.findPreviousGenerationFromHistory();
|
|
361261
|
+
if (derivedSha !== null) {
|
|
361262
|
+
const derivedRecord = await this.synthesizeGenerationRecord(derivedSha);
|
|
361263
|
+
return this.detectPatchesInRange(derivedSha, derivedRecord, lock);
|
|
361264
|
+
}
|
|
361207
361265
|
const lastGen = this.getLastGeneration(lock);
|
|
361208
361266
|
if (!lastGen) {
|
|
361209
361267
|
return { patches: [], revertedPatchIds: [] };
|
|
@@ -361211,7 +361269,7 @@ var require_dist14 = __commonJS({
|
|
|
361211
361269
|
const exists2 = await this.git.commitExists(lastGen.commit_sha);
|
|
361212
361270
|
if (!exists2) {
|
|
361213
361271
|
this.warnings.push(
|
|
361214
|
-
`Generation commit ${lastGen.commit_sha.slice(0, 7)} not found in git history. Falling back to
|
|
361272
|
+
`Generation commit ${lastGen.commit_sha.slice(0, 7)} not found in git history. Falling back to tree-diff detection (likely a shallow clone).`
|
|
361215
361273
|
);
|
|
361216
361274
|
return this.detectPatchesViaTreeDiff(
|
|
361217
361275
|
lastGen,
|
|
@@ -361219,44 +361277,8 @@ var require_dist14 = __commonJS({
|
|
|
361219
361277
|
true
|
|
361220
361278
|
);
|
|
361221
361279
|
}
|
|
361222
|
-
const isAncestor = await this.git.isAncestor(lastGen.commit_sha, "HEAD");
|
|
361223
|
-
if (!isAncestor) {
|
|
361224
|
-
return this.detectPatchesViaMergeBase(lastGen, lock);
|
|
361225
|
-
}
|
|
361226
361280
|
return this.detectPatchesInRange(lastGen.commit_sha, lastGen, lock);
|
|
361227
361281
|
}
|
|
361228
|
-
/**
|
|
361229
|
-
* Non-linear-history detection via `merge-base(prevGen, HEAD)`.
|
|
361230
|
-
*
|
|
361231
|
-
* After a squash-merge of a Fern-bot PR, `lastGen.commit_sha` (the previous
|
|
361232
|
-
* `[fern-generated]`) is orphaned but still in git's object database. The
|
|
361233
|
-
* merge-base is the commit on main from which the bot's branch was created —
|
|
361234
|
-
* a reachable ancestor of HEAD. Walking that range and classifying each
|
|
361235
|
-
* commit via `isGenerationCommit` mirrors the linear path and eliminates
|
|
361236
|
-
* the bug class where pipeline-driven changes (autoversion, replay,
|
|
361237
|
-
* generation) get bundled as customer customizations.
|
|
361238
|
-
*
|
|
361239
|
-
* Falls through to the legacy composite path when no common ancestor exists
|
|
361240
|
-
* (truly disjoint history — orphan branches with no shared root).
|
|
361241
|
-
*/
|
|
361242
|
-
async detectPatchesViaMergeBase(lastGen, lock) {
|
|
361243
|
-
let mergeBase = "";
|
|
361244
|
-
try {
|
|
361245
|
-
mergeBase = (await this.git.exec(["merge-base", lastGen.commit_sha, "HEAD"])).trim();
|
|
361246
|
-
} catch {
|
|
361247
|
-
}
|
|
361248
|
-
if (!mergeBase) {
|
|
361249
|
-
this.warnings.push(
|
|
361250
|
-
`No common ancestor between previous generation ${lastGen.commit_sha.slice(0, 7)} and HEAD. Falling back to composite tree-diff detection.`
|
|
361251
|
-
);
|
|
361252
|
-
return this.detectPatchesViaTreeDiff(
|
|
361253
|
-
lastGen,
|
|
361254
|
-
/* commitKnownMissing */
|
|
361255
|
-
false
|
|
361256
|
-
);
|
|
361257
|
-
}
|
|
361258
|
-
return this.detectPatchesInRange(mergeBase, lastGen, lock);
|
|
361259
|
-
}
|
|
361260
361282
|
/**
|
|
361261
361283
|
* Walk `${rangeStart}..HEAD`, classify each commit, emit one
|
|
361262
361284
|
* `StoredPatch` per customer commit. Body shared by the linear path
|
|
@@ -361692,6 +361714,26 @@ var require_dist14 = __commonJS({
|
|
|
361692
361714
|
getLastGeneration(lock) {
|
|
361693
361715
|
return lock.generations.find((g8) => g8.commit_sha === lock.current_generation);
|
|
361694
361716
|
}
|
|
361717
|
+
/**
|
|
361718
|
+
* Build a transient `GenerationRecord` from a SHA derived by walking git
|
|
361719
|
+
* history. Only `commit_sha` (and `tree_hash` when needed downstream) is
|
|
361720
|
+
* load-bearing here; the rest are filled with defensible placeholders.
|
|
361721
|
+
* This record is consumed by `detectPatchesInRange` and is never persisted.
|
|
361722
|
+
*/
|
|
361723
|
+
async synthesizeGenerationRecord(sha) {
|
|
361724
|
+
let tree_hash = "";
|
|
361725
|
+
try {
|
|
361726
|
+
tree_hash = await this.git.getTreeHash(sha);
|
|
361727
|
+
} catch {
|
|
361728
|
+
}
|
|
361729
|
+
return {
|
|
361730
|
+
commit_sha: sha,
|
|
361731
|
+
tree_hash,
|
|
361732
|
+
timestamp: (/* @__PURE__ */ new Date(0)).toISOString(),
|
|
361733
|
+
cli_version: "",
|
|
361734
|
+
generator_versions: {}
|
|
361735
|
+
};
|
|
361736
|
+
}
|
|
361695
361737
|
};
|
|
361696
361738
|
var import_node_diff3 = require_diff3();
|
|
361697
361739
|
function threeWayMerge(base4, ours, theirs) {
|
|
@@ -362813,8 +362855,7 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
362813
362855
|
tree_hash: treeHash,
|
|
362814
362856
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
362815
362857
|
cli_version: options2?.cliVersion ?? "unknown",
|
|
362816
|
-
generator_versions: options2?.generatorVersions ?? {}
|
|
362817
|
-
base_branch_head: options2?.baseBranchHead
|
|
362858
|
+
generator_versions: options2?.generatorVersions ?? {}
|
|
362818
362859
|
};
|
|
362819
362860
|
}
|
|
362820
362861
|
async stageAll() {
|
|
@@ -363193,7 +363234,6 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
363193
363234
|
flow: "first-generation",
|
|
363194
363235
|
previousGenerationSha: null,
|
|
363195
363236
|
currentGenerationSha: headSha,
|
|
363196
|
-
baseBranchHead: options2.baseBranchHead ?? null,
|
|
363197
363237
|
_prepared: {
|
|
363198
363238
|
kind: "terminal",
|
|
363199
363239
|
flow: "first-generation",
|
|
@@ -363203,8 +363243,7 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
363203
363243
|
}
|
|
363204
363244
|
const commitOpts = options2 ? {
|
|
363205
363245
|
cliVersion: options2.cliVersion ?? "unknown",
|
|
363206
|
-
generatorVersions: options2.generatorVersions ?? {}
|
|
363207
|
-
baseBranchHead: options2.baseBranchHead
|
|
363246
|
+
generatorVersions: options2.generatorVersions ?? {}
|
|
363208
363247
|
} : void 0;
|
|
363209
363248
|
await this.service.committer.commitGeneration("Initial SDK generation", commitOpts);
|
|
363210
363249
|
const genRecord = await this.service.committer.createGenerationRecord(commitOpts);
|
|
@@ -363213,7 +363252,6 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
363213
363252
|
flow: "first-generation",
|
|
363214
363253
|
previousGenerationSha: null,
|
|
363215
363254
|
currentGenerationSha: genRecord.commit_sha,
|
|
363216
|
-
baseBranchHead: options2?.baseBranchHead ?? null,
|
|
363217
363255
|
_prepared: {
|
|
363218
363256
|
kind: "active",
|
|
363219
363257
|
flow: "first-generation",
|
|
@@ -363248,8 +363286,7 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
363248
363286
|
async prepare(options2) {
|
|
363249
363287
|
const commitOpts = options2 ? {
|
|
363250
363288
|
cliVersion: options2.cliVersion ?? "unknown",
|
|
363251
|
-
generatorVersions: options2.generatorVersions ?? {}
|
|
363252
|
-
baseBranchHead: options2.baseBranchHead
|
|
363289
|
+
generatorVersions: options2.generatorVersions ?? {}
|
|
363253
363290
|
} : void 0;
|
|
363254
363291
|
await this.service.committer.commitGeneration("Update SDK (replay skipped)", commitOpts);
|
|
363255
363292
|
await this.service.cleanupStaleConflictMarkers();
|
|
@@ -363271,7 +363308,6 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
363271
363308
|
flow: "skip-application",
|
|
363272
363309
|
previousGenerationSha,
|
|
363273
363310
|
currentGenerationSha: genRecord.commit_sha,
|
|
363274
|
-
baseBranchHead: options2?.baseBranchHead ?? null,
|
|
363275
363311
|
_prepared: {
|
|
363276
363312
|
kind: "active",
|
|
363277
363313
|
flow: "skip-application",
|
|
@@ -363330,7 +363366,6 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
363330
363366
|
flow: "no-patches",
|
|
363331
363367
|
previousGenerationSha,
|
|
363332
363368
|
currentGenerationSha: headSha,
|
|
363333
|
-
baseBranchHead: options2.baseBranchHead ?? null,
|
|
363334
363369
|
_prepared: {
|
|
363335
363370
|
kind: "terminal",
|
|
363336
363371
|
flow: "no-patches",
|
|
@@ -363362,8 +363397,7 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
363362
363397
|
}
|
|
363363
363398
|
const commitOpts = options2 ? {
|
|
363364
363399
|
cliVersion: options2.cliVersion ?? "unknown",
|
|
363365
|
-
generatorVersions: options2.generatorVersions ?? {}
|
|
363366
|
-
baseBranchHead: options2.baseBranchHead
|
|
363400
|
+
generatorVersions: options2.generatorVersions ?? {}
|
|
363367
363401
|
} : void 0;
|
|
363368
363402
|
await this.service.committer.commitGeneration("Update SDK", commitOpts);
|
|
363369
363403
|
await this.service.cleanupStaleConflictMarkers();
|
|
@@ -363373,7 +363407,6 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
363373
363407
|
flow: "no-patches",
|
|
363374
363408
|
previousGenerationSha,
|
|
363375
363409
|
currentGenerationSha: genRecord.commit_sha,
|
|
363376
|
-
baseBranchHead: options2?.baseBranchHead ?? null,
|
|
363377
363410
|
_prepared: {
|
|
363378
363411
|
kind: "active",
|
|
363379
363412
|
flow: "no-patches",
|
|
@@ -363461,7 +363494,6 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
363461
363494
|
flow: "normal-regeneration",
|
|
363462
363495
|
previousGenerationSha,
|
|
363463
363496
|
currentGenerationSha: headSha,
|
|
363464
|
-
baseBranchHead: options2.baseBranchHead ?? null,
|
|
363465
363497
|
_prepared: {
|
|
363466
363498
|
kind: "terminal",
|
|
363467
363499
|
flow: "normal-regeneration",
|
|
@@ -363479,14 +363511,16 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
363479
363511
|
existingPatches = this.service.lockManager.getPatches();
|
|
363480
363512
|
const seenHashes = /* @__PURE__ */ new Map();
|
|
363481
363513
|
for (const p14 of existingPatches) {
|
|
363482
|
-
|
|
363483
|
-
|
|
363484
|
-
|
|
363485
|
-
|
|
363486
|
-
|
|
363487
|
-
|
|
363488
|
-
|
|
363489
|
-
|
|
363514
|
+
if (!p14.original_commit || p14.original_commit === "") {
|
|
363515
|
+
const priorPatchId = seenHashes.get(p14.content_hash);
|
|
363516
|
+
if (priorPatchId !== void 0) {
|
|
363517
|
+
this.service.lockManager.removePatch(p14.id);
|
|
363518
|
+
this.service.warnings.push(
|
|
363519
|
+
`Consolidated patch ${p14.id} into prior patch ${priorPatchId}: byte-identical patch_content. Lockfile collapsed to avoid duplicate-apply corruption on next regen.`
|
|
363520
|
+
);
|
|
363521
|
+
} else {
|
|
363522
|
+
seenHashes.set(p14.content_hash, p14.id);
|
|
363523
|
+
}
|
|
363490
363524
|
}
|
|
363491
363525
|
}
|
|
363492
363526
|
existingPatches = this.service.lockManager.getPatches();
|
|
@@ -363515,8 +363549,7 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
363515
363549
|
const allPatches = [...existingPatches, ...newPatches];
|
|
363516
363550
|
const commitOpts = options2 ? {
|
|
363517
363551
|
cliVersion: options2.cliVersion ?? "unknown",
|
|
363518
|
-
generatorVersions: options2.generatorVersions ?? {}
|
|
363519
|
-
baseBranchHead: options2.baseBranchHead
|
|
363552
|
+
generatorVersions: options2.generatorVersions ?? {}
|
|
363520
363553
|
} : void 0;
|
|
363521
363554
|
await this.service.committer.commitGeneration("Update SDK", commitOpts);
|
|
363522
363555
|
await this.service.cleanupStaleConflictMarkers();
|
|
@@ -363526,7 +363559,6 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
363526
363559
|
flow: "normal-regeneration",
|
|
363527
363560
|
previousGenerationSha,
|
|
363528
363561
|
currentGenerationSha: genRecord.commit_sha,
|
|
363529
|
-
baseBranchHead: options2?.baseBranchHead ?? null,
|
|
363530
363562
|
_prepared: {
|
|
363531
363563
|
kind: "active",
|
|
363532
363564
|
flow: "normal-regeneration",
|
|
@@ -363717,68 +363749,6 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
363717
363749
|
const prep = await this.prepareReplay(options2);
|
|
363718
363750
|
return this.applyPreparedReplay(prep, options2);
|
|
363719
363751
|
}
|
|
363720
|
-
/**
|
|
363721
|
-
* Sync the lockfile after a divergent PR was squash-merged.
|
|
363722
|
-
* Call this BEFORE runReplay() when the CLI detects a merged divergent PR.
|
|
363723
|
-
*
|
|
363724
|
-
* After updating the generation record, re-detects customer patches via
|
|
363725
|
-
* tree diff between the generation tag (pure generation tree) and HEAD
|
|
363726
|
-
* (which includes customer customizations after squash merge). This ensures
|
|
363727
|
-
* patches survive the squash merge → regenerate cycle even when the lockfile
|
|
363728
|
-
* was restored from the base branch during conflict PR creation.
|
|
363729
|
-
*/
|
|
363730
|
-
async syncFromDivergentMerge(generationCommitSha, options2) {
|
|
363731
|
-
const treeHash = await this.git.getTreeHash(generationCommitSha);
|
|
363732
|
-
const timestamp2 = (await this.git.exec(["log", "-1", "--format=%aI", generationCommitSha])).trim();
|
|
363733
|
-
const record23 = {
|
|
363734
|
-
commit_sha: generationCommitSha,
|
|
363735
|
-
tree_hash: treeHash,
|
|
363736
|
-
timestamp: timestamp2,
|
|
363737
|
-
cli_version: options2?.cliVersion ?? "unknown",
|
|
363738
|
-
generator_versions: options2?.generatorVersions ?? {},
|
|
363739
|
-
base_branch_head: options2?.baseBranchHead
|
|
363740
|
-
};
|
|
363741
|
-
let resolvedPatches;
|
|
363742
|
-
if (!this.lockManager.exists()) {
|
|
363743
|
-
this.lockManager.initializeInMemory(record23);
|
|
363744
|
-
} else {
|
|
363745
|
-
this.lockManager.read();
|
|
363746
|
-
const unresolvedPatches = [
|
|
363747
|
-
...this.lockManager.getUnresolvedPatches(),
|
|
363748
|
-
...this.lockManager.getResolvingPatches()
|
|
363749
|
-
];
|
|
363750
|
-
resolvedPatches = this.lockManager.getPatches().filter((p14) => p14.status == null);
|
|
363751
|
-
this.lockManager.addGeneration(record23);
|
|
363752
|
-
this.lockManager.clearPatches();
|
|
363753
|
-
for (const patch5 of unresolvedPatches) {
|
|
363754
|
-
this.lockManager.addPatch(patch5);
|
|
363755
|
-
}
|
|
363756
|
-
}
|
|
363757
|
-
try {
|
|
363758
|
-
const { patches: redetectedPatches } = await this.detector.detectNewPatches();
|
|
363759
|
-
if (redetectedPatches.length > 0) {
|
|
363760
|
-
const redetectedFiles = new Set(redetectedPatches.flatMap((p14) => p14.files));
|
|
363761
|
-
const currentPatches = this.lockManager.getPatches();
|
|
363762
|
-
for (const patch5 of currentPatches) {
|
|
363763
|
-
if (patch5.status != null && patch5.files.some((f4) => redetectedFiles.has(f4))) {
|
|
363764
|
-
this.lockManager.removePatch(patch5.id);
|
|
363765
|
-
}
|
|
363766
|
-
}
|
|
363767
|
-
for (const patch5 of redetectedPatches) {
|
|
363768
|
-
this.lockManager.addPatch(patch5);
|
|
363769
|
-
}
|
|
363770
|
-
}
|
|
363771
|
-
} catch (error50) {
|
|
363772
|
-
for (const patch5 of resolvedPatches ?? []) {
|
|
363773
|
-
this.lockManager.addPatch(patch5);
|
|
363774
|
-
}
|
|
363775
|
-
this.detector.warnings.push(
|
|
363776
|
-
`Patch re-detection failed after divergent merge sync. ${(resolvedPatches ?? []).length} previously resolved patch(es) preserved. Error: ${error50 instanceof Error ? error50.message : String(error50)}`
|
|
363777
|
-
);
|
|
363778
|
-
}
|
|
363779
|
-
this.lockManager.save();
|
|
363780
|
-
this.detector.warnings.push(...this.lockManager.warnings);
|
|
363781
|
-
}
|
|
363782
363752
|
determineFlow() {
|
|
363783
363753
|
try {
|
|
363784
363754
|
const lock = this.lockManager.read();
|
|
@@ -365476,14 +365446,12 @@ var require_replay_run = __commonJS({
|
|
|
365476
365446
|
exports2.replayPrepare = replayPrepare;
|
|
365477
365447
|
exports2.replayApply = replayApply;
|
|
365478
365448
|
exports2.replayRun = replayRun;
|
|
365479
|
-
exports2.isTagMergedIntoHead = isTagMergedIntoHead;
|
|
365480
365449
|
var replay_1 = require_dist14();
|
|
365481
|
-
var child_process_1 = require("child_process");
|
|
365482
365450
|
var fs_1 = require("fs");
|
|
365483
365451
|
var path_1 = require("path");
|
|
365484
365452
|
var fernignore_1 = require_fernignore();
|
|
365485
365453
|
async function replayPrepare(params2, state) {
|
|
365486
|
-
const { outputDir, cliVersion, generatorVersions, stageOnly = false,
|
|
365454
|
+
const { outputDir, cliVersion, generatorVersions, stageOnly = false, skipApplication, logger: logger4 } = params2;
|
|
365487
365455
|
const lockfilePath = (0, path_1.join)(outputDir, ".fern", "replay.lock");
|
|
365488
365456
|
let autoBootstrapped = false;
|
|
365489
365457
|
let bootstrapAttempted = false;
|
|
@@ -365516,57 +365484,6 @@ var require_replay_run = __commonJS({
|
|
|
365516
365484
|
return null;
|
|
365517
365485
|
}
|
|
365518
365486
|
}
|
|
365519
|
-
const baseBranchHead = gitRevParse(outputDir, "HEAD");
|
|
365520
|
-
let previousGenerationSha = null;
|
|
365521
|
-
let prevBaseBranchHead = null;
|
|
365522
|
-
try {
|
|
365523
|
-
const lockManager = new replay_1.LockfileManager(outputDir);
|
|
365524
|
-
if (lockManager.exists()) {
|
|
365525
|
-
const lock = lockManager.read();
|
|
365526
|
-
previousGenerationSha = lock.current_generation;
|
|
365527
|
-
const latestGen = lock.generations.find((g8) => g8.commit_sha === lock.current_generation);
|
|
365528
|
-
prevBaseBranchHead = latestGen?.base_branch_head ?? null;
|
|
365529
|
-
}
|
|
365530
|
-
} catch {
|
|
365531
|
-
}
|
|
365532
|
-
if (previousGenerationSha != null) {
|
|
365533
|
-
const sanitizedName = generatorName?.replace(/\//g, "--");
|
|
365534
|
-
const namespacedTag = sanitizedName != null ? `fern-generation-base--${sanitizedName}` : null;
|
|
365535
|
-
const tagSha = (namespacedTag != null ? gitRevParse(outputDir, namespacedTag) : null) ?? gitRevParse(outputDir, "fern-generation-base");
|
|
365536
|
-
let shouldSync = false;
|
|
365537
|
-
if (tagSha != null) {
|
|
365538
|
-
const tagParent = gitRevParse(outputDir, `${tagSha}^`);
|
|
365539
|
-
if (tagParent === prevBaseBranchHead || tagParent === previousGenerationSha) {
|
|
365540
|
-
const tagDistance = gitDiffNameOnly(outputDir, tagSha, "HEAD").length;
|
|
365541
|
-
const lockDistance = gitDiffNameOnly(outputDir, prevBaseBranchHead ?? previousGenerationSha, "HEAD").length;
|
|
365542
|
-
shouldSync = tagDistance < lockDistance;
|
|
365543
|
-
}
|
|
365544
|
-
}
|
|
365545
|
-
if (shouldSync && tagSha != null) {
|
|
365546
|
-
if (!isTagMergedIntoHead(outputDir, tagSha)) {
|
|
365547
|
-
logger4?.warn(`fern-generation-base tag ${tagSha} is not reachable from HEAD \u2014 skipping divergent-merge sync. The tag likely points at an unmerged generation (PR closed without merge).`);
|
|
365548
|
-
} else {
|
|
365549
|
-
try {
|
|
365550
|
-
const syncService = new replay_1.ReplayService(outputDir, { enabled: true });
|
|
365551
|
-
await syncService.syncFromDivergentMerge(tagSha, {
|
|
365552
|
-
cliVersion,
|
|
365553
|
-
generatorVersions,
|
|
365554
|
-
baseBranchHead: baseBranchHead ?? void 0
|
|
365555
|
-
});
|
|
365556
|
-
} catch (error50) {
|
|
365557
|
-
logger4?.warn("Replay divergent-merge sync failed, continuing without sync: " + String(error50));
|
|
365558
|
-
throw new ReplayPrepareError(String(error50), error50);
|
|
365559
|
-
}
|
|
365560
|
-
try {
|
|
365561
|
-
const freshLockManager = new replay_1.LockfileManager(outputDir);
|
|
365562
|
-
if (freshLockManager.exists()) {
|
|
365563
|
-
previousGenerationSha = freshLockManager.read().current_generation;
|
|
365564
|
-
}
|
|
365565
|
-
} catch {
|
|
365566
|
-
}
|
|
365567
|
-
}
|
|
365568
|
-
}
|
|
365569
|
-
}
|
|
365570
365487
|
const service = new replay_1.ReplayService(outputDir, { enabled: true });
|
|
365571
365488
|
let preparation;
|
|
365572
365489
|
try {
|
|
@@ -365574,8 +365491,7 @@ var require_replay_run = __commonJS({
|
|
|
365574
365491
|
cliVersion,
|
|
365575
365492
|
generatorVersions,
|
|
365576
365493
|
stageOnly,
|
|
365577
|
-
skipApplication
|
|
365578
|
-
baseBranchHead: baseBranchHead ?? void 0
|
|
365494
|
+
skipApplication
|
|
365579
365495
|
});
|
|
365580
365496
|
} catch (error50) {
|
|
365581
365497
|
logger4?.warn("Replay prepare failed, continuing without replay: " + String(error50));
|
|
@@ -365586,9 +365502,8 @@ var require_replay_run = __commonJS({
|
|
|
365586
365502
|
_preparation: preparation,
|
|
365587
365503
|
outputDir,
|
|
365588
365504
|
flow: preparation.flow,
|
|
365589
|
-
previousGenerationSha,
|
|
365505
|
+
previousGenerationSha: preparation.previousGenerationSha,
|
|
365590
365506
|
currentGenerationSha: preparation.currentGenerationSha,
|
|
365591
|
-
baseBranchHead,
|
|
365592
365507
|
autoBootstrapped,
|
|
365593
365508
|
bootstrapAttempted
|
|
365594
365509
|
};
|
|
@@ -365605,24 +365520,11 @@ var require_replay_run = __commonJS({
|
|
|
365605
365520
|
fernignoreUpdated: false,
|
|
365606
365521
|
previousGenerationSha: prepared.previousGenerationSha,
|
|
365607
365522
|
currentGenerationSha: prepared.currentGenerationSha,
|
|
365608
|
-
baseBranchHead: prepared.baseBranchHead,
|
|
365609
365523
|
autoBootstrapped: prepared.autoBootstrapped,
|
|
365610
365524
|
bootstrapAttempted: prepared.bootstrapAttempted,
|
|
365611
365525
|
failureReason: String(error50)
|
|
365612
365526
|
};
|
|
365613
365527
|
}
|
|
365614
|
-
let resolvedBaseBranchHead = prepared.baseBranchHead;
|
|
365615
|
-
try {
|
|
365616
|
-
const freshLockManager = new replay_1.LockfileManager(prepared.outputDir);
|
|
365617
|
-
if (freshLockManager.exists()) {
|
|
365618
|
-
const freshLock = freshLockManager.read();
|
|
365619
|
-
const latestGen = freshLock.generations.find((g8) => g8.commit_sha === freshLock.current_generation);
|
|
365620
|
-
if (latestGen?.base_branch_head) {
|
|
365621
|
-
resolvedBaseBranchHead = latestGen.base_branch_head;
|
|
365622
|
-
}
|
|
365623
|
-
}
|
|
365624
|
-
} catch {
|
|
365625
|
-
}
|
|
365626
365528
|
const fernignoreUpdated = await (0, fernignore_1.ensureReplayFernignoreEntries)(prepared.outputDir);
|
|
365627
365529
|
await (0, fernignore_1.ensureGitattributesEntries)(prepared.outputDir);
|
|
365628
365530
|
return {
|
|
@@ -365630,7 +365532,6 @@ var require_replay_run = __commonJS({
|
|
|
365630
365532
|
fernignoreUpdated,
|
|
365631
365533
|
previousGenerationSha: prepared.previousGenerationSha,
|
|
365632
365534
|
currentGenerationSha: prepared.currentGenerationSha,
|
|
365633
|
-
baseBranchHead: resolvedBaseBranchHead,
|
|
365634
365535
|
autoBootstrapped: prepared.autoBootstrapped,
|
|
365635
365536
|
bootstrapAttempted: prepared.bootstrapAttempted
|
|
365636
365537
|
};
|
|
@@ -365646,7 +365547,6 @@ var require_replay_run = __commonJS({
|
|
|
365646
365547
|
fernignoreUpdated: false,
|
|
365647
365548
|
previousGenerationSha: null,
|
|
365648
365549
|
currentGenerationSha: null,
|
|
365649
|
-
baseBranchHead: null,
|
|
365650
365550
|
autoBootstrapped: false,
|
|
365651
365551
|
bootstrapAttempted: prepareState.bootstrapAttempted,
|
|
365652
365552
|
failureReason: error50 instanceof ReplayPrepareError ? error50.reason : String(error50)
|
|
@@ -365658,7 +365558,6 @@ var require_replay_run = __commonJS({
|
|
|
365658
365558
|
fernignoreUpdated: false,
|
|
365659
365559
|
previousGenerationSha: null,
|
|
365660
365560
|
currentGenerationSha: null,
|
|
365661
|
-
baseBranchHead: null,
|
|
365662
365561
|
autoBootstrapped: false,
|
|
365663
365562
|
bootstrapAttempted: prepareState.bootstrapAttempted
|
|
365664
365563
|
};
|
|
@@ -365678,53 +365577,6 @@ var require_replay_run = __commonJS({
|
|
|
365678
365577
|
}
|
|
365679
365578
|
};
|
|
365680
365579
|
exports2.ReplayPrepareError = ReplayPrepareError;
|
|
365681
|
-
function isTagMergedIntoHead(cwd2, tagSha) {
|
|
365682
|
-
try {
|
|
365683
|
-
(0, child_process_1.execFileSync)("git", ["merge-base", "--is-ancestor", tagSha, "HEAD"], {
|
|
365684
|
-
cwd: cwd2,
|
|
365685
|
-
stdio: "pipe"
|
|
365686
|
-
});
|
|
365687
|
-
return true;
|
|
365688
|
-
} catch {
|
|
365689
|
-
}
|
|
365690
|
-
const tagTree = gitRevParse(cwd2, `${tagSha}^{tree}`);
|
|
365691
|
-
if (tagTree == null) {
|
|
365692
|
-
return false;
|
|
365693
|
-
}
|
|
365694
|
-
try {
|
|
365695
|
-
const trees = (0, child_process_1.execFileSync)("git", ["log", "HEAD", "--format=%T", "--max-count=500"], {
|
|
365696
|
-
cwd: cwd2,
|
|
365697
|
-
encoding: "utf-8",
|
|
365698
|
-
stdio: "pipe"
|
|
365699
|
-
});
|
|
365700
|
-
return trees.split("\n").some((t3) => t3.trim() === tagTree);
|
|
365701
|
-
} catch {
|
|
365702
|
-
return false;
|
|
365703
|
-
}
|
|
365704
|
-
}
|
|
365705
|
-
function gitRevParse(cwd2, rev) {
|
|
365706
|
-
try {
|
|
365707
|
-
return (0, child_process_1.execFileSync)("git", ["rev-parse", "--verify", rev], {
|
|
365708
|
-
cwd: cwd2,
|
|
365709
|
-
encoding: "utf-8",
|
|
365710
|
-
stdio: "pipe"
|
|
365711
|
-
}).trim();
|
|
365712
|
-
} catch {
|
|
365713
|
-
return null;
|
|
365714
|
-
}
|
|
365715
|
-
}
|
|
365716
|
-
function gitDiffNameOnly(cwd2, from4, to10) {
|
|
365717
|
-
try {
|
|
365718
|
-
const output2 = (0, child_process_1.execFileSync)("git", ["diff", "--name-only", from4, to10], {
|
|
365719
|
-
cwd: cwd2,
|
|
365720
|
-
encoding: "utf-8",
|
|
365721
|
-
stdio: "pipe"
|
|
365722
|
-
});
|
|
365723
|
-
return output2.trim().split("\n").filter(Boolean);
|
|
365724
|
-
} catch {
|
|
365725
|
-
return [];
|
|
365726
|
-
}
|
|
365727
|
-
}
|
|
365728
365580
|
}
|
|
365729
365581
|
});
|
|
365730
365582
|
|
|
@@ -365741,14 +365593,12 @@ var require_GenerationCommitStep = __commonJS({
|
|
|
365741
365593
|
config;
|
|
365742
365594
|
cliVersion;
|
|
365743
365595
|
generatorVersions;
|
|
365744
|
-
generatorName;
|
|
365745
365596
|
name = "generationCommit";
|
|
365746
|
-
constructor(outputDir, logger4, config5, cliVersion, generatorVersions
|
|
365597
|
+
constructor(outputDir, logger4, config5, cliVersion, generatorVersions) {
|
|
365747
365598
|
super(outputDir, logger4);
|
|
365748
365599
|
this.config = config5;
|
|
365749
365600
|
this.cliVersion = cliVersion;
|
|
365750
365601
|
this.generatorVersions = generatorVersions;
|
|
365751
|
-
this.generatorName = generatorName;
|
|
365752
365602
|
}
|
|
365753
365603
|
async execute(_context) {
|
|
365754
365604
|
const headBeforePrepare = tryRevParse(this.outputDir, "HEAD");
|
|
@@ -365759,7 +365609,6 @@ var require_GenerationCommitStep = __commonJS({
|
|
|
365759
365609
|
outputDir: this.outputDir,
|
|
365760
365610
|
cliVersion: this.cliVersion,
|
|
365761
365611
|
generatorVersions: this.generatorVersions,
|
|
365762
|
-
generatorName: this.generatorName,
|
|
365763
365612
|
skipApplication: this.config.skipApplication,
|
|
365764
365613
|
logger: this.logger
|
|
365765
365614
|
}, prepareState);
|
|
@@ -365796,7 +365645,6 @@ var require_GenerationCommitStep = __commonJS({
|
|
|
365796
365645
|
preparedReplay: prepared,
|
|
365797
365646
|
previousGenerationSha: prepared.previousGenerationSha ?? void 0,
|
|
365798
365647
|
currentGenerationSha: prepared.currentGenerationSha,
|
|
365799
|
-
baseBranchHead: prepared.baseBranchHead ?? void 0,
|
|
365800
365648
|
flow: prepared.flow,
|
|
365801
365649
|
bootstrapAttempted: prepareState.bootstrapAttempted
|
|
365802
365650
|
};
|
|
@@ -370467,14 +370315,12 @@ var require_ReplayStep = __commonJS({
|
|
|
370467
370315
|
config;
|
|
370468
370316
|
cliVersion;
|
|
370469
370317
|
generatorVersions;
|
|
370470
|
-
generatorName;
|
|
370471
370318
|
name = "replay";
|
|
370472
|
-
constructor(outputDir, logger4, config5, cliVersion, generatorVersions
|
|
370319
|
+
constructor(outputDir, logger4, config5, cliVersion, generatorVersions) {
|
|
370473
370320
|
super(outputDir, logger4);
|
|
370474
370321
|
this.config = config5;
|
|
370475
370322
|
this.cliVersion = cliVersion;
|
|
370476
370323
|
this.generatorVersions = generatorVersions;
|
|
370477
|
-
this.generatorName = generatorName;
|
|
370478
370324
|
}
|
|
370479
370325
|
async execute(context3) {
|
|
370480
370326
|
const generationCommit = context3.previousStepResults.generationCommit;
|
|
@@ -370513,7 +370359,6 @@ var require_ReplayStep = __commonJS({
|
|
|
370513
370359
|
cliVersion: this.cliVersion,
|
|
370514
370360
|
generatorVersions: this.generatorVersions,
|
|
370515
370361
|
stageOnly: this.config.stageOnly ?? false,
|
|
370516
|
-
generatorName: this.generatorName,
|
|
370517
370362
|
skipApplication: this.config.skipApplication,
|
|
370518
370363
|
logger: this.logger
|
|
370519
370364
|
});
|
|
@@ -370525,7 +370370,6 @@ var require_ReplayStep = __commonJS({
|
|
|
370525
370370
|
errorMessage: result.failureReason,
|
|
370526
370371
|
previousGenerationSha: result.previousGenerationSha ?? void 0,
|
|
370527
370372
|
currentGenerationSha: result.currentGenerationSha ?? void 0,
|
|
370528
|
-
baseBranchHead: result.baseBranchHead ?? void 0,
|
|
370529
370373
|
autoBootstrapped: result.autoBootstrapped,
|
|
370530
370374
|
bootstrapAttempted: result.bootstrapAttempted,
|
|
370531
370375
|
flow: "normal-regeneration",
|
|
@@ -370540,7 +370384,6 @@ var require_ReplayStep = __commonJS({
|
|
|
370540
370384
|
success: true,
|
|
370541
370385
|
previousGenerationSha: result.previousGenerationSha ?? void 0,
|
|
370542
370386
|
currentGenerationSha: result.currentGenerationSha ?? void 0,
|
|
370543
|
-
baseBranchHead: result.baseBranchHead ?? void 0,
|
|
370544
370387
|
autoBootstrapped: result.autoBootstrapped,
|
|
370545
370388
|
bootstrapAttempted: result.bootstrapAttempted,
|
|
370546
370389
|
flow: "first-generation",
|
|
@@ -370555,7 +370398,6 @@ var require_ReplayStep = __commonJS({
|
|
|
370555
370398
|
success: true,
|
|
370556
370399
|
previousGenerationSha: result.previousGenerationSha ?? void 0,
|
|
370557
370400
|
currentGenerationSha: result.currentGenerationSha ?? void 0,
|
|
370558
|
-
baseBranchHead: result.baseBranchHead ?? void 0,
|
|
370559
370401
|
autoBootstrapped: result.autoBootstrapped,
|
|
370560
370402
|
bootstrapAttempted: result.bootstrapAttempted,
|
|
370561
370403
|
flow: report.flow,
|
|
@@ -370948,13 +370790,13 @@ var require_PostGenerationPipeline = __commonJS({
|
|
|
370948
370790
|
autoVersionEnabled = false;
|
|
370949
370791
|
}
|
|
370950
370792
|
if (replayEnabled && config5.replay != null) {
|
|
370951
|
-
this.steps.push(new GenerationCommitStep_1.GenerationCommitStep(config5.outputDir, this.logger, { enabled: true, skipApplication: config5.replay.skipApplication }, config5.cliVersion, config5.generatorVersions
|
|
370793
|
+
this.steps.push(new GenerationCommitStep_1.GenerationCommitStep(config5.outputDir, this.logger, { enabled: true, skipApplication: config5.replay.skipApplication }, config5.cliVersion, config5.generatorVersions));
|
|
370952
370794
|
}
|
|
370953
370795
|
if (autoVersionEnabled && config5.autoVersion != null) {
|
|
370954
370796
|
this.steps.push(new AutoVersionStep_1.AutoVersionStep(config5.outputDir, this.logger, config5.autoVersion));
|
|
370955
370797
|
}
|
|
370956
370798
|
if (replayEnabled && config5.replay != null) {
|
|
370957
|
-
this.steps.push(new ReplayStep_1.ReplayStep(config5.outputDir, this.logger, config5.replay, config5.cliVersion, config5.generatorVersions
|
|
370799
|
+
this.steps.push(new ReplayStep_1.ReplayStep(config5.outputDir, this.logger, config5.replay, config5.cliVersion, config5.generatorVersions));
|
|
370958
370800
|
}
|
|
370959
370801
|
if (config5.verify?.enabled) {
|
|
370960
370802
|
this.steps.push(new VerificationStep_1.VerificationStep(config5.outputDir, this.logger, config5.verify, config5.generatorName, config5.generatorVersions));
|
|
@@ -668113,7 +667955,7 @@ var AccessTokenPosthogManager = class {
|
|
|
668113
667955
|
properties: {
|
|
668114
667956
|
...event,
|
|
668115
667957
|
...event.properties,
|
|
668116
|
-
version: "5.28.
|
|
667958
|
+
version: "5.28.3",
|
|
668117
667959
|
usingAccessToken: true,
|
|
668118
667960
|
...getRunIdProperties()
|
|
668119
667961
|
}
|
|
@@ -668177,7 +668019,7 @@ var UserPosthogManager = class {
|
|
|
668177
668019
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
668178
668020
|
event: "CLI",
|
|
668179
668021
|
properties: {
|
|
668180
|
-
version: "5.28.
|
|
668022
|
+
version: "5.28.3",
|
|
668181
668023
|
...event,
|
|
668182
668024
|
...event.properties,
|
|
668183
668025
|
usingAccessToken: false,
|
|
@@ -670976,6 +670818,8 @@ var Cache = class _Cache {
|
|
|
670976
670818
|
docsPreview;
|
|
670977
670819
|
/** Directory for downloaded generator migration packages. */
|
|
670978
670820
|
migrations;
|
|
670821
|
+
/** Directory for downloaded tool binaries (buf, protoc-gen-openapi). Shared with CLI v1. */
|
|
670822
|
+
bin;
|
|
670979
670823
|
constructor({ logger: logger4 } = {}) {
|
|
670980
670824
|
this.absoluteFilePath = _Cache.resolveAbsoluteFilePathStatic();
|
|
670981
670825
|
this.ir = new IrCache({
|
|
@@ -670990,6 +670834,9 @@ var Cache = class _Cache {
|
|
|
670990
670834
|
this.migrations = {
|
|
670991
670835
|
absoluteFilePath: join8(this.getVersionedPath(), RelativeFilePath2.of("migrations"))
|
|
670992
670836
|
};
|
|
670837
|
+
this.bin = {
|
|
670838
|
+
absoluteFilePath: join8(this.absoluteFilePath, RelativeFilePath2.of("bin"))
|
|
670839
|
+
};
|
|
670993
670840
|
}
|
|
670994
670841
|
/**
|
|
670995
670842
|
* Get the versioned cache directory path.
|
|
@@ -859868,7 +859715,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
859868
859715
|
var LOGS_FOLDER_NAME = "logs";
|
|
859869
859716
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
859870
859717
|
function getCliSource() {
|
|
859871
|
-
const version7 = "5.28.
|
|
859718
|
+
const version7 = "5.28.3";
|
|
859872
859719
|
return `cli@${version7}`;
|
|
859873
859720
|
}
|
|
859874
859721
|
var DebugLogger = class {
|
|
@@ -873877,7 +873724,7 @@ var LegacyDocsPublisher = class {
|
|
|
873877
873724
|
previewId,
|
|
873878
873725
|
disableTemplates: void 0,
|
|
873879
873726
|
skipUpload,
|
|
873880
|
-
cliVersion: "5.28.
|
|
873727
|
+
cliVersion: "5.28.3",
|
|
873881
873728
|
loginCommand: "fern auth login"
|
|
873882
873729
|
});
|
|
873883
873730
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -948282,7 +948129,7 @@ function getAutomationContextFromEnv() {
|
|
|
948282
948129
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
948283
948130
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
948284
948131
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
948285
|
-
cli_version: "5.28.
|
|
948132
|
+
cli_version: "5.28.3"
|
|
948286
948133
|
};
|
|
948287
948134
|
}
|
|
948288
948135
|
function isAutomationMode() {
|
|
@@ -949108,7 +948955,7 @@ var CliContext = class _CliContext {
|
|
|
949108
948955
|
if (false) {
|
|
949109
948956
|
this.logger.error("CLI_VERSION is not defined");
|
|
949110
948957
|
}
|
|
949111
|
-
return "5.28.
|
|
948958
|
+
return "5.28.3";
|
|
949112
948959
|
}
|
|
949113
948960
|
getCliName() {
|
|
949114
948961
|
if (false) {
|
package/package.json
CHANGED