@settlemint/sdk-cli 0.6.41-pre47f5d9 → 0.6.42-main3b09370
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/dist/cli.js +128 -126
- package/dist/cli.js.map +8 -8
- package/package.json +4 -3
package/dist/cli.js
CHANGED
|
@@ -221597,8 +221597,8 @@ var require_posix = __commonJS((exports) => {
|
|
|
221597
221597
|
}
|
|
221598
221598
|
};
|
|
221599
221599
|
exports.sync = sync3;
|
|
221600
|
-
var checkStat = (
|
|
221601
|
-
var checkMode = (
|
|
221600
|
+
var checkStat = (stat7, options) => stat7.isFile() && checkMode(stat7, options);
|
|
221601
|
+
var checkMode = (stat7, options) => {
|
|
221602
221602
|
const myUid = options.uid ?? process.getuid?.();
|
|
221603
221603
|
const myGroups = options.groups ?? process.getgroups?.() ?? [];
|
|
221604
221604
|
const myGid = options.gid ?? process.getgid?.() ?? myGroups[0];
|
|
@@ -221606,9 +221606,9 @@ var require_posix = __commonJS((exports) => {
|
|
|
221606
221606
|
throw new Error("cannot get uid or gid");
|
|
221607
221607
|
}
|
|
221608
221608
|
const groups = new Set([myGid, ...myGroups]);
|
|
221609
|
-
const mod =
|
|
221610
|
-
const uid =
|
|
221611
|
-
const gid =
|
|
221609
|
+
const mod = stat7.mode;
|
|
221610
|
+
const uid = stat7.uid;
|
|
221611
|
+
const gid = stat7.gid;
|
|
221612
221612
|
const u6 = parseInt("100", 8);
|
|
221613
221613
|
const g6 = parseInt("010", 8);
|
|
221614
221614
|
const o7 = parseInt("001", 8);
|
|
@@ -221662,7 +221662,7 @@ var require_win32 = __commonJS((exports) => {
|
|
|
221662
221662
|
}
|
|
221663
221663
|
return false;
|
|
221664
221664
|
};
|
|
221665
|
-
var checkStat = (
|
|
221665
|
+
var checkStat = (stat7, path5, options) => stat7.isFile() && checkPathExt(path5, options);
|
|
221666
221666
|
});
|
|
221667
221667
|
|
|
221668
221668
|
// ../../node_modules/isexe/dist/cjs/options.js
|
|
@@ -225272,8 +225272,8 @@ var require_clone = __commonJS((exports, module) => {
|
|
|
225272
225272
|
|
|
225273
225273
|
// ../../node_modules/@npmcli/git/lib/is.js
|
|
225274
225274
|
var require_is = __commonJS((exports, module) => {
|
|
225275
|
-
var { stat:
|
|
225276
|
-
module.exports = ({ cwd = process.cwd() } = {}) =>
|
|
225275
|
+
var { stat: stat7 } = __require("fs/promises");
|
|
225276
|
+
module.exports = ({ cwd = process.cwd() } = {}) => stat7(cwd + "/.git").then(() => true, () => false);
|
|
225277
225277
|
});
|
|
225278
225278
|
|
|
225279
225279
|
// ../../node_modules/@npmcli/git/lib/find.js
|
|
@@ -230270,21 +230270,21 @@ var require_write_entry = __commonJS((exports, module) => {
|
|
|
230270
230270
|
return super.emit(ev, ...data);
|
|
230271
230271
|
}
|
|
230272
230272
|
[LSTAT]() {
|
|
230273
|
-
fs3.lstat(this.absolute, (er2,
|
|
230273
|
+
fs3.lstat(this.absolute, (er2, stat8) => {
|
|
230274
230274
|
if (er2) {
|
|
230275
230275
|
return this.emit("error", er2);
|
|
230276
230276
|
}
|
|
230277
|
-
this[ONLSTAT](
|
|
230277
|
+
this[ONLSTAT](stat8);
|
|
230278
230278
|
});
|
|
230279
230279
|
}
|
|
230280
|
-
[ONLSTAT](
|
|
230281
|
-
this.statCache.set(this.absolute,
|
|
230282
|
-
this.stat =
|
|
230283
|
-
if (!
|
|
230284
|
-
|
|
230280
|
+
[ONLSTAT](stat8) {
|
|
230281
|
+
this.statCache.set(this.absolute, stat8);
|
|
230282
|
+
this.stat = stat8;
|
|
230283
|
+
if (!stat8.isFile()) {
|
|
230284
|
+
stat8.size = 0;
|
|
230285
230285
|
}
|
|
230286
|
-
this.type = getType(
|
|
230287
|
-
this.emit("stat",
|
|
230286
|
+
this.type = getType(stat8);
|
|
230287
|
+
this.emit("stat", stat8);
|
|
230288
230288
|
this[PROCESS2]();
|
|
230289
230289
|
}
|
|
230290
230290
|
[PROCESS2]() {
|
|
@@ -230616,7 +230616,7 @@ var require_write_entry = __commonJS((exports, module) => {
|
|
|
230616
230616
|
});
|
|
230617
230617
|
WriteEntry.Sync = WriteEntrySync;
|
|
230618
230618
|
WriteEntry.Tar = WriteEntryTar;
|
|
230619
|
-
var getType = (
|
|
230619
|
+
var getType = (stat8) => stat8.isFile() ? "File" : stat8.isDirectory() ? "Directory" : stat8.isSymbolicLink() ? "SymbolicLink" : "Unsupported";
|
|
230620
230620
|
module.exports = WriteEntry;
|
|
230621
230621
|
});
|
|
230622
230622
|
|
|
@@ -231148,21 +231148,21 @@ var require_pack = __commonJS((exports, module) => {
|
|
|
231148
231148
|
[STAT](job) {
|
|
231149
231149
|
job.pending = true;
|
|
231150
231150
|
this[JOBS] += 1;
|
|
231151
|
-
const
|
|
231152
|
-
fs3[
|
|
231151
|
+
const stat8 = this.follow ? "stat" : "lstat";
|
|
231152
|
+
fs3[stat8](job.absolute, (er2, stat9) => {
|
|
231153
231153
|
job.pending = false;
|
|
231154
231154
|
this[JOBS] -= 1;
|
|
231155
231155
|
if (er2) {
|
|
231156
231156
|
this.emit("error", er2);
|
|
231157
231157
|
} else {
|
|
231158
|
-
this[ONSTAT](job,
|
|
231158
|
+
this[ONSTAT](job, stat9);
|
|
231159
231159
|
}
|
|
231160
231160
|
});
|
|
231161
231161
|
}
|
|
231162
|
-
[ONSTAT](job,
|
|
231163
|
-
this.statCache.set(job.absolute,
|
|
231164
|
-
job.stat =
|
|
231165
|
-
if (!this.filter(job.path,
|
|
231162
|
+
[ONSTAT](job, stat8) {
|
|
231163
|
+
this.statCache.set(job.absolute, stat8);
|
|
231164
|
+
job.stat = stat8;
|
|
231165
|
+
if (!this.filter(job.path, stat8)) {
|
|
231166
231166
|
job.ignore = true;
|
|
231167
231167
|
}
|
|
231168
231168
|
this[PROCESS2]();
|
|
@@ -231330,10 +231330,10 @@ var require_pack = __commonJS((exports, module) => {
|
|
|
231330
231330
|
resume() {
|
|
231331
231331
|
}
|
|
231332
231332
|
[STAT](job) {
|
|
231333
|
-
const
|
|
231334
|
-
this[ONSTAT](job, fs3[
|
|
231333
|
+
const stat8 = this.follow ? "statSync" : "lstatSync";
|
|
231334
|
+
this[ONSTAT](job, fs3[stat8](job.absolute));
|
|
231335
231335
|
}
|
|
231336
|
-
[READDIR](job,
|
|
231336
|
+
[READDIR](job, stat8) {
|
|
231337
231337
|
this[ONREADDIR](job, fs3.readdirSync(job.absolute));
|
|
231338
231338
|
}
|
|
231339
231339
|
[PIPE](job) {
|
|
@@ -232717,15 +232717,15 @@ var require_list = __commonJS((exports, module) => {
|
|
|
232717
232717
|
let threw = true;
|
|
232718
232718
|
let fd;
|
|
232719
232719
|
try {
|
|
232720
|
-
const
|
|
232720
|
+
const stat8 = fs3.statSync(file);
|
|
232721
232721
|
const readSize = opt2.maxReadSize || 16 * 1024 * 1024;
|
|
232722
|
-
if (
|
|
232722
|
+
if (stat8.size < readSize) {
|
|
232723
232723
|
p5.end(fs3.readFileSync(file));
|
|
232724
232724
|
} else {
|
|
232725
232725
|
let pos = 0;
|
|
232726
232726
|
const buf = Buffer.allocUnsafe(readSize);
|
|
232727
232727
|
fd = fs3.openSync(file, "r");
|
|
232728
|
-
while (pos <
|
|
232728
|
+
while (pos < stat8.size) {
|
|
232729
232729
|
const bytesRead = fs3.readSync(fd, buf, 0, readSize, pos);
|
|
232730
232730
|
pos += bytesRead;
|
|
232731
232731
|
p5.write(buf.slice(0, bytesRead));
|
|
@@ -232749,13 +232749,13 @@ var require_list = __commonJS((exports, module) => {
|
|
|
232749
232749
|
const p5 = new Promise((resolve5, reject) => {
|
|
232750
232750
|
parse5.on("error", reject);
|
|
232751
232751
|
parse5.on("end", resolve5);
|
|
232752
|
-
fs3.stat(file, (er2,
|
|
232752
|
+
fs3.stat(file, (er2, stat8) => {
|
|
232753
232753
|
if (er2) {
|
|
232754
232754
|
reject(er2);
|
|
232755
232755
|
} else {
|
|
232756
232756
|
const stream2 = new fsm.ReadStream(file, {
|
|
232757
232757
|
readSize,
|
|
232758
|
-
size:
|
|
232758
|
+
size: stat8.size
|
|
232759
232759
|
});
|
|
232760
232760
|
stream2.on("error", reject);
|
|
232761
232761
|
stream2.pipe(parse5);
|
|
@@ -233082,7 +233082,7 @@ var require_update = __commonJS((exports, module) => {
|
|
|
233082
233082
|
if (!opt2.mtimeCache) {
|
|
233083
233083
|
opt2.mtimeCache = new Map;
|
|
233084
233084
|
}
|
|
233085
|
-
opt2.filter = filter4 ? (path5,
|
|
233085
|
+
opt2.filter = filter4 ? (path5, stat8) => filter4(path5, stat8) && !(opt2.mtimeCache.get(path5) > stat8.mtime) : (path5, stat8) => !(opt2.mtimeCache.get(path5) > stat8.mtime);
|
|
233086
233086
|
};
|
|
233087
233087
|
});
|
|
233088
233088
|
|
|
@@ -234470,11 +234470,11 @@ var require_extract = __commonJS((exports, module) => {
|
|
|
234470
234470
|
var extractFileSync = (opt2) => {
|
|
234471
234471
|
const u6 = new Unpack.Sync(opt2);
|
|
234472
234472
|
const file = opt2.file;
|
|
234473
|
-
const
|
|
234473
|
+
const stat8 = fs3.statSync(file);
|
|
234474
234474
|
const readSize = opt2.maxReadSize || 16 * 1024 * 1024;
|
|
234475
234475
|
const stream2 = new fsm.ReadStreamSync(file, {
|
|
234476
234476
|
readSize,
|
|
234477
|
-
size:
|
|
234477
|
+
size: stat8.size
|
|
234478
234478
|
});
|
|
234479
234479
|
stream2.pipe(u6);
|
|
234480
234480
|
};
|
|
@@ -234485,13 +234485,13 @@ var require_extract = __commonJS((exports, module) => {
|
|
|
234485
234485
|
const p5 = new Promise((resolve5, reject) => {
|
|
234486
234486
|
u6.on("error", reject);
|
|
234487
234487
|
u6.on("close", resolve5);
|
|
234488
|
-
fs3.stat(file, (er2,
|
|
234488
|
+
fs3.stat(file, (er2, stat8) => {
|
|
234489
234489
|
if (er2) {
|
|
234490
234490
|
reject(er2);
|
|
234491
234491
|
} else {
|
|
234492
234492
|
const stream2 = new fsm.ReadStream(file, {
|
|
234493
234493
|
readSize,
|
|
234494
|
-
size:
|
|
234494
|
+
size: stat8.size
|
|
234495
234495
|
});
|
|
234496
234496
|
stream2.on("error", reject);
|
|
234497
234497
|
stream2.pipe(u6);
|
|
@@ -234543,15 +234543,15 @@ var require_windows = __commonJS((exports, module) => {
|
|
|
234543
234543
|
}
|
|
234544
234544
|
return false;
|
|
234545
234545
|
}
|
|
234546
|
-
function checkStat(
|
|
234547
|
-
if (!
|
|
234546
|
+
function checkStat(stat8, path6, options) {
|
|
234547
|
+
if (!stat8.isSymbolicLink() && !stat8.isFile()) {
|
|
234548
234548
|
return false;
|
|
234549
234549
|
}
|
|
234550
234550
|
return checkPathExt(path6, options);
|
|
234551
234551
|
}
|
|
234552
234552
|
function isexe(path6, options, cb) {
|
|
234553
|
-
fs3.stat(path6, function(er2,
|
|
234554
|
-
cb(er2, er2 ? false : checkStat(
|
|
234553
|
+
fs3.stat(path6, function(er2, stat8) {
|
|
234554
|
+
cb(er2, er2 ? false : checkStat(stat8, path6, options));
|
|
234555
234555
|
});
|
|
234556
234556
|
}
|
|
234557
234557
|
function sync3(path6, options) {
|
|
@@ -234565,20 +234565,20 @@ var require_mode = __commonJS((exports, module) => {
|
|
|
234565
234565
|
isexe.sync = sync3;
|
|
234566
234566
|
var fs3 = __require("fs");
|
|
234567
234567
|
function isexe(path6, options, cb) {
|
|
234568
|
-
fs3.stat(path6, function(er2,
|
|
234569
|
-
cb(er2, er2 ? false : checkStat(
|
|
234568
|
+
fs3.stat(path6, function(er2, stat8) {
|
|
234569
|
+
cb(er2, er2 ? false : checkStat(stat8, options));
|
|
234570
234570
|
});
|
|
234571
234571
|
}
|
|
234572
234572
|
function sync3(path6, options) {
|
|
234573
234573
|
return checkStat(fs3.statSync(path6), options);
|
|
234574
234574
|
}
|
|
234575
|
-
function checkStat(
|
|
234576
|
-
return
|
|
234575
|
+
function checkStat(stat8, options) {
|
|
234576
|
+
return stat8.isFile() && checkMode(stat8, options);
|
|
234577
234577
|
}
|
|
234578
|
-
function checkMode(
|
|
234579
|
-
var mod =
|
|
234580
|
-
var uid =
|
|
234581
|
-
var gid =
|
|
234578
|
+
function checkMode(stat8, options) {
|
|
234579
|
+
var mod = stat8.mode;
|
|
234580
|
+
var uid = stat8.uid;
|
|
234581
|
+
var gid = stat8.gid;
|
|
234582
234582
|
var myUid = options.uid !== undefined ? options.uid : process.getuid && process.getuid();
|
|
234583
234583
|
var myGid = options.gid !== undefined ? options.gid : process.getgid && process.getgid();
|
|
234584
234584
|
var u6 = parseInt("100", 8);
|
|
@@ -239919,10 +239919,10 @@ Content-Type: ${R6.type || "application/octet-stream"}\r
|
|
|
239919
239919
|
}
|
|
239920
239920
|
var nodeDomexception = globalThis.DOMException;
|
|
239921
239921
|
var DOMException2 = _commonjsHelpers.getDefaultExportFromCjs(nodeDomexception);
|
|
239922
|
-
var { stat:
|
|
239922
|
+
var { stat: stat8 } = node_fs.promises;
|
|
239923
239923
|
var blobFromSync = u6((c3, l4) => fromBlob(node_fs.statSync(c3), c3, l4), "blobFromSync");
|
|
239924
|
-
var blobFrom = u6((c3, l4) =>
|
|
239925
|
-
var fileFrom = u6((c3, l4) =>
|
|
239924
|
+
var blobFrom = u6((c3, l4) => stat8(c3).then((d6) => fromBlob(d6, c3, l4)), "blobFrom");
|
|
239925
|
+
var fileFrom = u6((c3, l4) => stat8(c3).then((d6) => fromFile(d6, c3, l4)), "fileFrom");
|
|
239926
239926
|
var fileFromSync = u6((c3, l4) => fromFile(node_fs.statSync(c3), c3, l4), "fileFromSync");
|
|
239927
239927
|
var fromBlob = u6((c3, l4, d6 = "") => new r$1([new BlobDataItem({ path: l4, size: c3.size, lastModified: c3.mtimeMs, start: 0 })], { type: d6 }), "fromBlob");
|
|
239928
239928
|
var fromFile = u6((c3, l4, d6 = "") => new File$1([new BlobDataItem({ path: l4, size: c3.size, lastModified: c3.mtimeMs, start: 0 })], node_path.basename(l4), { type: d6, lastModified: c3.mtimeMs }), "fromFile");
|
|
@@ -239936,7 +239936,7 @@ Content-Type: ${R6.type || "application/octet-stream"}\r
|
|
|
239936
239936
|
return new Xt3({ path: D4(this, Me3), lastModified: this.lastModified, size: d6 - l4, start: D4(this, xe3) + l4 });
|
|
239937
239937
|
}
|
|
239938
239938
|
async* stream() {
|
|
239939
|
-
const { mtimeMs: l4 } = await
|
|
239939
|
+
const { mtimeMs: l4 } = await stat8(D4(this, Me3));
|
|
239940
239940
|
if (l4 > this.lastModified)
|
|
239941
239941
|
throw new DOMException2("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.", "NotReadableError");
|
|
239942
239942
|
yield* node_fs.createReadStream(D4(this, Me3), { start: D4(this, xe3), end: D4(this, xe3) + this.size - 1 });
|
|
@@ -261807,9 +261807,9 @@ var z4 = /* @__PURE__ */ Object.freeze({
|
|
|
261807
261807
|
|
|
261808
261808
|
// ../utils/dist/environment.mjs
|
|
261809
261809
|
var import_dotenvx = __toESM(require_main2(), 1);
|
|
261810
|
-
import { existsSync } from "node:fs";
|
|
261811
261810
|
import { readFile as readFile3, writeFile as writeFile4 } from "node:fs/promises";
|
|
261812
261811
|
import { dirname as dirname32, join as join3 } from "node:path";
|
|
261812
|
+
import { stat as stat6 } from "node:fs/promises";
|
|
261813
261813
|
import { dirname as dirname22 } from "node:path";
|
|
261814
261814
|
var import_dotenvx2 = __toESM(require_main2(), 1);
|
|
261815
261815
|
|
|
@@ -268099,6 +268099,14 @@ async function loadEnvironmentEnv(validateEnv, prod) {
|
|
|
268099
268099
|
return {};
|
|
268100
268100
|
}
|
|
268101
268101
|
}
|
|
268102
|
+
async function exists2(path4) {
|
|
268103
|
+
try {
|
|
268104
|
+
await stat6(path4);
|
|
268105
|
+
return true;
|
|
268106
|
+
} catch {
|
|
268107
|
+
return false;
|
|
268108
|
+
}
|
|
268109
|
+
}
|
|
268102
268110
|
async function projectRoot2() {
|
|
268103
268111
|
const packageJsonPath = await findUp("package.json");
|
|
268104
268112
|
if (!packageJsonPath) {
|
|
@@ -268110,7 +268118,7 @@ async function findMonoRepoRoot(startDir) {
|
|
|
268110
268118
|
let currentDir = startDir;
|
|
268111
268119
|
while (currentDir !== "/") {
|
|
268112
268120
|
const packageJsonPath = join3(currentDir, "package.json");
|
|
268113
|
-
if (
|
|
268121
|
+
if (await exists2(packageJsonPath)) {
|
|
268114
268122
|
try {
|
|
268115
268123
|
const packageJson = JSON.parse(await readFile3(packageJsonPath, "utf-8"));
|
|
268116
268124
|
if (packageJson.workspaces && Array.isArray(packageJson.workspaces) && packageJson.workspaces.length > 0) {
|
|
@@ -268154,11 +268162,11 @@ async function writeEnv(prod, env2, secrets) {
|
|
|
268154
268162
|
const targetDirs = await findMonoRepoPackages(projectDir);
|
|
268155
268163
|
await Promise.all(targetDirs.map(async (dir) => {
|
|
268156
268164
|
const envFile = join3(dir, secrets ? `.env${prod ? ".production" : ""}.local` : `.env${prod ? ".production" : ""}`);
|
|
268157
|
-
let { parsed: currentEnv } = import_dotenvx2.config({
|
|
268165
|
+
let { parsed: currentEnv } = await exists2(envFile) ? import_dotenvx2.config({
|
|
268158
268166
|
path: envFile,
|
|
268159
268167
|
logLevel: "error",
|
|
268160
268168
|
quiet: true
|
|
268161
|
-
});
|
|
268169
|
+
}) : { parsed: {} };
|
|
268162
268170
|
if (!currentEnv) {
|
|
268163
268171
|
currentEnv = {};
|
|
268164
268172
|
}
|
|
@@ -272334,7 +272342,7 @@ function connectCommand() {
|
|
|
272334
272342
|
var package_default = {
|
|
272335
272343
|
name: "@settlemint/sdk-cli",
|
|
272336
272344
|
description: "SettleMint SDK, integrate SettleMint into your application with ease.",
|
|
272337
|
-
version: "0.6.
|
|
272345
|
+
version: "0.6.42-main3b09370",
|
|
272338
272346
|
type: "module",
|
|
272339
272347
|
private: false,
|
|
272340
272348
|
license: "FSL-1.1-MIT",
|
|
@@ -272365,6 +272373,7 @@ var package_default = {
|
|
|
272365
272373
|
},
|
|
272366
272374
|
scripts: {
|
|
272367
272375
|
build: "bun run build.ts",
|
|
272376
|
+
dev: "tsup-node --watch",
|
|
272368
272377
|
test: "bun test",
|
|
272369
272378
|
"test:coverage": "bun test --coverage",
|
|
272370
272379
|
typecheck: "tsc --noEmit",
|
|
@@ -272384,8 +272393,8 @@ var package_default = {
|
|
|
272384
272393
|
"@inquirer/input": "4.1.0",
|
|
272385
272394
|
"@inquirer/password": "4.0.3",
|
|
272386
272395
|
"@inquirer/select": "4.0.3",
|
|
272387
|
-
"@settlemint/sdk-js": "0.6.
|
|
272388
|
-
"@settlemint/sdk-utils": "0.6.
|
|
272396
|
+
"@settlemint/sdk-js": "0.6.42-main3b09370",
|
|
272397
|
+
"@settlemint/sdk-utils": "0.6.42-main3b09370",
|
|
272389
272398
|
"get-tsconfig": "4.8.1",
|
|
272390
272399
|
giget: "1.2.3"
|
|
272391
272400
|
},
|
|
@@ -272448,7 +272457,7 @@ async function templatePrompt(templates, argument) {
|
|
|
272448
272457
|
// ../utils/dist/package-manager.mjs
|
|
272449
272458
|
import { readdir as readdir3, rm as rm2 } from "node:fs/promises";
|
|
272450
272459
|
import { resolve as resolve4 } from "node:path";
|
|
272451
|
-
import { stat as
|
|
272460
|
+
import { stat as stat7 } from "node:fs/promises";
|
|
272452
272461
|
import { dirname as dirname23 } from "node:path";
|
|
272453
272462
|
|
|
272454
272463
|
// ../../node_modules/package-manager-detector/dist/detect.mjs
|
|
@@ -272546,9 +272555,9 @@ async function fileExists(filePath) {
|
|
|
272546
272555
|
// ../utils/dist/package-manager.mjs
|
|
272547
272556
|
var import_package_json = __toESM(require_lib13(), 1);
|
|
272548
272557
|
var import_package_json2 = __toESM(require_lib13(), 1);
|
|
272549
|
-
async function
|
|
272558
|
+
async function exists3(path5) {
|
|
272550
272559
|
try {
|
|
272551
|
-
await
|
|
272560
|
+
await stat7(path5);
|
|
272552
272561
|
return true;
|
|
272553
272562
|
} catch {
|
|
272554
272563
|
return false;
|
|
@@ -272572,7 +272581,7 @@ async function isEmpty(path5) {
|
|
|
272572
272581
|
return files.length === 0 || files.length === 1 && files[0] === ".git";
|
|
272573
272582
|
}
|
|
272574
272583
|
async function emptyDir(dir) {
|
|
272575
|
-
if (!await
|
|
272584
|
+
if (!await exists3(dir))
|
|
272576
272585
|
return;
|
|
272577
272586
|
for (const file of await readdir3(dir)) {
|
|
272578
272587
|
if (file === ".git")
|
|
@@ -272594,7 +272603,7 @@ import { mkdir as mkdir5 } from "node:fs/promises";
|
|
|
272594
272603
|
// ../../node_modules/giget/dist/index.mjs
|
|
272595
272604
|
var import_tar = __toESM(require_tar(), 1);
|
|
272596
272605
|
import { readFile as readFile6, writeFile as writeFile7, mkdir as mkdir4, rm as rm3 } from "node:fs/promises";
|
|
272597
|
-
import { existsSync as
|
|
272606
|
+
import { existsSync as existsSync2, createWriteStream as createWriteStream2, readdirSync as readdirSync2 } from "node:fs";
|
|
272598
272607
|
|
|
272599
272608
|
// ../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs
|
|
272600
272609
|
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
@@ -272815,7 +272824,7 @@ var defuArrayFn = createDefu((object, key2, currentValue) => {
|
|
|
272815
272824
|
});
|
|
272816
272825
|
|
|
272817
272826
|
// ../../node_modules/nypm/dist/index.mjs
|
|
272818
|
-
import { existsSync
|
|
272827
|
+
import { existsSync } from "node:fs";
|
|
272819
272828
|
import { readFile as readFile5 } from "node:fs/promises";
|
|
272820
272829
|
async function findup(cwd2, match2, options = {}) {
|
|
272821
272830
|
const segments = normalize3(cwd2).split("/");
|
|
@@ -272909,7 +272918,7 @@ async function detectPackageManager(cwd2, options = {}) {
|
|
|
272909
272918
|
const detected = await findup(resolve5(cwd2 || "."), async (path8) => {
|
|
272910
272919
|
if (!options.ignorePackageJSON) {
|
|
272911
272920
|
const packageJSONPath = join5(path8, "package.json");
|
|
272912
|
-
if (
|
|
272921
|
+
if (existsSync(packageJSONPath)) {
|
|
272913
272922
|
const packageJSON = JSON.parse(await readFile5(packageJSONPath, "utf8"));
|
|
272914
272923
|
if (packageJSON?.packageManager) {
|
|
272915
272924
|
const [name2, version = "0.0.0"] = packageJSON.packageManager.split("@");
|
|
@@ -272931,7 +272940,7 @@ async function detectPackageManager(cwd2, options = {}) {
|
|
|
272931
272940
|
packageManager.lockFile,
|
|
272932
272941
|
packageManager.files
|
|
272933
272942
|
].flat().filter(Boolean);
|
|
272934
|
-
if (detectionsFiles.some((file) =>
|
|
272943
|
+
if (detectionsFiles.some((file) => existsSync(resolve5(path8, file)))) {
|
|
272935
272944
|
return {
|
|
272936
272945
|
...packageManager
|
|
272937
272946
|
};
|
|
@@ -272984,7 +272993,7 @@ async function download(url, filePath, options = {}) {
|
|
|
272984
272993
|
return;
|
|
272985
272994
|
});
|
|
272986
272995
|
const etag = headResponse?.headers.get("etag");
|
|
272987
|
-
if (info.etag === etag &&
|
|
272996
|
+
if (info.etag === etag && existsSync2(filePath)) {
|
|
272988
272997
|
return;
|
|
272989
272998
|
}
|
|
272990
272999
|
if (typeof etag === "string") {
|
|
@@ -273207,7 +273216,7 @@ async function downloadTemplate(input, options = {}) {
|
|
|
273207
273216
|
template.defaultDir = (template.defaultDir || template.name).replace(/[^\da-z-]/gi, "-");
|
|
273208
273217
|
const temporaryDirectory = resolve5(cacheDirectory(), providerName, template.name);
|
|
273209
273218
|
const tarPath = resolve5(temporaryDirectory, (template.version || template.name) + ".tar.gz");
|
|
273210
|
-
if (options.preferOffline &&
|
|
273219
|
+
if (options.preferOffline && existsSync2(tarPath)) {
|
|
273211
273220
|
options.offline = true;
|
|
273212
273221
|
}
|
|
273213
273222
|
if (!options.offline) {
|
|
@@ -273219,7 +273228,7 @@ async function downloadTemplate(input, options = {}) {
|
|
|
273219
273228
|
...normalizeHeaders(template.headers)
|
|
273220
273229
|
}
|
|
273221
273230
|
}).catch((error5) => {
|
|
273222
|
-
if (!
|
|
273231
|
+
if (!existsSync2(tarPath)) {
|
|
273223
273232
|
throw error5;
|
|
273224
273233
|
}
|
|
273225
273234
|
debug2("Download error. Using cached version:", error5);
|
|
@@ -273227,7 +273236,7 @@ async function downloadTemplate(input, options = {}) {
|
|
|
273227
273236
|
});
|
|
273228
273237
|
debug2(`Downloaded ${template.tar} to ${tarPath} in ${Date.now() - s22}ms`);
|
|
273229
273238
|
}
|
|
273230
|
-
if (!
|
|
273239
|
+
if (!existsSync2(tarPath)) {
|
|
273231
273240
|
throw new Error(`Tarball not found: ${tarPath} (offline: ${options.offline})`);
|
|
273232
273241
|
}
|
|
273233
273242
|
const cwd2 = resolve5(options.cwd || ".");
|
|
@@ -273235,7 +273244,7 @@ async function downloadTemplate(input, options = {}) {
|
|
|
273235
273244
|
if (options.forceClean) {
|
|
273236
273245
|
await rm3(extractPath, { recursive: true, force: true });
|
|
273237
273246
|
}
|
|
273238
|
-
if (!options.force &&
|
|
273247
|
+
if (!options.force && existsSync2(extractPath) && readdirSync2(extractPath).length > 0) {
|
|
273239
273248
|
throw new Error(`Destination ${extractPath} already exists.`);
|
|
273240
273249
|
}
|
|
273241
273250
|
await mkdir4(extractPath, { recursive: true });
|
|
@@ -273486,7 +273495,7 @@ var SETTLEMINT_CLIENT_MAP = {
|
|
|
273486
273495
|
// ../utils/dist/index.mjs
|
|
273487
273496
|
import { spawn as spawn2 } from "node:child_process";
|
|
273488
273497
|
var import_dotenvx3 = __toESM(require_main2(), 1);
|
|
273489
|
-
import { stat as
|
|
273498
|
+
import { stat as stat8 } from "node:fs/promises";
|
|
273490
273499
|
var import_dotenvx4 = __toESM(require_main2(), 1);
|
|
273491
273500
|
var import_package_json3 = __toESM(require_lib13(), 1);
|
|
273492
273501
|
var import_package_json4 = __toESM(require_lib13(), 1);
|
|
@@ -273495,17 +273504,23 @@ function capitalizeFirstLetter(val) {
|
|
|
273495
273504
|
}
|
|
273496
273505
|
async function executeCommand2(command, args, options) {
|
|
273497
273506
|
const child = spawn2(command, args, { env: { ...process.env, ...options?.env } });
|
|
273507
|
+
process.stdin.pipe(child.stdin);
|
|
273508
|
+
const output = [];
|
|
273498
273509
|
return new Promise((resolve22, reject) => {
|
|
273499
273510
|
child.stdout.on("data", (data) => {
|
|
273500
|
-
|
|
273511
|
+
if (!options?.silent) {
|
|
273512
|
+
process.stdout.write(data);
|
|
273513
|
+
}
|
|
273514
|
+
output.push(data.toString());
|
|
273501
273515
|
});
|
|
273502
273516
|
child.stderr.on("data", (data) => {
|
|
273503
|
-
|
|
273517
|
+
process.stderr.write(data);
|
|
273504
273518
|
});
|
|
273505
273519
|
child.on("error", (err) => reject(err));
|
|
273506
273520
|
child.on("close", (code2) => {
|
|
273507
273521
|
if (code2 === 0 || code2 === null || code2 === 143) {
|
|
273508
|
-
|
|
273522
|
+
process.stdin.unpipe(child.stdin);
|
|
273523
|
+
resolve22(output);
|
|
273509
273524
|
return;
|
|
273510
273525
|
}
|
|
273511
273526
|
reject(new Error(`Command "${command}" exited with code ${code2}`));
|
|
@@ -273601,9 +273616,9 @@ async function loadEnvironmentEnv2(validateEnv, prod) {
|
|
|
273601
273616
|
return {};
|
|
273602
273617
|
}
|
|
273603
273618
|
}
|
|
273604
|
-
async function
|
|
273619
|
+
async function exists4(path8) {
|
|
273605
273620
|
try {
|
|
273606
|
-
await
|
|
273621
|
+
await stat8(path8);
|
|
273607
273622
|
return true;
|
|
273608
273623
|
} catch {
|
|
273609
273624
|
return false;
|
|
@@ -275058,7 +275073,7 @@ function createCommand4() {
|
|
|
275058
275073
|
const name2 = await namePrompt(env2, projectName);
|
|
275059
275074
|
const targetDir = formatTargetDir(name2);
|
|
275060
275075
|
const projectDir = join7(process.cwd(), targetDir);
|
|
275061
|
-
if (await
|
|
275076
|
+
if (await exists4(projectDir) && !await isEmpty(projectDir)) {
|
|
275062
275077
|
const confirmEmpty = await esm_default2({
|
|
275063
275078
|
message: `The folder ${projectDir} already exists. Do you want to delete it?`,
|
|
275064
275079
|
default: false
|
|
@@ -275224,18 +275239,29 @@ async function deploymentIdPrompt(env2, accept, prod) {
|
|
|
275224
275239
|
// src/utils/hardhat-config.ts
|
|
275225
275240
|
async function getHardhatConfigData(envConfig) {
|
|
275226
275241
|
try {
|
|
275227
|
-
|
|
275228
|
-
|
|
275229
|
-
|
|
275230
|
-
|
|
275231
|
-
|
|
275232
|
-
|
|
275242
|
+
const { command, args } = await getPackageManagerExecutable();
|
|
275243
|
+
const output = await executeCommand2(command, [...args, "ts-node", "-e", `import hardhat from "hardhat";
|
|
275244
|
+
console.log(JSON.stringify(hardhat.userConfig));`], {
|
|
275245
|
+
env: {
|
|
275246
|
+
...process.env,
|
|
275247
|
+
...envConfig
|
|
275248
|
+
},
|
|
275249
|
+
silent: true
|
|
275250
|
+
});
|
|
275251
|
+
const config4 = JSON.parse(output.join(" "));
|
|
275252
|
+
if (isHardhatConfig(config4)) {
|
|
275253
|
+
return config4;
|
|
275254
|
+
}
|
|
275255
|
+
throw new Error("Invalid hardhat config");
|
|
275233
275256
|
} catch (err) {
|
|
275234
275257
|
const error5 = err;
|
|
275235
275258
|
note(`Error reading hardhat.config.ts: ${error5.message}`);
|
|
275236
275259
|
return {};
|
|
275237
275260
|
}
|
|
275238
275261
|
}
|
|
275262
|
+
function isHardhatConfig(config4) {
|
|
275263
|
+
return typeof config4 === "object" && config4 !== null && "networks" in config4;
|
|
275264
|
+
}
|
|
275239
275265
|
|
|
275240
275266
|
// src/commands/smart-contract-set/hardhat/deploy/remote.ts
|
|
275241
275267
|
function hardhatDeployRemoteCommand() {
|
|
@@ -275252,17 +275278,9 @@ function hardhatDeployRemoteCommand() {
|
|
|
275252
275278
|
accessToken,
|
|
275253
275279
|
instance
|
|
275254
275280
|
});
|
|
275255
|
-
let nodeId = blockchainNodeId
|
|
275281
|
+
let nodeId = blockchainNodeId;
|
|
275256
275282
|
if (!nodeId) {
|
|
275257
|
-
const
|
|
275258
|
-
if (!personalAccessToken) {
|
|
275259
|
-
return missingPersonalAccessTokenError();
|
|
275260
|
-
}
|
|
275261
|
-
const settlemintPat = createSettleMintClient({
|
|
275262
|
-
accessToken: personalAccessToken.personalAccessToken,
|
|
275263
|
-
instance
|
|
275264
|
-
});
|
|
275265
|
-
const blockchainNodes = await settlemintPat.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
275283
|
+
const blockchainNodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
275266
275284
|
const blockchainNode = await blockchainNodePrompt(env2, blockchainNodes, autoAccept);
|
|
275267
275285
|
if (!blockchainNode) {
|
|
275268
275286
|
cancel2("No Blockchain Node selected. Please select one to continue.");
|
|
@@ -275341,17 +275359,9 @@ function hardhatScriptRemoteCommand() {
|
|
|
275341
275359
|
accessToken,
|
|
275342
275360
|
instance
|
|
275343
275361
|
});
|
|
275344
|
-
let nodeId = blockchainNodeId
|
|
275362
|
+
let nodeId = blockchainNodeId;
|
|
275345
275363
|
if (!nodeId) {
|
|
275346
|
-
const
|
|
275347
|
-
if (!personalAccessToken) {
|
|
275348
|
-
return missingPersonalAccessTokenError();
|
|
275349
|
-
}
|
|
275350
|
-
const settlemintPat = createSettleMintClient({
|
|
275351
|
-
accessToken: personalAccessToken.personalAccessToken,
|
|
275352
|
-
instance
|
|
275353
|
-
});
|
|
275354
|
-
const blockchainNodes = await settlemintPat.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
275364
|
+
const blockchainNodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
275355
275365
|
const blockchainNode = await blockchainNodePrompt(env2, blockchainNodes, autoAccept);
|
|
275356
275366
|
if (!blockchainNode) {
|
|
275357
275367
|
cancel2("No Blockchain Node selected. Please select one to continue.");
|
|
@@ -275385,7 +275395,7 @@ function hardhatTestCommand() {
|
|
|
275385
275395
|
}
|
|
275386
275396
|
|
|
275387
275397
|
// src/commands/smart-contract-set/subgraph/utils/is-generated.ts
|
|
275388
|
-
var isGenerated = () =>
|
|
275398
|
+
var isGenerated = () => exists4("subgraph/subgraph.config.json");
|
|
275389
275399
|
|
|
275390
275400
|
// src/commands/smart-contract-set/subgraph/utils/setup.ts
|
|
275391
275401
|
import { rm as rm4, writeFile as writeFile9 } from "node:fs/promises";
|
|
@@ -275481,16 +275491,16 @@ async function subgraphSetup({ env: env2, instance, accessToken, isGenerated: is
|
|
|
275481
275491
|
cancel2("No Graph Middleware selected. Please select one to continue.");
|
|
275482
275492
|
}
|
|
275483
275493
|
await executeCommand2("forge", ["build"]);
|
|
275484
|
-
if (await
|
|
275494
|
+
if (await exists4("./generated")) {
|
|
275485
275495
|
await rm4("./generated", { recursive: true, force: true });
|
|
275486
275496
|
}
|
|
275487
|
-
if (await
|
|
275497
|
+
if (await exists4("./subgraph/generated")) {
|
|
275488
275498
|
await rm4("./subgraph/generated", { recursive: true, force: true });
|
|
275489
275499
|
}
|
|
275490
|
-
if (await
|
|
275500
|
+
if (await exists4("./build")) {
|
|
275491
275501
|
await rm4("./build", { recursive: true, force: true });
|
|
275492
275502
|
}
|
|
275493
|
-
if (await
|
|
275503
|
+
if (await exists4("./subgraph/build")) {
|
|
275494
275504
|
await rm4("./subgraph/build", { recursive: true, force: true });
|
|
275495
275505
|
}
|
|
275496
275506
|
const isFixedNetwork = (theGraphMiddleware.entityVersion ?? 4) >= 4;
|
|
@@ -275537,24 +275547,16 @@ async function getTheGraphMiddleware({
|
|
|
275537
275547
|
accessToken,
|
|
275538
275548
|
autoAccept
|
|
275539
275549
|
}) {
|
|
275550
|
+
const settlemintClient = createSettleMintClient({
|
|
275551
|
+
accessToken,
|
|
275552
|
+
instance
|
|
275553
|
+
});
|
|
275540
275554
|
if (autoAccept && env2.SETTLEMINT_THEGRAPH) {
|
|
275541
|
-
const
|
|
275542
|
-
accessToken,
|
|
275543
|
-
instance
|
|
275544
|
-
});
|
|
275545
|
-
const defaultTheGraphMiddleware = await settlemintClient2.middleware.read(env2.SETTLEMINT_THEGRAPH);
|
|
275555
|
+
const defaultTheGraphMiddleware = await settlemintClient.middleware.read(env2.SETTLEMINT_THEGRAPH);
|
|
275546
275556
|
if (defaultTheGraphMiddleware && defaultTheGraphMiddleware.__typename === "HAGraphMiddleware") {
|
|
275547
275557
|
return defaultTheGraphMiddleware;
|
|
275548
275558
|
}
|
|
275549
275559
|
}
|
|
275550
|
-
const personalAccessToken = await getInstanceCredentials(instance);
|
|
275551
|
-
if (!personalAccessToken) {
|
|
275552
|
-
return missingPersonalAccessTokenError();
|
|
275553
|
-
}
|
|
275554
|
-
const settlemintClient = createSettleMintClient({
|
|
275555
|
-
accessToken: personalAccessToken.personalAccessToken,
|
|
275556
|
-
instance
|
|
275557
|
-
});
|
|
275558
275560
|
const middlewares = await settlemintClient.middleware.list(env2.SETTLEMINT_APPLICATION);
|
|
275559
275561
|
return theGraphPrompt(env2, middlewares, autoAccept);
|
|
275560
275562
|
}
|
|
@@ -275737,4 +275739,4 @@ sdkcli.parseAsync(process.argv).catch((reason) => {
|
|
|
275737
275739
|
cancel2(reason);
|
|
275738
275740
|
});
|
|
275739
275741
|
|
|
275740
|
-
//# debugId=
|
|
275742
|
+
//# debugId=B073736222CA1CB764756E2164756E21
|