@fern-api/fern-api-dev 5.27.0 → 5.27.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 +65 -9
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -667931,7 +667931,7 @@ var AccessTokenPosthogManager = class {
667931
667931
  properties: {
667932
667932
  ...event,
667933
667933
  ...event.properties,
667934
- version: "5.27.0",
667934
+ version: "5.27.1",
667935
667935
  usingAccessToken: true,
667936
667936
  ...getRunIdProperties()
667937
667937
  }
@@ -667995,7 +667995,7 @@ var UserPosthogManager = class {
667995
667995
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
667996
667996
  event: "CLI",
667997
667997
  properties: {
667998
- version: "5.27.0",
667998
+ version: "5.27.1",
667999
667999
  ...event,
668000
668000
  ...event.properties,
668001
668001
  usingAccessToken: false,
@@ -859567,7 +859567,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
859567
859567
  var LOGS_FOLDER_NAME = "logs";
859568
859568
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
859569
859569
  function getCliSource() {
859570
- const version7 = "5.27.0";
859570
+ const version7 = "5.27.1";
859571
859571
  return `cli@${version7}`;
859572
859572
  }
859573
859573
  var DebugLogger = class {
@@ -873540,7 +873540,7 @@ var LegacyDocsPublisher = class {
873540
873540
  previewId,
873541
873541
  disableTemplates: void 0,
873542
873542
  skipUpload,
873543
- cliVersion: "5.27.0",
873543
+ cliVersion: "5.27.1",
873544
873544
  loginCommand: "fern auth login"
873545
873545
  });
873546
873546
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -947945,7 +947945,7 @@ function getAutomationContextFromEnv() {
947945
947945
  config_branch: process.env.FERN_CONFIG_BRANCH,
947946
947946
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
947947
947947
  trigger: process.env.GITHUB_EVENT_NAME,
947948
- cli_version: "5.27.0"
947948
+ cli_version: "5.27.1"
947949
947949
  };
947950
947950
  }
947951
947951
  function isAutomationMode() {
@@ -948065,12 +948065,26 @@ function isTelemetryDisabled() {
948065
948065
  return process.env.FERN_DISABLE_TELEMETRY === "true";
948066
948066
  }
948067
948067
 
948068
+ // src/telemetry/shouldInitializeTelemetry.ts
948069
+ function shouldInitializeTelemetry({
948070
+ cliName,
948071
+ packageVersion: packageVersion3,
948072
+ isLocal
948073
+ }) {
948074
+ if (isTelemetryDisabled() || isLocal) {
948075
+ return false;
948076
+ }
948077
+ const isLocalDev = packageVersion3 === "0.0.0";
948078
+ const isProductionCli = cliName === "fern" && false;
948079
+ return !isLocalDev && isProductionCli;
948080
+ }
948081
+
948068
948082
  // src/telemetry/SentryClient.ts
948069
948083
  var SentryClient = class {
948070
948084
  sentry;
948071
- constructor({ release: release2 }) {
948085
+ constructor({ release: release2, telemetry }) {
948072
948086
  const sentryDsn = "https://84f58b5e457f06999d92f11ce4b79158@o4509504076185600.ingest.us.sentry.io/4511021546602496";
948073
- if (!isTelemetryDisabled() && sentryDsn != null && sentryDsn.length > 0) {
948087
+ if (shouldInitializeTelemetry(telemetry) && sentryDsn != null && sentryDsn.length > 0) {
948074
948088
  const sentryEnvironment = "development";
948075
948089
  if (sentryEnvironment == null || sentryEnvironment.length === 0) {
948076
948090
  throw new CliError({
@@ -948737,7 +948751,14 @@ var CliContext = class _CliContext {
948737
948751
  packageVersion: packageVersion3,
948738
948752
  cliName
948739
948753
  };
948740
- this.sentryClient = new SentryClient({ release: `cli@${this.environment.packageVersion}` });
948754
+ this.sentryClient = new SentryClient({
948755
+ release: `cli@${this.environment.packageVersion}`,
948756
+ telemetry: {
948757
+ cliName: this.environment.cliName,
948758
+ packageVersion: this.environment.packageVersion,
948759
+ isLocal: this.isLocal
948760
+ }
948761
+ });
948741
948762
  this.automationTelemetryManager = new AutomationTelemetryManager(this);
948742
948763
  }
948743
948764
  getPackageName() {
@@ -948750,7 +948771,7 @@ var CliContext = class _CliContext {
948750
948771
  if (false) {
948751
948772
  this.logger.error("CLI_VERSION is not defined");
948752
948773
  }
948753
- return "5.27.0";
948774
+ return "5.27.1";
948754
948775
  }
948755
948776
  getCliName() {
948756
948777
  if (false) {
@@ -968129,6 +968150,40 @@ function evaluateRuntime4() {
968129
968150
  };
968130
968151
  }
968131
968152
 
968153
+ // src/telemetry/processHandlers.ts
968154
+ init_lib6();
968155
+ function installProcessHandlers(cliContext, { isLocal }) {
968156
+ if (!shouldInitializeTelemetry({
968157
+ cliName: cliContext.environment.cliName,
968158
+ packageVersion: cliContext.environment.packageVersion,
968159
+ isLocal
968160
+ })) {
968161
+ return;
968162
+ }
968163
+ let isHandlingFatal = false;
968164
+ const handleFatal = async (label, error50) => {
968165
+ if (isHandlingFatal) {
968166
+ process.exit(1);
968167
+ }
968168
+ isHandlingFatal = true;
968169
+ try {
968170
+ cliContext.failWithoutThrowing(label, error50, { code: CliError.Code.InternalError });
968171
+ } catch {
968172
+ }
968173
+ try {
968174
+ await cliContext.exit({ code: 1 });
968175
+ } catch {
968176
+ process.exit(1);
968177
+ }
968178
+ };
968179
+ process.on("uncaughtException", (error50) => {
968180
+ void handleFatal("uncaught exception", error50);
968181
+ });
968182
+ process.on("unhandledRejection", (reason) => {
968183
+ void handleFatal("unhandled promise rejection", reason);
968184
+ });
968185
+ }
968186
+
968132
968187
  // src/cli.ts
968133
968188
  if (process.platform === "linux" && parseInt(process.versions.node.split(".")[0] ?? "0", 10) >= 26 && process.env.UV_USE_IO_URING !== "0") {
968134
968189
  const result = (0, import_node_child_process7.spawnSync)(process.execPath, process.argv.slice(1), {
@@ -968151,6 +968206,7 @@ async function runCli() {
968151
968206
  if (isCompletion) {
968152
968207
  cliContext.suppressUpgradeMessage();
968153
968208
  }
968209
+ installProcessHandlers(cliContext, { isLocal });
968154
968210
  const exit3 = async () => {
968155
968211
  await cliContext.exit();
968156
968212
  };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.27.0",
2
+ "version": "5.27.1",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",