@fern-api/fern-api-dev 4.107.0-5-g8e65b2fdec8 → 4.107.0-6-g3c2cb45fcb9
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 +48 -8
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -340394,9 +340394,9 @@ var require_diff3 = __commonJS({
|
|
|
340394
340394
|
}
|
|
340395
340395
|
});
|
|
340396
340396
|
|
|
340397
|
-
// ../../../node_modules/.pnpm/@fern-api+replay@0.
|
|
340397
|
+
// ../../../node_modules/.pnpm/@fern-api+replay@0.13.0/node_modules/@fern-api/replay/dist/index.cjs
|
|
340398
340398
|
var require_dist14 = __commonJS({
|
|
340399
|
-
"../../../node_modules/.pnpm/@fern-api+replay@0.
|
|
340399
|
+
"../../../node_modules/.pnpm/@fern-api+replay@0.13.0/node_modules/@fern-api/replay/dist/index.cjs"(exports2, module4) {
|
|
340400
340400
|
"use strict";
|
|
340401
340401
|
var __defProp4 = Object.defineProperty;
|
|
340402
340402
|
var __getOwnPropDesc4 = Object.getOwnPropertyDescriptor;
|
|
@@ -341136,17 +341136,57 @@ var require_dist14 = __commonJS({
|
|
|
341136
341136
|
}
|
|
341137
341137
|
const isAncestor = await this.git.isAncestor(lastGen.commit_sha, "HEAD");
|
|
341138
341138
|
if (!isAncestor) {
|
|
341139
|
+
return this.detectPatchesViaMergeBase(lastGen, lock);
|
|
341140
|
+
}
|
|
341141
|
+
return this.detectPatchesInRange(lastGen.commit_sha, lastGen, lock);
|
|
341142
|
+
}
|
|
341143
|
+
/**
|
|
341144
|
+
* FER-10201 — Non-linear-history detection via `merge-base(prevGen, HEAD)`.
|
|
341145
|
+
*
|
|
341146
|
+
* After a squash-merge of a Fern-bot PR, `lastGen.commit_sha` (the previous
|
|
341147
|
+
* `[fern-generated]`) is orphaned but still in git's object database. The
|
|
341148
|
+
* merge-base is the commit on main from which the bot's branch was created —
|
|
341149
|
+
* a reachable ancestor of HEAD. Walking that range and classifying each
|
|
341150
|
+
* commit via `isGenerationCommit` mirrors the linear path and eliminates
|
|
341151
|
+
* the bug class where pipeline-driven changes (autoversion, replay,
|
|
341152
|
+
* generation) get bundled as customer customizations.
|
|
341153
|
+
*
|
|
341154
|
+
* Falls through to the legacy composite path when no common ancestor exists
|
|
341155
|
+
* (truly disjoint history — orphan branches with no shared root).
|
|
341156
|
+
*/
|
|
341157
|
+
async detectPatchesViaMergeBase(lastGen, lock) {
|
|
341158
|
+
let mergeBase = "";
|
|
341159
|
+
try {
|
|
341160
|
+
mergeBase = (await this.git.exec(["merge-base", lastGen.commit_sha, "HEAD"])).trim();
|
|
341161
|
+
} catch {
|
|
341162
|
+
}
|
|
341163
|
+
if (!mergeBase) {
|
|
341164
|
+
this.warnings.push(
|
|
341165
|
+
`No common ancestor between previous generation ${lastGen.commit_sha.slice(0, 7)} and HEAD. Falling back to composite tree-diff detection.`
|
|
341166
|
+
);
|
|
341139
341167
|
return this.detectPatchesViaTreeDiff(
|
|
341140
341168
|
lastGen,
|
|
341141
341169
|
/* commitKnownMissing */
|
|
341142
341170
|
false
|
|
341143
341171
|
);
|
|
341144
341172
|
}
|
|
341173
|
+
return this.detectPatchesInRange(mergeBase, lastGen, lock);
|
|
341174
|
+
}
|
|
341175
|
+
/**
|
|
341176
|
+
* FER-10201 — Walk `${rangeStart}..HEAD`, classify each commit, emit one
|
|
341177
|
+
* `StoredPatch` per customer commit. Body shared by the linear path
|
|
341178
|
+
* (rangeStart = lastGen.commit_sha) and the merge-base path.
|
|
341179
|
+
*
|
|
341180
|
+
* Patch `base_generation` is always `lastGen.commit_sha` — the
|
|
341181
|
+
* lockfile-tracked reference the applicator uses to fetch base file
|
|
341182
|
+
* content, regardless of where the walk actually started.
|
|
341183
|
+
*/
|
|
341184
|
+
async detectPatchesInRange(rangeStart, lastGen, lock) {
|
|
341145
341185
|
const log4 = await this.git.exec([
|
|
341146
341186
|
"log",
|
|
341147
341187
|
"--first-parent",
|
|
341148
341188
|
"--format=%H%x00%an%x00%ae%x00%s",
|
|
341149
|
-
`${
|
|
341189
|
+
`${rangeStart}..HEAD`,
|
|
341150
341190
|
"--",
|
|
341151
341191
|
this.sdkOutputDir
|
|
341152
341192
|
]);
|
|
@@ -621265,7 +621305,7 @@ var AccessTokenPosthogManager = class {
|
|
|
621265
621305
|
properties: {
|
|
621266
621306
|
...event,
|
|
621267
621307
|
...event.properties,
|
|
621268
|
-
version: "4.107.0-
|
|
621308
|
+
version: "4.107.0-6-g3c2cb45fcb9",
|
|
621269
621309
|
usingAccessToken: true
|
|
621270
621310
|
}
|
|
621271
621311
|
});
|
|
@@ -621319,7 +621359,7 @@ var UserPosthogManager = class {
|
|
|
621319
621359
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
621320
621360
|
event: "CLI",
|
|
621321
621361
|
properties: {
|
|
621322
|
-
version: "4.107.0-
|
|
621362
|
+
version: "4.107.0-6-g3c2cb45fcb9",
|
|
621323
621363
|
...event,
|
|
621324
621364
|
...event.properties,
|
|
621325
621365
|
usingAccessToken: false,
|
|
@@ -832962,7 +833002,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
832962
833002
|
var LOGS_FOLDER_NAME = "logs";
|
|
832963
833003
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
832964
833004
|
function getCliSource() {
|
|
832965
|
-
const version7 = "4.107.0-
|
|
833005
|
+
const version7 = "4.107.0-6-g3c2cb45fcb9";
|
|
832966
833006
|
return `cli@${version7}`;
|
|
832967
833007
|
}
|
|
832968
833008
|
var DebugLogger = class {
|
|
@@ -845371,7 +845411,7 @@ var LegacyDocsPublisher = class {
|
|
|
845371
845411
|
previewId,
|
|
845372
845412
|
disableTemplates: void 0,
|
|
845373
845413
|
skipUpload,
|
|
845374
|
-
cliVersion: "4.107.0-
|
|
845414
|
+
cliVersion: "4.107.0-6-g3c2cb45fcb9",
|
|
845375
845415
|
loginCommand: "fern auth login"
|
|
845376
845416
|
});
|
|
845377
845417
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -919602,7 +919642,7 @@ var CliContext = class _CliContext {
|
|
|
919602
919642
|
if (false) {
|
|
919603
919643
|
this.logger.error("CLI_VERSION is not defined");
|
|
919604
919644
|
}
|
|
919605
|
-
return "4.107.0-
|
|
919645
|
+
return "4.107.0-6-g3c2cb45fcb9";
|
|
919606
919646
|
}
|
|
919607
919647
|
getCliName() {
|
|
919608
919648
|
if (false) {
|
package/package.json
CHANGED