@fern-api/fern-api-dev 4.63.0 → 4.63.1

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 +60 -23
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -359558,12 +359558,12 @@ var require_cjs6 = __commonJS({
359558
359558
  target.push(buffer);
359559
359559
  };
359560
359560
  }
359561
- var import_child_process11;
359561
+ var import_child_process12;
359562
359562
  var GitExecutorChain2;
359563
359563
  var init_git_executor_chain2 = __esm3({
359564
359564
  "src/lib/runners/git-executor-chain.ts"() {
359565
359565
  "use strict";
359566
- import_child_process11 = require("child_process");
359566
+ import_child_process12 = require("child_process");
359567
359567
  init_git_error2();
359568
359568
  init_task2();
359569
359569
  init_utils9();
@@ -359713,7 +359713,7 @@ var require_cjs6 = __commonJS({
359713
359713
  rejection = reason || rejection;
359714
359714
  }
359715
359715
  });
359716
- const spawned = (0, import_child_process11.spawn)(command3, args, spawnOptions);
359716
+ const spawned = (0, import_child_process12.spawn)(command3, args, spawnOptions);
359717
359717
  spawned.stdout.on(
359718
359718
  "data",
359719
359719
  onDataReceived2(stdOut, "stdOut", logger4, outputLogger.step("stdOut"))
@@ -603120,7 +603120,7 @@ var AccessTokenPosthogManager = class {
603120
603120
  properties: {
603121
603121
  ...event,
603122
603122
  ...event.properties,
603123
- version: "4.63.0",
603123
+ version: "4.63.1",
603124
603124
  usingAccessToken: true
603125
603125
  }
603126
603126
  });
@@ -603171,7 +603171,7 @@ var UserPosthogManager = class {
603171
603171
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
603172
603172
  event: "CLI",
603173
603173
  properties: {
603174
- version: "4.63.0",
603174
+ version: "4.63.1",
603175
603175
  ...event,
603176
603176
  ...event.properties,
603177
603177
  usingAccessToken: false,
@@ -838081,6 +838081,7 @@ async function getPorts(options2) {
838081
838081
  init_lib4();
838082
838082
  init_js();
838083
838083
  init_lib6();
838084
+ var import_child_process6 = require("child_process");
838084
838085
  var import_cors = __toESM(require_lib14(), 1);
838085
838086
  var import_express2 = __toESM(require_express3(), 1);
838086
838087
  var import_fs25 = __toESM(require("fs"), 1);
@@ -839763,7 +839764,7 @@ var import_path54 = __toESM(require("path"), 1);
839763
839764
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
839764
839765
  var LOGS_FOLDER_NAME = "logs";
839765
839766
  function getCliSource() {
839766
- const version7 = "4.63.0";
839767
+ const version7 = "4.63.1";
839767
839768
  return `cli@${version7}`;
839768
839769
  }
839769
839770
  var DebugLogger = class {
@@ -840953,6 +840954,33 @@ function cleanFernDocsCacheSync(bundleRoot, context3) {
840953
840954
  context3.logger.debug(`Failed to clean Fern Docs cache: ${err}`);
840954
840955
  }
840955
840956
  }
840957
+ function killProcessesOnPort(targetPort, context3) {
840958
+ context3.logger.debug(`Killing any leftover processes on port ${targetPort}`);
840959
+ const isWindows = process.platform === "win32";
840960
+ const command3 = isWindows ? `netstat -ano | findstr :${targetPort} | findstr LISTENING` : `lsof -ti tcp:${targetPort}`;
840961
+ try {
840962
+ const output2 = (0, import_child_process6.execSync)(command3, { encoding: "utf-8", timeout: 5e3 });
840963
+ let pids;
840964
+ if (isWindows) {
840965
+ pids = output2.trim().split("\n").map((line) => line.trim().split(/\s+/).pop() ?? "").filter((pid) => pid.length > 0 && pid !== String(process.pid));
840966
+ pids = [...new Set(pids)];
840967
+ } else {
840968
+ pids = output2.trim().split("\n").map((pid) => pid.trim()).filter((pid) => pid.length > 0 && pid !== String(process.pid));
840969
+ }
840970
+ for (const pid of pids) {
840971
+ try {
840972
+ context3.logger.debug(`Killing leftover process ${pid} on port ${targetPort}`);
840973
+ if (isWindows) {
840974
+ (0, import_child_process6.execSync)(`taskkill /F /PID ${pid}`, { timeout: 5e3 });
840975
+ } else {
840976
+ process.kill(Number(pid), "SIGKILL");
840977
+ }
840978
+ } catch {
840979
+ }
840980
+ }
840981
+ } catch {
840982
+ }
840983
+ }
840956
840984
  async function runAppPreviewServer({ initialProject, reloadProject, validateProject, context: context3, port, bundlePath, backendPort, forceDownload }) {
840957
840985
  if (forceDownload) {
840958
840986
  const appPreviewFolder = getPathToPreviewFolder({ app: true });
@@ -841234,6 +841262,7 @@ ${err.stack}`);
841234
841262
  NODE_OPTIONS: "--max-old-space-size=8096 --enable-source-maps"
841235
841263
  };
841236
841264
  let serverProcess = null;
841265
+ let actualPort = port;
841237
841266
  const startNextJsServer = () => {
841238
841267
  return new Promise((resolve13) => {
841239
841268
  serverProcess = runExeca(context3.logger, "node", [serverPath], {
@@ -841243,6 +841272,10 @@ ${err.stack}`);
841243
841272
  const checkReady = (data2) => {
841244
841273
  const output2 = data2.toString();
841245
841274
  context3.logger.debug(`[Next.js] ${output2}`);
841275
+ const portMatch = output2.match(/localhost:(\d+)/);
841276
+ if (portMatch != null) {
841277
+ actualPort = Number(portMatch[1]);
841278
+ }
841246
841279
  if (output2.includes("Ready in") || output2.includes("\u2713 Ready")) {
841247
841280
  resolve13();
841248
841281
  }
@@ -841343,6 +841376,7 @@ ${err.stack}`);
841343
841376
  context3.logger.error(`Failed to kill server process: ${err}`);
841344
841377
  }
841345
841378
  }
841379
+ killProcessesOnPort(actualPort, context3);
841346
841380
  cleanFernDocsCacheSync(bundleRoot, context3);
841347
841381
  context3.logger.debug("Cleaning up WebSocket connections...");
841348
841382
  for (const [ws8, metadata] of connections) {
@@ -850637,6 +850671,9 @@ async function generateLanguageSpecificDynamicIRs({ workspace, organization, con
850637
850671
  if (generatorInvocation.language === "php" && generatorInvocation.config && typeof generatorInvocation.config === "object" && "packageName" in generatorInvocation.config) {
850638
850672
  packageName = generatorInvocation.config.packageName ?? "";
850639
850673
  }
850674
+ if (generatorInvocation.language === "go" && packageName) {
850675
+ packageName = normalizeGoPackageForLookup(packageName);
850676
+ }
850640
850677
  if (!generatorInvocation.language) {
850641
850678
  continue;
850642
850679
  }
@@ -850878,7 +850915,7 @@ var LegacyDocsPublisher = class {
850878
850915
  previewId,
850879
850916
  disableTemplates: void 0,
850880
850917
  skipUpload,
850881
- cliVersion: "4.63.0"
850918
+ cliVersion: "4.63.1"
850882
850919
  });
850883
850920
  if (taskContext.getResult() === TaskResult.Failure) {
850884
850921
  return { success: false };
@@ -851956,7 +851993,7 @@ components:
851956
851993
  // ../cli-v2/lib/init/Wizard.js
851957
851994
  init_lib4();
851958
851995
  init_lib6();
851959
- var import_child_process6 = require("child_process");
851996
+ var import_child_process7 = require("child_process");
851960
851997
  var import_path58 = __toESM(require("path"), 1);
851961
851998
 
851962
851999
  // ../cli-v2/lib/ui/withSpinner.js
@@ -852598,7 +852635,7 @@ var Wizard = class {
852598
852635
  */
852599
852636
  openMacOsFinderDialog() {
852600
852637
  try {
852601
- const result = (0, import_child_process6.execSync)(`osascript -e 'POSIX path of (choose file with prompt "Select your API spec:" of type {"json", "yml", "yaml"})'`, { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] });
852638
+ const result = (0, import_child_process7.execSync)(`osascript -e 'POSIX path of (choose file with prompt "Select your API spec:" of type {"json", "yml", "yaml"})'`, { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] });
852602
852639
  return result.trim();
852603
852640
  } catch {
852604
852641
  return void 0;
@@ -852764,7 +852801,7 @@ function addCreateCommand(cli) {
852764
852801
  }
852765
852802
 
852766
852803
  // ../cli-v2/lib/commands/org/list/command.js
852767
- var import_child_process7 = require("child_process");
852804
+ var import_child_process8 = require("child_process");
852768
852805
  var ListCommand = class {
852769
852806
  async handle(context3) {
852770
852807
  const token = await context3.getTokenOrPrompt();
@@ -852875,7 +852912,7 @@ var ListCommand = class {
852875
852912
  getPager() {
852876
852913
  const defaultPager = process.platform === "win32" ? "more" : "less";
852877
852914
  const pagerCmd = process.env.PAGER ?? defaultPager;
852878
- return (0, import_child_process7.spawn)(pagerCmd, {
852915
+ return (0, import_child_process8.spawn)(pagerCmd, {
852879
852916
  stdio: ["pipe", "inherit", "inherit"],
852880
852917
  env: {
852881
852918
  ...process.env,
@@ -884892,7 +884929,7 @@ var DynamicTypeLiteralMapper3 = class {
884892
884929
  const errorsBefore = this.context.errors.size();
884893
884930
  try {
884894
884931
  const instantiation = this.convert({ typeReference: typeReference2, value });
884895
- if (python_exports2.TypeInstantiation.isNop(instantiation)) {
884932
+ if (python_exports2.TypeInstantiation.isNop(instantiation) || this.context.errors.size() > errorsBefore) {
884896
884933
  this.context.errors.truncate(errorsBefore);
884897
884934
  continue;
884898
884935
  }
@@ -889294,10 +889331,10 @@ function generateDefaultCrateName(organization, apiName) {
889294
889331
  }
889295
889332
 
889296
889333
  // ../../../generators/rust/base/lib/formatter/RustFormatter.js
889297
- var import_child_process8 = require("child_process");
889334
+ var import_child_process9 = require("child_process");
889298
889335
  function formatRustSnippet(code5, logger4) {
889299
889336
  try {
889300
- const result = (0, import_child_process8.spawnSync)("rustfmt", ["--edition=2021"], {
889337
+ const result = (0, import_child_process9.spawnSync)("rustfmt", ["--edition=2021"], {
889301
889338
  input: code5,
889302
889339
  encoding: "utf8",
889303
889340
  timeout: 5e3
@@ -889316,7 +889353,7 @@ function formatRustSnippet(code5, logger4) {
889316
889353
  }
889317
889354
  async function formatRustSnippetAsync(code5, logger4) {
889318
889355
  return new Promise((resolve13) => {
889319
- const rustfmt = (0, import_child_process8.spawn)("rustfmt", ["--edition=2021"], {
889356
+ const rustfmt = (0, import_child_process9.spawn)("rustfmt", ["--edition=2021"], {
889320
889357
  stdio: "pipe"
889321
889358
  });
889322
889359
  rustfmt.stdin.write(code5);
@@ -902802,11 +902839,11 @@ generators:
902802
902839
  await fs18.mkdir(absolutePathToLocalOutput, { recursive: true });
902803
902840
  interactiveTaskContext.logger.debug(`Self-hosted GitHub mode: cloning ${selfhostedGithubConfig.uri} to ${absolutePathToLocalOutput}`);
902804
902841
  try {
902805
- const { execSync: execSync5 } = await import("child_process");
902806
- const gitPath = execSync5("which git 2>/dev/null || echo 'not found'", {
902842
+ const { execSync: execSync6 } = await import("child_process");
902843
+ const gitPath = execSync6("which git 2>/dev/null || echo 'not found'", {
902807
902844
  encoding: "utf-8"
902808
902845
  }).trim();
902809
- const gitVersion = execSync5("git --version 2>/dev/null || echo 'unknown'", {
902846
+ const gitVersion = execSync6("git --version 2>/dev/null || echo 'unknown'", {
902810
902847
  encoding: "utf-8"
902811
902848
  }).trim();
902812
902849
  interactiveTaskContext.logger.debug(`Git environment: path=${gitPath}, version=${gitVersion}, PATH=${process.env.PATH ?? "unset"}`);
@@ -924224,7 +924261,7 @@ var CliContext = class {
924224
924261
  if (false) {
924225
924262
  this.logger.error("CLI_VERSION is not defined");
924226
924263
  }
924227
- return "4.63.0";
924264
+ return "4.63.1";
924228
924265
  }
924229
924266
  getCliName() {
924230
924267
  if (false) {
@@ -935761,9 +935798,9 @@ function getAIEnhancerConfig2() {
935761
935798
  // src/commands/sdk-diff/sdkDiffCommand.ts
935762
935799
  init_lib4();
935763
935800
  init_lib6();
935764
- var import_child_process9 = require("child_process");
935801
+ var import_child_process10 = require("child_process");
935765
935802
  var import_util70 = require("util");
935766
- var execAsync = (0, import_util70.promisify)(import_child_process9.exec);
935803
+ var execAsync = (0, import_util70.promisify)(import_child_process10.exec);
935767
935804
  async function getClientRegistry(context3, project) {
935768
935805
  const workspace = project.apiWorkspaces[0];
935769
935806
  if (workspace == null) {
@@ -935943,10 +935980,10 @@ function computePreviewVersion({ previewId }) {
935943
935980
  }
935944
935981
 
935945
935982
  // src/commands/sdk-preview/getPreviewId.ts
935946
- var import_child_process10 = require("child_process");
935983
+ var import_child_process11 = require("child_process");
935947
935984
  var import_crypto12 = require("crypto");
935948
935985
  var import_util71 = require("util");
935949
- var execAsync2 = (0, import_util71.promisify)(import_child_process10.exec);
935986
+ var execAsync2 = (0, import_util71.promisify)(import_child_process11.exec);
935950
935987
  var MAX_PREVIEW_ID_LENGTH = 40;
935951
935988
  async function getPreviewId() {
935952
935989
  try {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.63.0",
2
+ "version": "4.63.1",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",