Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clients/js/refactor cmds & CLI docs generator #3182

Merged
merged 28 commits into from
Jul 17, 2023

Conversation

AlberErre
Copy link
Contributor

ℹ️ This PR exposes all CLI commands modules into a constant array called CLI_COMMAND_MODULES.

Looks like all commands can be imported into a singe .command() call 👀, if we export these commands as a JS module 🎉

More info about this approach can be found on the official documentation.

This refactor is needed to provide a single source of truth for all CLI commands. By this approach, we would be able to implement testing on CLI commands against auto-generated documentation, as pointed out here -> #2631 (comment)

Also, this PR refactors clients/js/src/doc.ts documentation generator:

  • A default english locale has been added (without this, documentation is generated on the language of the OS machine, it was generated in spanish in my case).
  • CLI_COMMAND_MODULES variable has been used to derive commands. This avoids maintaining multiple commands lists over the CLI, now we have a single source of truth.

@AlberErre
Copy link
Contributor Author

@aadam-10 @kcsongor @evan-gray @a5-pickle @heyitaki

just created this MR to extract the refactor done on #2631 regarding cmds modules & auto-generated documentation 👀

This way is easier to review 🎉🏄‍♂️

@evan-gray evan-gray requested a review from barnjamin July 9, 2023 12:54
@aadam-10 aadam-10 requested a review from heyitaki July 10, 2023 12:09
barnjamin
barnjamin previously approved these changes Jul 10, 2023
@AlberErre
Copy link
Contributor Author

@barnjamin just synced with main, and needed to solve some conflicts 👀

could you approve it again? ✅

thanks!

@AlberErre AlberErre requested a review from barnjamin July 12, 2023 22:40
@evan-gray evan-gray merged commit 8e0cf4c into wormhole-foundation:main Jul 17, 2023
bruce-riley pushed a commit that referenced this pull request Jul 17, 2023
* feat: update npm commands for Githun Actions CI

* feat: add worm cli github actions

* feat: save HTML test report as artifact

* chore: update github action, show report correctly

* fix: add missing CommandModule type

* chore: rm unused import

* fix: override auto-detected locale by OS system

* feat: infere command modules on doc.ts & main.ts

* feat: command args accepts an array of modules

* fix: cmds must be outside main, breaks otherwise

* fix: import CLI_COMMAND_MODULES outside of main

* chore: add missing transfer command from README

* chore: rm test branch dependencies

* feat: extract info cmds into array const

* chore: document command imports as list

* chore: package.json spacing

* chore: bump @types/yargs version

* feat: cast correct array type YargsCommandModule[]
panoel pushed a commit that referenced this pull request Jul 19, 2023
* feat: update npm commands for Githun Actions CI

* feat: add worm cli github actions

* feat: save HTML test report as artifact

* chore: update github action, show report correctly

* fix: add missing CommandModule type

* chore: rm unused import

* fix: override auto-detected locale by OS system

* feat: infere command modules on doc.ts & main.ts

* feat: command args accepts an array of modules

* fix: cmds must be outside main, breaks otherwise

* fix: import CLI_COMMAND_MODULES outside of main

* chore: add missing transfer command from README

* chore: rm test branch dependencies

* feat: extract info cmds into array const

* chore: document command imports as list

* chore: package.json spacing

* chore: bump @types/yargs version

* feat: cast correct array type YargsCommandModule[]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants