@settlemint/sdk-cli 1.0.9-main607ba123 → 1.0.9-main74c34848
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/README.md +3 -3
- package/dist/cli.js +78 -122
- package/dist/cli.js.map +22 -21
- package/package.json +12 -10
package/README.md
CHANGED
|
@@ -84,10 +84,10 @@ npm install -g @settlemint/sdk-cli
|
|
|
84
84
|
bun install -g @settlemint/sdk-cli
|
|
85
85
|
|
|
86
86
|
# pnpm
|
|
87
|
-
pnpm
|
|
87
|
+
pnpm add -g @settlemint/sdk-cli
|
|
88
88
|
|
|
89
89
|
# yarn
|
|
90
|
-
yarn
|
|
90
|
+
yarn global add @settlemint/sdk-cli
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
You can access the CLI globally by running `settlemint` in your terminal.
|
|
@@ -249,7 +249,7 @@ settlemint scs subgraph deploy --accept-defaults <subgraph-name>
|
|
|
249
249
|
|
|
250
250
|
## API Reference
|
|
251
251
|
|
|
252
|
-
See the [documentation](https://github.com/settlemint/sdk/tree/v1.0.
|
|
252
|
+
See the [documentation](https://github.com/settlemint/sdk/tree/v1.0.9/sdk/cli/docs/settlemint.md) for available commands.
|
|
253
253
|
|
|
254
254
|
## Contributing
|
|
255
255
|
|
package/dist/cli.js
CHANGED
|
@@ -34802,7 +34802,7 @@ var require_cjs = __commonJS((exports) => {
|
|
|
34802
34802
|
exports.sync = impl.sync;
|
|
34803
34803
|
});
|
|
34804
34804
|
|
|
34805
|
-
// ../../node_modules
|
|
34805
|
+
// ../../node_modules/which/lib/index.js
|
|
34806
34806
|
var require_lib4 = __commonJS((exports, module) => {
|
|
34807
34807
|
var { isexe, sync: isexeSync } = require_cjs();
|
|
34808
34808
|
var { join: join4, delimiter, sep: sep2, posix: posix2 } = __require("path");
|
|
@@ -35723,93 +35723,9 @@ var require_opts = __commonJS((exports, module) => {
|
|
|
35723
35723
|
module.exports.loadGitConfig = loadGitConfig;
|
|
35724
35724
|
});
|
|
35725
35725
|
|
|
35726
|
-
// ../../node_modules/@npmcli/git/node_modules/which/lib/index.js
|
|
35727
|
-
var require_lib6 = __commonJS((exports, module) => {
|
|
35728
|
-
var { isexe, sync: isexeSync } = require_cjs();
|
|
35729
|
-
var { join: join4, delimiter, sep: sep2, posix: posix2 } = __require("path");
|
|
35730
|
-
var isWindows2 = process.platform === "win32";
|
|
35731
|
-
var rSlash = new RegExp(`[${posix2.sep}${sep2 === posix2.sep ? "" : sep2}]`.replace(/(\\)/g, "\\$1"));
|
|
35732
|
-
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
35733
|
-
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
35734
|
-
var getPathInfo = (cmd, {
|
|
35735
|
-
path: optPath = process.env.PATH,
|
|
35736
|
-
pathExt: optPathExt = process.env.PATHEXT,
|
|
35737
|
-
delimiter: optDelimiter = delimiter
|
|
35738
|
-
}) => {
|
|
35739
|
-
const pathEnv = cmd.match(rSlash) ? [""] : [
|
|
35740
|
-
...isWindows2 ? [process.cwd()] : [],
|
|
35741
|
-
...(optPath || "").split(optDelimiter)
|
|
35742
|
-
];
|
|
35743
|
-
if (isWindows2) {
|
|
35744
|
-
const pathExtExe = optPathExt || [".EXE", ".CMD", ".BAT", ".COM"].join(optDelimiter);
|
|
35745
|
-
const pathExt = pathExtExe.split(optDelimiter).flatMap((item) => [item, item.toLowerCase()]);
|
|
35746
|
-
if (cmd.includes(".") && pathExt[0] !== "") {
|
|
35747
|
-
pathExt.unshift("");
|
|
35748
|
-
}
|
|
35749
|
-
return { pathEnv, pathExt, pathExtExe };
|
|
35750
|
-
}
|
|
35751
|
-
return { pathEnv, pathExt: [""] };
|
|
35752
|
-
};
|
|
35753
|
-
var getPathPart = (raw, cmd) => {
|
|
35754
|
-
const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
|
|
35755
|
-
const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "";
|
|
35756
|
-
return prefix + join4(pathPart, cmd);
|
|
35757
|
-
};
|
|
35758
|
-
var which = async (cmd, opt = {}) => {
|
|
35759
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
35760
|
-
const found = [];
|
|
35761
|
-
for (const envPart of pathEnv) {
|
|
35762
|
-
const p = getPathPart(envPart, cmd);
|
|
35763
|
-
for (const ext2 of pathExt) {
|
|
35764
|
-
const withExt = p + ext2;
|
|
35765
|
-
const is = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true });
|
|
35766
|
-
if (is) {
|
|
35767
|
-
if (!opt.all) {
|
|
35768
|
-
return withExt;
|
|
35769
|
-
}
|
|
35770
|
-
found.push(withExt);
|
|
35771
|
-
}
|
|
35772
|
-
}
|
|
35773
|
-
}
|
|
35774
|
-
if (opt.all && found.length) {
|
|
35775
|
-
return found;
|
|
35776
|
-
}
|
|
35777
|
-
if (opt.nothrow) {
|
|
35778
|
-
return null;
|
|
35779
|
-
}
|
|
35780
|
-
throw getNotFoundError(cmd);
|
|
35781
|
-
};
|
|
35782
|
-
var whichSync = (cmd, opt = {}) => {
|
|
35783
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
35784
|
-
const found = [];
|
|
35785
|
-
for (const pathEnvPart of pathEnv) {
|
|
35786
|
-
const p = getPathPart(pathEnvPart, cmd);
|
|
35787
|
-
for (const ext2 of pathExt) {
|
|
35788
|
-
const withExt = p + ext2;
|
|
35789
|
-
const is = isexeSync(withExt, { pathExt: pathExtExe, ignoreErrors: true });
|
|
35790
|
-
if (is) {
|
|
35791
|
-
if (!opt.all) {
|
|
35792
|
-
return withExt;
|
|
35793
|
-
}
|
|
35794
|
-
found.push(withExt);
|
|
35795
|
-
}
|
|
35796
|
-
}
|
|
35797
|
-
}
|
|
35798
|
-
if (opt.all && found.length) {
|
|
35799
|
-
return found;
|
|
35800
|
-
}
|
|
35801
|
-
if (opt.nothrow) {
|
|
35802
|
-
return null;
|
|
35803
|
-
}
|
|
35804
|
-
throw getNotFoundError(cmd);
|
|
35805
|
-
};
|
|
35806
|
-
module.exports = which;
|
|
35807
|
-
which.sync = whichSync;
|
|
35808
|
-
});
|
|
35809
|
-
|
|
35810
35726
|
// ../../node_modules/@npmcli/git/lib/which.js
|
|
35811
35727
|
var require_which = __commonJS((exports, module) => {
|
|
35812
|
-
var which =
|
|
35728
|
+
var which = require_lib4();
|
|
35813
35729
|
var gitPath;
|
|
35814
35730
|
try {
|
|
35815
35731
|
gitPath = which.sync("git");
|
|
@@ -37320,7 +37236,7 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
37320
37236
|
});
|
|
37321
37237
|
|
|
37322
37238
|
// ../../node_modules/npm-package-arg/node_modules/validate-npm-package-name/lib/index.js
|
|
37323
|
-
var
|
|
37239
|
+
var require_lib6 = __commonJS((exports, module) => {
|
|
37324
37240
|
var { builtinModules: builtins } = __require("module");
|
|
37325
37241
|
var scopedPackagePattern = new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$");
|
|
37326
37242
|
var blacklist = [
|
|
@@ -37412,7 +37328,7 @@ var require_npa = __commonJS((exports, module) => {
|
|
|
37412
37328
|
var HostedGit = require_lib3();
|
|
37413
37329
|
var semver = require_semver2();
|
|
37414
37330
|
var path5 = global.FAKE_WINDOWS ? __require("path").win32 : __require("path");
|
|
37415
|
-
var validatePackageName =
|
|
37331
|
+
var validatePackageName = require_lib6();
|
|
37416
37332
|
var { homedir } = __require("os");
|
|
37417
37333
|
var { log } = require_lib2();
|
|
37418
37334
|
var isWindows2 = process.platform === "win32" || global.FAKE_WINDOWS;
|
|
@@ -37951,7 +37867,7 @@ var require_dev_engines = __commonJS((exports, module) => {
|
|
|
37951
37867
|
});
|
|
37952
37868
|
|
|
37953
37869
|
// ../../node_modules/npm-install-checks/lib/index.js
|
|
37954
|
-
var
|
|
37870
|
+
var require_lib7 = __commonJS((exports, module) => {
|
|
37955
37871
|
var semver = require_semver2();
|
|
37956
37872
|
var currentEnv = require_current_env();
|
|
37957
37873
|
var { checkDevEngines } = require_dev_engines();
|
|
@@ -38035,7 +37951,7 @@ var require_lib8 = __commonJS((exports, module) => {
|
|
|
38035
37951
|
});
|
|
38036
37952
|
|
|
38037
37953
|
// ../../node_modules/npm-normalize-package-bin/lib/index.js
|
|
38038
|
-
var
|
|
37954
|
+
var require_lib8 = __commonJS((exports, module) => {
|
|
38039
37955
|
var { join: join4, basename } = __require("path");
|
|
38040
37956
|
var normalize2 = (pkg) => !pkg.bin ? removeBin(pkg) : typeof pkg.bin === "string" ? normalizeString(pkg) : Array.isArray(pkg.bin) ? normalizeArray(pkg) : typeof pkg.bin === "object" ? normalizeObject(pkg) : removeBin(pkg);
|
|
38041
37957
|
var normalizeString = (pkg) => {
|
|
@@ -38083,11 +37999,11 @@ var require_lib9 = __commonJS((exports, module) => {
|
|
|
38083
37999
|
});
|
|
38084
38000
|
|
|
38085
38001
|
// ../../node_modules/npm-pick-manifest/lib/index.js
|
|
38086
|
-
var
|
|
38002
|
+
var require_lib9 = __commonJS((exports, module) => {
|
|
38087
38003
|
var npa = require_npa();
|
|
38088
38004
|
var semver = require_semver2();
|
|
38089
|
-
var { checkEngine } =
|
|
38090
|
-
var normalizeBin =
|
|
38005
|
+
var { checkEngine } = require_lib7();
|
|
38006
|
+
var normalizeBin = require_lib8();
|
|
38091
38007
|
var engineOk = (manifest, npmVersion, nodeVersion) => {
|
|
38092
38008
|
try {
|
|
38093
38009
|
checkEngine(manifest, npmVersion, nodeVersion);
|
|
@@ -38249,7 +38165,7 @@ var require_clone = __commonJS((exports, module) => {
|
|
|
38249
38165
|
var getRevs = require_revs();
|
|
38250
38166
|
var spawn2 = require_spawn();
|
|
38251
38167
|
var { isWindows: isWindows2 } = require_utils7();
|
|
38252
|
-
var pickManifest =
|
|
38168
|
+
var pickManifest = require_lib9();
|
|
38253
38169
|
var fs3 = __require("fs/promises");
|
|
38254
38170
|
module.exports = (repo, ref = "HEAD", target = null, opts = {}) => getRevs(repo, opts).then((revs) => clone(repo, revs, ref, resolveRef(revs, ref, opts), target || defaultTarget(repo, opts.cwd), opts));
|
|
38255
38171
|
var maybeShallow = (repo, opts) => {
|
|
@@ -38381,7 +38297,7 @@ var require_is_clean = __commonJS((exports, module) => {
|
|
|
38381
38297
|
});
|
|
38382
38298
|
|
|
38383
38299
|
// ../../node_modules/@npmcli/git/lib/index.js
|
|
38384
|
-
var
|
|
38300
|
+
var require_lib10 = __commonJS((exports, module) => {
|
|
38385
38301
|
module.exports = {
|
|
38386
38302
|
clone: require_clone(),
|
|
38387
38303
|
revs: require_revs(),
|
|
@@ -40278,7 +40194,7 @@ var require_normalize = __commonJS((exports, module) => {
|
|
|
40278
40194
|
normalizePackageBin(data, changes);
|
|
40279
40195
|
}
|
|
40280
40196
|
if (steps.includes("gitHead") && !data.gitHead) {
|
|
40281
|
-
const git =
|
|
40197
|
+
const git = require_lib10();
|
|
40282
40198
|
const gitRoot = await git.find({ cwd: pkg.path, root });
|
|
40283
40199
|
let head;
|
|
40284
40200
|
if (gitRoot) {
|
|
@@ -40564,7 +40480,7 @@ var require_sort2 = __commonJS((exports, module) => {
|
|
|
40564
40480
|
});
|
|
40565
40481
|
|
|
40566
40482
|
// ../../node_modules/@npmcli/package-json/lib/index.js
|
|
40567
|
-
var
|
|
40483
|
+
var require_lib11 = __commonJS((exports, module) => {
|
|
40568
40484
|
var { readFile: readFile2, writeFile: writeFile2 } = __require("node:fs/promises");
|
|
40569
40485
|
var { resolve: resolve2 } = __require("node:path");
|
|
40570
40486
|
var parseJSON = require_lib();
|
|
@@ -228156,7 +228072,7 @@ var require_wrap_ansi = __commonJS((exports, module) => {
|
|
|
228156
228072
|
});
|
|
228157
228073
|
|
|
228158
228074
|
// ../../node_modules/mute-stream/lib/index.js
|
|
228159
|
-
var
|
|
228075
|
+
var require_lib12 = __commonJS((exports, module) => {
|
|
228160
228076
|
var Stream3 = __require("stream");
|
|
228161
228077
|
|
|
228162
228078
|
class MuteStream extends Stream3 {
|
|
@@ -241066,7 +240982,7 @@ var require_dist5 = __commonJS((exports) => {
|
|
|
241066
240982
|
});
|
|
241067
240983
|
|
|
241068
240984
|
// ../../node_modules/node-fetch-native/lib/index.cjs
|
|
241069
|
-
var
|
|
240985
|
+
var require_lib13 = __commonJS((exports, module) => {
|
|
241070
240986
|
var nodeFetch = require_dist5();
|
|
241071
240987
|
function fetch2(input, options) {
|
|
241072
240988
|
return nodeFetch.fetch(input, options);
|
|
@@ -241112,7 +241028,7 @@ var require_proxy = __commonJS((exports) => {
|
|
|
241112
241028
|
var require$$3 = __require("events");
|
|
241113
241029
|
var require$$5$4 = __require("url");
|
|
241114
241030
|
var require$$2 = __require("assert");
|
|
241115
|
-
var nodeFetchNative =
|
|
241031
|
+
var nodeFetchNative = require_lib13();
|
|
241116
241032
|
function _interopDefaultCompat(A5) {
|
|
241117
241033
|
return A5 && typeof A5 == "object" && "default" in A5 ? A5.default : A5;
|
|
241118
241034
|
}
|
|
@@ -269202,7 +269118,7 @@ function pruneCurrentEnv(currentEnv, env2) {
|
|
|
269202
269118
|
var package_default = {
|
|
269203
269119
|
name: "@settlemint/sdk-cli",
|
|
269204
269120
|
description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
|
|
269205
|
-
version: "1.0.9-
|
|
269121
|
+
version: "1.0.9-main74c34848",
|
|
269206
269122
|
type: "module",
|
|
269207
269123
|
private: false,
|
|
269208
269124
|
license: "FSL-1.1-MIT",
|
|
@@ -269245,22 +269161,24 @@ var package_default = {
|
|
|
269245
269161
|
tinyexec: "0.3.2"
|
|
269246
269162
|
},
|
|
269247
269163
|
devDependencies: {
|
|
269248
|
-
"@types/semver": "7.5.8",
|
|
269249
|
-
"@types/node": "22.10.10",
|
|
269250
|
-
"is-in-ci": "1.0.0",
|
|
269251
|
-
semver: "7.6.3",
|
|
269252
|
-
slugify: "1.6.6",
|
|
269253
|
-
yoctocolors: "2.1.1",
|
|
269254
269164
|
"@commander-js/extra-typings": "13.1.0",
|
|
269255
269165
|
"@inquirer/confirm": "5.1.3",
|
|
269256
269166
|
"@inquirer/input": "4.1.3",
|
|
269257
269167
|
"@inquirer/password": "4.0.6",
|
|
269258
269168
|
"@inquirer/select": "4.0.6",
|
|
269259
|
-
"@settlemint/sdk-js": "1.0.9-
|
|
269260
|
-
"@settlemint/sdk-utils": "1.0.9-
|
|
269169
|
+
"@settlemint/sdk-js": "1.0.9-main74c34848",
|
|
269170
|
+
"@settlemint/sdk-utils": "1.0.9-main74c34848",
|
|
269171
|
+
"@types/node": "22.10.10",
|
|
269172
|
+
"@types/semver": "7.5.8",
|
|
269173
|
+
"@types/which": "3.0.4",
|
|
269261
269174
|
"get-tsconfig": "4.10.0",
|
|
269262
269175
|
giget: "1.2.3",
|
|
269263
|
-
|
|
269176
|
+
"is-in-ci": "1.0.0",
|
|
269177
|
+
semver: "7.6.3",
|
|
269178
|
+
slugify: "1.6.6",
|
|
269179
|
+
which: "5.0.0",
|
|
269180
|
+
yaml: "2.7.0",
|
|
269181
|
+
yoctocolors: "2.1.1"
|
|
269264
269182
|
},
|
|
269265
269183
|
peerDependencies: {
|
|
269266
269184
|
hardhat: "2.22.18"
|
|
@@ -271752,8 +271670,8 @@ async function installPackage(names, options = {}) {
|
|
|
271752
271670
|
|
|
271753
271671
|
// ../utils/dist/package-manager.mjs
|
|
271754
271672
|
var import_console_table_printer3 = __toESM(require_dist2(), 1);
|
|
271755
|
-
var import_package_json = __toESM(
|
|
271756
|
-
var import_package_json2 = __toESM(
|
|
271673
|
+
var import_package_json = __toESM(require_lib11(), 1);
|
|
271674
|
+
var import_package_json2 = __toESM(require_lib11(), 1);
|
|
271757
271675
|
async function projectRoot2(fallbackToCwd = false, cwd) {
|
|
271758
271676
|
const packageJsonPath = await findUp("package.json", { cwd });
|
|
271759
271677
|
if (!packageJsonPath) {
|
|
@@ -274005,7 +273923,7 @@ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
|
274005
273923
|
`);
|
|
274006
273924
|
}
|
|
274007
273925
|
// ../../node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
|
274008
|
-
var import_mute_stream = __toESM(
|
|
273926
|
+
var import_mute_stream = __toESM(require_lib12(), 1);
|
|
274009
273927
|
init_mjs();
|
|
274010
273928
|
import * as readline2 from "node:readline";
|
|
274011
273929
|
import { AsyncResource as AsyncResource3 } from "node:async_hooks";
|
|
@@ -274812,8 +274730,9 @@ var esm_default5 = createPrompt((config3, done) => {
|
|
|
274812
274730
|
// src/prompts/aat.prompt.ts
|
|
274813
274731
|
async function applicationAccessTokenPrompt(env2, application, settlemint, accept) {
|
|
274814
274732
|
const autoAccept = !!accept || is_in_ci_default;
|
|
274815
|
-
const
|
|
274816
|
-
const
|
|
274733
|
+
const hasApplicationChanged = env2.SETTLEMINT_APPLICATION !== application.uniqueName;
|
|
274734
|
+
const defaultAccessToken = hasApplicationChanged ? undefined : env2.SETTLEMINT_ACCESS_TOKEN;
|
|
274735
|
+
const defaultPossible = autoAccept && !!defaultAccessToken;
|
|
274817
274736
|
if (defaultPossible || is_in_ci_default) {
|
|
274818
274737
|
return defaultAccessToken;
|
|
274819
274738
|
}
|
|
@@ -278849,6 +278768,17 @@ function formatUseCaseName(name2) {
|
|
|
278849
278768
|
return name2;
|
|
278850
278769
|
}
|
|
278851
278770
|
|
|
278771
|
+
// src/utils/smart-contract-set/execute-foundry-command.ts
|
|
278772
|
+
var import_which = __toESM(require_lib4(), 1);
|
|
278773
|
+
async function executeFoundryCommand(command, args) {
|
|
278774
|
+
try {
|
|
278775
|
+
await import_which.default(command);
|
|
278776
|
+
} catch (error5) {
|
|
278777
|
+
cancel2("Foundry is not installed. Instructions to install Foundry can be found here: https://book.getfoundry.sh/getting-started/installation");
|
|
278778
|
+
}
|
|
278779
|
+
return executeCommand(command, args);
|
|
278780
|
+
}
|
|
278781
|
+
|
|
278852
278782
|
// src/commands/smart-contract-set/create.ts
|
|
278853
278783
|
function createCommand4() {
|
|
278854
278784
|
return new Command("create").description("Bootstrap your smart contract set").option("-n, --project-name <name>", "The name for your smart contract set project").option("--use-case <useCase>", "Use case for the smart contract set (run `settlemint platform config` to see available use cases)").option("-i, --instance <instance>", "The instance to connect to").action(async ({ projectName, useCase, instance }) => {
|
|
@@ -278881,7 +278811,7 @@ function createCommand4() {
|
|
|
278881
278811
|
await spinner({
|
|
278882
278812
|
startMessage: "Scaffolding the smart contract set",
|
|
278883
278813
|
task: async () => {
|
|
278884
|
-
await
|
|
278814
|
+
await executeFoundryCommand("forge", [
|
|
278885
278815
|
"init",
|
|
278886
278816
|
name2,
|
|
278887
278817
|
"--template",
|
|
@@ -278925,7 +278855,7 @@ function foundryBuildCommand() {
|
|
|
278925
278855
|
}
|
|
278926
278856
|
])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
|
|
278927
278857
|
const forgeOptions = mapPassthroughOptions(passThroughOptions, cmd2);
|
|
278928
|
-
await
|
|
278858
|
+
await executeFoundryCommand("forge", ["build", ...forgeOptions]);
|
|
278929
278859
|
});
|
|
278930
278860
|
}
|
|
278931
278861
|
|
|
@@ -278946,7 +278876,7 @@ function foundryFormatCommand() {
|
|
|
278946
278876
|
}
|
|
278947
278877
|
])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
|
|
278948
278878
|
const forgeOptions = mapPassthroughOptions(passThroughOptions, cmd2);
|
|
278949
|
-
await
|
|
278879
|
+
await executeFoundryCommand("forge", ["fmt", ...forgeOptions]);
|
|
278950
278880
|
note("Smart contract set formatted successfully!");
|
|
278951
278881
|
});
|
|
278952
278882
|
}
|
|
@@ -278968,7 +278898,7 @@ function foundryNetworkCommand() {
|
|
|
278968
278898
|
}
|
|
278969
278899
|
])).helpOption(false).option("-h, --help", "Get list of possible anvil options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
|
|
278970
278900
|
const anvilOptions = mapPassthroughOptions(passThroughOptions, cmd2);
|
|
278971
|
-
await
|
|
278901
|
+
await executeFoundryCommand("anvil", anvilOptions);
|
|
278972
278902
|
});
|
|
278973
278903
|
}
|
|
278974
278904
|
|
|
@@ -278989,10 +278919,26 @@ function foundryTestCommand() {
|
|
|
278989
278919
|
}
|
|
278990
278920
|
])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
|
|
278991
278921
|
const forgeOptions = mapPassthroughOptions(passThroughOptions, cmd2);
|
|
278992
|
-
await
|
|
278922
|
+
await executeFoundryCommand("forge", ["test", ...forgeOptions]);
|
|
278993
278923
|
});
|
|
278994
278924
|
}
|
|
278995
278925
|
|
|
278926
|
+
// src/utils/validate-required-packages.ts
|
|
278927
|
+
var validateIfRequiredPackagesAreInstalled = async (packages, cwd2) => {
|
|
278928
|
+
const results = await Promise.all(packages.map(async (pkg) => {
|
|
278929
|
+
try {
|
|
278930
|
+
const isInstalled = await isPackageInstalled(pkg, cwd2);
|
|
278931
|
+
return { packageName: pkg, isInstalled };
|
|
278932
|
+
} catch (err) {
|
|
278933
|
+
return { packageName: pkg, isInstalled: false };
|
|
278934
|
+
}
|
|
278935
|
+
}));
|
|
278936
|
+
const notInstalled = results.filter((result) => !result.isInstalled);
|
|
278937
|
+
if (notInstalled.length > 0) {
|
|
278938
|
+
cancel2(`The following required npm packages are not installed: ${notInstalled.map((pkg) => pkg.packageName).join(", ")}. Please install them and try again.`);
|
|
278939
|
+
}
|
|
278940
|
+
};
|
|
278941
|
+
|
|
278996
278942
|
// src/commands/smart-contract-set/hardhat/build.ts
|
|
278997
278943
|
function hardhatBuildCommand() {
|
|
278998
278944
|
return new Command("build").description("Build the smart contracts using Hardhat").usage(createExamples([
|
|
@@ -279009,6 +278955,7 @@ function hardhatBuildCommand() {
|
|
|
279009
278955
|
command: "scs hardhat build --concurrency 2"
|
|
279010
278956
|
}
|
|
279011
278957
|
])).helpOption(false).option("-h, --help", "Get list of possible hardhat compile options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
|
|
278958
|
+
await validateIfRequiredPackagesAreInstalled(["hardhat"]);
|
|
279012
278959
|
const hardhatOptions = mapPassthroughOptions(passThroughOptions, cmd2);
|
|
279013
278960
|
const { command, args } = await getPackageManagerExecutable();
|
|
279014
278961
|
await executeCommand(command, [...args, "hardhat", "compile", ...hardhatOptions]);
|
|
@@ -279035,6 +278982,7 @@ function hardhatDeployLocalCommand() {
|
|
|
279035
278982
|
command: "scs hardhat deploy local --verify"
|
|
279036
278983
|
}
|
|
279037
278984
|
])).option("-m, --module <ignitionmodule>", 'The module to deploy with Ignition, defaults to "ignition/modules/main.ts"').option("-r, --reset", "Wipes the existing deployment state before deploying").option("-v, --verify", "Verify the deployment on Etherscan").action(async ({ module, reset: reset2, verify }) => {
|
|
278985
|
+
await validateIfRequiredPackagesAreInstalled(["hardhat"]);
|
|
279038
278986
|
const { command, args } = await getPackageManagerExecutable();
|
|
279039
278987
|
await executeCommand(command, [
|
|
279040
278988
|
...args,
|
|
@@ -279211,6 +279159,7 @@ function hardhatDeployRemoteCommand() {
|
|
|
279211
279159
|
acceptDefaults,
|
|
279212
279160
|
blockchainNode: blockchainNodeUniqueName
|
|
279213
279161
|
}) => {
|
|
279162
|
+
await validateIfRequiredPackagesAreInstalled(["hardhat"]);
|
|
279214
279163
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
279215
279164
|
const env2 = await loadEnv(false, !!prod);
|
|
279216
279165
|
const instance = await instancePrompt(env2, true);
|
|
@@ -279281,6 +279230,7 @@ function hardhatNetworkCommand() {
|
|
|
279281
279230
|
command: "scs hardhat network --port 3000"
|
|
279282
279231
|
}
|
|
279283
279232
|
])).helpOption(false).option("-h, --help", "Get list of possible hardhat node options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
|
|
279233
|
+
await validateIfRequiredPackagesAreInstalled(["hardhat"]);
|
|
279284
279234
|
const hardhatOptions = mapPassthroughOptions(passThroughOptions, cmd2);
|
|
279285
279235
|
const { command, args } = await getPackageManagerExecutable();
|
|
279286
279236
|
await executeCommand(command, [...args, "hardhat", "node", ...hardhatOptions]);
|
|
@@ -279290,6 +279240,7 @@ function hardhatNetworkCommand() {
|
|
|
279290
279240
|
// src/commands/smart-contract-set/hardhat/script/local.ts
|
|
279291
279241
|
function hardhatScriptLocalCommand() {
|
|
279292
279242
|
return new Command("local").description("Run a Hardhat script to deploy a contract on the platform or interact with a deployed contract.").requiredOption("-s, --script <script>", 'The script to run with Hardhat , e.g. "scripts/deploy.ts"').option("--no-compile", "Don't compile before running this task").action(async ({ script, compile }) => {
|
|
279243
|
+
await validateIfRequiredPackagesAreInstalled(["hardhat"]);
|
|
279293
279244
|
const { command, args } = await getPackageManagerExecutable();
|
|
279294
279245
|
await executeCommand(command, [
|
|
279295
279246
|
...args,
|
|
@@ -279307,6 +279258,7 @@ function hardhatScriptLocalCommand() {
|
|
|
279307
279258
|
function hardhatScriptRemoteCommand() {
|
|
279308
279259
|
const cmd2 = new Command("remote").description("Run a Hardhat script to deploy a contract on the platform or interact with a deployed contract.").requiredOption("-s, --script <script>", 'The script to run with Hardhat , e.g. "scripts/deploy.ts"').option("--blockchain-node <blockchainNode>", "Blockchain Node unique name (optional, defaults to the blockchain node in the environment)").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values").option("--no-compile", "Don't compile before running this task");
|
|
279309
279260
|
cmd2.action(async ({ script, prod, blockchainNode: blockchainNodeUniqueName, acceptDefaults, compile }) => {
|
|
279261
|
+
await validateIfRequiredPackagesAreInstalled(["hardhat"]);
|
|
279310
279262
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
279311
279263
|
const env2 = await loadEnv(false, !!prod);
|
|
279312
279264
|
const instance = await instancePrompt(env2, true);
|
|
@@ -279355,6 +279307,7 @@ function hardhatTestCommand() {
|
|
|
279355
279307
|
command: "scs hardhat test test/token.test.ts"
|
|
279356
279308
|
}
|
|
279357
279309
|
])).helpOption(false).option("-h, --help", "Get list of possible hardhat test options").passThroughOptions().allowUnknownOption().action(async (options, cmd2) => {
|
|
279310
|
+
await validateIfRequiredPackagesAreInstalled(["hardhat"]);
|
|
279358
279311
|
const hardhatOptions = mapPassthroughOptions(options, cmd2);
|
|
279359
279312
|
const { command, args } = await getPackageManagerExecutable();
|
|
279360
279313
|
await executeCommand(command, [...args, "hardhat", "test", ...hardhatOptions]);
|
|
@@ -279423,7 +279376,7 @@ var SETTLEMINT_NETWORK = "settlemint";
|
|
|
279423
279376
|
async function subgraphSetup({ network }) {
|
|
279424
279377
|
const generated = await isGenerated();
|
|
279425
279378
|
if (generated) {
|
|
279426
|
-
await
|
|
279379
|
+
await executeFoundryCommand("forge", ["build"]);
|
|
279427
279380
|
}
|
|
279428
279381
|
if (await exists3("./generated")) {
|
|
279429
279382
|
await rm4("./generated", { recursive: true, force: true });
|
|
@@ -279526,6 +279479,7 @@ async function getNodeName({
|
|
|
279526
279479
|
// src/commands/smart-contract-set/subgraph/build.ts
|
|
279527
279480
|
function subgraphBuildCommand() {
|
|
279528
279481
|
return new Command("build").description("Build the subgraph").action(async () => {
|
|
279482
|
+
await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
|
|
279529
279483
|
await subgraphSetup({
|
|
279530
279484
|
network: SETTLEMINT_NETWORK
|
|
279531
279485
|
});
|
|
@@ -279541,6 +279495,7 @@ function subgraphBuildCommand() {
|
|
|
279541
279495
|
import { dirname as dirname11 } from "node:path";
|
|
279542
279496
|
function subgraphCodegenCommand() {
|
|
279543
279497
|
return new Command("codegen").description("Codegen the subgraph types").action(async () => {
|
|
279498
|
+
await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
|
|
279544
279499
|
await subgraphSetup({
|
|
279545
279500
|
network: SETTLEMINT_NETWORK
|
|
279546
279501
|
});
|
|
@@ -279599,6 +279554,7 @@ function subgraphDeployCommand() {
|
|
|
279599
279554
|
command: "scs subgraph deploy my-subgraph"
|
|
279600
279555
|
}
|
|
279601
279556
|
])).option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").argument("[subgraph-name]", "The name of the subgraph to deploy (defaults to value in .env if not provided)").action(async (subgraphName, { prod, acceptDefaults }) => {
|
|
279557
|
+
await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
|
|
279602
279558
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
279603
279559
|
const env2 = await loadEnv(false, !!prod);
|
|
279604
279560
|
const instance = await instancePrompt(env2, true);
|
|
@@ -279788,4 +279744,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
|
279788
279744
|
// src/cli.ts
|
|
279789
279745
|
sdkCliCommand();
|
|
279790
279746
|
|
|
279791
|
-
//# debugId=
|
|
279747
|
+
//# debugId=298C47998A101FAA64756E2164756E21
|