fix(cli): Rename `hyperlane config create chain` -> `hyperlane registry init` (#3978)

### Description
Renames `hyperlane config create chain` -> `hyperlane registry init` as
according to
https://www.notion.so/hyperlanexyz/Must-use-config-to-create-a-new-chain-instead-of-the-registry-command-f7b407b29a834f7288f20e4c08bc206e?pvs=4

### Drive-by changes
- Rename `configure` to `init` for all functions
- Reorder functions alphabetically 

### Backward compatibility
No

### Testing

Manual
pull/4011/head
Lee 5 months ago committed by GitHub
parent 28f047739c
commit 5c8ba0b850
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      .changeset/giant-lies-whisper.md
  2. 28
      typescript/cli/src/commands/config.ts
  3. 6
      typescript/cli/src/commands/core.ts
  4. 15
      typescript/cli/src/commands/registry.ts
  5. 6
      typescript/cli/src/commands/warp.ts

@ -0,0 +1,5 @@
---
'@hyperlane-xyz/cli': minor
---
Rename hyperlane config create chain -> hyperlane registry init. Rename all `configure` to `init`

@ -1,6 +1,6 @@
import { CommandModule } from 'yargs';
import { createChainConfig, readChainConfigs } from '../config/chain.js';
import { readChainConfigs } from '../config/chain.js';
import { readIsmConfig } from '../config/ism.js';
import { readMultisigConfig } from '../config/multisig.js';
import { readWarpRouteDeployConfig } from '../config/warp.js';
@ -16,34 +16,10 @@ export const configCommand: CommandModule = {
command: 'config',
describe: 'Create or validate Hyperlane configs',
builder: (yargs) =>
yargs
.command(createCommand)
.command(validateCommand)
.version(false)
.demandCommand(),
handler: () => log('Command required'),
};
/**
* Create commands
*/
const createCommand: CommandModule = {
command: 'create',
describe: 'Create a new Hyperlane config',
builder: (yargs) =>
yargs.command(createChainConfigCommand).version(false).demandCommand(),
yargs.command(validateCommand).version(false).demandCommand(),
handler: () => log('Command required'),
};
const createChainConfigCommand: CommandModuleWithContext<{}> = {
command: 'chain',
describe: 'Create a new, minimal Hyperlane chain config (aka chain metadata)',
handler: async ({ context }) => {
await createChainConfig({ context });
process.exit(0);
},
};
/**
* Validate commands
*/

@ -32,8 +32,8 @@ export const coreCommand: CommandModule = {
describe: 'Manage core Hyperlane contracts & configs',
builder: (yargs) =>
yargs
.command(configure)
.command(deploy)
.command(init)
.command(read)
.version(false)
.demandCommand(),
@ -82,11 +82,11 @@ export const deploy: CommandModuleWithWriteContext<{
},
};
export const configure: CommandModuleWithContext<{
export const init: CommandModuleWithContext<{
advanced: boolean;
config: string;
}> = {
command: 'configure',
command: 'init',
describe: 'Create a core configuration, including ISMs and hooks.',
builder: {
advanced: {

@ -1,6 +1,7 @@
import { CommandModule } from 'yargs';
import { createAgentConfig } from '../config/agent.js';
import { createChainConfig } from '../config/chain.js';
import { CommandContext, CommandModuleWithContext } from '../context/types.js';
import { log, logBlue, logGray, logRed, logTable } from '../logger.js';
@ -15,12 +16,13 @@ import { ChainType, ChainTypes } from './types.js';
*/
export const registryCommand: CommandModule = {
command: 'registry',
describe: 'View information about Hyperlane chains in a registry',
describe: 'Manage Hyperlane chains in a registry',
builder: (yargs) =>
yargs
.command(listCommand)
.command(addressesCommand)
.command(createAgentConfigCommand)
.command(initCommand)
.command(listCommand)
.version(false)
.demandCommand(),
handler: () => log('Command required'),
@ -140,3 +142,12 @@ const createAgentConfigCommand: CommandModuleWithContext<{
process.exit(0);
},
};
const initCommand: CommandModuleWithContext<{}> = {
command: 'init',
describe: 'Create a new, minimal Hyperlane chain config (aka chain metadata)',
handler: async ({ context }) => {
await createChainConfig({ context });
process.exit(0);
},
};

@ -43,8 +43,8 @@ export const warpCommand: CommandModule = {
describe: 'Manage Hyperlane warp routes',
builder: (yargs) =>
yargs
.command(configure)
.command(deploy)
.command(init)
.command(read)
.command(send)
.version(false)
@ -82,11 +82,11 @@ export const deploy: CommandModuleWithWriteContext<{
},
};
export const configure: CommandModuleWithContext<{
export const init: CommandModuleWithContext<{
advanced: boolean;
out: string;
}> = {
command: 'configure',
command: 'init',
describe: 'Create a warp route configuration.',
builder: {
advanced: {

Loading…
Cancel
Save