@fern-api/fern-api-dev 3.30.5 → 3.31.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.
- package/cli.cjs +104 -19
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -1413665,7 +1413665,7 @@ var AccessTokenPosthogManager = class {
|
|
|
1413665
1413665
|
properties: {
|
|
1413666
1413666
|
...event,
|
|
1413667
1413667
|
...event.properties,
|
|
1413668
|
-
version: "3.
|
|
1413668
|
+
version: "3.31.0",
|
|
1413669
1413669
|
usingAccessToken: true
|
|
1413670
1413670
|
}
|
|
1413671
1413671
|
});
|
|
@@ -1413764,7 +1413764,7 @@ var UserPosthogManager = class {
|
|
|
1413764
1413764
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
1413765
1413765
|
event: "CLI",
|
|
1413766
1413766
|
properties: {
|
|
1413767
|
-
version: "3.
|
|
1413767
|
+
version: "3.31.0",
|
|
1413768
1413768
|
...event,
|
|
1413769
1413769
|
...event.properties,
|
|
1413770
1413770
|
usingAccessToken: false,
|
|
@@ -1493831,7 +1493831,7 @@ var CliContext = class {
|
|
|
1493831
1493831
|
if (false) {
|
|
1493832
1493832
|
this.logger.error("CLI_VERSION is not defined");
|
|
1493833
1493833
|
}
|
|
1493834
|
-
return "3.
|
|
1493834
|
+
return "3.31.0";
|
|
1493835
1493835
|
}
|
|
1493836
1493836
|
getCliName() {
|
|
1493837
1493837
|
if (false) {
|
|
@@ -1588688,7 +1588688,7 @@ var import_path35 = __toESM(require("path"), 1);
|
|
|
1588688
1588688
|
var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
1588689
1588689
|
var LOGS_FOLDER_NAME = "logs";
|
|
1588690
1588690
|
function getCliSource() {
|
|
1588691
|
-
const version6 = "3.
|
|
1588691
|
+
const version6 = "3.31.0";
|
|
1588692
1588692
|
return `cli@${version6}`;
|
|
1588693
1588693
|
}
|
|
1588694
1588694
|
var DebugLogger = class {
|
|
@@ -1622356,6 +1622356,17 @@ var RemoteTaskHandler = class {
|
|
|
1622356
1622356
|
_other: () => "<unknown package>"
|
|
1622357
1622357
|
});
|
|
1622358
1622358
|
});
|
|
1622359
|
+
if (remoteTask2.packages.length > 0 && this.#actualVersion == null) {
|
|
1622360
|
+
this.#actualVersion = remoteTask2.packages[0]?.coordinate._visit({
|
|
1622361
|
+
npm: (npmPackage) => npmPackage.version,
|
|
1622362
|
+
maven: (mavenPackage) => mavenPackage.version,
|
|
1622363
|
+
pypi: (pypiPackage) => pypiPackage.version,
|
|
1622364
|
+
ruby: (rubyGem) => rubyGem.version,
|
|
1622365
|
+
nuget: (nugetPackage) => nugetPackage.version,
|
|
1622366
|
+
crates: (cratesPackage) => cratesPackage.version,
|
|
1622367
|
+
_other: () => void 0
|
|
1622368
|
+
});
|
|
1622369
|
+
}
|
|
1622359
1622370
|
if (this.absolutePathToPreview == null) {
|
|
1622360
1622371
|
this.context.setSubtitle(coordinates.length > 0 ? coordinates.map((coordinate) => {
|
|
1622361
1622372
|
return `\u25E6 ${coordinate}`;
|
|
@@ -1622363,6 +1622374,12 @@ var RemoteTaskHandler = class {
|
|
|
1622363
1622374
|
}
|
|
1622364
1622375
|
for (const newLog of remoteTask2.logs.slice(this.lengthOfLastLogs)) {
|
|
1622365
1622376
|
this.context.logger.log(convertLogLevel(newLog.level), newLog.message);
|
|
1622377
|
+
if (this.#actualVersion == null) {
|
|
1622378
|
+
const tagMatch = newLog.message.match(/Tagging release (\d+\.\d+\.\d+)/);
|
|
1622379
|
+
if (tagMatch) {
|
|
1622380
|
+
this.#actualVersion = tagMatch[1];
|
|
1622381
|
+
}
|
|
1622382
|
+
}
|
|
1622366
1622383
|
}
|
|
1622367
1622384
|
this.lengthOfLastLogs = remoteTask2.logs.length;
|
|
1622368
1622385
|
const logS3Url = (s3Url) => {
|
|
@@ -1622406,7 +1622423,8 @@ var RemoteTaskHandler = class {
|
|
|
1622406
1622423
|
});
|
|
1622407
1622424
|
return this.#isFinished ? {
|
|
1622408
1622425
|
createdSnippets: this.#createdSnippets,
|
|
1622409
|
-
snippetsS3PreSignedReadUrl: this.#snippetsS3PreSignedReadUrl
|
|
1622426
|
+
snippetsS3PreSignedReadUrl: this.#snippetsS3PreSignedReadUrl,
|
|
1622427
|
+
actualVersion: this.#actualVersion
|
|
1622410
1622428
|
} : void 0;
|
|
1622411
1622429
|
}
|
|
1622412
1622430
|
getAbsolutePathToLocalOutput() {
|
|
@@ -1622424,6 +1622442,10 @@ var RemoteTaskHandler = class {
|
|
|
1622424
1622442
|
get snippetsS3PreSignedReadUrl() {
|
|
1622425
1622443
|
return this.#snippetsS3PreSignedReadUrl;
|
|
1622426
1622444
|
}
|
|
1622445
|
+
#actualVersion = void 0;
|
|
1622446
|
+
get actualVersion() {
|
|
1622447
|
+
return this.#actualVersion;
|
|
1622448
|
+
}
|
|
1622427
1622449
|
};
|
|
1622428
1622450
|
async function downloadFilesForTask({ s3PreSignedReadUrl, absolutePathToLocalOutput, context: context2 }) {
|
|
1622429
1622451
|
try {
|
|
@@ -1622634,7 +1622656,7 @@ var SourceUploader = class {
|
|
|
1622634
1622656
|
};
|
|
1622635
1622657
|
|
|
1622636
1622658
|
// ../generation/remote-generation/remote-workspace-runner/lib/runRemoteGenerationForGenerator.js
|
|
1622637
|
-
async function runRemoteGenerationForGenerator({ projectConfig, organization, workspace, interactiveTaskContext, generatorInvocation, version: version6, audiences, shouldLogS3Url, token, whitelabel, irVersionOverride, absolutePathToPreview, readme, fernignorePath }) {
|
|
1622659
|
+
async function runRemoteGenerationForGenerator({ projectConfig, organization, workspace, interactiveTaskContext, generatorInvocation, version: version6, audiences, shouldLogS3Url, token, whitelabel, irVersionOverride, absolutePathToPreview, readme, fernignorePath, dynamicIrOnly }) {
|
|
1622638
1622660
|
const fdr = createFdrService({ token: token.value });
|
|
1622639
1622661
|
const packageName = generators_yml_exports.getPackageName({ generatorInvocation });
|
|
1622640
1622662
|
const isPreview = absolutePathToPreview != null;
|
|
@@ -1622722,12 +1622744,25 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
|
|
|
1622722
1622744
|
interactiveTaskContext.logger.debug("Setting IR source configuration ...");
|
|
1622723
1622745
|
ir14.sourceConfig = sourceConfig;
|
|
1622724
1622746
|
}
|
|
1622725
|
-
if (
|
|
1622747
|
+
if (dynamicIrOnly) {
|
|
1622748
|
+
interactiveTaskContext.logger.info("Dynamic IR only mode: skipping SDK generation and uploading dynamic IR only");
|
|
1622749
|
+
if (version6 == null) {
|
|
1622750
|
+
interactiveTaskContext.failAndThrow("Version is required for dynamic IR only mode");
|
|
1622751
|
+
return void 0;
|
|
1622752
|
+
}
|
|
1622753
|
+
if (generatorInvocation.language == null) {
|
|
1622754
|
+
interactiveTaskContext.failAndThrow("Language is required for dynamic IR only mode");
|
|
1622755
|
+
return void 0;
|
|
1622756
|
+
}
|
|
1622757
|
+
if (packageName == null) {
|
|
1622758
|
+
interactiveTaskContext.failAndThrow("Package name is required for dynamic IR only mode");
|
|
1622759
|
+
return void 0;
|
|
1622760
|
+
}
|
|
1622726
1622761
|
try {
|
|
1622727
1622762
|
await uploadDynamicIRForSdkGeneration({
|
|
1622728
1622763
|
fdr,
|
|
1622729
1622764
|
organization,
|
|
1622730
|
-
version:
|
|
1622765
|
+
version: version6,
|
|
1622731
1622766
|
language: generatorInvocation.language,
|
|
1622732
1622767
|
packageName,
|
|
1622733
1622768
|
ir: ir14,
|
|
@@ -1622736,8 +1622771,13 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
|
|
|
1622736
1622771
|
context: interactiveTaskContext
|
|
1622737
1622772
|
});
|
|
1622738
1622773
|
} catch (error2) {
|
|
1622739
|
-
interactiveTaskContext.
|
|
1622774
|
+
interactiveTaskContext.failAndThrow(`Failed to upload dynamic IR: ${error2 instanceof Error ? error2.message : String(error2)}`);
|
|
1622740
1622775
|
}
|
|
1622776
|
+
return {
|
|
1622777
|
+
createdSnippets: false,
|
|
1622778
|
+
snippetsS3PreSignedReadUrl: void 0,
|
|
1622779
|
+
actualVersion: version6
|
|
1622780
|
+
};
|
|
1622741
1622781
|
}
|
|
1622742
1622782
|
const job = await createAndStartJob({
|
|
1622743
1622783
|
projectConfig,
|
|
@@ -1622772,12 +1622812,31 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
|
|
|
1622772
1622812
|
interactiveTaskContext,
|
|
1622773
1622813
|
absolutePathToPreview
|
|
1622774
1622814
|
});
|
|
1622775
|
-
|
|
1622815
|
+
const result = await pollJobAndReportStatus({
|
|
1622776
1622816
|
job,
|
|
1622777
1622817
|
taskHandler,
|
|
1622778
1622818
|
taskId,
|
|
1622779
1622819
|
context: interactiveTaskContext
|
|
1622780
1622820
|
});
|
|
1622821
|
+
const actualVersionForUpload = result?.actualVersion ?? resolvedVersion;
|
|
1622822
|
+
if (result != null && actualVersionForUpload != null && generatorInvocation.language != null && packageName != null && !isPreview) {
|
|
1622823
|
+
try {
|
|
1622824
|
+
await uploadDynamicIRForSdkGeneration({
|
|
1622825
|
+
fdr,
|
|
1622826
|
+
organization,
|
|
1622827
|
+
version: actualVersionForUpload,
|
|
1622828
|
+
language: generatorInvocation.language,
|
|
1622829
|
+
packageName,
|
|
1622830
|
+
ir: ir14,
|
|
1622831
|
+
smartCasing: generatorInvocation.smartCasing,
|
|
1622832
|
+
dynamicGeneratorConfig,
|
|
1622833
|
+
context: interactiveTaskContext
|
|
1622834
|
+
});
|
|
1622835
|
+
} catch (error2) {
|
|
1622836
|
+
interactiveTaskContext.logger.warn(`Failed to upload dynamic IR for SDK generation: ${error2 instanceof Error ? error2.message : String(error2)}`);
|
|
1622837
|
+
}
|
|
1622838
|
+
}
|
|
1622839
|
+
return result;
|
|
1622781
1622840
|
}
|
|
1622782
1622841
|
function getPublishConfig({ generatorInvocation }) {
|
|
1622783
1622842
|
return generatorInvocation.outputMode._visit({
|
|
@@ -1622911,14 +1622970,14 @@ async function uploadDynamicIRForSdkGeneration({ fdr, organization, version: ver
|
|
|
1622911
1622970
|
}
|
|
1622912
1622971
|
});
|
|
1622913
1622972
|
if (uploadResponse.ok) {
|
|
1622914
|
-
context2.logger.debug(`
|
|
1622973
|
+
context2.logger.debug(`Uploaded dynamic IR for ${language}:${packageName} (${version6})`);
|
|
1622915
1622974
|
} else {
|
|
1622916
1622975
|
context2.logger.warn(`Failed to upload dynamic IR for ${language}: ${uploadResponse.status}`);
|
|
1622917
1622976
|
}
|
|
1622918
1622977
|
}
|
|
1622919
1622978
|
|
|
1622920
1622979
|
// ../generation/remote-generation/remote-workspace-runner/lib/runRemoteGenerationForAPIWorkspace.js
|
|
1622921
|
-
async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization, workspace, context: context2, generatorGroup, version: version6, shouldLogS3Url, token, whitelabel, absolutePathToPreview, mode, fernignorePath }) {
|
|
1622980
|
+
async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization, workspace, context: context2, generatorGroup, version: version6, shouldLogS3Url, token, whitelabel, absolutePathToPreview, mode, fernignorePath, dynamicIrOnly }) {
|
|
1622922
1622981
|
if (generatorGroup.generators.length === 0) {
|
|
1622923
1622982
|
context2.logger.warn("No generators specified.");
|
|
1622924
1622983
|
return null;
|
|
@@ -1622962,7 +1623021,8 @@ async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization,
|
|
|
1622962
1623021
|
readme: generatorInvocation.readme,
|
|
1622963
1623022
|
irVersionOverride: generatorInvocation.irVersionOverride,
|
|
1622964
1623023
|
absolutePathToPreview,
|
|
1622965
|
-
fernignorePath
|
|
1623024
|
+
fernignorePath,
|
|
1623025
|
+
dynamicIrOnly
|
|
1622966
1623026
|
});
|
|
1622967
1623027
|
if (remoteTaskHandlerResponse != null && remoteTaskHandlerResponse.createdSnippets) {
|
|
1622968
1623028
|
snippetsProducedBy.push(generatorInvocation);
|
|
@@ -1638510,7 +1638570,8 @@ async function generateWorkspace({
|
|
|
1638510
1638570
|
runner,
|
|
1638511
1638571
|
inspect: inspect4,
|
|
1638512
1638572
|
lfsOverride,
|
|
1638513
|
-
fernignorePath
|
|
1638573
|
+
fernignorePath,
|
|
1638574
|
+
dynamicIrOnly
|
|
1638514
1638575
|
}) {
|
|
1638515
1638576
|
if (workspace.generatorsConfiguration == null) {
|
|
1638516
1638577
|
context2.logger.warn("This workspaces has no generators.yml");
|
|
@@ -1638582,7 +1638643,8 @@ async function generateWorkspace({
|
|
|
1638582
1638643
|
whitelabel: workspace.generatorsConfiguration?.whitelabel,
|
|
1638583
1638644
|
absolutePathToPreview,
|
|
1638584
1638645
|
mode,
|
|
1638585
|
-
fernignorePath
|
|
1638646
|
+
fernignorePath,
|
|
1638647
|
+
dynamicIrOnly
|
|
1638586
1638648
|
});
|
|
1638587
1638649
|
}
|
|
1638588
1638650
|
})
|
|
@@ -1638692,7 +1638754,8 @@ async function generateAPIWorkspaces({
|
|
|
1638692
1638754
|
runner,
|
|
1638693
1638755
|
inspect: inspect4,
|
|
1638694
1638756
|
lfsOverride,
|
|
1638695
|
-
fernignorePath
|
|
1638757
|
+
fernignorePath,
|
|
1638758
|
+
dynamicIrOnly
|
|
1638696
1638759
|
}) {
|
|
1638697
1638760
|
let token = void 0;
|
|
1638698
1638761
|
if (!useLocalDocker) {
|
|
@@ -1638769,7 +1638832,8 @@ async function generateAPIWorkspaces({
|
|
|
1638769
1638832
|
runner,
|
|
1638770
1638833
|
inspect: inspect4,
|
|
1638771
1638834
|
lfsOverride,
|
|
1638772
|
-
fernignorePath
|
|
1638835
|
+
fernignorePath,
|
|
1638836
|
+
dynamicIrOnly
|
|
1638773
1638837
|
});
|
|
1638774
1638838
|
});
|
|
1638775
1638839
|
})
|
|
@@ -1646328,6 +1646392,10 @@ function addGenerateCommand(cli, cliContext) {
|
|
|
1646328
1646392
|
}).option("fernignore", {
|
|
1646329
1646393
|
type: "string",
|
|
1646330
1646394
|
description: "Path to a custom .fernignore file to use instead of the one on the main branch (remote generation only)"
|
|
1646395
|
+
}).option("dynamic-ir-only", {
|
|
1646396
|
+
boolean: true,
|
|
1646397
|
+
description: "Only upload dynamic IR for specified version, skip SDK generation (remote generation only)",
|
|
1646398
|
+
default: false
|
|
1646331
1646399
|
}),
|
|
1646332
1646400
|
async (argv) => {
|
|
1646333
1646401
|
if (argv.api != null && argv.docs != null) {
|
|
@@ -1646344,6 +1646412,21 @@ function addGenerateCommand(cli, cliContext) {
|
|
|
1646344
1646412
|
"The --fernignore flag is not supported with local generation (--local or --runner). It can only be used with remote generation."
|
|
1646345
1646413
|
);
|
|
1646346
1646414
|
}
|
|
1646415
|
+
if (argv["dynamic-ir-only"] && (argv.local || argv.runner != null)) {
|
|
1646416
|
+
return cliContext.failWithoutThrowing(
|
|
1646417
|
+
"The --dynamic-ir-only flag is not supported with local generation (--local or --runner). It can only be used with remote generation."
|
|
1646418
|
+
);
|
|
1646419
|
+
}
|
|
1646420
|
+
if (argv["dynamic-ir-only"] && argv.version == null) {
|
|
1646421
|
+
return cliContext.failWithoutThrowing(
|
|
1646422
|
+
"The --dynamic-ir-only flag requires a version to be specified with --version."
|
|
1646423
|
+
);
|
|
1646424
|
+
}
|
|
1646425
|
+
if (argv["dynamic-ir-only"] && argv.docs != null) {
|
|
1646426
|
+
return cliContext.failWithoutThrowing(
|
|
1646427
|
+
"The --dynamic-ir-only flag can only be used for API generation, not docs generation."
|
|
1646428
|
+
);
|
|
1646429
|
+
}
|
|
1646347
1646430
|
if (argv.api != null) {
|
|
1646348
1646431
|
return await generateAPIWorkspaces({
|
|
1646349
1646432
|
project: await loadProjectAndRegisterWorkspacesWithContext(cliContext, {
|
|
@@ -1646362,7 +1646445,8 @@ function addGenerateCommand(cli, cliContext) {
|
|
|
1646362
1646445
|
runner: argv.runner,
|
|
1646363
1646446
|
inspect: false,
|
|
1646364
1646447
|
lfsOverride: argv.lfsOverride,
|
|
1646365
|
-
fernignorePath: argv.fernignore
|
|
1646448
|
+
fernignorePath: argv.fernignore,
|
|
1646449
|
+
dynamicIrOnly: argv["dynamic-ir-only"]
|
|
1646366
1646450
|
});
|
|
1646367
1646451
|
}
|
|
1646368
1646452
|
if (argv.docs != null) {
|
|
@@ -1646408,7 +1646492,8 @@ function addGenerateCommand(cli, cliContext) {
|
|
|
1646408
1646492
|
runner: argv.runner,
|
|
1646409
1646493
|
inspect: false,
|
|
1646410
1646494
|
lfsOverride: argv.lfsOverride,
|
|
1646411
|
-
fernignorePath: argv.fernignore
|
|
1646495
|
+
fernignorePath: argv.fernignore,
|
|
1646496
|
+
dynamicIrOnly: argv["dynamic-ir-only"]
|
|
1646412
1646497
|
});
|
|
1646413
1646498
|
}
|
|
1646414
1646499
|
);
|
package/package.json
CHANGED