Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🏗♻️ Share extension generator implementation (#34002)
Refactors the filesystem-read extension generator built for **Bento**, so that it can be used for **Classic** components. - Moves templates in `bento/` to `template/bento/extensions/`. This follows: `template/${templateName}/${rootDirPath...}`. - Code rules can now be excluded from `template/**` - We now start from the root directory so we can generate an `examples/` file for Classic. - (It also means that we can use the generator for anything and not just extensions.) - Moves some existing templates to `template/shared` which is used for both Bento and Classic. - Rewrites Classic templates to match the new filesystem-read generator, into `template/classic`. - The Classic generator would `prettier`-format, while Bento would not. Generated files are now always formatted. - Adds a few tests. New template directory structure: ``` build-system/tasks/make-extension/template ├── bento │ └── extensions │ └── amp-__component_name_hyphenated__ │ ├── OWNERS │ └── __component_version__ │ ├── amp-__component_name_hyphenated__.js │ ├── base-element.js │ ├── component.js │ ├── component.jss.js │ ├── component.type.js │ ├── storybook │ │ ├── Basic.amp.js │ │ └── Basic.js │ └── test │ └── test-amp-__component_name_hyphenated__.js ├── classic │ ├── examples │ │ └── amp-__component_name_hyphenated__.html │ └── extensions │ └── amp-__component_name_hyphenated__ │ ├── OWNERS │ └── __component_version__ │ ├── amp-__component_name_hyphenated__.js │ └── test │ ├── test-amp-__component_name_hyphenated__.js │ └── __validator__-amp-__component_name_hyphenated__.html └── shared └── extensions └── amp-__component_name_hyphenated__ ├── __component_version__ │ └── amp-__component_name_hyphenated__.css ├── amp-__component_name_hyphenated__.md └── __validator__-amp-__component_name_hyphenated__.protoascii ```
- Loading branch information