From c83d1b5f9a628ec61f4af73b774804701be723ba Mon Sep 17 00:00:00 2001
From: Jack Hamer <47187316+JackHamer09@users.noreply.github.com>
Date: Fri, 6 Oct 2023 18:33:59 +0300
Subject: [PATCH] fix: restructure commands (#64)
---
.github/CONTRIBUTING.md | 10 ++++----
.github/ISSUE_TEMPLATE/config.yml | 2 +-
README.md | 22 ++++++++--------
package.json | 2 +-
src/commands/bridge/command.ts | 3 +++
src/commands/{ => bridge}/deposit.ts | 24 +++++++++---------
src/commands/bridge/index.ts | 5 ++++
.../{ => bridge}/withdraw-finalize.ts | 22 ++++++++--------
src/commands/{ => bridge}/withdraw.ts | 24 +++++++++---------
src/commands/create/command.ts | 3 +++
.../{create-project.ts => create/create.ts} | 22 ++++++++--------
src/commands/create/index.ts | 3 +++
src/commands/dev/clean.ts | 2 +-
src/commands/dev/command.ts | 2 +-
src/commands/dev/install.ts | 2 +-
src/commands/dev/logs.ts | 2 +-
src/commands/dev/modules/index.ts | 2 +-
src/commands/dev/restart.ts | 2 +-
src/commands/dev/start.ts | 11 +++++++-
src/commands/dev/stop.ts | 2 +-
src/commands/dev/uninstall.ts | 2 +-
src/commands/dev/update.ts | 21 ++++++++++-----
src/index.ts | 8 +++---
zksync-cli-banner.png => zkcli-banner.png | Bin
24 files changed, 115 insertions(+), 83 deletions(-)
create mode 100644 src/commands/bridge/command.ts
rename src/commands/{ => bridge}/deposit.ts (87%)
create mode 100644 src/commands/bridge/index.ts
rename src/commands/{ => bridge}/withdraw-finalize.ts (89%)
rename src/commands/{ => bridge}/withdraw.ts (87%)
create mode 100644 src/commands/create/command.ts
rename src/commands/{create-project.ts => create/create.ts} (81%)
create mode 100644 src/commands/create/index.ts
rename zksync-cli-banner.png => zkcli-banner.png (100%)
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 06a72aa7..38cbf1e3 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -1,12 +1,12 @@
-# Contributing to zkSync Era CLI
+# Contributing to zkSync CLI
## Welcome! 🎉
-Hello, contributor! Thanks for thinking about helping with the `zkSync Era CLI` project. This guide will help you understand how to contribute to our CLI tool.
+Hello, contributor! Thanks for thinking about helping with the zkSync CLI project. This guide will help you understand how to contribute to our CLI tool.
## Getting Started
-- **Fork the project.** First, fork the `zkSync Era CLI` repository to your GitHub account.
+- **Fork the project.** First, fork the `zksync-cli` repository to your GitHub account.
- **Download the project.** Now, get the project on your computer:
@@ -41,7 +41,7 @@ Hello, contributor! Thanks for thinking about helping with the `zkSync Era CLI`
## Sending a Pull Request
-- **Ask to add your changes.** Go to the `zkSync Era CLI` repository on GitHub. You'll see a button "Compare & pull request." Click it and tell us about your changes.
+- **Ask to add your changes.** Go to the `zksync-cli` repository on GitHub. You'll see a button "Compare & pull request." Click it and tell us about your changes.
- **Wait for feedback.** Our team will look at your changes. We might ask you to change some things.
@@ -61,7 +61,7 @@ If you have questions, you can ask on our [zkSync Community Hub](https://github.
## Thank You!
-After we add your changes to the `zkSync Era CLI` project, we'll be very thankful! Your help makes our project better.
+After we add your changes to the `zksync-cli` project, we'll be very thankful! Your help makes our project better.
We hope you enjoy helping and come back to help more. Thanks for being part of our team!
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index fee4cf0a..66f5fd38 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -3,6 +3,6 @@ contact_links:
- name: zksync-developers Discussion
url: https://github.com/zkSync-Community-Hub/zkync-developers/discussions
about: Please provide feedback, and ask questions here.
- - name: zksync-cli documentation page
+ - name: zkSync CLI documentation page
url: https://era.zksync.io/docs/tools/zksync-cli
about: Please refer to the documentation for immediate answers.
\ No newline at end of file
diff --git a/README.md b/README.md
index 534cf83c..6ac8f8bb 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,10 @@
-# ‣ zkSync Era CLI
+# ‣ zkSync CLI
-![zksync cli](./zksync-cli-banner.png)
+![zkSync CLI](./zksync-cli-banner.png)
-This CLI tool simplifies the process of developing applications and interacting with zkSync Era.
+This CLI tool simplifies the process of developing applications and interacting with zkSync.
[Documentation](https://era.zksync.io/docs/tools/zksync-cli) | [Report a bug](https://github.com/matter-labs/zksync-cli/issues/new) | [Request a feature](https://github.com/matter-labs/zksync-cli/issues/new)
@@ -17,7 +17,7 @@ This CLI tool simplifies the process of developing applications and interacting
- [Node.js v18 or higher](https://nodejs.org/en)
- [Git](https://git-scm.com/downloads)
- [Docker](https://www.docker.com/get-started/) (for `zksync-cli dev` commands)
-- [Yarn](https://v3.yarnpkg.com/getting-started/install) (for `zksync-cli create-project`)
+- [Yarn](https://v3.yarnpkg.com/getting-started/install) (for `zksync-cli create` commands)
## 📥 Usage
@@ -27,7 +27,7 @@ Or you can install the CLI globally with `npm i -g zksync-cli` and run the comma
## 💻 Commands
### Local development commands
-`zksync-cli dev` - All-in-one tool for local zkSync development. It allows to easily start zkSync stack locally, for example: local Ethereum and zkSync nodes, Wallet and Bridge.
+`zksync-cli dev` - Manage local zkSync development environment. It allows to easily start zkSync stack locally, for example: local Ethereum and zkSync nodes, Wallet and Bridge.
**General:**
- `zksync-cli dev start` - start local development environment (will ask to configure if starting for the first time)
@@ -44,16 +44,16 @@ In addition to default modules, you can install custom modules from NPM.
Run `zksync-cli dev` to see the full list of commands.
### Bridge commands
-- `zksync-cli deposit`: deposits funds from Ethereum (L1) to zkSync (L2)
-- `zksync-cli withdraw`: withdraws funds from zkSync (L2) to Ethereum (L1)
-- `zksync-cli withdraw-finalize`: finalizes withdrawal of funds from zkSync (L2) to Ethereum (L1)
+- `zksync-cli bridge deposit`: deposits funds from Ethereum (L1) to zkSync (L2)
+- `zksync-cli bridge withdraw`: withdraws funds from zkSync (L2) to Ethereum (L1)
+- `zksync-cli bridge withdraw-finalize`: finalizes withdrawal of funds from zkSync (L2) to Ethereum (L1)
### Create project commands
-- `zksync-cli create-project {FOLDER_NAME}`: creates project from template in the specified folder
+- `zksync-cli create project {FOLDER_NAME}`: creates project from template in the specified folder
### Other commands
- `zksync-cli help`: Provides information about all supported commands
-- `zksync-cli help `: Provides detailed information about how to use a specific command. Replace with the name of the command you want help with (e.g., create-project, deposit, withdraw, withdraw-finalize)
+- `zksync-cli help `: Provides detailed information about how to use a specific command. Replace with the name of the command you want help with (e.g., `create`, `dev config`, `bridge withdraw-finalize`)
- `zksync-cli --version`: Returns the current version
@@ -68,7 +68,7 @@ If you're using [local setup (dockerized testing node)](https://github.com/matte
### Run in development mode
1. Install all dependencies with `npm i`.
-2. To use CLI in development mode run `npm run dev -- [command] [options]` (eg. `npm run dev -- deposit --chain=era-testnet`).
+2. To use CLI in development mode run `npm run dev -- [command] [options]` (eg. `npm run dev -- bridge deposit --chain=era-testnet`).
### Building for production
diff --git a/package.json b/package.json
index c8e1cc92..e701a914 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "zksync-cli",
"type": "module",
"version": "0.0.0-development",
- "description": "CLI tool that simplifies the process of developing applications and interacting with the zkSync Era network",
+ "description": "CLI tool that simplifies the process of developing applications and interacting with the zkSync network",
"repository": {
"type": "git",
"url": "https://github.com/matter-labs/zksync-cli.git"
diff --git a/src/commands/bridge/command.ts b/src/commands/bridge/command.ts
new file mode 100644
index 00000000..d00b3b7c
--- /dev/null
+++ b/src/commands/bridge/command.ts
@@ -0,0 +1,3 @@
+import Program from "../../program.js";
+
+export default Program.command("bridge").description("Bridge operations for zkSync");
diff --git a/src/commands/deposit.ts b/src/commands/bridge/deposit.ts
similarity index 87%
rename from src/commands/deposit.ts
rename to src/commands/bridge/deposit.ts
index 874751fb..89212876 100644
--- a/src/commands/deposit.ts
+++ b/src/commands/bridge/deposit.ts
@@ -1,5 +1,6 @@
import inquirer from "inquirer";
+import Program from "./command.js";
import {
amountOptionCreate,
chainOption,
@@ -8,24 +9,23 @@ import {
privateKeyOption,
recipientOptionCreate,
zeekOption,
-} from "../common/options.js";
-import { l2Chains } from "../data/chains.js";
-import Program from "../program.js";
-import { track } from "../utils/analytics.js";
-import { ETH_TOKEN } from "../utils/constants.js";
-import { bigNumberToDecimal, decimalToBigNumber } from "../utils/formatters.js";
+} from "../../common/options.js";
+import { l2Chains } from "../../data/chains.js";
+import { track } from "../../utils/analytics.js";
+import { ETH_TOKEN } from "../../utils/constants.js";
+import { bigNumberToDecimal, decimalToBigNumber } from "../../utils/formatters.js";
import {
getAddressFromPrivateKey,
getL1Provider,
getL2Provider,
getL2Wallet,
optionNameToParam,
-} from "../utils/helpers.js";
-import Logger from "../utils/logger.js";
-import { isDecimalAmount, isAddress, isPrivateKey } from "../utils/validators.js";
-import zeek from "../utils/zeek.js";
+} from "../../utils/helpers.js";
+import Logger from "../../utils/logger.js";
+import { isDecimalAmount, isAddress, isPrivateKey } from "../../utils/validators.js";
+import zeek from "../../utils/zeek.js";
-import type { DefaultTransferOptions } from "../common/options.js";
+import type { DefaultTransferOptions } from "../../common/options.js";
const amountOption = amountOptionCreate("deposit");
const recipientOption = recipientOptionCreate("L2");
@@ -135,7 +135,7 @@ export const handler = async (options: DepositOptions) => {
};
Program.command("deposit")
- .description("Deposit ETH from L1 to L2")
+ .description("Transfer ETH from L1 to L2")
.addOption(amountOption)
.addOption(chainOption)
.addOption(recipientOption)
diff --git a/src/commands/bridge/index.ts b/src/commands/bridge/index.ts
new file mode 100644
index 00000000..d66ea062
--- /dev/null
+++ b/src/commands/bridge/index.ts
@@ -0,0 +1,5 @@
+import "./deposit.js";
+import "./withdraw.js";
+import "./withdraw-finalize.js";
+
+import "./command.js"; // registers all the commands above
diff --git a/src/commands/withdraw-finalize.ts b/src/commands/bridge/withdraw-finalize.ts
similarity index 89%
rename from src/commands/withdraw-finalize.ts
rename to src/commands/bridge/withdraw-finalize.ts
index 7ddb6d36..eaf7dc4f 100644
--- a/src/commands/withdraw-finalize.ts
+++ b/src/commands/bridge/withdraw-finalize.ts
@@ -1,23 +1,23 @@
import { Option } from "commander";
import inquirer from "inquirer";
-import { chainOption, l1RpcUrlOption, l2RpcUrlOption, privateKeyOption, zeekOption } from "../common/options.js";
-import { l2Chains } from "../data/chains.js";
-import Program from "../program.js";
-import { track } from "../utils/analytics.js";
-import { bigNumberToDecimal } from "../utils/formatters.js";
+import Program from "./command.js";
+import { chainOption, l1RpcUrlOption, l2RpcUrlOption, privateKeyOption, zeekOption } from "../../common/options.js";
+import { l2Chains } from "../../data/chains.js";
+import { track } from "../../utils/analytics.js";
+import { bigNumberToDecimal } from "../../utils/formatters.js";
import {
getAddressFromPrivateKey,
getL1Provider,
getL2Provider,
getL2Wallet,
optionNameToParam,
-} from "../utils/helpers.js";
-import Logger from "../utils/logger.js";
-import { isPrivateKey, isTransactionHash } from "../utils/validators.js";
-import zeek from "../utils/zeek.js";
+} from "../../utils/helpers.js";
+import Logger from "../../utils/logger.js";
+import { isPrivateKey, isTransactionHash } from "../../utils/validators.js";
+import zeek from "../../utils/zeek.js";
-import type { DefaultTransactionOptions } from "../common/options.js";
+import type { DefaultTransactionOptions } from "../../common/options.js";
const transactionHashOption = new Option("--hash ", "L2 withdrawal transaction hash to finalize");
@@ -133,7 +133,7 @@ export const handler = async (options: WithdrawFinalizeOptions) => {
};
Program.command("withdraw-finalize")
- .description("Finalizes withdrawal of funds")
+ .description("Finalize withdrawal of funds")
.addOption(transactionHashOption)
.addOption(chainOption)
.addOption(l1RpcUrlOption)
diff --git a/src/commands/withdraw.ts b/src/commands/bridge/withdraw.ts
similarity index 87%
rename from src/commands/withdraw.ts
rename to src/commands/bridge/withdraw.ts
index fd148508..5e48742b 100644
--- a/src/commands/withdraw.ts
+++ b/src/commands/bridge/withdraw.ts
@@ -1,5 +1,6 @@
import inquirer from "inquirer";
+import Program from "./command.js";
import {
amountOptionCreate,
chainOption,
@@ -8,24 +9,23 @@ import {
privateKeyOption,
recipientOptionCreate,
zeekOption,
-} from "../common/options.js";
-import { l2Chains } from "../data/chains.js";
-import Program from "../program.js";
-import { track } from "../utils/analytics.js";
-import { ETH_TOKEN } from "../utils/constants.js";
-import { bigNumberToDecimal, decimalToBigNumber } from "../utils/formatters.js";
+} from "../../common/options.js";
+import { l2Chains } from "../../data/chains.js";
+import { track } from "../../utils/analytics.js";
+import { ETH_TOKEN } from "../../utils/constants.js";
+import { bigNumberToDecimal, decimalToBigNumber } from "../../utils/formatters.js";
import {
getAddressFromPrivateKey,
getL1Provider,
getL2Provider,
getL2Wallet,
optionNameToParam,
-} from "../utils/helpers.js";
-import Logger from "../utils/logger.js";
-import { isDecimalAmount, isAddress, isPrivateKey } from "../utils/validators.js";
-import zeek from "../utils/zeek.js";
+} from "../../utils/helpers.js";
+import Logger from "../../utils/logger.js";
+import { isDecimalAmount, isAddress, isPrivateKey } from "../../utils/validators.js";
+import zeek from "../../utils/zeek.js";
-import type { DefaultTransferOptions } from "../common/options.js";
+import type { DefaultTransferOptions } from "../../common/options.js";
const amountOption = amountOptionCreate("withdraw");
const recipientOption = recipientOptionCreate("L1");
@@ -135,7 +135,7 @@ export const handler = async (options: WithdrawOptions) => {
};
Program.command("withdraw")
- .description("Withdraw ETH from L2 to L1")
+ .description("Transfer ETH from L2 to L1")
.addOption(amountOption)
.addOption(chainOption)
.addOption(recipientOption)
diff --git a/src/commands/create/command.ts b/src/commands/create/command.ts
new file mode 100644
index 00000000..b52074c2
--- /dev/null
+++ b/src/commands/create/command.ts
@@ -0,0 +1,3 @@
+import Program from "../../program.js";
+
+export default Program.command("create").description("Scaffold new project for zkSync");
diff --git a/src/commands/create-project.ts b/src/commands/create/create.ts
similarity index 81%
rename from src/commands/create-project.ts
rename to src/commands/create/create.ts
index 48e0d3eb..019ecb23 100644
--- a/src/commands/create-project.ts
+++ b/src/commands/create/create.ts
@@ -2,14 +2,14 @@ import { Option } from "commander";
import inquirer from "inquirer";
import path from "path";
-import { zeekOption } from "../common/options.js";
-import Program from "../program.js";
-import { track } from "../utils/analytics.js";
-import { optionNameToParam, executeCommand } from "../utils/helpers.js";
-import Logger from "../utils/logger.js";
-import zeek from "../utils/zeek.js";
+import Program from "./command.js";
+import { zeekOption } from "../../common/options.js";
+import { track } from "../../utils/analytics.js";
+import { optionNameToParam, executeCommand } from "../../utils/helpers.js";
+import Logger from "../../utils/logger.js";
+import zeek from "../../utils/zeek.js";
-import type { DefaultOptions } from "../common/options.js";
+import type { DefaultOptions } from "../../common/options.js";
const templates = [
{
@@ -39,7 +39,7 @@ export const handler = async (folderName: string, options: CreateOptions) => {
...options,
folderName,
};
- Logger.debug(`Initial create-project options: ${JSON.stringify(options, null, 2)}`);
+ Logger.debug(`Initial create project options: ${JSON.stringify(options, null, 2)}`);
const answers: CreateOptions = await inquirer.prompt(
[
@@ -59,7 +59,7 @@ export const handler = async (folderName: string, options: CreateOptions) => {
...answers,
};
- Logger.debug(`Final create-project options: ${JSON.stringify(options, null, 2)}`);
+ Logger.debug(`Final create project options: ${JSON.stringify(options, null, 2)}`);
const template = templates.find((e) => e.value === options.template)!;
@@ -95,9 +95,9 @@ Read the ${path.join(options.folderName!, "README.md")} file to learn more.
}
};
-Program.command("create-project")
+Program.command("project")
+ .description("Initiate a project using a template in the chosen folder")
.argument("", "Folder name to create project in")
- .description("Creates project from template in the specified folder")
.addOption(templateOption)
.addOption(zeekOption)
.action(handler);
diff --git a/src/commands/create/index.ts b/src/commands/create/index.ts
new file mode 100644
index 00000000..b8bbf9fe
--- /dev/null
+++ b/src/commands/create/index.ts
@@ -0,0 +1,3 @@
+import "./create.js";
+
+import "./command.js"; // registers all the commands above
diff --git a/src/commands/dev/clean.ts b/src/commands/dev/clean.ts
index 67d5ba49..8cee763a 100644
--- a/src/commands/dev/clean.ts
+++ b/src/commands/dev/clean.ts
@@ -31,4 +31,4 @@ export const handler = async () => {
}
};
-Program.command("clean").description("Cleans data for all config modules").action(handler);
+Program.command("clean").description("Clean data for all config modules").action(handler);
diff --git a/src/commands/dev/command.ts b/src/commands/dev/command.ts
index ef05a28f..119a79f0 100644
--- a/src/commands/dev/command.ts
+++ b/src/commands/dev/command.ts
@@ -1,3 +1,3 @@
import Program from "../../program.js";
-export default Program.command("dev").description("All-in-one tool for local zkSync development");
+export default Program.command("dev").description("Manage local zkSync development environment");
diff --git a/src/commands/dev/install.ts b/src/commands/dev/install.ts
index 9ab96d04..a632fb16 100644
--- a/src/commands/dev/install.ts
+++ b/src/commands/dev/install.ts
@@ -31,7 +31,7 @@ export const handler = async (moduleNames: string[], options: { link: boolean })
Program.command("install")
.alias("i")
- .argument("[module...]", "NPM package name of the module to install")
.description("Install module with NPM")
+ .argument("", "NPM package name of the module to install")
.addOption(linkOption)
.action(handler);
diff --git a/src/commands/dev/logs.ts b/src/commands/dev/logs.ts
index 7ee587da..0396fefd 100644
--- a/src/commands/dev/logs.ts
+++ b/src/commands/dev/logs.ts
@@ -38,4 +38,4 @@ export const handler = async () => {
}
};
-Program.command("logs").description("Displays logs for configured modules").action(handler);
+Program.command("logs").description("Show logs for configured modules").action(handler);
diff --git a/src/commands/dev/modules/index.ts b/src/commands/dev/modules/index.ts
index 6221ecc9..4f0dc030 100644
--- a/src/commands/dev/modules/index.ts
+++ b/src/commands/dev/modules/index.ts
@@ -34,4 +34,4 @@ export const handler = async () => {
}
};
-Program.command("modules").description("Displays list of installed modules").action(handler);
+Program.command("modules").description("List currently installed modules").action(handler);
diff --git a/src/commands/dev/restart.ts b/src/commands/dev/restart.ts
index 6b0fe0d6..57f8b347 100644
--- a/src/commands/dev/restart.ts
+++ b/src/commands/dev/restart.ts
@@ -15,4 +15,4 @@ export const handler = async () => {
}
};
-Program.command("restart").description("Restarts the local zkSync environment and modules").action(handler);
+Program.command("restart").description("Restart local zkSync environment and modules").action(handler);
diff --git a/src/commands/dev/start.ts b/src/commands/dev/start.ts
index 52aa98ff..2eefccf4 100644
--- a/src/commands/dev/start.ts
+++ b/src/commands/dev/start.ts
@@ -59,6 +59,15 @@ const checkForUpdates = async (modules: Module[]) => {
str += chalk.gray(` - zksync-cli dev update ${module.package.name}`);
Logger.info(str);
}
+ if (modulesRequiringUpdates.length > 1) {
+ Logger.info(
+ chalk.gray(
+ `Update all modules: zksync-cli dev update ${modulesRequiringUpdates
+ .map(({ module }) => module.package.name)
+ .join(" ")}`
+ )
+ );
+ }
};
const showStartupInfo = async (modules: Module[]) => {
@@ -106,4 +115,4 @@ export const handler = async () => {
}
};
-Program.command("start").description("Starts the local zkSync environment and modules").action(handler);
+Program.command("start").description("Start local zkSync environment and modules").action(handler);
diff --git a/src/commands/dev/stop.ts b/src/commands/dev/stop.ts
index de888a5a..a946fbc4 100644
--- a/src/commands/dev/stop.ts
+++ b/src/commands/dev/stop.ts
@@ -15,4 +15,4 @@ export const handler = async () => {
}
};
-Program.command("stop").description("Stops the local zkSync environment and modules").action(handler);
+Program.command("stop").description("Stop local zkSync environment and modules").action(handler);
diff --git a/src/commands/dev/uninstall.ts b/src/commands/dev/uninstall.ts
index a309a983..8068b56d 100644
--- a/src/commands/dev/uninstall.ts
+++ b/src/commands/dev/uninstall.ts
@@ -39,7 +39,7 @@ export const handler = async (moduleNames: string[], options: { unlink: boolean
};
Program.command("uninstall")
- .argument("[module...]", "NPM package name of the module to uninstall")
.description("Uninstall module with NPM")
+ .argument("", "NPM package name of the module to uninstall")
.addOption(unlinkOption)
.action(handler);
diff --git a/src/commands/dev/update.ts b/src/commands/dev/update.ts
index d999a949..5f997b8b 100644
--- a/src/commands/dev/update.ts
+++ b/src/commands/dev/update.ts
@@ -1,3 +1,4 @@
+import chalk from "chalk";
import { Option } from "commander";
import Program from "./command.js";
@@ -8,8 +9,10 @@ import { executeCommand } from "../../utils/helpers.js";
import Logger from "../../utils/logger.js";
const packageOption = new Option("--package", "Update NPM package instead of module");
+const forceOption = new Option("--force", "Force update module (skip version check)");
type ModuleUpdateOptions = {
+ force?: boolean;
package?: boolean;
};
@@ -37,10 +40,13 @@ export const handler = async (moduleNames: string[], options: ModuleUpdateOption
const currentVersion = module.version;
const latestVersion = await module.getLatestVersion();
- if (currentVersion === latestVersion) {
- Logger.info(`Module "${moduleName}" is already up to date`);
- continue;
- } else if (!latestVersion) {
+ if (!options.force) {
+ if (currentVersion === latestVersion) {
+ Logger.warn(`Module "${moduleName}" is already up to date`);
+ continue;
+ }
+ }
+ if (!latestVersion) {
Logger.error(`Latest version wasn't found for module "${moduleName}"`);
continue;
}
@@ -56,6 +62,8 @@ export const handler = async (moduleNames: string[], options: ModuleUpdateOption
}
}
}
+
+ Logger.info(`\nTo make sure changes are applied use: \`${chalk.magentaBright("zksync-cli dev start")}\``);
} catch (error) {
Logger.error("There was an error while updating module:");
Logger.error(error);
@@ -64,7 +72,8 @@ export const handler = async (moduleNames: string[], options: ModuleUpdateOption
};
Program.command("update")
- .argument("[module...]", "NPM package name of the module to update")
- .description("Update installed module")
+ .description("Update module version")
+ .argument("", "NPM package name of the module to update")
+ .addOption(forceOption)
.addOption(packageOption)
.action(handler);
diff --git a/src/index.ts b/src/index.ts
index 32583f07..2a37bec9 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -2,9 +2,9 @@
import Program from "./program.js";
import "./commands/dev/index.js";
-import "./commands/deposit.js";
-import "./commands/withdraw.js";
-import "./commands/withdraw-finalize.js";
-import "./commands/create-project.js";
+
+import "./commands/bridge/index.js";
+
+import "./commands/create/index.js";
Program.parse();
diff --git a/zksync-cli-banner.png b/zkcli-banner.png
similarity index 100%
rename from zksync-cli-banner.png
rename to zkcli-banner.png