@fern-api/fern-api-dev 4.50.2-33-ga167d9a8a89 → 4.50.2-37-g63e2f19a771

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 +54 -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-33-ga167d9a8a89",
602305
+ version: "4.50.2-37-g63e2f19a771",
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-33-ga167d9a8a89",
602356
+ version: "4.50.2-37-g63e2f19a771",
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-33-ga167d9a8a89";
826211
+ const version7 = "4.50.2-37-g63e2f19a771";
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-33-ga167d9a8a89"
837213
+ cliVersion: "4.50.2-37-g63e2f19a771"
837214
837214
  });
837215
837215
  if (taskContext.getResult() === TaskResult.Failure) {
837216
837216
  return { success: false };
@@ -910329,7 +910329,7 @@ var CliContext = class {
910329
910329
  if (false) {
910330
910330
  this.logger.error("CLI_VERSION is not defined");
910331
910331
  }
910332
- return "4.50.2-33-ga167d9a8a89";
910332
+ return "4.50.2-37-g63e2f19a771";
910333
910333
  }
910334
910334
  getCliName() {
910335
910335
  if (false) {
@@ -926335,17 +926335,24 @@ async function validateDocsBrokenLinks({
926335
926335
  var import_fs34 = require("fs");
926336
926336
  var import_gray_matter10 = __toESM(require_gray_matter(), 1);
926337
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
+ }
926338
926345
  var MdxValidationError = class {
926339
- constructor(filepath, message, line, column) {
926346
+ constructor(filepath, message, line, column, contextLines) {
926340
926347
  this.filepath = filepath;
926341
926348
  this.message = message;
926342
926349
  this.line = line;
926343
926350
  this.column = column;
926351
+ this.contextLines = contextLines;
926344
926352
  }
926345
926353
  toString() {
926346
926354
  const relativePath = import_path90.default.relative(process.cwd(), this.filepath);
926347
- let formatted = source_default.red(`
926348
- ${relativePath}`);
926355
+ let formatted = source_default.red(` ${relativePath}`);
926349
926356
  if (this.line != null) {
926350
926357
  formatted += source_default.yellow(`:${this.line}`);
926351
926358
  if (this.column != null) {
@@ -926353,7 +926360,29 @@ var MdxValidationError = class {
926353
926360
  }
926354
926361
  }
926355
926362
  formatted += source_default.gray(`
926356
- ${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
+ }
926357
926386
  return formatted;
926358
926387
  }
926359
926388
  };
@@ -926398,7 +926427,21 @@ async function validateMdxFiles({
926398
926427
  column = errorObj.position.start.column;
926399
926428
  }
926400
926429
  }
926401
- 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));
926402
926445
  }
926403
926446
  }
926404
926447
  return { errors: errors4, totalFiles: filesToCheck.length };
@@ -926416,7 +926459,6 @@ function logMdxValidationResults({
926416
926459
  for (const error50 of errors4) {
926417
926460
  context3.logger.error(error50.toString());
926418
926461
  }
926419
- context3.logger.error("");
926420
926462
  }
926421
926463
 
926422
926464
  // src/commands/validate/validateWorkspaces.ts
@@ -929759,7 +929801,7 @@ function addDocsMdCheckCommand(cli, cliContext) {
929759
929801
  }
929760
929802
  });
929761
929803
  if (hasErrors) {
929762
- cliContext.failAndThrow("MDX validation failed");
929804
+ cliContext.failWithoutThrowing();
929763
929805
  }
929764
929806
  }
929765
929807
  );
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.50.2-33-ga167d9a8a89",
2
+ "version": "4.50.2-37-g63e2f19a771",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",