@fern-api/fern-api-dev 5.83.1 → 5.84.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 +559 -233
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -68321,6 +68321,15 @@ var init_PublishTarget = __esm({
|
|
|
68321
68321
|
}
|
|
68322
68322
|
};
|
|
68323
68323
|
},
|
|
68324
|
+
rubygems: (value2) => {
|
|
68325
|
+
return {
|
|
68326
|
+
...value2,
|
|
68327
|
+
type: "rubygems",
|
|
68328
|
+
_visit: function(visitor) {
|
|
68329
|
+
return PublishTarget._visit(this, visitor);
|
|
68330
|
+
}
|
|
68331
|
+
};
|
|
68332
|
+
},
|
|
68324
68333
|
_visit: (value2, visitor) => {
|
|
68325
68334
|
switch (value2.type) {
|
|
68326
68335
|
case "postman":
|
|
@@ -68337,6 +68346,8 @@ var init_PublishTarget = __esm({
|
|
|
68337
68346
|
return visitor.go(value2);
|
|
68338
68347
|
case "nuget":
|
|
68339
68348
|
return visitor.nuget(value2);
|
|
68349
|
+
case "rubygems":
|
|
68350
|
+
return visitor.rubygems(value2);
|
|
68340
68351
|
default:
|
|
68341
68352
|
return visitor._other(value2);
|
|
68342
68353
|
}
|
|
@@ -68352,6 +68363,13 @@ var init_PypiPublishTarget = __esm({
|
|
|
68352
68363
|
}
|
|
68353
68364
|
});
|
|
68354
68365
|
|
|
68366
|
+
// ../../ir-sdk/lib/sdk/api/resources/publish/types/RubyGemsPublishTarget.js
|
|
68367
|
+
var init_RubyGemsPublishTarget = __esm({
|
|
68368
|
+
"../../ir-sdk/lib/sdk/api/resources/publish/types/RubyGemsPublishTarget.js"() {
|
|
68369
|
+
"use strict";
|
|
68370
|
+
}
|
|
68371
|
+
});
|
|
68372
|
+
|
|
68355
68373
|
// ../../ir-sdk/lib/sdk/api/resources/publish/types/index.js
|
|
68356
68374
|
var init_types65 = __esm({
|
|
68357
68375
|
"../../ir-sdk/lib/sdk/api/resources/publish/types/index.js"() {
|
|
@@ -68368,6 +68386,7 @@ var init_types65 = __esm({
|
|
|
68368
68386
|
init_PublishingConfig();
|
|
68369
68387
|
init_PublishTarget();
|
|
68370
68388
|
init_PypiPublishTarget();
|
|
68389
|
+
init_RubyGemsPublishTarget();
|
|
68371
68390
|
}
|
|
68372
68391
|
});
|
|
68373
68392
|
|
|
@@ -80141,6 +80160,19 @@ var init_PypiPublishTarget2 = __esm({
|
|
|
80141
80160
|
}
|
|
80142
80161
|
});
|
|
80143
80162
|
|
|
80163
|
+
// ../../ir-sdk/lib/sdk/serialization/resources/publish/types/RubyGemsPublishTarget.js
|
|
80164
|
+
var RubyGemsPublishTarget;
|
|
80165
|
+
var init_RubyGemsPublishTarget2 = __esm({
|
|
80166
|
+
"../../ir-sdk/lib/sdk/serialization/resources/publish/types/RubyGemsPublishTarget.js"() {
|
|
80167
|
+
"use strict";
|
|
80168
|
+
init_core2();
|
|
80169
|
+
RubyGemsPublishTarget = schemas_exports3.objectWithoutOptionalProperties({
|
|
80170
|
+
version: schemas_exports3.string().optional(),
|
|
80171
|
+
packageName: schemas_exports3.string().optional()
|
|
80172
|
+
});
|
|
80173
|
+
}
|
|
80174
|
+
});
|
|
80175
|
+
|
|
80144
80176
|
// ../../ir-sdk/lib/sdk/serialization/resources/publish/types/PublishTarget.js
|
|
80145
80177
|
var PublishTarget2;
|
|
80146
80178
|
var init_PublishTarget2 = __esm({
|
|
@@ -80155,6 +80187,7 @@ var init_PublishTarget2 = __esm({
|
|
|
80155
80187
|
init_NugetPublishTarget2();
|
|
80156
80188
|
init_PostmanPublishTarget2();
|
|
80157
80189
|
init_PypiPublishTarget2();
|
|
80190
|
+
init_RubyGemsPublishTarget2();
|
|
80158
80191
|
PublishTarget2 = schemas_exports3.union("type", {
|
|
80159
80192
|
postman: PostmanPublishTarget,
|
|
80160
80193
|
npm: NpmPublishTarget,
|
|
@@ -80162,7 +80195,8 @@ var init_PublishTarget2 = __esm({
|
|
|
80162
80195
|
pypi: PypiPublishTarget,
|
|
80163
80196
|
crates: CratesPublishTarget,
|
|
80164
80197
|
go: GoPublishTarget,
|
|
80165
|
-
nuget: NugetPublishTarget
|
|
80198
|
+
nuget: NugetPublishTarget,
|
|
80199
|
+
rubygems: RubyGemsPublishTarget
|
|
80166
80200
|
}).transform({
|
|
80167
80201
|
transform: (value2) => {
|
|
80168
80202
|
switch (value2.type) {
|
|
@@ -80180,6 +80214,8 @@ var init_PublishTarget2 = __esm({
|
|
|
80180
80214
|
return PublishTarget.go(value2);
|
|
80181
80215
|
case "nuget":
|
|
80182
80216
|
return PublishTarget.nuget(value2);
|
|
80217
|
+
case "rubygems":
|
|
80218
|
+
return PublishTarget.rubygems(value2);
|
|
80183
80219
|
default:
|
|
80184
80220
|
return value2;
|
|
80185
80221
|
}
|
|
@@ -82228,6 +82264,7 @@ var init_types94 = __esm({
|
|
|
82228
82264
|
init_PublishingConfig2();
|
|
82229
82265
|
init_PublishTarget2();
|
|
82230
82266
|
init_PypiPublishTarget2();
|
|
82267
|
+
init_RubyGemsPublishTarget2();
|
|
82231
82268
|
}
|
|
82232
82269
|
});
|
|
82233
82270
|
|
|
@@ -82245,7 +82282,8 @@ __export(publish_exports2, {
|
|
|
82245
82282
|
PostmanPublishTarget: () => PostmanPublishTarget,
|
|
82246
82283
|
PublishTarget: () => PublishTarget2,
|
|
82247
82284
|
PublishingConfig: () => PublishingConfig2,
|
|
82248
|
-
PypiPublishTarget: () => PypiPublishTarget
|
|
82285
|
+
PypiPublishTarget: () => PypiPublishTarget,
|
|
82286
|
+
RubyGemsPublishTarget: () => RubyGemsPublishTarget
|
|
82249
82287
|
});
|
|
82250
82288
|
var init_publish2 = __esm({
|
|
82251
82289
|
"../../ir-sdk/lib/sdk/serialization/resources/publish/index.js"() {
|
|
@@ -83561,6 +83599,7 @@ __export(serialization_exports2, {
|
|
|
83561
83599
|
ResponseProperty: () => ResponseProperty,
|
|
83562
83600
|
RetriesConfiguration: () => RetriesConfiguration2,
|
|
83563
83601
|
RetriesDisabledSchema: () => RetriesDisabledSchema2,
|
|
83602
|
+
RubyGemsPublishTarget: () => RubyGemsPublishTarget,
|
|
83564
83603
|
SafeAndUnsafeString: () => SafeAndUnsafeString,
|
|
83565
83604
|
SdkConfig: () => SdkConfig,
|
|
83566
83605
|
SdkRequest: () => SdkRequest,
|
|
@@ -100362,7 +100401,7 @@ var require_polyfills = __commonJS({
|
|
|
100362
100401
|
}
|
|
100363
100402
|
if (platform4 === "win32") {
|
|
100364
100403
|
fs34.rename = typeof fs34.rename !== "function" ? fs34.rename : (function(fs$rename) {
|
|
100365
|
-
function
|
|
100404
|
+
function rename8(from4, to2, cb) {
|
|
100366
100405
|
var start2 = Date.now();
|
|
100367
100406
|
var backoff = 0;
|
|
100368
100407
|
fs$rename(from4, to2, function CB(er3) {
|
|
@@ -100382,8 +100421,8 @@ var require_polyfills = __commonJS({
|
|
|
100382
100421
|
if (cb) cb(er3);
|
|
100383
100422
|
});
|
|
100384
100423
|
}
|
|
100385
|
-
if (Object.setPrototypeOf) Object.setPrototypeOf(
|
|
100386
|
-
return
|
|
100424
|
+
if (Object.setPrototypeOf) Object.setPrototypeOf(rename8, fs$rename);
|
|
100425
|
+
return rename8;
|
|
100387
100426
|
})(fs34.rename);
|
|
100388
100427
|
}
|
|
100389
100428
|
fs34.read = typeof fs34.read !== "function" ? fs34.read : (function(fs$read) {
|
|
@@ -100789,8 +100828,8 @@ var require_graceful_fs = __commonJS({
|
|
|
100789
100828
|
fs35.createReadStream = createReadStream5;
|
|
100790
100829
|
fs35.createWriteStream = createWriteStream8;
|
|
100791
100830
|
var fs$readFile = fs35.readFile;
|
|
100792
|
-
fs35.readFile =
|
|
100793
|
-
function
|
|
100831
|
+
fs35.readFile = readFile121;
|
|
100832
|
+
function readFile121(path120, options2, cb) {
|
|
100794
100833
|
if (typeof options2 === "function")
|
|
100795
100834
|
cb = options2, options2 = null;
|
|
100796
100835
|
return go$readFile(path120, options2, cb);
|
|
@@ -100842,8 +100881,8 @@ var require_graceful_fs = __commonJS({
|
|
|
100842
100881
|
}
|
|
100843
100882
|
var fs$copyFile = fs35.copyFile;
|
|
100844
100883
|
if (fs$copyFile)
|
|
100845
|
-
fs35.copyFile =
|
|
100846
|
-
function
|
|
100884
|
+
fs35.copyFile = copyFile7;
|
|
100885
|
+
function copyFile7(src, dest, flags2, cb) {
|
|
100847
100886
|
if (typeof flags2 === "function") {
|
|
100848
100887
|
cb = flags2;
|
|
100849
100888
|
flags2 = 0;
|
|
@@ -100861,9 +100900,9 @@ var require_graceful_fs = __commonJS({
|
|
|
100861
100900
|
}
|
|
100862
100901
|
}
|
|
100863
100902
|
var fs$readdir = fs35.readdir;
|
|
100864
|
-
fs35.readdir =
|
|
100903
|
+
fs35.readdir = readdir23;
|
|
100865
100904
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
100866
|
-
function
|
|
100905
|
+
function readdir23(path120, options2, cb) {
|
|
100867
100906
|
if (typeof options2 === "function")
|
|
100868
100907
|
cb = options2, options2 = null;
|
|
100869
100908
|
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path121, options3, cb2, startTime) {
|
|
@@ -103077,6 +103116,13 @@ function getFilesystemPublishTarget({ generatorInvocation, version: version7, us
|
|
|
103077
103116
|
context3.logger.debug("Java generator config provided but could not construct Maven coordinate. Expected either 'group' and 'artifact' or 'package-prefix' with packageName.");
|
|
103078
103117
|
}
|
|
103079
103118
|
return void 0;
|
|
103119
|
+
} else if (generatorInvocation.language === "ruby") {
|
|
103120
|
+
const publishTarget = PublishTarget.rubygems({
|
|
103121
|
+
version: version7,
|
|
103122
|
+
packageName
|
|
103123
|
+
});
|
|
103124
|
+
context3.logger.debug(`Created RubyGemsPublishTarget: version ${version7} package name: ${packageName}`);
|
|
103125
|
+
return publishTarget;
|
|
103080
103126
|
} else if (generatorInvocation.language === "csharp") {
|
|
103081
103127
|
if (userProvidedVersion != null) {
|
|
103082
103128
|
const csharpPackageName = packageName ?? (typeof generatorInvocation.raw?.config === "object" && generatorInvocation.raw?.config !== null ? generatorInvocation.raw.config["package-id"] : void 0);
|
|
@@ -482217,7 +482263,7 @@ var require_polyfills2 = __commonJS({
|
|
|
482217
482263
|
}
|
|
482218
482264
|
if (platform4 === "win32") {
|
|
482219
482265
|
fs34.rename = typeof fs34.rename !== "function" ? fs34.rename : (function(fs$rename) {
|
|
482220
|
-
function
|
|
482266
|
+
function rename8(from4, to2, cb) {
|
|
482221
482267
|
var start2 = Date.now();
|
|
482222
482268
|
var backoff = 0;
|
|
482223
482269
|
fs$rename(from4, to2, function CB(er3) {
|
|
@@ -482237,8 +482283,8 @@ var require_polyfills2 = __commonJS({
|
|
|
482237
482283
|
if (cb) cb(er3);
|
|
482238
482284
|
});
|
|
482239
482285
|
}
|
|
482240
|
-
if (Object.setPrototypeOf) Object.setPrototypeOf(
|
|
482241
|
-
return
|
|
482286
|
+
if (Object.setPrototypeOf) Object.setPrototypeOf(rename8, fs$rename);
|
|
482287
|
+
return rename8;
|
|
482242
482288
|
})(fs34.rename);
|
|
482243
482289
|
}
|
|
482244
482290
|
fs34.read = typeof fs34.read !== "function" ? fs34.read : (function(fs$read) {
|
|
@@ -482644,8 +482690,8 @@ var require_graceful_fs2 = __commonJS({
|
|
|
482644
482690
|
fs35.createReadStream = createReadStream5;
|
|
482645
482691
|
fs35.createWriteStream = createWriteStream8;
|
|
482646
482692
|
var fs$readFile = fs35.readFile;
|
|
482647
|
-
fs35.readFile =
|
|
482648
|
-
function
|
|
482693
|
+
fs35.readFile = readFile121;
|
|
482694
|
+
function readFile121(path120, options2, cb) {
|
|
482649
482695
|
if (typeof options2 === "function")
|
|
482650
482696
|
cb = options2, options2 = null;
|
|
482651
482697
|
return go$readFile(path120, options2, cb);
|
|
@@ -482697,8 +482743,8 @@ var require_graceful_fs2 = __commonJS({
|
|
|
482697
482743
|
}
|
|
482698
482744
|
var fs$copyFile = fs35.copyFile;
|
|
482699
482745
|
if (fs$copyFile)
|
|
482700
|
-
fs35.copyFile =
|
|
482701
|
-
function
|
|
482746
|
+
fs35.copyFile = copyFile7;
|
|
482747
|
+
function copyFile7(src, dest, flags2, cb) {
|
|
482702
482748
|
if (typeof flags2 === "function") {
|
|
482703
482749
|
cb = flags2;
|
|
482704
482750
|
flags2 = 0;
|
|
@@ -482716,9 +482762,9 @@ var require_graceful_fs2 = __commonJS({
|
|
|
482716
482762
|
}
|
|
482717
482763
|
}
|
|
482718
482764
|
var fs$readdir = fs35.readdir;
|
|
482719
|
-
fs35.readdir =
|
|
482765
|
+
fs35.readdir = readdir23;
|
|
482720
482766
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
482721
|
-
function
|
|
482767
|
+
function readdir23(path120, options2, cb) {
|
|
482722
482768
|
if (typeof options2 === "function")
|
|
482723
482769
|
cb = options2, options2 = null;
|
|
482724
482770
|
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path121, options3, cb2, startTime) {
|
|
@@ -491571,10 +491617,10 @@ var require_make_dir = __commonJS({
|
|
|
491571
491617
|
module4.exports = (input3, opts) => Promise.resolve().then(() => {
|
|
491572
491618
|
checkPath(input3);
|
|
491573
491619
|
opts = Object.assign({}, defaults3, opts);
|
|
491574
|
-
const
|
|
491620
|
+
const mkdir46 = pify(opts.fs.mkdir);
|
|
491575
491621
|
const stat7 = pify(opts.fs.stat);
|
|
491576
491622
|
const make = (pth) => {
|
|
491577
|
-
return
|
|
491623
|
+
return mkdir46(pth, opts.mode).then(() => pth).catch((err) => {
|
|
491578
491624
|
if (err.code === "ENOENT") {
|
|
491579
491625
|
if (err.message.includes("null bytes") || path120.dirname(pth) === pth) {
|
|
491580
491626
|
throw err;
|
|
@@ -576161,7 +576207,7 @@ var require_dist24 = __commonJS({
|
|
|
576161
576207
|
return copy;
|
|
576162
576208
|
}
|
|
576163
576209
|
};
|
|
576164
|
-
var
|
|
576210
|
+
var import_promises218 = require("fs/promises");
|
|
576165
576211
|
var import_node_path310 = require("path");
|
|
576166
576212
|
async function resolveInputs(args) {
|
|
576167
576213
|
const {
|
|
@@ -576214,7 +576260,7 @@ var require_dist24 = __commonJS({
|
|
|
576214
576260
|
}
|
|
576215
576261
|
}
|
|
576216
576262
|
const oursPath = (0, import_node_path310.join)(outputDir, resolvedPath);
|
|
576217
|
-
const ours = await (0,
|
|
576263
|
+
const ours = await (0, import_promises218.readFile)(oursPath, "utf-8").catch(() => null);
|
|
576218
576264
|
let ghostTheirs = null;
|
|
576219
576265
|
let baseTreeUnreachable = false;
|
|
576220
576266
|
if (!base4 && !renameSourcePath) {
|
|
@@ -576456,7 +576502,7 @@ var require_dist24 = __commonJS({
|
|
|
576456
576502
|
conflictReasonHint
|
|
576457
576503
|
};
|
|
576458
576504
|
}
|
|
576459
|
-
var
|
|
576505
|
+
var import_promises219 = require("fs/promises");
|
|
576460
576506
|
var import_node_path45 = require("path");
|
|
576461
576507
|
var AUTOVERSION_PLACEHOLDERS = [
|
|
576462
576508
|
"v0.0.0-fern-placeholder",
|
|
@@ -576507,14 +576553,14 @@ var require_dist24 = __commonJS({
|
|
|
576507
576553
|
}
|
|
576508
576554
|
if (plan.kind === "new-file-only-user") {
|
|
576509
576555
|
accumulator.recordMerge(resolvedPath, plan.theirs, patch5.base_generation);
|
|
576510
|
-
await (0,
|
|
576511
|
-
await (0,
|
|
576556
|
+
await (0, import_promises219.mkdir)((0, import_node_path45.dirname)(oursPath), { recursive: true });
|
|
576557
|
+
await (0, import_promises219.writeFile)(oursPath, plan.theirs);
|
|
576512
576558
|
return { file: resolvedPath, status: "merged", reason: "new-file" };
|
|
576513
576559
|
}
|
|
576514
576560
|
if (plan.kind === "new-file-both") {
|
|
576515
576561
|
const merged2 = threeWayMerge("", ours, plan.theirs);
|
|
576516
|
-
await (0,
|
|
576517
|
-
await (0,
|
|
576562
|
+
await (0, import_promises219.mkdir)((0, import_node_path45.dirname)(oursPath), { recursive: true });
|
|
576563
|
+
await (0, import_promises219.writeFile)(oursPath, merged2.content);
|
|
576518
576564
|
const unreachableFlag = plan.baseTreeUnreachable ? { baseTreeUnreachable: true } : {};
|
|
576519
576565
|
if (merged2.hasConflicts) {
|
|
576520
576566
|
return {
|
|
@@ -576532,8 +576578,8 @@ var require_dist24 = __commonJS({
|
|
|
576532
576578
|
const mergeBase = inputs.base != null ? alignAutoversionToOurs(inputs.base, ours, plan.mergeBase) : plan.mergeBase;
|
|
576533
576579
|
const theirs = inputs.base != null ? alignAutoversionToOurs(inputs.base, ours, plan.theirs) : plan.theirs;
|
|
576534
576580
|
const merged = threeWayMerge(mergeBase, ours, theirs);
|
|
576535
|
-
await (0,
|
|
576536
|
-
await (0,
|
|
576581
|
+
await (0, import_promises219.mkdir)((0, import_node_path45.dirname)(oursPath), { recursive: true });
|
|
576582
|
+
await (0, import_promises219.writeFile)(oursPath, merged.content);
|
|
576537
576583
|
if (merged.hasConflicts) {
|
|
576538
576584
|
accumulator.recordConflict(resolvedPath, theirs, patch5.base_generation);
|
|
576539
576585
|
return {
|
|
@@ -624869,16 +624915,16 @@ var require_copy = __commonJS({
|
|
|
624869
624915
|
throw new Error(`Unknown file: ${src}`);
|
|
624870
624916
|
}
|
|
624871
624917
|
async function onFile(srcStat, destStat, src, dest, opts) {
|
|
624872
|
-
if (!destStat) return
|
|
624918
|
+
if (!destStat) return copyFile7(srcStat, src, dest, opts);
|
|
624873
624919
|
if (opts.overwrite) {
|
|
624874
624920
|
await fs34.unlink(dest);
|
|
624875
|
-
return
|
|
624921
|
+
return copyFile7(srcStat, src, dest, opts);
|
|
624876
624922
|
}
|
|
624877
624923
|
if (opts.errorOnExist) {
|
|
624878
624924
|
throw new Error(`'${dest}' already exists`);
|
|
624879
624925
|
}
|
|
624880
624926
|
}
|
|
624881
|
-
async function
|
|
624927
|
+
async function copyFile7(srcStat, src, dest, opts) {
|
|
624882
624928
|
await fs34.copyFile(src, dest);
|
|
624883
624929
|
if (opts.preserveTimestamps) {
|
|
624884
624930
|
if (fileIsNotWritable(srcStat.mode)) {
|
|
@@ -624986,18 +625032,18 @@ var require_copy_sync = __commonJS({
|
|
|
624986
625032
|
throw new Error(`Unknown file: ${src}`);
|
|
624987
625033
|
}
|
|
624988
625034
|
function onFile(srcStat, destStat, src, dest, opts) {
|
|
624989
|
-
if (!destStat) return
|
|
625035
|
+
if (!destStat) return copyFile7(srcStat, src, dest, opts);
|
|
624990
625036
|
return mayCopyFile(srcStat, src, dest, opts);
|
|
624991
625037
|
}
|
|
624992
625038
|
function mayCopyFile(srcStat, src, dest, opts) {
|
|
624993
625039
|
if (opts.overwrite) {
|
|
624994
625040
|
fs34.unlinkSync(dest);
|
|
624995
|
-
return
|
|
625041
|
+
return copyFile7(srcStat, src, dest, opts);
|
|
624996
625042
|
} else if (opts.errorOnExist) {
|
|
624997
625043
|
throw new Error(`'${dest}' already exists`);
|
|
624998
625044
|
}
|
|
624999
625045
|
}
|
|
625000
|
-
function
|
|
625046
|
+
function copyFile7(srcStat, src, dest, opts) {
|
|
625001
625047
|
fs34.copyFileSync(src, dest);
|
|
625002
625048
|
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
|
|
625003
625049
|
return setDestMode(dest, srcStat.mode);
|
|
@@ -625121,14 +625167,14 @@ var require_empty2 = __commonJS({
|
|
|
625121
625167
|
var u5 = require_universalify().fromPromise;
|
|
625122
625168
|
var fs34 = require_fs();
|
|
625123
625169
|
var path120 = require("path");
|
|
625124
|
-
var
|
|
625170
|
+
var mkdir46 = require_mkdirs();
|
|
625125
625171
|
var remove3 = require_remove3();
|
|
625126
625172
|
var emptyDir = u5(async function emptyDir2(dir) {
|
|
625127
625173
|
let items;
|
|
625128
625174
|
try {
|
|
625129
625175
|
items = await fs34.readdir(dir);
|
|
625130
625176
|
} catch {
|
|
625131
|
-
return
|
|
625177
|
+
return mkdir46.mkdirs(dir);
|
|
625132
625178
|
}
|
|
625133
625179
|
return Promise.all(items.map((item) => remove3.remove(path120.join(dir, item))));
|
|
625134
625180
|
});
|
|
@@ -625137,7 +625183,7 @@ var require_empty2 = __commonJS({
|
|
|
625137
625183
|
try {
|
|
625138
625184
|
items = fs34.readdirSync(dir);
|
|
625139
625185
|
} catch {
|
|
625140
|
-
return
|
|
625186
|
+
return mkdir46.mkdirsSync(dir);
|
|
625141
625187
|
}
|
|
625142
625188
|
items.forEach((item) => {
|
|
625143
625189
|
item = path120.join(dir, item);
|
|
@@ -625160,7 +625206,7 @@ var require_file2 = __commonJS({
|
|
|
625160
625206
|
var u5 = require_universalify().fromPromise;
|
|
625161
625207
|
var path120 = require("path");
|
|
625162
625208
|
var fs34 = require_fs();
|
|
625163
|
-
var
|
|
625209
|
+
var mkdir46 = require_mkdirs();
|
|
625164
625210
|
async function createFile(file4) {
|
|
625165
625211
|
let stats;
|
|
625166
625212
|
try {
|
|
@@ -625174,7 +625220,7 @@ var require_file2 = __commonJS({
|
|
|
625174
625220
|
dirStats = await fs34.stat(dir);
|
|
625175
625221
|
} catch (err) {
|
|
625176
625222
|
if (err.code === "ENOENT") {
|
|
625177
|
-
await
|
|
625223
|
+
await mkdir46.mkdirs(dir);
|
|
625178
625224
|
await fs34.writeFile(file4, "");
|
|
625179
625225
|
return;
|
|
625180
625226
|
} else {
|
|
@@ -625200,7 +625246,7 @@ var require_file2 = __commonJS({
|
|
|
625200
625246
|
fs34.readdirSync(dir);
|
|
625201
625247
|
}
|
|
625202
625248
|
} catch (err) {
|
|
625203
|
-
if (err && err.code === "ENOENT")
|
|
625249
|
+
if (err && err.code === "ENOENT") mkdir46.mkdirsSync(dir);
|
|
625204
625250
|
else throw err;
|
|
625205
625251
|
}
|
|
625206
625252
|
fs34.writeFileSync(file4, "");
|
|
@@ -625219,7 +625265,7 @@ var require_link = __commonJS({
|
|
|
625219
625265
|
var u5 = require_universalify().fromPromise;
|
|
625220
625266
|
var path120 = require("path");
|
|
625221
625267
|
var fs34 = require_fs();
|
|
625222
|
-
var
|
|
625268
|
+
var mkdir46 = require_mkdirs();
|
|
625223
625269
|
var { pathExists: pathExists2 } = require_path_exists();
|
|
625224
625270
|
var { areIdentical } = require_stat();
|
|
625225
625271
|
async function createLink(srcpath, dstpath) {
|
|
@@ -625239,7 +625285,7 @@ var require_link = __commonJS({
|
|
|
625239
625285
|
const dir = path120.dirname(dstpath);
|
|
625240
625286
|
const dirExists = await pathExists2(dir);
|
|
625241
625287
|
if (!dirExists) {
|
|
625242
|
-
await
|
|
625288
|
+
await mkdir46.mkdirs(dir);
|
|
625243
625289
|
}
|
|
625244
625290
|
await fs34.link(srcpath, dstpath);
|
|
625245
625291
|
}
|
|
@@ -625259,7 +625305,7 @@ var require_link = __commonJS({
|
|
|
625259
625305
|
const dir = path120.dirname(dstpath);
|
|
625260
625306
|
const dirExists = fs34.existsSync(dir);
|
|
625261
625307
|
if (dirExists) return fs34.linkSync(srcpath, dstpath);
|
|
625262
|
-
|
|
625308
|
+
mkdir46.mkdirsSync(dir);
|
|
625263
625309
|
return fs34.linkSync(srcpath, dstpath);
|
|
625264
625310
|
}
|
|
625265
625311
|
module4.exports = {
|
|
@@ -625533,7 +625579,7 @@ var require_jsonfile = __commonJS({
|
|
|
625533
625579
|
}
|
|
625534
625580
|
return obj;
|
|
625535
625581
|
}
|
|
625536
|
-
var
|
|
625582
|
+
var readFile121 = universalify.fromPromise(_readFile);
|
|
625537
625583
|
function readFileSync19(file4, options2 = {}) {
|
|
625538
625584
|
if (typeof options2 === "string") {
|
|
625539
625585
|
options2 = { encoding: options2 };
|
|
@@ -625565,7 +625611,7 @@ var require_jsonfile = __commonJS({
|
|
|
625565
625611
|
return fs34.writeFileSync(file4, str2, options2);
|
|
625566
625612
|
}
|
|
625567
625613
|
module4.exports = {
|
|
625568
|
-
readFile:
|
|
625614
|
+
readFile: readFile121,
|
|
625569
625615
|
readFileSync: readFileSync19,
|
|
625570
625616
|
writeFile: writeFile102,
|
|
625571
625617
|
writeFileSync: writeFileSync9
|
|
@@ -625595,19 +625641,19 @@ var require_output_file = __commonJS({
|
|
|
625595
625641
|
var u5 = require_universalify().fromPromise;
|
|
625596
625642
|
var fs34 = require_fs();
|
|
625597
625643
|
var path120 = require("path");
|
|
625598
|
-
var
|
|
625644
|
+
var mkdir46 = require_mkdirs();
|
|
625599
625645
|
var pathExists2 = require_path_exists().pathExists;
|
|
625600
625646
|
async function outputFile(file4, data2, encoding = "utf-8") {
|
|
625601
625647
|
const dir = path120.dirname(file4);
|
|
625602
625648
|
if (!await pathExists2(dir)) {
|
|
625603
|
-
await
|
|
625649
|
+
await mkdir46.mkdirs(dir);
|
|
625604
625650
|
}
|
|
625605
625651
|
return fs34.writeFile(file4, data2, encoding);
|
|
625606
625652
|
}
|
|
625607
625653
|
function outputFileSync(file4, ...args) {
|
|
625608
625654
|
const dir = path120.dirname(file4);
|
|
625609
625655
|
if (!fs34.existsSync(dir)) {
|
|
625610
|
-
|
|
625656
|
+
mkdir46.mkdirsSync(dir);
|
|
625611
625657
|
}
|
|
625612
625658
|
fs34.writeFileSync(file4, ...args);
|
|
625613
625659
|
}
|
|
@@ -625740,15 +625786,15 @@ var require_move_sync = __commonJS({
|
|
|
625740
625786
|
return parsedPath.root === parent;
|
|
625741
625787
|
}
|
|
625742
625788
|
function doRename(src, dest, overwrite, isChangingCase) {
|
|
625743
|
-
if (isChangingCase) return
|
|
625789
|
+
if (isChangingCase) return rename8(src, dest, overwrite);
|
|
625744
625790
|
if (overwrite) {
|
|
625745
625791
|
removeSync(dest);
|
|
625746
|
-
return
|
|
625792
|
+
return rename8(src, dest, overwrite);
|
|
625747
625793
|
}
|
|
625748
625794
|
if (fs34.existsSync(dest)) throw new Error("dest already exists.");
|
|
625749
|
-
return
|
|
625795
|
+
return rename8(src, dest, overwrite);
|
|
625750
625796
|
}
|
|
625751
|
-
function
|
|
625797
|
+
function rename8(src, dest, overwrite) {
|
|
625752
625798
|
try {
|
|
625753
625799
|
fs34.renameSync(src, dest);
|
|
625754
625800
|
} catch (err) {
|
|
@@ -692034,7 +692080,7 @@ var AccessTokenPosthogManager = class {
|
|
|
692034
692080
|
properties: {
|
|
692035
692081
|
...event,
|
|
692036
692082
|
...event.properties,
|
|
692037
|
-
version: "5.
|
|
692083
|
+
version: "5.84.0",
|
|
692038
692084
|
usingAccessToken: true,
|
|
692039
692085
|
...getRunIdProperties()
|
|
692040
692086
|
}
|
|
@@ -692100,7 +692146,7 @@ var UserPosthogManager = class {
|
|
|
692100
692146
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
692101
692147
|
event: "CLI",
|
|
692102
692148
|
properties: {
|
|
692103
|
-
version: "5.
|
|
692149
|
+
version: "5.84.0",
|
|
692104
692150
|
...event,
|
|
692105
692151
|
...event.properties,
|
|
692106
692152
|
usingAccessToken: false,
|
|
@@ -867735,7 +867781,7 @@ var MDX_NODE_TYPES = [
|
|
|
867735
867781
|
"mdxTextExpression",
|
|
867736
867782
|
"mdxjsEsm"
|
|
867737
867783
|
];
|
|
867738
|
-
function collectLinksAndSources({ readFile:
|
|
867784
|
+
function collectLinksAndSources({ readFile: readFile121 = (path120) => (0, import_node_fs17.readFileSync)(path120, "utf-8"), ...opts }) {
|
|
867739
867785
|
const visitedAbsoluteFilepaths = /* @__PURE__ */ new Set();
|
|
867740
867786
|
const contentQueue = [opts];
|
|
867741
867787
|
const links = [];
|
|
@@ -867784,7 +867830,7 @@ function collectLinksAndSources({ readFile: readFile120 = (path120) => (0, impor
|
|
|
867784
867830
|
const resolvedImportPath = resolve6(dirname6(absoluteFilepath), importPath);
|
|
867785
867831
|
if (resolvedImportPath.endsWith(".mdx") || resolvedImportPath.endsWith(".md")) {
|
|
867786
867832
|
contentQueue.push({
|
|
867787
|
-
content:
|
|
867833
|
+
content: readFile121(resolvedImportPath),
|
|
867788
867834
|
absoluteFilepath: resolvedImportPath
|
|
867789
867835
|
});
|
|
867790
867836
|
}
|
|
@@ -867827,7 +867873,7 @@ function collectLinksAndSources({ readFile: readFile120 = (path120) => (0, impor
|
|
|
867827
867873
|
if (absoluteFilepath && typeof src === "string") {
|
|
867828
867874
|
const resolvedImportPath = resolve6(dirname6(absoluteFilepath), src);
|
|
867829
867875
|
contentQueue.push({
|
|
867830
|
-
content:
|
|
867876
|
+
content: readFile121(resolvedImportPath),
|
|
867831
867877
|
absoluteFilepath: resolvedImportPath
|
|
867832
867878
|
});
|
|
867833
867879
|
}
|
|
@@ -873206,7 +873252,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
873206
873252
|
var LOGS_FOLDER_NAME = "logs";
|
|
873207
873253
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
873208
873254
|
function getCliSource() {
|
|
873209
|
-
const version7 = "5.
|
|
873255
|
+
const version7 = "5.84.0";
|
|
873210
873256
|
return `cli@${version7}`;
|
|
873211
873257
|
}
|
|
873212
873258
|
var DebugLogger = class {
|
|
@@ -903087,7 +903133,7 @@ var SourceUploader = class {
|
|
|
903087
903133
|
};
|
|
903088
903134
|
|
|
903089
903135
|
// ../generation/remote-generation/remote-workspace-runner/lib/runRemoteGenerationForGenerator.js
|
|
903090
|
-
async function runRemoteGenerationForGenerator({ projectConfig, organization, workspace, interactiveTaskContext, generatorInvocation, version: version7, audiences, shouldLogS3Url, token, whitelabel, replay, irVersionOverride, absolutePathToPreview, isPreview: isPreviewOverride, fiddlePreview, pushPreviewBranch, readme, fernignorePath, skipFernignore, dynamicIrOnly, retryRateLimited, requireEnvVars, automationMode, autoMerge, skipIfNoDiff, verify: verify2, noReplay, disableTelemetry, loginCommand, specsTarGzBuffer }) {
|
|
903136
|
+
async function runRemoteGenerationForGenerator({ projectConfig, organization, workspace, interactiveTaskContext, generatorInvocation, version: version7, audiences, shouldLogS3Url, token, whitelabel, replay, irVersionOverride, absolutePathToPreview, isPreview: isPreviewOverride, fiddlePreview, pushPreviewBranch, readme, fernignorePath, skipFernignore, dynamicIrOnly, retryRateLimited, requireEnvVars, automationMode, autoMerge, skipIfNoDiff, verify: verify2, noReplay, disableTelemetry, loginCommand, specsTarGzBuffer, generateFullProject }) {
|
|
903091
903137
|
const fdr = createFdrService({ token: token.value });
|
|
903092
903138
|
const fdrOrigin = "https://registry-dev2.buildwithfern.com";
|
|
903093
903139
|
const isAirGapped = await detectAirGappedMode(`${fdrOrigin}/health`, interactiveTaskContext.logger);
|
|
@@ -903276,6 +903322,7 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
|
|
|
903276
903322
|
userProvidedVersion: version7,
|
|
903277
903323
|
packageName,
|
|
903278
903324
|
selfHosted: ir3.selfHosted ?? false,
|
|
903325
|
+
generateFullProject,
|
|
903279
903326
|
context: interactiveTaskContext
|
|
903280
903327
|
})
|
|
903281
903328
|
},
|
|
@@ -903358,12 +903405,12 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
|
|
|
903358
903405
|
}
|
|
903359
903406
|
return result;
|
|
903360
903407
|
}
|
|
903361
|
-
function getPublishConfig({ generatorInvocation, version: version7, userProvidedVersion, packageName, selfHosted, context: context3 }) {
|
|
903408
|
+
function getPublishConfig({ generatorInvocation, version: version7, userProvidedVersion, packageName, selfHosted, generateFullProject, context: context3 }) {
|
|
903362
903409
|
const publishLanguage = generatorInvocation.language ?? (0, import_autoversion.extractLanguageFromGeneratorName)(generatorInvocation.name);
|
|
903363
903410
|
const substituteAutoVersion = (candidate) => candidate != null && (0, import_autoversion.isAutoVersion)(candidate) ? (0, import_autoversion.mapMagicVersionForLanguage)(import_autoversion.MAGIC_VERSION, publishLanguage) : candidate;
|
|
903364
903411
|
return generatorInvocation.outputMode._visit({
|
|
903365
903412
|
downloadFiles: () => api_exports.PublishingConfig.filesystem({
|
|
903366
|
-
generateFullProject: selfHosted,
|
|
903413
|
+
generateFullProject: selfHosted || (generateFullProject ?? false),
|
|
903367
903414
|
publishTarget: getFilesystemPublishTarget({
|
|
903368
903415
|
generatorInvocation,
|
|
903369
903416
|
version: substituteAutoVersion(version7),
|
|
@@ -903476,7 +903523,7 @@ function resolveVersionFallback(resolvedVersion) {
|
|
|
903476
903523
|
}
|
|
903477
903524
|
|
|
903478
903525
|
// ../generation/remote-generation/remote-workspace-runner/lib/runRemoteGenerationForAPIWorkspace.js
|
|
903479
|
-
async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization, workspace, context: context3, generatorGroup, version: version7, shouldLogS3Url, token, whitelabel, replay, absolutePathToPreview, isPreview, fiddlePreview, pushPreviewBranch, mode, fernignorePath, skipFernignore, dynamicIrOnly, validateWorkspace, retryRateLimited, requireEnvVars, automationMode, autoMerge, skipIfNoDiff, verify: verify2, noReplay, disableTelemetry, automation, occurrenceTracker, loginCommand, getSpecsTarGzBuffer }) {
|
|
903526
|
+
async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization, workspace, context: context3, generatorGroup, version: version7, shouldLogS3Url, token, whitelabel, replay, absolutePathToPreview, isPreview, fiddlePreview, pushPreviewBranch, mode, fernignorePath, skipFernignore, dynamicIrOnly, validateWorkspace, retryRateLimited, requireEnvVars, automationMode, autoMerge, skipIfNoDiff, verify: verify2, noReplay, disableTelemetry, automation, occurrenceTracker, loginCommand, getSpecsTarGzBuffer, generateFullProject }) {
|
|
903480
903527
|
if (generatorGroup.generators.length === 0) {
|
|
903481
903528
|
context3.logger.warn("No generators specified.");
|
|
903482
903529
|
return null;
|
|
@@ -903523,6 +903570,7 @@ async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization,
|
|
|
903523
903570
|
occurrenceTracker: effectiveOccurrenceTracker,
|
|
903524
903571
|
loginCommand,
|
|
903525
903572
|
getSpecsTarGzBuffer,
|
|
903573
|
+
generateFullProject,
|
|
903526
903574
|
onSnippetsProduced: (invocation) => snippetsProducedBy.push(invocation)
|
|
903527
903575
|
}))));
|
|
903528
903576
|
if (automation == null && results.some((didSucceed) => !didSucceed)) {
|
|
@@ -903532,7 +903580,7 @@ async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization,
|
|
|
903532
903580
|
snippetsProducedBy
|
|
903533
903581
|
};
|
|
903534
903582
|
}
|
|
903535
|
-
async function generateOne({ generatorInvocation, interactiveTaskContext, projectConfig, organization, workspace, context: context3, generatorGroup, version: version7, shouldLogS3Url, token, whitelabel, replay, absolutePathToPreview, isPreview, fiddlePreview, pushPreviewBranch, mode, fernignorePath, skipFernignore, dynamicIrOnly, validateWorkspace, retryRateLimited, requireEnvVars, automationMode, autoMerge, skipIfNoDiff, verify: verify2, noReplay, disableTelemetry, automation, generatorsYmlAbsolutePath, occurrenceTracker, loginCommand, getSpecsTarGzBuffer, onSnippetsProduced }) {
|
|
903583
|
+
async function generateOne({ generatorInvocation, interactiveTaskContext, projectConfig, organization, workspace, context: context3, generatorGroup, version: version7, shouldLogS3Url, token, whitelabel, replay, absolutePathToPreview, isPreview, fiddlePreview, pushPreviewBranch, mode, fernignorePath, skipFernignore, dynamicIrOnly, validateWorkspace, retryRateLimited, requireEnvVars, automationMode, autoMerge, skipIfNoDiff, verify: verify2, noReplay, disableTelemetry, automation, generatorsYmlAbsolutePath, occurrenceTracker, loginCommand, getSpecsTarGzBuffer, generateFullProject, onSnippetsProduced }) {
|
|
903536
903584
|
const startedAt = Date.now();
|
|
903537
903585
|
try {
|
|
903538
903586
|
const settings = getBaseOpenAPIWorkspaceSettingsFromGeneratorInvocation(generatorInvocation);
|
|
@@ -903599,7 +903647,8 @@ async function generateOne({ generatorInvocation, interactiveTaskContext, projec
|
|
|
903599
903647
|
noReplay,
|
|
903600
903648
|
disableTelemetry,
|
|
903601
903649
|
loginCommand,
|
|
903602
|
-
specsTarGzBuffer: await getSpecsTarGzBuffer?.(generatorInvocation.name)
|
|
903650
|
+
specsTarGzBuffer: await getSpecsTarGzBuffer?.(generatorInvocation.name),
|
|
903651
|
+
generateFullProject
|
|
903603
903652
|
});
|
|
903604
903653
|
if (remoteTaskHandlerResponse?.createdSnippets) {
|
|
903605
903654
|
onSnippetsProduced(generatorInvocation);
|
|
@@ -905902,7 +905951,7 @@ var LegacyDocsPublisher = class {
|
|
|
905902
905951
|
previewId,
|
|
905903
905952
|
disableTemplates: void 0,
|
|
905904
905953
|
skipUpload,
|
|
905905
|
-
cliVersion: "5.
|
|
905954
|
+
cliVersion: "5.84.0",
|
|
905906
905955
|
loginCommand: "fern auth login"
|
|
905907
905956
|
});
|
|
905908
905957
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -960647,7 +960696,7 @@ function getGeneratorOutputSubfolder(generatorName) {
|
|
|
960647
960696
|
}
|
|
960648
960697
|
|
|
960649
960698
|
// ../generation/local-generation/local-workspace-runner/lib/runLocalGenerationForWorkspace.js
|
|
960650
|
-
async function runLocalGenerationForWorkspace({ token, projectConfig, workspace, generatorGroup, version: version7, keepDocker, inspect: inspect6, context: context3, absolutePathToPreview, runner, ai: ai2, replay, noReplay, validateWorkspace, requireEnvVars, skipFernignore, publishToRegistry, isPreview: isPreviewOverride, automationMode, autoMerge, skipIfNoDiff, generateTests, verify: verify2, disableTelemetry }) {
|
|
960699
|
+
async function runLocalGenerationForWorkspace({ token, projectConfig, workspace, generatorGroup, version: version7, keepDocker, inspect: inspect6, context: context3, absolutePathToPreview, runner, ai: ai2, replay, noReplay, validateWorkspace, requireEnvVars, skipFernignore, publishToRegistry, isPreview: isPreviewOverride, automationMode, autoMerge, skipIfNoDiff, generateTests, generateFullProject, verify: verify2, disableTelemetry }) {
|
|
960651
960700
|
const userProvidedVersion = version7;
|
|
960652
960701
|
if (userProvidedVersion != null) {
|
|
960653
960702
|
if (absolutePathToPreview != null) {
|
|
@@ -960767,7 +960816,8 @@ async function runLocalGenerationForWorkspace({ token, projectConfig, workspace,
|
|
|
960767
960816
|
userProvidedVersion,
|
|
960768
960817
|
packageName,
|
|
960769
960818
|
context: interactiveTaskContext,
|
|
960770
|
-
generateTests
|
|
960819
|
+
generateTests,
|
|
960820
|
+
generateFullProject
|
|
960771
960821
|
});
|
|
960772
960822
|
if (publishConfig != null) {
|
|
960773
960823
|
intermediateRepresentation.publishConfig = publishConfig;
|
|
@@ -960992,7 +961042,7 @@ async function getWorkspaceTempDir() {
|
|
|
960992
961042
|
prefix: "fern"
|
|
960993
961043
|
});
|
|
960994
961044
|
}
|
|
960995
|
-
function getPublishConfig2({ generatorInvocation, org, version: version7, userProvidedVersion, packageName, context: context3, generateTests }) {
|
|
961045
|
+
function getPublishConfig2({ generatorInvocation, org, version: version7, userProvidedVersion, packageName, context: context3, generateTests, generateFullProject }) {
|
|
960996
961046
|
const publishLanguage = generatorInvocation.language ?? (0, import_autoversion4.extractLanguageFromGeneratorName)(generatorInvocation.name);
|
|
960997
961047
|
const substituteAutoVersion = (candidate) => candidate != null && (0, import_autoversion4.isAutoVersion)(candidate) ? (0, import_autoversion4.mapMagicVersionForLanguage)(import_autoversion4.MAGIC_VERSION, publishLanguage) : candidate;
|
|
960998
961048
|
const effectiveVersion = substituteAutoVersion(version7);
|
|
@@ -961023,14 +961073,14 @@ function getPublishConfig2({ generatorInvocation, org, version: version7, userPr
|
|
|
961023
961073
|
context: context3
|
|
961024
961074
|
});
|
|
961025
961075
|
return api_exports.PublishingConfig.filesystem({
|
|
961026
|
-
generateFullProject: generateTests || org?.selfHostedSdKs || false,
|
|
961076
|
+
generateFullProject: generateTests || generateFullProject || org?.selfHostedSdKs || false,
|
|
961027
961077
|
publishTarget
|
|
961028
961078
|
});
|
|
961029
961079
|
}
|
|
961030
961080
|
return generatorInvocation.outputMode._visit({
|
|
961031
961081
|
downloadFiles: () => {
|
|
961032
961082
|
return api_exports.PublishingConfig.filesystem({
|
|
961033
|
-
generateFullProject: generateTests || org?.selfHostedSdKs || false,
|
|
961083
|
+
generateFullProject: generateTests || generateFullProject || org?.selfHostedSdKs || false,
|
|
961034
961084
|
publishTarget: void 0
|
|
961035
961085
|
});
|
|
961036
961086
|
},
|
|
@@ -972776,7 +972826,7 @@ function getAutomationContextFromEnv() {
|
|
|
972776
972826
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
972777
972827
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
972778
972828
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
972779
|
-
cli_version: "5.
|
|
972829
|
+
cli_version: "5.84.0"
|
|
972780
972830
|
};
|
|
972781
972831
|
}
|
|
972782
972832
|
function isAutomationMode() {
|
|
@@ -973608,7 +973658,7 @@ var CliContext = class _CliContext {
|
|
|
973608
973658
|
if (false) {
|
|
973609
973659
|
this.logger.error("CLI_VERSION is not defined");
|
|
973610
973660
|
}
|
|
973611
|
-
return "5.
|
|
973661
|
+
return "5.84.0";
|
|
973612
973662
|
}
|
|
973613
973663
|
getCliName() {
|
|
973614
973664
|
if (false) {
|
|
@@ -975396,6 +975446,242 @@ init_lib35();
|
|
|
975396
975446
|
init_lib6();
|
|
975397
975447
|
init_esm19();
|
|
975398
975448
|
|
|
975449
|
+
// src/commands/generate/packLocalOutput.ts
|
|
975450
|
+
init_lib4();
|
|
975451
|
+
init_lib8();
|
|
975452
|
+
init_lib33();
|
|
975453
|
+
var import_promises168 = require("fs/promises");
|
|
975454
|
+
var PACK_OUTPUT_DIRECTORY = "fern-dist";
|
|
975455
|
+
var PACK_DOCKER_IMAGES = {
|
|
975456
|
+
typescript: "node:22",
|
|
975457
|
+
python: "python:3.12",
|
|
975458
|
+
java: "gradle:8-jdk17",
|
|
975459
|
+
csharp: "mcr.microsoft.com/dotnet/sdk:9.0",
|
|
975460
|
+
ruby: "ruby:3.3",
|
|
975461
|
+
php: "composer:2",
|
|
975462
|
+
rust: "rust:1"
|
|
975463
|
+
};
|
|
975464
|
+
async function packLocalOutputForGroup({
|
|
975465
|
+
group,
|
|
975466
|
+
context: context3,
|
|
975467
|
+
mode = "host",
|
|
975468
|
+
runner
|
|
975469
|
+
}) {
|
|
975470
|
+
const failures = [];
|
|
975471
|
+
for (const generator of group.generators) {
|
|
975472
|
+
const outputPath = generator.absolutePathToLocalOutput;
|
|
975473
|
+
if (outputPath == null) {
|
|
975474
|
+
context3.logger.debug(
|
|
975475
|
+
`Skipping packaging for ${generator.name}: output is not written to the local file system.`
|
|
975476
|
+
);
|
|
975477
|
+
continue;
|
|
975478
|
+
}
|
|
975479
|
+
const language = generator.language;
|
|
975480
|
+
if (language == null) {
|
|
975481
|
+
context3.logger.warn(`Skipping packaging for ${generator.name}: could not determine language.`);
|
|
975482
|
+
continue;
|
|
975483
|
+
}
|
|
975484
|
+
try {
|
|
975485
|
+
await packOutputForLanguage({ language, outputPath, context: context3, mode, runner: runner ?? "docker" });
|
|
975486
|
+
} catch (error50) {
|
|
975487
|
+
const message = error50 instanceof Error ? error50.message : String(error50);
|
|
975488
|
+
context3.logger.error(`Failed to package ${generator.name} output at ${outputPath}: ${message}`);
|
|
975489
|
+
await removeDistDirIfEmpty(outputPath);
|
|
975490
|
+
failures.push(generator.name);
|
|
975491
|
+
}
|
|
975492
|
+
}
|
|
975493
|
+
if (failures.length > 0) {
|
|
975494
|
+
context3.failAndThrow(`Packaging failed for: ${failures.join(", ")}`);
|
|
975495
|
+
}
|
|
975496
|
+
}
|
|
975497
|
+
async function packOutputForLanguage({
|
|
975498
|
+
language,
|
|
975499
|
+
outputPath,
|
|
975500
|
+
context: context3,
|
|
975501
|
+
mode,
|
|
975502
|
+
runner
|
|
975503
|
+
}) {
|
|
975504
|
+
const distDir = join8(outputPath, RelativeFilePath2.of(PACK_OUTPUT_DIRECTORY));
|
|
975505
|
+
const run = async (commands) => {
|
|
975506
|
+
await runPackCommands({ commands, language, outputPath, context: context3, mode, runner });
|
|
975507
|
+
};
|
|
975508
|
+
switch (language) {
|
|
975509
|
+
case "typescript": {
|
|
975510
|
+
await (0, import_promises168.mkdir)(distDir, { recursive: true });
|
|
975511
|
+
const commands = [["npm", "install"]];
|
|
975512
|
+
if (await hasNpmScript({ outputPath, script: "build" })) {
|
|
975513
|
+
commands.push(["npm", "run", "build"]);
|
|
975514
|
+
}
|
|
975515
|
+
commands.push(["npm", "pack", "--pack-destination", PACK_OUTPUT_DIRECTORY]);
|
|
975516
|
+
await run(commands);
|
|
975517
|
+
logArtifacts({ distDir, context: context3 });
|
|
975518
|
+
return;
|
|
975519
|
+
}
|
|
975520
|
+
case "python": {
|
|
975521
|
+
await (0, import_promises168.mkdir)(distDir, { recursive: true });
|
|
975522
|
+
await run([["python3", "-m", "pip", "wheel", ".", "--no-deps", "--wheel-dir", PACK_OUTPUT_DIRECTORY]]);
|
|
975523
|
+
logArtifacts({ distDir, context: context3 });
|
|
975524
|
+
return;
|
|
975525
|
+
}
|
|
975526
|
+
case "java": {
|
|
975527
|
+
await (0, import_promises168.mkdir)(distDir, { recursive: true });
|
|
975528
|
+
await run([["gradle", "jar", "-x", "test"]]);
|
|
975529
|
+
const libsDir = join8(outputPath, RelativeFilePath2.of("build/libs"));
|
|
975530
|
+
await copyMatchingFiles({ fromDir: libsDir, toDir: distDir, extension: ".jar" });
|
|
975531
|
+
logArtifacts({ distDir, context: context3 });
|
|
975532
|
+
return;
|
|
975533
|
+
}
|
|
975534
|
+
case "csharp": {
|
|
975535
|
+
await (0, import_promises168.mkdir)(distDir, { recursive: true });
|
|
975536
|
+
const csproj = await findCsproj(outputPath);
|
|
975537
|
+
if (csproj == null) {
|
|
975538
|
+
throw new Error("No packable .csproj found in output directory.");
|
|
975539
|
+
}
|
|
975540
|
+
await run([["dotnet", "pack", csproj, "-c", "Release", "-o", PACK_OUTPUT_DIRECTORY]]);
|
|
975541
|
+
logArtifacts({ distDir, context: context3 });
|
|
975542
|
+
return;
|
|
975543
|
+
}
|
|
975544
|
+
case "ruby": {
|
|
975545
|
+
await (0, import_promises168.mkdir)(distDir, { recursive: true });
|
|
975546
|
+
const gemspec = (await (0, import_promises168.readdir)(outputPath)).find((file4) => file4.endsWith(".gemspec"));
|
|
975547
|
+
if (gemspec == null) {
|
|
975548
|
+
throw new Error("No .gemspec found in output directory.");
|
|
975549
|
+
}
|
|
975550
|
+
await run([["gem", "build", gemspec]]);
|
|
975551
|
+
await moveMatchingFiles({ fromDir: outputPath, toDir: distDir, extension: ".gem" });
|
|
975552
|
+
logArtifacts({ distDir, context: context3 });
|
|
975553
|
+
return;
|
|
975554
|
+
}
|
|
975555
|
+
case "php": {
|
|
975556
|
+
await (0, import_promises168.mkdir)(distDir, { recursive: true });
|
|
975557
|
+
await run([["composer", "archive", "--format=zip", `--dir=${PACK_OUTPUT_DIRECTORY}`]]);
|
|
975558
|
+
logArtifacts({ distDir, context: context3 });
|
|
975559
|
+
return;
|
|
975560
|
+
}
|
|
975561
|
+
case "rust": {
|
|
975562
|
+
await (0, import_promises168.mkdir)(distDir, { recursive: true });
|
|
975563
|
+
await run([["cargo", "package", "--allow-dirty", "--no-verify"]]);
|
|
975564
|
+
const packageDir = join8(outputPath, RelativeFilePath2.of("target/package"));
|
|
975565
|
+
await copyMatchingFiles({ fromDir: packageDir, toDir: distDir, extension: ".crate" });
|
|
975566
|
+
logArtifacts({ distDir, context: context3 });
|
|
975567
|
+
return;
|
|
975568
|
+
}
|
|
975569
|
+
case "go":
|
|
975570
|
+
context3.logger.warn(
|
|
975571
|
+
"Go SDKs are distributed as source modules, so there is no package artifact to build. Share the output directory itself (e.g. as a zip), or reference it with a 'replace' directive in go.mod."
|
|
975572
|
+
);
|
|
975573
|
+
return;
|
|
975574
|
+
case "swift":
|
|
975575
|
+
context3.logger.warn(
|
|
975576
|
+
"Swift SDKs are distributed as source packages (Swift Package Manager), so there is no package artifact to build. Share the output directory itself, or reference it as a local package dependency."
|
|
975577
|
+
);
|
|
975578
|
+
return;
|
|
975579
|
+
default:
|
|
975580
|
+
assertNever(language);
|
|
975581
|
+
}
|
|
975582
|
+
}
|
|
975583
|
+
async function runPackCommands({
|
|
975584
|
+
commands,
|
|
975585
|
+
language,
|
|
975586
|
+
outputPath,
|
|
975587
|
+
context: context3,
|
|
975588
|
+
mode,
|
|
975589
|
+
runner
|
|
975590
|
+
}) {
|
|
975591
|
+
for (const command3 of commands) {
|
|
975592
|
+
const [executable, ...args] = command3;
|
|
975593
|
+
if (executable == null) {
|
|
975594
|
+
continue;
|
|
975595
|
+
}
|
|
975596
|
+
if (mode === "host") {
|
|
975597
|
+
await loggingExeca(context3.logger, executable, args, {
|
|
975598
|
+
cwd: outputPath,
|
|
975599
|
+
env: { ...process.env, GIT_DIR: join8(outputPath, RelativeFilePath2.of(".git")) }
|
|
975600
|
+
});
|
|
975601
|
+
continue;
|
|
975602
|
+
}
|
|
975603
|
+
const image3 = PACK_DOCKER_IMAGES[language];
|
|
975604
|
+
if (image3 == null) {
|
|
975605
|
+
throw new Error(`No Docker toolchain image is configured for ${language}.`);
|
|
975606
|
+
}
|
|
975607
|
+
const containerArgs = ["run", "--rm", "-v", `${outputPath}:/workspace`, "-w", "/workspace", "-e", "HOME=/tmp"];
|
|
975608
|
+
if (process.getuid != null && process.getgid != null) {
|
|
975609
|
+
containerArgs.push("--user", `${process.getuid()}:${process.getgid()}`);
|
|
975610
|
+
}
|
|
975611
|
+
await loggingExeca(context3.logger, runner, [...containerArgs, image3, executable, ...args], {
|
|
975612
|
+
cwd: outputPath
|
|
975613
|
+
});
|
|
975614
|
+
}
|
|
975615
|
+
}
|
|
975616
|
+
async function removeDistDirIfEmpty(outputPath) {
|
|
975617
|
+
const distDir = join8(outputPath, RelativeFilePath2.of(PACK_OUTPUT_DIRECTORY));
|
|
975618
|
+
try {
|
|
975619
|
+
if ((await (0, import_promises168.readdir)(distDir)).length === 0) {
|
|
975620
|
+
await (0, import_promises168.rmdir)(distDir);
|
|
975621
|
+
}
|
|
975622
|
+
} catch {
|
|
975623
|
+
}
|
|
975624
|
+
}
|
|
975625
|
+
async function hasNpmScript({
|
|
975626
|
+
outputPath,
|
|
975627
|
+
script
|
|
975628
|
+
}) {
|
|
975629
|
+
const packageJsonPath = join8(outputPath, RelativeFilePath2.of("package.json"));
|
|
975630
|
+
if (!await doesPathExist(packageJsonPath)) {
|
|
975631
|
+
return false;
|
|
975632
|
+
}
|
|
975633
|
+
const parsed = JSON.parse(await (0, import_promises168.readFile)(packageJsonPath, "utf-8"));
|
|
975634
|
+
if (typeof parsed !== "object" || parsed == null || !("scripts" in parsed)) {
|
|
975635
|
+
return false;
|
|
975636
|
+
}
|
|
975637
|
+
const scripts = parsed.scripts;
|
|
975638
|
+
return typeof scripts === "object" && scripts != null && script in scripts;
|
|
975639
|
+
}
|
|
975640
|
+
async function findCsproj(outputPath) {
|
|
975641
|
+
const srcDir = join8(outputPath, RelativeFilePath2.of("src"));
|
|
975642
|
+
if (!await doesPathExist(srcDir)) {
|
|
975643
|
+
return void 0;
|
|
975644
|
+
}
|
|
975645
|
+
for (const entry of await (0, import_promises168.readdir)(srcDir, { withFileTypes: true })) {
|
|
975646
|
+
if (!entry.isDirectory() || entry.name.endsWith(".Test") || entry.name.endsWith(".Tests")) {
|
|
975647
|
+
continue;
|
|
975648
|
+
}
|
|
975649
|
+
const relativeCsprojPath = `src/${entry.name}/${entry.name}.csproj`;
|
|
975650
|
+
if (await doesPathExist(join8(outputPath, RelativeFilePath2.of(relativeCsprojPath)))) {
|
|
975651
|
+
return relativeCsprojPath;
|
|
975652
|
+
}
|
|
975653
|
+
}
|
|
975654
|
+
return void 0;
|
|
975655
|
+
}
|
|
975656
|
+
async function copyMatchingFiles({
|
|
975657
|
+
fromDir,
|
|
975658
|
+
toDir,
|
|
975659
|
+
extension: extension4
|
|
975660
|
+
}) {
|
|
975661
|
+
if (!await doesPathExist(fromDir)) {
|
|
975662
|
+
throw new Error(`Expected build output directory ${fromDir} does not exist.`);
|
|
975663
|
+
}
|
|
975664
|
+
for (const file4 of await (0, import_promises168.readdir)(fromDir)) {
|
|
975665
|
+
if (file4.endsWith(extension4)) {
|
|
975666
|
+
await (0, import_promises168.copyFile)(join8(fromDir, RelativeFilePath2.of(file4)), join8(toDir, RelativeFilePath2.of(file4)));
|
|
975667
|
+
}
|
|
975668
|
+
}
|
|
975669
|
+
}
|
|
975670
|
+
async function moveMatchingFiles({
|
|
975671
|
+
fromDir,
|
|
975672
|
+
toDir,
|
|
975673
|
+
extension: extension4
|
|
975674
|
+
}) {
|
|
975675
|
+
for (const file4 of await (0, import_promises168.readdir)(fromDir)) {
|
|
975676
|
+
if (file4.endsWith(extension4)) {
|
|
975677
|
+
await (0, import_promises168.rename)(join8(fromDir, RelativeFilePath2.of(file4)), join8(toDir, RelativeFilePath2.of(file4)));
|
|
975678
|
+
}
|
|
975679
|
+
}
|
|
975680
|
+
}
|
|
975681
|
+
function logArtifacts({ distDir, context: context3 }) {
|
|
975682
|
+
context3.logger.info(`Packaged artifacts written to ${distDir}`);
|
|
975683
|
+
}
|
|
975684
|
+
|
|
975399
975685
|
// src/commands/generate/describeSkipReason.ts
|
|
975400
975686
|
function classifySkipReason(generator, rootAutorelease) {
|
|
975401
975687
|
if (!generator.automation.generate) {
|
|
@@ -975510,7 +975796,9 @@ async function generateWorkspace({
|
|
|
975510
975796
|
autoMerge,
|
|
975511
975797
|
skipIfNoDiff,
|
|
975512
975798
|
generateTests,
|
|
975513
|
-
automation
|
|
975799
|
+
automation,
|
|
975800
|
+
pack,
|
|
975801
|
+
packMode
|
|
975514
975802
|
}) {
|
|
975515
975803
|
if (workspace.generatorsConfiguration == null) {
|
|
975516
975804
|
context3.logger.warn("This workspaces has no generators.yml");
|
|
@@ -975573,6 +975861,7 @@ async function generateWorkspace({
|
|
|
975573
975861
|
autoMerge,
|
|
975574
975862
|
skipIfNoDiff,
|
|
975575
975863
|
generateTests,
|
|
975864
|
+
generateFullProject: pack,
|
|
975576
975865
|
verify: verify2,
|
|
975577
975866
|
disableTelemetry: isTelemetryDisabled()
|
|
975578
975867
|
});
|
|
@@ -975620,9 +975909,13 @@ async function generateWorkspace({
|
|
|
975620
975909
|
noReplay,
|
|
975621
975910
|
verify: verify2,
|
|
975622
975911
|
disableTelemetry: isTelemetryDisabled(),
|
|
975623
|
-
getSpecsTarGzBuffer: getSpecsTarGz
|
|
975912
|
+
getSpecsTarGzBuffer: getSpecsTarGz,
|
|
975913
|
+
generateFullProject: pack
|
|
975624
975914
|
});
|
|
975625
975915
|
}
|
|
975916
|
+
if (pack) {
|
|
975917
|
+
await packLocalOutputForGroup({ group, context: groupContext, mode: packMode, runner });
|
|
975918
|
+
}
|
|
975626
975919
|
})
|
|
975627
975920
|
)
|
|
975628
975921
|
);
|
|
@@ -975998,7 +976291,9 @@ async function generateAPIWorkspaces({
|
|
|
975998
976291
|
autoMerge,
|
|
975999
976292
|
skipIfNoDiff,
|
|
976000
976293
|
generateTests,
|
|
976001
|
-
automation
|
|
976294
|
+
automation,
|
|
976295
|
+
pack,
|
|
976296
|
+
packMode
|
|
976002
976297
|
}) {
|
|
976003
976298
|
let token = void 0;
|
|
976004
976299
|
if (!useLocalDocker) {
|
|
@@ -976077,7 +976372,9 @@ async function generateAPIWorkspaces({
|
|
|
976077
976372
|
autoMerge,
|
|
976078
976373
|
skipIfNoDiff,
|
|
976079
976374
|
generateTests,
|
|
976080
|
-
automation
|
|
976375
|
+
automation,
|
|
976376
|
+
pack,
|
|
976377
|
+
packMode
|
|
976081
976378
|
});
|
|
976082
976379
|
});
|
|
976083
976380
|
})
|
|
@@ -976344,7 +976641,7 @@ function renderOverflowWarning(failureCount) {
|
|
|
976344
976641
|
// src/commands/automations/generate/reportGenerateResults.ts
|
|
976345
976642
|
init_lib4();
|
|
976346
976643
|
var import_fs41 = require("fs");
|
|
976347
|
-
var
|
|
976644
|
+
var import_promises169 = require("fs/promises");
|
|
976348
976645
|
var JSON_SCHEMA_VERSION = 1;
|
|
976349
976646
|
function renderStdoutSummary(results) {
|
|
976350
976647
|
return formatCounts(countResults(results));
|
|
@@ -976534,12 +976831,12 @@ async function writeResults({
|
|
|
976534
976831
|
const stepSummaryPath = getGithubStepSummaryPath();
|
|
976535
976832
|
if (stepSummaryPath != null) {
|
|
976536
976833
|
try {
|
|
976537
|
-
await (0,
|
|
976834
|
+
await (0, import_promises169.appendFile)(stepSummaryPath, renderMarkdownSummary(results), "utf8");
|
|
976538
976835
|
} catch {
|
|
976539
976836
|
}
|
|
976540
976837
|
}
|
|
976541
976838
|
if (jsonOutputPath != null) {
|
|
976542
|
-
await (0,
|
|
976839
|
+
await (0, import_promises169.writeFile)(jsonOutputPath, JSON.stringify(renderJsonSummary(results), null, 2), "utf8");
|
|
976543
976840
|
}
|
|
976544
976841
|
}
|
|
976545
976842
|
function writeResultsSync({
|
|
@@ -976866,7 +977163,7 @@ function listPreviewGroups({
|
|
|
976866
977163
|
init_lib19();
|
|
976867
977164
|
init_lib6();
|
|
976868
977165
|
init_source();
|
|
976869
|
-
var
|
|
977166
|
+
var import_promises199 = require("fs/promises");
|
|
976870
977167
|
|
|
976871
977168
|
// ../cli-migrations/lib/runMigrations.js
|
|
976872
977169
|
init_lib4();
|
|
@@ -976877,7 +977174,7 @@ init_source();
|
|
|
976877
977174
|
init_lib27();
|
|
976878
977175
|
|
|
976879
977176
|
// ../cli-migrations/lib/migrations/0.0.191/discriminant/migration.js
|
|
976880
|
-
var
|
|
977177
|
+
var import_promises170 = require("fs/promises");
|
|
976881
977178
|
|
|
976882
977179
|
// ../cli-migrations/lib/migrations/0.0.191/discriminant/getAllYamlFiles.js
|
|
976883
977180
|
init_lib8();
|
|
@@ -976914,7 +977211,7 @@ var migration = {
|
|
|
976914
977211
|
try {
|
|
976915
977212
|
const fileContents = await getFileContents(yamlFilepath);
|
|
976916
977213
|
const newContents = addDiscriminantToFile(fileContents);
|
|
976917
|
-
await (0,
|
|
977214
|
+
await (0, import_promises170.writeFile)(yamlFilepath, newContents);
|
|
976918
977215
|
} catch (error50) {
|
|
976919
977216
|
context3.failAndThrow("Failed to migrate " + yamlFilepath, error50);
|
|
976920
977217
|
}
|
|
@@ -976922,7 +977219,7 @@ var migration = {
|
|
|
976922
977219
|
}
|
|
976923
977220
|
};
|
|
976924
977221
|
async function getFileContents(filepath) {
|
|
976925
|
-
const buffer = await (0,
|
|
977222
|
+
const buffer = await (0, import_promises170.readFile)(filepath);
|
|
976926
977223
|
return buffer.toString();
|
|
976927
977224
|
}
|
|
976928
977225
|
var UNION_REGEX = /^(\s{2,})union:\s*$/gm;
|
|
@@ -976951,7 +977248,7 @@ var versionMigrations = {
|
|
|
976951
977248
|
var __default = versionMigrations;
|
|
976952
977249
|
|
|
976953
977250
|
// ../cli-migrations/lib/migrations/0.0.203/union-single-property-key/migration.js
|
|
976954
|
-
var
|
|
977251
|
+
var import_promises171 = require("fs/promises");
|
|
976955
977252
|
var import_yaml7 = __toESM(require_dist11(), 1);
|
|
976956
977253
|
|
|
976957
977254
|
// ../cli-migrations/lib/migrations/0.0.203/union-single-property-key/getAllYamlFiles.js
|
|
@@ -976995,7 +977292,7 @@ var migration2 = {
|
|
|
976995
977292
|
}
|
|
976996
977293
|
};
|
|
976997
977294
|
async function migrateFile(filepath, context3) {
|
|
976998
|
-
const contents = await (0,
|
|
977295
|
+
const contents = await (0, import_promises171.readFile)(filepath);
|
|
976999
977296
|
const parsedDocument = import_yaml7.default.parseDocument(contents.toString());
|
|
977000
977297
|
const types4 = parsedDocument.get("types");
|
|
977001
977298
|
if (types4 == null) {
|
|
@@ -977027,7 +977324,7 @@ async function migrateFile(filepath, context3) {
|
|
|
977027
977324
|
}
|
|
977028
977325
|
}
|
|
977029
977326
|
}
|
|
977030
|
-
await (0,
|
|
977327
|
+
await (0, import_promises171.writeFile)(filepath, parsedDocument.toString());
|
|
977031
977328
|
}
|
|
977032
977329
|
|
|
977033
977330
|
// ../cli-migrations/lib/migrations/0.0.203/index.js
|
|
@@ -977038,7 +977335,7 @@ var versionMigrations2 = {
|
|
|
977038
977335
|
var __default2 = versionMigrations2;
|
|
977039
977336
|
|
|
977040
977337
|
// ../cli-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/migration.js
|
|
977041
|
-
var
|
|
977338
|
+
var import_promises172 = require("fs/promises");
|
|
977042
977339
|
var import_yaml8 = __toESM(require_dist11(), 1);
|
|
977043
977340
|
|
|
977044
977341
|
// ../cli-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/getAllGeneratorYamlFiles.js
|
|
@@ -977082,7 +977379,7 @@ var migration3 = {
|
|
|
977082
977379
|
}
|
|
977083
977380
|
};
|
|
977084
977381
|
async function migrateGeneratorsYml(filepath, context3) {
|
|
977085
|
-
const contents = await (0,
|
|
977382
|
+
const contents = await (0, import_promises172.readFile)(filepath);
|
|
977086
977383
|
const parsedDocument = import_yaml8.default.parseDocument(contents.toString());
|
|
977087
977384
|
const draftGenerators = parsedDocument.get("draft");
|
|
977088
977385
|
if (draftGenerators == null) {
|
|
@@ -977109,7 +977406,7 @@ async function migrateGeneratorsYml(filepath, context3) {
|
|
|
977109
977406
|
draftGenerator.set("output-path", name2.value.includes("openapi") ? "./generated-openapi" : name2.value.includes("postman") ? "./generated-postman" : localOutput);
|
|
977110
977407
|
}
|
|
977111
977408
|
});
|
|
977112
|
-
await (0,
|
|
977409
|
+
await (0, import_promises172.writeFile)(filepath, parsedDocument.toString());
|
|
977113
977410
|
}
|
|
977114
977411
|
|
|
977115
977412
|
// ../cli-migrations/lib/migrations/0.0.207/index.js
|
|
@@ -977120,7 +977417,7 @@ var versionMigrations3 = {
|
|
|
977120
977417
|
var __default3 = versionMigrations3;
|
|
977121
977418
|
|
|
977122
977419
|
// ../cli-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/migration.js
|
|
977123
|
-
var
|
|
977420
|
+
var import_promises173 = require("fs/promises");
|
|
977124
977421
|
var import_yaml9 = __toESM(require_dist11(), 1);
|
|
977125
977422
|
|
|
977126
977423
|
// ../cli-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/getAllYamlFiles.js
|
|
@@ -977164,7 +977461,7 @@ var migration4 = {
|
|
|
977164
977461
|
}
|
|
977165
977462
|
};
|
|
977166
977463
|
async function migrateFile2(filepath, context3) {
|
|
977167
|
-
const contents = await (0,
|
|
977464
|
+
const contents = await (0, import_promises173.readFile)(filepath);
|
|
977168
977465
|
const parsedDocument = import_yaml9.default.parseDocument(contents.toString());
|
|
977169
977466
|
const addType = (typeName, typeDeclaration2) => {
|
|
977170
977467
|
const types4 = parsedDocument.get("types");
|
|
@@ -977208,7 +977505,7 @@ async function migrateFile2(filepath, context3) {
|
|
|
977208
977505
|
}
|
|
977209
977506
|
}
|
|
977210
977507
|
}
|
|
977211
|
-
await (0,
|
|
977508
|
+
await (0, import_promises173.writeFile)(filepath, parsedDocument.toString());
|
|
977212
977509
|
}
|
|
977213
977510
|
|
|
977214
977511
|
// ../cli-migrations/lib/migrations/0.0.210/index.js
|
|
@@ -977219,7 +977516,7 @@ var versionMigrations4 = {
|
|
|
977219
977516
|
var __default4 = versionMigrations4;
|
|
977220
977517
|
|
|
977221
977518
|
// ../cli-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/migration.js
|
|
977222
|
-
var
|
|
977519
|
+
var import_promises174 = require("fs/promises");
|
|
977223
977520
|
var import_yaml10 = __toESM(require_dist11(), 1);
|
|
977224
977521
|
|
|
977225
977522
|
// ../cli-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/getAllGeneratorYamlFiles.js
|
|
@@ -977263,7 +977560,7 @@ var migration5 = {
|
|
|
977263
977560
|
}
|
|
977264
977561
|
};
|
|
977265
977562
|
async function migrateGeneratorsYml2(filepath, context3) {
|
|
977266
|
-
const contents = await (0,
|
|
977563
|
+
const contents = await (0, import_promises174.readFile)(filepath);
|
|
977267
977564
|
const parsedDocument = import_yaml10.default.parseDocument(contents.toString());
|
|
977268
977565
|
const releaseGenerators = parsedDocument.get("release");
|
|
977269
977566
|
if (releaseGenerators == null) {
|
|
@@ -977301,7 +977598,7 @@ async function migrateGeneratorsYml2(filepath, context3) {
|
|
|
977301
977598
|
}
|
|
977302
977599
|
releaseGenerator.delete("outputs");
|
|
977303
977600
|
});
|
|
977304
|
-
await (0,
|
|
977601
|
+
await (0, import_promises174.writeFile)(filepath, parsedDocument.toString());
|
|
977305
977602
|
}
|
|
977306
977603
|
|
|
977307
977604
|
// ../cli-migrations/lib/migrations/0.0.212/index.js
|
|
@@ -977312,7 +977609,7 @@ var versionMigrations5 = {
|
|
|
977312
977609
|
var __default5 = versionMigrations5;
|
|
977313
977610
|
|
|
977314
977611
|
// ../cli-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/migration.js
|
|
977315
|
-
var
|
|
977612
|
+
var import_promises175 = require("fs/promises");
|
|
977316
977613
|
|
|
977317
977614
|
// ../cli-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/getAllYamlFiles.js
|
|
977318
977615
|
init_lib8();
|
|
@@ -977346,9 +977643,9 @@ var migration6 = {
|
|
|
977346
977643
|
run: async ({ context: context3 }) => {
|
|
977347
977644
|
const yamlFiles = await getAllYamlFiles4(context3);
|
|
977348
977645
|
for (const filepath of yamlFiles) {
|
|
977349
|
-
const contents = await (0,
|
|
977646
|
+
const contents = await (0, import_promises175.readFile)(filepath);
|
|
977350
977647
|
const newContents = contents.toString().replaceAll(" alias:", " type:");
|
|
977351
|
-
await (0,
|
|
977648
|
+
await (0, import_promises175.writeFile)(filepath, newContents);
|
|
977352
977649
|
}
|
|
977353
977650
|
}
|
|
977354
977651
|
};
|
|
@@ -977361,7 +977658,7 @@ var versionMigrations6 = {
|
|
|
977361
977658
|
var __default6 = versionMigrations6;
|
|
977362
977659
|
|
|
977363
977660
|
// ../cli-migrations/lib/migrations/0.0.221/add-error-discriminant/migration.js
|
|
977364
|
-
var
|
|
977661
|
+
var import_promises176 = require("fs/promises");
|
|
977365
977662
|
|
|
977366
977663
|
// ../cli-migrations/lib/migrations/0.0.221/add-error-discriminant/getAllRootApiYamlFiles.js
|
|
977367
977664
|
init_lib8();
|
|
@@ -977395,9 +977692,9 @@ var migration7 = {
|
|
|
977395
977692
|
run: async ({ context: context3 }) => {
|
|
977396
977693
|
const yamlFiles = await getAllRootApiYamlFiles(context3);
|
|
977397
977694
|
for (const filepath of yamlFiles) {
|
|
977398
|
-
const contents = await (0,
|
|
977695
|
+
const contents = await (0, import_promises176.readFile)(filepath);
|
|
977399
977696
|
const newContents = contents.toString() + "\nerror-discriminant: error";
|
|
977400
|
-
await (0,
|
|
977697
|
+
await (0, import_promises176.writeFile)(filepath, newContents);
|
|
977401
977698
|
}
|
|
977402
977699
|
}
|
|
977403
977700
|
};
|
|
@@ -977411,7 +977708,7 @@ var __default7 = versionMigrations7;
|
|
|
977411
977708
|
|
|
977412
977709
|
// ../cli-migrations/lib/migrations/0.0.241/add-generator-groups/migration.js
|
|
977413
977710
|
init_lib4();
|
|
977414
|
-
var
|
|
977711
|
+
var import_promises177 = require("fs/promises");
|
|
977415
977712
|
init_js_yaml();
|
|
977416
977713
|
|
|
977417
977714
|
// ../cli-migrations/lib/migrations/0.0.241/add-generator-groups/getAllGeneratorYamlFiles.js
|
|
@@ -977545,7 +977842,7 @@ var migration8 = {
|
|
|
977545
977842
|
}
|
|
977546
977843
|
};
|
|
977547
977844
|
async function migrateGeneratorsYml3(filepath) {
|
|
977548
|
-
const contentsStr = await (0,
|
|
977845
|
+
const contentsStr = await (0, import_promises177.readFile)(filepath);
|
|
977549
977846
|
const contents = index_vite_proxy_tmp_default.load(contentsStr.toString());
|
|
977550
977847
|
const oldGeneratorsConfiguration = GeneratorsConfigurationSchema2.parse(contents);
|
|
977551
977848
|
let newGeneratorsConfiguration = {};
|
|
@@ -977563,7 +977860,7 @@ async function migrateGeneratorsYml3(filepath) {
|
|
|
977563
977860
|
generators: oldGeneratorsConfiguration.release.map((releaseGeneratorInvocation) => convertReleaseGeneratorInvocation(releaseGeneratorInvocation))
|
|
977564
977861
|
};
|
|
977565
977862
|
}
|
|
977566
|
-
await (0,
|
|
977863
|
+
await (0, import_promises177.writeFile)(filepath, index_vite_proxy_tmp_default.dump(newGeneratorsConfiguration));
|
|
977567
977864
|
}
|
|
977568
977865
|
function convertDraftGeneratorInvocation(draftGeneratorInvocation) {
|
|
977569
977866
|
const newSchema = {
|
|
@@ -977638,7 +977935,7 @@ var versionMigrations8 = {
|
|
|
977638
977935
|
var __default8 = versionMigrations8;
|
|
977639
977936
|
|
|
977640
977937
|
// ../cli-migrations/lib/migrations/0.0.248/add-error-discrimination-config/migration.js
|
|
977641
|
-
var
|
|
977938
|
+
var import_promises178 = require("fs/promises");
|
|
977642
977939
|
var import_yaml11 = __toESM(require_dist11(), 1);
|
|
977643
977940
|
|
|
977644
977941
|
// ../cli-migrations/lib/migrations/0.0.248/add-error-discrimination-config/getAllRootApiYamlFiles.js
|
|
@@ -977682,7 +977979,7 @@ var migration9 = {
|
|
|
977682
977979
|
}
|
|
977683
977980
|
};
|
|
977684
977981
|
async function migrateRootApiFile(filepath) {
|
|
977685
|
-
const contents = await (0,
|
|
977982
|
+
const contents = await (0, import_promises178.readFile)(filepath);
|
|
977686
977983
|
const parsedDocument = import_yaml11.default.parseDocument(contents.toString());
|
|
977687
977984
|
const errorDiscriminant = parsedDocument.get("error-discriminant", true);
|
|
977688
977985
|
if (errorDiscriminant == null || !import_yaml11.default.isScalar(errorDiscriminant) || typeof errorDiscriminant.value !== "string") {
|
|
@@ -977693,7 +977990,7 @@ async function migrateRootApiFile(filepath) {
|
|
|
977693
977990
|
"property-name": errorDiscriminant.value
|
|
977694
977991
|
});
|
|
977695
977992
|
parsedDocument.delete("error-discriminant");
|
|
977696
|
-
await (0,
|
|
977993
|
+
await (0, import_promises178.writeFile)(filepath, parsedDocument.toString());
|
|
977697
977994
|
}
|
|
977698
977995
|
|
|
977699
977996
|
// ../cli-migrations/lib/migrations/0.0.248/index.js
|
|
@@ -977704,7 +978001,7 @@ var versionMigrations9 = {
|
|
|
977704
978001
|
var __default9 = versionMigrations9;
|
|
977705
978002
|
|
|
977706
978003
|
// ../cli-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/migration.js
|
|
977707
|
-
var
|
|
978004
|
+
var import_promises179 = require("fs/promises");
|
|
977708
978005
|
var import_yaml12 = __toESM(require_dist11(), 1);
|
|
977709
978006
|
|
|
977710
978007
|
// ../cli-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/getAllYamlFiles.js
|
|
@@ -977748,7 +978045,7 @@ var migration10 = {
|
|
|
977748
978045
|
}
|
|
977749
978046
|
};
|
|
977750
978047
|
async function migrateYamlFile(filepath, context3) {
|
|
977751
|
-
const contents = await (0,
|
|
978048
|
+
const contents = await (0, import_promises179.readFile)(filepath);
|
|
977752
978049
|
const parsedDocument = import_yaml12.default.parseDocument(contents.toString());
|
|
977753
978050
|
const services = parsedDocument.get("services");
|
|
977754
978051
|
if (services == null) {
|
|
@@ -977788,7 +978085,7 @@ async function migrateYamlFile(filepath, context3) {
|
|
|
977788
978085
|
context3.failWithoutThrowing("Failed to convert endpoint", e2);
|
|
977789
978086
|
}
|
|
977790
978087
|
}
|
|
977791
|
-
await (0,
|
|
978088
|
+
await (0, import_promises179.writeFile)(filepath, parsedDocument.toString());
|
|
977792
978089
|
}
|
|
977793
978090
|
}
|
|
977794
978091
|
function convertEndpoint4({ document: document4, endpoint: endpoint3 }) {
|
|
@@ -977867,7 +978164,7 @@ var versionMigrations10 = {
|
|
|
977867
978164
|
var __default10 = versionMigrations10;
|
|
977868
978165
|
|
|
977869
978166
|
// ../cli-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/migration.js
|
|
977870
|
-
var
|
|
978167
|
+
var import_promises180 = require("fs/promises");
|
|
977871
978168
|
var import_yaml13 = __toESM(require_dist11(), 1);
|
|
977872
978169
|
|
|
977873
978170
|
// ../cli-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/getAllYamlFiles.js
|
|
@@ -977911,7 +978208,7 @@ var migration11 = {
|
|
|
977911
978208
|
}
|
|
977912
978209
|
};
|
|
977913
978210
|
async function migrateYamlFile2(filepath, context3) {
|
|
977914
|
-
const contents = await (0,
|
|
978211
|
+
const contents = await (0, import_promises180.readFile)(filepath);
|
|
977915
978212
|
const parsedDocument = import_yaml13.default.parseDocument(contents.toString());
|
|
977916
978213
|
const types4 = parsedDocument.get("types");
|
|
977917
978214
|
if (types4 == null) {
|
|
@@ -977937,7 +978234,7 @@ async function migrateYamlFile2(filepath, context3) {
|
|
|
977937
978234
|
examples.set(i5, { value: value2 });
|
|
977938
978235
|
}
|
|
977939
978236
|
}
|
|
977940
|
-
await (0,
|
|
978237
|
+
await (0, import_promises180.writeFile)(filepath, parsedDocument.toString());
|
|
977941
978238
|
}
|
|
977942
978239
|
|
|
977943
978240
|
// ../cli-migrations/lib/migrations/0.3.0-rc12/index.js
|
|
@@ -977948,7 +978245,7 @@ var versionMigrations11 = {
|
|
|
977948
978245
|
var __default11 = versionMigrations11;
|
|
977949
978246
|
|
|
977950
978247
|
// ../cli-migrations/lib/migrations/0.3.23/change-services-key-to-service/migration.js
|
|
977951
|
-
var
|
|
978248
|
+
var import_promises181 = require("fs/promises");
|
|
977952
978249
|
var import_yaml14 = __toESM(require_dist11(), 1);
|
|
977953
978250
|
|
|
977954
978251
|
// ../cli-migrations/lib/migrations/0.3.23/change-services-key-to-service/getAllYamlFiles.js
|
|
@@ -977992,7 +978289,7 @@ var migration12 = {
|
|
|
977992
978289
|
}
|
|
977993
978290
|
};
|
|
977994
978291
|
async function migrateYamlFile3(filepath, context3) {
|
|
977995
|
-
const contents = await (0,
|
|
978292
|
+
const contents = await (0, import_promises181.readFile)(filepath);
|
|
977996
978293
|
const parsedDocument = import_yaml14.default.parseDocument(contents.toString());
|
|
977997
978294
|
if (!import_yaml14.default.isMap(parsedDocument.contents)) {
|
|
977998
978295
|
return context3.failAndThrow("File is not a map");
|
|
@@ -978022,7 +978319,7 @@ async function migrateYamlFile3(filepath, context3) {
|
|
|
978022
978319
|
pair.value = firstService.value;
|
|
978023
978320
|
}
|
|
978024
978321
|
}
|
|
978025
|
-
await (0,
|
|
978322
|
+
await (0, import_promises181.writeFile)(filepath, parsedDocument.toString());
|
|
978026
978323
|
}
|
|
978027
978324
|
|
|
978028
978325
|
// ../cli-migrations/lib/migrations/0.3.23/index.js
|
|
@@ -978033,7 +978330,7 @@ var versionMigrations12 = {
|
|
|
978033
978330
|
var __default12 = versionMigrations12;
|
|
978034
978331
|
|
|
978035
978332
|
// ../cli-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/migration.js
|
|
978036
|
-
var
|
|
978333
|
+
var import_promises182 = require("fs/promises");
|
|
978037
978334
|
var import_yaml15 = __toESM(require_dist11(), 1);
|
|
978038
978335
|
|
|
978039
978336
|
// ../cli-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/getAllYamlFiles.js
|
|
@@ -978077,7 +978374,7 @@ var migration13 = {
|
|
|
978077
978374
|
}
|
|
978078
978375
|
};
|
|
978079
978376
|
async function migrateYamlFile4(filepath, context3) {
|
|
978080
|
-
const contents = await (0,
|
|
978377
|
+
const contents = await (0, import_promises182.readFile)(filepath);
|
|
978081
978378
|
const parsedDocument = import_yaml15.default.parseDocument(contents.toString());
|
|
978082
978379
|
if (!import_yaml15.default.isMap(parsedDocument.contents)) {
|
|
978083
978380
|
return context3.failAndThrow("File is not a map");
|
|
@@ -978096,7 +978393,7 @@ async function migrateYamlFile4(filepath, context3) {
|
|
|
978096
978393
|
}
|
|
978097
978394
|
service.items.splice(indexOfServiceDocsPair, 1);
|
|
978098
978395
|
parsedDocument.contents.items.unshift(docsPair);
|
|
978099
|
-
await (0,
|
|
978396
|
+
await (0, import_promises182.writeFile)(filepath, parsedDocument.toString());
|
|
978100
978397
|
}
|
|
978101
978398
|
|
|
978102
978399
|
// ../cli-migrations/lib/migrations/0.5.4/index.js
|
|
@@ -978107,7 +978404,7 @@ var versionMigrations13 = {
|
|
|
978107
978404
|
var __default13 = versionMigrations13;
|
|
978108
978405
|
|
|
978109
978406
|
// ../cli-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/migration.js
|
|
978110
|
-
var
|
|
978407
|
+
var import_promises183 = require("fs/promises");
|
|
978111
978408
|
|
|
978112
978409
|
// ../cli-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/getAllGeneratorYamlFiles.js
|
|
978113
978410
|
init_lib8();
|
|
@@ -978150,14 +978447,14 @@ var migration14 = {
|
|
|
978150
978447
|
}
|
|
978151
978448
|
};
|
|
978152
978449
|
async function migrateYamlFile5(filepath) {
|
|
978153
|
-
const contents = await (0,
|
|
978450
|
+
const contents = await (0, import_promises183.readFile)(filepath);
|
|
978154
978451
|
const domainSuffix = process.env.DOMAIN_SUFFIX ?? "docs.buildwithfern.com";
|
|
978155
978452
|
const regex6 = /(docs:\s*domain:\s*)"([^"]*)"/g;
|
|
978156
978453
|
const updatedSnapshot = contents.toString().replace(regex6, (_match, _prefix, domain3) => {
|
|
978157
978454
|
return `docs:
|
|
978158
978455
|
domain: "${domain3}.${domainSuffix}"`;
|
|
978159
978456
|
});
|
|
978160
|
-
await (0,
|
|
978457
|
+
await (0, import_promises183.writeFile)(filepath, updatedSnapshot.toString());
|
|
978161
978458
|
}
|
|
978162
978459
|
|
|
978163
978460
|
// ../cli-migrations/lib/migrations/0.9.10/index.js
|
|
@@ -978178,11 +978475,11 @@ var LegacyDocsSerializers = __toESM(require_serialization4(), 1);
|
|
|
978178
978475
|
|
|
978179
978476
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/loadRawDocsConfiguration.js
|
|
978180
978477
|
init_lib8();
|
|
978181
|
-
var
|
|
978478
|
+
var import_promises184 = require("fs/promises");
|
|
978182
978479
|
init_js_yaml();
|
|
978183
978480
|
async function loadRawDocsConfiguration2({ absolutePathToWorkspace }) {
|
|
978184
978481
|
const filepath = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
978185
|
-
const contentsStr = await (0,
|
|
978482
|
+
const contentsStr = await (0, import_promises184.readFile)(filepath);
|
|
978186
978483
|
const contentsParsed = index_vite_proxy_tmp_default.load(contentsStr.toString());
|
|
978187
978484
|
const result = await LegacyDocsSerializers.DocsConfiguration.parse(contentsParsed);
|
|
978188
978485
|
if (result.ok) {
|
|
@@ -978201,7 +978498,7 @@ function getAbsolutePathToDocsFolder({ absolutePathToWorkspace }) {
|
|
|
978201
978498
|
|
|
978202
978499
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndMultipleAPIs.js
|
|
978203
978500
|
init_lib8();
|
|
978204
|
-
var
|
|
978501
|
+
var import_promises186 = require("fs/promises");
|
|
978205
978502
|
init_js_yaml();
|
|
978206
978503
|
|
|
978207
978504
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/convertLegacyDocsConfig.js
|
|
@@ -978410,11 +978707,11 @@ __export(legacy_exports, {
|
|
|
978410
978707
|
|
|
978411
978708
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/generators-configuration/loadRawGeneratorsConfiguration.js
|
|
978412
978709
|
init_lib8();
|
|
978413
|
-
var
|
|
978710
|
+
var import_promises185 = require("fs/promises");
|
|
978414
978711
|
init_js_yaml();
|
|
978415
978712
|
async function loadRawGeneratorsConfiguration2({ absolutePathToWorkspace }) {
|
|
978416
978713
|
const filepath = getAbsolutePathToGeneratorsConfiguration({ absolutePathToWorkspace });
|
|
978417
|
-
const contentsStr = await (0,
|
|
978714
|
+
const contentsStr = await (0, import_promises185.readFile)(filepath);
|
|
978418
978715
|
const contentsParsed = index_vite_proxy_tmp_default.load(contentsStr.toString());
|
|
978419
978716
|
const result = await legacy_exports.GeneratorsConfigurationSchema.safeParseAsync(contentsParsed);
|
|
978420
978717
|
if (result.success) {
|
|
@@ -978444,7 +978741,7 @@ function migrateDocsInstances(docsURLs) {
|
|
|
978444
978741
|
var APIS_DIRECTORY2 = "apis";
|
|
978445
978742
|
async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspaces, workspaceContainingDocs }) {
|
|
978446
978743
|
const absolutePathToApisDirectory = join8(absolutePathToFernDirectory, RelativeFilePath2.of(APIS_DIRECTORY2));
|
|
978447
|
-
await (0,
|
|
978744
|
+
await (0, import_promises186.mkdir)(absolutePathToApisDirectory);
|
|
978448
978745
|
for (const workspace of workspaces) {
|
|
978449
978746
|
const absolutePathToWorkspace = join8(absolutePathToFernDirectory, RelativeFilePath2.of(workspace));
|
|
978450
978747
|
const docsURLs = await migrateAndWriteGeneratorsYml({ absolutePathToWorkspace });
|
|
@@ -978452,11 +978749,11 @@ async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspa
|
|
|
978452
978749
|
await migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName: workspaceContainingDocs });
|
|
978453
978750
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
978454
978751
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
978455
|
-
await (0,
|
|
978752
|
+
await (0, import_promises186.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
978456
978753
|
}
|
|
978457
978754
|
const absolutePathToNestedWorkspace = join8(absolutePathToApisDirectory, RelativeFilePath2.of(workspace));
|
|
978458
978755
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
978459
|
-
await (0,
|
|
978756
|
+
await (0, import_promises186.rm)(absolutePathToWorkspace, { recursive: true });
|
|
978460
978757
|
}
|
|
978461
978758
|
}
|
|
978462
978759
|
async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
@@ -978469,7 +978766,7 @@ async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
|
978469
978766
|
generatorsConfiguration,
|
|
978470
978767
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
978471
978768
|
});
|
|
978472
|
-
await (0,
|
|
978769
|
+
await (0, import_promises186.writeFile)(absolutePathToGeneratorsConfiguration, index_vite_proxy_tmp_default.dump(convertedResponse.value));
|
|
978473
978770
|
return convertedResponse.docsURLs;
|
|
978474
978771
|
}
|
|
978475
978772
|
async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName }) {
|
|
@@ -978483,12 +978780,12 @@ async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiNa
|
|
|
978483
978780
|
apiName
|
|
978484
978781
|
});
|
|
978485
978782
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
978486
|
-
await (0,
|
|
978783
|
+
await (0, import_promises186.writeFile)(absolutePathToDocsConfig, index_vite_proxy_tmp_default.dump(convertedDocsConfig));
|
|
978487
978784
|
}
|
|
978488
978785
|
|
|
978489
978786
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndSingleAPI.js
|
|
978490
978787
|
init_lib8();
|
|
978491
|
-
var
|
|
978788
|
+
var import_promises187 = require("fs/promises");
|
|
978492
978789
|
init_js_yaml();
|
|
978493
978790
|
async function migrateDocsAndSingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
978494
978791
|
const docsURLs = await migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace });
|
|
@@ -978496,8 +978793,8 @@ async function migrateDocsAndSingleAPI({ absolutePathToFernDirectory, absolutePa
|
|
|
978496
978793
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
978497
978794
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
978498
978795
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
978499
|
-
await (0,
|
|
978500
|
-
await (0,
|
|
978796
|
+
await (0, import_promises187.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
978797
|
+
await (0, import_promises187.rm)(absolutePathToWorkspace, { recursive: true });
|
|
978501
978798
|
}
|
|
978502
978799
|
async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
978503
978800
|
const docsConfiguration = await loadRawDocsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -978510,7 +978807,7 @@ async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
|
978510
978807
|
apiName: void 0
|
|
978511
978808
|
});
|
|
978512
978809
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
978513
|
-
await (0,
|
|
978810
|
+
await (0, import_promises187.writeFile)(absolutePathToDocsConfig, index_vite_proxy_tmp_default.dump(convertedDocsConfig));
|
|
978514
978811
|
}
|
|
978515
978812
|
async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
978516
978813
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -978522,24 +978819,24 @@ async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
|
978522
978819
|
generatorsConfiguration,
|
|
978523
978820
|
pathModificationStrategy: "MoveUp"
|
|
978524
978821
|
});
|
|
978525
|
-
await (0,
|
|
978822
|
+
await (0, import_promises187.writeFile)(absolutePathToGeneratorsConfiguration, index_vite_proxy_tmp_default.dump(convertedResponse.value));
|
|
978526
978823
|
return convertedResponse.docsURLs;
|
|
978527
978824
|
}
|
|
978528
978825
|
|
|
978529
978826
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlyMultipleAPIs.js
|
|
978530
978827
|
init_lib8();
|
|
978531
|
-
var
|
|
978828
|
+
var import_promises188 = require("fs/promises");
|
|
978532
978829
|
init_js_yaml();
|
|
978533
978830
|
var APIS_DIRECTORY3 = "apis";
|
|
978534
978831
|
async function migrateOnlyMultipleAPIs({ absolutePathToFernDirectory, workspaces }) {
|
|
978535
978832
|
const absolutePathToApisDirectory = join8(absolutePathToFernDirectory, RelativeFilePath2.of(APIS_DIRECTORY3));
|
|
978536
|
-
await (0,
|
|
978833
|
+
await (0, import_promises188.mkdir)(absolutePathToApisDirectory);
|
|
978537
978834
|
for (const workspace of workspaces) {
|
|
978538
978835
|
const absolutePathToWorkspace = join8(absolutePathToFernDirectory, RelativeFilePath2.of(workspace));
|
|
978539
978836
|
await migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace });
|
|
978540
978837
|
const absolutePathToNestedWorkspace = join8(absolutePathToApisDirectory, RelativeFilePath2.of(workspace));
|
|
978541
978838
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
978542
|
-
await (0,
|
|
978839
|
+
await (0, import_promises188.rm)(absolutePathToWorkspace, { recursive: true });
|
|
978543
978840
|
}
|
|
978544
978841
|
}
|
|
978545
978842
|
async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
@@ -978552,17 +978849,17 @@ async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
|
978552
978849
|
generatorsConfiguration,
|
|
978553
978850
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
978554
978851
|
});
|
|
978555
|
-
await (0,
|
|
978852
|
+
await (0, import_promises188.writeFile)(absolutePathToGeneratorsConfiguration, index_vite_proxy_tmp_default.dump(convertedResponse.value));
|
|
978556
978853
|
}
|
|
978557
978854
|
|
|
978558
978855
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlySingleAPI.js
|
|
978559
978856
|
init_lib8();
|
|
978560
|
-
var
|
|
978857
|
+
var import_promises189 = require("fs/promises");
|
|
978561
978858
|
init_js_yaml();
|
|
978562
978859
|
async function migrateOnlySingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
978563
978860
|
await migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace });
|
|
978564
978861
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
978565
|
-
await (0,
|
|
978862
|
+
await (0, import_promises189.rm)(absolutePathToWorkspace, { recursive: true });
|
|
978566
978863
|
}
|
|
978567
978864
|
async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
978568
978865
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -978574,7 +978871,7 @@ async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
|
978574
978871
|
generatorsConfiguration,
|
|
978575
978872
|
pathModificationStrategy: "MoveUp"
|
|
978576
978873
|
});
|
|
978577
|
-
await (0,
|
|
978874
|
+
await (0, import_promises189.writeFile)(absolutePathToGeneratorsConfiguration, index_vite_proxy_tmp_default.dump(convertedResponse.value));
|
|
978578
978875
|
}
|
|
978579
978876
|
|
|
978580
978877
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migration.js
|
|
@@ -978654,7 +978951,7 @@ var __default15 = versionMigrations15;
|
|
|
978654
978951
|
init_lib19();
|
|
978655
978952
|
init_lib8();
|
|
978656
978953
|
init_source();
|
|
978657
|
-
var
|
|
978954
|
+
var import_promises190 = require("fs/promises");
|
|
978658
978955
|
init_js_yaml();
|
|
978659
978956
|
var import_yaml16 = __toESM(require_dist11(), 1);
|
|
978660
978957
|
var migration16 = {
|
|
@@ -978698,7 +978995,7 @@ async function addApiConfigurationToSingleWorkspace({ absolutePathToFernDirector
|
|
|
978698
978995
|
if (existingGeneratorsYml == null) {
|
|
978699
978996
|
if (openapiDirectory != null && openapiDirectory.contents[0] != null) {
|
|
978700
978997
|
const absolutePathToGeneratorsYml = join8(absoluteFilepathToWorkspace, RelativeFilePath2.of("generators.yml"));
|
|
978701
|
-
await (0,
|
|
978998
|
+
await (0, import_promises190.writeFile)(absolutePathToGeneratorsYml, index_vite_proxy_tmp_default.dump({
|
|
978702
978999
|
api: {
|
|
978703
979000
|
path: join8(relativize(absolutePathToFernDirectory, absoluteFilepathToWorkspace), RelativeFilePath2.of(openapiDirectory.name), RelativeFilePath2.of(openapiDirectory.contents[0]?.name))
|
|
978704
979001
|
}
|
|
@@ -978713,7 +979010,7 @@ async function addApiConfigurationToSingleWorkspace({ absolutePathToFernDirector
|
|
|
978713
979010
|
parsedDocument.set("api", {
|
|
978714
979011
|
path: join8(relativize(absolutePathToFernDirectory, absoluteFilepathToWorkspace), RelativeFilePath2.of(openapiDirectory.name), RelativeFilePath2.of(openapiDirectory.contents[0]?.name))
|
|
978715
979012
|
});
|
|
978716
|
-
await (0,
|
|
979013
|
+
await (0, import_promises190.writeFile)(existingGeneratorsYml.absolutePath, parsedDocument.toString());
|
|
978717
979014
|
context3.logger.info(source_default.green(`Updated ${existingGeneratorsYml.absolutePath}`));
|
|
978718
979015
|
}
|
|
978719
979016
|
}
|
|
@@ -978743,7 +979040,7 @@ var __default16 = versionMigrations16;
|
|
|
978743
979040
|
init_lib19();
|
|
978744
979041
|
init_lib8();
|
|
978745
979042
|
init_source();
|
|
978746
|
-
var
|
|
979043
|
+
var import_promises191 = require("fs/promises");
|
|
978747
979044
|
init_js_yaml();
|
|
978748
979045
|
var import_yaml17 = __toESM(require_dist11(), 1);
|
|
978749
979046
|
var migration17 = {
|
|
@@ -978924,7 +979221,7 @@ async function addApiConfigurationToSingleWorkspace2({ absoluteFilepathToWorkspa
|
|
|
978924
979221
|
if (schemaComment && documentToWrite.indexOf(schemaComment) === -1) {
|
|
978925
979222
|
documentToWrite = `${schemaComment}${documentToWrite}`;
|
|
978926
979223
|
}
|
|
978927
|
-
await (0,
|
|
979224
|
+
await (0, import_promises191.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
978928
979225
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
978929
979226
|
}
|
|
978930
979227
|
async function parseApiSpec({ oldSpec, absoluteFilepathToWorkspace, files, directories, context: context3, namespace }) {
|
|
@@ -978971,7 +979268,7 @@ async function parseApiSpec({ oldSpec, absoluteFilepathToWorkspace, files, direc
|
|
|
978971
979268
|
}
|
|
978972
979269
|
let specContent;
|
|
978973
979270
|
try {
|
|
978974
|
-
const fileContents = await (0,
|
|
979271
|
+
const fileContents = await (0, import_promises191.readFile)(absoluteSpecPath, { encoding: "utf-8" });
|
|
978975
979272
|
specContent = index_vite_proxy_tmp_default.load(fileContents);
|
|
978976
979273
|
} catch (e2) {
|
|
978977
979274
|
context3.logger.warn(`Failed to read API spec file ${spec.path}. Error: ${e2}. Skipping...`);
|
|
@@ -979077,7 +979374,7 @@ var __default17 = versionMigrations17;
|
|
|
979077
979374
|
init_lib19();
|
|
979078
979375
|
init_lib8();
|
|
979079
979376
|
init_source();
|
|
979080
|
-
var
|
|
979377
|
+
var import_promises192 = require("fs/promises");
|
|
979081
979378
|
init_js_yaml();
|
|
979082
979379
|
var migration18 = {
|
|
979083
979380
|
name: "add-path-parameter-order-setting",
|
|
@@ -979166,7 +979463,7 @@ async function updateGeneratorsYml({ context: context3, files }) {
|
|
|
979166
979463
|
documentToWrite = `${schemaComment}
|
|
979167
979464
|
${documentToWrite}`;
|
|
979168
979465
|
}
|
|
979169
|
-
await (0,
|
|
979466
|
+
await (0, import_promises192.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
979170
979467
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
979171
979468
|
}
|
|
979172
979469
|
async function getFilesAndDirectories3(absoluteFilepath) {
|
|
@@ -979205,7 +979502,7 @@ var __default18 = versionMigrations18;
|
|
|
979205
979502
|
init_lib19();
|
|
979206
979503
|
init_lib8();
|
|
979207
979504
|
init_source();
|
|
979208
|
-
var
|
|
979505
|
+
var import_promises193 = require("fs/promises");
|
|
979209
979506
|
init_js_yaml();
|
|
979210
979507
|
var migration19 = {
|
|
979211
979508
|
name: "update-1_0_0-defaults",
|
|
@@ -979381,7 +979678,7 @@ async function updateGeneratorsYml2({ context: context3, files }) {
|
|
|
979381
979678
|
documentToWrite = `${schemaComment}
|
|
979382
979679
|
${documentToWrite}`;
|
|
979383
979680
|
}
|
|
979384
|
-
await (0,
|
|
979681
|
+
await (0, import_promises193.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
979385
979682
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
979386
979683
|
}
|
|
979387
979684
|
async function getFilesAndDirectories4(absoluteFilepath) {
|
|
@@ -979453,7 +979750,7 @@ var __default19 = versionMigrations19;
|
|
|
979453
979750
|
init_lib19();
|
|
979454
979751
|
init_lib8();
|
|
979455
979752
|
init_source();
|
|
979456
|
-
var
|
|
979753
|
+
var import_promises194 = require("fs/promises");
|
|
979457
979754
|
init_js_yaml();
|
|
979458
979755
|
var migration20 = {
|
|
979459
979756
|
name: "update-2_0_0-defaults",
|
|
@@ -979629,7 +979926,7 @@ async function updateGeneratorsYml3({ context: context3, files }) {
|
|
|
979629
979926
|
documentToWrite = `${schemaComment}
|
|
979630
979927
|
${documentToWrite}`;
|
|
979631
979928
|
}
|
|
979632
|
-
await (0,
|
|
979929
|
+
await (0, import_promises194.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
979633
979930
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
979634
979931
|
}
|
|
979635
979932
|
async function getFilesAndDirectories5(absoluteFilepath) {
|
|
@@ -979678,7 +979975,7 @@ var __default20 = versionMigrations20;
|
|
|
979678
979975
|
init_lib19();
|
|
979679
979976
|
init_lib8();
|
|
979680
979977
|
init_source();
|
|
979681
|
-
var
|
|
979978
|
+
var import_promises195 = require("fs/promises");
|
|
979682
979979
|
init_js_yaml();
|
|
979683
979980
|
var migration21 = {
|
|
979684
979981
|
name: "migrate-deprecated-generator-api-settings",
|
|
@@ -979770,7 +980067,7 @@ async function updateGeneratorsYml4({ context: context3, files }) {
|
|
|
979770
980067
|
documentToWrite = `${schemaComment}
|
|
979771
980068
|
${documentToWrite}`;
|
|
979772
980069
|
}
|
|
979773
|
-
await (0,
|
|
980070
|
+
await (0, import_promises195.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
979774
980071
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
979775
980072
|
}
|
|
979776
980073
|
function migrateDeprecatedSettings(settings, context3) {
|
|
@@ -979819,7 +980116,7 @@ var __default21 = versionMigrations21;
|
|
|
979819
980116
|
init_lib19();
|
|
979820
980117
|
init_lib8();
|
|
979821
980118
|
init_source();
|
|
979822
|
-
var
|
|
980119
|
+
var import_promises196 = require("fs/promises");
|
|
979823
980120
|
init_js_yaml();
|
|
979824
980121
|
var migration22 = {
|
|
979825
980122
|
name: "enable-smart-casing",
|
|
@@ -979904,7 +980201,7 @@ async function updateGeneratorsYml5({ context: context3, files }) {
|
|
|
979904
980201
|
documentToWrite = `${schemaComment}
|
|
979905
980202
|
${documentToWrite}`;
|
|
979906
980203
|
}
|
|
979907
|
-
await (0,
|
|
980204
|
+
await (0, import_promises196.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
979908
980205
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
979909
980206
|
}
|
|
979910
980207
|
function setSmartCasingFalseIfNotConfigured(generator, context3) {
|
|
@@ -979944,7 +980241,7 @@ var __default22 = versionMigrations22;
|
|
|
979944
980241
|
init_lib19();
|
|
979945
980242
|
init_lib8();
|
|
979946
980243
|
init_source();
|
|
979947
|
-
var
|
|
980244
|
+
var import_promises197 = require("fs/promises");
|
|
979948
980245
|
init_js_yaml();
|
|
979949
980246
|
var migration23 = {
|
|
979950
980247
|
name: "disable-disambiguate-request-names",
|
|
@@ -980069,7 +980366,7 @@ async function updateGeneratorsYml6({ context: context3, files }) {
|
|
|
980069
980366
|
documentToWrite = `${schemaComment}
|
|
980070
980367
|
${documentToWrite}`;
|
|
980071
980368
|
}
|
|
980072
|
-
await (0,
|
|
980369
|
+
await (0, import_promises197.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
980073
980370
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
980074
980371
|
}
|
|
980075
980372
|
async function getFilesAndDirectories8(absoluteFilepath) {
|
|
@@ -980204,7 +980501,7 @@ init_lib33();
|
|
|
980204
980501
|
init_lib27();
|
|
980205
980502
|
init_lib6();
|
|
980206
980503
|
init_source();
|
|
980207
|
-
var
|
|
980504
|
+
var import_promises198 = require("fs/promises");
|
|
980208
980505
|
|
|
980209
980506
|
// ../../../node_modules/.pnpm/immer@10.2.0/node_modules/immer/dist/immer.mjs
|
|
980210
980507
|
var NOTHING = /* @__PURE__ */ Symbol.for("immer-nothing");
|
|
@@ -981608,7 +981905,7 @@ async function upgrade({
|
|
|
981608
981905
|
const newProjectConfig = produce(projectConfig2.rawConfig, (draft) => {
|
|
981609
981906
|
draft.version = resolvedTargetVersion;
|
|
981610
981907
|
});
|
|
981611
|
-
await (0,
|
|
981908
|
+
await (0, import_promises198.writeFile)(
|
|
981612
981909
|
projectConfig2._absolutePath,
|
|
981613
981910
|
ensureFinalNewline(JSON.stringify(newProjectConfig, void 0, 2))
|
|
981614
981911
|
);
|
|
@@ -981815,7 +982112,7 @@ async function upgradeGeneratorsForAllWorkspaces({
|
|
|
981815
982112
|
absolutePathToWorkspace: workspace.absoluteFilePath
|
|
981816
982113
|
});
|
|
981817
982114
|
if (absolutePathToGeneratorsConfiguration != null && result.updatedConfiguration != null) {
|
|
981818
|
-
await (0,
|
|
982115
|
+
await (0, import_promises199.writeFile)(absolutePathToGeneratorsConfiguration, result.updatedConfiguration);
|
|
981819
982116
|
}
|
|
981820
982117
|
for (const upgrade2 of result.appliedUpgrades) {
|
|
981821
982118
|
const normalizedName = addDefaultDockerOrgIfNotPresent(upgrade2.generatorName);
|
|
@@ -982293,7 +982590,7 @@ async function previewDocsWorkspace({
|
|
|
982293
982590
|
// src/commands/docs-diff/docsDiff.ts
|
|
982294
982591
|
init_lib8();
|
|
982295
982592
|
init_lib6();
|
|
982296
|
-
var
|
|
982593
|
+
var import_promises200 = require("fs/promises");
|
|
982297
982594
|
var import_pngjs2 = __toESM(require_png(), 1);
|
|
982298
982595
|
async function getSlugForFiles2({
|
|
982299
982596
|
previewUrl,
|
|
@@ -982516,8 +982813,8 @@ async function generateComparisons2({
|
|
|
982516
982813
|
afterPath,
|
|
982517
982814
|
comparisonBasePath
|
|
982518
982815
|
}) {
|
|
982519
|
-
const beforePng = import_pngjs2.PNG.sync.read(await (0,
|
|
982520
|
-
const afterPng = import_pngjs2.PNG.sync.read(await (0,
|
|
982816
|
+
const beforePng = import_pngjs2.PNG.sync.read(await (0, import_promises200.readFile)(beforePath));
|
|
982817
|
+
const afterPng = import_pngjs2.PNG.sync.read(await (0, import_promises200.readFile)(afterPath));
|
|
982521
982818
|
const beforeOriginalHeight = beforePng.height;
|
|
982522
982819
|
const afterOriginalHeight = afterPng.height;
|
|
982523
982820
|
const width = Math.max(beforePng.width, afterPng.width);
|
|
@@ -982555,7 +982852,7 @@ async function generateComparisons2({
|
|
|
982555
982852
|
const sideBySide = createSideBySideComparison2(croppedBefore, croppedAfter, 20, true);
|
|
982556
982853
|
const outPath = `${base4}-region-${i5 + 1}.png`;
|
|
982557
982854
|
const pngBuffer = import_pngjs2.PNG.sync.write(sideBySide);
|
|
982558
|
-
await (0,
|
|
982855
|
+
await (0, import_promises200.writeFile)(outPath, new Uint8Array(pngBuffer));
|
|
982559
982856
|
results.push({ changePercent, boundingBox, comparisonPath: outPath });
|
|
982560
982857
|
}
|
|
982561
982858
|
return results;
|
|
@@ -982634,7 +982931,7 @@ async function docsDiff({
|
|
|
982634
982931
|
outputDir.startsWith("/") ? outputDir : join8(cwd(), RelativeFilePath2.of(outputDir))
|
|
982635
982932
|
);
|
|
982636
982933
|
if (!await doesPathExist(outputPath)) {
|
|
982637
|
-
await (0,
|
|
982934
|
+
await (0, import_promises200.mkdir)(outputPath, { recursive: true });
|
|
982638
982935
|
}
|
|
982639
982936
|
const results = [];
|
|
982640
982937
|
await cliContext.runTask(async (context3) => {
|
|
@@ -983036,7 +983333,7 @@ init_lib6();
|
|
|
983036
983333
|
// src/commands/docs-theme/ThemeExporter.ts
|
|
983037
983334
|
init_lib12();
|
|
983038
983335
|
init_lib8();
|
|
983039
|
-
var
|
|
983336
|
+
var import_promises201 = require("fs/promises");
|
|
983040
983337
|
init_js_yaml();
|
|
983041
983338
|
var import_path110 = __toESM(require("path"), 1);
|
|
983042
983339
|
var ThemeExporter = class {
|
|
@@ -983049,18 +983346,18 @@ var ThemeExporter = class {
|
|
|
983049
983346
|
const docsDir = import_path110.default.dirname(docsYmlPath);
|
|
983050
983347
|
const outDir = output2 != null ? import_path110.default.resolve(process.cwd(), output2) : import_path110.default.join(this.docsWorkspace.absoluteFilePath, "theme");
|
|
983051
983348
|
context3.logger.info(`Exporting theme-eligible fields from docs.yml \u2192 ${outDir}`);
|
|
983052
|
-
const raw = index_vite_proxy_tmp_default.load(await (0,
|
|
983349
|
+
const raw = index_vite_proxy_tmp_default.load(await (0, import_promises201.readFile)(docsYmlPath, "utf-8"));
|
|
983053
983350
|
const themeConfig = {};
|
|
983054
983351
|
for (const [k4, v3] of Object.entries(raw)) {
|
|
983055
983352
|
if (docs_yml_exports.THEME_ELIGIBLE_YAML_KEYS.has(k4)) {
|
|
983056
983353
|
themeConfig[k4] = v3;
|
|
983057
983354
|
}
|
|
983058
983355
|
}
|
|
983059
|
-
await (0,
|
|
983356
|
+
await (0, import_promises201.mkdir)(outDir, { recursive: true });
|
|
983060
983357
|
const assetsDir = import_path110.default.join(outDir, "assets");
|
|
983061
|
-
await (0,
|
|
983358
|
+
await (0, import_promises201.mkdir)(assetsDir, { recursive: true });
|
|
983062
983359
|
const exported = await copyLocalFiles(themeConfig, docsDir, assetsDir);
|
|
983063
|
-
await (0,
|
|
983360
|
+
await (0, import_promises201.writeFile)(import_path110.default.join(outDir, "theme.yml"), index_vite_proxy_tmp_default.dump(exported), "utf-8");
|
|
983064
983361
|
context3.logger.info(`Theme exported to ${outDir}/theme.yml`);
|
|
983065
983362
|
}
|
|
983066
983363
|
};
|
|
@@ -983074,8 +983371,8 @@ async function copyLocalFiles(obj, sourceDir, assetsDir) {
|
|
|
983074
983371
|
const destRelative = relFromSource.startsWith("..") ? relFromProject.startsWith("..") ? import_path110.default.basename(abs) : relFromProject : relFromSource;
|
|
983075
983372
|
const dest = import_path110.default.join(assetsDir, destRelative);
|
|
983076
983373
|
try {
|
|
983077
|
-
await (0,
|
|
983078
|
-
await (0,
|
|
983374
|
+
await (0, import_promises201.mkdir)(import_path110.default.dirname(dest), { recursive: true });
|
|
983375
|
+
await (0, import_promises201.copyFile)(abs, dest);
|
|
983079
983376
|
return `./assets/${destRelative.split(import_path110.default.sep).join("/")}`;
|
|
983080
983377
|
} catch {
|
|
983081
983378
|
return obj;
|
|
@@ -983167,7 +983464,7 @@ async function listDocsThemes({
|
|
|
983167
983464
|
|
|
983168
983465
|
// src/commands/docs-theme/uploadDocsTheme.ts
|
|
983169
983466
|
init_lib6();
|
|
983170
|
-
var
|
|
983467
|
+
var import_promises203 = require("fs/promises");
|
|
983171
983468
|
init_js_yaml();
|
|
983172
983469
|
var import_path112 = __toESM(require("path"), 1);
|
|
983173
983470
|
|
|
@@ -983176,7 +983473,7 @@ init_lib8();
|
|
|
983176
983473
|
init_lib6();
|
|
983177
983474
|
var import_child_process13 = require("child_process");
|
|
983178
983475
|
var import_crypto10 = require("crypto");
|
|
983179
|
-
var
|
|
983476
|
+
var import_promises202 = require("fs/promises");
|
|
983180
983477
|
var import_mime_types2 = __toESM(require_mime_types(), 1);
|
|
983181
983478
|
var import_path111 = __toESM(require("path"), 1);
|
|
983182
983479
|
function getGitRoot() {
|
|
@@ -983220,7 +983517,7 @@ var ThemeConfigProcessor = class {
|
|
|
983220
983517
|
filePaths.map(async (filePath) => {
|
|
983221
983518
|
const abs = import_path111.default.resolve(this.themeDir, filePath);
|
|
983222
983519
|
try {
|
|
983223
|
-
await (0,
|
|
983520
|
+
await (0, import_promises202.access)(abs);
|
|
983224
983521
|
} catch {
|
|
983225
983522
|
errors4.push(`Referenced file not found: ${abs}`);
|
|
983226
983523
|
}
|
|
@@ -983385,7 +983682,7 @@ ${errors4.map((e2) => ` - ${e2}`).join("\n")}`,
|
|
|
983385
983682
|
return { config: cfg, filesUploaded };
|
|
983386
983683
|
}
|
|
983387
983684
|
async uploadFileToCas(absolutePath) {
|
|
983388
|
-
const content5 = await (0,
|
|
983685
|
+
const content5 = await (0, import_promises202.readFile)(absolutePath);
|
|
983389
983686
|
const contentType = import_mime_types2.default.lookup(absolutePath) || "application/octet-stream";
|
|
983390
983687
|
const bindPath = posixBindPath(this.gitRoot, absolutePath);
|
|
983391
983688
|
return this.uploadToCas(content5, contentType, bindPath, import_path111.default.basename(absolutePath));
|
|
@@ -983500,7 +983797,7 @@ async function uploadDocsTheme({
|
|
|
983500
983797
|
await cliContext.runTask(async (context3) => {
|
|
983501
983798
|
let rawYaml;
|
|
983502
983799
|
try {
|
|
983503
|
-
const content5 = await (0,
|
|
983800
|
+
const content5 = await (0, import_promises203.readFile)(themeYmlPath, "utf-8");
|
|
983504
983801
|
rawYaml = index_vite_proxy_tmp_default.load(content5, { schema: index_vite_proxy_tmp_default.JSON_SCHEMA });
|
|
983505
983802
|
} catch {
|
|
983506
983803
|
context3.failAndThrow(
|
|
@@ -983555,7 +983852,7 @@ async function uploadDocsTheme({
|
|
|
983555
983852
|
// src/commands/downgrade/downgrade.ts
|
|
983556
983853
|
init_lib19();
|
|
983557
983854
|
init_lib6();
|
|
983558
|
-
var
|
|
983855
|
+
var import_promises204 = require("fs/promises");
|
|
983559
983856
|
function ensureFinalNewline2(content5) {
|
|
983560
983857
|
return content5.endsWith("\n") ? content5 : content5 + "\n";
|
|
983561
983858
|
}
|
|
@@ -983580,7 +983877,7 @@ async function downgrade({
|
|
|
983580
983877
|
const newProjectConfig = produce(projectConfig.rawConfig, (draft) => {
|
|
983581
983878
|
draft.version = targetVersion;
|
|
983582
983879
|
});
|
|
983583
|
-
await (0,
|
|
983880
|
+
await (0, import_promises204.writeFile)(projectConfig._absolutePath, ensureFinalNewline2(JSON.stringify(newProjectConfig, void 0, 2)));
|
|
983584
983881
|
cliContext.logger.info(`Updated ${PROJECT_CONFIG_FILENAME} to version ${targetVersion}`);
|
|
983585
983882
|
}
|
|
983586
983883
|
|
|
@@ -983588,7 +983885,7 @@ async function downgrade({
|
|
|
983588
983885
|
init_lib36();
|
|
983589
983886
|
init_lib8();
|
|
983590
983887
|
init_lib22();
|
|
983591
|
-
var
|
|
983888
|
+
var import_promises205 = require("fs/promises");
|
|
983592
983889
|
init_js_yaml();
|
|
983593
983890
|
|
|
983594
983891
|
// src/commands/export/convertIrToOpenApi.ts
|
|
@@ -985010,8 +985307,8 @@ async function generateOpenAPIForWorkspaces({
|
|
|
985010
985307
|
ir: ir3,
|
|
985011
985308
|
mode: "openapi"
|
|
985012
985309
|
});
|
|
985013
|
-
await (0,
|
|
985014
|
-
await (0,
|
|
985310
|
+
await (0, import_promises205.mkdir)(dirname6(outputPath), { recursive: true });
|
|
985311
|
+
await (0, import_promises205.writeFile)(
|
|
985015
985312
|
outputPath,
|
|
985016
985313
|
outputPath.endsWith(".json") ? JSON.stringify(openapi, void 0, indent4) : index_vite_proxy_tmp_default.dump(openapi, { indent: indent4 })
|
|
985017
985314
|
);
|
|
@@ -985617,7 +985914,7 @@ async function generateOpenAPIIrForWorkspaces({
|
|
|
985617
985914
|
// src/commands/generate-overrides/compareOpenAPISpecs.ts
|
|
985618
985915
|
init_lib8();
|
|
985619
985916
|
init_lib6();
|
|
985620
|
-
var
|
|
985917
|
+
var import_promises206 = require("fs/promises");
|
|
985621
985918
|
init_js_yaml();
|
|
985622
985919
|
async function compareOpenAPISpecs({
|
|
985623
985920
|
originalPath,
|
|
@@ -985659,12 +985956,12 @@ async function compareOpenAPISpecs({
|
|
|
985659
985956
|
}
|
|
985660
985957
|
outputPath = join8(dirname6(originalPath), RelativeFilePath2.of(overridesFilename));
|
|
985661
985958
|
}
|
|
985662
|
-
await (0,
|
|
985959
|
+
await (0, import_promises206.writeFile)(outputPath, index_vite_proxy_tmp_default.dump(overrides, { lineWidth: -1, noRefs: true }));
|
|
985663
985960
|
context3.logger.info(`Overrides written to ${outputPath}`);
|
|
985664
985961
|
});
|
|
985665
985962
|
}
|
|
985666
985963
|
async function loadSpec2(filepath, context3) {
|
|
985667
|
-
const contents = await (0,
|
|
985964
|
+
const contents = await (0, import_promises206.readFile)(filepath, "utf8");
|
|
985668
985965
|
try {
|
|
985669
985966
|
return JSON.parse(contents);
|
|
985670
985967
|
} catch {
|
|
@@ -985772,7 +986069,7 @@ init_lib35();
|
|
|
985772
986069
|
init_lib16();
|
|
985773
986070
|
init_lib15();
|
|
985774
986071
|
init_lib6();
|
|
985775
|
-
var
|
|
986072
|
+
var import_promises207 = require("fs/promises");
|
|
985776
986073
|
init_js_yaml();
|
|
985777
986074
|
async function writeOverridesForWorkspaces({
|
|
985778
986075
|
project,
|
|
@@ -985798,7 +986095,7 @@ async function writeOverridesForWorkspaces({
|
|
|
985798
986095
|
async function readExistingOverrides(overridesFilepath, context3) {
|
|
985799
986096
|
let parsedOverrides = null;
|
|
985800
986097
|
try {
|
|
985801
|
-
const contents = (await (0,
|
|
986098
|
+
const contents = (await (0, import_promises207.readFile)(overridesFilepath, "utf8")).toString();
|
|
985802
986099
|
try {
|
|
985803
986100
|
parsedOverrides = JSON.parse(contents);
|
|
985804
986101
|
} catch (err) {
|
|
@@ -985863,7 +986160,7 @@ async function writeDefinitionForOpenAPIWorkspace({
|
|
|
985863
986160
|
for (const overridesPath of overridesPaths) {
|
|
985864
986161
|
const existingOverrides = await readExistingOverrides(overridesPath, context3);
|
|
985865
986162
|
const content5 = generateOverridesContent({ ir: ir3, existingOverrides, includeModels, context: context3 });
|
|
985866
|
-
await (0,
|
|
986163
|
+
await (0, import_promises207.writeFile)(overridesPath, index_vite_proxy_tmp_default.dump(content5));
|
|
985867
986164
|
}
|
|
985868
986165
|
} else {
|
|
985869
986166
|
const content5 = generateOverridesContent({ ir: ir3, existingOverrides: {}, includeModels, context: context3 });
|
|
@@ -985877,7 +986174,7 @@ async function writeDefinitionForOpenAPIWorkspace({
|
|
|
985877
986174
|
overridesFilename = `${nameWithoutExt}-overrides${extension4}`;
|
|
985878
986175
|
}
|
|
985879
986176
|
}
|
|
985880
|
-
await (0,
|
|
986177
|
+
await (0, import_promises207.writeFile)(
|
|
985881
986178
|
join8(dirname6(spec.absoluteFilepath), RelativeFilePath2.of(overridesFilename)),
|
|
985882
986179
|
index_vite_proxy_tmp_default.dump(content5)
|
|
985883
986180
|
);
|
|
@@ -986336,7 +986633,7 @@ function convertIRtoJsonSchema(args) {
|
|
|
986336
986633
|
// src/commands/jsonschema/generateJsonschemaForWorkspace.ts
|
|
986337
986634
|
init_lib21();
|
|
986338
986635
|
init_source();
|
|
986339
|
-
var
|
|
986636
|
+
var import_promises208 = require("fs/promises");
|
|
986340
986637
|
async function generateJsonschemaForWorkspaces({
|
|
986341
986638
|
typeLocator,
|
|
986342
986639
|
project,
|
|
@@ -986384,9 +986681,9 @@ async function generateJsonschemaForWorkspaces({
|
|
|
986384
986681
|
context: context3
|
|
986385
986682
|
});
|
|
986386
986683
|
if (!await doesPathExist(dirname6(jsonschemaFilepath))) {
|
|
986387
|
-
await (0,
|
|
986684
|
+
await (0, import_promises208.mkdir)(dirname6(jsonschemaFilepath), { recursive: true });
|
|
986388
986685
|
}
|
|
986389
|
-
await (0,
|
|
986686
|
+
await (0, import_promises208.writeFile)(jsonschemaFilepath, JSON.stringify(jsonSchema, null, 2));
|
|
986390
986687
|
context3.logger.info(source_default.green(`Wrote JSON Schema to ${jsonschemaFilepath}`));
|
|
986391
986688
|
});
|
|
986392
986689
|
})
|
|
@@ -986396,7 +986693,7 @@ async function generateJsonschemaForWorkspaces({
|
|
|
986396
986693
|
// src/commands/merge/mergeOpenAPIWithOverrides.ts
|
|
986397
986694
|
init_lib8();
|
|
986398
986695
|
init_lib6();
|
|
986399
|
-
var
|
|
986696
|
+
var import_promises209 = require("fs/promises");
|
|
986400
986697
|
init_js_yaml();
|
|
986401
986698
|
var HTTP_METHODS4 = /* @__PURE__ */ new Set(["get", "put", "post", "delete", "options", "head", "patch", "trace"]);
|
|
986402
986699
|
async function mergeOpenAPIWithOverrides({
|
|
@@ -986425,11 +986722,11 @@ async function mergeOpenAPIWithOverrides({
|
|
|
986425
986722
|
if (split2) {
|
|
986426
986723
|
const examples = extractEnrichedExamples2(openapi, merged);
|
|
986427
986724
|
const output2 = isJson ? JSON.stringify(examples, null, 2) : index_vite_proxy_tmp_default.dump(examples, { lineWidth: -1, noRefs: true });
|
|
986428
|
-
await (0,
|
|
986725
|
+
await (0, import_promises209.writeFile)(outputPath, output2);
|
|
986429
986726
|
context3.logger.info(`Extracted enriched examples written to ${outputPath}`);
|
|
986430
986727
|
} else {
|
|
986431
986728
|
const output2 = isJson ? JSON.stringify(merged, null, 2) : index_vite_proxy_tmp_default.dump(merged, { lineWidth: -1, noRefs: true });
|
|
986432
|
-
await (0,
|
|
986729
|
+
await (0, import_promises209.writeFile)(outputPath, output2);
|
|
986433
986730
|
if (outputPath === openapiPath) {
|
|
986434
986731
|
context3.logger.info(`Enriched ${openapiPath} in-place`);
|
|
986435
986732
|
} else {
|
|
@@ -986439,7 +986736,7 @@ async function mergeOpenAPIWithOverrides({
|
|
|
986439
986736
|
});
|
|
986440
986737
|
}
|
|
986441
986738
|
async function loadYamlOrJson(filepath, context3) {
|
|
986442
|
-
const contents = await (0,
|
|
986739
|
+
const contents = await (0, import_promises209.readFile)(filepath, "utf8");
|
|
986443
986740
|
try {
|
|
986444
986741
|
return JSON.parse(contents);
|
|
986445
986742
|
} catch {
|
|
@@ -987234,7 +987531,7 @@ init_lib35();
|
|
|
987234
987531
|
init_lib6();
|
|
987235
987532
|
init_esm19();
|
|
987236
987533
|
init_axios2();
|
|
987237
|
-
var
|
|
987534
|
+
var import_promises210 = require("fs/promises");
|
|
987238
987535
|
var import_path118 = __toESM(require("path"), 1);
|
|
987239
987536
|
init_index_min2();
|
|
987240
987537
|
var import_tmp_promise21 = __toESM(require_tmp_promise(), 1);
|
|
@@ -987288,7 +987585,7 @@ async function registerWorkspacesV1({
|
|
|
987288
987585
|
context3.logger.debug(`Compressing definition at ${tmpDir.path}`);
|
|
987289
987586
|
await Kn({ file: tarPath, cwd: resolvedWorkspace.absoluteFilePath }, ["."]);
|
|
987290
987587
|
context3.logger.info("Uploading definition...");
|
|
987291
|
-
await axios_default.put(registerApiResponse.body.definitionS3UploadUrl, await (0,
|
|
987588
|
+
await axios_default.put(registerApiResponse.body.definitionS3UploadUrl, await (0, import_promises210.readFile)(tarPath));
|
|
987292
987589
|
context3.logger.info(
|
|
987293
987590
|
`Registered @${project.config.organization}/${resolvedWorkspace.definition.rootApiFile.contents.name}:${registerApiResponse.body.version}`
|
|
987294
987591
|
);
|
|
@@ -987345,7 +987642,7 @@ function getAIEnhancerConfig2() {
|
|
|
987345
987642
|
// src/commands/resolve-specs/resolveSpecsForWorkspaces.ts
|
|
987346
987643
|
init_lib8();
|
|
987347
987644
|
init_lib35();
|
|
987348
|
-
var
|
|
987645
|
+
var import_promises211 = require("fs/promises");
|
|
987349
987646
|
var import_path119 = __toESM(require("path"), 1);
|
|
987350
987647
|
async function resolveSpecsForWorkspaces({
|
|
987351
987648
|
project,
|
|
@@ -987365,14 +987662,14 @@ async function resolveSpecsForWorkspaces({
|
|
|
987365
987662
|
return;
|
|
987366
987663
|
}
|
|
987367
987664
|
const workspaceOutputDir = project.apiWorkspaces.length > 1 ? AbsoluteFilePath2.of(import_path119.default.join(outputDir, workspace.workspaceName ?? "api")) : outputDir;
|
|
987368
|
-
await (0,
|
|
987665
|
+
await (0, import_promises211.mkdir)(workspaceOutputDir, { recursive: true });
|
|
987369
987666
|
const manifest = await collectRawSpecs({
|
|
987370
987667
|
specs,
|
|
987371
987668
|
hostOutputDir: workspaceOutputDir,
|
|
987372
987669
|
containerBaseDir: ".",
|
|
987373
987670
|
context: context3
|
|
987374
987671
|
});
|
|
987375
|
-
await (0,
|
|
987672
|
+
await (0, import_promises211.writeFile)(
|
|
987376
987673
|
import_path119.default.join(workspaceOutputDir, SPECS_MANIFEST_FILENAME),
|
|
987377
987674
|
JSON.stringify(manifest, void 0, 4)
|
|
987378
987675
|
);
|
|
@@ -987582,7 +987879,7 @@ init_lib17();
|
|
|
987582
987879
|
init_lib19();
|
|
987583
987880
|
init_lib8();
|
|
987584
987881
|
init_lib6();
|
|
987585
|
-
var
|
|
987882
|
+
var import_promises212 = __toESM(require("fs/promises"), 1);
|
|
987586
987883
|
|
|
987587
987884
|
// src/commands/sdk-preview/computePreviewVersion.ts
|
|
987588
987885
|
var BASE_VERSION = "0.0.1";
|
|
@@ -987702,7 +987999,7 @@ async function sdkPreview({
|
|
|
987702
987999
|
const firstPath = pathOutputs[0];
|
|
987703
988000
|
const absolutePathToOutput = firstPath != null ? AbsoluteFilePath2.of(resolve6(cwd(), firstPath)) : void 0;
|
|
987704
988001
|
if (absolutePathToOutput != null) {
|
|
987705
|
-
await
|
|
988002
|
+
await import_promises212.default.mkdir(absolutePathToOutput, { recursive: true });
|
|
987706
988003
|
}
|
|
987707
988004
|
for (const workspace of project.apiWorkspaces) {
|
|
987708
988005
|
if (workspace.generatorsConfiguration == null) {
|
|
@@ -987892,7 +988189,7 @@ async function sdkPreview({
|
|
|
987892
988189
|
init_lib33();
|
|
987893
988190
|
init_lib6();
|
|
987894
988191
|
init_source();
|
|
987895
|
-
var
|
|
988192
|
+
var import_promises213 = require("fs/promises");
|
|
987896
988193
|
var import_path120 = require("path");
|
|
987897
988194
|
async function getPackageManagerBinDir(logger4, pm) {
|
|
987898
988195
|
let command3;
|
|
@@ -987938,7 +988235,7 @@ async function detectInstallationMethod(logger4) {
|
|
|
987938
988235
|
logger4.debug(`Found fern at: ${fernPath}`);
|
|
987939
988236
|
let resolvedPath;
|
|
987940
988237
|
try {
|
|
987941
|
-
resolvedPath = await (0,
|
|
988238
|
+
resolvedPath = await (0, import_promises213.realpath)(fernPath);
|
|
987942
988239
|
logger4.debug(`Resolved to: ${resolvedPath}`);
|
|
987943
988240
|
} catch (error50) {
|
|
987944
988241
|
logger4.debug(`Failed to resolve symlink: ${error50}`);
|
|
@@ -988252,22 +988549,22 @@ init_lib19();
|
|
|
988252
988549
|
init_lib8();
|
|
988253
988550
|
init_lib6();
|
|
988254
988551
|
var fs33 = __toESM(require("fs"), 1);
|
|
988255
|
-
var
|
|
988552
|
+
var import_promises214 = require("fs/promises");
|
|
988256
988553
|
init_graphql();
|
|
988257
988554
|
init_js_yaml();
|
|
988258
988555
|
var import_stream18 = require("stream");
|
|
988259
|
-
var
|
|
988556
|
+
var import_promises215 = require("stream/promises");
|
|
988260
988557
|
async function fetchAndWriteFile(url3, path120, logger4, indent4) {
|
|
988261
988558
|
const resp = await fetch(url3);
|
|
988262
988559
|
if (resp.ok && resp.body) {
|
|
988263
988560
|
logger4.debug("Origin successfully fetched, writing to file");
|
|
988264
988561
|
const fileStream = fs33.createWriteStream(path120);
|
|
988265
|
-
await (0,
|
|
988266
|
-
const fileContents = await (0,
|
|
988562
|
+
await (0, import_promises215.finished)(import_stream18.Readable.fromWeb(resp.body).pipe(fileStream));
|
|
988563
|
+
const fileContents = await (0, import_promises214.readFile)(path120, "utf8");
|
|
988267
988564
|
try {
|
|
988268
|
-
await (0,
|
|
988565
|
+
await (0, import_promises214.writeFile)(path120, JSON.stringify(JSON.parse(fileContents), void 0, indent4), "utf8");
|
|
988269
988566
|
} catch (e2) {
|
|
988270
|
-
await (0,
|
|
988567
|
+
await (0, import_promises214.writeFile)(path120, index_vite_proxy_tmp_default.dump(index_vite_proxy_tmp_default.load(fileContents), { indent: indent4 }), "utf8");
|
|
988271
988568
|
}
|
|
988272
988569
|
logger4.debug("File written successfully");
|
|
988273
988570
|
}
|
|
@@ -988423,14 +988720,14 @@ async function tryDirectJSONFetch(url3, logger4) {
|
|
|
988423
988720
|
async function fetchGraphQLSchemaWithAutoDetection(url3, path120, logger4) {
|
|
988424
988721
|
const postResult = await tryGraphQLIntrospection(url3, logger4);
|
|
988425
988722
|
if (postResult.success) {
|
|
988426
|
-
await (0,
|
|
988723
|
+
await (0, import_promises214.writeFile)(path120, postResult.result, "utf8");
|
|
988427
988724
|
logger4.info("Successfully fetched GraphQL schema using POST introspection");
|
|
988428
988725
|
return;
|
|
988429
988726
|
}
|
|
988430
988727
|
logger4.debug(`POST introspection failed: ${postResult.error}`);
|
|
988431
988728
|
const getResult = await tryDirectJSONFetch(url3, logger4);
|
|
988432
988729
|
if (getResult.success) {
|
|
988433
|
-
await (0,
|
|
988730
|
+
await (0, import_promises214.writeFile)(path120, getResult.result, "utf8");
|
|
988434
988731
|
logger4.info("Successfully fetched GraphQL schema using direct JSON fetch");
|
|
988435
988732
|
return;
|
|
988436
988733
|
}
|
|
@@ -989140,7 +989437,7 @@ async function validateWorkspaces({
|
|
|
989140
989437
|
init_lib19();
|
|
989141
989438
|
init_lib8();
|
|
989142
989439
|
init_source();
|
|
989143
|
-
var
|
|
989440
|
+
var import_promises216 = require("fs/promises");
|
|
989144
989441
|
init_js_yaml();
|
|
989145
989442
|
var import_path122 = __toESM(require("path"), 1);
|
|
989146
989443
|
async function writeDefinitionForWorkspaces({
|
|
@@ -989222,22 +989519,22 @@ async function writeFernDefinition({
|
|
|
989222
989519
|
return a3.localeCompare(b5);
|
|
989223
989520
|
};
|
|
989224
989521
|
if (await doesPathExist(absolutePathToOutputDirectory)) {
|
|
989225
|
-
await (0,
|
|
989522
|
+
await (0, import_promises216.rm)(absolutePathToOutputDirectory, { recursive: true });
|
|
989226
989523
|
}
|
|
989227
|
-
await (0,
|
|
989228
|
-
await (0,
|
|
989524
|
+
await (0, import_promises216.mkdir)(absolutePathToOutputDirectory, { recursive: true });
|
|
989525
|
+
await (0, import_promises216.writeFile)(
|
|
989229
989526
|
join8(absolutePathToOutputDirectory, RelativeFilePath2.of(ROOT_API_FILENAME)),
|
|
989230
989527
|
index_vite_proxy_tmp_default.dump(definition3.rootApiFile.contents, { sortKeys })
|
|
989231
989528
|
);
|
|
989232
989529
|
for (const [relativePath, packageMarker] of Object.entries(definition3.packageMarkers)) {
|
|
989233
989530
|
const absoluteFilepath = join8(absolutePathToOutputDirectory, RelativeFilePath2.of(relativePath));
|
|
989234
|
-
await (0,
|
|
989235
|
-
await (0,
|
|
989531
|
+
await (0, import_promises216.mkdir)(dirname6(absoluteFilepath), { recursive: true });
|
|
989532
|
+
await (0, import_promises216.writeFile)(absoluteFilepath, index_vite_proxy_tmp_default.dump(packageMarker.contents, { sortKeys }));
|
|
989236
989533
|
}
|
|
989237
989534
|
for (const [relativePath, definitionFile] of Object.entries(definition3.namedDefinitionFiles)) {
|
|
989238
989535
|
const absoluteFilepath = join8(absolutePathToOutputDirectory, RelativeFilePath2.of(relativePath));
|
|
989239
|
-
await (0,
|
|
989240
|
-
await (0,
|
|
989536
|
+
await (0, import_promises216.mkdir)(dirname6(absoluteFilepath), { recursive: true });
|
|
989537
|
+
await (0, import_promises216.writeFile)(absoluteFilepath, index_vite_proxy_tmp_default.dump(definitionFile.contents, { sortKeys }));
|
|
989241
989538
|
}
|
|
989242
989539
|
}
|
|
989243
989540
|
|
|
@@ -989245,7 +989542,7 @@ async function writeFernDefinition({
|
|
|
989245
989542
|
init_lib67();
|
|
989246
989543
|
init_lib8();
|
|
989247
989544
|
init_source();
|
|
989248
|
-
var
|
|
989545
|
+
var import_promises217 = require("fs/promises");
|
|
989249
989546
|
async function writeDocsDefinitionForProject({
|
|
989250
989547
|
project,
|
|
989251
989548
|
outputPath,
|
|
@@ -989277,7 +989574,7 @@ async function writeDocsDefinitionForProject({
|
|
|
989277
989574
|
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
|
|
989278
989575
|
});
|
|
989279
989576
|
const docsDefinition = await docsResolver.resolve();
|
|
989280
|
-
await (0,
|
|
989577
|
+
await (0, import_promises217.writeFile)(AbsoluteFilePath2.of(outputPath), JSON.stringify(docsDefinition, null, 2));
|
|
989281
989578
|
context3.logger.info(source_default.green(`Docs definition written to ${outputPath}`));
|
|
989282
989579
|
});
|
|
989283
989580
|
}
|
|
@@ -990065,6 +990362,14 @@ function addGenerateCommand3(cli, cliContext) {
|
|
|
990065
990362
|
boolean: true,
|
|
990066
990363
|
default: false,
|
|
990067
990364
|
description: "Generate test files even when generating to a local file system (tests are normally only generated for GitHub output modes)"
|
|
990365
|
+
}).option("pack", {
|
|
990366
|
+
boolean: true,
|
|
990367
|
+
default: false,
|
|
990368
|
+
description: "After generating to the local file system, build distributable package artifacts (npm tarball, wheel, JAR, NuGet package, gem, etc.) into a fern-dist/ folder inside the output directory."
|
|
990369
|
+
}).option("pack-mode", {
|
|
990370
|
+
choices: ["host", "docker"],
|
|
990371
|
+
default: "host",
|
|
990372
|
+
description: "Where --pack runs the packaging toolchain: 'host' uses toolchains installed on this machine; 'docker' runs each toolchain inside an official Docker image (node, python, gradle, dotnet/sdk, ruby, composer, rust) with the output directory mounted, so no local toolchains are needed."
|
|
990068
990373
|
}),
|
|
990069
990374
|
async (argv) => {
|
|
990070
990375
|
if (argv.api != null && argv.api.length > 0 && argv.docs != null) {
|
|
@@ -990140,6 +990445,23 @@ function addGenerateCommand3(cli, cliContext) {
|
|
|
990140
990445
|
{ code: CliError.Code.ConfigError }
|
|
990141
990446
|
);
|
|
990142
990447
|
}
|
|
990448
|
+
if (argv.pack && argv.preview) {
|
|
990449
|
+
return cliContext.failWithoutThrowing("The --pack flag cannot be used with --preview.", void 0, {
|
|
990450
|
+
code: CliError.Code.ConfigError
|
|
990451
|
+
});
|
|
990452
|
+
}
|
|
990453
|
+
if (argv.pack && argv.docs != null) {
|
|
990454
|
+
return cliContext.failWithoutThrowing(
|
|
990455
|
+
"The --pack flag can only be used for API generation, not docs generation.",
|
|
990456
|
+
void 0,
|
|
990457
|
+
{ code: CliError.Code.ConfigError }
|
|
990458
|
+
);
|
|
990459
|
+
}
|
|
990460
|
+
if (argv.packMode !== "host" && !argv.pack) {
|
|
990461
|
+
return cliContext.failWithoutThrowing("The --pack-mode flag can only be used with --pack.", void 0, {
|
|
990462
|
+
code: CliError.Code.ConfigError
|
|
990463
|
+
});
|
|
990464
|
+
}
|
|
990143
990465
|
if (argv.output != null && argv.docs != null) {
|
|
990144
990466
|
return cliContext.failWithoutThrowing(
|
|
990145
990467
|
"The --output flag is not supported for docs generation.",
|
|
@@ -990178,7 +990500,9 @@ function addGenerateCommand3(cli, cliContext) {
|
|
|
990178
990500
|
retryRateLimited: argv["retry-rate-limited"],
|
|
990179
990501
|
requireEnvVars: argv["require-env-vars"],
|
|
990180
990502
|
skipIfNoDiff: argv["skip-if-no-diff"],
|
|
990181
|
-
generateTests: argv["generate-tests"]
|
|
990503
|
+
generateTests: argv["generate-tests"],
|
|
990504
|
+
pack: argv.pack,
|
|
990505
|
+
packMode: argv.packMode
|
|
990182
990506
|
});
|
|
990183
990507
|
}
|
|
990184
990508
|
if (argv.docs != null) {
|
|
@@ -990240,7 +990564,9 @@ function addGenerateCommand3(cli, cliContext) {
|
|
|
990240
990564
|
retryRateLimited: argv["retry-rate-limited"],
|
|
990241
990565
|
requireEnvVars: argv["require-env-vars"],
|
|
990242
990566
|
skipIfNoDiff: argv["skip-if-no-diff"],
|
|
990243
|
-
generateTests: argv["generate-tests"]
|
|
990567
|
+
generateTests: argv["generate-tests"],
|
|
990568
|
+
pack: argv.pack,
|
|
990569
|
+
packMode: argv.packMode
|
|
990244
990570
|
});
|
|
990245
990571
|
}
|
|
990246
990572
|
);
|