@fern-api/fern-api-dev 5.89.3 → 5.89.5

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 (2) hide show
  1. package/cli.cjs +363 -89
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -100959,8 +100959,8 @@ var require_graceful_fs = __commonJS({
100959
100959
  }
100960
100960
  }
100961
100961
  var fs$writeFile = fs35.writeFile;
100962
- fs35.writeFile = writeFile102;
100963
- function writeFile102(path120, data2, options2, cb) {
100962
+ fs35.writeFile = writeFile103;
100963
+ function writeFile103(path120, data2, options2, cb) {
100964
100964
  if (typeof options2 === "function")
100965
100965
  cb = options2, options2 = null;
100966
100966
  return go$writeFile(path120, data2, options2, cb);
@@ -453152,49 +453152,103 @@ function requoteLeadingZeroValues(doc) {
453152
453152
  function getLargeFileBytes() {
453153
453153
  return parseInt(process.env.FERN_DOCS_LARGE_FILE_BYTES ?? "5000000", 10);
453154
453154
  }
453155
+ function isJsxTagStart(content5, index3) {
453156
+ if (content5[index3] !== "<" || content5[index3 - 1] === "\\") {
453157
+ return false;
453158
+ }
453159
+ const nameStart = content5[index3 + 1] === "/" ? content5[index3 + 2] : content5[index3 + 1];
453160
+ return nameStart != null && JSX_TAG_NAME_START_REGEX.test(nameStart);
453161
+ }
453162
+ function findScanLimit(content5, start2) {
453163
+ const blankLine2 = BLANK_LINE_REGEX.exec(content5.slice(start2));
453164
+ return blankLine2 == null ? content5.length : start2 + blankLine2.index;
453165
+ }
453166
+ function findCodeFenceEnd(content5, start2) {
453167
+ const lineEnd = content5.indexOf("\n", start2);
453168
+ const line = content5.slice(start2, lineEnd === -1 ? content5.length : lineEnd);
453169
+ const fence = CODE_FENCE_REGEX.exec(line)?.[1];
453170
+ if (fence == null || lineEnd === -1) {
453171
+ return null;
453172
+ }
453173
+ const closingFenceRegex = new RegExp(`^[ \\t]*${fence[0] === "`" ? "`" : "~"}{${fence.length},}[ \\t\\r]*$`);
453174
+ let i5 = lineEnd + 1;
453175
+ while (i5 <= content5.length) {
453176
+ const nextLineEnd = content5.indexOf("\n", i5);
453177
+ const end = nextLineEnd === -1 ? content5.length : nextLineEnd;
453178
+ if (closingFenceRegex.test(content5.slice(i5, end))) {
453179
+ return end;
453180
+ }
453181
+ if (nextLineEnd === -1) {
453182
+ return null;
453183
+ }
453184
+ i5 = nextLineEnd + 1;
453185
+ }
453186
+ return null;
453187
+ }
453188
+ function findInlineCodeEnd(content5, start2) {
453189
+ const limit = findScanLimit(content5, start2);
453190
+ let runLength = 0;
453191
+ while (content5[start2 + runLength] === "`") {
453192
+ runLength++;
453193
+ }
453194
+ let i5 = start2 + runLength;
453195
+ while (i5 < limit) {
453196
+ if (content5[i5] !== "`") {
453197
+ i5++;
453198
+ continue;
453199
+ }
453200
+ let closingRunLength = 0;
453201
+ while (content5[i5 + closingRunLength] === "`") {
453202
+ closingRunLength++;
453203
+ }
453204
+ if (closingRunLength === runLength) {
453205
+ return i5 + closingRunLength;
453206
+ }
453207
+ i5 += closingRunLength;
453208
+ }
453209
+ return null;
453210
+ }
453155
453211
  function streamingScanForImages(content5, metadata) {
453156
453212
  const filepaths = /* @__PURE__ */ new Set();
453157
453213
  const edits = [];
453158
453214
  let i5 = 0;
453159
453215
  const len = content5.length;
453160
- let inCodeFence = false;
453161
- let inInlineCode = false;
453162
453216
  while (i5 < len) {
453163
453217
  if (i5 === 0 || content5[i5 - 1] === "\n") {
453164
- if (content5.slice(i5, i5 + 3) === "```") {
453165
- inCodeFence = !inCodeFence;
453166
- i5 += 3;
453218
+ const fenceEnd = findCodeFenceEnd(content5, i5);
453219
+ if (fenceEnd != null) {
453220
+ i5 = fenceEnd;
453167
453221
  continue;
453168
453222
  }
453169
453223
  }
453170
- if (!inCodeFence) {
453171
- if (content5[i5] === "`" && (i5 === 0 || content5[i5 - 1] !== "\\")) {
453172
- inInlineCode = !inInlineCode;
453173
- i5++;
453224
+ if (content5[i5] === "`" && content5[i5 - 1] !== "\\") {
453225
+ const inlineCodeEnd = findInlineCodeEnd(content5, i5);
453226
+ if (inlineCodeEnd != null) {
453227
+ i5 = inlineCodeEnd;
453174
453228
  continue;
453175
453229
  }
453176
- if (!inInlineCode) {
453177
- if (content5[i5] === "!" && content5[i5 + 1] === "[") {
453178
- const result = parseMarkdownImage(content5, i5, metadata);
453179
- if (result) {
453180
- filepaths.add(result.filepath);
453181
- edits.push(result.edit);
453182
- i5 = result.nextIndex;
453183
- continue;
453184
- }
453185
- } else if (content5[i5] === "[" && content5[i5 - 1] !== "!") {
453186
- const result = parseMarkdownLink(content5, i5, metadata);
453187
- if (result) {
453188
- i5 = result.nextIndex;
453189
- continue;
453190
- }
453191
- } else if (content5[i5] === "<") {
453192
- const result = parseJsxTag(content5, i5, metadata, filepaths, edits);
453193
- if (result) {
453194
- i5 = result.nextIndex;
453195
- continue;
453196
- }
453197
- }
453230
+ i5++;
453231
+ continue;
453232
+ }
453233
+ if (content5[i5] === "!" && content5[i5 + 1] === "[") {
453234
+ const result = parseMarkdownImage(content5, i5, metadata);
453235
+ if (result) {
453236
+ filepaths.add(result.filepath);
453237
+ edits.push(result.edit);
453238
+ i5 = result.nextIndex;
453239
+ continue;
453240
+ }
453241
+ } else if (content5[i5] === "[" && content5[i5 - 1] !== "!") {
453242
+ const result = parseMarkdownLink(content5, i5, metadata);
453243
+ if (result) {
453244
+ i5 = result.nextIndex;
453245
+ continue;
453246
+ }
453247
+ } else if (content5[i5] === "<") {
453248
+ const result = parseJsxTag(content5, i5, metadata, filepaths, edits);
453249
+ if (result) {
453250
+ i5 = result.nextIndex;
453251
+ continue;
453198
453252
  }
453199
453253
  }
453200
453254
  i5++;
@@ -453303,30 +453357,35 @@ function parseMarkdownLink(content5, start2, metadata) {
453303
453357
  return { nextIndex: i5 };
453304
453358
  }
453305
453359
  function parseJsxTag(content5, start2, metadata, filepaths, edits) {
453360
+ if (!isJsxTagStart(content5, start2)) {
453361
+ return null;
453362
+ }
453306
453363
  let i5 = start2 + 1;
453307
- const len = content5.length;
453308
- while (i5 < len && content5[i5] !== ">" && content5[i5] !== " " && content5[i5] !== "\n") {
453364
+ const limit = findScanLimit(content5, start2);
453365
+ const tagFilepaths = [];
453366
+ const tagEdits = [];
453367
+ while (i5 < limit && content5[i5] !== ">" && content5[i5] !== " " && content5[i5] !== "\n") {
453309
453368
  i5++;
453310
453369
  }
453311
- while (i5 < len && content5[i5] !== ">") {
453312
- while (i5 < len && (content5[i5] === " " || content5[i5] === "\n")) {
453370
+ while (i5 < limit && content5[i5] !== ">") {
453371
+ while (i5 < limit && (content5[i5] === " " || content5[i5] === "\n")) {
453313
453372
  i5++;
453314
453373
  }
453315
453374
  const attrStart = i5;
453316
- while (i5 < len && content5[i5] !== "=" && content5[i5] !== ">" && content5[i5] !== " " && content5[i5] !== "\n") {
453375
+ while (i5 < limit && content5[i5] !== "=" && content5[i5] !== ">" && content5[i5] !== " " && content5[i5] !== "\n") {
453317
453376
  i5++;
453318
453377
  }
453319
453378
  const attrName = content5.slice(attrStart, i5).trim();
453320
453379
  if (content5[i5] === "=") {
453321
453380
  i5++;
453322
- while (i5 < len && (content5[i5] === " " || content5[i5] === "\n")) {
453381
+ while (i5 < limit && (content5[i5] === " " || content5[i5] === "\n")) {
453323
453382
  i5++;
453324
453383
  }
453325
453384
  if (content5[i5] === '"' || content5[i5] === "'") {
453326
453385
  const quote2 = content5[i5];
453327
453386
  i5++;
453328
453387
  const valueStart = i5;
453329
- while (i5 < len && content5[i5] !== quote2) {
453388
+ while (i5 < limit && content5[i5] !== quote2) {
453330
453389
  if (content5[i5] === "\\") {
453331
453390
  i5 += 2;
453332
453391
  } else {
@@ -453339,15 +453398,15 @@ function parseJsxTag(content5, start2, metadata, filepaths, edits) {
453339
453398
  const src = trimAnchor(value2);
453340
453399
  const resolvedPath = resolvePath5(src, metadata);
453341
453400
  if (src && resolvedPath) {
453342
- filepaths.add(resolvedPath);
453343
- edits.push({ start: valueStart, end: valueStart + value2.length, replacement: resolvedPath });
453401
+ tagFilepaths.push(resolvedPath);
453402
+ tagEdits.push({ start: valueStart, end: valueStart + value2.length, replacement: resolvedPath });
453344
453403
  }
453345
453404
  }
453346
453405
  } else if (content5[i5] === "{") {
453347
453406
  i5++;
453348
453407
  let braceDepth = 1;
453349
453408
  const exprStart = i5;
453350
- while (i5 < len && braceDepth > 0) {
453409
+ while (i5 < limit && braceDepth > 0) {
453351
453410
  if (content5[i5] === "{") {
453352
453411
  braceDepth++;
453353
453412
  } else if (content5[i5] === "}") {
@@ -453362,8 +453421,8 @@ function parseJsxTag(content5, start2, metadata, filepaths, edits) {
453362
453421
  const src = trimAnchor(value2);
453363
453422
  const resolvedPath = resolvePath5(src, metadata);
453364
453423
  if (src && resolvedPath) {
453365
- filepaths.add(resolvedPath);
453366
- edits.push({
453424
+ tagFilepaths.push(resolvedPath);
453425
+ tagEdits.push({
453367
453426
  start: exprStart + 1,
453368
453427
  end: exprStart + 1 + value2.length,
453369
453428
  replacement: resolvedPath
@@ -453376,8 +453435,8 @@ function parseJsxTag(content5, start2, metadata, filepaths, edits) {
453376
453435
  const src = trimAnchor(value2);
453377
453436
  const resolvedPath = resolvePath5(src, metadata);
453378
453437
  if (src && resolvedPath) {
453379
- filepaths.add(resolvedPath);
453380
- edits.push({
453438
+ tagFilepaths.push(resolvedPath);
453439
+ tagEdits.push({
453381
453440
  start: exprStart + 1,
453382
453441
  end: exprStart + 1 + value2.length,
453383
453442
  replacement: resolvedPath
@@ -453388,9 +453447,14 @@ function parseJsxTag(content5, start2, metadata, filepaths, edits) {
453388
453447
  }
453389
453448
  }
453390
453449
  }
453391
- if (i5 < len && content5[i5] === ">") {
453392
- i5++;
453450
+ if (i5 >= limit || content5[i5] !== ">") {
453451
+ return null;
453393
453452
  }
453453
+ i5++;
453454
+ for (const filepath of tagFilepaths) {
453455
+ filepaths.add(filepath);
453456
+ }
453457
+ edits.push(...tagEdits);
453394
453458
  return { nextIndex: i5 };
453395
453459
  }
453396
453460
  function precomputeLineStarts(content5) {
@@ -453655,6 +453719,22 @@ function replaceImagePathsAndUrls(markdown, fileIdsMap, markdownFilesToPathName,
453655
453719
  let i5 = 0;
453656
453720
  const len = content5.length;
453657
453721
  while (i5 < len) {
453722
+ if (i5 === 0 || content5[i5 - 1] === "\n") {
453723
+ const fenceEnd = findCodeFenceEnd(content5, i5);
453724
+ if (fenceEnd != null) {
453725
+ i5 = fenceEnd;
453726
+ continue;
453727
+ }
453728
+ }
453729
+ if (content5[i5] === "`" && content5[i5 - 1] !== "\\") {
453730
+ const inlineCodeEnd = findInlineCodeEnd(content5, i5);
453731
+ if (inlineCodeEnd != null) {
453732
+ i5 = inlineCodeEnd;
453733
+ continue;
453734
+ }
453735
+ i5++;
453736
+ continue;
453737
+ }
453658
453738
  if (content5[i5] === "!" && content5[i5 + 1] === "[") {
453659
453739
  const result = parseMarkdownImage(content5, i5, metadata);
453660
453740
  if (result) {
@@ -453695,6 +453775,10 @@ function replaceImagePathsAndUrls(markdown, fileIdsMap, markdownFilesToPathName,
453695
453775
  j5++;
453696
453776
  }
453697
453777
  }
453778
+ if (parenDepth !== 0) {
453779
+ i5++;
453780
+ continue;
453781
+ }
453698
453782
  const urlEnd = j5 - 1;
453699
453783
  const href = content5.slice(urlStart, urlEnd).trim();
453700
453784
  const destination = splitDestinationAndTitle(href);
@@ -453716,17 +453800,19 @@ function replaceImagePathsAndUrls(markdown, fileIdsMap, markdownFilesToPathName,
453716
453800
  i5 = j5;
453717
453801
  continue;
453718
453802
  }
453719
- } else if (content5[i5] === "<") {
453803
+ } else if (isJsxTagStart(content5, i5)) {
453804
+ const limit = findScanLimit(content5, i5);
453805
+ const editsBeforeTag = edits.length;
453720
453806
  let j5 = i5 + 1;
453721
- while (j5 < len && content5[j5] !== ">" && content5[j5] !== " " && content5[j5] !== "\n") {
453807
+ while (j5 < limit && content5[j5] !== ">" && content5[j5] !== " " && content5[j5] !== "\n") {
453722
453808
  j5++;
453723
453809
  }
453724
- while (j5 < len && content5[j5] !== ">") {
453725
- while (j5 < len && (content5[j5] === " " || content5[j5] === "\n")) {
453810
+ while (j5 < limit && content5[j5] !== ">") {
453811
+ while (j5 < limit && (content5[j5] === " " || content5[j5] === "\n")) {
453726
453812
  j5++;
453727
453813
  }
453728
453814
  const attrStart = j5;
453729
- while (j5 < len && content5[j5] !== "=" && content5[j5] !== ">" && content5[j5] !== " " && content5[j5] !== "\n") {
453815
+ while (j5 < limit && content5[j5] !== "=" && content5[j5] !== ">" && content5[j5] !== " " && content5[j5] !== "\n") {
453730
453816
  j5++;
453731
453817
  }
453732
453818
  const attrName = content5.slice(attrStart, j5).trim();
@@ -453734,7 +453820,7 @@ function replaceImagePathsAndUrls(markdown, fileIdsMap, markdownFilesToPathName,
453734
453820
  hasUnhandledExpressions = true;
453735
453821
  let braceDepth = 0;
453736
453822
  j5 = attrStart;
453737
- while (j5 < len) {
453823
+ while (j5 < limit) {
453738
453824
  if (content5[j5] === "{") {
453739
453825
  braceDepth++;
453740
453826
  } else if (content5[j5] === "}") {
@@ -453746,7 +453832,7 @@ function replaceImagePathsAndUrls(markdown, fileIdsMap, markdownFilesToPathName,
453746
453832
  } else if (content5[j5] === '"' || content5[j5] === "'") {
453747
453833
  const q5 = content5[j5];
453748
453834
  j5++;
453749
- while (j5 < len && content5[j5] !== q5) {
453835
+ while (j5 < limit && content5[j5] !== q5) {
453750
453836
  if (content5[j5] === "\\") {
453751
453837
  j5++;
453752
453838
  }
@@ -453759,13 +453845,13 @@ function replaceImagePathsAndUrls(markdown, fileIdsMap, markdownFilesToPathName,
453759
453845
  }
453760
453846
  if (content5[j5] === "=") {
453761
453847
  j5++;
453762
- while (j5 < len && (content5[j5] === " " || content5[j5] === "\n")) {
453848
+ while (j5 < limit && (content5[j5] === " " || content5[j5] === "\n")) {
453763
453849
  j5++;
453764
453850
  }
453765
453851
  const isCurlyWrapped = content5[j5] === "{";
453766
453852
  if (isCurlyWrapped) {
453767
453853
  j5++;
453768
- while (j5 < len && (content5[j5] === " " || content5[j5] === "\n")) {
453854
+ while (j5 < limit && (content5[j5] === " " || content5[j5] === "\n")) {
453769
453855
  j5++;
453770
453856
  }
453771
453857
  }
@@ -453773,7 +453859,7 @@ function replaceImagePathsAndUrls(markdown, fileIdsMap, markdownFilesToPathName,
453773
453859
  const quote2 = content5[j5];
453774
453860
  j5++;
453775
453861
  const valueStart = j5;
453776
- while (j5 < len && content5[j5] !== quote2) {
453862
+ while (j5 < limit && content5[j5] !== quote2) {
453777
453863
  if (content5[j5] === "\\") {
453778
453864
  j5 += 2;
453779
453865
  } else {
@@ -453783,10 +453869,10 @@ function replaceImagePathsAndUrls(markdown, fileIdsMap, markdownFilesToPathName,
453783
453869
  const value2 = content5.slice(valueStart, j5);
453784
453870
  j5++;
453785
453871
  if (isCurlyWrapped) {
453786
- while (j5 < len && (content5[j5] === " " || content5[j5] === "\n")) {
453872
+ while (j5 < limit && (content5[j5] === " " || content5[j5] === "\n")) {
453787
453873
  j5++;
453788
453874
  }
453789
- if (j5 < len && content5[j5] === "}") {
453875
+ if (j5 < limit && content5[j5] === "}") {
453790
453876
  j5++;
453791
453877
  }
453792
453878
  }
@@ -453820,7 +453906,7 @@ function replaceImagePathsAndUrls(markdown, fileIdsMap, markdownFilesToPathName,
453820
453906
  } else if (isCurlyWrapped && (attrName === "src" || attrName === "icon" || attrName === "href")) {
453821
453907
  hasUnhandledExpressions = true;
453822
453908
  let braceDepth = 1;
453823
- while (j5 < len && braceDepth > 0) {
453909
+ while (j5 < limit && braceDepth > 0) {
453824
453910
  if (content5[j5] === "{") {
453825
453911
  braceDepth++;
453826
453912
  } else if (content5[j5] === "}") {
@@ -453828,7 +453914,7 @@ function replaceImagePathsAndUrls(markdown, fileIdsMap, markdownFilesToPathName,
453828
453914
  } else if (content5[j5] === '"' || content5[j5] === "'") {
453829
453915
  const q5 = content5[j5];
453830
453916
  j5++;
453831
- while (j5 < len && content5[j5] !== q5) {
453917
+ while (j5 < limit && content5[j5] !== q5) {
453832
453918
  if (content5[j5] === "\\") {
453833
453919
  j5++;
453834
453920
  }
@@ -453840,9 +453926,12 @@ function replaceImagePathsAndUrls(markdown, fileIdsMap, markdownFilesToPathName,
453840
453926
  }
453841
453927
  }
453842
453928
  }
453843
- if (j5 < len && content5[j5] === ">") {
453844
- j5++;
453929
+ if (j5 >= limit || content5[j5] !== ">") {
453930
+ edits.length = editsBeforeTag;
453931
+ i5++;
453932
+ continue;
453845
453933
  }
453934
+ j5++;
453846
453935
  i5 = j5;
453847
453936
  continue;
453848
453937
  }
@@ -453970,7 +454059,7 @@ function replaceFrontmatterImagesforLogo(data2, mapImage) {
453970
454059
  }
453971
454060
  }
453972
454061
  }
453973
- var import_gray_matter3, import_path55, LogoOverrideFrontmatterSchema;
454062
+ var import_gray_matter3, import_path55, JSX_TAG_NAME_START_REGEX, BLANK_LINE_REGEX, CODE_FENCE_REGEX, LogoOverrideFrontmatterSchema;
453974
454063
  var init_parseImagePaths = __esm({
453975
454064
  "../docs-markdown-utils/lib/parseImagePaths.js"() {
453976
454065
  "use strict";
@@ -453984,6 +454073,9 @@ var init_parseImagePaths = __esm({
453984
454073
  init_is_mdx_element();
453985
454074
  init_parseMarkdownToTree();
453986
454075
  init_walk_estree_jsx_attributes();
454076
+ JSX_TAG_NAME_START_REGEX = /[A-Za-z]/;
454077
+ BLANK_LINE_REGEX = /\n[ \t]*\r?\n/;
454078
+ CODE_FENCE_REGEX = /^[ \t]*(`{3,}|~{3,})/;
453987
454079
  LogoOverrideFrontmatterSchema = external_exports2.union([
453988
454080
  external_exports2.string(),
453989
454081
  external_exports2.object({
@@ -460277,13 +460369,13 @@ async function removeInvalidAiExamples({ sourceFilePath, context: context3 }) {
460277
460369
  }
460278
460370
  }
460279
460371
  }
460280
- const { writeFile: writeFile102 } = await import("fs/promises");
460372
+ const { writeFile: writeFile103 } = await import("fs/promises");
460281
460373
  const yamlContent = index_vite_proxy_tmp_default.dump(parsed, {
460282
460374
  indent: 2,
460283
460375
  lineWidth: -1,
460284
460376
  noRefs: true
460285
460377
  });
460286
- await writeFile102(overrideFilePath, yamlContent, "utf-8");
460378
+ await writeFile103(overrideFilePath, yamlContent, "utf-8");
460287
460379
  context3.logger.info(`Removed ${validationResult.invalidCount} invalid AI examples from ai_examples_override.yml`);
460288
460380
  return {
460289
460381
  removedCount: validationResult.invalidCount,
@@ -483612,8 +483704,8 @@ var require_graceful_fs2 = __commonJS({
483612
483704
  }
483613
483705
  }
483614
483706
  var fs$writeFile = fs35.writeFile;
483615
- fs35.writeFile = writeFile102;
483616
- function writeFile102(path120, data2, options2, cb) {
483707
+ fs35.writeFile = writeFile103;
483708
+ function writeFile103(path120, data2, options2, cb) {
483617
483709
  if (typeof options2 === "function")
483618
483710
  cb = options2, options2 = null;
483619
483711
  return go$writeFile(path120, data2, options2, cb);
@@ -626797,7 +626889,7 @@ var require_jsonfile = __commonJS({
626797
626889
  const str2 = stringify5(obj, options2);
626798
626890
  await universalify.fromCallback(fs34.writeFile)(file4, str2, options2);
626799
626891
  }
626800
- var writeFile102 = universalify.fromPromise(_writeFile);
626892
+ var writeFile103 = universalify.fromPromise(_writeFile);
626801
626893
  function writeFileSync9(file4, obj, options2 = {}) {
626802
626894
  const fs34 = options2.fs || _fs;
626803
626895
  const str2 = stringify5(obj, options2);
@@ -626806,7 +626898,7 @@ var require_jsonfile = __commonJS({
626806
626898
  module4.exports = {
626807
626899
  readFile: readFile121,
626808
626900
  readFileSync: readFileSync19,
626809
- writeFile: writeFile102,
626901
+ writeFile: writeFile103,
626810
626902
  writeFileSync: writeFileSync9
626811
626903
  };
626812
626904
  }
@@ -694326,7 +694418,7 @@ var AccessTokenPosthogManager = class {
694326
694418
  properties: {
694327
694419
  ...event,
694328
694420
  ...event.properties,
694329
- version: "5.89.3",
694421
+ version: "5.89.5",
694330
694422
  usingAccessToken: true,
694331
694423
  ...getRunIdProperties()
694332
694424
  }
@@ -694392,7 +694484,7 @@ var UserPosthogManager = class {
694392
694484
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
694393
694485
  event: "CLI",
694394
694486
  properties: {
694395
- version: "5.89.3",
694487
+ version: "5.89.5",
694396
694488
  ...event,
694397
694489
  ...event.properties,
694398
694490
  usingAccessToken: false,
@@ -875522,7 +875614,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
875522
875614
  var LOGS_FOLDER_NAME = "logs";
875523
875615
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
875524
875616
  function getCliSource() {
875525
- const version7 = "5.89.3";
875617
+ const version7 = "5.89.5";
875526
875618
  return `cli@${version7}`;
875527
875619
  }
875528
875620
  var DebugLogger = class {
@@ -908232,7 +908324,7 @@ var LegacyDocsPublisher = class {
908232
908324
  previewId,
908233
908325
  disableTemplates: void 0,
908234
908326
  skipUpload,
908235
- cliVersion: "5.89.3",
908327
+ cliVersion: "5.89.5",
908236
908328
  loginCommand: "fern auth login"
908237
908329
  });
908238
908330
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -927968,6 +928060,8 @@ var Generation = class {
927968
928060
  omitFernHeaders: () => this.customConfig["omit-fern-headers"] ?? false,
927969
928061
  /** When true, emits the platform observability headers (X-Fern-Runtime, X-Fern-Runtime-Version, X-Fern-Platform). Default: false. Still subject to omitFernHeaders. */
927970
928062
  includePlatformHeaders: () => this.customConfig["include-platform-headers"] ?? false,
928063
+ /** When true, exposes an `AppInfo` client option whose sanitized product token is appended to the `User-Agent` header (RFC 9110). Default: false. Independent of includePlatformHeaders; still subject to omitFernHeaders. */
928064
+ allowUserAgentAppInfo: () => this.customConfig["allow-user-agent-app-info"] ?? false,
927971
928065
  /** When true, falls back to `<NuGetPackageId>/<version>` for the `User-Agent` header when the IR doesn't supply one. Default: false. */
927972
928066
  userAgentNameFromPackage: () => this.customConfig["user-agent-name-from-package"] ?? false,
927973
928067
  /** When true, moves auth params and IR headers into ClientOptions so the constructor takes only named arguments. Default: false. */
@@ -928256,6 +928350,14 @@ var Generation = class {
928256
928350
  origin: this.model.staticExplicit("ClientOptions"),
928257
928351
  namespace: this.namespaces.publicCoreClasses
928258
928352
  }),
928353
+ /**
928354
+ * Optional application-info product token appended to the `User-Agent`
928355
+ * header. Only generated when the `allow-user-agent-app-info` config is on.
928356
+ */
928357
+ AppInfo: () => this.csharp.classReference({
928358
+ origin: this.model.staticExplicit("AppInfo"),
928359
+ namespace: this.namespaces.publicCoreClasses
928360
+ }),
928259
928361
  /** Low-level HTTP client wrapper for making raw API calls */
928260
928362
  RawClient: () => this.csharp.classReference({
928261
928363
  namespace: this.namespaces.core,
@@ -958766,6 +958868,10 @@ var TypescriptCustomConfigSchema = external_exports2.strictObject({
958766
958868
  serdeLayer: external_exports2.optional(external_exports2.boolean()),
958767
958869
  private: external_exports2.optional(external_exports2.boolean()),
958768
958870
  requireDefaultEnvironment: external_exports2.optional(external_exports2.boolean()),
958871
+ // When true, the client's `baseUrl` option becomes required and the `environment`
958872
+ // option becomes optional. Intended for APIs whose consumers always supply a URL
958873
+ // explicitly and have no concept of named environments.
958874
+ requireBaseUrl: external_exports2.optional(external_exports2.boolean()),
958769
958875
  retainOriginalCasing: external_exports2.optional(external_exports2.boolean()),
958770
958876
  useBigInt: external_exports2.optional(external_exports2.boolean()),
958771
958877
  useBrandedStringAliases: external_exports2.optional(external_exports2.boolean()),
@@ -975108,7 +975214,7 @@ function getAutomationContextFromEnv() {
975108
975214
  config_branch: process.env.FERN_CONFIG_BRANCH,
975109
975215
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
975110
975216
  trigger: process.env.GITHUB_EVENT_NAME,
975111
- cli_version: "5.89.3"
975217
+ cli_version: "5.89.5"
975112
975218
  };
975113
975219
  }
975114
975220
  function isAutomationMode() {
@@ -975940,7 +976046,7 @@ var CliContext = class _CliContext {
975940
976046
  if (false) {
975941
976047
  this.logger.error("CLI_VERSION is not defined");
975942
976048
  }
975943
- return "5.89.3";
976049
+ return "5.89.5";
975944
976050
  }
975945
976051
  getCliName() {
975946
976052
  if (false) {
@@ -977752,7 +977858,8 @@ async function packLocalOutputForGroup({
977752
977858
  context: context3,
977753
977859
  mode = "host",
977754
977860
  runner,
977755
- packOnly = false
977861
+ packOnly = false,
977862
+ version: version7
977756
977863
  }) {
977757
977864
  const failures = [];
977758
977865
  for (const generator of group.generators) {
@@ -977774,7 +977881,8 @@ async function packLocalOutputForGroup({
977774
977881
  outputPath,
977775
977882
  context: context3,
977776
977883
  mode,
977777
- runner: runner ?? "docker"
977884
+ runner: runner ?? "docker",
977885
+ version: version7
977778
977886
  });
977779
977887
  if (packOnly) {
977780
977888
  if (artifactProduced) {
@@ -977801,7 +977909,8 @@ async function packOutputForLanguage({
977801
977909
  outputPath,
977802
977910
  context: context3,
977803
977911
  mode,
977804
- runner
977912
+ runner,
977913
+ version: version7
977805
977914
  }) {
977806
977915
  const distDir = join8(outputPath, RelativeFilePath2.of(PACK_OUTPUT_DIRECTORY));
977807
977916
  const run = async (commands) => {
@@ -977810,26 +977919,103 @@ async function packOutputForLanguage({
977810
977919
  switch (language) {
977811
977920
  case "typescript": {
977812
977921
  await (0, import_promises168.mkdir)(distDir, { recursive: true });
977813
- const commands = [["npm", "install"]];
977922
+ await run([["npm", "install"]]);
977814
977923
  if (await hasNpmScript({ outputPath, script: "build" })) {
977815
- commands.push(["npm", "run", "build"]);
977924
+ await run([["npx", "--yes", "pnpm", "run", "build"]]);
977925
+ } else {
977926
+ const tsconfig = await findTsconfig(outputPath);
977927
+ if (tsconfig != null) {
977928
+ try {
977929
+ await run([["npx", "--yes", "--package", "typescript", "tsc", "--project", tsconfig]]);
977930
+ } catch (error50) {
977931
+ if (!await hasEmittedCompilerOutput({ outputPath, tsconfig })) {
977932
+ throw error50;
977933
+ }
977934
+ context3.logger.warn(
977935
+ `tsc reported errors while compiling ${tsconfig}; packing the emitted output anyway.`
977936
+ );
977937
+ }
977938
+ }
977939
+ }
977940
+ const npmignorePath = join8(outputPath, RelativeFilePath2.of(".npmignore"));
977941
+ const shouldWriteNpmignore = !await doesPathExist(npmignorePath) && !await hasPackageJsonFilesField(outputPath) && await doesPathExist(join8(outputPath, RelativeFilePath2.of(".gitignore")));
977942
+ if (shouldWriteNpmignore) {
977943
+ await (0, import_promises168.writeFile)(npmignorePath, `${PACK_OUTPUT_DIRECTORY}/
977944
+ `);
977945
+ }
977946
+ try {
977947
+ await run([["npm", "pack", "--pack-destination", PACK_OUTPUT_DIRECTORY]]);
977948
+ } finally {
977949
+ if (shouldWriteNpmignore) {
977950
+ await (0, import_promises168.rm)(npmignorePath, { force: true });
977951
+ }
977816
977952
  }
977817
- commands.push(["npm", "pack", "--pack-destination", PACK_OUTPUT_DIRECTORY]);
977818
- await run(commands);
977819
977953
  logArtifacts({ distDir, context: context3 });
977820
977954
  return true;
977821
977955
  }
977822
977956
  case "python": {
977823
977957
  await (0, import_promises168.mkdir)(distDir, { recursive: true });
977824
- await run([["python3", "-m", "pip", "wheel", ".", "--no-deps", "--wheel-dir", PACK_OUTPUT_DIRECTORY]]);
977958
+ const pipWheelCommand = [
977959
+ "python3",
977960
+ "-m",
977961
+ "pip",
977962
+ "wheel",
977963
+ ".",
977964
+ "--no-deps",
977965
+ "--wheel-dir",
977966
+ PACK_OUTPUT_DIRECTORY
977967
+ ];
977968
+ if (mode === "host") {
977969
+ try {
977970
+ await run([pipWheelCommand]);
977971
+ } catch {
977972
+ context3.logger.warn(
977973
+ "pip wheel failed on the host toolchain; retrying in an isolated build environment (python -m venv + python -m build)."
977974
+ );
977975
+ const venvDirectory = ".fern-pack-venv";
977976
+ const venvPython = process.platform === "win32" ? `${venvDirectory}/Scripts/python` : `${venvDirectory}/bin/python`;
977977
+ try {
977978
+ await run([
977979
+ ["python3", "-m", "venv", venvDirectory],
977980
+ [venvPython, "-m", "pip", "install", "--quiet", "build"],
977981
+ [venvPython, "-m", "build", "--wheel", "--outdir", PACK_OUTPUT_DIRECTORY]
977982
+ ]);
977983
+ } finally {
977984
+ await (0, import_promises168.rm)(join8(outputPath, RelativeFilePath2.of(venvDirectory)), {
977985
+ recursive: true,
977986
+ force: true
977987
+ });
977988
+ }
977989
+ }
977990
+ } else {
977991
+ await run([pipWheelCommand]);
977992
+ }
977825
977993
  logArtifacts({ distDir, context: context3 });
977826
977994
  return true;
977827
977995
  }
977828
977996
  case "java": {
977829
977997
  await (0, import_promises168.mkdir)(distDir, { recursive: true });
977830
- await run([["gradle", "jar", "-x", "test"]]);
977998
+ const initScriptName = ".fern-pack-pom-init.gradle";
977999
+ const initScriptPath = join8(outputPath, RelativeFilePath2.of(initScriptName));
978000
+ await (0, import_promises168.writeFile)(initScriptPath, getJavaPomInitScript({ fallbackVersion: version7 ?? "0.0.0" }));
978001
+ try {
978002
+ await run([
978003
+ [
978004
+ "gradle",
978005
+ "--init-script",
978006
+ initScriptName,
978007
+ "jar",
978008
+ `generatePomFileFor${JAVA_POM_PUBLICATION_NAME_CAPITALIZED}Publication`,
978009
+ "-x",
978010
+ "test"
978011
+ ]
978012
+ ]);
978013
+ } finally {
978014
+ await (0, import_promises168.rm)(initScriptPath, { force: true });
978015
+ }
977831
978016
  const libsDir = join8(outputPath, RelativeFilePath2.of("build/libs"));
977832
978017
  await copyMatchingFiles({ fromDir: libsDir, toDir: distDir, extension: ".jar" });
978018
+ await copyGeneratedPom({ outputPath, distDir, context: context3 });
977833
978019
  logArtifacts({ distDir, context: context3 });
977834
978020
  return true;
977835
978021
  }
@@ -977911,7 +978097,8 @@ async function runPackCommands({
977911
978097
  if (image3 == null) {
977912
978098
  throw new Error(`No Docker toolchain image is configured for ${language}.`);
977913
978099
  }
977914
- const containerArgs = ["run", "--rm", "-v", `${outputPath}:/workspace`, "-w", "/workspace", "-e", "HOME=/tmp"];
978100
+ const workdir = `/workspace/${(0, import_path110.basename)(outputPath)}`;
978101
+ const containerArgs = ["run", "--rm", "-v", `${outputPath}:${workdir}`, "-w", workdir, "-e", "HOME=/tmp"];
977915
978102
  if (process.getuid != null && process.getgid != null) {
977916
978103
  containerArgs.push("--user", `${process.getuid()}:${process.getgid()}`);
977917
978104
  }
@@ -977977,6 +978164,86 @@ async function removeDistDirIfEmpty(outputPath) {
977977
978164
  } catch {
977978
978165
  }
977979
978166
  }
978167
+ var JAVA_POM_PUBLICATION_NAME = "fernLocalPack";
978168
+ var JAVA_POM_PUBLICATION_NAME_CAPITALIZED = "FernLocalPack";
978169
+ function getJavaPomInitScript({ fallbackVersion }) {
978170
+ return `allprojects { project ->
978171
+ project.plugins.withId("java") {
978172
+ project.apply plugin: "maven-publish"
978173
+ project.afterEvaluate {
978174
+ if (project.group == null || project.group.toString().isEmpty()) {
978175
+ project.group = project.name
978176
+ }
978177
+ if (project.version == null || project.version.toString() == "unspecified") {
978178
+ project.version = "${fallbackVersion}"
978179
+ }
978180
+ if (project.publishing.publications.findByName("${JAVA_POM_PUBLICATION_NAME}") == null) {
978181
+ project.publishing.publications.create("${JAVA_POM_PUBLICATION_NAME}", MavenPublication) {
978182
+ from project.components.java
978183
+ }
978184
+ }
978185
+ }
978186
+ }
978187
+ }
978188
+ `;
978189
+ }
978190
+ async function copyGeneratedPom({
978191
+ outputPath,
978192
+ distDir,
978193
+ context: context3
978194
+ }) {
978195
+ const pomPath = join8(
978196
+ outputPath,
978197
+ RelativeFilePath2.of(`build/publications/${JAVA_POM_PUBLICATION_NAME}/pom-default.xml`)
978198
+ );
978199
+ if (!await doesPathExist(pomPath)) {
978200
+ context3.logger.warn(
978201
+ "No POM was generated for the Java package; the JAR is packaged without dependency metadata."
978202
+ );
978203
+ return;
978204
+ }
978205
+ const jarNames = (await (0, import_promises168.readdir)(distDir)).filter((file4) => file4.endsWith(".jar"));
978206
+ const jarName = jarNames.find((file4) => !file4.endsWith("-sources.jar") && !file4.endsWith("-javadoc.jar")) ?? jarNames[0];
978207
+ const pomName = jarName != null ? `${jarName.slice(0, -".jar".length)}.pom` : "pom.xml";
978208
+ await (0, import_promises168.copyFile)(pomPath, join8(distDir, RelativeFilePath2.of(pomName)));
978209
+ }
978210
+ async function hasEmittedCompilerOutput({
978211
+ outputPath,
978212
+ tsconfig
978213
+ }) {
978214
+ let outDir = "dist";
978215
+ try {
978216
+ const parsed = JSON.parse(await (0, import_promises168.readFile)(join8(outputPath, RelativeFilePath2.of(tsconfig)), "utf-8"));
978217
+ if (typeof parsed === "object" && parsed != null && "compilerOptions" in parsed) {
978218
+ const compilerOptions = parsed.compilerOptions;
978219
+ if (typeof compilerOptions === "object" && compilerOptions != null && "outDir" in compilerOptions && typeof compilerOptions.outDir === "string") {
978220
+ outDir = compilerOptions.outDir;
978221
+ }
978222
+ }
978223
+ } catch {
978224
+ }
978225
+ const outDirPath = join8(outputPath, RelativeFilePath2.of(outDir));
978226
+ if (!await doesPathExist(outDirPath)) {
978227
+ return false;
978228
+ }
978229
+ return (await (0, import_promises168.readdir)(outDirPath)).length > 0;
978230
+ }
978231
+ async function findTsconfig(outputPath) {
978232
+ for (const candidate of ["tsconfig.cjs.json", "tsconfig.json"]) {
978233
+ if (await doesPathExist(join8(outputPath, RelativeFilePath2.of(candidate)))) {
978234
+ return candidate;
978235
+ }
978236
+ }
978237
+ return void 0;
978238
+ }
978239
+ async function hasPackageJsonFilesField(outputPath) {
978240
+ const packageJsonPath = join8(outputPath, RelativeFilePath2.of("package.json"));
978241
+ if (!await doesPathExist(packageJsonPath)) {
978242
+ return false;
978243
+ }
978244
+ const parsed = JSON.parse(await (0, import_promises168.readFile)(packageJsonPath, "utf-8"));
978245
+ return typeof parsed === "object" && parsed != null && "files" in parsed;
978246
+ }
977980
978247
  async function hasNpmScript({
977981
978248
  outputPath,
977982
978249
  script
@@ -978270,7 +978537,14 @@ async function generateWorkspace({
978270
978537
  });
978271
978538
  }
978272
978539
  if (pack) {
978273
- await packLocalOutputForGroup({ group, context: groupContext, mode: packMode, runner, packOnly });
978540
+ await packLocalOutputForGroup({
978541
+ group,
978542
+ context: groupContext,
978543
+ mode: packMode,
978544
+ runner,
978545
+ packOnly,
978546
+ version: version7
978547
+ });
978274
978548
  }
978275
978549
  })
978276
978550
  )
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.89.3",
2
+ "version": "5.89.5",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",