@fern-api/fern-api-dev 5.83.1 → 5.85.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 +1646 -337
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -45336,11 +45336,11 @@ var init_AbsoluteFilePath = __esm({
|
|
|
45336
45336
|
|
|
45337
45337
|
// ../../commons/path-utils/lib/basename.js
|
|
45338
45338
|
function basename3(path120, options2) {
|
|
45339
|
-
const
|
|
45339
|
+
const basename8 = path120.split("/").pop() ?? path120;
|
|
45340
45340
|
if (options2?.stripExtension) {
|
|
45341
|
-
return
|
|
45341
|
+
return basename8.split(".")[0] ?? basename8;
|
|
45342
45342
|
}
|
|
45343
|
-
return
|
|
45343
|
+
return basename8;
|
|
45344
45344
|
}
|
|
45345
45345
|
var init_basename = __esm({
|
|
45346
45346
|
"../../commons/path-utils/lib/basename.js"() {
|
|
@@ -53603,8 +53603,8 @@ var require_tmp = __commonJS({
|
|
|
53603
53603
|
if (!_isUndefined(options2.name)) {
|
|
53604
53604
|
const name2 = options2.name;
|
|
53605
53605
|
if (path120.isAbsolute(name2)) throw new Error(`name option must not contain an absolute path, found "${name2}".`);
|
|
53606
|
-
const
|
|
53607
|
-
if (
|
|
53606
|
+
const basename8 = path120.basename(name2);
|
|
53607
|
+
if (basename8 === ".." || basename8 === "." || basename8 !== name2) {
|
|
53608
53608
|
throw new Error(`name option must not contain a path, found "${name2}".`);
|
|
53609
53609
|
}
|
|
53610
53610
|
}
|
|
@@ -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) {
|
|
@@ -100787,10 +100826,10 @@ var require_graceful_fs = __commonJS({
|
|
|
100787
100826
|
polyfills(fs35);
|
|
100788
100827
|
fs35.gracefulify = patch5;
|
|
100789
100828
|
fs35.createReadStream = createReadStream5;
|
|
100790
|
-
fs35.createWriteStream =
|
|
100829
|
+
fs35.createWriteStream = createWriteStream9;
|
|
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) {
|
|
@@ -100999,7 +101038,7 @@ var require_graceful_fs = __commonJS({
|
|
|
100999
101038
|
function createReadStream5(path120, options2) {
|
|
101000
101039
|
return new fs35.ReadStream(path120, options2);
|
|
101001
101040
|
}
|
|
101002
|
-
function
|
|
101041
|
+
function createWriteStream9(path120, options2) {
|
|
101003
101042
|
return new fs35.WriteStream(path120, options2);
|
|
101004
101043
|
}
|
|
101005
101044
|
var fs$open = fs35.open;
|
|
@@ -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);
|
|
@@ -359307,8 +359353,8 @@ var init_ProtobufIRGenerator = __esm({
|
|
|
359307
359353
|
await (0, import_promises35.cp)(absoluteFilepathToProtobufRoot, protobufGeneratorConfigPath, {
|
|
359308
359354
|
recursive: true,
|
|
359309
359355
|
filter: (src) => {
|
|
359310
|
-
const
|
|
359311
|
-
return
|
|
359356
|
+
const basename8 = import_path41.default.basename(src);
|
|
359357
|
+
return basename8 !== "buf.yaml" && !(basename8.startsWith("buf.gen.") && basename8.endsWith(".yaml"));
|
|
359312
359358
|
}
|
|
359313
359359
|
});
|
|
359314
359360
|
}
|
|
@@ -473735,7 +473781,7 @@ var require_view = __commonJS({
|
|
|
473735
473781
|
var path120 = require("path");
|
|
473736
473782
|
var fs34 = require("fs");
|
|
473737
473783
|
var dirname22 = path120.dirname;
|
|
473738
|
-
var
|
|
473784
|
+
var basename8 = path120.basename;
|
|
473739
473785
|
var extname2 = path120.extname;
|
|
473740
473786
|
var join28 = path120.join;
|
|
473741
473787
|
var resolve15 = path120.resolve;
|
|
@@ -473774,7 +473820,7 @@ var require_view = __commonJS({
|
|
|
473774
473820
|
var root6 = roots[i5];
|
|
473775
473821
|
var loc = resolve15(root6, name2);
|
|
473776
473822
|
var dir = dirname22(loc);
|
|
473777
|
-
var file4 =
|
|
473823
|
+
var file4 = basename8(loc);
|
|
473778
473824
|
path121 = this.resolve(dir, file4);
|
|
473779
473825
|
}
|
|
473780
473826
|
return path121;
|
|
@@ -473790,7 +473836,7 @@ var require_view = __commonJS({
|
|
|
473790
473836
|
if (stat7 && stat7.isFile()) {
|
|
473791
473837
|
return path121;
|
|
473792
473838
|
}
|
|
473793
|
-
path121 = join28(dir,
|
|
473839
|
+
path121 = join28(dir, basename8(file4, ext2), "index" + ext2);
|
|
473794
473840
|
stat7 = tryStat(path121);
|
|
473795
473841
|
if (stat7 && stat7.isFile()) {
|
|
473796
473842
|
return path121;
|
|
@@ -473813,7 +473859,7 @@ var require_content_disposition = __commonJS({
|
|
|
473813
473859
|
"use strict";
|
|
473814
473860
|
module4.exports = contentDisposition;
|
|
473815
473861
|
module4.exports.parse = parse19;
|
|
473816
|
-
var
|
|
473862
|
+
var basename8 = require("path").basename;
|
|
473817
473863
|
var Buffer6 = require_safe_buffer().Buffer;
|
|
473818
473864
|
var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g;
|
|
473819
473865
|
var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/;
|
|
@@ -473849,9 +473895,9 @@ var require_content_disposition = __commonJS({
|
|
|
473849
473895
|
if (typeof fallback2 === "string" && NON_LATIN1_REGEXP.test(fallback2)) {
|
|
473850
473896
|
throw new TypeError("fallback must be ISO-8859-1 string");
|
|
473851
473897
|
}
|
|
473852
|
-
var name2 =
|
|
473898
|
+
var name2 = basename8(filename);
|
|
473853
473899
|
var isQuotedString = TEXT_REGEXP.test(name2);
|
|
473854
|
-
var fallbackName = typeof fallback2 !== "string" ? fallback2 && getlatin1(name2) :
|
|
473900
|
+
var fallbackName = typeof fallback2 !== "string" ? fallback2 && getlatin1(name2) : basename8(fallback2);
|
|
473855
473901
|
var hasFallback = typeof fallbackName === "string" && fallbackName !== name2;
|
|
473856
473902
|
if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name2)) {
|
|
473857
473903
|
params2["filename*"] = name2;
|
|
@@ -482217,7 +482263,7 @@ var require_polyfills2 = __commonJS({
|
|
|
482217
482263
|
}
|
|
482218
482264
|
if (platform4 === "win32") {
|
|
482219
482265
|
fs34.rename = typeof fs34.rename !== "function" ? fs34.rename : (function(fs$rename) {
|
|
482220
|
-
function
|
|
482266
|
+
function rename8(from4, to2, cb) {
|
|
482221
482267
|
var start2 = Date.now();
|
|
482222
482268
|
var backoff = 0;
|
|
482223
482269
|
fs$rename(from4, to2, function CB(er3) {
|
|
@@ -482237,8 +482283,8 @@ var require_polyfills2 = __commonJS({
|
|
|
482237
482283
|
if (cb) cb(er3);
|
|
482238
482284
|
});
|
|
482239
482285
|
}
|
|
482240
|
-
if (Object.setPrototypeOf) Object.setPrototypeOf(
|
|
482241
|
-
return
|
|
482286
|
+
if (Object.setPrototypeOf) Object.setPrototypeOf(rename8, fs$rename);
|
|
482287
|
+
return rename8;
|
|
482242
482288
|
})(fs34.rename);
|
|
482243
482289
|
}
|
|
482244
482290
|
fs34.read = typeof fs34.read !== "function" ? fs34.read : (function(fs$read) {
|
|
@@ -482642,10 +482688,10 @@ var require_graceful_fs2 = __commonJS({
|
|
|
482642
482688
|
polyfills(fs35);
|
|
482643
482689
|
fs35.gracefulify = patch5;
|
|
482644
482690
|
fs35.createReadStream = createReadStream5;
|
|
482645
|
-
fs35.createWriteStream =
|
|
482691
|
+
fs35.createWriteStream = createWriteStream9;
|
|
482646
482692
|
var fs$readFile = fs35.readFile;
|
|
482647
|
-
fs35.readFile =
|
|
482648
|
-
function
|
|
482693
|
+
fs35.readFile = readFile121;
|
|
482694
|
+
function readFile121(path120, options2, cb) {
|
|
482649
482695
|
if (typeof options2 === "function")
|
|
482650
482696
|
cb = options2, options2 = null;
|
|
482651
482697
|
return go$readFile(path120, options2, cb);
|
|
@@ -482697,8 +482743,8 @@ var require_graceful_fs2 = __commonJS({
|
|
|
482697
482743
|
}
|
|
482698
482744
|
var fs$copyFile = fs35.copyFile;
|
|
482699
482745
|
if (fs$copyFile)
|
|
482700
|
-
fs35.copyFile =
|
|
482701
|
-
function
|
|
482746
|
+
fs35.copyFile = copyFile7;
|
|
482747
|
+
function copyFile7(src, dest, flags2, cb) {
|
|
482702
482748
|
if (typeof flags2 === "function") {
|
|
482703
482749
|
cb = flags2;
|
|
482704
482750
|
flags2 = 0;
|
|
@@ -482716,9 +482762,9 @@ var require_graceful_fs2 = __commonJS({
|
|
|
482716
482762
|
}
|
|
482717
482763
|
}
|
|
482718
482764
|
var fs$readdir = fs35.readdir;
|
|
482719
|
-
fs35.readdir =
|
|
482765
|
+
fs35.readdir = readdir23;
|
|
482720
482766
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
482721
|
-
function
|
|
482767
|
+
function readdir23(path120, options2, cb) {
|
|
482722
482768
|
if (typeof options2 === "function")
|
|
482723
482769
|
cb = options2, options2 = null;
|
|
482724
482770
|
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path121, options3, cb2, startTime) {
|
|
@@ -482854,7 +482900,7 @@ var require_graceful_fs2 = __commonJS({
|
|
|
482854
482900
|
function createReadStream5(path120, options2) {
|
|
482855
482901
|
return new fs35.ReadStream(path120, options2);
|
|
482856
482902
|
}
|
|
482857
|
-
function
|
|
482903
|
+
function createWriteStream9(path120, options2) {
|
|
482858
482904
|
return new fs35.WriteStream(path120, options2);
|
|
482859
482905
|
}
|
|
482860
482906
|
var fs$open = fs35.open;
|
|
@@ -490678,7 +490724,7 @@ var require_yauzl = __commonJS({
|
|
|
490678
490724
|
exports2.getFileNameLowLevel = getFileNameLowLevel;
|
|
490679
490725
|
exports2.validateFileName = validateFileName;
|
|
490680
490726
|
exports2.parseExtraFields = parseExtraFields;
|
|
490681
|
-
exports2.ZipFile =
|
|
490727
|
+
exports2.ZipFile = ZipFile2;
|
|
490682
490728
|
exports2.Entry = Entry;
|
|
490683
490729
|
exports2.LocalFileHeader = LocalFileHeader;
|
|
490684
490730
|
exports2.RandomAccessReader = RandomAccessReader;
|
|
@@ -490787,19 +490833,19 @@ var require_yauzl = __commonJS({
|
|
|
490787
490833
|
}
|
|
490788
490834
|
entryCount = readUInt64LE(zip64EocdrBuffer, 32);
|
|
490789
490835
|
centralDirectoryOffset = readUInt64LE(zip64EocdrBuffer, 48);
|
|
490790
|
-
return callback(null, new
|
|
490836
|
+
return callback(null, new ZipFile2(reader, centralDirectoryOffset, totalSize, entryCount, comment6, options2.autoClose, options2.lazyEntries, decodeStrings, options2.validateEntrySizes, options2.strictFileNames));
|
|
490791
490837
|
});
|
|
490792
490838
|
}
|
|
490793
490839
|
if (diskNumber !== 0) {
|
|
490794
490840
|
return callback(new Error("multi-disk zip files are not supported: found disk number: " + diskNumber));
|
|
490795
490841
|
}
|
|
490796
|
-
return callback(null, new
|
|
490842
|
+
return callback(null, new ZipFile2(reader, centralDirectoryOffset, totalSize, entryCount, comment6, options2.autoClose, options2.lazyEntries, decodeStrings, options2.validateEntrySizes, options2.strictFileNames));
|
|
490797
490843
|
}
|
|
490798
490844
|
callback(new Error("End of central directory record signature not found. Either not a zip file, or file is truncated."));
|
|
490799
490845
|
});
|
|
490800
490846
|
}
|
|
490801
|
-
util5.inherits(
|
|
490802
|
-
function
|
|
490847
|
+
util5.inherits(ZipFile2, EventEmitter9);
|
|
490848
|
+
function ZipFile2(reader, centralDirectoryOffset, fileSize, entryCount, comment6, autoClose, lazyEntries, decodeStrings, validateEntrySizes, strictFileNames) {
|
|
490803
490849
|
var self2 = this;
|
|
490804
490850
|
EventEmitter9.call(self2);
|
|
490805
490851
|
self2.reader = reader;
|
|
@@ -490823,7 +490869,7 @@ var require_yauzl = __commonJS({
|
|
|
490823
490869
|
self2.emittedError = false;
|
|
490824
490870
|
if (!self2.lazyEntries) self2._readEntry();
|
|
490825
490871
|
}
|
|
490826
|
-
|
|
490872
|
+
ZipFile2.prototype.close = function() {
|
|
490827
490873
|
if (!this.isOpen) return;
|
|
490828
490874
|
this.isOpen = false;
|
|
490829
490875
|
this.reader.unref();
|
|
@@ -490837,11 +490883,11 @@ var require_yauzl = __commonJS({
|
|
|
490837
490883
|
self2.emittedError = true;
|
|
490838
490884
|
self2.emit("error", err);
|
|
490839
490885
|
}
|
|
490840
|
-
|
|
490886
|
+
ZipFile2.prototype.readEntry = function() {
|
|
490841
490887
|
if (!this.lazyEntries) throw new Error("readEntry() called without lazyEntries:true");
|
|
490842
490888
|
this._readEntry();
|
|
490843
490889
|
};
|
|
490844
|
-
|
|
490890
|
+
ZipFile2.prototype._readEntry = function() {
|
|
490845
490891
|
var self2 = this;
|
|
490846
490892
|
if (self2.entryCount === self2.entriesRead) {
|
|
490847
490893
|
setImmediate(function() {
|
|
@@ -490945,7 +490991,7 @@ var require_yauzl = __commonJS({
|
|
|
490945
490991
|
});
|
|
490946
490992
|
});
|
|
490947
490993
|
};
|
|
490948
|
-
|
|
490994
|
+
ZipFile2.prototype.openReadStream = function(entry, options2, callback) {
|
|
490949
490995
|
var self2 = this;
|
|
490950
490996
|
var relativeStart = 0;
|
|
490951
490997
|
var relativeEnd = entry.compressedSize;
|
|
@@ -491027,7 +491073,7 @@ var require_yauzl = __commonJS({
|
|
|
491027
491073
|
);
|
|
491028
491074
|
});
|
|
491029
491075
|
};
|
|
491030
|
-
|
|
491076
|
+
ZipFile2.prototype.openReadStreamLowLevel = function(fileDataStart, compressedSize, relativeStart, relativeEnd, decompress3, uncompressedSize, callback) {
|
|
491031
491077
|
var self2 = this;
|
|
491032
491078
|
var fileDataEnd = fileDataStart + compressedSize;
|
|
491033
491079
|
var readStream2 = self2.reader.createReadStream({
|
|
@@ -491064,7 +491110,7 @@ var require_yauzl = __commonJS({
|
|
|
491064
491110
|
}
|
|
491065
491111
|
callback(null, endpointStream);
|
|
491066
491112
|
};
|
|
491067
|
-
|
|
491113
|
+
ZipFile2.prototype.readLocalFileHeader = function(entry, options2, callback) {
|
|
491068
491114
|
var self2 = this;
|
|
491069
491115
|
if (callback == null) {
|
|
491070
491116
|
callback = options2;
|
|
@@ -491571,10 +491617,10 @@ var require_make_dir = __commonJS({
|
|
|
491571
491617
|
module4.exports = (input3, opts) => Promise.resolve().then(() => {
|
|
491572
491618
|
checkPath(input3);
|
|
491573
491619
|
opts = Object.assign({}, defaults3, opts);
|
|
491574
|
-
const
|
|
491620
|
+
const mkdir46 = pify(opts.fs.mkdir);
|
|
491575
491621
|
const stat7 = pify(opts.fs.stat);
|
|
491576
491622
|
const make = (pth) => {
|
|
491577
|
-
return
|
|
491623
|
+
return mkdir46(pth, opts.mode).then(() => pth).catch((err) => {
|
|
491578
491624
|
if (err.code === "ENOENT") {
|
|
491579
491625
|
if (err.message.includes("null bytes") || path120.dirname(pth) === pth) {
|
|
491580
491626
|
throw err;
|
|
@@ -509780,8 +509826,8 @@ var init_Page = __esm({
|
|
|
509780
509826
|
throw error50;
|
|
509781
509827
|
}
|
|
509782
509828
|
if (options2.path) {
|
|
509783
|
-
const { createWriteStream:
|
|
509784
|
-
const stream5 =
|
|
509829
|
+
const { createWriteStream: createWriteStream9 } = environment.value.fs;
|
|
509830
|
+
const stream5 = createWriteStream9(options2.path, "binary");
|
|
509785
509831
|
recorder.pipe(stream5);
|
|
509786
509832
|
}
|
|
509787
509833
|
return recorder;
|
|
@@ -560693,7 +560739,7 @@ var require_extract_zip = __commonJS({
|
|
|
560693
560739
|
"../../../node_modules/.pnpm/extract-zip@2.0.1/node_modules/extract-zip/index.js"(exports2, module4) {
|
|
560694
560740
|
"use strict";
|
|
560695
560741
|
var debug9 = require_src()("extract-zip");
|
|
560696
|
-
var { createWriteStream:
|
|
560742
|
+
var { createWriteStream: createWriteStream9, promises: fs34 } = require("fs");
|
|
560697
560743
|
var getStream = require_get_stream3();
|
|
560698
560744
|
var path120 = require("path");
|
|
560699
560745
|
var { promisify: promisify14 } = require("util");
|
|
@@ -560788,7 +560834,7 @@ var require_extract_zip = __commonJS({
|
|
|
560788
560834
|
debug9("creating symlink", link3, dest);
|
|
560789
560835
|
await fs34.symlink(link3, dest);
|
|
560790
560836
|
} else {
|
|
560791
|
-
await pipeline6(readStream2,
|
|
560837
|
+
await pipeline6(readStream2, createWriteStream9(dest, { mode: procMode }));
|
|
560792
560838
|
}
|
|
560793
560839
|
}
|
|
560794
560840
|
getExtractedMode(entryMode, isDir) {
|
|
@@ -576161,7 +576207,7 @@ var require_dist24 = __commonJS({
|
|
|
576161
576207
|
return copy;
|
|
576162
576208
|
}
|
|
576163
576209
|
};
|
|
576164
|
-
var
|
|
576210
|
+
var import_promises218 = require("fs/promises");
|
|
576165
576211
|
var import_node_path310 = require("path");
|
|
576166
576212
|
async function resolveInputs(args) {
|
|
576167
576213
|
const {
|
|
@@ -576214,7 +576260,7 @@ var require_dist24 = __commonJS({
|
|
|
576214
576260
|
}
|
|
576215
576261
|
}
|
|
576216
576262
|
const oursPath = (0, import_node_path310.join)(outputDir, resolvedPath);
|
|
576217
|
-
const ours = await (0,
|
|
576263
|
+
const ours = await (0, import_promises218.readFile)(oursPath, "utf-8").catch(() => null);
|
|
576218
576264
|
let ghostTheirs = null;
|
|
576219
576265
|
let baseTreeUnreachable = false;
|
|
576220
576266
|
if (!base4 && !renameSourcePath) {
|
|
@@ -576456,7 +576502,7 @@ var require_dist24 = __commonJS({
|
|
|
576456
576502
|
conflictReasonHint
|
|
576457
576503
|
};
|
|
576458
576504
|
}
|
|
576459
|
-
var
|
|
576505
|
+
var import_promises219 = require("fs/promises");
|
|
576460
576506
|
var import_node_path45 = require("path");
|
|
576461
576507
|
var AUTOVERSION_PLACEHOLDERS = [
|
|
576462
576508
|
"v0.0.0-fern-placeholder",
|
|
@@ -576507,14 +576553,14 @@ var require_dist24 = __commonJS({
|
|
|
576507
576553
|
}
|
|
576508
576554
|
if (plan.kind === "new-file-only-user") {
|
|
576509
576555
|
accumulator.recordMerge(resolvedPath, plan.theirs, patch5.base_generation);
|
|
576510
|
-
await (0,
|
|
576511
|
-
await (0,
|
|
576556
|
+
await (0, import_promises219.mkdir)((0, import_node_path45.dirname)(oursPath), { recursive: true });
|
|
576557
|
+
await (0, import_promises219.writeFile)(oursPath, plan.theirs);
|
|
576512
576558
|
return { file: resolvedPath, status: "merged", reason: "new-file" };
|
|
576513
576559
|
}
|
|
576514
576560
|
if (plan.kind === "new-file-both") {
|
|
576515
576561
|
const merged2 = threeWayMerge("", ours, plan.theirs);
|
|
576516
|
-
await (0,
|
|
576517
|
-
await (0,
|
|
576562
|
+
await (0, import_promises219.mkdir)((0, import_node_path45.dirname)(oursPath), { recursive: true });
|
|
576563
|
+
await (0, import_promises219.writeFile)(oursPath, merged2.content);
|
|
576518
576564
|
const unreachableFlag = plan.baseTreeUnreachable ? { baseTreeUnreachable: true } : {};
|
|
576519
576565
|
if (merged2.hasConflicts) {
|
|
576520
576566
|
return {
|
|
@@ -576532,8 +576578,8 @@ var require_dist24 = __commonJS({
|
|
|
576532
576578
|
const mergeBase = inputs.base != null ? alignAutoversionToOurs(inputs.base, ours, plan.mergeBase) : plan.mergeBase;
|
|
576533
576579
|
const theirs = inputs.base != null ? alignAutoversionToOurs(inputs.base, ours, plan.theirs) : plan.theirs;
|
|
576534
576580
|
const merged = threeWayMerge(mergeBase, ours, theirs);
|
|
576535
|
-
await (0,
|
|
576536
|
-
await (0,
|
|
576581
|
+
await (0, import_promises219.mkdir)((0, import_node_path45.dirname)(oursPath), { recursive: true });
|
|
576582
|
+
await (0, import_promises219.writeFile)(oursPath, merged.content);
|
|
576537
576583
|
if (merged.hasConflicts) {
|
|
576538
576584
|
accumulator.recordConflict(resolvedPath, theirs, patch5.base_generation);
|
|
576539
576585
|
return {
|
|
@@ -624869,16 +624915,16 @@ var require_copy = __commonJS({
|
|
|
624869
624915
|
throw new Error(`Unknown file: ${src}`);
|
|
624870
624916
|
}
|
|
624871
624917
|
async function onFile(srcStat, destStat, src, dest, opts) {
|
|
624872
|
-
if (!destStat) return
|
|
624918
|
+
if (!destStat) return copyFile7(srcStat, src, dest, opts);
|
|
624873
624919
|
if (opts.overwrite) {
|
|
624874
624920
|
await fs34.unlink(dest);
|
|
624875
|
-
return
|
|
624921
|
+
return copyFile7(srcStat, src, dest, opts);
|
|
624876
624922
|
}
|
|
624877
624923
|
if (opts.errorOnExist) {
|
|
624878
624924
|
throw new Error(`'${dest}' already exists`);
|
|
624879
624925
|
}
|
|
624880
624926
|
}
|
|
624881
|
-
async function
|
|
624927
|
+
async function copyFile7(srcStat, src, dest, opts) {
|
|
624882
624928
|
await fs34.copyFile(src, dest);
|
|
624883
624929
|
if (opts.preserveTimestamps) {
|
|
624884
624930
|
if (fileIsNotWritable(srcStat.mode)) {
|
|
@@ -624986,18 +625032,18 @@ var require_copy_sync = __commonJS({
|
|
|
624986
625032
|
throw new Error(`Unknown file: ${src}`);
|
|
624987
625033
|
}
|
|
624988
625034
|
function onFile(srcStat, destStat, src, dest, opts) {
|
|
624989
|
-
if (!destStat) return
|
|
625035
|
+
if (!destStat) return copyFile7(srcStat, src, dest, opts);
|
|
624990
625036
|
return mayCopyFile(srcStat, src, dest, opts);
|
|
624991
625037
|
}
|
|
624992
625038
|
function mayCopyFile(srcStat, src, dest, opts) {
|
|
624993
625039
|
if (opts.overwrite) {
|
|
624994
625040
|
fs34.unlinkSync(dest);
|
|
624995
|
-
return
|
|
625041
|
+
return copyFile7(srcStat, src, dest, opts);
|
|
624996
625042
|
} else if (opts.errorOnExist) {
|
|
624997
625043
|
throw new Error(`'${dest}' already exists`);
|
|
624998
625044
|
}
|
|
624999
625045
|
}
|
|
625000
|
-
function
|
|
625046
|
+
function copyFile7(srcStat, src, dest, opts) {
|
|
625001
625047
|
fs34.copyFileSync(src, dest);
|
|
625002
625048
|
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
|
|
625003
625049
|
return setDestMode(dest, srcStat.mode);
|
|
@@ -625121,14 +625167,14 @@ var require_empty2 = __commonJS({
|
|
|
625121
625167
|
var u5 = require_universalify().fromPromise;
|
|
625122
625168
|
var fs34 = require_fs();
|
|
625123
625169
|
var path120 = require("path");
|
|
625124
|
-
var
|
|
625170
|
+
var mkdir46 = require_mkdirs();
|
|
625125
625171
|
var remove3 = require_remove3();
|
|
625126
625172
|
var emptyDir = u5(async function emptyDir2(dir) {
|
|
625127
625173
|
let items;
|
|
625128
625174
|
try {
|
|
625129
625175
|
items = await fs34.readdir(dir);
|
|
625130
625176
|
} catch {
|
|
625131
|
-
return
|
|
625177
|
+
return mkdir46.mkdirs(dir);
|
|
625132
625178
|
}
|
|
625133
625179
|
return Promise.all(items.map((item) => remove3.remove(path120.join(dir, item))));
|
|
625134
625180
|
});
|
|
@@ -625137,7 +625183,7 @@ var require_empty2 = __commonJS({
|
|
|
625137
625183
|
try {
|
|
625138
625184
|
items = fs34.readdirSync(dir);
|
|
625139
625185
|
} catch {
|
|
625140
|
-
return
|
|
625186
|
+
return mkdir46.mkdirsSync(dir);
|
|
625141
625187
|
}
|
|
625142
625188
|
items.forEach((item) => {
|
|
625143
625189
|
item = path120.join(dir, item);
|
|
@@ -625160,7 +625206,7 @@ var require_file2 = __commonJS({
|
|
|
625160
625206
|
var u5 = require_universalify().fromPromise;
|
|
625161
625207
|
var path120 = require("path");
|
|
625162
625208
|
var fs34 = require_fs();
|
|
625163
|
-
var
|
|
625209
|
+
var mkdir46 = require_mkdirs();
|
|
625164
625210
|
async function createFile(file4) {
|
|
625165
625211
|
let stats;
|
|
625166
625212
|
try {
|
|
@@ -625174,7 +625220,7 @@ var require_file2 = __commonJS({
|
|
|
625174
625220
|
dirStats = await fs34.stat(dir);
|
|
625175
625221
|
} catch (err) {
|
|
625176
625222
|
if (err.code === "ENOENT") {
|
|
625177
|
-
await
|
|
625223
|
+
await mkdir46.mkdirs(dir);
|
|
625178
625224
|
await fs34.writeFile(file4, "");
|
|
625179
625225
|
return;
|
|
625180
625226
|
} else {
|
|
@@ -625200,7 +625246,7 @@ var require_file2 = __commonJS({
|
|
|
625200
625246
|
fs34.readdirSync(dir);
|
|
625201
625247
|
}
|
|
625202
625248
|
} catch (err) {
|
|
625203
|
-
if (err && err.code === "ENOENT")
|
|
625249
|
+
if (err && err.code === "ENOENT") mkdir46.mkdirsSync(dir);
|
|
625204
625250
|
else throw err;
|
|
625205
625251
|
}
|
|
625206
625252
|
fs34.writeFileSync(file4, "");
|
|
@@ -625219,7 +625265,7 @@ var require_link = __commonJS({
|
|
|
625219
625265
|
var u5 = require_universalify().fromPromise;
|
|
625220
625266
|
var path120 = require("path");
|
|
625221
625267
|
var fs34 = require_fs();
|
|
625222
|
-
var
|
|
625268
|
+
var mkdir46 = require_mkdirs();
|
|
625223
625269
|
var { pathExists: pathExists2 } = require_path_exists();
|
|
625224
625270
|
var { areIdentical } = require_stat();
|
|
625225
625271
|
async function createLink(srcpath, dstpath) {
|
|
@@ -625239,7 +625285,7 @@ var require_link = __commonJS({
|
|
|
625239
625285
|
const dir = path120.dirname(dstpath);
|
|
625240
625286
|
const dirExists = await pathExists2(dir);
|
|
625241
625287
|
if (!dirExists) {
|
|
625242
|
-
await
|
|
625288
|
+
await mkdir46.mkdirs(dir);
|
|
625243
625289
|
}
|
|
625244
625290
|
await fs34.link(srcpath, dstpath);
|
|
625245
625291
|
}
|
|
@@ -625259,7 +625305,7 @@ var require_link = __commonJS({
|
|
|
625259
625305
|
const dir = path120.dirname(dstpath);
|
|
625260
625306
|
const dirExists = fs34.existsSync(dir);
|
|
625261
625307
|
if (dirExists) return fs34.linkSync(srcpath, dstpath);
|
|
625262
|
-
|
|
625308
|
+
mkdir46.mkdirsSync(dir);
|
|
625263
625309
|
return fs34.linkSync(srcpath, dstpath);
|
|
625264
625310
|
}
|
|
625265
625311
|
module4.exports = {
|
|
@@ -625533,7 +625579,7 @@ var require_jsonfile = __commonJS({
|
|
|
625533
625579
|
}
|
|
625534
625580
|
return obj;
|
|
625535
625581
|
}
|
|
625536
|
-
var
|
|
625582
|
+
var readFile121 = universalify.fromPromise(_readFile);
|
|
625537
625583
|
function readFileSync19(file4, options2 = {}) {
|
|
625538
625584
|
if (typeof options2 === "string") {
|
|
625539
625585
|
options2 = { encoding: options2 };
|
|
@@ -625565,7 +625611,7 @@ var require_jsonfile = __commonJS({
|
|
|
625565
625611
|
return fs34.writeFileSync(file4, str2, options2);
|
|
625566
625612
|
}
|
|
625567
625613
|
module4.exports = {
|
|
625568
|
-
readFile:
|
|
625614
|
+
readFile: readFile121,
|
|
625569
625615
|
readFileSync: readFileSync19,
|
|
625570
625616
|
writeFile: writeFile102,
|
|
625571
625617
|
writeFileSync: writeFileSync9
|
|
@@ -625595,19 +625641,19 @@ var require_output_file = __commonJS({
|
|
|
625595
625641
|
var u5 = require_universalify().fromPromise;
|
|
625596
625642
|
var fs34 = require_fs();
|
|
625597
625643
|
var path120 = require("path");
|
|
625598
|
-
var
|
|
625644
|
+
var mkdir46 = require_mkdirs();
|
|
625599
625645
|
var pathExists2 = require_path_exists().pathExists;
|
|
625600
625646
|
async function outputFile(file4, data2, encoding = "utf-8") {
|
|
625601
625647
|
const dir = path120.dirname(file4);
|
|
625602
625648
|
if (!await pathExists2(dir)) {
|
|
625603
|
-
await
|
|
625649
|
+
await mkdir46.mkdirs(dir);
|
|
625604
625650
|
}
|
|
625605
625651
|
return fs34.writeFile(file4, data2, encoding);
|
|
625606
625652
|
}
|
|
625607
625653
|
function outputFileSync(file4, ...args) {
|
|
625608
625654
|
const dir = path120.dirname(file4);
|
|
625609
625655
|
if (!fs34.existsSync(dir)) {
|
|
625610
|
-
|
|
625656
|
+
mkdir46.mkdirsSync(dir);
|
|
625611
625657
|
}
|
|
625612
625658
|
fs34.writeFileSync(file4, ...args);
|
|
625613
625659
|
}
|
|
@@ -625740,15 +625786,15 @@ var require_move_sync = __commonJS({
|
|
|
625740
625786
|
return parsedPath.root === parent;
|
|
625741
625787
|
}
|
|
625742
625788
|
function doRename(src, dest, overwrite, isChangingCase) {
|
|
625743
|
-
if (isChangingCase) return
|
|
625789
|
+
if (isChangingCase) return rename8(src, dest, overwrite);
|
|
625744
625790
|
if (overwrite) {
|
|
625745
625791
|
removeSync(dest);
|
|
625746
|
-
return
|
|
625792
|
+
return rename8(src, dest, overwrite);
|
|
625747
625793
|
}
|
|
625748
625794
|
if (fs34.existsSync(dest)) throw new Error("dest already exists.");
|
|
625749
|
-
return
|
|
625795
|
+
return rename8(src, dest, overwrite);
|
|
625750
625796
|
}
|
|
625751
|
-
function
|
|
625797
|
+
function rename8(src, dest, overwrite) {
|
|
625752
625798
|
try {
|
|
625753
625799
|
fs34.renameSync(src, dest);
|
|
625754
625800
|
} catch (err) {
|
|
@@ -629246,6 +629292,955 @@ var require_lib19 = __commonJS({
|
|
|
629246
629292
|
}
|
|
629247
629293
|
});
|
|
629248
629294
|
|
|
629295
|
+
// ../../../node_modules/.pnpm/buffer-crc32@1.0.0/node_modules/buffer-crc32/dist/index.cjs
|
|
629296
|
+
var require_dist26 = __commonJS({
|
|
629297
|
+
"../../../node_modules/.pnpm/buffer-crc32@1.0.0/node_modules/buffer-crc32/dist/index.cjs"(exports2, module4) {
|
|
629298
|
+
"use strict";
|
|
629299
|
+
function getDefaultExportFromCjs(x4) {
|
|
629300
|
+
return x4 && x4.__esModule && Object.prototype.hasOwnProperty.call(x4, "default") ? x4["default"] : x4;
|
|
629301
|
+
}
|
|
629302
|
+
var CRC_TABLE = new Int32Array([
|
|
629303
|
+
0,
|
|
629304
|
+
1996959894,
|
|
629305
|
+
3993919788,
|
|
629306
|
+
2567524794,
|
|
629307
|
+
124634137,
|
|
629308
|
+
1886057615,
|
|
629309
|
+
3915621685,
|
|
629310
|
+
2657392035,
|
|
629311
|
+
249268274,
|
|
629312
|
+
2044508324,
|
|
629313
|
+
3772115230,
|
|
629314
|
+
2547177864,
|
|
629315
|
+
162941995,
|
|
629316
|
+
2125561021,
|
|
629317
|
+
3887607047,
|
|
629318
|
+
2428444049,
|
|
629319
|
+
498536548,
|
|
629320
|
+
1789927666,
|
|
629321
|
+
4089016648,
|
|
629322
|
+
2227061214,
|
|
629323
|
+
450548861,
|
|
629324
|
+
1843258603,
|
|
629325
|
+
4107580753,
|
|
629326
|
+
2211677639,
|
|
629327
|
+
325883990,
|
|
629328
|
+
1684777152,
|
|
629329
|
+
4251122042,
|
|
629330
|
+
2321926636,
|
|
629331
|
+
335633487,
|
|
629332
|
+
1661365465,
|
|
629333
|
+
4195302755,
|
|
629334
|
+
2366115317,
|
|
629335
|
+
997073096,
|
|
629336
|
+
1281953886,
|
|
629337
|
+
3579855332,
|
|
629338
|
+
2724688242,
|
|
629339
|
+
1006888145,
|
|
629340
|
+
1258607687,
|
|
629341
|
+
3524101629,
|
|
629342
|
+
2768942443,
|
|
629343
|
+
901097722,
|
|
629344
|
+
1119000684,
|
|
629345
|
+
3686517206,
|
|
629346
|
+
2898065728,
|
|
629347
|
+
853044451,
|
|
629348
|
+
1172266101,
|
|
629349
|
+
3705015759,
|
|
629350
|
+
2882616665,
|
|
629351
|
+
651767980,
|
|
629352
|
+
1373503546,
|
|
629353
|
+
3369554304,
|
|
629354
|
+
3218104598,
|
|
629355
|
+
565507253,
|
|
629356
|
+
1454621731,
|
|
629357
|
+
3485111705,
|
|
629358
|
+
3099436303,
|
|
629359
|
+
671266974,
|
|
629360
|
+
1594198024,
|
|
629361
|
+
3322730930,
|
|
629362
|
+
2970347812,
|
|
629363
|
+
795835527,
|
|
629364
|
+
1483230225,
|
|
629365
|
+
3244367275,
|
|
629366
|
+
3060149565,
|
|
629367
|
+
1994146192,
|
|
629368
|
+
31158534,
|
|
629369
|
+
2563907772,
|
|
629370
|
+
4023717930,
|
|
629371
|
+
1907459465,
|
|
629372
|
+
112637215,
|
|
629373
|
+
2680153253,
|
|
629374
|
+
3904427059,
|
|
629375
|
+
2013776290,
|
|
629376
|
+
251722036,
|
|
629377
|
+
2517215374,
|
|
629378
|
+
3775830040,
|
|
629379
|
+
2137656763,
|
|
629380
|
+
141376813,
|
|
629381
|
+
2439277719,
|
|
629382
|
+
3865271297,
|
|
629383
|
+
1802195444,
|
|
629384
|
+
476864866,
|
|
629385
|
+
2238001368,
|
|
629386
|
+
4066508878,
|
|
629387
|
+
1812370925,
|
|
629388
|
+
453092731,
|
|
629389
|
+
2181625025,
|
|
629390
|
+
4111451223,
|
|
629391
|
+
1706088902,
|
|
629392
|
+
314042704,
|
|
629393
|
+
2344532202,
|
|
629394
|
+
4240017532,
|
|
629395
|
+
1658658271,
|
|
629396
|
+
366619977,
|
|
629397
|
+
2362670323,
|
|
629398
|
+
4224994405,
|
|
629399
|
+
1303535960,
|
|
629400
|
+
984961486,
|
|
629401
|
+
2747007092,
|
|
629402
|
+
3569037538,
|
|
629403
|
+
1256170817,
|
|
629404
|
+
1037604311,
|
|
629405
|
+
2765210733,
|
|
629406
|
+
3554079995,
|
|
629407
|
+
1131014506,
|
|
629408
|
+
879679996,
|
|
629409
|
+
2909243462,
|
|
629410
|
+
3663771856,
|
|
629411
|
+
1141124467,
|
|
629412
|
+
855842277,
|
|
629413
|
+
2852801631,
|
|
629414
|
+
3708648649,
|
|
629415
|
+
1342533948,
|
|
629416
|
+
654459306,
|
|
629417
|
+
3188396048,
|
|
629418
|
+
3373015174,
|
|
629419
|
+
1466479909,
|
|
629420
|
+
544179635,
|
|
629421
|
+
3110523913,
|
|
629422
|
+
3462522015,
|
|
629423
|
+
1591671054,
|
|
629424
|
+
702138776,
|
|
629425
|
+
2966460450,
|
|
629426
|
+
3352799412,
|
|
629427
|
+
1504918807,
|
|
629428
|
+
783551873,
|
|
629429
|
+
3082640443,
|
|
629430
|
+
3233442989,
|
|
629431
|
+
3988292384,
|
|
629432
|
+
2596254646,
|
|
629433
|
+
62317068,
|
|
629434
|
+
1957810842,
|
|
629435
|
+
3939845945,
|
|
629436
|
+
2647816111,
|
|
629437
|
+
81470997,
|
|
629438
|
+
1943803523,
|
|
629439
|
+
3814918930,
|
|
629440
|
+
2489596804,
|
|
629441
|
+
225274430,
|
|
629442
|
+
2053790376,
|
|
629443
|
+
3826175755,
|
|
629444
|
+
2466906013,
|
|
629445
|
+
167816743,
|
|
629446
|
+
2097651377,
|
|
629447
|
+
4027552580,
|
|
629448
|
+
2265490386,
|
|
629449
|
+
503444072,
|
|
629450
|
+
1762050814,
|
|
629451
|
+
4150417245,
|
|
629452
|
+
2154129355,
|
|
629453
|
+
426522225,
|
|
629454
|
+
1852507879,
|
|
629455
|
+
4275313526,
|
|
629456
|
+
2312317920,
|
|
629457
|
+
282753626,
|
|
629458
|
+
1742555852,
|
|
629459
|
+
4189708143,
|
|
629460
|
+
2394877945,
|
|
629461
|
+
397917763,
|
|
629462
|
+
1622183637,
|
|
629463
|
+
3604390888,
|
|
629464
|
+
2714866558,
|
|
629465
|
+
953729732,
|
|
629466
|
+
1340076626,
|
|
629467
|
+
3518719985,
|
|
629468
|
+
2797360999,
|
|
629469
|
+
1068828381,
|
|
629470
|
+
1219638859,
|
|
629471
|
+
3624741850,
|
|
629472
|
+
2936675148,
|
|
629473
|
+
906185462,
|
|
629474
|
+
1090812512,
|
|
629475
|
+
3747672003,
|
|
629476
|
+
2825379669,
|
|
629477
|
+
829329135,
|
|
629478
|
+
1181335161,
|
|
629479
|
+
3412177804,
|
|
629480
|
+
3160834842,
|
|
629481
|
+
628085408,
|
|
629482
|
+
1382605366,
|
|
629483
|
+
3423369109,
|
|
629484
|
+
3138078467,
|
|
629485
|
+
570562233,
|
|
629486
|
+
1426400815,
|
|
629487
|
+
3317316542,
|
|
629488
|
+
2998733608,
|
|
629489
|
+
733239954,
|
|
629490
|
+
1555261956,
|
|
629491
|
+
3268935591,
|
|
629492
|
+
3050360625,
|
|
629493
|
+
752459403,
|
|
629494
|
+
1541320221,
|
|
629495
|
+
2607071920,
|
|
629496
|
+
3965973030,
|
|
629497
|
+
1969922972,
|
|
629498
|
+
40735498,
|
|
629499
|
+
2617837225,
|
|
629500
|
+
3943577151,
|
|
629501
|
+
1913087877,
|
|
629502
|
+
83908371,
|
|
629503
|
+
2512341634,
|
|
629504
|
+
3803740692,
|
|
629505
|
+
2075208622,
|
|
629506
|
+
213261112,
|
|
629507
|
+
2463272603,
|
|
629508
|
+
3855990285,
|
|
629509
|
+
2094854071,
|
|
629510
|
+
198958881,
|
|
629511
|
+
2262029012,
|
|
629512
|
+
4057260610,
|
|
629513
|
+
1759359992,
|
|
629514
|
+
534414190,
|
|
629515
|
+
2176718541,
|
|
629516
|
+
4139329115,
|
|
629517
|
+
1873836001,
|
|
629518
|
+
414664567,
|
|
629519
|
+
2282248934,
|
|
629520
|
+
4279200368,
|
|
629521
|
+
1711684554,
|
|
629522
|
+
285281116,
|
|
629523
|
+
2405801727,
|
|
629524
|
+
4167216745,
|
|
629525
|
+
1634467795,
|
|
629526
|
+
376229701,
|
|
629527
|
+
2685067896,
|
|
629528
|
+
3608007406,
|
|
629529
|
+
1308918612,
|
|
629530
|
+
956543938,
|
|
629531
|
+
2808555105,
|
|
629532
|
+
3495958263,
|
|
629533
|
+
1231636301,
|
|
629534
|
+
1047427035,
|
|
629535
|
+
2932959818,
|
|
629536
|
+
3654703836,
|
|
629537
|
+
1088359270,
|
|
629538
|
+
936918e3,
|
|
629539
|
+
2847714899,
|
|
629540
|
+
3736837829,
|
|
629541
|
+
1202900863,
|
|
629542
|
+
817233897,
|
|
629543
|
+
3183342108,
|
|
629544
|
+
3401237130,
|
|
629545
|
+
1404277552,
|
|
629546
|
+
615818150,
|
|
629547
|
+
3134207493,
|
|
629548
|
+
3453421203,
|
|
629549
|
+
1423857449,
|
|
629550
|
+
601450431,
|
|
629551
|
+
3009837614,
|
|
629552
|
+
3294710456,
|
|
629553
|
+
1567103746,
|
|
629554
|
+
711928724,
|
|
629555
|
+
3020668471,
|
|
629556
|
+
3272380065,
|
|
629557
|
+
1510334235,
|
|
629558
|
+
755167117
|
|
629559
|
+
]);
|
|
629560
|
+
function ensureBuffer(input3) {
|
|
629561
|
+
if (Buffer.isBuffer(input3)) {
|
|
629562
|
+
return input3;
|
|
629563
|
+
}
|
|
629564
|
+
if (typeof input3 === "number") {
|
|
629565
|
+
return Buffer.alloc(input3);
|
|
629566
|
+
} else if (typeof input3 === "string") {
|
|
629567
|
+
return Buffer.from(input3);
|
|
629568
|
+
} else {
|
|
629569
|
+
throw new Error("input must be buffer, number, or string, received " + typeof input3);
|
|
629570
|
+
}
|
|
629571
|
+
}
|
|
629572
|
+
function bufferizeInt(num) {
|
|
629573
|
+
const tmp22 = ensureBuffer(4);
|
|
629574
|
+
tmp22.writeInt32BE(num, 0);
|
|
629575
|
+
return tmp22;
|
|
629576
|
+
}
|
|
629577
|
+
function _crc32(buf, previous4) {
|
|
629578
|
+
buf = ensureBuffer(buf);
|
|
629579
|
+
if (Buffer.isBuffer(previous4)) {
|
|
629580
|
+
previous4 = previous4.readUInt32BE(0);
|
|
629581
|
+
}
|
|
629582
|
+
let crc = ~~previous4 ^ -1;
|
|
629583
|
+
for (var n2 = 0; n2 < buf.length; n2++) {
|
|
629584
|
+
crc = CRC_TABLE[(crc ^ buf[n2]) & 255] ^ crc >>> 8;
|
|
629585
|
+
}
|
|
629586
|
+
return crc ^ -1;
|
|
629587
|
+
}
|
|
629588
|
+
function crc322() {
|
|
629589
|
+
return bufferizeInt(_crc32.apply(null, arguments));
|
|
629590
|
+
}
|
|
629591
|
+
crc322.signed = function() {
|
|
629592
|
+
return _crc32.apply(null, arguments);
|
|
629593
|
+
};
|
|
629594
|
+
crc322.unsigned = function() {
|
|
629595
|
+
return _crc32.apply(null, arguments) >>> 0;
|
|
629596
|
+
};
|
|
629597
|
+
var bufferCrc32 = crc322;
|
|
629598
|
+
var index3 = /* @__PURE__ */ getDefaultExportFromCjs(bufferCrc32);
|
|
629599
|
+
module4.exports = index3;
|
|
629600
|
+
}
|
|
629601
|
+
});
|
|
629602
|
+
|
|
629603
|
+
// ../../../node_modules/.pnpm/yazl@3.3.1/node_modules/yazl/index.js
|
|
629604
|
+
var require_yazl = __commonJS({
|
|
629605
|
+
"../../../node_modules/.pnpm/yazl@3.3.1/node_modules/yazl/index.js"(exports2) {
|
|
629606
|
+
"use strict";
|
|
629607
|
+
var fs34 = require("fs");
|
|
629608
|
+
var Transform = require("stream").Transform;
|
|
629609
|
+
var PassThrough5 = require("stream").PassThrough;
|
|
629610
|
+
var zlib4 = require("zlib");
|
|
629611
|
+
var util5 = require("util");
|
|
629612
|
+
var EventEmitter9 = require("events").EventEmitter;
|
|
629613
|
+
var errorMonitor3 = require("events").errorMonitor;
|
|
629614
|
+
var crc322 = require_dist26();
|
|
629615
|
+
exports2.ZipFile = ZipFile2;
|
|
629616
|
+
exports2.dateToDosDateTime = dateToDosDateTime;
|
|
629617
|
+
util5.inherits(ZipFile2, EventEmitter9);
|
|
629618
|
+
function ZipFile2() {
|
|
629619
|
+
this.outputStream = new PassThrough5();
|
|
629620
|
+
this.entries = [];
|
|
629621
|
+
this.outputStreamCursor = 0;
|
|
629622
|
+
this.ended = false;
|
|
629623
|
+
this.allDone = false;
|
|
629624
|
+
this.forceZip64Eocd = false;
|
|
629625
|
+
this.errored = false;
|
|
629626
|
+
this.on(errorMonitor3, function() {
|
|
629627
|
+
this.errored = true;
|
|
629628
|
+
});
|
|
629629
|
+
}
|
|
629630
|
+
ZipFile2.prototype.addFile = function(realPath, metadataPath, options2) {
|
|
629631
|
+
var self2 = this;
|
|
629632
|
+
metadataPath = validateMetadataPath(metadataPath, false);
|
|
629633
|
+
if (options2 == null) options2 = {};
|
|
629634
|
+
if (shouldIgnoreAdding(self2)) return;
|
|
629635
|
+
var entry = new Entry(metadataPath, false, options2);
|
|
629636
|
+
self2.entries.push(entry);
|
|
629637
|
+
fs34.stat(realPath, function(err, stats) {
|
|
629638
|
+
if (err) return self2.emit("error", err);
|
|
629639
|
+
if (!stats.isFile()) return self2.emit("error", new Error("not a file: " + realPath));
|
|
629640
|
+
entry.uncompressedSize = stats.size;
|
|
629641
|
+
if (options2.mtime == null) entry.setLastModDate(stats.mtime);
|
|
629642
|
+
if (options2.mode == null) entry.setFileAttributesMode(stats.mode);
|
|
629643
|
+
entry.setFileDataPumpFunction(function() {
|
|
629644
|
+
var readStream2 = fs34.createReadStream(realPath);
|
|
629645
|
+
entry.state = Entry.FILE_DATA_IN_PROGRESS;
|
|
629646
|
+
readStream2.on("error", function(err2) {
|
|
629647
|
+
self2.emit("error", err2);
|
|
629648
|
+
});
|
|
629649
|
+
pumpFileDataReadStream(self2, entry, readStream2);
|
|
629650
|
+
});
|
|
629651
|
+
pumpEntries(self2);
|
|
629652
|
+
});
|
|
629653
|
+
};
|
|
629654
|
+
ZipFile2.prototype.addReadStream = function(readStream2, metadataPath, options2) {
|
|
629655
|
+
this.addReadStreamLazy(metadataPath, options2, function(cb) {
|
|
629656
|
+
cb(null, readStream2);
|
|
629657
|
+
});
|
|
629658
|
+
};
|
|
629659
|
+
ZipFile2.prototype.addReadStreamLazy = function(metadataPath, options2, getReadStreamFunction) {
|
|
629660
|
+
var self2 = this;
|
|
629661
|
+
if (typeof options2 === "function") {
|
|
629662
|
+
getReadStreamFunction = options2;
|
|
629663
|
+
options2 = null;
|
|
629664
|
+
}
|
|
629665
|
+
if (options2 == null) options2 = {};
|
|
629666
|
+
metadataPath = validateMetadataPath(metadataPath, false);
|
|
629667
|
+
if (shouldIgnoreAdding(self2)) return;
|
|
629668
|
+
var entry = new Entry(metadataPath, false, options2);
|
|
629669
|
+
self2.entries.push(entry);
|
|
629670
|
+
entry.setFileDataPumpFunction(function() {
|
|
629671
|
+
entry.state = Entry.FILE_DATA_IN_PROGRESS;
|
|
629672
|
+
getReadStreamFunction(function(err, readStream2) {
|
|
629673
|
+
if (err) return self2.emit("error", err);
|
|
629674
|
+
pumpFileDataReadStream(self2, entry, readStream2);
|
|
629675
|
+
});
|
|
629676
|
+
});
|
|
629677
|
+
pumpEntries(self2);
|
|
629678
|
+
};
|
|
629679
|
+
ZipFile2.prototype.addBuffer = function(buffer, metadataPath, options2) {
|
|
629680
|
+
var self2 = this;
|
|
629681
|
+
metadataPath = validateMetadataPath(metadataPath, false);
|
|
629682
|
+
if (buffer.length > 1073741823) throw new Error("buffer too large: " + buffer.length + " > 1073741823");
|
|
629683
|
+
if (options2 == null) options2 = {};
|
|
629684
|
+
if (options2.size != null) throw new Error("options.size not allowed");
|
|
629685
|
+
if (shouldIgnoreAdding(self2)) return;
|
|
629686
|
+
var entry = new Entry(metadataPath, false, options2);
|
|
629687
|
+
entry.uncompressedSize = buffer.length;
|
|
629688
|
+
entry.crc32 = crc322.unsigned(buffer);
|
|
629689
|
+
entry.crcAndFileSizeKnown = true;
|
|
629690
|
+
self2.entries.push(entry);
|
|
629691
|
+
if (entry.compressionLevel === 0) {
|
|
629692
|
+
setCompressedBuffer(buffer);
|
|
629693
|
+
} else {
|
|
629694
|
+
zlib4.deflateRaw(buffer, { level: entry.compressionLevel }, function(err, compressedBuffer) {
|
|
629695
|
+
setCompressedBuffer(compressedBuffer);
|
|
629696
|
+
});
|
|
629697
|
+
}
|
|
629698
|
+
function setCompressedBuffer(compressedBuffer) {
|
|
629699
|
+
entry.compressedSize = compressedBuffer.length;
|
|
629700
|
+
entry.setFileDataPumpFunction(function() {
|
|
629701
|
+
writeToOutputStream(self2, compressedBuffer);
|
|
629702
|
+
writeToOutputStream(self2, entry.getDataDescriptor());
|
|
629703
|
+
entry.state = Entry.FILE_DATA_DONE;
|
|
629704
|
+
setImmediate(function() {
|
|
629705
|
+
pumpEntries(self2);
|
|
629706
|
+
});
|
|
629707
|
+
});
|
|
629708
|
+
pumpEntries(self2);
|
|
629709
|
+
}
|
|
629710
|
+
};
|
|
629711
|
+
ZipFile2.prototype.addEmptyDirectory = function(metadataPath, options2) {
|
|
629712
|
+
var self2 = this;
|
|
629713
|
+
metadataPath = validateMetadataPath(metadataPath, true);
|
|
629714
|
+
if (options2 == null) options2 = {};
|
|
629715
|
+
if (options2.size != null) throw new Error("options.size not allowed");
|
|
629716
|
+
if (options2.compress != null) throw new Error("options.compress not allowed");
|
|
629717
|
+
if (options2.compressionLevel != null) throw new Error("options.compressionLevel not allowed");
|
|
629718
|
+
if (shouldIgnoreAdding(self2)) return;
|
|
629719
|
+
var entry = new Entry(metadataPath, true, options2);
|
|
629720
|
+
self2.entries.push(entry);
|
|
629721
|
+
entry.setFileDataPumpFunction(function() {
|
|
629722
|
+
writeToOutputStream(self2, entry.getDataDescriptor());
|
|
629723
|
+
entry.state = Entry.FILE_DATA_DONE;
|
|
629724
|
+
pumpEntries(self2);
|
|
629725
|
+
});
|
|
629726
|
+
pumpEntries(self2);
|
|
629727
|
+
};
|
|
629728
|
+
var eocdrSignatureBuffer = bufferFrom([80, 75, 5, 6]);
|
|
629729
|
+
ZipFile2.prototype.end = function(options2, calculatedTotalSizeCallback) {
|
|
629730
|
+
if (typeof options2 === "function") {
|
|
629731
|
+
calculatedTotalSizeCallback = options2;
|
|
629732
|
+
options2 = null;
|
|
629733
|
+
}
|
|
629734
|
+
if (options2 == null) options2 = {};
|
|
629735
|
+
if (this.ended) return;
|
|
629736
|
+
this.ended = true;
|
|
629737
|
+
if (this.errored) return;
|
|
629738
|
+
this.calculatedTotalSizeCallback = calculatedTotalSizeCallback;
|
|
629739
|
+
this.forceZip64Eocd = !!options2.forceZip64Format;
|
|
629740
|
+
if (options2.comment) {
|
|
629741
|
+
if (typeof options2.comment === "string") {
|
|
629742
|
+
this.comment = encodeCp437(options2.comment);
|
|
629743
|
+
} else {
|
|
629744
|
+
this.comment = options2.comment;
|
|
629745
|
+
}
|
|
629746
|
+
if (this.comment.length > 65535) throw new Error("comment is too large");
|
|
629747
|
+
if (bufferIncludes(this.comment, eocdrSignatureBuffer)) throw new Error("comment contains end of central directory record signature");
|
|
629748
|
+
} else {
|
|
629749
|
+
this.comment = EMPTY_BUFFER;
|
|
629750
|
+
}
|
|
629751
|
+
pumpEntries(this);
|
|
629752
|
+
};
|
|
629753
|
+
function writeToOutputStream(self2, buffer) {
|
|
629754
|
+
self2.outputStream.write(buffer);
|
|
629755
|
+
self2.outputStreamCursor += buffer.length;
|
|
629756
|
+
}
|
|
629757
|
+
function pumpFileDataReadStream(self2, entry, readStream2) {
|
|
629758
|
+
var crc32Watcher = new Crc32Watcher();
|
|
629759
|
+
var uncompressedSizeCounter = new ByteCounter();
|
|
629760
|
+
var compressor = entry.compressionLevel !== 0 ? new zlib4.DeflateRaw({ level: entry.compressionLevel }) : new PassThrough5();
|
|
629761
|
+
var compressedSizeCounter = new ByteCounter();
|
|
629762
|
+
readStream2.pipe(crc32Watcher).pipe(uncompressedSizeCounter).pipe(compressor).pipe(compressedSizeCounter).pipe(self2.outputStream, { end: false });
|
|
629763
|
+
compressedSizeCounter.on("end", function() {
|
|
629764
|
+
entry.crc32 = crc32Watcher.crc32;
|
|
629765
|
+
if (entry.uncompressedSize == null) {
|
|
629766
|
+
entry.uncompressedSize = uncompressedSizeCounter.byteCount;
|
|
629767
|
+
} else {
|
|
629768
|
+
if (entry.uncompressedSize !== uncompressedSizeCounter.byteCount) return self2.emit("error", new Error("file data stream has unexpected number of bytes"));
|
|
629769
|
+
}
|
|
629770
|
+
entry.compressedSize = compressedSizeCounter.byteCount;
|
|
629771
|
+
self2.outputStreamCursor += entry.compressedSize;
|
|
629772
|
+
writeToOutputStream(self2, entry.getDataDescriptor());
|
|
629773
|
+
entry.state = Entry.FILE_DATA_DONE;
|
|
629774
|
+
pumpEntries(self2);
|
|
629775
|
+
});
|
|
629776
|
+
}
|
|
629777
|
+
function determineCompressionLevel(options2) {
|
|
629778
|
+
if (options2.compress != null && options2.compressionLevel != null) {
|
|
629779
|
+
if (!!options2.compress !== !!options2.compressionLevel) throw new Error("conflicting settings for compress and compressionLevel");
|
|
629780
|
+
}
|
|
629781
|
+
if (options2.compressionLevel != null) return options2.compressionLevel;
|
|
629782
|
+
if (options2.compress === false) return 0;
|
|
629783
|
+
return 6;
|
|
629784
|
+
}
|
|
629785
|
+
function pumpEntries(self2) {
|
|
629786
|
+
if (self2.allDone || self2.errored) return;
|
|
629787
|
+
if (self2.ended && self2.calculatedTotalSizeCallback != null) {
|
|
629788
|
+
var calculatedTotalSize = calculateTotalSize(self2);
|
|
629789
|
+
if (calculatedTotalSize != null) {
|
|
629790
|
+
self2.calculatedTotalSizeCallback(calculatedTotalSize);
|
|
629791
|
+
self2.calculatedTotalSizeCallback = null;
|
|
629792
|
+
}
|
|
629793
|
+
}
|
|
629794
|
+
var entry = getFirstNotDoneEntry();
|
|
629795
|
+
function getFirstNotDoneEntry() {
|
|
629796
|
+
for (var i5 = 0; i5 < self2.entries.length; i5++) {
|
|
629797
|
+
var entry2 = self2.entries[i5];
|
|
629798
|
+
if (entry2.state < Entry.FILE_DATA_DONE) return entry2;
|
|
629799
|
+
}
|
|
629800
|
+
return null;
|
|
629801
|
+
}
|
|
629802
|
+
if (entry != null) {
|
|
629803
|
+
if (entry.state < Entry.READY_TO_PUMP_FILE_DATA) return;
|
|
629804
|
+
if (entry.state === Entry.FILE_DATA_IN_PROGRESS) return;
|
|
629805
|
+
entry.relativeOffsetOfLocalHeader = self2.outputStreamCursor;
|
|
629806
|
+
var localFileHeader = entry.getLocalFileHeader();
|
|
629807
|
+
writeToOutputStream(self2, localFileHeader);
|
|
629808
|
+
entry.doFileDataPump();
|
|
629809
|
+
} else {
|
|
629810
|
+
if (self2.ended) {
|
|
629811
|
+
self2.offsetOfStartOfCentralDirectory = self2.outputStreamCursor;
|
|
629812
|
+
self2.entries.forEach(function(entry2) {
|
|
629813
|
+
var centralDirectoryRecord = entry2.getCentralDirectoryRecord();
|
|
629814
|
+
writeToOutputStream(self2, centralDirectoryRecord);
|
|
629815
|
+
});
|
|
629816
|
+
writeToOutputStream(self2, getEndOfCentralDirectoryRecord(self2));
|
|
629817
|
+
self2.outputStream.end();
|
|
629818
|
+
self2.allDone = true;
|
|
629819
|
+
}
|
|
629820
|
+
}
|
|
629821
|
+
}
|
|
629822
|
+
function calculateTotalSize(self2) {
|
|
629823
|
+
var pretendOutputCursor = 0;
|
|
629824
|
+
var centralDirectorySize = 0;
|
|
629825
|
+
for (var i5 = 0; i5 < self2.entries.length; i5++) {
|
|
629826
|
+
var entry = self2.entries[i5];
|
|
629827
|
+
if (entry.compressionLevel !== 0) return -1;
|
|
629828
|
+
if (entry.state >= Entry.READY_TO_PUMP_FILE_DATA) {
|
|
629829
|
+
if (entry.uncompressedSize == null) return -1;
|
|
629830
|
+
} else {
|
|
629831
|
+
if (entry.uncompressedSize == null) return null;
|
|
629832
|
+
}
|
|
629833
|
+
entry.relativeOffsetOfLocalHeader = pretendOutputCursor;
|
|
629834
|
+
var useZip64Format = entry.useZip64Format();
|
|
629835
|
+
pretendOutputCursor += LOCAL_FILE_HEADER_FIXED_SIZE + entry.utf8FileName.length;
|
|
629836
|
+
pretendOutputCursor += entry.uncompressedSize;
|
|
629837
|
+
if (!entry.crcAndFileSizeKnown) {
|
|
629838
|
+
if (useZip64Format) {
|
|
629839
|
+
pretendOutputCursor += ZIP64_DATA_DESCRIPTOR_SIZE;
|
|
629840
|
+
} else {
|
|
629841
|
+
pretendOutputCursor += DATA_DESCRIPTOR_SIZE;
|
|
629842
|
+
}
|
|
629843
|
+
}
|
|
629844
|
+
centralDirectorySize += CENTRAL_DIRECTORY_RECORD_FIXED_SIZE + entry.utf8FileName.length + entry.fileComment.length;
|
|
629845
|
+
if (!entry.forceDosTimestamp) {
|
|
629846
|
+
centralDirectorySize += INFO_ZIP_UNIVERSAL_TIMESTAMP_EXTRA_FIELD_SIZE;
|
|
629847
|
+
}
|
|
629848
|
+
if (useZip64Format) {
|
|
629849
|
+
centralDirectorySize += ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE;
|
|
629850
|
+
}
|
|
629851
|
+
}
|
|
629852
|
+
var endOfCentralDirectorySize = 0;
|
|
629853
|
+
if (self2.forceZip64Eocd || self2.entries.length >= 65535 || centralDirectorySize >= 65535 || pretendOutputCursor >= 4294967295) {
|
|
629854
|
+
endOfCentralDirectorySize += ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE + ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIZE;
|
|
629855
|
+
}
|
|
629856
|
+
endOfCentralDirectorySize += END_OF_CENTRAL_DIRECTORY_RECORD_SIZE + self2.comment.length;
|
|
629857
|
+
return pretendOutputCursor + centralDirectorySize + endOfCentralDirectorySize;
|
|
629858
|
+
}
|
|
629859
|
+
function shouldIgnoreAdding(self2) {
|
|
629860
|
+
if (self2.ended) throw new Error("cannot add entries after calling end()");
|
|
629861
|
+
if (self2.errored) return true;
|
|
629862
|
+
return false;
|
|
629863
|
+
}
|
|
629864
|
+
var ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE = 56;
|
|
629865
|
+
var ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIZE = 20;
|
|
629866
|
+
var END_OF_CENTRAL_DIRECTORY_RECORD_SIZE = 22;
|
|
629867
|
+
function getEndOfCentralDirectoryRecord(self2, actuallyJustTellMeHowLongItWouldBe) {
|
|
629868
|
+
var needZip64Format = false;
|
|
629869
|
+
var normalEntriesLength = self2.entries.length;
|
|
629870
|
+
if (self2.forceZip64Eocd || self2.entries.length >= 65535) {
|
|
629871
|
+
normalEntriesLength = 65535;
|
|
629872
|
+
needZip64Format = true;
|
|
629873
|
+
}
|
|
629874
|
+
var sizeOfCentralDirectory = self2.outputStreamCursor - self2.offsetOfStartOfCentralDirectory;
|
|
629875
|
+
var normalSizeOfCentralDirectory = sizeOfCentralDirectory;
|
|
629876
|
+
if (self2.forceZip64Eocd || sizeOfCentralDirectory >= 4294967295) {
|
|
629877
|
+
normalSizeOfCentralDirectory = 4294967295;
|
|
629878
|
+
needZip64Format = true;
|
|
629879
|
+
}
|
|
629880
|
+
var normalOffsetOfStartOfCentralDirectory = self2.offsetOfStartOfCentralDirectory;
|
|
629881
|
+
if (self2.forceZip64Eocd || self2.offsetOfStartOfCentralDirectory >= 4294967295) {
|
|
629882
|
+
normalOffsetOfStartOfCentralDirectory = 4294967295;
|
|
629883
|
+
needZip64Format = true;
|
|
629884
|
+
}
|
|
629885
|
+
if (actuallyJustTellMeHowLongItWouldBe) {
|
|
629886
|
+
if (needZip64Format) {
|
|
629887
|
+
return ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE + ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIZE + END_OF_CENTRAL_DIRECTORY_RECORD_SIZE;
|
|
629888
|
+
} else {
|
|
629889
|
+
return END_OF_CENTRAL_DIRECTORY_RECORD_SIZE;
|
|
629890
|
+
}
|
|
629891
|
+
}
|
|
629892
|
+
var eocdrBuffer = bufferAlloc(END_OF_CENTRAL_DIRECTORY_RECORD_SIZE + self2.comment.length);
|
|
629893
|
+
eocdrBuffer.writeUInt32LE(101010256, 0);
|
|
629894
|
+
eocdrBuffer.writeUInt16LE(0, 4);
|
|
629895
|
+
eocdrBuffer.writeUInt16LE(0, 6);
|
|
629896
|
+
eocdrBuffer.writeUInt16LE(normalEntriesLength, 8);
|
|
629897
|
+
eocdrBuffer.writeUInt16LE(normalEntriesLength, 10);
|
|
629898
|
+
eocdrBuffer.writeUInt32LE(normalSizeOfCentralDirectory, 12);
|
|
629899
|
+
eocdrBuffer.writeUInt32LE(normalOffsetOfStartOfCentralDirectory, 16);
|
|
629900
|
+
eocdrBuffer.writeUInt16LE(self2.comment.length, 20);
|
|
629901
|
+
self2.comment.copy(eocdrBuffer, 22);
|
|
629902
|
+
if (!needZip64Format) return eocdrBuffer;
|
|
629903
|
+
var zip64EocdrBuffer = bufferAlloc(ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE);
|
|
629904
|
+
zip64EocdrBuffer.writeUInt32LE(101075792, 0);
|
|
629905
|
+
writeUInt64LE(zip64EocdrBuffer, ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE - 12, 4);
|
|
629906
|
+
zip64EocdrBuffer.writeUInt16LE(VERSION_MADE_BY, 12);
|
|
629907
|
+
zip64EocdrBuffer.writeUInt16LE(VERSION_NEEDED_TO_EXTRACT_ZIP64, 14);
|
|
629908
|
+
zip64EocdrBuffer.writeUInt32LE(0, 16);
|
|
629909
|
+
zip64EocdrBuffer.writeUInt32LE(0, 20);
|
|
629910
|
+
writeUInt64LE(zip64EocdrBuffer, self2.entries.length, 24);
|
|
629911
|
+
writeUInt64LE(zip64EocdrBuffer, self2.entries.length, 32);
|
|
629912
|
+
writeUInt64LE(zip64EocdrBuffer, sizeOfCentralDirectory, 40);
|
|
629913
|
+
writeUInt64LE(zip64EocdrBuffer, self2.offsetOfStartOfCentralDirectory, 48);
|
|
629914
|
+
var zip64EocdlBuffer = bufferAlloc(ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIZE);
|
|
629915
|
+
zip64EocdlBuffer.writeUInt32LE(117853008, 0);
|
|
629916
|
+
zip64EocdlBuffer.writeUInt32LE(0, 4);
|
|
629917
|
+
writeUInt64LE(zip64EocdlBuffer, self2.outputStreamCursor, 8);
|
|
629918
|
+
zip64EocdlBuffer.writeUInt32LE(1, 16);
|
|
629919
|
+
return Buffer.concat([
|
|
629920
|
+
zip64EocdrBuffer,
|
|
629921
|
+
zip64EocdlBuffer,
|
|
629922
|
+
eocdrBuffer
|
|
629923
|
+
]);
|
|
629924
|
+
}
|
|
629925
|
+
function validateMetadataPath(metadataPath, isDirectory) {
|
|
629926
|
+
if (metadataPath === "") throw new Error("empty metadataPath");
|
|
629927
|
+
metadataPath = metadataPath.replace(/\\/g, "/");
|
|
629928
|
+
if (/^[a-zA-Z]:/.test(metadataPath) || /^\//.test(metadataPath)) throw new Error("absolute path: " + metadataPath);
|
|
629929
|
+
if (metadataPath.split("/").indexOf("..") !== -1) throw new Error("invalid relative path: " + metadataPath);
|
|
629930
|
+
var looksLikeDirectory = /\/$/.test(metadataPath);
|
|
629931
|
+
if (isDirectory) {
|
|
629932
|
+
if (!looksLikeDirectory) metadataPath += "/";
|
|
629933
|
+
} else {
|
|
629934
|
+
if (looksLikeDirectory) throw new Error("file path cannot end with '/': " + metadataPath);
|
|
629935
|
+
}
|
|
629936
|
+
return metadataPath;
|
|
629937
|
+
}
|
|
629938
|
+
var EMPTY_BUFFER = bufferAlloc(0);
|
|
629939
|
+
function Entry(metadataPath, isDirectory, options2) {
|
|
629940
|
+
this.utf8FileName = bufferFrom(metadataPath);
|
|
629941
|
+
if (this.utf8FileName.length > 65535) throw new Error("utf8 file name too long. " + utf8FileName.length + " > 65535");
|
|
629942
|
+
this.isDirectory = isDirectory;
|
|
629943
|
+
this.state = Entry.WAITING_FOR_METADATA;
|
|
629944
|
+
this.setLastModDate(options2.mtime != null ? options2.mtime : /* @__PURE__ */ new Date());
|
|
629945
|
+
this.forceDosTimestamp = !!options2.forceDosTimestamp;
|
|
629946
|
+
if (options2.mode != null) {
|
|
629947
|
+
this.setFileAttributesMode(options2.mode);
|
|
629948
|
+
} else {
|
|
629949
|
+
this.setFileAttributesMode(isDirectory ? 16893 : 33204);
|
|
629950
|
+
}
|
|
629951
|
+
if (isDirectory) {
|
|
629952
|
+
this.crcAndFileSizeKnown = true;
|
|
629953
|
+
this.crc32 = 0;
|
|
629954
|
+
this.uncompressedSize = 0;
|
|
629955
|
+
this.compressedSize = 0;
|
|
629956
|
+
} else {
|
|
629957
|
+
this.crcAndFileSizeKnown = false;
|
|
629958
|
+
this.crc32 = null;
|
|
629959
|
+
this.uncompressedSize = null;
|
|
629960
|
+
this.compressedSize = null;
|
|
629961
|
+
if (options2.size != null) this.uncompressedSize = options2.size;
|
|
629962
|
+
}
|
|
629963
|
+
if (isDirectory) {
|
|
629964
|
+
this.compressionLevel = 0;
|
|
629965
|
+
} else {
|
|
629966
|
+
this.compressionLevel = determineCompressionLevel(options2);
|
|
629967
|
+
}
|
|
629968
|
+
this.forceZip64Format = !!options2.forceZip64Format;
|
|
629969
|
+
if (options2.fileComment) {
|
|
629970
|
+
if (typeof options2.fileComment === "string") {
|
|
629971
|
+
this.fileComment = bufferFrom(options2.fileComment, "utf-8");
|
|
629972
|
+
} else {
|
|
629973
|
+
this.fileComment = options2.fileComment;
|
|
629974
|
+
}
|
|
629975
|
+
if (this.fileComment.length > 65535) throw new Error("fileComment is too large");
|
|
629976
|
+
} else {
|
|
629977
|
+
this.fileComment = EMPTY_BUFFER;
|
|
629978
|
+
}
|
|
629979
|
+
}
|
|
629980
|
+
Entry.WAITING_FOR_METADATA = 0;
|
|
629981
|
+
Entry.READY_TO_PUMP_FILE_DATA = 1;
|
|
629982
|
+
Entry.FILE_DATA_IN_PROGRESS = 2;
|
|
629983
|
+
Entry.FILE_DATA_DONE = 3;
|
|
629984
|
+
Entry.prototype.setLastModDate = function(date26) {
|
|
629985
|
+
this.mtime = date26;
|
|
629986
|
+
var dosDateTime = dateToDosDateTime(date26);
|
|
629987
|
+
this.lastModFileTime = dosDateTime.time;
|
|
629988
|
+
this.lastModFileDate = dosDateTime.date;
|
|
629989
|
+
};
|
|
629990
|
+
Entry.prototype.setFileAttributesMode = function(mode) {
|
|
629991
|
+
if ((mode & 65535) !== mode) throw new Error("invalid mode. expected: 0 <= " + mode + " <= 65535");
|
|
629992
|
+
this.externalFileAttributes = mode << 16 >>> 0;
|
|
629993
|
+
};
|
|
629994
|
+
Entry.prototype.setFileDataPumpFunction = function(doFileDataPump) {
|
|
629995
|
+
this.doFileDataPump = doFileDataPump;
|
|
629996
|
+
this.state = Entry.READY_TO_PUMP_FILE_DATA;
|
|
629997
|
+
};
|
|
629998
|
+
Entry.prototype.useZip64Format = function() {
|
|
629999
|
+
return this.forceZip64Format || this.uncompressedSize != null && this.uncompressedSize > 4294967294 || this.compressedSize != null && this.compressedSize > 4294967294 || this.relativeOffsetOfLocalHeader != null && this.relativeOffsetOfLocalHeader > 4294967294;
|
|
630000
|
+
};
|
|
630001
|
+
var LOCAL_FILE_HEADER_FIXED_SIZE = 30;
|
|
630002
|
+
var VERSION_NEEDED_TO_EXTRACT_UTF8 = 20;
|
|
630003
|
+
var VERSION_NEEDED_TO_EXTRACT_ZIP64 = 45;
|
|
630004
|
+
var VERSION_MADE_BY = 3 << 8 | 63;
|
|
630005
|
+
var FILE_NAME_IS_UTF8 = 1 << 11;
|
|
630006
|
+
var UNKNOWN_CRC32_AND_FILE_SIZES = 1 << 3;
|
|
630007
|
+
Entry.prototype.getLocalFileHeader = function() {
|
|
630008
|
+
var crc323 = 0;
|
|
630009
|
+
var compressedSize = 0;
|
|
630010
|
+
var uncompressedSize = 0;
|
|
630011
|
+
if (this.crcAndFileSizeKnown) {
|
|
630012
|
+
crc323 = this.crc32;
|
|
630013
|
+
compressedSize = this.compressedSize;
|
|
630014
|
+
uncompressedSize = this.uncompressedSize;
|
|
630015
|
+
}
|
|
630016
|
+
var fixedSizeStuff = bufferAlloc(LOCAL_FILE_HEADER_FIXED_SIZE);
|
|
630017
|
+
var generalPurposeBitFlag = FILE_NAME_IS_UTF8;
|
|
630018
|
+
if (!this.crcAndFileSizeKnown) generalPurposeBitFlag |= UNKNOWN_CRC32_AND_FILE_SIZES;
|
|
630019
|
+
fixedSizeStuff.writeUInt32LE(67324752, 0);
|
|
630020
|
+
fixedSizeStuff.writeUInt16LE(VERSION_NEEDED_TO_EXTRACT_UTF8, 4);
|
|
630021
|
+
fixedSizeStuff.writeUInt16LE(generalPurposeBitFlag, 6);
|
|
630022
|
+
fixedSizeStuff.writeUInt16LE(this.getCompressionMethod(), 8);
|
|
630023
|
+
fixedSizeStuff.writeUInt16LE(this.lastModFileTime, 10);
|
|
630024
|
+
fixedSizeStuff.writeUInt16LE(this.lastModFileDate, 12);
|
|
630025
|
+
fixedSizeStuff.writeUInt32LE(crc323, 14);
|
|
630026
|
+
fixedSizeStuff.writeUInt32LE(compressedSize, 18);
|
|
630027
|
+
fixedSizeStuff.writeUInt32LE(uncompressedSize, 22);
|
|
630028
|
+
fixedSizeStuff.writeUInt16LE(this.utf8FileName.length, 26);
|
|
630029
|
+
fixedSizeStuff.writeUInt16LE(0, 28);
|
|
630030
|
+
return Buffer.concat([
|
|
630031
|
+
fixedSizeStuff,
|
|
630032
|
+
// file name (variable size)
|
|
630033
|
+
this.utf8FileName
|
|
630034
|
+
// extra field (variable size)
|
|
630035
|
+
// no extra fields
|
|
630036
|
+
]);
|
|
630037
|
+
};
|
|
630038
|
+
var DATA_DESCRIPTOR_SIZE = 16;
|
|
630039
|
+
var ZIP64_DATA_DESCRIPTOR_SIZE = 24;
|
|
630040
|
+
Entry.prototype.getDataDescriptor = function() {
|
|
630041
|
+
if (this.crcAndFileSizeKnown) {
|
|
630042
|
+
return EMPTY_BUFFER;
|
|
630043
|
+
}
|
|
630044
|
+
if (!this.useZip64Format()) {
|
|
630045
|
+
var buffer = bufferAlloc(DATA_DESCRIPTOR_SIZE);
|
|
630046
|
+
buffer.writeUInt32LE(134695760, 0);
|
|
630047
|
+
buffer.writeUInt32LE(this.crc32, 4);
|
|
630048
|
+
buffer.writeUInt32LE(this.compressedSize, 8);
|
|
630049
|
+
buffer.writeUInt32LE(this.uncompressedSize, 12);
|
|
630050
|
+
return buffer;
|
|
630051
|
+
} else {
|
|
630052
|
+
var buffer = bufferAlloc(ZIP64_DATA_DESCRIPTOR_SIZE);
|
|
630053
|
+
buffer.writeUInt32LE(134695760, 0);
|
|
630054
|
+
buffer.writeUInt32LE(this.crc32, 4);
|
|
630055
|
+
writeUInt64LE(buffer, this.compressedSize, 8);
|
|
630056
|
+
writeUInt64LE(buffer, this.uncompressedSize, 16);
|
|
630057
|
+
return buffer;
|
|
630058
|
+
}
|
|
630059
|
+
};
|
|
630060
|
+
var CENTRAL_DIRECTORY_RECORD_FIXED_SIZE = 46;
|
|
630061
|
+
var INFO_ZIP_UNIVERSAL_TIMESTAMP_EXTRA_FIELD_SIZE = 9;
|
|
630062
|
+
var ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE = 28;
|
|
630063
|
+
Entry.prototype.getCentralDirectoryRecord = function() {
|
|
630064
|
+
var fixedSizeStuff = bufferAlloc(CENTRAL_DIRECTORY_RECORD_FIXED_SIZE);
|
|
630065
|
+
var generalPurposeBitFlag = FILE_NAME_IS_UTF8;
|
|
630066
|
+
if (!this.crcAndFileSizeKnown) generalPurposeBitFlag |= UNKNOWN_CRC32_AND_FILE_SIZES;
|
|
630067
|
+
var izutefBuffer = EMPTY_BUFFER;
|
|
630068
|
+
if (!this.forceDosTimestamp) {
|
|
630069
|
+
izutefBuffer = bufferAlloc(INFO_ZIP_UNIVERSAL_TIMESTAMP_EXTRA_FIELD_SIZE);
|
|
630070
|
+
izutefBuffer.writeUInt16LE(21589, 0);
|
|
630071
|
+
izutefBuffer.writeUInt16LE(INFO_ZIP_UNIVERSAL_TIMESTAMP_EXTRA_FIELD_SIZE - 4, 2);
|
|
630072
|
+
var EB_UT_FL_MTIME = 1 << 0;
|
|
630073
|
+
var EB_UT_FL_ATIME = 1 << 1;
|
|
630074
|
+
izutefBuffer.writeUInt8(EB_UT_FL_MTIME | EB_UT_FL_ATIME, 4);
|
|
630075
|
+
var timestamp = Math.floor(this.mtime.getTime() / 1e3);
|
|
630076
|
+
if (timestamp < -2147483648) timestamp = -2147483648;
|
|
630077
|
+
if (timestamp > 2147483647) timestamp = 2147483647;
|
|
630078
|
+
izutefBuffer.writeUInt32LE(timestamp, 5);
|
|
630079
|
+
}
|
|
630080
|
+
var normalCompressedSize = this.compressedSize;
|
|
630081
|
+
var normalUncompressedSize = this.uncompressedSize;
|
|
630082
|
+
var normalRelativeOffsetOfLocalHeader = this.relativeOffsetOfLocalHeader;
|
|
630083
|
+
var versionNeededToExtract = VERSION_NEEDED_TO_EXTRACT_UTF8;
|
|
630084
|
+
var zeiefBuffer = EMPTY_BUFFER;
|
|
630085
|
+
if (this.useZip64Format()) {
|
|
630086
|
+
normalCompressedSize = 4294967295;
|
|
630087
|
+
normalUncompressedSize = 4294967295;
|
|
630088
|
+
normalRelativeOffsetOfLocalHeader = 4294967295;
|
|
630089
|
+
versionNeededToExtract = VERSION_NEEDED_TO_EXTRACT_ZIP64;
|
|
630090
|
+
zeiefBuffer = bufferAlloc(ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE);
|
|
630091
|
+
zeiefBuffer.writeUInt16LE(1, 0);
|
|
630092
|
+
zeiefBuffer.writeUInt16LE(ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE - 4, 2);
|
|
630093
|
+
writeUInt64LE(zeiefBuffer, this.uncompressedSize, 4);
|
|
630094
|
+
writeUInt64LE(zeiefBuffer, this.compressedSize, 12);
|
|
630095
|
+
writeUInt64LE(zeiefBuffer, this.relativeOffsetOfLocalHeader, 20);
|
|
630096
|
+
}
|
|
630097
|
+
fixedSizeStuff.writeUInt32LE(33639248, 0);
|
|
630098
|
+
fixedSizeStuff.writeUInt16LE(VERSION_MADE_BY, 4);
|
|
630099
|
+
fixedSizeStuff.writeUInt16LE(versionNeededToExtract, 6);
|
|
630100
|
+
fixedSizeStuff.writeUInt16LE(generalPurposeBitFlag, 8);
|
|
630101
|
+
fixedSizeStuff.writeUInt16LE(this.getCompressionMethod(), 10);
|
|
630102
|
+
fixedSizeStuff.writeUInt16LE(this.lastModFileTime, 12);
|
|
630103
|
+
fixedSizeStuff.writeUInt16LE(this.lastModFileDate, 14);
|
|
630104
|
+
fixedSizeStuff.writeUInt32LE(this.crc32, 16);
|
|
630105
|
+
fixedSizeStuff.writeUInt32LE(normalCompressedSize, 20);
|
|
630106
|
+
fixedSizeStuff.writeUInt32LE(normalUncompressedSize, 24);
|
|
630107
|
+
fixedSizeStuff.writeUInt16LE(this.utf8FileName.length, 28);
|
|
630108
|
+
fixedSizeStuff.writeUInt16LE(izutefBuffer.length + zeiefBuffer.length, 30);
|
|
630109
|
+
fixedSizeStuff.writeUInt16LE(this.fileComment.length, 32);
|
|
630110
|
+
fixedSizeStuff.writeUInt16LE(0, 34);
|
|
630111
|
+
fixedSizeStuff.writeUInt16LE(0, 36);
|
|
630112
|
+
fixedSizeStuff.writeUInt32LE(this.externalFileAttributes, 38);
|
|
630113
|
+
fixedSizeStuff.writeUInt32LE(normalRelativeOffsetOfLocalHeader, 42);
|
|
630114
|
+
return Buffer.concat([
|
|
630115
|
+
fixedSizeStuff,
|
|
630116
|
+
// file name (variable size)
|
|
630117
|
+
this.utf8FileName,
|
|
630118
|
+
// extra field (variable size)
|
|
630119
|
+
izutefBuffer,
|
|
630120
|
+
zeiefBuffer,
|
|
630121
|
+
// file comment (variable size)
|
|
630122
|
+
this.fileComment
|
|
630123
|
+
]);
|
|
630124
|
+
};
|
|
630125
|
+
Entry.prototype.getCompressionMethod = function() {
|
|
630126
|
+
var NO_COMPRESSION = 0;
|
|
630127
|
+
var DEFLATE_COMPRESSION = 8;
|
|
630128
|
+
return this.compressionLevel === 0 ? NO_COMPRESSION : DEFLATE_COMPRESSION;
|
|
630129
|
+
};
|
|
630130
|
+
var minDosDate = new Date(1980, 0, 1);
|
|
630131
|
+
var maxDosDate = new Date(2107, 11, 31, 23, 59, 58);
|
|
630132
|
+
function dateToDosDateTime(jsDate) {
|
|
630133
|
+
if (jsDate < minDosDate) jsDate = minDosDate;
|
|
630134
|
+
else if (jsDate > maxDosDate) jsDate = maxDosDate;
|
|
630135
|
+
var date26 = 0;
|
|
630136
|
+
date26 |= jsDate.getDate() & 31;
|
|
630137
|
+
date26 |= (jsDate.getMonth() + 1 & 15) << 5;
|
|
630138
|
+
date26 |= (jsDate.getFullYear() - 1980 & 127) << 9;
|
|
630139
|
+
var time3 = 0;
|
|
630140
|
+
time3 |= Math.floor(jsDate.getSeconds() / 2);
|
|
630141
|
+
time3 |= (jsDate.getMinutes() & 63) << 5;
|
|
630142
|
+
time3 |= (jsDate.getHours() & 31) << 11;
|
|
630143
|
+
return { date: date26, time: time3 };
|
|
630144
|
+
}
|
|
630145
|
+
function writeUInt64LE(buffer, n2, offset2) {
|
|
630146
|
+
var high = Math.floor(n2 / 4294967296);
|
|
630147
|
+
var low = n2 % 4294967296;
|
|
630148
|
+
buffer.writeUInt32LE(low, offset2);
|
|
630149
|
+
buffer.writeUInt32LE(high, offset2 + 4);
|
|
630150
|
+
}
|
|
630151
|
+
util5.inherits(ByteCounter, Transform);
|
|
630152
|
+
function ByteCounter(options2) {
|
|
630153
|
+
Transform.call(this, options2);
|
|
630154
|
+
this.byteCount = 0;
|
|
630155
|
+
}
|
|
630156
|
+
ByteCounter.prototype._transform = function(chunk2, encoding, cb) {
|
|
630157
|
+
this.byteCount += chunk2.length;
|
|
630158
|
+
cb(null, chunk2);
|
|
630159
|
+
};
|
|
630160
|
+
util5.inherits(Crc32Watcher, Transform);
|
|
630161
|
+
function Crc32Watcher(options2) {
|
|
630162
|
+
Transform.call(this, options2);
|
|
630163
|
+
this.crc32 = 0;
|
|
630164
|
+
}
|
|
630165
|
+
Crc32Watcher.prototype._transform = function(chunk2, encoding, cb) {
|
|
630166
|
+
this.crc32 = crc322.unsigned(chunk2, this.crc32);
|
|
630167
|
+
cb(null, chunk2);
|
|
630168
|
+
};
|
|
630169
|
+
var cp437 = "\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0";
|
|
630170
|
+
if (cp437.length !== 256) throw new Error("assertion failure");
|
|
630171
|
+
var reverseCp437 = null;
|
|
630172
|
+
function encodeCp437(string28) {
|
|
630173
|
+
if (/^[\x20-\x7e]*$/.test(string28)) {
|
|
630174
|
+
return bufferFrom(string28, "utf-8");
|
|
630175
|
+
}
|
|
630176
|
+
if (reverseCp437 == null) {
|
|
630177
|
+
reverseCp437 = {};
|
|
630178
|
+
for (var i5 = 0; i5 < cp437.length; i5++) {
|
|
630179
|
+
reverseCp437[cp437[i5]] = i5;
|
|
630180
|
+
}
|
|
630181
|
+
}
|
|
630182
|
+
var result = bufferAlloc(string28.length);
|
|
630183
|
+
for (var i5 = 0; i5 < string28.length; i5++) {
|
|
630184
|
+
var b5 = reverseCp437[string28[i5]];
|
|
630185
|
+
if (b5 == null) throw new Error("character not encodable in CP437: " + JSON.stringify(string28[i5]));
|
|
630186
|
+
result[i5] = b5;
|
|
630187
|
+
}
|
|
630188
|
+
return result;
|
|
630189
|
+
}
|
|
630190
|
+
function bufferAlloc(size2) {
|
|
630191
|
+
bufferAlloc = modern;
|
|
630192
|
+
try {
|
|
630193
|
+
return bufferAlloc(size2);
|
|
630194
|
+
} catch (e2) {
|
|
630195
|
+
bufferAlloc = legacy;
|
|
630196
|
+
return bufferAlloc(size2);
|
|
630197
|
+
}
|
|
630198
|
+
function modern(size3) {
|
|
630199
|
+
return Buffer.allocUnsafe(size3);
|
|
630200
|
+
}
|
|
630201
|
+
function legacy(size3) {
|
|
630202
|
+
return new Buffer(size3);
|
|
630203
|
+
}
|
|
630204
|
+
}
|
|
630205
|
+
function bufferFrom(something, encoding) {
|
|
630206
|
+
bufferFrom = modern;
|
|
630207
|
+
try {
|
|
630208
|
+
return bufferFrom(something, encoding);
|
|
630209
|
+
} catch (e2) {
|
|
630210
|
+
bufferFrom = legacy;
|
|
630211
|
+
return bufferFrom(something, encoding);
|
|
630212
|
+
}
|
|
630213
|
+
function modern(something2, encoding2) {
|
|
630214
|
+
return Buffer.from(something2, encoding2);
|
|
630215
|
+
}
|
|
630216
|
+
function legacy(something2, encoding2) {
|
|
630217
|
+
return new Buffer(something2, encoding2);
|
|
630218
|
+
}
|
|
630219
|
+
}
|
|
630220
|
+
function bufferIncludes(buffer, content5) {
|
|
630221
|
+
bufferIncludes = modern;
|
|
630222
|
+
try {
|
|
630223
|
+
return bufferIncludes(buffer, content5);
|
|
630224
|
+
} catch (e2) {
|
|
630225
|
+
bufferIncludes = legacy;
|
|
630226
|
+
return bufferIncludes(buffer, content5);
|
|
630227
|
+
}
|
|
630228
|
+
function modern(buffer2, content6) {
|
|
630229
|
+
return buffer2.includes(content6);
|
|
630230
|
+
}
|
|
630231
|
+
function legacy(buffer2, content6) {
|
|
630232
|
+
for (var i5 = 0; i5 <= buffer2.length - content6.length; i5++) {
|
|
630233
|
+
for (var j5 = 0; ; j5++) {
|
|
630234
|
+
if (j5 === content6.length) return true;
|
|
630235
|
+
if (buffer2[i5 + j5] !== content6[j5]) break;
|
|
630236
|
+
}
|
|
630237
|
+
}
|
|
630238
|
+
return false;
|
|
630239
|
+
}
|
|
630240
|
+
}
|
|
630241
|
+
}
|
|
630242
|
+
});
|
|
630243
|
+
|
|
629249
630244
|
// ../../../node_modules/.pnpm/@fern-fern+docs-config@0.0.80/node_modules/@fern-fern/docs-config/api/resources/docs/types/DocsConfiguration.js
|
|
629250
630245
|
var require_DocsConfiguration = __commonJS({
|
|
629251
630246
|
"../../../node_modules/.pnpm/@fern-fern+docs-config@0.0.80/node_modules/@fern-fern/docs-config/api/resources/docs/types/DocsConfiguration.js"(exports2) {
|
|
@@ -692034,7 +693029,7 @@ var AccessTokenPosthogManager = class {
|
|
|
692034
693029
|
properties: {
|
|
692035
693030
|
...event,
|
|
692036
693031
|
...event.properties,
|
|
692037
|
-
version: "5.
|
|
693032
|
+
version: "5.85.0",
|
|
692038
693033
|
usingAccessToken: true,
|
|
692039
693034
|
...getRunIdProperties()
|
|
692040
693035
|
}
|
|
@@ -692100,7 +693095,7 @@ var UserPosthogManager = class {
|
|
|
692100
693095
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
692101
693096
|
event: "CLI",
|
|
692102
693097
|
properties: {
|
|
692103
|
-
version: "5.
|
|
693098
|
+
version: "5.85.0",
|
|
692104
693099
|
...event,
|
|
692105
693100
|
...event.properties,
|
|
692106
693101
|
usingAccessToken: false,
|
|
@@ -850789,10 +851784,10 @@ var VFile = class {
|
|
|
850789
851784
|
* @returns {undefined}
|
|
850790
851785
|
* Nothing.
|
|
850791
851786
|
*/
|
|
850792
|
-
set basename(
|
|
850793
|
-
assertNonEmpty(
|
|
850794
|
-
assertPart(
|
|
850795
|
-
this.path = import_node_path21.default.join(this.dirname || "",
|
|
851787
|
+
set basename(basename8) {
|
|
851788
|
+
assertNonEmpty(basename8, "basename");
|
|
851789
|
+
assertPart(basename8, "basename");
|
|
851790
|
+
this.path = import_node_path21.default.join(this.dirname || "", basename8);
|
|
850796
851791
|
}
|
|
850797
851792
|
/**
|
|
850798
851793
|
* Get the parent path (example: `'~'`).
|
|
@@ -867735,7 +868730,7 @@ var MDX_NODE_TYPES = [
|
|
|
867735
868730
|
"mdxTextExpression",
|
|
867736
868731
|
"mdxjsEsm"
|
|
867737
868732
|
];
|
|
867738
|
-
function collectLinksAndSources({ readFile:
|
|
868733
|
+
function collectLinksAndSources({ readFile: readFile121 = (path120) => (0, import_node_fs17.readFileSync)(path120, "utf-8"), ...opts }) {
|
|
867739
868734
|
const visitedAbsoluteFilepaths = /* @__PURE__ */ new Set();
|
|
867740
868735
|
const contentQueue = [opts];
|
|
867741
868736
|
const links = [];
|
|
@@ -867784,7 +868779,7 @@ function collectLinksAndSources({ readFile: readFile120 = (path120) => (0, impor
|
|
|
867784
868779
|
const resolvedImportPath = resolve6(dirname6(absoluteFilepath), importPath);
|
|
867785
868780
|
if (resolvedImportPath.endsWith(".mdx") || resolvedImportPath.endsWith(".md")) {
|
|
867786
868781
|
contentQueue.push({
|
|
867787
|
-
content:
|
|
868782
|
+
content: readFile121(resolvedImportPath),
|
|
867788
868783
|
absoluteFilepath: resolvedImportPath
|
|
867789
868784
|
});
|
|
867790
868785
|
}
|
|
@@ -867827,7 +868822,7 @@ function collectLinksAndSources({ readFile: readFile120 = (path120) => (0, impor
|
|
|
867827
868822
|
if (absoluteFilepath && typeof src === "string") {
|
|
867828
868823
|
const resolvedImportPath = resolve6(dirname6(absoluteFilepath), src);
|
|
867829
868824
|
contentQueue.push({
|
|
867830
|
-
content:
|
|
868825
|
+
content: readFile121(resolvedImportPath),
|
|
867831
868826
|
absoluteFilepath: resolvedImportPath
|
|
867832
868827
|
});
|
|
867833
868828
|
}
|
|
@@ -871083,8 +872078,8 @@ function isMdxParseSymptom(violation, filesWithMdxParseErrors, mdxRawMessages) {
|
|
|
871083
872078
|
}
|
|
871084
872079
|
}
|
|
871085
872080
|
if (parts.length === 1) {
|
|
871086
|
-
const
|
|
871087
|
-
if (
|
|
872081
|
+
const basename8 = parts[0];
|
|
872082
|
+
if (basename8 != null && violation.message.includes(basename8)) {
|
|
871088
872083
|
return true;
|
|
871089
872084
|
}
|
|
871090
872085
|
}
|
|
@@ -872758,8 +873753,8 @@ var Migrator = class {
|
|
|
872758
873753
|
return { success: true, fernYml };
|
|
872759
873754
|
}
|
|
872760
873755
|
async findFernDirectory() {
|
|
872761
|
-
const
|
|
872762
|
-
if (
|
|
873756
|
+
const basename8 = this.cwd.split("/").pop();
|
|
873757
|
+
if (basename8 === FERN_DIRECTORY) {
|
|
872763
873758
|
return this.cwd;
|
|
872764
873759
|
}
|
|
872765
873760
|
const fernDir = join8(this.cwd, RelativeFilePath2.of(FERN_DIRECTORY));
|
|
@@ -872986,8 +873981,8 @@ function isMdxParseSymptom2(violation, filesWithMdxParseErrors, mdxRawMessages)
|
|
|
872986
873981
|
}
|
|
872987
873982
|
}
|
|
872988
873983
|
if (parts.length === 1) {
|
|
872989
|
-
const
|
|
872990
|
-
if (
|
|
873984
|
+
const basename8 = parts[0];
|
|
873985
|
+
if (basename8 != null && violation.message.includes(basename8)) {
|
|
872991
873986
|
return true;
|
|
872992
873987
|
}
|
|
872993
873988
|
}
|
|
@@ -873206,7 +874201,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
873206
874201
|
var LOGS_FOLDER_NAME = "logs";
|
|
873207
874202
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
873208
874203
|
function getCliSource() {
|
|
873209
|
-
const version7 = "5.
|
|
874204
|
+
const version7 = "5.85.0";
|
|
873210
874205
|
return `cli@${version7}`;
|
|
873211
874206
|
}
|
|
873212
874207
|
var DebugLogger = class {
|
|
@@ -883076,8 +884071,8 @@ var CdpPage = class _CdpPage extends Page {
|
|
|
883076
884071
|
return this.#buildMetricsObject(response.metrics);
|
|
883077
884072
|
}
|
|
883078
884073
|
async captureHeapSnapshot(options2) {
|
|
883079
|
-
const { createWriteStream:
|
|
883080
|
-
const stream5 =
|
|
884074
|
+
const { createWriteStream: createWriteStream9 } = environment.value.fs;
|
|
884075
|
+
const stream5 = createWriteStream9(options2.path);
|
|
883081
884076
|
const streamPromise = new Promise((resolve15, reject) => {
|
|
883082
884077
|
stream5.on("error", reject);
|
|
883083
884078
|
stream5.on("finish", resolve15);
|
|
@@ -903087,7 +904082,7 @@ var SourceUploader = class {
|
|
|
903087
904082
|
};
|
|
903088
904083
|
|
|
903089
904084
|
// ../generation/remote-generation/remote-workspace-runner/lib/runRemoteGenerationForGenerator.js
|
|
903090
|
-
async function runRemoteGenerationForGenerator({ projectConfig, organization, workspace, interactiveTaskContext, generatorInvocation, version: version7, audiences, shouldLogS3Url, token, whitelabel, replay, irVersionOverride, absolutePathToPreview, isPreview: isPreviewOverride, fiddlePreview, pushPreviewBranch, readme, fernignorePath, skipFernignore, dynamicIrOnly, retryRateLimited, requireEnvVars, automationMode, autoMerge, skipIfNoDiff, verify: verify2, noReplay, disableTelemetry, loginCommand, specsTarGzBuffer }) {
|
|
904085
|
+
async function runRemoteGenerationForGenerator({ projectConfig, organization, workspace, interactiveTaskContext, generatorInvocation, version: version7, audiences, shouldLogS3Url, token, whitelabel, replay, irVersionOverride, absolutePathToPreview, isPreview: isPreviewOverride, fiddlePreview, pushPreviewBranch, readme, fernignorePath, skipFernignore, dynamicIrOnly, retryRateLimited, requireEnvVars, automationMode, autoMerge, skipIfNoDiff, verify: verify2, noReplay, disableTelemetry, loginCommand, specsTarGzBuffer, generateFullProject }) {
|
|
903091
904086
|
const fdr = createFdrService({ token: token.value });
|
|
903092
904087
|
const fdrOrigin = "https://registry-dev2.buildwithfern.com";
|
|
903093
904088
|
const isAirGapped = await detectAirGappedMode(`${fdrOrigin}/health`, interactiveTaskContext.logger);
|
|
@@ -903276,6 +904271,7 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
|
|
|
903276
904271
|
userProvidedVersion: version7,
|
|
903277
904272
|
packageName,
|
|
903278
904273
|
selfHosted: ir3.selfHosted ?? false,
|
|
904274
|
+
generateFullProject,
|
|
903279
904275
|
context: interactiveTaskContext
|
|
903280
904276
|
})
|
|
903281
904277
|
},
|
|
@@ -903358,12 +904354,12 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
|
|
|
903358
904354
|
}
|
|
903359
904355
|
return result;
|
|
903360
904356
|
}
|
|
903361
|
-
function getPublishConfig({ generatorInvocation, version: version7, userProvidedVersion, packageName, selfHosted, context: context3 }) {
|
|
904357
|
+
function getPublishConfig({ generatorInvocation, version: version7, userProvidedVersion, packageName, selfHosted, generateFullProject, context: context3 }) {
|
|
903362
904358
|
const publishLanguage = generatorInvocation.language ?? (0, import_autoversion.extractLanguageFromGeneratorName)(generatorInvocation.name);
|
|
903363
904359
|
const substituteAutoVersion = (candidate) => candidate != null && (0, import_autoversion.isAutoVersion)(candidate) ? (0, import_autoversion.mapMagicVersionForLanguage)(import_autoversion.MAGIC_VERSION, publishLanguage) : candidate;
|
|
903364
904360
|
return generatorInvocation.outputMode._visit({
|
|
903365
904361
|
downloadFiles: () => api_exports.PublishingConfig.filesystem({
|
|
903366
|
-
generateFullProject: selfHosted,
|
|
904362
|
+
generateFullProject: selfHosted || (generateFullProject ?? false),
|
|
903367
904363
|
publishTarget: getFilesystemPublishTarget({
|
|
903368
904364
|
generatorInvocation,
|
|
903369
904365
|
version: substituteAutoVersion(version7),
|
|
@@ -903476,7 +904472,7 @@ function resolveVersionFallback(resolvedVersion) {
|
|
|
903476
904472
|
}
|
|
903477
904473
|
|
|
903478
904474
|
// ../generation/remote-generation/remote-workspace-runner/lib/runRemoteGenerationForAPIWorkspace.js
|
|
903479
|
-
async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization, workspace, context: context3, generatorGroup, version: version7, shouldLogS3Url, token, whitelabel, replay, absolutePathToPreview, isPreview, fiddlePreview, pushPreviewBranch, mode, fernignorePath, skipFernignore, dynamicIrOnly, validateWorkspace, retryRateLimited, requireEnvVars, automationMode, autoMerge, skipIfNoDiff, verify: verify2, noReplay, disableTelemetry, automation, occurrenceTracker, loginCommand, getSpecsTarGzBuffer }) {
|
|
904475
|
+
async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization, workspace, context: context3, generatorGroup, version: version7, shouldLogS3Url, token, whitelabel, replay, absolutePathToPreview, isPreview, fiddlePreview, pushPreviewBranch, mode, fernignorePath, skipFernignore, dynamicIrOnly, validateWorkspace, retryRateLimited, requireEnvVars, automationMode, autoMerge, skipIfNoDiff, verify: verify2, noReplay, disableTelemetry, automation, occurrenceTracker, loginCommand, getSpecsTarGzBuffer, generateFullProject }) {
|
|
903480
904476
|
if (generatorGroup.generators.length === 0) {
|
|
903481
904477
|
context3.logger.warn("No generators specified.");
|
|
903482
904478
|
return null;
|
|
@@ -903523,6 +904519,7 @@ async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization,
|
|
|
903523
904519
|
occurrenceTracker: effectiveOccurrenceTracker,
|
|
903524
904520
|
loginCommand,
|
|
903525
904521
|
getSpecsTarGzBuffer,
|
|
904522
|
+
generateFullProject,
|
|
903526
904523
|
onSnippetsProduced: (invocation) => snippetsProducedBy.push(invocation)
|
|
903527
904524
|
}))));
|
|
903528
904525
|
if (automation == null && results.some((didSucceed) => !didSucceed)) {
|
|
@@ -903532,7 +904529,7 @@ async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization,
|
|
|
903532
904529
|
snippetsProducedBy
|
|
903533
904530
|
};
|
|
903534
904531
|
}
|
|
903535
|
-
async function generateOne({ generatorInvocation, interactiveTaskContext, projectConfig, organization, workspace, context: context3, generatorGroup, version: version7, shouldLogS3Url, token, whitelabel, replay, absolutePathToPreview, isPreview, fiddlePreview, pushPreviewBranch, mode, fernignorePath, skipFernignore, dynamicIrOnly, validateWorkspace, retryRateLimited, requireEnvVars, automationMode, autoMerge, skipIfNoDiff, verify: verify2, noReplay, disableTelemetry, automation, generatorsYmlAbsolutePath, occurrenceTracker, loginCommand, getSpecsTarGzBuffer, onSnippetsProduced }) {
|
|
904532
|
+
async function generateOne({ generatorInvocation, interactiveTaskContext, projectConfig, organization, workspace, context: context3, generatorGroup, version: version7, shouldLogS3Url, token, whitelabel, replay, absolutePathToPreview, isPreview, fiddlePreview, pushPreviewBranch, mode, fernignorePath, skipFernignore, dynamicIrOnly, validateWorkspace, retryRateLimited, requireEnvVars, automationMode, autoMerge, skipIfNoDiff, verify: verify2, noReplay, disableTelemetry, automation, generatorsYmlAbsolutePath, occurrenceTracker, loginCommand, getSpecsTarGzBuffer, generateFullProject, onSnippetsProduced }) {
|
|
903536
904533
|
const startedAt = Date.now();
|
|
903537
904534
|
try {
|
|
903538
904535
|
const settings = getBaseOpenAPIWorkspaceSettingsFromGeneratorInvocation(generatorInvocation);
|
|
@@ -903599,7 +904596,8 @@ async function generateOne({ generatorInvocation, interactiveTaskContext, projec
|
|
|
903599
904596
|
noReplay,
|
|
903600
904597
|
disableTelemetry,
|
|
903601
904598
|
loginCommand,
|
|
903602
|
-
specsTarGzBuffer: await getSpecsTarGzBuffer?.(generatorInvocation.name)
|
|
904599
|
+
specsTarGzBuffer: await getSpecsTarGzBuffer?.(generatorInvocation.name),
|
|
904600
|
+
generateFullProject
|
|
903603
904601
|
});
|
|
903604
904602
|
if (remoteTaskHandlerResponse?.createdSnippets) {
|
|
903605
904603
|
onSnippetsProduced(generatorInvocation);
|
|
@@ -905902,7 +906900,7 @@ var LegacyDocsPublisher = class {
|
|
|
905902
906900
|
previewId,
|
|
905903
906901
|
disableTemplates: void 0,
|
|
905904
906902
|
skipUpload,
|
|
905905
|
-
cliVersion: "5.
|
|
906903
|
+
cliVersion: "5.85.0",
|
|
905906
906904
|
loginCommand: "fern auth login"
|
|
905907
906905
|
});
|
|
905908
906906
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -907683,9 +908681,9 @@ var Wizard = class {
|
|
|
907683
908681
|
const defaultFilename = specFormat === "openapi" ? "openapi.yml" : "asyncapi.yml";
|
|
907684
908682
|
try {
|
|
907685
908683
|
const pathname = new URL(url3).pathname;
|
|
907686
|
-
const
|
|
907687
|
-
if (
|
|
907688
|
-
return
|
|
908684
|
+
const basename8 = import_path82.default.basename(pathname);
|
|
908685
|
+
if (basename8.includes(".")) {
|
|
908686
|
+
return basename8;
|
|
907689
908687
|
}
|
|
907690
908688
|
return defaultFilename;
|
|
907691
908689
|
} catch {
|
|
@@ -960647,7 +961645,7 @@ function getGeneratorOutputSubfolder(generatorName) {
|
|
|
960647
961645
|
}
|
|
960648
961646
|
|
|
960649
961647
|
// ../generation/local-generation/local-workspace-runner/lib/runLocalGenerationForWorkspace.js
|
|
960650
|
-
async function runLocalGenerationForWorkspace({ token, projectConfig, workspace, generatorGroup, version: version7, keepDocker, inspect: inspect6, context: context3, absolutePathToPreview, runner, ai: ai2, replay, noReplay, validateWorkspace, requireEnvVars, skipFernignore, publishToRegistry, isPreview: isPreviewOverride, automationMode, autoMerge, skipIfNoDiff, generateTests, verify: verify2, disableTelemetry }) {
|
|
961648
|
+
async function runLocalGenerationForWorkspace({ token, projectConfig, workspace, generatorGroup, version: version7, keepDocker, inspect: inspect6, context: context3, absolutePathToPreview, runner, ai: ai2, replay, noReplay, validateWorkspace, requireEnvVars, skipFernignore, publishToRegistry, isPreview: isPreviewOverride, automationMode, autoMerge, skipIfNoDiff, generateTests, generateFullProject, verify: verify2, disableTelemetry }) {
|
|
960651
961649
|
const userProvidedVersion = version7;
|
|
960652
961650
|
if (userProvidedVersion != null) {
|
|
960653
961651
|
if (absolutePathToPreview != null) {
|
|
@@ -960767,7 +961765,8 @@ async function runLocalGenerationForWorkspace({ token, projectConfig, workspace,
|
|
|
960767
961765
|
userProvidedVersion,
|
|
960768
961766
|
packageName,
|
|
960769
961767
|
context: interactiveTaskContext,
|
|
960770
|
-
generateTests
|
|
961768
|
+
generateTests,
|
|
961769
|
+
generateFullProject
|
|
960771
961770
|
});
|
|
960772
961771
|
if (publishConfig != null) {
|
|
960773
961772
|
intermediateRepresentation.publishConfig = publishConfig;
|
|
@@ -960992,7 +961991,7 @@ async function getWorkspaceTempDir() {
|
|
|
960992
961991
|
prefix: "fern"
|
|
960993
961992
|
});
|
|
960994
961993
|
}
|
|
960995
|
-
function getPublishConfig2({ generatorInvocation, org, version: version7, userProvidedVersion, packageName, context: context3, generateTests }) {
|
|
961994
|
+
function getPublishConfig2({ generatorInvocation, org, version: version7, userProvidedVersion, packageName, context: context3, generateTests, generateFullProject }) {
|
|
960996
961995
|
const publishLanguage = generatorInvocation.language ?? (0, import_autoversion4.extractLanguageFromGeneratorName)(generatorInvocation.name);
|
|
960997
961996
|
const substituteAutoVersion = (candidate) => candidate != null && (0, import_autoversion4.isAutoVersion)(candidate) ? (0, import_autoversion4.mapMagicVersionForLanguage)(import_autoversion4.MAGIC_VERSION, publishLanguage) : candidate;
|
|
960998
961997
|
const effectiveVersion = substituteAutoVersion(version7);
|
|
@@ -961023,14 +962022,14 @@ function getPublishConfig2({ generatorInvocation, org, version: version7, userPr
|
|
|
961023
962022
|
context: context3
|
|
961024
962023
|
});
|
|
961025
962024
|
return api_exports.PublishingConfig.filesystem({
|
|
961026
|
-
generateFullProject: generateTests || org?.selfHostedSdKs || false,
|
|
962025
|
+
generateFullProject: generateTests || generateFullProject || org?.selfHostedSdKs || false,
|
|
961027
962026
|
publishTarget
|
|
961028
962027
|
});
|
|
961029
962028
|
}
|
|
961030
962029
|
return generatorInvocation.outputMode._visit({
|
|
961031
962030
|
downloadFiles: () => {
|
|
961032
962031
|
return api_exports.PublishingConfig.filesystem({
|
|
961033
|
-
generateFullProject: generateTests || org?.selfHostedSdKs || false,
|
|
962032
|
+
generateFullProject: generateTests || generateFullProject || org?.selfHostedSdKs || false,
|
|
961034
962033
|
publishTarget: void 0
|
|
961035
962034
|
});
|
|
961036
962035
|
},
|
|
@@ -972776,7 +973775,7 @@ function getAutomationContextFromEnv() {
|
|
|
972776
973775
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
972777
973776
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
972778
973777
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
972779
|
-
cli_version: "5.
|
|
973778
|
+
cli_version: "5.85.0"
|
|
972780
973779
|
};
|
|
972781
973780
|
}
|
|
972782
973781
|
function isAutomationMode() {
|
|
@@ -973608,7 +974607,7 @@ var CliContext = class _CliContext {
|
|
|
973608
974607
|
if (false) {
|
|
973609
974608
|
this.logger.error("CLI_VERSION is not defined");
|
|
973610
974609
|
}
|
|
973611
|
-
return "5.
|
|
974610
|
+
return "5.85.0";
|
|
973612
974611
|
}
|
|
973613
974612
|
getCliName() {
|
|
973614
974613
|
if (false) {
|
|
@@ -975396,6 +976395,276 @@ init_lib35();
|
|
|
975396
976395
|
init_lib6();
|
|
975397
976396
|
init_esm19();
|
|
975398
976397
|
|
|
976398
|
+
// src/commands/generate/packLocalOutput.ts
|
|
976399
|
+
init_lib4();
|
|
976400
|
+
init_lib8();
|
|
976401
|
+
init_lib33();
|
|
976402
|
+
var import_fs41 = require("fs");
|
|
976403
|
+
var import_promises168 = require("fs/promises");
|
|
976404
|
+
var import_path110 = require("path");
|
|
976405
|
+
var import_yazl = __toESM(require_yazl(), 1);
|
|
976406
|
+
var PACK_OUTPUT_DIRECTORY = "fern-dist";
|
|
976407
|
+
var PACK_DOCKER_IMAGES = {
|
|
976408
|
+
typescript: "node:22",
|
|
976409
|
+
python: "python:3.12",
|
|
976410
|
+
java: "gradle:8-jdk17",
|
|
976411
|
+
csharp: "mcr.microsoft.com/dotnet/sdk:9.0",
|
|
976412
|
+
ruby: "ruby:3.3",
|
|
976413
|
+
php: "composer:2",
|
|
976414
|
+
rust: "rust:1"
|
|
976415
|
+
};
|
|
976416
|
+
async function packLocalOutputForGroup({
|
|
976417
|
+
group,
|
|
976418
|
+
context: context3,
|
|
976419
|
+
mode = "host",
|
|
976420
|
+
runner
|
|
976421
|
+
}) {
|
|
976422
|
+
const failures = [];
|
|
976423
|
+
for (const generator of group.generators) {
|
|
976424
|
+
const outputPath = generator.absolutePathToLocalOutput;
|
|
976425
|
+
if (outputPath == null) {
|
|
976426
|
+
context3.logger.debug(
|
|
976427
|
+
`Skipping packaging for ${generator.name}: output is not written to the local file system.`
|
|
976428
|
+
);
|
|
976429
|
+
continue;
|
|
976430
|
+
}
|
|
976431
|
+
const language = generator.language;
|
|
976432
|
+
if (language == null) {
|
|
976433
|
+
context3.logger.warn(`Skipping packaging for ${generator.name}: could not determine language.`);
|
|
976434
|
+
continue;
|
|
976435
|
+
}
|
|
976436
|
+
try {
|
|
976437
|
+
await packOutputForLanguage({ language, outputPath, context: context3, mode, runner: runner ?? "docker" });
|
|
976438
|
+
} catch (error50) {
|
|
976439
|
+
const message = error50 instanceof Error ? error50.message : String(error50);
|
|
976440
|
+
context3.logger.error(`Failed to package ${generator.name} output at ${outputPath}: ${message}`);
|
|
976441
|
+
await removeDistDirIfEmpty(outputPath);
|
|
976442
|
+
failures.push(generator.name);
|
|
976443
|
+
}
|
|
976444
|
+
}
|
|
976445
|
+
if (failures.length > 0) {
|
|
976446
|
+
context3.failAndThrow(`Packaging failed for: ${failures.join(", ")}`);
|
|
976447
|
+
}
|
|
976448
|
+
}
|
|
976449
|
+
async function packOutputForLanguage({
|
|
976450
|
+
language,
|
|
976451
|
+
outputPath,
|
|
976452
|
+
context: context3,
|
|
976453
|
+
mode,
|
|
976454
|
+
runner
|
|
976455
|
+
}) {
|
|
976456
|
+
const distDir = join8(outputPath, RelativeFilePath2.of(PACK_OUTPUT_DIRECTORY));
|
|
976457
|
+
const run = async (commands) => {
|
|
976458
|
+
await runPackCommands({ commands, language, outputPath, context: context3, mode, runner });
|
|
976459
|
+
};
|
|
976460
|
+
switch (language) {
|
|
976461
|
+
case "typescript": {
|
|
976462
|
+
await (0, import_promises168.mkdir)(distDir, { recursive: true });
|
|
976463
|
+
const commands = [["npm", "install"]];
|
|
976464
|
+
if (await hasNpmScript({ outputPath, script: "build" })) {
|
|
976465
|
+
commands.push(["npm", "run", "build"]);
|
|
976466
|
+
}
|
|
976467
|
+
commands.push(["npm", "pack", "--pack-destination", PACK_OUTPUT_DIRECTORY]);
|
|
976468
|
+
await run(commands);
|
|
976469
|
+
logArtifacts({ distDir, context: context3 });
|
|
976470
|
+
return;
|
|
976471
|
+
}
|
|
976472
|
+
case "python": {
|
|
976473
|
+
await (0, import_promises168.mkdir)(distDir, { recursive: true });
|
|
976474
|
+
await run([["python3", "-m", "pip", "wheel", ".", "--no-deps", "--wheel-dir", PACK_OUTPUT_DIRECTORY]]);
|
|
976475
|
+
logArtifacts({ distDir, context: context3 });
|
|
976476
|
+
return;
|
|
976477
|
+
}
|
|
976478
|
+
case "java": {
|
|
976479
|
+
await (0, import_promises168.mkdir)(distDir, { recursive: true });
|
|
976480
|
+
await run([["gradle", "jar", "-x", "test"]]);
|
|
976481
|
+
const libsDir = join8(outputPath, RelativeFilePath2.of("build/libs"));
|
|
976482
|
+
await copyMatchingFiles({ fromDir: libsDir, toDir: distDir, extension: ".jar" });
|
|
976483
|
+
logArtifacts({ distDir, context: context3 });
|
|
976484
|
+
return;
|
|
976485
|
+
}
|
|
976486
|
+
case "csharp": {
|
|
976487
|
+
await (0, import_promises168.mkdir)(distDir, { recursive: true });
|
|
976488
|
+
const csproj = await findCsproj(outputPath);
|
|
976489
|
+
if (csproj == null) {
|
|
976490
|
+
throw new Error("No packable .csproj found in output directory.");
|
|
976491
|
+
}
|
|
976492
|
+
await run([["dotnet", "pack", csproj, "-c", "Release", "-o", PACK_OUTPUT_DIRECTORY]]);
|
|
976493
|
+
logArtifacts({ distDir, context: context3 });
|
|
976494
|
+
return;
|
|
976495
|
+
}
|
|
976496
|
+
case "ruby": {
|
|
976497
|
+
await (0, import_promises168.mkdir)(distDir, { recursive: true });
|
|
976498
|
+
const gemspec = (await (0, import_promises168.readdir)(outputPath)).find((file4) => file4.endsWith(".gemspec"));
|
|
976499
|
+
if (gemspec == null) {
|
|
976500
|
+
throw new Error("No .gemspec found in output directory.");
|
|
976501
|
+
}
|
|
976502
|
+
await run([["gem", "build", gemspec]]);
|
|
976503
|
+
await moveMatchingFiles({ fromDir: outputPath, toDir: distDir, extension: ".gem" });
|
|
976504
|
+
logArtifacts({ distDir, context: context3 });
|
|
976505
|
+
return;
|
|
976506
|
+
}
|
|
976507
|
+
case "php": {
|
|
976508
|
+
await (0, import_promises168.mkdir)(distDir, { recursive: true });
|
|
976509
|
+
await run([["composer", "archive", "--format=zip", `--dir=${PACK_OUTPUT_DIRECTORY}`]]);
|
|
976510
|
+
logArtifacts({ distDir, context: context3 });
|
|
976511
|
+
return;
|
|
976512
|
+
}
|
|
976513
|
+
case "rust": {
|
|
976514
|
+
await (0, import_promises168.mkdir)(distDir, { recursive: true });
|
|
976515
|
+
await run([["cargo", "package", "--allow-dirty", "--no-verify"]]);
|
|
976516
|
+
const packageDir = join8(outputPath, RelativeFilePath2.of("target/package"));
|
|
976517
|
+
await copyMatchingFiles({ fromDir: packageDir, toDir: distDir, extension: ".crate" });
|
|
976518
|
+
logArtifacts({ distDir, context: context3 });
|
|
976519
|
+
return;
|
|
976520
|
+
}
|
|
976521
|
+
case "go": {
|
|
976522
|
+
await (0, import_promises168.mkdir)(distDir, { recursive: true });
|
|
976523
|
+
const zipName = `${(0, import_path110.basename)(outputPath)}-source.zip`;
|
|
976524
|
+
await zipDirectory({
|
|
976525
|
+
sourceDir: outputPath,
|
|
976526
|
+
zipPath: join8(distDir, RelativeFilePath2.of(zipName))
|
|
976527
|
+
});
|
|
976528
|
+
logArtifacts({ distDir, context: context3 });
|
|
976529
|
+
return;
|
|
976530
|
+
}
|
|
976531
|
+
case "swift":
|
|
976532
|
+
context3.logger.warn(
|
|
976533
|
+
"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."
|
|
976534
|
+
);
|
|
976535
|
+
return;
|
|
976536
|
+
default:
|
|
976537
|
+
assertNever(language);
|
|
976538
|
+
}
|
|
976539
|
+
}
|
|
976540
|
+
async function runPackCommands({
|
|
976541
|
+
commands,
|
|
976542
|
+
language,
|
|
976543
|
+
outputPath,
|
|
976544
|
+
context: context3,
|
|
976545
|
+
mode,
|
|
976546
|
+
runner
|
|
976547
|
+
}) {
|
|
976548
|
+
for (const command3 of commands) {
|
|
976549
|
+
const [executable, ...args] = command3;
|
|
976550
|
+
if (executable == null) {
|
|
976551
|
+
continue;
|
|
976552
|
+
}
|
|
976553
|
+
if (mode === "host") {
|
|
976554
|
+
await loggingExeca(context3.logger, executable, args, {
|
|
976555
|
+
cwd: outputPath,
|
|
976556
|
+
env: { ...process.env, GIT_DIR: join8(outputPath, RelativeFilePath2.of(".git")) }
|
|
976557
|
+
});
|
|
976558
|
+
continue;
|
|
976559
|
+
}
|
|
976560
|
+
const image3 = PACK_DOCKER_IMAGES[language];
|
|
976561
|
+
if (image3 == null) {
|
|
976562
|
+
throw new Error(`No Docker toolchain image is configured for ${language}.`);
|
|
976563
|
+
}
|
|
976564
|
+
const containerArgs = ["run", "--rm", "-v", `${outputPath}:/workspace`, "-w", "/workspace", "-e", "HOME=/tmp"];
|
|
976565
|
+
if (process.getuid != null && process.getgid != null) {
|
|
976566
|
+
containerArgs.push("--user", `${process.getuid()}:${process.getgid()}`);
|
|
976567
|
+
}
|
|
976568
|
+
await loggingExeca(context3.logger, runner, [...containerArgs, image3, executable, ...args], {
|
|
976569
|
+
cwd: outputPath
|
|
976570
|
+
});
|
|
976571
|
+
}
|
|
976572
|
+
}
|
|
976573
|
+
async function zipDirectory({
|
|
976574
|
+
sourceDir,
|
|
976575
|
+
zipPath
|
|
976576
|
+
}) {
|
|
976577
|
+
const zip = new import_yazl.ZipFile();
|
|
976578
|
+
const addEntries = async (dir, prefix2) => {
|
|
976579
|
+
for (const entry of await (0, import_promises168.readdir)(dir, { withFileTypes: true })) {
|
|
976580
|
+
if (prefix2 === "" && (entry.name === PACK_OUTPUT_DIRECTORY || entry.name === ".git")) {
|
|
976581
|
+
continue;
|
|
976582
|
+
}
|
|
976583
|
+
const entryPath = join8(dir, RelativeFilePath2.of(entry.name));
|
|
976584
|
+
const entryName = prefix2 === "" ? entry.name : `${prefix2}/${entry.name}`;
|
|
976585
|
+
if (entry.isDirectory()) {
|
|
976586
|
+
await addEntries(entryPath, entryName);
|
|
976587
|
+
} else if (entry.isFile()) {
|
|
976588
|
+
zip.addFile(entryPath, entryName);
|
|
976589
|
+
}
|
|
976590
|
+
}
|
|
976591
|
+
};
|
|
976592
|
+
await addEntries(sourceDir, "");
|
|
976593
|
+
zip.end();
|
|
976594
|
+
await new Promise((resolve15, reject) => {
|
|
976595
|
+
zip.outputStream.on("error", reject);
|
|
976596
|
+
zip.outputStream.pipe((0, import_fs41.createWriteStream)(zipPath)).on("close", resolve15).on("error", reject);
|
|
976597
|
+
});
|
|
976598
|
+
}
|
|
976599
|
+
async function removeDistDirIfEmpty(outputPath) {
|
|
976600
|
+
const distDir = join8(outputPath, RelativeFilePath2.of(PACK_OUTPUT_DIRECTORY));
|
|
976601
|
+
try {
|
|
976602
|
+
if ((await (0, import_promises168.readdir)(distDir)).length === 0) {
|
|
976603
|
+
await (0, import_promises168.rmdir)(distDir);
|
|
976604
|
+
}
|
|
976605
|
+
} catch {
|
|
976606
|
+
}
|
|
976607
|
+
}
|
|
976608
|
+
async function hasNpmScript({
|
|
976609
|
+
outputPath,
|
|
976610
|
+
script
|
|
976611
|
+
}) {
|
|
976612
|
+
const packageJsonPath = join8(outputPath, RelativeFilePath2.of("package.json"));
|
|
976613
|
+
if (!await doesPathExist(packageJsonPath)) {
|
|
976614
|
+
return false;
|
|
976615
|
+
}
|
|
976616
|
+
const parsed = JSON.parse(await (0, import_promises168.readFile)(packageJsonPath, "utf-8"));
|
|
976617
|
+
if (typeof parsed !== "object" || parsed == null || !("scripts" in parsed)) {
|
|
976618
|
+
return false;
|
|
976619
|
+
}
|
|
976620
|
+
const scripts = parsed.scripts;
|
|
976621
|
+
return typeof scripts === "object" && scripts != null && script in scripts;
|
|
976622
|
+
}
|
|
976623
|
+
async function findCsproj(outputPath) {
|
|
976624
|
+
const srcDir = join8(outputPath, RelativeFilePath2.of("src"));
|
|
976625
|
+
if (!await doesPathExist(srcDir)) {
|
|
976626
|
+
return void 0;
|
|
976627
|
+
}
|
|
976628
|
+
for (const entry of await (0, import_promises168.readdir)(srcDir, { withFileTypes: true })) {
|
|
976629
|
+
if (!entry.isDirectory() || entry.name.endsWith(".Test") || entry.name.endsWith(".Tests")) {
|
|
976630
|
+
continue;
|
|
976631
|
+
}
|
|
976632
|
+
const relativeCsprojPath = `src/${entry.name}/${entry.name}.csproj`;
|
|
976633
|
+
if (await doesPathExist(join8(outputPath, RelativeFilePath2.of(relativeCsprojPath)))) {
|
|
976634
|
+
return relativeCsprojPath;
|
|
976635
|
+
}
|
|
976636
|
+
}
|
|
976637
|
+
return void 0;
|
|
976638
|
+
}
|
|
976639
|
+
async function copyMatchingFiles({
|
|
976640
|
+
fromDir,
|
|
976641
|
+
toDir,
|
|
976642
|
+
extension: extension4
|
|
976643
|
+
}) {
|
|
976644
|
+
if (!await doesPathExist(fromDir)) {
|
|
976645
|
+
throw new Error(`Expected build output directory ${fromDir} does not exist.`);
|
|
976646
|
+
}
|
|
976647
|
+
for (const file4 of await (0, import_promises168.readdir)(fromDir)) {
|
|
976648
|
+
if (file4.endsWith(extension4)) {
|
|
976649
|
+
await (0, import_promises168.copyFile)(join8(fromDir, RelativeFilePath2.of(file4)), join8(toDir, RelativeFilePath2.of(file4)));
|
|
976650
|
+
}
|
|
976651
|
+
}
|
|
976652
|
+
}
|
|
976653
|
+
async function moveMatchingFiles({
|
|
976654
|
+
fromDir,
|
|
976655
|
+
toDir,
|
|
976656
|
+
extension: extension4
|
|
976657
|
+
}) {
|
|
976658
|
+
for (const file4 of await (0, import_promises168.readdir)(fromDir)) {
|
|
976659
|
+
if (file4.endsWith(extension4)) {
|
|
976660
|
+
await (0, import_promises168.rename)(join8(fromDir, RelativeFilePath2.of(file4)), join8(toDir, RelativeFilePath2.of(file4)));
|
|
976661
|
+
}
|
|
976662
|
+
}
|
|
976663
|
+
}
|
|
976664
|
+
function logArtifacts({ distDir, context: context3 }) {
|
|
976665
|
+
context3.logger.info(`Packaged artifacts written to ${distDir}`);
|
|
976666
|
+
}
|
|
976667
|
+
|
|
975399
976668
|
// src/commands/generate/describeSkipReason.ts
|
|
975400
976669
|
function classifySkipReason(generator, rootAutorelease) {
|
|
975401
976670
|
if (!generator.automation.generate) {
|
|
@@ -975510,7 +976779,9 @@ async function generateWorkspace({
|
|
|
975510
976779
|
autoMerge,
|
|
975511
976780
|
skipIfNoDiff,
|
|
975512
976781
|
generateTests,
|
|
975513
|
-
automation
|
|
976782
|
+
automation,
|
|
976783
|
+
pack,
|
|
976784
|
+
packMode
|
|
975514
976785
|
}) {
|
|
975515
976786
|
if (workspace.generatorsConfiguration == null) {
|
|
975516
976787
|
context3.logger.warn("This workspaces has no generators.yml");
|
|
@@ -975573,6 +976844,7 @@ async function generateWorkspace({
|
|
|
975573
976844
|
autoMerge,
|
|
975574
976845
|
skipIfNoDiff,
|
|
975575
976846
|
generateTests,
|
|
976847
|
+
generateFullProject: pack,
|
|
975576
976848
|
verify: verify2,
|
|
975577
976849
|
disableTelemetry: isTelemetryDisabled()
|
|
975578
976850
|
});
|
|
@@ -975620,9 +976892,13 @@ async function generateWorkspace({
|
|
|
975620
976892
|
noReplay,
|
|
975621
976893
|
verify: verify2,
|
|
975622
976894
|
disableTelemetry: isTelemetryDisabled(),
|
|
975623
|
-
getSpecsTarGzBuffer: getSpecsTarGz
|
|
976895
|
+
getSpecsTarGzBuffer: getSpecsTarGz,
|
|
976896
|
+
generateFullProject: pack
|
|
975624
976897
|
});
|
|
975625
976898
|
}
|
|
976899
|
+
if (pack) {
|
|
976900
|
+
await packLocalOutputForGroup({ group, context: groupContext, mode: packMode, runner });
|
|
976901
|
+
}
|
|
975626
976902
|
})
|
|
975627
976903
|
)
|
|
975628
976904
|
);
|
|
@@ -975998,7 +977274,9 @@ async function generateAPIWorkspaces({
|
|
|
975998
977274
|
autoMerge,
|
|
975999
977275
|
skipIfNoDiff,
|
|
976000
977276
|
generateTests,
|
|
976001
|
-
automation
|
|
977277
|
+
automation,
|
|
977278
|
+
pack,
|
|
977279
|
+
packMode
|
|
976002
977280
|
}) {
|
|
976003
977281
|
let token = void 0;
|
|
976004
977282
|
if (!useLocalDocker) {
|
|
@@ -976077,7 +977355,9 @@ async function generateAPIWorkspaces({
|
|
|
976077
977355
|
autoMerge,
|
|
976078
977356
|
skipIfNoDiff,
|
|
976079
977357
|
generateTests,
|
|
976080
|
-
automation
|
|
977358
|
+
automation,
|
|
977359
|
+
pack,
|
|
977360
|
+
packMode
|
|
976081
977361
|
});
|
|
976082
977362
|
});
|
|
976083
977363
|
})
|
|
@@ -976343,8 +977623,8 @@ function renderOverflowWarning(failureCount) {
|
|
|
976343
977623
|
|
|
976344
977624
|
// src/commands/automations/generate/reportGenerateResults.ts
|
|
976345
977625
|
init_lib4();
|
|
976346
|
-
var
|
|
976347
|
-
var
|
|
977626
|
+
var import_fs42 = require("fs");
|
|
977627
|
+
var import_promises169 = require("fs/promises");
|
|
976348
977628
|
var JSON_SCHEMA_VERSION = 1;
|
|
976349
977629
|
function renderStdoutSummary(results) {
|
|
976350
977630
|
return formatCounts(countResults(results));
|
|
@@ -976534,12 +977814,12 @@ async function writeResults({
|
|
|
976534
977814
|
const stepSummaryPath = getGithubStepSummaryPath();
|
|
976535
977815
|
if (stepSummaryPath != null) {
|
|
976536
977816
|
try {
|
|
976537
|
-
await (0,
|
|
977817
|
+
await (0, import_promises169.appendFile)(stepSummaryPath, renderMarkdownSummary(results), "utf8");
|
|
976538
977818
|
} catch {
|
|
976539
977819
|
}
|
|
976540
977820
|
}
|
|
976541
977821
|
if (jsonOutputPath != null) {
|
|
976542
|
-
await (0,
|
|
977822
|
+
await (0, import_promises169.writeFile)(jsonOutputPath, JSON.stringify(renderJsonSummary(results), null, 2), "utf8");
|
|
976543
977823
|
}
|
|
976544
977824
|
}
|
|
976545
977825
|
function writeResultsSync({
|
|
@@ -976549,13 +977829,13 @@ function writeResultsSync({
|
|
|
976549
977829
|
const stepSummaryPath = getGithubStepSummaryPath();
|
|
976550
977830
|
if (stepSummaryPath != null) {
|
|
976551
977831
|
try {
|
|
976552
|
-
(0,
|
|
977832
|
+
(0, import_fs42.appendFileSync)(stepSummaryPath, renderMarkdownSummary(results), "utf8");
|
|
976553
977833
|
} catch {
|
|
976554
977834
|
}
|
|
976555
977835
|
}
|
|
976556
977836
|
if (jsonOutputPath != null) {
|
|
976557
977837
|
try {
|
|
976558
|
-
(0,
|
|
977838
|
+
(0, import_fs42.writeFileSync)(jsonOutputPath, JSON.stringify(renderJsonSummary(results), null, 2), "utf8");
|
|
976559
977839
|
} catch {
|
|
976560
977840
|
}
|
|
976561
977841
|
}
|
|
@@ -976866,7 +978146,7 @@ function listPreviewGroups({
|
|
|
976866
978146
|
init_lib19();
|
|
976867
978147
|
init_lib6();
|
|
976868
978148
|
init_source();
|
|
976869
|
-
var
|
|
978149
|
+
var import_promises199 = require("fs/promises");
|
|
976870
978150
|
|
|
976871
978151
|
// ../cli-migrations/lib/runMigrations.js
|
|
976872
978152
|
init_lib4();
|
|
@@ -976877,7 +978157,7 @@ init_source();
|
|
|
976877
978157
|
init_lib27();
|
|
976878
978158
|
|
|
976879
978159
|
// ../cli-migrations/lib/migrations/0.0.191/discriminant/migration.js
|
|
976880
|
-
var
|
|
978160
|
+
var import_promises170 = require("fs/promises");
|
|
976881
978161
|
|
|
976882
978162
|
// ../cli-migrations/lib/migrations/0.0.191/discriminant/getAllYamlFiles.js
|
|
976883
978163
|
init_lib8();
|
|
@@ -976914,7 +978194,7 @@ var migration = {
|
|
|
976914
978194
|
try {
|
|
976915
978195
|
const fileContents = await getFileContents(yamlFilepath);
|
|
976916
978196
|
const newContents = addDiscriminantToFile(fileContents);
|
|
976917
|
-
await (0,
|
|
978197
|
+
await (0, import_promises170.writeFile)(yamlFilepath, newContents);
|
|
976918
978198
|
} catch (error50) {
|
|
976919
978199
|
context3.failAndThrow("Failed to migrate " + yamlFilepath, error50);
|
|
976920
978200
|
}
|
|
@@ -976922,7 +978202,7 @@ var migration = {
|
|
|
976922
978202
|
}
|
|
976923
978203
|
};
|
|
976924
978204
|
async function getFileContents(filepath) {
|
|
976925
|
-
const buffer = await (0,
|
|
978205
|
+
const buffer = await (0, import_promises170.readFile)(filepath);
|
|
976926
978206
|
return buffer.toString();
|
|
976927
978207
|
}
|
|
976928
978208
|
var UNION_REGEX = /^(\s{2,})union:\s*$/gm;
|
|
@@ -976951,7 +978231,7 @@ var versionMigrations = {
|
|
|
976951
978231
|
var __default = versionMigrations;
|
|
976952
978232
|
|
|
976953
978233
|
// ../cli-migrations/lib/migrations/0.0.203/union-single-property-key/migration.js
|
|
976954
|
-
var
|
|
978234
|
+
var import_promises171 = require("fs/promises");
|
|
976955
978235
|
var import_yaml7 = __toESM(require_dist11(), 1);
|
|
976956
978236
|
|
|
976957
978237
|
// ../cli-migrations/lib/migrations/0.0.203/union-single-property-key/getAllYamlFiles.js
|
|
@@ -976995,7 +978275,7 @@ var migration2 = {
|
|
|
976995
978275
|
}
|
|
976996
978276
|
};
|
|
976997
978277
|
async function migrateFile(filepath, context3) {
|
|
976998
|
-
const contents = await (0,
|
|
978278
|
+
const contents = await (0, import_promises171.readFile)(filepath);
|
|
976999
978279
|
const parsedDocument = import_yaml7.default.parseDocument(contents.toString());
|
|
977000
978280
|
const types4 = parsedDocument.get("types");
|
|
977001
978281
|
if (types4 == null) {
|
|
@@ -977027,7 +978307,7 @@ async function migrateFile(filepath, context3) {
|
|
|
977027
978307
|
}
|
|
977028
978308
|
}
|
|
977029
978309
|
}
|
|
977030
|
-
await (0,
|
|
978310
|
+
await (0, import_promises171.writeFile)(filepath, parsedDocument.toString());
|
|
977031
978311
|
}
|
|
977032
978312
|
|
|
977033
978313
|
// ../cli-migrations/lib/migrations/0.0.203/index.js
|
|
@@ -977038,7 +978318,7 @@ var versionMigrations2 = {
|
|
|
977038
978318
|
var __default2 = versionMigrations2;
|
|
977039
978319
|
|
|
977040
978320
|
// ../cli-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/migration.js
|
|
977041
|
-
var
|
|
978321
|
+
var import_promises172 = require("fs/promises");
|
|
977042
978322
|
var import_yaml8 = __toESM(require_dist11(), 1);
|
|
977043
978323
|
|
|
977044
978324
|
// ../cli-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/getAllGeneratorYamlFiles.js
|
|
@@ -977082,7 +978362,7 @@ var migration3 = {
|
|
|
977082
978362
|
}
|
|
977083
978363
|
};
|
|
977084
978364
|
async function migrateGeneratorsYml(filepath, context3) {
|
|
977085
|
-
const contents = await (0,
|
|
978365
|
+
const contents = await (0, import_promises172.readFile)(filepath);
|
|
977086
978366
|
const parsedDocument = import_yaml8.default.parseDocument(contents.toString());
|
|
977087
978367
|
const draftGenerators = parsedDocument.get("draft");
|
|
977088
978368
|
if (draftGenerators == null) {
|
|
@@ -977109,7 +978389,7 @@ async function migrateGeneratorsYml(filepath, context3) {
|
|
|
977109
978389
|
draftGenerator.set("output-path", name2.value.includes("openapi") ? "./generated-openapi" : name2.value.includes("postman") ? "./generated-postman" : localOutput);
|
|
977110
978390
|
}
|
|
977111
978391
|
});
|
|
977112
|
-
await (0,
|
|
978392
|
+
await (0, import_promises172.writeFile)(filepath, parsedDocument.toString());
|
|
977113
978393
|
}
|
|
977114
978394
|
|
|
977115
978395
|
// ../cli-migrations/lib/migrations/0.0.207/index.js
|
|
@@ -977120,7 +978400,7 @@ var versionMigrations3 = {
|
|
|
977120
978400
|
var __default3 = versionMigrations3;
|
|
977121
978401
|
|
|
977122
978402
|
// ../cli-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/migration.js
|
|
977123
|
-
var
|
|
978403
|
+
var import_promises173 = require("fs/promises");
|
|
977124
978404
|
var import_yaml9 = __toESM(require_dist11(), 1);
|
|
977125
978405
|
|
|
977126
978406
|
// ../cli-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/getAllYamlFiles.js
|
|
@@ -977164,7 +978444,7 @@ var migration4 = {
|
|
|
977164
978444
|
}
|
|
977165
978445
|
};
|
|
977166
978446
|
async function migrateFile2(filepath, context3) {
|
|
977167
|
-
const contents = await (0,
|
|
978447
|
+
const contents = await (0, import_promises173.readFile)(filepath);
|
|
977168
978448
|
const parsedDocument = import_yaml9.default.parseDocument(contents.toString());
|
|
977169
978449
|
const addType = (typeName, typeDeclaration2) => {
|
|
977170
978450
|
const types4 = parsedDocument.get("types");
|
|
@@ -977208,7 +978488,7 @@ async function migrateFile2(filepath, context3) {
|
|
|
977208
978488
|
}
|
|
977209
978489
|
}
|
|
977210
978490
|
}
|
|
977211
|
-
await (0,
|
|
978491
|
+
await (0, import_promises173.writeFile)(filepath, parsedDocument.toString());
|
|
977212
978492
|
}
|
|
977213
978493
|
|
|
977214
978494
|
// ../cli-migrations/lib/migrations/0.0.210/index.js
|
|
@@ -977219,7 +978499,7 @@ var versionMigrations4 = {
|
|
|
977219
978499
|
var __default4 = versionMigrations4;
|
|
977220
978500
|
|
|
977221
978501
|
// ../cli-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/migration.js
|
|
977222
|
-
var
|
|
978502
|
+
var import_promises174 = require("fs/promises");
|
|
977223
978503
|
var import_yaml10 = __toESM(require_dist11(), 1);
|
|
977224
978504
|
|
|
977225
978505
|
// ../cli-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/getAllGeneratorYamlFiles.js
|
|
@@ -977263,7 +978543,7 @@ var migration5 = {
|
|
|
977263
978543
|
}
|
|
977264
978544
|
};
|
|
977265
978545
|
async function migrateGeneratorsYml2(filepath, context3) {
|
|
977266
|
-
const contents = await (0,
|
|
978546
|
+
const contents = await (0, import_promises174.readFile)(filepath);
|
|
977267
978547
|
const parsedDocument = import_yaml10.default.parseDocument(contents.toString());
|
|
977268
978548
|
const releaseGenerators = parsedDocument.get("release");
|
|
977269
978549
|
if (releaseGenerators == null) {
|
|
@@ -977301,7 +978581,7 @@ async function migrateGeneratorsYml2(filepath, context3) {
|
|
|
977301
978581
|
}
|
|
977302
978582
|
releaseGenerator.delete("outputs");
|
|
977303
978583
|
});
|
|
977304
|
-
await (0,
|
|
978584
|
+
await (0, import_promises174.writeFile)(filepath, parsedDocument.toString());
|
|
977305
978585
|
}
|
|
977306
978586
|
|
|
977307
978587
|
// ../cli-migrations/lib/migrations/0.0.212/index.js
|
|
@@ -977312,7 +978592,7 @@ var versionMigrations5 = {
|
|
|
977312
978592
|
var __default5 = versionMigrations5;
|
|
977313
978593
|
|
|
977314
978594
|
// ../cli-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/migration.js
|
|
977315
|
-
var
|
|
978595
|
+
var import_promises175 = require("fs/promises");
|
|
977316
978596
|
|
|
977317
978597
|
// ../cli-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/getAllYamlFiles.js
|
|
977318
978598
|
init_lib8();
|
|
@@ -977346,9 +978626,9 @@ var migration6 = {
|
|
|
977346
978626
|
run: async ({ context: context3 }) => {
|
|
977347
978627
|
const yamlFiles = await getAllYamlFiles4(context3);
|
|
977348
978628
|
for (const filepath of yamlFiles) {
|
|
977349
|
-
const contents = await (0,
|
|
978629
|
+
const contents = await (0, import_promises175.readFile)(filepath);
|
|
977350
978630
|
const newContents = contents.toString().replaceAll(" alias:", " type:");
|
|
977351
|
-
await (0,
|
|
978631
|
+
await (0, import_promises175.writeFile)(filepath, newContents);
|
|
977352
978632
|
}
|
|
977353
978633
|
}
|
|
977354
978634
|
};
|
|
@@ -977361,7 +978641,7 @@ var versionMigrations6 = {
|
|
|
977361
978641
|
var __default6 = versionMigrations6;
|
|
977362
978642
|
|
|
977363
978643
|
// ../cli-migrations/lib/migrations/0.0.221/add-error-discriminant/migration.js
|
|
977364
|
-
var
|
|
978644
|
+
var import_promises176 = require("fs/promises");
|
|
977365
978645
|
|
|
977366
978646
|
// ../cli-migrations/lib/migrations/0.0.221/add-error-discriminant/getAllRootApiYamlFiles.js
|
|
977367
978647
|
init_lib8();
|
|
@@ -977395,9 +978675,9 @@ var migration7 = {
|
|
|
977395
978675
|
run: async ({ context: context3 }) => {
|
|
977396
978676
|
const yamlFiles = await getAllRootApiYamlFiles(context3);
|
|
977397
978677
|
for (const filepath of yamlFiles) {
|
|
977398
|
-
const contents = await (0,
|
|
978678
|
+
const contents = await (0, import_promises176.readFile)(filepath);
|
|
977399
978679
|
const newContents = contents.toString() + "\nerror-discriminant: error";
|
|
977400
|
-
await (0,
|
|
978680
|
+
await (0, import_promises176.writeFile)(filepath, newContents);
|
|
977401
978681
|
}
|
|
977402
978682
|
}
|
|
977403
978683
|
};
|
|
@@ -977411,7 +978691,7 @@ var __default7 = versionMigrations7;
|
|
|
977411
978691
|
|
|
977412
978692
|
// ../cli-migrations/lib/migrations/0.0.241/add-generator-groups/migration.js
|
|
977413
978693
|
init_lib4();
|
|
977414
|
-
var
|
|
978694
|
+
var import_promises177 = require("fs/promises");
|
|
977415
978695
|
init_js_yaml();
|
|
977416
978696
|
|
|
977417
978697
|
// ../cli-migrations/lib/migrations/0.0.241/add-generator-groups/getAllGeneratorYamlFiles.js
|
|
@@ -977545,7 +978825,7 @@ var migration8 = {
|
|
|
977545
978825
|
}
|
|
977546
978826
|
};
|
|
977547
978827
|
async function migrateGeneratorsYml3(filepath) {
|
|
977548
|
-
const contentsStr = await (0,
|
|
978828
|
+
const contentsStr = await (0, import_promises177.readFile)(filepath);
|
|
977549
978829
|
const contents = index_vite_proxy_tmp_default.load(contentsStr.toString());
|
|
977550
978830
|
const oldGeneratorsConfiguration = GeneratorsConfigurationSchema2.parse(contents);
|
|
977551
978831
|
let newGeneratorsConfiguration = {};
|
|
@@ -977563,7 +978843,7 @@ async function migrateGeneratorsYml3(filepath) {
|
|
|
977563
978843
|
generators: oldGeneratorsConfiguration.release.map((releaseGeneratorInvocation) => convertReleaseGeneratorInvocation(releaseGeneratorInvocation))
|
|
977564
978844
|
};
|
|
977565
978845
|
}
|
|
977566
|
-
await (0,
|
|
978846
|
+
await (0, import_promises177.writeFile)(filepath, index_vite_proxy_tmp_default.dump(newGeneratorsConfiguration));
|
|
977567
978847
|
}
|
|
977568
978848
|
function convertDraftGeneratorInvocation(draftGeneratorInvocation) {
|
|
977569
978849
|
const newSchema = {
|
|
@@ -977638,7 +978918,7 @@ var versionMigrations8 = {
|
|
|
977638
978918
|
var __default8 = versionMigrations8;
|
|
977639
978919
|
|
|
977640
978920
|
// ../cli-migrations/lib/migrations/0.0.248/add-error-discrimination-config/migration.js
|
|
977641
|
-
var
|
|
978921
|
+
var import_promises178 = require("fs/promises");
|
|
977642
978922
|
var import_yaml11 = __toESM(require_dist11(), 1);
|
|
977643
978923
|
|
|
977644
978924
|
// ../cli-migrations/lib/migrations/0.0.248/add-error-discrimination-config/getAllRootApiYamlFiles.js
|
|
@@ -977682,7 +978962,7 @@ var migration9 = {
|
|
|
977682
978962
|
}
|
|
977683
978963
|
};
|
|
977684
978964
|
async function migrateRootApiFile(filepath) {
|
|
977685
|
-
const contents = await (0,
|
|
978965
|
+
const contents = await (0, import_promises178.readFile)(filepath);
|
|
977686
978966
|
const parsedDocument = import_yaml11.default.parseDocument(contents.toString());
|
|
977687
978967
|
const errorDiscriminant = parsedDocument.get("error-discriminant", true);
|
|
977688
978968
|
if (errorDiscriminant == null || !import_yaml11.default.isScalar(errorDiscriminant) || typeof errorDiscriminant.value !== "string") {
|
|
@@ -977693,7 +978973,7 @@ async function migrateRootApiFile(filepath) {
|
|
|
977693
978973
|
"property-name": errorDiscriminant.value
|
|
977694
978974
|
});
|
|
977695
978975
|
parsedDocument.delete("error-discriminant");
|
|
977696
|
-
await (0,
|
|
978976
|
+
await (0, import_promises178.writeFile)(filepath, parsedDocument.toString());
|
|
977697
978977
|
}
|
|
977698
978978
|
|
|
977699
978979
|
// ../cli-migrations/lib/migrations/0.0.248/index.js
|
|
@@ -977704,7 +978984,7 @@ var versionMigrations9 = {
|
|
|
977704
978984
|
var __default9 = versionMigrations9;
|
|
977705
978985
|
|
|
977706
978986
|
// ../cli-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/migration.js
|
|
977707
|
-
var
|
|
978987
|
+
var import_promises179 = require("fs/promises");
|
|
977708
978988
|
var import_yaml12 = __toESM(require_dist11(), 1);
|
|
977709
978989
|
|
|
977710
978990
|
// ../cli-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/getAllYamlFiles.js
|
|
@@ -977748,7 +979028,7 @@ var migration10 = {
|
|
|
977748
979028
|
}
|
|
977749
979029
|
};
|
|
977750
979030
|
async function migrateYamlFile(filepath, context3) {
|
|
977751
|
-
const contents = await (0,
|
|
979031
|
+
const contents = await (0, import_promises179.readFile)(filepath);
|
|
977752
979032
|
const parsedDocument = import_yaml12.default.parseDocument(contents.toString());
|
|
977753
979033
|
const services = parsedDocument.get("services");
|
|
977754
979034
|
if (services == null) {
|
|
@@ -977788,7 +979068,7 @@ async function migrateYamlFile(filepath, context3) {
|
|
|
977788
979068
|
context3.failWithoutThrowing("Failed to convert endpoint", e2);
|
|
977789
979069
|
}
|
|
977790
979070
|
}
|
|
977791
|
-
await (0,
|
|
979071
|
+
await (0, import_promises179.writeFile)(filepath, parsedDocument.toString());
|
|
977792
979072
|
}
|
|
977793
979073
|
}
|
|
977794
979074
|
function convertEndpoint4({ document: document4, endpoint: endpoint3 }) {
|
|
@@ -977867,7 +979147,7 @@ var versionMigrations10 = {
|
|
|
977867
979147
|
var __default10 = versionMigrations10;
|
|
977868
979148
|
|
|
977869
979149
|
// ../cli-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/migration.js
|
|
977870
|
-
var
|
|
979150
|
+
var import_promises180 = require("fs/promises");
|
|
977871
979151
|
var import_yaml13 = __toESM(require_dist11(), 1);
|
|
977872
979152
|
|
|
977873
979153
|
// ../cli-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/getAllYamlFiles.js
|
|
@@ -977911,7 +979191,7 @@ var migration11 = {
|
|
|
977911
979191
|
}
|
|
977912
979192
|
};
|
|
977913
979193
|
async function migrateYamlFile2(filepath, context3) {
|
|
977914
|
-
const contents = await (0,
|
|
979194
|
+
const contents = await (0, import_promises180.readFile)(filepath);
|
|
977915
979195
|
const parsedDocument = import_yaml13.default.parseDocument(contents.toString());
|
|
977916
979196
|
const types4 = parsedDocument.get("types");
|
|
977917
979197
|
if (types4 == null) {
|
|
@@ -977937,7 +979217,7 @@ async function migrateYamlFile2(filepath, context3) {
|
|
|
977937
979217
|
examples.set(i5, { value: value2 });
|
|
977938
979218
|
}
|
|
977939
979219
|
}
|
|
977940
|
-
await (0,
|
|
979220
|
+
await (0, import_promises180.writeFile)(filepath, parsedDocument.toString());
|
|
977941
979221
|
}
|
|
977942
979222
|
|
|
977943
979223
|
// ../cli-migrations/lib/migrations/0.3.0-rc12/index.js
|
|
@@ -977948,7 +979228,7 @@ var versionMigrations11 = {
|
|
|
977948
979228
|
var __default11 = versionMigrations11;
|
|
977949
979229
|
|
|
977950
979230
|
// ../cli-migrations/lib/migrations/0.3.23/change-services-key-to-service/migration.js
|
|
977951
|
-
var
|
|
979231
|
+
var import_promises181 = require("fs/promises");
|
|
977952
979232
|
var import_yaml14 = __toESM(require_dist11(), 1);
|
|
977953
979233
|
|
|
977954
979234
|
// ../cli-migrations/lib/migrations/0.3.23/change-services-key-to-service/getAllYamlFiles.js
|
|
@@ -977992,7 +979272,7 @@ var migration12 = {
|
|
|
977992
979272
|
}
|
|
977993
979273
|
};
|
|
977994
979274
|
async function migrateYamlFile3(filepath, context3) {
|
|
977995
|
-
const contents = await (0,
|
|
979275
|
+
const contents = await (0, import_promises181.readFile)(filepath);
|
|
977996
979276
|
const parsedDocument = import_yaml14.default.parseDocument(contents.toString());
|
|
977997
979277
|
if (!import_yaml14.default.isMap(parsedDocument.contents)) {
|
|
977998
979278
|
return context3.failAndThrow("File is not a map");
|
|
@@ -978022,7 +979302,7 @@ async function migrateYamlFile3(filepath, context3) {
|
|
|
978022
979302
|
pair.value = firstService.value;
|
|
978023
979303
|
}
|
|
978024
979304
|
}
|
|
978025
|
-
await (0,
|
|
979305
|
+
await (0, import_promises181.writeFile)(filepath, parsedDocument.toString());
|
|
978026
979306
|
}
|
|
978027
979307
|
|
|
978028
979308
|
// ../cli-migrations/lib/migrations/0.3.23/index.js
|
|
@@ -978033,7 +979313,7 @@ var versionMigrations12 = {
|
|
|
978033
979313
|
var __default12 = versionMigrations12;
|
|
978034
979314
|
|
|
978035
979315
|
// ../cli-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/migration.js
|
|
978036
|
-
var
|
|
979316
|
+
var import_promises182 = require("fs/promises");
|
|
978037
979317
|
var import_yaml15 = __toESM(require_dist11(), 1);
|
|
978038
979318
|
|
|
978039
979319
|
// ../cli-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/getAllYamlFiles.js
|
|
@@ -978077,7 +979357,7 @@ var migration13 = {
|
|
|
978077
979357
|
}
|
|
978078
979358
|
};
|
|
978079
979359
|
async function migrateYamlFile4(filepath, context3) {
|
|
978080
|
-
const contents = await (0,
|
|
979360
|
+
const contents = await (0, import_promises182.readFile)(filepath);
|
|
978081
979361
|
const parsedDocument = import_yaml15.default.parseDocument(contents.toString());
|
|
978082
979362
|
if (!import_yaml15.default.isMap(parsedDocument.contents)) {
|
|
978083
979363
|
return context3.failAndThrow("File is not a map");
|
|
@@ -978096,7 +979376,7 @@ async function migrateYamlFile4(filepath, context3) {
|
|
|
978096
979376
|
}
|
|
978097
979377
|
service.items.splice(indexOfServiceDocsPair, 1);
|
|
978098
979378
|
parsedDocument.contents.items.unshift(docsPair);
|
|
978099
|
-
await (0,
|
|
979379
|
+
await (0, import_promises182.writeFile)(filepath, parsedDocument.toString());
|
|
978100
979380
|
}
|
|
978101
979381
|
|
|
978102
979382
|
// ../cli-migrations/lib/migrations/0.5.4/index.js
|
|
@@ -978107,7 +979387,7 @@ var versionMigrations13 = {
|
|
|
978107
979387
|
var __default13 = versionMigrations13;
|
|
978108
979388
|
|
|
978109
979389
|
// ../cli-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/migration.js
|
|
978110
|
-
var
|
|
979390
|
+
var import_promises183 = require("fs/promises");
|
|
978111
979391
|
|
|
978112
979392
|
// ../cli-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/getAllGeneratorYamlFiles.js
|
|
978113
979393
|
init_lib8();
|
|
@@ -978150,14 +979430,14 @@ var migration14 = {
|
|
|
978150
979430
|
}
|
|
978151
979431
|
};
|
|
978152
979432
|
async function migrateYamlFile5(filepath) {
|
|
978153
|
-
const contents = await (0,
|
|
979433
|
+
const contents = await (0, import_promises183.readFile)(filepath);
|
|
978154
979434
|
const domainSuffix = process.env.DOMAIN_SUFFIX ?? "docs.buildwithfern.com";
|
|
978155
979435
|
const regex6 = /(docs:\s*domain:\s*)"([^"]*)"/g;
|
|
978156
979436
|
const updatedSnapshot = contents.toString().replace(regex6, (_match, _prefix, domain3) => {
|
|
978157
979437
|
return `docs:
|
|
978158
979438
|
domain: "${domain3}.${domainSuffix}"`;
|
|
978159
979439
|
});
|
|
978160
|
-
await (0,
|
|
979440
|
+
await (0, import_promises183.writeFile)(filepath, updatedSnapshot.toString());
|
|
978161
979441
|
}
|
|
978162
979442
|
|
|
978163
979443
|
// ../cli-migrations/lib/migrations/0.9.10/index.js
|
|
@@ -978178,11 +979458,11 @@ var LegacyDocsSerializers = __toESM(require_serialization4(), 1);
|
|
|
978178
979458
|
|
|
978179
979459
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/loadRawDocsConfiguration.js
|
|
978180
979460
|
init_lib8();
|
|
978181
|
-
var
|
|
979461
|
+
var import_promises184 = require("fs/promises");
|
|
978182
979462
|
init_js_yaml();
|
|
978183
979463
|
async function loadRawDocsConfiguration2({ absolutePathToWorkspace }) {
|
|
978184
979464
|
const filepath = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
978185
|
-
const contentsStr = await (0,
|
|
979465
|
+
const contentsStr = await (0, import_promises184.readFile)(filepath);
|
|
978186
979466
|
const contentsParsed = index_vite_proxy_tmp_default.load(contentsStr.toString());
|
|
978187
979467
|
const result = await LegacyDocsSerializers.DocsConfiguration.parse(contentsParsed);
|
|
978188
979468
|
if (result.ok) {
|
|
@@ -978201,7 +979481,7 @@ function getAbsolutePathToDocsFolder({ absolutePathToWorkspace }) {
|
|
|
978201
979481
|
|
|
978202
979482
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndMultipleAPIs.js
|
|
978203
979483
|
init_lib8();
|
|
978204
|
-
var
|
|
979484
|
+
var import_promises186 = require("fs/promises");
|
|
978205
979485
|
init_js_yaml();
|
|
978206
979486
|
|
|
978207
979487
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/convertLegacyDocsConfig.js
|
|
@@ -978410,11 +979690,11 @@ __export(legacy_exports, {
|
|
|
978410
979690
|
|
|
978411
979691
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/generators-configuration/loadRawGeneratorsConfiguration.js
|
|
978412
979692
|
init_lib8();
|
|
978413
|
-
var
|
|
979693
|
+
var import_promises185 = require("fs/promises");
|
|
978414
979694
|
init_js_yaml();
|
|
978415
979695
|
async function loadRawGeneratorsConfiguration2({ absolutePathToWorkspace }) {
|
|
978416
979696
|
const filepath = getAbsolutePathToGeneratorsConfiguration({ absolutePathToWorkspace });
|
|
978417
|
-
const contentsStr = await (0,
|
|
979697
|
+
const contentsStr = await (0, import_promises185.readFile)(filepath);
|
|
978418
979698
|
const contentsParsed = index_vite_proxy_tmp_default.load(contentsStr.toString());
|
|
978419
979699
|
const result = await legacy_exports.GeneratorsConfigurationSchema.safeParseAsync(contentsParsed);
|
|
978420
979700
|
if (result.success) {
|
|
@@ -978444,7 +979724,7 @@ function migrateDocsInstances(docsURLs) {
|
|
|
978444
979724
|
var APIS_DIRECTORY2 = "apis";
|
|
978445
979725
|
async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspaces, workspaceContainingDocs }) {
|
|
978446
979726
|
const absolutePathToApisDirectory = join8(absolutePathToFernDirectory, RelativeFilePath2.of(APIS_DIRECTORY2));
|
|
978447
|
-
await (0,
|
|
979727
|
+
await (0, import_promises186.mkdir)(absolutePathToApisDirectory);
|
|
978448
979728
|
for (const workspace of workspaces) {
|
|
978449
979729
|
const absolutePathToWorkspace = join8(absolutePathToFernDirectory, RelativeFilePath2.of(workspace));
|
|
978450
979730
|
const docsURLs = await migrateAndWriteGeneratorsYml({ absolutePathToWorkspace });
|
|
@@ -978452,11 +979732,11 @@ async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspa
|
|
|
978452
979732
|
await migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName: workspaceContainingDocs });
|
|
978453
979733
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
978454
979734
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
978455
|
-
await (0,
|
|
979735
|
+
await (0, import_promises186.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
978456
979736
|
}
|
|
978457
979737
|
const absolutePathToNestedWorkspace = join8(absolutePathToApisDirectory, RelativeFilePath2.of(workspace));
|
|
978458
979738
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
978459
|
-
await (0,
|
|
979739
|
+
await (0, import_promises186.rm)(absolutePathToWorkspace, { recursive: true });
|
|
978460
979740
|
}
|
|
978461
979741
|
}
|
|
978462
979742
|
async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
@@ -978469,7 +979749,7 @@ async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
|
978469
979749
|
generatorsConfiguration,
|
|
978470
979750
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
978471
979751
|
});
|
|
978472
|
-
await (0,
|
|
979752
|
+
await (0, import_promises186.writeFile)(absolutePathToGeneratorsConfiguration, index_vite_proxy_tmp_default.dump(convertedResponse.value));
|
|
978473
979753
|
return convertedResponse.docsURLs;
|
|
978474
979754
|
}
|
|
978475
979755
|
async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName }) {
|
|
@@ -978483,12 +979763,12 @@ async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiNa
|
|
|
978483
979763
|
apiName
|
|
978484
979764
|
});
|
|
978485
979765
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
978486
|
-
await (0,
|
|
979766
|
+
await (0, import_promises186.writeFile)(absolutePathToDocsConfig, index_vite_proxy_tmp_default.dump(convertedDocsConfig));
|
|
978487
979767
|
}
|
|
978488
979768
|
|
|
978489
979769
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndSingleAPI.js
|
|
978490
979770
|
init_lib8();
|
|
978491
|
-
var
|
|
979771
|
+
var import_promises187 = require("fs/promises");
|
|
978492
979772
|
init_js_yaml();
|
|
978493
979773
|
async function migrateDocsAndSingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
978494
979774
|
const docsURLs = await migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace });
|
|
@@ -978496,8 +979776,8 @@ async function migrateDocsAndSingleAPI({ absolutePathToFernDirectory, absolutePa
|
|
|
978496
979776
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
978497
979777
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
978498
979778
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
978499
|
-
await (0,
|
|
978500
|
-
await (0,
|
|
979779
|
+
await (0, import_promises187.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
979780
|
+
await (0, import_promises187.rm)(absolutePathToWorkspace, { recursive: true });
|
|
978501
979781
|
}
|
|
978502
979782
|
async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
978503
979783
|
const docsConfiguration = await loadRawDocsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -978510,7 +979790,7 @@ async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
|
978510
979790
|
apiName: void 0
|
|
978511
979791
|
});
|
|
978512
979792
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
978513
|
-
await (0,
|
|
979793
|
+
await (0, import_promises187.writeFile)(absolutePathToDocsConfig, index_vite_proxy_tmp_default.dump(convertedDocsConfig));
|
|
978514
979794
|
}
|
|
978515
979795
|
async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
978516
979796
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -978522,24 +979802,24 @@ async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
|
978522
979802
|
generatorsConfiguration,
|
|
978523
979803
|
pathModificationStrategy: "MoveUp"
|
|
978524
979804
|
});
|
|
978525
|
-
await (0,
|
|
979805
|
+
await (0, import_promises187.writeFile)(absolutePathToGeneratorsConfiguration, index_vite_proxy_tmp_default.dump(convertedResponse.value));
|
|
978526
979806
|
return convertedResponse.docsURLs;
|
|
978527
979807
|
}
|
|
978528
979808
|
|
|
978529
979809
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlyMultipleAPIs.js
|
|
978530
979810
|
init_lib8();
|
|
978531
|
-
var
|
|
979811
|
+
var import_promises188 = require("fs/promises");
|
|
978532
979812
|
init_js_yaml();
|
|
978533
979813
|
var APIS_DIRECTORY3 = "apis";
|
|
978534
979814
|
async function migrateOnlyMultipleAPIs({ absolutePathToFernDirectory, workspaces }) {
|
|
978535
979815
|
const absolutePathToApisDirectory = join8(absolutePathToFernDirectory, RelativeFilePath2.of(APIS_DIRECTORY3));
|
|
978536
|
-
await (0,
|
|
979816
|
+
await (0, import_promises188.mkdir)(absolutePathToApisDirectory);
|
|
978537
979817
|
for (const workspace of workspaces) {
|
|
978538
979818
|
const absolutePathToWorkspace = join8(absolutePathToFernDirectory, RelativeFilePath2.of(workspace));
|
|
978539
979819
|
await migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace });
|
|
978540
979820
|
const absolutePathToNestedWorkspace = join8(absolutePathToApisDirectory, RelativeFilePath2.of(workspace));
|
|
978541
979821
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
978542
|
-
await (0,
|
|
979822
|
+
await (0, import_promises188.rm)(absolutePathToWorkspace, { recursive: true });
|
|
978543
979823
|
}
|
|
978544
979824
|
}
|
|
978545
979825
|
async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
@@ -978552,17 +979832,17 @@ async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
|
978552
979832
|
generatorsConfiguration,
|
|
978553
979833
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
978554
979834
|
});
|
|
978555
|
-
await (0,
|
|
979835
|
+
await (0, import_promises188.writeFile)(absolutePathToGeneratorsConfiguration, index_vite_proxy_tmp_default.dump(convertedResponse.value));
|
|
978556
979836
|
}
|
|
978557
979837
|
|
|
978558
979838
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlySingleAPI.js
|
|
978559
979839
|
init_lib8();
|
|
978560
|
-
var
|
|
979840
|
+
var import_promises189 = require("fs/promises");
|
|
978561
979841
|
init_js_yaml();
|
|
978562
979842
|
async function migrateOnlySingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
978563
979843
|
await migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace });
|
|
978564
979844
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
978565
|
-
await (0,
|
|
979845
|
+
await (0, import_promises189.rm)(absolutePathToWorkspace, { recursive: true });
|
|
978566
979846
|
}
|
|
978567
979847
|
async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
978568
979848
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -978574,7 +979854,7 @@ async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
|
978574
979854
|
generatorsConfiguration,
|
|
978575
979855
|
pathModificationStrategy: "MoveUp"
|
|
978576
979856
|
});
|
|
978577
|
-
await (0,
|
|
979857
|
+
await (0, import_promises189.writeFile)(absolutePathToGeneratorsConfiguration, index_vite_proxy_tmp_default.dump(convertedResponse.value));
|
|
978578
979858
|
}
|
|
978579
979859
|
|
|
978580
979860
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migration.js
|
|
@@ -978654,7 +979934,7 @@ var __default15 = versionMigrations15;
|
|
|
978654
979934
|
init_lib19();
|
|
978655
979935
|
init_lib8();
|
|
978656
979936
|
init_source();
|
|
978657
|
-
var
|
|
979937
|
+
var import_promises190 = require("fs/promises");
|
|
978658
979938
|
init_js_yaml();
|
|
978659
979939
|
var import_yaml16 = __toESM(require_dist11(), 1);
|
|
978660
979940
|
var migration16 = {
|
|
@@ -978698,7 +979978,7 @@ async function addApiConfigurationToSingleWorkspace({ absolutePathToFernDirector
|
|
|
978698
979978
|
if (existingGeneratorsYml == null) {
|
|
978699
979979
|
if (openapiDirectory != null && openapiDirectory.contents[0] != null) {
|
|
978700
979980
|
const absolutePathToGeneratorsYml = join8(absoluteFilepathToWorkspace, RelativeFilePath2.of("generators.yml"));
|
|
978701
|
-
await (0,
|
|
979981
|
+
await (0, import_promises190.writeFile)(absolutePathToGeneratorsYml, index_vite_proxy_tmp_default.dump({
|
|
978702
979982
|
api: {
|
|
978703
979983
|
path: join8(relativize(absolutePathToFernDirectory, absoluteFilepathToWorkspace), RelativeFilePath2.of(openapiDirectory.name), RelativeFilePath2.of(openapiDirectory.contents[0]?.name))
|
|
978704
979984
|
}
|
|
@@ -978713,7 +979993,7 @@ async function addApiConfigurationToSingleWorkspace({ absolutePathToFernDirector
|
|
|
978713
979993
|
parsedDocument.set("api", {
|
|
978714
979994
|
path: join8(relativize(absolutePathToFernDirectory, absoluteFilepathToWorkspace), RelativeFilePath2.of(openapiDirectory.name), RelativeFilePath2.of(openapiDirectory.contents[0]?.name))
|
|
978715
979995
|
});
|
|
978716
|
-
await (0,
|
|
979996
|
+
await (0, import_promises190.writeFile)(existingGeneratorsYml.absolutePath, parsedDocument.toString());
|
|
978717
979997
|
context3.logger.info(source_default.green(`Updated ${existingGeneratorsYml.absolutePath}`));
|
|
978718
979998
|
}
|
|
978719
979999
|
}
|
|
@@ -978743,7 +980023,7 @@ var __default16 = versionMigrations16;
|
|
|
978743
980023
|
init_lib19();
|
|
978744
980024
|
init_lib8();
|
|
978745
980025
|
init_source();
|
|
978746
|
-
var
|
|
980026
|
+
var import_promises191 = require("fs/promises");
|
|
978747
980027
|
init_js_yaml();
|
|
978748
980028
|
var import_yaml17 = __toESM(require_dist11(), 1);
|
|
978749
980029
|
var migration17 = {
|
|
@@ -978924,7 +980204,7 @@ async function addApiConfigurationToSingleWorkspace2({ absoluteFilepathToWorkspa
|
|
|
978924
980204
|
if (schemaComment && documentToWrite.indexOf(schemaComment) === -1) {
|
|
978925
980205
|
documentToWrite = `${schemaComment}${documentToWrite}`;
|
|
978926
980206
|
}
|
|
978927
|
-
await (0,
|
|
980207
|
+
await (0, import_promises191.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
978928
980208
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
978929
980209
|
}
|
|
978930
980210
|
async function parseApiSpec({ oldSpec, absoluteFilepathToWorkspace, files, directories, context: context3, namespace }) {
|
|
@@ -978971,7 +980251,7 @@ async function parseApiSpec({ oldSpec, absoluteFilepathToWorkspace, files, direc
|
|
|
978971
980251
|
}
|
|
978972
980252
|
let specContent;
|
|
978973
980253
|
try {
|
|
978974
|
-
const fileContents = await (0,
|
|
980254
|
+
const fileContents = await (0, import_promises191.readFile)(absoluteSpecPath, { encoding: "utf-8" });
|
|
978975
980255
|
specContent = index_vite_proxy_tmp_default.load(fileContents);
|
|
978976
980256
|
} catch (e2) {
|
|
978977
980257
|
context3.logger.warn(`Failed to read API spec file ${spec.path}. Error: ${e2}. Skipping...`);
|
|
@@ -979077,7 +980357,7 @@ var __default17 = versionMigrations17;
|
|
|
979077
980357
|
init_lib19();
|
|
979078
980358
|
init_lib8();
|
|
979079
980359
|
init_source();
|
|
979080
|
-
var
|
|
980360
|
+
var import_promises192 = require("fs/promises");
|
|
979081
980361
|
init_js_yaml();
|
|
979082
980362
|
var migration18 = {
|
|
979083
980363
|
name: "add-path-parameter-order-setting",
|
|
@@ -979166,7 +980446,7 @@ async function updateGeneratorsYml({ context: context3, files }) {
|
|
|
979166
980446
|
documentToWrite = `${schemaComment}
|
|
979167
980447
|
${documentToWrite}`;
|
|
979168
980448
|
}
|
|
979169
|
-
await (0,
|
|
980449
|
+
await (0, import_promises192.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
979170
980450
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
979171
980451
|
}
|
|
979172
980452
|
async function getFilesAndDirectories3(absoluteFilepath) {
|
|
@@ -979205,7 +980485,7 @@ var __default18 = versionMigrations18;
|
|
|
979205
980485
|
init_lib19();
|
|
979206
980486
|
init_lib8();
|
|
979207
980487
|
init_source();
|
|
979208
|
-
var
|
|
980488
|
+
var import_promises193 = require("fs/promises");
|
|
979209
980489
|
init_js_yaml();
|
|
979210
980490
|
var migration19 = {
|
|
979211
980491
|
name: "update-1_0_0-defaults",
|
|
@@ -979381,7 +980661,7 @@ async function updateGeneratorsYml2({ context: context3, files }) {
|
|
|
979381
980661
|
documentToWrite = `${schemaComment}
|
|
979382
980662
|
${documentToWrite}`;
|
|
979383
980663
|
}
|
|
979384
|
-
await (0,
|
|
980664
|
+
await (0, import_promises193.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
979385
980665
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
979386
980666
|
}
|
|
979387
980667
|
async function getFilesAndDirectories4(absoluteFilepath) {
|
|
@@ -979453,7 +980733,7 @@ var __default19 = versionMigrations19;
|
|
|
979453
980733
|
init_lib19();
|
|
979454
980734
|
init_lib8();
|
|
979455
980735
|
init_source();
|
|
979456
|
-
var
|
|
980736
|
+
var import_promises194 = require("fs/promises");
|
|
979457
980737
|
init_js_yaml();
|
|
979458
980738
|
var migration20 = {
|
|
979459
980739
|
name: "update-2_0_0-defaults",
|
|
@@ -979629,7 +980909,7 @@ async function updateGeneratorsYml3({ context: context3, files }) {
|
|
|
979629
980909
|
documentToWrite = `${schemaComment}
|
|
979630
980910
|
${documentToWrite}`;
|
|
979631
980911
|
}
|
|
979632
|
-
await (0,
|
|
980912
|
+
await (0, import_promises194.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
979633
980913
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
979634
980914
|
}
|
|
979635
980915
|
async function getFilesAndDirectories5(absoluteFilepath) {
|
|
@@ -979678,7 +980958,7 @@ var __default20 = versionMigrations20;
|
|
|
979678
980958
|
init_lib19();
|
|
979679
980959
|
init_lib8();
|
|
979680
980960
|
init_source();
|
|
979681
|
-
var
|
|
980961
|
+
var import_promises195 = require("fs/promises");
|
|
979682
980962
|
init_js_yaml();
|
|
979683
980963
|
var migration21 = {
|
|
979684
980964
|
name: "migrate-deprecated-generator-api-settings",
|
|
@@ -979770,7 +981050,7 @@ async function updateGeneratorsYml4({ context: context3, files }) {
|
|
|
979770
981050
|
documentToWrite = `${schemaComment}
|
|
979771
981051
|
${documentToWrite}`;
|
|
979772
981052
|
}
|
|
979773
|
-
await (0,
|
|
981053
|
+
await (0, import_promises195.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
979774
981054
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
979775
981055
|
}
|
|
979776
981056
|
function migrateDeprecatedSettings(settings, context3) {
|
|
@@ -979819,7 +981099,7 @@ var __default21 = versionMigrations21;
|
|
|
979819
981099
|
init_lib19();
|
|
979820
981100
|
init_lib8();
|
|
979821
981101
|
init_source();
|
|
979822
|
-
var
|
|
981102
|
+
var import_promises196 = require("fs/promises");
|
|
979823
981103
|
init_js_yaml();
|
|
979824
981104
|
var migration22 = {
|
|
979825
981105
|
name: "enable-smart-casing",
|
|
@@ -979904,7 +981184,7 @@ async function updateGeneratorsYml5({ context: context3, files }) {
|
|
|
979904
981184
|
documentToWrite = `${schemaComment}
|
|
979905
981185
|
${documentToWrite}`;
|
|
979906
981186
|
}
|
|
979907
|
-
await (0,
|
|
981187
|
+
await (0, import_promises196.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
979908
981188
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
979909
981189
|
}
|
|
979910
981190
|
function setSmartCasingFalseIfNotConfigured(generator, context3) {
|
|
@@ -979944,7 +981224,7 @@ var __default22 = versionMigrations22;
|
|
|
979944
981224
|
init_lib19();
|
|
979945
981225
|
init_lib8();
|
|
979946
981226
|
init_source();
|
|
979947
|
-
var
|
|
981227
|
+
var import_promises197 = require("fs/promises");
|
|
979948
981228
|
init_js_yaml();
|
|
979949
981229
|
var migration23 = {
|
|
979950
981230
|
name: "disable-disambiguate-request-names",
|
|
@@ -980069,7 +981349,7 @@ async function updateGeneratorsYml6({ context: context3, files }) {
|
|
|
980069
981349
|
documentToWrite = `${schemaComment}
|
|
980070
981350
|
${documentToWrite}`;
|
|
980071
981351
|
}
|
|
980072
|
-
await (0,
|
|
981352
|
+
await (0, import_promises197.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
980073
981353
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
980074
981354
|
}
|
|
980075
981355
|
async function getFilesAndDirectories8(absoluteFilepath) {
|
|
@@ -980204,7 +981484,7 @@ init_lib33();
|
|
|
980204
981484
|
init_lib27();
|
|
980205
981485
|
init_lib6();
|
|
980206
981486
|
init_source();
|
|
980207
|
-
var
|
|
981487
|
+
var import_promises198 = require("fs/promises");
|
|
980208
981488
|
|
|
980209
981489
|
// ../../../node_modules/.pnpm/immer@10.2.0/node_modules/immer/dist/immer.mjs
|
|
980210
981490
|
var NOTHING = /* @__PURE__ */ Symbol.for("immer-nothing");
|
|
@@ -981608,7 +982888,7 @@ async function upgrade({
|
|
|
981608
982888
|
const newProjectConfig = produce(projectConfig2.rawConfig, (draft) => {
|
|
981609
982889
|
draft.version = resolvedTargetVersion;
|
|
981610
982890
|
});
|
|
981611
|
-
await (0,
|
|
982891
|
+
await (0, import_promises198.writeFile)(
|
|
981612
982892
|
projectConfig2._absolutePath,
|
|
981613
982893
|
ensureFinalNewline(JSON.stringify(newProjectConfig, void 0, 2))
|
|
981614
982894
|
);
|
|
@@ -981815,7 +983095,7 @@ async function upgradeGeneratorsForAllWorkspaces({
|
|
|
981815
983095
|
absolutePathToWorkspace: workspace.absoluteFilePath
|
|
981816
983096
|
});
|
|
981817
983097
|
if (absolutePathToGeneratorsConfiguration != null && result.updatedConfiguration != null) {
|
|
981818
|
-
await (0,
|
|
983098
|
+
await (0, import_promises199.writeFile)(absolutePathToGeneratorsConfiguration, result.updatedConfiguration);
|
|
981819
983099
|
}
|
|
981820
983100
|
for (const upgrade2 of result.appliedUpgrades) {
|
|
981821
983101
|
const normalizedName = addDefaultDockerOrgIfNotPresent(upgrade2.generatorName);
|
|
@@ -982293,7 +983573,7 @@ async function previewDocsWorkspace({
|
|
|
982293
983573
|
// src/commands/docs-diff/docsDiff.ts
|
|
982294
983574
|
init_lib8();
|
|
982295
983575
|
init_lib6();
|
|
982296
|
-
var
|
|
983576
|
+
var import_promises200 = require("fs/promises");
|
|
982297
983577
|
var import_pngjs2 = __toESM(require_png(), 1);
|
|
982298
983578
|
async function getSlugForFiles2({
|
|
982299
983579
|
previewUrl,
|
|
@@ -982516,8 +983796,8 @@ async function generateComparisons2({
|
|
|
982516
983796
|
afterPath,
|
|
982517
983797
|
comparisonBasePath
|
|
982518
983798
|
}) {
|
|
982519
|
-
const beforePng = import_pngjs2.PNG.sync.read(await (0,
|
|
982520
|
-
const afterPng = import_pngjs2.PNG.sync.read(await (0,
|
|
983799
|
+
const beforePng = import_pngjs2.PNG.sync.read(await (0, import_promises200.readFile)(beforePath));
|
|
983800
|
+
const afterPng = import_pngjs2.PNG.sync.read(await (0, import_promises200.readFile)(afterPath));
|
|
982521
983801
|
const beforeOriginalHeight = beforePng.height;
|
|
982522
983802
|
const afterOriginalHeight = afterPng.height;
|
|
982523
983803
|
const width = Math.max(beforePng.width, afterPng.width);
|
|
@@ -982555,7 +983835,7 @@ async function generateComparisons2({
|
|
|
982555
983835
|
const sideBySide = createSideBySideComparison2(croppedBefore, croppedAfter, 20, true);
|
|
982556
983836
|
const outPath = `${base4}-region-${i5 + 1}.png`;
|
|
982557
983837
|
const pngBuffer = import_pngjs2.PNG.sync.write(sideBySide);
|
|
982558
|
-
await (0,
|
|
983838
|
+
await (0, import_promises200.writeFile)(outPath, new Uint8Array(pngBuffer));
|
|
982559
983839
|
results.push({ changePercent, boundingBox, comparisonPath: outPath });
|
|
982560
983840
|
}
|
|
982561
983841
|
return results;
|
|
@@ -982634,7 +983914,7 @@ async function docsDiff({
|
|
|
982634
983914
|
outputDir.startsWith("/") ? outputDir : join8(cwd(), RelativeFilePath2.of(outputDir))
|
|
982635
983915
|
);
|
|
982636
983916
|
if (!await doesPathExist(outputPath)) {
|
|
982637
|
-
await (0,
|
|
983917
|
+
await (0, import_promises200.mkdir)(outputPath, { recursive: true });
|
|
982638
983918
|
}
|
|
982639
983919
|
const results = [];
|
|
982640
983920
|
await cliContext.runTask(async (context3) => {
|
|
@@ -983036,9 +984316,9 @@ init_lib6();
|
|
|
983036
984316
|
// src/commands/docs-theme/ThemeExporter.ts
|
|
983037
984317
|
init_lib12();
|
|
983038
984318
|
init_lib8();
|
|
983039
|
-
var
|
|
984319
|
+
var import_promises201 = require("fs/promises");
|
|
983040
984320
|
init_js_yaml();
|
|
983041
|
-
var
|
|
984321
|
+
var import_path111 = __toESM(require("path"), 1);
|
|
983042
984322
|
var ThemeExporter = class {
|
|
983043
984323
|
constructor(docsWorkspace) {
|
|
983044
984324
|
this.docsWorkspace = docsWorkspace;
|
|
@@ -983046,37 +984326,37 @@ var ThemeExporter = class {
|
|
|
983046
984326
|
docsWorkspace;
|
|
983047
984327
|
async export({ output: output2, context: context3 }) {
|
|
983048
984328
|
const docsYmlPath = this.docsWorkspace.absoluteFilepathToDocsConfig;
|
|
983049
|
-
const docsDir =
|
|
983050
|
-
const outDir = output2 != null ?
|
|
984329
|
+
const docsDir = import_path111.default.dirname(docsYmlPath);
|
|
984330
|
+
const outDir = output2 != null ? import_path111.default.resolve(process.cwd(), output2) : import_path111.default.join(this.docsWorkspace.absoluteFilePath, "theme");
|
|
983051
984331
|
context3.logger.info(`Exporting theme-eligible fields from docs.yml \u2192 ${outDir}`);
|
|
983052
|
-
const raw = index_vite_proxy_tmp_default.load(await (0,
|
|
984332
|
+
const raw = index_vite_proxy_tmp_default.load(await (0, import_promises201.readFile)(docsYmlPath, "utf-8"));
|
|
983053
984333
|
const themeConfig = {};
|
|
983054
984334
|
for (const [k4, v3] of Object.entries(raw)) {
|
|
983055
984335
|
if (docs_yml_exports.THEME_ELIGIBLE_YAML_KEYS.has(k4)) {
|
|
983056
984336
|
themeConfig[k4] = v3;
|
|
983057
984337
|
}
|
|
983058
984338
|
}
|
|
983059
|
-
await (0,
|
|
983060
|
-
const assetsDir =
|
|
983061
|
-
await (0,
|
|
984339
|
+
await (0, import_promises201.mkdir)(outDir, { recursive: true });
|
|
984340
|
+
const assetsDir = import_path111.default.join(outDir, "assets");
|
|
984341
|
+
await (0, import_promises201.mkdir)(assetsDir, { recursive: true });
|
|
983062
984342
|
const exported = await copyLocalFiles(themeConfig, docsDir, assetsDir);
|
|
983063
|
-
await (0,
|
|
984343
|
+
await (0, import_promises201.writeFile)(import_path111.default.join(outDir, "theme.yml"), index_vite_proxy_tmp_default.dump(exported), "utf-8");
|
|
983064
984344
|
context3.logger.info(`Theme exported to ${outDir}/theme.yml`);
|
|
983065
984345
|
}
|
|
983066
984346
|
};
|
|
983067
984347
|
async function copyLocalFiles(obj, sourceDir, assetsDir) {
|
|
983068
984348
|
if (obj === null || typeof obj !== "object") {
|
|
983069
984349
|
if (typeof obj === "string" && !isURL(obj)) {
|
|
983070
|
-
const abs =
|
|
983071
|
-
const relFromSource =
|
|
983072
|
-
const projectRoot =
|
|
983073
|
-
const relFromProject =
|
|
983074
|
-
const destRelative = relFromSource.startsWith("..") ? relFromProject.startsWith("..") ?
|
|
983075
|
-
const dest =
|
|
984350
|
+
const abs = import_path111.default.resolve(sourceDir, obj);
|
|
984351
|
+
const relFromSource = import_path111.default.relative(sourceDir, abs);
|
|
984352
|
+
const projectRoot = import_path111.default.dirname(sourceDir);
|
|
984353
|
+
const relFromProject = import_path111.default.relative(projectRoot, abs);
|
|
984354
|
+
const destRelative = relFromSource.startsWith("..") ? relFromProject.startsWith("..") ? import_path111.default.basename(abs) : relFromProject : relFromSource;
|
|
984355
|
+
const dest = import_path111.default.join(assetsDir, destRelative);
|
|
983076
984356
|
try {
|
|
983077
|
-
await (0,
|
|
983078
|
-
await (0,
|
|
983079
|
-
return `./assets/${destRelative.split(
|
|
984357
|
+
await (0, import_promises201.mkdir)(import_path111.default.dirname(dest), { recursive: true });
|
|
984358
|
+
await (0, import_promises201.copyFile)(abs, dest);
|
|
984359
|
+
return `./assets/${destRelative.split(import_path111.default.sep).join("/")}`;
|
|
983080
984360
|
} catch {
|
|
983081
984361
|
return obj;
|
|
983082
984362
|
}
|
|
@@ -983167,18 +984447,18 @@ async function listDocsThemes({
|
|
|
983167
984447
|
|
|
983168
984448
|
// src/commands/docs-theme/uploadDocsTheme.ts
|
|
983169
984449
|
init_lib6();
|
|
983170
|
-
var
|
|
984450
|
+
var import_promises203 = require("fs/promises");
|
|
983171
984451
|
init_js_yaml();
|
|
983172
|
-
var
|
|
984452
|
+
var import_path113 = __toESM(require("path"), 1);
|
|
983173
984453
|
|
|
983174
984454
|
// src/commands/docs-theme/ThemeConfigProcessor.ts
|
|
983175
984455
|
init_lib8();
|
|
983176
984456
|
init_lib6();
|
|
983177
984457
|
var import_child_process13 = require("child_process");
|
|
983178
984458
|
var import_crypto10 = require("crypto");
|
|
983179
|
-
var
|
|
984459
|
+
var import_promises202 = require("fs/promises");
|
|
983180
984460
|
var import_mime_types2 = __toESM(require_mime_types(), 1);
|
|
983181
|
-
var
|
|
984461
|
+
var import_path112 = __toESM(require("path"), 1);
|
|
983182
984462
|
function getGitRoot() {
|
|
983183
984463
|
try {
|
|
983184
984464
|
return (0, import_child_process13.execSync)("git rev-parse --show-toplevel", { encoding: "utf-8" }).trim();
|
|
@@ -983187,9 +984467,9 @@ function getGitRoot() {
|
|
|
983187
984467
|
}
|
|
983188
984468
|
}
|
|
983189
984469
|
function posixBindPath(gitRoot, absolutePath) {
|
|
983190
|
-
const repoName =
|
|
983191
|
-
const relative6 =
|
|
983192
|
-
return [repoName, ...relative6.split(
|
|
984470
|
+
const repoName = import_path112.default.basename(gitRoot);
|
|
984471
|
+
const relative6 = import_path112.default.relative(gitRoot, absolutePath);
|
|
984472
|
+
return [repoName, ...relative6.split(import_path112.default.sep)].join("/");
|
|
983193
984473
|
}
|
|
983194
984474
|
var ThemeConfigProcessor = class {
|
|
983195
984475
|
themeDir;
|
|
@@ -983203,7 +984483,7 @@ var ThemeConfigProcessor = class {
|
|
|
983203
984483
|
token,
|
|
983204
984484
|
context: context3
|
|
983205
984485
|
}) {
|
|
983206
|
-
this.themeDir =
|
|
984486
|
+
this.themeDir = import_path112.default.join(docsWorkspace.absoluteFilePath, "theme");
|
|
983207
984487
|
this.orgId = orgId;
|
|
983208
984488
|
this.token = token;
|
|
983209
984489
|
this.gitRoot = getGitRoot();
|
|
@@ -983218,9 +984498,9 @@ var ThemeConfigProcessor = class {
|
|
|
983218
984498
|
const errors4 = [];
|
|
983219
984499
|
await Promise.all(
|
|
983220
984500
|
filePaths.map(async (filePath) => {
|
|
983221
|
-
const abs =
|
|
984501
|
+
const abs = import_path112.default.resolve(this.themeDir, filePath);
|
|
983222
984502
|
try {
|
|
983223
|
-
await (0,
|
|
984503
|
+
await (0, import_promises202.access)(abs);
|
|
983224
984504
|
} catch {
|
|
983225
984505
|
errors4.push(`Referenced file not found: ${abs}`);
|
|
983226
984506
|
}
|
|
@@ -983305,7 +984585,7 @@ ${errors4.map((e2) => ` - ${e2}`).join("\n")}`,
|
|
|
983305
984585
|
if (isURL(value2)) {
|
|
983306
984586
|
return value2;
|
|
983307
984587
|
}
|
|
983308
|
-
const abs =
|
|
984588
|
+
const abs = import_path112.default.resolve(this.themeDir, value2);
|
|
983309
984589
|
this.context.logger.debug(` Uploading ${value2}...`);
|
|
983310
984590
|
const hash5 = await this.uploadFileToCas(abs);
|
|
983311
984591
|
filesUploaded++;
|
|
@@ -983385,10 +984665,10 @@ ${errors4.map((e2) => ` - ${e2}`).join("\n")}`,
|
|
|
983385
984665
|
return { config: cfg, filesUploaded };
|
|
983386
984666
|
}
|
|
983387
984667
|
async uploadFileToCas(absolutePath) {
|
|
983388
|
-
const content5 = await (0,
|
|
984668
|
+
const content5 = await (0, import_promises202.readFile)(absolutePath);
|
|
983389
984669
|
const contentType = import_mime_types2.default.lookup(absolutePath) || "application/octet-stream";
|
|
983390
984670
|
const bindPath = posixBindPath(this.gitRoot, absolutePath);
|
|
983391
|
-
return this.uploadToCas(content5, contentType, bindPath,
|
|
984671
|
+
return this.uploadToCas(content5, contentType, bindPath, import_path112.default.basename(absolutePath));
|
|
983392
984672
|
}
|
|
983393
984673
|
async uploadToCas(content5, contentType, bindPath, label) {
|
|
983394
984674
|
const hash5 = (0, import_crypto10.createHash)("sha256").update(content5).digest("hex");
|
|
@@ -983496,11 +984776,11 @@ async function uploadDocsTheme({
|
|
|
983496
984776
|
return;
|
|
983497
984777
|
}
|
|
983498
984778
|
const orgId = org ?? project.config.organization;
|
|
983499
|
-
const themeYmlPath =
|
|
984779
|
+
const themeYmlPath = import_path113.default.join(docsWorkspace.absoluteFilePath, "theme", "theme.yml");
|
|
983500
984780
|
await cliContext.runTask(async (context3) => {
|
|
983501
984781
|
let rawYaml;
|
|
983502
984782
|
try {
|
|
983503
|
-
const content5 = await (0,
|
|
984783
|
+
const content5 = await (0, import_promises203.readFile)(themeYmlPath, "utf-8");
|
|
983504
984784
|
rawYaml = index_vite_proxy_tmp_default.load(content5, { schema: index_vite_proxy_tmp_default.JSON_SCHEMA });
|
|
983505
984785
|
} catch {
|
|
983506
984786
|
context3.failAndThrow(
|
|
@@ -983555,7 +984835,7 @@ async function uploadDocsTheme({
|
|
|
983555
984835
|
// src/commands/downgrade/downgrade.ts
|
|
983556
984836
|
init_lib19();
|
|
983557
984837
|
init_lib6();
|
|
983558
|
-
var
|
|
984838
|
+
var import_promises204 = require("fs/promises");
|
|
983559
984839
|
function ensureFinalNewline2(content5) {
|
|
983560
984840
|
return content5.endsWith("\n") ? content5 : content5 + "\n";
|
|
983561
984841
|
}
|
|
@@ -983580,7 +984860,7 @@ async function downgrade({
|
|
|
983580
984860
|
const newProjectConfig = produce(projectConfig.rawConfig, (draft) => {
|
|
983581
984861
|
draft.version = targetVersion;
|
|
983582
984862
|
});
|
|
983583
|
-
await (0,
|
|
984863
|
+
await (0, import_promises204.writeFile)(projectConfig._absolutePath, ensureFinalNewline2(JSON.stringify(newProjectConfig, void 0, 2)));
|
|
983584
984864
|
cliContext.logger.info(`Updated ${PROJECT_CONFIG_FILENAME} to version ${targetVersion}`);
|
|
983585
984865
|
}
|
|
983586
984866
|
|
|
@@ -983588,7 +984868,7 @@ async function downgrade({
|
|
|
983588
984868
|
init_lib36();
|
|
983589
984869
|
init_lib8();
|
|
983590
984870
|
init_lib22();
|
|
983591
|
-
var
|
|
984871
|
+
var import_promises205 = require("fs/promises");
|
|
983592
984872
|
init_js_yaml();
|
|
983593
984873
|
|
|
983594
984874
|
// src/commands/export/convertIrToOpenApi.ts
|
|
@@ -985010,8 +986290,8 @@ async function generateOpenAPIForWorkspaces({
|
|
|
985010
986290
|
ir: ir3,
|
|
985011
986291
|
mode: "openapi"
|
|
985012
986292
|
});
|
|
985013
|
-
await (0,
|
|
985014
|
-
await (0,
|
|
986293
|
+
await (0, import_promises205.mkdir)(dirname6(outputPath), { recursive: true });
|
|
986294
|
+
await (0, import_promises205.writeFile)(
|
|
985015
986295
|
outputPath,
|
|
985016
986296
|
outputPath.endsWith(".json") ? JSON.stringify(openapi, void 0, indent4) : index_vite_proxy_tmp_default.dump(openapi, { indent: indent4 })
|
|
985017
986297
|
);
|
|
@@ -985343,7 +986623,7 @@ function summarizeValidationErrors(errors4) {
|
|
|
985343
986623
|
// src/commands/generate-dynamic-ir/generateDynamicIrForWorkspaces.ts
|
|
985344
986624
|
init_lib8();
|
|
985345
986625
|
init_lib6();
|
|
985346
|
-
var
|
|
986626
|
+
var import_path114 = __toESM(require("path"), 1);
|
|
985347
986627
|
|
|
985348
986628
|
// src/commands/generate-ir/generateIrForFernWorkspace.ts
|
|
985349
986629
|
init_lib36();
|
|
@@ -985410,7 +986690,7 @@ async function generateDynamicIrForWorkspaces({
|
|
|
985410
986690
|
code: CliError.Code.InternalError
|
|
985411
986691
|
});
|
|
985412
986692
|
}
|
|
985413
|
-
const irOutputFilePath =
|
|
986693
|
+
const irOutputFilePath = import_path114.default.resolve(irFilepath);
|
|
985414
986694
|
await streamObjectToFile(AbsoluteFilePath2.of(irOutputFilePath), intermediateRepresentation.dynamic);
|
|
985415
986695
|
context3.logger.info(`Wrote IR to ${irOutputFilePath}`);
|
|
985416
986696
|
});
|
|
@@ -985421,7 +986701,7 @@ async function generateDynamicIrForWorkspaces({
|
|
|
985421
986701
|
// src/commands/generate-fdr/generateFdrApiDefinitionForWorkspaces.ts
|
|
985422
986702
|
init_lib8();
|
|
985423
986703
|
init_lib66();
|
|
985424
|
-
var
|
|
986704
|
+
var import_path115 = __toESM(require("path"), 1);
|
|
985425
986705
|
async function generateFdrApiDefinitionForWorkspaces({
|
|
985426
986706
|
project,
|
|
985427
986707
|
outputFilepath,
|
|
@@ -985458,7 +986738,7 @@ async function generateFdrApiDefinitionForWorkspaces({
|
|
|
985458
986738
|
},
|
|
985459
986739
|
context: context3
|
|
985460
986740
|
});
|
|
985461
|
-
const resolvedOutputFilePath = AbsoluteFilePath2.of(
|
|
986741
|
+
const resolvedOutputFilePath = AbsoluteFilePath2.of(import_path115.default.resolve(outputFilepath));
|
|
985462
986742
|
await streamObjectToFile(resolvedOutputFilePath, apiDefinition, { pretty: true });
|
|
985463
986743
|
context3.logger.info(`Wrote FDR API definition to ${resolvedOutputFilePath}`);
|
|
985464
986744
|
});
|
|
@@ -985470,7 +986750,7 @@ async function generateFdrApiDefinitionForWorkspaces({
|
|
|
985470
986750
|
init_lib8();
|
|
985471
986751
|
init_lib9();
|
|
985472
986752
|
init_lib35();
|
|
985473
|
-
var
|
|
986753
|
+
var import_path116 = __toESM(require("path"), 1);
|
|
985474
986754
|
async function generateIrForWorkspaces({
|
|
985475
986755
|
project,
|
|
985476
986756
|
irFilepath,
|
|
@@ -985500,7 +986780,7 @@ async function generateIrForWorkspaces({
|
|
|
985500
986780
|
readme,
|
|
985501
986781
|
directFromOpenapi
|
|
985502
986782
|
});
|
|
985503
|
-
const irOutputFilePath = AbsoluteFilePath2.of(
|
|
986783
|
+
const irOutputFilePath = AbsoluteFilePath2.of(import_path116.default.resolve(irFilepath));
|
|
985504
986784
|
await streamObjectToFile(irOutputFilePath, intermediateRepresentation, { pretty: true });
|
|
985505
986785
|
context3.logger.info(`Wrote IR to ${irOutputFilePath}`);
|
|
985506
986786
|
});
|
|
@@ -985557,7 +986837,7 @@ async function getIntermediateRepresentation2({
|
|
|
985557
986837
|
// src/commands/generate-openapi-fdr/generateOpenApiToFdrApiDefinitionForWorkspaces.ts
|
|
985558
986838
|
init_lib67();
|
|
985559
986839
|
init_lib8();
|
|
985560
|
-
var
|
|
986840
|
+
var import_path117 = __toESM(require("path"), 1);
|
|
985561
986841
|
async function generateOpenApiToFdrApiDefinitionForWorkspaces({
|
|
985562
986842
|
project,
|
|
985563
986843
|
outputFilepath,
|
|
@@ -985568,7 +986848,7 @@ async function generateOpenApiToFdrApiDefinitionForWorkspaces({
|
|
|
985568
986848
|
project.apiWorkspaces.map(async (workspace) => {
|
|
985569
986849
|
await cliContext.runTaskForWorkspace(workspace, async (context3) => {
|
|
985570
986850
|
const fdrApiDefinition = await generateFdrFromOpenApiWorkspaceV3(workspace, context3, audiences);
|
|
985571
|
-
const resolvedOutputFilePath = AbsoluteFilePath2.of(
|
|
986851
|
+
const resolvedOutputFilePath = AbsoluteFilePath2.of(import_path117.default.resolve(outputFilepath));
|
|
985572
986852
|
await streamObjectToFile(resolvedOutputFilePath, fdrApiDefinition, { pretty: true });
|
|
985573
986853
|
context3.logger.info(`Wrote FDR API definition to ${resolvedOutputFilePath}`);
|
|
985574
986854
|
});
|
|
@@ -985581,7 +986861,7 @@ init_lib8();
|
|
|
985581
986861
|
init_lib35();
|
|
985582
986862
|
init_lib13();
|
|
985583
986863
|
init_lib16();
|
|
985584
|
-
var
|
|
986864
|
+
var import_path118 = __toESM(require("path"), 1);
|
|
985585
986865
|
async function generateOpenAPIIrForWorkspaces({
|
|
985586
986866
|
project,
|
|
985587
986867
|
irFilepath,
|
|
@@ -985603,7 +986883,7 @@ async function generateOpenAPIIrForWorkspaces({
|
|
|
985603
986883
|
context: context3,
|
|
985604
986884
|
documents: await openAPILoader.loadDocuments({ context: context3, specs: openAPISpecs })
|
|
985605
986885
|
});
|
|
985606
|
-
const irOutputFilePath = AbsoluteFilePath2.of(
|
|
986886
|
+
const irOutputFilePath = AbsoluteFilePath2.of(import_path118.default.resolve(irFilepath));
|
|
985607
986887
|
const openApiIrJson = serialization_exports5.OpenApiIntermediateRepresentation.jsonOrThrow(openAPIIr, {
|
|
985608
986888
|
skipValidation: true
|
|
985609
986889
|
});
|
|
@@ -985617,7 +986897,7 @@ async function generateOpenAPIIrForWorkspaces({
|
|
|
985617
986897
|
// src/commands/generate-overrides/compareOpenAPISpecs.ts
|
|
985618
986898
|
init_lib8();
|
|
985619
986899
|
init_lib6();
|
|
985620
|
-
var
|
|
986900
|
+
var import_promises206 = require("fs/promises");
|
|
985621
986901
|
init_js_yaml();
|
|
985622
986902
|
async function compareOpenAPISpecs({
|
|
985623
986903
|
originalPath,
|
|
@@ -985659,12 +986939,12 @@ async function compareOpenAPISpecs({
|
|
|
985659
986939
|
}
|
|
985660
986940
|
outputPath = join8(dirname6(originalPath), RelativeFilePath2.of(overridesFilename));
|
|
985661
986941
|
}
|
|
985662
|
-
await (0,
|
|
986942
|
+
await (0, import_promises206.writeFile)(outputPath, index_vite_proxy_tmp_default.dump(overrides, { lineWidth: -1, noRefs: true }));
|
|
985663
986943
|
context3.logger.info(`Overrides written to ${outputPath}`);
|
|
985664
986944
|
});
|
|
985665
986945
|
}
|
|
985666
986946
|
async function loadSpec2(filepath, context3) {
|
|
985667
|
-
const contents = await (0,
|
|
986947
|
+
const contents = await (0, import_promises206.readFile)(filepath, "utf8");
|
|
985668
986948
|
try {
|
|
985669
986949
|
return JSON.parse(contents);
|
|
985670
986950
|
} catch {
|
|
@@ -985772,7 +987052,7 @@ init_lib35();
|
|
|
985772
987052
|
init_lib16();
|
|
985773
987053
|
init_lib15();
|
|
985774
987054
|
init_lib6();
|
|
985775
|
-
var
|
|
987055
|
+
var import_promises207 = require("fs/promises");
|
|
985776
987056
|
init_js_yaml();
|
|
985777
987057
|
async function writeOverridesForWorkspaces({
|
|
985778
987058
|
project,
|
|
@@ -985798,7 +987078,7 @@ async function writeOverridesForWorkspaces({
|
|
|
985798
987078
|
async function readExistingOverrides(overridesFilepath, context3) {
|
|
985799
987079
|
let parsedOverrides = null;
|
|
985800
987080
|
try {
|
|
985801
|
-
const contents = (await (0,
|
|
987081
|
+
const contents = (await (0, import_promises207.readFile)(overridesFilepath, "utf8")).toString();
|
|
985802
987082
|
try {
|
|
985803
987083
|
parsedOverrides = JSON.parse(contents);
|
|
985804
987084
|
} catch (err) {
|
|
@@ -985863,7 +987143,7 @@ async function writeDefinitionForOpenAPIWorkspace({
|
|
|
985863
987143
|
for (const overridesPath of overridesPaths) {
|
|
985864
987144
|
const existingOverrides = await readExistingOverrides(overridesPath, context3);
|
|
985865
987145
|
const content5 = generateOverridesContent({ ir: ir3, existingOverrides, includeModels, context: context3 });
|
|
985866
|
-
await (0,
|
|
987146
|
+
await (0, import_promises207.writeFile)(overridesPath, index_vite_proxy_tmp_default.dump(content5));
|
|
985867
987147
|
}
|
|
985868
987148
|
} else {
|
|
985869
987149
|
const content5 = generateOverridesContent({ ir: ir3, existingOverrides: {}, includeModels, context: context3 });
|
|
@@ -985877,7 +987157,7 @@ async function writeDefinitionForOpenAPIWorkspace({
|
|
|
985877
987157
|
overridesFilename = `${nameWithoutExt}-overrides${extension4}`;
|
|
985878
987158
|
}
|
|
985879
987159
|
}
|
|
985880
|
-
await (0,
|
|
987160
|
+
await (0, import_promises207.writeFile)(
|
|
985881
987161
|
join8(dirname6(spec.absoluteFilepath), RelativeFilePath2.of(overridesFilename)),
|
|
985882
987162
|
index_vite_proxy_tmp_default.dump(content5)
|
|
985883
987163
|
);
|
|
@@ -986336,7 +987616,7 @@ function convertIRtoJsonSchema(args) {
|
|
|
986336
987616
|
// src/commands/jsonschema/generateJsonschemaForWorkspace.ts
|
|
986337
987617
|
init_lib21();
|
|
986338
987618
|
init_source();
|
|
986339
|
-
var
|
|
987619
|
+
var import_promises208 = require("fs/promises");
|
|
986340
987620
|
async function generateJsonschemaForWorkspaces({
|
|
986341
987621
|
typeLocator,
|
|
986342
987622
|
project,
|
|
@@ -986384,9 +987664,9 @@ async function generateJsonschemaForWorkspaces({
|
|
|
986384
987664
|
context: context3
|
|
986385
987665
|
});
|
|
986386
987666
|
if (!await doesPathExist(dirname6(jsonschemaFilepath))) {
|
|
986387
|
-
await (0,
|
|
987667
|
+
await (0, import_promises208.mkdir)(dirname6(jsonschemaFilepath), { recursive: true });
|
|
986388
987668
|
}
|
|
986389
|
-
await (0,
|
|
987669
|
+
await (0, import_promises208.writeFile)(jsonschemaFilepath, JSON.stringify(jsonSchema, null, 2));
|
|
986390
987670
|
context3.logger.info(source_default.green(`Wrote JSON Schema to ${jsonschemaFilepath}`));
|
|
986391
987671
|
});
|
|
986392
987672
|
})
|
|
@@ -986396,7 +987676,7 @@ async function generateJsonschemaForWorkspaces({
|
|
|
986396
987676
|
// src/commands/merge/mergeOpenAPIWithOverrides.ts
|
|
986397
987677
|
init_lib8();
|
|
986398
987678
|
init_lib6();
|
|
986399
|
-
var
|
|
987679
|
+
var import_promises209 = require("fs/promises");
|
|
986400
987680
|
init_js_yaml();
|
|
986401
987681
|
var HTTP_METHODS4 = /* @__PURE__ */ new Set(["get", "put", "post", "delete", "options", "head", "patch", "trace"]);
|
|
986402
987682
|
async function mergeOpenAPIWithOverrides({
|
|
@@ -986425,11 +987705,11 @@ async function mergeOpenAPIWithOverrides({
|
|
|
986425
987705
|
if (split2) {
|
|
986426
987706
|
const examples = extractEnrichedExamples2(openapi, merged);
|
|
986427
987707
|
const output2 = isJson ? JSON.stringify(examples, null, 2) : index_vite_proxy_tmp_default.dump(examples, { lineWidth: -1, noRefs: true });
|
|
986428
|
-
await (0,
|
|
987708
|
+
await (0, import_promises209.writeFile)(outputPath, output2);
|
|
986429
987709
|
context3.logger.info(`Extracted enriched examples written to ${outputPath}`);
|
|
986430
987710
|
} else {
|
|
986431
987711
|
const output2 = isJson ? JSON.stringify(merged, null, 2) : index_vite_proxy_tmp_default.dump(merged, { lineWidth: -1, noRefs: true });
|
|
986432
|
-
await (0,
|
|
987712
|
+
await (0, import_promises209.writeFile)(outputPath, output2);
|
|
986433
987713
|
if (outputPath === openapiPath) {
|
|
986434
987714
|
context3.logger.info(`Enriched ${openapiPath} in-place`);
|
|
986435
987715
|
} else {
|
|
@@ -986439,7 +987719,7 @@ async function mergeOpenAPIWithOverrides({
|
|
|
986439
987719
|
});
|
|
986440
987720
|
}
|
|
986441
987721
|
async function loadYamlOrJson(filepath, context3) {
|
|
986442
|
-
const contents = await (0,
|
|
987722
|
+
const contents = await (0, import_promises209.readFile)(filepath, "utf8");
|
|
986443
987723
|
try {
|
|
986444
987724
|
return JSON.parse(contents);
|
|
986445
987725
|
} catch {
|
|
@@ -987234,8 +988514,8 @@ init_lib35();
|
|
|
987234
988514
|
init_lib6();
|
|
987235
988515
|
init_esm19();
|
|
987236
988516
|
init_axios2();
|
|
987237
|
-
var
|
|
987238
|
-
var
|
|
988517
|
+
var import_promises210 = require("fs/promises");
|
|
988518
|
+
var import_path119 = __toESM(require("path"), 1);
|
|
987239
988519
|
init_index_min2();
|
|
987240
988520
|
var import_tmp_promise21 = __toESM(require_tmp_promise(), 1);
|
|
987241
988521
|
async function registerWorkspacesV1({
|
|
@@ -987284,11 +988564,11 @@ async function registerWorkspacesV1({
|
|
|
987284
988564
|
return;
|
|
987285
988565
|
}
|
|
987286
988566
|
const tmpDir = await import_tmp_promise21.default.dir();
|
|
987287
|
-
const tarPath =
|
|
988567
|
+
const tarPath = import_path119.default.join(tmpDir.path, "definition.tgz");
|
|
987288
988568
|
context3.logger.debug(`Compressing definition at ${tmpDir.path}`);
|
|
987289
988569
|
await Kn({ file: tarPath, cwd: resolvedWorkspace.absoluteFilePath }, ["."]);
|
|
987290
988570
|
context3.logger.info("Uploading definition...");
|
|
987291
|
-
await axios_default.put(registerApiResponse.body.definitionS3UploadUrl, await (0,
|
|
988571
|
+
await axios_default.put(registerApiResponse.body.definitionS3UploadUrl, await (0, import_promises210.readFile)(tarPath));
|
|
987292
988572
|
context3.logger.info(
|
|
987293
988573
|
`Registered @${project.config.organization}/${resolvedWorkspace.definition.rootApiFile.contents.name}:${registerApiResponse.body.version}`
|
|
987294
988574
|
);
|
|
@@ -987345,8 +988625,8 @@ function getAIEnhancerConfig2() {
|
|
|
987345
988625
|
// src/commands/resolve-specs/resolveSpecsForWorkspaces.ts
|
|
987346
988626
|
init_lib8();
|
|
987347
988627
|
init_lib35();
|
|
987348
|
-
var
|
|
987349
|
-
var
|
|
988628
|
+
var import_promises211 = require("fs/promises");
|
|
988629
|
+
var import_path120 = __toESM(require("path"), 1);
|
|
987350
988630
|
async function resolveSpecsForWorkspaces({
|
|
987351
988631
|
project,
|
|
987352
988632
|
outputDir,
|
|
@@ -987364,16 +988644,16 @@ async function resolveSpecsForWorkspaces({
|
|
|
987364
988644
|
context3.logger.info("No specs found.");
|
|
987365
988645
|
return;
|
|
987366
988646
|
}
|
|
987367
|
-
const workspaceOutputDir = project.apiWorkspaces.length > 1 ? AbsoluteFilePath2.of(
|
|
987368
|
-
await (0,
|
|
988647
|
+
const workspaceOutputDir = project.apiWorkspaces.length > 1 ? AbsoluteFilePath2.of(import_path120.default.join(outputDir, workspace.workspaceName ?? "api")) : outputDir;
|
|
988648
|
+
await (0, import_promises211.mkdir)(workspaceOutputDir, { recursive: true });
|
|
987369
988649
|
const manifest = await collectRawSpecs({
|
|
987370
988650
|
specs,
|
|
987371
988651
|
hostOutputDir: workspaceOutputDir,
|
|
987372
988652
|
containerBaseDir: ".",
|
|
987373
988653
|
context: context3
|
|
987374
988654
|
});
|
|
987375
|
-
await (0,
|
|
987376
|
-
|
|
988655
|
+
await (0, import_promises211.writeFile)(
|
|
988656
|
+
import_path120.default.join(workspaceOutputDir, SPECS_MANIFEST_FILENAME),
|
|
987377
988657
|
JSON.stringify(manifest, void 0, 4)
|
|
987378
988658
|
);
|
|
987379
988659
|
context3.logger.info(`Resolved ${manifest.specs.length} spec(s) to ${workspaceOutputDir}`);
|
|
@@ -987582,7 +988862,7 @@ init_lib17();
|
|
|
987582
988862
|
init_lib19();
|
|
987583
988863
|
init_lib8();
|
|
987584
988864
|
init_lib6();
|
|
987585
|
-
var
|
|
988865
|
+
var import_promises212 = __toESM(require("fs/promises"), 1);
|
|
987586
988866
|
|
|
987587
988867
|
// src/commands/sdk-preview/computePreviewVersion.ts
|
|
987588
988868
|
var BASE_VERSION = "0.0.1";
|
|
@@ -987702,7 +988982,7 @@ async function sdkPreview({
|
|
|
987702
988982
|
const firstPath = pathOutputs[0];
|
|
987703
988983
|
const absolutePathToOutput = firstPath != null ? AbsoluteFilePath2.of(resolve6(cwd(), firstPath)) : void 0;
|
|
987704
988984
|
if (absolutePathToOutput != null) {
|
|
987705
|
-
await
|
|
988985
|
+
await import_promises212.default.mkdir(absolutePathToOutput, { recursive: true });
|
|
987706
988986
|
}
|
|
987707
988987
|
for (const workspace of project.apiWorkspaces) {
|
|
987708
988988
|
if (workspace.generatorsConfiguration == null) {
|
|
@@ -987892,8 +989172,8 @@ async function sdkPreview({
|
|
|
987892
989172
|
init_lib33();
|
|
987893
989173
|
init_lib6();
|
|
987894
989174
|
init_source();
|
|
987895
|
-
var
|
|
987896
|
-
var
|
|
989175
|
+
var import_promises213 = require("fs/promises");
|
|
989176
|
+
var import_path121 = require("path");
|
|
987897
989177
|
async function getPackageManagerBinDir(logger4, pm) {
|
|
987898
989178
|
let command3;
|
|
987899
989179
|
let args;
|
|
@@ -987938,7 +989218,7 @@ async function detectInstallationMethod(logger4) {
|
|
|
987938
989218
|
logger4.debug(`Found fern at: ${fernPath}`);
|
|
987939
989219
|
let resolvedPath;
|
|
987940
989220
|
try {
|
|
987941
|
-
resolvedPath = await (0,
|
|
989221
|
+
resolvedPath = await (0, import_promises213.realpath)(fernPath);
|
|
987942
989222
|
logger4.debug(`Resolved to: ${resolvedPath}`);
|
|
987943
989223
|
} catch (error50) {
|
|
987944
989224
|
logger4.debug(`Failed to resolve symlink: ${error50}`);
|
|
@@ -987972,16 +989252,16 @@ async function detectInstallationMethod(logger4) {
|
|
|
987972
989252
|
}
|
|
987973
989253
|
}
|
|
987974
989254
|
}
|
|
987975
|
-
const fernDir = (0,
|
|
989255
|
+
const fernDir = (0, import_path121.dirname)(resolvedPath);
|
|
987976
989256
|
logger4.debug(`fern directory: ${fernDir}`);
|
|
987977
989257
|
const packageManagers = ["pnpm", "yarn", "bun", "npm"];
|
|
987978
989258
|
for (const pm of packageManagers) {
|
|
987979
989259
|
const binDir = await getPackageManagerBinDir(logger4, pm);
|
|
987980
989260
|
if (binDir != null) {
|
|
987981
989261
|
logger4.debug(`${pm} bin dir: ${binDir}`);
|
|
987982
|
-
const normalizedFernDir = (0,
|
|
987983
|
-
const normalizedBinDir = (0,
|
|
987984
|
-
if (normalizedFernDir === normalizedBinDir || normalizedFernDir.startsWith(normalizedBinDir +
|
|
989262
|
+
const normalizedFernDir = (0, import_path121.normalize)(fernDir);
|
|
989263
|
+
const normalizedBinDir = (0, import_path121.normalize)(binDir);
|
|
989264
|
+
if (normalizedFernDir === normalizedBinDir || normalizedFernDir.startsWith(normalizedBinDir + import_path121.sep) || normalizedFernDir.startsWith(normalizedBinDir + "/") || normalizedFernDir.startsWith(normalizedBinDir + "\\")) {
|
|
987985
989265
|
return {
|
|
987986
989266
|
type: pm,
|
|
987987
989267
|
command: pm,
|
|
@@ -987991,8 +989271,8 @@ async function detectInstallationMethod(logger4) {
|
|
|
987991
989271
|
}
|
|
987992
989272
|
}
|
|
987993
989273
|
}
|
|
987994
|
-
const normalizedPath = (0,
|
|
987995
|
-
if (normalizedPath.includes(".pnpm") || normalizedPath.includes("pnpm-global") || normalizedPath.includes(`${
|
|
989274
|
+
const normalizedPath = (0, import_path121.normalize)(resolvedPath);
|
|
989275
|
+
if (normalizedPath.includes(".pnpm") || normalizedPath.includes("pnpm-global") || normalizedPath.includes(`${import_path121.sep}pnpm${import_path121.sep}`) || normalizedPath.includes("/pnpm/") || normalizedPath.includes("\\pnpm\\")) {
|
|
987996
989276
|
return {
|
|
987997
989277
|
type: "pnpm",
|
|
987998
989278
|
command: "pnpm",
|
|
@@ -988000,7 +989280,7 @@ async function detectInstallationMethod(logger4) {
|
|
|
988000
989280
|
resolvedPath
|
|
988001
989281
|
};
|
|
988002
989282
|
}
|
|
988003
|
-
if (normalizedPath.includes(`${
|
|
989283
|
+
if (normalizedPath.includes(`${import_path121.sep}.yarn${import_path121.sep}`) || normalizedPath.includes(`${import_path121.sep}yarn${import_path121.sep}`) || normalizedPath.includes("/.yarn/") || normalizedPath.includes("/yarn/") || normalizedPath.includes("\\.yarn\\") || normalizedPath.includes("\\yarn\\")) {
|
|
988004
989284
|
return {
|
|
988005
989285
|
type: "yarn",
|
|
988006
989286
|
command: "yarn",
|
|
@@ -988008,7 +989288,7 @@ async function detectInstallationMethod(logger4) {
|
|
|
988008
989288
|
resolvedPath
|
|
988009
989289
|
};
|
|
988010
989290
|
}
|
|
988011
|
-
if (normalizedPath.includes(`${
|
|
989291
|
+
if (normalizedPath.includes(`${import_path121.sep}.bun${import_path121.sep}`) || normalizedPath.includes(`${import_path121.sep}bun${import_path121.sep}`) || normalizedPath.includes("/.bun/") || normalizedPath.includes("/bun/") || normalizedPath.includes("\\.bun\\") || normalizedPath.includes("\\bun\\")) {
|
|
988012
989292
|
return {
|
|
988013
989293
|
type: "bun",
|
|
988014
989294
|
command: "bun",
|
|
@@ -988016,7 +989296,7 @@ async function detectInstallationMethod(logger4) {
|
|
|
988016
989296
|
resolvedPath
|
|
988017
989297
|
};
|
|
988018
989298
|
}
|
|
988019
|
-
if (normalizedPath.includes(`${
|
|
989299
|
+
if (normalizedPath.includes(`${import_path121.sep}lib${import_path121.sep}node_modules${import_path121.sep}`) || normalizedPath.includes(`${import_path121.sep}node_modules${import_path121.sep}`) || normalizedPath.includes("/lib/node_modules/") || normalizedPath.includes("/node_modules/") || normalizedPath.includes("\\lib\\node_modules\\") || normalizedPath.includes("\\node_modules\\")) {
|
|
988020
989300
|
return {
|
|
988021
989301
|
type: "npm",
|
|
988022
989302
|
command: "npm",
|
|
@@ -988030,7 +989310,7 @@ async function detectInstallationMethod(logger4) {
|
|
|
988030
989310
|
}
|
|
988031
989311
|
logger4.debug(` - Package manager bin directories checked: pnpm, yarn, bun, npm (none matched)`);
|
|
988032
989312
|
logger4.debug(
|
|
988033
|
-
` - Path patterns checked: .pnpm, pnpm-global, ${
|
|
989313
|
+
` - Path patterns checked: .pnpm, pnpm-global, ${import_path121.sep}pnpm${import_path121.sep}, .yarn, ${import_path121.sep}yarn${import_path121.sep}, .bun, ${import_path121.sep}bun${import_path121.sep}, ${import_path121.sep}node_modules${import_path121.sep}`
|
|
988034
989314
|
);
|
|
988035
989315
|
logger4.debug(` - Resolved path: ${resolvedPath}`);
|
|
988036
989316
|
logger4.debug(` - Directory: ${fernDir}`);
|
|
@@ -988252,22 +989532,22 @@ init_lib19();
|
|
|
988252
989532
|
init_lib8();
|
|
988253
989533
|
init_lib6();
|
|
988254
989534
|
var fs33 = __toESM(require("fs"), 1);
|
|
988255
|
-
var
|
|
989535
|
+
var import_promises214 = require("fs/promises");
|
|
988256
989536
|
init_graphql();
|
|
988257
989537
|
init_js_yaml();
|
|
988258
989538
|
var import_stream18 = require("stream");
|
|
988259
|
-
var
|
|
989539
|
+
var import_promises215 = require("stream/promises");
|
|
988260
989540
|
async function fetchAndWriteFile(url3, path120, logger4, indent4) {
|
|
988261
989541
|
const resp = await fetch(url3);
|
|
988262
989542
|
if (resp.ok && resp.body) {
|
|
988263
989543
|
logger4.debug("Origin successfully fetched, writing to file");
|
|
988264
989544
|
const fileStream = fs33.createWriteStream(path120);
|
|
988265
|
-
await (0,
|
|
988266
|
-
const fileContents = await (0,
|
|
989545
|
+
await (0, import_promises215.finished)(import_stream18.Readable.fromWeb(resp.body).pipe(fileStream));
|
|
989546
|
+
const fileContents = await (0, import_promises214.readFile)(path120, "utf8");
|
|
988267
989547
|
try {
|
|
988268
|
-
await (0,
|
|
989548
|
+
await (0, import_promises214.writeFile)(path120, JSON.stringify(JSON.parse(fileContents), void 0, indent4), "utf8");
|
|
988269
989549
|
} catch (e2) {
|
|
988270
|
-
await (0,
|
|
989550
|
+
await (0, import_promises214.writeFile)(path120, index_vite_proxy_tmp_default.dump(index_vite_proxy_tmp_default.load(fileContents), { indent: indent4 }), "utf8");
|
|
988271
989551
|
}
|
|
988272
989552
|
logger4.debug("File written successfully");
|
|
988273
989553
|
}
|
|
@@ -988423,14 +989703,14 @@ async function tryDirectJSONFetch(url3, logger4) {
|
|
|
988423
989703
|
async function fetchGraphQLSchemaWithAutoDetection(url3, path120, logger4) {
|
|
988424
989704
|
const postResult = await tryGraphQLIntrospection(url3, logger4);
|
|
988425
989705
|
if (postResult.success) {
|
|
988426
|
-
await (0,
|
|
989706
|
+
await (0, import_promises214.writeFile)(path120, postResult.result, "utf8");
|
|
988427
989707
|
logger4.info("Successfully fetched GraphQL schema using POST introspection");
|
|
988428
989708
|
return;
|
|
988429
989709
|
}
|
|
988430
989710
|
logger4.debug(`POST introspection failed: ${postResult.error}`);
|
|
988431
989711
|
const getResult = await tryDirectJSONFetch(url3, logger4);
|
|
988432
989712
|
if (getResult.success) {
|
|
988433
|
-
await (0,
|
|
989713
|
+
await (0, import_promises214.writeFile)(path120, getResult.result, "utf8");
|
|
988434
989714
|
logger4.info("Successfully fetched GraphQL schema using direct JSON fetch");
|
|
988435
989715
|
return;
|
|
988436
989716
|
}
|
|
@@ -988577,9 +989857,9 @@ async function validateDocsBrokenLinks({
|
|
|
988577
989857
|
init_lib19();
|
|
988578
989858
|
init_lib64();
|
|
988579
989859
|
init_source();
|
|
988580
|
-
var
|
|
989860
|
+
var import_fs43 = require("fs");
|
|
988581
989861
|
var import_gray_matter12 = __toESM(require_gray_matter(), 1);
|
|
988582
|
-
var
|
|
989862
|
+
var import_path122 = __toESM(require("path"), 1);
|
|
988583
989863
|
function calculateVisualColumn(text9, charIndex, tabWidth = 4) {
|
|
988584
989864
|
let visualColumn = 0;
|
|
988585
989865
|
for (let i5 = 0; i5 < Math.min(charIndex, text9.length); i5++) {
|
|
@@ -988601,7 +989881,7 @@ var MdxValidationError = class {
|
|
|
988601
989881
|
column;
|
|
988602
989882
|
contextLines;
|
|
988603
989883
|
toString() {
|
|
988604
|
-
const relativePath =
|
|
989884
|
+
const relativePath = import_path122.default.relative(process.cwd(), this.filepath);
|
|
988605
989885
|
let formatted = source_default.red(` ${relativePath}`);
|
|
988606
989886
|
if (this.line != null) {
|
|
988607
989887
|
formatted += source_default.yellow(`:${this.line}`);
|
|
@@ -988653,7 +989933,7 @@ async function validateMdxFiles({
|
|
|
988653
989933
|
});
|
|
988654
989934
|
const filesToCheck = Array.from(new Set(allPages));
|
|
988655
989935
|
for (const filepath of filesToCheck) {
|
|
988656
|
-
const content5 = (0,
|
|
989936
|
+
const content5 = (0, import_fs43.readFileSync)(filepath, "utf-8");
|
|
988657
989937
|
try {
|
|
988658
989938
|
parseMarkdownToTree(content5);
|
|
988659
989939
|
} catch (error50) {
|
|
@@ -989140,9 +990420,9 @@ async function validateWorkspaces({
|
|
|
989140
990420
|
init_lib19();
|
|
989141
990421
|
init_lib8();
|
|
989142
990422
|
init_source();
|
|
989143
|
-
var
|
|
990423
|
+
var import_promises216 = require("fs/promises");
|
|
989144
990424
|
init_js_yaml();
|
|
989145
|
-
var
|
|
990425
|
+
var import_path123 = __toESM(require("path"), 1);
|
|
989146
990426
|
async function writeDefinitionForWorkspaces({
|
|
989147
990427
|
project,
|
|
989148
990428
|
cliContext,
|
|
@@ -989180,7 +990460,7 @@ async function writeDefinitionForFernWorkspace({
|
|
|
989180
990460
|
absolutePathToOutputDirectory
|
|
989181
990461
|
});
|
|
989182
990462
|
context3.logger.info(
|
|
989183
|
-
source_default.green(`Wrote imported definition at ${
|
|
990463
|
+
source_default.green(`Wrote imported definition at ${import_path123.default.relative(process.cwd(), absolutePathToOutputDirectory)}`)
|
|
989184
990464
|
);
|
|
989185
990465
|
}
|
|
989186
990466
|
}
|
|
@@ -989197,7 +990477,7 @@ async function writeDefinitionForNonFernWorkspace({
|
|
|
989197
990477
|
absolutePathToOutputDirectory
|
|
989198
990478
|
});
|
|
989199
990479
|
context3.logger.info(
|
|
989200
|
-
source_default.green(`Wrote definition to ${
|
|
990480
|
+
source_default.green(`Wrote definition to ${import_path123.default.relative(process.cwd(), absolutePathToOutputDirectory)}`)
|
|
989201
990481
|
);
|
|
989202
990482
|
}
|
|
989203
990483
|
async function writeFernDefinition({
|
|
@@ -989222,22 +990502,22 @@ async function writeFernDefinition({
|
|
|
989222
990502
|
return a3.localeCompare(b5);
|
|
989223
990503
|
};
|
|
989224
990504
|
if (await doesPathExist(absolutePathToOutputDirectory)) {
|
|
989225
|
-
await (0,
|
|
990505
|
+
await (0, import_promises216.rm)(absolutePathToOutputDirectory, { recursive: true });
|
|
989226
990506
|
}
|
|
989227
|
-
await (0,
|
|
989228
|
-
await (0,
|
|
990507
|
+
await (0, import_promises216.mkdir)(absolutePathToOutputDirectory, { recursive: true });
|
|
990508
|
+
await (0, import_promises216.writeFile)(
|
|
989229
990509
|
join8(absolutePathToOutputDirectory, RelativeFilePath2.of(ROOT_API_FILENAME)),
|
|
989230
990510
|
index_vite_proxy_tmp_default.dump(definition3.rootApiFile.contents, { sortKeys })
|
|
989231
990511
|
);
|
|
989232
990512
|
for (const [relativePath, packageMarker] of Object.entries(definition3.packageMarkers)) {
|
|
989233
990513
|
const absoluteFilepath = join8(absolutePathToOutputDirectory, RelativeFilePath2.of(relativePath));
|
|
989234
|
-
await (0,
|
|
989235
|
-
await (0,
|
|
990514
|
+
await (0, import_promises216.mkdir)(dirname6(absoluteFilepath), { recursive: true });
|
|
990515
|
+
await (0, import_promises216.writeFile)(absoluteFilepath, index_vite_proxy_tmp_default.dump(packageMarker.contents, { sortKeys }));
|
|
989236
990516
|
}
|
|
989237
990517
|
for (const [relativePath, definitionFile] of Object.entries(definition3.namedDefinitionFiles)) {
|
|
989238
990518
|
const absoluteFilepath = join8(absolutePathToOutputDirectory, RelativeFilePath2.of(relativePath));
|
|
989239
|
-
await (0,
|
|
989240
|
-
await (0,
|
|
990519
|
+
await (0, import_promises216.mkdir)(dirname6(absoluteFilepath), { recursive: true });
|
|
990520
|
+
await (0, import_promises216.writeFile)(absoluteFilepath, index_vite_proxy_tmp_default.dump(definitionFile.contents, { sortKeys }));
|
|
989241
990521
|
}
|
|
989242
990522
|
}
|
|
989243
990523
|
|
|
@@ -989245,7 +990525,7 @@ async function writeFernDefinition({
|
|
|
989245
990525
|
init_lib67();
|
|
989246
990526
|
init_lib8();
|
|
989247
990527
|
init_source();
|
|
989248
|
-
var
|
|
990528
|
+
var import_promises217 = require("fs/promises");
|
|
989249
990529
|
async function writeDocsDefinitionForProject({
|
|
989250
990530
|
project,
|
|
989251
990531
|
outputPath,
|
|
@@ -989277,7 +990557,7 @@ async function writeDocsDefinitionForProject({
|
|
|
989277
990557
|
targetAudiences: docsWorkspace.config.instances[0]?.audiences ? Array.isArray(docsWorkspace.config.instances[0].audiences) ? docsWorkspace.config.instances[0].audiences : [docsWorkspace.config.instances[0].audiences] : void 0
|
|
989278
990558
|
});
|
|
989279
990559
|
const docsDefinition = await docsResolver.resolve();
|
|
989280
|
-
await (0,
|
|
990560
|
+
await (0, import_promises217.writeFile)(AbsoluteFilePath2.of(outputPath), JSON.stringify(docsDefinition, null, 2));
|
|
989281
990561
|
context3.logger.info(source_default.green(`Docs definition written to ${outputPath}`));
|
|
989282
990562
|
});
|
|
989283
990563
|
}
|
|
@@ -990065,6 +991345,14 @@ function addGenerateCommand3(cli, cliContext) {
|
|
|
990065
991345
|
boolean: true,
|
|
990066
991346
|
default: false,
|
|
990067
991347
|
description: "Generate test files even when generating to a local file system (tests are normally only generated for GitHub output modes)"
|
|
991348
|
+
}).option("pack", {
|
|
991349
|
+
boolean: true,
|
|
991350
|
+
default: false,
|
|
991351
|
+
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."
|
|
991352
|
+
}).option("pack-mode", {
|
|
991353
|
+
choices: ["host", "docker"],
|
|
991354
|
+
default: "host",
|
|
991355
|
+
description: "Where --pack runs the packaging toolchain: 'host' uses toolchains installed on this machine; 'docker' runs each toolchain inside an official Docker image (node, python, gradle, dotnet/sdk, ruby, composer, rust) with the output directory mounted, so no local toolchains are needed."
|
|
990068
991356
|
}),
|
|
990069
991357
|
async (argv) => {
|
|
990070
991358
|
if (argv.api != null && argv.api.length > 0 && argv.docs != null) {
|
|
@@ -990140,6 +991428,23 @@ function addGenerateCommand3(cli, cliContext) {
|
|
|
990140
991428
|
{ code: CliError.Code.ConfigError }
|
|
990141
991429
|
);
|
|
990142
991430
|
}
|
|
991431
|
+
if (argv.pack && argv.preview) {
|
|
991432
|
+
return cliContext.failWithoutThrowing("The --pack flag cannot be used with --preview.", void 0, {
|
|
991433
|
+
code: CliError.Code.ConfigError
|
|
991434
|
+
});
|
|
991435
|
+
}
|
|
991436
|
+
if (argv.pack && argv.docs != null) {
|
|
991437
|
+
return cliContext.failWithoutThrowing(
|
|
991438
|
+
"The --pack flag can only be used for API generation, not docs generation.",
|
|
991439
|
+
void 0,
|
|
991440
|
+
{ code: CliError.Code.ConfigError }
|
|
991441
|
+
);
|
|
991442
|
+
}
|
|
991443
|
+
if (argv.packMode !== "host" && !argv.pack) {
|
|
991444
|
+
return cliContext.failWithoutThrowing("The --pack-mode flag can only be used with --pack.", void 0, {
|
|
991445
|
+
code: CliError.Code.ConfigError
|
|
991446
|
+
});
|
|
991447
|
+
}
|
|
990143
991448
|
if (argv.output != null && argv.docs != null) {
|
|
990144
991449
|
return cliContext.failWithoutThrowing(
|
|
990145
991450
|
"The --output flag is not supported for docs generation.",
|
|
@@ -990178,7 +991483,9 @@ function addGenerateCommand3(cli, cliContext) {
|
|
|
990178
991483
|
retryRateLimited: argv["retry-rate-limited"],
|
|
990179
991484
|
requireEnvVars: argv["require-env-vars"],
|
|
990180
991485
|
skipIfNoDiff: argv["skip-if-no-diff"],
|
|
990181
|
-
generateTests: argv["generate-tests"]
|
|
991486
|
+
generateTests: argv["generate-tests"],
|
|
991487
|
+
pack: argv.pack,
|
|
991488
|
+
packMode: argv.packMode
|
|
990182
991489
|
});
|
|
990183
991490
|
}
|
|
990184
991491
|
if (argv.docs != null) {
|
|
@@ -990240,7 +991547,9 @@ function addGenerateCommand3(cli, cliContext) {
|
|
|
990240
991547
|
retryRateLimited: argv["retry-rate-limited"],
|
|
990241
991548
|
requireEnvVars: argv["require-env-vars"],
|
|
990242
991549
|
skipIfNoDiff: argv["skip-if-no-diff"],
|
|
990243
|
-
generateTests: argv["generate-tests"]
|
|
991550
|
+
generateTests: argv["generate-tests"],
|
|
991551
|
+
pack: argv.pack,
|
|
991552
|
+
packMode: argv.packMode
|
|
990244
991553
|
});
|
|
990245
991554
|
}
|
|
990246
991555
|
);
|