@fern-api/fern-api-dev 3.95.6-17-ge0091fa472c → 3.96.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 +50 -14
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -577369,7 +577369,7 @@ var AccessTokenPosthogManager = class {
577369
577369
  properties: {
577370
577370
  ...event,
577371
577371
  ...event.properties,
577372
- version: "3.95.6-17-ge0091fa472c",
577372
+ version: "3.96.0",
577373
577373
  usingAccessToken: true
577374
577374
  }
577375
577375
  });
@@ -577478,7 +577478,7 @@ var UserPosthogManager = class {
577478
577478
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
577479
577479
  event: "CLI",
577480
577480
  properties: {
577481
- version: "3.95.6-17-ge0091fa472c",
577481
+ version: "3.96.0",
577482
577482
  ...event,
577483
577483
  ...event.properties,
577484
577484
  usingAccessToken: false,
@@ -639698,6 +639698,20 @@ init_lib5();
639698
639698
  init_lib6();
639699
639699
  init_lib5();
639700
639700
  init_lodash();
639701
+ function camelCasePreservingUnderscores(name3) {
639702
+ const leadingMatch = name3.match(/^(_+)/);
639703
+ const trailingMatch = name3.match(/(_+)$/);
639704
+ const leading = leadingMatch?.[1] ?? "";
639705
+ const trailing = trailingMatch?.[1] ?? "";
639706
+ if (leading === "" && trailing === "") {
639707
+ return camelCase_default(name3);
639708
+ }
639709
+ if (leading.length + trailing.length >= name3.length) {
639710
+ return name3;
639711
+ }
639712
+ const core3 = name3.slice(leading.length, name3.length - trailing.length || void 0);
639713
+ return `${leading}${camelCase_default(core3)}${trailing}`;
639714
+ }
639701
639715
  function cleanSdkGroupName(groupName) {
639702
639716
  const maybeNamespace = groupName.find((group) => typeof group === "object" && group.type === "namespace");
639703
639717
  const noNamespace = groupName.filter((group) => typeof group === "string" || group.type !== "namespace");
@@ -639711,12 +639725,12 @@ function convertSdkGroupNameToFileWithoutExtension(groupName) {
639711
639725
  const fileNames = [];
639712
639726
  for (const [index3, group] of cleanedGroupName.entries()) {
639713
639727
  if (typeof group === "string") {
639714
- fileNames.push(camelCase_default(group));
639728
+ fileNames.push(camelCasePreservingUnderscores(group));
639715
639729
  } else if (typeof group === "object") {
639716
639730
  switch (group.type) {
639717
639731
  case "namespace": {
639718
639732
  if (index3 < cleanedGroupName.length - 1) {
639719
- fileNames.push(camelCase_default(group.name));
639733
+ fileNames.push(camelCasePreservingUnderscores(group.name));
639720
639734
  } else {
639721
639735
  fileNames.push(...[group.name, FERN_PACKAGE_MARKER_FILENAME_NO_EXTENSION]);
639722
639736
  }
@@ -666568,13 +666582,16 @@ function constructCasingsGenerator({ generationLanguage, keywords: keywords3, sm
666568
666582
  keywords: getKeywords({ generationLanguage, keywords: keywords3 })
666569
666583
  })
666570
666584
  });
666571
- let camelCaseName = camelCase_default(name3);
666572
- let pascalCaseName = upperFirst_default(camelCaseName);
666573
- let snakeCaseName = snakeCase_default(name3);
666585
+ const preserve = opts?.preserveUnderscores === true;
666586
+ const applyCasing = preserve ? (n6, fn4) => withUnderscorePreservation(n6, fn4) : (_n3, fn4) => fn4(_n3);
666587
+ let camelCaseName = applyCasing(name3, camelCase_default);
666588
+ let pascalCaseName = preserve ? withUnderscorePreservation(name3, (n6) => upperFirst_default(camelCase_default(n6))) : upperFirst_default(camelCaseName);
666589
+ let snakeCaseName = applyCasing(name3, snakeCase_default);
666590
+ const { leading: nameLeading, trailing: nameTrailing } = preserve ? extractUnderscoreAffixes(name3) : { leading: "", trailing: "" };
666574
666591
  const camelCaseWords = words_default(camelCaseName);
666575
666592
  if (smartCasing) {
666576
666593
  if (!hasAdjacentCommonInitialisms(camelCaseWords) && (generationLanguage == null || CAPITALIZE_INITIALISM.includes(generationLanguage))) {
666577
- camelCaseName = camelCaseWords.map((word, index3) => {
666594
+ camelCaseName = nameLeading + camelCaseWords.map((word, index3) => {
666578
666595
  if (index3 > 0) {
666579
666596
  const pluralInitialism = maybeGetPluralInitialism(word);
666580
666597
  if (pluralInitialism != null) {
@@ -666585,8 +666602,8 @@ function constructCasingsGenerator({ generationLanguage, keywords: keywords3, sm
666585
666602
  }
666586
666603
  }
666587
666604
  return word;
666588
- }).join("");
666589
- pascalCaseName = upperFirst_default(camelCaseWords.map((word, index3) => {
666605
+ }).join("") + nameTrailing;
666606
+ pascalCaseName = upperFirst_default(nameLeading + camelCaseWords.map((word, index3) => {
666590
666607
  const pluralInitialism = maybeGetPluralInitialism(word);
666591
666608
  if (pluralInitialism != null) {
666592
666609
  return pluralInitialism;
@@ -666598,9 +666615,10 @@ function constructCasingsGenerator({ generationLanguage, keywords: keywords3, sm
666598
666615
  return upperFirst_default(word);
666599
666616
  }
666600
666617
  return word;
666601
- }).join(""));
666618
+ }).join("") + nameTrailing);
666602
666619
  }
666603
- snakeCaseName = name3.split(" ").map((part) => part.split(/(\d+)/).map(snakeCase_default).join("")).join("_");
666620
+ const smartSnakeFn = (n6) => n6.split(" ").map((part) => part.split(/(\d+)/).map(snakeCase_default).join("")).join("_");
666621
+ snakeCaseName = preserve ? withUnderscorePreservation(name3, smartSnakeFn) : smartSnakeFn(name3);
666604
666622
  }
666605
666623
  return {
666606
666624
  originalName: inputName,
@@ -666723,6 +666741,24 @@ var NAME_PREPROCESSOR_REPLACEMENTS = [
666723
666741
  function preprocessName(name3) {
666724
666742
  return NAME_PREPROCESSOR_REPLACEMENTS.reduce((result, [pattern, replacement]) => result.replace(pattern, replacement), name3);
666725
666743
  }
666744
+ function extractUnderscoreAffixes(name3) {
666745
+ const leadingMatch = name3.match(/^(_+)/);
666746
+ const trailingMatch = name3.match(/(_+)$/);
666747
+ const leading = leadingMatch?.[1] ?? "";
666748
+ const trailing = trailingMatch?.[1] ?? "";
666749
+ if (leading.length + trailing.length >= name3.length) {
666750
+ return { leading: name3, trailing: "", core: "" };
666751
+ }
666752
+ const core3 = name3.slice(leading.length, name3.length - trailing.length || void 0);
666753
+ return { leading, trailing, core: core3 };
666754
+ }
666755
+ function withUnderscorePreservation(name3, casingFn) {
666756
+ const { leading, trailing, core: core3 } = extractUnderscoreAffixes(name3);
666757
+ if (leading === "" && trailing === "") {
666758
+ return casingFn(name3);
666759
+ }
666760
+ return `${leading}${casingFn(core3)}${trailing}`;
666761
+ }
666726
666762
 
666727
666763
  // ../generation/ir-generator/lib/utils/getAllPropertiesForObject.js
666728
666764
  var CASINGS_GENERATOR = constructCasingsGenerator({
@@ -763363,7 +763399,7 @@ var import_path40 = __toESM(require("path"), 1);
763363
763399
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
763364
763400
  var LOGS_FOLDER_NAME = "logs";
763365
763401
  function getCliSource() {
763366
- const version7 = "3.95.6-17-ge0091fa472c";
763402
+ const version7 = "3.96.0";
763367
763403
  return `cli@${version7}`;
763368
763404
  }
763369
763405
  var DebugLogger = class {
@@ -1127069,7 +1127105,7 @@ var CliContext = class {
1127069
1127105
  if (false) {
1127070
1127106
  this.logger.error("CLI_VERSION is not defined");
1127071
1127107
  }
1127072
- return "3.95.6-17-ge0091fa472c";
1127108
+ return "3.96.0";
1127073
1127109
  }
1127074
1127110
  getCliName() {
1127075
1127111
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.95.6-17-ge0091fa472c",
2
+ "version": "3.96.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",