@fern-api/fern-api-dev 5.65.0 → 5.65.2
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 +573 -486
- 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.65.
|
|
688407
|
+
version: "5.65.2",
|
|
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.65.
|
|
688473
|
+
version: "5.65.2",
|
|
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.65.
|
|
869569
|
+
const version7 = "5.65.2";
|
|
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.65.
|
|
902148
|
+
cliVersion: "5.65.2",
|
|
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
|
}
|
|
@@ -941458,7 +941521,8 @@ var EndpointSnippetGenerator6 = class {
|
|
|
941458
941521
|
args.push(...this.getNamedParameterArgs({
|
|
941459
941522
|
kind: "PathParameters",
|
|
941460
941523
|
namedParameters: pathParameters,
|
|
941461
|
-
values: snippet.pathParameters
|
|
941524
|
+
values: snippet.pathParameters,
|
|
941525
|
+
reservedNames: this.getInlinedBodyPropertyNames({ request: request7 })
|
|
941462
941526
|
}));
|
|
941463
941527
|
args.push(...this.getNamedParameterArgs({
|
|
941464
941528
|
kind: "QueryParameters",
|
|
@@ -941521,7 +941585,23 @@ var EndpointSnippetGenerator6 = class {
|
|
|
941521
941585
|
}
|
|
941522
941586
|
return args;
|
|
941523
941587
|
}
|
|
941524
|
-
|
|
941588
|
+
/**
|
|
941589
|
+
* Property names of an inlined request body (both Ruby names and wire values). Path
|
|
941590
|
+
* parameters that collide with these are renamed in the generated SDK, so snippets
|
|
941591
|
+
* must rename them the same way.
|
|
941592
|
+
*/
|
|
941593
|
+
getInlinedBodyPropertyNames({ request: request7 }) {
|
|
941594
|
+
const names2 = /* @__PURE__ */ new Set();
|
|
941595
|
+
if (request7.body?.type !== "properties") {
|
|
941596
|
+
return names2;
|
|
941597
|
+
}
|
|
941598
|
+
for (const property24 of request7.body.value) {
|
|
941599
|
+
names2.add(this.context.getPropertyName(property24.name.name));
|
|
941600
|
+
names2.add(property24.name.wireValue);
|
|
941601
|
+
}
|
|
941602
|
+
return names2;
|
|
941603
|
+
}
|
|
941604
|
+
getNamedParameterArgs({ kind, namedParameters, values: values2, reservedNames }) {
|
|
941525
941605
|
const args = [];
|
|
941526
941606
|
this.context.errors.scope(kind);
|
|
941527
941607
|
if (namedParameters != null) {
|
|
@@ -941535,8 +941615,15 @@ var EndpointSnippetGenerator6 = class {
|
|
|
941535
941615
|
if (ruby_exports.TypeLiteral.isNop(value2)) {
|
|
941536
941616
|
continue;
|
|
941537
941617
|
}
|
|
941618
|
+
let name2 = this.context.getPropertyName(parameter6.name.name);
|
|
941619
|
+
if (reservedNames != null && reservedNames.has(name2)) {
|
|
941620
|
+
name2 = `${name2}_path_param`;
|
|
941621
|
+
while (reservedNames.has(name2)) {
|
|
941622
|
+
name2 = `${name2}_`;
|
|
941623
|
+
}
|
|
941624
|
+
}
|
|
941538
941625
|
args.push(ruby_exports.keywordArgument({
|
|
941539
|
-
name:
|
|
941626
|
+
name: name2,
|
|
941540
941627
|
value: value2
|
|
941541
941628
|
}));
|
|
941542
941629
|
}
|
|
@@ -941785,7 +941872,7 @@ var DynamicSnippetsGenerator6 = class extends AbstractDynamicSnippetsGenerator {
|
|
|
941785
941872
|
};
|
|
941786
941873
|
|
|
941787
941874
|
// ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/ruby/DynamicSnippetsRubyTestGenerator.js
|
|
941788
|
-
var
|
|
941875
|
+
var import_promises131 = require("fs/promises");
|
|
941789
941876
|
var import_path94 = __toESM(require("path"), 1);
|
|
941790
941877
|
var DynamicSnippetsRubyTestGenerator = class {
|
|
941791
941878
|
context;
|
|
@@ -941814,8 +941901,8 @@ var DynamicSnippetsRubyTestGenerator = class {
|
|
|
941814
941901
|
endpointId
|
|
941815
941902
|
});
|
|
941816
941903
|
const dynamicSnippetFilePath = this.getTestFilePath({ outputDir, idx });
|
|
941817
|
-
await (0,
|
|
941818
|
-
await (0,
|
|
941904
|
+
await (0, import_promises131.mkdir)(import_path94.default.dirname(dynamicSnippetFilePath), { recursive: true });
|
|
941905
|
+
await (0, import_promises131.writeFile)(dynamicSnippetFilePath, response.snippet);
|
|
941819
941906
|
} catch (error50) {
|
|
941820
941907
|
this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
|
|
941821
941908
|
if (error50 instanceof Error && error50.stack) {
|
|
@@ -941831,7 +941918,7 @@ var DynamicSnippetsRubyTestGenerator = class {
|
|
|
941831
941918
|
};
|
|
941832
941919
|
|
|
941833
941920
|
// ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/rust/DynamicSnippetsRustTestGenerator.js
|
|
941834
|
-
var
|
|
941921
|
+
var import_promises132 = require("fs/promises");
|
|
941835
941922
|
var import_node_path40 = __toESM(require("path"), 1);
|
|
941836
941923
|
init_lib8();
|
|
941837
941924
|
|
|
@@ -947065,8 +947152,8 @@ var DynamicSnippetsRustTestGenerator = class {
|
|
|
947065
947152
|
absolutePathToOutputDir,
|
|
947066
947153
|
idx
|
|
947067
947154
|
});
|
|
947068
|
-
await (0,
|
|
947069
|
-
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);
|
|
947070
947157
|
} catch (error50) {
|
|
947071
947158
|
this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
|
|
947072
947159
|
}
|
|
@@ -947075,7 +947162,7 @@ var DynamicSnippetsRustTestGenerator = class {
|
|
|
947075
947162
|
}
|
|
947076
947163
|
async initializeProject(outputDir) {
|
|
947077
947164
|
const absolutePathToOutputDir = join8(outputDir, RelativeFilePath2.of("dynamic-snippets"));
|
|
947078
|
-
await (0,
|
|
947165
|
+
await (0, import_promises132.mkdir)(absolutePathToOutputDir, { recursive: true });
|
|
947079
947166
|
return absolutePathToOutputDir;
|
|
947080
947167
|
}
|
|
947081
947168
|
getTestFilePath({ absolutePathToOutputDir, idx }) {
|
|
@@ -947084,7 +947171,7 @@ var DynamicSnippetsRustTestGenerator = class {
|
|
|
947084
947171
|
};
|
|
947085
947172
|
|
|
947086
947173
|
// ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/swift/DynamicSnippetsSwiftTestGenerator.js
|
|
947087
|
-
var
|
|
947174
|
+
var import_promises133 = require("fs/promises");
|
|
947088
947175
|
var import_node_path41 = __toESM(require("path"), 1);
|
|
947089
947176
|
init_lib8();
|
|
947090
947177
|
|
|
@@ -951748,8 +951835,8 @@ var DynamicSnippetsSwiftTestGenerator = class {
|
|
|
951748
951835
|
absolutePathToOutputDir,
|
|
951749
951836
|
idx
|
|
951750
951837
|
});
|
|
951751
|
-
await (0,
|
|
951752
|
-
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}`));
|
|
951753
951840
|
} catch (error50) {
|
|
951754
951841
|
this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
|
|
951755
951842
|
}
|
|
@@ -951758,7 +951845,7 @@ var DynamicSnippetsSwiftTestGenerator = class {
|
|
|
951758
951845
|
}
|
|
951759
951846
|
async initializeProject(outputDir) {
|
|
951760
951847
|
const absolutePathToOutputDir = join8(outputDir, RelativeFilePath2.of("Tests/Snippets"));
|
|
951761
|
-
await (0,
|
|
951848
|
+
await (0, import_promises133.mkdir)(absolutePathToOutputDir, { recursive: true });
|
|
951762
951849
|
return absolutePathToOutputDir;
|
|
951763
951850
|
}
|
|
951764
951851
|
getTestFilePath({ absolutePathToOutputDir, idx }) {
|
|
@@ -954259,7 +954346,7 @@ var DynamicSnippetsGenerator9 = class extends AbstractDynamicSnippetsGenerator {
|
|
|
954259
954346
|
};
|
|
954260
954347
|
|
|
954261
954348
|
// ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/typescript/DynamicSnippetsTypeScriptTestGenerator.js
|
|
954262
|
-
var
|
|
954349
|
+
var import_promises134 = require("fs/promises");
|
|
954263
954350
|
var import_path95 = __toESM(require("path"), 1);
|
|
954264
954351
|
var DynamicSnippetsTypeScriptTestGenerator = class {
|
|
954265
954352
|
context;
|
|
@@ -954288,8 +954375,8 @@ var DynamicSnippetsTypeScriptTestGenerator = class {
|
|
|
954288
954375
|
endpointId
|
|
954289
954376
|
});
|
|
954290
954377
|
const dynamicSnippetFilePath = this.getTestFilePath({ outputDir, idx });
|
|
954291
|
-
await (0,
|
|
954292
|
-
await (0,
|
|
954378
|
+
await (0, import_promises134.mkdir)(import_path95.default.dirname(dynamicSnippetFilePath), { recursive: true });
|
|
954379
|
+
await (0, import_promises134.writeFile)(dynamicSnippetFilePath, response.snippet);
|
|
954293
954380
|
} catch (error50) {
|
|
954294
954381
|
this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
|
|
954295
954382
|
}
|
|
@@ -954404,7 +954491,7 @@ init_lib8();
|
|
|
954404
954491
|
var import_autoversion3 = __toESM(require_autoversion(), 1);
|
|
954405
954492
|
init_lib9();
|
|
954406
954493
|
var import_serialization = __toESM(require_serialization3(), 1);
|
|
954407
|
-
var
|
|
954494
|
+
var import_promises138 = require("fs/promises");
|
|
954408
954495
|
var path102 = __toESM(require("path"), 1);
|
|
954409
954496
|
var import_path98 = require("path");
|
|
954410
954497
|
var import_tmp_promise17 = __toESM(require_tmp_promise(), 1);
|
|
@@ -954412,12 +954499,12 @@ var import_tmp_promise17 = __toESM(require_tmp_promise(), 1);
|
|
|
954412
954499
|
// ../generation/local-generation/local-workspace-runner/lib/applyTypeRelocations.js
|
|
954413
954500
|
init_lib8();
|
|
954414
954501
|
init_lib9();
|
|
954415
|
-
var
|
|
954502
|
+
var import_promises135 = require("fs/promises");
|
|
954416
954503
|
async function applyTypeRelocations({ ir: ir3, tmpOutputDirectory, context: context3 }) {
|
|
954417
954504
|
const relocationsFilepath = join8(tmpOutputDirectory, RelativeFilePath2.of(TYPE_RELOCATIONS_FILENAME));
|
|
954418
954505
|
let contents;
|
|
954419
954506
|
try {
|
|
954420
|
-
contents = await (0,
|
|
954507
|
+
contents = await (0, import_promises135.readFile)(relocationsFilepath, "utf-8");
|
|
954421
954508
|
} catch {
|
|
954422
954509
|
return;
|
|
954423
954510
|
}
|
|
@@ -954451,7 +954538,7 @@ async function applyTypeRelocations({ ir: ir3, tmpOutputDirectory, context: cont
|
|
|
954451
954538
|
} catch (error50) {
|
|
954452
954539
|
context3.logger.warn(`Failed to apply type relocations from ${relocationsFilepath}: ${error50 instanceof Error ? error50.message : String(error50)}`);
|
|
954453
954540
|
} finally {
|
|
954454
|
-
await (0,
|
|
954541
|
+
await (0, import_promises135.rm)(relocationsFilepath, { force: true });
|
|
954455
954542
|
}
|
|
954456
954543
|
}
|
|
954457
954544
|
|
|
@@ -954996,8 +955083,8 @@ var import_autoversion2 = __toESM(require_autoversion(), 1);
|
|
|
954996
955083
|
init_lib33();
|
|
954997
955084
|
init_lib6();
|
|
954998
955085
|
var import_decompress2 = __toESM(require_decompress(), 1);
|
|
954999
|
-
var
|
|
955000
|
-
var
|
|
955086
|
+
var import_promises136 = require("fs/promises");
|
|
955087
|
+
var import_os13 = require("os");
|
|
955001
955088
|
var import_path96 = require("path");
|
|
955002
955089
|
var import_semver13 = __toESM(require_semver2(), 1);
|
|
955003
955090
|
var import_tmp_promise15 = __toESM(require_tmp_promise(), 1);
|
|
@@ -955105,7 +955192,7 @@ var LocalTaskHandler = class {
|
|
|
955105
955192
|
try {
|
|
955106
955193
|
this.context.logger.info("Analyzing SDK changes for automatic semantic versioning");
|
|
955107
955194
|
diffFile = await this.generateDiffFile();
|
|
955108
|
-
const diffContent = await (0,
|
|
955195
|
+
const diffContent = await (0, import_promises136.readFile)(diffFile, "utf-8");
|
|
955109
955196
|
if (diffContent.trim().length === 0) {
|
|
955110
955197
|
this.context.logger.info("No changes detected in generated SDK");
|
|
955111
955198
|
return null;
|
|
@@ -955310,7 +955397,7 @@ var LocalTaskHandler = class {
|
|
|
955310
955397
|
} finally {
|
|
955311
955398
|
if (diffFile) {
|
|
955312
955399
|
try {
|
|
955313
|
-
await (0,
|
|
955400
|
+
await (0, import_promises136.rm)(diffFile);
|
|
955314
955401
|
} catch (cleanupError) {
|
|
955315
955402
|
this.context.logger.warn(`Failed to delete temp diff file: ${diffFile}`, String(cleanupError));
|
|
955316
955403
|
}
|
|
@@ -955491,7 +955578,7 @@ var LocalTaskHandler = class {
|
|
|
955491
955578
|
const absolutePathToFernignore = AbsoluteFilePath2.of(join8(this.absolutePathToLocalOutput, RelativeFilePath2.of(FERNIGNORE_FILENAME)));
|
|
955492
955579
|
const fernIgnorePaths = await getFernIgnorePaths({ absolutePathToFernignore });
|
|
955493
955580
|
const pathsToPreserve = await this.getPathsToPreserve(fernIgnorePaths);
|
|
955494
|
-
await (0,
|
|
955581
|
+
await (0, import_promises136.cp)(this.absolutePathToLocalOutput, tmpOutputResolutionDir, { recursive: true, verbatimSymlinks: true });
|
|
955495
955582
|
await this.runThrowawayGitCommand(["init"], tmpOutputResolutionDir);
|
|
955496
955583
|
await this.runThrowawayGitCommand(["config", "gc.auto", "0"], tmpOutputResolutionDir);
|
|
955497
955584
|
await this.runThrowawayGitCommand(["add", "."], tmpOutputResolutionDir);
|
|
@@ -955512,22 +955599,22 @@ var LocalTaskHandler = class {
|
|
|
955512
955599
|
await this.runThrowawayGitCommand(["reset", "--", ...pathsToPreserve], tmpOutputResolutionDir);
|
|
955513
955600
|
await this.runThrowawayGitCommand(["clean", "-fd", "--", ...pathsToPreserve], tmpOutputResolutionDir);
|
|
955514
955601
|
await this.runThrowawayGitCommand(["restore", "."], tmpOutputResolutionDir);
|
|
955515
|
-
await (0,
|
|
955602
|
+
await (0, import_promises136.rm)(join8(tmpOutputResolutionDir, RelativeFilePath2.of(".git")), {
|
|
955516
955603
|
recursive: true,
|
|
955517
955604
|
force: true,
|
|
955518
955605
|
maxRetries: 3,
|
|
955519
955606
|
retryDelay: 100
|
|
955520
955607
|
});
|
|
955521
|
-
await (0,
|
|
955522
|
-
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 });
|
|
955523
955610
|
}
|
|
955524
955611
|
async copyGeneratedFilesNoFernIgnorePreservingGit() {
|
|
955525
|
-
const contents = await (0,
|
|
955612
|
+
const contents = await (0, import_promises136.readdir)(this.absolutePathToLocalOutput);
|
|
955526
955613
|
const itemsToPreserve = [".git"];
|
|
955527
955614
|
if (await this.generatedOutputMissingReadme()) {
|
|
955528
955615
|
itemsToPreserve.push("README.md");
|
|
955529
955616
|
}
|
|
955530
|
-
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)), {
|
|
955531
955618
|
force: true,
|
|
955532
955619
|
recursive: true
|
|
955533
955620
|
})));
|
|
@@ -955535,11 +955622,11 @@ var LocalTaskHandler = class {
|
|
|
955535
955622
|
}
|
|
955536
955623
|
async copyGeneratedFilesNoFernIgnoreDeleteAll() {
|
|
955537
955624
|
this.context.logger.debug(`rm -rf ${this.absolutePathToLocalOutput}`);
|
|
955538
|
-
await (0,
|
|
955625
|
+
await (0, import_promises136.rm)(this.absolutePathToLocalOutput, { force: true, recursive: true });
|
|
955539
955626
|
await this.copyGeneratedFilesToDirectory(this.absolutePathToLocalOutput);
|
|
955540
955627
|
}
|
|
955541
955628
|
async copyGeneratedFilesToDirectory(outputPath) {
|
|
955542
|
-
const [firstLocalOutputItem, ...remaininglocalOutputItems] = await (0,
|
|
955629
|
+
const [firstLocalOutputItem, ...remaininglocalOutputItems] = await (0, import_promises136.readdir)(this.absolutePathToTmpOutputDirectory);
|
|
955543
955630
|
if (firstLocalOutputItem == null) {
|
|
955544
955631
|
return;
|
|
955545
955632
|
}
|
|
@@ -955547,10 +955634,10 @@ var LocalTaskHandler = class {
|
|
|
955547
955634
|
if (firstLocalOutputItem.endsWith(".zip")) {
|
|
955548
955635
|
await (0, import_decompress2.default)(join8(this.absolutePathToTmpOutputDirectory, RelativeFilePath2.of(firstLocalOutputItem)), outputPath);
|
|
955549
955636
|
for (const localOutputItem of remaininglocalOutputItems) {
|
|
955550
|
-
await (0,
|
|
955637
|
+
await (0, import_promises136.cp)(join8(this.absolutePathToTmpOutputDirectory, RelativeFilePath2.of(localOutputItem)), join8(outputPath, RelativeFilePath2.of(localOutputItem)), { recursive: true, verbatimSymlinks: true });
|
|
955551
955638
|
}
|
|
955552
955639
|
} else {
|
|
955553
|
-
await (0,
|
|
955640
|
+
await (0, import_promises136.cp)(this.absolutePathToTmpOutputDirectory, outputPath, { recursive: true, verbatimSymlinks: true });
|
|
955554
955641
|
}
|
|
955555
955642
|
}
|
|
955556
955643
|
async copySnippetJSON({ absolutePathToTmpSnippetJSON, absolutePathToLocalSnippetJSON }) {
|
|
@@ -955571,7 +955658,7 @@ var LocalTaskHandler = class {
|
|
|
955571
955658
|
*/
|
|
955572
955659
|
async generatedOutputMissingReadme() {
|
|
955573
955660
|
try {
|
|
955574
|
-
const contents = await (0,
|
|
955661
|
+
const contents = await (0, import_promises136.readdir)(this.absolutePathToTmpOutputDirectory);
|
|
955575
955662
|
if (contents.length === 1 && contents[0] != null && contents[0].endsWith(".zip")) {
|
|
955576
955663
|
return false;
|
|
955577
955664
|
}
|
|
@@ -955621,13 +955708,13 @@ var LocalTaskHandler = class {
|
|
|
955621
955708
|
async readPriorChangelog(maxEntries) {
|
|
955622
955709
|
const MAX_CHANGELOG_SIZE = 2048;
|
|
955623
955710
|
try {
|
|
955624
|
-
const files = await (0,
|
|
955711
|
+
const files = await (0, import_promises136.readdir)(this.absolutePathToLocalOutput);
|
|
955625
955712
|
const changelogFile = files.find((f3) => f3.toLowerCase() === "changelog.md");
|
|
955626
955713
|
if (!changelogFile) {
|
|
955627
955714
|
return "";
|
|
955628
955715
|
}
|
|
955629
955716
|
const changelogPath = join8(this.absolutePathToLocalOutput, RelativeFilePath2.of(changelogFile));
|
|
955630
|
-
const content5 = await (0,
|
|
955717
|
+
const content5 = await (0, import_promises136.readFile)(changelogPath, "utf-8");
|
|
955631
955718
|
if (content5.trim().length === 0) {
|
|
955632
955719
|
return "";
|
|
955633
955720
|
}
|
|
@@ -955695,7 +955782,7 @@ var LocalTaskHandler = class {
|
|
|
955695
955782
|
* when the copy path does not stage files (copyGeneratedFilesNoFernIgnorePreservingGit).
|
|
955696
955783
|
*/
|
|
955697
955784
|
async generateDiffFile() {
|
|
955698
|
-
const diffFile = (0, import_path96.join)((0,
|
|
955785
|
+
const diffFile = (0, import_path96.join)((0, import_os13.tmpdir)(), `git-diff-${Date.now()}.patch`);
|
|
955699
955786
|
await this.runGitCommand(["add", "-N", "."], this.absolutePathToLocalOutput);
|
|
955700
955787
|
await this.runGitCommand(["diff", "HEAD", "--output", diffFile, "--", ".", ":(exclude).fern/metadata.json"], this.absolutePathToLocalOutput);
|
|
955701
955788
|
this.context.logger.info(`Generated git diff to file: ${diffFile}`);
|
|
@@ -955703,11 +955790,11 @@ var LocalTaskHandler = class {
|
|
|
955703
955790
|
}
|
|
955704
955791
|
};
|
|
955705
955792
|
async function copySnippetJsonIfNonEmpty({ src, dest }) {
|
|
955706
|
-
const tmpStat = await (0,
|
|
955793
|
+
const tmpStat = await (0, import_promises136.stat)(src);
|
|
955707
955794
|
if (tmpStat.size === 0) {
|
|
955708
955795
|
return "skipped-empty";
|
|
955709
955796
|
}
|
|
955710
|
-
await (0,
|
|
955797
|
+
await (0, import_promises136.cp)(src, dest);
|
|
955711
955798
|
return "copied";
|
|
955712
955799
|
}
|
|
955713
955800
|
|
|
@@ -955715,7 +955802,7 @@ async function copySnippetJsonIfNonEmpty({ src, dest }) {
|
|
|
955715
955802
|
init_lib4();
|
|
955716
955803
|
init_lib8();
|
|
955717
955804
|
init_lib35();
|
|
955718
|
-
var
|
|
955805
|
+
var import_promises137 = require("fs/promises");
|
|
955719
955806
|
init_js_yaml();
|
|
955720
955807
|
var import_path97 = __toESM(require("path"), 1);
|
|
955721
955808
|
init_index_min2();
|
|
@@ -955784,7 +955871,7 @@ async function resolveOpenAPIOrAsyncAPI({ spec, hostOutputDir, containerBaseDir,
|
|
|
955784
955871
|
});
|
|
955785
955872
|
}
|
|
955786
955873
|
resolved = filterSpec(resolved, audiences);
|
|
955787
|
-
await (0,
|
|
955874
|
+
await (0, import_promises137.writeFile)(import_path97.default.join(hostOutputDir, filename), JSON.stringify(resolved));
|
|
955788
955875
|
context3.logger.debug(`Resolved ${isAsync2 ? "AsyncAPI" : "OpenAPI"} spec ${spec.absoluteFilepath} -> ${filename}`);
|
|
955789
955876
|
return {
|
|
955790
955877
|
type: isAsync2 ? "asyncapi" : "openapi",
|
|
@@ -955794,7 +955881,7 @@ async function resolveOpenAPIOrAsyncAPI({ spec, hostOutputDir, containerBaseDir,
|
|
|
955794
955881
|
}
|
|
955795
955882
|
async function resolveOpenRPC({ spec, hostOutputDir, containerBaseDir, context: context3, index: index3 }) {
|
|
955796
955883
|
const filename = `openrpc${index3}.json`;
|
|
955797
|
-
const rawContent = await (0,
|
|
955884
|
+
const rawContent = await (0, import_promises137.readFile)(spec.absoluteFilepath, "utf-8");
|
|
955798
955885
|
let parsed;
|
|
955799
955886
|
try {
|
|
955800
955887
|
parsed = JSON.parse(rawContent);
|
|
@@ -955804,7 +955891,7 @@ async function resolveOpenRPC({ spec, hostOutputDir, containerBaseDir, context:
|
|
|
955804
955891
|
let result = parsed;
|
|
955805
955892
|
const overrides = normalizeOverrides(spec.absoluteFilepathToOverrides);
|
|
955806
955893
|
for (const overridePath of overrides) {
|
|
955807
|
-
const overrideContent = await (0,
|
|
955894
|
+
const overrideContent = await (0, import_promises137.readFile)(overridePath, "utf-8");
|
|
955808
955895
|
let overrideParsed;
|
|
955809
955896
|
try {
|
|
955810
955897
|
overrideParsed = JSON.parse(overrideContent);
|
|
@@ -955816,7 +955903,7 @@ async function resolveOpenRPC({ spec, hostOutputDir, containerBaseDir, context:
|
|
|
955816
955903
|
overrides: overrideParsed
|
|
955817
955904
|
});
|
|
955818
955905
|
}
|
|
955819
|
-
await (0,
|
|
955906
|
+
await (0, import_promises137.writeFile)(import_path97.default.join(hostOutputDir, filename), JSON.stringify(result));
|
|
955820
955907
|
context3.logger.debug(`Resolved OpenRPC spec ${spec.absoluteFilepath} -> ${filename}`);
|
|
955821
955908
|
return {
|
|
955822
955909
|
type: "openrpc",
|
|
@@ -955827,7 +955914,7 @@ async function resolveOpenRPC({ spec, hostOutputDir, containerBaseDir, context:
|
|
|
955827
955914
|
async function copyProtobuf({ spec, hostOutputDir, containerBaseDir, index: index3 }) {
|
|
955828
955915
|
const dirName = `protobuf${index3}`;
|
|
955829
955916
|
const destDir = import_path97.default.join(hostOutputDir, dirName);
|
|
955830
|
-
await (0,
|
|
955917
|
+
await (0, import_promises137.cp)(spec.absoluteFilepathToProtobufRoot, destDir, { recursive: true });
|
|
955831
955918
|
const entry = {
|
|
955832
955919
|
type: "protobuf",
|
|
955833
955920
|
specPath: toContainerPath(dirName, containerBaseDir)
|
|
@@ -955837,7 +955924,7 @@ async function copyProtobuf({ spec, hostOutputDir, containerBaseDir, index: inde
|
|
|
955837
955924
|
entry.overridePaths = [];
|
|
955838
955925
|
for (const [i5, override] of overrides.entries()) {
|
|
955839
955926
|
const overrideName = `protobuf${index3}-override-${i5}${import_path97.default.extname(override)}`;
|
|
955840
|
-
await (0,
|
|
955927
|
+
await (0, import_promises137.copyFile)(override, import_path97.default.join(hostOutputDir, overrideName));
|
|
955841
955928
|
entry.overridePaths.push(toContainerPath(overrideName, containerBaseDir));
|
|
955842
955929
|
}
|
|
955843
955930
|
}
|
|
@@ -955846,7 +955933,7 @@ async function copyProtobuf({ spec, hostOutputDir, containerBaseDir, index: inde
|
|
|
955846
955933
|
async function copyGraphQL({ spec, hostOutputDir, containerBaseDir, index: index3 }) {
|
|
955847
955934
|
const ext2 = import_path97.default.extname(spec.absoluteFilepath) || ".graphql";
|
|
955848
955935
|
const filename = `graphql${index3}${ext2}`;
|
|
955849
|
-
await (0,
|
|
955936
|
+
await (0, import_promises137.copyFile)(spec.absoluteFilepath, import_path97.default.join(hostOutputDir, filename));
|
|
955850
955937
|
const entry = {
|
|
955851
955938
|
type: "graphql",
|
|
955852
955939
|
specPath: toContainerPath(filename, containerBaseDir),
|
|
@@ -955857,7 +955944,7 @@ async function copyGraphQL({ spec, hostOutputDir, containerBaseDir, index: index
|
|
|
955857
955944
|
entry.overridePaths = [];
|
|
955858
955945
|
for (const [i5, override] of overrides.entries()) {
|
|
955859
955946
|
const overrideName = `graphql${index3}-override-${i5}${import_path97.default.extname(override)}`;
|
|
955860
|
-
await (0,
|
|
955947
|
+
await (0, import_promises137.copyFile)(override, import_path97.default.join(hostOutputDir, overrideName));
|
|
955861
955948
|
entry.overridePaths.push(toContainerPath(overrideName, containerBaseDir));
|
|
955862
955949
|
}
|
|
955863
955950
|
}
|
|
@@ -955865,7 +955952,7 @@ async function copyGraphQL({ spec, hostOutputDir, containerBaseDir, index: index
|
|
|
955865
955952
|
}
|
|
955866
955953
|
async function isAsyncAPISpec(filepath) {
|
|
955867
955954
|
try {
|
|
955868
|
-
const content5 = await (0,
|
|
955955
|
+
const content5 = await (0, import_promises137.readFile)(filepath, "utf-8");
|
|
955869
955956
|
return content5.includes("asyncapi");
|
|
955870
955957
|
} catch {
|
|
955871
955958
|
return false;
|
|
@@ -955975,7 +956062,7 @@ async function createSpecsTarGzBuffer({ specs, context: context3, audiences }) {
|
|
|
955975
956062
|
context: context3,
|
|
955976
956063
|
audiences
|
|
955977
956064
|
});
|
|
955978
|
-
await (0,
|
|
956065
|
+
await (0, import_promises137.writeFile)(join8(AbsoluteFilePath2.of(tmpDir.path), RelativeFilePath2.of(SPECS_MANIFEST_FILENAME)), JSON.stringify(manifest, void 0, 4));
|
|
955979
956066
|
const tarGzPath = join8(AbsoluteFilePath2.of(tmpDir.path), RelativeFilePath2.of("specs.tar.gz"));
|
|
955980
956067
|
await Kn({
|
|
955981
956068
|
gzip: true,
|
|
@@ -955984,7 +956071,7 @@ async function createSpecsTarGzBuffer({ specs, context: context3, audiences }) {
|
|
|
955984
956071
|
portable: true,
|
|
955985
956072
|
filter: (entryPath) => entryPath !== "./specs.tar.gz"
|
|
955986
956073
|
}, ["."]);
|
|
955987
|
-
return await (0,
|
|
956074
|
+
return await (0, import_promises137.readFile)(tarGzPath);
|
|
955988
956075
|
} finally {
|
|
955989
956076
|
await tmpDir.cleanup();
|
|
955990
956077
|
}
|
|
@@ -956026,24 +956113,24 @@ async function writeFilesToDiskAndRunGenerator({ organization, absolutePathToFer
|
|
|
956026
956113
|
context3.logger.debug("Wrote IR to: " + absolutePathToIr);
|
|
956027
956114
|
const configJsonFile = (0, import_path98.join)(workspaceTempDir.path, GENERATOR_CONFIG_FILENAME);
|
|
956028
956115
|
const absolutePathToWriteConfigJson = AbsoluteFilePath2.of(configJsonFile);
|
|
956029
|
-
await (0,
|
|
956116
|
+
await (0, import_promises138.writeFile)(configJsonFile, "");
|
|
956030
956117
|
context3.logger.debug("Will write config.json to: " + absolutePathToWriteConfigJson);
|
|
956031
956118
|
const tmpOutputDirectory = (0, import_path98.join)(workspaceTempDir.path, CODEGEN_OUTPUT_DIRECTORY_NAME);
|
|
956032
956119
|
const absolutePathToTmpOutputDirectory = AbsoluteFilePath2.of(tmpOutputDirectory);
|
|
956033
|
-
await (0,
|
|
956120
|
+
await (0, import_promises138.mkdir)(tmpOutputDirectory, { recursive: true });
|
|
956034
956121
|
context3.logger.debug("Will write output to: " + absolutePathToTmpOutputDirectory);
|
|
956035
956122
|
let absolutePathToTmpSnippetJSON = void 0;
|
|
956036
956123
|
if (absolutePathToLocalSnippetJSON != null) {
|
|
956037
956124
|
const snippetJsonFile = (0, import_path98.join)(workspaceTempDir.path, "snippet.json");
|
|
956038
956125
|
absolutePathToTmpSnippetJSON = AbsoluteFilePath2.of(snippetJsonFile);
|
|
956039
|
-
await (0,
|
|
956126
|
+
await (0, import_promises138.writeFile)(snippetJsonFile, "");
|
|
956040
956127
|
context3.logger.debug("Will write snippet.json to: " + absolutePathToTmpSnippetJSON);
|
|
956041
956128
|
}
|
|
956042
956129
|
let absolutePathToTmpSnippetTemplatesJSON = void 0;
|
|
956043
956130
|
if (absolutePathToLocalSnippetTemplateJSON != null) {
|
|
956044
956131
|
const snippetTemplatesJsonFile = (0, import_path98.join)(workspaceTempDir.path, SNIPPET_TEMPLATES_JSON_FILENAME);
|
|
956045
956132
|
absolutePathToTmpSnippetTemplatesJSON = AbsoluteFilePath2.of(snippetTemplatesJsonFile);
|
|
956046
|
-
await (0,
|
|
956133
|
+
await (0, import_promises138.writeFile)(snippetTemplatesJsonFile, "");
|
|
956047
956134
|
context3.logger.debug("Will write snippet-templates.json to: " + absolutePathToTmpSnippetTemplatesJSON);
|
|
956048
956135
|
}
|
|
956049
956136
|
const environment2 = executionEnvironment ?? new ContainerExecutionEnvironment({
|
|
@@ -956084,7 +956171,7 @@ async function writeFilesToDiskAndRunGenerator({ organization, absolutePathToFer
|
|
|
956084
956171
|
publishToRegistry,
|
|
956085
956172
|
paths
|
|
956086
956173
|
});
|
|
956087
|
-
await (0,
|
|
956174
|
+
await (0, import_promises138.writeFile)(absolutePathToWriteConfigJson, JSON.stringify(await import_serialization.GeneratorConfig.jsonOrThrow(config5), void 0, 4));
|
|
956088
956175
|
const absolutePathToLicenseFile = extractLicenseFilePath(generatorInvocation, absolutePathToFernConfig);
|
|
956089
956176
|
const sourceMounts = workspace.getSources().filter((source2) => source2.type === "protobuf").map((source2) => ({
|
|
956090
956177
|
hostPath: source2.absoluteFilePath,
|
|
@@ -956092,7 +956179,7 @@ async function writeFilesToDiskAndRunGenerator({ organization, absolutePathToFer
|
|
|
956092
956179
|
}));
|
|
956093
956180
|
if (rawApiSpecs != null && rawApiSpecs.length > 0) {
|
|
956094
956181
|
const rawSpecsDir = (0, import_path98.join)(workspaceTempDir.path, SPECS_DIRECTORY_NAME);
|
|
956095
|
-
await (0,
|
|
956182
|
+
await (0, import_promises138.mkdir)(rawSpecsDir, { recursive: true });
|
|
956096
956183
|
const containerSpecsDir = environment2.usesContainerPaths ? CONTAINER_SPECS_DIRECTORY : rawSpecsDir;
|
|
956097
956184
|
const manifest = await collectRawSpecs({
|
|
956098
956185
|
specs: rawApiSpecs,
|
|
@@ -956101,7 +956188,7 @@ async function writeFilesToDiskAndRunGenerator({ organization, absolutePathToFer
|
|
|
956101
956188
|
context: context3,
|
|
956102
956189
|
audiences
|
|
956103
956190
|
});
|
|
956104
|
-
await (0,
|
|
956191
|
+
await (0, import_promises138.writeFile)((0, import_path98.join)(rawSpecsDir, SPECS_MANIFEST_FILENAME), JSON.stringify(manifest, void 0, 4));
|
|
956105
956192
|
context3.logger.debug(`Wrote raw specs manifest with ${manifest.specs.length} spec(s) to ${rawSpecsDir}`);
|
|
956106
956193
|
sourceMounts.push({
|
|
956107
956194
|
hostPath: AbsoluteFilePath2.of(rawSpecsDir),
|
|
@@ -956197,7 +956284,7 @@ init_lib35();
|
|
|
956197
956284
|
init_lib6();
|
|
956198
956285
|
init_source();
|
|
956199
956286
|
var fs30 = __toESM(require("fs/promises"), 1);
|
|
956200
|
-
var
|
|
956287
|
+
var import_os14 = __toESM(require("os"), 1);
|
|
956201
956288
|
var import_path99 = __toESM(require("path"), 1);
|
|
956202
956289
|
var import_tmp_promise18 = __toESM(require_tmp_promise(), 1);
|
|
956203
956290
|
|
|
@@ -956544,7 +956631,7 @@ async function getWorkspaceTempDir() {
|
|
|
956544
956631
|
return import_tmp_promise18.default.dir({
|
|
956545
956632
|
// use the /private prefix on osx so that docker can access the tmpdir
|
|
956546
956633
|
// see https://stackoverflow.com/a/45123074
|
|
956547
|
-
tmpdir:
|
|
956634
|
+
tmpdir: import_os14.default.platform() === "darwin" ? import_path99.default.join("/private", import_os14.default.tmpdir()) : void 0,
|
|
956548
956635
|
prefix: "fern"
|
|
956549
956636
|
});
|
|
956550
956637
|
}
|
|
@@ -956871,7 +956958,7 @@ async function runVerifyPipeline({ outputDir, generatorName, generatorVersion, c
|
|
|
956871
956958
|
// ../cli-v2/lib/sdk/generator/LegacyLocalGenerationRunner.js
|
|
956872
956959
|
init_lib5();
|
|
956873
956960
|
init_lib6();
|
|
956874
|
-
var
|
|
956961
|
+
var import_promises140 = require("fs/promises");
|
|
956875
956962
|
|
|
956876
956963
|
// ../cli-v2/lib/sdk/adapter/LegacyGeneratorInvocationAdapter.js
|
|
956877
956964
|
init_lib12();
|
|
@@ -956881,7 +956968,7 @@ init_lib8();
|
|
|
956881
956968
|
init_lib11();
|
|
956882
956969
|
init_lib6();
|
|
956883
956970
|
init_esm19();
|
|
956884
|
-
var
|
|
956971
|
+
var import_promises139 = require("fs/promises");
|
|
956885
956972
|
var LegacyGeneratorInvocationAdapter = class {
|
|
956886
956973
|
context;
|
|
956887
956974
|
constructor(config5) {
|
|
@@ -957135,7 +957222,7 @@ var LegacyGeneratorInvocationAdapter = class {
|
|
|
957135
957222
|
code: CliError.Code.InternalError
|
|
957136
957223
|
});
|
|
957137
957224
|
}
|
|
957138
|
-
const contents = await (0,
|
|
957225
|
+
const contents = await (0, import_promises139.readFile)(absolutePath, "utf-8");
|
|
957139
957226
|
return api_exports4.GithubLicense.custom({ contents });
|
|
957140
957227
|
}
|
|
957141
957228
|
buildReadme(target) {
|
|
@@ -957361,7 +957448,7 @@ var LegacyLocalGenerationRunner = class {
|
|
|
957361
957448
|
});
|
|
957362
957449
|
if (args.target.output.path != null && generatorInvocation.absolutePathToLocalOutput != null) {
|
|
957363
957450
|
const snippetPath = join8(generatorInvocation.absolutePathToLocalOutput, RelativeFilePath2.of(SNIPPET_JSON_FILENAME));
|
|
957364
|
-
await (0,
|
|
957451
|
+
await (0, import_promises140.rm)(snippetPath, { force: true });
|
|
957365
957452
|
}
|
|
957366
957453
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
957367
957454
|
return {
|
|
@@ -957380,8 +957467,8 @@ init_lib4();
|
|
|
957380
957467
|
init_lib8();
|
|
957381
957468
|
init_lib5();
|
|
957382
957469
|
init_lib6();
|
|
957383
|
-
var
|
|
957384
|
-
var
|
|
957470
|
+
var import_promises141 = require("fs/promises");
|
|
957471
|
+
var import_os15 = require("os");
|
|
957385
957472
|
var LegacyRemoteGenerationRunner = class {
|
|
957386
957473
|
context;
|
|
957387
957474
|
cliVersion;
|
|
@@ -957439,13 +957526,13 @@ var LegacyRemoteGenerationRunner = class {
|
|
|
957439
957526
|
const previewOutputDirectory = join8(absolutePathToPreview, RelativeFilePath2.of(generatorName));
|
|
957440
957527
|
const targetOutputDirectory = generatorInvocation.absolutePathToLocalOutput;
|
|
957441
957528
|
if (targetOutputDirectory != null) {
|
|
957442
|
-
await (0,
|
|
957443
|
-
await (0,
|
|
957529
|
+
await (0, import_promises141.cp)(previewOutputDirectory, targetOutputDirectory, { recursive: true });
|
|
957530
|
+
await (0, import_promises141.rm)(join8(targetOutputDirectory, RelativeFilePath2.of(".git")), {
|
|
957444
957531
|
recursive: true,
|
|
957445
957532
|
force: true
|
|
957446
957533
|
});
|
|
957447
957534
|
}
|
|
957448
|
-
await (0,
|
|
957535
|
+
await (0, import_promises141.rm)(absolutePathToPreview, { recursive: true, force: true });
|
|
957449
957536
|
}
|
|
957450
957537
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
957451
957538
|
return {
|
|
@@ -957474,7 +957561,7 @@ var LegacyRemoteGenerationRunner = class {
|
|
|
957474
957561
|
}
|
|
957475
957562
|
async getAbsolutePathToPreview(args) {
|
|
957476
957563
|
if (this.isLocalGitCombo(args)) {
|
|
957477
|
-
const tmpPreviewDirectory = await (0,
|
|
957564
|
+
const tmpPreviewDirectory = await (0, import_promises141.mkdtemp)(join8(AbsoluteFilePath2.of((0, import_os15.tmpdir)()), RelativeFilePath2.of("fern-preview-")));
|
|
957478
957565
|
return AbsoluteFilePath2.of(tmpPreviewDirectory);
|
|
957479
957566
|
}
|
|
957480
957567
|
if (!args.preview) {
|
|
@@ -958210,7 +958297,7 @@ Example:
|
|
|
958210
958297
|
if (!exists2) {
|
|
958211
958298
|
return { shouldProceed: true };
|
|
958212
958299
|
}
|
|
958213
|
-
const files = await (0,
|
|
958300
|
+
const files = await (0, import_promises142.readdir)(outputPath);
|
|
958214
958301
|
if (files.length === 0) {
|
|
958215
958302
|
return { shouldProceed: true };
|
|
958216
958303
|
}
|
|
@@ -958622,7 +958709,7 @@ init_lib4();
|
|
|
958622
958709
|
init_lib33();
|
|
958623
958710
|
init_lib6();
|
|
958624
958711
|
var import_fs38 = require("fs");
|
|
958625
|
-
var
|
|
958712
|
+
var import_promises143 = require("fs/promises");
|
|
958626
958713
|
var import_path101 = require("path");
|
|
958627
958714
|
var import_semver14 = __toESM(require_semver2(), 1);
|
|
958628
958715
|
var import_url8 = require("url");
|
|
@@ -958732,7 +958819,7 @@ var GeneratorMigrator = class _GeneratorMigrator {
|
|
|
958732
958819
|
}
|
|
958733
958820
|
this.migrationsInstallPromise = (async () => {
|
|
958734
958821
|
const cacheDir = this.cachePath;
|
|
958735
|
-
await (0,
|
|
958822
|
+
await (0, import_promises143.mkdir)(cacheDir, { recursive: true });
|
|
958736
958823
|
const npmCacheDir = (0, import_path101.join)(cacheDir, ".npm-cache");
|
|
958737
958824
|
const packageDir = (0, import_path101.join)(cacheDir, "node_modules", MIGRATION_PACKAGE_NAME);
|
|
958738
958825
|
const packageJsonPath = (0, import_path101.join)(packageDir, "package.json");
|
|
@@ -958749,7 +958836,7 @@ var GeneratorMigrator = class _GeneratorMigrator {
|
|
|
958749
958836
|
"--no-audit",
|
|
958750
958837
|
"--no-fund"
|
|
958751
958838
|
], { doNotPipeOutput: true });
|
|
958752
|
-
const packageJsonContent = await (0,
|
|
958839
|
+
const packageJsonContent = await (0, import_promises143.readFile)(packageJsonPath, "utf-8");
|
|
958753
958840
|
const packageJson2 = JSON.parse(packageJsonContent);
|
|
958754
958841
|
if (packageJson2.main == null) {
|
|
958755
958842
|
throw new CliError({
|
|
@@ -958794,7 +958881,7 @@ var GeneratorMigrator = class _GeneratorMigrator {
|
|
|
958794
958881
|
const myPid = String(process.pid);
|
|
958795
958882
|
while (true) {
|
|
958796
958883
|
try {
|
|
958797
|
-
const fh = await (0,
|
|
958884
|
+
const fh = await (0, import_promises143.open)(lockPath, "wx");
|
|
958798
958885
|
await fh.writeFile(myPid);
|
|
958799
958886
|
await fh.close();
|
|
958800
958887
|
const exitHandler = () => {
|
|
@@ -958811,9 +958898,9 @@ var GeneratorMigrator = class _GeneratorMigrator {
|
|
|
958811
958898
|
return async () => {
|
|
958812
958899
|
process.removeListener("exit", exitHandler);
|
|
958813
958900
|
try {
|
|
958814
|
-
const currentContent = await (0,
|
|
958901
|
+
const currentContent = await (0, import_promises143.readFile)(lockPath, "utf-8");
|
|
958815
958902
|
if (currentContent.trim() === myPid) {
|
|
958816
|
-
await (0,
|
|
958903
|
+
await (0, import_promises143.unlink)(lockPath);
|
|
958817
958904
|
} else {
|
|
958818
958905
|
logger4.debug(`Lock file owned by another process (expected pid=${myPid}, found=${currentContent.trim()}); skipping release`);
|
|
958819
958906
|
}
|
|
@@ -958827,14 +958914,14 @@ var GeneratorMigrator = class _GeneratorMigrator {
|
|
|
958827
958914
|
throw err;
|
|
958828
958915
|
}
|
|
958829
958916
|
try {
|
|
958830
|
-
const lockContent = await (0,
|
|
958917
|
+
const lockContent = await (0, import_promises143.readFile)(lockPath, "utf-8");
|
|
958831
958918
|
const lockPid = Number(lockContent.trim());
|
|
958832
|
-
const lockStat = await (0,
|
|
958919
|
+
const lockStat = await (0, import_promises143.stat)(lockPath);
|
|
958833
958920
|
const lockAge = Date.now() - lockStat.mtimeMs;
|
|
958834
958921
|
if (lockAge > _GeneratorMigrator.LOCK_STALE_MS || Number.isFinite(lockPid) && lockPid > 0 && !_GeneratorMigrator.isProcessAlive(lockPid)) {
|
|
958835
958922
|
logger4.debug(`Removing stale migration lock (pid=${lockContent.trim()}, age=${lockAge}ms)`);
|
|
958836
958923
|
try {
|
|
958837
|
-
await (0,
|
|
958924
|
+
await (0, import_promises143.unlink)(lockPath);
|
|
958838
958925
|
} catch (unlinkErr) {
|
|
958839
958926
|
logger4.debug(`Failed to remove stale lock: ${unlinkErr}`);
|
|
958840
958927
|
}
|
|
@@ -959523,7 +959610,7 @@ var import_generator_cli5 = __toESM(require_api3(), 1);
|
|
|
959523
959610
|
init_lib19();
|
|
959524
959611
|
init_lib8();
|
|
959525
959612
|
init_source();
|
|
959526
|
-
var
|
|
959613
|
+
var import_promises148 = require("fs/promises");
|
|
959527
959614
|
var import_fs_extra = __toESM(require_lib18(), 1);
|
|
959528
959615
|
var import_path104 = __toESM(require("path"), 1);
|
|
959529
959616
|
|
|
@@ -959533,7 +959620,7 @@ init_lib26();
|
|
|
959533
959620
|
init_lib8();
|
|
959534
959621
|
init_lib6();
|
|
959535
959622
|
init_source();
|
|
959536
|
-
var
|
|
959623
|
+
var import_promises145 = require("fs/promises");
|
|
959537
959624
|
init_lodash();
|
|
959538
959625
|
var GITIGNORE_CONTENT = "**/.preview\n**/.definition\n";
|
|
959539
959626
|
async function createFernDirectoryAndWorkspace({ organization, taskContext, versionOfCli }) {
|
|
@@ -959565,7 +959652,7 @@ async function createFernDirectoryAndWorkspace({ organization, taskContext, vers
|
|
|
959565
959652
|
}
|
|
959566
959653
|
}
|
|
959567
959654
|
}
|
|
959568
|
-
await (0,
|
|
959655
|
+
await (0, import_promises145.mkdir)(FERN_DIRECTORY);
|
|
959569
959656
|
await writeProjectConfig({
|
|
959570
959657
|
filepath: join8(pathToFernDirectory, RelativeFilePath2.of(PROJECT_CONFIG_FILENAME)),
|
|
959571
959658
|
organization,
|
|
@@ -959589,11 +959676,11 @@ async function writeProjectConfig({ organization, filepath, versionOfCli }) {
|
|
|
959589
959676
|
organization,
|
|
959590
959677
|
version: versionOfCli
|
|
959591
959678
|
};
|
|
959592
|
-
await (0,
|
|
959679
|
+
await (0, import_promises145.writeFile)(filepath, JSON.stringify(projectConfig, void 0, 4));
|
|
959593
959680
|
}
|
|
959594
959681
|
async function writeGitignore({ absolutePathToFernDirectory }) {
|
|
959595
959682
|
const gitignorePath = join8(absolutePathToFernDirectory, RelativeFilePath2.of(".gitignore"));
|
|
959596
|
-
await (0,
|
|
959683
|
+
await (0, import_promises145.writeFile)(gitignorePath, GITIGNORE_CONTENT);
|
|
959597
959684
|
}
|
|
959598
959685
|
|
|
959599
959686
|
// ../init/lib/createWorkspace.js
|
|
@@ -959787,7 +959874,7 @@ async function formatDefinitionFile({ fileContents }) {
|
|
|
959787
959874
|
init_lib4();
|
|
959788
959875
|
init_lib6();
|
|
959789
959876
|
init_source();
|
|
959790
|
-
var
|
|
959877
|
+
var import_promises146 = require("fs/promises");
|
|
959791
959878
|
async function formatFernWorkspace({ workspace, context: context3, shouldFix }) {
|
|
959792
959879
|
for (const [relativeFilepath, file4] of entries(workspace.definition.namedDefinitionFiles)) {
|
|
959793
959880
|
const formatted = await formatDefinitionFile({
|
|
@@ -959795,7 +959882,7 @@ async function formatFernWorkspace({ workspace, context: context3, shouldFix })
|
|
|
959795
959882
|
});
|
|
959796
959883
|
if (formatted !== file4.rawContents) {
|
|
959797
959884
|
if (shouldFix) {
|
|
959798
|
-
await (0,
|
|
959885
|
+
await (0, import_promises146.writeFile)(file4.absoluteFilePath, formatted);
|
|
959799
959886
|
context3.logger.info(source_default.green(`Formatted ${source_default.bold(relativeFilepath)}`));
|
|
959800
959887
|
} else {
|
|
959801
959888
|
context3.logger.info(source_default.red(`Invalid formatting: ${source_default.bold(relativeFilepath)}`));
|
|
@@ -959808,7 +959895,7 @@ async function formatFernWorkspace({ workspace, context: context3, shouldFix })
|
|
|
959808
959895
|
// ../init/lib/createWorkspace.js
|
|
959809
959896
|
init_lib8();
|
|
959810
959897
|
init_lib6();
|
|
959811
|
-
var
|
|
959898
|
+
var import_promises147 = require("fs/promises");
|
|
959812
959899
|
init_js_yaml();
|
|
959813
959900
|
|
|
959814
959901
|
// ../init/lib/sampleImdbApi.js
|
|
@@ -960009,7 +960096,7 @@ components:
|
|
|
960009
960096
|
// ../init/lib/createWorkspace.js
|
|
960010
960097
|
async function createFernWorkspace({ directoryOfWorkspace, cliVersion, context: context3, apiName = "api" }) {
|
|
960011
960098
|
if (!await doesPathExist(directoryOfWorkspace)) {
|
|
960012
|
-
await (0,
|
|
960099
|
+
await (0, import_promises147.mkdir)(directoryOfWorkspace);
|
|
960013
960100
|
}
|
|
960014
960101
|
await writeGeneratorsConfiguration({
|
|
960015
960102
|
filepath: join8(directoryOfWorkspace, RelativeFilePath2.of(GENERATORS_CONFIGURATION_FILENAME)),
|
|
@@ -960024,7 +960111,7 @@ async function createFernWorkspace({ directoryOfWorkspace, cliVersion, context:
|
|
|
960024
960111
|
}
|
|
960025
960112
|
async function createOpenAPIWorkspace({ directoryOfWorkspace, openAPIFilePath, cliVersion, context: context3 }) {
|
|
960026
960113
|
if (!await doesPathExist(directoryOfWorkspace)) {
|
|
960027
|
-
await (0,
|
|
960114
|
+
await (0, import_promises147.mkdir)(directoryOfWorkspace);
|
|
960028
960115
|
}
|
|
960029
960116
|
await writeGeneratorsConfiguration({
|
|
960030
960117
|
filepath: join8(directoryOfWorkspace, RelativeFilePath2.of(GENERATORS_CONFIGURATION_FILENAME)),
|
|
@@ -960037,10 +960124,10 @@ async function createOpenAPIWorkspace({ directoryOfWorkspace, openAPIFilePath, c
|
|
|
960037
960124
|
}
|
|
960038
960125
|
async function createDefaultOpenAPIWorkspace({ directoryOfWorkspace, cliVersion, context: context3 }) {
|
|
960039
960126
|
if (!await doesPathExist(directoryOfWorkspace)) {
|
|
960040
|
-
await (0,
|
|
960127
|
+
await (0, import_promises147.mkdir)(directoryOfWorkspace, { recursive: true });
|
|
960041
960128
|
}
|
|
960042
960129
|
const openApiFilePath = join8(directoryOfWorkspace, RelativeFilePath2.of("openapi.yml"));
|
|
960043
|
-
await (0,
|
|
960130
|
+
await (0, import_promises147.writeFile)(openApiFilePath, SAMPLE_OPENAPI);
|
|
960044
960131
|
await writeGeneratorsConfiguration({
|
|
960045
960132
|
filepath: join8(directoryOfWorkspace, RelativeFilePath2.of(GENERATORS_CONFIGURATION_FILENAME)),
|
|
960046
960133
|
cliVersion,
|
|
@@ -960085,7 +960172,7 @@ async function getDefaultGeneratorsConfiguration({ cliVersion, context: context3
|
|
|
960085
960172
|
return config5;
|
|
960086
960173
|
}
|
|
960087
960174
|
async function writeGeneratorsConfiguration({ filepath, cliVersion, context: context3, apiConfiguration }) {
|
|
960088
|
-
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 }), {
|
|
960089
960176
|
sortKeys: (a3, b5) => {
|
|
960090
960177
|
if (a3 === "api") {
|
|
960091
960178
|
return -1;
|
|
@@ -960104,8 +960191,8 @@ async function writeSampleApiDefinition({ directoryOfDefinition, apiName }) {
|
|
|
960104
960191
|
strategy: "status-code"
|
|
960105
960192
|
}
|
|
960106
960193
|
};
|
|
960107
|
-
await (0,
|
|
960108
|
-
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));
|
|
960109
960196
|
const absoluteFilepathToImdbYaml = join8(directoryOfDefinition, RelativeFilePath2.of("imdb.yml"));
|
|
960110
960197
|
let formattedContent;
|
|
960111
960198
|
try {
|
|
@@ -960121,7 +960208,7 @@ async function writeSampleApiDefinition({ directoryOfDefinition, apiName }) {
|
|
|
960121
960208
|
code: CliError.Code.ParseError
|
|
960122
960209
|
});
|
|
960123
960210
|
}
|
|
960124
|
-
await (0,
|
|
960211
|
+
await (0, import_promises147.writeFile)(absoluteFilepathToImdbYaml, formattedContent);
|
|
960125
960212
|
}
|
|
960126
960213
|
|
|
960127
960214
|
// ../init/lib/initializeAPI.js
|
|
@@ -960172,7 +960259,7 @@ async function getDirectoryOfNewAPIWorkspace({ absolutePathToFernDirectory, task
|
|
|
960172
960259
|
if (inlinedApiDefinition || inlinedOpenApiWorkspace) {
|
|
960173
960260
|
taskContext.logger.info("Creating workspaces to support multiple API Definitions.");
|
|
960174
960261
|
const apiWorkspaceDirectory = join8(absolutePathToFernDirectory, RelativeFilePath2.of(APIS_DIRECTORY), RelativeFilePath2.of("api"));
|
|
960175
|
-
await (0,
|
|
960262
|
+
await (0, import_promises148.mkdir)(apiWorkspaceDirectory, { recursive: true });
|
|
960176
960263
|
if (inlinedApiDefinition) {
|
|
960177
960264
|
const inlinedDefinitionDirectory = join8(absolutePathToFernDirectory, RelativeFilePath2.of(DEFINITION_DIRECTORY));
|
|
960178
960265
|
const workspaceDefinitionDirectory = join8(apiWorkspaceDirectory, RelativeFilePath2.of(DEFINITION_DIRECTORY));
|
|
@@ -960211,7 +960298,7 @@ init_lib19();
|
|
|
960211
960298
|
init_lib4();
|
|
960212
960299
|
init_lib8();
|
|
960213
960300
|
init_source();
|
|
960214
|
-
var
|
|
960301
|
+
var import_promises149 = require("fs/promises");
|
|
960215
960302
|
init_js_yaml();
|
|
960216
960303
|
async function initializeDocs({ organization, taskContext, versionOfCli }) {
|
|
960217
960304
|
const createDirectoryResponse = await createFernDirectoryAndWorkspace({
|
|
@@ -960227,7 +960314,7 @@ async function initializeDocs({ organization, taskContext, versionOfCli }) {
|
|
|
960227
960314
|
} else {
|
|
960228
960315
|
try {
|
|
960229
960316
|
const docsConfig = getDocsConfig(createDirectoryResponse.organization);
|
|
960230
|
-
await (0,
|
|
960317
|
+
await (0, import_promises149.writeFile)(docsYmlPath, index_vite_proxy_tmp_default.dump(docsConfig));
|
|
960231
960318
|
taskContext.logger.info(source_default.green("Created docs configuration"));
|
|
960232
960319
|
return;
|
|
960233
960320
|
} catch (writeError) {
|
|
@@ -960284,7 +960371,7 @@ var FernDocsBuilder = class {
|
|
|
960284
960371
|
init_lib12();
|
|
960285
960372
|
init_lib8();
|
|
960286
960373
|
init_lib6();
|
|
960287
|
-
var
|
|
960374
|
+
var import_promises150 = require("fs/promises");
|
|
960288
960375
|
init_js_yaml();
|
|
960289
960376
|
var FernDocsBuilderImpl = class extends FernDocsBuilder {
|
|
960290
960377
|
openApiSpecs = {};
|
|
@@ -960344,7 +960431,7 @@ var FernDocsBuilderImpl = class extends FernDocsBuilder {
|
|
|
960344
960431
|
}
|
|
960345
960432
|
async build({ outputDirectory }) {
|
|
960346
960433
|
const absolutePathToFernDirectory = join8(outputDirectory, RelativeFilePath2.of(FERN_DIRECTORY));
|
|
960347
|
-
await (0,
|
|
960434
|
+
await (0, import_promises150.mkdir)(absolutePathToFernDirectory, { recursive: true });
|
|
960348
960435
|
if (Object.keys(this.tabbedNavigation).length > 0) {
|
|
960349
960436
|
this.docsYml.tabs = Object.fromEntries(Object.entries(this.tabbedNavigation).map(([key2, value2]) => {
|
|
960350
960437
|
return [value2.tabId, value2.tabConfig];
|
|
@@ -960369,27 +960456,27 @@ var FernDocsBuilderImpl = class extends FernDocsBuilder {
|
|
|
960369
960456
|
}))
|
|
960370
960457
|
};
|
|
960371
960458
|
}
|
|
960372
|
-
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)));
|
|
960373
960460
|
await Promise.all(Object.entries(this.openApiSpecs).map(async ([relativePath, absolutePath]) => {
|
|
960374
960461
|
const absolutePathToOpenAPI = join8(absolutePathToFernDirectory, RelativeFilePath2.of(relativePath));
|
|
960375
|
-
await (0,
|
|
960376
|
-
await (0,
|
|
960462
|
+
await (0, import_promises150.mkdir)(dirname6(absolutePathToOpenAPI), { recursive: true });
|
|
960463
|
+
await (0, import_promises150.cp)(absolutePath, absolutePathToOpenAPI);
|
|
960377
960464
|
}));
|
|
960378
960465
|
}
|
|
960379
|
-
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 })));
|
|
960380
960467
|
await Promise.all(Object.entries(this.markdownPages).map(async ([filepath, page]) => {
|
|
960381
960468
|
const absoluteFilepathToMarkdownPage = join8(absolutePathToFernDirectory, RelativeFilePath2.of(filepath));
|
|
960382
|
-
await (0,
|
|
960469
|
+
await (0, import_promises150.mkdir)(dirname6(absoluteFilepathToMarkdownPage), { recursive: true });
|
|
960383
960470
|
const frontmatter = Object.keys(page.frontmatter).length > 0 ? `---
|
|
960384
960471
|
${index_vite_proxy_tmp_default.dump(JSON.parse(JSON.stringify(page.frontmatter)))}---
|
|
960385
960472
|
|
|
960386
960473
|
` : "";
|
|
960387
|
-
await (0,
|
|
960474
|
+
await (0, import_promises150.writeFile)(absoluteFilepathToMarkdownPage, `${frontmatter}${page.markdown}`);
|
|
960388
960475
|
}));
|
|
960389
960476
|
await Promise.all(Object.entries(this.assets).map(async ([filepath, asset]) => {
|
|
960390
960477
|
const absolutePathToAsset = join8(absolutePathToFernDirectory, RelativeFilePath2.of(filepath));
|
|
960391
|
-
await (0,
|
|
960392
|
-
await (0,
|
|
960478
|
+
await (0, import_promises150.mkdir)(dirname6(absolutePathToAsset), { recursive: true });
|
|
960479
|
+
await (0, import_promises150.cp)(asset.absoluteFilePathToAsset, absolutePathToAsset);
|
|
960393
960480
|
}));
|
|
960394
960481
|
}
|
|
960395
960482
|
setInstance({ companyName }) {
|
|
@@ -960423,7 +960510,7 @@ var NonTabbedNavigationBuilderImpl = class {
|
|
|
960423
960510
|
// ../docs-importers/mintlify/lib/MintlifyImporter.js
|
|
960424
960511
|
init_lib8();
|
|
960425
960512
|
init_lib6();
|
|
960426
|
-
var
|
|
960513
|
+
var import_promises152 = require("fs/promises");
|
|
960427
960514
|
|
|
960428
960515
|
// ../docs-importers/mintlify/lib/convertColors.js
|
|
960429
960516
|
function convertColors(colors19) {
|
|
@@ -960484,10 +960571,10 @@ init_lib8();
|
|
|
960484
960571
|
|
|
960485
960572
|
// ../docs-importers/mintlify/lib/convertMarkdown.js
|
|
960486
960573
|
init_lib8();
|
|
960487
|
-
var
|
|
960574
|
+
var import_promises151 = require("fs/promises");
|
|
960488
960575
|
var import_gray_matter11 = __toESM(require_gray_matter(), 1);
|
|
960489
960576
|
async function convertMarkdown({ absolutePathToMintJson, absoluteFilepathToMarkdown, relativeFilepathFromRoot, builder }) {
|
|
960490
|
-
const text9 = await (0,
|
|
960577
|
+
const text9 = await (0, import_promises151.readFile)(absoluteFilepathToMarkdown, "utf-8");
|
|
960491
960578
|
const { data: data2, content: content5 } = parseMintlifyFrontmatter(text9);
|
|
960492
960579
|
const slug = relativeFilepathFromRoot.replace(/\.(md|mdx)$/, "");
|
|
960493
960580
|
const transformedContent = markReferencedAssets({
|
|
@@ -960656,7 +960743,7 @@ var MintlifyImporter = class extends DocsImporter {
|
|
|
960656
960743
|
documentationTab = void 0;
|
|
960657
960744
|
tabUrlToInfo = {};
|
|
960658
960745
|
async import({ args, builder }) {
|
|
960659
|
-
const mintJsonContent = await (0,
|
|
960746
|
+
const mintJsonContent = await (0, import_promises152.readFile)(args.absolutePathToMintJson, "utf-8");
|
|
960660
960747
|
const mint = this.parseMintJson({
|
|
960661
960748
|
content: mintJsonContent,
|
|
960662
960749
|
absolutePathToMintJson: args.absolutePathToMintJson
|
|
@@ -960802,7 +960889,7 @@ var MintlifyImporter = class extends DocsImporter {
|
|
|
960802
960889
|
// ../docs-importers/mintlify/lib/runMintlifyMigration.js
|
|
960803
960890
|
init_lib12();
|
|
960804
960891
|
init_lib8();
|
|
960805
|
-
var
|
|
960892
|
+
var import_promises153 = require("fs/promises");
|
|
960806
960893
|
async function runMintlifyMigration({ absolutePathToMintJson, outputPath, taskContext, versionOfCli, organization }) {
|
|
960807
960894
|
const mintlifyImporter = new MintlifyImporter({
|
|
960808
960895
|
context: taskContext
|
|
@@ -960813,7 +960900,7 @@ async function runMintlifyMigration({ absolutePathToMintJson, outputPath, taskCo
|
|
|
960813
960900
|
builder
|
|
960814
960901
|
});
|
|
960815
960902
|
await builder.build({ outputDirectory: outputPath });
|
|
960816
|
-
await (0,
|
|
960903
|
+
await (0, import_promises153.writeFile)(join8(AbsoluteFilePath2.of(outputPath), RelativeFilePath2.of(FERN_DIRECTORY), RelativeFilePath2.of(PROJECT_CONFIG_FILENAME)), JSON.stringify({
|
|
960817
960904
|
version: versionOfCli,
|
|
960818
960905
|
organization
|
|
960819
960906
|
}, void 0, 4));
|
|
@@ -960874,7 +960961,7 @@ function assertIsStringArray(val) {
|
|
|
960874
960961
|
// ../docs-importers/readme/lib/ReadmeImporter.js
|
|
960875
960962
|
init_lib4();
|
|
960876
960963
|
init_lib8();
|
|
960877
|
-
var
|
|
960964
|
+
var import_promises154 = require("fs/promises");
|
|
960878
960965
|
|
|
960879
960966
|
// ../docs-importers/readme/lib/extract/favicon.js
|
|
960880
960967
|
init_unist_util_visit();
|
|
@@ -964228,7 +964315,7 @@ var ReadmeImporter = class extends DocsImporter {
|
|
|
964228
964315
|
if (response.ok) {
|
|
964229
964316
|
const imageBuffer = Buffer.from(await response.arrayBuffer());
|
|
964230
964317
|
const faviconPath = join8(assetsDirectory, RelativeFilePath2.of("favicon"));
|
|
964231
|
-
await (0,
|
|
964318
|
+
await (0, import_promises154.writeFile)(faviconPath, new Uint8Array(imageBuffer));
|
|
964232
964319
|
builder.setFavicon({ favicon: relativize(this.absolutePathToFernDirectory, faviconPath) });
|
|
964233
964320
|
}
|
|
964234
964321
|
}
|
|
@@ -964245,7 +964332,7 @@ var ReadmeImporter = class extends DocsImporter {
|
|
|
964245
964332
|
*/
|
|
964246
964333
|
async getAndCreateAssetsDirectory() {
|
|
964247
964334
|
const assetsDirectory = join8(this.absolutePathToFernDirectory, RelativeFilePath2.of("assets"));
|
|
964248
|
-
await (0,
|
|
964335
|
+
await (0, import_promises154.mkdir)(assetsDirectory, { recursive: true });
|
|
964249
964336
|
return assetsDirectory;
|
|
964250
964337
|
}
|
|
964251
964338
|
/**
|
|
@@ -964295,7 +964382,7 @@ var ReadmeImporter = class extends DocsImporter {
|
|
|
964295
964382
|
absolutePathToOutputDirectory,
|
|
964296
964383
|
section
|
|
964297
964384
|
});
|
|
964298
|
-
await (0,
|
|
964385
|
+
await (0, import_promises154.mkdir)(absolutePathToOutputDirectoryForSection, { recursive: true });
|
|
964299
964386
|
await Promise.all(section.pages.filter((page) => page.type === "page").map(async (page) => {
|
|
964300
964387
|
const url3 = new URL(page.slug.toString(), this.url);
|
|
964301
964388
|
this.logger.debug(`Fetching page: ${url3.toString()}`);
|
|
@@ -964310,7 +964397,7 @@ var ReadmeImporter = class extends DocsImporter {
|
|
|
964310
964397
|
absolutePathToOutputDirectoryForSection,
|
|
964311
964398
|
page: page.slug
|
|
964312
964399
|
});
|
|
964313
|
-
await (0,
|
|
964400
|
+
await (0, import_promises154.writeFile)(absolutePathForPage, result.data.mdx);
|
|
964314
964401
|
if (result.data.images.imageURLs.length > 0) {
|
|
964315
964402
|
this.logger.debug(`Found ${result.data.images.imageURLs.length} images to download for ${url3.toString()}`);
|
|
964316
964403
|
await Promise.all(Object.entries(result.data.images.imageURLToFilename).map(async ([imageUrl, filename]) => {
|
|
@@ -964323,8 +964410,8 @@ var ReadmeImporter = class extends DocsImporter {
|
|
|
964323
964410
|
const imageBuffer = Buffer.from(await response.arrayBuffer());
|
|
964324
964411
|
const imagePath = join8(absolutePathToOutputDirectoryForSection, RelativeFilePath2.of(filename));
|
|
964325
964412
|
const imageDir = dirname6(imagePath);
|
|
964326
|
-
await (0,
|
|
964327
|
-
await (0,
|
|
964413
|
+
await (0, import_promises154.mkdir)(imageDir, { recursive: true });
|
|
964414
|
+
await (0, import_promises154.writeFile)(imagePath, new Uint8Array(imageBuffer));
|
|
964328
964415
|
this.logger.debug(`Saved image to ${imagePath}`);
|
|
964329
964416
|
} catch (error50) {
|
|
964330
964417
|
this.logger.warn(`Error downloading image ${imageUrl}: ${error50}`);
|
|
@@ -964408,7 +964495,7 @@ var ReadmeImporter = class extends DocsImporter {
|
|
|
964408
964495
|
// ../docs-importers/readme/lib/runReadmeMigration.js
|
|
964409
964496
|
init_lib12();
|
|
964410
964497
|
init_lib8();
|
|
964411
|
-
var
|
|
964498
|
+
var import_promises155 = require("fs/promises");
|
|
964412
964499
|
async function runReadmeMigration({ readmeUrl, outputPath, taskContext, versionOfCli, organization }) {
|
|
964413
964500
|
const builder = new FernDocsBuilderImpl();
|
|
964414
964501
|
builder.setInstance({ companyName: organization });
|
|
@@ -964423,7 +964510,7 @@ async function runReadmeMigration({ readmeUrl, outputPath, taskContext, versionO
|
|
|
964423
964510
|
builder
|
|
964424
964511
|
});
|
|
964425
964512
|
await builder.build({ outputDirectory: outputPath });
|
|
964426
|
-
await (0,
|
|
964513
|
+
await (0, import_promises155.writeFile)(join8(AbsoluteFilePath2.of(outputPath), RelativeFilePath2.of(FERN_DIRECTORY), RelativeFilePath2.of(PROJECT_CONFIG_FILENAME)), JSON.stringify({
|
|
964427
964514
|
version: versionOfCli,
|
|
964428
964515
|
organization
|
|
964429
964516
|
}, void 0, 4));
|
|
@@ -964450,7 +964537,7 @@ var initializeWithReadme = async ({ readmeUrl, organization, taskContext, versio
|
|
|
964450
964537
|
|
|
964451
964538
|
// ../init/lib/utils/loadOpenApiFromUrl.js
|
|
964452
964539
|
init_axios2();
|
|
964453
|
-
var
|
|
964540
|
+
var import_promises156 = require("fs/promises");
|
|
964454
964541
|
init_js_yaml();
|
|
964455
964542
|
var import_path105 = require("path");
|
|
964456
964543
|
var import_tmp_promise19 = __toESM(require_tmp_promise(), 1);
|
|
@@ -964466,7 +964553,7 @@ async function loadOpenAPIFromUrl({ url: url3, logger: logger4 }) {
|
|
|
964466
964553
|
const filePath = (0, import_path105.join)(tmpDir.path, url3.endsWith(".json") ? "openapi.json" : "openapi.yaml");
|
|
964467
964554
|
logger4.debug("tmpDir", tmpDir.path);
|
|
964468
964555
|
logger4.debug("filePath", filePath);
|
|
964469
|
-
await (0,
|
|
964556
|
+
await (0, import_promises156.writeFile)(filePath, data2);
|
|
964470
964557
|
return {
|
|
964471
964558
|
status: LoadOpenAPIStatus.Success,
|
|
964472
964559
|
filePath
|
|
@@ -968392,7 +968479,7 @@ function getAutomationContextFromEnv() {
|
|
|
968392
968479
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
968393
968480
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
968394
968481
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
968395
|
-
cli_version: "5.65.
|
|
968482
|
+
cli_version: "5.65.2"
|
|
968396
968483
|
};
|
|
968397
968484
|
}
|
|
968398
968485
|
function isAutomationMode() {
|
|
@@ -969224,7 +969311,7 @@ var CliContext = class _CliContext {
|
|
|
969224
969311
|
if (false) {
|
|
969225
969312
|
this.logger.error("CLI_VERSION is not defined");
|
|
969226
969313
|
}
|
|
969227
|
-
return "5.65.
|
|
969314
|
+
return "5.65.2";
|
|
969228
969315
|
}
|
|
969229
969316
|
getCliName() {
|
|
969230
969317
|
if (false) {
|
|
@@ -969534,7 +969621,7 @@ init_lib19();
|
|
|
969534
969621
|
init_lib8();
|
|
969535
969622
|
init_lib6();
|
|
969536
969623
|
init_source();
|
|
969537
|
-
var
|
|
969624
|
+
var import_promises157 = require("fs/promises");
|
|
969538
969625
|
|
|
969539
969626
|
// ../project-loader/lib/normalizeCommandLineApiWorkspace.js
|
|
969540
969627
|
function normalizeCommandLineApiWorkspace(input3) {
|
|
@@ -969616,7 +969703,7 @@ async function loadApis({ cliName, fernDirectory, context: context3, cliVersion,
|
|
|
969616
969703
|
const apisDirectory = join8(fernDirectory, RelativeFilePath2.of(APIS_DIRECTORY));
|
|
969617
969704
|
const apisDirectoryExists = await doesPathExist(apisDirectory);
|
|
969618
969705
|
if (apisDirectoryExists) {
|
|
969619
|
-
const apiDirectoryContents = await (0,
|
|
969706
|
+
const apiDirectoryContents = await (0, import_promises157.readdir)(apisDirectory, { withFileTypes: true });
|
|
969620
969707
|
const apiWorkspaceDirectoryNames = apiDirectoryContents.reduce((all9, item) => {
|
|
969621
969708
|
if (item.isDirectory()) {
|
|
969622
969709
|
all9.push(item.name);
|
|
@@ -969694,13 +969781,13 @@ async function loadProjectAndRegisterWorkspacesWithContext(cliContext, args, reg
|
|
|
969694
969781
|
init_lib19();
|
|
969695
969782
|
init_lib6();
|
|
969696
969783
|
var import_generators_sdk6 = __toESM(require_generators_sdk(), 1);
|
|
969697
|
-
var
|
|
969784
|
+
var import_promises162 = require("fs/promises");
|
|
969698
969785
|
|
|
969699
969786
|
// src/commands/generator-list/getGeneratorList.ts
|
|
969700
969787
|
init_lib19();
|
|
969701
969788
|
init_lib4();
|
|
969702
969789
|
init_lib6();
|
|
969703
|
-
var
|
|
969790
|
+
var import_promises158 = require("fs/promises");
|
|
969704
969791
|
init_js_yaml();
|
|
969705
969792
|
var GenerationModeFilter = {
|
|
969706
969793
|
GitHub: "github",
|
|
@@ -969761,7 +969848,7 @@ async function getGeneratorList({
|
|
|
969761
969848
|
return;
|
|
969762
969849
|
}
|
|
969763
969850
|
try {
|
|
969764
|
-
await (0,
|
|
969851
|
+
await (0, import_promises158.writeFile)(outputLocation, generatorsListYaml);
|
|
969765
969852
|
} catch (error50) {
|
|
969766
969853
|
cliContext.failAndThrow(`Could not write file to the specified location: ${outputLocation}`, error50, {
|
|
969767
969854
|
code: CliError.Code.ConfigError
|
|
@@ -969831,7 +969918,7 @@ async function getGeneratorMetadata({
|
|
|
969831
969918
|
|
|
969832
969919
|
// src/commands/organization/getOrganization.ts
|
|
969833
969920
|
init_lib6();
|
|
969834
|
-
var
|
|
969921
|
+
var import_promises159 = require("fs/promises");
|
|
969835
969922
|
async function getOrganization({
|
|
969836
969923
|
project,
|
|
969837
969924
|
outputLocation,
|
|
@@ -969843,7 +969930,7 @@ async function getOrganization({
|
|
|
969843
969930
|
return;
|
|
969844
969931
|
}
|
|
969845
969932
|
try {
|
|
969846
|
-
await (0,
|
|
969933
|
+
await (0, import_promises159.writeFile)(outputLocation, org);
|
|
969847
969934
|
} catch (error50) {
|
|
969848
969935
|
context3.failAndThrow(`Could not write file to the specified location: ${outputLocation}`, error50, {
|
|
969849
969936
|
code: CliError.Code.ConfigError
|
|
@@ -969856,7 +969943,7 @@ init_lib19();
|
|
|
969856
969943
|
init_lib8();
|
|
969857
969944
|
init_lib6();
|
|
969858
969945
|
init_source();
|
|
969859
|
-
var
|
|
969946
|
+
var import_promises161 = require("fs/promises");
|
|
969860
969947
|
var import_path107 = __toESM(require("path"), 1);
|
|
969861
969948
|
var import_semver16 = __toESM(require_semver2(), 1);
|
|
969862
969949
|
var import_yaml6 = __toESM(require_dist11(), 1);
|
|
@@ -969866,14 +969953,14 @@ init_lib4();
|
|
|
969866
969953
|
init_lib33();
|
|
969867
969954
|
init_lib6();
|
|
969868
969955
|
var import_fs40 = require("fs");
|
|
969869
|
-
var
|
|
969870
|
-
var
|
|
969956
|
+
var import_promises160 = require("fs/promises");
|
|
969957
|
+
var import_os16 = require("os");
|
|
969871
969958
|
var import_path106 = require("path");
|
|
969872
969959
|
var import_semver15 = __toESM(require_semver2(), 1);
|
|
969873
969960
|
var import_url10 = require("url");
|
|
969874
969961
|
var MIGRATION_PACKAGE_NAME2 = "@fern-api/generator-migrations";
|
|
969875
969962
|
function getMigrationCacheDir() {
|
|
969876
|
-
return (0, import_path106.join)((0,
|
|
969963
|
+
return (0, import_path106.join)((0, import_os16.homedir)(), ".fern", "migration-cache");
|
|
969877
969964
|
}
|
|
969878
969965
|
var LOCK_FILENAME = ".install.lock";
|
|
969879
969966
|
var LOCK_POLL_MS = 200;
|
|
@@ -969894,7 +969981,7 @@ async function acquireLock3(logger4, cacheDir) {
|
|
|
969894
969981
|
const myPid = String(process.pid);
|
|
969895
969982
|
while (true) {
|
|
969896
969983
|
try {
|
|
969897
|
-
const fh = await (0,
|
|
969984
|
+
const fh = await (0, import_promises160.open)(lockPath, "wx");
|
|
969898
969985
|
await fh.writeFile(myPid);
|
|
969899
969986
|
await fh.close();
|
|
969900
969987
|
const exitHandler = () => {
|
|
@@ -969911,9 +969998,9 @@ async function acquireLock3(logger4, cacheDir) {
|
|
|
969911
969998
|
return async () => {
|
|
969912
969999
|
process.removeListener("exit", exitHandler);
|
|
969913
970000
|
try {
|
|
969914
|
-
const currentContent = await (0,
|
|
970001
|
+
const currentContent = await (0, import_promises160.readFile)(lockPath, "utf-8");
|
|
969915
970002
|
if (currentContent.trim() === myPid) {
|
|
969916
|
-
await (0,
|
|
970003
|
+
await (0, import_promises160.unlink)(lockPath);
|
|
969917
970004
|
} else {
|
|
969918
970005
|
logger4.debug(
|
|
969919
970006
|
`Lock file owned by another process (expected pid=${myPid}, found=${currentContent.trim()}); skipping release`
|
|
@@ -969929,14 +970016,14 @@ async function acquireLock3(logger4, cacheDir) {
|
|
|
969929
970016
|
throw err;
|
|
969930
970017
|
}
|
|
969931
970018
|
try {
|
|
969932
|
-
const lockContent = await (0,
|
|
970019
|
+
const lockContent = await (0, import_promises160.readFile)(lockPath, "utf-8");
|
|
969933
970020
|
const lockPid = Number(lockContent.trim());
|
|
969934
|
-
const lockStat = await (0,
|
|
970021
|
+
const lockStat = await (0, import_promises160.stat)(lockPath);
|
|
969935
970022
|
const lockAge = Date.now() - lockStat.mtimeMs;
|
|
969936
970023
|
if (lockAge > LOCK_STALE_MS || Number.isFinite(lockPid) && lockPid > 0 && !isProcessAlive(lockPid)) {
|
|
969937
970024
|
logger4.debug(`Removing stale migration lock (pid=${lockContent.trim()}, age=${lockAge}ms)`);
|
|
969938
970025
|
try {
|
|
969939
|
-
await (0,
|
|
970026
|
+
await (0, import_promises160.unlink)(lockPath);
|
|
969940
970027
|
} catch (unlinkErr) {
|
|
969941
970028
|
logger4.debug(`Failed to remove stale lock: ${unlinkErr}`);
|
|
969942
970029
|
}
|
|
@@ -969960,7 +970047,7 @@ async function ensureMigrationsInstalled(logger4) {
|
|
|
969960
970047
|
}
|
|
969961
970048
|
migrationsInstallPromise = (async () => {
|
|
969962
970049
|
const cacheDir = getMigrationCacheDir();
|
|
969963
|
-
await (0,
|
|
970050
|
+
await (0, import_promises160.mkdir)(cacheDir, { recursive: true });
|
|
969964
970051
|
const npmCacheDir = (0, import_path106.join)(cacheDir, ".npm-cache");
|
|
969965
970052
|
const packageDir = (0, import_path106.join)(cacheDir, "node_modules", MIGRATION_PACKAGE_NAME2);
|
|
969966
970053
|
const packageJsonPath = (0, import_path106.join)(packageDir, "package.json");
|
|
@@ -969977,7 +970064,7 @@ async function ensureMigrationsInstalled(logger4) {
|
|
|
969977
970064
|
"--no-audit",
|
|
969978
970065
|
"--no-fund"
|
|
969979
970066
|
]);
|
|
969980
|
-
const packageJsonContent = await (0,
|
|
970067
|
+
const packageJsonContent = await (0, import_promises160.readFile)(packageJsonPath, "utf-8");
|
|
969981
970068
|
const packageJson2 = JSON.parse(packageJsonContent);
|
|
969982
970069
|
if (packageJson2.main == null) {
|
|
969983
970070
|
throw new CliError({
|
|
@@ -970161,7 +970248,7 @@ async function loadAndUpdateGenerators({
|
|
|
970161
970248
|
skippedAutoreleaseDisabled: []
|
|
970162
970249
|
};
|
|
970163
970250
|
}
|
|
970164
|
-
const contents = await (0,
|
|
970251
|
+
const contents = await (0, import_promises161.readFile)(filepath);
|
|
970165
970252
|
context3.logger.debug(`Found generators: ${contents.toString()}`);
|
|
970166
970253
|
const parsedDocument = import_yaml6.default.parseDocument(contents.toString());
|
|
970167
970254
|
const generatorGroups = parsedDocument.get("groups");
|
|
@@ -970398,7 +970485,7 @@ async function upgradeGenerator({
|
|
|
970398
970485
|
absolutePathToWorkspace: workspace.absoluteFilePath
|
|
970399
970486
|
});
|
|
970400
970487
|
if (absolutePathToGeneratorsConfiguration != null && result.updatedConfiguration != null) {
|
|
970401
|
-
await (0,
|
|
970488
|
+
await (0, import_promises161.writeFile)(absolutePathToGeneratorsConfiguration, result.updatedConfiguration);
|
|
970402
970489
|
}
|
|
970403
970490
|
allSkippedMajorUpgrades.push(...result.skippedMajorUpgrades);
|
|
970404
970491
|
if (result.appliedUpgrades.length > 0) {
|
|
@@ -970798,7 +970885,7 @@ function addGeneratorCommands(cli, cliContext) {
|
|
|
970798
970885
|
}
|
|
970799
970886
|
if (argv.output) {
|
|
970800
970887
|
try {
|
|
970801
|
-
await (0,
|
|
970888
|
+
await (0, import_promises162.writeFile)(argv.output, JSON.stringify(generatorMetadata, null, 2));
|
|
970802
970889
|
} catch (error50) {
|
|
970803
970890
|
cliContext.failAndThrow(
|
|
970804
970891
|
`Could not write file to the specified location: ${argv.output}`,
|
|
@@ -970815,7 +970902,7 @@ function addGeneratorCommands(cli, cliContext) {
|
|
|
970815
970902
|
// src/commands/add-generator/addGeneratorToWorkspaces.ts
|
|
970816
970903
|
init_lib19();
|
|
970817
970904
|
init_source();
|
|
970818
|
-
var
|
|
970905
|
+
var import_promises163 = require("fs/promises");
|
|
970819
970906
|
init_js_yaml();
|
|
970820
970907
|
async function addGeneratorToWorkspaces({
|
|
970821
970908
|
project: { apiWorkspaces },
|
|
@@ -970843,7 +970930,7 @@ async function addGeneratorToWorkspaces({
|
|
|
970843
970930
|
if (absolutePathToGeneratorsConfiguration == null) {
|
|
970844
970931
|
return;
|
|
970845
970932
|
}
|
|
970846
|
-
await (0,
|
|
970933
|
+
await (0, import_promises163.writeFile)(
|
|
970847
970934
|
absolutePathToGeneratorsConfiguration,
|
|
970848
970935
|
"# yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json\n" + index_vite_proxy_tmp_default.dump(newConfiguration)
|
|
970849
970936
|
);
|
|
@@ -970911,18 +970998,18 @@ var LOCAL_STORAGE_FOLDER6 = ".fern-dev";
|
|
|
970911
970998
|
|
|
970912
970999
|
// src/commands/generate/checkOutputDirectory.ts
|
|
970913
971000
|
init_lib8();
|
|
970914
|
-
var
|
|
971001
|
+
var import_promises166 = require("fs/promises");
|
|
970915
971002
|
|
|
970916
971003
|
// src/persistence/output-directories/getOutputDirectories.ts
|
|
970917
971004
|
init_lib8();
|
|
970918
|
-
var
|
|
971005
|
+
var import_promises164 = require("fs/promises");
|
|
970919
971006
|
|
|
970920
971007
|
// src/persistence/output-directories/getPathToOutputDirectoriesFile.ts
|
|
970921
971008
|
init_lib8();
|
|
970922
|
-
var
|
|
971009
|
+
var import_os17 = require("os");
|
|
970923
971010
|
function getPathToOutputDirectoriesFile() {
|
|
970924
971011
|
return join8(
|
|
970925
|
-
AbsoluteFilePath2.of((0,
|
|
971012
|
+
AbsoluteFilePath2.of((0, import_os17.homedir)()),
|
|
970926
971013
|
RelativeFilePath2.of(LOCAL_STORAGE_FOLDER6),
|
|
970927
971014
|
RelativeFilePath2.of(APPROVED_DIRECTORIES_FILENAME)
|
|
970928
971015
|
);
|
|
@@ -970935,17 +971022,17 @@ async function getOutputDirectories() {
|
|
|
970935
971022
|
if (!doesOutputDirectoriesFileExist) {
|
|
970936
971023
|
return [];
|
|
970937
971024
|
}
|
|
970938
|
-
const outputDirectoriesFileContents = await (0,
|
|
971025
|
+
const outputDirectoriesFileContents = await (0, import_promises164.readFile)(pathToOutputDirectoriesFile, { encoding: "utf-8" });
|
|
970939
971026
|
const outputDirectories = JSON.parse(outputDirectoriesFileContents);
|
|
970940
971027
|
return outputDirectories;
|
|
970941
971028
|
}
|
|
970942
971029
|
|
|
970943
971030
|
// src/persistence/output-directories/storeOutputDirectories.ts
|
|
970944
|
-
var
|
|
971031
|
+
var import_promises165 = require("fs/promises");
|
|
970945
971032
|
var import_path108 = __toESM(require("path"), 1);
|
|
970946
971033
|
async function storeOutputDirectories(outputDirectories) {
|
|
970947
|
-
await (0,
|
|
970948
|
-
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));
|
|
970949
971036
|
}
|
|
970950
971037
|
|
|
970951
971038
|
// src/commands/generate/checkOutputDirectory.ts
|
|
@@ -970967,7 +971054,7 @@ async function checkOutputDirectory(outputPath, cliContext, force) {
|
|
|
970967
971054
|
shouldProceed: true
|
|
970968
971055
|
};
|
|
970969
971056
|
}
|
|
970970
|
-
const files = await (0,
|
|
971057
|
+
const files = await (0, import_promises166.readdir)(outputPath);
|
|
970971
971058
|
if (files.length === 0) {
|
|
970972
971059
|
return {
|
|
970973
971060
|
shouldProceed: true
|
|
@@ -971960,7 +972047,7 @@ function renderOverflowWarning(failureCount) {
|
|
|
971960
972047
|
// src/commands/automations/generate/reportGenerateResults.ts
|
|
971961
972048
|
init_lib4();
|
|
971962
972049
|
var import_fs41 = require("fs");
|
|
971963
|
-
var
|
|
972050
|
+
var import_promises167 = require("fs/promises");
|
|
971964
972051
|
var JSON_SCHEMA_VERSION = 1;
|
|
971965
972052
|
function renderStdoutSummary(results) {
|
|
971966
972053
|
return formatCounts(countResults(results));
|
|
@@ -972150,12 +972237,12 @@ async function writeResults({
|
|
|
972150
972237
|
const stepSummaryPath = getGithubStepSummaryPath();
|
|
972151
972238
|
if (stepSummaryPath != null) {
|
|
972152
972239
|
try {
|
|
972153
|
-
await (0,
|
|
972240
|
+
await (0, import_promises167.appendFile)(stepSummaryPath, renderMarkdownSummary(results), "utf8");
|
|
972154
972241
|
} catch {
|
|
972155
972242
|
}
|
|
972156
972243
|
}
|
|
972157
972244
|
if (jsonOutputPath != null) {
|
|
972158
|
-
await (0,
|
|
972245
|
+
await (0, import_promises167.writeFile)(jsonOutputPath, JSON.stringify(renderJsonSummary(results), null, 2), "utf8");
|
|
972159
972246
|
}
|
|
972160
972247
|
}
|
|
972161
972248
|
function writeResultsSync({
|
|
@@ -972482,7 +972569,7 @@ function listPreviewGroups({
|
|
|
972482
972569
|
init_lib19();
|
|
972483
972570
|
init_lib6();
|
|
972484
972571
|
init_source();
|
|
972485
|
-
var
|
|
972572
|
+
var import_promises197 = require("fs/promises");
|
|
972486
972573
|
|
|
972487
972574
|
// ../cli-migrations/lib/runMigrations.js
|
|
972488
972575
|
init_lib4();
|
|
@@ -972493,7 +972580,7 @@ init_source();
|
|
|
972493
972580
|
init_lib27();
|
|
972494
972581
|
|
|
972495
972582
|
// ../cli-migrations/lib/migrations/0.0.191/discriminant/migration.js
|
|
972496
|
-
var
|
|
972583
|
+
var import_promises168 = require("fs/promises");
|
|
972497
972584
|
|
|
972498
972585
|
// ../cli-migrations/lib/migrations/0.0.191/discriminant/getAllYamlFiles.js
|
|
972499
972586
|
init_lib8();
|
|
@@ -972530,7 +972617,7 @@ var migration = {
|
|
|
972530
972617
|
try {
|
|
972531
972618
|
const fileContents = await getFileContents(yamlFilepath);
|
|
972532
972619
|
const newContents = addDiscriminantToFile(fileContents);
|
|
972533
|
-
await (0,
|
|
972620
|
+
await (0, import_promises168.writeFile)(yamlFilepath, newContents);
|
|
972534
972621
|
} catch (error50) {
|
|
972535
972622
|
context3.failAndThrow("Failed to migrate " + yamlFilepath, error50);
|
|
972536
972623
|
}
|
|
@@ -972538,7 +972625,7 @@ var migration = {
|
|
|
972538
972625
|
}
|
|
972539
972626
|
};
|
|
972540
972627
|
async function getFileContents(filepath) {
|
|
972541
|
-
const buffer = await (0,
|
|
972628
|
+
const buffer = await (0, import_promises168.readFile)(filepath);
|
|
972542
972629
|
return buffer.toString();
|
|
972543
972630
|
}
|
|
972544
972631
|
var UNION_REGEX = /^(\s{2,})union:\s*$/gm;
|
|
@@ -972567,7 +972654,7 @@ var versionMigrations = {
|
|
|
972567
972654
|
var __default = versionMigrations;
|
|
972568
972655
|
|
|
972569
972656
|
// ../cli-migrations/lib/migrations/0.0.203/union-single-property-key/migration.js
|
|
972570
|
-
var
|
|
972657
|
+
var import_promises169 = require("fs/promises");
|
|
972571
972658
|
var import_yaml7 = __toESM(require_dist11(), 1);
|
|
972572
972659
|
|
|
972573
972660
|
// ../cli-migrations/lib/migrations/0.0.203/union-single-property-key/getAllYamlFiles.js
|
|
@@ -972611,7 +972698,7 @@ var migration2 = {
|
|
|
972611
972698
|
}
|
|
972612
972699
|
};
|
|
972613
972700
|
async function migrateFile(filepath, context3) {
|
|
972614
|
-
const contents = await (0,
|
|
972701
|
+
const contents = await (0, import_promises169.readFile)(filepath);
|
|
972615
972702
|
const parsedDocument = import_yaml7.default.parseDocument(contents.toString());
|
|
972616
972703
|
const types4 = parsedDocument.get("types");
|
|
972617
972704
|
if (types4 == null) {
|
|
@@ -972643,7 +972730,7 @@ async function migrateFile(filepath, context3) {
|
|
|
972643
972730
|
}
|
|
972644
972731
|
}
|
|
972645
972732
|
}
|
|
972646
|
-
await (0,
|
|
972733
|
+
await (0, import_promises169.writeFile)(filepath, parsedDocument.toString());
|
|
972647
972734
|
}
|
|
972648
972735
|
|
|
972649
972736
|
// ../cli-migrations/lib/migrations/0.0.203/index.js
|
|
@@ -972654,7 +972741,7 @@ var versionMigrations2 = {
|
|
|
972654
972741
|
var __default2 = versionMigrations2;
|
|
972655
972742
|
|
|
972656
972743
|
// ../cli-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/migration.js
|
|
972657
|
-
var
|
|
972744
|
+
var import_promises170 = require("fs/promises");
|
|
972658
972745
|
var import_yaml8 = __toESM(require_dist11(), 1);
|
|
972659
972746
|
|
|
972660
972747
|
// ../cli-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/getAllGeneratorYamlFiles.js
|
|
@@ -972698,7 +972785,7 @@ var migration3 = {
|
|
|
972698
972785
|
}
|
|
972699
972786
|
};
|
|
972700
972787
|
async function migrateGeneratorsYml(filepath, context3) {
|
|
972701
|
-
const contents = await (0,
|
|
972788
|
+
const contents = await (0, import_promises170.readFile)(filepath);
|
|
972702
972789
|
const parsedDocument = import_yaml8.default.parseDocument(contents.toString());
|
|
972703
972790
|
const draftGenerators = parsedDocument.get("draft");
|
|
972704
972791
|
if (draftGenerators == null) {
|
|
@@ -972725,7 +972812,7 @@ async function migrateGeneratorsYml(filepath, context3) {
|
|
|
972725
972812
|
draftGenerator.set("output-path", name2.value.includes("openapi") ? "./generated-openapi" : name2.value.includes("postman") ? "./generated-postman" : localOutput);
|
|
972726
972813
|
}
|
|
972727
972814
|
});
|
|
972728
|
-
await (0,
|
|
972815
|
+
await (0, import_promises170.writeFile)(filepath, parsedDocument.toString());
|
|
972729
972816
|
}
|
|
972730
972817
|
|
|
972731
972818
|
// ../cli-migrations/lib/migrations/0.0.207/index.js
|
|
@@ -972736,7 +972823,7 @@ var versionMigrations3 = {
|
|
|
972736
972823
|
var __default3 = versionMigrations3;
|
|
972737
972824
|
|
|
972738
972825
|
// ../cli-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/migration.js
|
|
972739
|
-
var
|
|
972826
|
+
var import_promises171 = require("fs/promises");
|
|
972740
972827
|
var import_yaml9 = __toESM(require_dist11(), 1);
|
|
972741
972828
|
|
|
972742
972829
|
// ../cli-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/getAllYamlFiles.js
|
|
@@ -972780,7 +972867,7 @@ var migration4 = {
|
|
|
972780
972867
|
}
|
|
972781
972868
|
};
|
|
972782
972869
|
async function migrateFile2(filepath, context3) {
|
|
972783
|
-
const contents = await (0,
|
|
972870
|
+
const contents = await (0, import_promises171.readFile)(filepath);
|
|
972784
972871
|
const parsedDocument = import_yaml9.default.parseDocument(contents.toString());
|
|
972785
972872
|
const addType = (typeName, typeDeclaration2) => {
|
|
972786
972873
|
const types4 = parsedDocument.get("types");
|
|
@@ -972824,7 +972911,7 @@ async function migrateFile2(filepath, context3) {
|
|
|
972824
972911
|
}
|
|
972825
972912
|
}
|
|
972826
972913
|
}
|
|
972827
|
-
await (0,
|
|
972914
|
+
await (0, import_promises171.writeFile)(filepath, parsedDocument.toString());
|
|
972828
972915
|
}
|
|
972829
972916
|
|
|
972830
972917
|
// ../cli-migrations/lib/migrations/0.0.210/index.js
|
|
@@ -972835,7 +972922,7 @@ var versionMigrations4 = {
|
|
|
972835
972922
|
var __default4 = versionMigrations4;
|
|
972836
972923
|
|
|
972837
972924
|
// ../cli-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/migration.js
|
|
972838
|
-
var
|
|
972925
|
+
var import_promises172 = require("fs/promises");
|
|
972839
972926
|
var import_yaml10 = __toESM(require_dist11(), 1);
|
|
972840
972927
|
|
|
972841
972928
|
// ../cli-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/getAllGeneratorYamlFiles.js
|
|
@@ -972879,7 +972966,7 @@ var migration5 = {
|
|
|
972879
972966
|
}
|
|
972880
972967
|
};
|
|
972881
972968
|
async function migrateGeneratorsYml2(filepath, context3) {
|
|
972882
|
-
const contents = await (0,
|
|
972969
|
+
const contents = await (0, import_promises172.readFile)(filepath);
|
|
972883
972970
|
const parsedDocument = import_yaml10.default.parseDocument(contents.toString());
|
|
972884
972971
|
const releaseGenerators = parsedDocument.get("release");
|
|
972885
972972
|
if (releaseGenerators == null) {
|
|
@@ -972917,7 +973004,7 @@ async function migrateGeneratorsYml2(filepath, context3) {
|
|
|
972917
973004
|
}
|
|
972918
973005
|
releaseGenerator.delete("outputs");
|
|
972919
973006
|
});
|
|
972920
|
-
await (0,
|
|
973007
|
+
await (0, import_promises172.writeFile)(filepath, parsedDocument.toString());
|
|
972921
973008
|
}
|
|
972922
973009
|
|
|
972923
973010
|
// ../cli-migrations/lib/migrations/0.0.212/index.js
|
|
@@ -972928,7 +973015,7 @@ var versionMigrations5 = {
|
|
|
972928
973015
|
var __default5 = versionMigrations5;
|
|
972929
973016
|
|
|
972930
973017
|
// ../cli-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/migration.js
|
|
972931
|
-
var
|
|
973018
|
+
var import_promises173 = require("fs/promises");
|
|
972932
973019
|
|
|
972933
973020
|
// ../cli-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/getAllYamlFiles.js
|
|
972934
973021
|
init_lib8();
|
|
@@ -972962,9 +973049,9 @@ var migration6 = {
|
|
|
972962
973049
|
run: async ({ context: context3 }) => {
|
|
972963
973050
|
const yamlFiles = await getAllYamlFiles4(context3);
|
|
972964
973051
|
for (const filepath of yamlFiles) {
|
|
972965
|
-
const contents = await (0,
|
|
973052
|
+
const contents = await (0, import_promises173.readFile)(filepath);
|
|
972966
973053
|
const newContents = contents.toString().replaceAll(" alias:", " type:");
|
|
972967
|
-
await (0,
|
|
973054
|
+
await (0, import_promises173.writeFile)(filepath, newContents);
|
|
972968
973055
|
}
|
|
972969
973056
|
}
|
|
972970
973057
|
};
|
|
@@ -972977,7 +973064,7 @@ var versionMigrations6 = {
|
|
|
972977
973064
|
var __default6 = versionMigrations6;
|
|
972978
973065
|
|
|
972979
973066
|
// ../cli-migrations/lib/migrations/0.0.221/add-error-discriminant/migration.js
|
|
972980
|
-
var
|
|
973067
|
+
var import_promises174 = require("fs/promises");
|
|
972981
973068
|
|
|
972982
973069
|
// ../cli-migrations/lib/migrations/0.0.221/add-error-discriminant/getAllRootApiYamlFiles.js
|
|
972983
973070
|
init_lib8();
|
|
@@ -973011,9 +973098,9 @@ var migration7 = {
|
|
|
973011
973098
|
run: async ({ context: context3 }) => {
|
|
973012
973099
|
const yamlFiles = await getAllRootApiYamlFiles(context3);
|
|
973013
973100
|
for (const filepath of yamlFiles) {
|
|
973014
|
-
const contents = await (0,
|
|
973101
|
+
const contents = await (0, import_promises174.readFile)(filepath);
|
|
973015
973102
|
const newContents = contents.toString() + "\nerror-discriminant: error";
|
|
973016
|
-
await (0,
|
|
973103
|
+
await (0, import_promises174.writeFile)(filepath, newContents);
|
|
973017
973104
|
}
|
|
973018
973105
|
}
|
|
973019
973106
|
};
|
|
@@ -973027,7 +973114,7 @@ var __default7 = versionMigrations7;
|
|
|
973027
973114
|
|
|
973028
973115
|
// ../cli-migrations/lib/migrations/0.0.241/add-generator-groups/migration.js
|
|
973029
973116
|
init_lib4();
|
|
973030
|
-
var
|
|
973117
|
+
var import_promises175 = require("fs/promises");
|
|
973031
973118
|
init_js_yaml();
|
|
973032
973119
|
|
|
973033
973120
|
// ../cli-migrations/lib/migrations/0.0.241/add-generator-groups/getAllGeneratorYamlFiles.js
|
|
@@ -973161,7 +973248,7 @@ var migration8 = {
|
|
|
973161
973248
|
}
|
|
973162
973249
|
};
|
|
973163
973250
|
async function migrateGeneratorsYml3(filepath) {
|
|
973164
|
-
const contentsStr = await (0,
|
|
973251
|
+
const contentsStr = await (0, import_promises175.readFile)(filepath);
|
|
973165
973252
|
const contents = index_vite_proxy_tmp_default.load(contentsStr.toString());
|
|
973166
973253
|
const oldGeneratorsConfiguration = GeneratorsConfigurationSchema2.parse(contents);
|
|
973167
973254
|
let newGeneratorsConfiguration = {};
|
|
@@ -973179,7 +973266,7 @@ async function migrateGeneratorsYml3(filepath) {
|
|
|
973179
973266
|
generators: oldGeneratorsConfiguration.release.map((releaseGeneratorInvocation) => convertReleaseGeneratorInvocation(releaseGeneratorInvocation))
|
|
973180
973267
|
};
|
|
973181
973268
|
}
|
|
973182
|
-
await (0,
|
|
973269
|
+
await (0, import_promises175.writeFile)(filepath, index_vite_proxy_tmp_default.dump(newGeneratorsConfiguration));
|
|
973183
973270
|
}
|
|
973184
973271
|
function convertDraftGeneratorInvocation(draftGeneratorInvocation) {
|
|
973185
973272
|
const newSchema = {
|
|
@@ -973254,7 +973341,7 @@ var versionMigrations8 = {
|
|
|
973254
973341
|
var __default8 = versionMigrations8;
|
|
973255
973342
|
|
|
973256
973343
|
// ../cli-migrations/lib/migrations/0.0.248/add-error-discrimination-config/migration.js
|
|
973257
|
-
var
|
|
973344
|
+
var import_promises176 = require("fs/promises");
|
|
973258
973345
|
var import_yaml11 = __toESM(require_dist11(), 1);
|
|
973259
973346
|
|
|
973260
973347
|
// ../cli-migrations/lib/migrations/0.0.248/add-error-discrimination-config/getAllRootApiYamlFiles.js
|
|
@@ -973298,7 +973385,7 @@ var migration9 = {
|
|
|
973298
973385
|
}
|
|
973299
973386
|
};
|
|
973300
973387
|
async function migrateRootApiFile(filepath) {
|
|
973301
|
-
const contents = await (0,
|
|
973388
|
+
const contents = await (0, import_promises176.readFile)(filepath);
|
|
973302
973389
|
const parsedDocument = import_yaml11.default.parseDocument(contents.toString());
|
|
973303
973390
|
const errorDiscriminant = parsedDocument.get("error-discriminant", true);
|
|
973304
973391
|
if (errorDiscriminant == null || !import_yaml11.default.isScalar(errorDiscriminant) || typeof errorDiscriminant.value !== "string") {
|
|
@@ -973309,7 +973396,7 @@ async function migrateRootApiFile(filepath) {
|
|
|
973309
973396
|
"property-name": errorDiscriminant.value
|
|
973310
973397
|
});
|
|
973311
973398
|
parsedDocument.delete("error-discriminant");
|
|
973312
|
-
await (0,
|
|
973399
|
+
await (0, import_promises176.writeFile)(filepath, parsedDocument.toString());
|
|
973313
973400
|
}
|
|
973314
973401
|
|
|
973315
973402
|
// ../cli-migrations/lib/migrations/0.0.248/index.js
|
|
@@ -973320,7 +973407,7 @@ var versionMigrations9 = {
|
|
|
973320
973407
|
var __default9 = versionMigrations9;
|
|
973321
973408
|
|
|
973322
973409
|
// ../cli-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/migration.js
|
|
973323
|
-
var
|
|
973410
|
+
var import_promises177 = require("fs/promises");
|
|
973324
973411
|
var import_yaml12 = __toESM(require_dist11(), 1);
|
|
973325
973412
|
|
|
973326
973413
|
// ../cli-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/getAllYamlFiles.js
|
|
@@ -973364,7 +973451,7 @@ var migration10 = {
|
|
|
973364
973451
|
}
|
|
973365
973452
|
};
|
|
973366
973453
|
async function migrateYamlFile(filepath, context3) {
|
|
973367
|
-
const contents = await (0,
|
|
973454
|
+
const contents = await (0, import_promises177.readFile)(filepath);
|
|
973368
973455
|
const parsedDocument = import_yaml12.default.parseDocument(contents.toString());
|
|
973369
973456
|
const services = parsedDocument.get("services");
|
|
973370
973457
|
if (services == null) {
|
|
@@ -973404,7 +973491,7 @@ async function migrateYamlFile(filepath, context3) {
|
|
|
973404
973491
|
context3.failWithoutThrowing("Failed to convert endpoint", e2);
|
|
973405
973492
|
}
|
|
973406
973493
|
}
|
|
973407
|
-
await (0,
|
|
973494
|
+
await (0, import_promises177.writeFile)(filepath, parsedDocument.toString());
|
|
973408
973495
|
}
|
|
973409
973496
|
}
|
|
973410
973497
|
function convertEndpoint4({ document: document4, endpoint: endpoint3 }) {
|
|
@@ -973483,7 +973570,7 @@ var versionMigrations10 = {
|
|
|
973483
973570
|
var __default10 = versionMigrations10;
|
|
973484
973571
|
|
|
973485
973572
|
// ../cli-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/migration.js
|
|
973486
|
-
var
|
|
973573
|
+
var import_promises178 = require("fs/promises");
|
|
973487
973574
|
var import_yaml13 = __toESM(require_dist11(), 1);
|
|
973488
973575
|
|
|
973489
973576
|
// ../cli-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/getAllYamlFiles.js
|
|
@@ -973527,7 +973614,7 @@ var migration11 = {
|
|
|
973527
973614
|
}
|
|
973528
973615
|
};
|
|
973529
973616
|
async function migrateYamlFile2(filepath, context3) {
|
|
973530
|
-
const contents = await (0,
|
|
973617
|
+
const contents = await (0, import_promises178.readFile)(filepath);
|
|
973531
973618
|
const parsedDocument = import_yaml13.default.parseDocument(contents.toString());
|
|
973532
973619
|
const types4 = parsedDocument.get("types");
|
|
973533
973620
|
if (types4 == null) {
|
|
@@ -973553,7 +973640,7 @@ async function migrateYamlFile2(filepath, context3) {
|
|
|
973553
973640
|
examples.set(i5, { value: value2 });
|
|
973554
973641
|
}
|
|
973555
973642
|
}
|
|
973556
|
-
await (0,
|
|
973643
|
+
await (0, import_promises178.writeFile)(filepath, parsedDocument.toString());
|
|
973557
973644
|
}
|
|
973558
973645
|
|
|
973559
973646
|
// ../cli-migrations/lib/migrations/0.3.0-rc12/index.js
|
|
@@ -973564,7 +973651,7 @@ var versionMigrations11 = {
|
|
|
973564
973651
|
var __default11 = versionMigrations11;
|
|
973565
973652
|
|
|
973566
973653
|
// ../cli-migrations/lib/migrations/0.3.23/change-services-key-to-service/migration.js
|
|
973567
|
-
var
|
|
973654
|
+
var import_promises179 = require("fs/promises");
|
|
973568
973655
|
var import_yaml14 = __toESM(require_dist11(), 1);
|
|
973569
973656
|
|
|
973570
973657
|
// ../cli-migrations/lib/migrations/0.3.23/change-services-key-to-service/getAllYamlFiles.js
|
|
@@ -973608,7 +973695,7 @@ var migration12 = {
|
|
|
973608
973695
|
}
|
|
973609
973696
|
};
|
|
973610
973697
|
async function migrateYamlFile3(filepath, context3) {
|
|
973611
|
-
const contents = await (0,
|
|
973698
|
+
const contents = await (0, import_promises179.readFile)(filepath);
|
|
973612
973699
|
const parsedDocument = import_yaml14.default.parseDocument(contents.toString());
|
|
973613
973700
|
if (!import_yaml14.default.isMap(parsedDocument.contents)) {
|
|
973614
973701
|
return context3.failAndThrow("File is not a map");
|
|
@@ -973638,7 +973725,7 @@ async function migrateYamlFile3(filepath, context3) {
|
|
|
973638
973725
|
pair.value = firstService.value;
|
|
973639
973726
|
}
|
|
973640
973727
|
}
|
|
973641
|
-
await (0,
|
|
973728
|
+
await (0, import_promises179.writeFile)(filepath, parsedDocument.toString());
|
|
973642
973729
|
}
|
|
973643
973730
|
|
|
973644
973731
|
// ../cli-migrations/lib/migrations/0.3.23/index.js
|
|
@@ -973649,7 +973736,7 @@ var versionMigrations12 = {
|
|
|
973649
973736
|
var __default12 = versionMigrations12;
|
|
973650
973737
|
|
|
973651
973738
|
// ../cli-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/migration.js
|
|
973652
|
-
var
|
|
973739
|
+
var import_promises180 = require("fs/promises");
|
|
973653
973740
|
var import_yaml15 = __toESM(require_dist11(), 1);
|
|
973654
973741
|
|
|
973655
973742
|
// ../cli-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/getAllYamlFiles.js
|
|
@@ -973693,7 +973780,7 @@ var migration13 = {
|
|
|
973693
973780
|
}
|
|
973694
973781
|
};
|
|
973695
973782
|
async function migrateYamlFile4(filepath, context3) {
|
|
973696
|
-
const contents = await (0,
|
|
973783
|
+
const contents = await (0, import_promises180.readFile)(filepath);
|
|
973697
973784
|
const parsedDocument = import_yaml15.default.parseDocument(contents.toString());
|
|
973698
973785
|
if (!import_yaml15.default.isMap(parsedDocument.contents)) {
|
|
973699
973786
|
return context3.failAndThrow("File is not a map");
|
|
@@ -973712,7 +973799,7 @@ async function migrateYamlFile4(filepath, context3) {
|
|
|
973712
973799
|
}
|
|
973713
973800
|
service.items.splice(indexOfServiceDocsPair, 1);
|
|
973714
973801
|
parsedDocument.contents.items.unshift(docsPair);
|
|
973715
|
-
await (0,
|
|
973802
|
+
await (0, import_promises180.writeFile)(filepath, parsedDocument.toString());
|
|
973716
973803
|
}
|
|
973717
973804
|
|
|
973718
973805
|
// ../cli-migrations/lib/migrations/0.5.4/index.js
|
|
@@ -973723,7 +973810,7 @@ var versionMigrations13 = {
|
|
|
973723
973810
|
var __default13 = versionMigrations13;
|
|
973724
973811
|
|
|
973725
973812
|
// ../cli-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/migration.js
|
|
973726
|
-
var
|
|
973813
|
+
var import_promises181 = require("fs/promises");
|
|
973727
973814
|
|
|
973728
973815
|
// ../cli-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/getAllGeneratorYamlFiles.js
|
|
973729
973816
|
init_lib8();
|
|
@@ -973766,14 +973853,14 @@ var migration14 = {
|
|
|
973766
973853
|
}
|
|
973767
973854
|
};
|
|
973768
973855
|
async function migrateYamlFile5(filepath) {
|
|
973769
|
-
const contents = await (0,
|
|
973856
|
+
const contents = await (0, import_promises181.readFile)(filepath);
|
|
973770
973857
|
const domainSuffix = process.env.DOMAIN_SUFFIX ?? "docs.buildwithfern.com";
|
|
973771
973858
|
const regex6 = /(docs:\s*domain:\s*)"([^"]*)"/g;
|
|
973772
973859
|
const updatedSnapshot = contents.toString().replace(regex6, (_match, _prefix, domain3) => {
|
|
973773
973860
|
return `docs:
|
|
973774
973861
|
domain: "${domain3}.${domainSuffix}"`;
|
|
973775
973862
|
});
|
|
973776
|
-
await (0,
|
|
973863
|
+
await (0, import_promises181.writeFile)(filepath, updatedSnapshot.toString());
|
|
973777
973864
|
}
|
|
973778
973865
|
|
|
973779
973866
|
// ../cli-migrations/lib/migrations/0.9.10/index.js
|
|
@@ -973794,11 +973881,11 @@ var LegacyDocsSerializers = __toESM(require_serialization4(), 1);
|
|
|
973794
973881
|
|
|
973795
973882
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/loadRawDocsConfiguration.js
|
|
973796
973883
|
init_lib8();
|
|
973797
|
-
var
|
|
973884
|
+
var import_promises182 = require("fs/promises");
|
|
973798
973885
|
init_js_yaml();
|
|
973799
973886
|
async function loadRawDocsConfiguration2({ absolutePathToWorkspace }) {
|
|
973800
973887
|
const filepath = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
973801
|
-
const contentsStr = await (0,
|
|
973888
|
+
const contentsStr = await (0, import_promises182.readFile)(filepath);
|
|
973802
973889
|
const contentsParsed = index_vite_proxy_tmp_default.load(contentsStr.toString());
|
|
973803
973890
|
const result = await LegacyDocsSerializers.DocsConfiguration.parse(contentsParsed);
|
|
973804
973891
|
if (result.ok) {
|
|
@@ -973817,7 +973904,7 @@ function getAbsolutePathToDocsFolder({ absolutePathToWorkspace }) {
|
|
|
973817
973904
|
|
|
973818
973905
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndMultipleAPIs.js
|
|
973819
973906
|
init_lib8();
|
|
973820
|
-
var
|
|
973907
|
+
var import_promises184 = require("fs/promises");
|
|
973821
973908
|
init_js_yaml();
|
|
973822
973909
|
|
|
973823
973910
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/convertLegacyDocsConfig.js
|
|
@@ -974026,11 +974113,11 @@ __export(legacy_exports, {
|
|
|
974026
974113
|
|
|
974027
974114
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/generators-configuration/loadRawGeneratorsConfiguration.js
|
|
974028
974115
|
init_lib8();
|
|
974029
|
-
var
|
|
974116
|
+
var import_promises183 = require("fs/promises");
|
|
974030
974117
|
init_js_yaml();
|
|
974031
974118
|
async function loadRawGeneratorsConfiguration2({ absolutePathToWorkspace }) {
|
|
974032
974119
|
const filepath = getAbsolutePathToGeneratorsConfiguration({ absolutePathToWorkspace });
|
|
974033
|
-
const contentsStr = await (0,
|
|
974120
|
+
const contentsStr = await (0, import_promises183.readFile)(filepath);
|
|
974034
974121
|
const contentsParsed = index_vite_proxy_tmp_default.load(contentsStr.toString());
|
|
974035
974122
|
const result = await legacy_exports.GeneratorsConfigurationSchema.safeParseAsync(contentsParsed);
|
|
974036
974123
|
if (result.success) {
|
|
@@ -974060,7 +974147,7 @@ function migrateDocsInstances(docsURLs) {
|
|
|
974060
974147
|
var APIS_DIRECTORY2 = "apis";
|
|
974061
974148
|
async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspaces, workspaceContainingDocs }) {
|
|
974062
974149
|
const absolutePathToApisDirectory = join8(absolutePathToFernDirectory, RelativeFilePath2.of(APIS_DIRECTORY2));
|
|
974063
|
-
await (0,
|
|
974150
|
+
await (0, import_promises184.mkdir)(absolutePathToApisDirectory);
|
|
974064
974151
|
for (const workspace of workspaces) {
|
|
974065
974152
|
const absolutePathToWorkspace = join8(absolutePathToFernDirectory, RelativeFilePath2.of(workspace));
|
|
974066
974153
|
const docsURLs = await migrateAndWriteGeneratorsYml({ absolutePathToWorkspace });
|
|
@@ -974068,11 +974155,11 @@ async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspa
|
|
|
974068
974155
|
await migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName: workspaceContainingDocs });
|
|
974069
974156
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
974070
974157
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
974071
|
-
await (0,
|
|
974158
|
+
await (0, import_promises184.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
974072
974159
|
}
|
|
974073
974160
|
const absolutePathToNestedWorkspace = join8(absolutePathToApisDirectory, RelativeFilePath2.of(workspace));
|
|
974074
974161
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
974075
|
-
await (0,
|
|
974162
|
+
await (0, import_promises184.rm)(absolutePathToWorkspace, { recursive: true });
|
|
974076
974163
|
}
|
|
974077
974164
|
}
|
|
974078
974165
|
async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
@@ -974085,7 +974172,7 @@ async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
|
974085
974172
|
generatorsConfiguration,
|
|
974086
974173
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
974087
974174
|
});
|
|
974088
|
-
await (0,
|
|
974175
|
+
await (0, import_promises184.writeFile)(absolutePathToGeneratorsConfiguration, index_vite_proxy_tmp_default.dump(convertedResponse.value));
|
|
974089
974176
|
return convertedResponse.docsURLs;
|
|
974090
974177
|
}
|
|
974091
974178
|
async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName }) {
|
|
@@ -974099,12 +974186,12 @@ async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiNa
|
|
|
974099
974186
|
apiName
|
|
974100
974187
|
});
|
|
974101
974188
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
974102
|
-
await (0,
|
|
974189
|
+
await (0, import_promises184.writeFile)(absolutePathToDocsConfig, index_vite_proxy_tmp_default.dump(convertedDocsConfig));
|
|
974103
974190
|
}
|
|
974104
974191
|
|
|
974105
974192
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndSingleAPI.js
|
|
974106
974193
|
init_lib8();
|
|
974107
|
-
var
|
|
974194
|
+
var import_promises185 = require("fs/promises");
|
|
974108
974195
|
init_js_yaml();
|
|
974109
974196
|
async function migrateDocsAndSingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
974110
974197
|
const docsURLs = await migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace });
|
|
@@ -974112,8 +974199,8 @@ async function migrateDocsAndSingleAPI({ absolutePathToFernDirectory, absolutePa
|
|
|
974112
974199
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
974113
974200
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
974114
974201
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
974115
|
-
await (0,
|
|
974116
|
-
await (0,
|
|
974202
|
+
await (0, import_promises185.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
974203
|
+
await (0, import_promises185.rm)(absolutePathToWorkspace, { recursive: true });
|
|
974117
974204
|
}
|
|
974118
974205
|
async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
974119
974206
|
const docsConfiguration = await loadRawDocsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -974126,7 +974213,7 @@ async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
|
974126
974213
|
apiName: void 0
|
|
974127
974214
|
});
|
|
974128
974215
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
974129
|
-
await (0,
|
|
974216
|
+
await (0, import_promises185.writeFile)(absolutePathToDocsConfig, index_vite_proxy_tmp_default.dump(convertedDocsConfig));
|
|
974130
974217
|
}
|
|
974131
974218
|
async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
974132
974219
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -974138,24 +974225,24 @@ async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
|
974138
974225
|
generatorsConfiguration,
|
|
974139
974226
|
pathModificationStrategy: "MoveUp"
|
|
974140
974227
|
});
|
|
974141
|
-
await (0,
|
|
974228
|
+
await (0, import_promises185.writeFile)(absolutePathToGeneratorsConfiguration, index_vite_proxy_tmp_default.dump(convertedResponse.value));
|
|
974142
974229
|
return convertedResponse.docsURLs;
|
|
974143
974230
|
}
|
|
974144
974231
|
|
|
974145
974232
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlyMultipleAPIs.js
|
|
974146
974233
|
init_lib8();
|
|
974147
|
-
var
|
|
974234
|
+
var import_promises186 = require("fs/promises");
|
|
974148
974235
|
init_js_yaml();
|
|
974149
974236
|
var APIS_DIRECTORY3 = "apis";
|
|
974150
974237
|
async function migrateOnlyMultipleAPIs({ absolutePathToFernDirectory, workspaces }) {
|
|
974151
974238
|
const absolutePathToApisDirectory = join8(absolutePathToFernDirectory, RelativeFilePath2.of(APIS_DIRECTORY3));
|
|
974152
|
-
await (0,
|
|
974239
|
+
await (0, import_promises186.mkdir)(absolutePathToApisDirectory);
|
|
974153
974240
|
for (const workspace of workspaces) {
|
|
974154
974241
|
const absolutePathToWorkspace = join8(absolutePathToFernDirectory, RelativeFilePath2.of(workspace));
|
|
974155
974242
|
await migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace });
|
|
974156
974243
|
const absolutePathToNestedWorkspace = join8(absolutePathToApisDirectory, RelativeFilePath2.of(workspace));
|
|
974157
974244
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
974158
|
-
await (0,
|
|
974245
|
+
await (0, import_promises186.rm)(absolutePathToWorkspace, { recursive: true });
|
|
974159
974246
|
}
|
|
974160
974247
|
}
|
|
974161
974248
|
async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
@@ -974168,17 +974255,17 @@ async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
|
974168
974255
|
generatorsConfiguration,
|
|
974169
974256
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
974170
974257
|
});
|
|
974171
|
-
await (0,
|
|
974258
|
+
await (0, import_promises186.writeFile)(absolutePathToGeneratorsConfiguration, index_vite_proxy_tmp_default.dump(convertedResponse.value));
|
|
974172
974259
|
}
|
|
974173
974260
|
|
|
974174
974261
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlySingleAPI.js
|
|
974175
974262
|
init_lib8();
|
|
974176
|
-
var
|
|
974263
|
+
var import_promises187 = require("fs/promises");
|
|
974177
974264
|
init_js_yaml();
|
|
974178
974265
|
async function migrateOnlySingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
974179
974266
|
await migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace });
|
|
974180
974267
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
974181
|
-
await (0,
|
|
974268
|
+
await (0, import_promises187.rm)(absolutePathToWorkspace, { recursive: true });
|
|
974182
974269
|
}
|
|
974183
974270
|
async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
974184
974271
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -974190,7 +974277,7 @@ async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
|
974190
974277
|
generatorsConfiguration,
|
|
974191
974278
|
pathModificationStrategy: "MoveUp"
|
|
974192
974279
|
});
|
|
974193
|
-
await (0,
|
|
974280
|
+
await (0, import_promises187.writeFile)(absolutePathToGeneratorsConfiguration, index_vite_proxy_tmp_default.dump(convertedResponse.value));
|
|
974194
974281
|
}
|
|
974195
974282
|
|
|
974196
974283
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migration.js
|
|
@@ -974270,7 +974357,7 @@ var __default15 = versionMigrations15;
|
|
|
974270
974357
|
init_lib19();
|
|
974271
974358
|
init_lib8();
|
|
974272
974359
|
init_source();
|
|
974273
|
-
var
|
|
974360
|
+
var import_promises188 = require("fs/promises");
|
|
974274
974361
|
init_js_yaml();
|
|
974275
974362
|
var import_yaml16 = __toESM(require_dist11(), 1);
|
|
974276
974363
|
var migration16 = {
|
|
@@ -974314,7 +974401,7 @@ async function addApiConfigurationToSingleWorkspace({ absolutePathToFernDirector
|
|
|
974314
974401
|
if (existingGeneratorsYml == null) {
|
|
974315
974402
|
if (openapiDirectory != null && openapiDirectory.contents[0] != null) {
|
|
974316
974403
|
const absolutePathToGeneratorsYml = join8(absoluteFilepathToWorkspace, RelativeFilePath2.of("generators.yml"));
|
|
974317
|
-
await (0,
|
|
974404
|
+
await (0, import_promises188.writeFile)(absolutePathToGeneratorsYml, index_vite_proxy_tmp_default.dump({
|
|
974318
974405
|
api: {
|
|
974319
974406
|
path: join8(relativize(absolutePathToFernDirectory, absoluteFilepathToWorkspace), RelativeFilePath2.of(openapiDirectory.name), RelativeFilePath2.of(openapiDirectory.contents[0]?.name))
|
|
974320
974407
|
}
|
|
@@ -974329,7 +974416,7 @@ async function addApiConfigurationToSingleWorkspace({ absolutePathToFernDirector
|
|
|
974329
974416
|
parsedDocument.set("api", {
|
|
974330
974417
|
path: join8(relativize(absolutePathToFernDirectory, absoluteFilepathToWorkspace), RelativeFilePath2.of(openapiDirectory.name), RelativeFilePath2.of(openapiDirectory.contents[0]?.name))
|
|
974331
974418
|
});
|
|
974332
|
-
await (0,
|
|
974419
|
+
await (0, import_promises188.writeFile)(existingGeneratorsYml.absolutePath, parsedDocument.toString());
|
|
974333
974420
|
context3.logger.info(source_default.green(`Updated ${existingGeneratorsYml.absolutePath}`));
|
|
974334
974421
|
}
|
|
974335
974422
|
}
|
|
@@ -974359,7 +974446,7 @@ var __default16 = versionMigrations16;
|
|
|
974359
974446
|
init_lib19();
|
|
974360
974447
|
init_lib8();
|
|
974361
974448
|
init_source();
|
|
974362
|
-
var
|
|
974449
|
+
var import_promises189 = require("fs/promises");
|
|
974363
974450
|
init_js_yaml();
|
|
974364
974451
|
var import_yaml17 = __toESM(require_dist11(), 1);
|
|
974365
974452
|
var migration17 = {
|
|
@@ -974540,7 +974627,7 @@ async function addApiConfigurationToSingleWorkspace2({ absoluteFilepathToWorkspa
|
|
|
974540
974627
|
if (schemaComment && documentToWrite.indexOf(schemaComment) === -1) {
|
|
974541
974628
|
documentToWrite = `${schemaComment}${documentToWrite}`;
|
|
974542
974629
|
}
|
|
974543
|
-
await (0,
|
|
974630
|
+
await (0, import_promises189.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
974544
974631
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
974545
974632
|
}
|
|
974546
974633
|
async function parseApiSpec({ oldSpec, absoluteFilepathToWorkspace, files, directories, context: context3, namespace }) {
|
|
@@ -974587,7 +974674,7 @@ async function parseApiSpec({ oldSpec, absoluteFilepathToWorkspace, files, direc
|
|
|
974587
974674
|
}
|
|
974588
974675
|
let specContent;
|
|
974589
974676
|
try {
|
|
974590
|
-
const fileContents = await (0,
|
|
974677
|
+
const fileContents = await (0, import_promises189.readFile)(absoluteSpecPath, { encoding: "utf-8" });
|
|
974591
974678
|
specContent = index_vite_proxy_tmp_default.load(fileContents);
|
|
974592
974679
|
} catch (e2) {
|
|
974593
974680
|
context3.logger.warn(`Failed to read API spec file ${spec.path}. Error: ${e2}. Skipping...`);
|
|
@@ -974693,7 +974780,7 @@ var __default17 = versionMigrations17;
|
|
|
974693
974780
|
init_lib19();
|
|
974694
974781
|
init_lib8();
|
|
974695
974782
|
init_source();
|
|
974696
|
-
var
|
|
974783
|
+
var import_promises190 = require("fs/promises");
|
|
974697
974784
|
init_js_yaml();
|
|
974698
974785
|
var migration18 = {
|
|
974699
974786
|
name: "add-path-parameter-order-setting",
|
|
@@ -974782,7 +974869,7 @@ async function updateGeneratorsYml({ context: context3, files }) {
|
|
|
974782
974869
|
documentToWrite = `${schemaComment}
|
|
974783
974870
|
${documentToWrite}`;
|
|
974784
974871
|
}
|
|
974785
|
-
await (0,
|
|
974872
|
+
await (0, import_promises190.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
974786
974873
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
974787
974874
|
}
|
|
974788
974875
|
async function getFilesAndDirectories3(absoluteFilepath) {
|
|
@@ -974821,7 +974908,7 @@ var __default18 = versionMigrations18;
|
|
|
974821
974908
|
init_lib19();
|
|
974822
974909
|
init_lib8();
|
|
974823
974910
|
init_source();
|
|
974824
|
-
var
|
|
974911
|
+
var import_promises191 = require("fs/promises");
|
|
974825
974912
|
init_js_yaml();
|
|
974826
974913
|
var migration19 = {
|
|
974827
974914
|
name: "update-1_0_0-defaults",
|
|
@@ -974997,7 +975084,7 @@ async function updateGeneratorsYml2({ context: context3, files }) {
|
|
|
974997
975084
|
documentToWrite = `${schemaComment}
|
|
974998
975085
|
${documentToWrite}`;
|
|
974999
975086
|
}
|
|
975000
|
-
await (0,
|
|
975087
|
+
await (0, import_promises191.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
975001
975088
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
975002
975089
|
}
|
|
975003
975090
|
async function getFilesAndDirectories4(absoluteFilepath) {
|
|
@@ -975069,7 +975156,7 @@ var __default19 = versionMigrations19;
|
|
|
975069
975156
|
init_lib19();
|
|
975070
975157
|
init_lib8();
|
|
975071
975158
|
init_source();
|
|
975072
|
-
var
|
|
975159
|
+
var import_promises192 = require("fs/promises");
|
|
975073
975160
|
init_js_yaml();
|
|
975074
975161
|
var migration20 = {
|
|
975075
975162
|
name: "update-2_0_0-defaults",
|
|
@@ -975245,7 +975332,7 @@ async function updateGeneratorsYml3({ context: context3, files }) {
|
|
|
975245
975332
|
documentToWrite = `${schemaComment}
|
|
975246
975333
|
${documentToWrite}`;
|
|
975247
975334
|
}
|
|
975248
|
-
await (0,
|
|
975335
|
+
await (0, import_promises192.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
975249
975336
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
975250
975337
|
}
|
|
975251
975338
|
async function getFilesAndDirectories5(absoluteFilepath) {
|
|
@@ -975294,7 +975381,7 @@ var __default20 = versionMigrations20;
|
|
|
975294
975381
|
init_lib19();
|
|
975295
975382
|
init_lib8();
|
|
975296
975383
|
init_source();
|
|
975297
|
-
var
|
|
975384
|
+
var import_promises193 = require("fs/promises");
|
|
975298
975385
|
init_js_yaml();
|
|
975299
975386
|
var migration21 = {
|
|
975300
975387
|
name: "migrate-deprecated-generator-api-settings",
|
|
@@ -975386,7 +975473,7 @@ async function updateGeneratorsYml4({ context: context3, files }) {
|
|
|
975386
975473
|
documentToWrite = `${schemaComment}
|
|
975387
975474
|
${documentToWrite}`;
|
|
975388
975475
|
}
|
|
975389
|
-
await (0,
|
|
975476
|
+
await (0, import_promises193.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
975390
975477
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
975391
975478
|
}
|
|
975392
975479
|
function migrateDeprecatedSettings(settings, context3) {
|
|
@@ -975435,7 +975522,7 @@ var __default21 = versionMigrations21;
|
|
|
975435
975522
|
init_lib19();
|
|
975436
975523
|
init_lib8();
|
|
975437
975524
|
init_source();
|
|
975438
|
-
var
|
|
975525
|
+
var import_promises194 = require("fs/promises");
|
|
975439
975526
|
init_js_yaml();
|
|
975440
975527
|
var migration22 = {
|
|
975441
975528
|
name: "enable-smart-casing",
|
|
@@ -975520,7 +975607,7 @@ async function updateGeneratorsYml5({ context: context3, files }) {
|
|
|
975520
975607
|
documentToWrite = `${schemaComment}
|
|
975521
975608
|
${documentToWrite}`;
|
|
975522
975609
|
}
|
|
975523
|
-
await (0,
|
|
975610
|
+
await (0, import_promises194.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
975524
975611
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
975525
975612
|
}
|
|
975526
975613
|
function setSmartCasingFalseIfNotConfigured(generator, context3) {
|
|
@@ -975560,7 +975647,7 @@ var __default22 = versionMigrations22;
|
|
|
975560
975647
|
init_lib19();
|
|
975561
975648
|
init_lib8();
|
|
975562
975649
|
init_source();
|
|
975563
|
-
var
|
|
975650
|
+
var import_promises195 = require("fs/promises");
|
|
975564
975651
|
init_js_yaml();
|
|
975565
975652
|
var migration23 = {
|
|
975566
975653
|
name: "disable-disambiguate-request-names",
|
|
@@ -975685,7 +975772,7 @@ async function updateGeneratorsYml6({ context: context3, files }) {
|
|
|
975685
975772
|
documentToWrite = `${schemaComment}
|
|
975686
975773
|
${documentToWrite}`;
|
|
975687
975774
|
}
|
|
975688
|
-
await (0,
|
|
975775
|
+
await (0, import_promises195.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
975689
975776
|
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
975690
975777
|
}
|
|
975691
975778
|
async function getFilesAndDirectories8(absoluteFilepath) {
|
|
@@ -975820,7 +975907,7 @@ init_lib33();
|
|
|
975820
975907
|
init_lib27();
|
|
975821
975908
|
init_lib6();
|
|
975822
975909
|
init_source();
|
|
975823
|
-
var
|
|
975910
|
+
var import_promises196 = require("fs/promises");
|
|
975824
975911
|
|
|
975825
975912
|
// ../../../node_modules/.pnpm/immer@10.2.0/node_modules/immer/dist/immer.mjs
|
|
975826
975913
|
var NOTHING = /* @__PURE__ */ Symbol.for("immer-nothing");
|
|
@@ -976876,7 +976963,7 @@ async function upgrade({
|
|
|
976876
976963
|
const newProjectConfig = produce(projectConfig2.rawConfig, (draft) => {
|
|
976877
976964
|
draft.version = resolvedTargetVersion;
|
|
976878
976965
|
});
|
|
976879
|
-
await (0,
|
|
976966
|
+
await (0, import_promises196.writeFile)(
|
|
976880
976967
|
projectConfig2._absolutePath,
|
|
976881
976968
|
ensureFinalNewline(JSON.stringify(newProjectConfig, void 0, 2))
|
|
976882
976969
|
);
|
|
@@ -977033,7 +977120,7 @@ async function upgradeGeneratorsForAllWorkspaces({
|
|
|
977033
977120
|
absolutePathToWorkspace: workspace.absoluteFilePath
|
|
977034
977121
|
});
|
|
977035
977122
|
if (absolutePathToGeneratorsConfiguration != null && result.updatedConfiguration != null) {
|
|
977036
|
-
await (0,
|
|
977123
|
+
await (0, import_promises197.writeFile)(absolutePathToGeneratorsConfiguration, result.updatedConfiguration);
|
|
977037
977124
|
}
|
|
977038
977125
|
for (const upgrade2 of result.appliedUpgrades) {
|
|
977039
977126
|
const normalizedName = addDefaultDockerOrgIfNotPresent(upgrade2.generatorName);
|
|
@@ -977511,7 +977598,7 @@ async function previewDocsWorkspace({
|
|
|
977511
977598
|
// src/commands/docs-diff/docsDiff.ts
|
|
977512
977599
|
init_lib8();
|
|
977513
977600
|
init_lib6();
|
|
977514
|
-
var
|
|
977601
|
+
var import_promises198 = require("fs/promises");
|
|
977515
977602
|
var import_pngjs2 = __toESM(require_png(), 1);
|
|
977516
977603
|
async function getSlugForFiles2({
|
|
977517
977604
|
previewUrl,
|
|
@@ -977734,8 +977821,8 @@ async function generateComparisons2({
|
|
|
977734
977821
|
afterPath,
|
|
977735
977822
|
comparisonBasePath
|
|
977736
977823
|
}) {
|
|
977737
|
-
const beforePng = import_pngjs2.PNG.sync.read(await (0,
|
|
977738
|
-
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));
|
|
977739
977826
|
const beforeOriginalHeight = beforePng.height;
|
|
977740
977827
|
const afterOriginalHeight = afterPng.height;
|
|
977741
977828
|
const width = Math.max(beforePng.width, afterPng.width);
|
|
@@ -977773,7 +977860,7 @@ async function generateComparisons2({
|
|
|
977773
977860
|
const sideBySide = createSideBySideComparison2(croppedBefore, croppedAfter, 20, true);
|
|
977774
977861
|
const outPath = `${base4}-region-${i5 + 1}.png`;
|
|
977775
977862
|
const pngBuffer = import_pngjs2.PNG.sync.write(sideBySide);
|
|
977776
|
-
await (0,
|
|
977863
|
+
await (0, import_promises198.writeFile)(outPath, new Uint8Array(pngBuffer));
|
|
977777
977864
|
results.push({ changePercent, boundingBox, comparisonPath: outPath });
|
|
977778
977865
|
}
|
|
977779
977866
|
return results;
|
|
@@ -977852,7 +977939,7 @@ async function docsDiff({
|
|
|
977852
977939
|
outputDir.startsWith("/") ? outputDir : join8(cwd(), RelativeFilePath2.of(outputDir))
|
|
977853
977940
|
);
|
|
977854
977941
|
if (!await doesPathExist(outputPath)) {
|
|
977855
|
-
await (0,
|
|
977942
|
+
await (0, import_promises198.mkdir)(outputPath, { recursive: true });
|
|
977856
977943
|
}
|
|
977857
977944
|
const results = [];
|
|
977858
977945
|
await cliContext.runTask(async (context3) => {
|
|
@@ -978280,7 +978367,7 @@ init_lib6();
|
|
|
978280
978367
|
// src/commands/docs-theme/ThemeExporter.ts
|
|
978281
978368
|
init_lib12();
|
|
978282
978369
|
init_lib8();
|
|
978283
|
-
var
|
|
978370
|
+
var import_promises199 = require("fs/promises");
|
|
978284
978371
|
init_js_yaml();
|
|
978285
978372
|
var import_path109 = __toESM(require("path"), 1);
|
|
978286
978373
|
var ThemeExporter = class {
|
|
@@ -978293,18 +978380,18 @@ var ThemeExporter = class {
|
|
|
978293
978380
|
const docsDir = import_path109.default.dirname(docsYmlPath);
|
|
978294
978381
|
const outDir = output2 != null ? import_path109.default.resolve(process.cwd(), output2) : import_path109.default.join(this.docsWorkspace.absoluteFilePath, "theme");
|
|
978295
978382
|
context3.logger.info(`Exporting theme-eligible fields from docs.yml \u2192 ${outDir}`);
|
|
978296
|
-
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"));
|
|
978297
978384
|
const themeConfig = {};
|
|
978298
978385
|
for (const [k4, v3] of Object.entries(raw)) {
|
|
978299
978386
|
if (docs_yml_exports.THEME_ELIGIBLE_YAML_KEYS.has(k4)) {
|
|
978300
978387
|
themeConfig[k4] = v3;
|
|
978301
978388
|
}
|
|
978302
978389
|
}
|
|
978303
|
-
await (0,
|
|
978390
|
+
await (0, import_promises199.mkdir)(outDir, { recursive: true });
|
|
978304
978391
|
const assetsDir = import_path109.default.join(outDir, "assets");
|
|
978305
|
-
await (0,
|
|
978392
|
+
await (0, import_promises199.mkdir)(assetsDir, { recursive: true });
|
|
978306
978393
|
const exported = await copyLocalFiles(themeConfig, docsDir, assetsDir);
|
|
978307
|
-
await (0,
|
|
978394
|
+
await (0, import_promises199.writeFile)(import_path109.default.join(outDir, "theme.yml"), index_vite_proxy_tmp_default.dump(exported), "utf-8");
|
|
978308
978395
|
context3.logger.info(`Theme exported to ${outDir}/theme.yml`);
|
|
978309
978396
|
}
|
|
978310
978397
|
};
|
|
@@ -978318,8 +978405,8 @@ async function copyLocalFiles(obj, sourceDir, assetsDir) {
|
|
|
978318
978405
|
const destRelative = relFromSource.startsWith("..") ? relFromProject.startsWith("..") ? import_path109.default.basename(abs) : relFromProject : relFromSource;
|
|
978319
978406
|
const dest = import_path109.default.join(assetsDir, destRelative);
|
|
978320
978407
|
try {
|
|
978321
|
-
await (0,
|
|
978322
|
-
await (0,
|
|
978408
|
+
await (0, import_promises199.mkdir)(import_path109.default.dirname(dest), { recursive: true });
|
|
978409
|
+
await (0, import_promises199.copyFile)(abs, dest);
|
|
978323
978410
|
return `./assets/${destRelative.split(import_path109.default.sep).join("/")}`;
|
|
978324
978411
|
} catch {
|
|
978325
978412
|
return obj;
|
|
@@ -978411,7 +978498,7 @@ async function listDocsThemes({
|
|
|
978411
978498
|
|
|
978412
978499
|
// src/commands/docs-theme/uploadDocsTheme.ts
|
|
978413
978500
|
init_lib6();
|
|
978414
|
-
var
|
|
978501
|
+
var import_promises201 = require("fs/promises");
|
|
978415
978502
|
init_js_yaml();
|
|
978416
978503
|
var import_path111 = __toESM(require("path"), 1);
|
|
978417
978504
|
|
|
@@ -978420,7 +978507,7 @@ init_lib8();
|
|
|
978420
978507
|
init_lib6();
|
|
978421
978508
|
var import_child_process13 = require("child_process");
|
|
978422
978509
|
var import_crypto10 = require("crypto");
|
|
978423
|
-
var
|
|
978510
|
+
var import_promises200 = require("fs/promises");
|
|
978424
978511
|
var import_mime_types2 = __toESM(require_mime_types(), 1);
|
|
978425
978512
|
var import_path110 = __toESM(require("path"), 1);
|
|
978426
978513
|
function getGitRoot() {
|
|
@@ -978464,7 +978551,7 @@ var ThemeConfigProcessor = class {
|
|
|
978464
978551
|
filePaths.map(async (filePath) => {
|
|
978465
978552
|
const abs = import_path110.default.resolve(this.themeDir, filePath);
|
|
978466
978553
|
try {
|
|
978467
|
-
await (0,
|
|
978554
|
+
await (0, import_promises200.access)(abs);
|
|
978468
978555
|
} catch {
|
|
978469
978556
|
errors4.push(`Referenced file not found: ${abs}`);
|
|
978470
978557
|
}
|
|
@@ -978629,7 +978716,7 @@ ${errors4.map((e2) => ` - ${e2}`).join("\n")}`,
|
|
|
978629
978716
|
return { config: cfg, filesUploaded };
|
|
978630
978717
|
}
|
|
978631
978718
|
async uploadFileToCas(absolutePath) {
|
|
978632
|
-
const content5 = await (0,
|
|
978719
|
+
const content5 = await (0, import_promises200.readFile)(absolutePath);
|
|
978633
978720
|
const contentType = import_mime_types2.default.lookup(absolutePath) || "application/octet-stream";
|
|
978634
978721
|
const bindPath = posixBindPath(this.gitRoot, absolutePath);
|
|
978635
978722
|
return this.uploadToCas(content5, contentType, bindPath, import_path110.default.basename(absolutePath));
|
|
@@ -978744,7 +978831,7 @@ async function uploadDocsTheme({
|
|
|
978744
978831
|
await cliContext.runTask(async (context3) => {
|
|
978745
978832
|
let rawYaml;
|
|
978746
978833
|
try {
|
|
978747
|
-
const content5 = await (0,
|
|
978834
|
+
const content5 = await (0, import_promises201.readFile)(themeYmlPath, "utf-8");
|
|
978748
978835
|
rawYaml = index_vite_proxy_tmp_default.load(content5, { schema: index_vite_proxy_tmp_default.JSON_SCHEMA });
|
|
978749
978836
|
} catch {
|
|
978750
978837
|
context3.failAndThrow(
|
|
@@ -978799,7 +978886,7 @@ async function uploadDocsTheme({
|
|
|
978799
978886
|
// src/commands/downgrade/downgrade.ts
|
|
978800
978887
|
init_lib19();
|
|
978801
978888
|
init_lib6();
|
|
978802
|
-
var
|
|
978889
|
+
var import_promises202 = require("fs/promises");
|
|
978803
978890
|
function ensureFinalNewline2(content5) {
|
|
978804
978891
|
return content5.endsWith("\n") ? content5 : content5 + "\n";
|
|
978805
978892
|
}
|
|
@@ -978824,7 +978911,7 @@ async function downgrade({
|
|
|
978824
978911
|
const newProjectConfig = produce(projectConfig.rawConfig, (draft) => {
|
|
978825
978912
|
draft.version = targetVersion;
|
|
978826
978913
|
});
|
|
978827
|
-
await (0,
|
|
978914
|
+
await (0, import_promises202.writeFile)(projectConfig._absolutePath, ensureFinalNewline2(JSON.stringify(newProjectConfig, void 0, 2)));
|
|
978828
978915
|
cliContext.logger.info(`Updated ${PROJECT_CONFIG_FILENAME} to version ${targetVersion}`);
|
|
978829
978916
|
}
|
|
978830
978917
|
|
|
@@ -978832,7 +978919,7 @@ async function downgrade({
|
|
|
978832
978919
|
init_lib36();
|
|
978833
978920
|
init_lib8();
|
|
978834
978921
|
init_lib22();
|
|
978835
|
-
var
|
|
978922
|
+
var import_promises203 = require("fs/promises");
|
|
978836
978923
|
init_js_yaml();
|
|
978837
978924
|
|
|
978838
978925
|
// src/commands/export/convertIrToOpenApi.ts
|
|
@@ -980254,8 +980341,8 @@ async function generateOpenAPIForWorkspaces({
|
|
|
980254
980341
|
ir: ir3,
|
|
980255
980342
|
mode: "openapi"
|
|
980256
980343
|
});
|
|
980257
|
-
await (0,
|
|
980258
|
-
await (0,
|
|
980344
|
+
await (0, import_promises203.mkdir)(dirname6(outputPath), { recursive: true });
|
|
980345
|
+
await (0, import_promises203.writeFile)(
|
|
980259
980346
|
outputPath,
|
|
980260
980347
|
outputPath.endsWith(".json") ? JSON.stringify(openapi, void 0, indent4) : index_vite_proxy_tmp_default.dump(openapi, { indent: indent4 })
|
|
980261
980348
|
);
|
|
@@ -980861,7 +980948,7 @@ async function generateOpenAPIIrForWorkspaces({
|
|
|
980861
980948
|
// src/commands/generate-overrides/compareOpenAPISpecs.ts
|
|
980862
980949
|
init_lib8();
|
|
980863
980950
|
init_lib6();
|
|
980864
|
-
var
|
|
980951
|
+
var import_promises204 = require("fs/promises");
|
|
980865
980952
|
init_js_yaml();
|
|
980866
980953
|
async function compareOpenAPISpecs({
|
|
980867
980954
|
originalPath,
|
|
@@ -980903,12 +980990,12 @@ async function compareOpenAPISpecs({
|
|
|
980903
980990
|
}
|
|
980904
980991
|
outputPath = join8(dirname6(originalPath), RelativeFilePath2.of(overridesFilename));
|
|
980905
980992
|
}
|
|
980906
|
-
await (0,
|
|
980993
|
+
await (0, import_promises204.writeFile)(outputPath, index_vite_proxy_tmp_default.dump(overrides, { lineWidth: -1, noRefs: true }));
|
|
980907
980994
|
context3.logger.info(`Overrides written to ${outputPath}`);
|
|
980908
980995
|
});
|
|
980909
980996
|
}
|
|
980910
980997
|
async function loadSpec2(filepath, context3) {
|
|
980911
|
-
const contents = await (0,
|
|
980998
|
+
const contents = await (0, import_promises204.readFile)(filepath, "utf8");
|
|
980912
980999
|
try {
|
|
980913
981000
|
return JSON.parse(contents);
|
|
980914
981001
|
} catch {
|
|
@@ -981016,7 +981103,7 @@ init_lib35();
|
|
|
981016
981103
|
init_lib16();
|
|
981017
981104
|
init_lib15();
|
|
981018
981105
|
init_lib6();
|
|
981019
|
-
var
|
|
981106
|
+
var import_promises205 = require("fs/promises");
|
|
981020
981107
|
init_js_yaml();
|
|
981021
981108
|
async function writeOverridesForWorkspaces({
|
|
981022
981109
|
project,
|
|
@@ -981042,7 +981129,7 @@ async function writeOverridesForWorkspaces({
|
|
|
981042
981129
|
async function readExistingOverrides(overridesFilepath, context3) {
|
|
981043
981130
|
let parsedOverrides = null;
|
|
981044
981131
|
try {
|
|
981045
|
-
const contents = (await (0,
|
|
981132
|
+
const contents = (await (0, import_promises205.readFile)(overridesFilepath, "utf8")).toString();
|
|
981046
981133
|
try {
|
|
981047
981134
|
parsedOverrides = JSON.parse(contents);
|
|
981048
981135
|
} catch (err) {
|
|
@@ -981107,7 +981194,7 @@ async function writeDefinitionForOpenAPIWorkspace({
|
|
|
981107
981194
|
for (const overridesPath of overridesPaths) {
|
|
981108
981195
|
const existingOverrides = await readExistingOverrides(overridesPath, context3);
|
|
981109
981196
|
const content5 = generateOverridesContent({ ir: ir3, existingOverrides, includeModels, context: context3 });
|
|
981110
|
-
await (0,
|
|
981197
|
+
await (0, import_promises205.writeFile)(overridesPath, index_vite_proxy_tmp_default.dump(content5));
|
|
981111
981198
|
}
|
|
981112
981199
|
} else {
|
|
981113
981200
|
const content5 = generateOverridesContent({ ir: ir3, existingOverrides: {}, includeModels, context: context3 });
|
|
@@ -981121,7 +981208,7 @@ async function writeDefinitionForOpenAPIWorkspace({
|
|
|
981121
981208
|
overridesFilename = `${nameWithoutExt}-overrides${extension4}`;
|
|
981122
981209
|
}
|
|
981123
981210
|
}
|
|
981124
|
-
await (0,
|
|
981211
|
+
await (0, import_promises205.writeFile)(
|
|
981125
981212
|
join8(dirname6(spec.absoluteFilepath), RelativeFilePath2.of(overridesFilename)),
|
|
981126
981213
|
index_vite_proxy_tmp_default.dump(content5)
|
|
981127
981214
|
);
|
|
@@ -981580,7 +981667,7 @@ function convertIRtoJsonSchema(args) {
|
|
|
981580
981667
|
// src/commands/jsonschema/generateJsonschemaForWorkspace.ts
|
|
981581
981668
|
init_lib21();
|
|
981582
981669
|
init_source();
|
|
981583
|
-
var
|
|
981670
|
+
var import_promises206 = require("fs/promises");
|
|
981584
981671
|
async function generateJsonschemaForWorkspaces({
|
|
981585
981672
|
typeLocator,
|
|
981586
981673
|
project,
|
|
@@ -981628,9 +981715,9 @@ async function generateJsonschemaForWorkspaces({
|
|
|
981628
981715
|
context: context3
|
|
981629
981716
|
});
|
|
981630
981717
|
if (!await doesPathExist(dirname6(jsonschemaFilepath))) {
|
|
981631
|
-
await (0,
|
|
981718
|
+
await (0, import_promises206.mkdir)(dirname6(jsonschemaFilepath), { recursive: true });
|
|
981632
981719
|
}
|
|
981633
|
-
await (0,
|
|
981720
|
+
await (0, import_promises206.writeFile)(jsonschemaFilepath, JSON.stringify(jsonSchema, null, 2));
|
|
981634
981721
|
context3.logger.info(source_default.green(`Wrote JSON Schema to ${jsonschemaFilepath}`));
|
|
981635
981722
|
});
|
|
981636
981723
|
})
|
|
@@ -981640,7 +981727,7 @@ async function generateJsonschemaForWorkspaces({
|
|
|
981640
981727
|
// src/commands/merge/mergeOpenAPIWithOverrides.ts
|
|
981641
981728
|
init_lib8();
|
|
981642
981729
|
init_lib6();
|
|
981643
|
-
var
|
|
981730
|
+
var import_promises207 = require("fs/promises");
|
|
981644
981731
|
init_js_yaml();
|
|
981645
981732
|
var HTTP_METHODS4 = /* @__PURE__ */ new Set(["get", "put", "post", "delete", "options", "head", "patch", "trace"]);
|
|
981646
981733
|
async function mergeOpenAPIWithOverrides({
|
|
@@ -981669,11 +981756,11 @@ async function mergeOpenAPIWithOverrides({
|
|
|
981669
981756
|
if (split2) {
|
|
981670
981757
|
const examples = extractEnrichedExamples2(openapi, merged);
|
|
981671
981758
|
const output2 = isJson ? JSON.stringify(examples, null, 2) : index_vite_proxy_tmp_default.dump(examples, { lineWidth: -1, noRefs: true });
|
|
981672
|
-
await (0,
|
|
981759
|
+
await (0, import_promises207.writeFile)(outputPath, output2);
|
|
981673
981760
|
context3.logger.info(`Extracted enriched examples written to ${outputPath}`);
|
|
981674
981761
|
} else {
|
|
981675
981762
|
const output2 = isJson ? JSON.stringify(merged, null, 2) : index_vite_proxy_tmp_default.dump(merged, { lineWidth: -1, noRefs: true });
|
|
981676
|
-
await (0,
|
|
981763
|
+
await (0, import_promises207.writeFile)(outputPath, output2);
|
|
981677
981764
|
if (outputPath === openapiPath) {
|
|
981678
981765
|
context3.logger.info(`Enriched ${openapiPath} in-place`);
|
|
981679
981766
|
} else {
|
|
@@ -981683,7 +981770,7 @@ async function mergeOpenAPIWithOverrides({
|
|
|
981683
981770
|
});
|
|
981684
981771
|
}
|
|
981685
981772
|
async function loadYamlOrJson(filepath, context3) {
|
|
981686
|
-
const contents = await (0,
|
|
981773
|
+
const contents = await (0, import_promises207.readFile)(filepath, "utf8");
|
|
981687
981774
|
try {
|
|
981688
981775
|
return JSON.parse(contents);
|
|
981689
981776
|
} catch {
|
|
@@ -982478,7 +982565,7 @@ init_lib35();
|
|
|
982478
982565
|
init_lib6();
|
|
982479
982566
|
init_esm19();
|
|
982480
982567
|
init_axios2();
|
|
982481
|
-
var
|
|
982568
|
+
var import_promises208 = require("fs/promises");
|
|
982482
982569
|
var import_path117 = __toESM(require("path"), 1);
|
|
982483
982570
|
init_index_min2();
|
|
982484
982571
|
var import_tmp_promise20 = __toESM(require_tmp_promise(), 1);
|
|
@@ -982532,7 +982619,7 @@ async function registerWorkspacesV1({
|
|
|
982532
982619
|
context3.logger.debug(`Compressing definition at ${tmpDir.path}`);
|
|
982533
982620
|
await Kn({ file: tarPath, cwd: resolvedWorkspace.absoluteFilePath }, ["."]);
|
|
982534
982621
|
context3.logger.info("Uploading definition...");
|
|
982535
|
-
await axios_default.put(registerApiResponse.body.definitionS3UploadUrl, await (0,
|
|
982622
|
+
await axios_default.put(registerApiResponse.body.definitionS3UploadUrl, await (0, import_promises208.readFile)(tarPath));
|
|
982536
982623
|
context3.logger.info(
|
|
982537
982624
|
`Registered @${project.config.organization}/${resolvedWorkspace.definition.rootApiFile.contents.name}:${registerApiResponse.body.version}`
|
|
982538
982625
|
);
|
|
@@ -982589,7 +982676,7 @@ function getAIEnhancerConfig2() {
|
|
|
982589
982676
|
// src/commands/resolve-specs/resolveSpecsForWorkspaces.ts
|
|
982590
982677
|
init_lib8();
|
|
982591
982678
|
init_lib35();
|
|
982592
|
-
var
|
|
982679
|
+
var import_promises209 = require("fs/promises");
|
|
982593
982680
|
var import_path118 = __toESM(require("path"), 1);
|
|
982594
982681
|
async function resolveSpecsForWorkspaces({
|
|
982595
982682
|
project,
|
|
@@ -982609,14 +982696,14 @@ async function resolveSpecsForWorkspaces({
|
|
|
982609
982696
|
return;
|
|
982610
982697
|
}
|
|
982611
982698
|
const workspaceOutputDir = project.apiWorkspaces.length > 1 ? AbsoluteFilePath2.of(import_path118.default.join(outputDir, workspace.workspaceName ?? "api")) : outputDir;
|
|
982612
|
-
await (0,
|
|
982699
|
+
await (0, import_promises209.mkdir)(workspaceOutputDir, { recursive: true });
|
|
982613
982700
|
const manifest = await collectRawSpecs({
|
|
982614
982701
|
specs,
|
|
982615
982702
|
hostOutputDir: workspaceOutputDir,
|
|
982616
982703
|
containerBaseDir: ".",
|
|
982617
982704
|
context: context3
|
|
982618
982705
|
});
|
|
982619
|
-
await (0,
|
|
982706
|
+
await (0, import_promises209.writeFile)(
|
|
982620
982707
|
import_path118.default.join(workspaceOutputDir, SPECS_MANIFEST_FILENAME),
|
|
982621
982708
|
JSON.stringify(manifest, void 0, 4)
|
|
982622
982709
|
);
|
|
@@ -982826,7 +982913,7 @@ init_lib17();
|
|
|
982826
982913
|
init_lib19();
|
|
982827
982914
|
init_lib8();
|
|
982828
982915
|
init_lib6();
|
|
982829
|
-
var
|
|
982916
|
+
var import_promises210 = __toESM(require("fs/promises"), 1);
|
|
982830
982917
|
|
|
982831
982918
|
// src/commands/sdk-preview/computePreviewVersion.ts
|
|
982832
982919
|
var BASE_VERSION = "0.0.1";
|
|
@@ -982946,7 +983033,7 @@ async function sdkPreview({
|
|
|
982946
983033
|
const firstPath = pathOutputs[0];
|
|
982947
983034
|
const absolutePathToOutput = firstPath != null ? AbsoluteFilePath2.of(resolve6(cwd(), firstPath)) : void 0;
|
|
982948
983035
|
if (absolutePathToOutput != null) {
|
|
982949
|
-
await
|
|
983036
|
+
await import_promises210.default.mkdir(absolutePathToOutput, { recursive: true });
|
|
982950
983037
|
}
|
|
982951
983038
|
for (const workspace of project.apiWorkspaces) {
|
|
982952
983039
|
if (workspace.generatorsConfiguration == null) {
|
|
@@ -983136,7 +983223,7 @@ async function sdkPreview({
|
|
|
983136
983223
|
init_lib33();
|
|
983137
983224
|
init_lib6();
|
|
983138
983225
|
init_source();
|
|
983139
|
-
var
|
|
983226
|
+
var import_promises211 = require("fs/promises");
|
|
983140
983227
|
var import_path119 = require("path");
|
|
983141
983228
|
async function getPackageManagerBinDir(logger4, pm) {
|
|
983142
983229
|
let command3;
|
|
@@ -983182,7 +983269,7 @@ async function detectInstallationMethod(logger4) {
|
|
|
983182
983269
|
logger4.debug(`Found fern at: ${fernPath}`);
|
|
983183
983270
|
let resolvedPath;
|
|
983184
983271
|
try {
|
|
983185
|
-
resolvedPath = await (0,
|
|
983272
|
+
resolvedPath = await (0, import_promises211.realpath)(fernPath);
|
|
983186
983273
|
logger4.debug(`Resolved to: ${resolvedPath}`);
|
|
983187
983274
|
} catch (error50) {
|
|
983188
983275
|
logger4.debug(`Failed to resolve symlink: ${error50}`);
|
|
@@ -983496,22 +983583,22 @@ init_lib19();
|
|
|
983496
983583
|
init_lib8();
|
|
983497
983584
|
init_lib6();
|
|
983498
983585
|
var fs33 = __toESM(require("fs"), 1);
|
|
983499
|
-
var
|
|
983586
|
+
var import_promises212 = require("fs/promises");
|
|
983500
983587
|
init_graphql();
|
|
983501
983588
|
init_js_yaml();
|
|
983502
983589
|
var import_stream18 = require("stream");
|
|
983503
|
-
var
|
|
983590
|
+
var import_promises213 = require("stream/promises");
|
|
983504
983591
|
async function fetchAndWriteFile(url3, path119, logger4, indent4) {
|
|
983505
983592
|
const resp = await fetch(url3);
|
|
983506
983593
|
if (resp.ok && resp.body) {
|
|
983507
983594
|
logger4.debug("Origin successfully fetched, writing to file");
|
|
983508
983595
|
const fileStream = fs33.createWriteStream(path119);
|
|
983509
|
-
await (0,
|
|
983510
|
-
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");
|
|
983511
983598
|
try {
|
|
983512
|
-
await (0,
|
|
983599
|
+
await (0, import_promises212.writeFile)(path119, JSON.stringify(JSON.parse(fileContents), void 0, indent4), "utf8");
|
|
983513
983600
|
} catch (e2) {
|
|
983514
|
-
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");
|
|
983515
983602
|
}
|
|
983516
983603
|
logger4.debug("File written successfully");
|
|
983517
983604
|
}
|
|
@@ -983667,14 +983754,14 @@ async function tryDirectJSONFetch(url3, logger4) {
|
|
|
983667
983754
|
async function fetchGraphQLSchemaWithAutoDetection(url3, path119, logger4) {
|
|
983668
983755
|
const postResult = await tryGraphQLIntrospection(url3, logger4);
|
|
983669
983756
|
if (postResult.success) {
|
|
983670
|
-
await (0,
|
|
983757
|
+
await (0, import_promises212.writeFile)(path119, postResult.result, "utf8");
|
|
983671
983758
|
logger4.info("Successfully fetched GraphQL schema using POST introspection");
|
|
983672
983759
|
return;
|
|
983673
983760
|
}
|
|
983674
983761
|
logger4.debug(`POST introspection failed: ${postResult.error}`);
|
|
983675
983762
|
const getResult = await tryDirectJSONFetch(url3, logger4);
|
|
983676
983763
|
if (getResult.success) {
|
|
983677
|
-
await (0,
|
|
983764
|
+
await (0, import_promises212.writeFile)(path119, getResult.result, "utf8");
|
|
983678
983765
|
logger4.info("Successfully fetched GraphQL schema using direct JSON fetch");
|
|
983679
983766
|
return;
|
|
983680
983767
|
}
|
|
@@ -984384,7 +984471,7 @@ async function validateWorkspaces({
|
|
|
984384
984471
|
init_lib19();
|
|
984385
984472
|
init_lib8();
|
|
984386
984473
|
init_source();
|
|
984387
|
-
var
|
|
984474
|
+
var import_promises214 = require("fs/promises");
|
|
984388
984475
|
init_js_yaml();
|
|
984389
984476
|
var import_path121 = __toESM(require("path"), 1);
|
|
984390
984477
|
async function writeDefinitionForWorkspaces({
|
|
@@ -984466,22 +984553,22 @@ async function writeFernDefinition({
|
|
|
984466
984553
|
return a3.localeCompare(b5);
|
|
984467
984554
|
};
|
|
984468
984555
|
if (await doesPathExist(absolutePathToOutputDirectory)) {
|
|
984469
|
-
await (0,
|
|
984556
|
+
await (0, import_promises214.rm)(absolutePathToOutputDirectory, { recursive: true });
|
|
984470
984557
|
}
|
|
984471
|
-
await (0,
|
|
984472
|
-
await (0,
|
|
984558
|
+
await (0, import_promises214.mkdir)(absolutePathToOutputDirectory, { recursive: true });
|
|
984559
|
+
await (0, import_promises214.writeFile)(
|
|
984473
984560
|
join8(absolutePathToOutputDirectory, RelativeFilePath2.of(ROOT_API_FILENAME)),
|
|
984474
984561
|
index_vite_proxy_tmp_default.dump(definition3.rootApiFile.contents, { sortKeys })
|
|
984475
984562
|
);
|
|
984476
984563
|
for (const [relativePath, packageMarker] of Object.entries(definition3.packageMarkers)) {
|
|
984477
984564
|
const absoluteFilepath = join8(absolutePathToOutputDirectory, RelativeFilePath2.of(relativePath));
|
|
984478
|
-
await (0,
|
|
984479
|
-
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 }));
|
|
984480
984567
|
}
|
|
984481
984568
|
for (const [relativePath, definitionFile] of Object.entries(definition3.namedDefinitionFiles)) {
|
|
984482
984569
|
const absoluteFilepath = join8(absolutePathToOutputDirectory, RelativeFilePath2.of(relativePath));
|
|
984483
|
-
await (0,
|
|
984484
|
-
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 }));
|
|
984485
984572
|
}
|
|
984486
984573
|
}
|
|
984487
984574
|
|
|
@@ -984489,7 +984576,7 @@ async function writeFernDefinition({
|
|
|
984489
984576
|
init_lib67();
|
|
984490
984577
|
init_lib8();
|
|
984491
984578
|
init_source();
|
|
984492
|
-
var
|
|
984579
|
+
var import_promises215 = require("fs/promises");
|
|
984493
984580
|
async function writeDocsDefinitionForProject({
|
|
984494
984581
|
project,
|
|
984495
984582
|
outputPath,
|
|
@@ -984521,7 +984608,7 @@ async function writeDocsDefinitionForProject({
|
|
|
984521
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
|
|
984522
984609
|
});
|
|
984523
984610
|
const docsDefinition = await docsResolver.resolve();
|
|
984524
|
-
await (0,
|
|
984611
|
+
await (0, import_promises215.writeFile)(AbsoluteFilePath2.of(outputPath), JSON.stringify(docsDefinition, null, 2));
|
|
984525
984612
|
context3.logger.info(source_default.green(`Docs definition written to ${outputPath}`));
|
|
984526
984613
|
});
|
|
984527
984614
|
}
|