@fern-api/fern-api-dev 4.74.0 → 4.75.0-1-ge9d9a1af736
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/cli.cjs +134 -60
- 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.
|
|
621397
|
+
version: "4.75.0-1-ge9d9a1af736",
|
|
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.
|
|
621451
|
+
version: "4.75.0-1-ge9d9a1af736",
|
|
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.
|
|
838661
|
+
const version7 = "4.75.0-1-ge9d9a1af736";
|
|
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.
|
|
849961
|
+
cliVersion: "4.75.0-1-ge9d9a1af736"
|
|
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.
|
|
924419
|
+
return "4.75.0-1-ge9d9a1af736";
|
|
924420
924420
|
}
|
|
924421
924421
|
getCliName() {
|
|
924422
924422
|
if (false) {
|
|
@@ -936585,39 +936585,98 @@ function overrideGroupOutputForPreview({
|
|
|
936585
936585
|
group,
|
|
936586
936586
|
packageName,
|
|
936587
936587
|
token,
|
|
936588
|
-
registryUrl: registryUrl2
|
|
936589
|
-
|
|
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
|
|
936590
936659
|
}) {
|
|
936591
936660
|
const modifiedGenerators = group.generators.map((generator) => {
|
|
936592
|
-
|
|
936593
|
-
|
|
936594
|
-
|
|
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
|
-
}
|
|
936661
|
+
const githubInfo = getGithubOwnerRepo(generator.outputMode);
|
|
936662
|
+
if (githubInfo == null) {
|
|
936663
|
+
return void 0;
|
|
936614
936664
|
}
|
|
936615
936665
|
return {
|
|
936616
936666
|
...generator,
|
|
936617
|
-
outputMode:
|
|
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
|
+
),
|
|
936618
936677
|
absolutePathToLocalOutput: void 0
|
|
936619
936678
|
};
|
|
936620
|
-
});
|
|
936679
|
+
}).filter((g19) => g19 != null);
|
|
936621
936680
|
return {
|
|
936622
936681
|
...group,
|
|
936623
936682
|
generators: modifiedGenerators
|
|
@@ -936764,62 +936823,78 @@ async function sdkPreview({
|
|
|
936764
936823
|
const previewVersion = computePreviewVersion({ previewId });
|
|
936765
936824
|
cliContext.logger.info(`Preview version: ${previewVersion}`);
|
|
936766
936825
|
const singleGeneratorGroup = { ...group, generators: [generator] };
|
|
936767
|
-
|
|
936826
|
+
const githubInfo = getGithubOwnerRepo(generator.outputMode);
|
|
936827
|
+
if (pushDiff && useRemoteGeneration && githubInfo == null) {
|
|
936768
936828
|
cliContext.logger.warn(
|
|
936769
936829
|
`Generator '${generator.name}' has no github output configuration. --push-diff will be ignored; falling back to registry-only publish.`
|
|
936770
936830
|
);
|
|
936771
936831
|
}
|
|
936772
|
-
|
|
936832
|
+
const shouldRunTwoJobs = pushDiff && useRemoteGeneration && publishToRegistry && registryUrl2 != null && githubInfo != null;
|
|
936833
|
+
let publishGroup;
|
|
936773
936834
|
if (publishToRegistry && registryUrl2 != null) {
|
|
936774
|
-
|
|
936835
|
+
publishGroup = overrideGroupOutputForPreview({
|
|
936775
936836
|
group: singleGeneratorGroup,
|
|
936776
936837
|
packageName: previewPackageName,
|
|
936777
936838
|
token: token.value,
|
|
936778
|
-
registryUrl: registryUrl2
|
|
936779
|
-
pushDiff: useRemoteGeneration ? pushDiff : void 0
|
|
936839
|
+
registryUrl: registryUrl2
|
|
936780
936840
|
});
|
|
936781
936841
|
} else if (useRemoteGeneration) {
|
|
936782
|
-
|
|
936842
|
+
publishGroup = overrideGroupOutputForDownload({ group: singleGeneratorGroup });
|
|
936783
936843
|
} else {
|
|
936784
|
-
|
|
936844
|
+
publishGroup = singleGeneratorGroup;
|
|
936785
936845
|
}
|
|
936786
936846
|
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
|
+
};
|
|
936787
936862
|
await cliContext.runTaskForWorkspace(workspace, async (context3) => {
|
|
936788
936863
|
await runRemoteGenerationForAPIWorkspace({
|
|
936789
|
-
|
|
936790
|
-
organization: project.config.organization,
|
|
936791
|
-
workspace,
|
|
936864
|
+
...commonRemoteArgs,
|
|
936792
936865
|
context: context3,
|
|
936793
|
-
generatorGroup:
|
|
936866
|
+
generatorGroup: publishGroup,
|
|
936794
936867
|
version: previewVersion,
|
|
936795
|
-
shouldLogS3Url: false,
|
|
936796
|
-
token,
|
|
936797
|
-
whitelabel: workspace.generatorsConfiguration?.whitelabel,
|
|
936798
936868
|
absolutePathToPreview: absolutePathToOutput,
|
|
936799
|
-
// isPreview controls CLI-side behavior: lenient env var substitution,
|
|
936800
|
-
// skip version availability check, skip dynamic IR upload.
|
|
936801
936869
|
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).
|
|
936805
936870
|
fiddlePreview: false,
|
|
936806
|
-
pushPreviewBranch:
|
|
936807
|
-
mode: void 0,
|
|
936808
|
-
fernignorePath: void 0,
|
|
936809
|
-
skipFernignore: false,
|
|
936810
|
-
dynamicIrOnly: false,
|
|
936811
|
-
validateWorkspace: true,
|
|
936812
|
-
retryRateLimited: false,
|
|
936813
|
-
requireEnvVars: false
|
|
936871
|
+
pushPreviewBranch: false
|
|
936814
936872
|
});
|
|
936815
936873
|
});
|
|
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
|
+
}
|
|
936816
936891
|
} else {
|
|
936817
936892
|
await cliContext.runTaskForWorkspace(workspace, async (context3) => {
|
|
936818
936893
|
await runLocalGenerationForWorkspace({
|
|
936819
936894
|
token,
|
|
936820
936895
|
projectConfig: project.config,
|
|
936821
936896
|
workspace,
|
|
936822
|
-
generatorGroup:
|
|
936897
|
+
generatorGroup: publishGroup,
|
|
936823
936898
|
version: previewVersion,
|
|
936824
936899
|
keepDocker: false,
|
|
936825
936900
|
context: context3,
|
|
@@ -936836,7 +936911,6 @@ async function sdkPreview({
|
|
|
936836
936911
|
});
|
|
936837
936912
|
}
|
|
936838
936913
|
const actualOutputPath = absolutePathToOutput != null ? join8(absolutePathToOutput, RelativeFilePath2.of(getGeneratorOutputSubfolder(generator.name))) : void 0;
|
|
936839
|
-
const githubInfo = getGithubOwnerRepo(generator.outputMode);
|
|
936840
936914
|
const previewBranch = `fern-preview-${previewVersion}`;
|
|
936841
936915
|
const diffUrl = pushDiff && githubInfo != null ? `https://github.com/${githubInfo.owner}/${githubInfo.repo}/compare/${previewBranch}` : void 0;
|
|
936842
936916
|
if (publishToRegistry && registryUrl2 != null) {
|
package/package.json
CHANGED