Skip to content

Commit

Permalink
fix(cli): add worldAddress to dev-contracts (#1892)
Browse files Browse the repository at this point in the history
Co-authored-by: alvrs <[email protected]>
  • Loading branch information
holic and alvrs authored Nov 10, 2023
1 parent e7881a8 commit 1feecf4
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .changeset/light-bananas-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@latticexyz/cli": patch
---

Added `--worldAddress` argument to `dev-contracts` CLI command so that you can develop against an existing world.
14 changes: 7 additions & 7 deletions next-docs/pages/cli/deploy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ Again, there are several ways to do this:

These are the command line options you can specify on `mud deploy`:

| Option | Meaning | Type | Default value |
| ----------------------- | ------------------------------------------------ | ------- | -------------------------------------------------------- |
| Option | Meaning | Type | Default value |
| ----------------------- | ------------------------------------------------ | ------- | ---------------------------------------------------------- |
| `--version` | Show version number | boolean | `false` |
| `--configPath` | Path to the config file | string | `foundry.toml` |
| `--configPath` | Path to the config file | string | `foundry.toml` |
| `--printConfig` | Print the resolved config | boolean | `false` |
| `--saveDeployment | Save the deployment info to a file | boolean | `true` |
| `--profile` | The foundry profile to use | string | `local` |
| `--rpc`<sup>1</sup> | The RPC URL to use | string | RPC url from `foundry.toml` |
| `--worldAddress` | Deploy to an existing World at the given address | string | Empty, deploy new `World` |
| `--srcDir` | Source directory | string | Foundry `src` directory |
| `--profile` | The foundry profile to use | string | `local` |
| `--rpc`<sup>1</sup> | The RPC URL to use | string | RPC url from `foundry.toml` |
| `--worldAddress` | Deploy to an existing World at the given address | string | Empty, deploy new `World` |
| `--srcDir` | Source directory | string | Foundry `src` directory |
| `--skipBuild` | Skip rebuilding the contracts before deploying | boolean | `false` |
| `--alwaysRunPostDeploy` | Run `PostDeploy.s.sol` after each deploy | boolean | `false` (run the script only when deploying a new `World`) |
| `--help` | Show help | boolean | `false` |
Expand Down
14 changes: 7 additions & 7 deletions next-docs/pages/cli/set-version.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ pnpm install

These are the command line options you can specify on `mud set-version`:

| Option | Meaning | Type | Default value |
| -------------- | ------------------------------------------------------------ | ------- | ------------- |
| `--version` | Show version number | boolean | false |
| `--mudVersion` | Set MUD to the given version | string | true |
| `--tag` | Set MUD to the latest version with the given tag from npm | string | |
| `--commit` | Set MUD to the version based on a given git commit hash | string |
| `--help` | Show help | boolean | false |
| Option | Meaning | Type | Default value |
| -------------- | --------------------------------------------------------- | ------- | ------------- |
| `--version` | Show version number | boolean | false |
| `--mudVersion` | Set MUD to the given version | string | true |
| `--tag` | Set MUD to the latest version with the given tag from npm | string | |
| `--commit` | Set MUD to the version based on a given git commit hash | string |
| `--help` | Show help | boolean | false |
3 changes: 2 additions & 1 deletion packages/cli/src/commands/dev-contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const devOptions = {
rpc: deployOptions.rpc,
configPath: deployOptions.configPath,
alwaysRunPostDeploy: deployOptions.alwaysRunPostDeploy,
worldAddress: deployOptions.worldAddress,
};

const commandModule: CommandModule<typeof devOptions, InferredOptionTypes<typeof devOptions>> = {
Expand Down Expand Up @@ -67,7 +68,7 @@ const commandModule: CommandModule<typeof devOptions, InferredOptionTypes<typeof
}
});

let worldAddress: Address | undefined;
let worldAddress = opts.worldAddress as Address | undefined;

const deploys$ = lastChange$.pipe(
// debounce so that a large batch of file changes only triggers a deploy after it settles down, rather than the first change it sees (and then redeploying immediately after)
Expand Down

0 comments on commit 1feecf4

Please sign in to comment.