@fern-api/fern-api-dev 5.7.5 → 5.7.6-2-g68a151c4de6

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 +92 -19
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -427701,7 +427701,7 @@ var require_sync2 = __commonJS({
427701
427701
  "../../../node_modules/.pnpm/escalade@3.2.0/node_modules/escalade/sync/index.js"(exports2, module4) {
427702
427702
  "use strict";
427703
427703
  var { dirname: dirname22, resolve: resolve15 } = require("path");
427704
- var { readdirSync: readdirSync3, statSync: statSync5 } = require("fs");
427704
+ var { readdirSync: readdirSync4, statSync: statSync5 } = require("fs");
427705
427705
  module4.exports = function(start2, callback) {
427706
427706
  let dir = resolve15(".", start2);
427707
427707
  let tmp18, stats = statSync5(dir);
@@ -427709,7 +427709,7 @@ var require_sync2 = __commonJS({
427709
427709
  dir = dirname22(dir);
427710
427710
  }
427711
427711
  while (true) {
427712
- tmp18 = callback(dir, readdirSync3(dir));
427712
+ tmp18 = callback(dir, readdirSync4(dir));
427713
427713
  if (tmp18) return resolve15(dir, tmp18);
427714
427714
  dir = dirname22(tmp18 = dir);
427715
427715
  if (tmp18 === dir) break;
@@ -622607,7 +622607,7 @@ var AccessTokenPosthogManager = class {
622607
622607
  properties: {
622608
622608
  ...event,
622609
622609
  ...event.properties,
622610
- version: "5.7.5",
622610
+ version: "5.7.6-2-g68a151c4de6",
622611
622611
  usingAccessToken: true
622612
622612
  }
622613
622613
  });
@@ -622661,7 +622661,7 @@ var UserPosthogManager = class {
622661
622661
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
622662
622662
  event: "CLI",
622663
622663
  properties: {
622664
- version: "5.7.5",
622664
+ version: "5.7.6-2-g68a151c4de6",
622665
622665
  ...event,
622666
622666
  ...event.properties,
622667
622667
  usingAccessToken: false,
@@ -847021,7 +847021,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
847021
847021
  var LOGS_FOLDER_NAME = "logs";
847022
847022
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
847023
847023
  function getCliSource() {
847024
- const version7 = "5.7.5";
847024
+ const version7 = "5.7.6-2-g68a151c4de6";
847025
847025
  return `cli@${version7}`;
847026
847026
  }
847027
847027
  var DebugLogger = class {
@@ -847450,6 +847450,7 @@ function resolveWindowsSymlinks(outputDir, symlinks, logger4, onProgress) {
847450
847450
  continue;
847451
847451
  }
847452
847452
  if (!(0, import_fs27.existsSync)(sourcePath)) {
847453
+ logger4.debug(`Symlink target not found: ${symlinkPath} -> ${linkname} (resolved: ${sourcePath})`);
847453
847454
  failed++;
847454
847455
  continue;
847455
847456
  }
@@ -847474,10 +847475,38 @@ function resolveWindowsSymlinks(outputDir, symlinks, logger4, onProgress) {
847474
847475
  }
847475
847476
  logger4.debug(`Symlink resolution: ${junctions} junctions, ${copies} file copies, ${alreadyExisted} pre-existing, ${failed} failed (${fallbackUsed} via fallback) out of ${symlinks.length}`);
847476
847477
  const standaloneNM = import_path58.default.join(outputDir, "standalone", "node_modules");
847477
- for (const dep of ["next", "react", "react-dom", "styled-jsx"]) {
847478
- if (!(0, import_fs27.existsSync)(import_path58.default.join(standaloneNM, dep))) {
847479
- logger4.warn(`${dep} is MISSING from standalone/node_modules/`);
847478
+ const criticalDeps = ["next", "react", "react-dom", "styled-jsx"];
847479
+ for (const dep of criticalDeps) {
847480
+ const depPath = import_path58.default.join(standaloneNM, dep);
847481
+ if ((0, import_fs27.existsSync)(depPath)) {
847482
+ continue;
847480
847483
  }
847484
+ logger4.warn(`${dep} is MISSING from standalone/node_modules/ \u2014 attempting recovery`);
847485
+ if ((0, import_fs27.existsSync)(rootPnpmStore)) {
847486
+ try {
847487
+ const pnpmDirs = (0, import_fs27.readdirSync)(rootPnpmStore);
847488
+ const matchingDir = pnpmDirs.find((d5) => d5 === dep || d5.startsWith(`${dep}@`));
847489
+ if (matchingDir != null) {
847490
+ const realPkgPath = import_path58.default.join(rootPnpmStore, matchingDir, "node_modules", dep);
847491
+ if ((0, import_fs27.existsSync)(realPkgPath)) {
847492
+ logger4.debug(`Found ${dep} in .pnpm store at ${realPkgPath}, copying...`);
847493
+ (0, import_fs27.mkdirSync)(import_path58.default.dirname(depPath), { recursive: true });
847494
+ (0, import_fs27.cpSync)(realPkgPath, depPath, { recursive: true });
847495
+ if ((0, import_fs27.existsSync)(depPath)) {
847496
+ logger4.info(`Recovered ${dep} via direct copy from .pnpm store`);
847497
+ continue;
847498
+ }
847499
+ }
847500
+ }
847501
+ } catch (recoverError) {
847502
+ logger4.debug(`Recovery scan for ${dep} failed: ${recoverError}`);
847503
+ }
847504
+ }
847505
+ const symlinkEntry = symlinks.find((s9) => s9.path === import_path58.default.join("standalone", "node_modules", dep).replace(/\\/g, "/") || s9.path.endsWith(`/node_modules/${dep}`));
847506
+ if (symlinkEntry != null) {
847507
+ logger4.debug(`${dep} was a symlink: ${symlinkEntry.path} -> ${symlinkEntry.linkname} but resolution failed`);
847508
+ }
847509
+ logger4.error(`${dep} could not be recovered and will be unavailable at runtime`);
847481
847510
  }
847482
847511
  }
847483
847512
  function getLocalStorageFolder() {
@@ -849035,7 +849064,9 @@ ${err.stack}`);
849035
849064
  let serverProcess = null;
849036
849065
  let actualPort = port;
849037
849066
  const startNextJsServer = () => {
849038
- return new Promise((resolve15) => {
849067
+ return new Promise((resolve15, reject) => {
849068
+ let settled = false;
849069
+ let fallbackTimer;
849039
849070
  serverProcess = runExeca(context3.logger, "node", [serverPath], {
849040
849071
  env: env5,
849041
849072
  doNotPipeOutput: true
@@ -849047,7 +849078,11 @@ ${err.stack}`);
849047
849078
  if (portMatch != null) {
849048
849079
  actualPort = Number(portMatch[1]);
849049
849080
  }
849050
- if (output2.includes("Ready in") || output2.includes("\u2713 Ready")) {
849081
+ if (!settled && (output2.includes("Ready in") || output2.includes("\u2713 Ready"))) {
849082
+ settled = true;
849083
+ if (fallbackTimer != null) {
849084
+ clearTimeout(fallbackTimer);
849085
+ }
849051
849086
  resolve15();
849052
849087
  }
849053
849088
  };
@@ -849057,23 +849092,44 @@ ${err.stack}`);
849057
849092
  });
849058
849093
  context3.logger.debug(`Next.js standalone server started with PID: ${serverProcess.pid}`);
849059
849094
  serverProcess.on("error", (err) => {
849060
- context3.logger.debug(`Server process error: ${err.message}`);
849095
+ context3.logger.error(`Server process error: ${err.message}`);
849096
+ if (!settled) {
849097
+ settled = true;
849098
+ if (fallbackTimer != null) {
849099
+ clearTimeout(fallbackTimer);
849100
+ }
849101
+ reject(new Error(`Server process failed to start: ${err.message}`));
849102
+ }
849061
849103
  });
849062
849104
  serverProcess.on("exit", (code5, signal) => {
849063
- if (code5) {
849064
- context3.logger.debug(`Server process exited with code: ${code5}`);
849105
+ if (code5 != null && code5 !== 0) {
849106
+ context3.logger.error(`Server process exited with code: ${code5}`);
849107
+ if (!settled) {
849108
+ settled = true;
849109
+ if (fallbackTimer != null) {
849110
+ clearTimeout(fallbackTimer);
849111
+ }
849112
+ reject(new Error(`Server process exited with code ${code5}. Check the debug logs above for details.`));
849113
+ }
849065
849114
  } else if (signal) {
849066
849115
  context3.logger.debug(`Server process killed with signal: ${signal}`);
849067
849116
  } else {
849068
849117
  context3.logger.debug("Server process exited");
849069
849118
  }
849070
849119
  });
849071
- setTimeout(() => {
849072
- resolve15();
849120
+ fallbackTimer = setTimeout(() => {
849121
+ if (!settled) {
849122
+ settled = true;
849123
+ resolve15();
849124
+ }
849073
849125
  }, 1e4);
849074
849126
  });
849075
849127
  };
849076
- await startNextJsServer();
849128
+ try {
849129
+ await startNextJsServer();
849130
+ } catch (err) {
849131
+ context3.failAndThrow(`Docs preview server failed to start: ${extractErrorMessage(err)}. Run with --log-level debug for more details.`, void 0, { code: CliError.Code.InternalError });
849132
+ }
849077
849133
  watcher.on("all", async (event, targetPath, _targetPathNext) => {
849078
849134
  if (targetPath.includes(".fern/logs/") || targetPath.includes(".fern\\logs\\")) {
849079
849135
  return;
@@ -849193,7 +849249,7 @@ ${err.stack}`);
849193
849249
  process.exit(1);
849194
849250
  });
849195
849251
  process.on("beforeExit", cleanup);
849196
- context3.logger.info(`Docs preview server ready on http://localhost:${port}`);
849252
+ context3.logger.info(`Docs preview server ready on http://localhost:${actualPort}`);
849197
849253
  await new Promise(() => {
849198
849254
  });
849199
849255
  }
@@ -859581,7 +859637,7 @@ var LegacyDocsPublisher = class {
859581
859637
  previewId,
859582
859638
  disableTemplates: void 0,
859583
859639
  skipUpload,
859584
- cliVersion: "5.7.5",
859640
+ cliVersion: "5.7.6-2-g68a151c4de6",
859585
859641
  loginCommand: "fern auth login"
859586
859642
  });
859587
859643
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -904911,6 +904967,11 @@ var Expression2 = class extends AstNode8 {
904911
904967
  case "string-literal":
904912
904968
  writer2.write(this.internalExpression.escape ? `"${escapeSwiftStringLiteralContent(this.internalExpression.value)}"` : `"${this.internalExpression.value}"`);
904913
904969
  break;
904970
+ case "raw-multi-line-string-literal":
904971
+ writer2.write(`#"""
904972
+ ${this.internalExpression.value}
904973
+ """#`);
904974
+ break;
904914
904975
  case "number-literal":
904915
904976
  writer2.write(this.internalExpression.value.toString());
904916
904977
  break;
@@ -905059,6 +905120,18 @@ var Expression2 = class extends AstNode8 {
905059
905120
  static escapedStringLiteral(value2) {
905060
905121
  return new this({ type: "string-literal", value: value2, escape: true });
905061
905122
  }
905123
+ /**
905124
+ * Emits `value` as a Swift raw multi-line string literal (`#"""..."""#`).
905125
+ * Inside a raw string literal, escape sequences such as `\n` are NOT
905126
+ * interpreted by the Swift compiler -- they remain as literal
905127
+ * backslash-n characters at runtime. Use this when `value` already
905128
+ * contains escape sequences that must survive verbatim into the
905129
+ * runtime `String` (e.g. JSON payloads where `\n` must reach the
905130
+ * JSON parser as `\n`, not as a real newline).
905131
+ */
905132
+ static rawMultiLineStringLiteral(value2) {
905133
+ return new this({ type: "raw-multi-line-string-literal", value: value2 });
905134
+ }
905062
905135
  static numberLiteral(value2) {
905063
905136
  return new this({ type: "number-literal", value: value2 });
905064
905137
  }
@@ -934006,7 +934079,7 @@ var CliContext = class _CliContext {
934006
934079
  if (false) {
934007
934080
  this.logger.error("CLI_VERSION is not defined");
934008
934081
  }
934009
- return "5.7.5";
934082
+ return "5.7.6-2-g68a151c4de6";
934010
934083
  }
934011
934084
  getCliName() {
934012
934085
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.7.5",
2
+ "version": "5.7.6-2-g68a151c4de6",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",