@fern-api/fern-api-dev 4.87.0-13-g7ad36b0cd26 → 4.87.0-3-g02eb2a68bd2

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 +88 -124
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -615211,7 +615211,7 @@ var AccessTokenPosthogManager = class {
615211
615211
  properties: {
615212
615212
  ...event,
615213
615213
  ...event.properties,
615214
- version: "4.87.0-13-g7ad36b0cd26",
615214
+ version: "4.87.0-3-g02eb2a68bd2",
615215
615215
  usingAccessToken: true
615216
615216
  }
615217
615217
  });
@@ -615265,7 +615265,7 @@ var UserPosthogManager = class {
615265
615265
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
615266
615266
  event: "CLI",
615267
615267
  properties: {
615268
- version: "4.87.0-13-g7ad36b0cd26",
615268
+ version: "4.87.0-3-g02eb2a68bd2",
615269
615269
  ...event,
615270
615270
  ...event.properties,
615271
615271
  usingAccessToken: false,
@@ -832787,7 +832787,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
832787
832787
  var LOGS_FOLDER_NAME = "logs";
832788
832788
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
832789
832789
  function getCliSource() {
832790
- const version7 = "4.87.0-13-g7ad36b0cd26";
832790
+ const version7 = "4.87.0-3-g02eb2a68bd2";
832791
832791
  return `cli@${version7}`;
832792
832792
  }
832793
832793
  var DebugLogger = class {
@@ -844535,7 +844535,7 @@ var LegacyDocsPublisher = class {
844535
844535
  previewId,
844536
844536
  disableTemplates: void 0,
844537
844537
  skipUpload,
844538
- cliVersion: "4.87.0-13-g7ad36b0cd26"
844538
+ cliVersion: "4.87.0-3-g02eb2a68bd2"
844539
844539
  });
844540
844540
  if (taskContext.getResult() === TaskResult.Failure) {
844541
844541
  return { success: false };
@@ -919923,7 +919923,7 @@ var CliContext = class _CliContext {
919923
919923
  if (false) {
919924
919924
  this.logger.error("CLI_VERSION is not defined");
919925
919925
  }
919926
- return "4.87.0-13-g7ad36b0cd26";
919926
+ return "4.87.0-3-g02eb2a68bd2";
919927
919927
  }
919928
919928
  getCliName() {
919929
919929
  if (false) {
@@ -921643,23 +921643,6 @@ async function checkOutputDirectory(outputPath, cliContext, force) {
921643
921643
  };
921644
921644
  }
921645
921645
 
921646
- // src/commands/generate/expandGroupFilter.ts
921647
- function expandGroupFilter(groupNames, generatorsConfiguration) {
921648
- if (groupNames == null || groupNames.length === 0) {
921649
- return null;
921650
- }
921651
- const expanded = [];
921652
- for (const name2 of groupNames) {
921653
- const aliasGroups = generatorsConfiguration?.groupAliases[name2];
921654
- for (const resolved of aliasGroups ?? [name2]) {
921655
- if (!expanded.includes(resolved)) {
921656
- expanded.push(resolved);
921657
- }
921658
- }
921659
- }
921660
- return expanded;
921661
- }
921662
-
921663
921646
  // src/commands/generate/generateAPIWorkspace.ts
921664
921647
  init_lib6();
921665
921648
 
@@ -921720,91 +921703,6 @@ function resolveGroupNamesForGeneration({
921720
921703
  };
921721
921704
  }
921722
921705
 
921723
- // src/commands/generate/resolveGroupsOrFail.ts
921724
- function resolveGroupsOrFail({
921725
- groupNames,
921726
- generatorsConfiguration,
921727
- isAutomation,
921728
- context: context3
921729
- }) {
921730
- if (groupNames == null || groupNames.length === 0) {
921731
- return resolveSingleGroupOrFail({
921732
- groupName: void 0,
921733
- generatorsConfiguration,
921734
- isAutomation,
921735
- context: context3
921736
- });
921737
- }
921738
- const resolved = [];
921739
- for (const groupName of groupNames) {
921740
- for (const name2 of resolveSingleGroupOrFail({
921741
- groupName,
921742
- generatorsConfiguration,
921743
- isAutomation,
921744
- context: context3
921745
- })) {
921746
- if (!resolved.includes(name2)) {
921747
- resolved.push(name2);
921748
- }
921749
- }
921750
- }
921751
- return resolved;
921752
- }
921753
- function resolveSingleGroupOrFail({
921754
- groupName,
921755
- generatorsConfiguration,
921756
- isAutomation,
921757
- context: context3
921758
- }) {
921759
- const resolution = resolveGroupNamesForGeneration({ groupName, generatorsConfiguration, isAutomation });
921760
- if (resolution.type === "fan-out") {
921761
- return resolution.groupNames;
921762
- }
921763
- if (resolution.type === "missing-group") {
921764
- const longestGroupName = Math.max(...resolution.availableGroupNames.map((name2) => name2.length));
921765
- const currentArgs = process.argv.slice(2).join(" ");
921766
- const suggestions = resolution.availableGroupNames.map((name2) => {
921767
- const suggestedCommand = `fern ${currentArgs} --${GROUP_CLI_OPTION} ${name2}`;
921768
- return ` \u203A ${source_default.bold(name2.padEnd(longestGroupName))} ${source_default.dim(suggestedCommand)}`;
921769
- }).join("\n");
921770
- context3.failAndThrow(
921771
- `No group specified. Use the --${GROUP_CLI_OPTION} option, or set "${DEFAULT_GROUP_GENERATORS_CONFIG_KEY}" in ${GENERATORS_CONFIGURATION_FILENAME}:
921772
- ${suggestions}`,
921773
- void 0,
921774
- { code: CliError.Code.NetworkError }
921775
- );
921776
- return [];
921777
- }
921778
- if (resolution.fromDefaultGroup) {
921779
- context3.logger.info(
921780
- source_default.dim(`Using default group '${resolution.groupName}' from ${GENERATORS_CONFIGURATION_FILENAME}`)
921781
- );
921782
- }
921783
- const aliasResult = resolveGroupAlias({
921784
- name: resolution.groupName,
921785
- groupAliases: generatorsConfiguration.groupAliases,
921786
- availableGroupNames: generatorsConfiguration.groups.map((g8) => g8.groupName)
921787
- });
921788
- if (aliasResult.type === "alias-references-missing-group") {
921789
- context3.failAndThrow(
921790
- `Group alias '${aliasResult.alias}' references non-existent group '${aliasResult.missingGroupName}'. Available groups: ${aliasResult.availableGroupNames.join(", ")}`,
921791
- void 0,
921792
- { code: CliError.Code.NetworkError }
921793
- );
921794
- return [];
921795
- }
921796
- if (aliasResult.type === "unknown") {
921797
- const aliasesSuffix = aliasResult.availableAliasNames.length > 0 ? `. Available aliases: ${aliasResult.availableAliasNames.join(", ")}` : "";
921798
- context3.failAndThrow(
921799
- `'${aliasResult.name}' is not a valid group or alias. Available groups: ${aliasResult.availableGroupNames.join(", ")}${aliasesSuffix}`,
921800
- void 0,
921801
- { code: CliError.Code.NetworkError }
921802
- );
921803
- return [];
921804
- }
921805
- return aliasResult.groupNames;
921806
- }
921807
-
921808
921706
  // src/commands/generate/describeSkipReason.ts
921809
921707
  function describeSkipReason(generator, rootAutorelease) {
921810
921708
  if (!generator.automation.generate) {
@@ -921879,7 +921777,7 @@ async function generateWorkspace({
921879
921777
  workspace,
921880
921778
  projectConfig,
921881
921779
  context: context3,
921882
- groupNames,
921780
+ groupName,
921883
921781
  generatorName,
921884
921782
  generatorIndex,
921885
921783
  version: version7,
@@ -921912,7 +921810,7 @@ async function generateWorkspace({
921912
921810
  return;
921913
921811
  }
921914
921812
  const resolvedGroupNames = resolveGroupsOrFail({
921915
- groupNames,
921813
+ groupName,
921916
921814
  generatorsConfiguration: workspace.generatorsConfiguration,
921917
921815
  isAutomation: automation != null,
921918
921816
  context: context3
@@ -922055,6 +921953,60 @@ function resolveRunnableGroup({
922055
921953
  }
922056
921954
  return group;
922057
921955
  }
921956
+ function resolveGroupsOrFail({
921957
+ groupName,
921958
+ generatorsConfiguration,
921959
+ isAutomation,
921960
+ context: context3
921961
+ }) {
921962
+ const resolution = resolveGroupNamesForGeneration({ groupName, generatorsConfiguration, isAutomation });
921963
+ if (resolution.type === "fan-out") {
921964
+ return resolution.groupNames;
921965
+ }
921966
+ if (resolution.type === "missing-group") {
921967
+ const longestGroupName = Math.max(...resolution.availableGroupNames.map((name2) => name2.length));
921968
+ const currentArgs = process.argv.slice(2).join(" ");
921969
+ const suggestions = resolution.availableGroupNames.map((name2) => {
921970
+ const suggestedCommand = `fern ${currentArgs} --${GROUP_CLI_OPTION} ${name2}`;
921971
+ return ` \u203A ${source_default.bold(name2.padEnd(longestGroupName))} ${source_default.dim(suggestedCommand)}`;
921972
+ }).join("\n");
921973
+ context3.failAndThrow(
921974
+ `No group specified. Use the --${GROUP_CLI_OPTION} option, or set "${DEFAULT_GROUP_GENERATORS_CONFIG_KEY}" in ${GENERATORS_CONFIGURATION_FILENAME}:
921975
+ ${suggestions}`,
921976
+ void 0,
921977
+ { code: CliError.Code.NetworkError }
921978
+ );
921979
+ return [];
921980
+ }
921981
+ if (resolution.fromDefaultGroup) {
921982
+ context3.logger.info(
921983
+ source_default.dim(`Using default group '${resolution.groupName}' from ${GENERATORS_CONFIGURATION_FILENAME}`)
921984
+ );
921985
+ }
921986
+ const aliasResult = resolveGroupAlias({
921987
+ name: resolution.groupName,
921988
+ groupAliases: generatorsConfiguration.groupAliases,
921989
+ availableGroupNames: generatorsConfiguration.groups.map((g8) => g8.groupName)
921990
+ });
921991
+ if (aliasResult.type === "alias-references-missing-group") {
921992
+ context3.failAndThrow(
921993
+ `Group alias '${aliasResult.alias}' references non-existent group '${aliasResult.missingGroupName}'. Available groups: ${aliasResult.availableGroupNames.join(", ")}`,
921994
+ void 0,
921995
+ { code: CliError.Code.NetworkError }
921996
+ );
921997
+ return [];
921998
+ }
921999
+ if (aliasResult.type === "unknown") {
922000
+ const aliasesSuffix = aliasResult.availableAliasNames.length > 0 ? `. Available aliases: ${aliasResult.availableAliasNames.join(", ")}` : "";
922001
+ context3.failAndThrow(
922002
+ `'${aliasResult.name}' is not a valid group or alias. Available groups: ${aliasResult.availableGroupNames.join(", ")}${aliasesSuffix}`,
922003
+ void 0,
922004
+ { code: CliError.Code.NetworkError }
922005
+ );
922006
+ return [];
922007
+ }
922008
+ return aliasResult.groupNames;
922009
+ }
922058
922010
  function applyLfsOverride(group, lfsOverridePath, context3) {
922059
922011
  const baseAbsolutePath = AbsoluteFilePath2.of(resolve6(cwd(), lfsOverridePath));
922060
922012
  const languageCount = {};
@@ -922144,7 +922096,7 @@ async function generateAPIWorkspaces({
922144
922096
  project,
922145
922097
  cliContext,
922146
922098
  version: version7,
922147
- groupNames,
922099
+ groupName,
922148
922100
  generatorName,
922149
922101
  generatorIndex,
922150
922102
  shouldLogS3Url,
@@ -922186,7 +922138,7 @@ async function generateAPIWorkspaces({
922186
922138
  }
922187
922139
  await confirmOutputDirectoriesForEligibleGenerators({
922188
922140
  project,
922189
- groupNames,
922141
+ groupName,
922190
922142
  generatorName,
922191
922143
  generatorIndex,
922192
922144
  automation,
@@ -922197,7 +922149,7 @@ async function generateAPIWorkspaces({
922197
922149
  orgId: project.config.organization,
922198
922150
  command: resolvePosthogCommandLabel(automation),
922199
922151
  properties: {
922200
- workspaces: buildPosthogWorkspaces({ project, groupNames, generatorName })
922152
+ workspaces: buildPosthogWorkspaces({ project, groupName, generatorName })
922201
922153
  }
922202
922154
  });
922203
922155
  await Promise.all(
@@ -922213,7 +922165,7 @@ async function generateAPIWorkspaces({
922213
922165
  projectConfig: project.config,
922214
922166
  context: context3,
922215
922167
  version: version7,
922216
- groupNames,
922168
+ groupName,
922217
922169
  generatorName,
922218
922170
  generatorIndex,
922219
922171
  shouldLogS3Url,
@@ -922242,7 +922194,7 @@ async function generateAPIWorkspaces({
922242
922194
  }
922243
922195
  async function confirmOutputDirectoriesForEligibleGenerators({
922244
922196
  project,
922245
- groupNames,
922197
+ groupName,
922246
922198
  generatorName,
922247
922199
  generatorIndex,
922248
922200
  automation,
@@ -922250,7 +922202,7 @@ async function confirmOutputDirectoriesForEligibleGenerators({
922250
922202
  force
922251
922203
  }) {
922252
922204
  for (const workspace of project.apiWorkspaces) {
922253
- const resolvedGroupNames = expandGroupFilter(groupNames, workspace.generatorsConfiguration);
922205
+ const resolvedGroupNames = expandGroupFilter(groupName, workspace.generatorsConfiguration);
922254
922206
  const rootAutorelease = workspace.generatorsConfiguration?.rawConfiguration.autorelease;
922255
922207
  const groupsInScope = workspace.generatorsConfiguration?.groups.filter(
922256
922208
  (group) => resolvedGroupNames == null || resolvedGroupNames.includes(group.groupName)
@@ -922283,14 +922235,14 @@ async function confirmOutputDirectoriesForEligibleGenerators({
922283
922235
  }
922284
922236
  function buildPosthogWorkspaces({
922285
922237
  project,
922286
- groupNames,
922238
+ groupName,
922287
922239
  generatorName
922288
922240
  }) {
922289
922241
  return project.apiWorkspaces.map((workspace) => {
922290
- const resolvedGroupNames = expandGroupFilter(groupNames, workspace.generatorsConfiguration);
922242
+ const resolvedGroupNames = expandGroupFilter(groupName, workspace.generatorsConfiguration);
922291
922243
  return {
922292
922244
  name: workspace.workspaceName,
922293
- group: groupNames != null && groupNames.length === 1 ? groupNames[0] : groupNames,
922245
+ group: groupName,
922294
922246
  generators: workspace.generatorsConfiguration?.groups.filter((group) => resolvedGroupNames == null || resolvedGroupNames.includes(group.groupName)).map(
922295
922247
  (group) => group.generators.filter((generator) => generatorName == null || generator.name === generatorName).map((generator) => ({
922296
922248
  name: generator.name,
@@ -922302,6 +922254,19 @@ function buildPosthogWorkspaces({
922302
922254
  };
922303
922255
  });
922304
922256
  }
922257
+ function expandGroupFilter(groupName, generatorsConfiguration) {
922258
+ if (groupName == null) {
922259
+ return null;
922260
+ }
922261
+ if (generatorsConfiguration == null) {
922262
+ return [groupName];
922263
+ }
922264
+ const aliasGroups = generatorsConfiguration.groupAliases[groupName];
922265
+ if (aliasGroups != null) {
922266
+ return aliasGroups;
922267
+ }
922268
+ return [groupName];
922269
+ }
922305
922270
 
922306
922271
  // src/commands/automations/generate/GeneratorRunResult.ts
922307
922272
  function countResults(results) {
@@ -922494,7 +922459,7 @@ async function executeAutomationsGenerate({
922494
922459
  }),
922495
922460
  cliContext,
922496
922461
  version: options2.version,
922497
- groupNames: options2.group != null ? [options2.group] : void 0,
922462
+ groupName: options2.group,
922498
922463
  generatorName,
922499
922464
  generatorIndex,
922500
922465
  shouldLogS3Url: false,
@@ -939569,8 +939534,7 @@ function addGenerateCommand2(cli, cliContext) {
939569
939534
  description: "A stable identifier for the preview. Reusing the same ID overwrites the previous preview, keeping the URL stable."
939570
939535
  }).option("group", {
939571
939536
  type: "string",
939572
- array: true,
939573
- description: "The group to generate. Pass --group multiple times to generate for several groups at once."
939537
+ description: "The group to generate"
939574
939538
  }).option("generator", {
939575
939539
  type: "string",
939576
939540
  description: "The name of a specific generator to run"
@@ -939751,7 +939715,7 @@ function addGenerateCommand2(cli, cliContext) {
939751
939715
  }),
939752
939716
  cliContext,
939753
939717
  version: argv.version,
939754
- groupNames: argv.group,
939718
+ groupName: argv.group,
939755
939719
  generatorName,
939756
939720
  generatorIndex,
939757
939721
  shouldLogS3Url: argv.printZipUrl,
@@ -939774,7 +939738,7 @@ function addGenerateCommand2(cli, cliContext) {
939774
939738
  });
939775
939739
  }
939776
939740
  if (argv.docs != null) {
939777
- if (argv.group != null && argv.group.length > 0) {
939741
+ if (argv.group != null) {
939778
939742
  cliContext.logger.warn("--group is ignored when generating docs");
939779
939743
  }
939780
939744
  if (argv.generator != null) {
@@ -939811,7 +939775,7 @@ function addGenerateCommand2(cli, cliContext) {
939811
939775
  }),
939812
939776
  cliContext,
939813
939777
  version: argv.version,
939814
- groupNames: argv.group,
939778
+ groupName: argv.group,
939815
939779
  generatorName,
939816
939780
  generatorIndex,
939817
939781
  shouldLogS3Url: argv.printZipUrl,
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.87.0-13-g7ad36b0cd26",
2
+ "version": "4.87.0-3-g02eb2a68bd2",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",