@fern-api/fern-api-dev 3.60.2 → 3.61.0

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 +66 -22
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -1413296,7 +1413296,7 @@ var range = (a10, b18, str3) => {
1413296
1413296
  return result;
1413297
1413297
  };
1413298
1413298
 
1413299
- // ../../../node_modules/.pnpm/@isaacs+brace-expansion@5.0.0/node_modules/@isaacs/brace-expansion/dist/esm/index.js
1413299
+ // ../../../node_modules/.pnpm/@isaacs+brace-expansion@5.0.1/node_modules/@isaacs/brace-expansion/dist/esm/index.js
1413300
1413300
  var escSlash = "\0SLASH" + Math.random() + "\0";
1413301
1413301
  var escOpen = "\0OPEN" + Math.random() + "\0";
1413302
1413302
  var escClose = "\0CLOSE" + Math.random() + "\0";
@@ -1413312,6 +1413312,7 @@ var openPattern = /\\{/g;
1413312
1413312
  var closePattern = /\\}/g;
1413313
1413313
  var commaPattern = /\\,/g;
1413314
1413314
  var periodPattern = /\\./g;
1413315
+ var EXPANSION_MAX = 1e5;
1413315
1413316
  function numeric(str3) {
1413316
1413317
  return !isNaN(str3) ? parseInt(str3, 10) : str3.charCodeAt(0);
1413317
1413318
  }
@@ -1413342,14 +1413343,15 @@ function parseCommaParts(str3) {
1413342
1413343
  parts.push.apply(parts, p9);
1413343
1413344
  return parts;
1413344
1413345
  }
1413345
- function expand(str3) {
1413346
+ function expand(str3, options2 = {}) {
1413346
1413347
  if (!str3) {
1413347
1413348
  return [];
1413348
1413349
  }
1413350
+ const { max = EXPANSION_MAX } = options2;
1413349
1413351
  if (str3.slice(0, 2) === "{}") {
1413350
1413352
  str3 = "\\{\\}" + str3.slice(2);
1413351
1413353
  }
1413352
- return expand_(escapeBraces(str3), true).map(unescapeBraces);
1413354
+ return expand_(escapeBraces(str3), max, true).map(unescapeBraces);
1413353
1413355
  }
1413354
1413356
  function embrace(str3) {
1413355
1413357
  return "{" + str3 + "}";
@@ -1413363,15 +1413365,15 @@ function lte(i11, y23) {
1413363
1413365
  function gte(i11, y23) {
1413364
1413366
  return i11 >= y23;
1413365
1413367
  }
1413366
- function expand_(str3, isTop) {
1413368
+ function expand_(str3, max, isTop) {
1413367
1413369
  const expansions = [];
1413368
1413370
  const m10 = balanced("{", "}", str3);
1413369
1413371
  if (!m10)
1413370
1413372
  return [str3];
1413371
1413373
  const pre = m10.pre;
1413372
- const post = m10.post.length ? expand_(m10.post, false) : [""];
1413374
+ const post = m10.post.length ? expand_(m10.post, max, false) : [""];
1413373
1413375
  if (/\$$/.test(m10.pre)) {
1413374
- for (let k18 = 0; k18 < post.length; k18++) {
1413376
+ for (let k18 = 0; k18 < post.length && k18 < max; k18++) {
1413375
1413377
  const expansion = pre + "{" + m10.body + "}" + post[k18];
1413376
1413378
  expansions.push(expansion);
1413377
1413379
  }
@@ -1413383,7 +1413385,7 @@ function expand_(str3, isTop) {
1413383
1413385
  if (!isSequence && !isOptions) {
1413384
1413386
  if (m10.post.match(/,(?!,).*\}/)) {
1413385
1413387
  str3 = m10.pre + "{" + m10.body + escClose + m10.post;
1413386
- return expand_(str3);
1413388
+ return expand_(str3, max, true);
1413387
1413389
  }
1413388
1413390
  return [str3];
1413389
1413391
  }
@@ -1413393,7 +1413395,7 @@ function expand_(str3, isTop) {
1413393
1413395
  } else {
1413394
1413396
  n6 = parseCommaParts(m10.body);
1413395
1413397
  if (n6.length === 1 && n6[0] !== void 0) {
1413396
- n6 = expand_(n6[0], false).map(embrace);
1413398
+ n6 = expand_(n6[0], max, false).map(embrace);
1413397
1413399
  if (n6.length === 1) {
1413398
1413400
  return post.map((p9) => m10.pre + n6[0] + p9);
1413399
1413401
  }
@@ -1413439,11 +1413441,11 @@ function expand_(str3, isTop) {
1413439
1413441
  } else {
1413440
1413442
  N12 = [];
1413441
1413443
  for (let j15 = 0; j15 < n6.length; j15++) {
1413442
- N12.push.apply(N12, expand_(n6[j15], false));
1413444
+ N12.push.apply(N12, expand_(n6[j15], max, false));
1413443
1413445
  }
1413444
1413446
  }
1413445
1413447
  for (let j15 = 0; j15 < N12.length; j15++) {
1413446
- for (let k18 = 0; k18 < post.length; k18++) {
1413448
+ for (let k18 = 0; k18 < post.length && expansions.length < max; k18++) {
1413447
1413449
  const expansion = pre + N12[j15] + post[k18];
1413448
1413450
  if (!isTop || isSequence || expansion) {
1413449
1413451
  expansions.push(expansion);
@@ -1413454,7 +1413456,7 @@ function expand_(str3, isTop) {
1413454
1413456
  return expansions;
1413455
1413457
  }
1413456
1413458
 
1413457
- // ../../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/assert-valid-pattern.js
1413459
+ // ../../../node_modules/.pnpm/minimatch@10.1.2/node_modules/minimatch/dist/esm/assert-valid-pattern.js
1413458
1413460
  var MAX_PATTERN_LENGTH = 1024 * 64;
1413459
1413461
  var assertValidPattern = (pattern) => {
1413460
1413462
  if (typeof pattern !== "string") {
@@ -1413465,7 +1413467,7 @@ var assertValidPattern = (pattern) => {
1413465
1413467
  }
1413466
1413468
  };
1413467
1413469
 
1413468
- // ../../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/brace-expressions.js
1413470
+ // ../../../node_modules/.pnpm/minimatch@10.1.2/node_modules/minimatch/dist/esm/brace-expressions.js
1413469
1413471
  var posixClasses = {
1413470
1413472
  "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
1413471
1413473
  "[:alpha:]": ["\\p{L}\\p{Nl}", true],
@@ -1413574,7 +1413576,7 @@ var parseClass = (glob2, position4) => {
1413574
1413576
  return [comb, uflag, endPos - pos2, true];
1413575
1413577
  };
1413576
1413578
 
1413577
- // ../../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/unescape.js
1413579
+ // ../../../node_modules/.pnpm/minimatch@10.1.2/node_modules/minimatch/dist/esm/unescape.js
1413578
1413580
  var unescape2 = (s9, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => {
1413579
1413581
  if (magicalBraces) {
1413580
1413582
  return windowsPathsNoEscape ? s9.replace(/\[([^\/\\])\]/g, "$1") : s9.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
@@ -1413582,7 +1413584,7 @@ var unescape2 = (s9, { windowsPathsNoEscape = false, magicalBraces = true } = {}
1413582
1413584
  return windowsPathsNoEscape ? s9.replace(/\[([^\/\\{}])\]/g, "$1") : s9.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, "$1$2").replace(/\\([^\/{}])/g, "$1");
1413583
1413585
  };
1413584
1413586
 
1413585
- // ../../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/ast.js
1413587
+ // ../../../node_modules/.pnpm/minimatch@10.1.2/node_modules/minimatch/dist/esm/ast.js
1413586
1413588
  var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
1413587
1413589
  var isExtglobType = (c16) => types.has(c16);
1413588
1413590
  var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
@@ -1414058,7 +1414060,7 @@ var AST = class _AST {
1414058
1414060
  }
1414059
1414061
  };
1414060
1414062
 
1414061
- // ../../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/escape.js
1414063
+ // ../../../node_modules/.pnpm/minimatch@10.1.2/node_modules/minimatch/dist/esm/escape.js
1414062
1414064
  var escape3 = (s9, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => {
1414063
1414065
  if (magicalBraces) {
1414064
1414066
  return windowsPathsNoEscape ? s9.replace(/[?*()[\]{}]/g, "[$&]") : s9.replace(/[?*()[\]\\{}]/g, "\\$&");
@@ -1414066,7 +1414068,7 @@ var escape3 = (s9, { windowsPathsNoEscape = false, magicalBraces = false } = {})
1414066
1414068
  return windowsPathsNoEscape ? s9.replace(/[?*()[\]]/g, "[$&]") : s9.replace(/[?*()[\]\\]/g, "\\$&");
1414067
1414069
  };
1414068
1414070
 
1414069
- // ../../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/index.js
1414071
+ // ../../../node_modules/.pnpm/minimatch@10.1.2/node_modules/minimatch/dist/esm/index.js
1414070
1414072
  var minimatch = (p9, pattern, options2 = {}) => {
1414071
1414073
  assertValidPattern(pattern);
1414072
1414074
  if (!options2.nocomment && pattern.charAt(0) === "#") {
@@ -1654811,6 +1654813,20 @@ async function replaceReferencedMarkdown({
1654811
1654813
  return { markdown: newMarkdown, referencedFiles: Array.from(collectedFiles.values()) };
1654812
1654814
  }
1654813
1654815
 
1654816
+ // ../docs-markdown-utils/lib/transformAtPrefixImports.js
1654817
+ function transformAtPrefixImports({ markdown, absolutePathToFernFolder, absolutePathToMarkdownFile }) {
1654818
+ const importRegex = /(import\s+(?:(?:\{[^}]*\}|\*\s+as\s+\w+|\w+)\s+from\s+)?['"])@\/([^'"]+)(['"])/g;
1654819
+ const mdxDir = dirname4(absolutePathToMarkdownFile);
1654820
+ return markdown.replace(importRegex, (match3, prefix2, importPath, suffix) => {
1654821
+ const absoluteImportPath = AbsoluteFilePath2.of(`${absolutePathToFernFolder}/${importPath}`);
1654822
+ let relativePath = relative3(mdxDir, absoluteImportPath);
1654823
+ if (!relativePath.startsWith(".") && !relativePath.startsWith("/")) {
1654824
+ relativePath = RelativeFilePath2.of(`./${relativePath}`);
1654825
+ }
1654826
+ return `${prefix2}${relativePath}${suffix}`;
1654827
+ });
1654828
+ }
1654829
+
1654814
1654830
  // ../docs-resolver/lib/DocsDefinitionResolver.js
1654815
1654831
  init_js();
1654816
1654832
  init_lib6();
@@ -1659164,12 +1659180,17 @@ var DocsDefinitionResolver = class {
1659164
1659180
  this.referencedMarkdownFiles.push(refFile);
1659165
1659181
  }
1659166
1659182
  }
1659167
- const newMarkdown = await replaceReferencedCode({
1659183
+ const codeReplacedMarkdown = await replaceReferencedCode({
1659168
1659184
  markdown: result.markdown,
1659169
1659185
  absolutePathToFernFolder: this.docsWorkspace.absoluteFilePath,
1659170
1659186
  absolutePathToMarkdownFile: this.resolveFilepath(relativePath),
1659171
1659187
  context: this.taskContext
1659172
1659188
  });
1659189
+ const newMarkdown = transformAtPrefixImports({
1659190
+ markdown: codeReplacedMarkdown,
1659191
+ absolutePathToFernFolder: this.docsWorkspace.absoluteFilePath,
1659192
+ absolutePathToMarkdownFile: this.resolveFilepath(relativePath)
1659193
+ });
1659173
1659194
  this.parsedDocsConfig.pages[RelativeFilePath2.of(relativePath)] = newMarkdown;
1659174
1659195
  }
1659175
1659196
  const refTime = performance.now() - refStart;
@@ -1678892,7 +1678913,7 @@ var AccessTokenPosthogManager = class {
1678892
1678913
  properties: {
1678893
1678914
  ...event,
1678894
1678915
  ...event.properties,
1678895
- version: "3.60.2",
1678916
+ version: "3.61.0",
1678896
1678917
  usingAccessToken: true
1678897
1678918
  }
1678898
1678919
  });
@@ -1678942,7 +1678963,7 @@ var UserPosthogManager = class {
1678942
1678963
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
1678943
1678964
  event: "CLI",
1678944
1678965
  properties: {
1678945
- version: "3.60.2",
1678966
+ version: "3.61.0",
1678946
1678967
  ...event,
1678947
1678968
  ...event.properties,
1678948
1678969
  usingAccessToken: false,
@@ -1710864,7 +1710885,7 @@ var CliContext = class {
1710864
1710885
  if (false) {
1710865
1710886
  this.logger.error("CLI_VERSION is not defined");
1710866
1710887
  }
1710867
- return "3.60.2";
1710888
+ return "3.61.0";
1710868
1710889
  }
1710869
1710890
  getCliName() {
1710870
1710891
  if (false) {
@@ -1713978,7 +1713999,7 @@ var import_path56 = __toESM(require("path"), 1);
1713978
1713999
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
1713979
1714000
  var LOGS_FOLDER_NAME = "logs";
1713980
1714001
  function getCliSource() {
1713981
- const version7 = "3.60.2";
1714002
+ const version7 = "3.61.0";
1713982
1714003
  return `cli@${version7}`;
1713983
1714004
  }
1713984
1714005
  var DebugLogger = class {
@@ -1715623,6 +1715644,24 @@ async function replaceReferencedMarkdown2({
1715623
1715644
  return { markdown: newMarkdown, referencedFiles: Array.from(collectedFiles.values()) };
1715624
1715645
  }
1715625
1715646
 
1715647
+ // ../docs-markdown-utils/src/transformAtPrefixImports.ts
1715648
+ function transformAtPrefixImports2({
1715649
+ markdown,
1715650
+ absolutePathToFernFolder,
1715651
+ absolutePathToMarkdownFile
1715652
+ }) {
1715653
+ const importRegex = /(import\s+(?:(?:\{[^}]*\}|\*\s+as\s+\w+|\w+)\s+from\s+)?['"])@\/([^'"]+)(['"])/g;
1715654
+ const mdxDir = dirname4(absolutePathToMarkdownFile);
1715655
+ return markdown.replace(importRegex, (match3, prefix2, importPath, suffix) => {
1715656
+ const absoluteImportPath = AbsoluteFilePath2.of(`${absolutePathToFernFolder}/${importPath}`);
1715657
+ let relativePath = relative3(mdxDir, absoluteImportPath);
1715658
+ if (!relativePath.startsWith(".") && !relativePath.startsWith("/")) {
1715659
+ relativePath = RelativeFilePath2.of(`./${relativePath}`);
1715660
+ }
1715661
+ return `${prefix2}${relativePath}${suffix}`;
1715662
+ });
1715663
+ }
1715664
+
1715626
1715665
  // ../docs-preview/lib/previewDocs.js
1715627
1715666
  var frontmatterPositionCache = /* @__PURE__ */ new Map();
1715628
1715667
  var frontmatterSidebarTitleCache = /* @__PURE__ */ new Map();
@@ -1715724,12 +1715763,17 @@ async function getPreviewDocsDefinition({ domain: domain3, project, context: con
1715724
1715763
  absolutePathToMarkdownFile: absoluteFilePath,
1715725
1715764
  context: context2
1715726
1715765
  });
1715727
- const markdownReplacedMdAndCode = await replaceReferencedCode2({
1715766
+ const markdownReplacedCode = await replaceReferencedCode2({
1715728
1715767
  markdown: markdownReplacedMd,
1715729
1715768
  absolutePathToFernFolder: docsWorkspace.absoluteFilePath,
1715730
1715769
  absolutePathToMarkdownFile: absoluteFilePath,
1715731
1715770
  context: context2
1715732
1715771
  });
1715772
+ const markdownReplacedMdAndCode = transformAtPrefixImports2({
1715773
+ markdown: markdownReplacedCode,
1715774
+ absolutePathToFernFolder: docsWorkspace.absoluteFilePath,
1715775
+ absolutePathToMarkdownFile: absoluteFilePath
1715776
+ });
1715733
1715777
  const { markdown: markdownWithAbsPaths, filepaths } = parseImagePaths2(markdownReplacedMdAndCode, {
1715734
1715778
  absolutePathToFernFolder: docsWorkspace.absoluteFilePath,
1715735
1715779
  absolutePathToMarkdownFile: absoluteFilePath
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.60.2",
2
+ "version": "3.61.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",