@moltium/world-cli 0.1.1 → 0.1.3

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.
Files changed (2) hide show
  1. package/dist/index.js +62 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -596,6 +596,36 @@ tokenCommand.command("deploy").description("Deploy custom ERC20 token").option("
596
596
  TOKEN_DECIMALS: tokenConfig.decimals?.toString() || "18"
597
597
  };
598
598
  const worldCorePath = path3.join(process.cwd(), "node_modules", "@moltium", "world-core");
599
+ const libPath = path3.join(worldCorePath, "lib");
600
+ try {
601
+ await fs3.access(libPath);
602
+ } catch {
603
+ deploySpinner.text = "Installing Foundry dependencies...";
604
+ try {
605
+ try {
606
+ execSync("git rev-parse --git-dir", {
607
+ cwd: worldCorePath,
608
+ stdio: "pipe"
609
+ });
610
+ } catch {
611
+ execSync("git init", {
612
+ cwd: worldCorePath,
613
+ stdio: "pipe"
614
+ });
615
+ }
616
+ execSync("forge install --no-commit", {
617
+ cwd: worldCorePath,
618
+ stdio: "pipe"
619
+ });
620
+ deploySpinner.text = "Deploying token contract...";
621
+ } catch (error) {
622
+ deploySpinner.fail();
623
+ console.error(chalk2.red("\\n\u274C Failed to install Foundry dependencies"));
624
+ console.log(chalk2.yellow("\\nPlease ensure Foundry is installed: https://getfoundry.sh/"));
625
+ console.log(chalk2.gray(`\\nThen run manually: cd ${worldCorePath} && git init && forge install\\n`));
626
+ process.exit(1);
627
+ }
628
+ }
599
629
  const command = `forge script script/DeployToken.s.sol:DeployTokenScript --rpc-url monad --broadcast -vvv`;
600
630
  const output = execSync(command, {
601
631
  cwd: worldCorePath,
@@ -740,6 +770,37 @@ var deployCommand = new Command4("deploy").description("Deploy smart contracts t
740
770
  const deploySpinner = ora4("Deploying AgentRegistry...").start();
741
771
  try {
742
772
  const worldCorePath = path4.join(process.cwd(), "node_modules", "@moltium", "world-core");
773
+ const libPath = path4.join(worldCorePath, "lib");
774
+ const fs4 = await import("fs/promises");
775
+ try {
776
+ await fs4.access(libPath);
777
+ } catch {
778
+ deploySpinner.text = "Installing Foundry dependencies...";
779
+ try {
780
+ try {
781
+ execSync3("git rev-parse --git-dir", {
782
+ cwd: worldCorePath,
783
+ stdio: "pipe"
784
+ });
785
+ } catch {
786
+ execSync3("git init", {
787
+ cwd: worldCorePath,
788
+ stdio: "pipe"
789
+ });
790
+ }
791
+ execSync3("forge install --no-commit", {
792
+ cwd: worldCorePath,
793
+ stdio: "pipe"
794
+ });
795
+ deploySpinner.text = "Deploying AgentRegistry...";
796
+ } catch (error) {
797
+ deploySpinner.fail();
798
+ console.error(chalk4.red("\\n\u274C Failed to install Foundry dependencies"));
799
+ console.log(chalk4.yellow("\\nPlease ensure Foundry is installed: https://getfoundry.sh/"));
800
+ console.log(chalk4.gray(`\\nThen run manually: cd ${worldCorePath} && git init && forge install\\n`));
801
+ process.exit(1);
802
+ }
803
+ }
743
804
  const env = {
744
805
  ...process.env,
745
806
  MONAD_RPC_URL: rpcUrl,
@@ -765,7 +826,6 @@ var deployCommand = new Command4("deploy").description("Deploy smart contracts t
765
826
  console.log(` ${chalk4.gray("AgentRegistry:")} ${chalk4.green(agentRegistryAddress)}`);
766
827
  console.log(` ${chalk4.gray("WorldMembership:")} ${chalk4.green(membershipAddress)}`);
767
828
  const updateSpinner = ora4("\\nUpdating world.config.json...").start();
768
- const fs4 = await import("fs/promises");
769
829
  worldConfig.blockchain = worldConfig.blockchain || {};
770
830
  worldConfig.blockchain.agentRegistryAddress = agentRegistryAddress;
771
831
  worldConfig.blockchain.membershipContractAddress = membershipAddress;
@@ -792,7 +852,7 @@ var deployCommand = new Command4("deploy").description("Deploy smart contracts t
792
852
 
793
853
  // src/index.ts
794
854
  var program = new Command5();
795
- program.name("moltium-world").description("CLI tool for creating and managing Moltium World SDK projects").version("0.1.0");
855
+ program.name("moltium-world").description("CLI tool for creating and managing Moltium World SDK projects").version("0.1.3");
796
856
  program.addCommand(initCommand);
797
857
  program.addCommand(tokenCommand);
798
858
  program.addCommand(startCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moltium/world-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "CLI tool for creating and managing Moltium World SDK projects",
5
5
  "license": "MIT",
6
6
  "keywords": [