nuxtapose is in alpha and may be unstable or changing
nuxtapose is a cli designed to do the repetitive work of Nuxt development for you.
# Create a new component file at 'log-details/log-info.vue' and a corresponding spec file
nuxtapose generate component log-details/log-info
# Generate a new page file at 'pages/faq.vue' and a corresponding spec file
nuxtapose generate page faq
# Generate a new vuex store file at `store/users.ts` and a corresponding spec file
nuxtapose generate vuex usersnpm install -g nuxtaposenuxtapose can be configured via a .nuxtaposerc.json in the projects root directory. nuxtapose will also run a configuration wizard if it is run in a project without a .nuxtaposerc.json
{
// Required Configuration
"component": "class-based | options-api",
"vuex": "modules | class-based",
"module": "modules", // More options coming soon (tm)
// Optional Configuration
"confirmChanges": "never | overwrite-only | always",
"reportLevel": "all | completed-only | none",
}componentclass-based: generate components using the class based patternoptions-api: generate components using the options api
vuexmodules: generate store files using GetterTree, ActionTree, and MutationTreeclass-based: Currently unsupported
modulemodules: Generate a store as a module using GetterTree, ActionTree, and MutationTree
confirmChanges- Defaultoverwrite-onlynever: never ask for confirmation before taking an actionoverwrite-only: ask for confirmation if the action will overwrite a filealways: ask for confirmation before any action
reportLevel- Defaultallall: include all events in the run reportcompleted-only: only show events for actions that were completednone: do not generate an after run report
--debug, -d- increases verbosity of logging
--quiet, -q- supress all logs and after run reports
--verbose, -v- equal to
--debugand"reportLevel": "all"
- equal to
Generate a new templated file. This is similar to the ng generate command.
nuxtapose generate|g <template-type> <output-path>output-path should not include the base output directory of the template. Output Paths with a trailing slash (i.e. dir/my-component/) will create a sub-directory of the same name containing the generated files:
components/
- dir/
- my-component/
- my-component.vue
- my-component.spec.ts
nuxtapose currently only supports Typescript projects, Javascript support is coming soon
| template | output dir | file type | notes |
|---|---|---|---|
c|component |
components/ |
vue | |
p|page |
pages/ |
vue | |
l|layout |
layouts/ |
vue | Adds layout suffix to provided name |
v|vuex |
store/ |
TS/JS | |
mod|module |
store/<name>/ |
TS/JS | Generates a file each for getters, setters, actions, and state |
--confirm, -c- equivalent to using
"confirmChanges": "all"
- equivalent to using
Features that I am hoping to implement in the near future:
- custom templates
- storybook story templating for components
- javascript templates
- middleware templates
- programmatic API