@fern-api/fern-api-dev 5.23.3-1172-gf0bd588bb0e → 5.23.3-1177-gde22c310de8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.cjs +546 -483
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -6326,7 +6326,7 @@ var require_has_flag = __commonJS({
|
|
|
6326
6326
|
var require_supports_color = __commonJS({
|
|
6327
6327
|
"../../../node_modules/.pnpm/supports-color@4.5.0/node_modules/supports-color/index.js"(exports2, module4) {
|
|
6328
6328
|
"use strict";
|
|
6329
|
-
var
|
|
6329
|
+
var os23 = require("os");
|
|
6330
6330
|
var hasFlag2 = require_has_flag();
|
|
6331
6331
|
var env5 = process.env;
|
|
6332
6332
|
var support = (level) => {
|
|
@@ -6357,7 +6357,7 @@ var require_supports_color = __commonJS({
|
|
|
6357
6357
|
return 0;
|
|
6358
6358
|
}
|
|
6359
6359
|
if (process.platform === "win32") {
|
|
6360
|
-
const osRelease =
|
|
6360
|
+
const osRelease = os23.release().split(".");
|
|
6361
6361
|
if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
6362
6362
|
return 2;
|
|
6363
6363
|
}
|
|
@@ -53342,15 +53342,15 @@ var require_tmp = __commonJS({
|
|
|
53342
53342
|
"../../../node_modules/.pnpm/tmp@0.2.7/node_modules/tmp/lib/tmp.js"(exports2, module4) {
|
|
53343
53343
|
"use strict";
|
|
53344
53344
|
var fs34 = require("fs");
|
|
53345
|
-
var
|
|
53345
|
+
var os23 = require("os");
|
|
53346
53346
|
var path119 = require("path");
|
|
53347
53347
|
var crypto5 = require("crypto");
|
|
53348
|
-
var _c3 = { fs: fs34.constants, os:
|
|
53348
|
+
var _c3 = { fs: fs34.constants, os: os23.constants };
|
|
53349
53349
|
var RANDOM_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
|
53350
53350
|
var TEMPLATE_PATTERN = /XXXXXX/;
|
|
53351
53351
|
var DEFAULT_TRIES = 3;
|
|
53352
53352
|
var CREATE_FLAGS = (_c3.O_CREAT || _c3.fs.O_CREAT) | (_c3.O_EXCL || _c3.fs.O_EXCL) | (_c3.O_RDWR || _c3.fs.O_RDWR);
|
|
53353
|
-
var IS_WIN32 =
|
|
53353
|
+
var IS_WIN32 = os23.platform() === "win32";
|
|
53354
53354
|
var EBADF = _c3.EBADF || _c3.os.errno.EBADF;
|
|
53355
53355
|
var ENOENT2 = _c3.ENOENT || _c3.os.errno.ENOENT;
|
|
53356
53356
|
var DIR_MODE = 448;
|
|
@@ -53689,10 +53689,10 @@ var require_tmp = __commonJS({
|
|
|
53689
53689
|
_gracefulCleanup = true;
|
|
53690
53690
|
}
|
|
53691
53691
|
function _getTmpDir(options2, cb) {
|
|
53692
|
-
return fs34.realpath(options2 && options2.tmpdir ||
|
|
53692
|
+
return fs34.realpath(options2 && options2.tmpdir || os23.tmpdir(), cb);
|
|
53693
53693
|
}
|
|
53694
53694
|
function _getTmpDirSync(options2) {
|
|
53695
|
-
return fs34.realpathSync(options2 && options2.tmpdir ||
|
|
53695
|
+
return fs34.realpathSync(options2 && options2.tmpdir || os23.tmpdir());
|
|
53696
53696
|
}
|
|
53697
53697
|
process.addListener(EXIT3, _garbageCollector);
|
|
53698
53698
|
Object.defineProperty(module4.exports, "tmpdir", {
|
|
@@ -100116,8 +100116,8 @@ var require_graceful_fs = __commonJS({
|
|
|
100116
100116
|
}
|
|
100117
100117
|
}
|
|
100118
100118
|
var fs$writeFile = fs35.writeFile;
|
|
100119
|
-
fs35.writeFile =
|
|
100120
|
-
function
|
|
100119
|
+
fs35.writeFile = writeFile100;
|
|
100120
|
+
function writeFile100(path119, data2, options2, cb) {
|
|
100121
100121
|
if (typeof options2 === "function")
|
|
100122
100122
|
cb = options2, options2 = null;
|
|
100123
100123
|
return go$writeFile(path119, data2, options2, cb);
|
|
@@ -101261,9 +101261,9 @@ var require_conf = __commonJS({
|
|
|
101261
101261
|
var require_defaults2 = __commonJS({
|
|
101262
101262
|
"../../../node_modules/.pnpm/@pnpm+npm-conf@3.0.2/node_modules/@pnpm/npm-conf/lib/defaults.js"(exports2) {
|
|
101263
101263
|
"use strict";
|
|
101264
|
-
var
|
|
101264
|
+
var os23 = require("os");
|
|
101265
101265
|
var path119 = require("path");
|
|
101266
|
-
var temp =
|
|
101266
|
+
var temp = os23.tmpdir();
|
|
101267
101267
|
var uidOrPid = process.getuid ? process.getuid() : process.pid;
|
|
101268
101268
|
var hasUnicode2 = () => true;
|
|
101269
101269
|
var isWindows = process.platform === "win32";
|
|
@@ -101274,7 +101274,7 @@ var require_defaults2 = __commonJS({
|
|
|
101274
101274
|
var umask = {
|
|
101275
101275
|
fromString: () => process.umask()
|
|
101276
101276
|
};
|
|
101277
|
-
var home =
|
|
101277
|
+
var home = os23.homedir();
|
|
101278
101278
|
if (home) {
|
|
101279
101279
|
process.env.HOME = home;
|
|
101280
101280
|
} else {
|
|
@@ -355629,7 +355629,7 @@ var require_stdio = __commonJS({
|
|
|
355629
355629
|
var require_kill = __commonJS({
|
|
355630
355630
|
"../../../node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/kill.js"(exports2, module4) {
|
|
355631
355631
|
"use strict";
|
|
355632
|
-
var
|
|
355632
|
+
var os23 = require("os");
|
|
355633
355633
|
var onExit2 = require_signal_exit();
|
|
355634
355634
|
var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
|
|
355635
355635
|
var spawnedKill = (kill, signal = "SIGTERM", options2 = {}) => {
|
|
@@ -355653,7 +355653,7 @@ var require_kill = __commonJS({
|
|
|
355653
355653
|
return isSigterm(signal) && forceKillAfterTimeout !== false && killResult;
|
|
355654
355654
|
};
|
|
355655
355655
|
var isSigterm = (signal) => {
|
|
355656
|
-
return signal ===
|
|
355656
|
+
return signal === os23.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM";
|
|
355657
355657
|
};
|
|
355658
355658
|
var getForceKillAfterTimeout = ({ forceKillAfterTimeout = true }) => {
|
|
355659
355659
|
if (forceKillAfterTimeout === true) {
|
|
@@ -388861,7 +388861,7 @@ var require_has_flag2 = __commonJS({
|
|
|
388861
388861
|
var require_supports_color2 = __commonJS({
|
|
388862
388862
|
"../../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports2, module4) {
|
|
388863
388863
|
"use strict";
|
|
388864
|
-
var
|
|
388864
|
+
var os23 = require("os");
|
|
388865
388865
|
var tty2 = require("tty");
|
|
388866
388866
|
var hasFlag2 = require_has_flag2();
|
|
388867
388867
|
var { env: env5 } = process;
|
|
@@ -388909,7 +388909,7 @@ var require_supports_color2 = __commonJS({
|
|
|
388909
388909
|
return min;
|
|
388910
388910
|
}
|
|
388911
388911
|
if (process.platform === "win32") {
|
|
388912
|
-
const osRelease =
|
|
388912
|
+
const osRelease = os23.release().split(".");
|
|
388913
388913
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
388914
388914
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
388915
388915
|
}
|
|
@@ -407507,7 +407507,7 @@ var require_main2 = __commonJS({
|
|
|
407507
407507
|
"use strict";
|
|
407508
407508
|
var fs34 = require("fs");
|
|
407509
407509
|
var path119 = require("path");
|
|
407510
|
-
var
|
|
407510
|
+
var os23 = require("os");
|
|
407511
407511
|
var crypto5 = require("crypto");
|
|
407512
407512
|
var packageJson2 = require_package4();
|
|
407513
407513
|
var version7 = packageJson2.version;
|
|
@@ -407630,7 +407630,7 @@ var require_main2 = __commonJS({
|
|
|
407630
407630
|
return null;
|
|
407631
407631
|
}
|
|
407632
407632
|
function _resolveHome(envPath) {
|
|
407633
|
-
return envPath[0] === "~" ? path119.join(
|
|
407633
|
+
return envPath[0] === "~" ? path119.join(os23.homedir(), envPath.slice(1)) : envPath;
|
|
407634
407634
|
}
|
|
407635
407635
|
function _configVault(options2) {
|
|
407636
407636
|
const debug9 = Boolean(options2 && options2.debug);
|
|
@@ -456668,13 +456668,13 @@ async function removeInvalidAiExamples({ sourceFilePath, context: context3 }) {
|
|
|
456668
456668
|
}
|
|
456669
456669
|
}
|
|
456670
456670
|
}
|
|
456671
|
-
const { writeFile:
|
|
456671
|
+
const { writeFile: writeFile100 } = await import("fs/promises");
|
|
456672
456672
|
const yamlContent = index_vite_proxy_tmp_default.dump(parsed, {
|
|
456673
456673
|
indent: 2,
|
|
456674
456674
|
lineWidth: -1,
|
|
456675
456675
|
noRefs: true
|
|
456676
456676
|
});
|
|
456677
|
-
await
|
|
456677
|
+
await writeFile100(overrideFilePath, yamlContent, "utf-8");
|
|
456678
456678
|
context3.logger.info(`Removed ${validationResult.invalidCount} invalid AI examples from ai_examples_override.yml`);
|
|
456679
456679
|
return {
|
|
456680
456680
|
removedCount: validationResult.invalidCount,
|
|
@@ -479932,8 +479932,8 @@ var require_graceful_fs2 = __commonJS({
|
|
|
479932
479932
|
}
|
|
479933
479933
|
}
|
|
479934
479934
|
var fs$writeFile = fs35.writeFile;
|
|
479935
|
-
fs35.writeFile =
|
|
479936
|
-
function
|
|
479935
|
+
fs35.writeFile = writeFile100;
|
|
479936
|
+
function writeFile100(path119, data2, options2, cb) {
|
|
479937
479937
|
if (typeof options2 === "function")
|
|
479938
479938
|
cb = options2, options2 = null;
|
|
479939
479939
|
return go$writeFile(path119, data2, options2, cb);
|
|
@@ -560756,7 +560756,7 @@ async function unpackArchive(archivePath, folderPath) {
|
|
|
560756
560756
|
} else if (archivePath.endsWith(".tar.bz2")) {
|
|
560757
560757
|
await extractTar(archivePath, folderPath, "bzip2");
|
|
560758
560758
|
} else if (archivePath.endsWith(".dmg")) {
|
|
560759
|
-
await (0,
|
|
560759
|
+
await (0, import_promises102.mkdir)(folderPath);
|
|
560760
560760
|
await installDMG(archivePath, folderPath);
|
|
560761
560761
|
} else if (archivePath.endsWith(".exe")) {
|
|
560762
560762
|
const result = (0, import_node_child_process11.spawnSync)(archivePath, [`/ExtractDir=${folderPath}`], {
|
|
@@ -560845,7 +560845,7 @@ async function installDMG(dmgPath, folderPath) {
|
|
|
560845
560845
|
}
|
|
560846
560846
|
const mountPath = volumes[0];
|
|
560847
560847
|
try {
|
|
560848
|
-
const fileNames = await (0,
|
|
560848
|
+
const fileNames = await (0, import_promises102.readdir)(mountPath);
|
|
560849
560849
|
const appName = fileNames.find((item) => {
|
|
560850
560850
|
return typeof item === "string" && item.endsWith(".app");
|
|
560851
560851
|
});
|
|
@@ -560858,13 +560858,13 @@ async function installDMG(dmgPath, folderPath) {
|
|
|
560858
560858
|
(0, import_node_child_process11.spawnSync)("hdiutil", ["detach", mountPath, "-quiet"]);
|
|
560859
560859
|
}
|
|
560860
560860
|
}
|
|
560861
|
-
var import_node_child_process11, import_node_fs26,
|
|
560861
|
+
var import_node_child_process11, import_node_fs26, import_promises102, path76, import_node_stream6, import_debug8, debugFileUtil, internalConstantsForTesting;
|
|
560862
560862
|
var init_fileUtil = __esm({
|
|
560863
560863
|
"../../../node_modules/.pnpm/@puppeteer+browsers@2.13.0/node_modules/@puppeteer/browsers/lib/esm/fileUtil.js"() {
|
|
560864
560864
|
"use strict";
|
|
560865
560865
|
import_node_child_process11 = require("child_process");
|
|
560866
560866
|
import_node_fs26 = require("fs");
|
|
560867
|
-
|
|
560867
|
+
import_promises102 = require("fs/promises");
|
|
560868
560868
|
path76 = __toESM(require("path"), 1);
|
|
560869
560869
|
import_node_stream6 = require("stream");
|
|
560870
560870
|
import_debug8 = __toESM(require_src(), 1);
|
|
@@ -560927,7 +560927,7 @@ async function installWithProviders(options2) {
|
|
|
560927
560927
|
}
|
|
560928
560928
|
debugInstall(`Successfully got URL from ${provider.getName()}: ${url3}`);
|
|
560929
560929
|
if (!(0, import_node_fs27.existsSync)(browserRoot)) {
|
|
560930
|
-
await (0,
|
|
560930
|
+
await (0, import_promises103.mkdir)(browserRoot, { recursive: true });
|
|
560931
560931
|
}
|
|
560932
560932
|
return await installUrl(url3, options2, provider);
|
|
560933
560933
|
} catch (err) {
|
|
@@ -561000,7 +561000,7 @@ async function installUrl(url3, options2, provider) {
|
|
|
561000
561000
|
const browserRoot = cache2.browserRoot(options2.browser);
|
|
561001
561001
|
const archivePath = import_node_path32.default.join(browserRoot, `${options2.buildId}-${fileName}`);
|
|
561002
561002
|
if (!(0, import_node_fs27.existsSync)(browserRoot)) {
|
|
561003
|
-
await (0,
|
|
561003
|
+
await (0, import_promises103.mkdir)(browserRoot, { recursive: true });
|
|
561004
561004
|
}
|
|
561005
561005
|
if (!options2.unpack) {
|
|
561006
561006
|
if ((0, import_node_fs27.existsSync)(archivePath)) {
|
|
@@ -561064,7 +561064,7 @@ async function installUrl(url3, options2, provider) {
|
|
|
561064
561064
|
return installedBrowser;
|
|
561065
561065
|
} finally {
|
|
561066
561066
|
if ((0, import_node_fs27.existsSync)(archivePath)) {
|
|
561067
|
-
await (0,
|
|
561067
|
+
await (0, import_promises103.unlink)(archivePath);
|
|
561068
561068
|
}
|
|
561069
561069
|
}
|
|
561070
561070
|
}
|
|
@@ -561144,14 +561144,14 @@ function toMegabytes(bytes) {
|
|
|
561144
561144
|
const mb = bytes / 1e3 / 1e3;
|
|
561145
561145
|
return `${Math.round(mb * 10) / 10} MB`;
|
|
561146
561146
|
}
|
|
561147
|
-
var import_node_assert3, import_node_child_process12, import_node_fs27,
|
|
561147
|
+
var import_node_assert3, import_node_child_process12, import_node_fs27, import_promises103, import_node_os10, import_node_path32, import_progress, debugInstall, times;
|
|
561148
561148
|
var init_install = __esm({
|
|
561149
561149
|
"../../../node_modules/.pnpm/@puppeteer+browsers@2.13.0/node_modules/@puppeteer/browsers/lib/esm/install.js"() {
|
|
561150
561150
|
"use strict";
|
|
561151
561151
|
import_node_assert3 = __toESM(require("assert"), 1);
|
|
561152
561152
|
import_node_child_process12 = require("child_process");
|
|
561153
561153
|
import_node_fs27 = require("fs");
|
|
561154
|
-
|
|
561154
|
+
import_promises103 = require("fs/promises");
|
|
561155
561155
|
import_node_os10 = __toESM(require("os"), 1);
|
|
561156
561156
|
import_node_path32 = __toESM(require("path"), 1);
|
|
561157
561157
|
import_progress = __toESM(require_progress(), 1);
|
|
@@ -562231,9 +562231,9 @@ var require_env_paths = __commonJS({
|
|
|
562231
562231
|
"../../../node_modules/.pnpm/env-paths@2.2.1/node_modules/env-paths/index.js"(exports2, module4) {
|
|
562232
562232
|
"use strict";
|
|
562233
562233
|
var path119 = require("path");
|
|
562234
|
-
var
|
|
562235
|
-
var homedir11 =
|
|
562236
|
-
var tmpdir5 =
|
|
562234
|
+
var os23 = require("os");
|
|
562235
|
+
var homedir11 = os23.homedir();
|
|
562236
|
+
var tmpdir5 = os23.tmpdir();
|
|
562237
562237
|
var { env: env5 } = process;
|
|
562238
562238
|
var macos = (name2) => {
|
|
562239
562239
|
const library = path119.join(homedir11, "Library");
|
|
@@ -563078,7 +563078,7 @@ async function tryRunContainer({ logger: logger4, imageName, args, binds, envVar
|
|
|
563078
563078
|
const logs4 = stdout + stderr;
|
|
563079
563079
|
if (writeLogsToFile) {
|
|
563080
563080
|
const tmpFile = await import_tmp_promise10.default.file();
|
|
563081
|
-
await (0,
|
|
563081
|
+
await (0, import_promises107.writeFile)(tmpFile.path, logs4);
|
|
563082
563082
|
logger4.info(`Generator logs here: ${tmpFile.path}`);
|
|
563083
563083
|
}
|
|
563084
563084
|
if (exitCode == null) {
|
|
@@ -563138,7 +563138,7 @@ async function execInContainer({ logger: logger4, containerId, command: command3
|
|
|
563138
563138
|
const logs4 = stdout + stderr;
|
|
563139
563139
|
if (writeLogsToFile) {
|
|
563140
563140
|
const tmpFile = await import_tmp_promise10.default.file();
|
|
563141
|
-
await (0,
|
|
563141
|
+
await (0, import_promises107.writeFile)(tmpFile.path, logs4);
|
|
563142
563142
|
logger4.info(`Generator logs here: ${tmpFile.path}`);
|
|
563143
563143
|
}
|
|
563144
563144
|
const resolvedExitCode = exitCode ?? 1;
|
|
@@ -563180,12 +563180,12 @@ async function stopContainer({ logger: logger4, containerId, runner }) {
|
|
|
563180
563180
|
doNotPipeOutput: true
|
|
563181
563181
|
});
|
|
563182
563182
|
}
|
|
563183
|
-
var
|
|
563183
|
+
var import_promises107, import_tmp_promise10, runDocker;
|
|
563184
563184
|
var init_runDocker = __esm({
|
|
563185
563185
|
"../generation/local-generation/docker-utils/lib/runDocker.js"() {
|
|
563186
563186
|
"use strict";
|
|
563187
563187
|
init_lib33();
|
|
563188
|
-
|
|
563188
|
+
import_promises107 = require("fs/promises");
|
|
563189
563189
|
import_tmp_promise10 = __toESM(require_tmp_promise(), 1);
|
|
563190
563190
|
runDocker = runContainer;
|
|
563191
563191
|
}
|
|
@@ -573161,7 +573161,7 @@ var require_dist24 = __commonJS({
|
|
|
573161
573161
|
return copy;
|
|
573162
573162
|
}
|
|
573163
573163
|
};
|
|
573164
|
-
var
|
|
573164
|
+
var import_promises216 = require("fs/promises");
|
|
573165
573165
|
var import_node_path310 = require("path");
|
|
573166
573166
|
async function resolveInputs(args) {
|
|
573167
573167
|
const {
|
|
@@ -573214,7 +573214,7 @@ var require_dist24 = __commonJS({
|
|
|
573214
573214
|
}
|
|
573215
573215
|
}
|
|
573216
573216
|
const oursPath = (0, import_node_path310.join)(outputDir, resolvedPath);
|
|
573217
|
-
const ours = await (0,
|
|
573217
|
+
const ours = await (0, import_promises216.readFile)(oursPath, "utf-8").catch(() => null);
|
|
573218
573218
|
let ghostTheirs = null;
|
|
573219
573219
|
let baseTreeUnreachable = false;
|
|
573220
573220
|
if (!base4 && !renameSourcePath) {
|
|
@@ -573456,7 +573456,7 @@ var require_dist24 = __commonJS({
|
|
|
573456
573456
|
conflictReasonHint
|
|
573457
573457
|
};
|
|
573458
573458
|
}
|
|
573459
|
-
var
|
|
573459
|
+
var import_promises217 = require("fs/promises");
|
|
573460
573460
|
var import_node_path45 = require("path");
|
|
573461
573461
|
async function runMergeAndRecord(args) {
|
|
573462
573462
|
const { plan, inputs, patch: patch5, accumulator } = args;
|
|
@@ -573466,14 +573466,14 @@ var require_dist24 = __commonJS({
|
|
|
573466
573466
|
}
|
|
573467
573467
|
if (plan.kind === "new-file-only-user") {
|
|
573468
573468
|
accumulator.recordMerge(resolvedPath, plan.theirs, patch5.base_generation);
|
|
573469
|
-
await (0,
|
|
573470
|
-
await (0,
|
|
573469
|
+
await (0, import_promises217.mkdir)((0, import_node_path45.dirname)(oursPath), { recursive: true });
|
|
573470
|
+
await (0, import_promises217.writeFile)(oursPath, plan.theirs);
|
|
573471
573471
|
return { file: resolvedPath, status: "merged", reason: "new-file" };
|
|
573472
573472
|
}
|
|
573473
573473
|
if (plan.kind === "new-file-both") {
|
|
573474
573474
|
const merged2 = threeWayMerge("", ours, plan.theirs);
|
|
573475
|
-
await (0,
|
|
573476
|
-
await (0,
|
|
573475
|
+
await (0, import_promises217.mkdir)((0, import_node_path45.dirname)(oursPath), { recursive: true });
|
|
573476
|
+
await (0, import_promises217.writeFile)(oursPath, merged2.content);
|
|
573477
573477
|
const unreachableFlag = plan.baseTreeUnreachable ? { baseTreeUnreachable: true } : {};
|
|
573478
573478
|
if (merged2.hasConflicts) {
|
|
573479
573479
|
return {
|
|
@@ -573489,8 +573489,8 @@ var require_dist24 = __commonJS({
|
|
|
573489
573489
|
return { file: resolvedPath, status: "merged", ...unreachableFlag };
|
|
573490
573490
|
}
|
|
573491
573491
|
const merged = threeWayMerge(plan.mergeBase, ours, plan.theirs);
|
|
573492
|
-
await (0,
|
|
573493
|
-
await (0,
|
|
573492
|
+
await (0, import_promises217.mkdir)((0, import_node_path45.dirname)(oursPath), { recursive: true });
|
|
573493
|
+
await (0, import_promises217.writeFile)(oursPath, merged.content);
|
|
573494
573494
|
if (merged.hasConflicts) {
|
|
573495
573495
|
accumulator.recordConflict(resolvedPath, plan.theirs, patch5.base_generation);
|
|
573496
573496
|
return {
|
|
@@ -590260,13 +590260,13 @@ async function buildTranslatedDocsDefinition({ docsDefinition, locale, localePag
|
|
|
590260
590260
|
};
|
|
590261
590261
|
const localeAwareMarkdownLoader = async (filepath) => {
|
|
590262
590262
|
const pathToRead = await resolveLocalePath(filepath);
|
|
590263
|
-
const raw = await (0,
|
|
590263
|
+
const raw = await (0, import_promises120.readFile)(pathToRead, "utf-8");
|
|
590264
590264
|
const fmMatch = raw.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/);
|
|
590265
590265
|
return fmMatch != null ? raw.slice(fmMatch[0].length) : raw;
|
|
590266
590266
|
};
|
|
590267
590267
|
const localeAwareFileLoader = async (filepath) => {
|
|
590268
590268
|
const pathToRead = await resolveLocalePath(filepath);
|
|
590269
|
-
return (0,
|
|
590269
|
+
return (0, import_promises120.readFile)(pathToRead, "utf-8");
|
|
590270
590270
|
};
|
|
590271
590271
|
const translatedPageEntries = await Promise.all(Object.entries(localePages).map(async ([path119, rawMarkdown]) => {
|
|
590272
590272
|
try {
|
|
@@ -590342,13 +590342,13 @@ async function buildTranslatedDocsDefinition({ docsDefinition, locale, localePag
|
|
|
590342
590342
|
}
|
|
590343
590343
|
};
|
|
590344
590344
|
}
|
|
590345
|
-
var
|
|
590345
|
+
var import_promises120;
|
|
590346
590346
|
var init_buildTranslatedDocsDefinition = __esm({
|
|
590347
590347
|
"../generation/remote-generation/remote-workspace-runner/lib/buildTranslatedDocsDefinition.js"() {
|
|
590348
590348
|
"use strict";
|
|
590349
590349
|
init_lib67();
|
|
590350
590350
|
init_lib8();
|
|
590351
|
-
|
|
590351
|
+
import_promises120 = require("fs/promises");
|
|
590352
590352
|
}
|
|
590353
590353
|
});
|
|
590354
590354
|
|
|
@@ -620797,7 +620797,7 @@ async function readFernYmlRaw(start2) {
|
|
|
620797
620797
|
for (let i5 = 0; i5 < 50; i5++) {
|
|
620798
620798
|
const candidate = (0, import_path102.resolve)(dir, "fern.yml");
|
|
620799
620799
|
try {
|
|
620800
|
-
const content5 = await (0,
|
|
620800
|
+
const content5 = await (0, import_promises144.readFile)(candidate, "utf-8");
|
|
620801
620801
|
const parsed = index_vite_proxy_tmp_default.load(content5);
|
|
620802
620802
|
if (isRawFernYml(parsed)) {
|
|
620803
620803
|
return parsed;
|
|
@@ -620845,11 +620845,11 @@ function extractInstances(raw) {
|
|
|
620845
620845
|
}
|
|
620846
620846
|
return raw.docs.instances.flatMap((inst) => typeof inst?.url === "string" ? [inst.url] : []);
|
|
620847
620847
|
}
|
|
620848
|
-
var
|
|
620848
|
+
var import_promises144, import_path102;
|
|
620849
620849
|
var init_completion2 = __esm({
|
|
620850
620850
|
"../cli-v2/lib/completion.js"() {
|
|
620851
620851
|
"use strict";
|
|
620852
|
-
|
|
620852
|
+
import_promises144 = require("fs/promises");
|
|
620853
620853
|
init_js_yaml();
|
|
620854
620854
|
import_path102 = require("path");
|
|
620855
620855
|
}
|
|
@@ -622013,7 +622013,7 @@ var require_jsonfile = __commonJS({
|
|
|
622013
622013
|
const str2 = stringify5(obj, options2);
|
|
622014
622014
|
await universalify.fromCallback(fs34.writeFile)(file4, str2, options2);
|
|
622015
622015
|
}
|
|
622016
|
-
var
|
|
622016
|
+
var writeFile100 = universalify.fromPromise(_writeFile);
|
|
622017
622017
|
function writeFileSync9(file4, obj, options2 = {}) {
|
|
622018
622018
|
const fs34 = options2.fs || _fs;
|
|
622019
622019
|
const str2 = stringify5(obj, options2);
|
|
@@ -622022,7 +622022,7 @@ var require_jsonfile = __commonJS({
|
|
|
622022
622022
|
module4.exports = {
|
|
622023
622023
|
readFile: readFile119,
|
|
622024
622024
|
readFileSync: readFileSync19,
|
|
622025
|
-
writeFile:
|
|
622025
|
+
writeFile: writeFile100,
|
|
622026
622026
|
writeFileSync: writeFileSync9
|
|
622027
622027
|
};
|
|
622028
622028
|
}
|
|
@@ -688404,7 +688404,7 @@ var AccessTokenPosthogManager = class {
|
|
|
688404
688404
|
properties: {
|
|
688405
688405
|
...event,
|
|
688406
688406
|
...event.properties,
|
|
688407
|
-
version: "5.23.3-
|
|
688407
|
+
version: "5.23.3-1177-gde22c310de8",
|
|
688408
688408
|
usingAccessToken: true,
|
|
688409
688409
|
...getRunIdProperties()
|
|
688410
688410
|
}
|
|
@@ -688470,7 +688470,7 @@ var UserPosthogManager = class {
|
|
|
688470
688470
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
688471
688471
|
event: "CLI",
|
|
688472
688472
|
properties: {
|
|
688473
|
-
version: "5.23.3-
|
|
688473
|
+
version: "5.23.3-1177-gde22c310de8",
|
|
688474
688474
|
...event,
|
|
688475
688475
|
...event.properties,
|
|
688476
688476
|
usingAccessToken: false,
|
|
@@ -869551,8 +869551,9 @@ var import_child_process7 = require("child_process");
|
|
|
869551
869551
|
var import_cors = __toESM(require_lib13(), 1);
|
|
869552
869552
|
var import_express3 = __toESM(require_express3(), 1);
|
|
869553
869553
|
var import_fs30 = __toESM(require("fs"), 1);
|
|
869554
|
-
var
|
|
869554
|
+
var import_promises100 = require("fs/promises");
|
|
869555
869555
|
var import_http9 = __toESM(require("http"), 1);
|
|
869556
|
+
var import_os11 = __toESM(require("os"), 1);
|
|
869556
869557
|
var import_path71 = __toESM(require("path"), 1);
|
|
869557
869558
|
init_wrapper();
|
|
869558
869559
|
|
|
@@ -869565,7 +869566,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
869565
869566
|
var LOGS_FOLDER_NAME = "logs";
|
|
869566
869567
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
869567
869568
|
function getCliSource() {
|
|
869568
|
-
const version7 = "5.23.3-
|
|
869569
|
+
const version7 = "5.23.3-1177-gde22c310de8";
|
|
869569
869570
|
return `cli@${version7}`;
|
|
869570
869571
|
}
|
|
869571
869572
|
var DebugLogger = class {
|
|
@@ -872654,6 +872655,43 @@ var ReferencedAPICollectorV2 = class {
|
|
|
872654
872655
|
}
|
|
872655
872656
|
};
|
|
872656
872657
|
|
|
872658
|
+
// ../docs-preview/lib/reloadUtils.js
|
|
872659
|
+
var import_promises99 = require("fs/promises");
|
|
872660
|
+
function isContentOnlyEdit(editedFilepaths) {
|
|
872661
|
+
if (editedFilepaths == null || editedFilepaths.length === 0) {
|
|
872662
|
+
return false;
|
|
872663
|
+
}
|
|
872664
|
+
return editedFilepaths.every((f3) => {
|
|
872665
|
+
const lower = f3.toLowerCase();
|
|
872666
|
+
return lower.endsWith(".md") || lower.endsWith(".mdx");
|
|
872667
|
+
});
|
|
872668
|
+
}
|
|
872669
|
+
var GenerationFileManager = class {
|
|
872670
|
+
filePath;
|
|
872671
|
+
generation = 0;
|
|
872672
|
+
constructor(filePath) {
|
|
872673
|
+
this.filePath = filePath;
|
|
872674
|
+
}
|
|
872675
|
+
/** Current generation value. */
|
|
872676
|
+
get current() {
|
|
872677
|
+
return this.generation;
|
|
872678
|
+
}
|
|
872679
|
+
/** Increment the generation and persist to the temp file. */
|
|
872680
|
+
async increment() {
|
|
872681
|
+
this.generation++;
|
|
872682
|
+
await this.write();
|
|
872683
|
+
return this.generation;
|
|
872684
|
+
}
|
|
872685
|
+
/** Write the current generation to disk (best-effort). */
|
|
872686
|
+
async write() {
|
|
872687
|
+
try {
|
|
872688
|
+
await (0, import_promises99.writeFile)(this.filePath, String(this.generation), "utf-8");
|
|
872689
|
+
} catch (e2) {
|
|
872690
|
+
console.debug(`Failed to write generation file ${this.filePath}: ${e2}`);
|
|
872691
|
+
}
|
|
872692
|
+
}
|
|
872693
|
+
};
|
|
872694
|
+
|
|
872657
872695
|
// ../docs-preview/lib/runAppPreviewServer.js
|
|
872658
872696
|
var EMPTY_DOCS_DEFINITION = {
|
|
872659
872697
|
pages: {},
|
|
@@ -872845,7 +872883,7 @@ var SnippetDependencyTracker = class {
|
|
|
872845
872883
|
const markdownFiles = await this.findMarkdownFiles(docsWorkspace.absoluteFilePath);
|
|
872846
872884
|
for (const markdownFile of markdownFiles) {
|
|
872847
872885
|
try {
|
|
872848
|
-
const content5 = await (0,
|
|
872886
|
+
const content5 = await (0, import_promises100.readFile)(markdownFile, "utf-8");
|
|
872849
872887
|
const referencedFiles = this.extractReferences(content5, markdownFile, docsWorkspace.absoluteFilePath);
|
|
872850
872888
|
this.pageToSnippets.set(markdownFile, referencedFiles);
|
|
872851
872889
|
for (const referencedFile of referencedFiles) {
|
|
@@ -872931,7 +872969,7 @@ async function cleanFernDocsCache(bundleRoot, context3) {
|
|
|
872931
872969
|
const cacheExists = await doesPathExist(AbsoluteFilePath2.of(cachePath));
|
|
872932
872970
|
if (cacheExists) {
|
|
872933
872971
|
context3.logger.debug(`Cleaning Fern Docs cache at ${cachePath}`);
|
|
872934
|
-
await (0,
|
|
872972
|
+
await (0, import_promises100.rm)(cachePath, { recursive: true });
|
|
872935
872973
|
context3.logger.debug("Fern Docs cache cleaned successfully");
|
|
872936
872974
|
} else {
|
|
872937
872975
|
context3.logger.debug("No Fern Docs cache to clean");
|
|
@@ -872984,7 +873022,7 @@ async function runAppPreviewServer({ initialProject, reloadProject, validateProj
|
|
|
872984
873022
|
const appPreviewFolder = getPathToPreviewFolder({ app: true, cacheDir });
|
|
872985
873023
|
if (await doesPathExist(appPreviewFolder)) {
|
|
872986
873024
|
context3.logger.info("Force download requested. Deleting cached bundle...");
|
|
872987
|
-
await (0,
|
|
873025
|
+
await (0, import_promises100.rm)(appPreviewFolder, { recursive: true });
|
|
872988
873026
|
}
|
|
872989
873027
|
}
|
|
872990
873028
|
if (bundlePath != null) {
|
|
@@ -873149,7 +873187,7 @@ async function runAppPreviewServer({ initialProject, reloadProject, validateProj
|
|
|
873149
873187
|
const slugTracker = new SlugChangeTracker(context3);
|
|
873150
873188
|
let reloadTimer = null;
|
|
873151
873189
|
let isReloading = false;
|
|
873152
|
-
const RELOAD_DEBOUNCE_MS =
|
|
873190
|
+
const RELOAD_DEBOUNCE_MS = 500;
|
|
873153
873191
|
async function computeTranslatedDefinitions(result) {
|
|
873154
873192
|
const translations = /* @__PURE__ */ new Map();
|
|
873155
873193
|
const { docsDefinition, translationPages, translationNavigationOverlays, translatedApiDefinitions, collectedFileIds, docsWorkspacePath } = result;
|
|
@@ -873176,13 +873214,13 @@ async function runAppPreviewServer({ initialProject, reloadProject, validateProj
|
|
|
873176
873214
|
};
|
|
873177
873215
|
const localeAwareMarkdownLoader = async (filepath) => {
|
|
873178
873216
|
const pathToRead = await resolveLocalePath(filepath);
|
|
873179
|
-
const raw = await (0,
|
|
873217
|
+
const raw = await (0, import_promises100.readFile)(pathToRead, "utf-8");
|
|
873180
873218
|
const fmMatch = raw.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/);
|
|
873181
873219
|
return fmMatch != null ? raw.slice(fmMatch[0].length) : raw;
|
|
873182
873220
|
};
|
|
873183
873221
|
const localeAwareFileLoader = async (filepath) => {
|
|
873184
873222
|
const pathToRead = await resolveLocalePath(filepath);
|
|
873185
|
-
return (0,
|
|
873223
|
+
return (0, import_promises100.readFile)(pathToRead, "utf-8");
|
|
873186
873224
|
};
|
|
873187
873225
|
const translatedPages = {};
|
|
873188
873226
|
for (const [pageId, page] of Object.entries(docsDefinition.pages)) {
|
|
@@ -873284,6 +873322,8 @@ async function runAppPreviewServer({ initialProject, reloadProject, validateProj
|
|
|
873284
873322
|
}
|
|
873285
873323
|
return translations;
|
|
873286
873324
|
}
|
|
873325
|
+
const genFilePath = import_path71.default.join(import_os11.default.tmpdir(), `fern-docs-dev-gen-${backendPort}`);
|
|
873326
|
+
const generationManager = new GenerationFileManager(genFilePath);
|
|
873287
873327
|
const reloadDocsDefinition = async (editedAbsoluteFilepaths2) => {
|
|
873288
873328
|
context3.logger.info("Reloading docs...");
|
|
873289
873329
|
const startTime = Date.now();
|
|
@@ -873291,18 +873331,20 @@ async function runAppPreviewServer({ initialProject, reloadProject, validateProj
|
|
|
873291
873331
|
try {
|
|
873292
873332
|
project = await reloadProject();
|
|
873293
873333
|
await snippetTracker.buildDependencyMap(project);
|
|
873294
|
-
|
|
873295
|
-
|
|
873296
|
-
|
|
873297
|
-
|
|
873298
|
-
|
|
873299
|
-
|
|
873300
|
-
|
|
873301
|
-
|
|
873302
|
-
|
|
873303
|
-
|
|
873304
|
-
|
|
873305
|
-
|
|
873334
|
+
if (!isContentOnlyEdit(editedAbsoluteFilepaths2)) {
|
|
873335
|
+
const validationStartTime = Date.now();
|
|
873336
|
+
void validateProject(project).then(() => {
|
|
873337
|
+
const validationTime = Date.now() - validationStartTime;
|
|
873338
|
+
void debugLogger.logCliValidation(validationTime, true);
|
|
873339
|
+
}).catch((err) => {
|
|
873340
|
+
const validationTime = Date.now() - validationStartTime;
|
|
873341
|
+
void debugLogger.logCliValidation(validationTime, false);
|
|
873342
|
+
context3.logger.error(`Validation failed (took ${validationTime}ms): ${extractErrorMessage(err)}`);
|
|
873343
|
+
if (err instanceof Error && err.stack) {
|
|
873344
|
+
context3.logger.debug(`Validation error stack: ${err.stack}`);
|
|
873345
|
+
}
|
|
873346
|
+
});
|
|
873347
|
+
}
|
|
873306
873348
|
const docsGenStartTime = Date.now();
|
|
873307
873349
|
const newPreviewResult = await getPreviewDocsDefinition({
|
|
873308
873350
|
domain: `${instance.host}${instance.pathname}`,
|
|
@@ -873461,6 +873503,7 @@ ${err.stack}`);
|
|
|
873461
873503
|
NEXT_PUBLIC_FDR_ORIGIN: `http://localhost:${backendPort}`,
|
|
873462
873504
|
NEXT_PUBLIC_DOCS_DOMAIN: initialProject.docsWorkspaces?.config.instances[0]?.url,
|
|
873463
873505
|
NEXT_PUBLIC_IS_LOCAL: "1",
|
|
873506
|
+
FERN_DOCS_DEV_GEN_FILE: genFilePath,
|
|
873464
873507
|
NEXT_DISABLE_CACHE: "1",
|
|
873465
873508
|
NODE_ENV: "production",
|
|
873466
873509
|
NODE_PATH: bundleRoot,
|
|
@@ -873565,6 +873608,7 @@ ${err.stack}`);
|
|
|
873565
873608
|
if (translatedDefinitions.size > 0) {
|
|
873566
873609
|
context3.logger.debug(`Recomputed translations for ${translatedDefinitions.size} locale(s)`);
|
|
873567
873610
|
}
|
|
873611
|
+
await generationManager.increment();
|
|
873568
873612
|
sendData({
|
|
873569
873613
|
version: 1,
|
|
873570
873614
|
type: "finishReload"
|
|
@@ -873581,6 +873625,7 @@ ${err.stack}`);
|
|
|
873581
873625
|
});
|
|
873582
873626
|
}
|
|
873583
873627
|
} else {
|
|
873628
|
+
await generationManager.increment();
|
|
873584
873629
|
sendData({
|
|
873585
873630
|
version: 1,
|
|
873586
873631
|
type: "finishReload"
|
|
@@ -873588,6 +873633,7 @@ ${err.stack}`);
|
|
|
873588
873633
|
}
|
|
873589
873634
|
} catch (err) {
|
|
873590
873635
|
context3.logger.error(`Reload failed: ${extractErrorMessage(err)}`);
|
|
873636
|
+
await generationManager.increment();
|
|
873591
873637
|
sendData({
|
|
873592
873638
|
version: 1,
|
|
873593
873639
|
type: "finishReload"
|
|
@@ -873678,7 +873724,7 @@ init_lib6();
|
|
|
873678
873724
|
init_source();
|
|
873679
873725
|
var import_cors2 = __toESM(require_lib13(), 1);
|
|
873680
873726
|
var import_express4 = __toESM(require_express3(), 1);
|
|
873681
|
-
var
|
|
873727
|
+
var import_promises101 = require("fs/promises");
|
|
873682
873728
|
var import_http10 = __toESM(require("http"), 1);
|
|
873683
873729
|
var import_path72 = __toESM(require("path"), 1);
|
|
873684
873730
|
init_wrapper();
|
|
@@ -873798,13 +873844,13 @@ async function runPreviewServer({ initialProject, reloadProject, validateProject
|
|
|
873798
873844
|
};
|
|
873799
873845
|
const localeAwareMarkdownLoader = async (filepath) => {
|
|
873800
873846
|
const pathToRead = await resolveLocalePath(filepath);
|
|
873801
|
-
const raw = await (0,
|
|
873847
|
+
const raw = await (0, import_promises101.readFile)(pathToRead, "utf-8");
|
|
873802
873848
|
const fmMatch = raw.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/);
|
|
873803
873849
|
return fmMatch != null ? raw.slice(fmMatch[0].length) : raw;
|
|
873804
873850
|
};
|
|
873805
873851
|
const localeAwareFileLoader = async (filepath) => {
|
|
873806
873852
|
const pathToRead = await resolveLocalePath(filepath);
|
|
873807
|
-
return (0,
|
|
873853
|
+
return (0, import_promises101.readFile)(pathToRead, "utf-8");
|
|
873808
873854
|
};
|
|
873809
873855
|
const translatedPages = {};
|
|
873810
873856
|
for (const [pageId, page] of Object.entries(docsDefinition.pages)) {
|
|
@@ -874159,7 +874205,7 @@ function addDevCommand(cli) {
|
|
|
874159
874205
|
// ../cli-v2/lib/commands/docs/diff/command.js
|
|
874160
874206
|
init_lib8();
|
|
874161
874207
|
init_lib6();
|
|
874162
|
-
var
|
|
874208
|
+
var import_promises106 = require("fs/promises");
|
|
874163
874209
|
var import_pngjs = __toESM(require_png(), 1);
|
|
874164
874210
|
|
|
874165
874211
|
// ../../../node_modules/.pnpm/puppeteer-core@24.40.0/node_modules/puppeteer-core/lib/esm/puppeteer/api/api.js
|
|
@@ -882613,7 +882659,7 @@ init_disposable();
|
|
|
882613
882659
|
init_incremental_id_generator();
|
|
882614
882660
|
|
|
882615
882661
|
// ../../../node_modules/.pnpm/puppeteer-core@24.40.0/node_modules/puppeteer-core/lib/esm/puppeteer/node/ChromeLauncher.js
|
|
882616
|
-
var
|
|
882662
|
+
var import_promises104 = require("fs/promises");
|
|
882617
882663
|
var import_node_os12 = __toESM(require("os"), 1);
|
|
882618
882664
|
var import_node_path34 = __toESM(require("path"), 1);
|
|
882619
882665
|
init_main();
|
|
@@ -883057,7 +883103,7 @@ var ChromeLauncher = class extends BrowserLauncher {
|
|
|
883057
883103
|
});
|
|
883058
883104
|
if (userDataDirIndex < 0) {
|
|
883059
883105
|
isTempUserDataDir = true;
|
|
883060
|
-
chromeArguments.push(`--user-data-dir=${await (0,
|
|
883106
|
+
chromeArguments.push(`--user-data-dir=${await (0, import_promises104.mkdtemp)(this.getProfilePath())}`);
|
|
883061
883107
|
userDataDirIndex = chromeArguments.length - 1;
|
|
883062
883108
|
}
|
|
883063
883109
|
const userDataDir = chromeArguments[userDataDirIndex].split("=", 2)[1];
|
|
@@ -883214,7 +883260,7 @@ function removeMatchingFlags(array3, flag) {
|
|
|
883214
883260
|
|
|
883215
883261
|
// ../../../node_modules/.pnpm/puppeteer-core@24.40.0/node_modules/puppeteer-core/lib/esm/puppeteer/node/FirefoxLauncher.js
|
|
883216
883262
|
var import_node_fs30 = __toESM(require("fs"), 1);
|
|
883217
|
-
var
|
|
883263
|
+
var import_promises105 = require("fs/promises");
|
|
883218
883264
|
var import_node_os13 = __toESM(require("os"), 1);
|
|
883219
883265
|
var import_node_path35 = __toESM(require("path"), 1);
|
|
883220
883266
|
init_main();
|
|
@@ -883268,7 +883314,7 @@ var FirefoxLauncher = class _FirefoxLauncher extends BrowserLauncher {
|
|
|
883268
883314
|
}
|
|
883269
883315
|
isTempUserDataDir = false;
|
|
883270
883316
|
} else {
|
|
883271
|
-
userDataDir = await (0,
|
|
883317
|
+
userDataDir = await (0, import_promises105.mkdtemp)(this.getProfilePath());
|
|
883272
883318
|
firefoxArguments.push("--profile");
|
|
883273
883319
|
firefoxArguments.push(userDataDir);
|
|
883274
883320
|
}
|
|
@@ -883309,8 +883355,8 @@ var FirefoxLauncher = class _FirefoxLauncher extends BrowserLauncher {
|
|
|
883309
883355
|
const prefsBackupPath = import_node_path35.default.join(userDataDir, file4 + backupSuffix);
|
|
883310
883356
|
if (import_node_fs30.default.existsSync(prefsBackupPath)) {
|
|
883311
883357
|
const prefsPath = import_node_path35.default.join(userDataDir, file4);
|
|
883312
|
-
await (0,
|
|
883313
|
-
await (0,
|
|
883358
|
+
await (0, import_promises105.unlink)(prefsPath);
|
|
883359
|
+
await (0, import_promises105.rename)(prefsBackupPath, prefsPath);
|
|
883314
883360
|
}
|
|
883315
883361
|
}));
|
|
883316
883362
|
for (const result of results) {
|
|
@@ -884089,7 +884135,7 @@ var DiffCommand = class {
|
|
|
884089
884135
|
}
|
|
884090
884136
|
const outputPath = AbsoluteFilePath2.of(outputDir.startsWith("/") ? outputDir : join8(cwd(), RelativeFilePath2.of(outputDir)));
|
|
884091
884137
|
if (!await doesPathExist(outputPath)) {
|
|
884092
|
-
await (0,
|
|
884138
|
+
await (0, import_promises106.mkdir)(outputPath, { recursive: true });
|
|
884093
884139
|
}
|
|
884094
884140
|
const results = [];
|
|
884095
884141
|
context3.stderr.info("Starting browser for screenshot capture...");
|
|
@@ -884426,8 +884472,8 @@ function createSideBySideComparison(beforePng, afterPng, gap = 20, highlight = t
|
|
|
884426
884472
|
return combined;
|
|
884427
884473
|
}
|
|
884428
884474
|
async function generateComparisons({ beforePath, afterPath, comparisonBasePath }) {
|
|
884429
|
-
const beforePng = import_pngjs.PNG.sync.read(await (0,
|
|
884430
|
-
const afterPng = import_pngjs.PNG.sync.read(await (0,
|
|
884475
|
+
const beforePng = import_pngjs.PNG.sync.read(await (0, import_promises106.readFile)(beforePath));
|
|
884476
|
+
const afterPng = import_pngjs.PNG.sync.read(await (0, import_promises106.readFile)(afterPath));
|
|
884431
884477
|
const beforeOriginalHeight = beforePng.height;
|
|
884432
884478
|
const afterOriginalHeight = afterPng.height;
|
|
884433
884479
|
const width = Math.max(beforePng.width, afterPng.width);
|
|
@@ -884461,7 +884507,7 @@ async function generateComparisons({ beforePath, afterPath, comparisonBasePath }
|
|
|
884461
884507
|
const sideBySide = createSideBySideComparison(croppedBefore, croppedAfter);
|
|
884462
884508
|
const outPath = `${base4}-region-${i5 + 1}.png`;
|
|
884463
884509
|
const pngBuffer = import_pngjs.PNG.sync.write(sideBySide);
|
|
884464
|
-
await (0,
|
|
884510
|
+
await (0, import_promises106.writeFile)(outPath, new Uint8Array(pngBuffer));
|
|
884465
884511
|
results.push({ changePercent, boundingBox, comparisonPath: outPath });
|
|
884466
884512
|
}
|
|
884467
884513
|
return results;
|
|
@@ -888987,14 +889033,14 @@ function generateIndexPages(ns2, title2, writer2, rootNsName, outputFolderSlug)
|
|
|
888987
889033
|
}
|
|
888988
889034
|
|
|
888989
889035
|
// ../library-docs-generator/lib/src/orchestrate.js
|
|
888990
|
-
var
|
|
889036
|
+
var import_promises109 = require("fs/promises");
|
|
888991
889037
|
init_lib4();
|
|
888992
889038
|
init_lib8();
|
|
888993
889039
|
init_lib6();
|
|
888994
889040
|
init_source();
|
|
888995
889041
|
|
|
888996
889042
|
// ../library-docs-generator/lib/src/LocalParserRunner.js
|
|
888997
|
-
var
|
|
889043
|
+
var import_promises108 = require("fs/promises");
|
|
888998
889044
|
var import_node_path39 = require("path");
|
|
888999
889045
|
init_lib68();
|
|
889000
889046
|
init_lib6();
|
|
@@ -889022,7 +889068,7 @@ async function runLocalParser({ context: context3, sourcePath, language, config:
|
|
|
889022
889068
|
const outputDir = await import_tmp_promise11.default.dir({ unsafeCleanup: true });
|
|
889023
889069
|
const configFile = await import_tmp_promise11.default.file({ postfix: ".json" });
|
|
889024
889070
|
try {
|
|
889025
|
-
await (0,
|
|
889071
|
+
await (0, import_promises108.writeFile)(configFile.path, JSON.stringify({
|
|
889026
889072
|
packagePath: config5.packagePath,
|
|
889027
889073
|
sourceUrl: config5.sourceUrl,
|
|
889028
889074
|
doxyfileContent: config5.doxyfileContent
|
|
@@ -889045,7 +889091,7 @@ async function runLocalParser({ context: context3, sourcePath, language, config:
|
|
|
889045
889091
|
const irPath = (0, import_node_path39.join)(outputDir.path, "ir.json");
|
|
889046
889092
|
let irContents;
|
|
889047
889093
|
try {
|
|
889048
|
-
irContents = await (0,
|
|
889094
|
+
irContents = await (0, import_promises108.readFile)(irPath, "utf-8");
|
|
889049
889095
|
} catch {
|
|
889050
889096
|
throw new CliError({
|
|
889051
889097
|
message: `Local parser (${imageName}) did not produce IR at ${irPath}`,
|
|
@@ -889926,7 +889972,7 @@ async function generateSingleLibrary({ client: client3, context: context3, name:
|
|
|
889926
889972
|
if (config5.lang === "cpp" && config5.config?.doxyfile != null) {
|
|
889927
889973
|
const doxyfilePath = resolve6(docsDirectoryPath, config5.config.doxyfile);
|
|
889928
889974
|
try {
|
|
889929
|
-
doxyfileContent = await (0,
|
|
889975
|
+
doxyfileContent = await (0, import_promises109.readFile)(doxyfilePath, "utf-8");
|
|
889930
889976
|
} catch {
|
|
889931
889977
|
throw new CliError({
|
|
889932
889978
|
message: `Library '${name2}': Could not read Doxyfile at '${config5.config.doxyfile}' (resolved to ${doxyfilePath})`,
|
|
@@ -890216,7 +890262,7 @@ init_source();
|
|
|
890216
890262
|
init_lib4();
|
|
890217
890263
|
|
|
890218
890264
|
// ../generation/remote-generation/remote-workspace-runner/lib/automationMetadata.js
|
|
890219
|
-
var
|
|
890265
|
+
var import_promises110 = require("fs/promises");
|
|
890220
890266
|
function getOutputRepoUrl(generatorInvocation) {
|
|
890221
890267
|
return generatorInvocation.outputMode._visit({
|
|
890222
890268
|
downloadFiles: () => void 0,
|
|
@@ -890235,7 +890281,7 @@ function getOutputRepoUrl(generatorInvocation) {
|
|
|
890235
890281
|
async function findGeneratorLineNumber(absolutePathToGeneratorsYml, generatorName, occurrenceIndex) {
|
|
890236
890282
|
let content5;
|
|
890237
890283
|
try {
|
|
890238
|
-
content5 = await (0,
|
|
890284
|
+
content5 = await (0, import_promises110.readFile)(absolutePathToGeneratorsYml, "utf8");
|
|
890239
890285
|
} catch {
|
|
890240
890286
|
return void 0;
|
|
890241
890287
|
}
|
|
@@ -891082,7 +891128,7 @@ init_lib8();
|
|
|
891082
891128
|
|
|
891083
891129
|
// ../workspace/loader/lib/listFernFiles.js
|
|
891084
891130
|
init_lib8();
|
|
891085
|
-
var
|
|
891131
|
+
var import_promises111 = require("fs/promises");
|
|
891086
891132
|
async function listFernFiles2(root6, extensionGlob) {
|
|
891087
891133
|
const files = [];
|
|
891088
891134
|
for (const absoluteFilepath of await listFiles(root6, extensionGlob)) {
|
|
@@ -891097,7 +891143,7 @@ async function createFernFile2({ relativeFilepath, absoluteFilepath }) {
|
|
|
891097
891143
|
return {
|
|
891098
891144
|
relativeFilepath,
|
|
891099
891145
|
absoluteFilepath,
|
|
891100
|
-
fileContents: (await (0,
|
|
891146
|
+
fileContents: (await (0, import_promises111.readFile)(absoluteFilepath)).toString()
|
|
891101
891147
|
};
|
|
891102
891148
|
}
|
|
891103
891149
|
|
|
@@ -891562,7 +891608,7 @@ init_lib19();
|
|
|
891562
891608
|
init_lib4();
|
|
891563
891609
|
init_lib8();
|
|
891564
891610
|
init_lib6();
|
|
891565
|
-
var
|
|
891611
|
+
var import_promises112 = require("fs/promises");
|
|
891566
891612
|
init_js_yaml();
|
|
891567
891613
|
|
|
891568
891614
|
// ../workspace/loader/lib/docs-yml.schema.json
|
|
@@ -898245,7 +898291,7 @@ async function loadDocsConfiguration({ absolutePathToDocsDefinition, context: co
|
|
|
898245
898291
|
});
|
|
898246
898292
|
}
|
|
898247
898293
|
async function loadRawDocsConfiguration({ absolutePathOfConfiguration, context: context3 }) {
|
|
898248
|
-
const contentsStr = await (0,
|
|
898294
|
+
const contentsStr = await (0, import_promises112.readFile)(absolutePathOfConfiguration);
|
|
898249
898295
|
let contentsJson;
|
|
898250
898296
|
try {
|
|
898251
898297
|
contentsJson = index_vite_proxy_tmp_default.load(contentsStr.toString());
|
|
@@ -898292,15 +898338,15 @@ ${result.error?.message ?? "Unknown error"}`,
|
|
|
898292
898338
|
|
|
898293
898339
|
// ../generation/remote-generation/remote-workspace-runner/lib/runRemoteGenerationForAPIWorkspace.js
|
|
898294
898340
|
init_esm19();
|
|
898295
|
-
var
|
|
898341
|
+
var import_promises119 = require("fs/promises");
|
|
898296
898342
|
|
|
898297
898343
|
// ../generation/remote-generation/remote-workspace-runner/lib/downloadSnippetsForTask.js
|
|
898298
898344
|
init_lib8();
|
|
898299
898345
|
init_axios2();
|
|
898300
898346
|
init_source();
|
|
898301
898347
|
var import_fs36 = require("fs");
|
|
898302
|
-
var
|
|
898303
|
-
var
|
|
898348
|
+
var import_promises113 = require("fs/promises");
|
|
898349
|
+
var import_promises114 = require("stream/promises");
|
|
898304
898350
|
async function downloadSnippetsForTask({ snippetsS3PreSignedReadUrl, absolutePathToLocalSnippetJSON, context: context3 }) {
|
|
898305
898351
|
try {
|
|
898306
898352
|
await downloadFileForTask({
|
|
@@ -898317,10 +898363,10 @@ async function downloadFileForTask({ s3PreSignedReadUrl, absolutePathToLocalOutp
|
|
|
898317
898363
|
responseType: "stream"
|
|
898318
898364
|
});
|
|
898319
898365
|
if (await doesPathExist(absolutePathToLocalOutput)) {
|
|
898320
|
-
await (0,
|
|
898366
|
+
await (0, import_promises113.rm)(absolutePathToLocalOutput, { recursive: true });
|
|
898321
898367
|
}
|
|
898322
|
-
await (0,
|
|
898323
|
-
await (0,
|
|
898368
|
+
await (0, import_promises113.mkdir)(dirname6(absolutePathToLocalOutput), { recursive: true });
|
|
898369
|
+
await (0, import_promises114.pipeline)(request7.data, (0, import_fs36.createWriteStream)(absolutePathToLocalOutput));
|
|
898324
898370
|
}
|
|
898325
898371
|
|
|
898326
898372
|
// ../generation/remote-generation/remote-workspace-runner/lib/resolveAutoDiscoveredFernignorePath.js
|
|
@@ -898361,7 +898407,7 @@ init_lib6();
|
|
|
898361
898407
|
init_esm19();
|
|
898362
898408
|
init_axios2();
|
|
898363
898409
|
var import_form_data4 = __toESM(require_form_data(), 1);
|
|
898364
|
-
var
|
|
898410
|
+
var import_promises115 = require("fs/promises");
|
|
898365
898411
|
init_js_yaml();
|
|
898366
898412
|
var import_url_join23 = __toESM(require_url_join(), 1);
|
|
898367
898413
|
var import_util68 = require("util");
|
|
@@ -898423,7 +898469,7 @@ async function createAndStartJob({ projectConfig, workspace, organization, inter
|
|
|
898423
898469
|
fernignoreContents = "";
|
|
898424
898470
|
} else if (fernignorePath != null) {
|
|
898425
898471
|
try {
|
|
898426
|
-
fernignoreContents = await (0,
|
|
898472
|
+
fernignoreContents = await (0, import_promises115.readFile)(fernignorePath, "utf-8");
|
|
898427
898473
|
} catch (error50) {
|
|
898428
898474
|
context3.failAndThrow(`Failed to read fernignore file at ${fernignorePath}: ${error50}`, void 0, {
|
|
898429
898475
|
code: CliError.Code.ConfigError
|
|
@@ -898733,9 +898779,9 @@ init_lib6();
|
|
|
898733
898779
|
init_axios2();
|
|
898734
898780
|
init_source();
|
|
898735
898781
|
var import_fs37 = require("fs");
|
|
898736
|
-
var
|
|
898782
|
+
var import_promises116 = require("fs/promises");
|
|
898737
898783
|
var import_path79 = __toESM(require("path"), 1);
|
|
898738
|
-
var
|
|
898784
|
+
var import_promises117 = require("stream/promises");
|
|
898739
898785
|
|
|
898740
898786
|
// ../../../node_modules/.pnpm/terminal-link@3.0.0/node_modules/terminal-link/index.js
|
|
898741
898787
|
init_ansi_escapes();
|
|
@@ -899057,9 +899103,9 @@ async function downloadZipForTask({ s3PreSignedReadUrl, absolutePathToLocalOutpu
|
|
|
899057
899103
|
});
|
|
899058
899104
|
const tmpDir = await import_tmp_promise13.default.dir({ prefix: "fern", unsafeCleanup: true });
|
|
899059
899105
|
const outputZipPath = import_path79.default.join(tmpDir.path, "output.zip");
|
|
899060
|
-
await (0,
|
|
899106
|
+
await (0, import_promises117.pipeline)(request7.data, (0, import_fs37.createWriteStream)(outputZipPath));
|
|
899061
899107
|
await forceRemoveDirectory(absolutePathToLocalOutput);
|
|
899062
|
-
await (0,
|
|
899108
|
+
await (0, import_promises116.mkdir)(absolutePathToLocalOutput, { recursive: true });
|
|
899063
899109
|
await extractZipToDirectory(outputZipPath, absolutePathToLocalOutput);
|
|
899064
899110
|
}
|
|
899065
899111
|
async function forceRemoveDirectory(dirPath) {
|
|
@@ -899067,22 +899113,22 @@ async function forceRemoveDirectory(dirPath) {
|
|
|
899067
899113
|
return;
|
|
899068
899114
|
}
|
|
899069
899115
|
await makeWritableRecursive(dirPath);
|
|
899070
|
-
await (0,
|
|
899116
|
+
await (0, import_promises116.rm)(dirPath, { recursive: true, force: true });
|
|
899071
899117
|
}
|
|
899072
899118
|
async function makeWritableRecursive(dirPath) {
|
|
899073
899119
|
try {
|
|
899074
|
-
const entries24 = await (0,
|
|
899120
|
+
const entries24 = await (0, import_promises116.readdir)(dirPath, { withFileTypes: true });
|
|
899075
899121
|
for (const entry of entries24) {
|
|
899076
899122
|
const fullPath = AbsoluteFilePath2.of(import_path79.default.join(dirPath, entry.name));
|
|
899077
899123
|
if (entry.isDirectory()) {
|
|
899078
899124
|
await makeWritableRecursive(fullPath);
|
|
899079
899125
|
}
|
|
899080
899126
|
try {
|
|
899081
|
-
await (0,
|
|
899127
|
+
await (0, import_promises116.chmod)(fullPath, 493);
|
|
899082
899128
|
} catch {
|
|
899083
899129
|
}
|
|
899084
899130
|
}
|
|
899085
|
-
await (0,
|
|
899131
|
+
await (0, import_promises116.chmod)(dirPath, 493);
|
|
899086
899132
|
} catch {
|
|
899087
899133
|
}
|
|
899088
899134
|
}
|
|
@@ -899128,7 +899174,7 @@ async function downloadFilesWithFernIgnoreInTempRepo({ s3PreSignedReadUrl, absol
|
|
|
899128
899174
|
const tmpOutputResolutionDir = AbsoluteFilePath2.of((await import_tmp_promise13.default.dir({})).path);
|
|
899129
899175
|
const absolutePathToFernignore = join8(absolutePathToLocalOutput, RelativeFilePath2.of(FERNIGNORE_FILENAME));
|
|
899130
899176
|
const fernIgnorePaths = await getFernIgnorePaths({ absolutePathToFernignore });
|
|
899131
|
-
await (0,
|
|
899177
|
+
await (0, import_promises116.cp)(absolutePathToLocalOutput, tmpOutputResolutionDir, { recursive: true });
|
|
899132
899178
|
await runGitCommand(["init"], tmpOutputResolutionDir, context3);
|
|
899133
899179
|
await runGitCommand(["add", "."], tmpOutputResolutionDir, context3);
|
|
899134
899180
|
await runGitCommand([
|
|
@@ -899151,7 +899197,7 @@ async function downloadFilesWithFernIgnoreInTempRepo({ s3PreSignedReadUrl, absol
|
|
|
899151
899197
|
await runGitCommand(["restore", "."], tmpOutputResolutionDir, context3);
|
|
899152
899198
|
await forceRemoveDirectory(join8(tmpOutputResolutionDir, RelativeFilePath2.of(".git")));
|
|
899153
899199
|
await forceRemoveDirectory(absolutePathToLocalOutput);
|
|
899154
|
-
await (0,
|
|
899200
|
+
await (0, import_promises116.cp)(tmpOutputResolutionDir, absolutePathToLocalOutput, { recursive: true });
|
|
899155
899201
|
}
|
|
899156
899202
|
async function downloadAndExtractZipToDirectory({ s3PreSignedReadUrl, outputPath }) {
|
|
899157
899203
|
const request7 = await axios_default.get(s3PreSignedReadUrl, {
|
|
@@ -899161,7 +899207,7 @@ async function downloadAndExtractZipToDirectory({ s3PreSignedReadUrl, outputPath
|
|
|
899161
899207
|
});
|
|
899162
899208
|
const tmpDir = await import_tmp_promise13.default.dir({ prefix: "fern", unsafeCleanup: true });
|
|
899163
899209
|
const outputZipPath = import_path79.default.join(tmpDir.path, "output.zip");
|
|
899164
|
-
await (0,
|
|
899210
|
+
await (0, import_promises117.pipeline)(request7.data, (0, import_fs37.createWriteStream)(outputZipPath));
|
|
899165
899211
|
await extractZipToDirectory(outputZipPath, outputPath);
|
|
899166
899212
|
}
|
|
899167
899213
|
async function extractZipToDirectory(zipPath, outputDir) {
|
|
@@ -899176,10 +899222,10 @@ async function extractZipToDirectory(zipPath, outputDir) {
|
|
|
899176
899222
|
zipFile.on("entry", (entry) => {
|
|
899177
899223
|
const outputPath = import_path79.default.join(outputDir, entry.fileName);
|
|
899178
899224
|
if (entry.fileName.endsWith("/")) {
|
|
899179
|
-
(0,
|
|
899225
|
+
(0, import_promises116.mkdir)(outputPath, { recursive: true }).then(() => zipFile.readEntry()).catch(reject);
|
|
899180
899226
|
return;
|
|
899181
899227
|
}
|
|
899182
|
-
(0,
|
|
899228
|
+
(0, import_promises116.mkdir)(import_path79.default.dirname(outputPath), { recursive: true }).then(() => {
|
|
899183
899229
|
zipFile.openReadStream(entry, (streamErr, readStream2) => {
|
|
899184
899230
|
if (streamErr || !readStream2) {
|
|
899185
899231
|
reject(streamErr ?? new Error("Failed to open read stream"));
|
|
@@ -899199,7 +899245,7 @@ init_lib8();
|
|
|
899199
899245
|
init_lib9();
|
|
899200
899246
|
init_lib33();
|
|
899201
899247
|
init_lib6();
|
|
899202
|
-
var
|
|
899248
|
+
var import_promises118 = require("fs/promises");
|
|
899203
899249
|
var import_tmp_promise14 = __toESM(require_tmp_promise(), 1);
|
|
899204
899250
|
var PROTOBUF_ZIP_FILENAME = "proto.zip";
|
|
899205
899251
|
var SourceUploader = class {
|
|
@@ -899220,7 +899266,7 @@ var SourceUploader = class {
|
|
|
899220
899266
|
}
|
|
899221
899267
|
async uploadSource(source2, uploadURL) {
|
|
899222
899268
|
const uploadCommand = await this.getUploadCommand(source2);
|
|
899223
|
-
const fileData = await (0,
|
|
899269
|
+
const fileData = await (0, import_promises118.readFile)(uploadCommand.absoluteFilePath);
|
|
899224
899270
|
let response;
|
|
899225
899271
|
try {
|
|
899226
899272
|
response = await fetch(uploadURL, {
|
|
@@ -899249,7 +899295,7 @@ var SourceUploader = class {
|
|
|
899249
899295
|
absoluteFilePath,
|
|
899250
899296
|
cleanup: async () => {
|
|
899251
899297
|
this.context.logger.debug(`Removing ${absoluteFilePath}`);
|
|
899252
|
-
await (0,
|
|
899298
|
+
await (0, import_promises118.unlink)(absoluteFilePath);
|
|
899253
899299
|
}
|
|
899254
899300
|
};
|
|
899255
899301
|
}
|
|
@@ -899916,7 +899962,7 @@ async function emitGenerationAnnotations(ctx) {
|
|
|
899916
899962
|
const lines = notices.map((n2) => `${n2.summaryLine}
|
|
899917
899963
|
`).join("");
|
|
899918
899964
|
try {
|
|
899919
|
-
await (0,
|
|
899965
|
+
await (0, import_promises119.appendFile)(stepSummaryPath, lines, "utf8");
|
|
899920
899966
|
} catch (error50) {
|
|
899921
899967
|
process.stderr.write(`[warn] Failed to append to GITHUB_STEP_SUMMARY: ${error50}
|
|
899922
899968
|
`);
|
|
@@ -899983,7 +900029,7 @@ init_lib6();
|
|
|
899983
900029
|
init_axios2();
|
|
899984
900030
|
init_source();
|
|
899985
900031
|
var import_crypto9 = require("crypto");
|
|
899986
|
-
var
|
|
900032
|
+
var import_promises122 = require("fs/promises");
|
|
899987
900033
|
init_lodash();
|
|
899988
900034
|
var mime3 = __toESM(require_mime_types(), 1);
|
|
899989
900035
|
var import_path80 = require("path");
|
|
@@ -900058,7 +900104,7 @@ init_lib67();
|
|
|
900058
900104
|
init_js();
|
|
900059
900105
|
init_lib66();
|
|
900060
900106
|
var import_crypto8 = require("crypto");
|
|
900061
|
-
var
|
|
900107
|
+
var import_promises121 = require("fs/promises");
|
|
900062
900108
|
var mime2 = __toESM(require_mime_types(), 1);
|
|
900063
900109
|
|
|
900064
900110
|
// ../generation/remote-generation/remote-workspace-runner/lib/mapDocsConfigToLedgerConfig.js
|
|
@@ -900430,7 +900476,7 @@ async function uploadMissingBlobs(missingContent, blobs, context3, filePaths) {
|
|
|
900430
900476
|
if (blob == null && filePaths != null) {
|
|
900431
900477
|
const filePath = filePaths.get(hash5);
|
|
900432
900478
|
if (filePath != null) {
|
|
900433
|
-
blob = await (0,
|
|
900479
|
+
blob = await (0, import_promises121.readFile)(filePath);
|
|
900434
900480
|
const inferred = mime2.lookup(filePath);
|
|
900435
900481
|
if (inferred !== false) {
|
|
900436
900482
|
contentType = inferred;
|
|
@@ -900714,6 +900760,22 @@ function sanitizePreviewId2(id) {
|
|
|
900714
900760
|
}
|
|
900715
900761
|
return sanitized;
|
|
900716
900762
|
}
|
|
900763
|
+
function formatLedgerError(error50) {
|
|
900764
|
+
if (error50 == null) {
|
|
900765
|
+
return "Unknown error";
|
|
900766
|
+
}
|
|
900767
|
+
const msg = error50 instanceof Error ? error50.message : String(error50);
|
|
900768
|
+
const data2 = error50.data;
|
|
900769
|
+
if (data2?.issues != null && Array.isArray(data2.issues) && data2.issues.length > 0) {
|
|
900770
|
+
const issueLines = data2.issues.map((issue2) => {
|
|
900771
|
+
const path119 = issue2.path?.join(".") ?? "";
|
|
900772
|
+
const message = issue2.message ?? "invalid";
|
|
900773
|
+
return path119 ? ` - ${path119}: ${message}` : ` - ${message}`;
|
|
900774
|
+
}).join("\n");
|
|
900775
|
+
return msg + "\n" + issueLines;
|
|
900776
|
+
}
|
|
900777
|
+
return msg;
|
|
900778
|
+
}
|
|
900717
900779
|
var DocsPublishConflictError = class extends Error {
|
|
900718
900780
|
constructor() {
|
|
900719
900781
|
super("Another docs publish is currently in progress for this domain.");
|
|
@@ -900730,7 +900792,7 @@ function sanitizeRelativePathForS3(relativeFilePath) {
|
|
|
900730
900792
|
return relativeFilePath.replace(/\.\.\//g, "_dot_dot_/");
|
|
900731
900793
|
}
|
|
900732
900794
|
async function readAndHashFile(absoluteFilePath) {
|
|
900733
|
-
const buffer = await (0,
|
|
900795
|
+
const buffer = await (0, import_promises122.readFile)(absoluteFilePath);
|
|
900734
900796
|
const hash5 = (0, import_crypto9.createHash)("sha256").update(new Uint8Array(buffer)).digest("hex");
|
|
900735
900797
|
return { buffer, hash: hash5 };
|
|
900736
900798
|
}
|
|
@@ -901181,7 +901243,8 @@ ${JSON.stringify(errorDetails, void 0, 2)}`);
|
|
|
901181
901243
|
try {
|
|
901182
901244
|
await runLedgerPublish();
|
|
901183
901245
|
} catch (error50) {
|
|
901184
|
-
|
|
901246
|
+
const detail = formatLedgerError(error50);
|
|
901247
|
+
return context3.failAndThrow("Failed to publish docs via ledger to " + domain3 + ": " + detail, error50, {
|
|
901185
901248
|
code: CliError.Code.NetworkError
|
|
901186
901249
|
});
|
|
901187
901250
|
}
|
|
@@ -901231,13 +901294,13 @@ ${JSON.stringify(errorDetails, void 0, 2)}`);
|
|
|
901231
901294
|
};
|
|
901232
901295
|
const localeAwareMarkdownLoader = async (filepath) => {
|
|
901233
901296
|
const pathToRead = await resolveLocalePath(filepath);
|
|
901234
|
-
const raw = await (0,
|
|
901297
|
+
const raw = await (0, import_promises122.readFile)(pathToRead, "utf-8");
|
|
901235
901298
|
const fmMatch = raw.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/);
|
|
901236
901299
|
return fmMatch != null ? raw.slice(fmMatch[0].length) : raw;
|
|
901237
901300
|
};
|
|
901238
901301
|
const localeAwareFileLoader = async (filepath) => {
|
|
901239
901302
|
const pathToRead = await resolveLocalePath(filepath);
|
|
901240
|
-
return (0,
|
|
901303
|
+
return (0, import_promises122.readFile)(pathToRead, "utf-8");
|
|
901241
901304
|
};
|
|
901242
901305
|
const translatedPageEntries = await Promise.all(Object.entries(localePages).map(async ([path119, rawMarkdown]) => {
|
|
901243
901306
|
try {
|
|
@@ -901431,7 +901494,7 @@ async function uploadFiles(filesToUpload, docsWorkspacePath, context3, batchSize
|
|
|
901431
901494
|
try {
|
|
901432
901495
|
const uploadUrl = extractUploadUrl(urlValue);
|
|
901433
901496
|
const mimeType = mime3.lookup(absoluteFilePath);
|
|
901434
|
-
await axios_default.put(uploadUrl, await (0,
|
|
901497
|
+
await axios_default.put(uploadUrl, await (0, import_promises122.readFile)(absoluteFilePath), {
|
|
901435
901498
|
headers: {
|
|
901436
901499
|
"Content-Type": mimeType === false ? "application/octet-stream" : mimeType,
|
|
901437
901500
|
// Set max cache control for S3 uploads
|
|
@@ -902082,7 +902145,7 @@ var LegacyDocsPublisher = class {
|
|
|
902082
902145
|
previewId,
|
|
902083
902146
|
disableTemplates: void 0,
|
|
902084
902147
|
skipUpload,
|
|
902085
|
-
cliVersion: "5.23.3-
|
|
902148
|
+
cliVersion: "5.23.3-1177-gde22c310de8",
|
|
902086
902149
|
loginCommand: "fern auth login"
|
|
902087
902150
|
});
|
|
902088
902151
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -903072,7 +903135,7 @@ init_lib4();
|
|
|
903072
903135
|
init_lib8();
|
|
903073
903136
|
init_lib6();
|
|
903074
903137
|
init_source();
|
|
903075
|
-
var
|
|
903138
|
+
var import_promises123 = require("fs/promises");
|
|
903076
903139
|
var import_path82 = __toESM(require("path"), 1);
|
|
903077
903140
|
|
|
903078
903141
|
// ../cli-v2/lib/config/fern-yml/FernYmlBuilder.js
|
|
@@ -903943,7 +904006,7 @@ var InitCommand = class {
|
|
|
903943
904006
|
apiPath,
|
|
903944
904007
|
defaultGroup: result.defaultGroup
|
|
903945
904008
|
});
|
|
903946
|
-
await (0,
|
|
904009
|
+
await (0, import_promises123.writeFile)(fernYmlPath, fernYmlContent, "utf-8");
|
|
903947
904010
|
context3.stderr.info(`
|
|
903948
904011
|
${Icons.success} Created ${FERN_YML_FILENAME}`);
|
|
903949
904012
|
}
|
|
@@ -903965,9 +904028,9 @@ var InitCommand = class {
|
|
|
903965
904028
|
}
|
|
903966
904029
|
async writeSpecFile(cwd2, filename, content5) {
|
|
903967
904030
|
const specsDir = join8(cwd2, RelativeFilePath2.of(SPECS_DIR));
|
|
903968
|
-
await (0,
|
|
904031
|
+
await (0, import_promises123.mkdir)(specsDir, { recursive: true });
|
|
903969
904032
|
const filePath = join8(specsDir, RelativeFilePath2.of(filename));
|
|
903970
|
-
await (0,
|
|
904033
|
+
await (0, import_promises123.writeFile)(filePath, content5, "utf-8");
|
|
903971
904034
|
}
|
|
903972
904035
|
resolveApiPath(apiSource) {
|
|
903973
904036
|
switch (apiSource.type) {
|
|
@@ -905129,7 +905192,7 @@ function addReplayCommand(cli) {
|
|
|
905129
905192
|
init_lib8();
|
|
905130
905193
|
init_lib6();
|
|
905131
905194
|
init_source();
|
|
905132
|
-
var
|
|
905195
|
+
var import_promises124 = require("fs/promises");
|
|
905133
905196
|
var SchemaCommand = class {
|
|
905134
905197
|
async handle(context3, args) {
|
|
905135
905198
|
const schema = this.resolveSchema(args.name);
|
|
@@ -905165,9 +905228,9 @@ var SchemaCommand = class {
|
|
|
905165
905228
|
const absoluteOutputPath = resolve6(context3.cwd, outputPath);
|
|
905166
905229
|
const outputDir = dirname6(absoluteOutputPath);
|
|
905167
905230
|
if (!await doesPathExist(outputDir)) {
|
|
905168
|
-
await (0,
|
|
905231
|
+
await (0, import_promises124.mkdir)(outputDir, { recursive: true });
|
|
905169
905232
|
}
|
|
905170
|
-
await (0,
|
|
905233
|
+
await (0, import_promises124.writeFile)(absoluteOutputPath, this.formatJson(value2, pretty));
|
|
905171
905234
|
context3.stderr.info(source_default.green(`Wrote JSON Schema to ${absoluteOutputPath}`));
|
|
905172
905235
|
}
|
|
905173
905236
|
};
|
|
@@ -905451,14 +905514,14 @@ init_lib4();
|
|
|
905451
905514
|
init_lib8();
|
|
905452
905515
|
init_lib6();
|
|
905453
905516
|
init_source();
|
|
905454
|
-
var
|
|
905517
|
+
var import_promises142 = require("fs/promises");
|
|
905455
905518
|
init_js_yaml();
|
|
905456
905519
|
|
|
905457
905520
|
// ../cli-v2/lib/api/resolver/ApiSpecResolver.js
|
|
905458
905521
|
init_lib8();
|
|
905459
905522
|
init_lib6();
|
|
905460
|
-
var
|
|
905461
|
-
var
|
|
905523
|
+
var import_promises125 = require("fs/promises");
|
|
905524
|
+
var import_os12 = require("os");
|
|
905462
905525
|
var import_path86 = __toESM(require("path"), 1);
|
|
905463
905526
|
|
|
905464
905527
|
// ../cli-v2/lib/api/resolver/ApiSpecDetector.js
|
|
@@ -905534,9 +905597,9 @@ var ApiSpecResolver = class {
|
|
|
905534
905597
|
});
|
|
905535
905598
|
}
|
|
905536
905599
|
const extension4 = this.inferExtensionFromContent(content5);
|
|
905537
|
-
const tempDir2 = await (0,
|
|
905600
|
+
const tempDir2 = await (0, import_promises125.mkdtemp)(import_path86.default.join((0, import_os12.tmpdir)(), "fern-"));
|
|
905538
905601
|
const absoluteFilePath = AbsoluteFilePath2.of(import_path86.default.join(tempDir2, `spec${extension4}`));
|
|
905539
|
-
await (0,
|
|
905602
|
+
await (0, import_promises125.writeFile)(absoluteFilePath, content5, "utf-8");
|
|
905540
905603
|
const specType = await this.detector.detect({ absoluteFilePath, content: content5, reference: "stdin" });
|
|
905541
905604
|
return {
|
|
905542
905605
|
absoluteFilePath,
|
|
@@ -905552,9 +905615,9 @@ var ApiSpecResolver = class {
|
|
|
905552
905615
|
async resolveUrl({ reference: reference4 }) {
|
|
905553
905616
|
const { content: content5, contentType } = await this.fetchContent({ url: reference4 });
|
|
905554
905617
|
const extension4 = this.inferExtension({ url: reference4, contentType });
|
|
905555
|
-
const tempDir2 = await (0,
|
|
905618
|
+
const tempDir2 = await (0, import_promises125.mkdtemp)(import_path86.default.join((0, import_os12.tmpdir)(), "fern-"));
|
|
905556
905619
|
const absoluteFilePath = AbsoluteFilePath2.of(import_path86.default.join(tempDir2, `spec${extension4}`));
|
|
905557
|
-
await (0,
|
|
905620
|
+
await (0, import_promises125.writeFile)(absoluteFilePath, content5, "utf-8");
|
|
905558
905621
|
const specType = await this.detector.detect({ absoluteFilePath, content: content5, reference: reference4 });
|
|
905559
905622
|
return {
|
|
905560
905623
|
absoluteFilePath,
|
|
@@ -905570,7 +905633,7 @@ var ApiSpecResolver = class {
|
|
|
905570
905633
|
code: CliError.Code.ConfigError
|
|
905571
905634
|
});
|
|
905572
905635
|
}
|
|
905573
|
-
const content5 = await (0,
|
|
905636
|
+
const content5 = await (0, import_promises125.readFile)(absoluteFilePath, "utf-8");
|
|
905574
905637
|
const specType = await this.detector.detect({ absoluteFilePath, content: content5, reference: reference4 });
|
|
905575
905638
|
return {
|
|
905576
905639
|
absoluteFilePath,
|
|
@@ -924363,7 +924426,7 @@ var DynamicSnippetsGenerator = class extends AbstractDynamicSnippetsGenerator {
|
|
|
924363
924426
|
|
|
924364
924427
|
// ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/csharp/DynamicSnippetsCsharpTestGenerator.js
|
|
924365
924428
|
init_lib8();
|
|
924366
|
-
var
|
|
924429
|
+
var import_promises126 = require("fs/promises");
|
|
924367
924430
|
var import_path88 = __toESM(require("path"), 1);
|
|
924368
924431
|
|
|
924369
924432
|
// ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/utils/convertEndpointSnippetRequest.js
|
|
@@ -924497,8 +924560,8 @@ var DynamicSnippetsCsharpTestGenerator = class {
|
|
|
924497
924560
|
endpointId
|
|
924498
924561
|
});
|
|
924499
924562
|
const dynamicSnippetFilePath = this.getTestFilePath({ absolutePathToOutputDir, idx });
|
|
924500
|
-
await (0,
|
|
924501
|
-
await (0,
|
|
924563
|
+
await (0, import_promises126.mkdir)(import_path88.default.dirname(dynamicSnippetFilePath), { recursive: true });
|
|
924564
|
+
await (0, import_promises126.writeFile)(dynamicSnippetFilePath, response.snippet);
|
|
924502
924565
|
} catch (error50) {
|
|
924503
924566
|
this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
|
|
924504
924567
|
}
|
|
@@ -924507,8 +924570,8 @@ var DynamicSnippetsCsharpTestGenerator = class {
|
|
|
924507
924570
|
}
|
|
924508
924571
|
async initializeProject(outputDir) {
|
|
924509
924572
|
const absolutePathToOutputDir = join8(outputDir, RelativeFilePath2.of("Snippets"));
|
|
924510
|
-
await (0,
|
|
924511
|
-
await (0,
|
|
924573
|
+
await (0, import_promises126.mkdir)(absolutePathToOutputDir, { recursive: true });
|
|
924574
|
+
await (0, import_promises126.writeFile)(join8(absolutePathToOutputDir, RelativeFilePath2.of("Snippets.csproj")), PROJECT_FILE_CONTENT);
|
|
924512
924575
|
return absolutePathToOutputDir;
|
|
924513
924576
|
}
|
|
924514
924577
|
getTestFilePath({ absolutePathToOutputDir, idx }) {
|
|
@@ -928021,7 +928084,7 @@ var DynamicSnippetsGenerator2 = class extends AbstractDynamicSnippetsGenerator {
|
|
|
928021
928084
|
};
|
|
928022
928085
|
|
|
928023
928086
|
// ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/go/DynamicSnippetsGoTestGenerator.js
|
|
928024
|
-
var
|
|
928087
|
+
var import_promises127 = require("fs/promises");
|
|
928025
928088
|
var import_path90 = __toESM(require("path"), 1);
|
|
928026
928089
|
var DynamicSnippetsGoTestGenerator = class {
|
|
928027
928090
|
context;
|
|
@@ -928050,8 +928113,8 @@ var DynamicSnippetsGoTestGenerator = class {
|
|
|
928050
928113
|
endpointId
|
|
928051
928114
|
});
|
|
928052
928115
|
const dynamicSnippetFilePath = this.getTestFilePath({ outputDir, idx });
|
|
928053
|
-
await (0,
|
|
928054
|
-
await (0,
|
|
928116
|
+
await (0, import_promises127.mkdir)(import_path90.default.dirname(dynamicSnippetFilePath), { recursive: true });
|
|
928117
|
+
await (0, import_promises127.writeFile)(dynamicSnippetFilePath, response.snippet);
|
|
928055
928118
|
} catch (error50) {
|
|
928056
928119
|
this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
|
|
928057
928120
|
if (error50 instanceof Error && error50.stack) {
|
|
@@ -931938,7 +932001,7 @@ var DynamicSnippetsGenerator3 = class extends AbstractDynamicSnippetsGenerator {
|
|
|
931938
932001
|
// ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/java/DynamicSnippetsJavaTestGenerator.js
|
|
931939
932002
|
init_lib33();
|
|
931940
932003
|
init_lib6();
|
|
931941
|
-
var
|
|
932004
|
+
var import_promises128 = require("fs/promises");
|
|
931942
932005
|
var import_path91 = __toESM(require("path"), 1);
|
|
931943
932006
|
var DynamicSnippetsJavaTestGenerator = class {
|
|
931944
932007
|
context;
|
|
@@ -931976,8 +932039,8 @@ var DynamicSnippetsJavaTestGenerator = class {
|
|
|
931976
932039
|
endpointId
|
|
931977
932040
|
});
|
|
931978
932041
|
const dynamicSnippetFilePath = this.getTestFilePath({ absolutePathToOutputDir, idx });
|
|
931979
|
-
await (0,
|
|
931980
|
-
await (0,
|
|
932042
|
+
await (0, import_promises128.mkdir)(import_path91.default.dirname(dynamicSnippetFilePath), { recursive: true });
|
|
932043
|
+
await (0, import_promises128.writeFile)(dynamicSnippetFilePath, response.snippet);
|
|
931981
932044
|
} catch (error50) {
|
|
931982
932045
|
this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
|
|
931983
932046
|
}
|
|
@@ -932004,7 +932067,7 @@ var DynamicSnippetsJavaTestGenerator = class {
|
|
|
932004
932067
|
const reportsPath = join8(outputDir, RelativeFilePath2.of("reports"));
|
|
932005
932068
|
const buildReportsExists = await doesPathExist(buildReportsPath, "directory");
|
|
932006
932069
|
if (buildReportsExists) {
|
|
932007
|
-
await (0,
|
|
932070
|
+
await (0, import_promises128.cp)(buildReportsPath, reportsPath, { recursive: true });
|
|
932008
932071
|
this.context.logger.info("Gradle profiling report copied to reports/");
|
|
932009
932072
|
} else {
|
|
932010
932073
|
this.context.logger.info("No profiling report found in build/reports/");
|
|
@@ -932018,7 +932081,7 @@ var DynamicSnippetsJavaTestGenerator = class {
|
|
|
932018
932081
|
}
|
|
932019
932082
|
async initializeProject(outputDir) {
|
|
932020
932083
|
const absolutePathToOutputDir = join8(outputDir, RelativeFilePath2.of("src/main/java/com/snippets"));
|
|
932021
|
-
await (0,
|
|
932084
|
+
await (0, import_promises128.mkdir)(absolutePathToOutputDir, { recursive: true });
|
|
932022
932085
|
return absolutePathToOutputDir;
|
|
932023
932086
|
}
|
|
932024
932087
|
getTestFilePath({ absolutePathToOutputDir, idx }) {
|
|
@@ -935521,7 +935584,7 @@ var DynamicSnippetsGenerator4 = class extends AbstractDynamicSnippetsGenerator {
|
|
|
935521
935584
|
};
|
|
935522
935585
|
|
|
935523
935586
|
// ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/php/DynamicSnippetsPhpTestGenerator.js
|
|
935524
|
-
var
|
|
935587
|
+
var import_promises129 = require("fs/promises");
|
|
935525
935588
|
var import_path92 = __toESM(require("path"), 1);
|
|
935526
935589
|
var DynamicSnippetsPhpTestGenerator = class {
|
|
935527
935590
|
context;
|
|
@@ -935550,8 +935613,8 @@ var DynamicSnippetsPhpTestGenerator = class {
|
|
|
935550
935613
|
endpointId
|
|
935551
935614
|
});
|
|
935552
935615
|
const dynamicSnippetFilePath = this.getTestFilePath({ outputDir, idx });
|
|
935553
|
-
await (0,
|
|
935554
|
-
await (0,
|
|
935616
|
+
await (0, import_promises129.mkdir)(import_path92.default.dirname(dynamicSnippetFilePath), { recursive: true });
|
|
935617
|
+
await (0, import_promises129.writeFile)(dynamicSnippetFilePath, response.snippet);
|
|
935555
935618
|
} catch (error50) {
|
|
935556
935619
|
this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
|
|
935557
935620
|
}
|
|
@@ -938808,7 +938871,7 @@ var DynamicSnippetsGenerator5 = class extends AbstractDynamicSnippetsGenerator {
|
|
|
938808
938871
|
};
|
|
938809
938872
|
|
|
938810
938873
|
// ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/python/DynamicSnippetsPythonTestGenerator.js
|
|
938811
|
-
var
|
|
938874
|
+
var import_promises130 = require("fs/promises");
|
|
938812
938875
|
var import_path93 = __toESM(require("path"), 1);
|
|
938813
938876
|
var DynamicSnippetsPythonTestGenerator = class {
|
|
938814
938877
|
context;
|
|
@@ -938837,8 +938900,8 @@ var DynamicSnippetsPythonTestGenerator = class {
|
|
|
938837
938900
|
endpointId
|
|
938838
938901
|
});
|
|
938839
938902
|
const dynamicSnippetFilePath = this.getTestFilePath({ outputDir, idx });
|
|
938840
|
-
await (0,
|
|
938841
|
-
await (0,
|
|
938903
|
+
await (0, import_promises130.mkdir)(import_path93.default.dirname(dynamicSnippetFilePath), { recursive: true });
|
|
938904
|
+
await (0, import_promises130.writeFile)(dynamicSnippetFilePath, response.snippet);
|
|
938842
938905
|
} catch (error50) {
|
|
938843
938906
|
this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
|
|
938844
938907
|
}
|
|
@@ -941809,7 +941872,7 @@ var DynamicSnippetsGenerator6 = class extends AbstractDynamicSnippetsGenerator {
|
|
|
941809
941872
|
};
|
|
941810
941873
|
|
|
941811
941874
|
// ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/ruby/DynamicSnippetsRubyTestGenerator.js
|
|
941812
|
-
var
|
|
941875
|
+
var import_promises131 = require("fs/promises");
|
|
941813
941876
|
var import_path94 = __toESM(require("path"), 1);
|
|
941814
941877
|
var DynamicSnippetsRubyTestGenerator = class {
|
|
941815
941878
|
context;
|
|
@@ -941838,8 +941901,8 @@ var DynamicSnippetsRubyTestGenerator = class {
|
|
|
941838
941901
|
endpointId
|
|
941839
941902
|
});
|
|
941840
941903
|
const dynamicSnippetFilePath = this.getTestFilePath({ outputDir, idx });
|
|
941841
|
-
await (0,
|
|
941842
|
-
await (0,
|
|
941904
|
+
await (0, import_promises131.mkdir)(import_path94.default.dirname(dynamicSnippetFilePath), { recursive: true });
|
|
941905
|
+
await (0, import_promises131.writeFile)(dynamicSnippetFilePath, response.snippet);
|
|
941843
941906
|
} catch (error50) {
|
|
941844
941907
|
this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
|
|
941845
941908
|
if (error50 instanceof Error && error50.stack) {
|
|
@@ -941855,7 +941918,7 @@ var DynamicSnippetsRubyTestGenerator = class {
|
|
|
941855
941918
|
};
|
|
941856
941919
|
|
|
941857
941920
|
// ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/rust/DynamicSnippetsRustTestGenerator.js
|
|
941858
|
-
var
|
|
941921
|
+
var import_promises132 = require("fs/promises");
|
|
941859
941922
|
var import_node_path40 = __toESM(require("path"), 1);
|
|
941860
941923
|
init_lib8();
|
|
941861
941924
|
|
|
@@ -947089,8 +947152,8 @@ var DynamicSnippetsRustTestGenerator = class {
|
|
|
947089
947152
|
absolutePathToOutputDir,
|
|
947090
947153
|
idx
|
|
947091
947154
|
});
|
|
947092
|
-
await (0,
|
|
947093
|
-
await (0,
|
|
947155
|
+
await (0, import_promises132.mkdir)(import_node_path40.default.dirname(dynamicSnippetFilePath), { recursive: true });
|
|
947156
|
+
await (0, import_promises132.writeFile)(dynamicSnippetFilePath, response.snippet);
|
|
947094
947157
|
} catch (error50) {
|
|
947095
947158
|
this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
|
|
947096
947159
|
}
|
|
@@ -947099,7 +947162,7 @@ var DynamicSnippetsRustTestGenerator = class {
|
|
|
947099
947162
|
}
|
|
947100
947163
|
async initializeProject(outputDir) {
|
|
947101
947164
|
const absolutePathToOutputDir = join8(outputDir, RelativeFilePath2.of("dynamic-snippets"));
|
|
947102
|
-
await (0,
|
|
947165
|
+
await (0, import_promises132.mkdir)(absolutePathToOutputDir, { recursive: true });
|
|
947103
947166
|
return absolutePathToOutputDir;
|
|
947104
947167
|
}
|
|
947105
947168
|
getTestFilePath({ absolutePathToOutputDir, idx }) {
|
|
@@ -947108,7 +947171,7 @@ var DynamicSnippetsRustTestGenerator = class {
|
|
|
947108
947171
|
};
|
|
947109
947172
|
|
|
947110
947173
|
// ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/swift/DynamicSnippetsSwiftTestGenerator.js
|
|
947111
|
-
var
|
|
947174
|
+
var import_promises133 = require("fs/promises");
|
|
947112
947175
|
var import_node_path41 = __toESM(require("path"), 1);
|
|
947113
947176
|
init_lib8();
|
|
947114
947177
|
|
|
@@ -951772,8 +951835,8 @@ var DynamicSnippetsSwiftTestGenerator = class {
|
|
|
951772
951835
|
absolutePathToOutputDir,
|
|
951773
951836
|
idx
|
|
951774
951837
|
});
|
|
951775
|
-
await (0,
|
|
951776
|
-
await (0,
|
|
951838
|
+
await (0, import_promises133.mkdir)(import_node_path41.default.dirname(dynamicSnippetFilePath), { recursive: true });
|
|
951839
|
+
await (0, import_promises133.writeFile)(dynamicSnippetFilePath, this.wrapSnippetAsLibrary(response.snippet, `Example${idx}`));
|
|
951777
951840
|
} catch (error50) {
|
|
951778
951841
|
this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
|
|
951779
951842
|
}
|
|
@@ -951782,7 +951845,7 @@ var DynamicSnippetsSwiftTestGenerator = class {
|
|
|
951782
951845
|
}
|
|
951783
951846
|
async initializeProject(outputDir) {
|
|
951784
951847
|
const absolutePathToOutputDir = join8(outputDir, RelativeFilePath2.of("Tests/Snippets"));
|
|
951785
|
-
await (0,
|
|
951848
|
+
await (0, import_promises133.mkdir)(absolutePathToOutputDir, { recursive: true });
|
|
951786
951849
|
return absolutePathToOutputDir;
|
|
951787
951850
|
}
|
|
951788
951851
|
getTestFilePath({ absolutePathToOutputDir, idx }) {
|
|
@@ -954283,7 +954346,7 @@ var DynamicSnippetsGenerator9 = class extends AbstractDynamicSnippetsGenerator {
|
|
|
954283
954346
|
};
|
|
954284
954347
|
|
|
954285
954348
|
// ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/typescript/DynamicSnippetsTypeScriptTestGenerator.js
|
|
954286
|
-
var
|
|
954349
|
+
var import_promises134 = require("fs/promises");
|
|
954287
954350
|
var import_path95 = __toESM(require("path"), 1);
|
|
954288
954351
|
var DynamicSnippetsTypeScriptTestGenerator = class {
|
|
954289
954352
|
context;
|
|
@@ -954312,8 +954375,8 @@ var DynamicSnippetsTypeScriptTestGenerator = class {
|
|
|
954312
954375
|
endpointId
|
|
954313
954376
|
});
|
|
954314
954377
|
const dynamicSnippetFilePath = this.getTestFilePath({ outputDir, idx });
|
|
954315
|
-
await (0,
|
|
954316
|
-
await (0,
|
|
954378
|
+
await (0, import_promises134.mkdir)(import_path95.default.dirname(dynamicSnippetFilePath), { recursive: true });
|
|
954379
|
+
await (0, import_promises134.writeFile)(dynamicSnippetFilePath, response.snippet);
|
|
954317
954380
|
} catch (error50) {
|
|
954318
954381
|
this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
|
|
954319
954382
|
}
|
|
@@ -954428,7 +954491,7 @@ init_lib8();
|
|
|
954428
954491
|
var import_autoversion3 = __toESM(require_autoversion(), 1);
|
|
954429
954492
|
init_lib9();
|
|
954430
954493
|
var import_serialization = __toESM(require_serialization3(), 1);
|
|
954431
|
-
var
|
|
954494
|
+
var import_promises138 = require("fs/promises");
|
|
954432
954495
|
var path102 = __toESM(require("path"), 1);
|
|
954433
954496
|
var import_path98 = require("path");
|
|
954434
954497
|
var import_tmp_promise17 = __toESM(require_tmp_promise(), 1);
|
|
@@ -954436,12 +954499,12 @@ var import_tmp_promise17 = __toESM(require_tmp_promise(), 1);
|
|
|
954436
954499
|
// ../generation/local-generation/local-workspace-runner/lib/applyTypeRelocations.js
|
|
954437
954500
|
init_lib8();
|
|
954438
954501
|
init_lib9();
|
|
954439
|
-
var
|
|
954502
|
+
var import_promises135 = require("fs/promises");
|
|
954440
954503
|
async function applyTypeRelocations({ ir: ir3, tmpOutputDirectory, context: context3 }) {
|
|
954441
954504
|
const relocationsFilepath = join8(tmpOutputDirectory, RelativeFilePath2.of(TYPE_RELOCATIONS_FILENAME));
|
|
954442
954505
|
let contents;
|
|
954443
954506
|
try {
|
|
954444
|
-
contents = await (0,
|
|
954507
|
+
contents = await (0, import_promises135.readFile)(relocationsFilepath, "utf-8");
|
|
954445
954508
|
} catch {
|
|
954446
954509
|
return;
|
|
954447
954510
|
}
|
|
@@ -954475,7 +954538,7 @@ async function applyTypeRelocations({ ir: ir3, tmpOutputDirectory, context: cont
|
|
|
954475
954538
|
} catch (error50) {
|
|
954476
954539
|
context3.logger.warn(`Failed to apply type relocations from ${relocationsFilepath}: ${error50 instanceof Error ? error50.message : String(error50)}`);
|
|
954477
954540
|
} finally {
|
|
954478
|
-
await (0,
|
|
954541
|
+
await (0, import_promises135.rm)(relocationsFilepath, { force: true });
|
|
954479
954542
|
}
|
|
954480
954543
|
}
|
|
954481
954544
|
|
|
@@ -955020,8 +955083,8 @@ var import_autoversion2 = __toESM(require_autoversion(), 1);
|
|
|
955020
955083
|
init_lib33();
|
|
955021
955084
|
init_lib6();
|
|
955022
955085
|
var import_decompress2 = __toESM(require_decompress(), 1);
|
|
955023
|
-
var
|
|
955024
|
-
var
|
|
955086
|
+
var import_promises136 = require("fs/promises");
|
|
955087
|
+
var import_os13 = require("os");
|
|
955025
955088
|
var import_path96 = require("path");
|
|
955026
955089
|
var import_semver13 = __toESM(require_semver2(), 1);
|
|
955027
955090
|
var import_tmp_promise15 = __toESM(require_tmp_promise(), 1);
|
|
@@ -955129,7 +955192,7 @@ var LocalTaskHandler = class {
|
|
|
955129
955192
|
try {
|
|
955130
955193
|
this.context.logger.info("Analyzing SDK changes for automatic semantic versioning");
|
|
955131
955194
|
diffFile = await this.generateDiffFile();
|
|
955132
|
-
const diffContent = await (0,
|
|
955195
|
+
const diffContent = await (0, import_promises136.readFile)(diffFile, "utf-8");
|
|
955133
955196
|
if (diffContent.trim().length === 0) {
|
|
955134
955197
|
this.context.logger.info("No changes detected in generated SDK");
|
|
955135
955198
|
return null;
|
|
@@ -955334,7 +955397,7 @@ var LocalTaskHandler = class {
|
|
|
955334
955397
|
} finally {
|
|
955335
955398
|
if (diffFile) {
|
|
955336
955399
|
try {
|
|
955337
|
-
await (0,
|
|
955400
|
+
await (0, import_promises136.rm)(diffFile);
|
|
955338
955401
|
} catch (cleanupError) {
|
|
955339
955402
|
this.context.logger.warn(`Failed to delete temp diff file: ${diffFile}`, String(cleanupError));
|
|
955340
955403
|
}
|
|
@@ -955515,7 +955578,7 @@ var LocalTaskHandler = class {
|
|
|
955515
955578
|
const absolutePathToFernignore = AbsoluteFilePath2.of(join8(this.absolutePathToLocalOutput, RelativeFilePath2.of(FERNIGNORE_FILENAME)));
|
|
955516
955579
|
const fernIgnorePaths = await getFernIgnorePaths({ absolutePathToFernignore });
|
|
955517
955580
|
const pathsToPreserve = await this.getPathsToPreserve(fernIgnorePaths);
|
|
955518
|
-
await (0,
|
|
955581
|
+
await (0, import_promises136.cp)(this.absolutePathToLocalOutput, tmpOutputResolutionDir, { recursive: true, verbatimSymlinks: true });
|
|
955519
955582
|
await this.runThrowawayGitCommand(["init"], tmpOutputResolutionDir);
|
|
955520
955583
|
await this.runThrowawayGitCommand(["config", "gc.auto", "0"], tmpOutputResolutionDir);
|
|
955521
955584
|
await this.runThrowawayGitCommand(["add", "."], tmpOutputResolutionDir);
|
|
@@ -955536,22 +955599,22 @@ var LocalTaskHandler = class {
|
|
|
955536
955599
|
await this.runThrowawayGitCommand(["reset", "--", ...pathsToPreserve], tmpOutputResolutionDir);
|
|
955537
955600
|
await this.runThrowawayGitCommand(["clean", "-fd", "--", ...pathsToPreserve], tmpOutputResolutionDir);
|
|
955538
955601
|
await this.runThrowawayGitCommand(["restore", "."], tmpOutputResolutionDir);
|
|
955539
|
-
await (0,
|
|
955602
|
+
await (0, import_promises136.rm)(join8(tmpOutputResolutionDir, RelativeFilePath2.of(".git")), {
|
|
955540
955603
|
recursive: true,
|
|
955541
955604
|
force: true,
|
|
955542
955605
|
maxRetries: 3,
|
|
955543
955606
|
retryDelay: 100
|
|
955544
955607
|
});
|
|
955545
|
-
await (0,
|
|
955546
|
-
await (0,
|
|
955608
|
+
await (0, import_promises136.rm)(this.absolutePathToLocalOutput, { recursive: true });
|
|
955609
|
+
await (0, import_promises136.cp)(tmpOutputResolutionDir, this.absolutePathToLocalOutput, { recursive: true, verbatimSymlinks: true });
|
|
955547
955610
|
}
|
|
955548
955611
|
async copyGeneratedFilesNoFernIgnorePreservingGit() {
|
|
955549
|
-
const contents = await (0,
|
|
955612
|
+
const contents = await (0, import_promises136.readdir)(this.absolutePathToLocalOutput);
|
|
955550
955613
|
const itemsToPreserve = [".git"];
|
|
955551
955614
|
if (await this.generatedOutputMissingReadme()) {
|
|
955552
955615
|
itemsToPreserve.push("README.md");
|
|
955553
955616
|
}
|
|
955554
|
-
await Promise.all(contents.filter((item) => !itemsToPreserve.includes(item)).map((item) => (0,
|
|
955617
|
+
await Promise.all(contents.filter((item) => !itemsToPreserve.includes(item)).map((item) => (0, import_promises136.rm)(join8(this.absolutePathToLocalOutput, RelativeFilePath2.of(item)), {
|
|
955555
955618
|
force: true,
|
|
955556
955619
|
recursive: true
|
|
955557
955620
|
})));
|
|
@@ -955559,11 +955622,11 @@ var LocalTaskHandler = class {
|
|
|
955559
955622
|
}
|
|
955560
955623
|
async copyGeneratedFilesNoFernIgnoreDeleteAll() {
|
|
955561
955624
|
this.context.logger.debug(`rm -rf ${this.absolutePathToLocalOutput}`);
|
|
955562
|
-
await (0,
|
|
955625
|
+
await (0, import_promises136.rm)(this.absolutePathToLocalOutput, { force: true, recursive: true });
|
|
955563
955626
|
await this.copyGeneratedFilesToDirectory(this.absolutePathToLocalOutput);
|
|
955564
955627
|
}
|
|
955565
955628
|
async copyGeneratedFilesToDirectory(outputPath) {
|
|
955566
|
-
const [firstLocalOutputItem, ...remaininglocalOutputItems] = await (0,
|
|
955629
|
+
const [firstLocalOutputItem, ...remaininglocalOutputItems] = await (0, import_promises136.readdir)(this.absolutePathToTmpOutputDirectory);
|
|
955567
955630
|
if (firstLocalOutputItem == null) {
|
|
955568
955631
|
return;
|
|
955569
955632
|
}
|
|
@@ -955571,10 +955634,10 @@ var LocalTaskHandler = class {
|
|
|
955571
955634
|
if (firstLocalOutputItem.endsWith(".zip")) {
|
|
955572
955635
|
await (0, import_decompress2.default)(join8(this.absolutePathToTmpOutputDirectory, RelativeFilePath2.of(firstLocalOutputItem)), outputPath);
|
|
955573
955636
|
for (const localOutputItem of remaininglocalOutputItems) {
|
|
955574
|
-
await (0,
|
|
955637
|
+
await (0, import_promises136.cp)(join8(this.absolutePathToTmpOutputDirectory, RelativeFilePath2.of(localOutputItem)), join8(outputPath, RelativeFilePath2.of(localOutputItem)), { recursive: true, verbatimSymlinks: true });
|
|
955575
955638
|
}
|
|
955576
955639
|
} else {
|
|
955577
|
-
await (0,
|
|
955640
|
+
await (0, import_promises136.cp)(this.absolutePathToTmpOutputDirectory, outputPath, { recursive: true, verbatimSymlinks: true });
|
|
955578
955641
|
}
|
|
955579
955642
|
}
|
|
955580
955643
|
async copySnippetJSON({ absolutePathToTmpSnippetJSON, absolutePathToLocalSnippetJSON }) {
|
|
@@ -955595,7 +955658,7 @@ var LocalTaskHandler = class {
|
|
|
955595
955658
|
*/
|
|
955596
955659
|
async generatedOutputMissingReadme() {
|
|
955597
955660
|
try {
|
|
955598
|
-
const contents = await (0,
|
|
955661
|
+
const contents = await (0, import_promises136.readdir)(this.absolutePathToTmpOutputDirectory);
|
|
955599
955662
|
if (contents.length === 1 && contents[0] != null && contents[0].endsWith(".zip")) {
|
|
955600
955663
|
return false;
|
|
955601
955664
|
}
|
|
@@ -955645,13 +955708,13 @@ var LocalTaskHandler = class {
|
|
|
955645
955708
|
async readPriorChangelog(maxEntries) {
|
|
955646
955709
|
const MAX_CHANGELOG_SIZE = 2048;
|
|
955647
955710
|
try {
|
|
955648
|
-
const files = await (0,
|
|
955711
|
+
const files = await (0, import_promises136.readdir)(this.absolutePathToLocalOutput);
|
|
955649
955712
|
const changelogFile = files.find((f3) => f3.toLowerCase() === "changelog.md");
|
|
955650
955713
|
if (!changelogFile) {
|
|
955651
955714
|
return "";
|
|
955652
955715
|
}
|
|
955653
955716
|
const changelogPath = join8(this.absolutePathToLocalOutput, RelativeFilePath2.of(changelogFile));
|
|
955654
|
-
const content5 = await (0,
|
|
955717
|
+
const content5 = await (0, import_promises136.readFile)(changelogPath, "utf-8");
|
|
955655
955718
|
if (content5.trim().length === 0) {
|
|
955656
955719
|
return "";
|
|
955657
955720
|
}
|
|
@@ -955719,7 +955782,7 @@ var LocalTaskHandler = class {
|
|
|
955719
955782
|
* when the copy path does not stage files (copyGeneratedFilesNoFernIgnorePreservingGit).
|
|
955720
955783
|
*/
|
|
955721
955784
|
async generateDiffFile() {
|
|
955722
|
-
const diffFile = (0, import_path96.join)((0,
|
|
955785
|
+
const diffFile = (0, import_path96.join)((0, import_os13.tmpdir)(), `git-diff-${Date.now()}.patch`);
|
|
955723
955786
|
await this.runGitCommand(["add", "-N", "."], this.absolutePathToLocalOutput);
|
|
955724
955787
|
await this.runGitCommand(["diff", "HEAD", "--output", diffFile, "--", ".", ":(exclude).fern/metadata.json"], this.absolutePathToLocalOutput);
|
|
955725
955788
|
this.context.logger.info(`Generated git diff to file: ${diffFile}`);
|
|
@@ -955727,11 +955790,11 @@ var LocalTaskHandler = class {
|
|
|
955727
955790
|
}
|
|
955728
955791
|
};
|
|
955729
955792
|
async function copySnippetJsonIfNonEmpty({ src, dest }) {
|
|
955730
|
-
const tmpStat = await (0,
|
|
955793
|
+
const tmpStat = await (0, import_promises136.stat)(src);
|
|
955731
955794
|
if (tmpStat.size === 0) {
|
|
955732
955795
|
return "skipped-empty";
|
|
955733
955796
|
}
|
|
955734
|
-
await (0,
|
|
955797
|
+
await (0, import_promises136.cp)(src, dest);
|
|
955735
955798
|
return "copied";
|
|
955736
955799
|
}
|
|
955737
955800
|
|
|
@@ -955739,7 +955802,7 @@ async function copySnippetJsonIfNonEmpty({ src, dest }) {
|
|
|
955739
955802
|
init_lib4();
|
|
955740
955803
|
init_lib8();
|
|
955741
955804
|
init_lib35();
|
|
955742
|
-
var
|
|
955805
|
+
var import_promises137 = require("fs/promises");
|
|
955743
955806
|
init_js_yaml();
|
|
955744
955807
|
var import_path97 = __toESM(require("path"), 1);
|
|
955745
955808
|
init_index_min2();
|
|
@@ -955808,7 +955871,7 @@ async function resolveOpenAPIOrAsyncAPI({ spec, hostOutputDir, containerBaseDir,
|
|
|
955808
955871
|
});
|
|
955809
955872
|
}
|
|
955810
955873
|
resolved = filterSpec(resolved, audiences);
|
|
955811
|
-
await (0,
|
|
955874
|
+
await (0, import_promises137.writeFile)(import_path97.default.join(hostOutputDir, filename), JSON.stringify(resolved));
|
|
955812
955875
|
context3.logger.debug(`Resolved ${isAsync2 ? "AsyncAPI" : "OpenAPI"} spec ${spec.absoluteFilepath} -> ${filename}`);
|
|
955813
955876
|
return {
|
|
955814
955877
|
type: isAsync2 ? "asyncapi" : "openapi",
|
|
@@ -955818,7 +955881,7 @@ async function resolveOpenAPIOrAsyncAPI({ spec, hostOutputDir, containerBaseDir,
|
|
|
955818
955881
|
}
|
|
955819
955882
|
async function resolveOpenRPC({ spec, hostOutputDir, containerBaseDir, context: context3, index: index3 }) {
|
|
955820
955883
|
const filename = `openrpc${index3}.json`;
|
|
955821
|
-
const rawContent = await (0,
|
|
955884
|
+
const rawContent = await (0, import_promises137.readFile)(spec.absoluteFilepath, "utf-8");
|
|
955822
955885
|
let parsed;
|
|
955823
955886
|
try {
|
|
955824
955887
|
parsed = JSON.parse(rawContent);
|
|
@@ -955828,7 +955891,7 @@ async function resolveOpenRPC({ spec, hostOutputDir, containerBaseDir, context:
|
|
|
955828
955891
|
let result = parsed;
|
|
955829
955892
|
const overrides = normalizeOverrides(spec.absoluteFilepathToOverrides);
|
|
955830
955893
|
for (const overridePath of overrides) {
|
|
955831
|
-
const overrideContent = await (0,
|
|
955894
|
+
const overrideContent = await (0, import_promises137.readFile)(overridePath, "utf-8");
|
|
955832
955895
|
let overrideParsed;
|
|
955833
955896
|
try {
|
|
955834
955897
|
overrideParsed = JSON.parse(overrideContent);
|
|
@@ -955840,7 +955903,7 @@ async function resolveOpenRPC({ spec, hostOutputDir, containerBaseDir, context:
|
|
|
955840
955903
|
overrides: overrideParsed
|
|
955841
955904
|
});
|
|
955842
955905
|
}
|
|
955843
|
-
await (0,
|
|
955906
|
+
await (0, import_promises137.writeFile)(import_path97.default.join(hostOutputDir, filename), JSON.stringify(result));
|
|
955844
955907
|
context3.logger.debug(`Resolved OpenRPC spec ${spec.absoluteFilepath} -> ${filename}`);
|
|
955845
955908
|
return {
|
|
955846
955909
|
type: "openrpc",
|
|
@@ -955851,7 +955914,7 @@ async function resolveOpenRPC({ spec, hostOutputDir, containerBaseDir, context:
|
|
|
955851
955914
|
async function copyProtobuf({ spec, hostOutputDir, containerBaseDir, index: index3 }) {
|
|
955852
955915
|
const dirName = `protobuf${index3}`;
|
|
955853
955916
|
const destDir = import_path97.default.join(hostOutputDir, dirName);
|
|
955854
|
-
await (0,
|
|
955917
|
+
await (0, import_promises137.cp)(spec.absoluteFilepathToProtobufRoot, destDir, { recursive: true });
|
|
955855
955918
|
const entry = {
|
|
955856
955919
|
type: "protobuf",
|
|
955857
955920
|
specPath: toContainerPath(dirName, containerBaseDir)
|
|
@@ -955861,7 +955924,7 @@ async function copyProtobuf({ spec, hostOutputDir, containerBaseDir, index: inde
|
|
|
955861
955924
|
entry.overridePaths = [];
|
|
955862
955925
|
for (const [i5, override] of overrides.entries()) {
|
|
955863
955926
|
const overrideName = `protobuf${index3}-override-${i5}${import_path97.default.extname(override)}`;
|
|
955864
|
-
await (0,
|
|
955927
|
+
await (0, import_promises137.copyFile)(override, import_path97.default.join(hostOutputDir, overrideName));
|
|
955865
955928
|
entry.overridePaths.push(toContainerPath(overrideName, containerBaseDir));
|
|
955866
955929
|
}
|
|
955867
955930
|
}
|
|
@@ -955870,7 +955933,7 @@ async function copyProtobuf({ spec, hostOutputDir, containerBaseDir, index: inde
|
|
|
955870
955933
|
async function copyGraphQL({ spec, hostOutputDir, containerBaseDir, index: index3 }) {
|
|
955871
955934
|
const ext2 = import_path97.default.extname(spec.absoluteFilepath) || ".graphql";
|
|
955872
955935
|
const filename = `graphql${index3}${ext2}`;
|
|
955873
|
-
await (0,
|
|
955936
|
+
await (0, import_promises137.copyFile)(spec.absoluteFilepath, import_path97.default.join(hostOutputDir, filename));
|
|
955874
955937
|
const entry = {
|
|
955875
955938
|
type: "graphql",
|
|
955876
955939
|
specPath: toContainerPath(filename, containerBaseDir),
|
|
@@ -955881,7 +955944,7 @@ async function copyGraphQL({ spec, hostOutputDir, containerBaseDir, index: index
|
|
|
955881
955944
|
entry.overridePaths = [];
|
|
955882
955945
|
for (const [i5, override] of overrides.entries()) {
|
|
955883
955946
|
const overrideName = `graphql${index3}-override-${i5}${import_path97.default.extname(override)}`;
|
|
955884
|
-
await (0,
|
|
955947
|
+
await (0, import_promises137.copyFile)(override, import_path97.default.join(hostOutputDir, overrideName));
|
|
955885
955948
|
entry.overridePaths.push(toContainerPath(overrideName, containerBaseDir));
|
|
955886
955949
|
}
|
|
955887
955950
|
}
|
|
@@ -955889,7 +955952,7 @@ async function copyGraphQL({ spec, hostOutputDir, containerBaseDir, index: index
|
|
|
955889
955952
|
}
|
|
955890
955953
|
async function isAsyncAPISpec(filepath) {
|
|
955891
955954
|
try {
|
|
955892
|
-
const content5 = await (0,
|
|
955955
|
+
const content5 = await (0, import_promises137.readFile)(filepath, "utf-8");
|
|
955893
955956
|
return content5.includes("asyncapi");
|
|
955894
955957
|
} catch {
|
|
955895
955958
|
return false;
|
|
@@ -955999,7 +956062,7 @@ async function createSpecsTarGzBuffer({ specs, context: context3, audiences }) {
|
|
|
955999
956062
|
context: context3,
|
|
956000
956063
|
audiences
|
|
956001
956064
|
});
|
|
956002
|
-
await (0,
|
|
956065
|
+
await (0, import_promises137.writeFile)(join8(AbsoluteFilePath2.of(tmpDir.path), RelativeFilePath2.of(SPECS_MANIFEST_FILENAME)), JSON.stringify(manifest, void 0, 4));
|
|
956003
956066
|
const tarGzPath = join8(AbsoluteFilePath2.of(tmpDir.path), RelativeFilePath2.of("specs.tar.gz"));
|
|
956004
956067
|
await Kn({
|
|
956005
956068
|
gzip: true,
|
|
@@ -956008,7 +956071,7 @@ async function createSpecsTarGzBuffer({ specs, context: context3, audiences }) {
|
|
|
956008
956071
|
portable: true,
|
|
956009
956072
|
filter: (entryPath) => entryPath !== "./specs.tar.gz"
|
|
956010
956073
|
}, ["."]);
|
|
956011
|
-
return await (0,
|
|
956074
|
+
return await (0, import_promises137.readFile)(tarGzPath);
|
|
956012
956075
|
} finally {
|
|
956013
956076
|
await tmpDir.cleanup();
|
|
956014
956077
|
}
|
|
@@ -956050,24 +956113,24 @@ async function writeFilesToDiskAndRunGenerator({ organization, absolutePathToFer
|
|
|
956050
956113
|
context3.logger.debug("Wrote IR to: " + absolutePathToIr);
|
|
956051
956114
|
const configJsonFile = (0, import_path98.join)(workspaceTempDir.path, GENERATOR_CONFIG_FILENAME);
|
|
956052
956115
|
const absolutePathToWriteConfigJson = AbsoluteFilePath2.of(configJsonFile);
|
|
956053
|
-
await (0,
|
|
956116
|
+
await (0, import_promises138.writeFile)(configJsonFile, "");
|
|
956054
956117
|
context3.logger.debug("Will write config.json to: " + absolutePathToWriteConfigJson);
|
|
956055
956118
|
const tmpOutputDirectory = (0, import_path98.join)(workspaceTempDir.path, CODEGEN_OUTPUT_DIRECTORY_NAME);
|
|
956056
956119
|
const absolutePathToTmpOutputDirectory = AbsoluteFilePath2.of(tmpOutputDirectory);
|
|
956057
|
-
await (0,
|
|
956120
|
+
await (0, import_promises138.mkdir)(tmpOutputDirectory, { recursive: true });
|
|
956058
956121
|
context3.logger.debug("Will write output to: " + absolutePathToTmpOutputDirectory);
|
|
956059
956122
|
let absolutePathToTmpSnippetJSON = void 0;
|
|
956060
956123
|
if (absolutePathToLocalSnippetJSON != null) {
|
|
956061
956124
|
const snippetJsonFile = (0, import_path98.join)(workspaceTempDir.path, "snippet.json");
|
|
956062
956125
|
absolutePathToTmpSnippetJSON = AbsoluteFilePath2.of(snippetJsonFile);
|
|
956063
|
-
await (0,
|
|
956126
|
+
await (0, import_promises138.writeFile)(snippetJsonFile, "");
|
|
956064
956127
|
context3.logger.debug("Will write snippet.json to: " + absolutePathToTmpSnippetJSON);
|
|
956065
956128
|
}
|
|
956066
956129
|
let absolutePathToTmpSnippetTemplatesJSON = void 0;
|
|
956067
956130
|
if (absolutePathToLocalSnippetTemplateJSON != null) {
|
|
956068
956131
|
const snippetTemplatesJsonFile = (0, import_path98.join)(workspaceTempDir.path, SNIPPET_TEMPLATES_JSON_FILENAME);
|
|
956069
956132
|
absolutePathToTmpSnippetTemplatesJSON = AbsoluteFilePath2.of(snippetTemplatesJsonFile);
|
|
956070
|
-
await (0,
|
|
956133
|
+
await (0, import_promises138.writeFile)(snippetTemplatesJsonFile, "");
|
|
956071
956134
|
context3.logger.debug("Will write snippet-templates.json to: " + absolutePathToTmpSnippetTemplatesJSON);
|
|
956072
956135
|
}
|
|
956073
956136
|
const environment2 = executionEnvironment ?? new ContainerExecutionEnvironment({
|
|
@@ -956108,7 +956171,7 @@ async function writeFilesToDiskAndRunGenerator({ organization, absolutePathToFer
|
|
|
956108
956171
|
publishToRegistry,
|
|
956109
956172
|
paths
|
|
956110
956173
|
});
|
|
956111
|
-
await (0,
|
|
956174
|
+
await (0, import_promises138.writeFile)(absolutePathToWriteConfigJson, JSON.stringify(await import_serialization.GeneratorConfig.jsonOrThrow(config5), void 0, 4));
|
|
956112
956175
|
const absolutePathToLicenseFile = extractLicenseFilePath(generatorInvocation, absolutePathToFernConfig);
|
|
956113
956176
|
const sourceMounts = workspace.getSources().filter((source2) => source2.type === "protobuf").map((source2) => ({
|
|
956114
956177
|
hostPath: source2.absoluteFilePath,
|
|
@@ -956116,7 +956179,7 @@ async function writeFilesToDiskAndRunGenerator({ organization, absolutePathToFer
|
|
|
956116
956179
|
}));
|
|
956117
956180
|
if (rawApiSpecs != null && rawApiSpecs.length > 0) {
|
|
956118
956181
|
const rawSpecsDir = (0, import_path98.join)(workspaceTempDir.path, SPECS_DIRECTORY_NAME);
|
|
956119
|
-
await (0,
|
|
956182
|
+
await (0, import_promises138.mkdir)(rawSpecsDir, { recursive: true });
|
|
956120
956183
|
const containerSpecsDir = environment2.usesContainerPaths ? CONTAINER_SPECS_DIRECTORY : rawSpecsDir;
|
|
956121
956184
|
const manifest = await collectRawSpecs({
|
|
956122
956185
|
specs: rawApiSpecs,
|
|
@@ -956125,7 +956188,7 @@ async function writeFilesToDiskAndRunGenerator({ organization, absolutePathToFer
|
|
|
956125
956188
|
context: context3,
|
|
956126
956189
|
audiences
|
|
956127
956190
|
});
|
|
956128
|
-
await (0,
|
|
956191
|
+
await (0, import_promises138.writeFile)((0, import_path98.join)(rawSpecsDir, SPECS_MANIFEST_FILENAME), JSON.stringify(manifest, void 0, 4));
|
|
956129
956192
|
context3.logger.debug(`Wrote raw specs manifest with ${manifest.specs.length} spec(s) to ${rawSpecsDir}`);
|
|
956130
956193
|
sourceMounts.push({
|
|
956131
956194
|
hostPath: AbsoluteFilePath2.of(rawSpecsDir),
|
|
@@ -956221,7 +956284,7 @@ init_lib35();
|
|
|
956221
956284
|
init_lib6();
|
|
956222
956285
|
init_source();
|
|
956223
956286
|
var fs30 = __toESM(require("fs/promises"), 1);
|
|
956224
|
-
var
|
|
956287
|
+
var import_os14 = __toESM(require("os"), 1);
|
|
956225
956288
|
var import_path99 = __toESM(require("path"), 1);
|
|
956226
956289
|
var import_tmp_promise18 = __toESM(require_tmp_promise(), 1);
|
|
956227
956290
|
|
|
@@ -956568,7 +956631,7 @@ async function getWorkspaceTempDir() {
|
|
|
956568
956631
|
return import_tmp_promise18.default.dir({
|
|
956569
956632
|
// use the /private prefix on osx so that docker can access the tmpdir
|
|
956570
956633
|
// see https://stackoverflow.com/a/45123074
|
|
956571
|
-
tmpdir:
|
|
956634
|
+
tmpdir: import_os14.default.platform() === "darwin" ? import_path99.default.join("/private", import_os14.default.tmpdir()) : void 0,
|
|
956572
956635
|
prefix: "fern"
|
|
956573
956636
|
});
|
|
956574
956637
|
}
|
|
@@ -956895,7 +956958,7 @@ async function runVerifyPipeline({ outputDir, generatorName, generatorVersion, c
|
|
|
956895
956958
|
// ../cli-v2/lib/sdk/generator/LegacyLocalGenerationRunner.js
|
|
956896
956959
|
init_lib5();
|
|
956897
956960
|
init_lib6();
|
|
956898
|
-
var
|
|
956961
|
+
var import_promises140 = require("fs/promises");
|
|
956899
956962
|
|
|
956900
956963
|
// ../cli-v2/lib/sdk/adapter/LegacyGeneratorInvocationAdapter.js
|
|
956901
956964
|
init_lib12();
|
|
@@ -956905,7 +956968,7 @@ init_lib8();
|
|
|
956905
956968
|
init_lib11();
|
|
956906
956969
|
init_lib6();
|
|
956907
956970
|
init_esm19();
|
|
956908
|
-
var
|
|
956971
|
+
var import_promises139 = require("fs/promises");
|
|
956909
956972
|
var LegacyGeneratorInvocationAdapter = class {
|
|
956910
956973
|
context;
|
|
956911
956974
|
constructor(config5) {
|
|
@@ -957159,7 +957222,7 @@ var LegacyGeneratorInvocationAdapter = class {
|
|
|
957159
957222
|
code: CliError.Code.InternalError
|
|
957160
957223
|
});
|
|
957161
957224
|
}
|
|
957162
|
-
const contents = await (0,
|
|
957225
|
+
const contents = await (0, import_promises139.readFile)(absolutePath, "utf-8");
|
|
957163
957226
|
return api_exports4.GithubLicense.custom({ contents });
|
|
957164
957227
|
}
|
|
957165
957228
|
buildReadme(target) {
|
|
@@ -957385,7 +957448,7 @@ var LegacyLocalGenerationRunner = class {
|
|
|
957385
957448
|
});
|
|
957386
957449
|
if (args.target.output.path != null && generatorInvocation.absolutePathToLocalOutput != null) {
|
|
957387
957450
|
const snippetPath = join8(generatorInvocation.absolutePathToLocalOutput, RelativeFilePath2.of(SNIPPET_JSON_FILENAME));
|
|
957388
|
-
await (0,
|
|
957451
|
+
await (0, import_promises140.rm)(snippetPath, { force: true });
|
|
957389
957452
|
}
|
|
957390
957453
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
957391
957454
|
return {
|
|
@@ -957404,8 +957467,8 @@ init_lib4();
|
|
|
957404
957467
|
init_lib8();
|
|
957405
957468
|
init_lib5();
|
|
957406
957469
|
init_lib6();
|
|
957407
|
-
var
|
|
957408
|
-
var
|
|
957470
|
+
var import_promises141 = require("fs/promises");
|
|
957471
|
+
var import_os15 = require("os");
|
|
957409
957472
|
var LegacyRemoteGenerationRunner = class {
|
|
957410
957473
|
context;
|
|
957411
957474
|
cliVersion;
|
|
@@ -957463,13 +957526,13 @@ var LegacyRemoteGenerationRunner = class {
|
|
|
957463
957526
|
const previewOutputDirectory = join8(absolutePathToPreview, RelativeFilePath2.of(generatorName));
|
|
957464
957527
|
const targetOutputDirectory = generatorInvocation.absolutePathToLocalOutput;
|
|
957465
957528
|
if (targetOutputDirectory != null) {
|
|
957466
|
-
await (0,
|
|
957467
|
-
await (0,
|
|
957529
|
+
await (0, import_promises141.cp)(previewOutputDirectory, targetOutputDirectory, { recursive: true });
|
|
957530
|
+
await (0, import_promises141.rm)(join8(targetOutputDirectory, RelativeFilePath2.of(".git")), {
|
|
957468
957531
|
recursive: true,
|
|
957469
957532
|
force: true
|
|
957470
957533
|
});
|
|
957471
957534
|
}
|
|
957472
|
-
await (0,
|
|
957535
|
+
await (0, import_promises141.rm)(absolutePathToPreview, { recursive: true, force: true });
|
|
957473
957536
|
}
|
|
957474
957537
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
957475
957538
|
return {
|
|
@@ -957498,7 +957561,7 @@ var LegacyRemoteGenerationRunner = class {
|
|
|
957498
957561
|
}
|
|
957499
957562
|
async getAbsolutePathToPreview(args) {
|
|
957500
957563
|
if (this.isLocalGitCombo(args)) {
|
|
957501
|
-
const tmpPreviewDirectory = await (0,
|
|
957564
|
+
const tmpPreviewDirectory = await (0, import_promises141.mkdtemp)(join8(AbsoluteFilePath2.of((0, import_os15.tmpdir)()), RelativeFilePath2.of("fern-preview-")));
|
|
957502
957565
|
return AbsoluteFilePath2.of(tmpPreviewDirectory);
|
|
957503
957566
|
}
|
|
957504
957567
|
if (!args.preview) {
|
|
@@ -958234,7 +958297,7 @@ Example:
|
|
|
958234
958297
|
if (!exists2) {
|
|
958235
958298
|
return { shouldProceed: true };
|
|
958236
958299
|
}
|
|
958237
|
-
const files = await (0,
|
|
958300
|
+
const files = await (0, import_promises142.readdir)(outputPath);
|
|
958238
958301
|
if (files.length === 0) {
|
|
958239
958302
|
return { shouldProceed: true };
|
|
958240
958303
|
}
|
|
@@ -958646,7 +958709,7 @@ init_lib4();
|
|
|
958646
958709
|
init_lib33();
|
|
958647
958710
|
init_lib6();
|
|
958648
958711
|
var import_fs38 = require("fs");
|
|
958649
|
-
var
|
|
958712
|
+
var import_promises143 = require("fs/promises");
|
|
958650
958713
|
var import_path101 = require("path");
|
|
958651
958714
|
var import_semver14 = __toESM(require_semver2(), 1);
|
|
958652
958715
|
var import_url8 = require("url");
|
|
@@ -958756,7 +958819,7 @@ var GeneratorMigrator = class _GeneratorMigrator {
|
|
|
958756
958819
|
}
|
|
958757
958820
|
this.migrationsInstallPromise = (async () => {
|
|
958758
958821
|
const cacheDir = this.cachePath;
|
|
958759
|
-
await (0,
|
|
958822
|
+
await (0, import_promises143.mkdir)(cacheDir, { recursive: true });
|
|
958760
958823
|
const npmCacheDir = (0, import_path101.join)(cacheDir, ".npm-cache");
|
|
958761
958824
|
const packageDir = (0, import_path101.join)(cacheDir, "node_modules", MIGRATION_PACKAGE_NAME);
|
|
958762
958825
|
const packageJsonPath = (0, import_path101.join)(packageDir, "package.json");
|
|
@@ -958773,7 +958836,7 @@ var GeneratorMigrator = class _GeneratorMigrator {
|
|
|
958773
958836
|
"--no-audit",
|
|
958774
958837
|
"--no-fund"
|
|
958775
958838
|
], { doNotPipeOutput: true });
|
|
958776
|
-
const packageJsonContent = await (0,
|
|
958839
|
+
const packageJsonContent = await (0, import_promises143.readFile)(packageJsonPath, "utf-8");
|
|
958777
958840
|
const packageJson2 = JSON.parse(packageJsonContent);
|
|
958778
958841
|
if (packageJson2.main == null) {
|
|
958779
958842
|
throw new CliError({
|
|
@@ -958818,7 +958881,7 @@ var GeneratorMigrator = class _GeneratorMigrator {
|
|
|
958818
958881
|
const myPid = String(process.pid);
|
|
958819
958882
|
while (true) {
|
|
958820
958883
|
try {
|
|
958821
|
-
const fh = await (0,
|
|
958884
|
+
const fh = await (0, import_promises143.open)(lockPath, "wx");
|
|
958822
958885
|
await fh.writeFile(myPid);
|
|
958823
958886
|
await fh.close();
|
|
958824
958887
|
const exitHandler = () => {
|
|
@@ -958835,9 +958898,9 @@ var GeneratorMigrator = class _GeneratorMigrator {
|
|
|
958835
958898
|
return async () => {
|
|
958836
958899
|
process.removeListener("exit", exitHandler);
|
|
958837
958900
|
try {
|
|
958838
|
-
const currentContent = await (0,
|
|
958901
|
+
const currentContent = await (0, import_promises143.readFile)(lockPath, "utf-8");
|
|
958839
958902
|
if (currentContent.trim() === myPid) {
|
|
958840
|
-
await (0,
|
|
958903
|
+
await (0, import_promises143.unlink)(lockPath);
|
|
958841
958904
|
} else {
|
|
958842
958905
|
logger4.debug(`Lock file owned by another process (expected pid=${myPid}, found=${currentContent.trim()}); skipping release`);
|
|
958843
958906
|
}
|
|
@@ -958851,14 +958914,14 @@ var GeneratorMigrator = class _GeneratorMigrator {
|
|
|
958851
958914
|
throw err;
|
|
958852
958915
|
}
|
|
958853
958916
|
try {
|
|
958854
|
-
const lockContent = await (0,
|
|
958917
|
+
const lockContent = await (0, import_promises143.readFile)(lockPath, "utf-8");
|
|
958855
958918
|
const lockPid = Number(lockContent.trim());
|
|
958856
|
-
const lockStat = await (0,
|
|
958919
|
+
const lockStat = await (0, import_promises143.stat)(lockPath);
|
|
958857
958920
|
const lockAge = Date.now() - lockStat.mtimeMs;
|
|
958858
958921
|
if (lockAge > _GeneratorMigrator.LOCK_STALE_MS || Number.isFinite(lockPid) && lockPid > 0 && !_GeneratorMigrator.isProcessAlive(lockPid)) {
|
|
958859
958922
|
logger4.debug(`Removing stale migration lock (pid=${lockContent.trim()}, age=${lockAge}ms)`);
|
|
958860
958923
|
try {
|
|
958861
|
-
await (0,
|
|
958924
|
+
await (0, import_promises143.unlink)(lockPath);
|
|
958862
958925
|
} catch (unlinkErr) {
|
|
958863
958926
|
logger4.debug(`Failed to remove stale lock: ${unlinkErr}`);
|
|
958864
958927
|
}
|
|
@@ -959547,7 +959610,7 @@ var import_generator_cli5 = __toESM(require_api3(), 1);
|
|
|
959547
959610
|
init_lib19();
|
|
959548
959611
|
init_lib8();
|
|
959549
959612
|
init_source();
|
|
959550
|
-
var
|
|
959613
|
+
var import_promises148 = require("fs/promises");
|
|
959551
959614
|
var import_fs_extra = __toESM(require_lib18(), 1);
|
|
959552
959615
|
var import_path104 = __toESM(require("path"), 1);
|
|
959553
959616
|
|
|
@@ -959557,7 +959620,7 @@ init_lib26();
|
|
|
959557
959620
|
init_lib8();
|
|
959558
959621
|
init_lib6();
|
|
959559
959622
|
init_source();
|
|
959560
|
-
var
|
|
959623
|
+
var import_promises145 = require("fs/promises");
|
|
959561
959624
|
init_lodash();
|
|
959562
959625
|
var GITIGNORE_CONTENT = "**/.preview\n**/.definition\n";
|
|
959563
959626
|
async function createFernDirectoryAndWorkspace({ organization, taskContext, versionOfCli }) {
|
|
@@ -959589,7 +959652,7 @@ async function createFernDirectoryAndWorkspace({ organization, taskContext, vers
|
|
|
959589
959652
|
}
|
|
959590
959653
|
}
|
|
959591
959654
|
}
|
|
959592
|
-
await (0,
|
|
959655
|
+
await (0, import_promises145.mkdir)(FERN_DIRECTORY);
|
|
959593
959656
|
await writeProjectConfig({
|
|
959594
959657
|
filepath: join8(pathToFernDirectory, RelativeFilePath2.of(PROJECT_CONFIG_FILENAME)),
|
|
959595
959658
|
organization,
|
|
@@ -959613,11 +959676,11 @@ async function writeProjectConfig({ organization, filepath, versionOfCli }) {
|
|
|
959613
959676
|
organization,
|
|
959614
959677
|
version: versionOfCli
|
|
959615
959678
|
};
|
|
959616
|
-
await (0,
|
|
959679
|
+
await (0, import_promises145.writeFile)(filepath, JSON.stringify(projectConfig, void 0, 4));
|
|
959617
959680
|
}
|
|
959618
959681
|
async function writeGitignore({ absolutePathToFernDirectory }) {
|
|
959619
959682
|
const gitignorePath = join8(absolutePathToFernDirectory, RelativeFilePath2.of(".gitignore"));
|
|
959620
|
-
await (0,
|
|
959683
|
+
await (0, import_promises145.writeFile)(gitignorePath, GITIGNORE_CONTENT);
|
|
959621
959684
|
}
|
|
959622
959685
|
|
|
959623
959686
|
// ../init/lib/createWorkspace.js
|
|
@@ -959811,7 +959874,7 @@ async function formatDefinitionFile({ fileContents }) {
|
|
|
959811
959874
|
init_lib4();
|
|
959812
959875
|
init_lib6();
|
|
959813
959876
|
init_source();
|
|
959814
|
-
var
|
|
959877
|
+
var import_promises146 = require("fs/promises");
|
|
959815
959878
|
async function formatFernWorkspace({ workspace, context: context3, shouldFix }) {
|
|
959816
959879
|
for (const [relativeFilepath, file4] of entries(workspace.definition.namedDefinitionFiles)) {
|
|
959817
959880
|
const formatted = await formatDefinitionFile({
|
|
@@ -959819,7 +959882,7 @@ async function formatFernWorkspace({ workspace, context: context3, shouldFix })
|
|
|
959819
959882
|
});
|
|
959820
959883
|
if (formatted !== file4.rawContents) {
|
|
959821
959884
|
if (shouldFix) {
|
|
959822
|
-
await (0,
|
|
959885
|
+
await (0, import_promises146.writeFile)(file4.absoluteFilePath, formatted);
|
|
959823
959886
|
context3.logger.info(source_default.green(`Formatted ${source_default.bold(relativeFilepath)}`));
|
|
959824
959887
|
} else {
|
|
959825
959888
|
context3.logger.info(source_default.red(`Invalid formatting: ${source_default.bold(relativeFilepath)}`));
|
|
@@ -959832,7 +959895,7 @@ async function formatFernWorkspace({ workspace, context: context3, shouldFix })
|
|
|
959832
959895
|
// ../init/lib/createWorkspace.js
|
|
959833
959896
|
init_lib8();
|
|
959834
959897
|
init_lib6();
|
|
959835
|
-
var
|
|
959898
|
+
var import_promises147 = require("fs/promises");
|
|
959836
959899
|
init_js_yaml();
|
|
959837
959900
|
|
|
959838
959901
|
// ../init/lib/sampleImdbApi.js
|
|
@@ -960033,7 +960096,7 @@ components:
|
|
|
960033
960096
|
// ../init/lib/createWorkspace.js
|
|
960034
960097
|
async function createFernWorkspace({ directoryOfWorkspace, cliVersion, context: context3, apiName = "api" }) {
|
|
960035
960098
|
if (!await doesPathExist(directoryOfWorkspace)) {
|
|
960036
|
-
await (0,
|
|
960099
|
+
await (0, import_promises147.mkdir)(directoryOfWorkspace);
|
|
960037
960100
|
}
|
|
960038
960101
|
await writeGeneratorsConfiguration({
|
|
960039
960102
|
filepath: join8(directoryOfWorkspace, RelativeFilePath2.of(GENERATORS_CONFIGURATION_FILENAME)),
|
|
@@ -960048,7 +960111,7 @@ async function createFernWorkspace({ directoryOfWorkspace, cliVersion, context:
|
|
|
960048
960111
|
}
|
|
960049
960112
|
async function createOpenAPIWorkspace({ directoryOfWorkspace, openAPIFilePath, cliVersion, context: context3 }) {
|
|
960050
960113
|
if (!await doesPathExist(directoryOfWorkspace)) {
|
|
960051
|
-
await (0,
|
|
960114
|
+
await (0, import_promises147.mkdir)(directoryOfWorkspace);
|
|
960052
960115
|
}
|
|
960053
960116
|
await writeGeneratorsConfiguration({
|
|
960054
960117
|
filepath: join8(directoryOfWorkspace, RelativeFilePath2.of(GENERATORS_CONFIGURATION_FILENAME)),
|
|
@@ -960061,10 +960124,10 @@ async function createOpenAPIWorkspace({ directoryOfWorkspace, openAPIFilePath, c
|
|
|
960061
960124
|
}
|
|
960062
960125
|
async function createDefaultOpenAPIWorkspace({ directoryOfWorkspace, cliVersion, context: context3 }) {
|
|
960063
960126
|
if (!await doesPathExist(directoryOfWorkspace)) {
|
|
960064
|
-
await (0,
|
|
960127
|
+
await (0, import_promises147.mkdir)(directoryOfWorkspace, { recursive: true });
|
|
960065
960128
|
}
|
|
960066
960129
|
const openApiFilePath = join8(directoryOfWorkspace, RelativeFilePath2.of("openapi.yml"));
|
|
960067
|
-
await (0,
|
|
960130
|
+
await (0, import_promises147.writeFile)(openApiFilePath, SAMPLE_OPENAPI);
|
|
960068
960131
|
await writeGeneratorsConfiguration({
|
|
960069
960132
|
filepath: join8(directoryOfWorkspace, RelativeFilePath2.of(GENERATORS_CONFIGURATION_FILENAME)),
|
|
960070
960133
|
cliVersion,
|
|
@@ -960109,7 +960172,7 @@ async function getDefaultGeneratorsConfiguration({ cliVersion, context: context3
|
|
|
960109
960172
|
return config5;
|
|
960110
960173
|
}
|
|
960111
960174
|
async function writeGeneratorsConfiguration({ filepath, cliVersion, context: context3, apiConfiguration }) {
|
|
960112
|
-
await (0,
|
|
960175
|
+
await (0, import_promises147.writeFile)(filepath, "# yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json\n" + index_vite_proxy_tmp_default.dump(await getDefaultGeneratorsConfiguration({ cliVersion, context: context3, apiConfiguration }), {
|
|
960113
960176
|
sortKeys: (a3, b5) => {
|
|
960114
960177
|
if (a3 === "api") {
|
|
960115
960178
|
return -1;
|
|
@@ -960128,8 +960191,8 @@ async function writeSampleApiDefinition({ directoryOfDefinition, apiName }) {
|
|
|
960128
960191
|
strategy: "status-code"
|
|
960129
960192
|
}
|
|
960130
960193
|
};
|
|
960131
|
-
await (0,
|
|
960132
|
-
await (0,
|
|
960194
|
+
await (0, import_promises147.mkdir)(directoryOfDefinition);
|
|
960195
|
+
await (0, import_promises147.writeFile)(join8(directoryOfDefinition, RelativeFilePath2.of(ROOT_API_FILENAME)), index_vite_proxy_tmp_default.dump(rootApi));
|
|
960133
960196
|
const absoluteFilepathToImdbYaml = join8(directoryOfDefinition, RelativeFilePath2.of("imdb.yml"));
|
|
960134
960197
|
let formattedContent;
|
|
960135
960198
|
try {
|
|
@@ -960145,7 +960208,7 @@ async function writeSampleApiDefinition({ directoryOfDefinition, apiName }) {
|
|
|
960145
960208
|
code: CliError.Code.ParseError
|
|
960146
960209
|
});
|
|
960147
960210
|
}
|
|
960148
|
-
await (0,
|
|
960211
|
+
await (0, import_promises147.writeFile)(absoluteFilepathToImdbYaml, formattedContent);
|
|
960149
960212
|
}
|
|
960150
960213
|
|
|
960151
960214
|
// ../init/lib/initializeAPI.js
|
|
@@ -960196,7 +960259,7 @@ async function getDirectoryOfNewAPIWorkspace({ absolutePathToFernDirectory, task
|
|
|
960196
960259
|
if (inlinedApiDefinition || inlinedOpenApiWorkspace) {
|
|
960197
960260
|
taskContext.logger.info("Creating workspaces to support multiple API Definitions.");
|
|
960198
960261
|
const apiWorkspaceDirectory = join8(absolutePathToFernDirectory, RelativeFilePath2.of(APIS_DIRECTORY), RelativeFilePath2.of("api"));
|
|
960199
|
-
await (0,
|
|
960262
|
+
await (0, import_promises148.mkdir)(apiWorkspaceDirectory, { recursive: true });
|
|
960200
960263
|
if (inlinedApiDefinition) {
|
|
960201
960264
|
const inlinedDefinitionDirectory = join8(absolutePathToFernDirectory, RelativeFilePath2.of(DEFINITION_DIRECTORY));
|
|
960202
960265
|
const workspaceDefinitionDirectory = join8(apiWorkspaceDirectory, RelativeFilePath2.of(DEFINITION_DIRECTORY));
|
|
@@ -960235,7 +960298,7 @@ init_lib19();
|
|
|
960235
960298
|
init_lib4();
|
|
960236
960299
|
init_lib8();
|
|
960237
960300
|
init_source();
|
|
960238
|
-
var
|
|
960301
|
+
var import_promises149 = require("fs/promises");
|
|
960239
960302
|
init_js_yaml();
|
|
960240
960303
|
async function initializeDocs({ organization, taskContext, versionOfCli }) {
|
|
960241
960304
|
const createDirectoryResponse = await createFernDirectoryAndWorkspace({
|
|
@@ -960251,7 +960314,7 @@ async function initializeDocs({ organization, taskContext, versionOfCli }) {
|
|
|
960251
960314
|
} else {
|
|
960252
960315
|
try {
|
|
960253
960316
|
const docsConfig = getDocsConfig(createDirectoryResponse.organization);
|
|
960254
|
-
await (0,
|
|
960317
|
+
await (0, import_promises149.writeFile)(docsYmlPath, index_vite_proxy_tmp_default.dump(docsConfig));
|
|
960255
960318
|
taskContext.logger.info(source_default.green("Created docs configuration"));
|
|
960256
960319
|
return;
|
|
960257
960320
|
} catch (writeError) {
|
|
@@ -960308,7 +960371,7 @@ var FernDocsBuilder = class {
|
|
|
960308
960371
|
init_lib12();
|
|
960309
960372
|
init_lib8();
|
|
960310
960373
|
init_lib6();
|
|
960311
|
-
var
|
|
960374
|
+
var import_promises150 = require("fs/promises");
|
|
960312
960375
|
init_js_yaml();
|
|
960313
960376
|
var FernDocsBuilderImpl = class extends FernDocsBuilder {
|
|
960314
960377
|
openApiSpecs = {};
|
|
@@ -960368,7 +960431,7 @@ var FernDocsBuilderImpl = class extends FernDocsBuilder {
|
|
|
960368
960431
|
}
|
|
960369
960432
|
async build({ outputDirectory }) {
|
|
960370
960433
|
const absolutePathToFernDirectory = join8(outputDirectory, RelativeFilePath2.of(FERN_DIRECTORY));
|
|
960371
|
-
await (0,
|
|
960434
|
+
await (0, import_promises150.mkdir)(absolutePathToFernDirectory, { recursive: true });
|
|
960372
960435
|
if (Object.keys(this.tabbedNavigation).length > 0) {
|
|
960373
960436
|
this.docsYml.tabs = Object.fromEntries(Object.entries(this.tabbedNavigation).map(([key2, value2]) => {
|
|
960374
960437
|
return [value2.tabId, value2.tabConfig];
|
|
@@ -960393,27 +960456,27 @@ var FernDocsBuilderImpl = class extends FernDocsBuilder {
|
|
|
960393
960456
|
}))
|
|
960394
960457
|
};
|
|
960395
960458
|
}
|
|
960396
|
-
await (0,
|
|
960459
|
+
await (0, import_promises150.writeFile)(join8(absolutePathToFernDirectory, RelativeFilePath2.of(GENERATORS_CONFIGURATION_FILENAME)), index_vite_proxy_tmp_default.dump(generators_yml_exports.serialization.GeneratorsConfigurationSchema.jsonOrThrow(this.generatorsYml)));
|
|
960397
960460
|
await Promise.all(Object.entries(this.openApiSpecs).map(async ([relativePath, absolutePath]) => {
|
|
960398
960461
|
const absolutePathToOpenAPI = join8(absolutePathToFernDirectory, RelativeFilePath2.of(relativePath));
|
|
960399
|
-
await (0,
|
|
960400
|
-
await (0,
|
|
960462
|
+
await (0, import_promises150.mkdir)(dirname6(absolutePathToOpenAPI), { recursive: true });
|
|
960463
|
+
await (0, import_promises150.cp)(absolutePath, absolutePathToOpenAPI);
|
|
960401
960464
|
}));
|
|
960402
960465
|
}
|
|
960403
|
-
await (0,
|
|
960466
|
+
await (0, import_promises150.writeFile)(join8(absolutePathToFernDirectory, RelativeFilePath2.of(DOCS_CONFIGURATION_FILENAME)), index_vite_proxy_tmp_default.dump(docs_yml_exports.RawSchemas.Serializer.DocsConfiguration.jsonOrThrow(this.docsYml, { omitUndefined: true })));
|
|
960404
960467
|
await Promise.all(Object.entries(this.markdownPages).map(async ([filepath, page]) => {
|
|
960405
960468
|
const absoluteFilepathToMarkdownPage = join8(absolutePathToFernDirectory, RelativeFilePath2.of(filepath));
|
|
960406
|
-
await (0,
|
|
960469
|
+
await (0, import_promises150.mkdir)(dirname6(absoluteFilepathToMarkdownPage), { recursive: true });
|
|
960407
960470
|
const frontmatter = Object.keys(page.frontmatter).length > 0 ? `---
|
|
960408
960471
|
${index_vite_proxy_tmp_default.dump(JSON.parse(JSON.stringify(page.frontmatter)))}---
|
|
960409
960472
|
|
|
960410
960473
|
` : "";
|
|
960411
|
-
await (0,
|
|
960474
|
+
await (0, import_promises150.writeFile)(absoluteFilepathToMarkdownPage, `${frontmatter}${page.markdown}`);
|
|
960412
960475
|
}));
|
|
960413
960476
|
await Promise.all(Object.entries(this.assets).map(async ([filepath, asset]) => {
|
|
960414
960477
|
const absolutePathToAsset = join8(absolutePathToFernDirectory, RelativeFilePath2.of(filepath));
|
|
960415
|
-
await (0,
|
|
960416
|
-
await (0,
|
|
960478
|
+
await (0, import_promises150.mkdir)(dirname6(absolutePathToAsset), { recursive: true });
|
|
960479
|
+
await (0, import_promises150.cp)(asset.absoluteFilePathToAsset, absolutePathToAsset);
|
|
960417
960480
|
}));
|
|
960418
960481
|
}
|
|
960419
960482
|
setInstance({ companyName }) {
|
|
@@ -960447,7 +960510,7 @@ var NonTabbedNavigationBuilderImpl = class {
|
|
|
960447
960510
|
// ../docs-importers/mintlify/lib/MintlifyImporter.js
|
|
960448
960511
|
init_lib8();
|
|
960449
960512
|
init_lib6();
|
|
960450
|
-
var
|
|
960513
|
+
var import_promises152 = require("fs/promises");
|
|
960451
960514
|
|
|
960452
960515
|
// ../docs-importers/mintlify/lib/convertColors.js
|
|
960453
960516
|
function convertColors(colors19) {
|
|
@@ -960508,10 +960571,10 @@ init_lib8();
|
|
|
960508
960571
|
|
|
960509
960572
|
// ../docs-importers/mintlify/lib/convertMarkdown.js
|
|
960510
960573
|
init_lib8();
|
|
960511
|
-
var
|
|
960574
|
+
var import_promises151 = require("fs/promises");
|
|
960512
960575
|
var import_gray_matter11 = __toESM(require_gray_matter(), 1);
|
|
960513
960576
|
async function convertMarkdown({ absolutePathToMintJson, absoluteFilepathToMarkdown, relativeFilepathFromRoot, builder }) {
|
|
960514
|
-
const text9 = await (0,
|
|
960577
|
+
const text9 = await (0, import_promises151.readFile)(absoluteFilepathToMarkdown, "utf-8");
|
|
960515
960578
|
const { data: data2, content: content5 } = parseMintlifyFrontmatter(text9);
|
|
960516
960579
|
const slug = relativeFilepathFromRoot.replace(/\.(md|mdx)$/, "");
|
|
960517
960580
|
const transformedContent = markReferencedAssets({
|
|
@@ -960680,7 +960743,7 @@ var MintlifyImporter = class extends DocsImporter {
|
|
|
960680
960743
|
documentationTab = void 0;
|
|
960681
960744
|
tabUrlToInfo = {};
|
|
960682
960745
|
async import({ args, builder }) {
|
|
960683
|
-
const mintJsonContent = await (0,
|
|
960746
|
+
const mintJsonContent = await (0, import_promises152.readFile)(args.absolutePathToMintJson, "utf-8");
|
|
960684
960747
|
const mint = this.parseMintJson({
|
|
960685
960748
|
content: mintJsonContent,
|
|
960686
960749
|
absolutePathToMintJson: args.absolutePathToMintJson
|
|
@@ -960826,7 +960889,7 @@ var MintlifyImporter = class extends DocsImporter {
|
|
|
960826
960889
|
// ../docs-importers/mintlify/lib/runMintlifyMigration.js
|
|
960827
960890
|
init_lib12();
|
|
960828
960891
|
init_lib8();
|
|
960829
|
-
var
|
|
960892
|
+
var import_promises153 = require("fs/promises");
|
|
960830
960893
|
async function runMintlifyMigration({ absolutePathToMintJson, outputPath, taskContext, versionOfCli, organization }) {
|
|
960831
960894
|
const mintlifyImporter = new MintlifyImporter({
|
|
960832
960895
|
context: taskContext
|
|
@@ -960837,7 +960900,7 @@ async function runMintlifyMigration({ absolutePathToMintJson, outputPath, taskCo
|
|
|
960837
960900
|
builder
|
|
960838
960901
|
});
|
|
960839
960902
|
await builder.build({ outputDirectory: outputPath });
|
|
960840
|
-
await (0,
|
|
960903
|
+
await (0, import_promises153.writeFile)(join8(AbsoluteFilePath2.of(outputPath), RelativeFilePath2.of(FERN_DIRECTORY), RelativeFilePath2.of(PROJECT_CONFIG_FILENAME)), JSON.stringify({
|
|
960841
960904
|
version: versionOfCli,
|
|
960842
960905
|
organization
|
|
960843
960906
|
}, void 0, 4));
|
|
@@ -960898,7 +960961,7 @@ function assertIsStringArray(val) {
|
|
|
960898
960961
|
// ../docs-importers/readme/lib/ReadmeImporter.js
|
|
960899
960962
|
init_lib4();
|
|
960900
960963
|
init_lib8();
|
|
960901
|
-
var
|
|
960964
|
+
var import_promises154 = require("fs/promises");
|
|
960902
960965
|
|
|
960903
960966
|
// ../docs-importers/readme/lib/extract/favicon.js
|
|
960904
960967
|
init_unist_util_visit();
|
|
@@ -964252,7 +964315,7 @@ var ReadmeImporter = class extends DocsImporter {
|
|
|
964252
964315
|
if (response.ok) {
|
|
964253
964316
|
const imageBuffer = Buffer.from(await response.arrayBuffer());
|
|
964254
964317
|
const faviconPath = join8(assetsDirectory, RelativeFilePath2.of("favicon"));
|
|
964255
|
-
await (0,
|
|
964318
|
+
await (0, import_promises154.writeFile)(faviconPath, new Uint8Array(imageBuffer));
|
|
964256
964319
|
builder.setFavicon({ favicon: relativize(this.absolutePathToFernDirectory, faviconPath) });
|
|
964257
964320
|
}
|
|
964258
964321
|
}
|
|
@@ -964269,7 +964332,7 @@ var ReadmeImporter = class extends DocsImporter {
|
|
|
964269
964332
|
*/
|
|
964270
964333
|
async getAndCreateAssetsDirectory() {
|
|
964271
964334
|
const assetsDirectory = join8(this.absolutePathToFernDirectory, RelativeFilePath2.of("assets"));
|
|
964272
|
-
await (0,
|
|
964335
|
+
await (0, import_promises154.mkdir)(assetsDirectory, { recursive: true });
|
|
964273
964336
|
return assetsDirectory;
|
|
964274
964337
|
}
|
|
964275
964338
|
/**
|
|
@@ -964319,7 +964382,7 @@ var ReadmeImporter = class extends DocsImporter {
|
|
|
964319
964382
|
absolutePathToOutputDirectory,
|
|
964320
964383
|
section
|
|
964321
964384
|
});
|
|
964322
|
-
await (0,
|
|
964385
|
+
await (0, import_promises154.mkdir)(absolutePathToOutputDirectoryForSection, { recursive: true });
|
|
964323
964386
|
await Promise.all(section.pages.filter((page) => page.type === "page").map(async (page) => {
|
|
964324
964387
|
const url3 = new URL(page.slug.toString(), this.url);
|
|
964325
964388
|
this.logger.debug(`Fetching page: ${url3.toString()}`);
|
|
@@ -964334,7 +964397,7 @@ var ReadmeImporter = class extends DocsImporter {
|
|
|
964334
964397
|
absolutePathToOutputDirectoryForSection,
|
|
964335
964398
|
page: page.slug
|
|
964336
964399
|
});
|
|
964337
|
-
await (0,
|
|
964400
|
+
await (0, import_promises154.writeFile)(absolutePathForPage, result.data.mdx);
|
|
964338
964401
|
if (result.data.images.imageURLs.length > 0) {
|
|
964339
964402
|
this.logger.debug(`Found ${result.data.images.imageURLs.length} images to download for ${url3.toString()}`);
|
|
964340
964403
|
await Promise.all(Object.entries(result.data.images.imageURLToFilename).map(async ([imageUrl, filename]) => {
|
|
@@ -964347,8 +964410,8 @@ var ReadmeImporter = class extends DocsImporter {
|
|
|
964347
964410
|
const imageBuffer = Buffer.from(await response.arrayBuffer());
|
|
964348
964411
|
const imagePath = join8(absolutePathToOutputDirectoryForSection, RelativeFilePath2.of(filename));
|
|
964349
964412
|
const imageDir = dirname6(imagePath);
|
|
964350
|
-
await (0,
|
|
964351
|
-
await (0,
|
|
964413
|
+
await (0, import_promises154.mkdir)(imageDir, { recursive: true });
|
|
964414
|
+
await (0, import_promises154.writeFile)(imagePath, new Uint8Array(imageBuffer));
|
|
964352
964415
|
this.logger.debug(`Saved image to ${imagePath}`);
|
|
964353
964416
|
} catch (error50) {
|
|
964354
964417
|
this.logger.warn(`Error downloading image ${imageUrl}: ${error50}`);
|
|
@@ -964432,7 +964495,7 @@ var ReadmeImporter = class extends DocsImporter {
|
|
|
964432
964495
|
// ../docs-importers/readme/lib/runReadmeMigration.js
|
|
964433
964496
|
init_lib12();
|
|
964434
964497
|
init_lib8();
|
|
964435
|
-
var
|
|
964498
|
+
var import_promises155 = require("fs/promises");
|
|
964436
964499
|
async function runReadmeMigration({ readmeUrl, outputPath, taskContext, versionOfCli, organization }) {
|
|
964437
964500
|
const builder = new FernDocsBuilderImpl();
|
|
964438
964501
|
builder.setInstance({ companyName: organization });
|
|
@@ -964447,7 +964510,7 @@ async function runReadmeMigration({ readmeUrl, outputPath, taskContext, versionO
|
|
|
964447
964510
|
builder
|
|
964448
964511
|
});
|
|
964449
964512
|
await builder.build({ outputDirectory: outputPath });
|
|
964450
|
-
await (0,
|
|
964513
|
+
await (0, import_promises155.writeFile)(join8(AbsoluteFilePath2.of(outputPath), RelativeFilePath2.of(FERN_DIRECTORY), RelativeFilePath2.of(PROJECT_CONFIG_FILENAME)), JSON.stringify({
|
|
964451
964514
|
version: versionOfCli,
|
|
964452
964515
|
organization
|
|
964453
964516
|
}, void 0, 4));
|
|
@@ -964474,7 +964537,7 @@ var initializeWithReadme = async ({ readmeUrl, organization, taskContext, versio
|
|
|
964474
964537
|
|
|
964475
964538
|
// ../init/lib/utils/loadOpenApiFromUrl.js
|
|
964476
964539
|
init_axios2();
|
|
964477
|
-
var
|
|
964540
|
+
var import_promises156 = require("fs/promises");
|
|
964478
964541
|
init_js_yaml();
|
|
964479
964542
|
var import_path105 = require("path");
|
|
964480
964543
|
var import_tmp_promise19 = __toESM(require_tmp_promise(), 1);
|
|
@@ -964490,7 +964553,7 @@ async function loadOpenAPIFromUrl({ url: url3, logger: logger4 }) {
|
|
|
964490
964553
|
const filePath = (0, import_path105.join)(tmpDir.path, url3.endsWith(".json") ? "openapi.json" : "openapi.yaml");
|
|
964491
964554
|
logger4.debug("tmpDir", tmpDir.path);
|
|
964492
964555
|
logger4.debug("filePath", filePath);
|
|
964493
|
-
await (0,
|
|
964556
|
+
await (0, import_promises156.writeFile)(filePath, data2);
|
|
964494
964557
|
return {
|
|
964495
964558
|
status: LoadOpenAPIStatus.Success,
|
|
964496
964559
|
filePath
|
|
@@ -968416,7 +968479,7 @@ function getAutomationContextFromEnv() {
|
|
|
968416
968479
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
968417
968480
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
968418
968481
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
968419
|
-
cli_version: "5.23.3-
|
|
968482
|
+
cli_version: "5.23.3-1177-gde22c310de8"
|
|
968420
968483
|
};
|
|
968421
968484
|
}
|
|
968422
968485
|
function isAutomationMode() {
|
|
@@ -969248,7 +969311,7 @@ var CliContext = class _CliContext {
|
|
|
969248
969311
|
if (false) {
|
|
969249
969312
|
this.logger.error("CLI_VERSION is not defined");
|
|
969250
969313
|
}
|
|
969251
|
-
return "5.23.3-
|
|
969314
|
+
return "5.23.3-1177-gde22c310de8";
|
|
969252
969315
|
}
|
|
969253
969316
|
getCliName() {
|
|
969254
969317
|
if (false) {
|
|
@@ -969558,7 +969621,7 @@ init_lib19();
|
|
|
969558
969621
|
init_lib8();
|
|
969559
969622
|
init_lib6();
|
|
969560
969623
|
init_source();
|
|
969561
|
-
var
|
|
969624
|
+
var import_promises157 = require("fs/promises");
|
|
969562
969625
|
|
|
969563
969626
|
// ../project-loader/lib/normalizeCommandLineApiWorkspace.js
|
|
969564
969627
|
function normalizeCommandLineApiWorkspace(input3) {
|
|
@@ -969640,7 +969703,7 @@ async function loadApis({ cliName, fernDirectory, context: context3, cliVersion,
|
|
|
969640
969703
|
const apisDirectory = join8(fernDirectory, RelativeFilePath2.of(APIS_DIRECTORY));
|
|
969641
969704
|
const apisDirectoryExists = await doesPathExist(apisDirectory);
|
|
969642
969705
|
if (apisDirectoryExists) {
|
|
969643
|
-
const apiDirectoryContents = await (0,
|
|
969706
|
+
const apiDirectoryContents = await (0, import_promises157.readdir)(apisDirectory, { withFileTypes: true });
|
|
969644
969707
|
const apiWorkspaceDirectoryNames = apiDirectoryContents.reduce((all9, item) => {
|
|
969645
969708
|
if (item.isDirectory()) {
|
|
969646
969709
|
all9.push(item.name);
|
|
@@ -969718,13 +969781,13 @@ async function loadProjectAndRegisterWorkspacesWithContext(cliContext, args, reg
|
|
|
969718
969781
|
init_lib19();
|
|
969719
969782
|
init_lib6();
|
|
969720
969783
|
var import_generators_sdk6 = __toESM(require_generators_sdk(), 1);
|
|
969721
|
-
var
|
|
969784
|
+
var import_promises162 = require("fs/promises");
|
|
969722
969785
|
|
|
969723
969786
|
// src/commands/generator-list/getGeneratorList.ts
|
|
969724
969787
|
init_lib19();
|
|
969725
969788
|
init_lib4();
|
|
969726
969789
|
init_lib6();
|
|
969727
|
-
var
|
|
969790
|
+
var import_promises158 = require("fs/promises");
|
|
969728
969791
|
init_js_yaml();
|
|
969729
969792
|
var GenerationModeFilter = {
|
|
969730
969793
|
GitHub: "github",
|
|
@@ -969785,7 +969848,7 @@ async function getGeneratorList({
|
|
|
969785
969848
|
return;
|
|
969786
969849
|
}
|
|
969787
969850
|
try {
|
|
969788
|
-
await (0,
|
|
969851
|
+
await (0, import_promises158.writeFile)(outputLocation, generatorsListYaml);
|
|
969789
969852
|
} catch (error50) {
|
|
969790
969853
|
cliContext.failAndThrow(`Could not write file to the specified location: ${outputLocation}`, error50, {
|
|
969791
969854
|
code: CliError.Code.ConfigError
|
|
@@ -969855,7 +969918,7 @@ async function getGeneratorMetadata({
|
|
|
969855
969918
|
|
|
969856
969919
|
// src/commands/organization/getOrganization.ts
|
|
969857
969920
|
init_lib6();
|
|
969858
|
-
var
|
|
969921
|
+
var import_promises159 = require("fs/promises");
|
|
969859
969922
|
async function getOrganization({
|
|
969860
969923
|
project,
|
|
969861
969924
|
outputLocation,
|
|
@@ -969867,7 +969930,7 @@ async function getOrganization({
|
|
|
969867
969930
|
return;
|
|
969868
969931
|
}
|
|
969869
969932
|
try {
|
|
969870
|
-
await (0,
|
|
969933
|
+
await (0, import_promises159.writeFile)(outputLocation, org);
|
|
969871
969934
|
} catch (error50) {
|
|
969872
969935
|
context3.failAndThrow(`Could not write file to the specified location: ${outputLocation}`, error50, {
|
|
969873
969936
|
code: CliError.Code.ConfigError
|
|
@@ -969880,7 +969943,7 @@ init_lib19();
|
|
|
969880
969943
|
init_lib8();
|
|
969881
969944
|
init_lib6();
|
|
969882
969945
|
init_source();
|
|
969883
|
-
var
|
|
969946
|
+
var import_promises161 = require("fs/promises");
|
|
969884
969947
|
var import_path107 = __toESM(require("path"), 1);
|
|
969885
969948
|
var import_semver16 = __toESM(require_semver2(), 1);
|
|
969886
969949
|
var import_yaml6 = __toESM(require_dist11(), 1);
|
|
@@ -969890,14 +969953,14 @@ init_lib4();
|
|
|
969890
969953
|
init_lib33();
|
|
969891
969954
|
init_lib6();
|
|
969892
969955
|
var import_fs40 = require("fs");
|
|
969893
|
-
var
|
|
969894
|
-
var
|
|
969956
|
+
var import_promises160 = require("fs/promises");
|
|
969957
|
+
var import_os16 = require("os");
|
|
969895
969958
|
var import_path106 = require("path");
|
|
969896
969959
|
var import_semver15 = __toESM(require_semver2(), 1);
|
|
969897
969960
|
var import_url10 = require("url");
|
|
969898
969961
|
var MIGRATION_PACKAGE_NAME2 = "@fern-api/generator-migrations";
|
|
969899
969962
|
function getMigrationCacheDir() {
|
|
969900
|
-
return (0, import_path106.join)((0,
|
|
969963
|
+
return (0, import_path106.join)((0, import_os16.homedir)(), ".fern", "migration-cache");
|
|
969901
969964
|
}
|
|
969902
969965
|
var LOCK_FILENAME = ".install.lock";
|
|
969903
969966
|
var LOCK_POLL_MS = 200;
|
|
@@ -969918,7 +969981,7 @@ async function acquireLock3(logger4, cacheDir) {
|
|
|
969918
969981
|
const myPid = String(process.pid);
|
|
969919
969982
|
while (true) {
|
|
969920
969983
|
try {
|
|
969921
|
-
const fh = await (0,
|
|
969984
|
+
const fh = await (0, import_promises160.open)(lockPath, "wx");
|
|
969922
969985
|
await fh.writeFile(myPid);
|
|
969923
969986
|
await fh.close();
|
|
969924
969987
|
const exitHandler = () => {
|
|
@@ -969935,9 +969998,9 @@ async function acquireLock3(logger4, cacheDir) {
|
|
|
969935
969998
|
return async () => {
|
|
969936
969999
|
process.removeListener("exit", exitHandler);
|
|
969937
970000
|
try {
|
|
969938
|
-
const currentContent = await (0,
|
|
970001
|
+
const currentContent = await (0, import_promises160.readFile)(lockPath, "utf-8");
|
|
969939
970002
|
if (currentContent.trim() === myPid) {
|
|
969940
|
-
await (0,
|
|
970003
|
+
await (0, import_promises160.unlink)(lockPath);
|
|
969941
970004
|
} else {
|
|
969942
970005
|
logger4.debug(
|
|
969943
970006
|
`Lock file owned by another process (expected pid=${myPid}, found=${currentContent.trim()}); skipping release`
|
|
@@ -969953,14 +970016,14 @@ async function acquireLock3(logger4, cacheDir) {
|
|
|
969953
970016
|
throw err;
|
|
969954
970017
|
}
|
|
969955
970018
|
try {
|
|
969956
|
-
const lockContent = await (0,
|
|
970019
|
+
const lockContent = await (0, import_promises160.readFile)(lockPath, "utf-8");
|
|
969957
970020
|
const lockPid = Number(lockContent.trim());
|
|
969958
|
-
const lockStat = await (0,
|
|
970021
|
+
const lockStat = await (0, import_promises160.stat)(lockPath);
|
|
969959
970022
|
const lockAge = Date.now() - lockStat.mtimeMs;
|
|
969960
970023
|
if (lockAge > LOCK_STALE_MS || Number.isFinite(lockPid) && lockPid > 0 && !isProcessAlive(lockPid)) {
|
|
969961
970024
|
logger4.debug(`Removing stale migration lock (pid=${lockContent.trim()}, age=${lockAge}ms)`);
|
|
969962
970025
|
try {
|
|
969963
|
-
await (0,
|
|
970026
|
+
await (0, import_promises160.unlink)(lockPath);
|
|
969964
970027
|
} catch (unlinkErr) {
|
|
969965
970028
|
logger4.debug(`Failed to remove stale lock: ${unlinkErr}`);
|
|
969966
970029
|
}
|
|
@@ -969984,7 +970047,7 @@ async function ensureMigrationsInstalled(logger4) {
|
|
|
969984
970047
|
}
|
|
969985
970048
|
migrationsInstallPromise = (async () => {
|
|
969986
970049
|
const cacheDir = getMigrationCacheDir();
|
|
969987
|
-
await (0,
|
|
970050
|
+
await (0, import_promises160.mkdir)(cacheDir, { recursive: true });
|
|
969988
970051
|
const npmCacheDir = (0, import_path106.join)(cacheDir, ".npm-cache");
|
|
969989
970052
|
const packageDir = (0, import_path106.join)(cacheDir, "node_modules", MIGRATION_PACKAGE_NAME2);
|
|
969990
970053
|
const packageJsonPath = (0, import_path106.join)(packageDir, "package.json");
|
|
@@ -970001,7 +970064,7 @@ async function ensureMigrationsInstalled(logger4) {
|
|
|
970001
970064
|
"--no-audit",
|
|
970002
970065
|
"--no-fund"
|
|
970003
970066
|
]);
|
|
970004
|
-
const packageJsonContent = await (0,
|
|
970067
|
+
const packageJsonContent = await (0, import_promises160.readFile)(packageJsonPath, "utf-8");
|
|
970005
970068
|
const packageJson2 = JSON.parse(packageJsonContent);
|
|
970006
970069
|
if (packageJson2.main == null) {
|
|
970007
970070
|
throw new CliError({
|
|
@@ -970185,7 +970248,7 @@ async function loadAndUpdateGenerators({
|
|
|
970185
970248
|
skippedAutoreleaseDisabled: []
|
|
970186
970249
|
};
|
|
970187
970250
|
}
|
|
970188
|
-
const contents = await (0,
|
|
970251
|
+
const contents = await (0, import_promises161.readFile)(filepath);
|
|
970189
970252
|
context3.logger.debug(`Found generators: ${contents.toString()}`);
|
|
970190
970253
|
const parsedDocument = import_yaml6.default.parseDocument(contents.toString());
|
|
970191
970254
|
const generatorGroups = parsedDocument.get("groups");
|
|
@@ -970422,7 +970485,7 @@ async function upgradeGenerator({
|
|
|
970422
970485
|
absolutePathToWorkspace: workspace.absoluteFilePath
|
|
970423
970486
|
});
|
|
970424
970487
|
if (absolutePathToGeneratorsConfiguration != null && result.updatedConfiguration != null) {
|
|
970425
|
-
await (0,
|
|
970488
|
+
await (0, import_promises161.writeFile)(absolutePathToGeneratorsConfiguration, result.updatedConfiguration);
|
|
970426
970489
|
}
|
|
970427
970490
|
allSkippedMajorUpgrades.push(...result.skippedMajorUpgrades);
|
|
970428
970491
|
if (result.appliedUpgrades.length > 0) {
|
|
@@ -970822,7 +970885,7 @@ function addGeneratorCommands(cli, cliContext) {
|
|
|
970822
970885
|
}
|
|
970823
970886
|
if (argv.output) {
|
|
970824
970887
|
try {
|
|
970825
|
-
await (0,
|
|
970888
|
+
await (0, import_promises162.writeFile)(argv.output, JSON.stringify(generatorMetadata, null, 2));
|
|
970826
970889
|
} catch (error50) {
|
|
970827
970890
|
cliContext.failAndThrow(
|
|
970828
970891
|
`Could not write file to the specified location: ${argv.output}`,
|
|
@@ -970839,7 +970902,7 @@ function addGeneratorCommands(cli, cliContext) {
|
|
|
970839
970902
|
// src/commands/add-generator/addGeneratorToWorkspaces.ts
|
|
970840
970903
|
init_lib19();
|
|
970841
970904
|
init_source();
|
|
970842
|
-
var
|
|
970905
|
+
var import_promises163 = require("fs/promises");
|
|
970843
970906
|
init_js_yaml();
|
|
970844
970907
|
async function addGeneratorToWorkspaces({
|
|
970845
970908
|
project: { apiWorkspaces },
|
|
@@ -970867,7 +970930,7 @@ async function addGeneratorToWorkspaces({
|
|
|
970867
970930
|
if (absolutePathToGeneratorsConfiguration == null) {
|
|
970868
970931
|
return;
|
|
970869
970932
|
}
|
|
970870
|
-
await (0,
|
|
970933
|
+
await (0, import_promises163.writeFile)(
|
|
970871
970934
|
absolutePathToGeneratorsConfiguration,
|
|
970872
970935
|
"# yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json\n" + index_vite_proxy_tmp_default.dump(newConfiguration)
|
|
970873
970936
|
);
|
|
@@ -970935,18 +970998,18 @@ var LOCAL_STORAGE_FOLDER6 = ".fern-dev";
|
|
|
970935
970998
|
|
|
970936
970999
|
// src/commands/generate/checkOutputDirectory.ts
|
|
970937
971000
|
init_lib8();
|
|
970938
|
-
var
|
|
971001
|
+
var import_promises166 = require("fs/promises");
|
|
970939
971002
|
|
|
970940
971003
|
// src/persistence/output-directories/getOutputDirectories.ts
|
|
970941
971004
|
init_lib8();
|
|
970942
|
-
var
|
|
971005
|
+
var import_promises164 = require("fs/promises");
|
|
970943
971006
|
|
|
970944
971007
|
// src/persistence/output-directories/getPathToOutputDirectoriesFile.ts
|
|
970945
971008
|
init_lib8();
|
|
970946
|
-
var
|
|
971009
|
+
var import_os17 = require("os");
|
|
970947
971010
|
function getPathToOutputDirectoriesFile() {
|
|
970948
971011
|
return join8(
|
|
970949
|
-
AbsoluteFilePath2.of((0,
|
|
971012
|
+
AbsoluteFilePath2.of((0, import_os17.homedir)()),
|
|
970950
971013
|
RelativeFilePath2.of(LOCAL_STORAGE_FOLDER6),
|
|
970951
971014
|
RelativeFilePath2.of(APPROVED_DIRECTORIES_FILENAME)
|
|
970952
971015
|
);
|
|
@@ -970959,17 +971022,17 @@ async function getOutputDirectories() {
|
|
|
970959
971022
|
if (!doesOutputDirectoriesFileExist) {
|
|
970960
971023
|
return [];
|
|
970961
971024
|
}
|
|
970962
|
-
const outputDirectoriesFileContents = await (0,
|
|
971025
|
+
const outputDirectoriesFileContents = await (0, import_promises164.readFile)(pathToOutputDirectoriesFile, { encoding: "utf-8" });
|
|
970963
971026
|
const outputDirectories = JSON.parse(outputDirectoriesFileContents);
|
|
970964
971027
|
return outputDirectories;
|
|
970965
971028
|
}
|
|
970966
971029
|
|
|
970967
971030
|
// src/persistence/output-directories/storeOutputDirectories.ts
|
|
970968
|
-
var
|
|
971031
|
+
var import_promises165 = require("fs/promises");
|
|
970969
971032
|
var import_path108 = __toESM(require("path"), 1);
|
|
970970
971033
|
async function storeOutputDirectories(outputDirectories) {
|
|
970971
|
-
await (0,
|
|
970972
|
-
await (0,
|
|
971034
|
+
await (0, import_promises165.mkdir)(import_path108.default.dirname(getPathToOutputDirectoriesFile()), { recursive: true });
|
|
971035
|
+
await (0, import_promises165.writeFile)(getPathToOutputDirectoriesFile(), JSON.stringify(outputDirectories, null, 2));
|
|
970973
971036
|
}
|
|
970974
971037
|
|
|
970975
971038
|
// src/commands/generate/checkOutputDirectory.ts
|
|
@@ -970991,7 +971054,7 @@ async function checkOutputDirectory(outputPath, cliContext, force) {
|
|
|
970991
971054
|
shouldProceed: true
|
|
970992
971055
|
};
|
|
970993
971056
|
}
|
|
970994
|
-
const files = await (0,
|
|
971057
|
+
const files = await (0, import_promises166.readdir)(outputPath);
|
|
970995
971058
|
if (files.length === 0) {
|
|
970996
971059
|
return {
|
|
970997
971060
|
shouldProceed: true
|
|
@@ -971984,7 +972047,7 @@ function renderOverflowWarning(failureCount) {
|
|
|
971984
972047
|
// src/commands/automations/generate/reportGenerateResults.ts
|
|
971985
972048
|
init_lib4();
|
|
971986
972049
|
var import_fs41 = require("fs");
|
|
971987
|
-
var
|
|
972050
|
+
var import_promises167 = require("fs/promises");
|
|
971988
972051
|
var JSON_SCHEMA_VERSION = 1;
|
|
971989
972052
|
function renderStdoutSummary(results) {
|
|
971990
972053
|
return formatCounts(countResults(results));
|
|
@@ -972174,12 +972237,12 @@ async function writeResults({
|
|
|
972174
972237
|
const stepSummaryPath = getGithubStepSummaryPath();
|
|
972175
972238
|
if (stepSummaryPath != null) {
|
|
972176
972239
|
try {
|
|
972177
|
-
await (0,
|
|
972240
|
+
await (0, import_promises167.appendFile)(stepSummaryPath, renderMarkdownSummary(results), "utf8");
|
|
972178
972241
|
} catch {
|
|
972179
972242
|
}
|
|
972180
972243
|
}
|
|
972181
972244
|
if (jsonOutputPath != null) {
|
|
972182
|
-
await (0,
|
|
972245
|
+
await (0, import_promises167.writeFile)(jsonOutputPath, JSON.stringify(renderJsonSummary(results), null, 2), "utf8");
|
|
972183
972246
|
}
|
|
972184
972247
|
}
|
|
972185
972248
|
function writeResultsSync({
|
|
@@ -972506,7 +972569,7 @@ function listPreviewGroups({
|
|
|
972506
972569
|
init_lib19();
|
|
972507
972570
|
init_lib6();
|
|
972508
972571
|
init_source();
|
|
972509
|
-
var
|
|
972572
|
+
var import_promises197 = require("fs/promises");
|
|
972510
972573
|
|
|
972511
972574
|
// ../cli-migrations/lib/runMigrations.js
|
|
972512
972575
|
init_lib4();
|
|
@@ -972517,7 +972580,7 @@ init_source();
|
|
|
972517
972580
|
init_lib27();
|
|
972518
972581
|
|
|
972519
972582
|
// ../cli-migrations/lib/migrations/0.0.191/discriminant/migration.js
|
|
972520
|
-
var
|
|
972583
|
+
var import_promises168 = require("fs/promises");
|
|
972521
972584
|
|
|
972522
972585
|
// ../cli-migrations/lib/migrations/0.0.191/discriminant/getAllYamlFiles.js
|
|
972523
972586
|
init_lib8();
|
|
@@ -972554,7 +972617,7 @@ var migration = {
|
|
|
972554
972617
|
try {
|
|
972555
972618
|
const fileContents = await getFileContents(yamlFilepath);
|
|
972556
972619
|
const newContents = addDiscriminantToFile(fileContents);
|
|
972557
|
-
await (0,
|
|
972620
|
+
await (0, import_promises168.writeFile)(yamlFilepath, newContents);
|
|
972558
972621
|
} catch (error50) {
|
|
972559
972622
|
context3.failAndThrow("Failed to migrate " + yamlFilepath, error50);
|
|
972560
972623
|
}
|
|
@@ -972562,7 +972625,7 @@ var migration = {
|
|
|
972562
972625
|
}
|
|
972563
972626
|
};
|
|
972564
972627
|
async function getFileContents(filepath) {
|
|
972565
|
-
const buffer = await (0,
|
|
972628
|
+
const buffer = await (0, import_promises168.readFile)(filepath);
|
|
972566
972629
|
return buffer.toString();
|
|
972567
972630
|
}
|
|
972568
972631
|
var UNION_REGEX = /^(\s{2,})union:\s*$/gm;
|
|
@@ -972591,7 +972654,7 @@ var versionMigrations = {
|
|
|
972591
972654
|
var __default = versionMigrations;
|
|
972592
972655
|
|
|
972593
972656
|
// ../cli-migrations/lib/migrations/0.0.203/union-single-property-key/migration.js
|
|
972594
|
-
var
|
|
972657
|
+
var import_promises169 = require("fs/promises");
|
|
972595
972658
|
var import_yaml7 = __toESM(require_dist11(), 1);
|
|
972596
972659
|
|
|
972597
972660
|
// ../cli-migrations/lib/migrations/0.0.203/union-single-property-key/getAllYamlFiles.js
|
|
@@ -972635,7 +972698,7 @@ var migration2 = {
|
|
|
972635
972698
|
}
|
|
972636
972699
|
};
|
|
972637
972700
|
async function migrateFile(filepath, context3) {
|
|
972638
|
-
const contents = await (0,
|
|
972701
|
+
const contents = await (0, import_promises169.readFile)(filepath);
|
|
972639
972702
|
const parsedDocument = import_yaml7.default.parseDocument(contents.toString());
|
|
972640
972703
|
const types4 = parsedDocument.get("types");
|
|
972641
972704
|
if (types4 == null) {
|
|
@@ -972667,7 +972730,7 @@ async function migrateFile(filepath, context3) {
|
|
|
972667
972730
|
}
|
|
972668
972731
|
}
|
|
972669
972732
|
}
|
|
972670
|
-
await (0,
|
|
972733
|
+
await (0, import_promises169.writeFile)(filepath, parsedDocument.toString());
|
|
972671
972734
|
}
|
|
972672
972735
|
|
|
972673
972736
|
// ../cli-migrations/lib/migrations/0.0.203/index.js
|
|
@@ -972678,7 +972741,7 @@ var versionMigrations2 = {
|
|
|
972678
972741
|
var __default2 = versionMigrations2;
|
|
972679
972742
|
|
|
972680
972743
|
// ../cli-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/migration.js
|
|
972681
|
-
var
|
|
972744
|
+
var import_promises170 = require("fs/promises");
|
|
972682
972745
|
var import_yaml8 = __toESM(require_dist11(), 1);
|
|
972683
972746
|
|
|
972684
972747
|
// ../cli-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/getAllGeneratorYamlFiles.js
|
|
@@ -972722,7 +972785,7 @@ var migration3 = {
|
|
|
972722
972785
|
}
|
|
972723
972786
|
};
|
|
972724
972787
|
async function migrateGeneratorsYml(filepath, context3) {
|
|
972725
|
-
const contents = await (0,
|
|
972788
|
+
const contents = await (0, import_promises170.readFile)(filepath);
|
|
972726
972789
|
const parsedDocument = import_yaml8.default.parseDocument(contents.toString());
|
|
972727
972790
|
const draftGenerators = parsedDocument.get("draft");
|
|
972728
972791
|
if (draftGenerators == null) {
|
|
@@ -972749,7 +972812,7 @@ async function migrateGeneratorsYml(filepath, context3) {
|
|
|
972749
972812
|
draftGenerator.set("output-path", name2.value.includes("openapi") ? "./generated-openapi" : name2.value.includes("postman") ? "./generated-postman" : localOutput);
|
|
972750
972813
|
}
|
|
972751
972814
|
});
|
|
972752
|
-
await (0,
|
|
972815
|
+
await (0, import_promises170.writeFile)(filepath, parsedDocument.toString());
|
|
972753
972816
|
}
|
|
972754
972817
|
|
|
972755
972818
|
// ../cli-migrations/lib/migrations/0.0.207/index.js
|
|
@@ -972760,7 +972823,7 @@ var versionMigrations3 = {
|
|
|
972760
972823
|
var __default3 = versionMigrations3;
|
|
972761
972824
|
|
|
972762
972825
|
// ../cli-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/migration.js
|
|
972763
|
-
var
|
|
972826
|
+
var import_promises171 = require("fs/promises");
|
|
972764
972827
|
var import_yaml9 = __toESM(require_dist11(), 1);
|
|
972765
972828
|
|
|
972766
972829
|
// ../cli-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/getAllYamlFiles.js
|
|
@@ -972804,7 +972867,7 @@ var migration4 = {
|
|
|
972804
972867
|
}
|
|
972805
972868
|
};
|
|
972806
972869
|
async function migrateFile2(filepath, context3) {
|
|
972807
|
-
const contents = await (0,
|
|
972870
|
+
const contents = await (0, import_promises171.readFile)(filepath);
|
|
972808
972871
|
const parsedDocument = import_yaml9.default.parseDocument(contents.toString());
|
|
972809
972872
|
const addType = (typeName, typeDeclaration2) => {
|
|
972810
972873
|
const types4 = parsedDocument.get("types");
|
|
@@ -972848,7 +972911,7 @@ async function migrateFile2(filepath, context3) {
|
|
|
972848
972911
|
}
|
|
972849
972912
|
}
|
|
972850
972913
|
}
|
|
972851
|
-
await (0,
|
|
972914
|
+
await (0, import_promises171.writeFile)(filepath, parsedDocument.toString());
|
|
972852
972915
|
}
|
|
972853
972916
|
|
|
972854
972917
|
// ../cli-migrations/lib/migrations/0.0.210/index.js
|
|
@@ -972859,7 +972922,7 @@ var versionMigrations4 = {
|
|
|
972859
972922
|
var __default4 = versionMigrations4;
|
|
972860
972923
|
|
|
972861
972924
|
// ../cli-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/migration.js
|
|
972862
|
-
var
|
|
972925
|
+
var import_promises172 = require("fs/promises");
|
|
972863
972926
|
var import_yaml10 = __toESM(require_dist11(), 1);
|
|
972864
972927
|
|
|
972865
972928
|
// ../cli-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/getAllGeneratorYamlFiles.js
|
|
@@ -972903,7 +972966,7 @@ var migration5 = {
|
|
|
972903
972966
|
}
|
|
972904
972967
|
};
|
|
972905
972968
|
async function migrateGeneratorsYml2(filepath, context3) {
|
|
972906
|
-
const contents = await (0,
|
|
972969
|
+
const contents = await (0, import_promises172.readFile)(filepath);
|
|
972907
972970
|
const parsedDocument = import_yaml10.default.parseDocument(contents.toString());
|
|
972908
972971
|
const releaseGenerators = parsedDocument.get("release");
|
|
972909
972972
|
if (releaseGenerators == null) {
|
|
@@ -972941,7 +973004,7 @@ async function migrateGeneratorsYml2(filepath, context3) {
|
|
|
972941
973004
|
}
|
|
972942
973005
|
releaseGenerator.delete("outputs");
|
|
972943
973006
|
});
|
|
972944
|
-
await (0,
|
|
973007
|
+
await (0, import_promises172.writeFile)(filepath, parsedDocument.toString());
|
|
972945
973008
|
}
|
|
972946
973009
|
|
|
972947
973010
|
// ../cli-migrations/lib/migrations/0.0.212/index.js
|
|
@@ -972952,7 +973015,7 @@ var versionMigrations5 = {
|
|
|
972952
973015
|
var __default5 = versionMigrations5;
|
|
972953
973016
|
|
|
972954
973017
|
// ../cli-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/migration.js
|
|
972955
|
-
var
|
|
973018
|
+
var import_promises173 = require("fs/promises");
|
|
972956
973019
|
|
|
972957
973020
|
// ../cli-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/getAllYamlFiles.js
|
|
972958
973021
|
init_lib8();
|
|
@@ -972986,9 +973049,9 @@ var migration6 = {
|
|
|
972986
973049
|
run: async ({ context: context3 }) => {
|
|
972987
973050
|
const yamlFiles = await getAllYamlFiles4(context3);
|
|
972988
973051
|
for (const filepath of yamlFiles) {
|
|
972989
|
-
const contents = await (0,
|
|
973052
|
+
const contents = await (0, import_promises173.readFile)(filepath);
|
|
972990
973053
|
const newContents = contents.toString().replaceAll(" alias:", " type:");
|
|
972991
|
-
await (0,
|
|
973054
|
+
await (0, import_promises173.writeFile)(filepath, newContents);
|
|
972992
973055
|
}
|
|
972993
973056
|
}
|
|
972994
973057
|
};
|
|
@@ -973001,7 +973064,7 @@ var versionMigrations6 = {
|
|
|
973001
973064
|
var __default6 = versionMigrations6;
|
|
973002
973065
|
|
|
973003
973066
|
// ../cli-migrations/lib/migrations/0.0.221/add-error-discriminant/migration.js
|
|
973004
|
-
var
|
|
973067
|
+
var import_promises174 = require("fs/promises");
|
|
973005
973068
|
|
|
973006
973069
|
// ../cli-migrations/lib/migrations/0.0.221/add-error-discriminant/getAllRootApiYamlFiles.js
|
|
973007
973070
|
init_lib8();
|
|
@@ -973035,9 +973098,9 @@ var migration7 = {
|
|
|
973035
973098
|
run: async ({ context: context3 }) => {
|
|
973036
973099
|
const yamlFiles = await getAllRootApiYamlFiles(context3);
|
|
973037
973100
|
for (const filepath of yamlFiles) {
|
|
973038
|
-
const contents = await (0,
|
|
973101
|
+
const contents = await (0, import_promises174.readFile)(filepath);
|
|
973039
973102
|
const newContents = contents.toString() + "\nerror-discriminant: error";
|
|
973040
|
-
await (0,
|
|
973103
|
+
await (0, import_promises174.writeFile)(filepath, newContents);
|
|
973041
973104
|
}
|
|
973042
973105
|
}
|
|
973043
973106
|
};
|
|
@@ -973051,7 +973114,7 @@ var __default7 = versionMigrations7;
|
|
|
973051
973114
|
|
|
973052
973115
|
// ../cli-migrations/lib/migrations/0.0.241/add-generator-groups/migration.js
|
|
973053
973116
|
init_lib4();
|
|
973054
|
-
var
|
|
973117
|
+
var import_promises175 = require("fs/promises");
|
|
973055
973118
|
init_js_yaml();
|
|
973056
973119
|
|
|
973057
973120
|
// ../cli-migrations/lib/migrations/0.0.241/add-generator-groups/getAllGeneratorYamlFiles.js
|
|
@@ -973185,7 +973248,7 @@ var migration8 = {
|
|
|
973185
973248
|
}
|
|
973186
973249
|
};
|
|
973187
973250
|
async function migrateGeneratorsYml3(filepath) {
|
|
973188
|
-
const contentsStr = await (0,
|
|
973251
|
+
const contentsStr = await (0, import_promises175.readFile)(filepath);
|
|
973189
973252
|
const contents = index_vite_proxy_tmp_default.load(contentsStr.toString());
|
|
973190
973253
|
const oldGeneratorsConfiguration = GeneratorsConfigurationSchema2.parse(contents);
|
|
973191
973254
|
let newGeneratorsConfiguration = {};
|
|
@@ -973203,7 +973266,7 @@ async function migrateGeneratorsYml3(filepath) {
|
|
|
973203
973266
|
generators: oldGeneratorsConfiguration.release.map((releaseGeneratorInvocation) => convertReleaseGeneratorInvocation(releaseGeneratorInvocation))
|
|
973204
973267
|
};
|
|
973205
973268
|
}
|
|
973206
|
-
await (0,
|
|
973269
|
+
await (0, import_promises175.writeFile)(filepath, index_vite_proxy_tmp_default.dump(newGeneratorsConfiguration));
|
|
973207
973270
|
}
|
|
973208
973271
|
function convertDraftGeneratorInvocation(draftGeneratorInvocation) {
|
|
973209
973272
|
const newSchema = {
|
|
@@ -973278,7 +973341,7 @@ var versionMigrations8 = {
|
|
|
973278
973341
|
var __default8 = versionMigrations8;
|
|
973279
973342
|
|
|
973280
973343
|
// ../cli-migrations/lib/migrations/0.0.248/add-error-discrimination-config/migration.js
|
|
973281
|
-
var
|
|
973344
|
+
var import_promises176 = require("fs/promises");
|
|
973282
973345
|
var import_yaml11 = __toESM(require_dist11(), 1);
|
|
973283
973346
|
|
|
973284
973347
|
// ../cli-migrations/lib/migrations/0.0.248/add-error-discrimination-config/getAllRootApiYamlFiles.js
|
|
@@ -973322,7 +973385,7 @@ var migration9 = {
|
|
|
973322
973385
|
}
|
|
973323
973386
|
};
|
|
973324
973387
|
async function migrateRootApiFile(filepath) {
|
|
973325
|
-
const contents = await (0,
|
|
973388
|
+
const contents = await (0, import_promises176.readFile)(filepath);
|
|
973326
973389
|
const parsedDocument = import_yaml11.default.parseDocument(contents.toString());
|
|
973327
973390
|
const errorDiscriminant = parsedDocument.get("error-discriminant", true);
|
|
973328
973391
|
if (errorDiscriminant == null || !import_yaml11.default.isScalar(errorDiscriminant) || typeof errorDiscriminant.value !== "string") {
|
|
@@ -973333,7 +973396,7 @@ async function migrateRootApiFile(filepath) {
|
|
|
973333
973396
|
"property-name": errorDiscriminant.value
|
|
973334
973397
|
});
|
|
973335
973398
|
parsedDocument.delete("error-discriminant");
|
|
973336
|
-
await (0,
|
|
973399
|
+
await (0, import_promises176.writeFile)(filepath, parsedDocument.toString());
|
|
973337
973400
|
}
|
|
973338
973401
|
|
|
973339
973402
|
// ../cli-migrations/lib/migrations/0.0.248/index.js
|
|
@@ -973344,7 +973407,7 @@ var versionMigrations9 = {
|
|
|
973344
973407
|
var __default9 = versionMigrations9;
|
|
973345
973408
|
|
|
973346
973409
|
// ../cli-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/migration.js
|
|
973347
|
-
var
|
|
973410
|
+
var import_promises177 = require("fs/promises");
|
|
973348
973411
|
var import_yaml12 = __toESM(require_dist11(), 1);
|
|
973349
973412
|
|
|
973350
973413
|
// ../cli-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/getAllYamlFiles.js
|
|
@@ -973388,7 +973451,7 @@ var migration10 = {
|
|
|
973388
973451
|
}
|
|
973389
973452
|
};
|
|
973390
973453
|
async function migrateYamlFile(filepath, context3) {
|
|
973391
|
-
const contents = await (0,
|
|
973454
|
+
const contents = await (0, import_promises177.readFile)(filepath);
|
|
973392
973455
|
const parsedDocument = import_yaml12.default.parseDocument(contents.toString());
|
|
973393
973456
|
const services = parsedDocument.get("services");
|
|
973394
973457
|
if (services == null) {
|
|
@@ -973428,7 +973491,7 @@ async function migrateYamlFile(filepath, context3) {
|
|
|
973428
973491
|
context3.failWithoutThrowing("Failed to convert endpoint", e2);
|
|
973429
973492
|
}
|
|
973430
973493
|
}
|
|
973431
|
-
await (0,
|
|
973494
|
+
await (0, import_promises177.writeFile)(filepath, parsedDocument.toString());
|
|
973432
973495
|
}
|
|
973433
973496
|
}
|
|
973434
973497
|
function convertEndpoint4({ document: document4, endpoint: endpoint3 }) {
|
|
@@ -973507,7 +973570,7 @@ var versionMigrations10 = {
|
|
|
973507
973570
|
var __default10 = versionMigrations10;
|
|
973508
973571
|
|
|
973509
973572
|
// ../cli-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/migration.js
|
|
973510
|
-
var
|
|
973573
|
+
var import_promises178 = require("fs/promises");
|
|
973511
973574
|
var import_yaml13 = __toESM(require_dist11(), 1);
|
|
973512
973575
|
|
|
973513
973576
|
// ../cli-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/getAllYamlFiles.js
|
|
@@ -973551,7 +973614,7 @@ var migration11 = {
|
|
|
973551
973614
|
}
|
|
973552
973615
|
};
|
|
973553
973616
|
async function migrateYamlFile2(filepath, context3) {
|
|
973554
|
-
const contents = await (0,
|
|
973617
|
+
const contents = await (0, import_promises178.readFile)(filepath);
|
|
973555
973618
|
const parsedDocument = import_yaml13.default.parseDocument(contents.toString());
|
|
973556
973619
|
const types4 = parsedDocument.get("types");
|
|
973557
973620
|
if (types4 == null) {
|
|
@@ -973577,7 +973640,7 @@ async function migrateYamlFile2(filepath, context3) {
|
|
|
973577
973640
|
examples.set(i5, { value: value2 });
|
|
973578
973641
|
}
|
|
973579
973642
|
}
|
|
973580
|
-
await (0,
|
|
973643
|
+
await (0, import_promises178.writeFile)(filepath, parsedDocument.toString());
|
|
973581
973644
|
}
|
|
973582
973645
|
|
|
973583
973646
|
// ../cli-migrations/lib/migrations/0.3.0-rc12/index.js
|
|
@@ -973588,7 +973651,7 @@ var versionMigrations11 = {
|
|
|
973588
973651
|
var __default11 = versionMigrations11;
|
|
973589
973652
|
|
|
973590
973653
|
// ../cli-migrations/lib/migrations/0.3.23/change-services-key-to-service/migration.js
|
|
973591
|
-
var
|
|
973654
|
+
var import_promises179 = require("fs/promises");
|
|
973592
973655
|
var import_yaml14 = __toESM(require_dist11(), 1);
|
|
973593
973656
|
|
|
973594
973657
|
// ../cli-migrations/lib/migrations/0.3.23/change-services-key-to-service/getAllYamlFiles.js
|
|
@@ -973632,7 +973695,7 @@ var migration12 = {
|
|
|
973632
973695
|
}
|
|
973633
973696
|
};
|
|
973634
973697
|
async function migrateYamlFile3(filepath, context3) {
|
|
973635
|
-
const contents = await (0,
|
|
973698
|
+
const contents = await (0, import_promises179.readFile)(filepath);
|
|
973636
973699
|
const parsedDocument = import_yaml14.default.parseDocument(contents.toString());
|
|
973637
973700
|
if (!import_yaml14.default.isMap(parsedDocument.contents)) {
|
|
973638
973701
|
return context3.failAndThrow("File is not a map");
|
|
@@ -973662,7 +973725,7 @@ async function migrateYamlFile3(filepath, context3) {
|
|
|
973662
973725
|
pair.value = firstService.value;
|
|
973663
973726
|
}
|
|
973664
973727
|
}
|
|
973665
|
-
await (0,
|
|
973728
|
+
await (0, import_promises179.writeFile)(filepath, parsedDocument.toString());
|
|
973666
973729
|
}
|
|
973667
973730
|
|
|
973668
973731
|
// ../cli-migrations/lib/migrations/0.3.23/index.js
|
|
@@ -973673,7 +973736,7 @@ var versionMigrations12 = {
|
|
|
973673
973736
|
var __default12 = versionMigrations12;
|
|
973674
973737
|
|
|
973675
973738
|
// ../cli-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/migration.js
|
|
973676
|
-
var
|
|
973739
|
+
var import_promises180 = require("fs/promises");
|
|
973677
973740
|
var import_yaml15 = __toESM(require_dist11(), 1);
|
|
973678
973741
|
|
|
973679
973742
|
// ../cli-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/getAllYamlFiles.js
|
|
@@ -973717,7 +973780,7 @@ var migration13 = {
|
|
|
973717
973780
|
}
|
|
973718
973781
|
};
|
|
973719
973782
|
async function migrateYamlFile4(filepath, context3) {
|
|
973720
|
-
const contents = await (0,
|
|
973783
|
+
const contents = await (0, import_promises180.readFile)(filepath);
|
|
973721
973784
|
const parsedDocument = import_yaml15.default.parseDocument(contents.toString());
|
|
973722
973785
|
if (!import_yaml15.default.isMap(parsedDocument.contents)) {
|
|
973723
973786
|
return context3.failAndThrow("File is not a map");
|
|
@@ -973736,7 +973799,7 @@ async function migrateYamlFile4(filepath, context3) {
|
|
|
973736
973799
|
}
|
|
973737
973800
|
service.items.splice(indexOfServiceDocsPair, 1);
|
|
973738
973801
|
parsedDocument.contents.items.unshift(docsPair);
|
|
973739
|
-
await (0,
|
|
973802
|
+
await (0, import_promises180.writeFile)(filepath, parsedDocument.toString());
|
|
973740
973803
|
}
|
|
973741
973804
|
|
|
973742
973805
|
// ../cli-migrations/lib/migrations/0.5.4/index.js
|
|
@@ -973747,7 +973810,7 @@ var versionMigrations13 = {
|
|
|
973747
973810
|
var __default13 = versionMigrations13;
|
|
973748
973811
|
|
|
973749
973812
|
// ../cli-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/migration.js
|
|
973750
|
-
var
|
|
973813
|
+
var import_promises181 = require("fs/promises");
|
|
973751
973814
|
|
|
973752
973815
|
// ../cli-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/getAllGeneratorYamlFiles.js
|
|
973753
973816
|
init_lib8();
|
|
@@ -973790,14 +973853,14 @@ var migration14 = {
|
|
|
973790
973853
|
}
|
|
973791
973854
|
};
|
|
973792
973855
|
async function migrateYamlFile5(filepath) {
|
|
973793
|
-
const contents = await (0,
|
|
973856
|
+
const contents = await (0, import_promises181.readFile)(filepath);
|
|
973794
973857
|
const domainSuffix = process.env.DOMAIN_SUFFIX ?? "docs.buildwithfern.com";
|
|
973795
973858
|
const regex6 = /(docs:\s*domain:\s*)"([^"]*)"/g;
|
|
973796
973859
|
const updatedSnapshot = contents.toString().replace(regex6, (_match, _prefix, domain3) => {
|
|
973797
973860
|
return `docs:
|
|
973798
973861
|
domain: "${domain3}.${domainSuffix}"`;
|
|
973799
973862
|
});
|
|
973800
|
-
await (0,
|
|
973863
|
+
await (0, import_promises181.writeFile)(filepath, updatedSnapshot.toString());
|
|
973801
973864
|
}
|
|
973802
973865
|
|
|
973803
973866
|
// ../cli-migrations/lib/migrations/0.9.10/index.js
|
|
@@ -973818,11 +973881,11 @@ var LegacyDocsSerializers = __toESM(require_serialization4(), 1);
|
|
|
973818
973881
|
|
|
973819
973882
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/loadRawDocsConfiguration.js
|
|
973820
973883
|
init_lib8();
|
|
973821
|
-
var
|
|
973884
|
+
var import_promises182 = require("fs/promises");
|
|
973822
973885
|
init_js_yaml();
|
|
973823
973886
|
async function loadRawDocsConfiguration2({ absolutePathToWorkspace }) {
|
|
973824
973887
|
const filepath = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
973825
|
-
const contentsStr = await (0,
|
|
973888
|
+
const contentsStr = await (0, import_promises182.readFile)(filepath);
|
|
973826
973889
|
const contentsParsed = index_vite_proxy_tmp_default.load(contentsStr.toString());
|
|
973827
973890
|
const result = await LegacyDocsSerializers.DocsConfiguration.parse(contentsParsed);
|
|
973828
973891
|
if (result.ok) {
|
|
@@ -973841,7 +973904,7 @@ function getAbsolutePathToDocsFolder({ absolutePathToWorkspace }) {
|
|
|
973841
973904
|
|
|
973842
973905
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndMultipleAPIs.js
|
|
973843
973906
|
init_lib8();
|
|
973844
|
-
var
|
|
973907
|
+
var import_promises184 = require("fs/promises");
|
|
973845
973908
|
init_js_yaml();
|
|
973846
973909
|
|
|
973847
973910
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/convertLegacyDocsConfig.js
|
|
@@ -974050,11 +974113,11 @@ __export(legacy_exports, {
|
|
|
974050
974113
|
|
|
974051
974114
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/generators-configuration/loadRawGeneratorsConfiguration.js
|
|
974052
974115
|
init_lib8();
|
|
974053
|
-
var
|
|
974116
|
+
var import_promises183 = require("fs/promises");
|
|
974054
974117
|
init_js_yaml();
|
|
974055
974118
|
async function loadRawGeneratorsConfiguration2({ absolutePathToWorkspace }) {
|
|
974056
974119
|
const filepath = getAbsolutePathToGeneratorsConfiguration({ absolutePathToWorkspace });
|
|
974057
|
-
const contentsStr = await (0,
|
|
974120
|
+
const contentsStr = await (0, import_promises183.readFile)(filepath);
|
|
974058
974121
|
const contentsParsed = index_vite_proxy_tmp_default.load(contentsStr.toString());
|
|
974059
974122
|
const result = await legacy_exports.GeneratorsConfigurationSchema.safeParseAsync(contentsParsed);
|
|
974060
974123
|
if (result.success) {
|
|
@@ -974084,7 +974147,7 @@ function migrateDocsInstances(docsURLs) {
|
|
|
974084
974147
|
var APIS_DIRECTORY2 = "apis";
|
|
974085
974148
|
async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspaces, workspaceContainingDocs }) {
|
|
974086
974149
|
const absolutePathToApisDirectory = join8(absolutePathToFernDirectory, RelativeFilePath2.of(APIS_DIRECTORY2));
|
|
974087
|
-
await (0,
|
|
974150
|
+
await (0, import_promises184.mkdir)(absolutePathToApisDirectory);
|
|
974088
974151
|
for (const workspace of workspaces) {
|
|
974089
974152
|
const absolutePathToWorkspace = join8(absolutePathToFernDirectory, RelativeFilePath2.of(workspace));
|
|
974090
974153
|
const docsURLs = await migrateAndWriteGeneratorsYml({ absolutePathToWorkspace });
|
|
@@ -974092,11 +974155,11 @@ async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspa
|
|
|
974092
974155
|
await migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName: workspaceContainingDocs });
|
|
974093
974156
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
974094
974157
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
974095
|
-
await (0,
|
|
974158
|
+
await (0, import_promises184.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
974096
974159
|
}
|
|
974097
974160
|
const absolutePathToNestedWorkspace = join8(absolutePathToApisDirectory, RelativeFilePath2.of(workspace));
|
|
974098
974161
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
974099
|
-
await (0,
|
|
974162
|
+
await (0, import_promises184.rm)(absolutePathToWorkspace, { recursive: true });
|
|
974100
974163
|
}
|
|
974101
974164
|
}
|
|
974102
974165
|
async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
@@ -974109,7 +974172,7 @@ async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
|
974109
974172
|
generatorsConfiguration,
|
|
974110
974173
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
974111
974174
|
});
|
|
974112
|
-
await (0,
|
|
974175
|
+
await (0, import_promises184.writeFile)(absolutePathToGeneratorsConfiguration, index_vite_proxy_tmp_default.dump(convertedResponse.value));
|
|
974113
974176
|
return convertedResponse.docsURLs;
|
|
974114
974177
|
}
|
|
974115
974178
|
async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName }) {
|
|
@@ -974123,12 +974186,12 @@ async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiNa
|
|
|
974123
974186
|
apiName
|
|
974124
974187
|
});
|
|
974125
974188
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
974126
|
-
await (0,
|
|
974189
|
+
await (0, import_promises184.writeFile)(absolutePathToDocsConfig, index_vite_proxy_tmp_default.dump(convertedDocsConfig));
|
|
974127
974190
|
}
|
|
974128
974191
|
|
|
974129
974192
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndSingleAPI.js
|
|
974130
974193
|
init_lib8();
|
|
974131
|
-
var
|
|
974194
|
+
var import_promises185 = require("fs/promises");
|
|
974132
974195
|
init_js_yaml();
|
|
974133
974196
|
async function migrateDocsAndSingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
974134
974197
|
const docsURLs = await migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace });
|
|
@@ -974136,8 +974199,8 @@ async function migrateDocsAndSingleAPI({ absolutePathToFernDirectory, absolutePa
|
|
|
974136
974199
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
974137
974200
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
974138
974201
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
974139
|
-
await (0,
|
|
974140
|
-
await (0,
|
|
974202
|
+
await (0, import_promises185.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
974203
|
+
await (0, import_promises185.rm)(absolutePathToWorkspace, { recursive: true });
|
|
974141
974204
|
}
|
|
974142
974205
|
async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
974143
974206
|
const docsConfiguration = await loadRawDocsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -974150,7 +974213,7 @@ async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
|
974150
974213
|
apiName: void 0
|
|
974151
974214
|
});
|
|
974152
974215
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
974153
|
-
await (0,
|
|
974216
|
+
await (0, import_promises185.writeFile)(absolutePathToDocsConfig, index_vite_proxy_tmp_default.dump(convertedDocsConfig));
|
|
974154
974217
|
}
|
|
974155
974218
|
async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
974156
974219
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -974162,24 +974225,24 @@ async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
|
974162
974225
|
generatorsConfiguration,
|
|
974163
974226
|
pathModificationStrategy: "MoveUp"
|
|
974164
974227
|
});
|
|
974165
|
-
await (0,
|
|
974228
|
+
await (0, import_promises185.writeFile)(absolutePathToGeneratorsConfiguration, index_vite_proxy_tmp_default.dump(convertedResponse.value));
|
|
974166
974229
|
return convertedResponse.docsURLs;
|
|
974167
974230
|
}
|
|
974168
974231
|
|
|
974169
974232
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlyMultipleAPIs.js
|
|
974170
974233
|
init_lib8();
|
|
974171
|
-
var
|
|
974234
|
+
var import_promises186 = require("fs/promises");
|
|
974172
974235
|
init_js_yaml();
|
|
974173
974236
|
var APIS_DIRECTORY3 = "apis";
|
|
974174
974237
|
async function migrateOnlyMultipleAPIs({ absolutePathToFernDirectory, workspaces }) {
|
|
974175
974238
|
const absolutePathToApisDirectory = join8(absolutePathToFernDirectory, RelativeFilePath2.of(APIS_DIRECTORY3));
|
|
974176
|
-
await (0,
|
|
974239
|
+
await (0, import_promises186.mkdir)(absolutePathToApisDirectory);
|
|
974177
974240
|
for (const workspace of workspaces) {
|
|
974178
974241
|
const absolutePathToWorkspace = join8(absolutePathToFernDirectory, RelativeFilePath2.of(workspace));
|
|
974179
974242
|
await migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace });
|
|
974180
974243
|
const absolutePathToNestedWorkspace = join8(absolutePathToApisDirectory, RelativeFilePath2.of(workspace));
|
|
974181
974244
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
974182
|
-
await (0,
|
|
974245
|
+
await (0, import_promises186.rm)(absolutePathToWorkspace, { recursive: true });
|
|
974183
974246
|
}
|
|
974184
974247
|
}
|
|
974185
974248
|
async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
@@ -974192,17 +974255,17 @@ async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
|
974192
974255
|
generatorsConfiguration,
|
|
974193
974256
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
974194
974257
|
});
|
|
974195
|
-
await (0,
|
|
974258
|
+
await (0, import_promises186.writeFile)(absolutePathToGeneratorsConfiguration, index_vite_proxy_tmp_default.dump(convertedResponse.value));
|
|
974196
974259
|
}
|
|
974197
974260
|
|
|
974198
974261
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlySingleAPI.js
|
|
974199
974262
|
init_lib8();
|
|
974200
|
-
var
|
|
974263
|
+
var import_promises187 = require("fs/promises");
|
|
974201
974264
|
init_js_yaml();
|
|
974202
974265
|
async function migrateOnlySingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
974203
974266
|
await migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace });
|
|
974204
974267
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
974205
|
-
await (0,
|
|
974268
|
+
await (0, import_promises187.rm)(absolutePathToWorkspace, { recursive: true });
|
|
974206
974269
|
}
|
|
974207
974270
|
async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
974208
974271
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -974214,7 +974277,7 @@ async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
|
974214
974277
|
generatorsConfiguration,
|
|
974215
974278
|
pathModificationStrategy: "MoveUp"
|
|
974216
974279
|
});
|
|
974217
|
-
await (0,
|
|
974280
|
+
await (0, import_promises187.writeFile)(absolutePathToGeneratorsConfiguration, index_vite_proxy_tmp_default.dump(convertedResponse.value));
|
|
974218
974281
|
}
|
|
974219
974282
|
|
|
974220
974283
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migration.js
|
|
@@ -974294,7 +974357,7 @@ var __default15 = versionMigrations15;
|
|
|
974294
974357
|
init_lib19();
|
|
974295
974358
|
init_lib8();
|
|
974296
974359
|
init_source();
|
|
974297
|
-
var
|
|
974360
|
+
var import_promises188 = require("fs/promises");
|
|
974298
974361
|
init_js_yaml();
|
|
974299
974362
|
var import_yaml16 = __toESM(require_dist11(), 1);
|
|
974300
974363
|
var migration16 = {
|
|
@@ -974338,7 +974401,7 @@ async function addApiConfigurationToSingleWorkspace({ absolutePathToFernDirector
|
|
|
974338
974401
|
if (existingGeneratorsYml == null) {
|
|
974339
974402
|
if (openapiDirectory != null && openapiDirectory.contents[0] != null) {
|
|
974340
974403
|
const absolutePathToGeneratorsYml = join8(absoluteFilepathToWorkspace, RelativeFilePath2.of("generators.yml"));
|
|
974341
|
-
await (0,
|
|
974404
|
+
await (0, import_promises188.writeFile)(absolutePathToGeneratorsYml, index_vite_proxy_tmp_default.dump({
|
|
974342
974405
|
api: {
|
|
974343
974406
|
path: join8(relativize(absolutePathToFernDirectory, absoluteFilepathToWorkspace), RelativeFilePath2.of(openapiDirectory.name), RelativeFilePath2.of(openapiDirectory.contents[0]?.name))
|
|
974344
974407
|
}
|
|
@@ -974353,7 +974416,7 @@ async function addApiConfigurationToSingleWorkspace({ absolutePathToFernDirector
|
|
|
974353
974416
|
parsedDocument.set("api", {
|
|
974354
974417
|
path: join8(relativize(absolutePathToFernDirectory, absoluteFilepathToWorkspace), RelativeFilePath2.of(openapiDirectory.name), RelativeFilePath2.of(openapiDirectory.contents[0]?.name))
|
|
974355
974418
|
});
|
|
974356
|
-
await (0,
|
|
974419
|
+
await (0, import_promises188.writeFile)(existingGeneratorsYml.absolutePath, parsedDocument.toString());
|
|
974357
974420
|
context3.logger.info(source_default.green(`Updated ${existingGeneratorsYml.absolutePath}`));
|
|
974358
974421
|
}
|
|
974359
974422
|
}
|
|
@@ -974383,7 +974446,7 @@ var __default16 = versionMigrations16;
|
|
|
974383
974446
|
init_lib19();
|
|
974384
974447
|
init_lib8();
|
|
974385
974448
|
init_source();
|
|
974386
|
-
var
|
|
974449
|
+
var import_promises189 = require("fs/promises");
|
|
974387
974450
|
init_js_yaml();
|
|
974388
974451
|
var import_yaml17 = __toESM(require_dist11(), 1);
|
|
974389
974452
|
var migration17 = {
|
|
@@ -974564,7 +974627,7 @@ async function addApiConfigurationToSingleWorkspace2({ absoluteFilepathToWorkspa
|
|
|
974564
974627
|
if (schemaComment && documentToWrite.indexOf(schemaComment) === -1) {
|
|
974565
974628
|
documentToWrite = `${schemaComment}${documentToWrite}`;
|
|
974566
974629
|
}
|
|
974567
|
-
await (0,
|
|
974630
|
+
await (0, import_promises189.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
974568
974631
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
974569
974632
|
}
|
|
974570
974633
|
async function parseApiSpec({ oldSpec, absoluteFilepathToWorkspace, files, directories, context: context3, namespace }) {
|
|
@@ -974611,7 +974674,7 @@ async function parseApiSpec({ oldSpec, absoluteFilepathToWorkspace, files, direc
|
|
|
974611
974674
|
}
|
|
974612
974675
|
let specContent;
|
|
974613
974676
|
try {
|
|
974614
|
-
const fileContents = await (0,
|
|
974677
|
+
const fileContents = await (0, import_promises189.readFile)(absoluteSpecPath, { encoding: "utf-8" });
|
|
974615
974678
|
specContent = index_vite_proxy_tmp_default.load(fileContents);
|
|
974616
974679
|
} catch (e2) {
|
|
974617
974680
|
context3.logger.warn(`Failed to read API spec file ${spec.path}. Error: ${e2}. Skipping...`);
|
|
@@ -974717,7 +974780,7 @@ var __default17 = versionMigrations17;
|
|
|
974717
974780
|
init_lib19();
|
|
974718
974781
|
init_lib8();
|
|
974719
974782
|
init_source();
|
|
974720
|
-
var
|
|
974783
|
+
var import_promises190 = require("fs/promises");
|
|
974721
974784
|
init_js_yaml();
|
|
974722
974785
|
var migration18 = {
|
|
974723
974786
|
name: "add-path-parameter-order-setting",
|
|
@@ -974806,7 +974869,7 @@ async function updateGeneratorsYml({ context: context3, files }) {
|
|
|
974806
974869
|
documentToWrite = `${schemaComment}
|
|
974807
974870
|
${documentToWrite}`;
|
|
974808
974871
|
}
|
|
974809
|
-
await (0,
|
|
974872
|
+
await (0, import_promises190.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
974810
974873
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
974811
974874
|
}
|
|
974812
974875
|
async function getFilesAndDirectories3(absoluteFilepath) {
|
|
@@ -974845,7 +974908,7 @@ var __default18 = versionMigrations18;
|
|
|
974845
974908
|
init_lib19();
|
|
974846
974909
|
init_lib8();
|
|
974847
974910
|
init_source();
|
|
974848
|
-
var
|
|
974911
|
+
var import_promises191 = require("fs/promises");
|
|
974849
974912
|
init_js_yaml();
|
|
974850
974913
|
var migration19 = {
|
|
974851
974914
|
name: "update-1_0_0-defaults",
|
|
@@ -975021,7 +975084,7 @@ async function updateGeneratorsYml2({ context: context3, files }) {
|
|
|
975021
975084
|
documentToWrite = `${schemaComment}
|
|
975022
975085
|
${documentToWrite}`;
|
|
975023
975086
|
}
|
|
975024
|
-
await (0,
|
|
975087
|
+
await (0, import_promises191.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
975025
975088
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
975026
975089
|
}
|
|
975027
975090
|
async function getFilesAndDirectories4(absoluteFilepath) {
|
|
@@ -975093,7 +975156,7 @@ var __default19 = versionMigrations19;
|
|
|
975093
975156
|
init_lib19();
|
|
975094
975157
|
init_lib8();
|
|
975095
975158
|
init_source();
|
|
975096
|
-
var
|
|
975159
|
+
var import_promises192 = require("fs/promises");
|
|
975097
975160
|
init_js_yaml();
|
|
975098
975161
|
var migration20 = {
|
|
975099
975162
|
name: "update-2_0_0-defaults",
|
|
@@ -975269,7 +975332,7 @@ async function updateGeneratorsYml3({ context: context3, files }) {
|
|
|
975269
975332
|
documentToWrite = `${schemaComment}
|
|
975270
975333
|
${documentToWrite}`;
|
|
975271
975334
|
}
|
|
975272
|
-
await (0,
|
|
975335
|
+
await (0, import_promises192.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
975273
975336
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
975274
975337
|
}
|
|
975275
975338
|
async function getFilesAndDirectories5(absoluteFilepath) {
|
|
@@ -975318,7 +975381,7 @@ var __default20 = versionMigrations20;
|
|
|
975318
975381
|
init_lib19();
|
|
975319
975382
|
init_lib8();
|
|
975320
975383
|
init_source();
|
|
975321
|
-
var
|
|
975384
|
+
var import_promises193 = require("fs/promises");
|
|
975322
975385
|
init_js_yaml();
|
|
975323
975386
|
var migration21 = {
|
|
975324
975387
|
name: "migrate-deprecated-generator-api-settings",
|
|
@@ -975410,7 +975473,7 @@ async function updateGeneratorsYml4({ context: context3, files }) {
|
|
|
975410
975473
|
documentToWrite = `${schemaComment}
|
|
975411
975474
|
${documentToWrite}`;
|
|
975412
975475
|
}
|
|
975413
|
-
await (0,
|
|
975476
|
+
await (0, import_promises193.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
975414
975477
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
975415
975478
|
}
|
|
975416
975479
|
function migrateDeprecatedSettings(settings, context3) {
|
|
@@ -975459,7 +975522,7 @@ var __default21 = versionMigrations21;
|
|
|
975459
975522
|
init_lib19();
|
|
975460
975523
|
init_lib8();
|
|
975461
975524
|
init_source();
|
|
975462
|
-
var
|
|
975525
|
+
var import_promises194 = require("fs/promises");
|
|
975463
975526
|
init_js_yaml();
|
|
975464
975527
|
var migration22 = {
|
|
975465
975528
|
name: "enable-smart-casing",
|
|
@@ -975544,7 +975607,7 @@ async function updateGeneratorsYml5({ context: context3, files }) {
|
|
|
975544
975607
|
documentToWrite = `${schemaComment}
|
|
975545
975608
|
${documentToWrite}`;
|
|
975546
975609
|
}
|
|
975547
|
-
await (0,
|
|
975610
|
+
await (0, import_promises194.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
975548
975611
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
975549
975612
|
}
|
|
975550
975613
|
function setSmartCasingFalseIfNotConfigured(generator, context3) {
|
|
@@ -975584,7 +975647,7 @@ var __default22 = versionMigrations22;
|
|
|
975584
975647
|
init_lib19();
|
|
975585
975648
|
init_lib8();
|
|
975586
975649
|
init_source();
|
|
975587
|
-
var
|
|
975650
|
+
var import_promises195 = require("fs/promises");
|
|
975588
975651
|
init_js_yaml();
|
|
975589
975652
|
var migration23 = {
|
|
975590
975653
|
name: "disable-disambiguate-request-names",
|
|
@@ -975709,7 +975772,7 @@ async function updateGeneratorsYml6({ context: context3, files }) {
|
|
|
975709
975772
|
documentToWrite = `${schemaComment}
|
|
975710
975773
|
${documentToWrite}`;
|
|
975711
975774
|
}
|
|
975712
|
-
await (0,
|
|
975775
|
+
await (0, import_promises195.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
975713
975776
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
975714
975777
|
}
|
|
975715
975778
|
async function getFilesAndDirectories8(absoluteFilepath) {
|
|
@@ -975844,7 +975907,7 @@ init_lib33();
|
|
|
975844
975907
|
init_lib27();
|
|
975845
975908
|
init_lib6();
|
|
975846
975909
|
init_source();
|
|
975847
|
-
var
|
|
975910
|
+
var import_promises196 = require("fs/promises");
|
|
975848
975911
|
|
|
975849
975912
|
// ../../../node_modules/.pnpm/immer@10.2.0/node_modules/immer/dist/immer.mjs
|
|
975850
975913
|
var NOTHING = /* @__PURE__ */ Symbol.for("immer-nothing");
|
|
@@ -976900,7 +976963,7 @@ async function upgrade({
|
|
|
976900
976963
|
const newProjectConfig = produce(projectConfig2.rawConfig, (draft) => {
|
|
976901
976964
|
draft.version = resolvedTargetVersion;
|
|
976902
976965
|
});
|
|
976903
|
-
await (0,
|
|
976966
|
+
await (0, import_promises196.writeFile)(
|
|
976904
976967
|
projectConfig2._absolutePath,
|
|
976905
976968
|
ensureFinalNewline(JSON.stringify(newProjectConfig, void 0, 2))
|
|
976906
976969
|
);
|
|
@@ -977057,7 +977120,7 @@ async function upgradeGeneratorsForAllWorkspaces({
|
|
|
977057
977120
|
absolutePathToWorkspace: workspace.absoluteFilePath
|
|
977058
977121
|
});
|
|
977059
977122
|
if (absolutePathToGeneratorsConfiguration != null && result.updatedConfiguration != null) {
|
|
977060
|
-
await (0,
|
|
977123
|
+
await (0, import_promises197.writeFile)(absolutePathToGeneratorsConfiguration, result.updatedConfiguration);
|
|
977061
977124
|
}
|
|
977062
977125
|
for (const upgrade2 of result.appliedUpgrades) {
|
|
977063
977126
|
const normalizedName = addDefaultDockerOrgIfNotPresent(upgrade2.generatorName);
|
|
@@ -977535,7 +977598,7 @@ async function previewDocsWorkspace({
|
|
|
977535
977598
|
// src/commands/docs-diff/docsDiff.ts
|
|
977536
977599
|
init_lib8();
|
|
977537
977600
|
init_lib6();
|
|
977538
|
-
var
|
|
977601
|
+
var import_promises198 = require("fs/promises");
|
|
977539
977602
|
var import_pngjs2 = __toESM(require_png(), 1);
|
|
977540
977603
|
async function getSlugForFiles2({
|
|
977541
977604
|
previewUrl,
|
|
@@ -977758,8 +977821,8 @@ async function generateComparisons2({
|
|
|
977758
977821
|
afterPath,
|
|
977759
977822
|
comparisonBasePath
|
|
977760
977823
|
}) {
|
|
977761
|
-
const beforePng = import_pngjs2.PNG.sync.read(await (0,
|
|
977762
|
-
const afterPng = import_pngjs2.PNG.sync.read(await (0,
|
|
977824
|
+
const beforePng = import_pngjs2.PNG.sync.read(await (0, import_promises198.readFile)(beforePath));
|
|
977825
|
+
const afterPng = import_pngjs2.PNG.sync.read(await (0, import_promises198.readFile)(afterPath));
|
|
977763
977826
|
const beforeOriginalHeight = beforePng.height;
|
|
977764
977827
|
const afterOriginalHeight = afterPng.height;
|
|
977765
977828
|
const width = Math.max(beforePng.width, afterPng.width);
|
|
@@ -977797,7 +977860,7 @@ async function generateComparisons2({
|
|
|
977797
977860
|
const sideBySide = createSideBySideComparison2(croppedBefore, croppedAfter, 20, true);
|
|
977798
977861
|
const outPath = `${base4}-region-${i5 + 1}.png`;
|
|
977799
977862
|
const pngBuffer = import_pngjs2.PNG.sync.write(sideBySide);
|
|
977800
|
-
await (0,
|
|
977863
|
+
await (0, import_promises198.writeFile)(outPath, new Uint8Array(pngBuffer));
|
|
977801
977864
|
results.push({ changePercent, boundingBox, comparisonPath: outPath });
|
|
977802
977865
|
}
|
|
977803
977866
|
return results;
|
|
@@ -977876,7 +977939,7 @@ async function docsDiff({
|
|
|
977876
977939
|
outputDir.startsWith("/") ? outputDir : join8(cwd(), RelativeFilePath2.of(outputDir))
|
|
977877
977940
|
);
|
|
977878
977941
|
if (!await doesPathExist(outputPath)) {
|
|
977879
|
-
await (0,
|
|
977942
|
+
await (0, import_promises198.mkdir)(outputPath, { recursive: true });
|
|
977880
977943
|
}
|
|
977881
977944
|
const results = [];
|
|
977882
977945
|
await cliContext.runTask(async (context3) => {
|
|
@@ -978304,7 +978367,7 @@ init_lib6();
|
|
|
978304
978367
|
// src/commands/docs-theme/ThemeExporter.ts
|
|
978305
978368
|
init_lib12();
|
|
978306
978369
|
init_lib8();
|
|
978307
|
-
var
|
|
978370
|
+
var import_promises199 = require("fs/promises");
|
|
978308
978371
|
init_js_yaml();
|
|
978309
978372
|
var import_path109 = __toESM(require("path"), 1);
|
|
978310
978373
|
var ThemeExporter = class {
|
|
@@ -978317,18 +978380,18 @@ var ThemeExporter = class {
|
|
|
978317
978380
|
const docsDir = import_path109.default.dirname(docsYmlPath);
|
|
978318
978381
|
const outDir = output2 != null ? import_path109.default.resolve(process.cwd(), output2) : import_path109.default.join(this.docsWorkspace.absoluteFilePath, "theme");
|
|
978319
978382
|
context3.logger.info(`Exporting theme-eligible fields from docs.yml \u2192 ${outDir}`);
|
|
978320
|
-
const raw = index_vite_proxy_tmp_default.load(await (0,
|
|
978383
|
+
const raw = index_vite_proxy_tmp_default.load(await (0, import_promises199.readFile)(docsYmlPath, "utf-8"));
|
|
978321
978384
|
const themeConfig = {};
|
|
978322
978385
|
for (const [k4, v3] of Object.entries(raw)) {
|
|
978323
978386
|
if (docs_yml_exports.THEME_ELIGIBLE_YAML_KEYS.has(k4)) {
|
|
978324
978387
|
themeConfig[k4] = v3;
|
|
978325
978388
|
}
|
|
978326
978389
|
}
|
|
978327
|
-
await (0,
|
|
978390
|
+
await (0, import_promises199.mkdir)(outDir, { recursive: true });
|
|
978328
978391
|
const assetsDir = import_path109.default.join(outDir, "assets");
|
|
978329
|
-
await (0,
|
|
978392
|
+
await (0, import_promises199.mkdir)(assetsDir, { recursive: true });
|
|
978330
978393
|
const exported = await copyLocalFiles(themeConfig, docsDir, assetsDir);
|
|
978331
|
-
await (0,
|
|
978394
|
+
await (0, import_promises199.writeFile)(import_path109.default.join(outDir, "theme.yml"), index_vite_proxy_tmp_default.dump(exported), "utf-8");
|
|
978332
978395
|
context3.logger.info(`Theme exported to ${outDir}/theme.yml`);
|
|
978333
978396
|
}
|
|
978334
978397
|
};
|
|
@@ -978342,8 +978405,8 @@ async function copyLocalFiles(obj, sourceDir, assetsDir) {
|
|
|
978342
978405
|
const destRelative = relFromSource.startsWith("..") ? relFromProject.startsWith("..") ? import_path109.default.basename(abs) : relFromProject : relFromSource;
|
|
978343
978406
|
const dest = import_path109.default.join(assetsDir, destRelative);
|
|
978344
978407
|
try {
|
|
978345
|
-
await (0,
|
|
978346
|
-
await (0,
|
|
978408
|
+
await (0, import_promises199.mkdir)(import_path109.default.dirname(dest), { recursive: true });
|
|
978409
|
+
await (0, import_promises199.copyFile)(abs, dest);
|
|
978347
978410
|
return `./assets/${destRelative.split(import_path109.default.sep).join("/")}`;
|
|
978348
978411
|
} catch {
|
|
978349
978412
|
return obj;
|
|
@@ -978435,7 +978498,7 @@ async function listDocsThemes({
|
|
|
978435
978498
|
|
|
978436
978499
|
// src/commands/docs-theme/uploadDocsTheme.ts
|
|
978437
978500
|
init_lib6();
|
|
978438
|
-
var
|
|
978501
|
+
var import_promises201 = require("fs/promises");
|
|
978439
978502
|
init_js_yaml();
|
|
978440
978503
|
var import_path111 = __toESM(require("path"), 1);
|
|
978441
978504
|
|
|
@@ -978444,7 +978507,7 @@ init_lib8();
|
|
|
978444
978507
|
init_lib6();
|
|
978445
978508
|
var import_child_process13 = require("child_process");
|
|
978446
978509
|
var import_crypto10 = require("crypto");
|
|
978447
|
-
var
|
|
978510
|
+
var import_promises200 = require("fs/promises");
|
|
978448
978511
|
var import_mime_types2 = __toESM(require_mime_types(), 1);
|
|
978449
978512
|
var import_path110 = __toESM(require("path"), 1);
|
|
978450
978513
|
function getGitRoot() {
|
|
@@ -978488,7 +978551,7 @@ var ThemeConfigProcessor = class {
|
|
|
978488
978551
|
filePaths.map(async (filePath) => {
|
|
978489
978552
|
const abs = import_path110.default.resolve(this.themeDir, filePath);
|
|
978490
978553
|
try {
|
|
978491
|
-
await (0,
|
|
978554
|
+
await (0, import_promises200.access)(abs);
|
|
978492
978555
|
} catch {
|
|
978493
978556
|
errors4.push(`Referenced file not found: ${abs}`);
|
|
978494
978557
|
}
|
|
@@ -978653,7 +978716,7 @@ ${errors4.map((e2) => ` - ${e2}`).join("\n")}`,
|
|
|
978653
978716
|
return { config: cfg, filesUploaded };
|
|
978654
978717
|
}
|
|
978655
978718
|
async uploadFileToCas(absolutePath) {
|
|
978656
|
-
const content5 = await (0,
|
|
978719
|
+
const content5 = await (0, import_promises200.readFile)(absolutePath);
|
|
978657
978720
|
const contentType = import_mime_types2.default.lookup(absolutePath) || "application/octet-stream";
|
|
978658
978721
|
const bindPath = posixBindPath(this.gitRoot, absolutePath);
|
|
978659
978722
|
return this.uploadToCas(content5, contentType, bindPath, import_path110.default.basename(absolutePath));
|
|
@@ -978768,7 +978831,7 @@ async function uploadDocsTheme({
|
|
|
978768
978831
|
await cliContext.runTask(async (context3) => {
|
|
978769
978832
|
let rawYaml;
|
|
978770
978833
|
try {
|
|
978771
|
-
const content5 = await (0,
|
|
978834
|
+
const content5 = await (0, import_promises201.readFile)(themeYmlPath, "utf-8");
|
|
978772
978835
|
rawYaml = index_vite_proxy_tmp_default.load(content5, { schema: index_vite_proxy_tmp_default.JSON_SCHEMA });
|
|
978773
978836
|
} catch {
|
|
978774
978837
|
context3.failAndThrow(
|
|
@@ -978823,7 +978886,7 @@ async function uploadDocsTheme({
|
|
|
978823
978886
|
// src/commands/downgrade/downgrade.ts
|
|
978824
978887
|
init_lib19();
|
|
978825
978888
|
init_lib6();
|
|
978826
|
-
var
|
|
978889
|
+
var import_promises202 = require("fs/promises");
|
|
978827
978890
|
function ensureFinalNewline2(content5) {
|
|
978828
978891
|
return content5.endsWith("\n") ? content5 : content5 + "\n";
|
|
978829
978892
|
}
|
|
@@ -978848,7 +978911,7 @@ async function downgrade({
|
|
|
978848
978911
|
const newProjectConfig = produce(projectConfig.rawConfig, (draft) => {
|
|
978849
978912
|
draft.version = targetVersion;
|
|
978850
978913
|
});
|
|
978851
|
-
await (0,
|
|
978914
|
+
await (0, import_promises202.writeFile)(projectConfig._absolutePath, ensureFinalNewline2(JSON.stringify(newProjectConfig, void 0, 2)));
|
|
978852
978915
|
cliContext.logger.info(`Updated ${PROJECT_CONFIG_FILENAME} to version ${targetVersion}`);
|
|
978853
978916
|
}
|
|
978854
978917
|
|
|
@@ -978856,7 +978919,7 @@ async function downgrade({
|
|
|
978856
978919
|
init_lib36();
|
|
978857
978920
|
init_lib8();
|
|
978858
978921
|
init_lib22();
|
|
978859
|
-
var
|
|
978922
|
+
var import_promises203 = require("fs/promises");
|
|
978860
978923
|
init_js_yaml();
|
|
978861
978924
|
|
|
978862
978925
|
// src/commands/export/convertIrToOpenApi.ts
|
|
@@ -980278,8 +980341,8 @@ async function generateOpenAPIForWorkspaces({
|
|
|
980278
980341
|
ir: ir3,
|
|
980279
980342
|
mode: "openapi"
|
|
980280
980343
|
});
|
|
980281
|
-
await (0,
|
|
980282
|
-
await (0,
|
|
980344
|
+
await (0, import_promises203.mkdir)(dirname6(outputPath), { recursive: true });
|
|
980345
|
+
await (0, import_promises203.writeFile)(
|
|
980283
980346
|
outputPath,
|
|
980284
980347
|
outputPath.endsWith(".json") ? JSON.stringify(openapi, void 0, indent4) : index_vite_proxy_tmp_default.dump(openapi, { indent: indent4 })
|
|
980285
980348
|
);
|
|
@@ -980885,7 +980948,7 @@ async function generateOpenAPIIrForWorkspaces({
|
|
|
980885
980948
|
// src/commands/generate-overrides/compareOpenAPISpecs.ts
|
|
980886
980949
|
init_lib8();
|
|
980887
980950
|
init_lib6();
|
|
980888
|
-
var
|
|
980951
|
+
var import_promises204 = require("fs/promises");
|
|
980889
980952
|
init_js_yaml();
|
|
980890
980953
|
async function compareOpenAPISpecs({
|
|
980891
980954
|
originalPath,
|
|
@@ -980927,12 +980990,12 @@ async function compareOpenAPISpecs({
|
|
|
980927
980990
|
}
|
|
980928
980991
|
outputPath = join8(dirname6(originalPath), RelativeFilePath2.of(overridesFilename));
|
|
980929
980992
|
}
|
|
980930
|
-
await (0,
|
|
980993
|
+
await (0, import_promises204.writeFile)(outputPath, index_vite_proxy_tmp_default.dump(overrides, { lineWidth: -1, noRefs: true }));
|
|
980931
980994
|
context3.logger.info(`Overrides written to ${outputPath}`);
|
|
980932
980995
|
});
|
|
980933
980996
|
}
|
|
980934
980997
|
async function loadSpec2(filepath, context3) {
|
|
980935
|
-
const contents = await (0,
|
|
980998
|
+
const contents = await (0, import_promises204.readFile)(filepath, "utf8");
|
|
980936
980999
|
try {
|
|
980937
981000
|
return JSON.parse(contents);
|
|
980938
981001
|
} catch {
|
|
@@ -981040,7 +981103,7 @@ init_lib35();
|
|
|
981040
981103
|
init_lib16();
|
|
981041
981104
|
init_lib15();
|
|
981042
981105
|
init_lib6();
|
|
981043
|
-
var
|
|
981106
|
+
var import_promises205 = require("fs/promises");
|
|
981044
981107
|
init_js_yaml();
|
|
981045
981108
|
async function writeOverridesForWorkspaces({
|
|
981046
981109
|
project,
|
|
@@ -981066,7 +981129,7 @@ async function writeOverridesForWorkspaces({
|
|
|
981066
981129
|
async function readExistingOverrides(overridesFilepath, context3) {
|
|
981067
981130
|
let parsedOverrides = null;
|
|
981068
981131
|
try {
|
|
981069
|
-
const contents = (await (0,
|
|
981132
|
+
const contents = (await (0, import_promises205.readFile)(overridesFilepath, "utf8")).toString();
|
|
981070
981133
|
try {
|
|
981071
981134
|
parsedOverrides = JSON.parse(contents);
|
|
981072
981135
|
} catch (err) {
|
|
@@ -981131,7 +981194,7 @@ async function writeDefinitionForOpenAPIWorkspace({
|
|
|
981131
981194
|
for (const overridesPath of overridesPaths) {
|
|
981132
981195
|
const existingOverrides = await readExistingOverrides(overridesPath, context3);
|
|
981133
981196
|
const content5 = generateOverridesContent({ ir: ir3, existingOverrides, includeModels, context: context3 });
|
|
981134
|
-
await (0,
|
|
981197
|
+
await (0, import_promises205.writeFile)(overridesPath, index_vite_proxy_tmp_default.dump(content5));
|
|
981135
981198
|
}
|
|
981136
981199
|
} else {
|
|
981137
981200
|
const content5 = generateOverridesContent({ ir: ir3, existingOverrides: {}, includeModels, context: context3 });
|
|
@@ -981145,7 +981208,7 @@ async function writeDefinitionForOpenAPIWorkspace({
|
|
|
981145
981208
|
overridesFilename = `${nameWithoutExt}-overrides${extension4}`;
|
|
981146
981209
|
}
|
|
981147
981210
|
}
|
|
981148
|
-
await (0,
|
|
981211
|
+
await (0, import_promises205.writeFile)(
|
|
981149
981212
|
join8(dirname6(spec.absoluteFilepath), RelativeFilePath2.of(overridesFilename)),
|
|
981150
981213
|
index_vite_proxy_tmp_default.dump(content5)
|
|
981151
981214
|
);
|
|
@@ -981604,7 +981667,7 @@ function convertIRtoJsonSchema(args) {
|
|
|
981604
981667
|
// src/commands/jsonschema/generateJsonschemaForWorkspace.ts
|
|
981605
981668
|
init_lib21();
|
|
981606
981669
|
init_source();
|
|
981607
|
-
var
|
|
981670
|
+
var import_promises206 = require("fs/promises");
|
|
981608
981671
|
async function generateJsonschemaForWorkspaces({
|
|
981609
981672
|
typeLocator,
|
|
981610
981673
|
project,
|
|
@@ -981652,9 +981715,9 @@ async function generateJsonschemaForWorkspaces({
|
|
|
981652
981715
|
context: context3
|
|
981653
981716
|
});
|
|
981654
981717
|
if (!await doesPathExist(dirname6(jsonschemaFilepath))) {
|
|
981655
|
-
await (0,
|
|
981718
|
+
await (0, import_promises206.mkdir)(dirname6(jsonschemaFilepath), { recursive: true });
|
|
981656
981719
|
}
|
|
981657
|
-
await (0,
|
|
981720
|
+
await (0, import_promises206.writeFile)(jsonschemaFilepath, JSON.stringify(jsonSchema, null, 2));
|
|
981658
981721
|
context3.logger.info(source_default.green(`Wrote JSON Schema to ${jsonschemaFilepath}`));
|
|
981659
981722
|
});
|
|
981660
981723
|
})
|
|
@@ -981664,7 +981727,7 @@ async function generateJsonschemaForWorkspaces({
|
|
|
981664
981727
|
// src/commands/merge/mergeOpenAPIWithOverrides.ts
|
|
981665
981728
|
init_lib8();
|
|
981666
981729
|
init_lib6();
|
|
981667
|
-
var
|
|
981730
|
+
var import_promises207 = require("fs/promises");
|
|
981668
981731
|
init_js_yaml();
|
|
981669
981732
|
var HTTP_METHODS4 = /* @__PURE__ */ new Set(["get", "put", "post", "delete", "options", "head", "patch", "trace"]);
|
|
981670
981733
|
async function mergeOpenAPIWithOverrides({
|
|
@@ -981693,11 +981756,11 @@ async function mergeOpenAPIWithOverrides({
|
|
|
981693
981756
|
if (split2) {
|
|
981694
981757
|
const examples = extractEnrichedExamples2(openapi, merged);
|
|
981695
981758
|
const output2 = isJson ? JSON.stringify(examples, null, 2) : index_vite_proxy_tmp_default.dump(examples, { lineWidth: -1, noRefs: true });
|
|
981696
|
-
await (0,
|
|
981759
|
+
await (0, import_promises207.writeFile)(outputPath, output2);
|
|
981697
981760
|
context3.logger.info(`Extracted enriched examples written to ${outputPath}`);
|
|
981698
981761
|
} else {
|
|
981699
981762
|
const output2 = isJson ? JSON.stringify(merged, null, 2) : index_vite_proxy_tmp_default.dump(merged, { lineWidth: -1, noRefs: true });
|
|
981700
|
-
await (0,
|
|
981763
|
+
await (0, import_promises207.writeFile)(outputPath, output2);
|
|
981701
981764
|
if (outputPath === openapiPath) {
|
|
981702
981765
|
context3.logger.info(`Enriched ${openapiPath} in-place`);
|
|
981703
981766
|
} else {
|
|
@@ -981707,7 +981770,7 @@ async function mergeOpenAPIWithOverrides({
|
|
|
981707
981770
|
});
|
|
981708
981771
|
}
|
|
981709
981772
|
async function loadYamlOrJson(filepath, context3) {
|
|
981710
|
-
const contents = await (0,
|
|
981773
|
+
const contents = await (0, import_promises207.readFile)(filepath, "utf8");
|
|
981711
981774
|
try {
|
|
981712
981775
|
return JSON.parse(contents);
|
|
981713
981776
|
} catch {
|
|
@@ -982502,7 +982565,7 @@ init_lib35();
|
|
|
982502
982565
|
init_lib6();
|
|
982503
982566
|
init_esm19();
|
|
982504
982567
|
init_axios2();
|
|
982505
|
-
var
|
|
982568
|
+
var import_promises208 = require("fs/promises");
|
|
982506
982569
|
var import_path117 = __toESM(require("path"), 1);
|
|
982507
982570
|
init_index_min2();
|
|
982508
982571
|
var import_tmp_promise20 = __toESM(require_tmp_promise(), 1);
|
|
@@ -982556,7 +982619,7 @@ async function registerWorkspacesV1({
|
|
|
982556
982619
|
context3.logger.debug(`Compressing definition at ${tmpDir.path}`);
|
|
982557
982620
|
await Kn({ file: tarPath, cwd: resolvedWorkspace.absoluteFilePath }, ["."]);
|
|
982558
982621
|
context3.logger.info("Uploading definition...");
|
|
982559
|
-
await axios_default.put(registerApiResponse.body.definitionS3UploadUrl, await (0,
|
|
982622
|
+
await axios_default.put(registerApiResponse.body.definitionS3UploadUrl, await (0, import_promises208.readFile)(tarPath));
|
|
982560
982623
|
context3.logger.info(
|
|
982561
982624
|
`Registered @${project.config.organization}/${resolvedWorkspace.definition.rootApiFile.contents.name}:${registerApiResponse.body.version}`
|
|
982562
982625
|
);
|
|
@@ -982613,7 +982676,7 @@ function getAIEnhancerConfig2() {
|
|
|
982613
982676
|
// src/commands/resolve-specs/resolveSpecsForWorkspaces.ts
|
|
982614
982677
|
init_lib8();
|
|
982615
982678
|
init_lib35();
|
|
982616
|
-
var
|
|
982679
|
+
var import_promises209 = require("fs/promises");
|
|
982617
982680
|
var import_path118 = __toESM(require("path"), 1);
|
|
982618
982681
|
async function resolveSpecsForWorkspaces({
|
|
982619
982682
|
project,
|
|
@@ -982633,14 +982696,14 @@ async function resolveSpecsForWorkspaces({
|
|
|
982633
982696
|
return;
|
|
982634
982697
|
}
|
|
982635
982698
|
const workspaceOutputDir = project.apiWorkspaces.length > 1 ? AbsoluteFilePath2.of(import_path118.default.join(outputDir, workspace.workspaceName ?? "api")) : outputDir;
|
|
982636
|
-
await (0,
|
|
982699
|
+
await (0, import_promises209.mkdir)(workspaceOutputDir, { recursive: true });
|
|
982637
982700
|
const manifest = await collectRawSpecs({
|
|
982638
982701
|
specs,
|
|
982639
982702
|
hostOutputDir: workspaceOutputDir,
|
|
982640
982703
|
containerBaseDir: ".",
|
|
982641
982704
|
context: context3
|
|
982642
982705
|
});
|
|
982643
|
-
await (0,
|
|
982706
|
+
await (0, import_promises209.writeFile)(
|
|
982644
982707
|
import_path118.default.join(workspaceOutputDir, SPECS_MANIFEST_FILENAME),
|
|
982645
982708
|
JSON.stringify(manifest, void 0, 4)
|
|
982646
982709
|
);
|
|
@@ -982850,7 +982913,7 @@ init_lib17();
|
|
|
982850
982913
|
init_lib19();
|
|
982851
982914
|
init_lib8();
|
|
982852
982915
|
init_lib6();
|
|
982853
|
-
var
|
|
982916
|
+
var import_promises210 = __toESM(require("fs/promises"), 1);
|
|
982854
982917
|
|
|
982855
982918
|
// src/commands/sdk-preview/computePreviewVersion.ts
|
|
982856
982919
|
var BASE_VERSION = "0.0.1";
|
|
@@ -982970,7 +983033,7 @@ async function sdkPreview({
|
|
|
982970
983033
|
const firstPath = pathOutputs[0];
|
|
982971
983034
|
const absolutePathToOutput = firstPath != null ? AbsoluteFilePath2.of(resolve6(cwd(), firstPath)) : void 0;
|
|
982972
983035
|
if (absolutePathToOutput != null) {
|
|
982973
|
-
await
|
|
983036
|
+
await import_promises210.default.mkdir(absolutePathToOutput, { recursive: true });
|
|
982974
983037
|
}
|
|
982975
983038
|
for (const workspace of project.apiWorkspaces) {
|
|
982976
983039
|
if (workspace.generatorsConfiguration == null) {
|
|
@@ -983160,7 +983223,7 @@ async function sdkPreview({
|
|
|
983160
983223
|
init_lib33();
|
|
983161
983224
|
init_lib6();
|
|
983162
983225
|
init_source();
|
|
983163
|
-
var
|
|
983226
|
+
var import_promises211 = require("fs/promises");
|
|
983164
983227
|
var import_path119 = require("path");
|
|
983165
983228
|
async function getPackageManagerBinDir(logger4, pm) {
|
|
983166
983229
|
let command3;
|
|
@@ -983206,7 +983269,7 @@ async function detectInstallationMethod(logger4) {
|
|
|
983206
983269
|
logger4.debug(`Found fern at: ${fernPath}`);
|
|
983207
983270
|
let resolvedPath;
|
|
983208
983271
|
try {
|
|
983209
|
-
resolvedPath = await (0,
|
|
983272
|
+
resolvedPath = await (0, import_promises211.realpath)(fernPath);
|
|
983210
983273
|
logger4.debug(`Resolved to: ${resolvedPath}`);
|
|
983211
983274
|
} catch (error50) {
|
|
983212
983275
|
logger4.debug(`Failed to resolve symlink: ${error50}`);
|
|
@@ -983520,22 +983583,22 @@ init_lib19();
|
|
|
983520
983583
|
init_lib8();
|
|
983521
983584
|
init_lib6();
|
|
983522
983585
|
var fs33 = __toESM(require("fs"), 1);
|
|
983523
|
-
var
|
|
983586
|
+
var import_promises212 = require("fs/promises");
|
|
983524
983587
|
init_graphql();
|
|
983525
983588
|
init_js_yaml();
|
|
983526
983589
|
var import_stream18 = require("stream");
|
|
983527
|
-
var
|
|
983590
|
+
var import_promises213 = require("stream/promises");
|
|
983528
983591
|
async function fetchAndWriteFile(url3, path119, logger4, indent4) {
|
|
983529
983592
|
const resp = await fetch(url3);
|
|
983530
983593
|
if (resp.ok && resp.body) {
|
|
983531
983594
|
logger4.debug("Origin successfully fetched, writing to file");
|
|
983532
983595
|
const fileStream = fs33.createWriteStream(path119);
|
|
983533
|
-
await (0,
|
|
983534
|
-
const fileContents = await (0,
|
|
983596
|
+
await (0, import_promises213.finished)(import_stream18.Readable.fromWeb(resp.body).pipe(fileStream));
|
|
983597
|
+
const fileContents = await (0, import_promises212.readFile)(path119, "utf8");
|
|
983535
983598
|
try {
|
|
983536
|
-
await (0,
|
|
983599
|
+
await (0, import_promises212.writeFile)(path119, JSON.stringify(JSON.parse(fileContents), void 0, indent4), "utf8");
|
|
983537
983600
|
} catch (e2) {
|
|
983538
|
-
await (0,
|
|
983601
|
+
await (0, import_promises212.writeFile)(path119, index_vite_proxy_tmp_default.dump(index_vite_proxy_tmp_default.load(fileContents), { indent: indent4 }), "utf8");
|
|
983539
983602
|
}
|
|
983540
983603
|
logger4.debug("File written successfully");
|
|
983541
983604
|
}
|
|
@@ -983691,14 +983754,14 @@ async function tryDirectJSONFetch(url3, logger4) {
|
|
|
983691
983754
|
async function fetchGraphQLSchemaWithAutoDetection(url3, path119, logger4) {
|
|
983692
983755
|
const postResult = await tryGraphQLIntrospection(url3, logger4);
|
|
983693
983756
|
if (postResult.success) {
|
|
983694
|
-
await (0,
|
|
983757
|
+
await (0, import_promises212.writeFile)(path119, postResult.result, "utf8");
|
|
983695
983758
|
logger4.info("Successfully fetched GraphQL schema using POST introspection");
|
|
983696
983759
|
return;
|
|
983697
983760
|
}
|
|
983698
983761
|
logger4.debug(`POST introspection failed: ${postResult.error}`);
|
|
983699
983762
|
const getResult = await tryDirectJSONFetch(url3, logger4);
|
|
983700
983763
|
if (getResult.success) {
|
|
983701
|
-
await (0,
|
|
983764
|
+
await (0, import_promises212.writeFile)(path119, getResult.result, "utf8");
|
|
983702
983765
|
logger4.info("Successfully fetched GraphQL schema using direct JSON fetch");
|
|
983703
983766
|
return;
|
|
983704
983767
|
}
|
|
@@ -984408,7 +984471,7 @@ async function validateWorkspaces({
|
|
|
984408
984471
|
init_lib19();
|
|
984409
984472
|
init_lib8();
|
|
984410
984473
|
init_source();
|
|
984411
|
-
var
|
|
984474
|
+
var import_promises214 = require("fs/promises");
|
|
984412
984475
|
init_js_yaml();
|
|
984413
984476
|
var import_path121 = __toESM(require("path"), 1);
|
|
984414
984477
|
async function writeDefinitionForWorkspaces({
|
|
@@ -984490,22 +984553,22 @@ async function writeFernDefinition({
|
|
|
984490
984553
|
return a3.localeCompare(b5);
|
|
984491
984554
|
};
|
|
984492
984555
|
if (await doesPathExist(absolutePathToOutputDirectory)) {
|
|
984493
|
-
await (0,
|
|
984556
|
+
await (0, import_promises214.rm)(absolutePathToOutputDirectory, { recursive: true });
|
|
984494
984557
|
}
|
|
984495
|
-
await (0,
|
|
984496
|
-
await (0,
|
|
984558
|
+
await (0, import_promises214.mkdir)(absolutePathToOutputDirectory, { recursive: true });
|
|
984559
|
+
await (0, import_promises214.writeFile)(
|
|
984497
984560
|
join8(absolutePathToOutputDirectory, RelativeFilePath2.of(ROOT_API_FILENAME)),
|
|
984498
984561
|
index_vite_proxy_tmp_default.dump(definition3.rootApiFile.contents, { sortKeys })
|
|
984499
984562
|
);
|
|
984500
984563
|
for (const [relativePath, packageMarker] of Object.entries(definition3.packageMarkers)) {
|
|
984501
984564
|
const absoluteFilepath = join8(absolutePathToOutputDirectory, RelativeFilePath2.of(relativePath));
|
|
984502
|
-
await (0,
|
|
984503
|
-
await (0,
|
|
984565
|
+
await (0, import_promises214.mkdir)(dirname6(absoluteFilepath), { recursive: true });
|
|
984566
|
+
await (0, import_promises214.writeFile)(absoluteFilepath, index_vite_proxy_tmp_default.dump(packageMarker.contents, { sortKeys }));
|
|
984504
984567
|
}
|
|
984505
984568
|
for (const [relativePath, definitionFile] of Object.entries(definition3.namedDefinitionFiles)) {
|
|
984506
984569
|
const absoluteFilepath = join8(absolutePathToOutputDirectory, RelativeFilePath2.of(relativePath));
|
|
984507
|
-
await (0,
|
|
984508
|
-
await (0,
|
|
984570
|
+
await (0, import_promises214.mkdir)(dirname6(absoluteFilepath), { recursive: true });
|
|
984571
|
+
await (0, import_promises214.writeFile)(absoluteFilepath, index_vite_proxy_tmp_default.dump(definitionFile.contents, { sortKeys }));
|
|
984509
984572
|
}
|
|
984510
984573
|
}
|
|
984511
984574
|
|
|
@@ -984513,7 +984576,7 @@ async function writeFernDefinition({
|
|
|
984513
984576
|
init_lib67();
|
|
984514
984577
|
init_lib8();
|
|
984515
984578
|
init_source();
|
|
984516
|
-
var
|
|
984579
|
+
var import_promises215 = require("fs/promises");
|
|
984517
984580
|
async function writeDocsDefinitionForProject({
|
|
984518
984581
|
project,
|
|
984519
984582
|
outputPath,
|
|
@@ -984545,7 +984608,7 @@ async function writeDocsDefinitionForProject({
|
|
|
984545
984608
|
targetAudiences: docsWorkspace.config.instances[0]?.audiences ? Array.isArray(docsWorkspace.config.instances[0].audiences) ? docsWorkspace.config.instances[0].audiences : [docsWorkspace.config.instances[0].audiences] : void 0
|
|
984546
984609
|
});
|
|
984547
984610
|
const docsDefinition = await docsResolver.resolve();
|
|
984548
|
-
await (0,
|
|
984611
|
+
await (0, import_promises215.writeFile)(AbsoluteFilePath2.of(outputPath), JSON.stringify(docsDefinition, null, 2));
|
|
984549
984612
|
context3.logger.info(source_default.green(`Docs definition written to ${outputPath}`));
|
|
984550
984613
|
});
|
|
984551
984614
|
}
|