@settlemint/sdk-cli 1.0.9-prb617d863 → 1.0.9-prc21fe3e2

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 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 add -g @settlemint/sdk-cli
87
+ pnpm install -g @settlemint/sdk-cli
88
88
 
89
89
  # yarn
90
- yarn global add @settlemint/sdk-cli
90
+ yarn install -g @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.9/sdk/cli/docs/settlemint.md) for available commands.
252
+ See the [documentation](https://github.com/settlemint/sdk/tree/v1.0.8/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/which/lib/index.js
34805
+ // ../../node_modules/@npmcli/promise-spawn/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,9 +35723,93 @@ 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
+
35726
35810
  // ../../node_modules/@npmcli/git/lib/which.js
35727
35811
  var require_which = __commonJS((exports, module) => {
35728
- var which = require_lib4();
35812
+ var which = require_lib6();
35729
35813
  var gitPath;
35730
35814
  try {
35731
35815
  gitPath = which.sync("git");
@@ -37236,7 +37320,7 @@ var require_utils7 = __commonJS((exports) => {
37236
37320
  });
37237
37321
 
37238
37322
  // ../../node_modules/npm-package-arg/node_modules/validate-npm-package-name/lib/index.js
37239
- var require_lib6 = __commonJS((exports, module) => {
37323
+ var require_lib7 = __commonJS((exports, module) => {
37240
37324
  var { builtinModules: builtins } = __require("module");
37241
37325
  var scopedPackagePattern = new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$");
37242
37326
  var blacklist = [
@@ -37328,7 +37412,7 @@ var require_npa = __commonJS((exports, module) => {
37328
37412
  var HostedGit = require_lib3();
37329
37413
  var semver = require_semver2();
37330
37414
  var path5 = global.FAKE_WINDOWS ? __require("path").win32 : __require("path");
37331
- var validatePackageName = require_lib6();
37415
+ var validatePackageName = require_lib7();
37332
37416
  var { homedir } = __require("os");
37333
37417
  var { log } = require_lib2();
37334
37418
  var isWindows2 = process.platform === "win32" || global.FAKE_WINDOWS;
@@ -37867,7 +37951,7 @@ var require_dev_engines = __commonJS((exports, module) => {
37867
37951
  });
37868
37952
 
37869
37953
  // ../../node_modules/npm-install-checks/lib/index.js
37870
- var require_lib7 = __commonJS((exports, module) => {
37954
+ var require_lib8 = __commonJS((exports, module) => {
37871
37955
  var semver = require_semver2();
37872
37956
  var currentEnv = require_current_env();
37873
37957
  var { checkDevEngines } = require_dev_engines();
@@ -37951,7 +38035,7 @@ var require_lib7 = __commonJS((exports, module) => {
37951
38035
  });
37952
38036
 
37953
38037
  // ../../node_modules/npm-normalize-package-bin/lib/index.js
37954
- var require_lib8 = __commonJS((exports, module) => {
38038
+ var require_lib9 = __commonJS((exports, module) => {
37955
38039
  var { join: join4, basename } = __require("path");
37956
38040
  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);
37957
38041
  var normalizeString = (pkg) => {
@@ -37999,11 +38083,11 @@ var require_lib8 = __commonJS((exports, module) => {
37999
38083
  });
38000
38084
 
38001
38085
  // ../../node_modules/npm-pick-manifest/lib/index.js
38002
- var require_lib9 = __commonJS((exports, module) => {
38086
+ var require_lib10 = __commonJS((exports, module) => {
38003
38087
  var npa = require_npa();
38004
38088
  var semver = require_semver2();
38005
- var { checkEngine } = require_lib7();
38006
- var normalizeBin = require_lib8();
38089
+ var { checkEngine } = require_lib8();
38090
+ var normalizeBin = require_lib9();
38007
38091
  var engineOk = (manifest, npmVersion, nodeVersion) => {
38008
38092
  try {
38009
38093
  checkEngine(manifest, npmVersion, nodeVersion);
@@ -38165,7 +38249,7 @@ var require_clone = __commonJS((exports, module) => {
38165
38249
  var getRevs = require_revs();
38166
38250
  var spawn2 = require_spawn();
38167
38251
  var { isWindows: isWindows2 } = require_utils7();
38168
- var pickManifest = require_lib9();
38252
+ var pickManifest = require_lib10();
38169
38253
  var fs3 = __require("fs/promises");
38170
38254
  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));
38171
38255
  var maybeShallow = (repo, opts) => {
@@ -38297,7 +38381,7 @@ var require_is_clean = __commonJS((exports, module) => {
38297
38381
  });
38298
38382
 
38299
38383
  // ../../node_modules/@npmcli/git/lib/index.js
38300
- var require_lib10 = __commonJS((exports, module) => {
38384
+ var require_lib11 = __commonJS((exports, module) => {
38301
38385
  module.exports = {
38302
38386
  clone: require_clone(),
38303
38387
  revs: require_revs(),
@@ -40194,7 +40278,7 @@ var require_normalize = __commonJS((exports, module) => {
40194
40278
  normalizePackageBin(data, changes);
40195
40279
  }
40196
40280
  if (steps.includes("gitHead") && !data.gitHead) {
40197
- const git = require_lib10();
40281
+ const git = require_lib11();
40198
40282
  const gitRoot = await git.find({ cwd: pkg.path, root });
40199
40283
  let head;
40200
40284
  if (gitRoot) {
@@ -40480,7 +40564,7 @@ var require_sort2 = __commonJS((exports, module) => {
40480
40564
  });
40481
40565
 
40482
40566
  // ../../node_modules/@npmcli/package-json/lib/index.js
40483
- var require_lib11 = __commonJS((exports, module) => {
40567
+ var require_lib12 = __commonJS((exports, module) => {
40484
40568
  var { readFile: readFile2, writeFile: writeFile2 } = __require("node:fs/promises");
40485
40569
  var { resolve: resolve2 } = __require("node:path");
40486
40570
  var parseJSON = require_lib();
@@ -228072,7 +228156,7 @@ var require_wrap_ansi = __commonJS((exports, module) => {
228072
228156
  });
228073
228157
 
228074
228158
  // ../../node_modules/mute-stream/lib/index.js
228075
- var require_lib12 = __commonJS((exports, module) => {
228159
+ var require_lib13 = __commonJS((exports, module) => {
228076
228160
  var Stream3 = __require("stream");
228077
228161
 
228078
228162
  class MuteStream extends Stream3 {
@@ -240982,7 +241066,7 @@ var require_dist5 = __commonJS((exports) => {
240982
241066
  });
240983
241067
 
240984
241068
  // ../../node_modules/node-fetch-native/lib/index.cjs
240985
- var require_lib13 = __commonJS((exports, module) => {
241069
+ var require_lib14 = __commonJS((exports, module) => {
240986
241070
  var nodeFetch = require_dist5();
240987
241071
  function fetch2(input, options) {
240988
241072
  return nodeFetch.fetch(input, options);
@@ -241028,7 +241112,7 @@ var require_proxy = __commonJS((exports) => {
241028
241112
  var require$$3 = __require("events");
241029
241113
  var require$$5$4 = __require("url");
241030
241114
  var require$$2 = __require("assert");
241031
- var nodeFetchNative = require_lib13();
241115
+ var nodeFetchNative = require_lib14();
241032
241116
  function _interopDefaultCompat(A5) {
241033
241117
  return A5 && typeof A5 == "object" && "default" in A5 ? A5.default : A5;
241034
241118
  }
@@ -269118,7 +269202,7 @@ function pruneCurrentEnv(currentEnv, env2) {
269118
269202
  var package_default = {
269119
269203
  name: "@settlemint/sdk-cli",
269120
269204
  description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
269121
- version: "1.0.9-prb617d863",
269205
+ version: "1.0.9-prc21fe3e2",
269122
269206
  type: "module",
269123
269207
  private: false,
269124
269208
  license: "FSL-1.1-MIT",
@@ -269161,24 +269245,22 @@ var package_default = {
269161
269245
  tinyexec: "0.3.2"
269162
269246
  },
269163
269247
  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",
269164
269254
  "@commander-js/extra-typings": "13.1.0",
269165
269255
  "@inquirer/confirm": "5.1.3",
269166
269256
  "@inquirer/input": "4.1.3",
269167
269257
  "@inquirer/password": "4.0.6",
269168
269258
  "@inquirer/select": "4.0.6",
269169
- "@settlemint/sdk-js": "1.0.9-prb617d863",
269170
- "@settlemint/sdk-utils": "1.0.9-prb617d863",
269171
- "@types/node": "22.12.0",
269172
- "@types/semver": "7.5.8",
269173
- "@types/which": "3.0.4",
269259
+ "@settlemint/sdk-js": "1.0.9-prc21fe3e2",
269260
+ "@settlemint/sdk-utils": "1.0.9-prc21fe3e2",
269174
269261
  "get-tsconfig": "4.10.0",
269175
269262
  giget: "1.2.3",
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"
269263
+ yaml: "2.7.0"
269182
269264
  },
269183
269265
  peerDependencies: {
269184
269266
  hardhat: "2.22.18"
@@ -269231,7 +269313,7 @@ async function telemetry(data) {
269231
269313
  message,
269232
269314
  workspace: env2.SETTLEMINT_WORKSPACE,
269233
269315
  application: env2.SETTLEMINT_APPLICATION,
269234
- cliVersion: package_default.version
269316
+ sdkVersion: package_default.version
269235
269317
  }),
269236
269318
  signal: controller.signal
269237
269319
  });
@@ -269278,6 +269360,9 @@ var cancel2 = (msg) => {
269278
269360
  throw new CancelError2(msg);
269279
269361
  };
269280
269362
  async function executeCommand(command, args, options) {
269363
+ console.log("command", command);
269364
+ console.log("args", args);
269365
+ console.log("options", options);
269281
269366
  const child = spawn(command, args, { env: { ...process.env, ...options?.env } });
269282
269367
  process.stdin.pipe(child.stdin);
269283
269368
  const output = [];
@@ -271670,8 +271755,8 @@ async function installPackage(names, options = {}) {
271670
271755
 
271671
271756
  // ../utils/dist/package-manager.mjs
271672
271757
  var import_console_table_printer3 = __toESM(require_dist2(), 1);
271673
- var import_package_json = __toESM(require_lib11(), 1);
271674
- var import_package_json2 = __toESM(require_lib11(), 1);
271758
+ var import_package_json = __toESM(require_lib12(), 1);
271759
+ var import_package_json2 = __toESM(require_lib12(), 1);
271675
271760
  async function projectRoot2(fallbackToCwd = false, cwd) {
271676
271761
  const packageJsonPath = await findUp("package.json", { cwd });
271677
271762
  if (!packageJsonPath) {
@@ -271749,6 +271834,14 @@ async function isPackageInstalled(name, path5) {
271749
271834
  const inPeerDependencies = !!pkgJson.content.peerDependencies?.[name];
271750
271835
  return inDependencies || inDevDependencies || inPeerDependencies;
271751
271836
  }
271837
+ async function isPackageInstalledGlobally(packageName) {
271838
+ try {
271839
+ const installedLocally = await isPackageInstalled(packageName);
271840
+ return !installedLocally;
271841
+ } catch {
271842
+ return true;
271843
+ }
271844
+ }
271752
271845
  async function setName(name, path5) {
271753
271846
  const pkgJson = await import_package_json2.default.load(path5 ?? await projectRoot2());
271754
271847
  pkgJson.update({
@@ -271897,7 +271990,6 @@ async function setLastSdkVersionCheck(date) {
271897
271990
  }
271898
271991
 
271899
271992
  // src/utils/sdk-version.ts
271900
- var SDK_PACKAGE_NAME = "@settlemint/sdk-cli";
271901
271993
  async function validateSdkVersionFromCommand(command, interval = 5 * 60 * 1000) {
271902
271994
  const now = Date.now();
271903
271995
  const config3 = await readConfig();
@@ -271938,27 +272030,20 @@ async function getInstanceFromCommand(command) {
271938
272030
  return env2.SETTLEMINT_INSTANCE ?? "https://console.settlemint.com";
271939
272031
  }
271940
272032
  async function getUpgradeInstructions() {
271941
- const globallyInstalled = await isSdkInstalledGlobally();
272033
+ const packageName = "@settlemint/sdk-cli";
272034
+ const globallyInstalled = await isPackageInstalledGlobally(packageName);
271942
272035
  if (globallyInstalled) {
271943
272036
  const executablePath = process.execPath;
271944
272037
  if (executablePath.endsWith("bun")) {
271945
272038
  return `To update, run:
271946
- bun install -g ${SDK_PACKAGE_NAME}`;
272039
+ bun install -g ${packageName}`;
271947
272040
  }
271948
272041
  return `To update:
271949
- - For npm, run: npm update -g ${SDK_PACKAGE_NAME}
271950
- - For yarn, run: yarn global add ${SDK_PACKAGE_NAME}
271951
- - For pnpm, run: pnpm update -g ${SDK_PACKAGE_NAME}`;
271952
- }
271953
- return `Update your ${SDK_PACKAGE_NAME} version in the package.json file.`;
271954
- }
271955
- async function isSdkInstalledGlobally() {
271956
- try {
271957
- const installedLocally = await isPackageInstalled(SDK_PACKAGE_NAME);
271958
- return !installedLocally;
271959
- } catch {
271960
- return true;
272042
+ - For npm, run: npm update -g ${packageName}
272043
+ - For yarn, run: yarn global add ${packageName}
272044
+ - For pnpm, run: pnpm update -g ${packageName}`;
271961
272045
  }
272046
+ return `Update your ${packageName} version in the package.json file.`;
271962
272047
  }
271963
272048
 
271964
272049
  // src/commands/codegen/utils/write-template.ts
@@ -273923,7 +274008,7 @@ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
273923
274008
  `);
273924
274009
  }
273925
274010
  // ../../node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
273926
- var import_mute_stream = __toESM(require_lib12(), 1);
274011
+ var import_mute_stream = __toESM(require_lib13(), 1);
273927
274012
  init_mjs();
273928
274013
  import * as readline2 from "node:readline";
273929
274014
  import { AsyncResource as AsyncResource3 } from "node:async_hooks";
@@ -274730,9 +274815,8 @@ var esm_default5 = createPrompt((config3, done) => {
274730
274815
  // src/prompts/aat.prompt.ts
274731
274816
  async function applicationAccessTokenPrompt(env2, application, settlemint, accept) {
274732
274817
  const autoAccept = !!accept || is_in_ci_default;
274733
- const hasApplicationChanged = env2.SETTLEMINT_APPLICATION !== application.uniqueName;
274734
- const defaultAccessToken = hasApplicationChanged ? undefined : env2.SETTLEMINT_ACCESS_TOKEN;
274735
- const defaultPossible = autoAccept && !!defaultAccessToken;
274818
+ const defaultAccessToken = env2.SETTLEMINT_ACCESS_TOKEN;
274819
+ const defaultPossible = autoAccept && defaultAccessToken;
274736
274820
  if (defaultPossible || is_in_ci_default) {
274737
274821
  return defaultAccessToken;
274738
274822
  }
@@ -278768,17 +278852,6 @@ function formatUseCaseName(name2) {
278768
278852
  return name2;
278769
278853
  }
278770
278854
 
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
-
278782
278855
  // src/commands/smart-contract-set/create.ts
278783
278856
  function createCommand4() {
278784
278857
  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 }) => {
@@ -278811,7 +278884,7 @@ function createCommand4() {
278811
278884
  await spinner({
278812
278885
  startMessage: "Scaffolding the smart contract set",
278813
278886
  task: async () => {
278814
- await executeFoundryCommand("forge", [
278887
+ await executeCommand("forge", [
278815
278888
  "init",
278816
278889
  name2,
278817
278890
  "--template",
@@ -278855,7 +278928,7 @@ function foundryBuildCommand() {
278855
278928
  }
278856
278929
  ])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
278857
278930
  const forgeOptions = mapPassthroughOptions(passThroughOptions, cmd2);
278858
- await executeFoundryCommand("forge", ["build", ...forgeOptions]);
278931
+ await executeCommand("forge", ["build", ...forgeOptions]);
278859
278932
  });
278860
278933
  }
278861
278934
 
@@ -278876,7 +278949,7 @@ function foundryFormatCommand() {
278876
278949
  }
278877
278950
  ])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
278878
278951
  const forgeOptions = mapPassthroughOptions(passThroughOptions, cmd2);
278879
- await executeFoundryCommand("forge", ["fmt", ...forgeOptions]);
278952
+ await executeCommand("forge", ["fmt", ...forgeOptions]);
278880
278953
  note("Smart contract set formatted successfully!");
278881
278954
  });
278882
278955
  }
@@ -278898,7 +278971,7 @@ function foundryNetworkCommand() {
278898
278971
  }
278899
278972
  ])).helpOption(false).option("-h, --help", "Get list of possible anvil options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
278900
278973
  const anvilOptions = mapPassthroughOptions(passThroughOptions, cmd2);
278901
- await executeFoundryCommand("anvil", anvilOptions);
278974
+ await executeCommand("anvil", anvilOptions);
278902
278975
  });
278903
278976
  }
278904
278977
 
@@ -278919,26 +278992,10 @@ function foundryTestCommand() {
278919
278992
  }
278920
278993
  ])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
278921
278994
  const forgeOptions = mapPassthroughOptions(passThroughOptions, cmd2);
278922
- await executeFoundryCommand("forge", ["test", ...forgeOptions]);
278995
+ await executeCommand("forge", ["test", ...forgeOptions]);
278923
278996
  });
278924
278997
  }
278925
278998
 
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
-
278942
278999
  // src/commands/smart-contract-set/hardhat/build.ts
278943
279000
  function hardhatBuildCommand() {
278944
279001
  return new Command("build").description("Build the smart contracts using Hardhat").usage(createExamples([
@@ -278955,7 +279012,6 @@ function hardhatBuildCommand() {
278955
279012
  command: "scs hardhat build --concurrency 2"
278956
279013
  }
278957
279014
  ])).helpOption(false).option("-h, --help", "Get list of possible hardhat compile options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
278958
- await validateIfRequiredPackagesAreInstalled(["hardhat"]);
278959
279015
  const hardhatOptions = mapPassthroughOptions(passThroughOptions, cmd2);
278960
279016
  const { command, args } = await getPackageManagerExecutable();
278961
279017
  await executeCommand(command, [...args, "hardhat", "compile", ...hardhatOptions]);
@@ -278982,7 +279038,6 @@ function hardhatDeployLocalCommand() {
278982
279038
  command: "scs hardhat deploy local --verify"
278983
279039
  }
278984
279040
  ])).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"]);
278986
279041
  const { command, args } = await getPackageManagerExecutable();
278987
279042
  await executeCommand(command, [
278988
279043
  ...args,
@@ -279159,7 +279214,6 @@ function hardhatDeployRemoteCommand() {
279159
279214
  acceptDefaults,
279160
279215
  blockchainNode: blockchainNodeUniqueName
279161
279216
  }) => {
279162
- await validateIfRequiredPackagesAreInstalled(["hardhat"]);
279163
279217
  const autoAccept = !!acceptDefaults || is_in_ci_default;
279164
279218
  const env2 = await loadEnv(false, !!prod);
279165
279219
  const instance = await instancePrompt(env2, true);
@@ -279230,7 +279284,6 @@ function hardhatNetworkCommand() {
279230
279284
  command: "scs hardhat network --port 3000"
279231
279285
  }
279232
279286
  ])).helpOption(false).option("-h, --help", "Get list of possible hardhat node options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
279233
- await validateIfRequiredPackagesAreInstalled(["hardhat"]);
279234
279287
  const hardhatOptions = mapPassthroughOptions(passThroughOptions, cmd2);
279235
279288
  const { command, args } = await getPackageManagerExecutable();
279236
279289
  await executeCommand(command, [...args, "hardhat", "node", ...hardhatOptions]);
@@ -279240,7 +279293,6 @@ function hardhatNetworkCommand() {
279240
279293
  // src/commands/smart-contract-set/hardhat/script/local.ts
279241
279294
  function hardhatScriptLocalCommand() {
279242
279295
  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"]);
279244
279296
  const { command, args } = await getPackageManagerExecutable();
279245
279297
  await executeCommand(command, [
279246
279298
  ...args,
@@ -279258,7 +279310,6 @@ function hardhatScriptLocalCommand() {
279258
279310
  function hardhatScriptRemoteCommand() {
279259
279311
  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");
279260
279312
  cmd2.action(async ({ script, prod, blockchainNode: blockchainNodeUniqueName, acceptDefaults, compile }) => {
279261
- await validateIfRequiredPackagesAreInstalled(["hardhat"]);
279262
279313
  const autoAccept = !!acceptDefaults || is_in_ci_default;
279263
279314
  const env2 = await loadEnv(false, !!prod);
279264
279315
  const instance = await instancePrompt(env2, true);
@@ -279307,7 +279358,6 @@ function hardhatTestCommand() {
279307
279358
  command: "scs hardhat test test/token.test.ts"
279308
279359
  }
279309
279360
  ])).helpOption(false).option("-h, --help", "Get list of possible hardhat test options").passThroughOptions().allowUnknownOption().action(async (options, cmd2) => {
279310
- await validateIfRequiredPackagesAreInstalled(["hardhat"]);
279311
279361
  const hardhatOptions = mapPassthroughOptions(options, cmd2);
279312
279362
  const { command, args } = await getPackageManagerExecutable();
279313
279363
  await executeCommand(command, [...args, "hardhat", "test", ...hardhatOptions]);
@@ -279376,7 +279426,7 @@ var SETTLEMINT_NETWORK = "settlemint";
279376
279426
  async function subgraphSetup({ network }) {
279377
279427
  const generated = await isGenerated();
279378
279428
  if (generated) {
279379
- await executeFoundryCommand("forge", ["build"]);
279429
+ await executeCommand("forge", ["build"]);
279380
279430
  }
279381
279431
  if (await exists3("./generated")) {
279382
279432
  await rm4("./generated", { recursive: true, force: true });
@@ -279479,7 +279529,6 @@ async function getNodeName({
279479
279529
  // src/commands/smart-contract-set/subgraph/build.ts
279480
279530
  function subgraphBuildCommand() {
279481
279531
  return new Command("build").description("Build the subgraph").action(async () => {
279482
- await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
279483
279532
  await subgraphSetup({
279484
279533
  network: SETTLEMINT_NETWORK
279485
279534
  });
@@ -279495,7 +279544,6 @@ function subgraphBuildCommand() {
279495
279544
  import { dirname as dirname11 } from "node:path";
279496
279545
  function subgraphCodegenCommand() {
279497
279546
  return new Command("codegen").description("Codegen the subgraph types").action(async () => {
279498
- await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
279499
279547
  await subgraphSetup({
279500
279548
  network: SETTLEMINT_NETWORK
279501
279549
  });
@@ -279554,7 +279602,6 @@ function subgraphDeployCommand() {
279554
279602
  command: "scs subgraph deploy my-subgraph"
279555
279603
  }
279556
279604
  ])).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"]);
279558
279605
  const autoAccept = !!acceptDefaults || is_in_ci_default;
279559
279606
  const env2 = await loadEnv(false, !!prod);
279560
279607
  const instance = await instancePrompt(env2, true);
@@ -279744,4 +279791,4 @@ async function sdkCliCommand(argv = process.argv) {
279744
279791
  // src/cli.ts
279745
279792
  sdkCliCommand();
279746
279793
 
279747
- //# debugId=6B456B48DCE5548864756E2164756E21
279794
+ //# debugId=7A0D6D9DE77BEF5064756E2164756E21