123456789101112131415161718192021222324252627282930313233343536 |
- const { notEmpty } = require('../utils.js');
- module.exports = {
- description: 'generate store',
- prompts: [
- {
- type: 'input',
- name: 'name',
- message: 'store name please',
- validate: notEmpty('name'),
- },
- ],
- actions(data) {
- const { name } = data;
- const actions = [
- {
- type: 'add',
- path: `src/store/modules/${name}/index.ts`,
- templateFile: 'plop-templates/store/index.hbs',
- data: {
- name,
- },
- },
- {
- type: 'add',
- path: `src/store/modules/${name}/types.ts`,
- templateFile: 'plop-templates/store/types.hbs',
- data: {
- name,
- },
- },
- ];
- return actions;
- },
- };
|