@moltium/world-cli 0.1.1 → 0.1.2
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/index.js +40 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -596,6 +596,25 @@ 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
|
+
execSync("forge install --no-commit", {
|
|
606
|
+
cwd: worldCorePath,
|
|
607
|
+
stdio: "pipe"
|
|
608
|
+
});
|
|
609
|
+
deploySpinner.text = "Deploying token contract...";
|
|
610
|
+
} catch (error) {
|
|
611
|
+
deploySpinner.fail();
|
|
612
|
+
console.error(chalk2.red("\\n\u274C Failed to install Foundry dependencies"));
|
|
613
|
+
console.log(chalk2.yellow("\\nPlease ensure Foundry is installed: https://getfoundry.sh/"));
|
|
614
|
+
console.log(chalk2.gray(`\\nThen run manually: cd ${worldCorePath} && forge install\\n`));
|
|
615
|
+
process.exit(1);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
599
618
|
const command = `forge script script/DeployToken.s.sol:DeployTokenScript --rpc-url monad --broadcast -vvv`;
|
|
600
619
|
const output = execSync(command, {
|
|
601
620
|
cwd: worldCorePath,
|
|
@@ -740,6 +759,26 @@ var deployCommand = new Command4("deploy").description("Deploy smart contracts t
|
|
|
740
759
|
const deploySpinner = ora4("Deploying AgentRegistry...").start();
|
|
741
760
|
try {
|
|
742
761
|
const worldCorePath = path4.join(process.cwd(), "node_modules", "@moltium", "world-core");
|
|
762
|
+
const libPath = path4.join(worldCorePath, "lib");
|
|
763
|
+
const fs4 = await import("fs/promises");
|
|
764
|
+
try {
|
|
765
|
+
await fs4.access(libPath);
|
|
766
|
+
} catch {
|
|
767
|
+
deploySpinner.text = "Installing Foundry dependencies...";
|
|
768
|
+
try {
|
|
769
|
+
execSync3("forge install --no-commit", {
|
|
770
|
+
cwd: worldCorePath,
|
|
771
|
+
stdio: "pipe"
|
|
772
|
+
});
|
|
773
|
+
deploySpinner.text = "Deploying AgentRegistry...";
|
|
774
|
+
} catch (error) {
|
|
775
|
+
deploySpinner.fail();
|
|
776
|
+
console.error(chalk4.red("\\n\u274C Failed to install Foundry dependencies"));
|
|
777
|
+
console.log(chalk4.yellow("\\nPlease ensure Foundry is installed: https://getfoundry.sh/"));
|
|
778
|
+
console.log(chalk4.gray(`\\nThen run manually: cd ${worldCorePath} && forge install\\n`));
|
|
779
|
+
process.exit(1);
|
|
780
|
+
}
|
|
781
|
+
}
|
|
743
782
|
const env = {
|
|
744
783
|
...process.env,
|
|
745
784
|
MONAD_RPC_URL: rpcUrl,
|
|
@@ -765,7 +804,6 @@ var deployCommand = new Command4("deploy").description("Deploy smart contracts t
|
|
|
765
804
|
console.log(` ${chalk4.gray("AgentRegistry:")} ${chalk4.green(agentRegistryAddress)}`);
|
|
766
805
|
console.log(` ${chalk4.gray("WorldMembership:")} ${chalk4.green(membershipAddress)}`);
|
|
767
806
|
const updateSpinner = ora4("\\nUpdating world.config.json...").start();
|
|
768
|
-
const fs4 = await import("fs/promises");
|
|
769
807
|
worldConfig.blockchain = worldConfig.blockchain || {};
|
|
770
808
|
worldConfig.blockchain.agentRegistryAddress = agentRegistryAddress;
|
|
771
809
|
worldConfig.blockchain.membershipContractAddress = membershipAddress;
|
|
@@ -792,7 +830,7 @@ var deployCommand = new Command4("deploy").description("Deploy smart contracts t
|
|
|
792
830
|
|
|
793
831
|
// src/index.ts
|
|
794
832
|
var program = new Command5();
|
|
795
|
-
program.name("moltium-world").description("CLI tool for creating and managing Moltium World SDK projects").version("0.1.
|
|
833
|
+
program.name("moltium-world").description("CLI tool for creating and managing Moltium World SDK projects").version("0.1.2");
|
|
796
834
|
program.addCommand(initCommand);
|
|
797
835
|
program.addCommand(tokenCommand);
|
|
798
836
|
program.addCommand(startCommand);
|