lorawan-stack icon indicating copy to clipboard operation
lorawan-stack copied to clipboard

Add redux store primitives generator tool

Open kschiffer opened this issue 3 months ago • 0 comments

Summary

This PR adds a tooling script that can generate redux store primitives.

➜  lorawan-stack git:(feature/console-search) ✗ node tools/js/index.js
? Select a tool to run: Generate Redux Files
? Enter the name of the store file: (eg. device) top-entities
? Enter the base name for the action: (eg. getDevice) getTopEntities
? Which files do you want to generate? actions, reducers, selectors, middleware
File created: pkg/webui/console/store/actions/top-entities.js
File created: pkg/webui/console/store/reducers/top-entities.js
File created: pkg/webui/console/store/selectors/top-entities.js
File created: pkg/webui/console/store/middleware/logics/top-entities.js
? Please check the files. If there is an issue, you can choose to undo the changes.
Do you want to undo? No

Changes

  • Add general JS tooling scaffold
  • Add redux generator tool (as a first tool)

Testing

See the bash output above.

Notes for Reviewers

The idea is to use this also as ground work for other scripts we may want to add in the future to help us with repetitive tasks. So please feel free to extend and modify.

Checklist

  • [x] Scope: The referenced issue is addressed, there are no unrelated changes.
  • [x] Compatibility: The changes are backwards compatible with existing API, storage, configuration and CLI, according to the compatibility commitments in README.md for the chosen target branch.
  • [x] Documentation: Relevant documentation is added or updated.
  • [x] Testing: The steps/process to test this feature are clearly explained including testing for regressions.
  • [x] Infrastructure: If infrastructural changes (e.g., new RPC, configuration) are needed, a separate issue is created in the infrastructural repositories.
  • [x] Changelog: Significant features, behavior changes, deprecations and fixes are added to CHANGELOG.md.
  • [x] Commits: Commit messages follow guidelines in CONTRIBUTING.md, there are no fixup commits left.

kschiffer avatar May 14 '24 14:05 kschiffer