-
Notifications
You must be signed in to change notification settings - Fork 20
/
plopfile.mjs
36 lines (33 loc) · 1.8 KB
/
plopfile.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import promptDirectory from 'inquirer-directory';
import { customHookGeneratorDescription, customHookGenerator } from './plop/generators/customHook.mjs';
import {
reactAppComponentGeneratorDescription,
reactAppComponentGenerator,
} from './plop/generators/reactAppComponent.mjs';
import {
reactUiComponentGeneratorDescription,
reactUiComponentGenerator,
} from './plop/generators/reactUiComponent.mjs';
import {
reactContainerComponentGeneratorDescription,
reactContainerComponentGenerator,
} from './plop/generators/reactContainerComponent.mjs';
import {
apiActionsCollectionGeneratorDescription,
apiActionsCollectionGenerator,
} from './plop/generators/apiActionsCollection.mjs';
import { apiQueryGeneratorDescription, apiQueryGenerator } from './plop/generators/apiQuery.mjs';
import { apiMutationGeneratorDescription, apiMutationGenerator } from './plop/generators/apiMutation.mjs';
import { reactContextGeneratorDescription, reactContextGenerator } from './plop/generators/reactContext.mjs';
export default function (plop) {
const toKebabCase = plop.getHelper('kebabCase');
plop.setPrompt('directory', promptDirectory);
plop.setGenerator(reactAppComponentGeneratorDescription, reactAppComponentGenerator);
plop.setGenerator(reactContainerComponentGeneratorDescription, reactContainerComponentGenerator);
plop.setGenerator(reactUiComponentGeneratorDescription, reactUiComponentGenerator);
plop.setGenerator(customHookGeneratorDescription, customHookGenerator);
plop.setGenerator(apiActionsCollectionGeneratorDescription, apiActionsCollectionGenerator);
plop.setGenerator(apiQueryGeneratorDescription, apiQueryGenerator(toKebabCase));
plop.setGenerator(apiMutationGeneratorDescription, apiMutationGenerator(toKebabCase));
plop.setGenerator(reactContextGeneratorDescription, reactContextGenerator);
}