commands to scaffold JS
Description
Rails has some good scaffold
commands for adding new things or for adding tests to existing ones.
Proposal
I would mainly like equivalent of scaffold -s
to create a test for an existing folder.
Links / references
Documentation blurb
Overview
What is it? Why should someone use this feature?
The first few changes to a JS file are usually the same.
What is the underlying (business) problem?
Creating boilerplate doesn't take much time, but doing it repeatedly means ongoing wasted time, room for code-style inconsistencies, or things getting missed or skipped. An example of this issue is some of our Vue components were a lot of DOM is shoved into the same template.
How do you use this feature?
To add a new vue component, run yarn generate component diff_notes/jump_to_discussion.js
. This will generate an empty vue component exported from that path, and create test in spec/javascripts
directory.
Use cases
- Adding tests to existing component
- Adding new major component (incl. store, service, main component)
- Adding new child component (add js file + test)
Feature checklist
Make sure these are completed before closing the issue, with a link to the relevant commit.
-
Feature assurance -
Documentation -
Added to features.yml