Skip to content

Commit ca929a1

Browse files
committed
chore: added template types
1 parent 48e6aff commit ca929a1

36 files changed

+284
-75
lines changed

src/command/GenerateAclXmlFileCommand.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
22
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
3+
import { TemplatePath } from 'types/handlebars';
34

45
export default class GenerateAclXmlFileCommand extends SimpleTemplateGeneratorCommand {
56
constructor() {
@@ -16,7 +17,7 @@ export default class GenerateAclXmlFileCommand extends SimpleTemplateGeneratorCo
1617
return `app/code/${vendor}/${module}/etc/acl.xml`;
1718
}
1819

19-
getTemplateName(data: TemplateWizardData): string {
20-
return 'xml/blank-acl';
20+
getTemplateName(data: TemplateWizardData): TemplatePath {
21+
return TemplatePath.XmlBlankAcl;
2122
}
2223
}

src/command/GenerateConfigXmlFileCommand.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
22
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
33
import FileHeader from 'common/xml/FileHeader';
4+
import { TemplatePath } from 'types/handlebars';
45

56
export default class GenerateConfigXmlFileCommand extends SimpleTemplateGeneratorCommand {
67
constructor() {
@@ -21,7 +22,7 @@ export default class GenerateConfigXmlFileCommand extends SimpleTemplateGenerato
2122
return `app/code/${vendor}/${module}/etc/config.xml`;
2223
}
2324

24-
getTemplateName(data: TemplateWizardData): string {
25-
return 'xml/blank-config';
25+
getTemplateName(data: TemplateWizardData): TemplatePath {
26+
return TemplatePath.XmlBlankConfig;
2627
}
2728
}

src/command/GenerateCrontabXmlCommand.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
22
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
33
import FileHeader from 'common/xml/FileHeader';
4+
import { TemplatePath } from 'types/handlebars';
45

56
export default class GenerateCrontabXmlCommand extends SimpleTemplateGeneratorCommand {
67
constructor() {
@@ -21,7 +22,7 @@ export default class GenerateCrontabXmlCommand extends SimpleTemplateGeneratorCo
2122
return `app/code/${vendor}/${module}/etc/crontab.xml`;
2223
}
2324

24-
getTemplateName(data: TemplateWizardData): string {
25-
return 'xml/blank-crontab';
25+
getTemplateName(data: TemplateWizardData): TemplatePath {
26+
return TemplatePath.XmlBlankCrontab;
2627
}
2728
}

src/command/GenerateDiXmlFileCommand.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { MagentoScope } from 'types/global';
22
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
33
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
4+
import { TemplatePath } from 'types/handlebars';
45

56
export default class GenerateDiXmlFileCommand extends SimpleTemplateGeneratorCommand {
67
constructor() {
@@ -33,7 +34,7 @@ export default class GenerateDiXmlFileCommand extends SimpleTemplateGeneratorCom
3334
return `app/code/${vendor}/${module}/etc/di.xml`;
3435
}
3536

36-
getTemplateName(data: TemplateWizardData): string {
37-
return 'xml/blank-di';
37+
getTemplateName(data: TemplateWizardData): TemplatePath {
38+
return TemplatePath.XmlBlankDi;
3839
}
3940
}

src/command/GenerateEmailTemplatesXmlCommand.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
22
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
33
import FileHeader from 'common/xml/FileHeader';
4+
import { TemplatePath } from 'types/handlebars';
45

56
export default class GenerateEmailTemplatesXmlCommand extends SimpleTemplateGeneratorCommand {
67
constructor() {
@@ -21,7 +22,7 @@ export default class GenerateEmailTemplatesXmlCommand extends SimpleTemplateGene
2122
return `app/code/${vendor}/${module}/etc/email_templates.xml`;
2223
}
2324

24-
getTemplateName(data: TemplateWizardData): string {
25-
return 'xml/blank-email-templates';
25+
getTemplateName(data: TemplateWizardData): TemplatePath {
26+
return TemplatePath.XmlBlankEmailTemplates;
2627
}
2728
}

src/command/GenerateEventsXmlCommand.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand
22
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
33
import { MagentoScope } from 'types/global';
44
import FileHeader from 'common/xml/FileHeader';
5+
import { TemplatePath } from 'types/handlebars';
56

67
export default class GenerateEventsXmlCommand extends SimpleTemplateGeneratorCommand {
78
constructor() {
@@ -38,7 +39,7 @@ export default class GenerateEventsXmlCommand extends SimpleTemplateGeneratorCom
3839
return `app/code/${vendor}/${module}/etc/events.xml`;
3940
}
4041

41-
getTemplateName(data: TemplateWizardData): string {
42-
return 'xml/blank-events';
42+
getTemplateName(data: TemplateWizardData): TemplatePath {
43+
return TemplatePath.XmlBlankEvents;
4344
}
4445
}

src/command/GenerateExtensionAttributesXmlFileCommand.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
22
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
33
import FileHeader from 'common/xml/FileHeader';
4+
import { TemplatePath } from 'types/handlebars';
45

56
export default class GenerateExtensionAttributesXmlFileCommand extends SimpleTemplateGeneratorCommand {
67
constructor() {
@@ -21,7 +22,7 @@ export default class GenerateExtensionAttributesXmlFileCommand extends SimpleTem
2122
return `app/code/${vendor}/${module}/etc/extension_attributes.xml`;
2223
}
2324

24-
getTemplateName(data: TemplateWizardData): string {
25-
return 'xml/blank-extension-attributes';
25+
getTemplateName(data: TemplateWizardData): TemplatePath {
26+
return TemplatePath.XmlBlankExtensionAttributes;
2627
}
2728
}

src/command/GenerateFieldsetXmlCommand.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
22
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
33
import FileHeader from 'common/xml/FileHeader';
4+
import { TemplatePath } from 'types/handlebars';
45

56
export default class GenerateFieldsetXmlCommand extends SimpleTemplateGeneratorCommand {
67
constructor() {
@@ -21,7 +22,7 @@ export default class GenerateFieldsetXmlCommand extends SimpleTemplateGeneratorC
2122
return `app/code/${vendor}/${module}/etc/fieldset.xml`;
2223
}
2324

24-
getTemplateName(data: TemplateWizardData): string {
25-
return 'xml/blank-fieldset';
25+
getTemplateName(data: TemplateWizardData): TemplatePath {
26+
return TemplatePath.XmlBlankFieldset;
2627
}
2728
}

src/command/GenerateGraphqlSchemaFile.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
22
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
3+
import { TemplatePath } from 'types/handlebars';
34

45
export default class GenerateGraphqlSchemaFileCommand extends SimpleTemplateGeneratorCommand {
56
constructor() {
@@ -16,7 +17,7 @@ export default class GenerateGraphqlSchemaFileCommand extends SimpleTemplateGene
1617
return `app/code/${vendor}/${module}/etc/schema.graphqls`;
1718
}
1819

19-
getTemplateName(data: TemplateWizardData): string {
20-
return 'graphql/blank-schema';
20+
getTemplateName(data: TemplateWizardData): TemplatePath {
21+
return TemplatePath.GraphqlBlankSchema;
2122
}
2223
}

src/command/GenerateIndexerXmlFileCommand.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
22
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
33
import FileHeader from 'common/xml/FileHeader';
4+
import { TemplatePath } from 'types/handlebars';
45

56
export default class GenerateIndexerXmlFileCommand extends SimpleTemplateGeneratorCommand {
67
constructor() {
@@ -21,7 +22,7 @@ export default class GenerateIndexerXmlFileCommand extends SimpleTemplateGenerat
2122
return `app/code/${vendor}/${module}/etc/indexer.xml`;
2223
}
2324

24-
getTemplateName(data: TemplateWizardData): string {
25-
return 'xml/blank-indexer';
25+
getTemplateName(data: TemplateWizardData): TemplatePath {
26+
return TemplatePath.XmlBlankIndexer;
2627
}
2728
}

0 commit comments

Comments
 (0)