@fern-api/fern-api-dev 4.107.0-5-g8e65b2fdec8 → 4.107.0-65-g0230cd2035f
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 +88 -40
- 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-65-g0230cd2035f",
|
|
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-65-g0230cd2035f",
|
|
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-65-g0230cd2035f";
|
|
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-65-g0230cd2035f",
|
|
845375
845415
|
loginCommand: "fern auth login"
|
|
845376
845416
|
});
|
|
845377
845417
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -873709,28 +873749,28 @@ var STRING_TYPE_REFERENCE = {
|
|
|
873709
873749
|
type: "primitive",
|
|
873710
873750
|
value: "STRING"
|
|
873711
873751
|
};
|
|
873712
|
-
function
|
|
873752
|
+
function stripOptionalAndNullable(item) {
|
|
873753
|
+
let current3 = item;
|
|
873754
|
+
while (current3.type === "optional" || current3.type === "nullable") {
|
|
873755
|
+
current3 = current3.value;
|
|
873756
|
+
}
|
|
873757
|
+
return current3;
|
|
873758
|
+
}
|
|
873759
|
+
function stripListItemWrappers(typeReference2) {
|
|
873713
873760
|
if (typeReference2.type === "optional" && typeReference2.value.type === "list") {
|
|
873714
|
-
const
|
|
873715
|
-
const
|
|
873716
|
-
if (
|
|
873717
|
-
return
|
|
873718
|
-
type: "optional",
|
|
873719
|
-
value: {
|
|
873720
|
-
type: "list",
|
|
873721
|
-
value: itemType.value
|
|
873722
|
-
}
|
|
873723
|
-
};
|
|
873761
|
+
const itemType = typeReference2.value.value;
|
|
873762
|
+
const stripped = stripOptionalAndNullable(itemType);
|
|
873763
|
+
if (stripped === itemType) {
|
|
873764
|
+
return typeReference2;
|
|
873724
873765
|
}
|
|
873766
|
+
return { type: "optional", value: { type: "list", value: stripped } };
|
|
873725
873767
|
}
|
|
873726
873768
|
if (typeReference2.type === "list") {
|
|
873727
|
-
const
|
|
873728
|
-
if (
|
|
873729
|
-
return
|
|
873730
|
-
type: "list",
|
|
873731
|
-
value: itemType.value
|
|
873732
|
-
};
|
|
873769
|
+
const stripped = stripOptionalAndNullable(typeReference2.value);
|
|
873770
|
+
if (stripped === typeReference2.value) {
|
|
873771
|
+
return typeReference2;
|
|
873733
873772
|
}
|
|
873773
|
+
return { type: "list", value: stripped };
|
|
873734
873774
|
}
|
|
873735
873775
|
return typeReference2;
|
|
873736
873776
|
}
|
|
@@ -874246,9 +874286,7 @@ var EndpointSnippetGenerator4 = class {
|
|
|
874246
874286
|
const queryParameterFields = sortedQueryParameters.map((queryParameter) => ({
|
|
874247
874287
|
name: this.context.getMethodName(queryParameter.name.name),
|
|
874248
874288
|
value: this.context.dynamicTypeLiteralMapper.convert({
|
|
874249
|
-
|
|
874250
|
-
// Java SDK builders have convenience overloads that accept List<T>.
|
|
874251
|
-
typeReference: unwrapOptionalFromListItems(queryParameter.typeReference),
|
|
874289
|
+
typeReference: stripListItemWrappers(queryParameter.typeReference),
|
|
874252
874290
|
value: queryParameter.value,
|
|
874253
874291
|
as: "request"
|
|
874254
874292
|
})
|
|
@@ -881458,7 +881496,8 @@ var Comment6 = class extends AstNode6 {
|
|
|
881458
881496
|
this.docs.split("\n").forEach((line) => {
|
|
881459
881497
|
const wrappedLines = this.wrapLine(line, writer2);
|
|
881460
881498
|
wrappedLines.forEach((wrappedLine) => {
|
|
881461
|
-
|
|
881499
|
+
const trimmed2 = wrappedLine.trimEnd();
|
|
881500
|
+
writer2.writeLine(trimmed2 === "" ? "#" : `# ${trimmed2}`);
|
|
881462
881501
|
});
|
|
881463
881502
|
});
|
|
881464
881503
|
}
|
|
@@ -919602,7 +919641,7 @@ var CliContext = class _CliContext {
|
|
|
919602
919641
|
if (false) {
|
|
919603
919642
|
this.logger.error("CLI_VERSION is not defined");
|
|
919604
919643
|
}
|
|
919605
|
-
return "4.107.0-
|
|
919644
|
+
return "4.107.0-65-g0230cd2035f";
|
|
919606
919645
|
}
|
|
919607
919646
|
getCliName() {
|
|
919608
919647
|
if (false) {
|
|
@@ -931028,6 +931067,7 @@ async function formatWorkspaces({
|
|
|
931028
931067
|
}
|
|
931029
931068
|
|
|
931030
931069
|
// src/commands/generate/generateDocsWorkspace.ts
|
|
931070
|
+
init_lib4();
|
|
931031
931071
|
init_js();
|
|
931032
931072
|
|
|
931033
931073
|
// src/utils/environment.ts
|
|
@@ -931229,27 +931269,35 @@ ${source_default.yellow("?")} Are you sure you want to continue?`,
|
|
|
931229
931269
|
errorOnBrokenLinks: strictBrokenLinks,
|
|
931230
931270
|
excludeRules: getExcludeRules(brokenLinks, strictBrokenLinks)
|
|
931231
931271
|
});
|
|
931272
|
+
const skippedWorkspacePaths = /* @__PURE__ */ new Set();
|
|
931232
931273
|
const ossWorkspacesForValidation = await filterOssWorkspaces(project);
|
|
931233
931274
|
for (const ossWorkspace of ossWorkspacesForValidation) {
|
|
931234
|
-
|
|
931235
|
-
|
|
931236
|
-
|
|
931237
|
-
|
|
931238
|
-
|
|
931275
|
+
try {
|
|
931276
|
+
const violations = await validateOSSWorkspace(ossWorkspace, context3);
|
|
931277
|
+
const errors4 = violations.filter((v9) => v9.severity === "fatal" || v9.severity === "error");
|
|
931278
|
+
if (errors4.length > 0) {
|
|
931279
|
+
for (const error50 of errors4) {
|
|
931280
|
+
context3.logger.warn(`${error50.relativeFilepath}: ${error50.message}`);
|
|
931281
|
+
}
|
|
931282
|
+
context3.logger.warn(
|
|
931283
|
+
`Skipping API workspace at ${ossWorkspace.absoluteFilePath} due to ${errors4.length} validation error${errors4.length !== 1 ? "s" : ""}. Run fern check for details.`
|
|
931284
|
+
);
|
|
931285
|
+
skippedWorkspacePaths.add(ossWorkspace.absoluteFilePath);
|
|
931239
931286
|
}
|
|
931240
|
-
|
|
931241
|
-
|
|
931242
|
-
|
|
931243
|
-
{ code: CliError.Code.ValidationError }
|
|
931287
|
+
} catch (error50) {
|
|
931288
|
+
context3.logger.warn(
|
|
931289
|
+
`Skipping API workspace at ${ossWorkspace.absoluteFilePath}: ${extractErrorMessage(error50)}`
|
|
931244
931290
|
);
|
|
931291
|
+
skippedWorkspacePaths.add(ossWorkspace.absoluteFilePath);
|
|
931245
931292
|
}
|
|
931246
931293
|
}
|
|
931247
931294
|
context3.logger.info("Validation complete, starting remote docs generation...");
|
|
931248
931295
|
const filterStart = performance.now();
|
|
931249
|
-
const
|
|
931296
|
+
const allOssWorkspaces = await filterOssWorkspaces(project);
|
|
931297
|
+
const ossWorkspaces = allOssWorkspaces.filter((ws5) => !skippedWorkspacePaths.has(ws5.absoluteFilePath));
|
|
931250
931298
|
const filterTime = performance.now() - filterStart;
|
|
931251
931299
|
context3.logger.debug(
|
|
931252
|
-
`Filtered OSS workspaces (${ossWorkspaces.length} workspaces) in ${filterTime.toFixed(0)}ms`
|
|
931300
|
+
`Filtered OSS workspaces (${ossWorkspaces.length} workspaces, ${skippedWorkspacePaths.size} skipped) in ${filterTime.toFixed(0)}ms`
|
|
931253
931301
|
);
|
|
931254
931302
|
const generationStart = performance.now();
|
|
931255
931303
|
await runRemoteGenerationForDocsWorkspace({
|
package/package.json
CHANGED