diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index eb806c15..c34e3ef1 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,6 @@ { "name": "swanky-env", - "image": "ghcr.io/astarnetwork/swanky-cli/swanky-base:swanky3.0.4_v2.0.3", + "image": "ghcr.io/swankyhub/swanky-cli/swanky-base:swanky3.1.0-beta.0_v2.1.0", // Mount the workspace volume "mounts": ["source=${localWorkspaceFolder},target=/workspaces,type=bind,consistency=cached"], diff --git a/.eslintignore b/.eslintignore index 5d53074d..d05306cd 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,4 @@ /dist src/templates +/temp* +tmp \ No newline at end of file diff --git a/.eslintrc b/.eslintrc index b5850dc4..f08f97eb 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,9 +1,27 @@ { "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "./tsconfig.json" + }, "plugins": ["@typescript-eslint", "prettier"], - "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-type-checked", + "plugin:@typescript-eslint/stylistic-type-checked", + "prettier" + ], "rules": { + "no-throw-literal": "off", "@typescript-eslint/ban-ts-comment": "off", - "@typescript-eslint/no-explicit-any": "off" + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unsafe-call": "off", + "@typescript-eslint/no-unsafe-member-access": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-unsafe-return": "off", + "@typescript-eslint/no-unsafe-argument": "off", + "@typescript-eslint/no-misused-promises": "off", + "@typescript-eslint/no-floating-promises": "off", + "@typescript-eslint/require-await": "off" } } diff --git a/README.md b/README.md index 9dad44f3..51a6b4e4 100644 --- a/README.md +++ b/README.md @@ -187,7 +187,7 @@ $ npm install -g @astar-network/swanky-cli $ swanky COMMAND running command... $ swanky (--version|-V|-v) -@astar-network/swanky-cli/3.0.4 darwin-x64 node-v19.9.0 +@astar-network/swanky-cli/3.1.0-beta.0 darwin-x64 node-v20.2.0 $ swanky --help [COMMAND] USAGE $ swanky COMMAND @@ -230,11 +230,12 @@ Create a new dev account in config ``` USAGE - $ swanky account create [-g] [-d] + $ swanky account create [-v] [-g] [-d] FLAGS -d, --dev -g, --generate + -v, --verbose Display more info in the result logs DESCRIPTION Create a new dev account in config @@ -246,7 +247,10 @@ List dev accounts stored in config ``` USAGE - $ swanky account list + $ swanky account list [-v] + +FLAGS + -v, --verbose Display more info in the result logs DESCRIPTION List dev accounts stored in config @@ -261,7 +265,10 @@ List dev accounts stored in config ``` USAGE - $ swanky account ls + $ swanky account ls [-v] + +FLAGS + -v, --verbose Display more info in the result logs DESCRIPTION List dev accounts stored in config @@ -276,13 +283,16 @@ Check installed package versions and compatibility ``` USAGE - $ swanky check + $ swanky check [-v] + +FLAGS + -v, --verbose Display more info in the result logs DESCRIPTION Check installed package versions and compatibility ``` -_See code: [dist/commands/check/index.ts](https://github.com/AstarNetwork/swanky-cli/blob/v3.0.4/dist/commands/check/index.ts)_ +_See code: [dist/commands/check/index.ts](https://github.com/AstarNetwork/swanky-cli/blob/v3.1.0-beta.0/dist/commands/check/index.ts)_ ## `swanky contract compile [CONTRACTNAME]` @@ -298,7 +308,7 @@ ARGUMENTS FLAGS -a, --all Set all to true to compile all contracts -r, --release A production contract should always be build in `release` mode for building optimized wasm - -v, --verbose Display additional compilation output + -v, --verbose Display more info in the result logs DESCRIPTION Compile the smart contract(s) in your contracts directory @@ -310,7 +320,7 @@ Deploy contract to a running node ``` USAGE - $ swanky contract deploy CONTRACTNAME --account [-g ] [-a ] [-c ] [-n ] + $ swanky contract deploy CONTRACTNAME --account [-v] [-g ] [-a ] [-c ] [-n ] ARGUMENTS CONTRACTNAME Name of the contract to deploy @@ -320,6 +330,7 @@ FLAGS -c, --constructorName= [default: new] Constructor function name of a contract to deploy -g, --gas= -n, --network= Network name to connect to + -v, --verbose Display more info in the result logs --account= (required) Alias of account to be used DESCRIPTION @@ -350,7 +361,7 @@ Generate a new smart contract template inside a project ``` USAGE - $ swanky contract new CONTRACTNAME [--template blank|flipper|psp22] [-v] + $ swanky contract new CONTRACTNAME [-v] [--template blank|flipper|psp22] ARGUMENTS CONTRACTNAME Name of the new contract @@ -391,13 +402,14 @@ Run tests for a given contact ``` USAGE - $ swanky contract test [CONTRACTNAME] [-a] + $ swanky contract test [CONTRACTNAME] [-v] [-a] ARGUMENTS CONTRACTNAME Name of the contract to test FLAGS - -a, --all Set all to true to compile all contracts + -a, --all Set all to true to compile all contracts + -v, --verbose Display more info in the result logs DESCRIPTION Run tests for a given contact @@ -432,11 +444,14 @@ Generate types from compiled contract metadata ``` USAGE - $ swanky contract typegen CONTRACTNAME + $ swanky contract typegen CONTRACTNAME [-v] ARGUMENTS CONTRACTNAME Name of the contract +FLAGS + -v, --verbose Display more info in the result logs + DESCRIPTION Generate types from compiled contract metadata ``` @@ -459,7 +474,7 @@ DESCRIPTION Display help for swanky. ``` -_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.9/src/commands/help.ts)_ +_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.14/src/commands/help.ts)_ ## `swanky init PROJECTNAME` @@ -482,7 +497,7 @@ DESCRIPTION Generate a new smart contract environment ``` -_See code: [dist/commands/init/index.ts](https://github.com/AstarNetwork/swanky-cli/blob/v3.0.4/dist/commands/init/index.ts)_ +_See code: [dist/commands/init/index.ts](https://github.com/AstarNetwork/swanky-cli/blob/v3.1.0-beta.0/dist/commands/init/index.ts)_ ## `swanky node install` @@ -505,7 +520,10 @@ Purge local chain state ``` USAGE - $ swanky node purge + $ swanky node purge [-v] + +FLAGS + -v, --verbose Display more info in the result logs DESCRIPTION Purge local chain state @@ -517,12 +535,15 @@ Start a local node ``` USAGE - $ swanky node start [-t] [--rpcCors ] [--finalizeDelaySec ] + $ swanky node start [-v] [-t] [--rpcCors ] [--finalizeDelaySec ] FLAGS -t, --tmp Run node with non-persistent mode + -v, --verbose + Display more info in the result logs + --finalizeDelaySec= Delay time in seconds after blocks being sealed @@ -558,7 +579,7 @@ EXAMPLES $ swanky plugins ``` -_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.1.1/src/commands/plugins/index.ts)_ +_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.1.8/src/commands/plugins/index.ts)_ ## `swanky plugins:install PLUGIN...` @@ -791,5 +812,5 @@ FLAG DESCRIPTIONS Additionally shows the architecture, node version, operating system, and versions of plugins that the CLI is using. ``` -_See code: [@oclif/plugin-version](https://github.com/oclif/plugin-version/blob/v1.3.4/src/commands/version.ts)_ +_See code: [@oclif/plugin-version](https://github.com/oclif/plugin-version/blob/v1.3.7/src/commands/version.ts)_ diff --git a/backup/CLI_README.md b/backup/CLI_README.md deleted file mode 100644 index a4f1bad2..00000000 --- a/backup/CLI_README.md +++ /dev/null @@ -1,728 +0,0 @@ -# Swanky CLI - -[How to guide on Astar docs page](https://docs.astar.network/docs/wasm/sc-dev/swanky) - - - -- [Swanky CLI](#swanky-cli) -- [Usage](#usage) -- [Commands](#commands) -- [Config](#config) - - -# Usage - - - -```sh-session -$ npm install -g @astar-network/swanky-cli -$ swanky COMMAND -running command... -$ swanky (--version|-V|-v) -@astar-network/swanky-cli/2.2.3 darwin-x64 node-v18.2.0 -$ swanky --help [COMMAND] -USAGE - $ swanky COMMAND -... -``` - - - -# Commands - - - -- [`swanky account create`](#swanky-account-create) -- [`swanky account list`](#swanky-account-list) -- [`swanky account ls`](#swanky-account-ls) -- [`swanky check`](#swanky-check) -- [`swanky contract compile [CONTRACTNAME]`](#swanky-contract-compile-contractname) -- [`swanky contract deploy CONTRACTNAME`](#swanky-contract-deploy-contractname) -- [`swanky contract explain CONTRACTNAME`](#swanky-contract-explain-contractname) -- [`swanky contract new CONTRACTNAME`](#swanky-contract-new-contractname) -- [`swanky contract query CONTRACTNAME MESSAGENAME`](#swanky-contract-query-contractname-messagename) -- [`swanky contract test [CONTRACTNAME]`](#swanky-contract-test-contractname) -- [`swanky contract tx CONTRACTNAME MESSAGENAME`](#swanky-contract-tx-contractname-messagename) -- [`swanky contract typegen CONTRACTNAME`](#swanky-contract-typegen-contractname) -- [`swanky help [COMMANDS]`](#swanky-help-commands) -- [`swanky init PROJECTNAME`](#swanky-init-projectname) -- [`swanky node install`](#swanky-node-install) -- [`swanky node purge`](#swanky-node-purge) -- [`swanky node start`](#swanky-node-start) -- [`swanky plugins`](#swanky-plugins) -- [`swanky plugins:install PLUGIN...`](#swanky-pluginsinstall-plugin) -- [`swanky plugins:inspect PLUGIN...`](#swanky-pluginsinspect-plugin) -- [`swanky plugins:install PLUGIN...`](#swanky-pluginsinstall-plugin-1) -- [`swanky plugins:link PLUGIN`](#swanky-pluginslink-plugin) -- [`swanky plugins:uninstall PLUGIN...`](#swanky-pluginsuninstall-plugin) -- [`swanky plugins:uninstall PLUGIN...`](#swanky-pluginsuninstall-plugin-1) -- [`swanky plugins:uninstall PLUGIN...`](#swanky-pluginsuninstall-plugin-2) -- [`swanky plugins update`](#swanky-plugins-update) -- [`swanky version`](#swanky-version) - -## `swanky account create` - -Create a new dev account in config - -``` -USAGE - $ swanky account create [-g] [-d] - -FLAGS - -d, --dev - -g, --generate - -DESCRIPTION - Create a new dev account in config -``` - -## `swanky account list` - -List dev accounts stored in config - -``` -USAGE - $ swanky account list - -DESCRIPTION - List dev accounts stored in config - -ALIASES - $ swanky account ls -``` - -## `swanky account ls` - -List dev accounts stored in config - -``` -USAGE - $ swanky account ls - -DESCRIPTION - List dev accounts stored in config - -ALIASES - $ swanky account ls -``` - -## `swanky check` - -Check installed package versions and compatibility - -``` -USAGE - $ swanky check - -DESCRIPTION - Check installed package versions and compatibility -``` - -_See code: [dist/commands/check/index.js](https://github.com/AstarNetwork/swanky-cli/blob/v2.2.3/dist/commands/check/index.js)_ - -## `swanky contract compile [CONTRACTNAME]` - -Compile the smart contract(s) in your contracts directory - -``` -USAGE - $ swanky contract compile [CONTRACTNAME] [-v] [-r] [-a] - -ARGUMENTS - CONTRACTNAME Name of the contract to compile - -FLAGS - -a, --all Set all to true to compile all contracts - -r, --release A production contract should always be build in `release` mode for building optimized wasm - -v, --verbose Display additional compilation output - -DESCRIPTION - Compile the smart contract(s) in your contracts directory -``` - -## `swanky contract deploy CONTRACTNAME` - -Deploy contract to a running node - -``` -USAGE - $ swanky contract deploy CONTRACTNAME --account -g [-a ] [-c ] [-n ] - -ARGUMENTS - CONTRACTNAME Name of the contract to deploy - -FLAGS - -a, --args=... - -c, --constructorName= [default: new] Constructor function name of a contract to deploy - -g, --gas= (required) - -n, --network= Network name to connect to - --account= (required) Alias of account to be used - -DESCRIPTION - Deploy contract to a running node -``` - -## `swanky contract explain CONTRACTNAME` - -Explain contract messages based on the contracts' metadata - -``` -USAGE - $ swanky contract explain CONTRACTNAME [-v] - -ARGUMENTS - CONTRACTNAME Name of the contract - -FLAGS - -v, --verbose Display more info in the result logs - -DESCRIPTION - Explain contract messages based on the contracts' metadata -``` - -## `swanky contract new CONTRACTNAME` - -Generate a new smart contract template inside a project - -``` -USAGE - $ swanky contract new CONTRACTNAME [--template blank|erc20token|flipper|blank|flipper|psp22] [-l ink|ask] [-v] - -ARGUMENTS - CONTRACTNAME Name of the new contract - -FLAGS - -l, --language=