@fern-api/fern-api-dev 5.92.4 → 5.93.0

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 +79 -13
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -32221,6 +32221,15 @@ var init_extractErrorMessage = __esm({
32221
32221
  }
32222
32222
  });
32223
32223
 
32224
+ // ../../commons/core-utils/lib/fernEnvVars.js
32225
+ var FERN_JAVA_SKIP_FORMATTING_ENV_VAR;
32226
+ var init_fernEnvVars = __esm({
32227
+ "../../commons/core-utils/lib/fernEnvVars.js"() {
32228
+ "use strict";
32229
+ FERN_JAVA_SKIP_FORMATTING_ENV_VAR = "FERN_JAVA_SKIP_FORMATTING";
32230
+ }
32231
+ });
32232
+
32224
32233
  // ../../commons/core-utils/lib/getDuplicates.js
32225
32234
  function getDuplicates(items) {
32226
32235
  const seen = /* @__PURE__ */ new Set();
@@ -32271,6 +32280,22 @@ var init_identity2 = __esm({
32271
32280
  }
32272
32281
  });
32273
32282
 
32283
+ // ../../commons/core-utils/lib/isEnvVarTruthy.js
32284
+ function isEnvVarTruthy(value2) {
32285
+ if (value2 == null) {
32286
+ return false;
32287
+ }
32288
+ const normalized = value2.trim().replace(/^["']|["']$/g, "").trim().toLowerCase();
32289
+ return TRUTHY_VALUES.has(normalized);
32290
+ }
32291
+ var TRUTHY_VALUES;
32292
+ var init_isEnvVarTruthy = __esm({
32293
+ "../../commons/core-utils/lib/isEnvVarTruthy.js"() {
32294
+ "use strict";
32295
+ TRUTHY_VALUES = /* @__PURE__ */ new Set(["1", "true", "yes", "on"]);
32296
+ }
32297
+ });
32298
+
32274
32299
  // ../../commons/core-utils/lib/isNonNullish.js
32275
32300
  function isNonNullish(x4) {
32276
32301
  return x4 != null;
@@ -44637,6 +44662,7 @@ __export(lib_exports, {
44637
44662
  EMPTY_ARRAY: () => EMPTY_ARRAY,
44638
44663
  EMPTY_OBJECT: () => EMPTY_OBJECT,
44639
44664
  Examples: () => examples_exports,
44665
+ FERN_JAVA_SKIP_FORMATTING_ENV_VAR: () => FERN_JAVA_SKIP_FORMATTING_ENV_VAR,
44640
44666
  MediaType: () => MediaType,
44641
44667
  PLATFORM: () => PLATFORM,
44642
44668
  SKIP_MARKER: () => SKIP_MARKER,
@@ -44658,6 +44684,7 @@ __export(lib_exports, {
44658
44684
  haveSameNullishness: () => haveSameNullishness,
44659
44685
  identity: () => identity2,
44660
44686
  isCommitSha: () => isCommitSha,
44687
+ isEnvVarTruthy: () => isEnvVarTruthy,
44661
44688
  isGitAvailable: () => isGitAvailable,
44662
44689
  isNonNullish: () => isNonNullish,
44663
44690
  isPlainObject: () => isPlainObject4,
@@ -44695,9 +44722,11 @@ var init_lib4 = __esm({
44695
44722
  init_empty();
44696
44723
  init_examples();
44697
44724
  init_extractErrorMessage();
44725
+ init_fernEnvVars();
44698
44726
  init_getDuplicates();
44699
44727
  init_gitUtils();
44700
44728
  init_identity2();
44729
+ init_isEnvVarTruthy();
44701
44730
  init_isNonNullish();
44702
44731
  init_mediaType();
44703
44732
  init_mergeWithOverrides();
@@ -575084,6 +575113,23 @@ var require_dist21 = __commonJS({
575084
575113
  }
575085
575114
  });
575086
575115
 
575116
+ // ../generation/local-generation/docker-utils/lib/buildContainerEnvVars.js
575117
+ function buildContainerEnvVars({ envVars, processEnv }) {
575118
+ const forwardedEntries = FORWARDED_ENV_VARS.filter((name2) => envVars[name2] == null).map((name2) => [name2, processEnv[name2]]).filter((entry) => entry[1] != null && entry[1] !== "");
575119
+ return {
575120
+ envVars: { ...Object.fromEntries(forwardedEntries), ...envVars },
575121
+ forwardedFromHost: forwardedEntries.map(([name2]) => name2)
575122
+ };
575123
+ }
575124
+ var FORWARDED_ENV_VARS;
575125
+ var init_buildContainerEnvVars = __esm({
575126
+ "../generation/local-generation/docker-utils/lib/buildContainerEnvVars.js"() {
575127
+ "use strict";
575128
+ init_lib4();
575129
+ FORWARDED_ENV_VARS = ["FERN_STACK_TRACK", FERN_JAVA_SKIP_FORMATTING_ENV_VAR];
575130
+ }
575131
+ });
575132
+
575087
575133
  // ../generation/local-generation/docker-utils/lib/runDocker.js
575088
575134
  async function runContainer({ logger: logger4, imageName, args = [], binds = [], envVars = {}, ports = {}, writeLogsToFile = true, removeAfterCompletion = false, runner, pull = false, platform: platform4, signal }) {
575089
575135
  const tryRun = () => tryRunContainer({
@@ -575112,9 +575158,11 @@ async function runContainer({ logger: logger4, imageName, args = [], binds = [],
575112
575158
  }
575113
575159
  }
575114
575160
  async function tryRunContainer({ logger: logger4, imageName, args, binds, envVars = {}, ports = {}, removeAfterCompletion, writeLogsToFile, runner, pull = false, platform: platform4, signal }) {
575115
- if (process.env["FERN_STACK_TRACK"]) {
575116
- envVars["FERN_STACK_TRACK"] = process.env["FERN_STACK_TRACK"];
575117
- }
575161
+ const { envVars: containerEnvVars, forwardedFromHost } = buildContainerEnvVars({
575162
+ envVars,
575163
+ processEnv: process.env
575164
+ });
575165
+ logForwardedEnvVars({ logger: logger4, containerEnvVars, forwardedFromHost });
575118
575166
  const containerArgs = [
575119
575167
  "run",
575120
575168
  "--user",
@@ -575122,7 +575170,7 @@ async function tryRunContainer({ logger: logger4, imageName, args, binds, envVar
575122
575170
  ...pull ? ["--pull", "always"] : [],
575123
575171
  ...platform4 != null ? ["--platform", platform4] : [],
575124
575172
  ...binds.flatMap((bind5) => ["-v", bind5]),
575125
- ...Object.entries(envVars).flatMap(([key2, value2]) => ["-e", `${key2}="${value2}"`]),
575173
+ ...Object.entries(containerEnvVars).flatMap(([key2, value2]) => ["-e", `${key2}="${value2}"`]),
575126
575174
  ...Object.entries(ports).flatMap(([hostPort, containerPort]) => ["-p", `${hostPort}:${containerPort}`]),
575127
575175
  removeAfterCompletion ? "--rm" : "",
575128
575176
  imageName,
@@ -575152,6 +575200,16 @@ ${stdout}
575152
575200
  ${stderr}`);
575153
575201
  }
575154
575202
  }
575203
+ function logForwardedEnvVars({ logger: logger4, containerEnvVars, forwardedFromHost }) {
575204
+ for (const name2 of forwardedFromHost) {
575205
+ logger4.info(`Forwarding ${name2}=${containerEnvVars[name2]} into the generator container`);
575206
+ }
575207
+ for (const name2 of FORWARDED_ENV_VARS) {
575208
+ if (!forwardedFromHost.includes(name2) && containerEnvVars[name2] == null) {
575209
+ logger4.debug(`${name2} is not set on the host; not forwarding it into the generator container`);
575210
+ }
575211
+ }
575212
+ }
575155
575213
  async function pullImage(imageName, runner, signal) {
575156
575214
  await loggingExeca(void 0, runner ?? "docker", ["pull", imageName], {
575157
575215
  all: true,
@@ -575189,7 +575247,12 @@ ${stderr}`);
575189
575247
  }
575190
575248
  async function execInContainer({ logger: logger4, containerId, command: command3, runner, envVars = {}, writeLogsToFile = true, reject = true }) {
575191
575249
  const containerRunner = runner ?? "docker";
575192
- const envArgs = Object.entries(envVars).flatMap(([key2, value2]) => ["-e", `${key2}=${value2}`]);
575250
+ const { envVars: containerEnvVars, forwardedFromHost } = buildContainerEnvVars({
575251
+ envVars,
575252
+ processEnv: process.env
575253
+ });
575254
+ logForwardedEnvVars({ logger: logger4, containerEnvVars, forwardedFromHost });
575255
+ const envArgs = Object.entries(containerEnvVars).flatMap(([key2, value2]) => ["-e", `${key2}=${value2}`]);
575193
575256
  const { stdout, stderr, exitCode } = await loggingExeca(logger4, containerRunner, ["exec", "--user", "root", ...envArgs, containerId, ...command3], {
575194
575257
  reject: false,
575195
575258
  all: true,
@@ -575247,6 +575310,7 @@ var init_runDocker = __esm({
575247
575310
  init_lib18();
575248
575311
  import_promises112 = require("fs/promises");
575249
575312
  import_tmp_promise13 = __toESM(require_tmp_promise(), 1);
575313
+ init_buildContainerEnvVars();
575250
575314
  runDocker = runContainer;
575251
575315
  }
575252
575316
  });
@@ -702758,7 +702822,7 @@ var AccessTokenPosthogManager = class {
702758
702822
  properties: {
702759
702823
  ...event,
702760
702824
  ...event.properties,
702761
- version: "5.92.4",
702825
+ version: "5.93.0",
702762
702826
  usingAccessToken: true,
702763
702827
  ...getRunIdProperties()
702764
702828
  }
@@ -702824,7 +702888,7 @@ var UserPosthogManager = class {
702824
702888
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
702825
702889
  event: "CLI",
702826
702890
  properties: {
702827
- version: "5.92.4",
702891
+ version: "5.93.0",
702828
702892
  ...event,
702829
702893
  ...event.properties,
702830
702894
  usingAccessToken: false,
@@ -883990,7 +884054,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
883990
884054
  var LOGS_FOLDER_NAME = "logs";
883991
884055
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
883992
884056
  function getCliSource() {
883993
- const version7 = "5.92.4";
884057
+ const version7 = "5.93.0";
883994
884058
  return `cli@${version7}`;
883995
884059
  }
883996
884060
  var DebugLogger = class {
@@ -909306,7 +909370,7 @@ var LegacyDocsPublisher = class {
909306
909370
  previewId,
909307
909371
  disableTemplates: void 0,
909308
909372
  skipUpload,
909309
- cliVersion: "5.92.4",
909373
+ cliVersion: "5.93.0",
909310
909374
  loginCommand: "fern auth login"
909311
909375
  });
909312
909376
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -935707,6 +935771,7 @@ var DynamicSnippetsGoTestGenerator = class {
935707
935771
  };
935708
935772
 
935709
935773
  // ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/java/DynamicSnippetsJavaTestGenerator.js
935774
+ init_lib4();
935710
935775
  init_lib8();
935711
935776
 
935712
935777
  // ../../../generators/java-v2/dynamic-snippets/lib/context/DynamicSnippetsGeneratorContext.js
@@ -939623,10 +939688,11 @@ var DynamicSnippetsJavaTestGenerator = class {
939623
939688
  this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
939624
939689
  }
939625
939690
  }
939626
- this.context.logger.debug("Dynamic snippets test files generated, running spotlessApply...");
939691
+ const skipFormatting = isEnvVarTruthy(process.env[FERN_JAVA_SKIP_FORMATTING_ENV_VAR]);
939692
+ this.context.logger.debug(skipFormatting ? `Dynamic snippets test files generated, skipping spotlessApply because ${FERN_JAVA_SKIP_FORMATTING_ENV_VAR} is set` : "Dynamic snippets test files generated, running spotlessApply...");
939627
939693
  const gradlewPath = join8(outputDir, RelativeFilePath2.of("gradlew"));
939628
939694
  const gradlewExists = await doesPathExist(gradlewPath, "file");
939629
- if (gradlewExists) {
939695
+ if (gradlewExists && !skipFormatting) {
939630
939696
  try {
939631
939697
  const customConfig = this.generatorConfig.customConfig;
939632
939698
  const enableProfiling = customConfig?.["enable-gradle-profiling"] === true;
@@ -976222,7 +976288,7 @@ function getAutomationContextFromEnv() {
976222
976288
  config_branch: process.env.FERN_CONFIG_BRANCH,
976223
976289
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
976224
976290
  trigger: process.env.GITHUB_EVENT_NAME,
976225
- cli_version: "5.92.4"
976291
+ cli_version: "5.93.0"
976226
976292
  };
976227
976293
  }
976228
976294
  function isAutomationMode() {
@@ -977054,7 +977120,7 @@ var CliContext = class _CliContext {
977054
977120
  if (false) {
977055
977121
  this.logger.error("CLI_VERSION is not defined");
977056
977122
  }
977057
- return "5.92.4";
977123
+ return "5.93.0";
977058
977124
  }
977059
977125
  getCliName() {
977060
977126
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.92.4",
2
+ "version": "5.93.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",