Skip to content

Commit 2298678

Browse files
copy files wip
1 parent e57f0c5 commit 2298678

File tree

2 files changed

+35
-23
lines changed

2 files changed

+35
-23
lines changed

src/generators/AngularGenerator.js

+32-22
Original file line numberDiff line numberDiff line change
@@ -86,43 +86,53 @@ export default class extends BaseGenerator {
8686
[
8787
`${dir}/assets`,
8888
`${dir}/utils`,
89-
`${dir}/app/components/${lc}`,
90-
`${dir}/app/components/common`,
91-
`${dir}/app/components/svg`,
89+
`${dir}/app/components/${lc}/create`,
90+
`${dir}/app/components/${lc}/edit`,
91+
`${dir}/app/components/${lc}/list`,
92+
`${dir}/app/components/${lc}/show`,
93+
`${dir}/app/components/common/delete`,
94+
`${dir}/app/components/common/form`,
95+
`${dir}/app/components/common/header`,
96+
`${dir}/app/components/common/sidebar`,
97+
`${dir}/app/components/common/table`,
98+
`${dir}/app/components/svg/list-svg`,
99+
`${dir}/app/components/svg/menu`,
92100
`${dir}/app/interface`,
93101
`${dir}/app/router`,
94102
`${dir}/app/service`,
95103
].forEach((dir) => this.createDir(dir, false));
96104

97105
//CREATE FILE
98106
[
99-
`${dir}/app/components/svg/list-svg/list-svg.component.svg`,
100-
`${dir}/app/components/svg/list-svg/list-svg.component.ts`,
101-
`${dir}/app/components/svg/menu/menu.component.svg`,
102-
`${dir}/app/components/svg/menu/menu.component.ts`,
103-
`${dir}/app/components/common/delete/delete.component.html`,
104-
`${dir}/app/components/common/delete/delete.component.ts`,
105-
`${dir}/app/components/common/form/form.component.html`,
106-
`${dir}/app/components/common/form/form.component.ts`,
107-
`${dir}/app/components/common/header/header.component.html`,
108-
`${dir}/app/components/common/header/header.component.ts`,
109-
`${dir}/app/components/common/sidebar/sidebar.component.html`,
110-
`${dir}/app/components/common/sidebar/sidebar.component.ts`,
111-
`${dir}/app/components/common/table/table.component.html`,
112-
`${dir}/app/app.component.html`,
113-
`${dir}/app/app.component.ts`,
114-
`${dir}/app/app.routes.ts`,
115-
].forEach((file) => this.createFile(file, file, context, false));
107+
"app/components/svg/list-svg/list-svg.component.svg",
108+
"app/components/svg/list-svg/list-svg.component.ts",
109+
"app/components/svg/menu/menu.component.svg",
110+
"app/components/svg/menu/menu.component.ts",
111+
"app/components/common/delete/delete.component.html",
112+
"app/components/common/delete/delete.component.ts",
113+
"app/components/common/form/form.component.html",
114+
"app/components/common/form/form.component.ts",
115+
"app/components/common/header/header.component.html",
116+
"app/components/common/header/header.component.ts",
117+
"app/components/common/sidebar/sidebar.component.html",
118+
"app/components/common/sidebar/sidebar.component.ts",
119+
120+
"app/app.component.html",
121+
"app/app.component.ts",
122+
"app/app.routes.ts",
123+
].forEach((file) =>
124+
this.createFile(file, `${dir}/${file}`, context, false)
125+
);
116126

117127
[
118-
`app/components/%s/create/create.component.html",
128+
"app/components/%s/create/create.component.html",
119129
"app/components/%s/create/create.component.ts",
120130
"app/components/%s/edit/edit.component.html",
121131
"app/components/%s/edit/edit.component.ts",
122132
"app/components/%s/list/list.component.html",
123133
"app/components/%s/list/list.component.ts",
124134
"app/components/%s/show/show.component.html",
125-
"app/components/%s/show/show.component.ts",`,
135+
"app/components/%s/show/show.component.ts",
126136
].forEach((file) => this.createFileFromPattern(file, dir, [lc], context));
127137
}
128138

src/generators/BaseGenerator.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export default class {
4444
context,
4545
templateValues = ["foo", "Foo"]
4646
) {
47-
console.log(dir);
4847
this.createFile(
4948
vsprintf(pattern, templateValues),
5049
vsprintf(`${dir}/${pattern}`, values),
@@ -53,6 +52,9 @@ export default class {
5352
}
5453

5554
createFile(template, dest, context = {}, warn = true) {
55+
console.table(this.templates);
56+
console.log("template ==>", template);
57+
console.log("dest ==>", dest);
5658
if (undefined === this.templates[template]) {
5759
console.log(
5860
`The template ${template} does not exists in the registered templates.`

0 commit comments

Comments
 (0)