inkdevhub / swanky-cli

The all-in-one developer environment for Parity pallet-contracts based smart contracts!
https://docs.astar.network/docs/build/wasm/swanky-suite/cli/
MIT License
70 stars 29 forks source link

Feature/init convert #136

Closed codespool closed 1 year ago

codespool commented 1 year ago

Main feature is introducing a --convert flag to init command. (#111 ) Also handled are #113 and #83 .

Some changes to how init works are introduced:

To test:

Note: the converted project is not expected to work out-of-the-box when converted, but should require minimum adjustments.

codespool commented 1 year ago

What's the distinction between contractName and moduleName?

I noticed on imported contracts that directory name (used for contractName) is often different than [package] name = value. (used now for moduleName) Typechain used that package name value when creating it's directory structure and file names, so bugs were popping up when contactName was used in constructing the paths for artifacts, tests etc. I believe that was also the cause of some of the bugs reported.

shunsukew commented 1 year ago

What's the distinction between contractName and moduleName?

I noticed on imported contracts that directory name (used for contractName) is often different than [package] name = value. (used now for moduleName) Typechain used that package name value when creating it's directory structure and file names, so bugs were popping up when contactName was used in constructing the paths for artifacts, tests etc. I believe that was also the cause of some of the bugs reported.

I see, And when user name contract with Camel case, compile fails, this should be fixed in future PRs https://github.com/AstarNetwork/swanky-cli/issues/151

codespool commented 1 year ago

Oh, this is actually a bug in this PR, good catch! When generated, the moduleName should be snake_case. I'll fix it right away. (that'll close #151 )