@settlemint/sdk-cli 0.6.55 → 0.6.56-pr7411e13
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 +57 -39
- package/dist/cli.js.map +9 -9
- 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.jFUnmmBEy9:/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.56-pr7411e13",
|
|
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.jFUnmmBEy9:/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.jFUnmmBEy9:/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.jFUnmmBEy9:/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.jFUnmmBEy9:/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) : [""];
|
|
@@ -267876,7 +267876,7 @@ export const { client: theGraphClient${nameSuffix}, graphql: theGraphGraphql${na
|
|
|
267876
267876
|
Timestamp: string;
|
|
267877
267877
|
};
|
|
267878
267878
|
}>({
|
|
267879
|
-
instances: process.env.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS
|
|
267879
|
+
instances: JSON.parse(process.env.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS!),
|
|
267880
267880
|
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN!, // undefined in browser, by design to not leak the secrets
|
|
267881
267881
|
subgraphName: "${name2}",
|
|
267882
267882
|
});`
|
|
@@ -273253,7 +273253,7 @@ function connectCommand() {
|
|
|
273253
273253
|
var package_default = {
|
|
273254
273254
|
name: "@settlemint/sdk-cli",
|
|
273255
273255
|
description: "SettleMint SDK, integrate SettleMint into your application with ease.",
|
|
273256
|
-
version: "0.6.
|
|
273256
|
+
version: "0.6.56-pr7411e13",
|
|
273257
273257
|
type: "module",
|
|
273258
273258
|
private: false,
|
|
273259
273259
|
license: "FSL-1.1-MIT",
|
|
@@ -273304,8 +273304,8 @@ var package_default = {
|
|
|
273304
273304
|
"@inquirer/input": "4.1.0",
|
|
273305
273305
|
"@inquirer/password": "4.0.3",
|
|
273306
273306
|
"@inquirer/select": "4.0.3",
|
|
273307
|
-
"@settlemint/sdk-js": "0.6.
|
|
273308
|
-
"@settlemint/sdk-utils": "0.6.
|
|
273307
|
+
"@settlemint/sdk-js": "0.6.56-pr7411e13",
|
|
273308
|
+
"@settlemint/sdk-utils": "0.6.56-pr7411e13",
|
|
273309
273309
|
"get-tsconfig": "4.8.1",
|
|
273310
273310
|
giget: "1.2.3"
|
|
273311
273311
|
},
|
|
@@ -276071,8 +276071,11 @@ function hardhatTestCommand() {
|
|
|
276071
276071
|
return test;
|
|
276072
276072
|
}
|
|
276073
276073
|
|
|
276074
|
+
// src/commands/smart-contract-set/subgraph/build.ts
|
|
276075
|
+
import { dirname as dirname7 } from "node:path";
|
|
276076
|
+
|
|
276074
276077
|
// src/commands/smart-contract-set/subgraph/utils/setup.ts
|
|
276075
|
-
import { rm as rm4
|
|
276078
|
+
import { rm as rm4 } from "node:fs/promises";
|
|
276076
276079
|
|
|
276077
276080
|
// src/commands/smart-contract-set/subgraph/utils/sanitize-name.ts
|
|
276078
276081
|
var import_slugify = __toESM(require_slugify(), 1);
|
|
@@ -276085,8 +276088,9 @@ function sanitizeName(value4, length = 35) {
|
|
|
276085
276088
|
}).slice(0, length).replaceAll(/(^\d*)/g, "").replaceAll(/(-$)/g, "").replaceAll(/(^-)/g, "");
|
|
276086
276089
|
}
|
|
276087
276090
|
|
|
276088
|
-
// src/commands/smart-contract-set/subgraph/utils/
|
|
276089
|
-
|
|
276091
|
+
// src/commands/smart-contract-set/subgraph/utils/subgraph-config.ts
|
|
276092
|
+
import { readFile as readFile7, writeFile as writeFile8 } from "node:fs/promises";
|
|
276093
|
+
import { basename as basename4, join as join8 } from "node:path";
|
|
276090
276094
|
|
|
276091
276095
|
// ../../node_modules/yaml/dist/index.js
|
|
276092
276096
|
var composer = require_composer();
|
|
@@ -276135,18 +276139,28 @@ var $visit = visit2.visit;
|
|
|
276135
276139
|
var $visitAsync = visit2.visitAsync;
|
|
276136
276140
|
|
|
276137
276141
|
// 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
276142
|
var CONFIG_FILE_PATH = "./subgraph/subgraph.config.json";
|
|
276141
|
-
var isGenerated = () => exists2(CONFIG_FILE_PATH);
|
|
276142
|
-
var getSubgraphYamlFile = async (
|
|
276143
|
-
|
|
276144
|
-
|
|
276143
|
+
var isGenerated = (path8 = process.cwd()) => exists2(join8(path8, CONFIG_FILE_PATH));
|
|
276144
|
+
var getSubgraphYamlFile = async (path8 = process.cwd()) => {
|
|
276145
|
+
const generated = await isGenerated();
|
|
276146
|
+
if (generated && await exists2(join8(path8, "generated/scs.subgraph.yaml"))) {
|
|
276147
|
+
return join8(path8, "generated/scs.subgraph.yaml");
|
|
276148
|
+
}
|
|
276149
|
+
if (await exists2(join8(path8, "subgraph/subgraph.yaml"))) {
|
|
276150
|
+
return join8(path8, "subgraph/subgraph.yaml");
|
|
276151
|
+
}
|
|
276152
|
+
if (await exists2(join8(path8, "subgraph.yaml"))) {
|
|
276153
|
+
return join8(path8, "subgraph.yaml");
|
|
276154
|
+
}
|
|
276155
|
+
throw new Error("Subgraph configuration file not found");
|
|
276156
|
+
};
|
|
276157
|
+
var getSubgraphYamlConfig = async (path8 = process.cwd()) => {
|
|
276158
|
+
const subgraphYamlFile = await getSubgraphYamlFile(path8);
|
|
276145
276159
|
const rawYamlConfig = await readFile7(subgraphYamlFile);
|
|
276146
276160
|
return $parse(rawYamlConfig.toString());
|
|
276147
276161
|
};
|
|
276148
|
-
var updateSubgraphYamlConfig = async (config4) => {
|
|
276149
|
-
const subgraphYamlFile = await getSubgraphYamlFile();
|
|
276162
|
+
var updateSubgraphYamlConfig = async (config4, cwd2 = process.cwd()) => {
|
|
276163
|
+
const subgraphYamlFile = await getSubgraphYamlFile(cwd2);
|
|
276150
276164
|
await writeFile8(subgraphYamlFile, $stringify(config4));
|
|
276151
276165
|
};
|
|
276152
276166
|
var getSubgraphConfig = async (path8 = process.cwd()) => {
|
|
@@ -276162,12 +276176,16 @@ var getSubgraphConfig = async (path8 = process.cwd()) => {
|
|
|
276162
276176
|
};
|
|
276163
276177
|
|
|
276164
276178
|
// src/commands/smart-contract-set/subgraph/utils/setup.ts
|
|
276165
|
-
|
|
276179
|
+
var import_semver = __toESM(require_semver2(), 1);
|
|
276180
|
+
async function subgraphSetup({ env: env2, instance, accessToken, autoAccept }) {
|
|
276166
276181
|
const theGraphMiddleware = await getTheGraphMiddleware({ env: env2, instance, accessToken, autoAccept });
|
|
276167
276182
|
if (!theGraphMiddleware) {
|
|
276168
276183
|
cancel2("No Graph Middleware selected. Please select one to continue.");
|
|
276169
276184
|
}
|
|
276170
|
-
await
|
|
276185
|
+
const generated = await isGenerated();
|
|
276186
|
+
if (generated) {
|
|
276187
|
+
await executeCommand("forge", ["build"]);
|
|
276188
|
+
}
|
|
276171
276189
|
if (await exists2("./generated")) {
|
|
276172
276190
|
await rm4("./generated", { recursive: true, force: true });
|
|
276173
276191
|
}
|
|
@@ -276182,7 +276200,7 @@ async function subgraphSetup({ env: env2, instance, accessToken, isGenerated: is
|
|
|
276182
276200
|
}
|
|
276183
276201
|
const isFixedNetwork = (theGraphMiddleware.entityVersion ?? 4) >= 4;
|
|
276184
276202
|
const network = isFixedNetwork ? "settlemint" : sanitizeName(await getNodeName({ env: env2, instance, accessToken }), 30);
|
|
276185
|
-
if (
|
|
276203
|
+
if (generated) {
|
|
276186
276204
|
const { command, args } = await getPackageManagerExecutable();
|
|
276187
276205
|
await executeCommand(command, [
|
|
276188
276206
|
...args,
|
|
@@ -276197,7 +276215,7 @@ async function subgraphSetup({ env: env2, instance, accessToken, isGenerated: is
|
|
|
276197
276215
|
]);
|
|
276198
276216
|
}
|
|
276199
276217
|
const yamlConfig = await getSubgraphYamlConfig();
|
|
276200
|
-
if (
|
|
276218
|
+
if (generated) {
|
|
276201
276219
|
yamlConfig.features = ["nonFatalErrors", "fullTextSearch", "ipfsOnEthereumContracts"];
|
|
276202
276220
|
}
|
|
276203
276221
|
for (const dataSource of yamlConfig.dataSources) {
|
|
@@ -276214,8 +276232,7 @@ async function subgraphSetup({ env: env2, instance, accessToken, isGenerated: is
|
|
|
276214
276232
|
template.network = network;
|
|
276215
276233
|
}
|
|
276216
276234
|
}
|
|
276217
|
-
|
|
276218
|
-
await writeFile9(subgraphYamlFile, $stringify(yamlConfig));
|
|
276235
|
+
await updateSubgraphYamlConfig(yamlConfig);
|
|
276219
276236
|
return theGraphMiddleware;
|
|
276220
276237
|
}
|
|
276221
276238
|
async function getTheGraphMiddleware({
|
|
@@ -276263,23 +276280,22 @@ function subgraphBuildCommand() {
|
|
|
276263
276280
|
return missingAccessTokenError();
|
|
276264
276281
|
}
|
|
276265
276282
|
const instance = await instancePrompt(env2, true);
|
|
276266
|
-
const generated = await isGenerated();
|
|
276267
276283
|
await subgraphSetup({
|
|
276268
|
-
isGenerated: generated,
|
|
276269
276284
|
env: env2,
|
|
276270
276285
|
instance,
|
|
276271
276286
|
accessToken,
|
|
276272
276287
|
autoAccept
|
|
276273
276288
|
});
|
|
276274
|
-
const cwd2 = generated ? process.cwd() : "./subgraph";
|
|
276275
276289
|
const { command, args } = await getPackageManagerExecutable();
|
|
276276
276290
|
const subgraphYamlFile = await getSubgraphYamlFile();
|
|
276291
|
+
const cwd2 = dirname7(subgraphYamlFile);
|
|
276277
276292
|
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile], { cwd: cwd2 });
|
|
276278
276293
|
await executeCommand(command, [...args, "graph", "build", subgraphYamlFile], { cwd: cwd2 });
|
|
276279
276294
|
});
|
|
276280
276295
|
}
|
|
276281
276296
|
|
|
276282
276297
|
// src/commands/smart-contract-set/subgraph/codegen.ts
|
|
276298
|
+
import { dirname as dirname8 } from "node:path";
|
|
276283
276299
|
function subgraphCodegenCommand() {
|
|
276284
276300
|
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
276301
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
@@ -276289,21 +276305,23 @@ function subgraphCodegenCommand() {
|
|
|
276289
276305
|
return missingAccessTokenError();
|
|
276290
276306
|
}
|
|
276291
276307
|
const instance = await instancePrompt(env2, true);
|
|
276292
|
-
const generated = await isGenerated();
|
|
276293
276308
|
await subgraphSetup({
|
|
276294
|
-
isGenerated: generated,
|
|
276295
276309
|
env: env2,
|
|
276296
276310
|
instance,
|
|
276297
276311
|
accessToken,
|
|
276298
276312
|
autoAccept
|
|
276299
276313
|
});
|
|
276300
|
-
const cwd2 = generated ? process.cwd() : "./subgraph";
|
|
276301
276314
|
const { command, args } = await getPackageManagerExecutable();
|
|
276302
276315
|
const subgraphYamlFile = await getSubgraphYamlFile();
|
|
276303
|
-
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile], {
|
|
276316
|
+
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile], {
|
|
276317
|
+
cwd: dirname8(subgraphYamlFile)
|
|
276318
|
+
});
|
|
276304
276319
|
});
|
|
276305
276320
|
}
|
|
276306
276321
|
|
|
276322
|
+
// src/commands/smart-contract-set/subgraph/deploy.ts
|
|
276323
|
+
import { dirname as dirname9 } from "node:path";
|
|
276324
|
+
|
|
276307
276325
|
// src/commands/smart-contract-set/prompts/subgraph-name.prompt.ts
|
|
276308
276326
|
async function subgraphNamePrompt2(defaultName, env2, accept, prod) {
|
|
276309
276327
|
const defaultSubgraphName = defaultName ? sanitizeName(defaultName) : env2.SETTLEMINT_THEGRAPH_SUBGRAPH_NAME;
|
|
@@ -276341,19 +276359,19 @@ function subgraphDeployCommand() {
|
|
|
276341
276359
|
return missingAccessTokenError();
|
|
276342
276360
|
}
|
|
276343
276361
|
const instance = await instancePrompt(env2, true);
|
|
276344
|
-
const generated = await isGenerated();
|
|
276345
276362
|
const theGraphMiddleware = await subgraphSetup({
|
|
276346
|
-
isGenerated: generated,
|
|
276347
276363
|
env: env2,
|
|
276348
276364
|
instance,
|
|
276349
276365
|
accessToken,
|
|
276350
276366
|
autoAccept
|
|
276351
276367
|
});
|
|
276352
|
-
const cwd2 = generated ? process.cwd() : "./subgraph";
|
|
276353
276368
|
const subgraphYamlFile = await getSubgraphYamlFile();
|
|
276354
276369
|
await updateSpecVersion(theGraphMiddleware.specVersion);
|
|
276355
276370
|
const { command, args } = await getPackageManagerExecutable();
|
|
276356
|
-
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile], {
|
|
276371
|
+
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile], {
|
|
276372
|
+
cwd: dirname9(subgraphYamlFile)
|
|
276373
|
+
});
|
|
276374
|
+
const generated = await isGenerated();
|
|
276357
276375
|
if (generated) {
|
|
276358
276376
|
const currentConfig = await getSubgraphConfig();
|
|
276359
276377
|
if (!currentConfig || currentConfig?.datasources.some((ds) => ds.address === "0x0000000000000000000000000000000000000000")) {
|
|
@@ -276432,4 +276450,4 @@ sdkcli.parseAsync(process.argv).catch((reason) => {
|
|
|
276432
276450
|
cancel2(reason);
|
|
276433
276451
|
});
|
|
276434
276452
|
|
|
276435
|
-
//# debugId=
|
|
276453
|
+
//# debugId=61B4BE7D22CDD61164756E2164756E21
|