fern-api 0.36.0-rc0 → 0.36.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/bundle.cjs +259 -192
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -33190,7 +33190,7 @@ var require_agent = __commonJS({
|
|
|
33190
33190
|
var { Socket } = require("net");
|
|
33191
33191
|
var { Duplex } = require("stream");
|
|
33192
33192
|
var { resolve: resolve6 } = require("path");
|
|
33193
|
-
var { readFile:
|
|
33193
|
+
var { readFile: readFile46 } = require("fs");
|
|
33194
33194
|
var { execFile, spawn } = require("child_process");
|
|
33195
33195
|
var { isParsedKey, parseKey } = require_keyParser();
|
|
33196
33196
|
var {
|
|
@@ -33408,7 +33408,7 @@ var require_agent = __commonJS({
|
|
|
33408
33408
|
cb = once3(cb);
|
|
33409
33409
|
let socketPath = this.socketPath;
|
|
33410
33410
|
let triedCygpath = false;
|
|
33411
|
-
|
|
33411
|
+
readFile46(socketPath, function readCygsocket(err, data2) {
|
|
33412
33412
|
if (err) {
|
|
33413
33413
|
if (triedCygpath)
|
|
33414
33414
|
return cb(new Error("Invalid cygwin unix socket path"));
|
|
@@ -33417,7 +33417,7 @@ var require_agent = __commonJS({
|
|
|
33417
33417
|
return cb(new Error("Invalid cygwin unix socket path"));
|
|
33418
33418
|
triedCygpath = true;
|
|
33419
33419
|
socketPath = stdout.toString().replace(/[\r\n]/g, "");
|
|
33420
|
-
|
|
33420
|
+
readFile46(socketPath, readCygsocket);
|
|
33421
33421
|
});
|
|
33422
33422
|
return;
|
|
33423
33423
|
}
|
|
@@ -70799,8 +70799,8 @@ var require_graceful_fs = __commonJS({
|
|
|
70799
70799
|
fs11.createReadStream = createReadStream2;
|
|
70800
70800
|
fs11.createWriteStream = createWriteStream7;
|
|
70801
70801
|
var fs$readFile = fs11.readFile;
|
|
70802
|
-
fs11.readFile =
|
|
70803
|
-
function
|
|
70802
|
+
fs11.readFile = readFile46;
|
|
70803
|
+
function readFile46(path44, options2, cb) {
|
|
70804
70804
|
if (typeof options2 === "function")
|
|
70805
70805
|
cb = options2, options2 = null;
|
|
70806
70806
|
return go$readFile(path44, options2, cb);
|
|
@@ -72307,7 +72307,7 @@ var require_jsonfile = __commonJS({
|
|
|
72307
72307
|
}
|
|
72308
72308
|
return obj;
|
|
72309
72309
|
}
|
|
72310
|
-
var
|
|
72310
|
+
var readFile46 = universalify.fromPromise(_readFile);
|
|
72311
72311
|
function readFileSync4(file, options2 = {}) {
|
|
72312
72312
|
if (typeof options2 === "string") {
|
|
72313
72313
|
options2 = { encoding: options2 };
|
|
@@ -72339,7 +72339,7 @@ var require_jsonfile = __commonJS({
|
|
|
72339
72339
|
return fs10.writeFileSync(file, str3, options2);
|
|
72340
72340
|
}
|
|
72341
72341
|
var jsonfile = {
|
|
72342
|
-
readFile:
|
|
72342
|
+
readFile: readFile46,
|
|
72343
72343
|
readFileSync: readFileSync4,
|
|
72344
72344
|
writeFile: writeFile41,
|
|
72345
72345
|
writeFileSync
|
|
@@ -135076,7 +135076,7 @@ ${error.message}`;
|
|
|
135076
135076
|
Object.defineProperty(exports22, "__esModule", {
|
|
135077
135077
|
value: true
|
|
135078
135078
|
});
|
|
135079
|
-
exports22.readFile =
|
|
135079
|
+
exports22.readFile = readFile46;
|
|
135080
135080
|
exports22.readFileSync = readFileSync4;
|
|
135081
135081
|
var _fs = _interopRequireDefault(require("fs"));
|
|
135082
135082
|
function _interopRequireDefault(obj) {
|
|
@@ -135095,7 +135095,7 @@ ${error.message}`;
|
|
|
135095
135095
|
});
|
|
135096
135096
|
});
|
|
135097
135097
|
}
|
|
135098
|
-
async function
|
|
135098
|
+
async function readFile46(filepath, options2 = {}) {
|
|
135099
135099
|
const throwNotFound = options2.throwNotFound === true;
|
|
135100
135100
|
try {
|
|
135101
135101
|
const content5 = await fsReadFileAsync(filepath, "utf8");
|
|
@@ -326616,8 +326616,8 @@ ${error.message}`;
|
|
|
326616
326616
|
cb(null, x2);
|
|
326617
326617
|
}
|
|
326618
326618
|
};
|
|
326619
|
-
var defaultReadPackage = function defaultReadPackage2(
|
|
326620
|
-
|
|
326619
|
+
var defaultReadPackage = function defaultReadPackage2(readFile46, pkgfile, cb) {
|
|
326620
|
+
readFile46(pkgfile, function(readFileErr, body) {
|
|
326621
326621
|
if (readFileErr)
|
|
326622
326622
|
cb(readFileErr);
|
|
326623
326623
|
else {
|
|
@@ -326653,7 +326653,7 @@ ${error.message}`;
|
|
|
326653
326653
|
opts = normalizeOptions(x2, opts);
|
|
326654
326654
|
var isFile2 = opts.isFile || defaultIsFile;
|
|
326655
326655
|
var isDirectory = opts.isDirectory || defaultIsDir;
|
|
326656
|
-
var
|
|
326656
|
+
var readFile46 = opts.readFile || fs10.readFile;
|
|
326657
326657
|
var realpath = opts.realpath || defaultRealpath;
|
|
326658
326658
|
var readPackage = opts.readPackage || defaultReadPackage;
|
|
326659
326659
|
if (opts.readFile && opts.readPackage) {
|
|
@@ -326785,7 +326785,7 @@ ${error.message}`;
|
|
|
326785
326785
|
isFile2(pkgfile, function(err2, ex) {
|
|
326786
326786
|
if (!ex)
|
|
326787
326787
|
return loadpkg(path44.dirname(dir), cb2);
|
|
326788
|
-
readPackage(
|
|
326788
|
+
readPackage(readFile46, pkgfile, function(err3, pkgParam) {
|
|
326789
326789
|
if (err3)
|
|
326790
326790
|
cb2(err3);
|
|
326791
326791
|
var pkg2 = pkgParam;
|
|
@@ -326813,7 +326813,7 @@ ${error.message}`;
|
|
|
326813
326813
|
return cb2(err2);
|
|
326814
326814
|
if (!ex)
|
|
326815
326815
|
return loadAsFile(path44.join(x22, "index"), fpkg, cb2);
|
|
326816
|
-
readPackage(
|
|
326816
|
+
readPackage(readFile46, pkgfile, function(err3, pkgParam) {
|
|
326817
326817
|
if (err3)
|
|
326818
326818
|
return cb2(err3);
|
|
326819
326819
|
var pkg2 = pkgParam;
|
|
@@ -389586,7 +389586,7 @@ var require_parse9 = __commonJS({
|
|
|
389586
389586
|
extension: url.getExtension(path44)
|
|
389587
389587
|
};
|
|
389588
389588
|
try {
|
|
389589
|
-
const resolver3 = await
|
|
389589
|
+
const resolver3 = await readFile46(file, options2, $refs);
|
|
389590
389590
|
$ref.pathType = resolver3.plugin.name;
|
|
389591
389591
|
file.data = resolver3.result;
|
|
389592
389592
|
const parser2 = await parseFile(file, options2, $refs);
|
|
@@ -389599,7 +389599,7 @@ var require_parse9 = __commonJS({
|
|
|
389599
389599
|
throw err;
|
|
389600
389600
|
}
|
|
389601
389601
|
}
|
|
389602
|
-
function
|
|
389602
|
+
function readFile46(file, options2, $refs) {
|
|
389603
389603
|
return new Promise((resolve6, reject2) => {
|
|
389604
389604
|
let resolvers = plugins.all(options2.resolve);
|
|
389605
389605
|
resolvers = plugins.filter(resolvers, "canRead", file);
|
|
@@ -1189932,7 +1189932,7 @@ var AccessTokenPosthogManager = class {
|
|
|
1189932
1189932
|
properties: {
|
|
1189933
1189933
|
...event,
|
|
1189934
1189934
|
...event.properties,
|
|
1189935
|
-
version: "0.36.0
|
|
1189935
|
+
version: "0.36.0",
|
|
1189936
1189936
|
usingAccessToken: true
|
|
1189937
1189937
|
}
|
|
1189938
1189938
|
});
|
|
@@ -1189994,7 +1189994,7 @@ var UserPosthogManager = class {
|
|
|
1189994
1189994
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
1189995
1189995
|
event: "CLI",
|
|
1189996
1189996
|
properties: {
|
|
1189997
|
-
version: "0.36.0
|
|
1189997
|
+
version: "0.36.0",
|
|
1189998
1189998
|
...event,
|
|
1189999
1189999
|
...event.properties
|
|
1190000
1190000
|
}
|
|
@@ -1202258,18 +1202258,21 @@ async function replaceReferencedMarkdown({
|
|
|
1202258
1202258
|
if (!markdown.includes("<Markdown")) {
|
|
1202259
1202259
|
return markdown;
|
|
1202260
1202260
|
}
|
|
1202261
|
-
const regex3 =
|
|
1202261
|
+
const regex3 = /([ \t]*)<Markdown\s+src={?['"]([^'"]+.mdx?)['"](?! \+)}?\s*\/>/g;
|
|
1202262
1202262
|
let newMarkdown = markdown;
|
|
1202263
1202263
|
let match;
|
|
1202264
1202264
|
while ((match = regex3.exec(markdown)) != null) {
|
|
1202265
1202265
|
const matchString = match[0];
|
|
1202266
|
-
const
|
|
1202266
|
+
const indent3 = match[1];
|
|
1202267
|
+
const src = match[2];
|
|
1202267
1202268
|
if (matchString == null || src == null) {
|
|
1202268
1202269
|
throw new Error(`Failed to parse regex "${match}" in ${absolutePathToMdx}`);
|
|
1202269
1202270
|
}
|
|
1202270
1202271
|
const filepath = resolve(src.startsWith("/") ? absolutePathToFernFolder : dirname(absolutePathToMdx), RelativeFilePath.of(src.replace(/^\//, "")));
|
|
1202271
1202272
|
try {
|
|
1202272
|
-
|
|
1202273
|
+
let replaceString = await markdownLoader(filepath);
|
|
1202274
|
+
replaceString = replaceString.split("\n").map((line) => indent3 + line).join("\n");
|
|
1202275
|
+
newMarkdown = newMarkdown.replace(matchString, replaceString);
|
|
1202273
1202276
|
} catch (e) {
|
|
1202274
1202277
|
context.failAndThrow(`Failed to read markdown file "${src}" referenced in ${absolutePathToMdx}`, e);
|
|
1202275
1202278
|
break;
|
|
@@ -1202278,8 +1202281,60 @@ async function replaceReferencedMarkdown({
|
|
|
1202278
1202281
|
return newMarkdown;
|
|
1202279
1202282
|
}
|
|
1202280
1202283
|
|
|
1202281
|
-
// pnp:/home/runner/work/fern/fern/packages/cli/
|
|
1202284
|
+
// pnp:/home/runner/work/fern/fern/packages/cli/docs-markdown-utils/lib/replaceReferencedCode.js
|
|
1202282
1202285
|
var import_promises24 = require("fs/promises");
|
|
1202286
|
+
async function defaultFileLoader(filepath) {
|
|
1202287
|
+
const file = await (0, import_promises24.readFile)(filepath);
|
|
1202288
|
+
return file.toString();
|
|
1202289
|
+
}
|
|
1202290
|
+
async function replaceReferencedCode({
|
|
1202291
|
+
markdown,
|
|
1202292
|
+
absolutePathToFernFolder,
|
|
1202293
|
+
absolutePathToMdx,
|
|
1202294
|
+
context,
|
|
1202295
|
+
fileLoader = defaultFileLoader
|
|
1202296
|
+
}) {
|
|
1202297
|
+
if (!markdown.includes("<Code ")) {
|
|
1202298
|
+
return markdown;
|
|
1202299
|
+
}
|
|
1202300
|
+
const regex3 = /([ \t]*)<Code\s+src={?['"]([^'"]+)['"](?! \+)}?\s*\/>/g;
|
|
1202301
|
+
let newMarkdown = markdown;
|
|
1202302
|
+
let match;
|
|
1202303
|
+
while ((match = regex3.exec(markdown)) != null) {
|
|
1202304
|
+
const matchString = match[0];
|
|
1202305
|
+
const indent3 = match[1];
|
|
1202306
|
+
const src = match[2];
|
|
1202307
|
+
if (matchString == null || src == null) {
|
|
1202308
|
+
throw new Error(`Failed to parse regex "${match}" in ${absolutePathToMdx}`);
|
|
1202309
|
+
}
|
|
1202310
|
+
const filepath = resolve(src.startsWith("/") ? absolutePathToFernFolder : dirname(absolutePathToMdx), RelativeFilePath.of(src.replace(/^\//, "")));
|
|
1202311
|
+
try {
|
|
1202312
|
+
let replacement = await fileLoader(filepath);
|
|
1202313
|
+
let metastring = "";
|
|
1202314
|
+
const language = filepath.split(".").pop();
|
|
1202315
|
+
if (language != null) {
|
|
1202316
|
+
metastring += language;
|
|
1202317
|
+
}
|
|
1202318
|
+
const title2 = filepath.split("/").pop();
|
|
1202319
|
+
if (title2 != null) {
|
|
1202320
|
+
metastring += ` title="${title2}"`;
|
|
1202321
|
+
}
|
|
1202322
|
+
replacement = `\`\`\`${metastring}
|
|
1202323
|
+
${replacement}
|
|
1202324
|
+
\`\`\``;
|
|
1202325
|
+
replacement = replacement.split("\n").map((line) => indent3 + line).join("\n");
|
|
1202326
|
+
replacement = replacement + "\n";
|
|
1202327
|
+
newMarkdown = newMarkdown.replace(matchString, replacement);
|
|
1202328
|
+
} catch (e) {
|
|
1202329
|
+
context.failAndThrow(`Failed to read markdown file "${src}" referenced in ${absolutePathToMdx}`, e);
|
|
1202330
|
+
break;
|
|
1202331
|
+
}
|
|
1202332
|
+
}
|
|
1202333
|
+
return newMarkdown;
|
|
1202334
|
+
}
|
|
1202335
|
+
|
|
1202336
|
+
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-schema/lib/docsAst/visitDocsConfigFileAst.js
|
|
1202337
|
+
var import_promises25 = require("fs/promises");
|
|
1202283
1202338
|
var import_path17 = __toESM(require("path"));
|
|
1202284
1202339
|
async function visitDocsConfigFileYamlAst(contents, visitor, absoluteFilepathToConfiguration, absolutePathToFernFolder, context) {
|
|
1202285
1202340
|
var _a5, _b4, _c4, _d2, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
@@ -1202304,6 +1202359,12 @@ async function visitDocsConfigFileYamlAst(contents, visitor, absoluteFilepathToC
|
|
|
1202304
1202359
|
absolutePathToMdx: resolve(absolutePathToFernFolder, relativePath),
|
|
1202305
1202360
|
context
|
|
1202306
1202361
|
});
|
|
1202362
|
+
pageEntries[RelativeFilePath.of(relativePath)] = await replaceReferencedCode({
|
|
1202363
|
+
markdown,
|
|
1202364
|
+
absolutePathToFernFolder,
|
|
1202365
|
+
absolutePathToMdx: resolve(absolutePathToFernFolder, relativePath),
|
|
1202366
|
+
context
|
|
1202367
|
+
});
|
|
1202307
1202368
|
}
|
|
1202308
1202369
|
for (const [relativePath, markdown] of Object.entries(pageEntries)) {
|
|
1202309
1202370
|
const { filepaths } = parseImagePaths(markdown, {
|
|
@@ -1202472,7 +1202533,7 @@ async function visitDocsConfigFileYamlAst(contents, visitor, absoluteFilepathToC
|
|
|
1202472
1202533
|
willBeUploaded: false
|
|
1202473
1202534
|
});
|
|
1202474
1202535
|
const absoluteFilepath = resolve(dirname(absoluteFilepathToConfiguration), version3.path);
|
|
1202475
|
-
const content5 = js_yaml_default.load((await (0,
|
|
1202536
|
+
const content5 = js_yaml_default.load((await (0, import_promises25.readFile)(absoluteFilepath)).toString());
|
|
1202476
1202537
|
if (await doesPathExist(absoluteFilepath)) {
|
|
1202477
1202538
|
await ((_a6 = visitor.versionFile) == null ? void 0 : _a6.call(visitor, {
|
|
1202478
1202539
|
path: version3.path,
|
|
@@ -1202537,7 +1202598,7 @@ async function visitNavigationItem({ navigationItem, visitor, nodePath, absolute
|
|
|
1202537
1202598
|
});
|
|
1202538
1202599
|
const absoluteFilepath = resolve(dirname(absoluteFilepathToConfiguration), navigationItem.path);
|
|
1202539
1202600
|
if (await doesPathExist(absoluteFilepath)) {
|
|
1202540
|
-
const content5 = (await (0,
|
|
1202601
|
+
const content5 = (await (0, import_promises25.readFile)(absoluteFilepath)).toString();
|
|
1202541
1202602
|
await ((_a5 = visitor.markdownPage) == null ? void 0 : _a5.call(visitor, {
|
|
1202542
1202603
|
title: navigationItem.page,
|
|
1202543
1202604
|
content: content5,
|
|
@@ -1203784,7 +1203845,7 @@ var import_fiddle_sdk3 = __toESM(require_fiddle_sdk());
|
|
|
1203784
1203845
|
var import_axios3 = __toESM(require_axios4());
|
|
1203785
1203846
|
var import_fs3 = require("fs");
|
|
1203786
1203847
|
var import_path18 = __toESM(require("path"));
|
|
1203787
|
-
var
|
|
1203848
|
+
var import_promises26 = require("stream/promises");
|
|
1203788
1203849
|
var import_tar = __toESM(require_tar());
|
|
1203789
1203850
|
var import_tmp_promise2 = __toESM(require_tmp_promise());
|
|
1203790
1203851
|
var FIDDLE = createFiddleService();
|
|
@@ -1203913,7 +1203974,7 @@ async function downloadDependency({ s3PreSignedReadUrl, absolutePathToLocalOutpu
|
|
|
1203913
1203974
|
});
|
|
1203914
1203975
|
const tmpDir = await import_tmp_promise2.default.dir();
|
|
1203915
1203976
|
const outputTarPath = import_path18.default.join(tmpDir.path, "api.tgz");
|
|
1203916
|
-
await (0,
|
|
1203977
|
+
await (0, import_promises26.pipeline)(request.data, (0, import_fs3.createWriteStream)(outputTarPath));
|
|
1203917
1203978
|
await import_tar.default.extract({ file: outputTarPath, cwd: absolutePathToLocalOutput });
|
|
1203918
1203979
|
}
|
|
1203919
1203980
|
function stringifyDependency(dependency) {
|
|
@@ -1205168,7 +1205229,7 @@ function buildPathParameter({ pathParameter, context, fileContainingReference })
|
|
|
1205168
1205229
|
}
|
|
1205169
1205230
|
|
|
1205170
1205231
|
// pnp:/home/runner/work/fern/fern/packages/cli/openapi-parser/lib/parse.js
|
|
1205171
|
-
var
|
|
1205232
|
+
var import_promises28 = require("fs/promises");
|
|
1205172
1205233
|
|
|
1205173
1205234
|
// pnp:/home/runner/work/fern/fern/packages/cli/openapi-parser/lib/getExtension.js
|
|
1205174
1205235
|
function getExtension(object4, extension3) {
|
|
@@ -1209711,11 +1209772,11 @@ var import_swagger_parser = __toESM(require_lib17());
|
|
|
1209711
1209772
|
var import_openapi_core = __toESM(require_lib19());
|
|
1209712
1209773
|
|
|
1209713
1209774
|
// pnp:/home/runner/work/fern/fern/packages/cli/openapi-parser/lib/mergeWithOverrides.js
|
|
1209714
|
-
var
|
|
1209775
|
+
var import_promises27 = require("fs/promises");
|
|
1209715
1209776
|
async function mergeWithOverrides({ absoluteFilepathToOverrides, data: data2, context }) {
|
|
1209716
1209777
|
let parsedOverrides = null;
|
|
1209717
1209778
|
try {
|
|
1209718
|
-
const contents = (await (0,
|
|
1209779
|
+
const contents = (await (0, import_promises27.readFile)(absoluteFilepathToOverrides, "utf8")).toString();
|
|
1209719
1209780
|
try {
|
|
1209720
1209781
|
parsedOverrides = JSON.parse(contents);
|
|
1209721
1209782
|
} catch (err) {
|
|
@@ -1212067,7 +1212128,7 @@ async function parse4({ specs, taskContext, optionOverrides }) {
|
|
|
1212067
1212128
|
groups: {}
|
|
1212068
1212129
|
};
|
|
1212069
1212130
|
for (const spec of specs) {
|
|
1212070
|
-
const contents = (await (0,
|
|
1212131
|
+
const contents = (await (0, import_promises28.readFile)(spec.absoluteFilepath)).toString();
|
|
1212071
1212132
|
if (contents.includes("openapi") || contents.includes("swagger")) {
|
|
1212072
1212133
|
const openApiDocument = await loadOpenAPI({
|
|
1212073
1212134
|
absolutePathToOpenAPI: spec.absoluteFilepath,
|
|
@@ -1212166,7 +1212227,7 @@ function merge3(ir1, ir2) {
|
|
|
1212166
1212227
|
};
|
|
1212167
1212228
|
}
|
|
1212168
1212229
|
async function loadAsyncAPI({ absoluteFilePathToAsyncAPI, absoluteFilePathToAsyncAPIOverrides, context }) {
|
|
1212169
|
-
const contents = (await (0,
|
|
1212230
|
+
const contents = (await (0, import_promises28.readFile)(absoluteFilePathToAsyncAPI)).toString();
|
|
1212170
1212231
|
const parsed = await js_yaml_default.load(contents);
|
|
1212171
1212232
|
if (absoluteFilePathToAsyncAPIOverrides != null) {
|
|
1212172
1212233
|
return await mergeWithOverrides({
|
|
@@ -1212797,7 +1212858,7 @@ var HeaderWithCount = class {
|
|
|
1212797
1212858
|
}
|
|
1212798
1212859
|
};
|
|
1212799
1212860
|
var GLOBAL_HEADER_PERCENTAGE_THRESHOLD = 0.75;
|
|
1212800
|
-
var HEADERS_TO_IGNORE = new Set(...["
|
|
1212861
|
+
var HEADERS_TO_IGNORE = new Set(...["authorization"]);
|
|
1212801
1212862
|
function buildGlobalHeaders(context) {
|
|
1212802
1212863
|
const predefinedGlobalHeaders = Object.fromEntries((context.ir.globalHeaders ?? []).map((header) => [header.header, header]));
|
|
1212803
1212864
|
for (const [headerName, header] of Object.entries(predefinedGlobalHeaders)) {
|
|
@@ -1212824,7 +1212885,7 @@ function buildGlobalHeaders(context) {
|
|
|
1212824
1212885
|
const globalHeaders = {};
|
|
1212825
1212886
|
for (const endpoint of context.ir.endpoints) {
|
|
1212826
1212887
|
for (const header of endpoint.headers) {
|
|
1212827
|
-
if (HEADERS_TO_IGNORE.has(header.name)) {
|
|
1212888
|
+
if (HEADERS_TO_IGNORE.has(header.name.toLowerCase())) {
|
|
1212828
1212889
|
continue;
|
|
1212829
1212890
|
}
|
|
1212830
1212891
|
let headerWithCount = globalHeaders[header.name];
|
|
@@ -1214532,7 +1214593,7 @@ async function loadAPIWorkspace({ absolutePathToWorkspace, context, cliVersion,
|
|
|
1214532
1214593
|
}
|
|
1214533
1214594
|
|
|
1214534
1214595
|
// pnp:/home/runner/work/fern/fern/packages/cli/workspace-loader/lib/loadDocsWorkspace.js
|
|
1214535
|
-
var
|
|
1214596
|
+
var import_promises29 = require("fs/promises");
|
|
1214536
1214597
|
var import_path21 = __toESM(require("path"));
|
|
1214537
1214598
|
async function loadDocsWorkspace({ fernDirectory, context }) {
|
|
1214538
1214599
|
const docsConfigurationFile = join(fernDirectory, RelativeFilePath.of(DOCS_CONFIGURATION_FILENAME));
|
|
@@ -1214565,7 +1214626,7 @@ async function loadDocsConfiguration({ absolutePathToDocsDefinition, context })
|
|
|
1214565
1214626
|
});
|
|
1214566
1214627
|
}
|
|
1214567
1214628
|
async function loadRawDocsConfiguration({ absolutePathOfConfiguration, context }) {
|
|
1214568
|
-
const contentsStr = await (0,
|
|
1214629
|
+
const contentsStr = await (0, import_promises29.readFile)(absolutePathOfConfiguration);
|
|
1214569
1214630
|
const contentsJson = js_yaml_default.load(contentsStr.toString());
|
|
1214570
1214631
|
return await validateSchema2({
|
|
1214571
1214632
|
value: contentsJson,
|
|
@@ -1214652,7 +1214713,7 @@ async function visitAllPackageMarkers(workspace, visitor) {
|
|
|
1214652
1214713
|
}
|
|
1214653
1214714
|
|
|
1214654
1214715
|
// pnp:/home/runner/work/fern/fern/packages/cli/project-loader/lib/loadProject.js
|
|
1214655
|
-
var
|
|
1214716
|
+
var import_promises30 = require("fs/promises");
|
|
1214656
1214717
|
|
|
1214657
1214718
|
// pnp:/home/runner/work/fern/fern/packages/cli/project-loader/lib/handleFailedWorkspaceParserResult.js
|
|
1214658
1214719
|
function handleFailedWorkspaceParserResult(result2, logger) {
|
|
@@ -1214765,7 +1214826,7 @@ async function loadApis({ cliName, fernDirectory, context, cliVersion, commandLi
|
|
|
1214765
1214826
|
const apisDirectory = join(fernDirectory, RelativeFilePath.of(APIS_DIRECTORY));
|
|
1214766
1214827
|
const apisDirectoryExists = await doesPathExist(apisDirectory);
|
|
1214767
1214828
|
if (apisDirectoryExists) {
|
|
1214768
|
-
const apiDirectoryContents = await (0,
|
|
1214829
|
+
const apiDirectoryContents = await (0, import_promises30.readdir)(apisDirectory, { withFileTypes: true });
|
|
1214769
1214830
|
const apiWorkspaceDirectoryNames = apiDirectoryContents.reduce((all5, item) => {
|
|
1214770
1214831
|
if (item.isDirectory()) {
|
|
1214771
1214832
|
all5.push(item.name);
|
|
@@ -1216520,7 +1216581,7 @@ var yargs_default = Yargs;
|
|
|
1216520
1216581
|
|
|
1216521
1216582
|
// pnp:/home/runner/work/fern/fern/packages/cli/init/src/utils/loadOpenApiFromUrl.ts
|
|
1216522
1216583
|
var import_axios4 = __toESM(require_axios4());
|
|
1216523
|
-
var
|
|
1216584
|
+
var import_promises31 = require("fs/promises");
|
|
1216524
1216585
|
var import_path27 = require("path");
|
|
1216525
1216586
|
var import_tmp_promise3 = __toESM(require_tmp_promise());
|
|
1216526
1216587
|
async function loadOpenAPIFromUrl({ url, logger }) {
|
|
@@ -1216532,7 +1216593,7 @@ async function loadOpenAPIFromUrl({ url, logger }) {
|
|
|
1216532
1216593
|
const filePath = (0, import_path27.join)(tmpDir.path, "openapi.yml");
|
|
1216533
1216594
|
logger.debug("tmpDir", tmpDir.path);
|
|
1216534
1216595
|
logger.debug("filePath", filePath);
|
|
1216535
|
-
await (0,
|
|
1216596
|
+
await (0, import_promises31.writeFile)(filePath, yamlData);
|
|
1216536
1216597
|
return {
|
|
1216537
1216598
|
status: "success" /* Success */,
|
|
1216538
1216599
|
filePath
|
|
@@ -1218236,10 +1218297,10 @@ var CliContext = class {
|
|
|
1218236
1218297
|
return "fern-api";
|
|
1218237
1218298
|
}
|
|
1218238
1218299
|
getPackageVersion() {
|
|
1218239
|
-
if ("0.36.0
|
|
1218300
|
+
if ("0.36.0" == null) {
|
|
1218240
1218301
|
this.logger.error("CLI_VERSION is not defined");
|
|
1218241
1218302
|
}
|
|
1218242
|
-
return "0.36.0
|
|
1218303
|
+
return "0.36.0";
|
|
1218243
1218304
|
}
|
|
1218244
1218305
|
getCliName() {
|
|
1218245
1218306
|
if ("fern" == null) {
|
|
@@ -1218412,7 +1218473,7 @@ function wrapWorkspaceNameForPrefix(workspaceName) {
|
|
|
1218412
1218473
|
}
|
|
1218413
1218474
|
|
|
1218414
1218475
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/add-generator/addGeneratorToWorkspaces.ts
|
|
1218415
|
-
var
|
|
1218476
|
+
var import_promises32 = require("fs/promises");
|
|
1218416
1218477
|
async function addGeneratorToWorkspaces({
|
|
1218417
1218478
|
project: { apiWorkspaces },
|
|
1218418
1218479
|
generatorName,
|
|
@@ -1218433,7 +1218494,7 @@ async function addGeneratorToWorkspaces({
|
|
|
1218433
1218494
|
groupName,
|
|
1218434
1218495
|
context
|
|
1218435
1218496
|
});
|
|
1218436
|
-
await (0,
|
|
1218497
|
+
await (0, import_promises32.writeFile)(
|
|
1218437
1218498
|
((_a5 = workspace.generatorsConfiguration) == null ? void 0 : _a5.absolutePathToConfiguration) ?? generators_yml_exports.getPathToGeneratorsConfiguration({
|
|
1218438
1218499
|
absolutePathToWorkspace: workspace.absoluteFilepath
|
|
1218439
1218500
|
}),
|
|
@@ -1225916,7 +1225977,7 @@ function filterServiceTypeReferenceInfoForAudiences(serviceTypeReferenceInfo, fi
|
|
|
1225916
1225977
|
// pnp:/home/runner/work/fern/fern/packages/cli/docs-resolver/lib/DocsDefinitionResolver.js
|
|
1225917
1225978
|
var import_dayjs3 = __toESM(require_dayjs_min());
|
|
1225918
1225979
|
var import_utc3 = __toESM(require_utc());
|
|
1225919
|
-
var
|
|
1225980
|
+
var import_promises33 = require("fs/promises");
|
|
1225920
1225981
|
var import_gray_matter3 = __toESM(require_gray_matter());
|
|
1225921
1225982
|
|
|
1225922
1225983
|
// pnp:/home/runner/work/fern/fern/packages/cli/docs-resolver/lib/utils/isSubpackage.js
|
|
@@ -1228008,6 +1228069,12 @@ var DocsDefinitionResolver = class {
|
|
|
1228008
1228069
|
absolutePathToMdx: this.resolveFilepath(relativePath),
|
|
1228009
1228070
|
context: this.taskContext
|
|
1228010
1228071
|
});
|
|
1228072
|
+
this.parsedDocsConfig.pages[RelativeFilePath.of(relativePath)] = await replaceReferencedCode({
|
|
1228073
|
+
markdown,
|
|
1228074
|
+
absolutePathToFernFolder: this.docsWorkspace.absoluteFilepath,
|
|
1228075
|
+
absolutePathToMdx: this.resolveFilepath(relativePath),
|
|
1228076
|
+
context: this.taskContext
|
|
1228077
|
+
});
|
|
1228011
1228078
|
}
|
|
1228012
1228079
|
const filesToUploadSet = collectFilesFromDocsConfig(this.parsedDocsConfig);
|
|
1228013
1228080
|
for (const [relativePath, markdown] of Object.entries(this.parsedDocsConfig.pages)) {
|
|
@@ -1228056,7 +1228123,7 @@ var DocsDefinitionResolver = class {
|
|
|
1228056
1228123
|
const jsFilePaths = /* @__PURE__ */ new Set();
|
|
1228057
1228124
|
await Promise.all(this._parsedDocsConfig.experimental.mdxComponents.map(async (filepath) => {
|
|
1228058
1228125
|
const absoluteFilePath = resolve(this.docsWorkspace.absoluteFilepath, filepath);
|
|
1228059
|
-
const stats = await (0,
|
|
1228126
|
+
const stats = await (0, import_promises33.stat)(absoluteFilePath);
|
|
1228060
1228127
|
if (stats.isDirectory()) {
|
|
1228061
1228128
|
const files = await listFiles(absoluteFilePath, "{js,ts,jsx,tsx}");
|
|
1228062
1228129
|
files.forEach((file) => {
|
|
@@ -1228068,7 +1228135,7 @@ var DocsDefinitionResolver = class {
|
|
|
1228068
1228135
|
}));
|
|
1228069
1228136
|
jsFiles = Object.fromEntries(await Promise.all([...jsFilePaths].map(async (filePath) => {
|
|
1228070
1228137
|
const relativeFilePath = this.toRelativeFilepath(filePath);
|
|
1228071
|
-
const contents = (await (0,
|
|
1228138
|
+
const contents = (await (0, import_promises33.readFile)(filePath)).toString();
|
|
1228072
1228139
|
return [relativeFilePath, contents];
|
|
1228073
1228140
|
})));
|
|
1228074
1228141
|
}
|
|
@@ -1230140,10 +1230207,10 @@ var import_websocket_server = __toESM(require_websocket_server(), 1);
|
|
|
1230140
1230207
|
// pnp:/home/runner/work/fern/fern/packages/cli/docs-preview/lib/downloadLocalDocsBundle.js
|
|
1230141
1230208
|
var import_decompress = __toESM(require_decompress());
|
|
1230142
1230209
|
var import_fs8 = require("fs");
|
|
1230143
|
-
var
|
|
1230210
|
+
var import_promises34 = require("fs/promises");
|
|
1230144
1230211
|
var import_os3 = require("os");
|
|
1230145
1230212
|
var import_path29 = __toESM(require("path"));
|
|
1230146
|
-
var
|
|
1230213
|
+
var import_promises35 = require("stream/promises");
|
|
1230147
1230214
|
var import_tmp_promise4 = __toESM(require_tmp_promise());
|
|
1230148
1230215
|
var import_xml2js = __toESM(require_xml2js());
|
|
1230149
1230216
|
var ETAG_FILENAME = "etag";
|
|
@@ -1230174,7 +1230241,7 @@ async function downloadBundle({ bucketUrl, logger, preferCached }) {
|
|
|
1230174
1230241
|
let currentETag = void 0;
|
|
1230175
1230242
|
if (currentETagExists) {
|
|
1230176
1230243
|
logger.debug("Reading existing ETag");
|
|
1230177
|
-
currentETag = (await (0,
|
|
1230244
|
+
currentETag = (await (0, import_promises34.readFile)(eTagFilepath)).toString();
|
|
1230178
1230245
|
}
|
|
1230179
1230246
|
if (currentETag != null && currentETag === eTag) {
|
|
1230180
1230247
|
logger.debug("ETag matches. Using already downloaded bundle");
|
|
@@ -1230196,18 +1230263,18 @@ async function downloadBundle({ bucketUrl, logger, preferCached }) {
|
|
|
1230196
1230263
|
type: "failure"
|
|
1230197
1230264
|
};
|
|
1230198
1230265
|
}
|
|
1230199
|
-
await (0,
|
|
1230266
|
+
await (0, import_promises35.pipeline)(contents, (0, import_fs8.createWriteStream)(outputZipPath));
|
|
1230200
1230267
|
logger.debug(`Wrote output.zip to ${outputZipPath}`);
|
|
1230201
1230268
|
const absolutePathToPreviewFolder = getPathToPreviewFolder();
|
|
1230202
1230269
|
if (await doesPathExist(absolutePathToPreviewFolder)) {
|
|
1230203
|
-
await (0,
|
|
1230270
|
+
await (0, import_promises34.rm)(absolutePathToPreviewFolder, { recursive: true });
|
|
1230204
1230271
|
}
|
|
1230205
|
-
await (0,
|
|
1230272
|
+
await (0, import_promises34.mkdir)(absolutePathToPreviewFolder, { recursive: true });
|
|
1230206
1230273
|
logger.debug(`rm -rf ${absolutePathToPreviewFolder}`);
|
|
1230207
1230274
|
const absolutePathToBundleFolder = getPathToBundleFolder();
|
|
1230208
|
-
await (0,
|
|
1230275
|
+
await (0, import_promises34.mkdir)(absolutePathToBundleFolder, { recursive: true });
|
|
1230209
1230276
|
await (0, import_decompress.default)(outputZipPath, absolutePathToBundleFolder);
|
|
1230210
|
-
await (0,
|
|
1230277
|
+
await (0, import_promises34.writeFile)(eTagFilepath, eTag);
|
|
1230211
1230278
|
logger.debug(`Downloaded bundle to ${absolutePathToBundleFolder}`);
|
|
1230212
1230279
|
return {
|
|
1230213
1230280
|
type: "success"
|
|
@@ -1255307,7 +1255374,7 @@ var supportedExtensions = new Set(extensions);
|
|
|
1255307
1255374
|
var supportedMimeTypes = new Set(mimeTypes);
|
|
1255308
1255375
|
|
|
1255309
1255376
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/docs-validator/lib/rules/valid-file-types/valid-file-types.js
|
|
1255310
|
-
var
|
|
1255377
|
+
var import_promises36 = require("fs/promises");
|
|
1255311
1255378
|
var import_path32 = __toESM(require("path"));
|
|
1255312
1255379
|
var ALLOWED_FILE_TYPES = /* @__PURE__ */ new Set([
|
|
1255313
1255380
|
"image/jpeg",
|
|
@@ -1255384,7 +1255451,7 @@ var ValidFileTypes = {
|
|
|
1255384
1255451
|
}
|
|
1255385
1255452
|
};
|
|
1255386
1255453
|
var getViolationsForFile = async (absoluteFilepath) => {
|
|
1255387
|
-
const file = await (0,
|
|
1255454
|
+
const file = await (0, import_promises36.readFile)(absoluteFilepath);
|
|
1255388
1255455
|
const fileType = await fileTypeFromBuffer(file);
|
|
1255389
1255456
|
if (fileType != null) {
|
|
1255390
1255457
|
if (ALLOWED_FILE_TYPES.has(fileType.mime)) {
|
|
@@ -1255657,7 +1255724,7 @@ async function formatWorkspaces({
|
|
|
1255657
1255724
|
}
|
|
1255658
1255725
|
|
|
1255659
1255726
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/generate-fdr/generateFdrApiDefinitionForWorkspaces.ts
|
|
1255660
|
-
var
|
|
1255727
|
+
var import_promises37 = require("fs/promises");
|
|
1255661
1255728
|
var import_path35 = __toESM(require("path"));
|
|
1255662
1255729
|
|
|
1255663
1255730
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/validator/lib/rules/valid-field-names/regex.js
|
|
@@ -1259810,7 +1259877,7 @@ async function generateFdrApiDefinitionForWorkspaces({
|
|
|
1259810
1259877
|
snippetsConfig: {}
|
|
1259811
1259878
|
});
|
|
1259812
1259879
|
const resolvedOutputFilePath = import_path35.default.resolve(outputFilepath);
|
|
1259813
|
-
await (0,
|
|
1259880
|
+
await (0, import_promises37.writeFile)(resolvedOutputFilePath, await stringifyLargeObject(apiDefinition, { pretty: true }));
|
|
1259814
1259881
|
context.logger.info(`Wrote FDR API definition to ${resolvedOutputFilePath}`);
|
|
1259815
1259882
|
});
|
|
1259816
1259883
|
})
|
|
@@ -1269458,7 +1269525,7 @@ function migrateIntermediateRepresentationThroughVersion({ intermediateRepresent
|
|
|
1269458
1269525
|
}
|
|
1269459
1269526
|
|
|
1269460
1269527
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/generate-ir/generateIrForWorkspaces.ts
|
|
1269461
|
-
var
|
|
1269528
|
+
var import_promises38 = require("fs/promises");
|
|
1269462
1269529
|
var import_path36 = __toESM(require("path"));
|
|
1269463
1269530
|
async function generateIrForWorkspaces({
|
|
1269464
1269531
|
project,
|
|
@@ -1269488,7 +1269555,7 @@ async function generateIrForWorkspaces({
|
|
|
1269488
1269555
|
readme
|
|
1269489
1269556
|
});
|
|
1269490
1269557
|
const irOutputFilePath = import_path36.default.resolve(irFilepath);
|
|
1269491
|
-
await (0,
|
|
1269558
|
+
await (0, import_promises38.writeFile)(
|
|
1269492
1269559
|
irOutputFilePath,
|
|
1269493
1269560
|
await stringifyLargeObject(intermediateRepresentation, { pretty: true })
|
|
1269494
1269561
|
);
|
|
@@ -1269531,7 +1269598,7 @@ async function getIntermediateRepresentation({
|
|
|
1269531
1269598
|
}
|
|
1269532
1269599
|
|
|
1269533
1269600
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/generate-openapi-ir/generateOpenAPIIrForWorkspaces.ts
|
|
1269534
|
-
var
|
|
1269601
|
+
var import_promises39 = require("fs/promises");
|
|
1269535
1269602
|
var import_path37 = __toESM(require("path"));
|
|
1269536
1269603
|
async function generateOpenAPIIrForWorkspaces({
|
|
1269537
1269604
|
project,
|
|
@@ -1269554,7 +1269621,7 @@ async function generateOpenAPIIrForWorkspaces({
|
|
|
1269554
1269621
|
const openApiIrJson = await serialization_exports3.OpenApiIntermediateRepresentation.jsonOrThrow(openAPIIr, {
|
|
1269555
1269622
|
skipValidation: true
|
|
1269556
1269623
|
});
|
|
1269557
|
-
await (0,
|
|
1269624
|
+
await (0, import_promises39.writeFile)(irOutputFilePath, await stringifyLargeObject(openApiIrJson, { pretty: true }));
|
|
1269558
1269625
|
context.logger.info(`Wrote IR to ${irOutputFilePath}`);
|
|
1269559
1269626
|
});
|
|
1269560
1269627
|
})
|
|
@@ -1269562,7 +1269629,7 @@ async function generateOpenAPIIrForWorkspaces({
|
|
|
1269562
1269629
|
}
|
|
1269563
1269630
|
|
|
1269564
1269631
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/generate-overrides/writeOverridesForWorkspaces.ts
|
|
1269565
|
-
var
|
|
1269632
|
+
var import_promises40 = require("fs/promises");
|
|
1269566
1269633
|
async function writeOverridesForWorkspaces({
|
|
1269567
1269634
|
project,
|
|
1269568
1269635
|
includeModels,
|
|
@@ -1269587,7 +1269654,7 @@ async function writeOverridesForWorkspaces({
|
|
|
1269587
1269654
|
async function readExistingOverrides(overridesFilepath, context) {
|
|
1269588
1269655
|
let parsedOverrides = null;
|
|
1269589
1269656
|
try {
|
|
1269590
|
-
const contents = (await (0,
|
|
1269657
|
+
const contents = (await (0, import_promises40.readFile)(overridesFilepath, "utf8")).toString();
|
|
1269591
1269658
|
try {
|
|
1269592
1269659
|
parsedOverrides = JSON.parse(contents);
|
|
1269593
1269660
|
} catch (err) {
|
|
@@ -1269643,7 +1269710,7 @@ async function writeDefinitionForOpenAPIWorkspace({
|
|
|
1269643
1269710
|
}
|
|
1269644
1269711
|
}
|
|
1269645
1269712
|
const components = { schemas };
|
|
1269646
|
-
await (0,
|
|
1269713
|
+
await (0, import_promises40.writeFile)(
|
|
1269647
1269714
|
join(dirname(spec.absoluteFilepath), RelativeFilePath.of("openapi-overrides.yml")),
|
|
1269648
1269715
|
js_yaml_default.dump({ paths, components })
|
|
1269649
1269716
|
);
|
|
@@ -1269909,7 +1269976,7 @@ async function getIntermediateRepresentation2({ workspace, audiences, generatorI
|
|
|
1269909
1269976
|
|
|
1269910
1269977
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/local-generation/docker-utils/lib/runDocker.js
|
|
1269911
1269978
|
var import_dockerode2 = __toESM(require_docker());
|
|
1269912
|
-
var
|
|
1269979
|
+
var import_promises41 = require("fs/promises");
|
|
1269913
1269980
|
var import_stream4 = require("stream");
|
|
1269914
1269981
|
var import_tmp_promise5 = __toESM(require_tmp_promise());
|
|
1269915
1269982
|
async function runDocker({ imageName, args, binds, writeLogsToFile = true, removeAfterCompletion = false }) {
|
|
@@ -1269946,7 +1270013,7 @@ async function tryRunDocker({ docker, imageName, args, binds, removeAfterComplet
|
|
|
1269946
1270013
|
if (status.StatusCode !== 0) {
|
|
1269947
1270014
|
if (writeLogsToFile) {
|
|
1269948
1270015
|
const tmpFile = await import_tmp_promise5.default.file();
|
|
1269949
|
-
await (0,
|
|
1270016
|
+
await (0, import_promises41.writeFile)(tmpFile.path, logs);
|
|
1269950
1270017
|
throw new Error(`Docker exited with a non-zero exit code. Logs here: ${tmpFile.path}`);
|
|
1269951
1270018
|
} else {
|
|
1269952
1270019
|
throw new Error("Docker exited with a non-zero exit code.");
|
|
@@ -1269968,7 +1270035,7 @@ async function pullImage(docker, imageName) {
|
|
|
1269968
1270035
|
|
|
1269969
1270036
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/local-generation/local-workspace-runner/lib/runGenerator.js
|
|
1269970
1270037
|
var FernGeneratorExecParsing = __toESM(require_serialization32());
|
|
1269971
|
-
var
|
|
1270038
|
+
var import_promises43 = require("fs/promises");
|
|
1269972
1270039
|
var import_tmp_promise7 = __toESM(require_tmp_promise());
|
|
1269973
1270040
|
|
|
1269974
1270041
|
// pnp:/home/runner/work/fern/fern/packages/commons/logging-execa/lib/loggingExeca.js
|
|
@@ -1269994,7 +1270061,7 @@ async function loggingExeca(logger, executable, args = [], { doNotPipeOutput = f
|
|
|
1269994
1270061
|
|
|
1269995
1270062
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/local-generation/local-workspace-runner/lib/LocalTaskHandler.js
|
|
1269996
1270063
|
var import_decompress2 = __toESM(require_decompress());
|
|
1269997
|
-
var
|
|
1270064
|
+
var import_promises42 = require("fs/promises");
|
|
1269998
1270065
|
var import_tmp_promise6 = __toESM(require_tmp_promise());
|
|
1269999
1270066
|
var LocalTaskHandler = class {
|
|
1270000
1270067
|
context;
|
|
@@ -1270040,7 +1270107,7 @@ var LocalTaskHandler = class {
|
|
|
1270040
1270107
|
const tmpOutputResolutionDir = AbsoluteFilePath.of((await import_tmp_promise6.default.dir({})).path);
|
|
1270041
1270108
|
const absolutePathToFernignore = AbsoluteFilePath.of(join(this.absolutePathToLocalOutput, RelativeFilePath.of(FERNIGNORE_FILENAME)));
|
|
1270042
1270109
|
const fernIngnorePaths = await getFernIgnorePaths({ absolutePathToFernignore });
|
|
1270043
|
-
await (0,
|
|
1270110
|
+
await (0, import_promises42.cp)(this.absolutePathToLocalOutput, tmpOutputResolutionDir, { recursive: true });
|
|
1270044
1270111
|
await this.runGitCommand(["init"], tmpOutputResolutionDir);
|
|
1270045
1270112
|
await this.runGitCommand(["add", "."], tmpOutputResolutionDir);
|
|
1270046
1270113
|
const response = await this.runGitCommand(["config", "--list"], tmpOutputResolutionDir);
|
|
@@ -1270053,16 +1270120,16 @@ var LocalTaskHandler = class {
|
|
|
1270053
1270120
|
await this.copyGeneratedFilesToDirectory(tmpOutputResolutionDir);
|
|
1270054
1270121
|
await this.runGitCommand(["reset", "--", ...fernIngnorePaths], tmpOutputResolutionDir);
|
|
1270055
1270122
|
await this.runGitCommand(["restore", "."], tmpOutputResolutionDir);
|
|
1270056
|
-
await (0,
|
|
1270057
|
-
await (0,
|
|
1270123
|
+
await (0, import_promises42.rmdir)(this.absolutePathToLocalOutput, { recursive: true });
|
|
1270124
|
+
await (0, import_promises42.cp)(tmpOutputResolutionDir, this.absolutePathToLocalOutput, { recursive: true });
|
|
1270058
1270125
|
}
|
|
1270059
1270126
|
async copyGeneratedFilesNoFernIgnore() {
|
|
1270060
1270127
|
this.context.logger.debug(`rm -rf ${this.absolutePathToLocalOutput}`);
|
|
1270061
|
-
await (0,
|
|
1270128
|
+
await (0, import_promises42.rm)(this.absolutePathToLocalOutput, { force: true, recursive: true });
|
|
1270062
1270129
|
await this.copyGeneratedFilesToDirectory(this.absolutePathToLocalOutput);
|
|
1270063
1270130
|
}
|
|
1270064
1270131
|
async copyGeneratedFilesToDirectory(outputPath) {
|
|
1270065
|
-
const [firstLocalOutputItem, ...remaininglocalOutputItems] = await (0,
|
|
1270132
|
+
const [firstLocalOutputItem, ...remaininglocalOutputItems] = await (0, import_promises42.readdir)(this.absolutePathToTmpOutputDirectory);
|
|
1270066
1270133
|
if (firstLocalOutputItem == null) {
|
|
1270067
1270134
|
return;
|
|
1270068
1270135
|
}
|
|
@@ -1270070,15 +1270137,15 @@ var LocalTaskHandler = class {
|
|
|
1270070
1270137
|
if (firstLocalOutputItem.endsWith(".zip")) {
|
|
1270071
1270138
|
await (0, import_decompress2.default)(join(this.absolutePathToTmpOutputDirectory, RelativeFilePath.of(firstLocalOutputItem)), outputPath);
|
|
1270072
1270139
|
for (const localOutputItem of remaininglocalOutputItems) {
|
|
1270073
|
-
await (0,
|
|
1270140
|
+
await (0, import_promises42.cp)(join(this.absolutePathToTmpOutputDirectory, RelativeFilePath.of(localOutputItem)), join(outputPath, RelativeFilePath.of(localOutputItem)), { recursive: true });
|
|
1270074
1270141
|
}
|
|
1270075
1270142
|
} else {
|
|
1270076
|
-
await (0,
|
|
1270143
|
+
await (0, import_promises42.cp)(this.absolutePathToTmpOutputDirectory, outputPath, { recursive: true });
|
|
1270077
1270144
|
}
|
|
1270078
1270145
|
}
|
|
1270079
1270146
|
async copySnippetJSON({ absolutePathToTmpSnippetJSON, absolutePathToLocalSnippetJSON }) {
|
|
1270080
1270147
|
this.context.logger.debug(`Copying generated snippets to ${absolutePathToLocalSnippetJSON}`);
|
|
1270081
|
-
await (0,
|
|
1270148
|
+
await (0, import_promises42.cp)(absolutePathToTmpSnippetJSON, absolutePathToLocalSnippetJSON);
|
|
1270082
1270149
|
}
|
|
1270083
1270150
|
async runGitCommand(options2, cwd2) {
|
|
1270084
1270151
|
const response = await loggingExeca(this.context.logger, "git", options2, {
|
|
@@ -1270090,7 +1270157,7 @@ var LocalTaskHandler = class {
|
|
|
1270090
1270157
|
};
|
|
1270091
1270158
|
var NEW_LINE_REGEX = /\r?\n/;
|
|
1270092
1270159
|
async function getFernIgnorePaths({ absolutePathToFernignore }) {
|
|
1270093
|
-
const fernIgnoreFileContents = (await (0,
|
|
1270160
|
+
const fernIgnoreFileContents = (await (0, import_promises42.readFile)(absolutePathToFernignore)).toString();
|
|
1270094
1270161
|
return [
|
|
1270095
1270162
|
FERNIGNORE_FILENAME,
|
|
1270096
1270163
|
...fernIgnoreFileContents.trim().split(NEW_LINE_REGEX).filter((line) => !line.startsWith("#") && line.length > 0)
|
|
@@ -1270179,7 +1270246,7 @@ async function writeIrToFile({ workspace, audiences, generatorInvocation, worksp
|
|
|
1270179
1270246
|
tmpdir: workspaceTempDir.path
|
|
1270180
1270247
|
});
|
|
1270181
1270248
|
const absolutePathToIr = AbsoluteFilePath.of(irFile.path);
|
|
1270182
|
-
await (0,
|
|
1270249
|
+
await (0, import_promises43.writeFile)(absolutePathToIr, JSON.stringify(intermediateRepresentation, void 0, 4));
|
|
1270183
1270250
|
context.logger.debug(`Wrote IR to ${absolutePathToIr}`);
|
|
1270184
1270251
|
return absolutePathToIr;
|
|
1270185
1270252
|
}
|
|
@@ -1270208,7 +1270275,7 @@ async function runGenerator({ workspaceName, organization, outputVersion, absolu
|
|
|
1270208
1270275
|
if (!parsedConfig.ok) {
|
|
1270209
1270276
|
throw new Error(`Failed to parse config.json into ${absolutePathToWriteConfigJson}`);
|
|
1270210
1270277
|
}
|
|
1270211
|
-
await (0,
|
|
1270278
|
+
await (0, import_promises43.writeFile)(absolutePathToWriteConfigJson, JSON.stringify(parsedConfig.value, void 0, 4));
|
|
1270212
1270279
|
const doesConfigJsonExist = await waitUntilPathExists(absolutePathToWriteConfigJson, 5e3);
|
|
1270213
1270280
|
if (!doesConfigJsonExist) {
|
|
1270214
1270281
|
throw new Error(`Failed to create ${absolutePathToWriteConfigJson}`);
|
|
@@ -1270277,8 +1270344,8 @@ var import_fiddle_sdk5 = __toESM(require_fiddle_sdk());
|
|
|
1270277
1270344
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/remote-generation/remote-workspace-runner/lib/downloadSnippetsForTask.js
|
|
1270278
1270345
|
var import_axios5 = __toESM(require_axios4());
|
|
1270279
1270346
|
var import_fs9 = require("fs");
|
|
1270280
|
-
var
|
|
1270281
|
-
var
|
|
1270347
|
+
var import_promises44 = require("fs/promises");
|
|
1270348
|
+
var import_promises45 = require("stream/promises");
|
|
1270282
1270349
|
async function downloadSnippetsForTask({ snippetsS3PreSignedReadUrl, absolutePathToLocalSnippetJSON, context }) {
|
|
1270283
1270350
|
try {
|
|
1270284
1270351
|
await downloadFileForTask({
|
|
@@ -1270295,17 +1270362,17 @@ async function downloadFileForTask({ s3PreSignedReadUrl, absolutePathToLocalOutp
|
|
|
1270295
1270362
|
responseType: "stream"
|
|
1270296
1270363
|
});
|
|
1270297
1270364
|
if (await doesPathExist(absolutePathToLocalOutput)) {
|
|
1270298
|
-
await (0,
|
|
1270365
|
+
await (0, import_promises44.rm)(absolutePathToLocalOutput, { recursive: true });
|
|
1270299
1270366
|
}
|
|
1270300
|
-
await (0,
|
|
1270301
|
-
await (0,
|
|
1270367
|
+
await (0, import_promises44.mkdir)(dirname(absolutePathToLocalOutput), { recursive: true });
|
|
1270368
|
+
await (0, import_promises45.pipeline)(request.data, (0, import_fs9.createWriteStream)(absolutePathToLocalOutput));
|
|
1270302
1270369
|
}
|
|
1270303
1270370
|
|
|
1270304
1270371
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/remote-generation/remote-workspace-runner/lib/createAndStartJob.js
|
|
1270305
1270372
|
var import_fiddle_sdk4 = __toESM(require_fiddle_sdk());
|
|
1270306
1270373
|
var import_axios6 = __toESM(require_axios4());
|
|
1270307
1270374
|
var import_form_data2 = __toESM(require_form_data());
|
|
1270308
|
-
var
|
|
1270375
|
+
var import_promises46 = require("fs/promises");
|
|
1270309
1270376
|
var import_tar2 = __toESM(require_tar());
|
|
1270310
1270377
|
var import_tmp_promise9 = __toESM(require_tmp_promise());
|
|
1270311
1270378
|
|
|
@@ -1270371,15 +1270438,15 @@ async function createJob({ projectConfig, workspace, organization, generatorInvo
|
|
|
1270371
1270438
|
context.logger.debug(`Writing mock fern definition to ${absolutePathToTmpDir}`);
|
|
1270372
1270439
|
const absolutePathToTmpFernDirectory = join(absolutePathToTmpDir, RelativeFilePath.of(FERN_DIRECTORY));
|
|
1270373
1270440
|
const absolutePathToTmpDefinitionDirectory = join(absolutePathToTmpFernDirectory, RelativeFilePath.of(DEFINITION_DIRECTORY));
|
|
1270374
|
-
await (0,
|
|
1270441
|
+
await (0, import_promises46.mkdir)(absolutePathToTmpDefinitionDirectory, { recursive: true });
|
|
1270375
1270442
|
const absolutePathToApiYml = join(absolutePathToTmpDefinitionDirectory, RelativeFilePath.of(ROOT_API_FILENAME));
|
|
1270376
|
-
await (0,
|
|
1270443
|
+
await (0, import_promises46.writeFile)(absolutePathToApiYml, js_yaml_default.dump(workspace.definition.rootApiFile.contents));
|
|
1270377
1270444
|
await writeFernDefinition({
|
|
1270378
1270445
|
absolutePathToDefinitionDirectory: absolutePathToTmpDefinitionDirectory,
|
|
1270379
1270446
|
definition: workspace.definition
|
|
1270380
1270447
|
});
|
|
1270381
1270448
|
const absolutePathToFernConfigJson = join(absolutePathToTmpFernDirectory, RelativeFilePath.of(PROJECT_CONFIG_FILENAME));
|
|
1270382
|
-
await (0,
|
|
1270449
|
+
await (0, import_promises46.writeFile)(absolutePathToFernConfigJson, JSON.stringify(projectConfig.rawConfig, void 0, 2));
|
|
1270383
1270450
|
const tarPath = join(absolutePathToTmpDir, RelativeFilePath.of("definition.tgz"));
|
|
1270384
1270451
|
await import_tar2.default.create({ file: tarPath, cwd: absolutePathToTmpFernDirectory }, ["."]);
|
|
1270385
1270452
|
context.logger.debug("Getting upload URL for Fern definition.");
|
|
@@ -1270398,7 +1270465,7 @@ async function createJob({ projectConfig, workspace, organization, generatorInvo
|
|
|
1270398
1270465
|
}
|
|
1270399
1270466
|
} else {
|
|
1270400
1270467
|
context.logger.debug("Uploading definition...");
|
|
1270401
|
-
await import_axios6.default.put(definitionUploadUrlRequest.body.s3Url, await (0,
|
|
1270468
|
+
await import_axios6.default.put(definitionUploadUrlRequest.body.s3Url, await (0, import_promises46.readFile)(tarPath));
|
|
1270402
1270469
|
fernDefinitionMetadata = {
|
|
1270403
1270470
|
definitionS3DownloadUrl: definitionUploadUrlRequest.body.s3Url,
|
|
1270404
1270471
|
outputPath: ".mock",
|
|
@@ -1270460,14 +1270527,14 @@ async function createJob({ projectConfig, workspace, organization, generatorInvo
|
|
|
1270460
1270527
|
async function writeFernDefinition({ absolutePathToDefinitionDirectory, definition: definition3 }) {
|
|
1270461
1270528
|
for (const [relativePath, definitionFile] of Object.entries(definition3.namedDefinitionFiles)) {
|
|
1270462
1270529
|
const absolutePathToDefinitionFile = join(absolutePathToDefinitionDirectory, RelativeFilePath.of(relativePath));
|
|
1270463
|
-
await (0,
|
|
1270464
|
-
await (0,
|
|
1270530
|
+
await (0, import_promises46.mkdir)(dirname(absolutePathToDefinitionFile), { recursive: true });
|
|
1270531
|
+
await (0, import_promises46.writeFile)(absolutePathToDefinitionFile, js_yaml_default.dump(definitionFile.contents));
|
|
1270465
1270532
|
}
|
|
1270466
1270533
|
for (const [relativePath, packageMarker] of Object.entries(definition3.packageMarkers)) {
|
|
1270467
1270534
|
if (packageMarker.contents.export == null) {
|
|
1270468
1270535
|
const absolutePathToPackageMarker = join(absolutePathToDefinitionDirectory, RelativeFilePath.of(relativePath));
|
|
1270469
|
-
await (0,
|
|
1270470
|
-
await (0,
|
|
1270536
|
+
await (0, import_promises46.mkdir)(dirname(absolutePathToPackageMarker), { recursive: true });
|
|
1270537
|
+
await (0, import_promises46.writeFile)(absolutePathToPackageMarker, js_yaml_default.dump(packageMarker.contents));
|
|
1270471
1270538
|
}
|
|
1270472
1270539
|
}
|
|
1270473
1270540
|
for (const [relativePath, importedDefinition] of Object.entries(definition3.importedDefinitions)) {
|
|
@@ -1270583,9 +1270650,9 @@ function pollJobAndReportStatus({ job, taskId, taskHandler, context }) {
|
|
|
1270583
1270650
|
var import_axios7 = __toESM(require_axios4());
|
|
1270584
1270651
|
var import_decompress3 = __toESM(require_decompress());
|
|
1270585
1270652
|
var import_fs10 = require("fs");
|
|
1270586
|
-
var
|
|
1270653
|
+
var import_promises47 = require("fs/promises");
|
|
1270587
1270654
|
var import_path40 = __toESM(require("path"));
|
|
1270588
|
-
var
|
|
1270655
|
+
var import_promises48 = require("stream/promises");
|
|
1270589
1270656
|
var import_tmp_promise10 = __toESM(require_tmp_promise());
|
|
1270590
1270657
|
var _isFinished, _createdSnippets, _snippetsS3PreSignedReadUrl;
|
|
1270591
1270658
|
var RemoteTaskHandler = class {
|
|
@@ -1270701,11 +1270768,11 @@ async function downloadZipForTask({ s3PreSignedReadUrl, absolutePathToLocalOutpu
|
|
|
1270701
1270768
|
});
|
|
1270702
1270769
|
const tmpDir = await import_tmp_promise10.default.dir({ prefix: "fern", unsafeCleanup: true });
|
|
1270703
1270770
|
const outputZipPath = import_path40.default.join(tmpDir.path, "output.zip");
|
|
1270704
|
-
await (0,
|
|
1270771
|
+
await (0, import_promises48.pipeline)(request.data, (0, import_fs10.createWriteStream)(outputZipPath));
|
|
1270705
1270772
|
if (await doesPathExist(absolutePathToLocalOutput)) {
|
|
1270706
|
-
await (0,
|
|
1270773
|
+
await (0, import_promises47.rm)(absolutePathToLocalOutput, { recursive: true });
|
|
1270707
1270774
|
}
|
|
1270708
|
-
await (0,
|
|
1270775
|
+
await (0, import_promises47.mkdir)(absolutePathToLocalOutput, { recursive: true });
|
|
1270709
1270776
|
await (0, import_decompress3.default)(outputZipPath, absolutePathToLocalOutput);
|
|
1270710
1270777
|
}
|
|
1270711
1270778
|
function convertLogLevel(logLevel) {
|
|
@@ -1270842,7 +1270909,7 @@ async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization,
|
|
|
1270842
1270909
|
|
|
1270843
1270910
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/remote-generation/remote-workspace-runner/lib/publishDocs.js
|
|
1270844
1270911
|
var import_axios8 = __toESM(require_axios4());
|
|
1270845
|
-
var
|
|
1270912
|
+
var import_promises49 = require("fs/promises");
|
|
1270846
1270913
|
var mime = __toESM(require_mime_types());
|
|
1270847
1270914
|
|
|
1270848
1270915
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/remote-generation/remote-workspace-runner/lib/measureImageSizes.js
|
|
@@ -1270997,7 +1271064,7 @@ async function uploadFiles(filesToUpload, docsWorkspacePath, context, batchSize)
|
|
|
1270997
1271064
|
const absoluteFilePath = resolve(docsWorkspacePath, relativeFilePath);
|
|
1270998
1271065
|
try {
|
|
1270999
1271066
|
const mimeType = mime.lookup(absoluteFilePath);
|
|
1271000
|
-
await import_axios8.default.put(uploadUrl, await (0,
|
|
1271067
|
+
await import_axios8.default.put(uploadUrl, await (0, import_promises49.readFile)(absoluteFilePath), {
|
|
1271001
1271068
|
headers: {
|
|
1271002
1271069
|
"Content-Type": mimeType === false ? "application/octet-stream" : mimeType
|
|
1271003
1271070
|
}
|
|
@@ -1271577,7 +1271644,7 @@ async function mockServer({
|
|
|
1271577
1271644
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/register/registerWorkspacesV1.ts
|
|
1271578
1271645
|
var import_fiddle_sdk6 = __toESM(require_fiddle_sdk());
|
|
1271579
1271646
|
var import_axios9 = __toESM(require_axios4());
|
|
1271580
|
-
var
|
|
1271647
|
+
var import_promises50 = require("fs/promises");
|
|
1271581
1271648
|
var import_path41 = __toESM(require("path"));
|
|
1271582
1271649
|
var import_tar3 = __toESM(require_tar());
|
|
1271583
1271650
|
var import_tmp_promise11 = __toESM(require_tmp_promise());
|
|
@@ -1271626,7 +1271693,7 @@ async function registerWorkspacesV1({
|
|
|
1271626
1271693
|
context.logger.debug(`Compressing definition at ${tmpDir.path}`);
|
|
1271627
1271694
|
await import_tar3.default.create({ file: tarPath, cwd: workspace.absoluteFilepath }, ["."]);
|
|
1271628
1271695
|
context.logger.info("Uploading definition...");
|
|
1271629
|
-
await import_axios9.default.put(registerApiResponse.body.definitionS3UploadUrl, await (0,
|
|
1271696
|
+
await import_axios9.default.put(registerApiResponse.body.definitionS3UploadUrl, await (0, import_promises50.readFile)(tarPath));
|
|
1271630
1271697
|
context.logger.info(
|
|
1271631
1271698
|
`Registered @${project.config.organization}/${workspace.definition.rootApiFile.contents.name}:${registerApiResponse.body.version}`
|
|
1271632
1271699
|
);
|
|
@@ -1271750,20 +1271817,20 @@ async function generateToken({
|
|
|
1271750
1271817
|
|
|
1271751
1271818
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/upgrade/updateApiSpec.ts
|
|
1271752
1271819
|
var fs9 = __toESM(require("fs"));
|
|
1271753
|
-
var
|
|
1271820
|
+
var import_promises51 = require("fs/promises");
|
|
1271754
1271821
|
var import_stream5 = require("stream");
|
|
1271755
|
-
var
|
|
1271822
|
+
var import_promises52 = require("stream/promises");
|
|
1271756
1271823
|
async function fetchAndWriteFile(url, path44, logger) {
|
|
1271757
1271824
|
const resp = await fetch(url);
|
|
1271758
1271825
|
if (resp.ok && resp.body) {
|
|
1271759
1271826
|
logger.debug("Origin successfully fetched, writing to file");
|
|
1271760
1271827
|
const fileStream = fs9.createWriteStream(path44);
|
|
1271761
|
-
await (0,
|
|
1271762
|
-
const fileContents = await (0,
|
|
1271828
|
+
await (0, import_promises52.finished)(import_stream5.Readable.fromWeb(resp.body).pipe(fileStream));
|
|
1271829
|
+
const fileContents = await (0, import_promises51.readFile)(path44, "utf8");
|
|
1271763
1271830
|
try {
|
|
1271764
|
-
await (0,
|
|
1271831
|
+
await (0, import_promises51.writeFile)(path44, JSON.stringify(JSON.parse(fileContents), void 0, 2), "utf8");
|
|
1271765
1271832
|
} catch (e) {
|
|
1271766
|
-
await (0,
|
|
1271833
|
+
await (0, import_promises51.writeFile)(path44, js_yaml_default.dump(js_yaml_default.load(fileContents)), "utf8");
|
|
1271767
1271834
|
}
|
|
1271768
1271835
|
logger.debug("File written successfully");
|
|
1271769
1271836
|
}
|
|
@@ -1271837,17 +1271904,17 @@ async function updateApiSpec({
|
|
|
1271837
1271904
|
}
|
|
1271838
1271905
|
|
|
1271839
1271906
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/migration.js
|
|
1271840
|
-
var
|
|
1271907
|
+
var import_promises55 = require("fs/promises");
|
|
1271841
1271908
|
|
|
1271842
1271909
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/loadWorkspaces.js
|
|
1271843
|
-
var
|
|
1271910
|
+
var import_promises53 = require("fs/promises");
|
|
1271844
1271911
|
var FERN_DIRECTORY2 = "fern";
|
|
1271845
1271912
|
async function loadWorkspaces(context) {
|
|
1271846
1271913
|
const fernDirectory = await getFernDirectory2();
|
|
1271847
1271914
|
if (fernDirectory == null) {
|
|
1271848
1271915
|
context.failAndThrow(`Directory "${FERN_DIRECTORY2}" not found.`);
|
|
1271849
1271916
|
}
|
|
1271850
|
-
const fernDirectoryContents = await (0,
|
|
1271917
|
+
const fernDirectoryContents = await (0, import_promises53.readdir)(fernDirectory, { withFileTypes: true });
|
|
1271851
1271918
|
return fernDirectoryContents.reduce((all5, item) => {
|
|
1271852
1271919
|
if (item.isDirectory()) {
|
|
1271853
1271920
|
all5.push(join(fernDirectory, RelativeFilePath.of(item.name)));
|
|
@@ -1271882,7 +1271949,7 @@ function convertGeneratorsConfiguration2({ absolutePathToGeneratorsConfiguration
|
|
|
1271882
1271949
|
}
|
|
1271883
1271950
|
|
|
1271884
1271951
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/old-configuration/loadRawGeneratorsConfiguration.js
|
|
1271885
|
-
var
|
|
1271952
|
+
var import_promises54 = require("fs/promises");
|
|
1271886
1271953
|
|
|
1271887
1271954
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/old-configuration/schemas/GenerateConfigSchema.js
|
|
1271888
1271955
|
var GenerateConfigSchema = z.strictObject({
|
|
@@ -1271905,7 +1271972,7 @@ var GeneratorsConfigurationSchema2 = z.strictObject({
|
|
|
1271905
1271972
|
|
|
1271906
1271973
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/old-configuration/loadRawGeneratorsConfiguration.js
|
|
1271907
1271974
|
async function loadRawGeneratorsConfiguration2({ absolutePathToGeneratorsConfiguration, context }) {
|
|
1271908
|
-
const contentsStr = await (0,
|
|
1271975
|
+
const contentsStr = await (0, import_promises54.readFile)(absolutePathToGeneratorsConfiguration);
|
|
1271909
1271976
|
const contentsParsed = js_yaml_default.load(contentsStr.toString());
|
|
1271910
1271977
|
return await validateSchema({
|
|
1271911
1271978
|
schema: GeneratorsConfigurationSchema2,
|
|
@@ -1271941,7 +1272008,7 @@ async function migrateWorkspace(pathToWorkspace, context) {
|
|
|
1271941
1272008
|
rawGeneratorsConfiguration: oldRawConfiguration
|
|
1271942
1272009
|
});
|
|
1271943
1272010
|
const migratedConfiguration = migrateConfiguration(oldConfiguration);
|
|
1271944
|
-
await (0,
|
|
1272011
|
+
await (0, import_promises55.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(migratedConfiguration));
|
|
1271945
1272012
|
}
|
|
1271946
1272013
|
function migrateConfiguration(oldConfiguration) {
|
|
1271947
1272014
|
return {
|
|
@@ -1271967,7 +1272034,7 @@ var versionMigrations = {
|
|
|
1271967
1272034
|
var __default = versionMigrations;
|
|
1271968
1272035
|
|
|
1271969
1272036
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.191/discriminant/migration.js
|
|
1271970
|
-
var
|
|
1272037
|
+
var import_promises56 = require("fs/promises");
|
|
1271971
1272038
|
|
|
1271972
1272039
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.191/discriminant/getAllYamlFiles.js
|
|
1271973
1272040
|
var import_glob_promise2 = __toESM(require_lib());
|
|
@@ -1272001,7 +1272068,7 @@ var migration2 = {
|
|
|
1272001
1272068
|
try {
|
|
1272002
1272069
|
const fileContents = await getFileContents(yamlFilepath);
|
|
1272003
1272070
|
const newContents = addDiscriminantToFile(fileContents);
|
|
1272004
|
-
await (0,
|
|
1272071
|
+
await (0, import_promises56.writeFile)(yamlFilepath, newContents);
|
|
1272005
1272072
|
} catch (error) {
|
|
1272006
1272073
|
context.failAndThrow("Failed to migrate " + yamlFilepath, error);
|
|
1272007
1272074
|
}
|
|
@@ -1272009,7 +1272076,7 @@ var migration2 = {
|
|
|
1272009
1272076
|
}
|
|
1272010
1272077
|
};
|
|
1272011
1272078
|
async function getFileContents(filepath) {
|
|
1272012
|
-
const buffer3 = await (0,
|
|
1272079
|
+
const buffer3 = await (0, import_promises56.readFile)(filepath);
|
|
1272013
1272080
|
return buffer3.toString();
|
|
1272014
1272081
|
}
|
|
1272015
1272082
|
var UNION_REGEX = /^(\s{2,})union:\s*$/gm;
|
|
@@ -1272038,7 +1272105,7 @@ var versionMigrations2 = {
|
|
|
1272038
1272105
|
var __default2 = versionMigrations2;
|
|
1272039
1272106
|
|
|
1272040
1272107
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.203/union-single-property-key/migration.js
|
|
1272041
|
-
var
|
|
1272108
|
+
var import_promises57 = require("fs/promises");
|
|
1272042
1272109
|
var import_yaml = __toESM(require_dist4());
|
|
1272043
1272110
|
|
|
1272044
1272111
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.203/union-single-property-key/getAllYamlFiles.js
|
|
@@ -1272079,7 +1272146,7 @@ var migration3 = {
|
|
|
1272079
1272146
|
}
|
|
1272080
1272147
|
};
|
|
1272081
1272148
|
async function migrateFile(filepath, context) {
|
|
1272082
|
-
const contents = await (0,
|
|
1272149
|
+
const contents = await (0, import_promises57.readFile)(filepath);
|
|
1272083
1272150
|
const parsedDocument = import_yaml.default.parseDocument(contents.toString());
|
|
1272084
1272151
|
const types3 = parsedDocument.get("types");
|
|
1272085
1272152
|
if (types3 == null) {
|
|
@@ -1272111,7 +1272178,7 @@ async function migrateFile(filepath, context) {
|
|
|
1272111
1272178
|
}
|
|
1272112
1272179
|
}
|
|
1272113
1272180
|
}
|
|
1272114
|
-
await (0,
|
|
1272181
|
+
await (0, import_promises57.writeFile)(filepath, parsedDocument.toString());
|
|
1272115
1272182
|
}
|
|
1272116
1272183
|
|
|
1272117
1272184
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.203/index.js
|
|
@@ -1272122,7 +1272189,7 @@ var versionMigrations3 = {
|
|
|
1272122
1272189
|
var __default3 = versionMigrations3;
|
|
1272123
1272190
|
|
|
1272124
1272191
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/migration.js
|
|
1272125
|
-
var
|
|
1272192
|
+
var import_promises58 = require("fs/promises");
|
|
1272126
1272193
|
var import_yaml2 = __toESM(require_dist4());
|
|
1272127
1272194
|
|
|
1272128
1272195
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/getAllGeneratorYamlFiles.js
|
|
@@ -1272163,7 +1272230,7 @@ var migration4 = {
|
|
|
1272163
1272230
|
}
|
|
1272164
1272231
|
};
|
|
1272165
1272232
|
async function migrateGeneratorsYml(filepath, context) {
|
|
1272166
|
-
const contents = await (0,
|
|
1272233
|
+
const contents = await (0, import_promises58.readFile)(filepath);
|
|
1272167
1272234
|
const parsedDocument = import_yaml2.default.parseDocument(contents.toString());
|
|
1272168
1272235
|
const draftGenerators = parsedDocument.get("draft");
|
|
1272169
1272236
|
if (draftGenerators == null) {
|
|
@@ -1272190,7 +1272257,7 @@ async function migrateGeneratorsYml(filepath, context) {
|
|
|
1272190
1272257
|
draftGenerator.set("output-path", name3.value.includes("openapi") ? "./generated-openapi" : name3.value.includes("postman") ? "./generated-postman" : localOutput);
|
|
1272191
1272258
|
}
|
|
1272192
1272259
|
});
|
|
1272193
|
-
await (0,
|
|
1272260
|
+
await (0, import_promises58.writeFile)(filepath, parsedDocument.toString());
|
|
1272194
1272261
|
}
|
|
1272195
1272262
|
|
|
1272196
1272263
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.207/index.js
|
|
@@ -1272201,7 +1272268,7 @@ var versionMigrations4 = {
|
|
|
1272201
1272268
|
var __default4 = versionMigrations4;
|
|
1272202
1272269
|
|
|
1272203
1272270
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/migration.js
|
|
1272204
|
-
var
|
|
1272271
|
+
var import_promises59 = require("fs/promises");
|
|
1272205
1272272
|
var import_yaml3 = __toESM(require_dist4());
|
|
1272206
1272273
|
|
|
1272207
1272274
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/getAllYamlFiles.js
|
|
@@ -1272242,7 +1272309,7 @@ var migration5 = {
|
|
|
1272242
1272309
|
}
|
|
1272243
1272310
|
};
|
|
1272244
1272311
|
async function migrateFile2(filepath, context) {
|
|
1272245
|
-
const contents = await (0,
|
|
1272312
|
+
const contents = await (0, import_promises59.readFile)(filepath);
|
|
1272246
1272313
|
const parsedDocument = import_yaml3.default.parseDocument(contents.toString());
|
|
1272247
1272314
|
const addType = (typeName, typeDeclaration) => {
|
|
1272248
1272315
|
const types3 = parsedDocument.get("types");
|
|
@@ -1272286,7 +1272353,7 @@ async function migrateFile2(filepath, context) {
|
|
|
1272286
1272353
|
}
|
|
1272287
1272354
|
}
|
|
1272288
1272355
|
}
|
|
1272289
|
-
await (0,
|
|
1272356
|
+
await (0, import_promises59.writeFile)(filepath, parsedDocument.toString());
|
|
1272290
1272357
|
}
|
|
1272291
1272358
|
|
|
1272292
1272359
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.210/index.js
|
|
@@ -1272297,7 +1272364,7 @@ var versionMigrations5 = {
|
|
|
1272297
1272364
|
var __default5 = versionMigrations5;
|
|
1272298
1272365
|
|
|
1272299
1272366
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/migration.js
|
|
1272300
|
-
var
|
|
1272367
|
+
var import_promises60 = require("fs/promises");
|
|
1272301
1272368
|
var import_yaml4 = __toESM(require_dist4());
|
|
1272302
1272369
|
|
|
1272303
1272370
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/getAllGeneratorYamlFiles.js
|
|
@@ -1272338,7 +1272405,7 @@ var migration6 = {
|
|
|
1272338
1272405
|
}
|
|
1272339
1272406
|
};
|
|
1272340
1272407
|
async function migrateGeneratorsYml2(filepath, context) {
|
|
1272341
|
-
const contents = await (0,
|
|
1272408
|
+
const contents = await (0, import_promises60.readFile)(filepath);
|
|
1272342
1272409
|
const parsedDocument = import_yaml4.default.parseDocument(contents.toString());
|
|
1272343
1272410
|
const releaseGenerators = parsedDocument.get("release");
|
|
1272344
1272411
|
if (releaseGenerators == null) {
|
|
@@ -1272376,7 +1272443,7 @@ async function migrateGeneratorsYml2(filepath, context) {
|
|
|
1272376
1272443
|
}
|
|
1272377
1272444
|
releaseGenerator.delete("outputs");
|
|
1272378
1272445
|
});
|
|
1272379
|
-
await (0,
|
|
1272446
|
+
await (0, import_promises60.writeFile)(filepath, parsedDocument.toString());
|
|
1272380
1272447
|
}
|
|
1272381
1272448
|
|
|
1272382
1272449
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.212/index.js
|
|
@@ -1272387,7 +1272454,7 @@ var versionMigrations6 = {
|
|
|
1272387
1272454
|
var __default6 = versionMigrations6;
|
|
1272388
1272455
|
|
|
1272389
1272456
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/migration.js
|
|
1272390
|
-
var
|
|
1272457
|
+
var import_promises61 = require("fs/promises");
|
|
1272391
1272458
|
|
|
1272392
1272459
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/getAllYamlFiles.js
|
|
1272393
1272460
|
var import_glob_promise7 = __toESM(require_lib());
|
|
@@ -1272418,9 +1272485,9 @@ var migration7 = {
|
|
|
1272418
1272485
|
run: async ({ context }) => {
|
|
1272419
1272486
|
const yamlFiles = await getAllYamlFiles4(context);
|
|
1272420
1272487
|
for (const filepath of yamlFiles) {
|
|
1272421
|
-
const contents = await (0,
|
|
1272488
|
+
const contents = await (0, import_promises61.readFile)(filepath);
|
|
1272422
1272489
|
const newContents = contents.toString().replaceAll(" alias:", " type:");
|
|
1272423
|
-
await (0,
|
|
1272490
|
+
await (0, import_promises61.writeFile)(filepath, newContents);
|
|
1272424
1272491
|
}
|
|
1272425
1272492
|
}
|
|
1272426
1272493
|
};
|
|
@@ -1272433,7 +1272500,7 @@ var versionMigrations7 = {
|
|
|
1272433
1272500
|
var __default7 = versionMigrations7;
|
|
1272434
1272501
|
|
|
1272435
1272502
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.221/add-error-discriminant/migration.js
|
|
1272436
|
-
var
|
|
1272503
|
+
var import_promises62 = require("fs/promises");
|
|
1272437
1272504
|
|
|
1272438
1272505
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.221/add-error-discriminant/getAllRootApiYamlFiles.js
|
|
1272439
1272506
|
var import_glob_promise8 = __toESM(require_lib());
|
|
@@ -1272464,9 +1272531,9 @@ var migration8 = {
|
|
|
1272464
1272531
|
run: async ({ context }) => {
|
|
1272465
1272532
|
const yamlFiles = await getAllRootApiYamlFiles(context);
|
|
1272466
1272533
|
for (const filepath of yamlFiles) {
|
|
1272467
|
-
const contents = await (0,
|
|
1272534
|
+
const contents = await (0, import_promises62.readFile)(filepath);
|
|
1272468
1272535
|
const newContents = contents.toString() + "\nerror-discriminant: error";
|
|
1272469
|
-
await (0,
|
|
1272536
|
+
await (0, import_promises62.writeFile)(filepath, newContents);
|
|
1272470
1272537
|
}
|
|
1272471
1272538
|
}
|
|
1272472
1272539
|
};
|
|
@@ -1272479,7 +1272546,7 @@ var versionMigrations8 = {
|
|
|
1272479
1272546
|
var __default8 = versionMigrations8;
|
|
1272480
1272547
|
|
|
1272481
1272548
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.241/add-generator-groups/migration.js
|
|
1272482
|
-
var
|
|
1272549
|
+
var import_promises63 = require("fs/promises");
|
|
1272483
1272550
|
|
|
1272484
1272551
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.241/add-generator-groups/getAllGeneratorYamlFiles.js
|
|
1272485
1272552
|
var import_glob_promise9 = __toESM(require_lib());
|
|
@@ -1272586,7 +1272653,7 @@ var migration9 = {
|
|
|
1272586
1272653
|
}
|
|
1272587
1272654
|
};
|
|
1272588
1272655
|
async function migrateGeneratorsYml3(filepath) {
|
|
1272589
|
-
const contentsStr = await (0,
|
|
1272656
|
+
const contentsStr = await (0, import_promises63.readFile)(filepath);
|
|
1272590
1272657
|
const contents = js_yaml_default.load(contentsStr.toString());
|
|
1272591
1272658
|
const oldGeneratorsConfiguration = GeneratorsConfigurationSchema3.parse(contents);
|
|
1272592
1272659
|
let newGeneratorsConfiguration = {};
|
|
@@ -1272604,7 +1272671,7 @@ async function migrateGeneratorsYml3(filepath) {
|
|
|
1272604
1272671
|
generators: oldGeneratorsConfiguration.release.map((releaseGeneratorInvocation) => convertReleaseGeneratorInvocation(releaseGeneratorInvocation))
|
|
1272605
1272672
|
};
|
|
1272606
1272673
|
}
|
|
1272607
|
-
await (0,
|
|
1272674
|
+
await (0, import_promises63.writeFile)(filepath, js_yaml_default.dump(newGeneratorsConfiguration));
|
|
1272608
1272675
|
}
|
|
1272609
1272676
|
function convertDraftGeneratorInvocation(draftGeneratorInvocation) {
|
|
1272610
1272677
|
const newSchema = {
|
|
@@ -1272679,7 +1272746,7 @@ var versionMigrations9 = {
|
|
|
1272679
1272746
|
var __default9 = versionMigrations9;
|
|
1272680
1272747
|
|
|
1272681
1272748
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.248/add-error-discrimination-config/migration.js
|
|
1272682
|
-
var
|
|
1272749
|
+
var import_promises64 = require("fs/promises");
|
|
1272683
1272750
|
var import_yaml5 = __toESM(require_dist4());
|
|
1272684
1272751
|
|
|
1272685
1272752
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.248/add-error-discrimination-config/getAllRootApiYamlFiles.js
|
|
@@ -1272720,7 +1272787,7 @@ var migration10 = {
|
|
|
1272720
1272787
|
}
|
|
1272721
1272788
|
};
|
|
1272722
1272789
|
async function migrateRootApiFile(filepath) {
|
|
1272723
|
-
const contents = await (0,
|
|
1272790
|
+
const contents = await (0, import_promises64.readFile)(filepath);
|
|
1272724
1272791
|
const parsedDocument = import_yaml5.default.parseDocument(contents.toString());
|
|
1272725
1272792
|
const errorDiscriminant = parsedDocument.get("error-discriminant", true);
|
|
1272726
1272793
|
if (errorDiscriminant == null || !import_yaml5.default.isScalar(errorDiscriminant) || typeof errorDiscriminant.value !== "string") {
|
|
@@ -1272731,7 +1272798,7 @@ async function migrateRootApiFile(filepath) {
|
|
|
1272731
1272798
|
"property-name": errorDiscriminant.value
|
|
1272732
1272799
|
});
|
|
1272733
1272800
|
parsedDocument.delete("error-discriminant");
|
|
1272734
|
-
await (0,
|
|
1272801
|
+
await (0, import_promises64.writeFile)(filepath, parsedDocument.toString());
|
|
1272735
1272802
|
}
|
|
1272736
1272803
|
|
|
1272737
1272804
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.248/index.js
|
|
@@ -1272742,7 +1272809,7 @@ var versionMigrations10 = {
|
|
|
1272742
1272809
|
var __default10 = versionMigrations10;
|
|
1272743
1272810
|
|
|
1272744
1272811
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/migration.js
|
|
1272745
|
-
var
|
|
1272812
|
+
var import_promises65 = require("fs/promises");
|
|
1272746
1272813
|
var import_yaml6 = __toESM(require_dist4());
|
|
1272747
1272814
|
|
|
1272748
1272815
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/getAllYamlFiles.js
|
|
@@ -1272783,7 +1272850,7 @@ var migration11 = {
|
|
|
1272783
1272850
|
}
|
|
1272784
1272851
|
};
|
|
1272785
1272852
|
async function migrateYamlFile(filepath, context) {
|
|
1272786
|
-
const contents = await (0,
|
|
1272853
|
+
const contents = await (0, import_promises65.readFile)(filepath);
|
|
1272787
1272854
|
const parsedDocument = import_yaml6.default.parseDocument(contents.toString());
|
|
1272788
1272855
|
const services = parsedDocument.get("services");
|
|
1272789
1272856
|
if (services == null) {
|
|
@@ -1272823,7 +1272890,7 @@ async function migrateYamlFile(filepath, context) {
|
|
|
1272823
1272890
|
context.failWithoutThrowing("Failed to convert endpoint", e);
|
|
1272824
1272891
|
}
|
|
1272825
1272892
|
}
|
|
1272826
|
-
await (0,
|
|
1272893
|
+
await (0, import_promises65.writeFile)(filepath, parsedDocument.toString());
|
|
1272827
1272894
|
}
|
|
1272828
1272895
|
}
|
|
1272829
1272896
|
function convertEndpoint17({ document: document6, endpoint }) {
|
|
@@ -1272907,10 +1272974,10 @@ var import_legacy_docs_config = __toESM(require_legacy_docs_config());
|
|
|
1272907
1272974
|
var LegacyDocsSerializers = __toESM(require_serialization33());
|
|
1272908
1272975
|
|
|
1272909
1272976
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/loadRawDocsConfiguration.js
|
|
1272910
|
-
var
|
|
1272977
|
+
var import_promises66 = require("fs/promises");
|
|
1272911
1272978
|
async function loadRawDocsConfiguration2({ absolutePathToWorkspace }) {
|
|
1272912
1272979
|
const filepath = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
1272913
|
-
const contentsStr = await (0,
|
|
1272980
|
+
const contentsStr = await (0, import_promises66.readFile)(filepath);
|
|
1272914
1272981
|
const contentsParsed = js_yaml_default.load(contentsStr.toString());
|
|
1272915
1272982
|
const result2 = await LegacyDocsSerializers.DocsConfiguration.parse(contentsParsed);
|
|
1272916
1272983
|
if (result2.ok) {
|
|
@@ -1272928,7 +1272995,7 @@ function getAbsolutePathToDocsFolder({ absolutePathToWorkspace }) {
|
|
|
1272928
1272995
|
}
|
|
1272929
1272996
|
|
|
1272930
1272997
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndMultipleAPIs.js
|
|
1272931
|
-
var
|
|
1272998
|
+
var import_promises68 = require("fs/promises");
|
|
1272932
1272999
|
|
|
1272933
1273000
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/convertLegacyDocsConfig.js
|
|
1272934
1273001
|
function convertLegacyDocsConfig({ docsConfiguration, docsURLs, apiName }) {
|
|
@@ -1273109,10 +1273176,10 @@ __export(legacy_exports, {
|
|
|
1273109
1273176
|
});
|
|
1273110
1273177
|
|
|
1273111
1273178
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/generators-configuration/loadRawGeneratorsConfiguration.js
|
|
1273112
|
-
var
|
|
1273179
|
+
var import_promises67 = require("fs/promises");
|
|
1273113
1273180
|
async function loadRawGeneratorsConfiguration3({ absolutePathToWorkspace }) {
|
|
1273114
1273181
|
const filepath = getAbsolutePathToGeneratorsConfiguration({ absolutePathToWorkspace });
|
|
1273115
|
-
const contentsStr = await (0,
|
|
1273182
|
+
const contentsStr = await (0, import_promises67.readFile)(filepath);
|
|
1273116
1273183
|
const contentsParsed = js_yaml_default.load(contentsStr.toString());
|
|
1273117
1273184
|
const result2 = await legacy_exports.GeneratorsConfigurationSchema.safeParseAsync(contentsParsed);
|
|
1273118
1273185
|
if (result2.success) {
|
|
@@ -1273232,7 +1273299,7 @@ function migrateDocsInstances(docsURLs) {
|
|
|
1273232
1273299
|
var APIS_DIRECTORY2 = "apis";
|
|
1273233
1273300
|
async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspaces, workspaceContainingDocs }) {
|
|
1273234
1273301
|
const absolutePathToApisDirectory = join(absolutePathToFernDirectory, RelativeFilePath.of(APIS_DIRECTORY2));
|
|
1273235
|
-
await (0,
|
|
1273302
|
+
await (0, import_promises68.mkdir)(absolutePathToApisDirectory);
|
|
1273236
1273303
|
for (const workspace of workspaces) {
|
|
1273237
1273304
|
const absolutePathToWorkspace = join(absolutePathToFernDirectory, RelativeFilePath.of(workspace));
|
|
1273238
1273305
|
const docsURLs = await migrateAndWriteGeneratorsYml({ absolutePathToWorkspace });
|
|
@@ -1273240,11 +1273307,11 @@ async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspa
|
|
|
1273240
1273307
|
await migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName: workspaceContainingDocs });
|
|
1273241
1273308
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
1273242
1273309
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
1273243
|
-
await (0,
|
|
1273310
|
+
await (0, import_promises68.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
1273244
1273311
|
}
|
|
1273245
1273312
|
const absolutePathToNestedWorkspace = join(absolutePathToApisDirectory, RelativeFilePath.of(workspace));
|
|
1273246
1273313
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
1273247
|
-
await (0,
|
|
1273314
|
+
await (0, import_promises68.rm)(absolutePathToWorkspace, { recursive: true });
|
|
1273248
1273315
|
}
|
|
1273249
1273316
|
}
|
|
1273250
1273317
|
async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
@@ -1273257,7 +1273324,7 @@ async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
|
1273257
1273324
|
generatorsConfiguration,
|
|
1273258
1273325
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
1273259
1273326
|
});
|
|
1273260
|
-
await (0,
|
|
1273327
|
+
await (0, import_promises68.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
1273261
1273328
|
return convertedResponse.docsURLs;
|
|
1273262
1273329
|
}
|
|
1273263
1273330
|
async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName }) {
|
|
@@ -1273271,19 +1273338,19 @@ async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiNa
|
|
|
1273271
1273338
|
apiName
|
|
1273272
1273339
|
});
|
|
1273273
1273340
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
1273274
|
-
await (0,
|
|
1273341
|
+
await (0, import_promises68.writeFile)(absolutePathToDocsConfig, js_yaml_default.dump(convertedDocsConfig));
|
|
1273275
1273342
|
}
|
|
1273276
1273343
|
|
|
1273277
1273344
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndSingleAPI.js
|
|
1273278
|
-
var
|
|
1273345
|
+
var import_promises69 = require("fs/promises");
|
|
1273279
1273346
|
async function migrateDocsAndSingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
1273280
1273347
|
const docsURLs = await migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace });
|
|
1273281
1273348
|
await migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs });
|
|
1273282
1273349
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
1273283
1273350
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
1273284
1273351
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
1273285
|
-
await (0,
|
|
1273286
|
-
await (0,
|
|
1273352
|
+
await (0, import_promises69.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
1273353
|
+
await (0, import_promises69.rm)(absolutePathToWorkspace, { recursive: true });
|
|
1273287
1273354
|
}
|
|
1273288
1273355
|
async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
1273289
1273356
|
const docsConfiguration = await loadRawDocsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -1273296,7 +1273363,7 @@ async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
|
1273296
1273363
|
apiName: void 0
|
|
1273297
1273364
|
});
|
|
1273298
1273365
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
1273299
|
-
await (0,
|
|
1273366
|
+
await (0, import_promises69.writeFile)(absolutePathToDocsConfig, js_yaml_default.dump(convertedDocsConfig));
|
|
1273300
1273367
|
}
|
|
1273301
1273368
|
async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
1273302
1273369
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration3({ absolutePathToWorkspace });
|
|
@@ -1273308,22 +1273375,22 @@ async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
|
1273308
1273375
|
generatorsConfiguration,
|
|
1273309
1273376
|
pathModificationStrategy: "MoveUp"
|
|
1273310
1273377
|
});
|
|
1273311
|
-
await (0,
|
|
1273378
|
+
await (0, import_promises69.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
1273312
1273379
|
return convertedResponse.docsURLs;
|
|
1273313
1273380
|
}
|
|
1273314
1273381
|
|
|
1273315
1273382
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlyMultipleAPIs.js
|
|
1273316
|
-
var
|
|
1273383
|
+
var import_promises70 = require("fs/promises");
|
|
1273317
1273384
|
var APIS_DIRECTORY3 = "apis";
|
|
1273318
1273385
|
async function migrateOnlyMultipleAPIs({ absolutePathToFernDirectory, workspaces }) {
|
|
1273319
1273386
|
const absolutePathToApisDirectory = join(absolutePathToFernDirectory, RelativeFilePath.of(APIS_DIRECTORY3));
|
|
1273320
|
-
await (0,
|
|
1273387
|
+
await (0, import_promises70.mkdir)(absolutePathToApisDirectory);
|
|
1273321
1273388
|
for (const workspace of workspaces) {
|
|
1273322
1273389
|
const absolutePathToWorkspace = join(absolutePathToFernDirectory, RelativeFilePath.of(workspace));
|
|
1273323
1273390
|
await migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace });
|
|
1273324
1273391
|
const absolutePathToNestedWorkspace = join(absolutePathToApisDirectory, RelativeFilePath.of(workspace));
|
|
1273325
1273392
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
1273326
|
-
await (0,
|
|
1273393
|
+
await (0, import_promises70.rm)(absolutePathToWorkspace, { recursive: true });
|
|
1273327
1273394
|
}
|
|
1273328
1273395
|
}
|
|
1273329
1273396
|
async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
@@ -1273336,15 +1273403,15 @@ async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
|
1273336
1273403
|
generatorsConfiguration,
|
|
1273337
1273404
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
1273338
1273405
|
});
|
|
1273339
|
-
await (0,
|
|
1273406
|
+
await (0, import_promises70.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
1273340
1273407
|
}
|
|
1273341
1273408
|
|
|
1273342
1273409
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlySingleAPI.js
|
|
1273343
|
-
var
|
|
1273410
|
+
var import_promises71 = require("fs/promises");
|
|
1273344
1273411
|
async function migrateOnlySingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
1273345
1273412
|
await migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace });
|
|
1273346
1273413
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
1273347
|
-
await (0,
|
|
1273414
|
+
await (0, import_promises71.rmdir)(absolutePathToWorkspace, { recursive: true });
|
|
1273348
1273415
|
}
|
|
1273349
1273416
|
async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
1273350
1273417
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration3({ absolutePathToWorkspace });
|
|
@@ -1273356,7 +1273423,7 @@ async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
|
1273356
1273423
|
generatorsConfiguration,
|
|
1273357
1273424
|
pathModificationStrategy: "MoveUp"
|
|
1273358
1273425
|
});
|
|
1273359
|
-
await (0,
|
|
1273426
|
+
await (0, import_promises71.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
1273360
1273427
|
}
|
|
1273361
1273428
|
|
|
1273362
1273429
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migration.js
|
|
@@ -1273433,7 +1273500,7 @@ var versionMigrations12 = {
|
|
|
1273433
1273500
|
var __default12 = versionMigrations12;
|
|
1273434
1273501
|
|
|
1273435
1273502
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/migration.js
|
|
1273436
|
-
var
|
|
1273503
|
+
var import_promises72 = require("fs/promises");
|
|
1273437
1273504
|
var import_yaml7 = __toESM(require_dist4());
|
|
1273438
1273505
|
|
|
1273439
1273506
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/getAllYamlFiles.js
|
|
@@ -1273474,7 +1273541,7 @@ var migration13 = {
|
|
|
1273474
1273541
|
}
|
|
1273475
1273542
|
};
|
|
1273476
1273543
|
async function migrateYamlFile2(filepath, context) {
|
|
1273477
|
-
const contents = await (0,
|
|
1273544
|
+
const contents = await (0, import_promises72.readFile)(filepath);
|
|
1273478
1273545
|
const parsedDocument = import_yaml7.default.parseDocument(contents.toString());
|
|
1273479
1273546
|
const types3 = parsedDocument.get("types");
|
|
1273480
1273547
|
if (types3 == null) {
|
|
@@ -1273500,7 +1273567,7 @@ async function migrateYamlFile2(filepath, context) {
|
|
|
1273500
1273567
|
examples.set(i2, { value });
|
|
1273501
1273568
|
}
|
|
1273502
1273569
|
}
|
|
1273503
|
-
await (0,
|
|
1273570
|
+
await (0, import_promises72.writeFile)(filepath, parsedDocument.toString());
|
|
1273504
1273571
|
}
|
|
1273505
1273572
|
|
|
1273506
1273573
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.0-rc12/index.js
|
|
@@ -1273511,7 +1273578,7 @@ var versionMigrations13 = {
|
|
|
1273511
1273578
|
var __default13 = versionMigrations13;
|
|
1273512
1273579
|
|
|
1273513
1273580
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.23/change-services-key-to-service/migration.js
|
|
1273514
|
-
var
|
|
1273581
|
+
var import_promises73 = require("fs/promises");
|
|
1273515
1273582
|
var import_yaml8 = __toESM(require_dist4());
|
|
1273516
1273583
|
|
|
1273517
1273584
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.23/change-services-key-to-service/getAllYamlFiles.js
|
|
@@ -1273552,7 +1273619,7 @@ var migration14 = {
|
|
|
1273552
1273619
|
}
|
|
1273553
1273620
|
};
|
|
1273554
1273621
|
async function migrateYamlFile3(filepath, context) {
|
|
1273555
|
-
const contents = await (0,
|
|
1273622
|
+
const contents = await (0, import_promises73.readFile)(filepath);
|
|
1273556
1273623
|
const parsedDocument = import_yaml8.default.parseDocument(contents.toString());
|
|
1273557
1273624
|
if (!import_yaml8.default.isMap(parsedDocument.contents)) {
|
|
1273558
1273625
|
return context.failAndThrow("File is not a map");
|
|
@@ -1273582,7 +1273649,7 @@ async function migrateYamlFile3(filepath, context) {
|
|
|
1273582
1273649
|
pair.value = firstService.value;
|
|
1273583
1273650
|
}
|
|
1273584
1273651
|
}
|
|
1273585
|
-
await (0,
|
|
1273652
|
+
await (0, import_promises73.writeFile)(filepath, parsedDocument.toString());
|
|
1273586
1273653
|
}
|
|
1273587
1273654
|
|
|
1273588
1273655
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.23/index.js
|
|
@@ -1273593,7 +1273660,7 @@ var versionMigrations14 = {
|
|
|
1273593
1273660
|
var __default14 = versionMigrations14;
|
|
1273594
1273661
|
|
|
1273595
1273662
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/migration.js
|
|
1273596
|
-
var
|
|
1273663
|
+
var import_promises74 = require("fs/promises");
|
|
1273597
1273664
|
var import_yaml9 = __toESM(require_dist4());
|
|
1273598
1273665
|
|
|
1273599
1273666
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/getAllYamlFiles.js
|
|
@@ -1273634,7 +1273701,7 @@ var migration15 = {
|
|
|
1273634
1273701
|
}
|
|
1273635
1273702
|
};
|
|
1273636
1273703
|
async function migrateYamlFile4(filepath, context) {
|
|
1273637
|
-
const contents = await (0,
|
|
1273704
|
+
const contents = await (0, import_promises74.readFile)(filepath);
|
|
1273638
1273705
|
const parsedDocument = import_yaml9.default.parseDocument(contents.toString());
|
|
1273639
1273706
|
if (!import_yaml9.default.isMap(parsedDocument.contents)) {
|
|
1273640
1273707
|
return context.failAndThrow("File is not a map");
|
|
@@ -1273653,7 +1273720,7 @@ async function migrateYamlFile4(filepath, context) {
|
|
|
1273653
1273720
|
}
|
|
1273654
1273721
|
service.items.splice(indexOfServiceDocsPair, 1);
|
|
1273655
1273722
|
parsedDocument.contents.items.unshift(docsPair);
|
|
1273656
|
-
await (0,
|
|
1273723
|
+
await (0, import_promises74.writeFile)(filepath, parsedDocument.toString());
|
|
1273657
1273724
|
}
|
|
1273658
1273725
|
|
|
1273659
1273726
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.5.4/index.js
|
|
@@ -1273664,7 +1273731,7 @@ var versionMigrations15 = {
|
|
|
1273664
1273731
|
var __default15 = versionMigrations15;
|
|
1273665
1273732
|
|
|
1273666
1273733
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/migration.js
|
|
1273667
|
-
var
|
|
1273734
|
+
var import_promises75 = require("fs/promises");
|
|
1273668
1273735
|
|
|
1273669
1273736
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/getAllGeneratorYamlFiles.js
|
|
1273670
1273737
|
var import_glob_promise15 = __toESM(require_lib());
|
|
@@ -1273704,14 +1273771,14 @@ var migration16 = {
|
|
|
1273704
1273771
|
}
|
|
1273705
1273772
|
};
|
|
1273706
1273773
|
async function migrateYamlFile5(filepath) {
|
|
1273707
|
-
const contents = await (0,
|
|
1273774
|
+
const contents = await (0, import_promises75.readFile)(filepath);
|
|
1273708
1273775
|
const domainSuffix = process.env.DOMAIN_SUFFIX ?? "docs.buildwithfern.com";
|
|
1273709
1273776
|
const regex3 = /(docs:\s*domain:\s*)"([^"]*)"/g;
|
|
1273710
1273777
|
const updatedSnapshot = contents.toString().replace(regex3, (_match, _prefix, domain2) => {
|
|
1273711
1273778
|
return `docs:
|
|
1273712
1273779
|
domain: "${domain2}.${domainSuffix}"`;
|
|
1273713
1273780
|
});
|
|
1273714
|
-
await (0,
|
|
1273781
|
+
await (0, import_promises75.writeFile)(filepath, updatedSnapshot.toString());
|
|
1273715
1273782
|
}
|
|
1273716
1273783
|
|
|
1273717
1273784
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.9.10/index.js
|
|
@@ -1273813,7 +1273880,7 @@ ${source_default.dim(migration17.summary)}`
|
|
|
1273813
1273880
|
}
|
|
1273814
1273881
|
|
|
1273815
1273882
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/upgrade/upgrade.ts
|
|
1273816
|
-
var
|
|
1273883
|
+
var import_promises76 = require("fs/promises");
|
|
1273817
1273884
|
|
|
1273818
1273885
|
// pnp:/home/runner/work/fern/fern/.yarn/cache/immer-npm-9.0.15-6c734225db-92e3d63e81.zip/node_modules/immer/dist/immer.esm.mjs
|
|
1273819
1273886
|
function n(n2) {
|
|
@@ -1274302,7 +1274369,7 @@ async function upgrade({
|
|
|
1274302
1274369
|
const newProjectConfig = immer_esm_default(projectConfig.rawConfig, (draft) => {
|
|
1274303
1274370
|
draft.version = fernCliUpgradeInfo.latestVersion;
|
|
1274304
1274371
|
});
|
|
1274305
|
-
await (0,
|
|
1274372
|
+
await (0, import_promises76.writeFile)(projectConfig._absolutePath, JSON.stringify(newProjectConfig, void 0, 2));
|
|
1274306
1274373
|
cliContext.logger.info(
|
|
1274307
1274374
|
`Upgrading from ${source_default.dim(cliContext.environment.packageVersion)} \u2192 ${source_default.green(
|
|
1274308
1274375
|
fernCliUpgradeInfo.latestVersion
|
|
@@ -1274324,7 +1274391,7 @@ async function upgrade({
|
|
|
1274324
1274391
|
}
|
|
1274325
1274392
|
|
|
1274326
1274393
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/upgrade/upgradeGenerator.ts
|
|
1274327
|
-
var
|
|
1274394
|
+
var import_promises77 = require("fs/promises");
|
|
1274328
1274395
|
var import_path42 = __toESM(require("path"));
|
|
1274329
1274396
|
var semver3 = __toESM(require_semver8());
|
|
1274330
1274397
|
var import_yaml10 = __toESM(require_dist4());
|
|
@@ -1274340,7 +1274407,7 @@ async function loadAndUpdateGenerators({
|
|
|
1274340
1274407
|
context.failAndThrow("Generators configuration file was not found, no generators to upgrade.");
|
|
1274341
1274408
|
return void 0;
|
|
1274342
1274409
|
}
|
|
1274343
|
-
const contents = await (0,
|
|
1274410
|
+
const contents = await (0, import_promises77.readFile)(filepath);
|
|
1274344
1274411
|
context.logger.debug(`Found generators: ${contents.toString()}`);
|
|
1274345
1274412
|
const parsedDocument = import_yaml10.default.parseDocument(contents.toString());
|
|
1274346
1274413
|
const generatorGroups = parsedDocument.get("groups");
|
|
@@ -1274430,7 +1274497,7 @@ async function upgradeGenerator2({
|
|
|
1274430
1274497
|
includeMajor
|
|
1274431
1274498
|
});
|
|
1274432
1274499
|
if (updatedConfiguration != null) {
|
|
1274433
|
-
await (0,
|
|
1274500
|
+
await (0, import_promises77.writeFile)(
|
|
1274434
1274501
|
((_a5 = workspace.generatorsConfiguration) == null ? void 0 : _a5.absolutePathToConfiguration) ?? generators_yml_exports.getPathToGeneratorsConfiguration({
|
|
1274435
1274502
|
absolutePathToWorkspace: workspace.absoluteFilepath
|
|
1274436
1274503
|
}),
|
|
@@ -1274465,7 +1274532,7 @@ async function validateWorkspaces({
|
|
|
1274465
1274532
|
}
|
|
1274466
1274533
|
|
|
1274467
1274534
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/write-definition/writeDefinitionForWorkspaces.ts
|
|
1274468
|
-
var
|
|
1274535
|
+
var import_promises78 = require("fs/promises");
|
|
1274469
1274536
|
var import_path43 = __toESM(require("path"));
|
|
1274470
1274537
|
async function writeDefinitionForWorkspaces({
|
|
1274471
1274538
|
project,
|
|
@@ -1274527,22 +1274594,22 @@ async function writeFernDefinition2({
|
|
|
1274527
1274594
|
absolutePathToOutputDirectory
|
|
1274528
1274595
|
}) {
|
|
1274529
1274596
|
if (await doesPathExist(absolutePathToOutputDirectory)) {
|
|
1274530
|
-
await (0,
|
|
1274597
|
+
await (0, import_promises78.rmdir)(absolutePathToOutputDirectory, { recursive: true });
|
|
1274531
1274598
|
}
|
|
1274532
|
-
await (0,
|
|
1274533
|
-
await (0,
|
|
1274599
|
+
await (0, import_promises78.mkdir)(absolutePathToOutputDirectory, { recursive: true });
|
|
1274600
|
+
await (0, import_promises78.writeFile)(
|
|
1274534
1274601
|
join(absolutePathToOutputDirectory, RelativeFilePath.of(ROOT_API_FILENAME)),
|
|
1274535
1274602
|
js_yaml_default.dump(definition3.rootApiFile.contents)
|
|
1274536
1274603
|
);
|
|
1274537
1274604
|
for (const [relativePath, packageMarker] of Object.entries(definition3.packageMarkers)) {
|
|
1274538
1274605
|
const absoluteFilepath = join(absolutePathToOutputDirectory, RelativeFilePath.of(relativePath));
|
|
1274539
|
-
await (0,
|
|
1274540
|
-
await (0,
|
|
1274606
|
+
await (0, import_promises78.mkdir)(dirname(absoluteFilepath), { recursive: true });
|
|
1274607
|
+
await (0, import_promises78.writeFile)(absoluteFilepath, js_yaml_default.dump(packageMarker.contents));
|
|
1274541
1274608
|
}
|
|
1274542
1274609
|
for (const [relativePath, definitionFile] of Object.entries(definition3.namedDefinitionFiles)) {
|
|
1274543
1274610
|
const absoluteFilepath = join(absolutePathToOutputDirectory, RelativeFilePath.of(relativePath));
|
|
1274544
|
-
await (0,
|
|
1274545
|
-
await (0,
|
|
1274611
|
+
await (0, import_promises78.mkdir)(dirname(absoluteFilepath), { recursive: true });
|
|
1274612
|
+
await (0, import_promises78.writeFile)(absoluteFilepath, js_yaml_default.dump(definitionFile.contents));
|
|
1274546
1274613
|
}
|
|
1274547
1274614
|
}
|
|
1274548
1274615
|
|