This repository was archived by the owner on Dec 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathgenerate.js
89 lines (88 loc) · 2.56 KB
/
generate.js
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
const {generateTemplateFiles} = require('generate-template-files');
generateTemplateFiles([
// React
{
option: 'React Redux Store',
defaultCase: '(pascalCase)',
entry: {
folderPath: './tools/templates/react/redux-store/',
},
stringReplacers: ['__store__', '__model__'],
output: {
path: './src/stores/__store__(kebabCase)',
pathAndFileNameDefaultCase: '(pascalCase)',
},
},
{
option: 'React Component',
defaultCase: '(pascalCase)',
entry: {
folderPath: './tools/templates/react/component/',
},
stringReplacers: ['__name__'],
output: {
path: './src/views/components/__name__(kebabCase)',
pathAndFileNameDefaultCase: '(pascalCase)',
},
},
{
option: 'React Connected Component',
defaultCase: '(pascalCase)',
entry: {
folderPath: './tools/templates/react/connected-component/',
},
stringReplacers: ['__name__'],
output: {
path: './src/views/__name__(kebabCase)',
pathAndFileNameDefaultCase: '(pascalCase)',
},
},
{
option: 'Selector',
defaultCase: '(pascalCase)',
entry: {
folderPath: './tools/templates/react/selectors/',
},
stringReplacers: ['__name__'],
output: {
path: './src/selectors/__name__(kebabCase)',
pathAndFileNameDefaultCase: '(pascalCase)',
},
},
{
option: 'Model',
defaultCase: '(pascalCase)',
entry: {
folderPath: './tools/templates/react/__model__Model.ts',
},
stringReplacers: ['__model__'],
output: {
path: './src/models/__model__Model.ts',
pathAndFileNameDefaultCase: '(pascalCase)',
},
},
{
option: 'Interface',
defaultCase: '(pascalCase)',
entry: {
folderPath: './tools/templates/react/I__interface__.ts',
},
stringReplacers: ['__interface__'],
output: {
path: './src/models/I__interface__.ts',
pathAndFileNameDefaultCase: '(pascalCase)',
},
},
{
option: 'Enum',
defaultCase: '(pascalCase)',
entry: {
folderPath: './tools/templates/react/__enum__Enum.ts',
},
stringReplacers: ['__enum__'],
output: {
path: './src/constants/__enum__Enum.ts',
pathAndFileNameDefaultCase: '(pascalCase)',
},
},
]);