@settlemint/sdk-cli 0.6.56 → 0.6.57
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 +65 -54
- package/dist/cli.js.map +12 -12
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -197427,7 +197427,7 @@ ${Bt.cyan(Yt)}
|
|
|
197427
197427
|
code: "ENOENT"
|
|
197428
197428
|
}), getPathInfo = (e9, t7) => {
|
|
197429
197429
|
var r6 = t7.colon || or;
|
|
197430
|
-
var i6 = e9.match(/\//) || nr && e9.match(/\\/) ? [""] : [...nr ? [process.cwd()] : [], ...(t7.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
197430
|
+
var i6 = e9.match(/\//) || nr && e9.match(/\\/) ? [""] : [...nr ? [process.cwd()] : [], ...(t7.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.deGGLqqAfq:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin").split(r6)];
|
|
197431
197431
|
var n6 = nr ? t7.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
197432
197432
|
var a5 = nr ? n6.split(r6) : [""];
|
|
197433
197433
|
if (nr) {
|
|
@@ -200564,7 +200564,7 @@ ${whileRunning(e9)}`;
|
|
|
200564
200564
|
};
|
|
200565
200565
|
ni = Object.assign(async function _main() {
|
|
200566
200566
|
var e9 = new Cli({
|
|
200567
|
-
binaryVersion: "0.6.
|
|
200567
|
+
binaryVersion: "0.6.57",
|
|
200568
200568
|
binaryLabel: "gql.tada CLI",
|
|
200569
200569
|
binaryName: "gql.tada"
|
|
200570
200570
|
});
|
|
@@ -218401,7 +218401,7 @@ var require_lib4 = __commonJS((exports, module) => {
|
|
|
218401
218401
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
218402
218402
|
var getNotFoundError2 = (cmd2) => Object.assign(new Error(`not found: ${cmd2}`), { code: "ENOENT" });
|
|
218403
218403
|
var getPathInfo2 = (cmd2, {
|
|
218404
|
-
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
218404
|
+
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.deGGLqqAfq:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
|
|
218405
218405
|
pathExt: optPathExt = process.env.PATHEXT,
|
|
218406
218406
|
delimiter: optDelimiter = delimiter
|
|
218407
218407
|
}) => {
|
|
@@ -218605,7 +218605,7 @@ var require_lib5 = __commonJS((exports, module) => {
|
|
|
218605
218605
|
let pathToInitial;
|
|
218606
218606
|
try {
|
|
218607
218607
|
pathToInitial = which.sync(initialCmd, {
|
|
218608
|
-
path: options.env && findInObject(options.env, "PATH") || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
218608
|
+
path: options.env && findInObject(options.env, "PATH") || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.deGGLqqAfq:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
|
|
218609
218609
|
pathext: options.env && findInObject(options.env, "PATHEXT") || process.env.PATHEXT
|
|
218610
218610
|
}).toLowerCase();
|
|
218611
218611
|
} catch (err) {
|
|
@@ -219322,7 +219322,7 @@ var require_lib6 = __commonJS((exports, module) => {
|
|
|
219322
219322
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
219323
219323
|
var getNotFoundError2 = (cmd2) => Object.assign(new Error(`not found: ${cmd2}`), { code: "ENOENT" });
|
|
219324
219324
|
var getPathInfo2 = (cmd2, {
|
|
219325
|
-
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
219325
|
+
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.deGGLqqAfq:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
|
|
219326
219326
|
pathExt: optPathExt = process.env.PATHEXT,
|
|
219327
219327
|
delimiter: optDelimiter = delimiter
|
|
219328
219328
|
}) => {
|
|
@@ -235213,7 +235213,7 @@ var require_which2 = __commonJS((exports, module) => {
|
|
|
235213
235213
|
const colon = opt2.colon || COLON;
|
|
235214
235214
|
const pathEnv = cmd2.match(/\//) || isWindows2 && cmd2.match(/\\/) ? [""] : [
|
|
235215
235215
|
...isWindows2 ? [process.cwd()] : [],
|
|
235216
|
-
...(opt2.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
235216
|
+
...(opt2.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.deGGLqqAfq:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin").split(colon)
|
|
235217
235217
|
];
|
|
235218
235218
|
const pathExtExe = isWindows2 ? opt2.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
235219
235219
|
const pathExt = isWindows2 ? pathExtExe.split(colon) : [""];
|
|
@@ -270073,12 +270073,9 @@ async function findMonoRepoRoot(startDir) {
|
|
|
270073
270073
|
while (currentDir !== "/") {
|
|
270074
270074
|
const packageJsonPath = join3(currentDir, "package.json");
|
|
270075
270075
|
if (await exists3(packageJsonPath)) {
|
|
270076
|
-
|
|
270077
|
-
|
|
270078
|
-
|
|
270079
|
-
return currentDir;
|
|
270080
|
-
}
|
|
270081
|
-
} catch {
|
|
270076
|
+
const packageJson = tryParseJson2(await readFile3(packageJsonPath, "utf-8"));
|
|
270077
|
+
if (packageJson?.workspaces && Array.isArray(packageJson?.workspaces) && packageJson?.workspaces.length > 0) {
|
|
270078
|
+
return currentDir;
|
|
270082
270079
|
}
|
|
270083
270080
|
}
|
|
270084
270081
|
const parentDir = dirname32(currentDir);
|
|
@@ -270096,8 +270093,8 @@ async function findMonoRepoPackages(projectDir) {
|
|
|
270096
270093
|
return [projectDir];
|
|
270097
270094
|
}
|
|
270098
270095
|
const packageJsonPath = join3(monoRepoRoot, "package.json");
|
|
270099
|
-
const packageJson =
|
|
270100
|
-
const workspaces = packageJson
|
|
270096
|
+
const packageJson = tryParseJson2(await readFile3(packageJsonPath, "utf-8"));
|
|
270097
|
+
const workspaces = packageJson?.workspaces ?? [];
|
|
270101
270098
|
const packagePaths = await Promise.all(workspaces.map(async (workspace) => {
|
|
270102
270099
|
const matches = await glob(join3(monoRepoRoot, workspace, "package.json"));
|
|
270103
270100
|
return matches.map((match2) => join3(match2, ".."));
|
|
@@ -270483,12 +270480,8 @@ async function ensureConfigDir() {
|
|
|
270483
270480
|
}
|
|
270484
270481
|
async function readConfig() {
|
|
270485
270482
|
await ensureConfigDir();
|
|
270486
|
-
|
|
270487
|
-
|
|
270488
|
-
return JSON.parse(content);
|
|
270489
|
-
} catch {
|
|
270490
|
-
return { instances: {} };
|
|
270491
|
-
}
|
|
270483
|
+
const content = await readFile4(CONFIG_FILE, "utf-8");
|
|
270484
|
+
return tryParseJson(content, { instances: {} });
|
|
270492
270485
|
}
|
|
270493
270486
|
async function writeConfig(config4) {
|
|
270494
270487
|
await ensureConfigDir();
|
|
@@ -273253,7 +273246,7 @@ function connectCommand() {
|
|
|
273253
273246
|
var package_default = {
|
|
273254
273247
|
name: "@settlemint/sdk-cli",
|
|
273255
273248
|
description: "SettleMint SDK, integrate SettleMint into your application with ease.",
|
|
273256
|
-
version: "0.6.
|
|
273249
|
+
version: "0.6.57",
|
|
273257
273250
|
type: "module",
|
|
273258
273251
|
private: false,
|
|
273259
273252
|
license: "FSL-1.1-MIT",
|
|
@@ -273304,8 +273297,8 @@ var package_default = {
|
|
|
273304
273297
|
"@inquirer/input": "4.1.0",
|
|
273305
273298
|
"@inquirer/password": "4.0.3",
|
|
273306
273299
|
"@inquirer/select": "4.0.3",
|
|
273307
|
-
"@settlemint/sdk-js": "0.6.
|
|
273308
|
-
"@settlemint/sdk-utils": "0.6.
|
|
273300
|
+
"@settlemint/sdk-js": "0.6.57",
|
|
273301
|
+
"@settlemint/sdk-utils": "0.6.57",
|
|
273309
273302
|
"get-tsconfig": "4.8.1",
|
|
273310
273303
|
giget: "1.2.3"
|
|
273311
273304
|
},
|
|
@@ -275916,7 +275909,7 @@ console.log(JSON.stringify(hardhat.userConfig));`], {
|
|
|
275916
275909
|
},
|
|
275917
275910
|
silent: true
|
|
275918
275911
|
});
|
|
275919
|
-
const config4 =
|
|
275912
|
+
const config4 = tryParseJson(output.join(" "));
|
|
275920
275913
|
if (isHardhatConfig(config4)) {
|
|
275921
275914
|
return config4;
|
|
275922
275915
|
}
|
|
@@ -276071,8 +276064,11 @@ function hardhatTestCommand() {
|
|
|
276071
276064
|
return test;
|
|
276072
276065
|
}
|
|
276073
276066
|
|
|
276067
|
+
// src/commands/smart-contract-set/subgraph/build.ts
|
|
276068
|
+
import { dirname as dirname7 } from "node:path";
|
|
276069
|
+
|
|
276074
276070
|
// src/commands/smart-contract-set/subgraph/utils/setup.ts
|
|
276075
|
-
import { rm as rm4
|
|
276071
|
+
import { rm as rm4 } from "node:fs/promises";
|
|
276076
276072
|
|
|
276077
276073
|
// src/commands/smart-contract-set/subgraph/utils/sanitize-name.ts
|
|
276078
276074
|
var import_slugify = __toESM(require_slugify(), 1);
|
|
@@ -276085,8 +276081,9 @@ function sanitizeName(value4, length = 35) {
|
|
|
276085
276081
|
}).slice(0, length).replaceAll(/(^\d*)/g, "").replaceAll(/(-$)/g, "").replaceAll(/(^-)/g, "");
|
|
276086
276082
|
}
|
|
276087
276083
|
|
|
276088
|
-
// src/commands/smart-contract-set/subgraph/utils/
|
|
276089
|
-
|
|
276084
|
+
// src/commands/smart-contract-set/subgraph/utils/subgraph-config.ts
|
|
276085
|
+
import { readFile as readFile7, writeFile as writeFile8 } from "node:fs/promises";
|
|
276086
|
+
import { basename as basename4, join as join8 } from "node:path";
|
|
276090
276087
|
|
|
276091
276088
|
// ../../node_modules/yaml/dist/index.js
|
|
276092
276089
|
var composer = require_composer();
|
|
@@ -276135,24 +276132,34 @@ var $visit = visit2.visit;
|
|
|
276135
276132
|
var $visitAsync = visit2.visitAsync;
|
|
276136
276133
|
|
|
276137
276134
|
// src/commands/smart-contract-set/subgraph/utils/subgraph-config.ts
|
|
276138
|
-
import { readFile as readFile7, writeFile as writeFile8 } from "node:fs/promises";
|
|
276139
|
-
import { basename as basename4, join as join8 } from "node:path";
|
|
276140
276135
|
var CONFIG_FILE_PATH = "./subgraph/subgraph.config.json";
|
|
276141
|
-
var isGenerated = () => exists2(CONFIG_FILE_PATH);
|
|
276142
|
-
var getSubgraphYamlFile = async (
|
|
276143
|
-
|
|
276144
|
-
|
|
276136
|
+
var isGenerated = (path8 = process.cwd()) => exists2(join8(path8, CONFIG_FILE_PATH));
|
|
276137
|
+
var getSubgraphYamlFile = async (path8 = process.cwd()) => {
|
|
276138
|
+
const generated = await isGenerated(path8);
|
|
276139
|
+
if (generated && await exists2(join8(path8, "generated/scs.subgraph.yaml"))) {
|
|
276140
|
+
return join8(path8, "generated/scs.subgraph.yaml");
|
|
276141
|
+
}
|
|
276142
|
+
if (await exists2(join8(path8, "subgraph/subgraph.yaml"))) {
|
|
276143
|
+
return join8(path8, "subgraph/subgraph.yaml");
|
|
276144
|
+
}
|
|
276145
|
+
if (await exists2(join8(path8, "subgraph.yaml"))) {
|
|
276146
|
+
return join8(path8, "subgraph.yaml");
|
|
276147
|
+
}
|
|
276148
|
+
throw new Error("Subgraph configuration file not found");
|
|
276149
|
+
};
|
|
276150
|
+
var getSubgraphYamlConfig = async (path8 = process.cwd()) => {
|
|
276151
|
+
const subgraphYamlFile = await getSubgraphYamlFile(path8);
|
|
276145
276152
|
const rawYamlConfig = await readFile7(subgraphYamlFile);
|
|
276146
276153
|
return $parse(rawYamlConfig.toString());
|
|
276147
276154
|
};
|
|
276148
|
-
var updateSubgraphYamlConfig = async (config4) => {
|
|
276149
|
-
const subgraphYamlFile = await getSubgraphYamlFile();
|
|
276155
|
+
var updateSubgraphYamlConfig = async (config4, cwd2 = process.cwd()) => {
|
|
276156
|
+
const subgraphYamlFile = await getSubgraphYamlFile(cwd2);
|
|
276150
276157
|
await writeFile8(subgraphYamlFile, $stringify(config4));
|
|
276151
276158
|
};
|
|
276152
276159
|
var getSubgraphConfig = async (path8 = process.cwd()) => {
|
|
276153
276160
|
try {
|
|
276154
276161
|
const configContents = await readFile7(join8(path8, CONFIG_FILE_PATH));
|
|
276155
|
-
const currentConfig =
|
|
276162
|
+
const currentConfig = tryParseJson(configContents.toString());
|
|
276156
276163
|
return currentConfig;
|
|
276157
276164
|
} catch (err) {
|
|
276158
276165
|
const error5 = err;
|
|
@@ -276162,12 +276169,16 @@ var getSubgraphConfig = async (path8 = process.cwd()) => {
|
|
|
276162
276169
|
};
|
|
276163
276170
|
|
|
276164
276171
|
// src/commands/smart-contract-set/subgraph/utils/setup.ts
|
|
276165
|
-
|
|
276172
|
+
var import_semver = __toESM(require_semver2(), 1);
|
|
276173
|
+
async function subgraphSetup({ env: env2, instance, accessToken, autoAccept }) {
|
|
276166
276174
|
const theGraphMiddleware = await getTheGraphMiddleware({ env: env2, instance, accessToken, autoAccept });
|
|
276167
276175
|
if (!theGraphMiddleware) {
|
|
276168
276176
|
cancel2("No Graph Middleware selected. Please select one to continue.");
|
|
276169
276177
|
}
|
|
276170
|
-
await
|
|
276178
|
+
const generated = await isGenerated();
|
|
276179
|
+
if (generated) {
|
|
276180
|
+
await executeCommand("forge", ["build"]);
|
|
276181
|
+
}
|
|
276171
276182
|
if (await exists2("./generated")) {
|
|
276172
276183
|
await rm4("./generated", { recursive: true, force: true });
|
|
276173
276184
|
}
|
|
@@ -276182,7 +276193,7 @@ async function subgraphSetup({ env: env2, instance, accessToken, isGenerated: is
|
|
|
276182
276193
|
}
|
|
276183
276194
|
const isFixedNetwork = (theGraphMiddleware.entityVersion ?? 4) >= 4;
|
|
276184
276195
|
const network = isFixedNetwork ? "settlemint" : sanitizeName(await getNodeName({ env: env2, instance, accessToken }), 30);
|
|
276185
|
-
if (
|
|
276196
|
+
if (generated) {
|
|
276186
276197
|
const { command, args } = await getPackageManagerExecutable();
|
|
276187
276198
|
await executeCommand(command, [
|
|
276188
276199
|
...args,
|
|
@@ -276197,7 +276208,7 @@ async function subgraphSetup({ env: env2, instance, accessToken, isGenerated: is
|
|
|
276197
276208
|
]);
|
|
276198
276209
|
}
|
|
276199
276210
|
const yamlConfig = await getSubgraphYamlConfig();
|
|
276200
|
-
if (
|
|
276211
|
+
if (generated) {
|
|
276201
276212
|
yamlConfig.features = ["nonFatalErrors", "fullTextSearch", "ipfsOnEthereumContracts"];
|
|
276202
276213
|
}
|
|
276203
276214
|
for (const dataSource of yamlConfig.dataSources) {
|
|
@@ -276214,8 +276225,7 @@ async function subgraphSetup({ env: env2, instance, accessToken, isGenerated: is
|
|
|
276214
276225
|
template.network = network;
|
|
276215
276226
|
}
|
|
276216
276227
|
}
|
|
276217
|
-
|
|
276218
|
-
await writeFile9(subgraphYamlFile, $stringify(yamlConfig));
|
|
276228
|
+
await updateSubgraphYamlConfig(yamlConfig);
|
|
276219
276229
|
return theGraphMiddleware;
|
|
276220
276230
|
}
|
|
276221
276231
|
async function getTheGraphMiddleware({
|
|
@@ -276263,23 +276273,22 @@ function subgraphBuildCommand() {
|
|
|
276263
276273
|
return missingAccessTokenError();
|
|
276264
276274
|
}
|
|
276265
276275
|
const instance = await instancePrompt(env2, true);
|
|
276266
|
-
const generated = await isGenerated();
|
|
276267
276276
|
await subgraphSetup({
|
|
276268
|
-
isGenerated: generated,
|
|
276269
276277
|
env: env2,
|
|
276270
276278
|
instance,
|
|
276271
276279
|
accessToken,
|
|
276272
276280
|
autoAccept
|
|
276273
276281
|
});
|
|
276274
|
-
const cwd2 = generated ? process.cwd() : "./subgraph";
|
|
276275
276282
|
const { command, args } = await getPackageManagerExecutable();
|
|
276276
276283
|
const subgraphYamlFile = await getSubgraphYamlFile();
|
|
276284
|
+
const cwd2 = dirname7(subgraphYamlFile);
|
|
276277
276285
|
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile], { cwd: cwd2 });
|
|
276278
276286
|
await executeCommand(command, [...args, "graph", "build", subgraphYamlFile], { cwd: cwd2 });
|
|
276279
276287
|
});
|
|
276280
276288
|
}
|
|
276281
276289
|
|
|
276282
276290
|
// src/commands/smart-contract-set/subgraph/codegen.ts
|
|
276291
|
+
import { dirname as dirname8 } from "node:path";
|
|
276283
276292
|
function subgraphCodegenCommand() {
|
|
276284
276293
|
return new Command2("codegen").option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").description("Codegen the subgraph types").action(async ({ acceptDefaults, prod }) => {
|
|
276285
276294
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
@@ -276289,21 +276298,23 @@ function subgraphCodegenCommand() {
|
|
|
276289
276298
|
return missingAccessTokenError();
|
|
276290
276299
|
}
|
|
276291
276300
|
const instance = await instancePrompt(env2, true);
|
|
276292
|
-
const generated = await isGenerated();
|
|
276293
276301
|
await subgraphSetup({
|
|
276294
|
-
isGenerated: generated,
|
|
276295
276302
|
env: env2,
|
|
276296
276303
|
instance,
|
|
276297
276304
|
accessToken,
|
|
276298
276305
|
autoAccept
|
|
276299
276306
|
});
|
|
276300
|
-
const cwd2 = generated ? process.cwd() : "./subgraph";
|
|
276301
276307
|
const { command, args } = await getPackageManagerExecutable();
|
|
276302
276308
|
const subgraphYamlFile = await getSubgraphYamlFile();
|
|
276303
|
-
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile], {
|
|
276309
|
+
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile], {
|
|
276310
|
+
cwd: dirname8(subgraphYamlFile)
|
|
276311
|
+
});
|
|
276304
276312
|
});
|
|
276305
276313
|
}
|
|
276306
276314
|
|
|
276315
|
+
// src/commands/smart-contract-set/subgraph/deploy.ts
|
|
276316
|
+
import { dirname as dirname9 } from "node:path";
|
|
276317
|
+
|
|
276307
276318
|
// src/commands/smart-contract-set/prompts/subgraph-name.prompt.ts
|
|
276308
276319
|
async function subgraphNamePrompt2(defaultName, env2, accept, prod) {
|
|
276309
276320
|
const defaultSubgraphName = defaultName ? sanitizeName(defaultName) : env2.SETTLEMINT_THEGRAPH_SUBGRAPH_NAME;
|
|
@@ -276341,19 +276352,19 @@ function subgraphDeployCommand() {
|
|
|
276341
276352
|
return missingAccessTokenError();
|
|
276342
276353
|
}
|
|
276343
276354
|
const instance = await instancePrompt(env2, true);
|
|
276344
|
-
const generated = await isGenerated();
|
|
276345
276355
|
const theGraphMiddleware = await subgraphSetup({
|
|
276346
|
-
isGenerated: generated,
|
|
276347
276356
|
env: env2,
|
|
276348
276357
|
instance,
|
|
276349
276358
|
accessToken,
|
|
276350
276359
|
autoAccept
|
|
276351
276360
|
});
|
|
276352
|
-
const cwd2 = generated ? process.cwd() : "./subgraph";
|
|
276353
276361
|
const subgraphYamlFile = await getSubgraphYamlFile();
|
|
276354
276362
|
await updateSpecVersion(theGraphMiddleware.specVersion);
|
|
276355
276363
|
const { command, args } = await getPackageManagerExecutable();
|
|
276356
|
-
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile], {
|
|
276364
|
+
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile], {
|
|
276365
|
+
cwd: dirname9(subgraphYamlFile)
|
|
276366
|
+
});
|
|
276367
|
+
const generated = await isGenerated();
|
|
276357
276368
|
if (generated) {
|
|
276358
276369
|
const currentConfig = await getSubgraphConfig();
|
|
276359
276370
|
if (!currentConfig || currentConfig?.datasources.some((ds) => ds.address === "0x0000000000000000000000000000000000000000")) {
|
|
@@ -276432,4 +276443,4 @@ sdkcli.parseAsync(process.argv).catch((reason) => {
|
|
|
276432
276443
|
cancel2(reason);
|
|
276433
276444
|
});
|
|
276434
276445
|
|
|
276435
|
-
//# debugId=
|
|
276446
|
+
//# debugId=087AC30C3266236D64756E2164756E21
|