@fern-api/fern-api-dev 3.29.1-6-g9009332f9a → 3.30.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 +96 -12
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -1413604,7 +1413604,7 @@ var AccessTokenPosthogManager = class {
1413604
1413604
  properties: {
1413605
1413605
  ...event,
1413606
1413606
  ...event.properties,
1413607
- version: "3.29.1-6-g9009332f9a",
1413607
+ version: "3.30.0",
1413608
1413608
  usingAccessToken: true
1413609
1413609
  }
1413610
1413610
  });
@@ -1413703,7 +1413703,7 @@ var UserPosthogManager = class {
1413703
1413703
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
1413704
1413704
  event: "CLI",
1413705
1413705
  properties: {
1413706
- version: "3.29.1-6-g9009332f9a",
1413706
+ version: "3.30.0",
1413707
1413707
  ...event,
1413708
1413708
  ...event.properties,
1413709
1413709
  usingAccessToken: false,
@@ -1493769,7 +1493769,7 @@ var CliContext = class {
1493769
1493769
  if (false) {
1493770
1493770
  this.logger.error("CLI_VERSION is not defined");
1493771
1493771
  }
1493772
- return "3.29.1-6-g9009332f9a";
1493772
+ return "3.30.0";
1493773
1493773
  }
1493774
1493774
  getCliName() {
1493775
1493775
  if (false) {
@@ -1562951,7 +1562951,7 @@ function parseJsxTag(content5, start2, metadata, filepaths, edits) {
1562951
1562951
  }
1562952
1562952
  const value = content5.slice(valueStart, i11);
1562953
1562953
  i11++;
1562954
- if (attrName === "src") {
1562954
+ if (attrName === "src" || attrName === "icon" && isLocalIconReference(value)) {
1562955
1562955
  const src = trimAnchor(value);
1562956
1562956
  const resolvedPath = resolvePath4(src, metadata);
1562957
1562957
  if (src && resolvedPath) {
@@ -1562974,7 +1562974,7 @@ function parseJsxTag(content5, start2, metadata, filepaths, edits) {
1562974
1562974
  const expr = content5.slice(exprStart, i11 - 1).trim();
1562975
1562975
  if (expr.startsWith('"') && expr.endsWith('"') || expr.startsWith("'") && expr.endsWith("'")) {
1562976
1562976
  const value = expr.slice(1, -1);
1562977
- if (attrName === "src") {
1562977
+ if (attrName === "src" || attrName === "icon" && isLocalIconReference(value)) {
1562978
1562978
  const src = trimAnchor(value);
1562979
1562979
  const resolvedPath = resolvePath4(src, metadata);
1562980
1562980
  if (src && resolvedPath) {
@@ -1562988,7 +1562988,7 @@ function parseJsxTag(content5, start2, metadata, filepaths, edits) {
1562988
1562988
  }
1562989
1562989
  } else if (expr.startsWith("`") && expr.endsWith("`") && !expr.includes("${")) {
1562990
1562990
  const value = expr.slice(1, -1);
1562991
- if (attrName === "src") {
1562991
+ if (attrName === "src" || attrName === "icon" && isLocalIconReference(value)) {
1562992
1562992
  const src = trimAnchor(value);
1562993
1562993
  const resolvedPath = resolvePath4(src, metadata);
1562994
1562994
  if (src && resolvedPath) {
@@ -1563110,6 +1563110,17 @@ function parseImagePaths(markdown, metadata, context2) {
1563110
1563110
  replaced = replaced.replaceAll(src, resolvedPath);
1563111
1563111
  }
1563112
1563112
  return;
1563113
+ },
1563114
+ icon: (attr) => {
1563115
+ const icon = trimAnchor(extractSingleLiteral(attr.value));
1563116
+ if (isLocalIconReference(icon)) {
1563117
+ const resolvedPath = resolvePath4(icon, metadata);
1563118
+ if (icon && resolvedPath) {
1563119
+ filepaths.add(resolvedPath);
1563120
+ replaced = replaced.replaceAll(icon, resolvedPath);
1563121
+ }
1563122
+ }
1563123
+ return;
1563113
1563124
  }
1563114
1563125
  });
1563115
1563126
  }
@@ -1563123,6 +1563134,15 @@ function parseImagePaths(markdown, metadata, context2) {
1563123
1563134
  replaced = replaced.replaceAll(src, resolvedPath);
1563124
1563135
  }
1563125
1563136
  }
1563137
+ const iconAttr = node3.attributes.filter(isMdxJsxAttribute).find((attr) => attr.name === "icon");
1563138
+ const icon = trimAnchor(extractAttributeValueLiteral(iconAttr?.value));
1563139
+ if (iconAttr && icon && isLocalIconReference(icon)) {
1563140
+ const resolvedPath = resolvePath4(icon, metadata);
1563141
+ if (resolvedPath != null) {
1563142
+ filepaths.add(resolvedPath);
1563143
+ replaced = replaced.replaceAll(icon, resolvedPath);
1563144
+ }
1563145
+ }
1563126
1563146
  node3.attributes.forEach((attr) => {
1563127
1563147
  if (isMdxJsxAttribute(attr) && typeof attr.value !== "string" && attr.value != null && attr.value.data?.estree) {
1563128
1563148
  walkEstreeForSrc(attr.value.data.estree);
@@ -1563175,6 +1563195,17 @@ function isWindowsAbsolutePath(path68) {
1563175
1563195
  function isDataUrl(url2) {
1563176
1563196
  return url2.startsWith("data:");
1563177
1563197
  }
1563198
+ function isLocalIconReference(icon) {
1563199
+ if (icon == null || icon === "" || isExternalUrl2(icon) || isDataUrl(icon)) {
1563200
+ return false;
1563201
+ }
1563202
+ if (icon.includes("/")) {
1563203
+ return true;
1563204
+ }
1563205
+ const lowerIcon = icon.toLowerCase();
1563206
+ const imageExtensions = [".svg", ".png", ".jpg", ".jpeg", ".gif", ".webp", ".ico", ".bmp", ".avif"];
1563207
+ return imageExtensions.some((ext2) => lowerIcon.endsWith(ext2));
1563208
+ }
1563178
1563209
  function getReplacedHref({ href, metadata, markdownFilesToPathName }) {
1563179
1563210
  if (href == null) {
1563180
1563211
  return;
@@ -1563317,7 +1563348,7 @@ function replaceImagePathsAndUrls(markdown, fileIdsMap, markdownFilesToPathName,
1563317
1563348
  }
1563318
1563349
  const value = content5.slice(valueStart, j15);
1563319
1563350
  j15++;
1563320
- if (attrName === "src") {
1563351
+ if (attrName === "src" || attrName === "icon" && isLocalIconReference(value)) {
1563321
1563352
  const imageSrc = mapImage(value);
1563322
1563353
  if (imageSrc) {
1563323
1563354
  edits.push({
@@ -1563384,6 +1563415,12 @@ function replaceImagePathsAndUrls(markdown, fileIdsMap, markdownFilesToPathName,
1563384
1563415
  function walkEstreeForSrcAndHref(estree) {
1563385
1563416
  walkEstreeJsxAttributes(estree, {
1563386
1563417
  src: (attr) => replaceSrc(trimAnchor(extractSingleLiteral(attr.value))),
1563418
+ icon: (attr) => {
1563419
+ const icon = trimAnchor(extractSingleLiteral(attr.value));
1563420
+ if (isLocalIconReference(icon)) {
1563421
+ replaceSrc(icon);
1563422
+ }
1563423
+ },
1563387
1563424
  href: (attr) => replaceHref(trimAnchor(extractSingleLiteral(attr.value)))
1563388
1563425
  });
1563389
1563426
  }
@@ -1563397,6 +1563434,11 @@ function replaceImagePathsAndUrls(markdown, fileIdsMap, markdownFilesToPathName,
1563397
1563434
  if (isMdxJsxElement(node3)) {
1563398
1563435
  const srcAttr = node3.attributes.filter(isMdxJsxAttribute).find((attr) => attr.name === "src");
1563399
1563436
  replaceSrc(trimAnchor(extractAttributeValueLiteral(srcAttr?.value)));
1563437
+ const iconAttr = node3.attributes.filter(isMdxJsxAttribute).find((attr) => attr.name === "icon");
1563438
+ const iconValue = trimAnchor(extractAttributeValueLiteral(iconAttr?.value));
1563439
+ if (isLocalIconReference(iconValue)) {
1563440
+ replaceSrc(iconValue);
1563441
+ }
1563400
1563442
  const hrefAttr = node3.attributes.find((attr) => attr.type === "mdxJsxAttribute" && attr.name === "href");
1563401
1563443
  replaceHref(trimAnchor(extractAttributeValueLiteral(hrefAttr?.value)));
1563402
1563444
  node3.attributes.forEach((attr) => {
@@ -1588528,7 +1588570,7 @@ var import_path35 = __toESM(require("path"), 1);
1588528
1588570
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
1588529
1588571
  var LOGS_FOLDER_NAME = "logs";
1588530
1588572
  function getCliSource() {
1588531
- const version6 = "3.29.1-6-g9009332f9a";
1588573
+ const version6 = "3.30.0";
1588532
1588574
  return `cli@${version6}`;
1588533
1588575
  }
1588534
1588576
  var DebugLogger = class {
@@ -1589264,7 +1589306,7 @@ function parseJsxTag2(content5, start2, metadata, filepaths, edits) {
1589264
1589306
  }
1589265
1589307
  const value = content5.slice(valueStart, i11);
1589266
1589308
  i11++;
1589267
- if (attrName === "src") {
1589309
+ if (attrName === "src" || attrName === "icon" && isLocalIconReference2(value)) {
1589268
1589310
  const src = trimAnchor2(value);
1589269
1589311
  const resolvedPath = resolvePath5(src, metadata);
1589270
1589312
  if (src && resolvedPath) {
@@ -1589287,7 +1589329,7 @@ function parseJsxTag2(content5, start2, metadata, filepaths, edits) {
1589287
1589329
  const expr = content5.slice(exprStart, i11 - 1).trim();
1589288
1589330
  if (expr.startsWith('"') && expr.endsWith('"') || expr.startsWith("'") && expr.endsWith("'")) {
1589289
1589331
  const value = expr.slice(1, -1);
1589290
- if (attrName === "src") {
1589332
+ if (attrName === "src" || attrName === "icon" && isLocalIconReference2(value)) {
1589291
1589333
  const src = trimAnchor2(value);
1589292
1589334
  const resolvedPath = resolvePath5(src, metadata);
1589293
1589335
  if (src && resolvedPath) {
@@ -1589301,7 +1589343,7 @@ function parseJsxTag2(content5, start2, metadata, filepaths, edits) {
1589301
1589343
  }
1589302
1589344
  } else if (expr.startsWith("`") && expr.endsWith("`") && !expr.includes("${")) {
1589303
1589345
  const value = expr.slice(1, -1);
1589304
- if (attrName === "src") {
1589346
+ if (attrName === "src" || attrName === "icon" && isLocalIconReference2(value)) {
1589305
1589347
  const src = trimAnchor2(value);
1589306
1589348
  const resolvedPath = resolvePath5(src, metadata);
1589307
1589349
  if (src && resolvedPath) {
@@ -1589427,6 +1589469,17 @@ function parseImagePaths2(markdown, metadata, context2) {
1589427
1589469
  replaced = replaced.replaceAll(src, resolvedPath);
1589428
1589470
  }
1589429
1589471
  return;
1589472
+ },
1589473
+ icon: (attr) => {
1589474
+ const icon = trimAnchor2(extractSingleLiteral2(attr.value));
1589475
+ if (isLocalIconReference2(icon)) {
1589476
+ const resolvedPath = resolvePath5(icon, metadata);
1589477
+ if (icon && resolvedPath) {
1589478
+ filepaths.add(resolvedPath);
1589479
+ replaced = replaced.replaceAll(icon, resolvedPath);
1589480
+ }
1589481
+ }
1589482
+ return;
1589430
1589483
  }
1589431
1589484
  });
1589432
1589485
  }
@@ -1589440,6 +1589493,15 @@ function parseImagePaths2(markdown, metadata, context2) {
1589440
1589493
  replaced = replaced.replaceAll(src, resolvedPath);
1589441
1589494
  }
1589442
1589495
  }
1589496
+ const iconAttr = node3.attributes.filter(isMdxJsxAttribute2).find((attr) => attr.name === "icon");
1589497
+ const icon = trimAnchor2(extractAttributeValueLiteral2(iconAttr?.value));
1589498
+ if (iconAttr && icon && isLocalIconReference2(icon)) {
1589499
+ const resolvedPath = resolvePath5(icon, metadata);
1589500
+ if (resolvedPath != null) {
1589501
+ filepaths.add(resolvedPath);
1589502
+ replaced = replaced.replaceAll(icon, resolvedPath);
1589503
+ }
1589504
+ }
1589443
1589505
  node3.attributes.forEach((attr) => {
1589444
1589506
  if (isMdxJsxAttribute2(attr) && typeof attr.value !== "string" && attr.value != null && attr.value.data?.estree) {
1589445
1589507
  walkEstreeForSrc(attr.value.data.estree);
@@ -1589497,6 +1589559,17 @@ function isWindowsAbsolutePath2(path68) {
1589497
1589559
  function isDataUrl2(url2) {
1589498
1589560
  return url2.startsWith("data:");
1589499
1589561
  }
1589562
+ function isLocalIconReference2(icon) {
1589563
+ if (icon == null || icon === "" || isExternalUrl3(icon) || isDataUrl2(icon)) {
1589564
+ return false;
1589565
+ }
1589566
+ if (icon.includes("/")) {
1589567
+ return true;
1589568
+ }
1589569
+ const lowerIcon = icon.toLowerCase();
1589570
+ const imageExtensions = [".svg", ".png", ".jpg", ".jpeg", ".gif", ".webp", ".ico", ".bmp", ".avif"];
1589571
+ return imageExtensions.some((ext2) => lowerIcon.endsWith(ext2));
1589572
+ }
1589500
1589573
  function getReplacedHref2({
1589501
1589574
  href,
1589502
1589575
  metadata,
@@ -1589645,7 +1589718,7 @@ function replaceImagePathsAndUrls2(markdown, fileIdsMap, markdownFilesToPathName
1589645
1589718
  }
1589646
1589719
  const value = content5.slice(valueStart, j15);
1589647
1589720
  j15++;
1589648
- if (attrName === "src") {
1589721
+ if (attrName === "src" || attrName === "icon" && isLocalIconReference2(value)) {
1589649
1589722
  const imageSrc = mapImage(value);
1589650
1589723
  if (imageSrc) {
1589651
1589724
  edits.push({
@@ -1589714,6 +1589787,12 @@ function replaceImagePathsAndUrls2(markdown, fileIdsMap, markdownFilesToPathName
1589714
1589787
  function walkEstreeForSrcAndHref(estree) {
1589715
1589788
  walkEstreeJsxAttributes2(estree, {
1589716
1589789
  src: (attr) => replaceSrc(trimAnchor2(extractSingleLiteral2(attr.value))),
1589790
+ icon: (attr) => {
1589791
+ const icon = trimAnchor2(extractSingleLiteral2(attr.value));
1589792
+ if (isLocalIconReference2(icon)) {
1589793
+ replaceSrc(icon);
1589794
+ }
1589795
+ },
1589717
1589796
  href: (attr) => replaceHref(trimAnchor2(extractSingleLiteral2(attr.value)))
1589718
1589797
  });
1589719
1589798
  }
@@ -1589727,6 +1589806,11 @@ function replaceImagePathsAndUrls2(markdown, fileIdsMap, markdownFilesToPathName
1589727
1589806
  if (isMdxJsxElement2(node3)) {
1589728
1589807
  const srcAttr = node3.attributes.filter(isMdxJsxAttribute2).find((attr) => attr.name === "src");
1589729
1589808
  replaceSrc(trimAnchor2(extractAttributeValueLiteral2(srcAttr?.value)));
1589809
+ const iconAttr = node3.attributes.filter(isMdxJsxAttribute2).find((attr) => attr.name === "icon");
1589810
+ const iconValue = trimAnchor2(extractAttributeValueLiteral2(iconAttr?.value));
1589811
+ if (isLocalIconReference2(iconValue)) {
1589812
+ replaceSrc(iconValue);
1589813
+ }
1589730
1589814
  const hrefAttr = node3.attributes.find(
1589731
1589815
  (attr) => attr.type === "mdxJsxAttribute" && attr.name === "href"
1589732
1589816
  );
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.29.1-6-g9009332f9a",
2
+ "version": "3.30.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",