File tree Expand file tree Collapse file tree 5 files changed +44
-0
lines changed Expand file tree Collapse file tree 5 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
1616- Added: Generator command for sample indexer.xml file
1717- Added: Generator command for sample mview.xml file
1818- Added: Generator command for sample widget.xml file
19+ - Added: Generator command for sample extension_attributes.xml file
1920
2021## [ 1.1.3] - 3/12/2025
2122
Original file line number Diff line number Diff line change 150150 {
151151 "command" : " magento-toolbox.generateWidgetXmlFile" ,
152152 "title" : " Magento Toolbox: Generate Widget XML"
153+ },
154+ {
155+ "command" : " magento-toolbox.generateExtensionAttributesXmlFile" ,
156+ "title" : " Magento Toolbox: Generate Extension Attributes XML"
153157 }
154158 ],
155159 "menus" : {
263267 {
264268 "command" : " magento-toolbox.generateWidgetXmlFile" ,
265269 "when" : " resourcePath =~ /app\\ /code\\ /.+\\ /.+/i"
270+ },
271+ {
272+ "command" : " magento-toolbox.generateExtensionAttributesXmlFile" ,
273+ "when" : " resourcePath =~ /app\\ /code\\ /.+\\ /.+/i"
266274 }
267275 ]
268276 }
Original file line number Diff line number Diff line change 1+ import { SimpleTemplateGeneratorCommand } from './SimpleTemplateGeneratorCommand' ;
2+ import { TemplateWizardData } from 'wizard/SimpleTemplateWizard' ;
3+ import FileHeader from 'common/xml/FileHeader' ;
4+
5+ export default class GenerateExtensionAttributesXmlFileCommand extends SimpleTemplateGeneratorCommand {
6+ constructor ( ) {
7+ super ( 'magento-toolbox.generateExtensionAttributesXmlFile' ) ;
8+ }
9+
10+ getWizardTitle ( ) : string {
11+ return 'Extension Attributes XML File' ;
12+ }
13+
14+ getFileHeader ( data : TemplateWizardData ) : string | undefined {
15+ return FileHeader . getHeader ( data . module ) ;
16+ }
17+
18+ getFilePath ( data : TemplateWizardData ) : string {
19+ const [ vendor , module ] = data . module . split ( '_' ) ;
20+
21+ return `app/code/${ vendor } /${ module } /etc/extension_attributes.xml` ;
22+ }
23+
24+ getTemplateName ( data : TemplateWizardData ) : string {
25+ return 'xml/blank-extension-attributes' ;
26+ }
27+ }
Original file line number Diff line number Diff line change @@ -22,3 +22,4 @@ export { default as GenerateViewXmlFile } from './GenerateViewXmlFile';
2222export { default as GenerateIndexerXmlFileCommand } from './GenerateIndexerXmlFileCommand' ;
2323export { default as GenerateMviewXmlFileCommand } from './GenerateMviewXmlFileCommand' ;
2424export { default as GenerateWidgetXmlFileCommand } from './GenerateWidgetXmlFileCommand' ;
25+ export { default as GenerateExtensionAttributesXmlFileCommand } from './GenerateExtensionAttributesXmlFileCommand' ;
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" ?>
2+ <% if (fileHeader) { -% >
3+ < %- fileHeader % >
4+ < % } - %>
5+ <config xmlns:xsi =" http://www.w3.org/2001/XMLSchema-instance"
6+ xsi:noNamespaceSchemaLocation =" urn:magento:framework:Api/etc/extension_attributes.xsd" >
7+ </config >
You can’t perform that action at this time.
0 commit comments