Gum-Joe / 2Keys

A easy to setup second keyboard, designed for everyone.
GNU General Public License v3.0
11 stars 4 forks source link

V1.0.0 CU-5wt3mp commands base structure #77

Closed Gum-Joe closed 4 years ago

Gum-Joe commented 4 years ago

This PR adds the base structure for commands, that is discrete chunks of logic that are shared by the CLI and GUI.

The main focus here is to create @twokeys/commandex, which helps generate command factories from our commands so that they are all in one place and instance of TwoKeys objects can easily be passed through to commands without having to manually create an instance every time a command is called.

The main focus of this PR is to create the base structure that will allow us to write both stateless and stateful commands in @twokeys/common-hi (see @twokeys/common-hi/src/common/), as well as run them using a custom TwoKeys object provided by the GUI or CLI.

Gum-Joe commented 4 years ago

Task linked: CU-5wt3mp Commands: base structure

codecov[bot] commented 4 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (v1@7bb472e). Click here to learn what that means. The diff coverage is 100.00%.

Impacted file tree graph

@@          Coverage Diff          @@
##             v1      #77   +/-   ##
=====================================
  Coverage      ?   91.35%           
=====================================
  Files         ?       28           
  Lines         ?     1284           
  Branches      ?      209           
=====================================
  Hits          ?     1173           
  Misses        ?      111           
  Partials      ?        0           
Impacted Files Coverage Δ
...s/@twokeys/addons/src/module-interfaces/twokeys.ts 100.00% <100.00%> (ø)
...ges/@twokeys/common-hi/src/common/base-commands.ts 100.00% <100.00%> (ø)
...s/@twokeys/common-hi/src/common/command-factory.ts 100.00% <100.00%> (ø)
packages/@twokeys/common-hi/src/common/twokeys.ts 100.00% <100.00%> (ø)
...twokeys/server/src/oobe/software/zip-downloader.ts 84.74% <0.00%> (ø)
packages/@twokeys/server/src/util/logger.ts 100.00% <0.00%> (ø)
packages/@twokeys/core/src/constants.ts 100.00% <0.00%> (ø)
packages/@twokeys/addons/src/util/constants.ts 100.00% <0.00%> (ø)
packages/@twokeys/addons/src/util/interfaces.ts 100.00% <0.00%> (ø)
packages/@twokeys/server/src/util/config.ts 90.00% <0.00%> (ø)
... and 22 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7bb472e...4879104. Read the comment docs.

Gum-Joe commented 4 years ago

Note to reviewer: DO NOT MEREG THIS if commandex package is still there. Also don't merge if checks are failing ofc

Gum-Joe commented 4 years ago

Note: I've decided not to export everything in index.ts, given how much is in this dir, please require directories directly.

If the reviewer disagrees with this, please mark this in src/index.ts

ILikeTeaALot commented 4 years ago

Note: I've decided not to export everything in index.ts, given how much is in this dir, please require directories directly.

If the reviewer disagrees with this, please mark this in src/index.ts

this is ok by me!