@fern-api/generator-cli 0.9.54 → 0.9.55

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.
package/dist/api.js CHANGED
@@ -10834,7 +10834,7 @@ var ReadmeGenerator = class {
10834
10834
  })
10835
10835
  );
10836
10836
  }
10837
- if (this.readmeConfig.requirements != null) {
10837
+ if (this.readmeConfig.requirements != null && this.readmeConfig.requirements.length > 0) {
10838
10838
  blocks.push(
10839
10839
  await this.generateRequirements({
10840
10840
  requirements: this.readmeConfig.requirements
package/dist/cli.js CHANGED
@@ -30446,6 +30446,9 @@ function extractErrorMessage(e) {
30446
30446
  return stringified.length > 0 ? stringified : "Unknown error";
30447
30447
  }
30448
30448
 
30449
+ // ../commons/core-utils/lib/fernEnvVars.js
30450
+ var FERN_JAVA_SKIP_FORMATTING_ENV_VAR = "FERN_JAVA_SKIP_FORMATTING";
30451
+
30449
30452
  // ../commons/path-utils/lib/convertToOsPath.js
30450
30453
  function convertToOsPath(path5) {
30451
30454
  return path5.replace(/\\/g, "/");
@@ -39242,7 +39245,7 @@ var ReadmeGenerator = class {
39242
39245
  })
39243
39246
  );
39244
39247
  }
39245
- if (this.readmeConfig.requirements != null) {
39248
+ if (this.readmeConfig.requirements != null && this.readmeConfig.requirements.length > 0) {
39246
39249
  blocks.push(
39247
39250
  await this.generateRequirements({
39248
39251
  requirements: this.readmeConfig.requirements
@@ -43885,6 +43888,28 @@ var ReplayStep = class extends BaseStep {
43885
43888
  // ../cli/generation/local-generation/docker-utils/lib/runDocker.js
43886
43889
  var import_promises18 = require("fs/promises");
43887
43890
  var import_tmp_promise3 = __toESM(require_tmp_promise(), 1);
43891
+
43892
+ // ../cli/generation/local-generation/docker-utils/lib/buildContainerEnvVars.js
43893
+ var FORWARDED_ENV_VARS = ["FERN_STACK_TRACK", FERN_JAVA_SKIP_FORMATTING_ENV_VAR];
43894
+ function buildContainerEnvVars({ envVars, processEnv }) {
43895
+ const forwardedEntries = FORWARDED_ENV_VARS.filter((name) => envVars[name] == null).map((name) => [name, processEnv[name]]).filter((entry) => entry[1] != null && entry[1] !== "");
43896
+ return {
43897
+ envVars: { ...Object.fromEntries(forwardedEntries), ...envVars },
43898
+ forwardedFromHost: forwardedEntries.map(([name]) => name)
43899
+ };
43900
+ }
43901
+
43902
+ // ../cli/generation/local-generation/docker-utils/lib/runDocker.js
43903
+ function logForwardedEnvVars({ logger, containerEnvVars, forwardedFromHost }) {
43904
+ for (const name of forwardedFromHost) {
43905
+ logger.info(`Forwarding ${name}=${containerEnvVars[name]} into the generator container`);
43906
+ }
43907
+ for (const name of FORWARDED_ENV_VARS) {
43908
+ if (!forwardedFromHost.includes(name) && containerEnvVars[name] == null) {
43909
+ logger.debug(`${name} is not set on the host; not forwarding it into the generator container`);
43910
+ }
43911
+ }
43912
+ }
43888
43913
  async function pullImage(imageName, runner, signal) {
43889
43914
  await loggingExeca(void 0, runner ?? "docker", ["pull", imageName], {
43890
43915
  all: true,
@@ -43922,7 +43947,12 @@ ${stderr}`);
43922
43947
  }
43923
43948
  async function execInContainer({ logger, containerId, command, runner, envVars = {}, writeLogsToFile = true, reject = true }) {
43924
43949
  const containerRunner = runner ?? "docker";
43925
- const envArgs = Object.entries(envVars).flatMap(([key, value]) => ["-e", `${key}=${value}`]);
43950
+ const { envVars: containerEnvVars, forwardedFromHost } = buildContainerEnvVars({
43951
+ envVars,
43952
+ processEnv: process.env
43953
+ });
43954
+ logForwardedEnvVars({ logger, containerEnvVars, forwardedFromHost });
43955
+ const envArgs = Object.entries(containerEnvVars).flatMap(([key, value]) => ["-e", `${key}=${value}`]);
43926
43956
  const { stdout, stderr, exitCode } = await loggingExeca(logger, containerRunner, ["exec", "--user", "root", ...envArgs, containerId, ...command], {
43927
43957
  reject: false,
43928
43958
  all: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fern-api/generator-cli",
3
- "version": "0.9.54",
3
+ "version": "0.9.55",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/fern-api/fern.git",