@fern-api/fern-api-dev 5.83.0 → 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 +572 -237
- 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);
|
|
@@ -356471,7 +356517,7 @@ var init_MethodConverter = __esm({
|
|
|
356471
356517
|
autogeneratedExamples: [],
|
|
356472
356518
|
v2Examples: {
|
|
356473
356519
|
autogeneratedExamples: {},
|
|
356474
|
-
userSpecifiedExamples: this.convertExamples()
|
|
356520
|
+
userSpecifiedExamples: this.convertExamples(pathString)
|
|
356475
356521
|
},
|
|
356476
356522
|
transport: void 0,
|
|
356477
356523
|
availability: void 0,
|
|
@@ -356511,8 +356557,17 @@ var init_MethodConverter = __esm({
|
|
|
356511
356557
|
});
|
|
356512
356558
|
return baseUrls;
|
|
356513
356559
|
}
|
|
356514
|
-
convertExamples() {
|
|
356560
|
+
convertExamples(path120) {
|
|
356515
356561
|
const examples = {};
|
|
356562
|
+
const pathParameters = {};
|
|
356563
|
+
for (const parameter6 of this.pathParameters) {
|
|
356564
|
+
const userExample = Object.values(parameter6.v2Examples?.userSpecifiedExamples ?? {})[0];
|
|
356565
|
+
const autogeneratedExample = Object.values(parameter6.v2Examples?.autogeneratedExamples ?? {})[0];
|
|
356566
|
+
const example = userExample !== void 0 ? userExample : autogeneratedExample;
|
|
356567
|
+
if (example !== void 0) {
|
|
356568
|
+
pathParameters[getOriginalName(parameter6.name)] = example;
|
|
356569
|
+
}
|
|
356570
|
+
}
|
|
356516
356571
|
let i5 = 0;
|
|
356517
356572
|
if (this.method.examples && this.method.examples.length > 0) {
|
|
356518
356573
|
for (const example of this.method.examples ?? []) {
|
|
@@ -356568,12 +356623,12 @@ var init_MethodConverter = __esm({
|
|
|
356568
356623
|
docs: void 0,
|
|
356569
356624
|
endpoint: {
|
|
356570
356625
|
method: "POST",
|
|
356571
|
-
path:
|
|
356626
|
+
path: path120
|
|
356572
356627
|
},
|
|
356573
356628
|
baseUrl: void 0,
|
|
356574
356629
|
environment: void 0,
|
|
356575
356630
|
auth: void 0,
|
|
356576
|
-
pathParameters
|
|
356631
|
+
pathParameters,
|
|
356577
356632
|
queryParameters: {},
|
|
356578
356633
|
headers: {},
|
|
356579
356634
|
requestBody: resolvedParams.map((param) => param.value) ?? void 0
|
|
@@ -482208,7 +482263,7 @@ var require_polyfills2 = __commonJS({
|
|
|
482208
482263
|
}
|
|
482209
482264
|
if (platform4 === "win32") {
|
|
482210
482265
|
fs34.rename = typeof fs34.rename !== "function" ? fs34.rename : (function(fs$rename) {
|
|
482211
|
-
function
|
|
482266
|
+
function rename8(from4, to2, cb) {
|
|
482212
482267
|
var start2 = Date.now();
|
|
482213
482268
|
var backoff = 0;
|
|
482214
482269
|
fs$rename(from4, to2, function CB(er3) {
|
|
@@ -482228,8 +482283,8 @@ var require_polyfills2 = __commonJS({
|
|
|
482228
482283
|
if (cb) cb(er3);
|
|
482229
482284
|
});
|
|
482230
482285
|
}
|
|
482231
|
-
if (Object.setPrototypeOf) Object.setPrototypeOf(
|
|
482232
|
-
return
|
|
482286
|
+
if (Object.setPrototypeOf) Object.setPrototypeOf(rename8, fs$rename);
|
|
482287
|
+
return rename8;
|
|
482233
482288
|
})(fs34.rename);
|
|
482234
482289
|
}
|
|
482235
482290
|
fs34.read = typeof fs34.read !== "function" ? fs34.read : (function(fs$read) {
|
|
@@ -482635,8 +482690,8 @@ var require_graceful_fs2 = __commonJS({
|
|
|
482635
482690
|
fs35.createReadStream = createReadStream5;
|
|
482636
482691
|
fs35.createWriteStream = createWriteStream8;
|
|
482637
482692
|
var fs$readFile = fs35.readFile;
|
|
482638
|
-
fs35.readFile =
|
|
482639
|
-
function
|
|
482693
|
+
fs35.readFile = readFile121;
|
|
482694
|
+
function readFile121(path120, options2, cb) {
|
|
482640
482695
|
if (typeof options2 === "function")
|
|
482641
482696
|
cb = options2, options2 = null;
|
|
482642
482697
|
return go$readFile(path120, options2, cb);
|
|
@@ -482688,8 +482743,8 @@ var require_graceful_fs2 = __commonJS({
|
|
|
482688
482743
|
}
|
|
482689
482744
|
var fs$copyFile = fs35.copyFile;
|
|
482690
482745
|
if (fs$copyFile)
|
|
482691
|
-
fs35.copyFile =
|
|
482692
|
-
function
|
|
482746
|
+
fs35.copyFile = copyFile7;
|
|
482747
|
+
function copyFile7(src, dest, flags2, cb) {
|
|
482693
482748
|
if (typeof flags2 === "function") {
|
|
482694
482749
|
cb = flags2;
|
|
482695
482750
|
flags2 = 0;
|
|
@@ -482707,9 +482762,9 @@ var require_graceful_fs2 = __commonJS({
|
|
|
482707
482762
|
}
|
|
482708
482763
|
}
|
|
482709
482764
|
var fs$readdir = fs35.readdir;
|
|
482710
|
-
fs35.readdir =
|
|
482765
|
+
fs35.readdir = readdir23;
|
|
482711
482766
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
482712
|
-
function
|
|
482767
|
+
function readdir23(path120, options2, cb) {
|
|
482713
482768
|
if (typeof options2 === "function")
|
|
482714
482769
|
cb = options2, options2 = null;
|
|
482715
482770
|
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path121, options3, cb2, startTime) {
|
|
@@ -491562,10 +491617,10 @@ var require_make_dir = __commonJS({
|
|
|
491562
491617
|
module4.exports = (input3, opts) => Promise.resolve().then(() => {
|
|
491563
491618
|
checkPath(input3);
|
|
491564
491619
|
opts = Object.assign({}, defaults3, opts);
|
|
491565
|
-
const
|
|
491620
|
+
const mkdir46 = pify(opts.fs.mkdir);
|
|
491566
491621
|
const stat7 = pify(opts.fs.stat);
|
|
491567
491622
|
const make = (pth) => {
|
|
491568
|
-
return
|
|
491623
|
+
return mkdir46(pth, opts.mode).then(() => pth).catch((err) => {
|
|
491569
491624
|
if (err.code === "ENOENT") {
|
|
491570
491625
|
if (err.message.includes("null bytes") || path120.dirname(pth) === pth) {
|
|
491571
491626
|
throw err;
|
|
@@ -576152,7 +576207,7 @@ var require_dist24 = __commonJS({
|
|
|
576152
576207
|
return copy;
|
|
576153
576208
|
}
|
|
576154
576209
|
};
|
|
576155
|
-
var
|
|
576210
|
+
var import_promises218 = require("fs/promises");
|
|
576156
576211
|
var import_node_path310 = require("path");
|
|
576157
576212
|
async function resolveInputs(args) {
|
|
576158
576213
|
const {
|
|
@@ -576205,7 +576260,7 @@ var require_dist24 = __commonJS({
|
|
|
576205
576260
|
}
|
|
576206
576261
|
}
|
|
576207
576262
|
const oursPath = (0, import_node_path310.join)(outputDir, resolvedPath);
|
|
576208
|
-
const ours = await (0,
|
|
576263
|
+
const ours = await (0, import_promises218.readFile)(oursPath, "utf-8").catch(() => null);
|
|
576209
576264
|
let ghostTheirs = null;
|
|
576210
576265
|
let baseTreeUnreachable = false;
|
|
576211
576266
|
if (!base4 && !renameSourcePath) {
|
|
@@ -576447,7 +576502,7 @@ var require_dist24 = __commonJS({
|
|
|
576447
576502
|
conflictReasonHint
|
|
576448
576503
|
};
|
|
576449
576504
|
}
|
|
576450
|
-
var
|
|
576505
|
+
var import_promises219 = require("fs/promises");
|
|
576451
576506
|
var import_node_path45 = require("path");
|
|
576452
576507
|
var AUTOVERSION_PLACEHOLDERS = [
|
|
576453
576508
|
"v0.0.0-fern-placeholder",
|
|
@@ -576498,14 +576553,14 @@ var require_dist24 = __commonJS({
|
|
|
576498
576553
|
}
|
|
576499
576554
|
if (plan.kind === "new-file-only-user") {
|
|
576500
576555
|
accumulator.recordMerge(resolvedPath, plan.theirs, patch5.base_generation);
|
|
576501
|
-
await (0,
|
|
576502
|
-
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);
|
|
576503
576558
|
return { file: resolvedPath, status: "merged", reason: "new-file" };
|
|
576504
576559
|
}
|
|
576505
576560
|
if (plan.kind === "new-file-both") {
|
|
576506
576561
|
const merged2 = threeWayMerge("", ours, plan.theirs);
|
|
576507
|
-
await (0,
|
|
576508
|
-
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);
|
|
576509
576564
|
const unreachableFlag = plan.baseTreeUnreachable ? { baseTreeUnreachable: true } : {};
|
|
576510
576565
|
if (merged2.hasConflicts) {
|
|
576511
576566
|
return {
|
|
@@ -576523,8 +576578,8 @@ var require_dist24 = __commonJS({
|
|
|
576523
576578
|
const mergeBase = inputs.base != null ? alignAutoversionToOurs(inputs.base, ours, plan.mergeBase) : plan.mergeBase;
|
|
576524
576579
|
const theirs = inputs.base != null ? alignAutoversionToOurs(inputs.base, ours, plan.theirs) : plan.theirs;
|
|
576525
576580
|
const merged = threeWayMerge(mergeBase, ours, theirs);
|
|
576526
|
-
await (0,
|
|
576527
|
-
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);
|
|
576528
576583
|
if (merged.hasConflicts) {
|
|
576529
576584
|
accumulator.recordConflict(resolvedPath, theirs, patch5.base_generation);
|
|
576530
576585
|
return {
|
|
@@ -624860,16 +624915,16 @@ var require_copy = __commonJS({
|
|
|
624860
624915
|
throw new Error(`Unknown file: ${src}`);
|
|
624861
624916
|
}
|
|
624862
624917
|
async function onFile(srcStat, destStat, src, dest, opts) {
|
|
624863
|
-
if (!destStat) return
|
|
624918
|
+
if (!destStat) return copyFile7(srcStat, src, dest, opts);
|
|
624864
624919
|
if (opts.overwrite) {
|
|
624865
624920
|
await fs34.unlink(dest);
|
|
624866
|
-
return
|
|
624921
|
+
return copyFile7(srcStat, src, dest, opts);
|
|
624867
624922
|
}
|
|
624868
624923
|
if (opts.errorOnExist) {
|
|
624869
624924
|
throw new Error(`'${dest}' already exists`);
|
|
624870
624925
|
}
|
|
624871
624926
|
}
|
|
624872
|
-
async function
|
|
624927
|
+
async function copyFile7(srcStat, src, dest, opts) {
|
|
624873
624928
|
await fs34.copyFile(src, dest);
|
|
624874
624929
|
if (opts.preserveTimestamps) {
|
|
624875
624930
|
if (fileIsNotWritable(srcStat.mode)) {
|
|
@@ -624977,18 +625032,18 @@ var require_copy_sync = __commonJS({
|
|
|
624977
625032
|
throw new Error(`Unknown file: ${src}`);
|
|
624978
625033
|
}
|
|
624979
625034
|
function onFile(srcStat, destStat, src, dest, opts) {
|
|
624980
|
-
if (!destStat) return
|
|
625035
|
+
if (!destStat) return copyFile7(srcStat, src, dest, opts);
|
|
624981
625036
|
return mayCopyFile(srcStat, src, dest, opts);
|
|
624982
625037
|
}
|
|
624983
625038
|
function mayCopyFile(srcStat, src, dest, opts) {
|
|
624984
625039
|
if (opts.overwrite) {
|
|
624985
625040
|
fs34.unlinkSync(dest);
|
|
624986
|
-
return
|
|
625041
|
+
return copyFile7(srcStat, src, dest, opts);
|
|
624987
625042
|
} else if (opts.errorOnExist) {
|
|
624988
625043
|
throw new Error(`'${dest}' already exists`);
|
|
624989
625044
|
}
|
|
624990
625045
|
}
|
|
624991
|
-
function
|
|
625046
|
+
function copyFile7(srcStat, src, dest, opts) {
|
|
624992
625047
|
fs34.copyFileSync(src, dest);
|
|
624993
625048
|
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
|
|
624994
625049
|
return setDestMode(dest, srcStat.mode);
|
|
@@ -625112,14 +625167,14 @@ var require_empty2 = __commonJS({
|
|
|
625112
625167
|
var u5 = require_universalify().fromPromise;
|
|
625113
625168
|
var fs34 = require_fs();
|
|
625114
625169
|
var path120 = require("path");
|
|
625115
|
-
var
|
|
625170
|
+
var mkdir46 = require_mkdirs();
|
|
625116
625171
|
var remove3 = require_remove3();
|
|
625117
625172
|
var emptyDir = u5(async function emptyDir2(dir) {
|
|
625118
625173
|
let items;
|
|
625119
625174
|
try {
|
|
625120
625175
|
items = await fs34.readdir(dir);
|
|
625121
625176
|
} catch {
|
|
625122
|
-
return
|
|
625177
|
+
return mkdir46.mkdirs(dir);
|
|
625123
625178
|
}
|
|
625124
625179
|
return Promise.all(items.map((item) => remove3.remove(path120.join(dir, item))));
|
|
625125
625180
|
});
|
|
@@ -625128,7 +625183,7 @@ var require_empty2 = __commonJS({
|
|
|
625128
625183
|
try {
|
|
625129
625184
|
items = fs34.readdirSync(dir);
|
|
625130
625185
|
} catch {
|
|
625131
|
-
return
|
|
625186
|
+
return mkdir46.mkdirsSync(dir);
|
|
625132
625187
|
}
|
|
625133
625188
|
items.forEach((item) => {
|
|
625134
625189
|
item = path120.join(dir, item);
|
|
@@ -625151,7 +625206,7 @@ var require_file2 = __commonJS({
|
|
|
625151
625206
|
var u5 = require_universalify().fromPromise;
|
|
625152
625207
|
var path120 = require("path");
|
|
625153
625208
|
var fs34 = require_fs();
|
|
625154
|
-
var
|
|
625209
|
+
var mkdir46 = require_mkdirs();
|
|
625155
625210
|
async function createFile(file4) {
|
|
625156
625211
|
let stats;
|
|
625157
625212
|
try {
|
|
@@ -625165,7 +625220,7 @@ var require_file2 = __commonJS({
|
|
|
625165
625220
|
dirStats = await fs34.stat(dir);
|
|
625166
625221
|
} catch (err) {
|
|
625167
625222
|
if (err.code === "ENOENT") {
|
|
625168
|
-
await
|
|
625223
|
+
await mkdir46.mkdirs(dir);
|
|
625169
625224
|
await fs34.writeFile(file4, "");
|
|
625170
625225
|
return;
|
|
625171
625226
|
} else {
|
|
@@ -625191,7 +625246,7 @@ var require_file2 = __commonJS({
|
|
|
625191
625246
|
fs34.readdirSync(dir);
|
|
625192
625247
|
}
|
|
625193
625248
|
} catch (err) {
|
|
625194
|
-
if (err && err.code === "ENOENT")
|
|
625249
|
+
if (err && err.code === "ENOENT") mkdir46.mkdirsSync(dir);
|
|
625195
625250
|
else throw err;
|
|
625196
625251
|
}
|
|
625197
625252
|
fs34.writeFileSync(file4, "");
|
|
@@ -625210,7 +625265,7 @@ var require_link = __commonJS({
|
|
|
625210
625265
|
var u5 = require_universalify().fromPromise;
|
|
625211
625266
|
var path120 = require("path");
|
|
625212
625267
|
var fs34 = require_fs();
|
|
625213
|
-
var
|
|
625268
|
+
var mkdir46 = require_mkdirs();
|
|
625214
625269
|
var { pathExists: pathExists2 } = require_path_exists();
|
|
625215
625270
|
var { areIdentical } = require_stat();
|
|
625216
625271
|
async function createLink(srcpath, dstpath) {
|
|
@@ -625230,7 +625285,7 @@ var require_link = __commonJS({
|
|
|
625230
625285
|
const dir = path120.dirname(dstpath);
|
|
625231
625286
|
const dirExists = await pathExists2(dir);
|
|
625232
625287
|
if (!dirExists) {
|
|
625233
|
-
await
|
|
625288
|
+
await mkdir46.mkdirs(dir);
|
|
625234
625289
|
}
|
|
625235
625290
|
await fs34.link(srcpath, dstpath);
|
|
625236
625291
|
}
|
|
@@ -625250,7 +625305,7 @@ var require_link = __commonJS({
|
|
|
625250
625305
|
const dir = path120.dirname(dstpath);
|
|
625251
625306
|
const dirExists = fs34.existsSync(dir);
|
|
625252
625307
|
if (dirExists) return fs34.linkSync(srcpath, dstpath);
|
|
625253
|
-
|
|
625308
|
+
mkdir46.mkdirsSync(dir);
|
|
625254
625309
|
return fs34.linkSync(srcpath, dstpath);
|
|
625255
625310
|
}
|
|
625256
625311
|
module4.exports = {
|
|
@@ -625524,7 +625579,7 @@ var require_jsonfile = __commonJS({
|
|
|
625524
625579
|
}
|
|
625525
625580
|
return obj;
|
|
625526
625581
|
}
|
|
625527
|
-
var
|
|
625582
|
+
var readFile121 = universalify.fromPromise(_readFile);
|
|
625528
625583
|
function readFileSync19(file4, options2 = {}) {
|
|
625529
625584
|
if (typeof options2 === "string") {
|
|
625530
625585
|
options2 = { encoding: options2 };
|
|
@@ -625556,7 +625611,7 @@ var require_jsonfile = __commonJS({
|
|
|
625556
625611
|
return fs34.writeFileSync(file4, str2, options2);
|
|
625557
625612
|
}
|
|
625558
625613
|
module4.exports = {
|
|
625559
|
-
readFile:
|
|
625614
|
+
readFile: readFile121,
|
|
625560
625615
|
readFileSync: readFileSync19,
|
|
625561
625616
|
writeFile: writeFile102,
|
|
625562
625617
|
writeFileSync: writeFileSync9
|
|
@@ -625586,19 +625641,19 @@ var require_output_file = __commonJS({
|
|
|
625586
625641
|
var u5 = require_universalify().fromPromise;
|
|
625587
625642
|
var fs34 = require_fs();
|
|
625588
625643
|
var path120 = require("path");
|
|
625589
|
-
var
|
|
625644
|
+
var mkdir46 = require_mkdirs();
|
|
625590
625645
|
var pathExists2 = require_path_exists().pathExists;
|
|
625591
625646
|
async function outputFile(file4, data2, encoding = "utf-8") {
|
|
625592
625647
|
const dir = path120.dirname(file4);
|
|
625593
625648
|
if (!await pathExists2(dir)) {
|
|
625594
|
-
await
|
|
625649
|
+
await mkdir46.mkdirs(dir);
|
|
625595
625650
|
}
|
|
625596
625651
|
return fs34.writeFile(file4, data2, encoding);
|
|
625597
625652
|
}
|
|
625598
625653
|
function outputFileSync(file4, ...args) {
|
|
625599
625654
|
const dir = path120.dirname(file4);
|
|
625600
625655
|
if (!fs34.existsSync(dir)) {
|
|
625601
|
-
|
|
625656
|
+
mkdir46.mkdirsSync(dir);
|
|
625602
625657
|
}
|
|
625603
625658
|
fs34.writeFileSync(file4, ...args);
|
|
625604
625659
|
}
|
|
@@ -625731,15 +625786,15 @@ var require_move_sync = __commonJS({
|
|
|
625731
625786
|
return parsedPath.root === parent;
|
|
625732
625787
|
}
|
|
625733
625788
|
function doRename(src, dest, overwrite, isChangingCase) {
|
|
625734
|
-
if (isChangingCase) return
|
|
625789
|
+
if (isChangingCase) return rename8(src, dest, overwrite);
|
|
625735
625790
|
if (overwrite) {
|
|
625736
625791
|
removeSync(dest);
|
|
625737
|
-
return
|
|
625792
|
+
return rename8(src, dest, overwrite);
|
|
625738
625793
|
}
|
|
625739
625794
|
if (fs34.existsSync(dest)) throw new Error("dest already exists.");
|
|
625740
|
-
return
|
|
625795
|
+
return rename8(src, dest, overwrite);
|
|
625741
625796
|
}
|
|
625742
|
-
function
|
|
625797
|
+
function rename8(src, dest, overwrite) {
|
|
625743
625798
|
try {
|
|
625744
625799
|
fs34.renameSync(src, dest);
|
|
625745
625800
|
} catch (err) {
|
|
@@ -692025,7 +692080,7 @@ var AccessTokenPosthogManager = class {
|
|
|
692025
692080
|
properties: {
|
|
692026
692081
|
...event,
|
|
692027
692082
|
...event.properties,
|
|
692028
|
-
version: "5.
|
|
692083
|
+
version: "5.84.0",
|
|
692029
692084
|
usingAccessToken: true,
|
|
692030
692085
|
...getRunIdProperties()
|
|
692031
692086
|
}
|
|
@@ -692091,7 +692146,7 @@ var UserPosthogManager = class {
|
|
|
692091
692146
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
692092
692147
|
event: "CLI",
|
|
692093
692148
|
properties: {
|
|
692094
|
-
version: "5.
|
|
692149
|
+
version: "5.84.0",
|
|
692095
692150
|
...event,
|
|
692096
692151
|
...event.properties,
|
|
692097
692152
|
usingAccessToken: false,
|
|
@@ -867726,7 +867781,7 @@ var MDX_NODE_TYPES = [
|
|
|
867726
867781
|
"mdxTextExpression",
|
|
867727
867782
|
"mdxjsEsm"
|
|
867728
867783
|
];
|
|
867729
|
-
function collectLinksAndSources({ readFile:
|
|
867784
|
+
function collectLinksAndSources({ readFile: readFile121 = (path120) => (0, import_node_fs17.readFileSync)(path120, "utf-8"), ...opts }) {
|
|
867730
867785
|
const visitedAbsoluteFilepaths = /* @__PURE__ */ new Set();
|
|
867731
867786
|
const contentQueue = [opts];
|
|
867732
867787
|
const links = [];
|
|
@@ -867775,7 +867830,7 @@ function collectLinksAndSources({ readFile: readFile120 = (path120) => (0, impor
|
|
|
867775
867830
|
const resolvedImportPath = resolve6(dirname6(absoluteFilepath), importPath);
|
|
867776
867831
|
if (resolvedImportPath.endsWith(".mdx") || resolvedImportPath.endsWith(".md")) {
|
|
867777
867832
|
contentQueue.push({
|
|
867778
|
-
content:
|
|
867833
|
+
content: readFile121(resolvedImportPath),
|
|
867779
867834
|
absoluteFilepath: resolvedImportPath
|
|
867780
867835
|
});
|
|
867781
867836
|
}
|
|
@@ -867818,7 +867873,7 @@ function collectLinksAndSources({ readFile: readFile120 = (path120) => (0, impor
|
|
|
867818
867873
|
if (absoluteFilepath && typeof src === "string") {
|
|
867819
867874
|
const resolvedImportPath = resolve6(dirname6(absoluteFilepath), src);
|
|
867820
867875
|
contentQueue.push({
|
|
867821
|
-
content:
|
|
867876
|
+
content: readFile121(resolvedImportPath),
|
|
867822
867877
|
absoluteFilepath: resolvedImportPath
|
|
867823
867878
|
});
|
|
867824
867879
|
}
|
|
@@ -873197,7 +873252,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
873197
873252
|
var LOGS_FOLDER_NAME = "logs";
|
|
873198
873253
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
873199
873254
|
function getCliSource() {
|
|
873200
|
-
const version7 = "5.
|
|
873255
|
+
const version7 = "5.84.0";
|
|
873201
873256
|
return `cli@${version7}`;
|
|
873202
873257
|
}
|
|
873203
873258
|
var DebugLogger = class {
|
|
@@ -903078,7 +903133,7 @@ var SourceUploader = class {
|
|
|
903078
903133
|
};
|
|
903079
903134
|
|
|
903080
903135
|
// ../generation/remote-generation/remote-workspace-runner/lib/runRemoteGenerationForGenerator.js
|
|
903081
|
-
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 }) {
|
|
903082
903137
|
const fdr = createFdrService({ token: token.value });
|
|
903083
903138
|
const fdrOrigin = "https://registry-dev2.buildwithfern.com";
|
|
903084
903139
|
const isAirGapped = await detectAirGappedMode(`${fdrOrigin}/health`, interactiveTaskContext.logger);
|
|
@@ -903267,6 +903322,7 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
|
|
|
903267
903322
|
userProvidedVersion: version7,
|
|
903268
903323
|
packageName,
|
|
903269
903324
|
selfHosted: ir3.selfHosted ?? false,
|
|
903325
|
+
generateFullProject,
|
|
903270
903326
|
context: interactiveTaskContext
|
|
903271
903327
|
})
|
|
903272
903328
|
},
|
|
@@ -903349,12 +903405,12 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
|
|
|
903349
903405
|
}
|
|
903350
903406
|
return result;
|
|
903351
903407
|
}
|
|
903352
|
-
function getPublishConfig({ generatorInvocation, version: version7, userProvidedVersion, packageName, selfHosted, context: context3 }) {
|
|
903408
|
+
function getPublishConfig({ generatorInvocation, version: version7, userProvidedVersion, packageName, selfHosted, generateFullProject, context: context3 }) {
|
|
903353
903409
|
const publishLanguage = generatorInvocation.language ?? (0, import_autoversion.extractLanguageFromGeneratorName)(generatorInvocation.name);
|
|
903354
903410
|
const substituteAutoVersion = (candidate) => candidate != null && (0, import_autoversion.isAutoVersion)(candidate) ? (0, import_autoversion.mapMagicVersionForLanguage)(import_autoversion.MAGIC_VERSION, publishLanguage) : candidate;
|
|
903355
903411
|
return generatorInvocation.outputMode._visit({
|
|
903356
903412
|
downloadFiles: () => api_exports.PublishingConfig.filesystem({
|
|
903357
|
-
generateFullProject: selfHosted,
|
|
903413
|
+
generateFullProject: selfHosted || (generateFullProject ?? false),
|
|
903358
903414
|
publishTarget: getFilesystemPublishTarget({
|
|
903359
903415
|
generatorInvocation,
|
|
903360
903416
|
version: substituteAutoVersion(version7),
|
|
@@ -903467,7 +903523,7 @@ function resolveVersionFallback(resolvedVersion) {
|
|
|
903467
903523
|
}
|
|
903468
903524
|
|
|
903469
903525
|
// ../generation/remote-generation/remote-workspace-runner/lib/runRemoteGenerationForAPIWorkspace.js
|
|
903470
|
-
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 }) {
|
|
903471
903527
|
if (generatorGroup.generators.length === 0) {
|
|
903472
903528
|
context3.logger.warn("No generators specified.");
|
|
903473
903529
|
return null;
|
|
@@ -903514,6 +903570,7 @@ async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization,
|
|
|
903514
903570
|
occurrenceTracker: effectiveOccurrenceTracker,
|
|
903515
903571
|
loginCommand,
|
|
903516
903572
|
getSpecsTarGzBuffer,
|
|
903573
|
+
generateFullProject,
|
|
903517
903574
|
onSnippetsProduced: (invocation) => snippetsProducedBy.push(invocation)
|
|
903518
903575
|
}))));
|
|
903519
903576
|
if (automation == null && results.some((didSucceed) => !didSucceed)) {
|
|
@@ -903523,7 +903580,7 @@ async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization,
|
|
|
903523
903580
|
snippetsProducedBy
|
|
903524
903581
|
};
|
|
903525
903582
|
}
|
|
903526
|
-
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 }) {
|
|
903527
903584
|
const startedAt = Date.now();
|
|
903528
903585
|
try {
|
|
903529
903586
|
const settings = getBaseOpenAPIWorkspaceSettingsFromGeneratorInvocation(generatorInvocation);
|
|
@@ -903590,7 +903647,8 @@ async function generateOne({ generatorInvocation, interactiveTaskContext, projec
|
|
|
903590
903647
|
noReplay,
|
|
903591
903648
|
disableTelemetry,
|
|
903592
903649
|
loginCommand,
|
|
903593
|
-
specsTarGzBuffer: await getSpecsTarGzBuffer?.(generatorInvocation.name)
|
|
903650
|
+
specsTarGzBuffer: await getSpecsTarGzBuffer?.(generatorInvocation.name),
|
|
903651
|
+
generateFullProject
|
|
903594
903652
|
});
|
|
903595
903653
|
if (remoteTaskHandlerResponse?.createdSnippets) {
|
|
903596
903654
|
onSnippetsProduced(generatorInvocation);
|
|
@@ -905893,7 +905951,7 @@ var LegacyDocsPublisher = class {
|
|
|
905893
905951
|
previewId,
|
|
905894
905952
|
disableTemplates: void 0,
|
|
905895
905953
|
skipUpload,
|
|
905896
|
-
cliVersion: "5.
|
|
905954
|
+
cliVersion: "5.84.0",
|
|
905897
905955
|
loginCommand: "fern auth login"
|
|
905898
905956
|
});
|
|
905899
905957
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -960638,7 +960696,7 @@ function getGeneratorOutputSubfolder(generatorName) {
|
|
|
960638
960696
|
}
|
|
960639
960697
|
|
|
960640
960698
|
// ../generation/local-generation/local-workspace-runner/lib/runLocalGenerationForWorkspace.js
|
|
960641
|
-
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 }) {
|
|
960642
960700
|
const userProvidedVersion = version7;
|
|
960643
960701
|
if (userProvidedVersion != null) {
|
|
960644
960702
|
if (absolutePathToPreview != null) {
|
|
@@ -960758,7 +960816,8 @@ async function runLocalGenerationForWorkspace({ token, projectConfig, workspace,
|
|
|
960758
960816
|
userProvidedVersion,
|
|
960759
960817
|
packageName,
|
|
960760
960818
|
context: interactiveTaskContext,
|
|
960761
|
-
generateTests
|
|
960819
|
+
generateTests,
|
|
960820
|
+
generateFullProject
|
|
960762
960821
|
});
|
|
960763
960822
|
if (publishConfig != null) {
|
|
960764
960823
|
intermediateRepresentation.publishConfig = publishConfig;
|
|
@@ -960983,7 +961042,7 @@ async function getWorkspaceTempDir() {
|
|
|
960983
961042
|
prefix: "fern"
|
|
960984
961043
|
});
|
|
960985
961044
|
}
|
|
960986
|
-
function getPublishConfig2({ generatorInvocation, org, version: version7, userProvidedVersion, packageName, context: context3, generateTests }) {
|
|
961045
|
+
function getPublishConfig2({ generatorInvocation, org, version: version7, userProvidedVersion, packageName, context: context3, generateTests, generateFullProject }) {
|
|
960987
961046
|
const publishLanguage = generatorInvocation.language ?? (0, import_autoversion4.extractLanguageFromGeneratorName)(generatorInvocation.name);
|
|
960988
961047
|
const substituteAutoVersion = (candidate) => candidate != null && (0, import_autoversion4.isAutoVersion)(candidate) ? (0, import_autoversion4.mapMagicVersionForLanguage)(import_autoversion4.MAGIC_VERSION, publishLanguage) : candidate;
|
|
960989
961048
|
const effectiveVersion = substituteAutoVersion(version7);
|
|
@@ -961014,14 +961073,14 @@ function getPublishConfig2({ generatorInvocation, org, version: version7, userPr
|
|
|
961014
961073
|
context: context3
|
|
961015
961074
|
});
|
|
961016
961075
|
return api_exports.PublishingConfig.filesystem({
|
|
961017
|
-
generateFullProject: generateTests || org?.selfHostedSdKs || false,
|
|
961076
|
+
generateFullProject: generateTests || generateFullProject || org?.selfHostedSdKs || false,
|
|
961018
961077
|
publishTarget
|
|
961019
961078
|
});
|
|
961020
961079
|
}
|
|
961021
961080
|
return generatorInvocation.outputMode._visit({
|
|
961022
961081
|
downloadFiles: () => {
|
|
961023
961082
|
return api_exports.PublishingConfig.filesystem({
|
|
961024
|
-
generateFullProject: generateTests || org?.selfHostedSdKs || false,
|
|
961083
|
+
generateFullProject: generateTests || generateFullProject || org?.selfHostedSdKs || false,
|
|
961025
961084
|
publishTarget: void 0
|
|
961026
961085
|
});
|
|
961027
961086
|
},
|
|
@@ -972767,7 +972826,7 @@ function getAutomationContextFromEnv() {
|
|
|
972767
972826
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
972768
972827
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
972769
972828
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
972770
|
-
cli_version: "5.
|
|
972829
|
+
cli_version: "5.84.0"
|
|
972771
972830
|
};
|
|
972772
972831
|
}
|
|
972773
972832
|
function isAutomationMode() {
|
|
@@ -973599,7 +973658,7 @@ var CliContext = class _CliContext {
|
|
|
973599
973658
|
if (false) {
|
|
973600
973659
|
this.logger.error("CLI_VERSION is not defined");
|
|
973601
973660
|
}
|
|
973602
|
-
return "5.
|
|
973661
|
+
return "5.84.0";
|
|
973603
973662
|
}
|
|
973604
973663
|
getCliName() {
|
|
973605
973664
|
if (false) {
|
|
@@ -975387,6 +975446,242 @@ init_lib35();
|
|
|
975387
975446
|
init_lib6();
|
|
975388
975447
|
init_esm19();
|
|
975389
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
|
+
|
|
975390
975685
|
// src/commands/generate/describeSkipReason.ts
|
|
975391
975686
|
function classifySkipReason(generator, rootAutorelease) {
|
|
975392
975687
|
if (!generator.automation.generate) {
|
|
@@ -975501,7 +975796,9 @@ async function generateWorkspace({
|
|
|
975501
975796
|
autoMerge,
|
|
975502
975797
|
skipIfNoDiff,
|
|
975503
975798
|
generateTests,
|
|
975504
|
-
automation
|
|
975799
|
+
automation,
|
|
975800
|
+
pack,
|
|
975801
|
+
packMode
|
|
975505
975802
|
}) {
|
|
975506
975803
|
if (workspace.generatorsConfiguration == null) {
|
|
975507
975804
|
context3.logger.warn("This workspaces has no generators.yml");
|
|
@@ -975564,6 +975861,7 @@ async function generateWorkspace({
|
|
|
975564
975861
|
autoMerge,
|
|
975565
975862
|
skipIfNoDiff,
|
|
975566
975863
|
generateTests,
|
|
975864
|
+
generateFullProject: pack,
|
|
975567
975865
|
verify: verify2,
|
|
975568
975866
|
disableTelemetry: isTelemetryDisabled()
|
|
975569
975867
|
});
|
|
@@ -975611,9 +975909,13 @@ async function generateWorkspace({
|
|
|
975611
975909
|
noReplay,
|
|
975612
975910
|
verify: verify2,
|
|
975613
975911
|
disableTelemetry: isTelemetryDisabled(),
|
|
975614
|
-
getSpecsTarGzBuffer: getSpecsTarGz
|
|
975912
|
+
getSpecsTarGzBuffer: getSpecsTarGz,
|
|
975913
|
+
generateFullProject: pack
|
|
975615
975914
|
});
|
|
975616
975915
|
}
|
|
975916
|
+
if (pack) {
|
|
975917
|
+
await packLocalOutputForGroup({ group, context: groupContext, mode: packMode, runner });
|
|
975918
|
+
}
|
|
975617
975919
|
})
|
|
975618
975920
|
)
|
|
975619
975921
|
);
|
|
@@ -975989,7 +976291,9 @@ async function generateAPIWorkspaces({
|
|
|
975989
976291
|
autoMerge,
|
|
975990
976292
|
skipIfNoDiff,
|
|
975991
976293
|
generateTests,
|
|
975992
|
-
automation
|
|
976294
|
+
automation,
|
|
976295
|
+
pack,
|
|
976296
|
+
packMode
|
|
975993
976297
|
}) {
|
|
975994
976298
|
let token = void 0;
|
|
975995
976299
|
if (!useLocalDocker) {
|
|
@@ -976068,7 +976372,9 @@ async function generateAPIWorkspaces({
|
|
|
976068
976372
|
autoMerge,
|
|
976069
976373
|
skipIfNoDiff,
|
|
976070
976374
|
generateTests,
|
|
976071
|
-
automation
|
|
976375
|
+
automation,
|
|
976376
|
+
pack,
|
|
976377
|
+
packMode
|
|
976072
976378
|
});
|
|
976073
976379
|
});
|
|
976074
976380
|
})
|
|
@@ -976335,7 +976641,7 @@ function renderOverflowWarning(failureCount) {
|
|
|
976335
976641
|
// src/commands/automations/generate/reportGenerateResults.ts
|
|
976336
976642
|
init_lib4();
|
|
976337
976643
|
var import_fs41 = require("fs");
|
|
976338
|
-
var
|
|
976644
|
+
var import_promises169 = require("fs/promises");
|
|
976339
976645
|
var JSON_SCHEMA_VERSION = 1;
|
|
976340
976646
|
function renderStdoutSummary(results) {
|
|
976341
976647
|
return formatCounts(countResults(results));
|
|
@@ -976525,12 +976831,12 @@ async function writeResults({
|
|
|
976525
976831
|
const stepSummaryPath = getGithubStepSummaryPath();
|
|
976526
976832
|
if (stepSummaryPath != null) {
|
|
976527
976833
|
try {
|
|
976528
|
-
await (0,
|
|
976834
|
+
await (0, import_promises169.appendFile)(stepSummaryPath, renderMarkdownSummary(results), "utf8");
|
|
976529
976835
|
} catch {
|
|
976530
976836
|
}
|
|
976531
976837
|
}
|
|
976532
976838
|
if (jsonOutputPath != null) {
|
|
976533
|
-
await (0,
|
|
976839
|
+
await (0, import_promises169.writeFile)(jsonOutputPath, JSON.stringify(renderJsonSummary(results), null, 2), "utf8");
|
|
976534
976840
|
}
|
|
976535
976841
|
}
|
|
976536
976842
|
function writeResultsSync({
|
|
@@ -976857,7 +977163,7 @@ function listPreviewGroups({
|
|
|
976857
977163
|
init_lib19();
|
|
976858
977164
|
init_lib6();
|
|
976859
977165
|
init_source();
|
|
976860
|
-
var
|
|
977166
|
+
var import_promises199 = require("fs/promises");
|
|
976861
977167
|
|
|
976862
977168
|
// ../cli-migrations/lib/runMigrations.js
|
|
976863
977169
|
init_lib4();
|
|
@@ -976868,7 +977174,7 @@ init_source();
|
|
|
976868
977174
|
init_lib27();
|
|
976869
977175
|
|
|
976870
977176
|
// ../cli-migrations/lib/migrations/0.0.191/discriminant/migration.js
|
|
976871
|
-
var
|
|
977177
|
+
var import_promises170 = require("fs/promises");
|
|
976872
977178
|
|
|
976873
977179
|
// ../cli-migrations/lib/migrations/0.0.191/discriminant/getAllYamlFiles.js
|
|
976874
977180
|
init_lib8();
|
|
@@ -976905,7 +977211,7 @@ var migration = {
|
|
|
976905
977211
|
try {
|
|
976906
977212
|
const fileContents = await getFileContents(yamlFilepath);
|
|
976907
977213
|
const newContents = addDiscriminantToFile(fileContents);
|
|
976908
|
-
await (0,
|
|
977214
|
+
await (0, import_promises170.writeFile)(yamlFilepath, newContents);
|
|
976909
977215
|
} catch (error50) {
|
|
976910
977216
|
context3.failAndThrow("Failed to migrate " + yamlFilepath, error50);
|
|
976911
977217
|
}
|
|
@@ -976913,7 +977219,7 @@ var migration = {
|
|
|
976913
977219
|
}
|
|
976914
977220
|
};
|
|
976915
977221
|
async function getFileContents(filepath) {
|
|
976916
|
-
const buffer = await (0,
|
|
977222
|
+
const buffer = await (0, import_promises170.readFile)(filepath);
|
|
976917
977223
|
return buffer.toString();
|
|
976918
977224
|
}
|
|
976919
977225
|
var UNION_REGEX = /^(\s{2,})union:\s*$/gm;
|
|
@@ -976942,7 +977248,7 @@ var versionMigrations = {
|
|
|
976942
977248
|
var __default = versionMigrations;
|
|
976943
977249
|
|
|
976944
977250
|
// ../cli-migrations/lib/migrations/0.0.203/union-single-property-key/migration.js
|
|
976945
|
-
var
|
|
977251
|
+
var import_promises171 = require("fs/promises");
|
|
976946
977252
|
var import_yaml7 = __toESM(require_dist11(), 1);
|
|
976947
977253
|
|
|
976948
977254
|
// ../cli-migrations/lib/migrations/0.0.203/union-single-property-key/getAllYamlFiles.js
|
|
@@ -976986,7 +977292,7 @@ var migration2 = {
|
|
|
976986
977292
|
}
|
|
976987
977293
|
};
|
|
976988
977294
|
async function migrateFile(filepath, context3) {
|
|
976989
|
-
const contents = await (0,
|
|
977295
|
+
const contents = await (0, import_promises171.readFile)(filepath);
|
|
976990
977296
|
const parsedDocument = import_yaml7.default.parseDocument(contents.toString());
|
|
976991
977297
|
const types4 = parsedDocument.get("types");
|
|
976992
977298
|
if (types4 == null) {
|
|
@@ -977018,7 +977324,7 @@ async function migrateFile(filepath, context3) {
|
|
|
977018
977324
|
}
|
|
977019
977325
|
}
|
|
977020
977326
|
}
|
|
977021
|
-
await (0,
|
|
977327
|
+
await (0, import_promises171.writeFile)(filepath, parsedDocument.toString());
|
|
977022
977328
|
}
|
|
977023
977329
|
|
|
977024
977330
|
// ../cli-migrations/lib/migrations/0.0.203/index.js
|
|
@@ -977029,7 +977335,7 @@ var versionMigrations2 = {
|
|
|
977029
977335
|
var __default2 = versionMigrations2;
|
|
977030
977336
|
|
|
977031
977337
|
// ../cli-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/migration.js
|
|
977032
|
-
var
|
|
977338
|
+
var import_promises172 = require("fs/promises");
|
|
977033
977339
|
var import_yaml8 = __toESM(require_dist11(), 1);
|
|
977034
977340
|
|
|
977035
977341
|
// ../cli-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/getAllGeneratorYamlFiles.js
|
|
@@ -977073,7 +977379,7 @@ var migration3 = {
|
|
|
977073
977379
|
}
|
|
977074
977380
|
};
|
|
977075
977381
|
async function migrateGeneratorsYml(filepath, context3) {
|
|
977076
|
-
const contents = await (0,
|
|
977382
|
+
const contents = await (0, import_promises172.readFile)(filepath);
|
|
977077
977383
|
const parsedDocument = import_yaml8.default.parseDocument(contents.toString());
|
|
977078
977384
|
const draftGenerators = parsedDocument.get("draft");
|
|
977079
977385
|
if (draftGenerators == null) {
|
|
@@ -977100,7 +977406,7 @@ async function migrateGeneratorsYml(filepath, context3) {
|
|
|
977100
977406
|
draftGenerator.set("output-path", name2.value.includes("openapi") ? "./generated-openapi" : name2.value.includes("postman") ? "./generated-postman" : localOutput);
|
|
977101
977407
|
}
|
|
977102
977408
|
});
|
|
977103
|
-
await (0,
|
|
977409
|
+
await (0, import_promises172.writeFile)(filepath, parsedDocument.toString());
|
|
977104
977410
|
}
|
|
977105
977411
|
|
|
977106
977412
|
// ../cli-migrations/lib/migrations/0.0.207/index.js
|
|
@@ -977111,7 +977417,7 @@ var versionMigrations3 = {
|
|
|
977111
977417
|
var __default3 = versionMigrations3;
|
|
977112
977418
|
|
|
977113
977419
|
// ../cli-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/migration.js
|
|
977114
|
-
var
|
|
977420
|
+
var import_promises173 = require("fs/promises");
|
|
977115
977421
|
var import_yaml9 = __toESM(require_dist11(), 1);
|
|
977116
977422
|
|
|
977117
977423
|
// ../cli-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/getAllYamlFiles.js
|
|
@@ -977155,7 +977461,7 @@ var migration4 = {
|
|
|
977155
977461
|
}
|
|
977156
977462
|
};
|
|
977157
977463
|
async function migrateFile2(filepath, context3) {
|
|
977158
|
-
const contents = await (0,
|
|
977464
|
+
const contents = await (0, import_promises173.readFile)(filepath);
|
|
977159
977465
|
const parsedDocument = import_yaml9.default.parseDocument(contents.toString());
|
|
977160
977466
|
const addType = (typeName, typeDeclaration2) => {
|
|
977161
977467
|
const types4 = parsedDocument.get("types");
|
|
@@ -977199,7 +977505,7 @@ async function migrateFile2(filepath, context3) {
|
|
|
977199
977505
|
}
|
|
977200
977506
|
}
|
|
977201
977507
|
}
|
|
977202
|
-
await (0,
|
|
977508
|
+
await (0, import_promises173.writeFile)(filepath, parsedDocument.toString());
|
|
977203
977509
|
}
|
|
977204
977510
|
|
|
977205
977511
|
// ../cli-migrations/lib/migrations/0.0.210/index.js
|
|
@@ -977210,7 +977516,7 @@ var versionMigrations4 = {
|
|
|
977210
977516
|
var __default4 = versionMigrations4;
|
|
977211
977517
|
|
|
977212
977518
|
// ../cli-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/migration.js
|
|
977213
|
-
var
|
|
977519
|
+
var import_promises174 = require("fs/promises");
|
|
977214
977520
|
var import_yaml10 = __toESM(require_dist11(), 1);
|
|
977215
977521
|
|
|
977216
977522
|
// ../cli-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/getAllGeneratorYamlFiles.js
|
|
@@ -977254,7 +977560,7 @@ var migration5 = {
|
|
|
977254
977560
|
}
|
|
977255
977561
|
};
|
|
977256
977562
|
async function migrateGeneratorsYml2(filepath, context3) {
|
|
977257
|
-
const contents = await (0,
|
|
977563
|
+
const contents = await (0, import_promises174.readFile)(filepath);
|
|
977258
977564
|
const parsedDocument = import_yaml10.default.parseDocument(contents.toString());
|
|
977259
977565
|
const releaseGenerators = parsedDocument.get("release");
|
|
977260
977566
|
if (releaseGenerators == null) {
|
|
@@ -977292,7 +977598,7 @@ async function migrateGeneratorsYml2(filepath, context3) {
|
|
|
977292
977598
|
}
|
|
977293
977599
|
releaseGenerator.delete("outputs");
|
|
977294
977600
|
});
|
|
977295
|
-
await (0,
|
|
977601
|
+
await (0, import_promises174.writeFile)(filepath, parsedDocument.toString());
|
|
977296
977602
|
}
|
|
977297
977603
|
|
|
977298
977604
|
// ../cli-migrations/lib/migrations/0.0.212/index.js
|
|
@@ -977303,7 +977609,7 @@ var versionMigrations5 = {
|
|
|
977303
977609
|
var __default5 = versionMigrations5;
|
|
977304
977610
|
|
|
977305
977611
|
// ../cli-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/migration.js
|
|
977306
|
-
var
|
|
977612
|
+
var import_promises175 = require("fs/promises");
|
|
977307
977613
|
|
|
977308
977614
|
// ../cli-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/getAllYamlFiles.js
|
|
977309
977615
|
init_lib8();
|
|
@@ -977337,9 +977643,9 @@ var migration6 = {
|
|
|
977337
977643
|
run: async ({ context: context3 }) => {
|
|
977338
977644
|
const yamlFiles = await getAllYamlFiles4(context3);
|
|
977339
977645
|
for (const filepath of yamlFiles) {
|
|
977340
|
-
const contents = await (0,
|
|
977646
|
+
const contents = await (0, import_promises175.readFile)(filepath);
|
|
977341
977647
|
const newContents = contents.toString().replaceAll(" alias:", " type:");
|
|
977342
|
-
await (0,
|
|
977648
|
+
await (0, import_promises175.writeFile)(filepath, newContents);
|
|
977343
977649
|
}
|
|
977344
977650
|
}
|
|
977345
977651
|
};
|
|
@@ -977352,7 +977658,7 @@ var versionMigrations6 = {
|
|
|
977352
977658
|
var __default6 = versionMigrations6;
|
|
977353
977659
|
|
|
977354
977660
|
// ../cli-migrations/lib/migrations/0.0.221/add-error-discriminant/migration.js
|
|
977355
|
-
var
|
|
977661
|
+
var import_promises176 = require("fs/promises");
|
|
977356
977662
|
|
|
977357
977663
|
// ../cli-migrations/lib/migrations/0.0.221/add-error-discriminant/getAllRootApiYamlFiles.js
|
|
977358
977664
|
init_lib8();
|
|
@@ -977386,9 +977692,9 @@ var migration7 = {
|
|
|
977386
977692
|
run: async ({ context: context3 }) => {
|
|
977387
977693
|
const yamlFiles = await getAllRootApiYamlFiles(context3);
|
|
977388
977694
|
for (const filepath of yamlFiles) {
|
|
977389
|
-
const contents = await (0,
|
|
977695
|
+
const contents = await (0, import_promises176.readFile)(filepath);
|
|
977390
977696
|
const newContents = contents.toString() + "\nerror-discriminant: error";
|
|
977391
|
-
await (0,
|
|
977697
|
+
await (0, import_promises176.writeFile)(filepath, newContents);
|
|
977392
977698
|
}
|
|
977393
977699
|
}
|
|
977394
977700
|
};
|
|
@@ -977402,7 +977708,7 @@ var __default7 = versionMigrations7;
|
|
|
977402
977708
|
|
|
977403
977709
|
// ../cli-migrations/lib/migrations/0.0.241/add-generator-groups/migration.js
|
|
977404
977710
|
init_lib4();
|
|
977405
|
-
var
|
|
977711
|
+
var import_promises177 = require("fs/promises");
|
|
977406
977712
|
init_js_yaml();
|
|
977407
977713
|
|
|
977408
977714
|
// ../cli-migrations/lib/migrations/0.0.241/add-generator-groups/getAllGeneratorYamlFiles.js
|
|
@@ -977536,7 +977842,7 @@ var migration8 = {
|
|
|
977536
977842
|
}
|
|
977537
977843
|
};
|
|
977538
977844
|
async function migrateGeneratorsYml3(filepath) {
|
|
977539
|
-
const contentsStr = await (0,
|
|
977845
|
+
const contentsStr = await (0, import_promises177.readFile)(filepath);
|
|
977540
977846
|
const contents = index_vite_proxy_tmp_default.load(contentsStr.toString());
|
|
977541
977847
|
const oldGeneratorsConfiguration = GeneratorsConfigurationSchema2.parse(contents);
|
|
977542
977848
|
let newGeneratorsConfiguration = {};
|
|
@@ -977554,7 +977860,7 @@ async function migrateGeneratorsYml3(filepath) {
|
|
|
977554
977860
|
generators: oldGeneratorsConfiguration.release.map((releaseGeneratorInvocation) => convertReleaseGeneratorInvocation(releaseGeneratorInvocation))
|
|
977555
977861
|
};
|
|
977556
977862
|
}
|
|
977557
|
-
await (0,
|
|
977863
|
+
await (0, import_promises177.writeFile)(filepath, index_vite_proxy_tmp_default.dump(newGeneratorsConfiguration));
|
|
977558
977864
|
}
|
|
977559
977865
|
function convertDraftGeneratorInvocation(draftGeneratorInvocation) {
|
|
977560
977866
|
const newSchema = {
|
|
@@ -977629,7 +977935,7 @@ var versionMigrations8 = {
|
|
|
977629
977935
|
var __default8 = versionMigrations8;
|
|
977630
977936
|
|
|
977631
977937
|
// ../cli-migrations/lib/migrations/0.0.248/add-error-discrimination-config/migration.js
|
|
977632
|
-
var
|
|
977938
|
+
var import_promises178 = require("fs/promises");
|
|
977633
977939
|
var import_yaml11 = __toESM(require_dist11(), 1);
|
|
977634
977940
|
|
|
977635
977941
|
// ../cli-migrations/lib/migrations/0.0.248/add-error-discrimination-config/getAllRootApiYamlFiles.js
|
|
@@ -977673,7 +977979,7 @@ var migration9 = {
|
|
|
977673
977979
|
}
|
|
977674
977980
|
};
|
|
977675
977981
|
async function migrateRootApiFile(filepath) {
|
|
977676
|
-
const contents = await (0,
|
|
977982
|
+
const contents = await (0, import_promises178.readFile)(filepath);
|
|
977677
977983
|
const parsedDocument = import_yaml11.default.parseDocument(contents.toString());
|
|
977678
977984
|
const errorDiscriminant = parsedDocument.get("error-discriminant", true);
|
|
977679
977985
|
if (errorDiscriminant == null || !import_yaml11.default.isScalar(errorDiscriminant) || typeof errorDiscriminant.value !== "string") {
|
|
@@ -977684,7 +977990,7 @@ async function migrateRootApiFile(filepath) {
|
|
|
977684
977990
|
"property-name": errorDiscriminant.value
|
|
977685
977991
|
});
|
|
977686
977992
|
parsedDocument.delete("error-discriminant");
|
|
977687
|
-
await (0,
|
|
977993
|
+
await (0, import_promises178.writeFile)(filepath, parsedDocument.toString());
|
|
977688
977994
|
}
|
|
977689
977995
|
|
|
977690
977996
|
// ../cli-migrations/lib/migrations/0.0.248/index.js
|
|
@@ -977695,7 +978001,7 @@ var versionMigrations9 = {
|
|
|
977695
978001
|
var __default9 = versionMigrations9;
|
|
977696
978002
|
|
|
977697
978003
|
// ../cli-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/migration.js
|
|
977698
|
-
var
|
|
978004
|
+
var import_promises179 = require("fs/promises");
|
|
977699
978005
|
var import_yaml12 = __toESM(require_dist11(), 1);
|
|
977700
978006
|
|
|
977701
978007
|
// ../cli-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/getAllYamlFiles.js
|
|
@@ -977739,7 +978045,7 @@ var migration10 = {
|
|
|
977739
978045
|
}
|
|
977740
978046
|
};
|
|
977741
978047
|
async function migrateYamlFile(filepath, context3) {
|
|
977742
|
-
const contents = await (0,
|
|
978048
|
+
const contents = await (0, import_promises179.readFile)(filepath);
|
|
977743
978049
|
const parsedDocument = import_yaml12.default.parseDocument(contents.toString());
|
|
977744
978050
|
const services = parsedDocument.get("services");
|
|
977745
978051
|
if (services == null) {
|
|
@@ -977779,7 +978085,7 @@ async function migrateYamlFile(filepath, context3) {
|
|
|
977779
978085
|
context3.failWithoutThrowing("Failed to convert endpoint", e2);
|
|
977780
978086
|
}
|
|
977781
978087
|
}
|
|
977782
|
-
await (0,
|
|
978088
|
+
await (0, import_promises179.writeFile)(filepath, parsedDocument.toString());
|
|
977783
978089
|
}
|
|
977784
978090
|
}
|
|
977785
978091
|
function convertEndpoint4({ document: document4, endpoint: endpoint3 }) {
|
|
@@ -977858,7 +978164,7 @@ var versionMigrations10 = {
|
|
|
977858
978164
|
var __default10 = versionMigrations10;
|
|
977859
978165
|
|
|
977860
978166
|
// ../cli-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/migration.js
|
|
977861
|
-
var
|
|
978167
|
+
var import_promises180 = require("fs/promises");
|
|
977862
978168
|
var import_yaml13 = __toESM(require_dist11(), 1);
|
|
977863
978169
|
|
|
977864
978170
|
// ../cli-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/getAllYamlFiles.js
|
|
@@ -977902,7 +978208,7 @@ var migration11 = {
|
|
|
977902
978208
|
}
|
|
977903
978209
|
};
|
|
977904
978210
|
async function migrateYamlFile2(filepath, context3) {
|
|
977905
|
-
const contents = await (0,
|
|
978211
|
+
const contents = await (0, import_promises180.readFile)(filepath);
|
|
977906
978212
|
const parsedDocument = import_yaml13.default.parseDocument(contents.toString());
|
|
977907
978213
|
const types4 = parsedDocument.get("types");
|
|
977908
978214
|
if (types4 == null) {
|
|
@@ -977928,7 +978234,7 @@ async function migrateYamlFile2(filepath, context3) {
|
|
|
977928
978234
|
examples.set(i5, { value: value2 });
|
|
977929
978235
|
}
|
|
977930
978236
|
}
|
|
977931
|
-
await (0,
|
|
978237
|
+
await (0, import_promises180.writeFile)(filepath, parsedDocument.toString());
|
|
977932
978238
|
}
|
|
977933
978239
|
|
|
977934
978240
|
// ../cli-migrations/lib/migrations/0.3.0-rc12/index.js
|
|
@@ -977939,7 +978245,7 @@ var versionMigrations11 = {
|
|
|
977939
978245
|
var __default11 = versionMigrations11;
|
|
977940
978246
|
|
|
977941
978247
|
// ../cli-migrations/lib/migrations/0.3.23/change-services-key-to-service/migration.js
|
|
977942
|
-
var
|
|
978248
|
+
var import_promises181 = require("fs/promises");
|
|
977943
978249
|
var import_yaml14 = __toESM(require_dist11(), 1);
|
|
977944
978250
|
|
|
977945
978251
|
// ../cli-migrations/lib/migrations/0.3.23/change-services-key-to-service/getAllYamlFiles.js
|
|
@@ -977983,7 +978289,7 @@ var migration12 = {
|
|
|
977983
978289
|
}
|
|
977984
978290
|
};
|
|
977985
978291
|
async function migrateYamlFile3(filepath, context3) {
|
|
977986
|
-
const contents = await (0,
|
|
978292
|
+
const contents = await (0, import_promises181.readFile)(filepath);
|
|
977987
978293
|
const parsedDocument = import_yaml14.default.parseDocument(contents.toString());
|
|
977988
978294
|
if (!import_yaml14.default.isMap(parsedDocument.contents)) {
|
|
977989
978295
|
return context3.failAndThrow("File is not a map");
|
|
@@ -978013,7 +978319,7 @@ async function migrateYamlFile3(filepath, context3) {
|
|
|
978013
978319
|
pair.value = firstService.value;
|
|
978014
978320
|
}
|
|
978015
978321
|
}
|
|
978016
|
-
await (0,
|
|
978322
|
+
await (0, import_promises181.writeFile)(filepath, parsedDocument.toString());
|
|
978017
978323
|
}
|
|
978018
978324
|
|
|
978019
978325
|
// ../cli-migrations/lib/migrations/0.3.23/index.js
|
|
@@ -978024,7 +978330,7 @@ var versionMigrations12 = {
|
|
|
978024
978330
|
var __default12 = versionMigrations12;
|
|
978025
978331
|
|
|
978026
978332
|
// ../cli-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/migration.js
|
|
978027
|
-
var
|
|
978333
|
+
var import_promises182 = require("fs/promises");
|
|
978028
978334
|
var import_yaml15 = __toESM(require_dist11(), 1);
|
|
978029
978335
|
|
|
978030
978336
|
// ../cli-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/getAllYamlFiles.js
|
|
@@ -978068,7 +978374,7 @@ var migration13 = {
|
|
|
978068
978374
|
}
|
|
978069
978375
|
};
|
|
978070
978376
|
async function migrateYamlFile4(filepath, context3) {
|
|
978071
|
-
const contents = await (0,
|
|
978377
|
+
const contents = await (0, import_promises182.readFile)(filepath);
|
|
978072
978378
|
const parsedDocument = import_yaml15.default.parseDocument(contents.toString());
|
|
978073
978379
|
if (!import_yaml15.default.isMap(parsedDocument.contents)) {
|
|
978074
978380
|
return context3.failAndThrow("File is not a map");
|
|
@@ -978087,7 +978393,7 @@ async function migrateYamlFile4(filepath, context3) {
|
|
|
978087
978393
|
}
|
|
978088
978394
|
service.items.splice(indexOfServiceDocsPair, 1);
|
|
978089
978395
|
parsedDocument.contents.items.unshift(docsPair);
|
|
978090
|
-
await (0,
|
|
978396
|
+
await (0, import_promises182.writeFile)(filepath, parsedDocument.toString());
|
|
978091
978397
|
}
|
|
978092
978398
|
|
|
978093
978399
|
// ../cli-migrations/lib/migrations/0.5.4/index.js
|
|
@@ -978098,7 +978404,7 @@ var versionMigrations13 = {
|
|
|
978098
978404
|
var __default13 = versionMigrations13;
|
|
978099
978405
|
|
|
978100
978406
|
// ../cli-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/migration.js
|
|
978101
|
-
var
|
|
978407
|
+
var import_promises183 = require("fs/promises");
|
|
978102
978408
|
|
|
978103
978409
|
// ../cli-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/getAllGeneratorYamlFiles.js
|
|
978104
978410
|
init_lib8();
|
|
@@ -978141,14 +978447,14 @@ var migration14 = {
|
|
|
978141
978447
|
}
|
|
978142
978448
|
};
|
|
978143
978449
|
async function migrateYamlFile5(filepath) {
|
|
978144
|
-
const contents = await (0,
|
|
978450
|
+
const contents = await (0, import_promises183.readFile)(filepath);
|
|
978145
978451
|
const domainSuffix = process.env.DOMAIN_SUFFIX ?? "docs.buildwithfern.com";
|
|
978146
978452
|
const regex6 = /(docs:\s*domain:\s*)"([^"]*)"/g;
|
|
978147
978453
|
const updatedSnapshot = contents.toString().replace(regex6, (_match, _prefix, domain3) => {
|
|
978148
978454
|
return `docs:
|
|
978149
978455
|
domain: "${domain3}.${domainSuffix}"`;
|
|
978150
978456
|
});
|
|
978151
|
-
await (0,
|
|
978457
|
+
await (0, import_promises183.writeFile)(filepath, updatedSnapshot.toString());
|
|
978152
978458
|
}
|
|
978153
978459
|
|
|
978154
978460
|
// ../cli-migrations/lib/migrations/0.9.10/index.js
|
|
@@ -978169,11 +978475,11 @@ var LegacyDocsSerializers = __toESM(require_serialization4(), 1);
|
|
|
978169
978475
|
|
|
978170
978476
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/loadRawDocsConfiguration.js
|
|
978171
978477
|
init_lib8();
|
|
978172
|
-
var
|
|
978478
|
+
var import_promises184 = require("fs/promises");
|
|
978173
978479
|
init_js_yaml();
|
|
978174
978480
|
async function loadRawDocsConfiguration2({ absolutePathToWorkspace }) {
|
|
978175
978481
|
const filepath = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
978176
|
-
const contentsStr = await (0,
|
|
978482
|
+
const contentsStr = await (0, import_promises184.readFile)(filepath);
|
|
978177
978483
|
const contentsParsed = index_vite_proxy_tmp_default.load(contentsStr.toString());
|
|
978178
978484
|
const result = await LegacyDocsSerializers.DocsConfiguration.parse(contentsParsed);
|
|
978179
978485
|
if (result.ok) {
|
|
@@ -978192,7 +978498,7 @@ function getAbsolutePathToDocsFolder({ absolutePathToWorkspace }) {
|
|
|
978192
978498
|
|
|
978193
978499
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndMultipleAPIs.js
|
|
978194
978500
|
init_lib8();
|
|
978195
|
-
var
|
|
978501
|
+
var import_promises186 = require("fs/promises");
|
|
978196
978502
|
init_js_yaml();
|
|
978197
978503
|
|
|
978198
978504
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/convertLegacyDocsConfig.js
|
|
@@ -978401,11 +978707,11 @@ __export(legacy_exports, {
|
|
|
978401
978707
|
|
|
978402
978708
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/generators-configuration/loadRawGeneratorsConfiguration.js
|
|
978403
978709
|
init_lib8();
|
|
978404
|
-
var
|
|
978710
|
+
var import_promises185 = require("fs/promises");
|
|
978405
978711
|
init_js_yaml();
|
|
978406
978712
|
async function loadRawGeneratorsConfiguration2({ absolutePathToWorkspace }) {
|
|
978407
978713
|
const filepath = getAbsolutePathToGeneratorsConfiguration({ absolutePathToWorkspace });
|
|
978408
|
-
const contentsStr = await (0,
|
|
978714
|
+
const contentsStr = await (0, import_promises185.readFile)(filepath);
|
|
978409
978715
|
const contentsParsed = index_vite_proxy_tmp_default.load(contentsStr.toString());
|
|
978410
978716
|
const result = await legacy_exports.GeneratorsConfigurationSchema.safeParseAsync(contentsParsed);
|
|
978411
978717
|
if (result.success) {
|
|
@@ -978435,7 +978741,7 @@ function migrateDocsInstances(docsURLs) {
|
|
|
978435
978741
|
var APIS_DIRECTORY2 = "apis";
|
|
978436
978742
|
async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspaces, workspaceContainingDocs }) {
|
|
978437
978743
|
const absolutePathToApisDirectory = join8(absolutePathToFernDirectory, RelativeFilePath2.of(APIS_DIRECTORY2));
|
|
978438
|
-
await (0,
|
|
978744
|
+
await (0, import_promises186.mkdir)(absolutePathToApisDirectory);
|
|
978439
978745
|
for (const workspace of workspaces) {
|
|
978440
978746
|
const absolutePathToWorkspace = join8(absolutePathToFernDirectory, RelativeFilePath2.of(workspace));
|
|
978441
978747
|
const docsURLs = await migrateAndWriteGeneratorsYml({ absolutePathToWorkspace });
|
|
@@ -978443,11 +978749,11 @@ async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspa
|
|
|
978443
978749
|
await migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName: workspaceContainingDocs });
|
|
978444
978750
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
978445
978751
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
978446
|
-
await (0,
|
|
978752
|
+
await (0, import_promises186.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
978447
978753
|
}
|
|
978448
978754
|
const absolutePathToNestedWorkspace = join8(absolutePathToApisDirectory, RelativeFilePath2.of(workspace));
|
|
978449
978755
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
978450
|
-
await (0,
|
|
978756
|
+
await (0, import_promises186.rm)(absolutePathToWorkspace, { recursive: true });
|
|
978451
978757
|
}
|
|
978452
978758
|
}
|
|
978453
978759
|
async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
@@ -978460,7 +978766,7 @@ async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
|
978460
978766
|
generatorsConfiguration,
|
|
978461
978767
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
978462
978768
|
});
|
|
978463
|
-
await (0,
|
|
978769
|
+
await (0, import_promises186.writeFile)(absolutePathToGeneratorsConfiguration, index_vite_proxy_tmp_default.dump(convertedResponse.value));
|
|
978464
978770
|
return convertedResponse.docsURLs;
|
|
978465
978771
|
}
|
|
978466
978772
|
async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName }) {
|
|
@@ -978474,12 +978780,12 @@ async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiNa
|
|
|
978474
978780
|
apiName
|
|
978475
978781
|
});
|
|
978476
978782
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
978477
|
-
await (0,
|
|
978783
|
+
await (0, import_promises186.writeFile)(absolutePathToDocsConfig, index_vite_proxy_tmp_default.dump(convertedDocsConfig));
|
|
978478
978784
|
}
|
|
978479
978785
|
|
|
978480
978786
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndSingleAPI.js
|
|
978481
978787
|
init_lib8();
|
|
978482
|
-
var
|
|
978788
|
+
var import_promises187 = require("fs/promises");
|
|
978483
978789
|
init_js_yaml();
|
|
978484
978790
|
async function migrateDocsAndSingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
978485
978791
|
const docsURLs = await migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace });
|
|
@@ -978487,8 +978793,8 @@ async function migrateDocsAndSingleAPI({ absolutePathToFernDirectory, absolutePa
|
|
|
978487
978793
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
978488
978794
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
978489
978795
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
978490
|
-
await (0,
|
|
978491
|
-
await (0,
|
|
978796
|
+
await (0, import_promises187.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
978797
|
+
await (0, import_promises187.rm)(absolutePathToWorkspace, { recursive: true });
|
|
978492
978798
|
}
|
|
978493
978799
|
async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
978494
978800
|
const docsConfiguration = await loadRawDocsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -978501,7 +978807,7 @@ async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
|
978501
978807
|
apiName: void 0
|
|
978502
978808
|
});
|
|
978503
978809
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
978504
|
-
await (0,
|
|
978810
|
+
await (0, import_promises187.writeFile)(absolutePathToDocsConfig, index_vite_proxy_tmp_default.dump(convertedDocsConfig));
|
|
978505
978811
|
}
|
|
978506
978812
|
async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
978507
978813
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -978513,24 +978819,24 @@ async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
|
978513
978819
|
generatorsConfiguration,
|
|
978514
978820
|
pathModificationStrategy: "MoveUp"
|
|
978515
978821
|
});
|
|
978516
|
-
await (0,
|
|
978822
|
+
await (0, import_promises187.writeFile)(absolutePathToGeneratorsConfiguration, index_vite_proxy_tmp_default.dump(convertedResponse.value));
|
|
978517
978823
|
return convertedResponse.docsURLs;
|
|
978518
978824
|
}
|
|
978519
978825
|
|
|
978520
978826
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlyMultipleAPIs.js
|
|
978521
978827
|
init_lib8();
|
|
978522
|
-
var
|
|
978828
|
+
var import_promises188 = require("fs/promises");
|
|
978523
978829
|
init_js_yaml();
|
|
978524
978830
|
var APIS_DIRECTORY3 = "apis";
|
|
978525
978831
|
async function migrateOnlyMultipleAPIs({ absolutePathToFernDirectory, workspaces }) {
|
|
978526
978832
|
const absolutePathToApisDirectory = join8(absolutePathToFernDirectory, RelativeFilePath2.of(APIS_DIRECTORY3));
|
|
978527
|
-
await (0,
|
|
978833
|
+
await (0, import_promises188.mkdir)(absolutePathToApisDirectory);
|
|
978528
978834
|
for (const workspace of workspaces) {
|
|
978529
978835
|
const absolutePathToWorkspace = join8(absolutePathToFernDirectory, RelativeFilePath2.of(workspace));
|
|
978530
978836
|
await migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace });
|
|
978531
978837
|
const absolutePathToNestedWorkspace = join8(absolutePathToApisDirectory, RelativeFilePath2.of(workspace));
|
|
978532
978838
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
978533
|
-
await (0,
|
|
978839
|
+
await (0, import_promises188.rm)(absolutePathToWorkspace, { recursive: true });
|
|
978534
978840
|
}
|
|
978535
978841
|
}
|
|
978536
978842
|
async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
@@ -978543,17 +978849,17 @@ async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
|
978543
978849
|
generatorsConfiguration,
|
|
978544
978850
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
978545
978851
|
});
|
|
978546
|
-
await (0,
|
|
978852
|
+
await (0, import_promises188.writeFile)(absolutePathToGeneratorsConfiguration, index_vite_proxy_tmp_default.dump(convertedResponse.value));
|
|
978547
978853
|
}
|
|
978548
978854
|
|
|
978549
978855
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlySingleAPI.js
|
|
978550
978856
|
init_lib8();
|
|
978551
|
-
var
|
|
978857
|
+
var import_promises189 = require("fs/promises");
|
|
978552
978858
|
init_js_yaml();
|
|
978553
978859
|
async function migrateOnlySingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
978554
978860
|
await migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace });
|
|
978555
978861
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
978556
|
-
await (0,
|
|
978862
|
+
await (0, import_promises189.rm)(absolutePathToWorkspace, { recursive: true });
|
|
978557
978863
|
}
|
|
978558
978864
|
async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
978559
978865
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -978565,7 +978871,7 @@ async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
|
978565
978871
|
generatorsConfiguration,
|
|
978566
978872
|
pathModificationStrategy: "MoveUp"
|
|
978567
978873
|
});
|
|
978568
|
-
await (0,
|
|
978874
|
+
await (0, import_promises189.writeFile)(absolutePathToGeneratorsConfiguration, index_vite_proxy_tmp_default.dump(convertedResponse.value));
|
|
978569
978875
|
}
|
|
978570
978876
|
|
|
978571
978877
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migration.js
|
|
@@ -978645,7 +978951,7 @@ var __default15 = versionMigrations15;
|
|
|
978645
978951
|
init_lib19();
|
|
978646
978952
|
init_lib8();
|
|
978647
978953
|
init_source();
|
|
978648
|
-
var
|
|
978954
|
+
var import_promises190 = require("fs/promises");
|
|
978649
978955
|
init_js_yaml();
|
|
978650
978956
|
var import_yaml16 = __toESM(require_dist11(), 1);
|
|
978651
978957
|
var migration16 = {
|
|
@@ -978689,7 +978995,7 @@ async function addApiConfigurationToSingleWorkspace({ absolutePathToFernDirector
|
|
|
978689
978995
|
if (existingGeneratorsYml == null) {
|
|
978690
978996
|
if (openapiDirectory != null && openapiDirectory.contents[0] != null) {
|
|
978691
978997
|
const absolutePathToGeneratorsYml = join8(absoluteFilepathToWorkspace, RelativeFilePath2.of("generators.yml"));
|
|
978692
|
-
await (0,
|
|
978998
|
+
await (0, import_promises190.writeFile)(absolutePathToGeneratorsYml, index_vite_proxy_tmp_default.dump({
|
|
978693
978999
|
api: {
|
|
978694
979000
|
path: join8(relativize(absolutePathToFernDirectory, absoluteFilepathToWorkspace), RelativeFilePath2.of(openapiDirectory.name), RelativeFilePath2.of(openapiDirectory.contents[0]?.name))
|
|
978695
979001
|
}
|
|
@@ -978704,7 +979010,7 @@ async function addApiConfigurationToSingleWorkspace({ absolutePathToFernDirector
|
|
|
978704
979010
|
parsedDocument.set("api", {
|
|
978705
979011
|
path: join8(relativize(absolutePathToFernDirectory, absoluteFilepathToWorkspace), RelativeFilePath2.of(openapiDirectory.name), RelativeFilePath2.of(openapiDirectory.contents[0]?.name))
|
|
978706
979012
|
});
|
|
978707
|
-
await (0,
|
|
979013
|
+
await (0, import_promises190.writeFile)(existingGeneratorsYml.absolutePath, parsedDocument.toString());
|
|
978708
979014
|
context3.logger.info(source_default.green(`Updated ${existingGeneratorsYml.absolutePath}`));
|
|
978709
979015
|
}
|
|
978710
979016
|
}
|
|
@@ -978734,7 +979040,7 @@ var __default16 = versionMigrations16;
|
|
|
978734
979040
|
init_lib19();
|
|
978735
979041
|
init_lib8();
|
|
978736
979042
|
init_source();
|
|
978737
|
-
var
|
|
979043
|
+
var import_promises191 = require("fs/promises");
|
|
978738
979044
|
init_js_yaml();
|
|
978739
979045
|
var import_yaml17 = __toESM(require_dist11(), 1);
|
|
978740
979046
|
var migration17 = {
|
|
@@ -978915,7 +979221,7 @@ async function addApiConfigurationToSingleWorkspace2({ absoluteFilepathToWorkspa
|
|
|
978915
979221
|
if (schemaComment && documentToWrite.indexOf(schemaComment) === -1) {
|
|
978916
979222
|
documentToWrite = `${schemaComment}${documentToWrite}`;
|
|
978917
979223
|
}
|
|
978918
|
-
await (0,
|
|
979224
|
+
await (0, import_promises191.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
978919
979225
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
978920
979226
|
}
|
|
978921
979227
|
async function parseApiSpec({ oldSpec, absoluteFilepathToWorkspace, files, directories, context: context3, namespace }) {
|
|
@@ -978962,7 +979268,7 @@ async function parseApiSpec({ oldSpec, absoluteFilepathToWorkspace, files, direc
|
|
|
978962
979268
|
}
|
|
978963
979269
|
let specContent;
|
|
978964
979270
|
try {
|
|
978965
|
-
const fileContents = await (0,
|
|
979271
|
+
const fileContents = await (0, import_promises191.readFile)(absoluteSpecPath, { encoding: "utf-8" });
|
|
978966
979272
|
specContent = index_vite_proxy_tmp_default.load(fileContents);
|
|
978967
979273
|
} catch (e2) {
|
|
978968
979274
|
context3.logger.warn(`Failed to read API spec file ${spec.path}. Error: ${e2}. Skipping...`);
|
|
@@ -979068,7 +979374,7 @@ var __default17 = versionMigrations17;
|
|
|
979068
979374
|
init_lib19();
|
|
979069
979375
|
init_lib8();
|
|
979070
979376
|
init_source();
|
|
979071
|
-
var
|
|
979377
|
+
var import_promises192 = require("fs/promises");
|
|
979072
979378
|
init_js_yaml();
|
|
979073
979379
|
var migration18 = {
|
|
979074
979380
|
name: "add-path-parameter-order-setting",
|
|
@@ -979157,7 +979463,7 @@ async function updateGeneratorsYml({ context: context3, files }) {
|
|
|
979157
979463
|
documentToWrite = `${schemaComment}
|
|
979158
979464
|
${documentToWrite}`;
|
|
979159
979465
|
}
|
|
979160
|
-
await (0,
|
|
979466
|
+
await (0, import_promises192.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
979161
979467
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
979162
979468
|
}
|
|
979163
979469
|
async function getFilesAndDirectories3(absoluteFilepath) {
|
|
@@ -979196,7 +979502,7 @@ var __default18 = versionMigrations18;
|
|
|
979196
979502
|
init_lib19();
|
|
979197
979503
|
init_lib8();
|
|
979198
979504
|
init_source();
|
|
979199
|
-
var
|
|
979505
|
+
var import_promises193 = require("fs/promises");
|
|
979200
979506
|
init_js_yaml();
|
|
979201
979507
|
var migration19 = {
|
|
979202
979508
|
name: "update-1_0_0-defaults",
|
|
@@ -979372,7 +979678,7 @@ async function updateGeneratorsYml2({ context: context3, files }) {
|
|
|
979372
979678
|
documentToWrite = `${schemaComment}
|
|
979373
979679
|
${documentToWrite}`;
|
|
979374
979680
|
}
|
|
979375
|
-
await (0,
|
|
979681
|
+
await (0, import_promises193.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
979376
979682
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
979377
979683
|
}
|
|
979378
979684
|
async function getFilesAndDirectories4(absoluteFilepath) {
|
|
@@ -979444,7 +979750,7 @@ var __default19 = versionMigrations19;
|
|
|
979444
979750
|
init_lib19();
|
|
979445
979751
|
init_lib8();
|
|
979446
979752
|
init_source();
|
|
979447
|
-
var
|
|
979753
|
+
var import_promises194 = require("fs/promises");
|
|
979448
979754
|
init_js_yaml();
|
|
979449
979755
|
var migration20 = {
|
|
979450
979756
|
name: "update-2_0_0-defaults",
|
|
@@ -979620,7 +979926,7 @@ async function updateGeneratorsYml3({ context: context3, files }) {
|
|
|
979620
979926
|
documentToWrite = `${schemaComment}
|
|
979621
979927
|
${documentToWrite}`;
|
|
979622
979928
|
}
|
|
979623
|
-
await (0,
|
|
979929
|
+
await (0, import_promises194.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
979624
979930
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
979625
979931
|
}
|
|
979626
979932
|
async function getFilesAndDirectories5(absoluteFilepath) {
|
|
@@ -979669,7 +979975,7 @@ var __default20 = versionMigrations20;
|
|
|
979669
979975
|
init_lib19();
|
|
979670
979976
|
init_lib8();
|
|
979671
979977
|
init_source();
|
|
979672
|
-
var
|
|
979978
|
+
var import_promises195 = require("fs/promises");
|
|
979673
979979
|
init_js_yaml();
|
|
979674
979980
|
var migration21 = {
|
|
979675
979981
|
name: "migrate-deprecated-generator-api-settings",
|
|
@@ -979761,7 +980067,7 @@ async function updateGeneratorsYml4({ context: context3, files }) {
|
|
|
979761
980067
|
documentToWrite = `${schemaComment}
|
|
979762
980068
|
${documentToWrite}`;
|
|
979763
980069
|
}
|
|
979764
|
-
await (0,
|
|
980070
|
+
await (0, import_promises195.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
979765
980071
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
979766
980072
|
}
|
|
979767
980073
|
function migrateDeprecatedSettings(settings, context3) {
|
|
@@ -979810,7 +980116,7 @@ var __default21 = versionMigrations21;
|
|
|
979810
980116
|
init_lib19();
|
|
979811
980117
|
init_lib8();
|
|
979812
980118
|
init_source();
|
|
979813
|
-
var
|
|
980119
|
+
var import_promises196 = require("fs/promises");
|
|
979814
980120
|
init_js_yaml();
|
|
979815
980121
|
var migration22 = {
|
|
979816
980122
|
name: "enable-smart-casing",
|
|
@@ -979895,7 +980201,7 @@ async function updateGeneratorsYml5({ context: context3, files }) {
|
|
|
979895
980201
|
documentToWrite = `${schemaComment}
|
|
979896
980202
|
${documentToWrite}`;
|
|
979897
980203
|
}
|
|
979898
|
-
await (0,
|
|
980204
|
+
await (0, import_promises196.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
979899
980205
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
979900
980206
|
}
|
|
979901
980207
|
function setSmartCasingFalseIfNotConfigured(generator, context3) {
|
|
@@ -979935,7 +980241,7 @@ var __default22 = versionMigrations22;
|
|
|
979935
980241
|
init_lib19();
|
|
979936
980242
|
init_lib8();
|
|
979937
980243
|
init_source();
|
|
979938
|
-
var
|
|
980244
|
+
var import_promises197 = require("fs/promises");
|
|
979939
980245
|
init_js_yaml();
|
|
979940
980246
|
var migration23 = {
|
|
979941
980247
|
name: "disable-disambiguate-request-names",
|
|
@@ -980060,7 +980366,7 @@ async function updateGeneratorsYml6({ context: context3, files }) {
|
|
|
980060
980366
|
documentToWrite = `${schemaComment}
|
|
980061
980367
|
${documentToWrite}`;
|
|
980062
980368
|
}
|
|
980063
|
-
await (0,
|
|
980369
|
+
await (0, import_promises197.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
980064
980370
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
980065
980371
|
}
|
|
980066
980372
|
async function getFilesAndDirectories8(absoluteFilepath) {
|
|
@@ -980195,7 +980501,7 @@ init_lib33();
|
|
|
980195
980501
|
init_lib27();
|
|
980196
980502
|
init_lib6();
|
|
980197
980503
|
init_source();
|
|
980198
|
-
var
|
|
980504
|
+
var import_promises198 = require("fs/promises");
|
|
980199
980505
|
|
|
980200
980506
|
// ../../../node_modules/.pnpm/immer@10.2.0/node_modules/immer/dist/immer.mjs
|
|
980201
980507
|
var NOTHING = /* @__PURE__ */ Symbol.for("immer-nothing");
|
|
@@ -981599,7 +981905,7 @@ async function upgrade({
|
|
|
981599
981905
|
const newProjectConfig = produce(projectConfig2.rawConfig, (draft) => {
|
|
981600
981906
|
draft.version = resolvedTargetVersion;
|
|
981601
981907
|
});
|
|
981602
|
-
await (0,
|
|
981908
|
+
await (0, import_promises198.writeFile)(
|
|
981603
981909
|
projectConfig2._absolutePath,
|
|
981604
981910
|
ensureFinalNewline(JSON.stringify(newProjectConfig, void 0, 2))
|
|
981605
981911
|
);
|
|
@@ -981806,7 +982112,7 @@ async function upgradeGeneratorsForAllWorkspaces({
|
|
|
981806
982112
|
absolutePathToWorkspace: workspace.absoluteFilePath
|
|
981807
982113
|
});
|
|
981808
982114
|
if (absolutePathToGeneratorsConfiguration != null && result.updatedConfiguration != null) {
|
|
981809
|
-
await (0,
|
|
982115
|
+
await (0, import_promises199.writeFile)(absolutePathToGeneratorsConfiguration, result.updatedConfiguration);
|
|
981810
982116
|
}
|
|
981811
982117
|
for (const upgrade2 of result.appliedUpgrades) {
|
|
981812
982118
|
const normalizedName = addDefaultDockerOrgIfNotPresent(upgrade2.generatorName);
|
|
@@ -982284,7 +982590,7 @@ async function previewDocsWorkspace({
|
|
|
982284
982590
|
// src/commands/docs-diff/docsDiff.ts
|
|
982285
982591
|
init_lib8();
|
|
982286
982592
|
init_lib6();
|
|
982287
|
-
var
|
|
982593
|
+
var import_promises200 = require("fs/promises");
|
|
982288
982594
|
var import_pngjs2 = __toESM(require_png(), 1);
|
|
982289
982595
|
async function getSlugForFiles2({
|
|
982290
982596
|
previewUrl,
|
|
@@ -982507,8 +982813,8 @@ async function generateComparisons2({
|
|
|
982507
982813
|
afterPath,
|
|
982508
982814
|
comparisonBasePath
|
|
982509
982815
|
}) {
|
|
982510
|
-
const beforePng = import_pngjs2.PNG.sync.read(await (0,
|
|
982511
|
-
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));
|
|
982512
982818
|
const beforeOriginalHeight = beforePng.height;
|
|
982513
982819
|
const afterOriginalHeight = afterPng.height;
|
|
982514
982820
|
const width = Math.max(beforePng.width, afterPng.width);
|
|
@@ -982546,7 +982852,7 @@ async function generateComparisons2({
|
|
|
982546
982852
|
const sideBySide = createSideBySideComparison2(croppedBefore, croppedAfter, 20, true);
|
|
982547
982853
|
const outPath = `${base4}-region-${i5 + 1}.png`;
|
|
982548
982854
|
const pngBuffer = import_pngjs2.PNG.sync.write(sideBySide);
|
|
982549
|
-
await (0,
|
|
982855
|
+
await (0, import_promises200.writeFile)(outPath, new Uint8Array(pngBuffer));
|
|
982550
982856
|
results.push({ changePercent, boundingBox, comparisonPath: outPath });
|
|
982551
982857
|
}
|
|
982552
982858
|
return results;
|
|
@@ -982625,7 +982931,7 @@ async function docsDiff({
|
|
|
982625
982931
|
outputDir.startsWith("/") ? outputDir : join8(cwd(), RelativeFilePath2.of(outputDir))
|
|
982626
982932
|
);
|
|
982627
982933
|
if (!await doesPathExist(outputPath)) {
|
|
982628
|
-
await (0,
|
|
982934
|
+
await (0, import_promises200.mkdir)(outputPath, { recursive: true });
|
|
982629
982935
|
}
|
|
982630
982936
|
const results = [];
|
|
982631
982937
|
await cliContext.runTask(async (context3) => {
|
|
@@ -983027,7 +983333,7 @@ init_lib6();
|
|
|
983027
983333
|
// src/commands/docs-theme/ThemeExporter.ts
|
|
983028
983334
|
init_lib12();
|
|
983029
983335
|
init_lib8();
|
|
983030
|
-
var
|
|
983336
|
+
var import_promises201 = require("fs/promises");
|
|
983031
983337
|
init_js_yaml();
|
|
983032
983338
|
var import_path110 = __toESM(require("path"), 1);
|
|
983033
983339
|
var ThemeExporter = class {
|
|
@@ -983040,18 +983346,18 @@ var ThemeExporter = class {
|
|
|
983040
983346
|
const docsDir = import_path110.default.dirname(docsYmlPath);
|
|
983041
983347
|
const outDir = output2 != null ? import_path110.default.resolve(process.cwd(), output2) : import_path110.default.join(this.docsWorkspace.absoluteFilePath, "theme");
|
|
983042
983348
|
context3.logger.info(`Exporting theme-eligible fields from docs.yml \u2192 ${outDir}`);
|
|
983043
|
-
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"));
|
|
983044
983350
|
const themeConfig = {};
|
|
983045
983351
|
for (const [k4, v3] of Object.entries(raw)) {
|
|
983046
983352
|
if (docs_yml_exports.THEME_ELIGIBLE_YAML_KEYS.has(k4)) {
|
|
983047
983353
|
themeConfig[k4] = v3;
|
|
983048
983354
|
}
|
|
983049
983355
|
}
|
|
983050
|
-
await (0,
|
|
983356
|
+
await (0, import_promises201.mkdir)(outDir, { recursive: true });
|
|
983051
983357
|
const assetsDir = import_path110.default.join(outDir, "assets");
|
|
983052
|
-
await (0,
|
|
983358
|
+
await (0, import_promises201.mkdir)(assetsDir, { recursive: true });
|
|
983053
983359
|
const exported = await copyLocalFiles(themeConfig, docsDir, assetsDir);
|
|
983054
|
-
await (0,
|
|
983360
|
+
await (0, import_promises201.writeFile)(import_path110.default.join(outDir, "theme.yml"), index_vite_proxy_tmp_default.dump(exported), "utf-8");
|
|
983055
983361
|
context3.logger.info(`Theme exported to ${outDir}/theme.yml`);
|
|
983056
983362
|
}
|
|
983057
983363
|
};
|
|
@@ -983065,8 +983371,8 @@ async function copyLocalFiles(obj, sourceDir, assetsDir) {
|
|
|
983065
983371
|
const destRelative = relFromSource.startsWith("..") ? relFromProject.startsWith("..") ? import_path110.default.basename(abs) : relFromProject : relFromSource;
|
|
983066
983372
|
const dest = import_path110.default.join(assetsDir, destRelative);
|
|
983067
983373
|
try {
|
|
983068
|
-
await (0,
|
|
983069
|
-
await (0,
|
|
983374
|
+
await (0, import_promises201.mkdir)(import_path110.default.dirname(dest), { recursive: true });
|
|
983375
|
+
await (0, import_promises201.copyFile)(abs, dest);
|
|
983070
983376
|
return `./assets/${destRelative.split(import_path110.default.sep).join("/")}`;
|
|
983071
983377
|
} catch {
|
|
983072
983378
|
return obj;
|
|
@@ -983158,7 +983464,7 @@ async function listDocsThemes({
|
|
|
983158
983464
|
|
|
983159
983465
|
// src/commands/docs-theme/uploadDocsTheme.ts
|
|
983160
983466
|
init_lib6();
|
|
983161
|
-
var
|
|
983467
|
+
var import_promises203 = require("fs/promises");
|
|
983162
983468
|
init_js_yaml();
|
|
983163
983469
|
var import_path112 = __toESM(require("path"), 1);
|
|
983164
983470
|
|
|
@@ -983167,7 +983473,7 @@ init_lib8();
|
|
|
983167
983473
|
init_lib6();
|
|
983168
983474
|
var import_child_process13 = require("child_process");
|
|
983169
983475
|
var import_crypto10 = require("crypto");
|
|
983170
|
-
var
|
|
983476
|
+
var import_promises202 = require("fs/promises");
|
|
983171
983477
|
var import_mime_types2 = __toESM(require_mime_types(), 1);
|
|
983172
983478
|
var import_path111 = __toESM(require("path"), 1);
|
|
983173
983479
|
function getGitRoot() {
|
|
@@ -983211,7 +983517,7 @@ var ThemeConfigProcessor = class {
|
|
|
983211
983517
|
filePaths.map(async (filePath) => {
|
|
983212
983518
|
const abs = import_path111.default.resolve(this.themeDir, filePath);
|
|
983213
983519
|
try {
|
|
983214
|
-
await (0,
|
|
983520
|
+
await (0, import_promises202.access)(abs);
|
|
983215
983521
|
} catch {
|
|
983216
983522
|
errors4.push(`Referenced file not found: ${abs}`);
|
|
983217
983523
|
}
|
|
@@ -983376,7 +983682,7 @@ ${errors4.map((e2) => ` - ${e2}`).join("\n")}`,
|
|
|
983376
983682
|
return { config: cfg, filesUploaded };
|
|
983377
983683
|
}
|
|
983378
983684
|
async uploadFileToCas(absolutePath) {
|
|
983379
|
-
const content5 = await (0,
|
|
983685
|
+
const content5 = await (0, import_promises202.readFile)(absolutePath);
|
|
983380
983686
|
const contentType = import_mime_types2.default.lookup(absolutePath) || "application/octet-stream";
|
|
983381
983687
|
const bindPath = posixBindPath(this.gitRoot, absolutePath);
|
|
983382
983688
|
return this.uploadToCas(content5, contentType, bindPath, import_path111.default.basename(absolutePath));
|
|
@@ -983491,7 +983797,7 @@ async function uploadDocsTheme({
|
|
|
983491
983797
|
await cliContext.runTask(async (context3) => {
|
|
983492
983798
|
let rawYaml;
|
|
983493
983799
|
try {
|
|
983494
|
-
const content5 = await (0,
|
|
983800
|
+
const content5 = await (0, import_promises203.readFile)(themeYmlPath, "utf-8");
|
|
983495
983801
|
rawYaml = index_vite_proxy_tmp_default.load(content5, { schema: index_vite_proxy_tmp_default.JSON_SCHEMA });
|
|
983496
983802
|
} catch {
|
|
983497
983803
|
context3.failAndThrow(
|
|
@@ -983546,7 +983852,7 @@ async function uploadDocsTheme({
|
|
|
983546
983852
|
// src/commands/downgrade/downgrade.ts
|
|
983547
983853
|
init_lib19();
|
|
983548
983854
|
init_lib6();
|
|
983549
|
-
var
|
|
983855
|
+
var import_promises204 = require("fs/promises");
|
|
983550
983856
|
function ensureFinalNewline2(content5) {
|
|
983551
983857
|
return content5.endsWith("\n") ? content5 : content5 + "\n";
|
|
983552
983858
|
}
|
|
@@ -983571,7 +983877,7 @@ async function downgrade({
|
|
|
983571
983877
|
const newProjectConfig = produce(projectConfig.rawConfig, (draft) => {
|
|
983572
983878
|
draft.version = targetVersion;
|
|
983573
983879
|
});
|
|
983574
|
-
await (0,
|
|
983880
|
+
await (0, import_promises204.writeFile)(projectConfig._absolutePath, ensureFinalNewline2(JSON.stringify(newProjectConfig, void 0, 2)));
|
|
983575
983881
|
cliContext.logger.info(`Updated ${PROJECT_CONFIG_FILENAME} to version ${targetVersion}`);
|
|
983576
983882
|
}
|
|
983577
983883
|
|
|
@@ -983579,7 +983885,7 @@ async function downgrade({
|
|
|
983579
983885
|
init_lib36();
|
|
983580
983886
|
init_lib8();
|
|
983581
983887
|
init_lib22();
|
|
983582
|
-
var
|
|
983888
|
+
var import_promises205 = require("fs/promises");
|
|
983583
983889
|
init_js_yaml();
|
|
983584
983890
|
|
|
983585
983891
|
// src/commands/export/convertIrToOpenApi.ts
|
|
@@ -985001,8 +985307,8 @@ async function generateOpenAPIForWorkspaces({
|
|
|
985001
985307
|
ir: ir3,
|
|
985002
985308
|
mode: "openapi"
|
|
985003
985309
|
});
|
|
985004
|
-
await (0,
|
|
985005
|
-
await (0,
|
|
985310
|
+
await (0, import_promises205.mkdir)(dirname6(outputPath), { recursive: true });
|
|
985311
|
+
await (0, import_promises205.writeFile)(
|
|
985006
985312
|
outputPath,
|
|
985007
985313
|
outputPath.endsWith(".json") ? JSON.stringify(openapi, void 0, indent4) : index_vite_proxy_tmp_default.dump(openapi, { indent: indent4 })
|
|
985008
985314
|
);
|
|
@@ -985608,7 +985914,7 @@ async function generateOpenAPIIrForWorkspaces({
|
|
|
985608
985914
|
// src/commands/generate-overrides/compareOpenAPISpecs.ts
|
|
985609
985915
|
init_lib8();
|
|
985610
985916
|
init_lib6();
|
|
985611
|
-
var
|
|
985917
|
+
var import_promises206 = require("fs/promises");
|
|
985612
985918
|
init_js_yaml();
|
|
985613
985919
|
async function compareOpenAPISpecs({
|
|
985614
985920
|
originalPath,
|
|
@@ -985650,12 +985956,12 @@ async function compareOpenAPISpecs({
|
|
|
985650
985956
|
}
|
|
985651
985957
|
outputPath = join8(dirname6(originalPath), RelativeFilePath2.of(overridesFilename));
|
|
985652
985958
|
}
|
|
985653
|
-
await (0,
|
|
985959
|
+
await (0, import_promises206.writeFile)(outputPath, index_vite_proxy_tmp_default.dump(overrides, { lineWidth: -1, noRefs: true }));
|
|
985654
985960
|
context3.logger.info(`Overrides written to ${outputPath}`);
|
|
985655
985961
|
});
|
|
985656
985962
|
}
|
|
985657
985963
|
async function loadSpec2(filepath, context3) {
|
|
985658
|
-
const contents = await (0,
|
|
985964
|
+
const contents = await (0, import_promises206.readFile)(filepath, "utf8");
|
|
985659
985965
|
try {
|
|
985660
985966
|
return JSON.parse(contents);
|
|
985661
985967
|
} catch {
|
|
@@ -985763,7 +986069,7 @@ init_lib35();
|
|
|
985763
986069
|
init_lib16();
|
|
985764
986070
|
init_lib15();
|
|
985765
986071
|
init_lib6();
|
|
985766
|
-
var
|
|
986072
|
+
var import_promises207 = require("fs/promises");
|
|
985767
986073
|
init_js_yaml();
|
|
985768
986074
|
async function writeOverridesForWorkspaces({
|
|
985769
986075
|
project,
|
|
@@ -985789,7 +986095,7 @@ async function writeOverridesForWorkspaces({
|
|
|
985789
986095
|
async function readExistingOverrides(overridesFilepath, context3) {
|
|
985790
986096
|
let parsedOverrides = null;
|
|
985791
986097
|
try {
|
|
985792
|
-
const contents = (await (0,
|
|
986098
|
+
const contents = (await (0, import_promises207.readFile)(overridesFilepath, "utf8")).toString();
|
|
985793
986099
|
try {
|
|
985794
986100
|
parsedOverrides = JSON.parse(contents);
|
|
985795
986101
|
} catch (err) {
|
|
@@ -985854,7 +986160,7 @@ async function writeDefinitionForOpenAPIWorkspace({
|
|
|
985854
986160
|
for (const overridesPath of overridesPaths) {
|
|
985855
986161
|
const existingOverrides = await readExistingOverrides(overridesPath, context3);
|
|
985856
986162
|
const content5 = generateOverridesContent({ ir: ir3, existingOverrides, includeModels, context: context3 });
|
|
985857
|
-
await (0,
|
|
986163
|
+
await (0, import_promises207.writeFile)(overridesPath, index_vite_proxy_tmp_default.dump(content5));
|
|
985858
986164
|
}
|
|
985859
986165
|
} else {
|
|
985860
986166
|
const content5 = generateOverridesContent({ ir: ir3, existingOverrides: {}, includeModels, context: context3 });
|
|
@@ -985868,7 +986174,7 @@ async function writeDefinitionForOpenAPIWorkspace({
|
|
|
985868
986174
|
overridesFilename = `${nameWithoutExt}-overrides${extension4}`;
|
|
985869
986175
|
}
|
|
985870
986176
|
}
|
|
985871
|
-
await (0,
|
|
986177
|
+
await (0, import_promises207.writeFile)(
|
|
985872
986178
|
join8(dirname6(spec.absoluteFilepath), RelativeFilePath2.of(overridesFilename)),
|
|
985873
986179
|
index_vite_proxy_tmp_default.dump(content5)
|
|
985874
986180
|
);
|
|
@@ -986327,7 +986633,7 @@ function convertIRtoJsonSchema(args) {
|
|
|
986327
986633
|
// src/commands/jsonschema/generateJsonschemaForWorkspace.ts
|
|
986328
986634
|
init_lib21();
|
|
986329
986635
|
init_source();
|
|
986330
|
-
var
|
|
986636
|
+
var import_promises208 = require("fs/promises");
|
|
986331
986637
|
async function generateJsonschemaForWorkspaces({
|
|
986332
986638
|
typeLocator,
|
|
986333
986639
|
project,
|
|
@@ -986375,9 +986681,9 @@ async function generateJsonschemaForWorkspaces({
|
|
|
986375
986681
|
context: context3
|
|
986376
986682
|
});
|
|
986377
986683
|
if (!await doesPathExist(dirname6(jsonschemaFilepath))) {
|
|
986378
|
-
await (0,
|
|
986684
|
+
await (0, import_promises208.mkdir)(dirname6(jsonschemaFilepath), { recursive: true });
|
|
986379
986685
|
}
|
|
986380
|
-
await (0,
|
|
986686
|
+
await (0, import_promises208.writeFile)(jsonschemaFilepath, JSON.stringify(jsonSchema, null, 2));
|
|
986381
986687
|
context3.logger.info(source_default.green(`Wrote JSON Schema to ${jsonschemaFilepath}`));
|
|
986382
986688
|
});
|
|
986383
986689
|
})
|
|
@@ -986387,7 +986693,7 @@ async function generateJsonschemaForWorkspaces({
|
|
|
986387
986693
|
// src/commands/merge/mergeOpenAPIWithOverrides.ts
|
|
986388
986694
|
init_lib8();
|
|
986389
986695
|
init_lib6();
|
|
986390
|
-
var
|
|
986696
|
+
var import_promises209 = require("fs/promises");
|
|
986391
986697
|
init_js_yaml();
|
|
986392
986698
|
var HTTP_METHODS4 = /* @__PURE__ */ new Set(["get", "put", "post", "delete", "options", "head", "patch", "trace"]);
|
|
986393
986699
|
async function mergeOpenAPIWithOverrides({
|
|
@@ -986416,11 +986722,11 @@ async function mergeOpenAPIWithOverrides({
|
|
|
986416
986722
|
if (split2) {
|
|
986417
986723
|
const examples = extractEnrichedExamples2(openapi, merged);
|
|
986418
986724
|
const output2 = isJson ? JSON.stringify(examples, null, 2) : index_vite_proxy_tmp_default.dump(examples, { lineWidth: -1, noRefs: true });
|
|
986419
|
-
await (0,
|
|
986725
|
+
await (0, import_promises209.writeFile)(outputPath, output2);
|
|
986420
986726
|
context3.logger.info(`Extracted enriched examples written to ${outputPath}`);
|
|
986421
986727
|
} else {
|
|
986422
986728
|
const output2 = isJson ? JSON.stringify(merged, null, 2) : index_vite_proxy_tmp_default.dump(merged, { lineWidth: -1, noRefs: true });
|
|
986423
|
-
await (0,
|
|
986729
|
+
await (0, import_promises209.writeFile)(outputPath, output2);
|
|
986424
986730
|
if (outputPath === openapiPath) {
|
|
986425
986731
|
context3.logger.info(`Enriched ${openapiPath} in-place`);
|
|
986426
986732
|
} else {
|
|
@@ -986430,7 +986736,7 @@ async function mergeOpenAPIWithOverrides({
|
|
|
986430
986736
|
});
|
|
986431
986737
|
}
|
|
986432
986738
|
async function loadYamlOrJson(filepath, context3) {
|
|
986433
|
-
const contents = await (0,
|
|
986739
|
+
const contents = await (0, import_promises209.readFile)(filepath, "utf8");
|
|
986434
986740
|
try {
|
|
986435
986741
|
return JSON.parse(contents);
|
|
986436
986742
|
} catch {
|
|
@@ -987225,7 +987531,7 @@ init_lib35();
|
|
|
987225
987531
|
init_lib6();
|
|
987226
987532
|
init_esm19();
|
|
987227
987533
|
init_axios2();
|
|
987228
|
-
var
|
|
987534
|
+
var import_promises210 = require("fs/promises");
|
|
987229
987535
|
var import_path118 = __toESM(require("path"), 1);
|
|
987230
987536
|
init_index_min2();
|
|
987231
987537
|
var import_tmp_promise21 = __toESM(require_tmp_promise(), 1);
|
|
@@ -987279,7 +987585,7 @@ async function registerWorkspacesV1({
|
|
|
987279
987585
|
context3.logger.debug(`Compressing definition at ${tmpDir.path}`);
|
|
987280
987586
|
await Kn({ file: tarPath, cwd: resolvedWorkspace.absoluteFilePath }, ["."]);
|
|
987281
987587
|
context3.logger.info("Uploading definition...");
|
|
987282
|
-
await axios_default.put(registerApiResponse.body.definitionS3UploadUrl, await (0,
|
|
987588
|
+
await axios_default.put(registerApiResponse.body.definitionS3UploadUrl, await (0, import_promises210.readFile)(tarPath));
|
|
987283
987589
|
context3.logger.info(
|
|
987284
987590
|
`Registered @${project.config.organization}/${resolvedWorkspace.definition.rootApiFile.contents.name}:${registerApiResponse.body.version}`
|
|
987285
987591
|
);
|
|
@@ -987336,7 +987642,7 @@ function getAIEnhancerConfig2() {
|
|
|
987336
987642
|
// src/commands/resolve-specs/resolveSpecsForWorkspaces.ts
|
|
987337
987643
|
init_lib8();
|
|
987338
987644
|
init_lib35();
|
|
987339
|
-
var
|
|
987645
|
+
var import_promises211 = require("fs/promises");
|
|
987340
987646
|
var import_path119 = __toESM(require("path"), 1);
|
|
987341
987647
|
async function resolveSpecsForWorkspaces({
|
|
987342
987648
|
project,
|
|
@@ -987356,14 +987662,14 @@ async function resolveSpecsForWorkspaces({
|
|
|
987356
987662
|
return;
|
|
987357
987663
|
}
|
|
987358
987664
|
const workspaceOutputDir = project.apiWorkspaces.length > 1 ? AbsoluteFilePath2.of(import_path119.default.join(outputDir, workspace.workspaceName ?? "api")) : outputDir;
|
|
987359
|
-
await (0,
|
|
987665
|
+
await (0, import_promises211.mkdir)(workspaceOutputDir, { recursive: true });
|
|
987360
987666
|
const manifest = await collectRawSpecs({
|
|
987361
987667
|
specs,
|
|
987362
987668
|
hostOutputDir: workspaceOutputDir,
|
|
987363
987669
|
containerBaseDir: ".",
|
|
987364
987670
|
context: context3
|
|
987365
987671
|
});
|
|
987366
|
-
await (0,
|
|
987672
|
+
await (0, import_promises211.writeFile)(
|
|
987367
987673
|
import_path119.default.join(workspaceOutputDir, SPECS_MANIFEST_FILENAME),
|
|
987368
987674
|
JSON.stringify(manifest, void 0, 4)
|
|
987369
987675
|
);
|
|
@@ -987573,7 +987879,7 @@ init_lib17();
|
|
|
987573
987879
|
init_lib19();
|
|
987574
987880
|
init_lib8();
|
|
987575
987881
|
init_lib6();
|
|
987576
|
-
var
|
|
987882
|
+
var import_promises212 = __toESM(require("fs/promises"), 1);
|
|
987577
987883
|
|
|
987578
987884
|
// src/commands/sdk-preview/computePreviewVersion.ts
|
|
987579
987885
|
var BASE_VERSION = "0.0.1";
|
|
@@ -987693,7 +987999,7 @@ async function sdkPreview({
|
|
|
987693
987999
|
const firstPath = pathOutputs[0];
|
|
987694
988000
|
const absolutePathToOutput = firstPath != null ? AbsoluteFilePath2.of(resolve6(cwd(), firstPath)) : void 0;
|
|
987695
988001
|
if (absolutePathToOutput != null) {
|
|
987696
|
-
await
|
|
988002
|
+
await import_promises212.default.mkdir(absolutePathToOutput, { recursive: true });
|
|
987697
988003
|
}
|
|
987698
988004
|
for (const workspace of project.apiWorkspaces) {
|
|
987699
988005
|
if (workspace.generatorsConfiguration == null) {
|
|
@@ -987883,7 +988189,7 @@ async function sdkPreview({
|
|
|
987883
988189
|
init_lib33();
|
|
987884
988190
|
init_lib6();
|
|
987885
988191
|
init_source();
|
|
987886
|
-
var
|
|
988192
|
+
var import_promises213 = require("fs/promises");
|
|
987887
988193
|
var import_path120 = require("path");
|
|
987888
988194
|
async function getPackageManagerBinDir(logger4, pm) {
|
|
987889
988195
|
let command3;
|
|
@@ -987929,7 +988235,7 @@ async function detectInstallationMethod(logger4) {
|
|
|
987929
988235
|
logger4.debug(`Found fern at: ${fernPath}`);
|
|
987930
988236
|
let resolvedPath;
|
|
987931
988237
|
try {
|
|
987932
|
-
resolvedPath = await (0,
|
|
988238
|
+
resolvedPath = await (0, import_promises213.realpath)(fernPath);
|
|
987933
988239
|
logger4.debug(`Resolved to: ${resolvedPath}`);
|
|
987934
988240
|
} catch (error50) {
|
|
987935
988241
|
logger4.debug(`Failed to resolve symlink: ${error50}`);
|
|
@@ -988243,22 +988549,22 @@ init_lib19();
|
|
|
988243
988549
|
init_lib8();
|
|
988244
988550
|
init_lib6();
|
|
988245
988551
|
var fs33 = __toESM(require("fs"), 1);
|
|
988246
|
-
var
|
|
988552
|
+
var import_promises214 = require("fs/promises");
|
|
988247
988553
|
init_graphql();
|
|
988248
988554
|
init_js_yaml();
|
|
988249
988555
|
var import_stream18 = require("stream");
|
|
988250
|
-
var
|
|
988556
|
+
var import_promises215 = require("stream/promises");
|
|
988251
988557
|
async function fetchAndWriteFile(url3, path120, logger4, indent4) {
|
|
988252
988558
|
const resp = await fetch(url3);
|
|
988253
988559
|
if (resp.ok && resp.body) {
|
|
988254
988560
|
logger4.debug("Origin successfully fetched, writing to file");
|
|
988255
988561
|
const fileStream = fs33.createWriteStream(path120);
|
|
988256
|
-
await (0,
|
|
988257
|
-
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");
|
|
988258
988564
|
try {
|
|
988259
|
-
await (0,
|
|
988565
|
+
await (0, import_promises214.writeFile)(path120, JSON.stringify(JSON.parse(fileContents), void 0, indent4), "utf8");
|
|
988260
988566
|
} catch (e2) {
|
|
988261
|
-
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");
|
|
988262
988568
|
}
|
|
988263
988569
|
logger4.debug("File written successfully");
|
|
988264
988570
|
}
|
|
@@ -988414,14 +988720,14 @@ async function tryDirectJSONFetch(url3, logger4) {
|
|
|
988414
988720
|
async function fetchGraphQLSchemaWithAutoDetection(url3, path120, logger4) {
|
|
988415
988721
|
const postResult = await tryGraphQLIntrospection(url3, logger4);
|
|
988416
988722
|
if (postResult.success) {
|
|
988417
|
-
await (0,
|
|
988723
|
+
await (0, import_promises214.writeFile)(path120, postResult.result, "utf8");
|
|
988418
988724
|
logger4.info("Successfully fetched GraphQL schema using POST introspection");
|
|
988419
988725
|
return;
|
|
988420
988726
|
}
|
|
988421
988727
|
logger4.debug(`POST introspection failed: ${postResult.error}`);
|
|
988422
988728
|
const getResult = await tryDirectJSONFetch(url3, logger4);
|
|
988423
988729
|
if (getResult.success) {
|
|
988424
|
-
await (0,
|
|
988730
|
+
await (0, import_promises214.writeFile)(path120, getResult.result, "utf8");
|
|
988425
988731
|
logger4.info("Successfully fetched GraphQL schema using direct JSON fetch");
|
|
988426
988732
|
return;
|
|
988427
988733
|
}
|
|
@@ -989131,7 +989437,7 @@ async function validateWorkspaces({
|
|
|
989131
989437
|
init_lib19();
|
|
989132
989438
|
init_lib8();
|
|
989133
989439
|
init_source();
|
|
989134
|
-
var
|
|
989440
|
+
var import_promises216 = require("fs/promises");
|
|
989135
989441
|
init_js_yaml();
|
|
989136
989442
|
var import_path122 = __toESM(require("path"), 1);
|
|
989137
989443
|
async function writeDefinitionForWorkspaces({
|
|
@@ -989213,22 +989519,22 @@ async function writeFernDefinition({
|
|
|
989213
989519
|
return a3.localeCompare(b5);
|
|
989214
989520
|
};
|
|
989215
989521
|
if (await doesPathExist(absolutePathToOutputDirectory)) {
|
|
989216
|
-
await (0,
|
|
989522
|
+
await (0, import_promises216.rm)(absolutePathToOutputDirectory, { recursive: true });
|
|
989217
989523
|
}
|
|
989218
|
-
await (0,
|
|
989219
|
-
await (0,
|
|
989524
|
+
await (0, import_promises216.mkdir)(absolutePathToOutputDirectory, { recursive: true });
|
|
989525
|
+
await (0, import_promises216.writeFile)(
|
|
989220
989526
|
join8(absolutePathToOutputDirectory, RelativeFilePath2.of(ROOT_API_FILENAME)),
|
|
989221
989527
|
index_vite_proxy_tmp_default.dump(definition3.rootApiFile.contents, { sortKeys })
|
|
989222
989528
|
);
|
|
989223
989529
|
for (const [relativePath, packageMarker] of Object.entries(definition3.packageMarkers)) {
|
|
989224
989530
|
const absoluteFilepath = join8(absolutePathToOutputDirectory, RelativeFilePath2.of(relativePath));
|
|
989225
|
-
await (0,
|
|
989226
|
-
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 }));
|
|
989227
989533
|
}
|
|
989228
989534
|
for (const [relativePath, definitionFile] of Object.entries(definition3.namedDefinitionFiles)) {
|
|
989229
989535
|
const absoluteFilepath = join8(absolutePathToOutputDirectory, RelativeFilePath2.of(relativePath));
|
|
989230
|
-
await (0,
|
|
989231
|
-
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 }));
|
|
989232
989538
|
}
|
|
989233
989539
|
}
|
|
989234
989540
|
|
|
@@ -989236,7 +989542,7 @@ async function writeFernDefinition({
|
|
|
989236
989542
|
init_lib67();
|
|
989237
989543
|
init_lib8();
|
|
989238
989544
|
init_source();
|
|
989239
|
-
var
|
|
989545
|
+
var import_promises217 = require("fs/promises");
|
|
989240
989546
|
async function writeDocsDefinitionForProject({
|
|
989241
989547
|
project,
|
|
989242
989548
|
outputPath,
|
|
@@ -989268,7 +989574,7 @@ async function writeDocsDefinitionForProject({
|
|
|
989268
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
|
|
989269
989575
|
});
|
|
989270
989576
|
const docsDefinition = await docsResolver.resolve();
|
|
989271
|
-
await (0,
|
|
989577
|
+
await (0, import_promises217.writeFile)(AbsoluteFilePath2.of(outputPath), JSON.stringify(docsDefinition, null, 2));
|
|
989272
989578
|
context3.logger.info(source_default.green(`Docs definition written to ${outputPath}`));
|
|
989273
989579
|
});
|
|
989274
989580
|
}
|
|
@@ -990056,6 +990362,14 @@ function addGenerateCommand3(cli, cliContext) {
|
|
|
990056
990362
|
boolean: true,
|
|
990057
990363
|
default: false,
|
|
990058
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."
|
|
990059
990373
|
}),
|
|
990060
990374
|
async (argv) => {
|
|
990061
990375
|
if (argv.api != null && argv.api.length > 0 && argv.docs != null) {
|
|
@@ -990131,6 +990445,23 @@ function addGenerateCommand3(cli, cliContext) {
|
|
|
990131
990445
|
{ code: CliError.Code.ConfigError }
|
|
990132
990446
|
);
|
|
990133
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
|
+
}
|
|
990134
990465
|
if (argv.output != null && argv.docs != null) {
|
|
990135
990466
|
return cliContext.failWithoutThrowing(
|
|
990136
990467
|
"The --output flag is not supported for docs generation.",
|
|
@@ -990169,7 +990500,9 @@ function addGenerateCommand3(cli, cliContext) {
|
|
|
990169
990500
|
retryRateLimited: argv["retry-rate-limited"],
|
|
990170
990501
|
requireEnvVars: argv["require-env-vars"],
|
|
990171
990502
|
skipIfNoDiff: argv["skip-if-no-diff"],
|
|
990172
|
-
generateTests: argv["generate-tests"]
|
|
990503
|
+
generateTests: argv["generate-tests"],
|
|
990504
|
+
pack: argv.pack,
|
|
990505
|
+
packMode: argv.packMode
|
|
990173
990506
|
});
|
|
990174
990507
|
}
|
|
990175
990508
|
if (argv.docs != null) {
|
|
@@ -990231,7 +990564,9 @@ function addGenerateCommand3(cli, cliContext) {
|
|
|
990231
990564
|
retryRateLimited: argv["retry-rate-limited"],
|
|
990232
990565
|
requireEnvVars: argv["require-env-vars"],
|
|
990233
990566
|
skipIfNoDiff: argv["skip-if-no-diff"],
|
|
990234
|
-
generateTests: argv["generate-tests"]
|
|
990567
|
+
generateTests: argv["generate-tests"],
|
|
990568
|
+
pack: argv.pack,
|
|
990569
|
+
packMode: argv.packMode
|
|
990235
990570
|
});
|
|
990236
990571
|
}
|
|
990237
990572
|
);
|