@fern-api/fern-api-dev 4.74.0-11-g4d0b805a133 → 4.74.0-3-g63dec7747b5

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 +60 -134
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -621394,7 +621394,7 @@ var AccessTokenPosthogManager = class {
621394
621394
  properties: {
621395
621395
  ...event,
621396
621396
  ...event.properties,
621397
- version: "4.74.0-11-g4d0b805a133",
621397
+ version: "4.74.0-3-g63dec7747b5",
621398
621398
  usingAccessToken: true
621399
621399
  }
621400
621400
  });
@@ -621448,7 +621448,7 @@ var UserPosthogManager = class {
621448
621448
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
621449
621449
  event: "CLI",
621450
621450
  properties: {
621451
- version: "4.74.0-11-g4d0b805a133",
621451
+ version: "4.74.0-3-g63dec7747b5",
621452
621452
  ...event,
621453
621453
  ...event.properties,
621454
621454
  usingAccessToken: false,
@@ -838658,7 +838658,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
838658
838658
  var LOGS_FOLDER_NAME = "logs";
838659
838659
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
838660
838660
  function getCliSource() {
838661
- const version7 = "4.74.0-11-g4d0b805a133";
838661
+ const version7 = "4.74.0-3-g63dec7747b5";
838662
838662
  return `cli@${version7}`;
838663
838663
  }
838664
838664
  var DebugLogger = class {
@@ -849958,7 +849958,7 @@ var LegacyDocsPublisher = class {
849958
849958
  previewId,
849959
849959
  disableTemplates: void 0,
849960
849960
  skipUpload,
849961
- cliVersion: "4.74.0-11-g4d0b805a133"
849961
+ cliVersion: "4.74.0-3-g63dec7747b5"
849962
849962
  });
849963
849963
  if (taskContext.getResult() === TaskResult.Failure) {
849964
849964
  return { success: false };
@@ -924416,7 +924416,7 @@ var CliContext = class _CliContext {
924416
924416
  if (false) {
924417
924417
  this.logger.error("CLI_VERSION is not defined");
924418
924418
  }
924419
- return "4.74.0-11-g4d0b805a133";
924419
+ return "4.74.0-3-g63dec7747b5";
924420
924420
  }
924421
924421
  getCliName() {
924422
924422
  if (false) {
@@ -936585,98 +936585,39 @@ function overrideGroupOutputForPreview({
936585
936585
  group,
936586
936586
  packageName,
936587
936587
  token,
936588
- registryUrl: registryUrl2
936589
- }) {
936590
- const modifiedGenerators = group.generators.map((generator) => ({
936591
- ...generator,
936592
- outputMode: createNpmOverrideOutputMode({ registryUrl: registryUrl2, packageName, token }),
936593
- absolutePathToLocalOutput: void 0
936594
- }));
936595
- return {
936596
- ...group,
936597
- generators: modifiedGenerators
936598
- };
936599
- }
936600
- function getGithubPublishInfoWithoutToken(outputMode) {
936601
- const publishInfo = outputMode._visit({
936602
- downloadFiles: () => void 0,
936603
- github: () => void 0,
936604
- githubV2: (val) => val._visit({
936605
- push: (v23) => v23.publishInfo,
936606
- commitAndRelease: (v23) => v23.publishInfo,
936607
- pullRequest: (v23) => v23.publishInfo,
936608
- _other: () => void 0
936609
- }),
936610
- publish: () => void 0,
936611
- publishV2: () => void 0,
936612
- _other: () => void 0
936613
- });
936614
- if (publishInfo == null) {
936615
- return void 0;
936616
- }
936617
- return stripPublishInfoCredentials(publishInfo);
936618
- }
936619
- function stripPublishInfoCredentials(publishInfo) {
936620
- return publishInfo._visit({
936621
- npm: (val) => api_exports5.GithubPublishInfo.npm({
936622
- registryUrl: val.registryUrl,
936623
- packageName: val.packageName,
936624
- token: void 0
936625
- }),
936626
- maven: (val) => api_exports5.GithubPublishInfo.maven({
936627
- registryUrl: val.registryUrl,
936628
- coordinate: val.coordinate,
936629
- credentials: void 0,
936630
- signature: void 0
936631
- }),
936632
- postman: () => void 0,
936633
- pypi: (val) => api_exports5.GithubPublishInfo.pypi({
936634
- registryUrl: val.registryUrl,
936635
- packageName: val.packageName,
936636
- credentials: void 0,
936637
- pypiMetadata: val.pypiMetadata
936638
- }),
936639
- nuget: (val) => api_exports5.GithubPublishInfo.nuget({
936640
- registryUrl: val.registryUrl,
936641
- packageName: val.packageName,
936642
- apiKey: void 0
936643
- }),
936644
- rubygems: (val) => api_exports5.GithubPublishInfo.rubygems({
936645
- registryUrl: val.registryUrl,
936646
- packageName: val.packageName,
936647
- apiKey: void 0
936648
- }),
936649
- crates: (val) => api_exports5.GithubPublishInfo.crates({
936650
- registryUrl: val.registryUrl,
936651
- packageName: val.packageName,
936652
- token: void 0
936653
- }),
936654
- _other: () => void 0
936655
- });
936656
- }
936657
- function overrideGroupOutputForDiffBranch({
936658
- group
936588
+ registryUrl: registryUrl2,
936589
+ pushDiff
936659
936590
  }) {
936660
936591
  const modifiedGenerators = group.generators.map((generator) => {
936661
- const githubInfo = getGithubOwnerRepo(generator.outputMode);
936662
- if (githubInfo == null) {
936663
- return void 0;
936592
+ if (pushDiff === true) {
936593
+ const githubInfo = getGithubOwnerRepo(generator.outputMode);
936594
+ if (githubInfo != null) {
936595
+ return {
936596
+ ...generator,
936597
+ outputMode: api_exports5.OutputMode.githubV2(
936598
+ api_exports5.GithubOutputModeV2.push({
936599
+ owner: githubInfo.owner,
936600
+ repo: githubInfo.repo,
936601
+ branch: void 0,
936602
+ license: void 0,
936603
+ publishInfo: api_exports5.GithubPublishInfo.npm({
936604
+ registryUrl: registryUrl2,
936605
+ packageName,
936606
+ token
936607
+ }),
936608
+ downloadSnippets: false
936609
+ })
936610
+ ),
936611
+ absolutePathToLocalOutput: void 0
936612
+ };
936613
+ }
936664
936614
  }
936665
936615
  return {
936666
936616
  ...generator,
936667
- outputMode: api_exports5.OutputMode.githubV2(
936668
- api_exports5.GithubOutputModeV2.push({
936669
- owner: githubInfo.owner,
936670
- repo: githubInfo.repo,
936671
- branch: void 0,
936672
- license: void 0,
936673
- publishInfo: getGithubPublishInfoWithoutToken(generator.outputMode),
936674
- downloadSnippets: false
936675
- })
936676
- ),
936617
+ outputMode: createNpmOverrideOutputMode({ registryUrl: registryUrl2, packageName, token }),
936677
936618
  absolutePathToLocalOutput: void 0
936678
936619
  };
936679
- }).filter((g19) => g19 != null);
936620
+ });
936680
936621
  return {
936681
936622
  ...group,
936682
936623
  generators: modifiedGenerators
@@ -936823,78 +936764,62 @@ async function sdkPreview({
936823
936764
  const previewVersion = computePreviewVersion({ previewId });
936824
936765
  cliContext.logger.info(`Preview version: ${previewVersion}`);
936825
936766
  const singleGeneratorGroup = { ...group, generators: [generator] };
936826
- const githubInfo = getGithubOwnerRepo(generator.outputMode);
936827
- if (pushDiff && useRemoteGeneration && githubInfo == null) {
936767
+ if (pushDiff && useRemoteGeneration && getGithubOwnerRepo(generator.outputMode) == null) {
936828
936768
  cliContext.logger.warn(
936829
936769
  `Generator '${generator.name}' has no github output configuration. --push-diff will be ignored; falling back to registry-only publish.`
936830
936770
  );
936831
936771
  }
936832
- const shouldRunTwoJobs = pushDiff && useRemoteGeneration && publishToRegistry && registryUrl2 != null && githubInfo != null;
936833
- let publishGroup;
936772
+ let modifiedGroup;
936834
936773
  if (publishToRegistry && registryUrl2 != null) {
936835
- publishGroup = overrideGroupOutputForPreview({
936774
+ modifiedGroup = overrideGroupOutputForPreview({
936836
936775
  group: singleGeneratorGroup,
936837
936776
  packageName: previewPackageName,
936838
936777
  token: token.value,
936839
- registryUrl: registryUrl2
936778
+ registryUrl: registryUrl2,
936779
+ pushDiff: useRemoteGeneration ? pushDiff : void 0
936840
936780
  });
936841
936781
  } else if (useRemoteGeneration) {
936842
- publishGroup = overrideGroupOutputForDownload({ group: singleGeneratorGroup });
936782
+ modifiedGroup = overrideGroupOutputForDownload({ group: singleGeneratorGroup });
936843
936783
  } else {
936844
- publishGroup = singleGeneratorGroup;
936784
+ modifiedGroup = singleGeneratorGroup;
936845
936785
  }
936846
936786
  if (useRemoteGeneration) {
936847
- const commonRemoteArgs = {
936848
- projectConfig: project.config,
936849
- organization: project.config.organization,
936850
- workspace,
936851
- shouldLogS3Url: false,
936852
- token,
936853
- whitelabel: workspace.generatorsConfiguration?.whitelabel,
936854
- mode: void 0,
936855
- fernignorePath: void 0,
936856
- skipFernignore: false,
936857
- dynamicIrOnly: false,
936858
- validateWorkspace: true,
936859
- retryRateLimited: false,
936860
- requireEnvVars: false
936861
- };
936862
936787
  await cliContext.runTaskForWorkspace(workspace, async (context3) => {
936863
936788
  await runRemoteGenerationForAPIWorkspace({
936864
- ...commonRemoteArgs,
936789
+ projectConfig: project.config,
936790
+ organization: project.config.organization,
936791
+ workspace,
936865
936792
  context: context3,
936866
- generatorGroup: publishGroup,
936793
+ generatorGroup: modifiedGroup,
936867
936794
  version: previewVersion,
936795
+ shouldLogS3Url: false,
936796
+ token,
936797
+ whitelabel: workspace.generatorsConfiguration?.whitelabel,
936868
936798
  absolutePathToPreview: absolutePathToOutput,
936799
+ // isPreview controls CLI-side behavior: lenient env var substitution,
936800
+ // skip version availability check, skip dynamic IR upload.
936869
936801
  isPreview: true,
936802
+ // fiddlePreview controls what's sent to Fiddle as the `preview` flag.
936803
+ // We explicitly send false so Fiddle doesn't set dryRun=true (which
936804
+ // would cause `npm publish --dry-run` instead of actually publishing).
936870
936805
  fiddlePreview: false,
936871
- pushPreviewBranch: false
936806
+ pushPreviewBranch: pushDiff,
936807
+ mode: void 0,
936808
+ fernignorePath: void 0,
936809
+ skipFernignore: false,
936810
+ dynamicIrOnly: false,
936811
+ validateWorkspace: true,
936812
+ retryRateLimited: false,
936813
+ requireEnvVars: false
936872
936814
  });
936873
936815
  });
936874
- if (shouldRunTwoJobs) {
936875
- const diffGroup = overrideGroupOutputForDiffBranch({ group: singleGeneratorGroup });
936876
- if (diffGroup.generators.length > 0) {
936877
- await cliContext.runTaskForWorkspace(workspace, async (context3) => {
936878
- await runRemoteGenerationForAPIWorkspace({
936879
- ...commonRemoteArgs,
936880
- context: context3,
936881
- generatorGroup: diffGroup,
936882
- version: previewVersion,
936883
- absolutePathToPreview: void 0,
936884
- isPreview: true,
936885
- fiddlePreview: true,
936886
- pushPreviewBranch: true
936887
- });
936888
- });
936889
- }
936890
- }
936891
936816
  } else {
936892
936817
  await cliContext.runTaskForWorkspace(workspace, async (context3) => {
936893
936818
  await runLocalGenerationForWorkspace({
936894
936819
  token,
936895
936820
  projectConfig: project.config,
936896
936821
  workspace,
936897
- generatorGroup: publishGroup,
936822
+ generatorGroup: modifiedGroup,
936898
936823
  version: previewVersion,
936899
936824
  keepDocker: false,
936900
936825
  context: context3,
@@ -936911,6 +936836,7 @@ async function sdkPreview({
936911
936836
  });
936912
936837
  }
936913
936838
  const actualOutputPath = absolutePathToOutput != null ? join8(absolutePathToOutput, RelativeFilePath2.of(getGeneratorOutputSubfolder(generator.name))) : void 0;
936839
+ const githubInfo = getGithubOwnerRepo(generator.outputMode);
936914
936840
  const previewBranch = `fern-preview-${previewVersion}`;
936915
936841
  const diffUrl = pushDiff && githubInfo != null ? `https://github.com/${githubInfo.owner}/${githubInfo.repo}/compare/${previewBranch}` : void 0;
936916
936842
  if (publishToRegistry && registryUrl2 != null) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.74.0-11-g4d0b805a133",
2
+ "version": "4.74.0-3-g63dec7747b5",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",