@@ -13,7 +13,16 @@ export default function generator(plop: PlopTypes.NodePlopAPI): void {
1313 {
1414 type : 'checkbox' ,
1515 name : 'modules' ,
16- choices : [ 'articles' , 'cms' , 'notifications' , 'organizations' , 'resources' , 'tickets' , 'users' , 'cache' ] ,
16+ choices : [
17+ 'articles' ,
18+ 'cms' ,
19+ 'notifications' ,
20+ 'organizations' ,
21+ 'resources' ,
22+ 'tickets' ,
23+ 'users' ,
24+ 'cache' ,
25+ ] ,
1726 message : 'Choose which modules you want to be included in the integration.' ,
1827 validate : ( input : string [ ] ) => ! ! input . length ,
1928 } ,
@@ -22,47 +31,47 @@ export default function generator(plop: PlopTypes.NodePlopAPI): void {
2231 const actions : PlopTypes . ActionType [ ] = [
2332 {
2433 type : 'add' ,
25- path : 'packages/api/ integrations/{{kebabCase name}}/package.json' ,
34+ path : 'packages/integrations/{{kebabCase name}}/package.json' ,
2635 templateFile : 'templates/integration/package.hbs' ,
2736 } ,
2837 {
2938 type : 'add' ,
30- path : 'packages/api/ integrations/{{kebabCase name}}/tsconfig.json' ,
39+ path : 'packages/integrations/{{kebabCase name}}/tsconfig.json' ,
3140 templateFile : 'templates/integration/tsconfig.hbs' ,
3241 } ,
3342 {
3443 type : 'add' ,
35- path : 'packages/api/ integrations/{{kebabCase name}}/tsconfig.lint.json' ,
44+ path : 'packages/integrations/{{kebabCase name}}/tsconfig.lint.json' ,
3645 templateFile : 'templates/integration/tsconfig.lint.hbs' ,
3746 } ,
3847 {
3948 type : 'add' ,
40- path : 'packages/api/ integrations/{{kebabCase name}}/turbo.json' ,
49+ path : 'packages/integrations/{{kebabCase name}}/turbo.json' ,
4150 templateFile : 'templates/integration/turbo.hbs' ,
4251 } ,
4352 {
4453 type : 'add' ,
45- path : 'packages/api/ integrations/{{kebabCase name}}/.eslintrc.js' ,
54+ path : 'packages/integrations/{{kebabCase name}}/.eslintrc.js' ,
4655 templateFile : 'templates/integration/eslintrc.hbs' ,
4756 } ,
4857 {
4958 type : 'add' ,
50- path : 'packages/api/ integrations/{{kebabCase name}}/.gitignore' ,
59+ path : 'packages/integrations/{{kebabCase name}}/.gitignore' ,
5160 templateFile : 'templates/integration/gitignore.hbs' ,
5261 } ,
5362 {
5463 type : 'add' ,
55- path : 'packages/api/ integrations/{{kebabCase name}}/.prettierrc.mjs' ,
64+ path : 'packages/integrations/{{kebabCase name}}/.prettierrc.mjs' ,
5665 templateFile : 'templates/integration/prettierrc.hbs' ,
5766 } ,
5867 {
5968 type : 'add' ,
60- path : 'packages/api/ integrations/{{kebabCase name}}/src/integration.ts' ,
69+ path : 'packages/integrations/{{kebabCase name}}/src/integration.ts' ,
6170 templateFile : 'templates/integration/integration.hbs' ,
6271 } ,
6372 {
6473 type : 'add' ,
65- path : 'packages/api/ integrations/{{kebabCase name}}/src/modules/index.ts' ,
74+ path : 'packages/integrations/{{kebabCase name}}/src/modules/index.ts' ,
6675 template : '// MODULE_EXPORTS' ,
6776 } ,
6877 ] ;
@@ -77,46 +86,46 @@ export default function generator(plop: PlopTypes.NodePlopAPI): void {
7786 actions . push (
7887 {
7988 type : 'add' ,
80- path : `packages/api/ integrations/{{kebabCase name}}/src/modules/{{kebabCase module}}/index.ts` ,
89+ path : `packages/integrations/{{kebabCase name}}/src/modules/{{kebabCase module}}/index.ts` ,
8190 templateFile : 'templates/integration/module-index.hbs' ,
8291 data : { module } ,
8392 } ,
8493 {
8594 type : 'add' ,
86- path : `packages/api/ integrations/{{kebabCase name}}/src/modules/{{kebabCase module}}/{{kebabCase module}}.service.ts` ,
95+ path : `packages/integrations/{{kebabCase name}}/src/modules/{{kebabCase module}}/{{kebabCase module}}.service.ts` ,
8796 templateFile : 'templates/integration/service.hbs' ,
8897 data : { module } ,
8998 } ,
9099 {
91100 type : 'add' ,
92- path : `packages/api/ integrations/{{kebabCase name}}/src/modules/{{kebabCase module}}/{{kebabCase module}}.controller.ts` ,
101+ path : `packages/integrations/{{kebabCase name}}/src/modules/{{kebabCase module}}/{{kebabCase module}}.controller.ts` ,
93102 templateFile : 'templates/integration/controller.hbs' ,
94103 data : { module } ,
95104 } ,
96105 {
97106 type : 'add' ,
98- path : `packages/api/ integrations/{{kebabCase name}}/src/modules/{{kebabCase module}}/mappers/index.ts` ,
107+ path : `packages/integrations/{{kebabCase name}}/src/modules/{{kebabCase module}}/mappers/index.ts` ,
99108 templateFile : 'templates/integration/mappers-index.hbs' ,
100109 data : { module } ,
101110 } ,
102111 {
103112 type : 'modify' ,
104- path : 'packages/api/ integrations/{{kebabCase name}}/src/modules/index.ts' ,
113+ path : 'packages/integrations/{{kebabCase name}}/src/modules/index.ts' ,
105114 pattern : / ( \/ \/ M O D U L E _ E X P O R T S ) / g,
106115 templateFile : 'templates/integration/modules-index.hbs' ,
107116 data : { module } ,
108117 } ,
109118 {
110119 type : 'modify' ,
111- path : 'packages/api/ integrations/{{kebabCase name}}/src/integration.ts' ,
120+ path : 'packages/integrations/{{kebabCase name}}/src/integration.ts' ,
112121 pattern : / ( \/ \/ M O D U L E _ I M P O R T S ) / g,
113122 template :
114123 "import { Service as {{ pascalCase module }}Service } from './modules/{{kebabCase module}}';\n// MODULE_IMPORTS" ,
115124 data : { module } ,
116125 } ,
117126 {
118127 type : 'modify' ,
119- path : 'packages/api/ integrations/{{kebabCase name}}/src/integration.ts' ,
128+ path : 'packages/integrations/{{kebabCase name}}/src/integration.ts' ,
120129 pattern : / ( \/ \/ M O D U L E _ E X P O R T S ) / g,
121130 template :
122131 ' {{ camelCase module }}: {\n' +
0 commit comments