@fern-api/fern-api-dev 4.50.2 → 4.50.3

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 +58 -12
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -602302,7 +602302,7 @@ var AccessTokenPosthogManager = class {
602302
602302
  properties: {
602303
602303
  ...event,
602304
602304
  ...event.properties,
602305
- version: "4.50.2",
602305
+ version: "4.50.3",
602306
602306
  usingAccessToken: true
602307
602307
  }
602308
602308
  });
@@ -602353,7 +602353,7 @@ var UserPosthogManager = class {
602353
602353
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
602354
602354
  event: "CLI",
602355
602355
  properties: {
602356
- version: "4.50.2",
602356
+ version: "4.50.3",
602357
602357
  ...event,
602358
602358
  ...event.properties,
602359
602359
  usingAccessToken: false,
@@ -826208,7 +826208,7 @@ var import_path54 = __toESM(require("path"), 1);
826208
826208
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
826209
826209
  var LOGS_FOLDER_NAME = "logs";
826210
826210
  function getCliSource() {
826211
- const version7 = "4.50.2";
826211
+ const version7 = "4.50.3";
826212
826212
  return `cli@${version7}`;
826213
826213
  }
826214
826214
  var DebugLogger = class {
@@ -837210,7 +837210,7 @@ var LegacyDocsPublisher = class {
837210
837210
  previewId: void 0,
837211
837211
  disableTemplates: void 0,
837212
837212
  skipUpload,
837213
- cliVersion: "4.50.2"
837213
+ cliVersion: "4.50.3"
837214
837214
  });
837215
837215
  if (taskContext.getResult() === TaskResult.Failure) {
837216
837216
  return { success: false };
@@ -875571,6 +875571,10 @@ var Attribute2 = class _Attribute extends AstNode7 {
875571
875571
  name: "serde",
875572
875572
  args: ["skip"]
875573
875573
  }),
875574
+ skipSerializing: () => new _Attribute({
875575
+ name: "serde",
875576
+ args: ["skip_serializing"]
875577
+ }),
875574
875578
  skipSerializingIf: (condition) => new _Attribute({
875575
875579
  name: "serde",
875576
875580
  args: [`skip_serializing_if = ${condition}`]
@@ -910325,7 +910329,7 @@ var CliContext = class {
910325
910329
  if (false) {
910326
910330
  this.logger.error("CLI_VERSION is not defined");
910327
910331
  }
910328
- return "4.50.2";
910332
+ return "4.50.3";
910329
910333
  }
910330
910334
  getCliName() {
910331
910335
  if (false) {
@@ -926331,17 +926335,24 @@ async function validateDocsBrokenLinks({
926331
926335
  var import_fs34 = require("fs");
926332
926336
  var import_gray_matter10 = __toESM(require_gray_matter(), 1);
926333
926337
  var import_path90 = __toESM(require("path"), 1);
926338
+ function calculateVisualColumn(text9, charIndex, tabWidth = 4) {
926339
+ let visualColumn = 0;
926340
+ for (let i11 = 0; i11 < Math.min(charIndex, text9.length); i11++) {
926341
+ visualColumn += text9[i11] === " " ? tabWidth : 1;
926342
+ }
926343
+ return visualColumn;
926344
+ }
926334
926345
  var MdxValidationError = class {
926335
- constructor(filepath, message, line, column) {
926346
+ constructor(filepath, message, line, column, contextLines) {
926336
926347
  this.filepath = filepath;
926337
926348
  this.message = message;
926338
926349
  this.line = line;
926339
926350
  this.column = column;
926351
+ this.contextLines = contextLines;
926340
926352
  }
926341
926353
  toString() {
926342
926354
  const relativePath = import_path90.default.relative(process.cwd(), this.filepath);
926343
- let formatted = source_default.red(`
926344
- ${relativePath}`);
926355
+ let formatted = source_default.red(` ${relativePath}`);
926345
926356
  if (this.line != null) {
926346
926357
  formatted += source_default.yellow(`:${this.line}`);
926347
926358
  if (this.column != null) {
@@ -926349,7 +926360,29 @@ var MdxValidationError = class {
926349
926360
  }
926350
926361
  }
926351
926362
  formatted += source_default.gray(`
926352
- ${this.message}`);
926363
+ ${this.message}`);
926364
+ if (this.contextLines && this.contextLines.length > 0) {
926365
+ formatted += "\n";
926366
+ const maxLineNum = Math.max(...this.contextLines.map((ctx) => ctx.lineNumber));
926367
+ const lineNumWidth = String(maxLineNum).length;
926368
+ for (const ctx of this.contextLines) {
926369
+ const lineNumStr = String(ctx.lineNumber).padStart(lineNumWidth, " ");
926370
+ const displayContent = ctx.content.replace(/\t/g, " ");
926371
+ if (ctx.isErrorLine) {
926372
+ formatted += `
926373
+ ${source_default.cyan(lineNumStr)} | ${displayContent}`;
926374
+ if (this.column != null && this.column > 0) {
926375
+ const visualColumn = calculateVisualColumn(ctx.content, this.column - 1);
926376
+ const caretPadding = " ".repeat(lineNumWidth + 3 + visualColumn);
926377
+ formatted += source_default.red(`
926378
+ ${caretPadding}^`);
926379
+ }
926380
+ } else {
926381
+ formatted += `
926382
+ ${source_default.gray(lineNumStr + " | " + displayContent)}`;
926383
+ }
926384
+ }
926385
+ }
926353
926386
  return formatted;
926354
926387
  }
926355
926388
  };
@@ -926394,7 +926427,21 @@ async function validateMdxFiles({
926394
926427
  column = errorObj.position.start.column;
926395
926428
  }
926396
926429
  }
926397
- errors4.push(new MdxValidationError(filepath, message, line, column));
926430
+ let contextLines;
926431
+ if (line != null) {
926432
+ const allLines = content5.split("\n");
926433
+ const contextStart = Math.max(0, line - 3);
926434
+ const contextEnd = Math.min(allLines.length, line);
926435
+ contextLines = [];
926436
+ for (let i11 = contextStart; i11 < contextEnd; i11++) {
926437
+ contextLines.push({
926438
+ lineNumber: i11 + 1,
926439
+ content: allLines[i11] ?? "",
926440
+ isErrorLine: i11 + 1 === line
926441
+ });
926442
+ }
926443
+ }
926444
+ errors4.push(new MdxValidationError(filepath, message, line, column, contextLines));
926398
926445
  }
926399
926446
  }
926400
926447
  return { errors: errors4, totalFiles: filesToCheck.length };
@@ -926412,7 +926459,6 @@ function logMdxValidationResults({
926412
926459
  for (const error50 of errors4) {
926413
926460
  context3.logger.error(error50.toString());
926414
926461
  }
926415
- context3.logger.error("");
926416
926462
  }
926417
926463
 
926418
926464
  // src/commands/validate/validateWorkspaces.ts
@@ -929755,7 +929801,7 @@ function addDocsMdCheckCommand(cli, cliContext) {
929755
929801
  }
929756
929802
  });
929757
929803
  if (hasErrors) {
929758
- cliContext.failAndThrow("MDX validation failed");
929804
+ cliContext.failWithoutThrowing();
929759
929805
  }
929760
929806
  }
929761
929807
  );
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.50.2",
2
+ "version": "4.50.3",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",