@fern-api/fern-api-dev 5.105.0 → 5.105.2

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 +49 -6
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -236012,6 +236012,48 @@ async function getDefaultRemote({ repoRoot, context: context3 }) {
236012
236012
  const remotes = result.stdout.split("\n").map((line) => line.trim());
236013
236013
  return remotes.includes("origin") ? "origin" : remotes[0];
236014
236014
  }
236015
+ async function worktreeContainsGitLfsPointers({ worktreePath, ref: ref2, sha, context: context3 }) {
236016
+ const result = await runGit({
236017
+ args: ["grep", "-l", "-I", "-e", "^version https://git-lfs.github.com/spec/v1$", "--", "."],
236018
+ cwd: worktreePath,
236019
+ context: context3
236020
+ });
236021
+ if (result.exitCode === 0) {
236022
+ return true;
236023
+ }
236024
+ if (result.exitCode === 1) {
236025
+ return false;
236026
+ }
236027
+ throw new CliError({
236028
+ message: `Failed to inspect git ref '${ref2}' (${sha}) for Git LFS pointers: ${result.stderr || result.stdout}`,
236029
+ code: CliError.Code.ConfigError
236030
+ });
236031
+ }
236032
+ async function materializeGitLfsFiles({ worktreePath, ref: ref2, sha, context: context3 }) {
236033
+ if (!await worktreeContainsGitLfsPointers({ worktreePath, ref: ref2, sha, context: context3 })) {
236034
+ return;
236035
+ }
236036
+ const remote = await getDefaultRemote({ repoRoot: worktreePath, context: context3 });
236037
+ const pullResult = await runGit({
236038
+ args: remote != null ? ["lfs", "pull", "--include=*", "--exclude=", remote] : ["lfs", "checkout"],
236039
+ cwd: worktreePath,
236040
+ context: context3
236041
+ });
236042
+ if (pullResult.exitCode !== 0) {
236043
+ const output2 = pullResult.stderr || pullResult.stdout;
236044
+ const gitLfsUnavailable = output2.includes("'lfs' is not a git command");
236045
+ throw new CliError({
236046
+ message: gitLfsUnavailable ? `Git LFS is required to materialize files for git ref '${ref2}' (${sha}). Install Git LFS and retry.` : `Failed to materialize Git LFS files for git ref '${ref2}' (${sha}): ${output2}`,
236047
+ code: CliError.Code.ConfigError
236048
+ });
236049
+ }
236050
+ if (await worktreeContainsGitLfsPointers({ worktreePath, ref: ref2, sha, context: context3 })) {
236051
+ throw new CliError({
236052
+ message: `Git LFS files for git ref '${ref2}' (${sha}) could not be materialized. Ensure the required LFS objects are available from the configured git remote.`,
236053
+ code: CliError.Code.ConfigError
236054
+ });
236055
+ }
236056
+ }
236015
236057
  async function tryResolveSha({ repoRoot, ref: ref2, context: context3 }) {
236016
236058
  const result = await runGit({
236017
236059
  // `--end-of-options` terminates option parsing so a ref beginning with `-` cannot be read as
@@ -236127,6 +236169,7 @@ async function materializeGitRef({ ref: ref2, absolutePathToFernFolder, context:
236127
236169
  code: CliError.Code.ConfigError
236128
236170
  });
236129
236171
  }
236172
+ await materializeGitLfsFiles({ worktreePath, ref: ref2, sha, context: context3 });
236130
236173
  const materialized = {
236131
236174
  ref: ref2,
236132
236175
  sha,
@@ -704474,7 +704517,7 @@ var AccessTokenPosthogManager = class {
704474
704517
  properties: {
704475
704518
  ...event,
704476
704519
  ...event.properties,
704477
- version: "5.105.0",
704520
+ version: "5.105.2",
704478
704521
  usingAccessToken: true,
704479
704522
  ...getRunIdProperties()
704480
704523
  }
@@ -704540,7 +704583,7 @@ var UserPosthogManager = class {
704540
704583
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
704541
704584
  event: "CLI",
704542
704585
  properties: {
704543
- version: "5.105.0",
704586
+ version: "5.105.2",
704544
704587
  ...event,
704545
704588
  ...event.properties,
704546
704589
  usingAccessToken: false,
@@ -885923,7 +885966,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
885923
885966
  var LOGS_FOLDER_NAME = "logs";
885924
885967
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
885925
885968
  function getCliSource() {
885926
- const version7 = "5.105.0";
885969
+ const version7 = "5.105.2";
885927
885970
  return `cli@${version7}`;
885928
885971
  }
885929
885972
  var DebugLogger = class {
@@ -912009,7 +912052,7 @@ var LegacyDocsPublisher = class {
912009
912052
  previewId,
912010
912053
  disableTemplates: void 0,
912011
912054
  skipUpload,
912012
- cliVersion: "5.105.0",
912055
+ cliVersion: "5.105.2",
912013
912056
  loginCommand: "fern auth login"
912014
912057
  });
912015
912058
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -979384,7 +979427,7 @@ function getAutomationContextFromEnv() {
979384
979427
  config_branch: process.env.FERN_CONFIG_BRANCH,
979385
979428
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
979386
979429
  trigger: process.env.GITHUB_EVENT_NAME,
979387
- cli_version: "5.105.0"
979430
+ cli_version: "5.105.2"
979388
979431
  };
979389
979432
  }
979390
979433
  function isAutomationMode() {
@@ -980216,7 +980259,7 @@ var CliContext = class _CliContext {
980216
980259
  if (false) {
980217
980260
  this.logger.error("CLI_VERSION is not defined");
980218
980261
  }
980219
- return "5.105.0";
980262
+ return "5.105.2";
980220
980263
  }
980221
980264
  getCliName() {
980222
980265
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.105.0",
2
+ "version": "5.105.2",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",