Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to the "magento-toolbox" extension will be documented in thi

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## [Unreleased]
- Fixed: Generated plugin class arguments contain an incorrect namespace

## [1.3.0] - 2025-03-17

- Added: Jump to module command
Expand Down
5 changes: 3 additions & 2 deletions src/command/GenerateAclXmlFileCommand.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
import { TemplatePath } from 'types/handlebars';

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

getTemplateName(data: TemplateWizardData): string {
return 'xml/blank-acl';
getTemplateName(data: TemplateWizardData): TemplatePath {
return TemplatePath.XmlBlankAcl;
}
}
5 changes: 3 additions & 2 deletions src/command/GenerateConfigXmlFileCommand.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
import FileHeader from 'common/xml/FileHeader';
import { TemplatePath } from 'types/handlebars';

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

getTemplateName(data: TemplateWizardData): string {
return 'xml/blank-config';
getTemplateName(data: TemplateWizardData): TemplatePath {
return TemplatePath.XmlBlankConfig;
}
}
5 changes: 3 additions & 2 deletions src/command/GenerateCrontabXmlCommand.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
import FileHeader from 'common/xml/FileHeader';
import { TemplatePath } from 'types/handlebars';

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

getTemplateName(data: TemplateWizardData): string {
return 'xml/blank-crontab';
getTemplateName(data: TemplateWizardData): TemplatePath {
return TemplatePath.XmlBlankCrontab;
}
}
7 changes: 4 additions & 3 deletions src/command/GenerateDiXmlFileCommand.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { MagentoScope } from 'types';
import { MagentoScope } from 'types/global';
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
import { TemplatePath } from 'types/handlebars';

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

getTemplateName(data: TemplateWizardData): string {
return 'xml/blank-di';
getTemplateName(data: TemplateWizardData): TemplatePath {
return TemplatePath.XmlBlankDi;
}
}
5 changes: 3 additions & 2 deletions src/command/GenerateEmailTemplatesXmlCommand.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
import FileHeader from 'common/xml/FileHeader';
import { TemplatePath } from 'types/handlebars';

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

getTemplateName(data: TemplateWizardData): string {
return 'xml/blank-email-templates';
getTemplateName(data: TemplateWizardData): TemplatePath {
return TemplatePath.XmlBlankEmailTemplates;
}
}
7 changes: 4 additions & 3 deletions src/command/GenerateEventsXmlCommand.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
import { MagentoScope } from 'types';
import { MagentoScope } from 'types/global';
import FileHeader from 'common/xml/FileHeader';
import { TemplatePath } from 'types/handlebars';

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

getTemplateName(data: TemplateWizardData): string {
return 'xml/blank-events';
getTemplateName(data: TemplateWizardData): TemplatePath {
return TemplatePath.XmlBlankEvents;
}
}
5 changes: 3 additions & 2 deletions src/command/GenerateExtensionAttributesXmlFileCommand.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
import FileHeader from 'common/xml/FileHeader';
import { TemplatePath } from 'types/handlebars';

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

getTemplateName(data: TemplateWizardData): string {
return 'xml/blank-extension-attributes';
getTemplateName(data: TemplateWizardData): TemplatePath {
return TemplatePath.XmlBlankExtensionAttributes;
}
}
5 changes: 3 additions & 2 deletions src/command/GenerateFieldsetXmlCommand.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
import FileHeader from 'common/xml/FileHeader';
import { TemplatePath } from 'types/handlebars';

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

getTemplateName(data: TemplateWizardData): string {
return 'xml/blank-fieldset';
getTemplateName(data: TemplateWizardData): TemplatePath {
return TemplatePath.XmlBlankFieldset;
}
}
5 changes: 3 additions & 2 deletions src/command/GenerateGraphqlSchemaFile.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
import { TemplatePath } from 'types/handlebars';

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

getTemplateName(data: TemplateWizardData): string {
return 'graphql/blank-schema';
getTemplateName(data: TemplateWizardData): TemplatePath {
return TemplatePath.GraphqlBlankSchema;
}
}
5 changes: 3 additions & 2 deletions src/command/GenerateIndexerXmlFileCommand.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
import FileHeader from 'common/xml/FileHeader';
import { TemplatePath } from 'types/handlebars';

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

getTemplateName(data: TemplateWizardData): string {
return 'xml/blank-indexer';
getTemplateName(data: TemplateWizardData): TemplatePath {
return TemplatePath.XmlBlankIndexer;
}
}
9 changes: 5 additions & 4 deletions src/command/GenerateLayoutXmlCommand.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { MagentoScope } from 'types';
import { MagentoScope } from 'types/global';
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
import { WizardField, WizardValidationRule } from 'webview/types';
import { WizardField, WizardValidationRule } from 'types/webview';
import { WizardFieldBuilder } from 'webview/WizardFieldBuilder';
import FileHeader from 'common/xml/FileHeader';
import { TemplatePath } from 'types/handlebars';

export default class GenerateLayoutXmlCommand extends SimpleTemplateGeneratorCommand {
constructor() {
Expand Down Expand Up @@ -40,8 +41,8 @@ export default class GenerateLayoutXmlCommand extends SimpleTemplateGeneratorCom
return `app/code/${vendor}/${module}/view/base/layout/${data.name}.xml`;
}

getTemplateName(data: TemplateWizardData): string {
return 'xml/blank-layout';
getTemplateName(data: TemplateWizardData): TemplatePath {
return TemplatePath.XmlBlankLayout;
}

getWizardFields(): WizardField[] {
Expand Down
5 changes: 3 additions & 2 deletions src/command/GenerateMviewXmlFileCommand.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
import FileHeader from 'common/xml/FileHeader';
import { TemplatePath } from 'types/handlebars';

export default class GenerateMviewXmlFileCommand extends SimpleTemplateGeneratorCommand {
constructor() {
Expand All @@ -21,7 +22,7 @@ export default class GenerateMviewXmlFileCommand extends SimpleTemplateGenerator
return `app/code/${vendor}/${module}/etc/mview.xml`;
}

getTemplateName(data: TemplateWizardData): string {
return 'xml/blank-mview';
getTemplateName(data: TemplateWizardData): TemplatePath {
return TemplatePath.XmlBlankMview;
}
}
5 changes: 3 additions & 2 deletions src/command/GeneratePageTypesXmlCommand.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
import FileHeader from 'common/xml/FileHeader';
import { TemplatePath } from 'types/handlebars';

export default class GeneratePageTypesXmlCommand extends SimpleTemplateGeneratorCommand {
constructor() {
Expand All @@ -21,7 +22,7 @@ export default class GeneratePageTypesXmlCommand extends SimpleTemplateGenerator
return `app/code/${vendor}/${module}/etc/frontend/page_types.xml`;
}

getTemplateName(data: TemplateWizardData): string {
return 'xml/blank-page-types';
getTemplateName(data: TemplateWizardData): TemplatePath {
return TemplatePath.XmlBlankPageTypes;
}
}
11 changes: 6 additions & 5 deletions src/command/GenerateRoutesXmlFileCommand.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
import { MagentoScope } from 'types';
import { MagentoScope } from 'types/global';
import FileHeader from 'common/xml/FileHeader';
import { WizardFieldBuilder } from 'webview/WizardFieldBuilder';
import { WizardField, WizardValidationRule } from 'webview/types';
import { WizardField, WizardValidationRule } from 'types/webview';
import { TemplatePath } from 'types/handlebars';

export default class GenerateRoutesXmlFileCommand extends SimpleTemplateGeneratorCommand {
constructor() {
Expand All @@ -28,8 +29,8 @@ export default class GenerateRoutesXmlFileCommand extends SimpleTemplateGenerato
return `app/code/${vendor}/${module}/etc/${data.area}/routes.xml`;
}

getTemplateName(data: TemplateWizardData): string {
return 'xml/blank-routes';
getTemplateName(data: TemplateWizardData): TemplatePath {
return TemplatePath.XmlBlankRoutes;
}

getWizardFields(): WizardField[] {
Expand Down Expand Up @@ -85,7 +86,7 @@ export default class GenerateRoutesXmlFileCommand extends SimpleTemplateGenerato
};
}

getTemplateData(data: TemplateWizardData): Record<string, string> {
getTemplateData(data: TemplateWizardData): Record<string, any> {
return {
...data,
routerId: data.frontendRouterId || data.adminRouterId || 'default',
Expand Down
6 changes: 3 additions & 3 deletions src/command/GenerateSectionsXmlCommand.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
import FileHeader from 'common/xml/FileHeader';

import { TemplatePath } from 'types/handlebars';
export default class GenerateSectionsXmlCommand extends SimpleTemplateGeneratorCommand {
constructor() {
super('magento-toolbox.generateSectionsXmlFile');
Expand All @@ -21,7 +21,7 @@ export default class GenerateSectionsXmlCommand extends SimpleTemplateGeneratorC
return `app/code/${vendor}/${module}/etc/frontend/sections.xml`;
}

getTemplateName(data: TemplateWizardData): string {
return 'xml/blank-sections';
getTemplateName(data: TemplateWizardData): TemplatePath {
return TemplatePath.XmlBlankSections;
}
}
5 changes: 3 additions & 2 deletions src/command/GenerateSystemXmlFileCommand.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
import FileHeader from 'common/xml/FileHeader';
import { TemplatePath } from 'types/handlebars';

export default class GenerateSystemXmlFileCommand extends SimpleTemplateGeneratorCommand {
constructor() {
Expand All @@ -21,7 +22,7 @@ export default class GenerateSystemXmlFileCommand extends SimpleTemplateGenerato
return `app/code/${vendor}/${module}/etc/adminhtml/system.xml`;
}

getTemplateName(data: TemplateWizardData): string {
return 'xml/blank-system';
getTemplateName(data: TemplateWizardData): TemplatePath {
return TemplatePath.XmlBlankSystem;
}
}
5 changes: 3 additions & 2 deletions src/command/GenerateViewXmlFile.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
import FileHeader from 'common/xml/FileHeader';
import { TemplatePath } from 'types/handlebars';

export default class GenerateViewXmlFile extends SimpleTemplateGeneratorCommand {
constructor() {
Expand All @@ -21,7 +22,7 @@ export default class GenerateViewXmlFile extends SimpleTemplateGeneratorCommand
return `app/code/${vendor}/${module}/etc/view.xml`;
}

getTemplateName(data: TemplateWizardData): string {
return 'xml/blank-view';
getTemplateName(data: TemplateWizardData): TemplatePath {
return TemplatePath.XmlBlankView;
}
}
5 changes: 3 additions & 2 deletions src/command/GenerateWebapiXmlFileCommand.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
import FileHeader from 'common/xml/FileHeader';
import { TemplatePath } from 'types/handlebars';

export default class GenerateWebapiXmlFileCommand extends SimpleTemplateGeneratorCommand {
constructor() {
Expand All @@ -21,7 +22,7 @@ export default class GenerateWebapiXmlFileCommand extends SimpleTemplateGenerato
return `app/code/${vendor}/${module}/etc/webapi.xml`;
}

getTemplateName(data: TemplateWizardData): string {
return 'xml/blank-webapi';
getTemplateName(data: TemplateWizardData): TemplatePath {
return TemplatePath.XmlBlankWebapi;
}
}
5 changes: 3 additions & 2 deletions src/command/GenerateWidgetXmlFileCommand.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand';
import { TemplateWizardData } from 'wizard/SimpleTemplateWizard';
import FileHeader from 'common/xml/FileHeader';
import { TemplatePath } from 'types/handlebars';

export default class GenerateWidgetXmlFileCommand extends SimpleTemplateGeneratorCommand {
constructor() {
Expand All @@ -21,7 +22,7 @@ export default class GenerateWidgetXmlFileCommand extends SimpleTemplateGenerato
return `app/code/${vendor}/${module}/etc/widget.xml`;
}

getTemplateName(data: TemplateWizardData): string {
return 'xml/blank-widget';
getTemplateName(data: TemplateWizardData): TemplatePath {
return TemplatePath.XmlBlankWidget;
}
}
Loading