@fern-api/fern-api-dev 4.80.4 → 4.81.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 +1383 -810
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -68378,8 +68378,8 @@ var require_graceful_fs = __commonJS({
|
|
|
68378
68378
|
}
|
|
68379
68379
|
}
|
|
68380
68380
|
var fs$writeFile = fs28.writeFile;
|
|
68381
|
-
fs28.writeFile =
|
|
68382
|
-
function
|
|
68381
|
+
fs28.writeFile = writeFile91;
|
|
68382
|
+
function writeFile91(path99, data2, options2, cb) {
|
|
68383
68383
|
if (typeof options2 === "function")
|
|
68384
68384
|
cb = options2, options2 = null;
|
|
68385
68385
|
return go$writeFile(path99, data2, options2, cb);
|
|
@@ -68396,8 +68396,8 @@ var require_graceful_fs = __commonJS({
|
|
|
68396
68396
|
}
|
|
68397
68397
|
var fs$appendFile = fs28.appendFile;
|
|
68398
68398
|
if (fs$appendFile)
|
|
68399
|
-
fs28.appendFile =
|
|
68400
|
-
function
|
|
68399
|
+
fs28.appendFile = appendFile3;
|
|
68400
|
+
function appendFile3(path99, data2, options2, cb) {
|
|
68401
68401
|
if (typeof options2 === "function")
|
|
68402
68402
|
cb = options2, options2 = null;
|
|
68403
68403
|
return go$appendFile(path99, data2, options2, cb);
|
|
@@ -290012,8 +290012,8 @@ var require_graceful_fs2 = __commonJS({
|
|
|
290012
290012
|
}
|
|
290013
290013
|
}
|
|
290014
290014
|
var fs$writeFile = fs28.writeFile;
|
|
290015
|
-
fs28.writeFile =
|
|
290016
|
-
function
|
|
290015
|
+
fs28.writeFile = writeFile91;
|
|
290016
|
+
function writeFile91(path99, data2, options2, cb) {
|
|
290017
290017
|
if (typeof options2 === "function")
|
|
290018
290018
|
cb = options2, options2 = null;
|
|
290019
290019
|
return go$writeFile(path99, data2, options2, cb);
|
|
@@ -290030,8 +290030,8 @@ var require_graceful_fs2 = __commonJS({
|
|
|
290030
290030
|
}
|
|
290031
290031
|
var fs$appendFile = fs28.appendFile;
|
|
290032
290032
|
if (fs$appendFile)
|
|
290033
|
-
fs28.appendFile =
|
|
290034
|
-
function
|
|
290033
|
+
fs28.appendFile = appendFile3;
|
|
290034
|
+
function appendFile3(path99, data2, options2, cb) {
|
|
290035
290035
|
if (typeof options2 === "function")
|
|
290036
290036
|
cb = options2, options2 = null;
|
|
290037
290037
|
return go$appendFile(path99, data2, options2, cb);
|
|
@@ -330613,6 +330613,50 @@ var require_constants3 = __commonJS({
|
|
|
330613
330613
|
}
|
|
330614
330614
|
});
|
|
330615
330615
|
|
|
330616
|
+
// ../../generator-cli/lib/pipeline/steps/BaseStep.js
|
|
330617
|
+
var require_BaseStep = __commonJS({
|
|
330618
|
+
"../../generator-cli/lib/pipeline/steps/BaseStep.js"(exports2) {
|
|
330619
|
+
"use strict";
|
|
330620
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
330621
|
+
exports2.BaseStep = void 0;
|
|
330622
|
+
var BaseStep = class {
|
|
330623
|
+
outputDir;
|
|
330624
|
+
logger;
|
|
330625
|
+
constructor(outputDir, logger4) {
|
|
330626
|
+
this.outputDir = outputDir;
|
|
330627
|
+
this.logger = logger4;
|
|
330628
|
+
}
|
|
330629
|
+
};
|
|
330630
|
+
exports2.BaseStep = BaseStep;
|
|
330631
|
+
}
|
|
330632
|
+
});
|
|
330633
|
+
|
|
330634
|
+
// ../../generator-cli/lib/pipeline/steps/AutoVersionStep.js
|
|
330635
|
+
var require_AutoVersionStep = __commonJS({
|
|
330636
|
+
"../../generator-cli/lib/pipeline/steps/AutoVersionStep.js"(exports2) {
|
|
330637
|
+
"use strict";
|
|
330638
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
330639
|
+
exports2.AutoVersionStep = void 0;
|
|
330640
|
+
var BaseStep_1 = require_BaseStep();
|
|
330641
|
+
var AutoVersionStep = class extends BaseStep_1.BaseStep {
|
|
330642
|
+
config;
|
|
330643
|
+
name = "autoVersion";
|
|
330644
|
+
constructor(outputDir, logger4, config5) {
|
|
330645
|
+
super(outputDir, logger4);
|
|
330646
|
+
this.config = config5;
|
|
330647
|
+
}
|
|
330648
|
+
async execute(_context) {
|
|
330649
|
+
this.logger.info(`AutoVersionStep: no-op scaffold for language=${this.config.language} (logic lands in FER-9980)`);
|
|
330650
|
+
return {
|
|
330651
|
+
executed: true,
|
|
330652
|
+
success: true
|
|
330653
|
+
};
|
|
330654
|
+
}
|
|
330655
|
+
};
|
|
330656
|
+
exports2.AutoVersionStep = AutoVersionStep;
|
|
330657
|
+
}
|
|
330658
|
+
});
|
|
330659
|
+
|
|
330616
330660
|
// ../../generator-cli/lib/pipeline/github/createReplayBranch.js
|
|
330617
330661
|
var require_createReplayBranch = __commonJS({
|
|
330618
330662
|
"../../generator-cli/lib/pipeline/github/createReplayBranch.js"(exports2) {
|
|
@@ -330879,24 +330923,6 @@ var require_replay_summary = __commonJS({
|
|
|
330879
330923
|
}
|
|
330880
330924
|
});
|
|
330881
330925
|
|
|
330882
|
-
// ../../generator-cli/lib/pipeline/steps/BaseStep.js
|
|
330883
|
-
var require_BaseStep = __commonJS({
|
|
330884
|
-
"../../generator-cli/lib/pipeline/steps/BaseStep.js"(exports2) {
|
|
330885
|
-
"use strict";
|
|
330886
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
330887
|
-
exports2.BaseStep = void 0;
|
|
330888
|
-
var BaseStep = class {
|
|
330889
|
-
outputDir;
|
|
330890
|
-
logger;
|
|
330891
|
-
constructor(outputDir, logger4) {
|
|
330892
|
-
this.outputDir = outputDir;
|
|
330893
|
-
this.logger = logger4;
|
|
330894
|
-
}
|
|
330895
|
-
};
|
|
330896
|
-
exports2.BaseStep = BaseStep;
|
|
330897
|
-
}
|
|
330898
|
-
});
|
|
330899
|
-
|
|
330900
330926
|
// ../../generator-cli/lib/pipeline/steps/GithubStep.js
|
|
330901
330927
|
var require_GithubStep = __commonJS({
|
|
330902
330928
|
"../../generator-cli/lib/pipeline/steps/GithubStep.js"(exports2) {
|
|
@@ -337970,7 +337996,7 @@ var require_dist14 = __commonJS({
|
|
|
337970
337996
|
}
|
|
337971
337997
|
return result;
|
|
337972
337998
|
}
|
|
337973
|
-
var
|
|
337999
|
+
var import_promises185 = require("fs/promises");
|
|
337974
338000
|
var import_node_os15 = require("os");
|
|
337975
338001
|
var import_node_path210 = require("path");
|
|
337976
338002
|
var import_minimatch8 = require_commonjs3();
|
|
@@ -338183,9 +338209,9 @@ var require_dist14 = __commonJS({
|
|
|
338183
338209
|
if (laterFiles.has(fileResult.file) || laterFiles.has(originalPath)) {
|
|
338184
338210
|
const filePath = (0, import_node_path210.join)(this.outputDir, fileResult.file);
|
|
338185
338211
|
try {
|
|
338186
|
-
const content5 = await (0,
|
|
338212
|
+
const content5 = await (0, import_promises185.readFile)(filePath, "utf-8");
|
|
338187
338213
|
const stripped = stripConflictMarkers(content5);
|
|
338188
|
-
await (0,
|
|
338214
|
+
await (0, import_promises185.writeFile)(filePath, stripped);
|
|
338189
338215
|
} catch {
|
|
338190
338216
|
}
|
|
338191
338217
|
}
|
|
@@ -338197,7 +338223,7 @@ var require_dist14 = __commonJS({
|
|
|
338197
338223
|
/** Populate accumulator after git apply succeeds. */
|
|
338198
338224
|
async populateAccumulatorForPatch(patch5, baseGen, currentTreeHash) {
|
|
338199
338225
|
if (!baseGen) return;
|
|
338200
|
-
const tempDir2 = await (0,
|
|
338226
|
+
const tempDir2 = await (0, import_promises185.mkdtemp)((0, import_node_path210.join)((0, import_node_os15.tmpdir)(), "replay-acc-"));
|
|
338201
338227
|
const { GitClient: GitClient2 } = await Promise.resolve().then(() => (init_GitClient(), GitClient_exports));
|
|
338202
338228
|
const tempGit = new GitClient2(tempDir2);
|
|
338203
338229
|
await tempGit.exec(["init"]);
|
|
@@ -338209,7 +338235,7 @@ var require_dist14 = __commonJS({
|
|
|
338209
338235
|
const resolvedPath = await this.resolveFilePath(filePath, baseGen.tree_hash, currentTreeHash);
|
|
338210
338236
|
const base4 = await this.git.showFile(baseGen.tree_hash, filePath);
|
|
338211
338237
|
const theirs = await this.applyPatchToContent(base4, patch5.patch_content, filePath, tempGit, tempDir2);
|
|
338212
|
-
const effectiveTheirs = theirs ?? await (0,
|
|
338238
|
+
const effectiveTheirs = theirs ?? await (0, import_promises185.readFile)((0, import_node_path210.join)(this.outputDir, resolvedPath), "utf-8").catch(() => null);
|
|
338213
338239
|
if (effectiveTheirs != null) {
|
|
338214
338240
|
this.fileTheirsAccumulator.set(resolvedPath, {
|
|
338215
338241
|
content: effectiveTheirs,
|
|
@@ -338218,7 +338244,7 @@ var require_dist14 = __commonJS({
|
|
|
338218
338244
|
}
|
|
338219
338245
|
}
|
|
338220
338246
|
} finally {
|
|
338221
|
-
await (0,
|
|
338247
|
+
await (0, import_promises185.rm)(tempDir2, { recursive: true }).catch(() => {
|
|
338222
338248
|
});
|
|
338223
338249
|
}
|
|
338224
338250
|
}
|
|
@@ -338247,7 +338273,7 @@ var require_dist14 = __commonJS({
|
|
|
338247
338273
|
const snapshots = /* @__PURE__ */ new Map();
|
|
338248
338274
|
for (const filePath of patch5.files) {
|
|
338249
338275
|
const fullPath = (0, import_node_path210.join)(this.outputDir, filePath);
|
|
338250
|
-
snapshots.set(filePath, await (0,
|
|
338276
|
+
snapshots.set(filePath, await (0, import_promises185.readFile)(fullPath, "utf-8").catch(() => null));
|
|
338251
338277
|
}
|
|
338252
338278
|
try {
|
|
338253
338279
|
await this.git.execWithInput(["apply", "--3way"], patch5.patch_content);
|
|
@@ -338262,9 +338288,9 @@ var require_dist14 = __commonJS({
|
|
|
338262
338288
|
for (const [filePath, content5] of snapshots) {
|
|
338263
338289
|
const fullPath = (0, import_node_path210.join)(this.outputDir, filePath);
|
|
338264
338290
|
if (content5 != null) {
|
|
338265
|
-
await (0,
|
|
338291
|
+
await (0, import_promises185.writeFile)(fullPath, content5);
|
|
338266
338292
|
} else {
|
|
338267
|
-
await (0,
|
|
338293
|
+
await (0, import_promises185.unlink)(fullPath).catch(() => {
|
|
338268
338294
|
});
|
|
338269
338295
|
}
|
|
338270
338296
|
}
|
|
@@ -338275,7 +338301,7 @@ var require_dist14 = __commonJS({
|
|
|
338275
338301
|
async applyWithThreeWayMerge(patch5) {
|
|
338276
338302
|
const fileResults = [];
|
|
338277
338303
|
const resolvedFiles = {};
|
|
338278
|
-
const tempDir2 = await (0,
|
|
338304
|
+
const tempDir2 = await (0, import_promises185.mkdtemp)((0, import_node_path210.join)((0, import_node_os15.tmpdir)(), "replay-"));
|
|
338279
338305
|
const { GitClient: GitClient2 } = await Promise.resolve().then(() => (init_GitClient(), GitClient_exports));
|
|
338280
338306
|
const tempGit = new GitClient2(tempDir2);
|
|
338281
338307
|
await tempGit.exec(["init"]);
|
|
@@ -338298,7 +338324,7 @@ var require_dist14 = __commonJS({
|
|
|
338298
338324
|
fileResults.push(result);
|
|
338299
338325
|
}
|
|
338300
338326
|
} finally {
|
|
338301
|
-
await (0,
|
|
338327
|
+
await (0, import_promises185.rm)(tempDir2, { recursive: true }).catch(() => {
|
|
338302
338328
|
});
|
|
338303
338329
|
}
|
|
338304
338330
|
const conflictFiles = fileResults.filter((r5) => r5.status === "conflict");
|
|
@@ -338339,7 +338365,7 @@ var require_dist14 = __commonJS({
|
|
|
338339
338365
|
}
|
|
338340
338366
|
}
|
|
338341
338367
|
const oursPath = (0, import_node_path210.join)(this.outputDir, resolvedPath);
|
|
338342
|
-
const ours = await (0,
|
|
338368
|
+
const ours = await (0, import_promises185.readFile)(oursPath, "utf-8").catch(() => null);
|
|
338343
338369
|
let ghostReconstructed = false;
|
|
338344
338370
|
let theirs = null;
|
|
338345
338371
|
if (!base4 && ours && !renameSourcePath) {
|
|
@@ -338436,15 +338462,15 @@ var require_dist14 = __commonJS({
|
|
|
338436
338462
|
baseGeneration: patch5.base_generation
|
|
338437
338463
|
});
|
|
338438
338464
|
const outDir2 = (0, import_node_path210.dirname)(oursPath);
|
|
338439
|
-
await (0,
|
|
338440
|
-
await (0,
|
|
338465
|
+
await (0, import_promises185.mkdir)(outDir2, { recursive: true });
|
|
338466
|
+
await (0, import_promises185.writeFile)(oursPath, effective_theirs);
|
|
338441
338467
|
return { file: resolvedPath, status: "merged", reason: "new-file" };
|
|
338442
338468
|
}
|
|
338443
338469
|
if (base4 == null && ours != null && effective_theirs != null && !useAccumulatorAsMergeBase) {
|
|
338444
338470
|
const merged2 = threeWayMerge("", ours, effective_theirs);
|
|
338445
338471
|
const outDir2 = (0, import_node_path210.dirname)(oursPath);
|
|
338446
|
-
await (0,
|
|
338447
|
-
await (0,
|
|
338472
|
+
await (0, import_promises185.mkdir)(outDir2, { recursive: true });
|
|
338473
|
+
await (0, import_promises185.writeFile)(oursPath, merged2.content);
|
|
338448
338474
|
if (merged2.hasConflicts) {
|
|
338449
338475
|
return {
|
|
338450
338476
|
file: resolvedPath,
|
|
@@ -338484,8 +338510,8 @@ var require_dist14 = __commonJS({
|
|
|
338484
338510
|
}
|
|
338485
338511
|
const merged = threeWayMerge(mergeBase, ours, effective_theirs);
|
|
338486
338512
|
const outDir = (0, import_node_path210.dirname)(oursPath);
|
|
338487
|
-
await (0,
|
|
338488
|
-
await (0,
|
|
338513
|
+
await (0, import_promises185.mkdir)(outDir, { recursive: true });
|
|
338514
|
+
await (0, import_promises185.writeFile)(oursPath, merged.content);
|
|
338489
338515
|
if (effective_theirs != null && !merged.hasConflicts) {
|
|
338490
338516
|
this.fileTheirsAccumulator.set(resolvedPath, {
|
|
338491
338517
|
content: effective_theirs,
|
|
@@ -338560,8 +338586,8 @@ var require_dist14 = __commonJS({
|
|
|
338560
338586
|
try {
|
|
338561
338587
|
if (sourceFilePath) {
|
|
338562
338588
|
const tempSourcePath = (0, import_node_path210.join)(tempDir2, sourceFilePath);
|
|
338563
|
-
await (0,
|
|
338564
|
-
await (0,
|
|
338589
|
+
await (0, import_promises185.mkdir)((0, import_node_path210.dirname)(tempSourcePath), { recursive: true });
|
|
338590
|
+
await (0, import_promises185.writeFile)(tempSourcePath, base4);
|
|
338565
338591
|
await tempGit.exec(["add", sourceFilePath]);
|
|
338566
338592
|
await tempGit.exec([
|
|
338567
338593
|
"commit",
|
|
@@ -338571,15 +338597,15 @@ var require_dist14 = __commonJS({
|
|
|
338571
338597
|
]);
|
|
338572
338598
|
await tempGit.execWithInput(["apply", "--allow-empty"], fileDiff);
|
|
338573
338599
|
const tempTargetPath = (0, import_node_path210.join)(tempDir2, filePath);
|
|
338574
|
-
return await (0,
|
|
338600
|
+
return await (0, import_promises185.readFile)(tempTargetPath, "utf-8");
|
|
338575
338601
|
}
|
|
338576
338602
|
const tempFilePath = (0, import_node_path210.join)(tempDir2, filePath);
|
|
338577
|
-
await (0,
|
|
338578
|
-
await (0,
|
|
338603
|
+
await (0, import_promises185.mkdir)((0, import_node_path210.dirname)(tempFilePath), { recursive: true });
|
|
338604
|
+
await (0, import_promises185.writeFile)(tempFilePath, base4);
|
|
338579
338605
|
await tempGit.exec(["add", filePath]);
|
|
338580
338606
|
await tempGit.exec(["commit", "-m", `base for ${filePath}`, "--allow-empty"]);
|
|
338581
338607
|
await tempGit.execWithInput(["apply", "--allow-empty"], fileDiff);
|
|
338582
|
-
return await (0,
|
|
338608
|
+
return await (0, import_promises185.readFile)(tempFilePath, "utf-8");
|
|
338583
338609
|
} catch {
|
|
338584
338610
|
return null;
|
|
338585
338611
|
}
|
|
@@ -338596,8 +338622,8 @@ var require_dist14 = __commonJS({
|
|
|
338596
338622
|
if (!fileDiff) return false;
|
|
338597
338623
|
try {
|
|
338598
338624
|
const tempFilePath = (0, import_node_path210.join)(tempDir2, filePath);
|
|
338599
|
-
await (0,
|
|
338600
|
-
await (0,
|
|
338625
|
+
await (0, import_promises185.mkdir)((0, import_node_path210.dirname)(tempFilePath), { recursive: true });
|
|
338626
|
+
await (0, import_promises185.writeFile)(tempFilePath, content5);
|
|
338601
338627
|
await tempGit.exec(["add", filePath]);
|
|
338602
338628
|
await tempGit.exec(["commit", "-m", `check already-applied ${filePath}`, "--allow-empty"]);
|
|
338603
338629
|
await tempGit.execWithInput(["apply", "--reverse", "--check", "--allow-empty"], fileDiff);
|
|
@@ -340634,6 +340660,7 @@ var require_PostGenerationPipeline = __commonJS({
|
|
|
340634
340660
|
var child_process_1 = require("child_process");
|
|
340635
340661
|
var constants_1 = require_constants3();
|
|
340636
340662
|
var PipelineLogger_1 = require_PipelineLogger();
|
|
340663
|
+
var AutoVersionStep_1 = require_AutoVersionStep();
|
|
340637
340664
|
var GithubStep_1 = require_GithubStep();
|
|
340638
340665
|
var ReplayStep_1 = require_ReplayStep();
|
|
340639
340666
|
var PostGenerationPipeline2 = class {
|
|
@@ -340647,6 +340674,9 @@ var require_PostGenerationPipeline = __commonJS({
|
|
|
340647
340674
|
this.logger.warn("Replay is not supported with GitHub push mode. Disabling replay to prevent force push to base branch.");
|
|
340648
340675
|
config5.replay.enabled = false;
|
|
340649
340676
|
}
|
|
340677
|
+
if (config5.autoVersion?.enabled) {
|
|
340678
|
+
this.steps.push(new AutoVersionStep_1.AutoVersionStep(config5.outputDir, this.logger, config5.autoVersion));
|
|
340679
|
+
}
|
|
340650
340680
|
if (config5.replay?.enabled) {
|
|
340651
340681
|
this.steps.push(new ReplayStep_1.ReplayStep(config5.outputDir, this.logger, config5.replay, config5.cliVersion, config5.generatorVersions, config5.generatorName));
|
|
340652
340682
|
}
|
|
@@ -340675,6 +340705,9 @@ var require_PostGenerationPipeline = __commonJS({
|
|
|
340675
340705
|
if (step.name === "replay") {
|
|
340676
340706
|
result.steps.replay = stepResult;
|
|
340677
340707
|
pipelineContext.previousStepResults.replay = stepResult;
|
|
340708
|
+
} else if (step.name === "autoVersion") {
|
|
340709
|
+
result.steps.autoVersion = stepResult;
|
|
340710
|
+
pipelineContext.previousStepResults.autoVersion = stepResult;
|
|
340678
340711
|
} else if (step.name === "fernignore") {
|
|
340679
340712
|
result.steps.fernignore = stepResult;
|
|
340680
340713
|
} else if (step.name === "github") {
|
|
@@ -352409,8 +352442,8 @@ var require_jsonfile = __commonJS({
|
|
|
352409
352442
|
const str3 = stringify5(obj, options2);
|
|
352410
352443
|
await universalify.fromCallback(fs27.writeFile)(file4, str3, options2);
|
|
352411
352444
|
}
|
|
352412
|
-
var
|
|
352413
|
-
function
|
|
352445
|
+
var writeFile91 = universalify.fromPromise(_writeFile);
|
|
352446
|
+
function writeFileSync9(file4, obj, options2 = {}) {
|
|
352414
352447
|
const fs27 = options2.fs || _fs;
|
|
352415
352448
|
const str3 = stringify5(obj, options2);
|
|
352416
352449
|
return fs27.writeFileSync(file4, str3, options2);
|
|
@@ -352418,8 +352451,8 @@ var require_jsonfile = __commonJS({
|
|
|
352418
352451
|
module4.exports = {
|
|
352419
352452
|
readFile: readFile104,
|
|
352420
352453
|
readFileSync: readFileSync19,
|
|
352421
|
-
writeFile:
|
|
352422
|
-
writeFileSync:
|
|
352454
|
+
writeFile: writeFile91,
|
|
352455
|
+
writeFileSync: writeFileSync9
|
|
352423
352456
|
};
|
|
352424
352457
|
}
|
|
352425
352458
|
});
|
|
@@ -567233,25 +567266,28 @@ var TtyAwareLogger = class {
|
|
|
567233
567266
|
}
|
|
567234
567267
|
paint() {
|
|
567235
567268
|
const spinnerFrame = this.spinner.frame();
|
|
567236
|
-
const
|
|
567269
|
+
const frames = [];
|
|
567237
567270
|
for (const task of this.tasks) {
|
|
567238
|
-
const
|
|
567239
|
-
if (
|
|
567240
|
-
|
|
567271
|
+
const body = task.printInteractiveTasks({ spinner: spinnerFrame });
|
|
567272
|
+
if (body.length > 0) {
|
|
567273
|
+
frames.push({ title: task.title, body });
|
|
567241
567274
|
}
|
|
567242
567275
|
}
|
|
567243
|
-
if (
|
|
567276
|
+
if (frames.length === 0) {
|
|
567244
567277
|
return "";
|
|
567245
567278
|
}
|
|
567246
567279
|
const spinnerStatus = process.env.FERN_SPINNER_STATUS;
|
|
567247
|
-
if (spinnerStatus
|
|
567248
|
-
|
|
567280
|
+
if (spinnerStatus) {
|
|
567281
|
+
const first3 = frames[0];
|
|
567282
|
+
if (first3 != null) {
|
|
567283
|
+
first3.body = `${first3.body} - ${spinnerStatus}`;
|
|
567284
|
+
}
|
|
567249
567285
|
}
|
|
567250
|
-
const paint = [
|
|
567251
|
-
"\u250C\u2500",
|
|
567252
|
-
|
|
567286
|
+
const paint = frames.map(({ title: title3, body }) => [
|
|
567287
|
+
title3 != null ? `\u250C\u2500 ${title3} \u2500` : "\u250C\u2500",
|
|
567288
|
+
addPrefixToString({ content: body, prefix: "\u2502 ", includePrefixOnAllLines: true }),
|
|
567253
567289
|
"\u2514\u2500"
|
|
567254
|
-
].join("\n") + "\n";
|
|
567290
|
+
].join("\n")).join("\n") + "\n";
|
|
567255
567291
|
this.lastPaint = paint;
|
|
567256
567292
|
return paint;
|
|
567257
567293
|
}
|
|
@@ -614298,7 +614334,7 @@ var AccessTokenPosthogManager = class {
|
|
|
614298
614334
|
properties: {
|
|
614299
614335
|
...event,
|
|
614300
614336
|
...event.properties,
|
|
614301
|
-
version: "4.
|
|
614337
|
+
version: "4.81.0",
|
|
614302
614338
|
usingAccessToken: true
|
|
614303
614339
|
}
|
|
614304
614340
|
});
|
|
@@ -614352,7 +614388,7 @@ var UserPosthogManager = class {
|
|
|
614352
614388
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
614353
614389
|
event: "CLI",
|
|
614354
614390
|
properties: {
|
|
614355
|
-
version: "4.
|
|
614391
|
+
version: "4.81.0",
|
|
614356
614392
|
...event,
|
|
614357
614393
|
...event.properties,
|
|
614358
614394
|
usingAccessToken: false,
|
|
@@ -788468,13 +788504,13 @@ async function removeInvalidAiExamples({ sourceFilePath, context: context3 }) {
|
|
|
788468
788504
|
}
|
|
788469
788505
|
}
|
|
788470
788506
|
}
|
|
788471
|
-
const { writeFile:
|
|
788507
|
+
const { writeFile: writeFile91 } = await import("fs/promises");
|
|
788472
788508
|
const yamlContent = jsYaml.dump(parsed, {
|
|
788473
788509
|
indent: 2,
|
|
788474
788510
|
lineWidth: -1,
|
|
788475
788511
|
noRefs: true
|
|
788476
788512
|
});
|
|
788477
|
-
await
|
|
788513
|
+
await writeFile91(overrideFilePath, yamlContent, "utf-8");
|
|
788478
788514
|
context3.logger.info(`Removed ${validationResult.invalidCount} invalid AI examples from ai_examples_override.yml`);
|
|
788479
788515
|
return {
|
|
788480
788516
|
removedCount: validationResult.invalidCount,
|
|
@@ -831633,7 +831669,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
831633
831669
|
var LOGS_FOLDER_NAME = "logs";
|
|
831634
831670
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
831635
831671
|
function getCliSource() {
|
|
831636
|
-
const version7 = "4.
|
|
831672
|
+
const version7 = "4.81.0";
|
|
831637
831673
|
return `cli@${version7}`;
|
|
831638
831674
|
}
|
|
831639
831675
|
var DebugLogger = class {
|
|
@@ -834508,6 +834544,9 @@ async function validateAPIWorkspaceAndLogIssues({ workspace, context: context3,
|
|
|
834508
834544
|
}
|
|
834509
834545
|
}
|
|
834510
834546
|
|
|
834547
|
+
// ../generation/remote-generation/remote-workspace-runner/lib/runRemoteGenerationForAPIWorkspace.js
|
|
834548
|
+
init_lib4();
|
|
834549
|
+
|
|
834511
834550
|
// ../workspace/loader/lib/handleFailedWorkspaceParserResult.js
|
|
834512
834551
|
init_lib4();
|
|
834513
834552
|
init_zod();
|
|
@@ -841997,14 +842036,51 @@ async function uploadDynamicIRForSdkGeneration({ fdr, organization, version: ver
|
|
|
841997
842036
|
}
|
|
841998
842037
|
|
|
841999
842038
|
// ../generation/remote-generation/remote-workspace-runner/lib/runRemoteGenerationForAPIWorkspace.js
|
|
842000
|
-
async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization, workspace, context: context3, generatorGroup, version: version7, shouldLogS3Url, token, whitelabel, absolutePathToPreview, isPreview, fiddlePreview, pushPreviewBranch, mode, fernignorePath, skipFernignore, dynamicIrOnly, validateWorkspace, retryRateLimited, requireEnvVars, automationMode, autoMerge }) {
|
|
842039
|
+
async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization, workspace, context: context3, generatorGroup, version: version7, shouldLogS3Url, token, whitelabel, absolutePathToPreview, isPreview, fiddlePreview, pushPreviewBranch, mode, fernignorePath, skipFernignore, dynamicIrOnly, validateWorkspace, retryRateLimited, requireEnvVars, automationMode, autoMerge, automation }) {
|
|
842001
842040
|
if (generatorGroup.generators.length === 0) {
|
|
842002
842041
|
context3.logger.warn("No generators specified.");
|
|
842003
842042
|
return null;
|
|
842004
842043
|
}
|
|
842005
|
-
const interactiveTasks = [];
|
|
842006
842044
|
const snippetsProducedBy = [];
|
|
842007
|
-
|
|
842045
|
+
const results = await Promise.all(generatorGroup.generators.map((generatorInvocation) => context3.runInteractiveTask({ name: generatorInvocation.name }, (interactiveTaskContext) => generateOne({
|
|
842046
|
+
generatorInvocation,
|
|
842047
|
+
interactiveTaskContext,
|
|
842048
|
+
// Closed-over state + params passed through to the per-generator worker.
|
|
842049
|
+
projectConfig,
|
|
842050
|
+
organization,
|
|
842051
|
+
workspace,
|
|
842052
|
+
context: context3,
|
|
842053
|
+
generatorGroup,
|
|
842054
|
+
version: version7,
|
|
842055
|
+
shouldLogS3Url,
|
|
842056
|
+
token,
|
|
842057
|
+
whitelabel,
|
|
842058
|
+
absolutePathToPreview,
|
|
842059
|
+
isPreview,
|
|
842060
|
+
fiddlePreview,
|
|
842061
|
+
pushPreviewBranch,
|
|
842062
|
+
mode,
|
|
842063
|
+
fernignorePath,
|
|
842064
|
+
skipFernignore,
|
|
842065
|
+
dynamicIrOnly,
|
|
842066
|
+
validateWorkspace,
|
|
842067
|
+
retryRateLimited,
|
|
842068
|
+
requireEnvVars,
|
|
842069
|
+
automationMode,
|
|
842070
|
+
autoMerge,
|
|
842071
|
+
automation,
|
|
842072
|
+
onSnippetsProduced: (invocation) => snippetsProducedBy.push(invocation)
|
|
842073
|
+
}))));
|
|
842074
|
+
if (automation == null && results.some((didSucceed) => !didSucceed)) {
|
|
842075
|
+
context3.failAndThrow();
|
|
842076
|
+
}
|
|
842077
|
+
return {
|
|
842078
|
+
snippetsProducedBy
|
|
842079
|
+
};
|
|
842080
|
+
}
|
|
842081
|
+
async function generateOne({ generatorInvocation, interactiveTaskContext, projectConfig, organization, workspace, context: context3, generatorGroup, version: version7, shouldLogS3Url, token, whitelabel, absolutePathToPreview, isPreview, fiddlePreview, pushPreviewBranch, mode, fernignorePath, skipFernignore, dynamicIrOnly, validateWorkspace, retryRateLimited, requireEnvVars, automationMode, autoMerge, automation, onSnippetsProduced }) {
|
|
842082
|
+
const startedAt = Date.now();
|
|
842083
|
+
try {
|
|
842008
842084
|
const settings = getBaseOpenAPIWorkspaceSettingsFromGeneratorInvocation(generatorInvocation);
|
|
842009
842085
|
const fernWorkspace = await workspace.toFernWorkspace({ context: context3 }, settings, generatorInvocation.apiOverride?.specs);
|
|
842010
842086
|
if (validateWorkspace) {
|
|
@@ -842064,8 +842140,8 @@ async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization,
|
|
|
842064
842140
|
automationMode,
|
|
842065
842141
|
autoMerge
|
|
842066
842142
|
});
|
|
842067
|
-
if (remoteTaskHandlerResponse
|
|
842068
|
-
|
|
842143
|
+
if (remoteTaskHandlerResponse?.createdSnippets) {
|
|
842144
|
+
onSnippetsProduced(generatorInvocation);
|
|
842069
842145
|
if (generatorInvocation.absolutePathToLocalSnippets != null && remoteTaskHandlerResponse.snippetsS3PreSignedReadUrl != null) {
|
|
842070
842146
|
await downloadSnippetsForTask({
|
|
842071
842147
|
snippetsS3PreSignedReadUrl: remoteTaskHandlerResponse.snippetsS3PreSignedReadUrl,
|
|
@@ -842074,14 +842150,27 @@ async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization,
|
|
|
842074
842150
|
});
|
|
842075
842151
|
}
|
|
842076
842152
|
}
|
|
842077
|
-
|
|
842078
|
-
|
|
842079
|
-
|
|
842080
|
-
|
|
842153
|
+
automation?.recorder.recordSuccess({
|
|
842154
|
+
apiName: workspace.workspaceName,
|
|
842155
|
+
groupName: generatorGroup.groupName,
|
|
842156
|
+
generatorName: generatorInvocation.name,
|
|
842157
|
+
version: remoteTaskHandlerResponse?.actualVersion ?? null,
|
|
842158
|
+
durationMs: Date.now() - startedAt
|
|
842159
|
+
});
|
|
842160
|
+
} catch (error50) {
|
|
842161
|
+
if (automation == null) {
|
|
842162
|
+
throw error50;
|
|
842163
|
+
}
|
|
842164
|
+
const message = extractErrorMessage(error50);
|
|
842165
|
+
automation.recorder.recordFailure({
|
|
842166
|
+
apiName: workspace.workspaceName,
|
|
842167
|
+
groupName: generatorGroup.groupName,
|
|
842168
|
+
generatorName: generatorInvocation.name,
|
|
842169
|
+
errorMessage: message,
|
|
842170
|
+
durationMs: Date.now() - startedAt
|
|
842171
|
+
});
|
|
842172
|
+
interactiveTaskContext.failWithoutThrowing(message);
|
|
842081
842173
|
}
|
|
842082
|
-
return {
|
|
842083
|
-
snippetsProducedBy
|
|
842084
|
-
};
|
|
842085
842174
|
}
|
|
842086
842175
|
|
|
842087
842176
|
// ../generation/remote-generation/remote-workspace-runner/lib/runRemoteGenerationForDocsWorkspace.js
|
|
@@ -843147,7 +843236,7 @@ var LegacyDocsPublisher = class {
|
|
|
843147
843236
|
previewId,
|
|
843148
843237
|
disableTemplates: void 0,
|
|
843149
843238
|
skipUpload,
|
|
843150
|
-
cliVersion: "4.
|
|
843239
|
+
cliVersion: "4.81.0"
|
|
843151
843240
|
});
|
|
843152
843241
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
843153
843242
|
return { success: false };
|
|
@@ -917724,6 +917813,7 @@ var TaskContextImpl = class {
|
|
|
917724
917813
|
result = TaskResult.Success;
|
|
917725
917814
|
logImmediately;
|
|
917726
917815
|
logPrefix;
|
|
917816
|
+
title;
|
|
917727
917817
|
subtasks = [];
|
|
917728
917818
|
shouldBufferLogs;
|
|
917729
917819
|
bufferedLogs = [];
|
|
@@ -917734,6 +917824,7 @@ var TaskContextImpl = class {
|
|
|
917734
917824
|
constructor({
|
|
917735
917825
|
logImmediately,
|
|
917736
917826
|
logPrefix,
|
|
917827
|
+
title: title3,
|
|
917737
917828
|
takeOverTerminal,
|
|
917738
917829
|
onResult,
|
|
917739
917830
|
shouldBufferLogs,
|
|
@@ -917742,6 +917833,7 @@ var TaskContextImpl = class {
|
|
|
917742
917833
|
}) {
|
|
917743
917834
|
this.logImmediately = logImmediately;
|
|
917744
917835
|
this.logPrefix = logPrefix ?? "";
|
|
917836
|
+
this.title = title3;
|
|
917745
917837
|
this.takeOverTerminal = takeOverTerminal;
|
|
917746
917838
|
this.onResult = onResult;
|
|
917747
917839
|
this.shouldBufferLogs = shouldBufferLogs;
|
|
@@ -917882,25 +917974,34 @@ var InteractiveTaskContextImpl = class extends TaskContextImpl {
|
|
|
917882
917974
|
}
|
|
917883
917975
|
lines.push(...this.subtasks.map((subtask) => subtask.print({ spinner })));
|
|
917884
917976
|
return addPrefixToString({
|
|
917885
|
-
prefix:
|
|
917977
|
+
prefix: this.getIcon({ spinner }),
|
|
917886
917978
|
content: lines.join("\n")
|
|
917887
917979
|
});
|
|
917888
917980
|
}
|
|
917889
917981
|
printInteractiveTasks({ spinner }) {
|
|
917890
917982
|
return this.print({ spinner });
|
|
917891
917983
|
}
|
|
917984
|
+
/**
|
|
917985
|
+
* Tasks with subtasks (e.g. a generator group whose children are individual generators)
|
|
917986
|
+
* render with a disclosure-triangle glyph instead of the leaf check/x/spinner, so the
|
|
917987
|
+
* tree shape is legible at a glance. Leaves keep the existing per-status glyphs.
|
|
917988
|
+
*
|
|
917989
|
+
* Every branch returns a string ending in a trailing space so the caller doesn't need
|
|
917990
|
+
* to pad — `spinner` from ora already includes one, and static glyphs add one explicitly.
|
|
917991
|
+
*/
|
|
917892
917992
|
getIcon({ spinner }) {
|
|
917993
|
+
const hasChildren2 = this.subtasks.length > 0;
|
|
917893
917994
|
switch (this.status) {
|
|
917894
917995
|
case "notStarted":
|
|
917895
|
-
return source_default.dim("\u25E6");
|
|
917996
|
+
return hasChildren2 ? source_default.dim("\u25B8 ") : source_default.dim("\u25E6 ");
|
|
917896
917997
|
case "running":
|
|
917897
|
-
return spinner;
|
|
917998
|
+
return hasChildren2 ? source_default.cyan("\u25BE ") : spinner;
|
|
917898
917999
|
case "finished":
|
|
917899
918000
|
switch (this.getResult()) {
|
|
917900
918001
|
case TaskResult.Success:
|
|
917901
|
-
return source_default.green("\u2713");
|
|
918002
|
+
return hasChildren2 ? source_default.green("\u25BE ") : source_default.green("\u2713 ");
|
|
917902
918003
|
case TaskResult.Failure:
|
|
917903
|
-
return source_default.red("x");
|
|
918004
|
+
return hasChildren2 ? source_default.red("\u25BE ") : source_default.red("x ");
|
|
917904
918005
|
}
|
|
917905
918006
|
}
|
|
917906
918007
|
}
|
|
@@ -918236,7 +918337,7 @@ var CliContext = class _CliContext {
|
|
|
918236
918337
|
if (false) {
|
|
918237
918338
|
this.logger.error("CLI_VERSION is not defined");
|
|
918238
918339
|
}
|
|
918239
|
-
return "4.
|
|
918340
|
+
return "4.81.0";
|
|
918240
918341
|
}
|
|
918241
918342
|
getCliName() {
|
|
918242
918343
|
if (false) {
|
|
@@ -918383,16 +918484,16 @@ var CliContext = class _CliContext {
|
|
|
918383
918484
|
logger = createLogger((level, ...args) => this.log(level, ...args));
|
|
918384
918485
|
stderr = createLogger((level, ...args) => this.logStderr(level, ...args));
|
|
918385
918486
|
constructTaskInitForWorkspace(workspace) {
|
|
918386
|
-
const
|
|
918387
|
-
|
|
918388
|
-
);
|
|
918487
|
+
const workspaceName = workspace.type === "docs" ? "docs" : workspace.workspaceName ?? "api";
|
|
918488
|
+
const prefixWithoutPadding = wrapWorkspaceNameForPrefix(workspaceName);
|
|
918389
918489
|
const minLengthForPrefix = 1 + (this.longestWorkspaceName != null ? wrapWorkspaceNameForPrefix(this.longestWorkspaceName) : prefixWithoutPadding).length;
|
|
918390
918490
|
const prefix2 = prefixWithoutPadding.padEnd(minLengthForPrefix);
|
|
918391
918491
|
const colorForWorkspace = WORKSPACE_NAME_COLORS[this.numTasks++ % WORKSPACE_NAME_COLORS.length];
|
|
918392
918492
|
const prefixWithColor = source_default.hex(colorForWorkspace)(prefix2);
|
|
918393
918493
|
return {
|
|
918394
918494
|
...this.constructTaskInit(),
|
|
918395
|
-
logPrefix: prefixWithColor
|
|
918495
|
+
logPrefix: prefixWithColor,
|
|
918496
|
+
title: source_default.hex(colorForWorkspace).bold(workspaceName)
|
|
918396
918497
|
};
|
|
918397
918498
|
}
|
|
918398
918499
|
constructTaskInit() {
|
|
@@ -919822,6 +919923,1007 @@ async function addGeneratorToWorkspaces({
|
|
|
919822
919923
|
);
|
|
919823
919924
|
}
|
|
919824
919925
|
|
|
919926
|
+
// src/commands/generate/filterGenerators.ts
|
|
919927
|
+
function parseGeneratorArg(generatorArg) {
|
|
919928
|
+
if (generatorArg == null) {
|
|
919929
|
+
return { generatorName: void 0, generatorIndex: void 0 };
|
|
919930
|
+
}
|
|
919931
|
+
const parsed = generatorArg.length > 0 ? Number(generatorArg) : Number.NaN;
|
|
919932
|
+
if (!Number.isNaN(parsed) && Number.isInteger(parsed) && parsed >= 0) {
|
|
919933
|
+
return { generatorName: void 0, generatorIndex: parsed };
|
|
919934
|
+
}
|
|
919935
|
+
return { generatorName: generatorArg, generatorIndex: void 0 };
|
|
919936
|
+
}
|
|
919937
|
+
function filterGenerators({
|
|
919938
|
+
generators,
|
|
919939
|
+
generatorIndex,
|
|
919940
|
+
generatorName,
|
|
919941
|
+
groupName
|
|
919942
|
+
}) {
|
|
919943
|
+
if (generatorIndex != null) {
|
|
919944
|
+
const generator = generators[generatorIndex];
|
|
919945
|
+
if (generator == null) {
|
|
919946
|
+
return {
|
|
919947
|
+
ok: false,
|
|
919948
|
+
error: `Generator index ${generatorIndex} is out of bounds in group '${groupName}' (${generators.length} generators available)`
|
|
919949
|
+
};
|
|
919950
|
+
}
|
|
919951
|
+
return { ok: true, generators: [generator] };
|
|
919952
|
+
}
|
|
919953
|
+
if (generatorName != null) {
|
|
919954
|
+
const filtered = generators.filter((gen) => gen.name === generatorName);
|
|
919955
|
+
if (filtered.length === 0) {
|
|
919956
|
+
const available = generators.map((gen) => gen.name);
|
|
919957
|
+
return {
|
|
919958
|
+
ok: false,
|
|
919959
|
+
error: `Generator '${generatorName}' not found in group '${groupName}'. Available generators: ${available.join(", ")}`
|
|
919960
|
+
};
|
|
919961
|
+
}
|
|
919962
|
+
return { ok: true, generators: filtered };
|
|
919963
|
+
}
|
|
919964
|
+
return { ok: true, generators };
|
|
919965
|
+
}
|
|
919966
|
+
|
|
919967
|
+
// src/commands/generate/generateAPIWorkspaces.ts
|
|
919968
|
+
init_lib6();
|
|
919969
|
+
|
|
919970
|
+
// src/constants.ts
|
|
919971
|
+
var API_CLI_OPTION = "api";
|
|
919972
|
+
var GROUP_CLI_OPTION = "group";
|
|
919973
|
+
var PREVIEW_DIRECTORY = ".preview";
|
|
919974
|
+
var APPROVED_DIRECTORIES_FILENAME = "approved-output-directories";
|
|
919975
|
+
var LOCAL_STORAGE_FOLDER6 = ".fern-dev";
|
|
919976
|
+
|
|
919977
|
+
// src/commands/generate/checkOutputDirectory.ts
|
|
919978
|
+
init_lib6();
|
|
919979
|
+
var import_promises136 = require("fs/promises");
|
|
919980
|
+
|
|
919981
|
+
// src/persistence/output-directories/getOutputDirectories.ts
|
|
919982
|
+
init_lib6();
|
|
919983
|
+
var import_promises134 = require("fs/promises");
|
|
919984
|
+
|
|
919985
|
+
// src/persistence/output-directories/getPathToOutputDirectoriesFile.ts
|
|
919986
|
+
init_lib6();
|
|
919987
|
+
var import_os16 = require("os");
|
|
919988
|
+
function getPathToOutputDirectoriesFile() {
|
|
919989
|
+
return join8(
|
|
919990
|
+
AbsoluteFilePath2.of((0, import_os16.homedir)()),
|
|
919991
|
+
RelativeFilePath2.of(LOCAL_STORAGE_FOLDER6),
|
|
919992
|
+
RelativeFilePath2.of(APPROVED_DIRECTORIES_FILENAME)
|
|
919993
|
+
);
|
|
919994
|
+
}
|
|
919995
|
+
|
|
919996
|
+
// src/persistence/output-directories/getOutputDirectories.ts
|
|
919997
|
+
async function getOutputDirectories() {
|
|
919998
|
+
const pathToOutputDirectoriesFile = getPathToOutputDirectoriesFile();
|
|
919999
|
+
const doesOutputDirectoriesFileExist = await doesPathExist(pathToOutputDirectoriesFile);
|
|
920000
|
+
if (!doesOutputDirectoriesFileExist) {
|
|
920001
|
+
return [];
|
|
920002
|
+
}
|
|
920003
|
+
const outputDirectoriesFileContents = await (0, import_promises134.readFile)(pathToOutputDirectoriesFile, { encoding: "utf-8" });
|
|
920004
|
+
const outputDirectories = JSON.parse(outputDirectoriesFileContents);
|
|
920005
|
+
return outputDirectories;
|
|
920006
|
+
}
|
|
920007
|
+
|
|
920008
|
+
// src/persistence/output-directories/storeOutputDirectories.ts
|
|
920009
|
+
var import_promises135 = require("fs/promises");
|
|
920010
|
+
var import_path85 = __toESM(require("path"), 1);
|
|
920011
|
+
async function storeOutputDirectories(outputDirectories) {
|
|
920012
|
+
await (0, import_promises135.mkdir)(import_path85.default.dirname(getPathToOutputDirectoriesFile()), { recursive: true });
|
|
920013
|
+
await (0, import_promises135.writeFile)(getPathToOutputDirectoriesFile(), JSON.stringify(outputDirectories, null, 2));
|
|
920014
|
+
}
|
|
920015
|
+
|
|
920016
|
+
// src/commands/generate/checkOutputDirectory.ts
|
|
920017
|
+
async function checkOutputDirectory(outputPath, cliContext, force) {
|
|
920018
|
+
if (!outputPath || isCI() || force) {
|
|
920019
|
+
return {
|
|
920020
|
+
shouldProceed: true
|
|
920021
|
+
};
|
|
920022
|
+
}
|
|
920023
|
+
const savedDirectories = await getOutputDirectories();
|
|
920024
|
+
if (savedDirectories?.includes(outputPath)) {
|
|
920025
|
+
return {
|
|
920026
|
+
shouldProceed: true
|
|
920027
|
+
};
|
|
920028
|
+
}
|
|
920029
|
+
const doesExist = await doesPathExist(outputPath);
|
|
920030
|
+
if (!doesExist) {
|
|
920031
|
+
return {
|
|
920032
|
+
shouldProceed: true
|
|
920033
|
+
};
|
|
920034
|
+
}
|
|
920035
|
+
const files = await (0, import_promises136.readdir)(outputPath);
|
|
920036
|
+
if (files.length === 0) {
|
|
920037
|
+
return {
|
|
920038
|
+
shouldProceed: true
|
|
920039
|
+
};
|
|
920040
|
+
}
|
|
920041
|
+
const shouldOverwrite = await cliContext.confirmPrompt(
|
|
920042
|
+
`Directory ${outputPath} contains existing files that may be overwritten. Continue?`,
|
|
920043
|
+
false
|
|
920044
|
+
);
|
|
920045
|
+
if (!shouldOverwrite) {
|
|
920046
|
+
return {
|
|
920047
|
+
shouldProceed: false
|
|
920048
|
+
};
|
|
920049
|
+
}
|
|
920050
|
+
await storeOutputDirectories([...savedDirectories ?? [], outputPath]);
|
|
920051
|
+
return {
|
|
920052
|
+
shouldProceed: true
|
|
920053
|
+
};
|
|
920054
|
+
}
|
|
920055
|
+
|
|
920056
|
+
// src/commands/generate/generateAPIWorkspace.ts
|
|
920057
|
+
init_lib6();
|
|
920058
|
+
|
|
920059
|
+
// src/commands/generate/resolveGroupAlias.ts
|
|
920060
|
+
function resolveGroupAlias({
|
|
920061
|
+
name: name2,
|
|
920062
|
+
groupAliases,
|
|
920063
|
+
availableGroupNames
|
|
920064
|
+
}) {
|
|
920065
|
+
const aliasTargets = groupAliases[name2];
|
|
920066
|
+
if (aliasTargets != null) {
|
|
920067
|
+
for (const target of aliasTargets) {
|
|
920068
|
+
if (!availableGroupNames.includes(target)) {
|
|
920069
|
+
return {
|
|
920070
|
+
type: "alias-references-missing-group",
|
|
920071
|
+
alias: name2,
|
|
920072
|
+
missingGroupName: target,
|
|
920073
|
+
availableGroupNames
|
|
920074
|
+
};
|
|
920075
|
+
}
|
|
920076
|
+
}
|
|
920077
|
+
return { type: "resolved", groupNames: aliasTargets };
|
|
920078
|
+
}
|
|
920079
|
+
if (availableGroupNames.includes(name2)) {
|
|
920080
|
+
return { type: "resolved", groupNames: [name2] };
|
|
920081
|
+
}
|
|
920082
|
+
return {
|
|
920083
|
+
type: "unknown",
|
|
920084
|
+
name: name2,
|
|
920085
|
+
availableGroupNames,
|
|
920086
|
+
availableAliasNames: Object.keys(groupAliases)
|
|
920087
|
+
};
|
|
920088
|
+
}
|
|
920089
|
+
|
|
920090
|
+
// src/commands/generate/resolveGroupNamesForGeneration.ts
|
|
920091
|
+
function resolveGroupNamesForGeneration({
|
|
920092
|
+
groupName,
|
|
920093
|
+
generatorsConfiguration,
|
|
920094
|
+
isAutomation
|
|
920095
|
+
}) {
|
|
920096
|
+
if (isAutomation && groupName == null) {
|
|
920097
|
+
return {
|
|
920098
|
+
type: "fan-out",
|
|
920099
|
+
groupNames: generatorsConfiguration.groups.map((g8) => g8.groupName)
|
|
920100
|
+
};
|
|
920101
|
+
}
|
|
920102
|
+
const effective = groupName ?? generatorsConfiguration.defaultGroup;
|
|
920103
|
+
if (effective == null) {
|
|
920104
|
+
return {
|
|
920105
|
+
type: "missing-group",
|
|
920106
|
+
availableGroupNames: generatorsConfiguration.groups.map((g8) => g8.groupName)
|
|
920107
|
+
};
|
|
920108
|
+
}
|
|
920109
|
+
return {
|
|
920110
|
+
type: "targeted",
|
|
920111
|
+
groupName: effective,
|
|
920112
|
+
fromDefaultGroup: groupName == null
|
|
920113
|
+
};
|
|
920114
|
+
}
|
|
920115
|
+
|
|
920116
|
+
// src/commands/generate/describeSkipReason.ts
|
|
920117
|
+
function describeSkipReason(generator, rootAutorelease) {
|
|
920118
|
+
if (!generator.automation.generate) {
|
|
920119
|
+
return "automations.generate is false";
|
|
920120
|
+
}
|
|
920121
|
+
if (generator.absolutePathToLocalOutput != null) {
|
|
920122
|
+
return "output is configured for local-file-system (cannot run remotely)";
|
|
920123
|
+
}
|
|
920124
|
+
if (generator.raw?.autorelease === false) {
|
|
920125
|
+
return "autorelease is false";
|
|
920126
|
+
}
|
|
920127
|
+
if (generator.raw?.autorelease == null && rootAutorelease === false) {
|
|
920128
|
+
return "autorelease is false at the root of generators.yml";
|
|
920129
|
+
}
|
|
920130
|
+
return null;
|
|
920131
|
+
}
|
|
920132
|
+
|
|
920133
|
+
// src/commands/generate/shouldSkipGenerator.ts
|
|
920134
|
+
function shouldSkipGenerator({
|
|
920135
|
+
generator,
|
|
920136
|
+
rootAutorelease
|
|
920137
|
+
}) {
|
|
920138
|
+
return describeSkipReason(generator, rootAutorelease) != null;
|
|
920139
|
+
}
|
|
920140
|
+
|
|
920141
|
+
// src/commands/generate/selectGeneratorsForAutomation.ts
|
|
920142
|
+
function buildAutomationTargeting({
|
|
920143
|
+
generatorIndex,
|
|
920144
|
+
generatorName
|
|
920145
|
+
}) {
|
|
920146
|
+
if (generatorIndex != null) {
|
|
920147
|
+
return { type: "index", index: generatorIndex };
|
|
920148
|
+
}
|
|
920149
|
+
if (generatorName != null) {
|
|
920150
|
+
return { type: "name", name: generatorName };
|
|
920151
|
+
}
|
|
920152
|
+
return { type: "none" };
|
|
920153
|
+
}
|
|
920154
|
+
function selectGeneratorsForAutomation({
|
|
920155
|
+
generators,
|
|
920156
|
+
rootAutorelease,
|
|
920157
|
+
targeting
|
|
920158
|
+
}) {
|
|
920159
|
+
if (targeting.type === "index") {
|
|
920160
|
+
for (const g8 of generators) {
|
|
920161
|
+
const reason = describeSkipReason(g8, rootAutorelease);
|
|
920162
|
+
if (reason != null) {
|
|
920163
|
+
return { type: "reject-opted-out", generatorName: g8.name, index: targeting.index, reason };
|
|
920164
|
+
}
|
|
920165
|
+
}
|
|
920166
|
+
return { type: "run", generators };
|
|
920167
|
+
}
|
|
920168
|
+
const eligible = generators.filter((g8) => !shouldSkipGenerator({ generator: g8, rootAutorelease }));
|
|
920169
|
+
if (eligible.length === 0) {
|
|
920170
|
+
return { type: "empty-after-skip" };
|
|
920171
|
+
}
|
|
920172
|
+
return { type: "run", generators: eligible };
|
|
920173
|
+
}
|
|
920174
|
+
|
|
920175
|
+
// src/commands/generate/shouldSkipMissingGenerator.ts
|
|
920176
|
+
function shouldSkipMissingGenerator({
|
|
920177
|
+
automation,
|
|
920178
|
+
generatorName,
|
|
920179
|
+
generatorIndex
|
|
920180
|
+
}) {
|
|
920181
|
+
return automation != null && generatorName != null && generatorIndex == null;
|
|
920182
|
+
}
|
|
920183
|
+
|
|
920184
|
+
// src/commands/generate/generateAPIWorkspace.ts
|
|
920185
|
+
async function generateWorkspace({
|
|
920186
|
+
organization,
|
|
920187
|
+
workspace,
|
|
920188
|
+
projectConfig,
|
|
920189
|
+
context: context3,
|
|
920190
|
+
groupName,
|
|
920191
|
+
generatorName,
|
|
920192
|
+
generatorIndex,
|
|
920193
|
+
version: version7,
|
|
920194
|
+
shouldLogS3Url,
|
|
920195
|
+
token,
|
|
920196
|
+
useLocalDocker,
|
|
920197
|
+
keepDocker,
|
|
920198
|
+
absolutePathToPreview,
|
|
920199
|
+
mode,
|
|
920200
|
+
runner,
|
|
920201
|
+
inspect: inspect6,
|
|
920202
|
+
lfsOverride,
|
|
920203
|
+
fernignorePath,
|
|
920204
|
+
skipFernignore,
|
|
920205
|
+
dynamicIrOnly,
|
|
920206
|
+
noReplay,
|
|
920207
|
+
retryRateLimited,
|
|
920208
|
+
requireEnvVars,
|
|
920209
|
+
automationMode,
|
|
920210
|
+
autoMerge,
|
|
920211
|
+
automation
|
|
920212
|
+
}) {
|
|
920213
|
+
if (workspace.generatorsConfiguration == null) {
|
|
920214
|
+
context3.logger.warn("This workspaces has no generators.yml");
|
|
920215
|
+
return;
|
|
920216
|
+
}
|
|
920217
|
+
if (workspace.generatorsConfiguration.groups.length === 0) {
|
|
920218
|
+
context3.logger.warn(`This workspace has no groups specified in ${GENERATORS_CONFIGURATION_FILENAME}`);
|
|
920219
|
+
return;
|
|
920220
|
+
}
|
|
920221
|
+
const resolvedGroupNames = resolveGroupsOrFail({
|
|
920222
|
+
groupName,
|
|
920223
|
+
generatorsConfiguration: workspace.generatorsConfiguration,
|
|
920224
|
+
isAutomation: automation != null,
|
|
920225
|
+
context: context3
|
|
920226
|
+
});
|
|
920227
|
+
const { ai: ai10, replay } = workspace.generatorsConfiguration;
|
|
920228
|
+
if (!useLocalDocker && !token) {
|
|
920229
|
+
return context3.failAndThrow("Please run fern login", void 0, { code: CliError.Code.AuthError });
|
|
920230
|
+
}
|
|
920231
|
+
const runnableGroups = resolvedGroupNames.flatMap((resolvedGroupName) => {
|
|
920232
|
+
const runnable = resolveRunnableGroup({
|
|
920233
|
+
resolvedGroupName,
|
|
920234
|
+
workspace,
|
|
920235
|
+
generatorIndex,
|
|
920236
|
+
generatorName,
|
|
920237
|
+
automation,
|
|
920238
|
+
lfsOverride,
|
|
920239
|
+
context: context3,
|
|
920240
|
+
useLocalDocker,
|
|
920241
|
+
token
|
|
920242
|
+
});
|
|
920243
|
+
return runnable != null ? [{ resolvedGroupName, group: runnable }] : [];
|
|
920244
|
+
});
|
|
920245
|
+
await Promise.all(
|
|
920246
|
+
runnableGroups.map(
|
|
920247
|
+
({ resolvedGroupName, group }) => context3.runInteractiveTask({ name: resolvedGroupName }, async (groupContext) => {
|
|
920248
|
+
if (useLocalDocker) {
|
|
920249
|
+
await runLocalGenerationForWorkspace({
|
|
920250
|
+
token,
|
|
920251
|
+
projectConfig,
|
|
920252
|
+
workspace,
|
|
920253
|
+
generatorGroup: group,
|
|
920254
|
+
version: version7,
|
|
920255
|
+
keepDocker,
|
|
920256
|
+
context: groupContext,
|
|
920257
|
+
runner,
|
|
920258
|
+
absolutePathToPreview,
|
|
920259
|
+
inspect: inspect6,
|
|
920260
|
+
ai: ai10,
|
|
920261
|
+
replay,
|
|
920262
|
+
noReplay,
|
|
920263
|
+
validateWorkspace: true,
|
|
920264
|
+
requireEnvVars,
|
|
920265
|
+
skipFernignore,
|
|
920266
|
+
automationMode,
|
|
920267
|
+
autoMerge
|
|
920268
|
+
});
|
|
920269
|
+
} else if (token != null) {
|
|
920270
|
+
await runRemoteGenerationForAPIWorkspace({
|
|
920271
|
+
projectConfig,
|
|
920272
|
+
organization,
|
|
920273
|
+
workspace,
|
|
920274
|
+
context: groupContext,
|
|
920275
|
+
generatorGroup: group,
|
|
920276
|
+
version: version7,
|
|
920277
|
+
shouldLogS3Url,
|
|
920278
|
+
token,
|
|
920279
|
+
whitelabel: workspace.generatorsConfiguration?.whitelabel,
|
|
920280
|
+
absolutePathToPreview,
|
|
920281
|
+
mode,
|
|
920282
|
+
fernignorePath,
|
|
920283
|
+
skipFernignore,
|
|
920284
|
+
dynamicIrOnly,
|
|
920285
|
+
validateWorkspace: true,
|
|
920286
|
+
retryRateLimited,
|
|
920287
|
+
requireEnvVars,
|
|
920288
|
+
automationMode,
|
|
920289
|
+
autoMerge,
|
|
920290
|
+
automation
|
|
920291
|
+
});
|
|
920292
|
+
}
|
|
920293
|
+
})
|
|
920294
|
+
)
|
|
920295
|
+
);
|
|
920296
|
+
}
|
|
920297
|
+
function resolveRunnableGroup({
|
|
920298
|
+
resolvedGroupName,
|
|
920299
|
+
workspace,
|
|
920300
|
+
generatorIndex,
|
|
920301
|
+
generatorName,
|
|
920302
|
+
automation,
|
|
920303
|
+
lfsOverride,
|
|
920304
|
+
context: context3,
|
|
920305
|
+
useLocalDocker,
|
|
920306
|
+
token
|
|
920307
|
+
}) {
|
|
920308
|
+
let group = workspace.generatorsConfiguration?.groups.find(
|
|
920309
|
+
(otherGroup) => otherGroup.groupName === resolvedGroupName
|
|
920310
|
+
);
|
|
920311
|
+
if (group == null) {
|
|
920312
|
+
return context3.failAndThrow(`Group '${resolvedGroupName}' does not exist.`, void 0, {
|
|
920313
|
+
code: CliError.Code.ConfigError
|
|
920314
|
+
});
|
|
920315
|
+
}
|
|
920316
|
+
const filterResult = filterGenerators({
|
|
920317
|
+
generators: group.generators,
|
|
920318
|
+
generatorIndex,
|
|
920319
|
+
generatorName,
|
|
920320
|
+
groupName: resolvedGroupName
|
|
920321
|
+
});
|
|
920322
|
+
if (!filterResult.ok) {
|
|
920323
|
+
if (shouldSkipMissingGenerator({ automation, generatorName, generatorIndex })) {
|
|
920324
|
+
return null;
|
|
920325
|
+
}
|
|
920326
|
+
return context3.failAndThrow(filterResult.error, void 0, { code: CliError.Code.ConfigError });
|
|
920327
|
+
}
|
|
920328
|
+
let filteredGenerators = filterResult.generators;
|
|
920329
|
+
if (automation != null) {
|
|
920330
|
+
const selection = selectGeneratorsForAutomation({
|
|
920331
|
+
generators: filteredGenerators,
|
|
920332
|
+
rootAutorelease: workspace.generatorsConfiguration?.rawConfiguration.autorelease,
|
|
920333
|
+
targeting: buildAutomationTargeting({ generatorIndex, generatorName })
|
|
920334
|
+
});
|
|
920335
|
+
if (selection.type === "reject-opted-out") {
|
|
920336
|
+
return context3.failAndThrow(
|
|
920337
|
+
`Generator '${selection.generatorName}' at index ${selection.index} in group '${resolvedGroupName}' is excluded from automation: ${selection.reason}. Target by name instead to have opt-outs filtered silently, drop the --generator flag to fan out across eligible generators, or re-enable automation for this generator in generators.yml.`,
|
|
920338
|
+
void 0,
|
|
920339
|
+
{ code: CliError.Code.ConfigError }
|
|
920340
|
+
);
|
|
920341
|
+
}
|
|
920342
|
+
if (selection.type === "empty-after-skip") {
|
|
920343
|
+
return null;
|
|
920344
|
+
}
|
|
920345
|
+
filteredGenerators = selection.generators;
|
|
920346
|
+
}
|
|
920347
|
+
group = { ...group, generators: filteredGenerators };
|
|
920348
|
+
if (lfsOverride != null) {
|
|
920349
|
+
group = applyLfsOverride(group, lfsOverride, context3);
|
|
920350
|
+
}
|
|
920351
|
+
if (!useLocalDocker && token != null) {
|
|
920352
|
+
const customImageGenerators = group.generators.filter((g8) => g8.containerImage != null);
|
|
920353
|
+
if (customImageGenerators.length > 0) {
|
|
920354
|
+
const names2 = customImageGenerators.map((g8) => g8.name).join(", ");
|
|
920355
|
+
return context3.failAndThrow(
|
|
920356
|
+
`Custom image configurations are only supported with local generation (--local). The following generators use custom images: ${names2}`
|
|
920357
|
+
);
|
|
920358
|
+
}
|
|
920359
|
+
}
|
|
920360
|
+
return group;
|
|
920361
|
+
}
|
|
920362
|
+
function resolveGroupsOrFail({
|
|
920363
|
+
groupName,
|
|
920364
|
+
generatorsConfiguration,
|
|
920365
|
+
isAutomation,
|
|
920366
|
+
context: context3
|
|
920367
|
+
}) {
|
|
920368
|
+
const resolution = resolveGroupNamesForGeneration({ groupName, generatorsConfiguration, isAutomation });
|
|
920369
|
+
if (resolution.type === "fan-out") {
|
|
920370
|
+
return resolution.groupNames;
|
|
920371
|
+
}
|
|
920372
|
+
if (resolution.type === "missing-group") {
|
|
920373
|
+
const longestGroupName = Math.max(...resolution.availableGroupNames.map((name2) => name2.length));
|
|
920374
|
+
const currentArgs = process.argv.slice(2).join(" ");
|
|
920375
|
+
const suggestions = resolution.availableGroupNames.map((name2) => {
|
|
920376
|
+
const suggestedCommand = `fern ${currentArgs} --${GROUP_CLI_OPTION} ${name2}`;
|
|
920377
|
+
return ` \u203A ${source_default.bold(name2.padEnd(longestGroupName))} ${source_default.dim(suggestedCommand)}`;
|
|
920378
|
+
}).join("\n");
|
|
920379
|
+
context3.failAndThrow(
|
|
920380
|
+
`No group specified. Use the --${GROUP_CLI_OPTION} option, or set "${DEFAULT_GROUP_GENERATORS_CONFIG_KEY}" in ${GENERATORS_CONFIGURATION_FILENAME}:
|
|
920381
|
+
${suggestions}`,
|
|
920382
|
+
void 0,
|
|
920383
|
+
{ code: CliError.Code.NetworkError }
|
|
920384
|
+
);
|
|
920385
|
+
return [];
|
|
920386
|
+
}
|
|
920387
|
+
if (resolution.fromDefaultGroup) {
|
|
920388
|
+
context3.logger.info(
|
|
920389
|
+
source_default.dim(`Using default group '${resolution.groupName}' from ${GENERATORS_CONFIGURATION_FILENAME}`)
|
|
920390
|
+
);
|
|
920391
|
+
}
|
|
920392
|
+
const aliasResult = resolveGroupAlias({
|
|
920393
|
+
name: resolution.groupName,
|
|
920394
|
+
groupAliases: generatorsConfiguration.groupAliases,
|
|
920395
|
+
availableGroupNames: generatorsConfiguration.groups.map((g8) => g8.groupName)
|
|
920396
|
+
});
|
|
920397
|
+
if (aliasResult.type === "alias-references-missing-group") {
|
|
920398
|
+
context3.failAndThrow(
|
|
920399
|
+
`Group alias '${aliasResult.alias}' references non-existent group '${aliasResult.missingGroupName}'. Available groups: ${aliasResult.availableGroupNames.join(", ")}`,
|
|
920400
|
+
void 0,
|
|
920401
|
+
{ code: CliError.Code.NetworkError }
|
|
920402
|
+
);
|
|
920403
|
+
return [];
|
|
920404
|
+
}
|
|
920405
|
+
if (aliasResult.type === "unknown") {
|
|
920406
|
+
const aliasesSuffix = aliasResult.availableAliasNames.length > 0 ? `. Available aliases: ${aliasResult.availableAliasNames.join(", ")}` : "";
|
|
920407
|
+
context3.failAndThrow(
|
|
920408
|
+
`'${aliasResult.name}' is not a valid group or alias. Available groups: ${aliasResult.availableGroupNames.join(", ")}${aliasesSuffix}`,
|
|
920409
|
+
void 0,
|
|
920410
|
+
{ code: CliError.Code.NetworkError }
|
|
920411
|
+
);
|
|
920412
|
+
return [];
|
|
920413
|
+
}
|
|
920414
|
+
return aliasResult.groupNames;
|
|
920415
|
+
}
|
|
920416
|
+
function applyLfsOverride(group, lfsOverridePath, context3) {
|
|
920417
|
+
const baseAbsolutePath = AbsoluteFilePath2.of(resolve6(cwd(), lfsOverridePath));
|
|
920418
|
+
const languageCount = {};
|
|
920419
|
+
const modifiedGenerators = [];
|
|
920420
|
+
for (const generator of group.generators) {
|
|
920421
|
+
const language = generator.language ?? getLanguageFromGeneratorName3(generator.name);
|
|
920422
|
+
let outputPath;
|
|
920423
|
+
if (group.generators.length === 1) {
|
|
920424
|
+
outputPath = baseAbsolutePath;
|
|
920425
|
+
} else {
|
|
920426
|
+
const languageDir = language || "unknown";
|
|
920427
|
+
if (languageCount[languageDir] == null) {
|
|
920428
|
+
languageCount[languageDir] = 0;
|
|
920429
|
+
}
|
|
920430
|
+
languageCount[languageDir]++;
|
|
920431
|
+
const dirName = languageCount[languageDir] === 1 ? languageDir : `${languageDir}-${languageCount[languageDir]}`;
|
|
920432
|
+
outputPath = join8(baseAbsolutePath, RelativeFilePath2.of(dirName));
|
|
920433
|
+
}
|
|
920434
|
+
const modifiedGenerator = {
|
|
920435
|
+
...generator,
|
|
920436
|
+
outputMode: api_exports4.remoteGen.OutputMode.downloadFiles({}),
|
|
920437
|
+
absolutePathToLocalOutput: outputPath
|
|
920438
|
+
};
|
|
920439
|
+
modifiedGenerators.push(modifiedGenerator);
|
|
920440
|
+
context3.logger.info(
|
|
920441
|
+
`Overriding output for generator '${generator.name}' to local-file-system at: ${outputPath}`
|
|
920442
|
+
);
|
|
920443
|
+
}
|
|
920444
|
+
return {
|
|
920445
|
+
...group,
|
|
920446
|
+
generators: modifiedGenerators
|
|
920447
|
+
};
|
|
920448
|
+
}
|
|
920449
|
+
function getLanguageFromGeneratorName3(generatorName) {
|
|
920450
|
+
if (generatorName.includes("typescript") || generatorName.includes("ts")) {
|
|
920451
|
+
return "typescript";
|
|
920452
|
+
}
|
|
920453
|
+
if (generatorName.includes("python") || generatorName.includes("py")) {
|
|
920454
|
+
return "python";
|
|
920455
|
+
}
|
|
920456
|
+
if (generatorName.includes("java")) {
|
|
920457
|
+
return "java";
|
|
920458
|
+
}
|
|
920459
|
+
if (generatorName.includes("go")) {
|
|
920460
|
+
return "go";
|
|
920461
|
+
}
|
|
920462
|
+
if (generatorName.includes("ruby")) {
|
|
920463
|
+
return "ruby";
|
|
920464
|
+
}
|
|
920465
|
+
if (generatorName.includes("csharp") || generatorName.includes("c#")) {
|
|
920466
|
+
return "csharp";
|
|
920467
|
+
}
|
|
920468
|
+
if (generatorName.includes("swift")) {
|
|
920469
|
+
return "swift";
|
|
920470
|
+
}
|
|
920471
|
+
if (generatorName.includes("php")) {
|
|
920472
|
+
return "php";
|
|
920473
|
+
}
|
|
920474
|
+
if (generatorName.includes("rust")) {
|
|
920475
|
+
return "rust";
|
|
920476
|
+
}
|
|
920477
|
+
return generatorName.replace(/[^a-zA-Z0-9]/g, "-").toLowerCase();
|
|
920478
|
+
}
|
|
920479
|
+
|
|
920480
|
+
// src/commands/generate/resolvePosthogCommandLabel.ts
|
|
920481
|
+
function resolvePosthogCommandLabel(automation) {
|
|
920482
|
+
return automation != null ? "fern automations generate" : "fern generate";
|
|
920483
|
+
}
|
|
920484
|
+
|
|
920485
|
+
// src/commands/generate/shouldPreflightGenerator.ts
|
|
920486
|
+
function shouldPreflightGenerator({
|
|
920487
|
+
generator,
|
|
920488
|
+
rootAutorelease,
|
|
920489
|
+
automation
|
|
920490
|
+
}) {
|
|
920491
|
+
if (automation == null) {
|
|
920492
|
+
return true;
|
|
920493
|
+
}
|
|
920494
|
+
return !shouldSkipGenerator({ generator, rootAutorelease });
|
|
920495
|
+
}
|
|
920496
|
+
|
|
920497
|
+
// src/commands/generate/generateAPIWorkspaces.ts
|
|
920498
|
+
var GenerationMode = {
|
|
920499
|
+
PullRequest: "pull-request"
|
|
920500
|
+
};
|
|
920501
|
+
async function generateAPIWorkspaces({
|
|
920502
|
+
project,
|
|
920503
|
+
cliContext,
|
|
920504
|
+
version: version7,
|
|
920505
|
+
groupName,
|
|
920506
|
+
generatorName,
|
|
920507
|
+
generatorIndex,
|
|
920508
|
+
shouldLogS3Url,
|
|
920509
|
+
keepDocker,
|
|
920510
|
+
useLocalDocker,
|
|
920511
|
+
preview,
|
|
920512
|
+
mode,
|
|
920513
|
+
force,
|
|
920514
|
+
runner,
|
|
920515
|
+
inspect: inspect6,
|
|
920516
|
+
lfsOverride,
|
|
920517
|
+
fernignorePath,
|
|
920518
|
+
skipFernignore,
|
|
920519
|
+
dynamicIrOnly,
|
|
920520
|
+
outputDir,
|
|
920521
|
+
noReplay,
|
|
920522
|
+
retryRateLimited,
|
|
920523
|
+
requireEnvVars,
|
|
920524
|
+
automationMode,
|
|
920525
|
+
autoMerge,
|
|
920526
|
+
automation
|
|
920527
|
+
}) {
|
|
920528
|
+
let token = void 0;
|
|
920529
|
+
if (!useLocalDocker) {
|
|
920530
|
+
const currentToken = await cliContext.runTask(async (context3) => {
|
|
920531
|
+
return askToLogin(context3);
|
|
920532
|
+
});
|
|
920533
|
+
if (currentToken.type === "user") {
|
|
920534
|
+
await cliContext.runTask(async (context3) => {
|
|
920535
|
+
await createOrganizationIfDoesNotExist({
|
|
920536
|
+
organization: project.config.organization,
|
|
920537
|
+
token: currentToken,
|
|
920538
|
+
context: context3
|
|
920539
|
+
});
|
|
920540
|
+
});
|
|
920541
|
+
}
|
|
920542
|
+
token = currentToken;
|
|
920543
|
+
}
|
|
920544
|
+
await confirmOutputDirectoriesForEligibleGenerators({
|
|
920545
|
+
project,
|
|
920546
|
+
groupName,
|
|
920547
|
+
generatorName,
|
|
920548
|
+
generatorIndex,
|
|
920549
|
+
automation,
|
|
920550
|
+
cliContext,
|
|
920551
|
+
force
|
|
920552
|
+
});
|
|
920553
|
+
cliContext.instrumentPostHogEvent({
|
|
920554
|
+
orgId: project.config.organization,
|
|
920555
|
+
command: resolvePosthogCommandLabel(automation),
|
|
920556
|
+
properties: {
|
|
920557
|
+
workspaces: buildPosthogWorkspaces({ project, groupName, generatorName })
|
|
920558
|
+
}
|
|
920559
|
+
});
|
|
920560
|
+
await Promise.all(
|
|
920561
|
+
project.apiWorkspaces.map(async (workspace) => {
|
|
920562
|
+
await cliContext.runTaskForWorkspace(workspace, async (context3) => {
|
|
920563
|
+
const absolutePathToPreview = preview ? outputDir != null ? AbsoluteFilePath2.of(resolve6(cwd(), outputDir)) : join8(workspace.absoluteFilePath, RelativeFilePath2.of(PREVIEW_DIRECTORY)) : void 0;
|
|
920564
|
+
if (absolutePathToPreview != null) {
|
|
920565
|
+
context3.logger.info(`Writing preview to ${absolutePathToPreview}`);
|
|
920566
|
+
}
|
|
920567
|
+
await generateWorkspace({
|
|
920568
|
+
organization: project.config.organization,
|
|
920569
|
+
workspace,
|
|
920570
|
+
projectConfig: project.config,
|
|
920571
|
+
context: context3,
|
|
920572
|
+
version: version7,
|
|
920573
|
+
groupName,
|
|
920574
|
+
generatorName,
|
|
920575
|
+
generatorIndex,
|
|
920576
|
+
shouldLogS3Url,
|
|
920577
|
+
token,
|
|
920578
|
+
useLocalDocker,
|
|
920579
|
+
keepDocker,
|
|
920580
|
+
absolutePathToPreview,
|
|
920581
|
+
mode,
|
|
920582
|
+
runner,
|
|
920583
|
+
inspect: inspect6,
|
|
920584
|
+
lfsOverride,
|
|
920585
|
+
fernignorePath,
|
|
920586
|
+
skipFernignore,
|
|
920587
|
+
dynamicIrOnly,
|
|
920588
|
+
noReplay,
|
|
920589
|
+
retryRateLimited,
|
|
920590
|
+
requireEnvVars,
|
|
920591
|
+
automationMode,
|
|
920592
|
+
autoMerge,
|
|
920593
|
+
automation
|
|
920594
|
+
});
|
|
920595
|
+
});
|
|
920596
|
+
})
|
|
920597
|
+
);
|
|
920598
|
+
}
|
|
920599
|
+
async function confirmOutputDirectoriesForEligibleGenerators({
|
|
920600
|
+
project,
|
|
920601
|
+
groupName,
|
|
920602
|
+
generatorName,
|
|
920603
|
+
generatorIndex,
|
|
920604
|
+
automation,
|
|
920605
|
+
cliContext,
|
|
920606
|
+
force
|
|
920607
|
+
}) {
|
|
920608
|
+
for (const workspace of project.apiWorkspaces) {
|
|
920609
|
+
const resolvedGroupNames = expandGroupFilter(groupName, workspace.generatorsConfiguration);
|
|
920610
|
+
const rootAutorelease = workspace.generatorsConfiguration?.rawConfiguration.autorelease;
|
|
920611
|
+
const groupsInScope = workspace.generatorsConfiguration?.groups.filter(
|
|
920612
|
+
(group) => resolvedGroupNames == null || resolvedGroupNames.includes(group.groupName)
|
|
920613
|
+
) ?? [];
|
|
920614
|
+
for (const group of groupsInScope) {
|
|
920615
|
+
const filterResult = filterGenerators({
|
|
920616
|
+
generators: group.generators,
|
|
920617
|
+
generatorIndex,
|
|
920618
|
+
generatorName,
|
|
920619
|
+
groupName: group.groupName
|
|
920620
|
+
});
|
|
920621
|
+
if (!filterResult.ok) {
|
|
920622
|
+
continue;
|
|
920623
|
+
}
|
|
920624
|
+
for (const generator of filterResult.generators) {
|
|
920625
|
+
if (!shouldPreflightGenerator({ generator, rootAutorelease, automation })) {
|
|
920626
|
+
continue;
|
|
920627
|
+
}
|
|
920628
|
+
const { shouldProceed } = await checkOutputDirectory(
|
|
920629
|
+
generator.absolutePathToLocalOutput,
|
|
920630
|
+
cliContext,
|
|
920631
|
+
force
|
|
920632
|
+
);
|
|
920633
|
+
if (!shouldProceed) {
|
|
920634
|
+
cliContext.failAndThrow("Generation cancelled", void 0, { code: CliError.Code.ConfigError });
|
|
920635
|
+
}
|
|
920636
|
+
}
|
|
920637
|
+
}
|
|
920638
|
+
}
|
|
920639
|
+
}
|
|
920640
|
+
function buildPosthogWorkspaces({
|
|
920641
|
+
project,
|
|
920642
|
+
groupName,
|
|
920643
|
+
generatorName
|
|
920644
|
+
}) {
|
|
920645
|
+
return project.apiWorkspaces.map((workspace) => {
|
|
920646
|
+
const resolvedGroupNames = expandGroupFilter(groupName, workspace.generatorsConfiguration);
|
|
920647
|
+
return {
|
|
920648
|
+
name: workspace.workspaceName,
|
|
920649
|
+
group: groupName,
|
|
920650
|
+
generators: workspace.generatorsConfiguration?.groups.filter((group) => resolvedGroupNames == null || resolvedGroupNames.includes(group.groupName)).map(
|
|
920651
|
+
(group) => group.generators.filter((generator) => generatorName == null || generator.name === generatorName).map((generator) => ({
|
|
920652
|
+
name: generator.name,
|
|
920653
|
+
version: generator.version,
|
|
920654
|
+
outputMode: generator.outputMode.type,
|
|
920655
|
+
config: generator.config
|
|
920656
|
+
}))
|
|
920657
|
+
)
|
|
920658
|
+
};
|
|
920659
|
+
});
|
|
920660
|
+
}
|
|
920661
|
+
function expandGroupFilter(groupName, generatorsConfiguration) {
|
|
920662
|
+
if (groupName == null) {
|
|
920663
|
+
return null;
|
|
920664
|
+
}
|
|
920665
|
+
if (generatorsConfiguration == null) {
|
|
920666
|
+
return [groupName];
|
|
920667
|
+
}
|
|
920668
|
+
const aliasGroups = generatorsConfiguration.groupAliases[groupName];
|
|
920669
|
+
if (aliasGroups != null) {
|
|
920670
|
+
return aliasGroups;
|
|
920671
|
+
}
|
|
920672
|
+
return [groupName];
|
|
920673
|
+
}
|
|
920674
|
+
|
|
920675
|
+
// src/commands/automations/generate/GeneratorRunResult.ts
|
|
920676
|
+
function countResults(results) {
|
|
920677
|
+
let succeeded = 0;
|
|
920678
|
+
let failed = 0;
|
|
920679
|
+
let skipped = 0;
|
|
920680
|
+
for (const r5 of results) {
|
|
920681
|
+
switch (r5.status) {
|
|
920682
|
+
case "success":
|
|
920683
|
+
succeeded++;
|
|
920684
|
+
break;
|
|
920685
|
+
case "failed":
|
|
920686
|
+
failed++;
|
|
920687
|
+
break;
|
|
920688
|
+
case "skipped_no_diff":
|
|
920689
|
+
skipped++;
|
|
920690
|
+
break;
|
|
920691
|
+
}
|
|
920692
|
+
}
|
|
920693
|
+
return { succeeded, failed, skipped };
|
|
920694
|
+
}
|
|
920695
|
+
var GeneratorRunCollector = class {
|
|
920696
|
+
#results = [];
|
|
920697
|
+
recordSuccess(args) {
|
|
920698
|
+
this.#results.push({
|
|
920699
|
+
apiName: args.apiName,
|
|
920700
|
+
groupName: args.groupName,
|
|
920701
|
+
generatorName: args.generatorName,
|
|
920702
|
+
status: "success",
|
|
920703
|
+
version: args.version,
|
|
920704
|
+
pullRequestUrl: null,
|
|
920705
|
+
errorMessage: null,
|
|
920706
|
+
durationMs: args.durationMs
|
|
920707
|
+
});
|
|
920708
|
+
}
|
|
920709
|
+
recordFailure(args) {
|
|
920710
|
+
this.#results.push({
|
|
920711
|
+
apiName: args.apiName,
|
|
920712
|
+
groupName: args.groupName,
|
|
920713
|
+
generatorName: args.generatorName,
|
|
920714
|
+
status: "failed",
|
|
920715
|
+
version: null,
|
|
920716
|
+
pullRequestUrl: null,
|
|
920717
|
+
errorMessage: args.errorMessage,
|
|
920718
|
+
durationMs: args.durationMs
|
|
920719
|
+
});
|
|
920720
|
+
}
|
|
920721
|
+
results() {
|
|
920722
|
+
return this.#results;
|
|
920723
|
+
}
|
|
920724
|
+
hasFailures() {
|
|
920725
|
+
return this.#results.some((r5) => r5.status === "failed");
|
|
920726
|
+
}
|
|
920727
|
+
counts() {
|
|
920728
|
+
return countResults(this.#results);
|
|
920729
|
+
}
|
|
920730
|
+
};
|
|
920731
|
+
|
|
920732
|
+
// src/commands/automations/generate/reportGenerateResults.ts
|
|
920733
|
+
var import_fs35 = require("fs");
|
|
920734
|
+
var import_promises137 = require("fs/promises");
|
|
920735
|
+
var JSON_SCHEMA_VERSION = 1;
|
|
920736
|
+
function renderStdoutSummary(results) {
|
|
920737
|
+
return formatCounts(countResults(results));
|
|
920738
|
+
}
|
|
920739
|
+
function renderMarkdownSummary(results) {
|
|
920740
|
+
const lines = [];
|
|
920741
|
+
lines.push("## Fern Automations \xB7 Generate");
|
|
920742
|
+
lines.push("");
|
|
920743
|
+
lines.push("| API | Group | Generator | Status | Version | PR |");
|
|
920744
|
+
lines.push("|-----|-------|-----------|--------|---------|----|");
|
|
920745
|
+
for (const result of results) {
|
|
920746
|
+
lines.push(
|
|
920747
|
+
`| ${mdCell(result.apiName)} | ${mdCell(result.groupName)} | ${mdCell(result.generatorName)} | ${statusCell(result)} | ${mdCell(result.version)} | ${prCell(result.pullRequestUrl)} |`
|
|
920748
|
+
);
|
|
920749
|
+
}
|
|
920750
|
+
lines.push("");
|
|
920751
|
+
lines.push(`**Summary:** ${formatCounts(countResults(results))}`);
|
|
920752
|
+
lines.push("");
|
|
920753
|
+
return lines.join("\n");
|
|
920754
|
+
}
|
|
920755
|
+
function renderJsonSummary(results) {
|
|
920756
|
+
return {
|
|
920757
|
+
version: JSON_SCHEMA_VERSION,
|
|
920758
|
+
generators: results.map((r5) => ({
|
|
920759
|
+
api: r5.apiName ?? null,
|
|
920760
|
+
group: r5.groupName,
|
|
920761
|
+
generatorName: r5.generatorName,
|
|
920762
|
+
status: r5.status,
|
|
920763
|
+
pullRequestUrl: r5.pullRequestUrl,
|
|
920764
|
+
version: r5.version,
|
|
920765
|
+
error: r5.errorMessage,
|
|
920766
|
+
durationMs: r5.durationMs
|
|
920767
|
+
})),
|
|
920768
|
+
summary: countResults(results)
|
|
920769
|
+
};
|
|
920770
|
+
}
|
|
920771
|
+
function formatCounts(counts) {
|
|
920772
|
+
return `${counts.succeeded} succeeded \xB7 ${counts.skipped} skipped \xB7 ${counts.failed} failed`;
|
|
920773
|
+
}
|
|
920774
|
+
async function writeResults({
|
|
920775
|
+
results,
|
|
920776
|
+
jsonOutputPath
|
|
920777
|
+
}) {
|
|
920778
|
+
const stepSummaryPath = getGithubStepSummaryPath();
|
|
920779
|
+
if (stepSummaryPath != null) {
|
|
920780
|
+
try {
|
|
920781
|
+
await (0, import_promises137.appendFile)(stepSummaryPath, renderMarkdownSummary(results), "utf8");
|
|
920782
|
+
} catch {
|
|
920783
|
+
}
|
|
920784
|
+
}
|
|
920785
|
+
if (jsonOutputPath != null) {
|
|
920786
|
+
await (0, import_promises137.writeFile)(jsonOutputPath, JSON.stringify(renderJsonSummary(results), null, 2), "utf8");
|
|
920787
|
+
}
|
|
920788
|
+
}
|
|
920789
|
+
function writeResultsSync({
|
|
920790
|
+
results,
|
|
920791
|
+
jsonOutputPath
|
|
920792
|
+
}) {
|
|
920793
|
+
const stepSummaryPath = getGithubStepSummaryPath();
|
|
920794
|
+
if (stepSummaryPath != null) {
|
|
920795
|
+
try {
|
|
920796
|
+
(0, import_fs35.appendFileSync)(stepSummaryPath, renderMarkdownSummary(results), "utf8");
|
|
920797
|
+
} catch {
|
|
920798
|
+
}
|
|
920799
|
+
}
|
|
920800
|
+
if (jsonOutputPath != null) {
|
|
920801
|
+
try {
|
|
920802
|
+
(0, import_fs35.writeFileSync)(jsonOutputPath, JSON.stringify(renderJsonSummary(results), null, 2), "utf8");
|
|
920803
|
+
} catch {
|
|
920804
|
+
}
|
|
920805
|
+
}
|
|
920806
|
+
}
|
|
920807
|
+
function getGithubStepSummaryPath() {
|
|
920808
|
+
const path99 = process.env.GITHUB_STEP_SUMMARY;
|
|
920809
|
+
return path99 != null && path99.length > 0 ? path99 : void 0;
|
|
920810
|
+
}
|
|
920811
|
+
function mdCell(value2) {
|
|
920812
|
+
if (value2 == null || value2.length === 0) {
|
|
920813
|
+
return "\u2014";
|
|
920814
|
+
}
|
|
920815
|
+
return value2.replace(/\|/g, "\\|");
|
|
920816
|
+
}
|
|
920817
|
+
function statusCell(result) {
|
|
920818
|
+
switch (result.status) {
|
|
920819
|
+
case "success":
|
|
920820
|
+
return "\u2705 success";
|
|
920821
|
+
case "failed":
|
|
920822
|
+
return "\u274C failed";
|
|
920823
|
+
case "skipped_no_diff":
|
|
920824
|
+
return "\u23ED\uFE0F skipped (no diff)";
|
|
920825
|
+
}
|
|
920826
|
+
}
|
|
920827
|
+
function prCell(url3) {
|
|
920828
|
+
if (url3 == null) {
|
|
920829
|
+
return "\u2014";
|
|
920830
|
+
}
|
|
920831
|
+
const match3 = url3.match(/\/pull\/(\d+)/);
|
|
920832
|
+
if (match3 != null) {
|
|
920833
|
+
return `[#${match3[1]}](${url3})`;
|
|
920834
|
+
}
|
|
920835
|
+
return `[link](${url3})`;
|
|
920836
|
+
}
|
|
920837
|
+
|
|
920838
|
+
// src/commands/automations/generate/executeAutomationsGenerate.ts
|
|
920839
|
+
async function executeAutomationsGenerate({
|
|
920840
|
+
cliContext,
|
|
920841
|
+
options: options2
|
|
920842
|
+
}) {
|
|
920843
|
+
const { generatorName, generatorIndex } = parseGeneratorArg(options2.generator);
|
|
920844
|
+
const collector = new GeneratorRunCollector();
|
|
920845
|
+
const { jsonOutputPath } = options2;
|
|
920846
|
+
let outputsFlushed = false;
|
|
920847
|
+
let taskAborted = false;
|
|
920848
|
+
const flushOnSignal = () => {
|
|
920849
|
+
if (outputsFlushed) {
|
|
920850
|
+
return;
|
|
920851
|
+
}
|
|
920852
|
+
outputsFlushed = true;
|
|
920853
|
+
writeResultsSync({ results: collector.results(), jsonOutputPath });
|
|
920854
|
+
};
|
|
920855
|
+
process.once("SIGINT", flushOnSignal);
|
|
920856
|
+
process.once("SIGTERM", flushOnSignal);
|
|
920857
|
+
try {
|
|
920858
|
+
await cliContext.runTask(async () => {
|
|
920859
|
+
await generateAPIWorkspaces({
|
|
920860
|
+
project: await loadProjectAndRegisterWorkspacesWithContext(cliContext, {
|
|
920861
|
+
commandLineApiWorkspace: options2.api,
|
|
920862
|
+
defaultToAllApiWorkspaces: true
|
|
920863
|
+
}),
|
|
920864
|
+
cliContext,
|
|
920865
|
+
version: options2.version,
|
|
920866
|
+
groupName: options2.group,
|
|
920867
|
+
generatorName,
|
|
920868
|
+
generatorIndex,
|
|
920869
|
+
shouldLogS3Url: false,
|
|
920870
|
+
keepDocker: false,
|
|
920871
|
+
useLocalDocker: false,
|
|
920872
|
+
preview: false,
|
|
920873
|
+
mode: void 0,
|
|
920874
|
+
force: true,
|
|
920875
|
+
runner: void 0,
|
|
920876
|
+
inspect: false,
|
|
920877
|
+
lfsOverride: void 0,
|
|
920878
|
+
fernignorePath: void 0,
|
|
920879
|
+
skipFernignore: false,
|
|
920880
|
+
dynamicIrOnly: false,
|
|
920881
|
+
outputDir: void 0,
|
|
920882
|
+
noReplay: false,
|
|
920883
|
+
retryRateLimited: false,
|
|
920884
|
+
requireEnvVars: false,
|
|
920885
|
+
automationMode: true,
|
|
920886
|
+
autoMerge: options2.autoMerge,
|
|
920887
|
+
automation: { recorder: collector }
|
|
920888
|
+
});
|
|
920889
|
+
});
|
|
920890
|
+
} catch (error50) {
|
|
920891
|
+
if (!(error50 instanceof TaskAbortSignal)) {
|
|
920892
|
+
throw error50;
|
|
920893
|
+
}
|
|
920894
|
+
taskAborted = true;
|
|
920895
|
+
} finally {
|
|
920896
|
+
process.off("SIGINT", flushOnSignal);
|
|
920897
|
+
process.off("SIGTERM", flushOnSignal);
|
|
920898
|
+
if (!outputsFlushed) {
|
|
920899
|
+
outputsFlushed = true;
|
|
920900
|
+
await reportFinalOutputs({ collector, jsonOutputPath, taskAborted });
|
|
920901
|
+
}
|
|
920902
|
+
if (collector.hasFailures()) {
|
|
920903
|
+
process.exitCode = 1;
|
|
920904
|
+
}
|
|
920905
|
+
}
|
|
920906
|
+
}
|
|
920907
|
+
async function reportFinalOutputs({
|
|
920908
|
+
collector,
|
|
920909
|
+
jsonOutputPath,
|
|
920910
|
+
taskAborted
|
|
920911
|
+
}) {
|
|
920912
|
+
const results = collector.results();
|
|
920913
|
+
if (results.length === 0) {
|
|
920914
|
+
if (taskAborted) {
|
|
920915
|
+
return;
|
|
920916
|
+
}
|
|
920917
|
+
process.stdout.write(
|
|
920918
|
+
"No eligible generators ran in the selected APIs and groups \u2014 every candidate either opts out via automations.generate / autorelease, uses local-file-system output, or did not match an explicit --group / --api filter.\n"
|
|
920919
|
+
);
|
|
920920
|
+
return;
|
|
920921
|
+
}
|
|
920922
|
+
await writeResults({ results, jsonOutputPath });
|
|
920923
|
+
process.stdout.write(`${renderStdoutSummary(results)}
|
|
920924
|
+
`);
|
|
920925
|
+
}
|
|
920926
|
+
|
|
919825
920927
|
// src/commands/sdk-preview/overrideOutputForPreview.ts
|
|
919826
920928
|
var PREVIEW_REGISTRY_URL = process.env.FERN_PREVIEW_REGISTRY_URL ?? "https://npm.buildwithfern.com";
|
|
919827
920929
|
var SUPPORTED_TYPESCRIPT_GENERATORS = /* @__PURE__ */ new Set([
|
|
@@ -920368,7 +921470,7 @@ async function previewDocsWorkspace({
|
|
|
920368
921470
|
|
|
920369
921471
|
// src/commands/docs-diff/docsDiff.ts
|
|
920370
921472
|
init_lib6();
|
|
920371
|
-
var
|
|
921473
|
+
var import_promises138 = require("fs/promises");
|
|
920372
921474
|
var import_pngjs = __toESM(require_png2(), 1);
|
|
920373
921475
|
async function getSlugForFiles({
|
|
920374
921476
|
previewUrl,
|
|
@@ -920591,8 +921693,8 @@ async function generateComparisons({
|
|
|
920591
921693
|
afterPath,
|
|
920592
921694
|
comparisonBasePath
|
|
920593
921695
|
}) {
|
|
920594
|
-
const beforePng = import_pngjs.PNG.sync.read(await (0,
|
|
920595
|
-
const afterPng = import_pngjs.PNG.sync.read(await (0,
|
|
921696
|
+
const beforePng = import_pngjs.PNG.sync.read(await (0, import_promises138.readFile)(beforePath));
|
|
921697
|
+
const afterPng = import_pngjs.PNG.sync.read(await (0, import_promises138.readFile)(afterPath));
|
|
920596
921698
|
const beforeOriginalHeight = beforePng.height;
|
|
920597
921699
|
const afterOriginalHeight = afterPng.height;
|
|
920598
921700
|
const width = Math.max(beforePng.width, afterPng.width);
|
|
@@ -920630,7 +921732,7 @@ async function generateComparisons({
|
|
|
920630
921732
|
const sideBySide = createSideBySideComparison(croppedBefore, croppedAfter, 20, true);
|
|
920631
921733
|
const outPath = `${base4}-region-${i9 + 1}.png`;
|
|
920632
921734
|
const pngBuffer = import_pngjs.PNG.sync.write(sideBySide);
|
|
920633
|
-
await (0,
|
|
921735
|
+
await (0, import_promises138.writeFile)(outPath, new Uint8Array(pngBuffer));
|
|
920634
921736
|
results.push({ changePercent, boundingBox, comparisonPath: outPath });
|
|
920635
921737
|
}
|
|
920636
921738
|
return results;
|
|
@@ -920709,7 +921811,7 @@ async function docsDiff({
|
|
|
920709
921811
|
outputDir.startsWith("/") ? outputDir : join8(cwd(), RelativeFilePath2.of(outputDir))
|
|
920710
921812
|
);
|
|
920711
921813
|
if (!await doesPathExist(outputPath)) {
|
|
920712
|
-
await (0,
|
|
921814
|
+
await (0, import_promises138.mkdir)(outputPath, { recursive: true });
|
|
920713
921815
|
}
|
|
920714
921816
|
const results = [];
|
|
920715
921817
|
await cliContext.runTask(async (context3) => {
|
|
@@ -924021,8 +925123,8 @@ function renderNamespacesIndexPage(nsPath, childEntries, nsTitle) {
|
|
|
924021
925123
|
}
|
|
924022
925124
|
|
|
924023
925125
|
// ../library-docs-generator/lib/src/writers/MdxFileWriter.js
|
|
924024
|
-
var
|
|
924025
|
-
var
|
|
925126
|
+
var import_fs36 = require("fs");
|
|
925127
|
+
var import_path86 = require("path");
|
|
924026
925128
|
var MdxFileWriter = class {
|
|
924027
925129
|
outputDir;
|
|
924028
925130
|
writtenFiles = [];
|
|
@@ -924038,9 +925140,9 @@ var MdxFileWriter = class {
|
|
|
924038
925140
|
* @returns Absolute path of the written file
|
|
924039
925141
|
*/
|
|
924040
925142
|
writePage(pageKey, content5) {
|
|
924041
|
-
const filePath = (0,
|
|
924042
|
-
(0,
|
|
924043
|
-
(0,
|
|
925143
|
+
const filePath = (0, import_path86.join)(this.outputDir, pageKey);
|
|
925144
|
+
(0, import_fs36.mkdirSync)((0, import_path86.dirname)(filePath), { recursive: true });
|
|
925145
|
+
(0, import_fs36.writeFileSync)(filePath, content5);
|
|
924044
925146
|
this.writtenFiles.push(filePath);
|
|
924045
925147
|
return filePath;
|
|
924046
925148
|
}
|
|
@@ -925047,8 +926149,8 @@ function renderModulePage(module4, ctx, parentPath = "") {
|
|
|
925047
926149
|
}
|
|
925048
926150
|
|
|
925049
926151
|
// ../library-docs-generator/lib/src/writers/NavigationBuilder.js
|
|
925050
|
-
var
|
|
925051
|
-
var
|
|
926152
|
+
var import_fs37 = require("fs");
|
|
926153
|
+
var import_path87 = require("path");
|
|
925052
926154
|
function buildNavigation(rootModule, baseSlug) {
|
|
925053
926155
|
return generateModuleNav(rootModule, "", baseSlug);
|
|
925054
926156
|
}
|
|
@@ -925082,9 +926184,9 @@ var NAVIGATION_FILENAME = "_navigation.yml";
|
|
|
925082
926184
|
function writeNavigation(outputDir, navigation2) {
|
|
925083
926185
|
const header = "# AUTO-GENERATED by `fern docs md generate` \u2014 DO NOT EDIT\n";
|
|
925084
926186
|
const yaml3 = jsYaml.dump(navigation2, { lineWidth: 120, noRefs: true });
|
|
925085
|
-
const filePath = (0,
|
|
925086
|
-
(0,
|
|
925087
|
-
(0,
|
|
926187
|
+
const filePath = (0, import_path87.join)(outputDir, NAVIGATION_FILENAME);
|
|
926188
|
+
(0, import_fs37.mkdirSync)((0, import_path87.dirname)(filePath), { recursive: true });
|
|
926189
|
+
(0, import_fs37.writeFileSync)(filePath, header + yaml3);
|
|
925088
926190
|
return filePath;
|
|
925089
926191
|
}
|
|
925090
926192
|
|
|
@@ -925122,7 +926224,7 @@ function renderModuleTree(module4, ctx, writer2, parentPath) {
|
|
|
925122
926224
|
}
|
|
925123
926225
|
|
|
925124
926226
|
// src/commands/docs-md-generate/generateLibraryDocs.ts
|
|
925125
|
-
var
|
|
926227
|
+
var import_promises139 = require("fs/promises");
|
|
925126
926228
|
function createLibraryDocsClient2({ token }) {
|
|
925127
926229
|
const defaultOrigin = "https://registry-dev2.buildwithfern.com";
|
|
925128
926230
|
const baseUrl = process.env.FERN_FDR_ORIGIN ?? process.env.OVERRIDE_FDR_ORIGIN ?? defaultOrigin;
|
|
@@ -925248,7 +926350,7 @@ async function generateSingleLibrary({
|
|
|
925248
926350
|
if (config5.lang === "cpp" && config5.config?.doxyfile != null) {
|
|
925249
926351
|
const doxyfilePath = resolve6(docsWorkspace.absoluteFilePath, config5.config.doxyfile);
|
|
925250
926352
|
try {
|
|
925251
|
-
doxyfileContent = await (0,
|
|
926353
|
+
doxyfileContent = await (0, import_promises139.readFile)(doxyfilePath, "utf-8");
|
|
925252
926354
|
} catch {
|
|
925253
926355
|
return interactiveTaskContext.failAndThrow(
|
|
925254
926356
|
`Library '${name2}': Could not read Doxyfile at '${config5.config.doxyfile}' (resolved to ${doxyfilePath})`,
|
|
@@ -925594,7 +926696,7 @@ Found ${previewDeployments.length} preview deployment(s):
|
|
|
925594
926696
|
}
|
|
925595
926697
|
|
|
925596
926698
|
// src/commands/downgrade/downgrade.ts
|
|
925597
|
-
var
|
|
926699
|
+
var import_promises140 = require("fs/promises");
|
|
925598
926700
|
|
|
925599
926701
|
// ../../../node_modules/.pnpm/immer@10.2.0/node_modules/immer/dist/immer.mjs
|
|
925600
926702
|
var NOTHING = /* @__PURE__ */ Symbol.for("immer-nothing");
|
|
@@ -926345,13 +927447,13 @@ async function downgrade({
|
|
|
926345
927447
|
const newProjectConfig = produce(projectConfig.rawConfig, (draft) => {
|
|
926346
927448
|
draft.version = targetVersion;
|
|
926347
927449
|
});
|
|
926348
|
-
await (0,
|
|
927450
|
+
await (0, import_promises140.writeFile)(projectConfig._absolutePath, ensureFinalNewline(JSON.stringify(newProjectConfig, void 0, 2)));
|
|
926349
927451
|
cliContext.logger.info(`Updated ${PROJECT_CONFIG_FILENAME} to version ${targetVersion}`);
|
|
926350
927452
|
}
|
|
926351
927453
|
|
|
926352
927454
|
// src/commands/export/generateOpenAPIForWorkspaces.ts
|
|
926353
927455
|
init_lib6();
|
|
926354
|
-
var
|
|
927456
|
+
var import_promises141 = require("fs/promises");
|
|
926355
927457
|
|
|
926356
927458
|
// src/commands/export/converters/servicesConverter.ts
|
|
926357
927459
|
init_lib4();
|
|
@@ -927734,8 +928836,8 @@ async function generateOpenAPIForWorkspaces({
|
|
|
927734
928836
|
ir: ir10,
|
|
927735
928837
|
mode: "openapi"
|
|
927736
928838
|
});
|
|
927737
|
-
await (0,
|
|
927738
|
-
await (0,
|
|
928839
|
+
await (0, import_promises141.mkdir)(dirname6(outputPath), { recursive: true });
|
|
928840
|
+
await (0, import_promises141.writeFile)(
|
|
927739
928841
|
outputPath,
|
|
927740
928842
|
outputPath.endsWith(".json") ? JSON.stringify(openapi, void 0, indent4) : jsYaml.dump(openapi, { indent: indent4 })
|
|
927741
928843
|
);
|
|
@@ -927766,517 +928868,6 @@ async function formatWorkspaces({
|
|
|
927766
928868
|
);
|
|
927767
928869
|
}
|
|
927768
928870
|
|
|
927769
|
-
// src/commands/generate/filterGenerators.ts
|
|
927770
|
-
function parseGeneratorArg(generatorArg) {
|
|
927771
|
-
if (generatorArg == null) {
|
|
927772
|
-
return { generatorName: void 0, generatorIndex: void 0 };
|
|
927773
|
-
}
|
|
927774
|
-
const parsed = generatorArg.length > 0 ? Number(generatorArg) : Number.NaN;
|
|
927775
|
-
if (!Number.isNaN(parsed) && Number.isInteger(parsed) && parsed >= 0) {
|
|
927776
|
-
return { generatorName: void 0, generatorIndex: parsed };
|
|
927777
|
-
}
|
|
927778
|
-
return { generatorName: generatorArg, generatorIndex: void 0 };
|
|
927779
|
-
}
|
|
927780
|
-
function filterGenerators({
|
|
927781
|
-
generators,
|
|
927782
|
-
generatorIndex,
|
|
927783
|
-
generatorName,
|
|
927784
|
-
groupName
|
|
927785
|
-
}) {
|
|
927786
|
-
if (generatorIndex != null) {
|
|
927787
|
-
const generator = generators[generatorIndex];
|
|
927788
|
-
if (generator == null) {
|
|
927789
|
-
return {
|
|
927790
|
-
ok: false,
|
|
927791
|
-
error: `Generator index ${generatorIndex} is out of bounds in group '${groupName}' (${generators.length} generators available)`
|
|
927792
|
-
};
|
|
927793
|
-
}
|
|
927794
|
-
return { ok: true, generators: [generator] };
|
|
927795
|
-
}
|
|
927796
|
-
if (generatorName != null) {
|
|
927797
|
-
const filtered = generators.filter((gen) => gen.name === generatorName);
|
|
927798
|
-
if (filtered.length === 0) {
|
|
927799
|
-
const available = generators.map((gen) => gen.name);
|
|
927800
|
-
return {
|
|
927801
|
-
ok: false,
|
|
927802
|
-
error: `Generator '${generatorName}' not found in group '${groupName}'. Available generators: ${available.join(", ")}`
|
|
927803
|
-
};
|
|
927804
|
-
}
|
|
927805
|
-
return { ok: true, generators: filtered };
|
|
927806
|
-
}
|
|
927807
|
-
return { ok: true, generators };
|
|
927808
|
-
}
|
|
927809
|
-
|
|
927810
|
-
// src/commands/generate/generateAPIWorkspaces.ts
|
|
927811
|
-
init_lib6();
|
|
927812
|
-
|
|
927813
|
-
// src/constants.ts
|
|
927814
|
-
var API_CLI_OPTION = "api";
|
|
927815
|
-
var GROUP_CLI_OPTION = "group";
|
|
927816
|
-
var PREVIEW_DIRECTORY = ".preview";
|
|
927817
|
-
var APPROVED_DIRECTORIES_FILENAME = "approved-output-directories";
|
|
927818
|
-
var LOCAL_STORAGE_FOLDER6 = ".fern-dev";
|
|
927819
|
-
|
|
927820
|
-
// src/commands/generate/checkOutputDirectory.ts
|
|
927821
|
-
init_lib6();
|
|
927822
|
-
var import_promises140 = require("fs/promises");
|
|
927823
|
-
|
|
927824
|
-
// src/persistence/output-directories/getOutputDirectories.ts
|
|
927825
|
-
init_lib6();
|
|
927826
|
-
var import_promises138 = require("fs/promises");
|
|
927827
|
-
|
|
927828
|
-
// src/persistence/output-directories/getPathToOutputDirectoriesFile.ts
|
|
927829
|
-
init_lib6();
|
|
927830
|
-
var import_os16 = require("os");
|
|
927831
|
-
function getPathToOutputDirectoriesFile() {
|
|
927832
|
-
return join8(
|
|
927833
|
-
AbsoluteFilePath2.of((0, import_os16.homedir)()),
|
|
927834
|
-
RelativeFilePath2.of(LOCAL_STORAGE_FOLDER6),
|
|
927835
|
-
RelativeFilePath2.of(APPROVED_DIRECTORIES_FILENAME)
|
|
927836
|
-
);
|
|
927837
|
-
}
|
|
927838
|
-
|
|
927839
|
-
// src/persistence/output-directories/getOutputDirectories.ts
|
|
927840
|
-
async function getOutputDirectories() {
|
|
927841
|
-
const pathToOutputDirectoriesFile = getPathToOutputDirectoriesFile();
|
|
927842
|
-
const doesOutputDirectoriesFileExist = await doesPathExist(pathToOutputDirectoriesFile);
|
|
927843
|
-
if (!doesOutputDirectoriesFileExist) {
|
|
927844
|
-
return [];
|
|
927845
|
-
}
|
|
927846
|
-
const outputDirectoriesFileContents = await (0, import_promises138.readFile)(pathToOutputDirectoriesFile, { encoding: "utf-8" });
|
|
927847
|
-
const outputDirectories = JSON.parse(outputDirectoriesFileContents);
|
|
927848
|
-
return outputDirectories;
|
|
927849
|
-
}
|
|
927850
|
-
|
|
927851
|
-
// src/persistence/output-directories/storeOutputDirectories.ts
|
|
927852
|
-
var import_promises139 = require("fs/promises");
|
|
927853
|
-
var import_path87 = __toESM(require("path"), 1);
|
|
927854
|
-
async function storeOutputDirectories(outputDirectories) {
|
|
927855
|
-
await (0, import_promises139.mkdir)(import_path87.default.dirname(getPathToOutputDirectoriesFile()), { recursive: true });
|
|
927856
|
-
await (0, import_promises139.writeFile)(getPathToOutputDirectoriesFile(), JSON.stringify(outputDirectories, null, 2));
|
|
927857
|
-
}
|
|
927858
|
-
|
|
927859
|
-
// src/commands/generate/checkOutputDirectory.ts
|
|
927860
|
-
async function checkOutputDirectory(outputPath, cliContext, force) {
|
|
927861
|
-
if (!outputPath || isCI() || force) {
|
|
927862
|
-
return {
|
|
927863
|
-
shouldProceed: true
|
|
927864
|
-
};
|
|
927865
|
-
}
|
|
927866
|
-
const savedDirectories = await getOutputDirectories();
|
|
927867
|
-
if (savedDirectories?.includes(outputPath)) {
|
|
927868
|
-
return {
|
|
927869
|
-
shouldProceed: true
|
|
927870
|
-
};
|
|
927871
|
-
}
|
|
927872
|
-
const doesExist = await doesPathExist(outputPath);
|
|
927873
|
-
if (!doesExist) {
|
|
927874
|
-
return {
|
|
927875
|
-
shouldProceed: true
|
|
927876
|
-
};
|
|
927877
|
-
}
|
|
927878
|
-
const files = await (0, import_promises140.readdir)(outputPath);
|
|
927879
|
-
if (files.length === 0) {
|
|
927880
|
-
return {
|
|
927881
|
-
shouldProceed: true
|
|
927882
|
-
};
|
|
927883
|
-
}
|
|
927884
|
-
const shouldOverwrite = await cliContext.confirmPrompt(
|
|
927885
|
-
`Directory ${outputPath} contains existing files that may be overwritten. Continue?`,
|
|
927886
|
-
false
|
|
927887
|
-
);
|
|
927888
|
-
if (!shouldOverwrite) {
|
|
927889
|
-
return {
|
|
927890
|
-
shouldProceed: false
|
|
927891
|
-
};
|
|
927892
|
-
}
|
|
927893
|
-
await storeOutputDirectories([...savedDirectories ?? [], outputPath]);
|
|
927894
|
-
return {
|
|
927895
|
-
shouldProceed: true
|
|
927896
|
-
};
|
|
927897
|
-
}
|
|
927898
|
-
|
|
927899
|
-
// src/commands/generate/generateAPIWorkspace.ts
|
|
927900
|
-
init_lib6();
|
|
927901
|
-
async function generateWorkspace({
|
|
927902
|
-
organization,
|
|
927903
|
-
workspace,
|
|
927904
|
-
projectConfig,
|
|
927905
|
-
context: context3,
|
|
927906
|
-
groupName,
|
|
927907
|
-
generatorName,
|
|
927908
|
-
generatorIndex,
|
|
927909
|
-
version: version7,
|
|
927910
|
-
shouldLogS3Url,
|
|
927911
|
-
token,
|
|
927912
|
-
useLocalDocker,
|
|
927913
|
-
keepDocker,
|
|
927914
|
-
absolutePathToPreview,
|
|
927915
|
-
mode,
|
|
927916
|
-
runner,
|
|
927917
|
-
inspect: inspect6,
|
|
927918
|
-
lfsOverride,
|
|
927919
|
-
fernignorePath,
|
|
927920
|
-
skipFernignore,
|
|
927921
|
-
dynamicIrOnly,
|
|
927922
|
-
noReplay,
|
|
927923
|
-
retryRateLimited,
|
|
927924
|
-
requireEnvVars,
|
|
927925
|
-
automationMode,
|
|
927926
|
-
autoMerge
|
|
927927
|
-
}) {
|
|
927928
|
-
if (workspace.generatorsConfiguration == null) {
|
|
927929
|
-
context3.logger.warn("This workspaces has no generators.yml");
|
|
927930
|
-
return;
|
|
927931
|
-
}
|
|
927932
|
-
if (workspace.generatorsConfiguration.groups.length === 0) {
|
|
927933
|
-
context3.logger.warn(`This workspace has no groups specified in ${GENERATORS_CONFIGURATION_FILENAME}`);
|
|
927934
|
-
return;
|
|
927935
|
-
}
|
|
927936
|
-
const groupNameOrDefault = groupName ?? workspace.generatorsConfiguration.defaultGroup;
|
|
927937
|
-
if (groupName == null && groupNameOrDefault != null) {
|
|
927938
|
-
context3.logger.info(
|
|
927939
|
-
source_default.dim(`Using default group '${groupNameOrDefault}' from ${GENERATORS_CONFIGURATION_FILENAME}`)
|
|
927940
|
-
);
|
|
927941
|
-
}
|
|
927942
|
-
if (groupNameOrDefault == null) {
|
|
927943
|
-
const groupNames = workspace.generatorsConfiguration.groups.map((g8) => g8.groupName);
|
|
927944
|
-
const longestGroupName = Math.max(...groupNames.map((name2) => name2.length));
|
|
927945
|
-
const currentArgs = process.argv.slice(2).join(" ");
|
|
927946
|
-
const message = `No group specified. Use the --${GROUP_CLI_OPTION} option, or set "${DEFAULT_GROUP_GENERATORS_CONFIG_KEY}" in ${GENERATORS_CONFIGURATION_FILENAME}:
|
|
927947
|
-
` + groupNames.map((name2) => {
|
|
927948
|
-
const suggestedCommand = `fern ${currentArgs} --${GROUP_CLI_OPTION} ${name2}`;
|
|
927949
|
-
return ` \u203A ${source_default.bold(name2.padEnd(longestGroupName))} ${source_default.dim(suggestedCommand)}`;
|
|
927950
|
-
}).join("\n");
|
|
927951
|
-
return context3.failAndThrow(message, void 0, { code: CliError.Code.NetworkError });
|
|
927952
|
-
}
|
|
927953
|
-
const resolvedGroupNames = resolveGroupAlias(
|
|
927954
|
-
groupNameOrDefault,
|
|
927955
|
-
workspace.generatorsConfiguration.groupAliases,
|
|
927956
|
-
workspace.generatorsConfiguration.groups.map((g8) => g8.groupName),
|
|
927957
|
-
context3
|
|
927958
|
-
);
|
|
927959
|
-
const { ai: ai10, replay } = workspace.generatorsConfiguration;
|
|
927960
|
-
if (!useLocalDocker && !token) {
|
|
927961
|
-
return context3.failAndThrow("Please run fern login", void 0, { code: CliError.Code.AuthError });
|
|
927962
|
-
}
|
|
927963
|
-
await Promise.all(
|
|
927964
|
-
resolvedGroupNames.map(async (resolvedGroupName) => {
|
|
927965
|
-
let group = workspace.generatorsConfiguration?.groups.find(
|
|
927966
|
-
(otherGroup) => otherGroup.groupName === resolvedGroupName
|
|
927967
|
-
);
|
|
927968
|
-
if (group == null) {
|
|
927969
|
-
return context3.failAndThrow(`Group '${resolvedGroupName}' does not exist.`, void 0, {
|
|
927970
|
-
code: CliError.Code.ConfigError
|
|
927971
|
-
});
|
|
927972
|
-
}
|
|
927973
|
-
const filterResult = filterGenerators({
|
|
927974
|
-
generators: group.generators,
|
|
927975
|
-
generatorIndex,
|
|
927976
|
-
generatorName,
|
|
927977
|
-
groupName: resolvedGroupName
|
|
927978
|
-
});
|
|
927979
|
-
if (!filterResult.ok) {
|
|
927980
|
-
return context3.failAndThrow(filterResult.error, void 0, { code: CliError.Code.ConfigError });
|
|
927981
|
-
}
|
|
927982
|
-
group = { ...group, generators: filterResult.generators };
|
|
927983
|
-
if (lfsOverride != null) {
|
|
927984
|
-
group = applyLfsOverride(group, lfsOverride, context3);
|
|
927985
|
-
}
|
|
927986
|
-
if (resolvedGroupNames.length > 1) {
|
|
927987
|
-
context3.logger.info(`Running generation for group '${resolvedGroupName}'...`);
|
|
927988
|
-
}
|
|
927989
|
-
if (useLocalDocker) {
|
|
927990
|
-
await runLocalGenerationForWorkspace({
|
|
927991
|
-
token,
|
|
927992
|
-
projectConfig,
|
|
927993
|
-
workspace,
|
|
927994
|
-
generatorGroup: group,
|
|
927995
|
-
version: version7,
|
|
927996
|
-
keepDocker,
|
|
927997
|
-
context: context3,
|
|
927998
|
-
runner,
|
|
927999
|
-
absolutePathToPreview,
|
|
928000
|
-
inspect: inspect6,
|
|
928001
|
-
ai: ai10,
|
|
928002
|
-
replay,
|
|
928003
|
-
noReplay,
|
|
928004
|
-
validateWorkspace: true,
|
|
928005
|
-
requireEnvVars,
|
|
928006
|
-
skipFernignore,
|
|
928007
|
-
automationMode,
|
|
928008
|
-
autoMerge
|
|
928009
|
-
});
|
|
928010
|
-
} else if (token != null) {
|
|
928011
|
-
const customImageGenerators = group.generators.filter((g8) => g8.containerImage != null);
|
|
928012
|
-
if (customImageGenerators.length > 0) {
|
|
928013
|
-
const names2 = customImageGenerators.map((g8) => g8.name).join(", ");
|
|
928014
|
-
return context3.failAndThrow(
|
|
928015
|
-
`Custom image configurations are only supported with local generation (--local). The following generators use custom images: ${names2}`
|
|
928016
|
-
);
|
|
928017
|
-
}
|
|
928018
|
-
await runRemoteGenerationForAPIWorkspace({
|
|
928019
|
-
projectConfig,
|
|
928020
|
-
organization,
|
|
928021
|
-
workspace,
|
|
928022
|
-
context: context3,
|
|
928023
|
-
generatorGroup: group,
|
|
928024
|
-
version: version7,
|
|
928025
|
-
shouldLogS3Url,
|
|
928026
|
-
token,
|
|
928027
|
-
whitelabel: workspace.generatorsConfiguration?.whitelabel,
|
|
928028
|
-
absolutePathToPreview,
|
|
928029
|
-
mode,
|
|
928030
|
-
fernignorePath,
|
|
928031
|
-
skipFernignore,
|
|
928032
|
-
dynamicIrOnly,
|
|
928033
|
-
validateWorkspace: true,
|
|
928034
|
-
retryRateLimited,
|
|
928035
|
-
requireEnvVars,
|
|
928036
|
-
automationMode,
|
|
928037
|
-
autoMerge
|
|
928038
|
-
});
|
|
928039
|
-
}
|
|
928040
|
-
})
|
|
928041
|
-
);
|
|
928042
|
-
}
|
|
928043
|
-
function resolveGroupAlias(groupNameOrAlias, groupAliases, availableGroups, context3) {
|
|
928044
|
-
const aliasGroups = groupAliases[groupNameOrAlias];
|
|
928045
|
-
if (aliasGroups != null) {
|
|
928046
|
-
for (const groupName of aliasGroups) {
|
|
928047
|
-
if (!availableGroups.includes(groupName)) {
|
|
928048
|
-
context3.failAndThrow(
|
|
928049
|
-
`Group alias '${groupNameOrAlias}' references non-existent group '${groupName}'. Available groups: ${availableGroups.join(", ")}`,
|
|
928050
|
-
void 0,
|
|
928051
|
-
{ code: CliError.Code.NetworkError }
|
|
928052
|
-
);
|
|
928053
|
-
}
|
|
928054
|
-
}
|
|
928055
|
-
return aliasGroups;
|
|
928056
|
-
}
|
|
928057
|
-
if (availableGroups.includes(groupNameOrAlias)) {
|
|
928058
|
-
return [groupNameOrAlias];
|
|
928059
|
-
}
|
|
928060
|
-
const availableAliases = Object.keys(groupAliases);
|
|
928061
|
-
const suggestions = [...availableGroups, ...availableAliases];
|
|
928062
|
-
context3.failAndThrow(
|
|
928063
|
-
`'${groupNameOrAlias}' is not a valid group or alias. Available groups: ${availableGroups.join(", ")}` + (availableAliases.length > 0 ? `. Available aliases: ${availableAliases.join(", ")}` : ""),
|
|
928064
|
-
void 0,
|
|
928065
|
-
{ code: CliError.Code.NetworkError }
|
|
928066
|
-
);
|
|
928067
|
-
return [];
|
|
928068
|
-
}
|
|
928069
|
-
function applyLfsOverride(group, lfsOverridePath, context3) {
|
|
928070
|
-
const baseAbsolutePath = AbsoluteFilePath2.of(resolve6(cwd(), lfsOverridePath));
|
|
928071
|
-
const languageCount = {};
|
|
928072
|
-
const modifiedGenerators = [];
|
|
928073
|
-
for (const generator of group.generators) {
|
|
928074
|
-
const language = generator.language ?? getLanguageFromGeneratorName3(generator.name);
|
|
928075
|
-
let outputPath;
|
|
928076
|
-
if (group.generators.length === 1) {
|
|
928077
|
-
outputPath = baseAbsolutePath;
|
|
928078
|
-
} else {
|
|
928079
|
-
const languageDir = language || "unknown";
|
|
928080
|
-
if (languageCount[languageDir] == null) {
|
|
928081
|
-
languageCount[languageDir] = 0;
|
|
928082
|
-
}
|
|
928083
|
-
languageCount[languageDir]++;
|
|
928084
|
-
const dirName = languageCount[languageDir] === 1 ? languageDir : `${languageDir}-${languageCount[languageDir]}`;
|
|
928085
|
-
outputPath = join8(baseAbsolutePath, RelativeFilePath2.of(dirName));
|
|
928086
|
-
}
|
|
928087
|
-
const modifiedGenerator = {
|
|
928088
|
-
...generator,
|
|
928089
|
-
outputMode: api_exports4.remoteGen.OutputMode.downloadFiles({}),
|
|
928090
|
-
absolutePathToLocalOutput: outputPath
|
|
928091
|
-
};
|
|
928092
|
-
modifiedGenerators.push(modifiedGenerator);
|
|
928093
|
-
context3.logger.info(
|
|
928094
|
-
`Overriding output for generator '${generator.name}' to local-file-system at: ${outputPath}`
|
|
928095
|
-
);
|
|
928096
|
-
}
|
|
928097
|
-
return {
|
|
928098
|
-
...group,
|
|
928099
|
-
generators: modifiedGenerators
|
|
928100
|
-
};
|
|
928101
|
-
}
|
|
928102
|
-
function getLanguageFromGeneratorName3(generatorName) {
|
|
928103
|
-
if (generatorName.includes("typescript") || generatorName.includes("ts")) {
|
|
928104
|
-
return "typescript";
|
|
928105
|
-
}
|
|
928106
|
-
if (generatorName.includes("python") || generatorName.includes("py")) {
|
|
928107
|
-
return "python";
|
|
928108
|
-
}
|
|
928109
|
-
if (generatorName.includes("java")) {
|
|
928110
|
-
return "java";
|
|
928111
|
-
}
|
|
928112
|
-
if (generatorName.includes("go")) {
|
|
928113
|
-
return "go";
|
|
928114
|
-
}
|
|
928115
|
-
if (generatorName.includes("ruby")) {
|
|
928116
|
-
return "ruby";
|
|
928117
|
-
}
|
|
928118
|
-
if (generatorName.includes("csharp") || generatorName.includes("c#")) {
|
|
928119
|
-
return "csharp";
|
|
928120
|
-
}
|
|
928121
|
-
if (generatorName.includes("swift")) {
|
|
928122
|
-
return "swift";
|
|
928123
|
-
}
|
|
928124
|
-
if (generatorName.includes("php")) {
|
|
928125
|
-
return "php";
|
|
928126
|
-
}
|
|
928127
|
-
if (generatorName.includes("rust")) {
|
|
928128
|
-
return "rust";
|
|
928129
|
-
}
|
|
928130
|
-
return generatorName.replace(/[^a-zA-Z0-9]/g, "-").toLowerCase();
|
|
928131
|
-
}
|
|
928132
|
-
|
|
928133
|
-
// src/commands/generate/generateAPIWorkspaces.ts
|
|
928134
|
-
var GenerationMode = {
|
|
928135
|
-
PullRequest: "pull-request"
|
|
928136
|
-
};
|
|
928137
|
-
async function generateAPIWorkspaces({
|
|
928138
|
-
project,
|
|
928139
|
-
cliContext,
|
|
928140
|
-
version: version7,
|
|
928141
|
-
groupName,
|
|
928142
|
-
generatorName,
|
|
928143
|
-
generatorIndex,
|
|
928144
|
-
shouldLogS3Url,
|
|
928145
|
-
keepDocker,
|
|
928146
|
-
useLocalDocker,
|
|
928147
|
-
preview,
|
|
928148
|
-
mode,
|
|
928149
|
-
force,
|
|
928150
|
-
runner,
|
|
928151
|
-
inspect: inspect6,
|
|
928152
|
-
lfsOverride,
|
|
928153
|
-
fernignorePath,
|
|
928154
|
-
skipFernignore,
|
|
928155
|
-
dynamicIrOnly,
|
|
928156
|
-
outputDir,
|
|
928157
|
-
noReplay,
|
|
928158
|
-
retryRateLimited,
|
|
928159
|
-
requireEnvVars,
|
|
928160
|
-
automationMode,
|
|
928161
|
-
autoMerge
|
|
928162
|
-
}) {
|
|
928163
|
-
let token = void 0;
|
|
928164
|
-
if (!useLocalDocker) {
|
|
928165
|
-
const currentToken = await cliContext.runTask(async (context3) => {
|
|
928166
|
-
return askToLogin(context3);
|
|
928167
|
-
});
|
|
928168
|
-
if (currentToken.type === "user") {
|
|
928169
|
-
await cliContext.runTask(async (context3) => {
|
|
928170
|
-
await createOrganizationIfDoesNotExist({
|
|
928171
|
-
organization: project.config.organization,
|
|
928172
|
-
token: currentToken,
|
|
928173
|
-
context: context3
|
|
928174
|
-
});
|
|
928175
|
-
});
|
|
928176
|
-
}
|
|
928177
|
-
token = currentToken;
|
|
928178
|
-
}
|
|
928179
|
-
for (const workspace of project.apiWorkspaces) {
|
|
928180
|
-
const resolvedGroupNames = resolveGroupNamesForWorkspace(groupName, workspace.generatorsConfiguration);
|
|
928181
|
-
for (const group of workspace.generatorsConfiguration?.groups.filter(
|
|
928182
|
-
(group2) => resolvedGroupNames == null || resolvedGroupNames.includes(group2.groupName)
|
|
928183
|
-
) ?? []) {
|
|
928184
|
-
const filterResult = filterGenerators({
|
|
928185
|
-
generators: group.generators,
|
|
928186
|
-
generatorIndex,
|
|
928187
|
-
generatorName,
|
|
928188
|
-
groupName: group.groupName
|
|
928189
|
-
});
|
|
928190
|
-
if (!filterResult.ok) {
|
|
928191
|
-
continue;
|
|
928192
|
-
}
|
|
928193
|
-
for (const generator of filterResult.generators) {
|
|
928194
|
-
const { shouldProceed } = await checkOutputDirectory(
|
|
928195
|
-
generator.absolutePathToLocalOutput,
|
|
928196
|
-
cliContext,
|
|
928197
|
-
force
|
|
928198
|
-
);
|
|
928199
|
-
if (!shouldProceed) {
|
|
928200
|
-
cliContext.failAndThrow("Generation cancelled", void 0, { code: CliError.Code.ConfigError });
|
|
928201
|
-
}
|
|
928202
|
-
}
|
|
928203
|
-
}
|
|
928204
|
-
}
|
|
928205
|
-
cliContext.instrumentPostHogEvent({
|
|
928206
|
-
orgId: project.config.organization,
|
|
928207
|
-
command: "fern generate",
|
|
928208
|
-
properties: {
|
|
928209
|
-
workspaces: project.apiWorkspaces.map((workspace) => {
|
|
928210
|
-
const resolvedGroupNames = resolveGroupNamesForWorkspace(groupName, workspace.generatorsConfiguration);
|
|
928211
|
-
return {
|
|
928212
|
-
name: workspace.workspaceName,
|
|
928213
|
-
group: groupName,
|
|
928214
|
-
generators: workspace.generatorsConfiguration?.groups.filter((group) => resolvedGroupNames == null || resolvedGroupNames.includes(group.groupName)).map((group) => {
|
|
928215
|
-
return group.generators.filter((generator) => generatorName == null || generator.name === generatorName).map((generator) => {
|
|
928216
|
-
return {
|
|
928217
|
-
name: generator.name,
|
|
928218
|
-
version: generator.version,
|
|
928219
|
-
outputMode: generator.outputMode.type,
|
|
928220
|
-
config: generator.config
|
|
928221
|
-
};
|
|
928222
|
-
});
|
|
928223
|
-
})
|
|
928224
|
-
};
|
|
928225
|
-
})
|
|
928226
|
-
}
|
|
928227
|
-
});
|
|
928228
|
-
await Promise.all(
|
|
928229
|
-
project.apiWorkspaces.map(async (workspace) => {
|
|
928230
|
-
await cliContext.runTaskForWorkspace(workspace, async (context3) => {
|
|
928231
|
-
const absolutePathToPreview = preview ? outputDir != null ? AbsoluteFilePath2.of(resolve6(cwd(), outputDir)) : join8(workspace.absoluteFilePath, RelativeFilePath2.of(PREVIEW_DIRECTORY)) : void 0;
|
|
928232
|
-
if (absolutePathToPreview != null) {
|
|
928233
|
-
context3.logger.info(`Writing preview to ${absolutePathToPreview}`);
|
|
928234
|
-
}
|
|
928235
|
-
await generateWorkspace({
|
|
928236
|
-
organization: project.config.organization,
|
|
928237
|
-
workspace,
|
|
928238
|
-
projectConfig: project.config,
|
|
928239
|
-
context: context3,
|
|
928240
|
-
version: version7,
|
|
928241
|
-
groupName,
|
|
928242
|
-
generatorName,
|
|
928243
|
-
generatorIndex,
|
|
928244
|
-
shouldLogS3Url,
|
|
928245
|
-
token,
|
|
928246
|
-
useLocalDocker,
|
|
928247
|
-
keepDocker,
|
|
928248
|
-
absolutePathToPreview,
|
|
928249
|
-
mode,
|
|
928250
|
-
runner,
|
|
928251
|
-
inspect: inspect6,
|
|
928252
|
-
lfsOverride,
|
|
928253
|
-
fernignorePath,
|
|
928254
|
-
skipFernignore,
|
|
928255
|
-
dynamicIrOnly,
|
|
928256
|
-
noReplay,
|
|
928257
|
-
retryRateLimited,
|
|
928258
|
-
requireEnvVars,
|
|
928259
|
-
automationMode,
|
|
928260
|
-
autoMerge
|
|
928261
|
-
});
|
|
928262
|
-
});
|
|
928263
|
-
})
|
|
928264
|
-
);
|
|
928265
|
-
}
|
|
928266
|
-
function resolveGroupNamesForWorkspace(groupName, generatorsConfiguration) {
|
|
928267
|
-
if (groupName == null) {
|
|
928268
|
-
return null;
|
|
928269
|
-
}
|
|
928270
|
-
if (generatorsConfiguration == null) {
|
|
928271
|
-
return [groupName];
|
|
928272
|
-
}
|
|
928273
|
-
const aliasGroups = generatorsConfiguration.groupAliases[groupName];
|
|
928274
|
-
if (aliasGroups != null) {
|
|
928275
|
-
return aliasGroups;
|
|
928276
|
-
}
|
|
928277
|
-
return [groupName];
|
|
928278
|
-
}
|
|
928279
|
-
|
|
928280
928871
|
// src/commands/generate/generateDocsWorkspace.ts
|
|
928281
928872
|
init_js();
|
|
928282
928873
|
|
|
@@ -928797,7 +929388,7 @@ async function generateOpenAPIIrForWorkspaces({
|
|
|
928797
929388
|
|
|
928798
929389
|
// src/commands/generate-overrides/compareOpenAPISpecs.ts
|
|
928799
929390
|
init_lib6();
|
|
928800
|
-
var
|
|
929391
|
+
var import_promises142 = require("fs/promises");
|
|
928801
929392
|
async function compareOpenAPISpecs({
|
|
928802
929393
|
originalPath,
|
|
928803
929394
|
modifiedPath,
|
|
@@ -928838,12 +929429,12 @@ async function compareOpenAPISpecs({
|
|
|
928838
929429
|
}
|
|
928839
929430
|
outputPath = join8(dirname6(originalPath), RelativeFilePath2.of(overridesFilename));
|
|
928840
929431
|
}
|
|
928841
|
-
await (0,
|
|
929432
|
+
await (0, import_promises142.writeFile)(outputPath, jsYaml.dump(overrides, { lineWidth: -1, noRefs: true }));
|
|
928842
929433
|
context3.logger.info(`Overrides written to ${outputPath}`);
|
|
928843
929434
|
});
|
|
928844
929435
|
}
|
|
928845
929436
|
async function loadSpec2(filepath, context3) {
|
|
928846
|
-
const contents = await (0,
|
|
929437
|
+
const contents = await (0, import_promises142.readFile)(filepath, "utf8");
|
|
928847
929438
|
try {
|
|
928848
929439
|
return JSON.parse(contents);
|
|
928849
929440
|
} catch {
|
|
@@ -928947,7 +929538,7 @@ function deepEqual(a4, b7) {
|
|
|
928947
929538
|
|
|
928948
929539
|
// src/commands/generate-overrides/writeOverridesForWorkspaces.ts
|
|
928949
929540
|
init_lib6();
|
|
928950
|
-
var
|
|
929541
|
+
var import_promises143 = require("fs/promises");
|
|
928951
929542
|
async function writeOverridesForWorkspaces({
|
|
928952
929543
|
project,
|
|
928953
929544
|
includeModels,
|
|
@@ -928972,7 +929563,7 @@ async function writeOverridesForWorkspaces({
|
|
|
928972
929563
|
async function readExistingOverrides(overridesFilepath, context3) {
|
|
928973
929564
|
let parsedOverrides = null;
|
|
928974
929565
|
try {
|
|
928975
|
-
const contents = (await (0,
|
|
929566
|
+
const contents = (await (0, import_promises143.readFile)(overridesFilepath, "utf8")).toString();
|
|
928976
929567
|
try {
|
|
928977
929568
|
parsedOverrides = JSON.parse(contents);
|
|
928978
929569
|
} catch (err) {
|
|
@@ -929037,7 +929628,7 @@ async function writeDefinitionForOpenAPIWorkspace({
|
|
|
929037
929628
|
for (const overridesPath of overridesPaths) {
|
|
929038
929629
|
const existingOverrides = await readExistingOverrides(overridesPath, context3);
|
|
929039
929630
|
const content5 = generateOverridesContent({ ir: ir10, existingOverrides, includeModels, context: context3 });
|
|
929040
|
-
await (0,
|
|
929631
|
+
await (0, import_promises143.writeFile)(overridesPath, jsYaml.dump(content5));
|
|
929041
929632
|
}
|
|
929042
929633
|
} else {
|
|
929043
929634
|
const content5 = generateOverridesContent({ ir: ir10, existingOverrides: {}, includeModels, context: context3 });
|
|
@@ -929051,7 +929642,7 @@ async function writeDefinitionForOpenAPIWorkspace({
|
|
|
929051
929642
|
overridesFilename = `${nameWithoutExt}-overrides${extension4}`;
|
|
929052
929643
|
}
|
|
929053
929644
|
}
|
|
929054
|
-
await (0,
|
|
929645
|
+
await (0, import_promises143.writeFile)(
|
|
929055
929646
|
join8(dirname6(spec.absoluteFilepath), RelativeFilePath2.of(overridesFilename)),
|
|
929056
929647
|
jsYaml.dump(content5)
|
|
929057
929648
|
);
|
|
@@ -929467,7 +930058,7 @@ function convertIRtoJsonSchema(args) {
|
|
|
929467
930058
|
}
|
|
929468
930059
|
|
|
929469
930060
|
// src/commands/jsonschema/generateJsonschemaForWorkspace.ts
|
|
929470
|
-
var
|
|
930061
|
+
var import_promises144 = require("fs/promises");
|
|
929471
930062
|
async function generateJsonschemaForWorkspaces({
|
|
929472
930063
|
typeLocator,
|
|
929473
930064
|
project,
|
|
@@ -929515,9 +930106,9 @@ async function generateJsonschemaForWorkspaces({
|
|
|
929515
930106
|
context: context3
|
|
929516
930107
|
});
|
|
929517
930108
|
if (!await doesPathExist(dirname6(jsonschemaFilepath))) {
|
|
929518
|
-
await (0,
|
|
930109
|
+
await (0, import_promises144.mkdir)(dirname6(jsonschemaFilepath), { recursive: true });
|
|
929519
930110
|
}
|
|
929520
|
-
await (0,
|
|
930111
|
+
await (0, import_promises144.writeFile)(jsonschemaFilepath, JSON.stringify(jsonSchema, null, 2));
|
|
929521
930112
|
context3.logger.info(source_default.green(`Wrote JSON Schema to ${jsonschemaFilepath}`));
|
|
929522
930113
|
});
|
|
929523
930114
|
})
|
|
@@ -929526,7 +930117,7 @@ async function generateJsonschemaForWorkspaces({
|
|
|
929526
930117
|
|
|
929527
930118
|
// src/commands/merge/mergeOpenAPIWithOverrides.ts
|
|
929528
930119
|
init_lib6();
|
|
929529
|
-
var
|
|
930120
|
+
var import_promises145 = require("fs/promises");
|
|
929530
930121
|
var HTTP_METHODS2 = /* @__PURE__ */ new Set(["get", "put", "post", "delete", "options", "head", "patch", "trace"]);
|
|
929531
930122
|
async function mergeOpenAPIWithOverrides({
|
|
929532
930123
|
openapiPath,
|
|
@@ -929551,12 +930142,12 @@ async function mergeOpenAPIWithOverrides({
|
|
|
929551
930142
|
const merged = mergeExamplesIntoSpec(openapi, overrides, context3);
|
|
929552
930143
|
const isJson = outputPath.endsWith(".json");
|
|
929553
930144
|
const output2 = isJson ? JSON.stringify(merged, null, 2) : jsYaml.dump(merged, { lineWidth: -1, noRefs: true });
|
|
929554
|
-
await (0,
|
|
930145
|
+
await (0, import_promises145.writeFile)(outputPath, output2);
|
|
929555
930146
|
context3.logger.info(`Merged output written to ${outputPath}`);
|
|
929556
930147
|
});
|
|
929557
930148
|
}
|
|
929558
930149
|
async function loadYamlOrJson(filepath, context3) {
|
|
929559
|
-
const contents = await (0,
|
|
930150
|
+
const contents = await (0, import_promises145.readFile)(filepath, "utf8");
|
|
929560
930151
|
try {
|
|
929561
930152
|
return JSON.parse(contents);
|
|
929562
930153
|
} catch {
|
|
@@ -930190,7 +930781,7 @@ async function mockServer({
|
|
|
930190
930781
|
}
|
|
930191
930782
|
|
|
930192
930783
|
// src/commands/register/registerWorkspacesV1.ts
|
|
930193
|
-
var
|
|
930784
|
+
var import_promises146 = require("fs/promises");
|
|
930194
930785
|
var import_path93 = __toESM(require("path"), 1);
|
|
930195
930786
|
var import_tmp_promise16 = __toESM(require_tmp_promise(), 1);
|
|
930196
930787
|
async function registerWorkspacesV1({
|
|
@@ -930243,7 +930834,7 @@ async function registerWorkspacesV1({
|
|
|
930243
930834
|
context3.logger.debug(`Compressing definition at ${tmpDir.path}`);
|
|
930244
930835
|
await Zn8({ file: tarPath, cwd: resolvedWorkspace.absoluteFilePath }, ["."]);
|
|
930245
930836
|
context3.logger.info("Uploading definition...");
|
|
930246
|
-
await axios_default.put(registerApiResponse.body.definitionS3UploadUrl, await (0,
|
|
930837
|
+
await axios_default.put(registerApiResponse.body.definitionS3UploadUrl, await (0, import_promises146.readFile)(tarPath));
|
|
930247
930838
|
context3.logger.info(
|
|
930248
930839
|
`Registered @${project.config.organization}/${resolvedWorkspace.definition.rootApiFile.contents.name}:${registerApiResponse.body.version}`
|
|
930249
930840
|
);
|
|
@@ -930485,7 +931076,7 @@ async function generateDiff({
|
|
|
930485
931076
|
|
|
930486
931077
|
// src/commands/sdk-preview/sdkPreview.ts
|
|
930487
931078
|
init_lib6();
|
|
930488
|
-
var
|
|
931079
|
+
var import_promises147 = __toESM(require("fs/promises"), 1);
|
|
930489
931080
|
|
|
930490
931081
|
// src/commands/sdk-preview/computePreviewVersion.ts
|
|
930491
931082
|
var BASE_VERSION = "0.0.1";
|
|
@@ -930605,7 +931196,7 @@ async function sdkPreview({
|
|
|
930605
931196
|
const firstPath = pathOutputs[0];
|
|
930606
931197
|
const absolutePathToOutput = firstPath != null ? AbsoluteFilePath2.of(resolve6(cwd(), firstPath)) : void 0;
|
|
930607
931198
|
if (absolutePathToOutput != null) {
|
|
930608
|
-
await
|
|
931199
|
+
await import_promises147.default.mkdir(absolutePathToOutput, { recursive: true });
|
|
930609
931200
|
}
|
|
930610
931201
|
for (const workspace of project.apiWorkspaces) {
|
|
930611
931202
|
if (workspace.generatorsConfiguration == null) {
|
|
@@ -930789,7 +931380,7 @@ async function sdkPreview({
|
|
|
930789
931380
|
}
|
|
930790
931381
|
|
|
930791
931382
|
// src/commands/self-update/selfUpdate.ts
|
|
930792
|
-
var
|
|
931383
|
+
var import_promises148 = require("fs/promises");
|
|
930793
931384
|
var import_path94 = require("path");
|
|
930794
931385
|
async function getPackageManagerBinDir(logger4, pm) {
|
|
930795
931386
|
let command3;
|
|
@@ -930835,7 +931426,7 @@ async function detectInstallationMethod(logger4) {
|
|
|
930835
931426
|
logger4.debug(`Found fern at: ${fernPath}`);
|
|
930836
931427
|
let resolvedPath;
|
|
930837
931428
|
try {
|
|
930838
|
-
resolvedPath = await (0,
|
|
931429
|
+
resolvedPath = await (0, import_promises148.realpath)(fernPath);
|
|
930839
931430
|
logger4.debug(`Resolved to: ${resolvedPath}`);
|
|
930840
931431
|
} catch (error50) {
|
|
930841
931432
|
logger4.debug(`Failed to resolve symlink: ${error50}`);
|
|
@@ -931138,21 +931729,21 @@ async function generateToken({
|
|
|
931138
931729
|
// src/commands/upgrade/updateApiSpec.ts
|
|
931139
931730
|
init_lib6();
|
|
931140
931731
|
var fs26 = __toESM(require("fs"), 1);
|
|
931141
|
-
var
|
|
931732
|
+
var import_promises149 = require("fs/promises");
|
|
931142
931733
|
init_graphql();
|
|
931143
931734
|
var import_stream16 = require("stream");
|
|
931144
|
-
var
|
|
931735
|
+
var import_promises150 = require("stream/promises");
|
|
931145
931736
|
async function fetchAndWriteFile(url3, path99, logger4, indent4) {
|
|
931146
931737
|
const resp = await fetch(url3);
|
|
931147
931738
|
if (resp.ok && resp.body) {
|
|
931148
931739
|
logger4.debug("Origin successfully fetched, writing to file");
|
|
931149
931740
|
const fileStream = fs26.createWriteStream(path99);
|
|
931150
|
-
await (0,
|
|
931151
|
-
const fileContents = await (0,
|
|
931741
|
+
await (0, import_promises150.finished)(import_stream16.Readable.fromWeb(resp.body).pipe(fileStream));
|
|
931742
|
+
const fileContents = await (0, import_promises149.readFile)(path99, "utf8");
|
|
931152
931743
|
try {
|
|
931153
|
-
await (0,
|
|
931744
|
+
await (0, import_promises149.writeFile)(path99, JSON.stringify(JSON.parse(fileContents), void 0, indent4), "utf8");
|
|
931154
931745
|
} catch (e5) {
|
|
931155
|
-
await (0,
|
|
931746
|
+
await (0, import_promises149.writeFile)(path99, jsYaml.dump(jsYaml.load(fileContents), { indent: indent4 }), "utf8");
|
|
931156
931747
|
}
|
|
931157
931748
|
logger4.debug("File written successfully");
|
|
931158
931749
|
}
|
|
@@ -931308,14 +931899,14 @@ async function tryDirectJSONFetch(url3, logger4) {
|
|
|
931308
931899
|
async function fetchGraphQLSchemaWithAutoDetection(url3, path99, logger4) {
|
|
931309
931900
|
const postResult = await tryGraphQLIntrospection(url3, logger4);
|
|
931310
931901
|
if (postResult.success) {
|
|
931311
|
-
await (0,
|
|
931902
|
+
await (0, import_promises149.writeFile)(path99, postResult.result, "utf8");
|
|
931312
931903
|
logger4.info("Successfully fetched GraphQL schema using POST introspection");
|
|
931313
931904
|
return;
|
|
931314
931905
|
}
|
|
931315
931906
|
logger4.debug(`POST introspection failed: ${postResult.error}`);
|
|
931316
931907
|
const getResult = await tryDirectJSONFetch(url3, logger4);
|
|
931317
931908
|
if (getResult.success) {
|
|
931318
|
-
await (0,
|
|
931909
|
+
await (0, import_promises149.writeFile)(path99, getResult.result, "utf8");
|
|
931319
931910
|
logger4.info("Successfully fetched GraphQL schema using direct JSON fetch");
|
|
931320
931911
|
return;
|
|
931321
931912
|
}
|
|
@@ -931424,7 +932015,7 @@ async function processDefinitions({
|
|
|
931424
932015
|
init_lib4();
|
|
931425
932016
|
|
|
931426
932017
|
// ../cli-migrations/lib/migrations/0.0.191/discriminant/migration.js
|
|
931427
|
-
var
|
|
932018
|
+
var import_promises151 = require("fs/promises");
|
|
931428
932019
|
|
|
931429
932020
|
// ../cli-migrations/lib/migrations/0.0.191/discriminant/getAllYamlFiles.js
|
|
931430
932021
|
init_lib6();
|
|
@@ -931460,7 +932051,7 @@ var migration = {
|
|
|
931460
932051
|
try {
|
|
931461
932052
|
const fileContents = await getFileContents(yamlFilepath);
|
|
931462
932053
|
const newContents = addDiscriminantToFile(fileContents);
|
|
931463
|
-
await (0,
|
|
932054
|
+
await (0, import_promises151.writeFile)(yamlFilepath, newContents);
|
|
931464
932055
|
} catch (error50) {
|
|
931465
932056
|
context3.failAndThrow("Failed to migrate " + yamlFilepath, error50);
|
|
931466
932057
|
}
|
|
@@ -931468,7 +932059,7 @@ var migration = {
|
|
|
931468
932059
|
}
|
|
931469
932060
|
};
|
|
931470
932061
|
async function getFileContents(filepath) {
|
|
931471
|
-
const buffer = await (0,
|
|
932062
|
+
const buffer = await (0, import_promises151.readFile)(filepath);
|
|
931472
932063
|
return buffer.toString();
|
|
931473
932064
|
}
|
|
931474
932065
|
var UNION_REGEX = /^(\s{2,})union:\s*$/gm;
|
|
@@ -931497,7 +932088,7 @@ var versionMigrations = {
|
|
|
931497
932088
|
var __default = versionMigrations;
|
|
931498
932089
|
|
|
931499
932090
|
// ../cli-migrations/lib/migrations/0.0.203/union-single-property-key/migration.js
|
|
931500
|
-
var
|
|
932091
|
+
var import_promises152 = require("fs/promises");
|
|
931501
932092
|
var import_yaml7 = __toESM(require_dist9(), 1);
|
|
931502
932093
|
|
|
931503
932094
|
// ../cli-migrations/lib/migrations/0.0.203/union-single-property-key/getAllYamlFiles.js
|
|
@@ -931540,7 +932131,7 @@ var migration2 = {
|
|
|
931540
932131
|
}
|
|
931541
932132
|
};
|
|
931542
932133
|
async function migrateFile(filepath, context3) {
|
|
931543
|
-
const contents = await (0,
|
|
932134
|
+
const contents = await (0, import_promises152.readFile)(filepath);
|
|
931544
932135
|
const parsedDocument = import_yaml7.default.parseDocument(contents.toString());
|
|
931545
932136
|
const types4 = parsedDocument.get("types");
|
|
931546
932137
|
if (types4 == null) {
|
|
@@ -931572,7 +932163,7 @@ async function migrateFile(filepath, context3) {
|
|
|
931572
932163
|
}
|
|
931573
932164
|
}
|
|
931574
932165
|
}
|
|
931575
|
-
await (0,
|
|
932166
|
+
await (0, import_promises152.writeFile)(filepath, parsedDocument.toString());
|
|
931576
932167
|
}
|
|
931577
932168
|
|
|
931578
932169
|
// ../cli-migrations/lib/migrations/0.0.203/index.js
|
|
@@ -931583,7 +932174,7 @@ var versionMigrations2 = {
|
|
|
931583
932174
|
var __default2 = versionMigrations2;
|
|
931584
932175
|
|
|
931585
932176
|
// ../cli-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/migration.js
|
|
931586
|
-
var
|
|
932177
|
+
var import_promises153 = require("fs/promises");
|
|
931587
932178
|
var import_yaml8 = __toESM(require_dist9(), 1);
|
|
931588
932179
|
|
|
931589
932180
|
// ../cli-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/getAllGeneratorYamlFiles.js
|
|
@@ -931626,7 +932217,7 @@ var migration3 = {
|
|
|
931626
932217
|
}
|
|
931627
932218
|
};
|
|
931628
932219
|
async function migrateGeneratorsYml(filepath, context3) {
|
|
931629
|
-
const contents = await (0,
|
|
932220
|
+
const contents = await (0, import_promises153.readFile)(filepath);
|
|
931630
932221
|
const parsedDocument = import_yaml8.default.parseDocument(contents.toString());
|
|
931631
932222
|
const draftGenerators = parsedDocument.get("draft");
|
|
931632
932223
|
if (draftGenerators == null) {
|
|
@@ -931653,7 +932244,7 @@ async function migrateGeneratorsYml(filepath, context3) {
|
|
|
931653
932244
|
draftGenerator.set("output-path", name2.value.includes("openapi") ? "./generated-openapi" : name2.value.includes("postman") ? "./generated-postman" : localOutput);
|
|
931654
932245
|
}
|
|
931655
932246
|
});
|
|
931656
|
-
await (0,
|
|
932247
|
+
await (0, import_promises153.writeFile)(filepath, parsedDocument.toString());
|
|
931657
932248
|
}
|
|
931658
932249
|
|
|
931659
932250
|
// ../cli-migrations/lib/migrations/0.0.207/index.js
|
|
@@ -931664,7 +932255,7 @@ var versionMigrations3 = {
|
|
|
931664
932255
|
var __default3 = versionMigrations3;
|
|
931665
932256
|
|
|
931666
932257
|
// ../cli-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/migration.js
|
|
931667
|
-
var
|
|
932258
|
+
var import_promises154 = require("fs/promises");
|
|
931668
932259
|
var import_yaml9 = __toESM(require_dist9(), 1);
|
|
931669
932260
|
|
|
931670
932261
|
// ../cli-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/getAllYamlFiles.js
|
|
@@ -931707,7 +932298,7 @@ var migration4 = {
|
|
|
931707
932298
|
}
|
|
931708
932299
|
};
|
|
931709
932300
|
async function migrateFile2(filepath, context3) {
|
|
931710
|
-
const contents = await (0,
|
|
932301
|
+
const contents = await (0, import_promises154.readFile)(filepath);
|
|
931711
932302
|
const parsedDocument = import_yaml9.default.parseDocument(contents.toString());
|
|
931712
932303
|
const addType = (typeName, typeDeclaration2) => {
|
|
931713
932304
|
const types4 = parsedDocument.get("types");
|
|
@@ -931751,7 +932342,7 @@ async function migrateFile2(filepath, context3) {
|
|
|
931751
932342
|
}
|
|
931752
932343
|
}
|
|
931753
932344
|
}
|
|
931754
|
-
await (0,
|
|
932345
|
+
await (0, import_promises154.writeFile)(filepath, parsedDocument.toString());
|
|
931755
932346
|
}
|
|
931756
932347
|
|
|
931757
932348
|
// ../cli-migrations/lib/migrations/0.0.210/index.js
|
|
@@ -931762,7 +932353,7 @@ var versionMigrations4 = {
|
|
|
931762
932353
|
var __default4 = versionMigrations4;
|
|
931763
932354
|
|
|
931764
932355
|
// ../cli-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/migration.js
|
|
931765
|
-
var
|
|
932356
|
+
var import_promises155 = require("fs/promises");
|
|
931766
932357
|
var import_yaml10 = __toESM(require_dist9(), 1);
|
|
931767
932358
|
|
|
931768
932359
|
// ../cli-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/getAllGeneratorYamlFiles.js
|
|
@@ -931805,7 +932396,7 @@ var migration5 = {
|
|
|
931805
932396
|
}
|
|
931806
932397
|
};
|
|
931807
932398
|
async function migrateGeneratorsYml2(filepath, context3) {
|
|
931808
|
-
const contents = await (0,
|
|
932399
|
+
const contents = await (0, import_promises155.readFile)(filepath);
|
|
931809
932400
|
const parsedDocument = import_yaml10.default.parseDocument(contents.toString());
|
|
931810
932401
|
const releaseGenerators = parsedDocument.get("release");
|
|
931811
932402
|
if (releaseGenerators == null) {
|
|
@@ -931843,7 +932434,7 @@ async function migrateGeneratorsYml2(filepath, context3) {
|
|
|
931843
932434
|
}
|
|
931844
932435
|
releaseGenerator.delete("outputs");
|
|
931845
932436
|
});
|
|
931846
|
-
await (0,
|
|
932437
|
+
await (0, import_promises155.writeFile)(filepath, parsedDocument.toString());
|
|
931847
932438
|
}
|
|
931848
932439
|
|
|
931849
932440
|
// ../cli-migrations/lib/migrations/0.0.212/index.js
|
|
@@ -931854,7 +932445,7 @@ var versionMigrations5 = {
|
|
|
931854
932445
|
var __default5 = versionMigrations5;
|
|
931855
932446
|
|
|
931856
932447
|
// ../cli-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/migration.js
|
|
931857
|
-
var
|
|
932448
|
+
var import_promises156 = require("fs/promises");
|
|
931858
932449
|
|
|
931859
932450
|
// ../cli-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/getAllYamlFiles.js
|
|
931860
932451
|
init_lib6();
|
|
@@ -931887,9 +932478,9 @@ var migration6 = {
|
|
|
931887
932478
|
run: async ({ context: context3 }) => {
|
|
931888
932479
|
const yamlFiles = await getAllYamlFiles4(context3);
|
|
931889
932480
|
for (const filepath of yamlFiles) {
|
|
931890
|
-
const contents = await (0,
|
|
932481
|
+
const contents = await (0, import_promises156.readFile)(filepath);
|
|
931891
932482
|
const newContents = contents.toString().replaceAll(" alias:", " type:");
|
|
931892
|
-
await (0,
|
|
932483
|
+
await (0, import_promises156.writeFile)(filepath, newContents);
|
|
931893
932484
|
}
|
|
931894
932485
|
}
|
|
931895
932486
|
};
|
|
@@ -931902,7 +932493,7 @@ var versionMigrations6 = {
|
|
|
931902
932493
|
var __default6 = versionMigrations6;
|
|
931903
932494
|
|
|
931904
932495
|
// ../cli-migrations/lib/migrations/0.0.221/add-error-discriminant/migration.js
|
|
931905
|
-
var
|
|
932496
|
+
var import_promises157 = require("fs/promises");
|
|
931906
932497
|
|
|
931907
932498
|
// ../cli-migrations/lib/migrations/0.0.221/add-error-discriminant/getAllRootApiYamlFiles.js
|
|
931908
932499
|
init_lib6();
|
|
@@ -931935,9 +932526,9 @@ var migration7 = {
|
|
|
931935
932526
|
run: async ({ context: context3 }) => {
|
|
931936
932527
|
const yamlFiles = await getAllRootApiYamlFiles(context3);
|
|
931937
932528
|
for (const filepath of yamlFiles) {
|
|
931938
|
-
const contents = await (0,
|
|
932529
|
+
const contents = await (0, import_promises157.readFile)(filepath);
|
|
931939
932530
|
const newContents = contents.toString() + "\nerror-discriminant: error";
|
|
931940
|
-
await (0,
|
|
932531
|
+
await (0, import_promises157.writeFile)(filepath, newContents);
|
|
931941
932532
|
}
|
|
931942
932533
|
}
|
|
931943
932534
|
};
|
|
@@ -931951,7 +932542,7 @@ var __default7 = versionMigrations7;
|
|
|
931951
932542
|
|
|
931952
932543
|
// ../cli-migrations/lib/migrations/0.0.241/add-generator-groups/migration.js
|
|
931953
932544
|
init_lib4();
|
|
931954
|
-
var
|
|
932545
|
+
var import_promises158 = require("fs/promises");
|
|
931955
932546
|
|
|
931956
932547
|
// ../cli-migrations/lib/migrations/0.0.241/add-generator-groups/getAllGeneratorYamlFiles.js
|
|
931957
932548
|
init_lib6();
|
|
@@ -932083,7 +932674,7 @@ var migration8 = {
|
|
|
932083
932674
|
}
|
|
932084
932675
|
};
|
|
932085
932676
|
async function migrateGeneratorsYml3(filepath) {
|
|
932086
|
-
const contentsStr = await (0,
|
|
932677
|
+
const contentsStr = await (0, import_promises158.readFile)(filepath);
|
|
932087
932678
|
const contents = jsYaml.load(contentsStr.toString());
|
|
932088
932679
|
const oldGeneratorsConfiguration = GeneratorsConfigurationSchema2.parse(contents);
|
|
932089
932680
|
let newGeneratorsConfiguration = {};
|
|
@@ -932101,7 +932692,7 @@ async function migrateGeneratorsYml3(filepath) {
|
|
|
932101
932692
|
generators: oldGeneratorsConfiguration.release.map((releaseGeneratorInvocation) => convertReleaseGeneratorInvocation(releaseGeneratorInvocation))
|
|
932102
932693
|
};
|
|
932103
932694
|
}
|
|
932104
|
-
await (0,
|
|
932695
|
+
await (0, import_promises158.writeFile)(filepath, jsYaml.dump(newGeneratorsConfiguration));
|
|
932105
932696
|
}
|
|
932106
932697
|
function convertDraftGeneratorInvocation(draftGeneratorInvocation) {
|
|
932107
932698
|
const newSchema = {
|
|
@@ -932176,7 +932767,7 @@ var versionMigrations8 = {
|
|
|
932176
932767
|
var __default8 = versionMigrations8;
|
|
932177
932768
|
|
|
932178
932769
|
// ../cli-migrations/lib/migrations/0.0.248/add-error-discrimination-config/migration.js
|
|
932179
|
-
var
|
|
932770
|
+
var import_promises159 = require("fs/promises");
|
|
932180
932771
|
var import_yaml11 = __toESM(require_dist9(), 1);
|
|
932181
932772
|
|
|
932182
932773
|
// ../cli-migrations/lib/migrations/0.0.248/add-error-discrimination-config/getAllRootApiYamlFiles.js
|
|
@@ -932219,7 +932810,7 @@ var migration9 = {
|
|
|
932219
932810
|
}
|
|
932220
932811
|
};
|
|
932221
932812
|
async function migrateRootApiFile(filepath) {
|
|
932222
|
-
const contents = await (0,
|
|
932813
|
+
const contents = await (0, import_promises159.readFile)(filepath);
|
|
932223
932814
|
const parsedDocument = import_yaml11.default.parseDocument(contents.toString());
|
|
932224
932815
|
const errorDiscriminant = parsedDocument.get("error-discriminant", true);
|
|
932225
932816
|
if (errorDiscriminant == null || !import_yaml11.default.isScalar(errorDiscriminant) || typeof errorDiscriminant.value !== "string") {
|
|
@@ -932230,7 +932821,7 @@ async function migrateRootApiFile(filepath) {
|
|
|
932230
932821
|
"property-name": errorDiscriminant.value
|
|
932231
932822
|
});
|
|
932232
932823
|
parsedDocument.delete("error-discriminant");
|
|
932233
|
-
await (0,
|
|
932824
|
+
await (0, import_promises159.writeFile)(filepath, parsedDocument.toString());
|
|
932234
932825
|
}
|
|
932235
932826
|
|
|
932236
932827
|
// ../cli-migrations/lib/migrations/0.0.248/index.js
|
|
@@ -932241,7 +932832,7 @@ var versionMigrations9 = {
|
|
|
932241
932832
|
var __default9 = versionMigrations9;
|
|
932242
932833
|
|
|
932243
932834
|
// ../cli-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/migration.js
|
|
932244
|
-
var
|
|
932835
|
+
var import_promises160 = require("fs/promises");
|
|
932245
932836
|
var import_yaml12 = __toESM(require_dist9(), 1);
|
|
932246
932837
|
|
|
932247
932838
|
// ../cli-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/getAllYamlFiles.js
|
|
@@ -932284,7 +932875,7 @@ var migration10 = {
|
|
|
932284
932875
|
}
|
|
932285
932876
|
};
|
|
932286
932877
|
async function migrateYamlFile(filepath, context3) {
|
|
932287
|
-
const contents = await (0,
|
|
932878
|
+
const contents = await (0, import_promises160.readFile)(filepath);
|
|
932288
932879
|
const parsedDocument = import_yaml12.default.parseDocument(contents.toString());
|
|
932289
932880
|
const services = parsedDocument.get("services");
|
|
932290
932881
|
if (services == null) {
|
|
@@ -932324,7 +932915,7 @@ async function migrateYamlFile(filepath, context3) {
|
|
|
932324
932915
|
context3.failWithoutThrowing("Failed to convert endpoint", e5);
|
|
932325
932916
|
}
|
|
932326
932917
|
}
|
|
932327
|
-
await (0,
|
|
932918
|
+
await (0, import_promises160.writeFile)(filepath, parsedDocument.toString());
|
|
932328
932919
|
}
|
|
932329
932920
|
}
|
|
932330
932921
|
function convertEndpoint4({ document: document4, endpoint: endpoint3 }) {
|
|
@@ -932403,7 +932994,7 @@ var versionMigrations10 = {
|
|
|
932403
932994
|
var __default10 = versionMigrations10;
|
|
932404
932995
|
|
|
932405
932996
|
// ../cli-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/migration.js
|
|
932406
|
-
var
|
|
932997
|
+
var import_promises161 = require("fs/promises");
|
|
932407
932998
|
var import_yaml13 = __toESM(require_dist9(), 1);
|
|
932408
932999
|
|
|
932409
933000
|
// ../cli-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/getAllYamlFiles.js
|
|
@@ -932446,7 +933037,7 @@ var migration11 = {
|
|
|
932446
933037
|
}
|
|
932447
933038
|
};
|
|
932448
933039
|
async function migrateYamlFile2(filepath, context3) {
|
|
932449
|
-
const contents = await (0,
|
|
933040
|
+
const contents = await (0, import_promises161.readFile)(filepath);
|
|
932450
933041
|
const parsedDocument = import_yaml13.default.parseDocument(contents.toString());
|
|
932451
933042
|
const types4 = parsedDocument.get("types");
|
|
932452
933043
|
if (types4 == null) {
|
|
@@ -932472,7 +933063,7 @@ async function migrateYamlFile2(filepath, context3) {
|
|
|
932472
933063
|
examples.set(i9, { value: value2 });
|
|
932473
933064
|
}
|
|
932474
933065
|
}
|
|
932475
|
-
await (0,
|
|
933066
|
+
await (0, import_promises161.writeFile)(filepath, parsedDocument.toString());
|
|
932476
933067
|
}
|
|
932477
933068
|
|
|
932478
933069
|
// ../cli-migrations/lib/migrations/0.3.0-rc12/index.js
|
|
@@ -932483,7 +933074,7 @@ var versionMigrations11 = {
|
|
|
932483
933074
|
var __default11 = versionMigrations11;
|
|
932484
933075
|
|
|
932485
933076
|
// ../cli-migrations/lib/migrations/0.3.23/change-services-key-to-service/migration.js
|
|
932486
|
-
var
|
|
933077
|
+
var import_promises162 = require("fs/promises");
|
|
932487
933078
|
var import_yaml14 = __toESM(require_dist9(), 1);
|
|
932488
933079
|
|
|
932489
933080
|
// ../cli-migrations/lib/migrations/0.3.23/change-services-key-to-service/getAllYamlFiles.js
|
|
@@ -932526,7 +933117,7 @@ var migration12 = {
|
|
|
932526
933117
|
}
|
|
932527
933118
|
};
|
|
932528
933119
|
async function migrateYamlFile3(filepath, context3) {
|
|
932529
|
-
const contents = await (0,
|
|
933120
|
+
const contents = await (0, import_promises162.readFile)(filepath);
|
|
932530
933121
|
const parsedDocument = import_yaml14.default.parseDocument(contents.toString());
|
|
932531
933122
|
if (!import_yaml14.default.isMap(parsedDocument.contents)) {
|
|
932532
933123
|
return context3.failAndThrow("File is not a map");
|
|
@@ -932556,7 +933147,7 @@ async function migrateYamlFile3(filepath, context3) {
|
|
|
932556
933147
|
pair.value = firstService.value;
|
|
932557
933148
|
}
|
|
932558
933149
|
}
|
|
932559
|
-
await (0,
|
|
933150
|
+
await (0, import_promises162.writeFile)(filepath, parsedDocument.toString());
|
|
932560
933151
|
}
|
|
932561
933152
|
|
|
932562
933153
|
// ../cli-migrations/lib/migrations/0.3.23/index.js
|
|
@@ -932567,7 +933158,7 @@ var versionMigrations12 = {
|
|
|
932567
933158
|
var __default12 = versionMigrations12;
|
|
932568
933159
|
|
|
932569
933160
|
// ../cli-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/migration.js
|
|
932570
|
-
var
|
|
933161
|
+
var import_promises163 = require("fs/promises");
|
|
932571
933162
|
var import_yaml15 = __toESM(require_dist9(), 1);
|
|
932572
933163
|
|
|
932573
933164
|
// ../cli-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/getAllYamlFiles.js
|
|
@@ -932610,7 +933201,7 @@ var migration13 = {
|
|
|
932610
933201
|
}
|
|
932611
933202
|
};
|
|
932612
933203
|
async function migrateYamlFile4(filepath, context3) {
|
|
932613
|
-
const contents = await (0,
|
|
933204
|
+
const contents = await (0, import_promises163.readFile)(filepath);
|
|
932614
933205
|
const parsedDocument = import_yaml15.default.parseDocument(contents.toString());
|
|
932615
933206
|
if (!import_yaml15.default.isMap(parsedDocument.contents)) {
|
|
932616
933207
|
return context3.failAndThrow("File is not a map");
|
|
@@ -932629,7 +933220,7 @@ async function migrateYamlFile4(filepath, context3) {
|
|
|
932629
933220
|
}
|
|
932630
933221
|
service.items.splice(indexOfServiceDocsPair, 1);
|
|
932631
933222
|
parsedDocument.contents.items.unshift(docsPair);
|
|
932632
|
-
await (0,
|
|
933223
|
+
await (0, import_promises163.writeFile)(filepath, parsedDocument.toString());
|
|
932633
933224
|
}
|
|
932634
933225
|
|
|
932635
933226
|
// ../cli-migrations/lib/migrations/0.5.4/index.js
|
|
@@ -932640,7 +933231,7 @@ var versionMigrations13 = {
|
|
|
932640
933231
|
var __default13 = versionMigrations13;
|
|
932641
933232
|
|
|
932642
933233
|
// ../cli-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/migration.js
|
|
932643
|
-
var
|
|
933234
|
+
var import_promises164 = require("fs/promises");
|
|
932644
933235
|
|
|
932645
933236
|
// ../cli-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/getAllGeneratorYamlFiles.js
|
|
932646
933237
|
init_lib6();
|
|
@@ -932682,14 +933273,14 @@ var migration14 = {
|
|
|
932682
933273
|
}
|
|
932683
933274
|
};
|
|
932684
933275
|
async function migrateYamlFile5(filepath) {
|
|
932685
|
-
const contents = await (0,
|
|
933276
|
+
const contents = await (0, import_promises164.readFile)(filepath);
|
|
932686
933277
|
const domainSuffix = process.env.DOMAIN_SUFFIX ?? "docs.buildwithfern.com";
|
|
932687
933278
|
const regex5 = /(docs:\s*domain:\s*)"([^"]*)"/g;
|
|
932688
933279
|
const updatedSnapshot = contents.toString().replace(regex5, (_match, _prefix, domain3) => {
|
|
932689
933280
|
return `docs:
|
|
932690
933281
|
domain: "${domain3}.${domainSuffix}"`;
|
|
932691
933282
|
});
|
|
932692
|
-
await (0,
|
|
933283
|
+
await (0, import_promises164.writeFile)(filepath, updatedSnapshot.toString());
|
|
932693
933284
|
}
|
|
932694
933285
|
|
|
932695
933286
|
// ../cli-migrations/lib/migrations/0.9.10/index.js
|
|
@@ -932709,10 +933300,10 @@ var LegacyDocsSerializers = __toESM(require_serialization4(), 1);
|
|
|
932709
933300
|
|
|
932710
933301
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/loadRawDocsConfiguration.js
|
|
932711
933302
|
init_lib6();
|
|
932712
|
-
var
|
|
933303
|
+
var import_promises165 = require("fs/promises");
|
|
932713
933304
|
async function loadRawDocsConfiguration2({ absolutePathToWorkspace }) {
|
|
932714
933305
|
const filepath = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
932715
|
-
const contentsStr = await (0,
|
|
933306
|
+
const contentsStr = await (0, import_promises165.readFile)(filepath);
|
|
932716
933307
|
const contentsParsed = jsYaml.load(contentsStr.toString());
|
|
932717
933308
|
const result = await LegacyDocsSerializers.DocsConfiguration.parse(contentsParsed);
|
|
932718
933309
|
if (result.ok) {
|
|
@@ -932731,7 +933322,7 @@ function getAbsolutePathToDocsFolder({ absolutePathToWorkspace }) {
|
|
|
932731
933322
|
|
|
932732
933323
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndMultipleAPIs.js
|
|
932733
933324
|
init_lib6();
|
|
932734
|
-
var
|
|
933325
|
+
var import_promises167 = require("fs/promises");
|
|
932735
933326
|
|
|
932736
933327
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/convertLegacyDocsConfig.js
|
|
932737
933328
|
function convertLegacyDocsConfig({ docsConfiguration, docsURLs, apiName }) {
|
|
@@ -932939,10 +933530,10 @@ __export(legacy_exports, {
|
|
|
932939
933530
|
|
|
932940
933531
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/generators-configuration/loadRawGeneratorsConfiguration.js
|
|
932941
933532
|
init_lib6();
|
|
932942
|
-
var
|
|
933533
|
+
var import_promises166 = require("fs/promises");
|
|
932943
933534
|
async function loadRawGeneratorsConfiguration2({ absolutePathToWorkspace }) {
|
|
932944
933535
|
const filepath = getAbsolutePathToGeneratorsConfiguration({ absolutePathToWorkspace });
|
|
932945
|
-
const contentsStr = await (0,
|
|
933536
|
+
const contentsStr = await (0, import_promises166.readFile)(filepath);
|
|
932946
933537
|
const contentsParsed = jsYaml.load(contentsStr.toString());
|
|
932947
933538
|
const result = await legacy_exports.GeneratorsConfigurationSchema.safeParseAsync(contentsParsed);
|
|
932948
933539
|
if (result.success) {
|
|
@@ -932972,7 +933563,7 @@ function migrateDocsInstances(docsURLs) {
|
|
|
932972
933563
|
var APIS_DIRECTORY2 = "apis";
|
|
932973
933564
|
async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspaces, workspaceContainingDocs }) {
|
|
932974
933565
|
const absolutePathToApisDirectory = join8(absolutePathToFernDirectory, RelativeFilePath2.of(APIS_DIRECTORY2));
|
|
932975
|
-
await (0,
|
|
933566
|
+
await (0, import_promises167.mkdir)(absolutePathToApisDirectory);
|
|
932976
933567
|
for (const workspace of workspaces) {
|
|
932977
933568
|
const absolutePathToWorkspace = join8(absolutePathToFernDirectory, RelativeFilePath2.of(workspace));
|
|
932978
933569
|
const docsURLs = await migrateAndWriteGeneratorsYml({ absolutePathToWorkspace });
|
|
@@ -932980,11 +933571,11 @@ async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspa
|
|
|
932980
933571
|
await migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName: workspaceContainingDocs });
|
|
932981
933572
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
932982
933573
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
932983
|
-
await (0,
|
|
933574
|
+
await (0, import_promises167.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
932984
933575
|
}
|
|
932985
933576
|
const absolutePathToNestedWorkspace = join8(absolutePathToApisDirectory, RelativeFilePath2.of(workspace));
|
|
932986
933577
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
932987
|
-
await (0,
|
|
933578
|
+
await (0, import_promises167.rm)(absolutePathToWorkspace, { recursive: true });
|
|
932988
933579
|
}
|
|
932989
933580
|
}
|
|
932990
933581
|
async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
@@ -932997,7 +933588,7 @@ async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
|
932997
933588
|
generatorsConfiguration,
|
|
932998
933589
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
932999
933590
|
});
|
|
933000
|
-
await (0,
|
|
933591
|
+
await (0, import_promises167.writeFile)(absolutePathToGeneratorsConfiguration, jsYaml.dump(convertedResponse.value));
|
|
933001
933592
|
return convertedResponse.docsURLs;
|
|
933002
933593
|
}
|
|
933003
933594
|
async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName }) {
|
|
@@ -933011,20 +933602,20 @@ async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiNa
|
|
|
933011
933602
|
apiName
|
|
933012
933603
|
});
|
|
933013
933604
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
933014
|
-
await (0,
|
|
933605
|
+
await (0, import_promises167.writeFile)(absolutePathToDocsConfig, jsYaml.dump(convertedDocsConfig));
|
|
933015
933606
|
}
|
|
933016
933607
|
|
|
933017
933608
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndSingleAPI.js
|
|
933018
933609
|
init_lib6();
|
|
933019
|
-
var
|
|
933610
|
+
var import_promises168 = require("fs/promises");
|
|
933020
933611
|
async function migrateDocsAndSingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
933021
933612
|
const docsURLs = await migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace });
|
|
933022
933613
|
await migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs });
|
|
933023
933614
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
933024
933615
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
933025
933616
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
933026
|
-
await (0,
|
|
933027
|
-
await (0,
|
|
933617
|
+
await (0, import_promises168.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
933618
|
+
await (0, import_promises168.rm)(absolutePathToWorkspace, { recursive: true });
|
|
933028
933619
|
}
|
|
933029
933620
|
async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
933030
933621
|
const docsConfiguration = await loadRawDocsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -933037,7 +933628,7 @@ async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
|
933037
933628
|
apiName: void 0
|
|
933038
933629
|
});
|
|
933039
933630
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
933040
|
-
await (0,
|
|
933631
|
+
await (0, import_promises168.writeFile)(absolutePathToDocsConfig, jsYaml.dump(convertedDocsConfig));
|
|
933041
933632
|
}
|
|
933042
933633
|
async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
933043
933634
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -933049,23 +933640,23 @@ async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
|
933049
933640
|
generatorsConfiguration,
|
|
933050
933641
|
pathModificationStrategy: "MoveUp"
|
|
933051
933642
|
});
|
|
933052
|
-
await (0,
|
|
933643
|
+
await (0, import_promises168.writeFile)(absolutePathToGeneratorsConfiguration, jsYaml.dump(convertedResponse.value));
|
|
933053
933644
|
return convertedResponse.docsURLs;
|
|
933054
933645
|
}
|
|
933055
933646
|
|
|
933056
933647
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlyMultipleAPIs.js
|
|
933057
933648
|
init_lib6();
|
|
933058
|
-
var
|
|
933649
|
+
var import_promises169 = require("fs/promises");
|
|
933059
933650
|
var APIS_DIRECTORY3 = "apis";
|
|
933060
933651
|
async function migrateOnlyMultipleAPIs({ absolutePathToFernDirectory, workspaces }) {
|
|
933061
933652
|
const absolutePathToApisDirectory = join8(absolutePathToFernDirectory, RelativeFilePath2.of(APIS_DIRECTORY3));
|
|
933062
|
-
await (0,
|
|
933653
|
+
await (0, import_promises169.mkdir)(absolutePathToApisDirectory);
|
|
933063
933654
|
for (const workspace of workspaces) {
|
|
933064
933655
|
const absolutePathToWorkspace = join8(absolutePathToFernDirectory, RelativeFilePath2.of(workspace));
|
|
933065
933656
|
await migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace });
|
|
933066
933657
|
const absolutePathToNestedWorkspace = join8(absolutePathToApisDirectory, RelativeFilePath2.of(workspace));
|
|
933067
933658
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
933068
|
-
await (0,
|
|
933659
|
+
await (0, import_promises169.rm)(absolutePathToWorkspace, { recursive: true });
|
|
933069
933660
|
}
|
|
933070
933661
|
}
|
|
933071
933662
|
async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
@@ -933078,16 +933669,16 @@ async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
|
933078
933669
|
generatorsConfiguration,
|
|
933079
933670
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
933080
933671
|
});
|
|
933081
|
-
await (0,
|
|
933672
|
+
await (0, import_promises169.writeFile)(absolutePathToGeneratorsConfiguration, jsYaml.dump(convertedResponse.value));
|
|
933082
933673
|
}
|
|
933083
933674
|
|
|
933084
933675
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlySingleAPI.js
|
|
933085
933676
|
init_lib6();
|
|
933086
|
-
var
|
|
933677
|
+
var import_promises170 = require("fs/promises");
|
|
933087
933678
|
async function migrateOnlySingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
933088
933679
|
await migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace });
|
|
933089
933680
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
933090
|
-
await (0,
|
|
933681
|
+
await (0, import_promises170.rm)(absolutePathToWorkspace, { recursive: true });
|
|
933091
933682
|
}
|
|
933092
933683
|
async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
933093
933684
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -933099,7 +933690,7 @@ async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
|
933099
933690
|
generatorsConfiguration,
|
|
933100
933691
|
pathModificationStrategy: "MoveUp"
|
|
933101
933692
|
});
|
|
933102
|
-
await (0,
|
|
933693
|
+
await (0, import_promises170.writeFile)(absolutePathToGeneratorsConfiguration, jsYaml.dump(convertedResponse.value));
|
|
933103
933694
|
}
|
|
933104
933695
|
|
|
933105
933696
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migration.js
|
|
@@ -933177,7 +933768,7 @@ var __default15 = versionMigrations15;
|
|
|
933177
933768
|
|
|
933178
933769
|
// ../cli-migrations/lib/migrations/0.41.0-rc0/require-generators-yml/migration.js
|
|
933179
933770
|
init_lib6();
|
|
933180
|
-
var
|
|
933771
|
+
var import_promises171 = require("fs/promises");
|
|
933181
933772
|
var import_yaml16 = __toESM(require_dist9(), 1);
|
|
933182
933773
|
var migration16 = {
|
|
933183
933774
|
name: "require-generators-yml",
|
|
@@ -933220,7 +933811,7 @@ async function addApiConfigurationToSingleWorkspace({ absolutePathToFernDirector
|
|
|
933220
933811
|
if (existingGeneratorsYml == null) {
|
|
933221
933812
|
if (openapiDirectory != null && openapiDirectory.contents[0] != null) {
|
|
933222
933813
|
const absolutePathToGeneratorsYml = join8(absoluteFilepathToWorkspace, RelativeFilePath2.of("generators.yml"));
|
|
933223
|
-
await (0,
|
|
933814
|
+
await (0, import_promises171.writeFile)(absolutePathToGeneratorsYml, jsYaml.dump({
|
|
933224
933815
|
api: {
|
|
933225
933816
|
path: join8(relativize(absolutePathToFernDirectory, absoluteFilepathToWorkspace), RelativeFilePath2.of(openapiDirectory.name), RelativeFilePath2.of(openapiDirectory.contents[0]?.name))
|
|
933226
933817
|
}
|
|
@@ -933235,7 +933826,7 @@ async function addApiConfigurationToSingleWorkspace({ absolutePathToFernDirector
|
|
|
933235
933826
|
parsedDocument.set("api", {
|
|
933236
933827
|
path: join8(relativize(absolutePathToFernDirectory, absoluteFilepathToWorkspace), RelativeFilePath2.of(openapiDirectory.name), RelativeFilePath2.of(openapiDirectory.contents[0]?.name))
|
|
933237
933828
|
});
|
|
933238
|
-
await (0,
|
|
933829
|
+
await (0, import_promises171.writeFile)(existingGeneratorsYml.absolutePath, parsedDocument.toString());
|
|
933239
933830
|
context3.logger.info(source_default.green(`Updated ${existingGeneratorsYml.absolutePath}`));
|
|
933240
933831
|
}
|
|
933241
933832
|
}
|
|
@@ -933263,7 +933854,7 @@ var __default16 = versionMigrations16;
|
|
|
933263
933854
|
|
|
933264
933855
|
// ../cli-migrations/lib/migrations/0.54.0-rc0/use-generators-yml-specs/migration.js
|
|
933265
933856
|
init_lib6();
|
|
933266
|
-
var
|
|
933857
|
+
var import_promises172 = require("fs/promises");
|
|
933267
933858
|
var import_yaml17 = __toESM(require_dist9(), 1);
|
|
933268
933859
|
var migration17 = {
|
|
933269
933860
|
name: "generators-yml-use-api-specs",
|
|
@@ -933443,7 +934034,7 @@ async function addApiConfigurationToSingleWorkspace2({ absoluteFilepathToWorkspa
|
|
|
933443
934034
|
if (schemaComment && documentToWrite.indexOf(schemaComment) === -1) {
|
|
933444
934035
|
documentToWrite = `${schemaComment}${documentToWrite}`;
|
|
933445
934036
|
}
|
|
933446
|
-
await (0,
|
|
934037
|
+
await (0, import_promises172.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
933447
934038
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
933448
934039
|
}
|
|
933449
934040
|
async function parseApiSpec({ oldSpec, absoluteFilepathToWorkspace, files, directories, context: context3, namespace }) {
|
|
@@ -933490,7 +934081,7 @@ async function parseApiSpec({ oldSpec, absoluteFilepathToWorkspace, files, direc
|
|
|
933490
934081
|
}
|
|
933491
934082
|
let specContent;
|
|
933492
934083
|
try {
|
|
933493
|
-
const fileContents = await (0,
|
|
934084
|
+
const fileContents = await (0, import_promises172.readFile)(absoluteSpecPath, { encoding: "utf-8" });
|
|
933494
934085
|
specContent = jsYaml.load(fileContents);
|
|
933495
934086
|
} catch (e5) {
|
|
933496
934087
|
context3.logger.warn(`Failed to read API spec file ${spec.path}. Error: ${e5}. Skipping...`);
|
|
@@ -933594,7 +934185,7 @@ var __default17 = versionMigrations17;
|
|
|
933594
934185
|
|
|
933595
934186
|
// ../cli-migrations/lib/migrations/0.82.1/add-path-parameter-order-setting/migration.js
|
|
933596
934187
|
init_lib6();
|
|
933597
|
-
var
|
|
934188
|
+
var import_promises173 = require("fs/promises");
|
|
933598
934189
|
var migration18 = {
|
|
933599
934190
|
name: "add-path-parameter-order-setting",
|
|
933600
934191
|
summary: `Adds the 'path-parameter-order' setting to existing API configurations to maintain backwards compatibility.
|
|
@@ -933682,7 +934273,7 @@ async function updateGeneratorsYml({ context: context3, files }) {
|
|
|
933682
934273
|
documentToWrite = `${schemaComment}
|
|
933683
934274
|
${documentToWrite}`;
|
|
933684
934275
|
}
|
|
933685
|
-
await (0,
|
|
934276
|
+
await (0, import_promises173.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
933686
934277
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
933687
934278
|
}
|
|
933688
934279
|
async function getFilesAndDirectories3(absoluteFilepath) {
|
|
@@ -933719,7 +934310,7 @@ var __default18 = versionMigrations18;
|
|
|
933719
934310
|
|
|
933720
934311
|
// ../cli-migrations/lib/migrations/1.0.0/update-settings-defaults/migration.js
|
|
933721
934312
|
init_lib6();
|
|
933722
|
-
var
|
|
934313
|
+
var import_promises174 = require("fs/promises");
|
|
933723
934314
|
var migration19 = {
|
|
933724
934315
|
name: "update-1_0_0-defaults",
|
|
933725
934316
|
summary: `The defaults of the API spec settings have changed.
|
|
@@ -933894,7 +934485,7 @@ async function updateGeneratorsYml2({ context: context3, files }) {
|
|
|
933894
934485
|
documentToWrite = `${schemaComment}
|
|
933895
934486
|
${documentToWrite}`;
|
|
933896
934487
|
}
|
|
933897
|
-
await (0,
|
|
934488
|
+
await (0, import_promises174.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
933898
934489
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
933899
934490
|
}
|
|
933900
934491
|
async function getFilesAndDirectories4(absoluteFilepath) {
|
|
@@ -933964,7 +934555,7 @@ var __default19 = versionMigrations19;
|
|
|
933964
934555
|
|
|
933965
934556
|
// ../cli-migrations/lib/migrations/2.0.0-rc0/update-settings-defaults/migration.js
|
|
933966
934557
|
init_lib6();
|
|
933967
|
-
var
|
|
934558
|
+
var import_promises175 = require("fs/promises");
|
|
933968
934559
|
var migration20 = {
|
|
933969
934560
|
name: "update-2_0_0-defaults",
|
|
933970
934561
|
summary: `The default of 'coerce-enums-to-literals' has changed from true to false.
|
|
@@ -934139,7 +934730,7 @@ async function updateGeneratorsYml3({ context: context3, files }) {
|
|
|
934139
934730
|
documentToWrite = `${schemaComment}
|
|
934140
934731
|
${documentToWrite}`;
|
|
934141
934732
|
}
|
|
934142
|
-
await (0,
|
|
934733
|
+
await (0, import_promises175.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
934143
934734
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
934144
934735
|
}
|
|
934145
934736
|
async function getFilesAndDirectories5(absoluteFilepath) {
|
|
@@ -934186,7 +934777,7 @@ var __default20 = versionMigrations20;
|
|
|
934186
934777
|
|
|
934187
934778
|
// ../cli-migrations/lib/migrations/2.13.0/migrate-deprecated-generator-api-settings/migration.js
|
|
934188
934779
|
init_lib6();
|
|
934189
|
-
var
|
|
934780
|
+
var import_promises176 = require("fs/promises");
|
|
934190
934781
|
var migration21 = {
|
|
934191
934782
|
name: "migrate-deprecated-generator-api-settings",
|
|
934192
934783
|
summary: `Migrates deprecated generator-level API settings keys to their new equivalents:
|
|
@@ -934277,7 +934868,7 @@ async function updateGeneratorsYml4({ context: context3, files }) {
|
|
|
934277
934868
|
documentToWrite = `${schemaComment}
|
|
934278
934869
|
${documentToWrite}`;
|
|
934279
934870
|
}
|
|
934280
|
-
await (0,
|
|
934871
|
+
await (0, import_promises176.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
934281
934872
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
934282
934873
|
}
|
|
934283
934874
|
function migrateDeprecatedSettings(settings, context3) {
|
|
@@ -934324,7 +934915,7 @@ var __default21 = versionMigrations21;
|
|
|
934324
934915
|
|
|
934325
934916
|
// ../cli-migrations/lib/migrations/3.0.0/enable-smart-casing/migration.js
|
|
934326
934917
|
init_lib6();
|
|
934327
|
-
var
|
|
934918
|
+
var import_promises177 = require("fs/promises");
|
|
934328
934919
|
var migration22 = {
|
|
934329
934920
|
name: "enable-smart-casing",
|
|
934330
934921
|
summary: `Sets 'smart-casing: false' for existing generators to preserve backwards compatibility.
|
|
@@ -934408,7 +934999,7 @@ async function updateGeneratorsYml5({ context: context3, files }) {
|
|
|
934408
934999
|
documentToWrite = `${schemaComment}
|
|
934409
935000
|
${documentToWrite}`;
|
|
934410
935001
|
}
|
|
934411
|
-
await (0,
|
|
935002
|
+
await (0, import_promises177.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
934412
935003
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
934413
935004
|
}
|
|
934414
935005
|
function setSmartCasingFalseIfNotConfigured(generator, context3) {
|
|
@@ -934549,7 +935140,7 @@ ${source_default.dim(migration23.summary)}`
|
|
|
934549
935140
|
}
|
|
934550
935141
|
|
|
934551
935142
|
// src/commands/upgrade/upgrade.ts
|
|
934552
|
-
var
|
|
935143
|
+
var import_promises178 = require("fs/promises");
|
|
934553
935144
|
|
|
934554
935145
|
// src/cwd.ts
|
|
934555
935146
|
var FERN_CWD_ENV_VAR = "FERN_CWD";
|
|
@@ -934876,7 +935467,7 @@ async function upgrade({
|
|
|
934876
935467
|
const newProjectConfig = produce(projectConfig2.rawConfig, (draft) => {
|
|
934877
935468
|
draft.version = resolvedTargetVersion;
|
|
934878
935469
|
});
|
|
934879
|
-
await (0,
|
|
935470
|
+
await (0, import_promises178.writeFile)(
|
|
934880
935471
|
projectConfig2._absolutePath,
|
|
934881
935472
|
ensureFinalNewline2(JSON.stringify(newProjectConfig, void 0, 2))
|
|
934882
935473
|
);
|
|
@@ -934978,7 +935569,7 @@ async function validateDocsBrokenLinks({
|
|
|
934978
935569
|
}
|
|
934979
935570
|
|
|
934980
935571
|
// src/commands/validate/validateMdx.ts
|
|
934981
|
-
var
|
|
935572
|
+
var import_fs38 = require("fs");
|
|
934982
935573
|
var import_gray_matter10 = __toESM(require_gray_matter(), 1);
|
|
934983
935574
|
var import_path95 = __toESM(require("path"), 1);
|
|
934984
935575
|
function calculateVisualColumn(text9, charIndex, tabWidth = 4) {
|
|
@@ -935054,7 +935645,7 @@ async function validateMdxFiles({
|
|
|
935054
935645
|
});
|
|
935055
935646
|
const filesToCheck = Array.from(new Set(allPages));
|
|
935056
935647
|
for (const filepath of filesToCheck) {
|
|
935057
|
-
const content5 = (0,
|
|
935648
|
+
const content5 = (0, import_fs38.readFileSync)(filepath, "utf-8");
|
|
935058
935649
|
try {
|
|
935059
935650
|
parseMarkdownToTree(content5);
|
|
935060
935651
|
} catch (error50) {
|
|
@@ -935501,7 +936092,7 @@ async function validateWorkspaces({
|
|
|
935501
936092
|
|
|
935502
936093
|
// src/commands/write-definition/writeDefinitionForWorkspaces.ts
|
|
935503
936094
|
init_lib6();
|
|
935504
|
-
var
|
|
936095
|
+
var import_promises179 = require("fs/promises");
|
|
935505
936096
|
var import_path96 = __toESM(require("path"), 1);
|
|
935506
936097
|
async function writeDefinitionForWorkspaces({
|
|
935507
936098
|
project,
|
|
@@ -935582,28 +936173,28 @@ async function writeFernDefinition({
|
|
|
935582
936173
|
return a4.localeCompare(b7);
|
|
935583
936174
|
};
|
|
935584
936175
|
if (await doesPathExist(absolutePathToOutputDirectory)) {
|
|
935585
|
-
await (0,
|
|
936176
|
+
await (0, import_promises179.rm)(absolutePathToOutputDirectory, { recursive: true });
|
|
935586
936177
|
}
|
|
935587
|
-
await (0,
|
|
935588
|
-
await (0,
|
|
936178
|
+
await (0, import_promises179.mkdir)(absolutePathToOutputDirectory, { recursive: true });
|
|
936179
|
+
await (0, import_promises179.writeFile)(
|
|
935589
936180
|
join8(absolutePathToOutputDirectory, RelativeFilePath2.of(ROOT_API_FILENAME)),
|
|
935590
936181
|
jsYaml.dump(definition3.rootApiFile.contents, { sortKeys })
|
|
935591
936182
|
);
|
|
935592
936183
|
for (const [relativePath, packageMarker] of Object.entries(definition3.packageMarkers)) {
|
|
935593
936184
|
const absoluteFilepath = join8(absolutePathToOutputDirectory, RelativeFilePath2.of(relativePath));
|
|
935594
|
-
await (0,
|
|
935595
|
-
await (0,
|
|
936185
|
+
await (0, import_promises179.mkdir)(dirname6(absoluteFilepath), { recursive: true });
|
|
936186
|
+
await (0, import_promises179.writeFile)(absoluteFilepath, jsYaml.dump(packageMarker.contents, { sortKeys }));
|
|
935596
936187
|
}
|
|
935597
936188
|
for (const [relativePath, definitionFile] of Object.entries(definition3.namedDefinitionFiles)) {
|
|
935598
936189
|
const absoluteFilepath = join8(absolutePathToOutputDirectory, RelativeFilePath2.of(relativePath));
|
|
935599
|
-
await (0,
|
|
935600
|
-
await (0,
|
|
936190
|
+
await (0, import_promises179.mkdir)(dirname6(absoluteFilepath), { recursive: true });
|
|
936191
|
+
await (0, import_promises179.writeFile)(absoluteFilepath, jsYaml.dump(definitionFile.contents, { sortKeys }));
|
|
935601
936192
|
}
|
|
935602
936193
|
}
|
|
935603
936194
|
|
|
935604
936195
|
// src/commands/write-docs-definition/writeDocsDefinitionForProject.ts
|
|
935605
936196
|
init_lib6();
|
|
935606
|
-
var
|
|
936197
|
+
var import_promises180 = require("fs/promises");
|
|
935607
936198
|
async function writeDocsDefinitionForProject({
|
|
935608
936199
|
project,
|
|
935609
936200
|
outputPath,
|
|
@@ -935635,7 +936226,7 @@ async function writeDocsDefinitionForProject({
|
|
|
935635
936226
|
targetAudiences: docsWorkspace.config.instances[0]?.audiences ? Array.isArray(docsWorkspace.config.instances[0].audiences) ? docsWorkspace.config.instances[0].audiences : [docsWorkspace.config.instances[0].audiences] : void 0
|
|
935636
936227
|
});
|
|
935637
936228
|
const docsDefinition = await docsResolver.resolve();
|
|
935638
|
-
await (0,
|
|
936229
|
+
await (0, import_promises180.writeFile)(AbsoluteFilePath2.of(outputPath), JSON.stringify(docsDefinition, null, 2));
|
|
935639
936230
|
context3.logger.info(source_default.green(`Docs definition written to ${outputPath}`));
|
|
935640
936231
|
});
|
|
935641
936232
|
}
|
|
@@ -935643,8 +936234,8 @@ async function writeDocsDefinitionForProject({
|
|
|
935643
936234
|
// src/commands/write-translation/writeTranslationForProject.ts
|
|
935644
936235
|
init_lib6();
|
|
935645
936236
|
var import_cli_progress2 = __toESM(require_cli_progress(), 1);
|
|
935646
|
-
var
|
|
935647
|
-
var
|
|
936237
|
+
var import_fs41 = require("fs");
|
|
936238
|
+
var import_promises184 = require("fs/promises");
|
|
935648
936239
|
var import_is_ci3 = __toESM(require_is_ci(), 1);
|
|
935649
936240
|
var import_path99 = __toESM(require("path"), 1);
|
|
935650
936241
|
|
|
@@ -936137,7 +936728,7 @@ function shouldProcessFile(filePath, stub) {
|
|
|
936137
936728
|
|
|
936138
936729
|
// src/commands/write-translation/docs-config-utils.ts
|
|
936139
936730
|
init_lib6();
|
|
936140
|
-
var
|
|
936731
|
+
var import_promises181 = require("fs/promises");
|
|
936141
936732
|
|
|
936142
936733
|
// src/commands/write-translation/url-utils.ts
|
|
936143
936734
|
function addLanguageSuffixToUrl(url3, language) {
|
|
@@ -936294,7 +936885,7 @@ async function createLanguageSpecificDocsConfig({
|
|
|
936294
936885
|
stub = false
|
|
936295
936886
|
}) {
|
|
936296
936887
|
try {
|
|
936297
|
-
const originalConfigContent = await (0,
|
|
936888
|
+
const originalConfigContent = await (0, import_promises181.readFile)(originalDocsConfigPath, "utf-8");
|
|
936298
936889
|
const transformation = {
|
|
936299
936890
|
filePath: DOCS_CONFIGURATION_FILENAME,
|
|
936300
936891
|
language,
|
|
@@ -936308,7 +936899,7 @@ async function createLanguageSpecificDocsConfig({
|
|
|
936308
936899
|
const modifiedConfigContent = jsYaml.dump(modifiedConfig, {
|
|
936309
936900
|
sortKeys: false
|
|
936310
936901
|
});
|
|
936311
|
-
await (0,
|
|
936902
|
+
await (0, import_promises181.writeFile)(modifiedConfigPath, modifiedConfigContent, "utf-8");
|
|
936312
936903
|
context3.logger.debug(`Created language-specific docs config: ${modifiedConfigPath}`);
|
|
936313
936904
|
} catch (error50) {
|
|
936314
936905
|
if (error50 instanceof Error && error50.message.includes("403")) {
|
|
@@ -936320,19 +936911,19 @@ async function createLanguageSpecificDocsConfig({
|
|
|
936320
936911
|
|
|
936321
936912
|
// src/commands/write-translation/file-collection-utils.ts
|
|
936322
936913
|
init_lib6();
|
|
936323
|
-
var
|
|
936324
|
-
var
|
|
936914
|
+
var import_fs39 = require("fs");
|
|
936915
|
+
var import_promises182 = require("fs/promises");
|
|
936325
936916
|
var import_path97 = __toESM(require("path"), 1);
|
|
936326
936917
|
async function collectFiles(baseDirectory, relativeBase) {
|
|
936327
936918
|
const discoveredFiles = {};
|
|
936328
|
-
const entries23 = await (0,
|
|
936919
|
+
const entries23 = await (0, import_promises182.readdir)(baseDirectory);
|
|
936329
936920
|
for (const entry of entries23) {
|
|
936330
936921
|
if (entry === "translations") {
|
|
936331
936922
|
continue;
|
|
936332
936923
|
}
|
|
936333
936924
|
const fullPath = import_path97.default.join(baseDirectory, entry);
|
|
936334
936925
|
const relativePath = relativeBase ? join8(relativeBase, RelativeFilePath2.of(entry)) : RelativeFilePath2.of(entry);
|
|
936335
|
-
const stat7 = (0,
|
|
936926
|
+
const stat7 = (0, import_fs39.statSync)(fullPath);
|
|
936336
936927
|
if (stat7.isDirectory()) {
|
|
936337
936928
|
const subdirectoryFiles = await collectFiles(fullPath, relativePath);
|
|
936338
936929
|
for (const [subPath, subRelativePath] of Object.entries(subdirectoryFiles)) {
|
|
@@ -936347,19 +936938,19 @@ async function collectFiles(baseDirectory, relativeBase) {
|
|
|
936347
936938
|
|
|
936348
936939
|
// src/commands/write-translation/hash-utils.ts
|
|
936349
936940
|
var import_crypto13 = require("crypto");
|
|
936350
|
-
var
|
|
936351
|
-
var
|
|
936941
|
+
var import_fs40 = require("fs");
|
|
936942
|
+
var import_promises183 = require("fs/promises");
|
|
936352
936943
|
var import_path98 = __toESM(require("path"), 1);
|
|
936353
936944
|
function calculateContentHash(content5) {
|
|
936354
936945
|
return (0, import_crypto13.createHash)("sha256").update(content5, "utf-8").digest("hex");
|
|
936355
936946
|
}
|
|
936356
936947
|
async function loadHashMappings(translationsDirectory) {
|
|
936357
936948
|
const hashesFilePath = import_path98.default.join(translationsDirectory, "hashes");
|
|
936358
|
-
if (!(0,
|
|
936949
|
+
if (!(0, import_fs40.existsSync)(hashesFilePath)) {
|
|
936359
936950
|
return {};
|
|
936360
936951
|
}
|
|
936361
936952
|
try {
|
|
936362
|
-
const hashesContent = await (0,
|
|
936953
|
+
const hashesContent = await (0, import_promises183.readFile)(hashesFilePath, "utf-8");
|
|
936363
936954
|
const parsed = JSON.parse(hashesContent);
|
|
936364
936955
|
const { _comment, ...hashMappings } = parsed;
|
|
936365
936956
|
return hashMappings;
|
|
@@ -936380,11 +936971,11 @@ async function saveHashMappings(translationsDirectory, hashMappings) {
|
|
|
936380
936971
|
_comment: "This file is auto-generated by Fern to track source file changes for translation purposes. Do not edit manually - it will be overwritten on the next translation update.",
|
|
936381
936972
|
...sortedMappings
|
|
936382
936973
|
};
|
|
936383
|
-
await (0,
|
|
936974
|
+
await (0, import_promises183.writeFile)(hashesFilePath, JSON.stringify(fileContent, null, 2), "utf-8");
|
|
936384
936975
|
}
|
|
936385
936976
|
async function hasFileChanged(filePath, relativePath, previousHashes) {
|
|
936386
936977
|
try {
|
|
936387
|
-
const content5 = await (0,
|
|
936978
|
+
const content5 = await (0, import_promises183.readFile)(filePath, "utf-8");
|
|
936388
936979
|
const currentHash = calculateContentHash(content5);
|
|
936389
936980
|
const previousHash = previousHashes[relativePath];
|
|
936390
936981
|
return currentHash !== previousHash;
|
|
@@ -936438,22 +937029,22 @@ async function writeTranslationForProject({
|
|
|
936438
937029
|
code: CliError.Code.InternalError
|
|
936439
937030
|
});
|
|
936440
937031
|
}
|
|
936441
|
-
if (!(0,
|
|
937032
|
+
if (!(0, import_fs41.existsSync)(translationsDirectory)) {
|
|
936442
937033
|
context3.logger.debug(`Creating translations directory at: ${translationsDirectory}`);
|
|
936443
|
-
await (0,
|
|
937034
|
+
await (0, import_promises184.mkdir)(translationsDirectory, { recursive: true });
|
|
936444
937035
|
}
|
|
936445
937036
|
const languageStats = {};
|
|
936446
937037
|
const targetLanguages = languages.filter((lang) => lang !== sourceLanguage);
|
|
936447
937038
|
const originalDocsConfigPath = join8(fernDirectory, RelativeFilePath2.of(DOCS_CONFIGURATION_FILENAME));
|
|
936448
|
-
const hasDocsConfig = (0,
|
|
937039
|
+
const hasDocsConfig = (0, import_fs41.existsSync)(originalDocsConfigPath);
|
|
936449
937040
|
for (const language of targetLanguages) {
|
|
936450
937041
|
const languageDirectory = join8(
|
|
936451
937042
|
translationsDirectory,
|
|
936452
937043
|
RelativeFilePath2.of(language),
|
|
936453
937044
|
RelativeFilePath2.of("fern")
|
|
936454
937045
|
);
|
|
936455
|
-
if (!(0,
|
|
936456
|
-
await (0,
|
|
937046
|
+
if (!(0, import_fs41.existsSync)(languageDirectory)) {
|
|
937047
|
+
await (0, import_promises184.mkdir)(languageDirectory, { recursive: true });
|
|
936457
937048
|
}
|
|
936458
937049
|
languageStats[language] = {
|
|
936459
937050
|
filesProcessed: 0,
|
|
@@ -936555,7 +937146,7 @@ async function writeTranslationForProject({
|
|
|
936555
937146
|
`[COMPLETED] ${DOCS_CONFIGURATION_FILENAME} -> ${language}/${DOCS_CONFIGURATION_FILENAME}`
|
|
936556
937147
|
);
|
|
936557
937148
|
}
|
|
936558
|
-
const originalConfigContent = await (0,
|
|
937149
|
+
const originalConfigContent = await (0, import_promises184.readFile)(originalDocsConfigPath, "utf-8");
|
|
936559
937150
|
await updateAndSaveHashForFile(
|
|
936560
937151
|
translationsDirectory,
|
|
936561
937152
|
hashMappings,
|
|
@@ -936600,7 +937191,7 @@ async function writeTranslationForProject({
|
|
|
936600
937191
|
continue;
|
|
936601
937192
|
}
|
|
936602
937193
|
cliContext.logger.debug(`[PROCESSING] ${relativePath} (detected changes)`);
|
|
936603
|
-
const originalContent = await (0,
|
|
937194
|
+
const originalContent = await (0, import_promises184.readFile)(filePath, "utf-8");
|
|
936604
937195
|
await updateAndSaveHashForFile(translationsDirectory, hashMappings, relativePath, originalContent);
|
|
936605
937196
|
const sourceStats = languageStats[sourceLanguage];
|
|
936606
937197
|
if (sourceStats) {
|
|
@@ -936624,8 +937215,8 @@ async function writeTranslationForProject({
|
|
|
936624
937215
|
);
|
|
936625
937216
|
const destPath = join8(languageDirectory, relativePath);
|
|
936626
937217
|
const destDir = import_path99.default.dirname(destPath);
|
|
936627
|
-
if (!(0,
|
|
936628
|
-
await (0,
|
|
937218
|
+
if (!(0, import_fs41.existsSync)(destDir)) {
|
|
937219
|
+
await (0, import_promises184.mkdir)(destDir, { recursive: true });
|
|
936629
937220
|
}
|
|
936630
937221
|
const transformation = {
|
|
936631
937222
|
filePath: relativePath,
|
|
@@ -936638,7 +937229,7 @@ async function writeTranslationForProject({
|
|
|
936638
937229
|
cliContext,
|
|
936639
937230
|
stub
|
|
936640
937231
|
});
|
|
936641
|
-
await (0,
|
|
937232
|
+
await (0, import_promises184.writeFile)(destPath, transformedContent, "utf-8");
|
|
936642
937233
|
const languageStatsForLang = languageStats[language];
|
|
936643
937234
|
if (languageStatsForLang) {
|
|
936644
937235
|
languageStatsForLang.filesProcessed++;
|
|
@@ -936668,10 +937259,10 @@ async function writeTranslationForProject({
|
|
|
936668
937259
|
);
|
|
936669
937260
|
const destPath = join8(languageDirectory, relativePath);
|
|
936670
937261
|
const destDir = import_path99.default.dirname(destPath);
|
|
936671
|
-
if (!(0,
|
|
936672
|
-
await (0,
|
|
937262
|
+
if (!(0, import_fs41.existsSync)(destDir)) {
|
|
937263
|
+
await (0, import_promises184.mkdir)(destDir, { recursive: true });
|
|
936673
937264
|
}
|
|
936674
|
-
await (0,
|
|
937265
|
+
await (0, import_promises184.copyFile)(filePath, destPath);
|
|
936675
937266
|
assetsCopied++;
|
|
936676
937267
|
cliContext.logger.debug(`[ASSET COPIED] ${relativePath} -> ${language}/${relativePath}`);
|
|
936677
937268
|
}
|
|
@@ -938812,13 +939403,13 @@ function addAutomationsGenerateCommand(cli, cliContext) {
|
|
|
938812
939403
|
// hidden
|
|
938813
939404
|
(yargs) => yargs.option("api", {
|
|
938814
939405
|
type: "string",
|
|
938815
|
-
description: "
|
|
939406
|
+
description: "Filter to a specific API in a multi-API repo (e.g. 'foo' for fern/apis/foo/). Omit to fan out across every API in the project."
|
|
938816
939407
|
}).option("group", {
|
|
938817
939408
|
type: "string",
|
|
938818
|
-
description: "
|
|
939409
|
+
description: "Filter to a specific generator group (e.g. 'sdk'). Omit to fan out across every group. The default-group field in generators.yml is intentionally ignored."
|
|
938819
939410
|
}).option("generator", {
|
|
938820
939411
|
type: "string",
|
|
938821
|
-
description: "Target a specific generator by 0-based index (e.g. '0', '1') or by name.
|
|
939412
|
+
description: "Target a specific generator by 0-based index (e.g. '0', '1') or by name. When targeting an opted-out generator by index, the command rejects with an error rather than silently skipping. Omit to fan out across every eligible generator in the selected APIs and groups."
|
|
938822
939413
|
}).option("version", {
|
|
938823
939414
|
type: "string",
|
|
938824
939415
|
description: "Version for generated packages. Use 'AUTO' for AI-based semantic versioning that analyzes the diff and determines MAJOR/MINOR/PATCH automatically."
|
|
@@ -938826,39 +939417,21 @@ function addAutomationsGenerateCommand(cli, cliContext) {
|
|
|
938826
939417
|
boolean: true,
|
|
938827
939418
|
default: false,
|
|
938828
939419
|
description: "Enable GitHub automerge on generated PRs. Automerge is skipped when breaking changes (MAJOR bump) are detected, regardless of this flag."
|
|
939420
|
+
}).option("json-file-output", {
|
|
939421
|
+
type: "string",
|
|
939422
|
+
description: "Write a JSON summary of per-generator results to the given path. CI-neutral companion to the markdown summary auto-written to $GITHUB_STEP_SUMMARY."
|
|
938829
939423
|
}),
|
|
938830
939424
|
async (argv) => {
|
|
938831
|
-
|
|
938832
|
-
|
|
938833
|
-
|
|
938834
|
-
|
|
938835
|
-
|
|
938836
|
-
|
|
938837
|
-
}),
|
|
938838
|
-
cliContext,
|
|
939425
|
+
await executeAutomationsGenerate({
|
|
939426
|
+
cliContext,
|
|
939427
|
+
options: {
|
|
939428
|
+
api: argv.api,
|
|
939429
|
+
group: argv.group,
|
|
939430
|
+
generator: argv.generator,
|
|
938839
939431
|
version: argv.version,
|
|
938840
|
-
|
|
938841
|
-
|
|
938842
|
-
|
|
938843
|
-
shouldLogS3Url: false,
|
|
938844
|
-
keepDocker: false,
|
|
938845
|
-
useLocalDocker: false,
|
|
938846
|
-
preview: false,
|
|
938847
|
-
mode: void 0,
|
|
938848
|
-
force: true,
|
|
938849
|
-
runner: void 0,
|
|
938850
|
-
inspect: false,
|
|
938851
|
-
lfsOverride: void 0,
|
|
938852
|
-
fernignorePath: void 0,
|
|
938853
|
-
skipFernignore: false,
|
|
938854
|
-
dynamicIrOnly: false,
|
|
938855
|
-
outputDir: void 0,
|
|
938856
|
-
noReplay: false,
|
|
938857
|
-
retryRateLimited: false,
|
|
938858
|
-
requireEnvVars: false,
|
|
938859
|
-
automationMode: true,
|
|
938860
|
-
autoMerge: argv["auto-merge"]
|
|
938861
|
-
});
|
|
939432
|
+
autoMerge: argv["auto-merge"],
|
|
939433
|
+
jsonOutputPath: argv["json-file-output"]
|
|
939434
|
+
}
|
|
938862
939435
|
});
|
|
938863
939436
|
}
|
|
938864
939437
|
);
|