upassist/prototypegenerator
Composer 安装命令:
composer require upassist/prototypegenerator
包简介
A prototype generator to quickly generate prototypes based on nodetype definitions.
README 文档
README
What does this package do?
This package lets you create scaffolding for prototypes for Neos using the commandline.
Why did you make this?
Working with an Atomic setup in Neos often requires creating quite some files for a single NodeType.
Fusion files, CSS files and sometimes specific JS files as well.
While working with templates like textExpander or livetemplates in PhpStorm, still creating the files takes up some time.
Not anymore! 😃
⚙️ How to install
Simply run the composer command to install the package.
composer require upassist/prototypegenerator --dev
How to setup
🚀 Quick Setup
Copy the following Settings and set your defaults:
UpAssist: PrototypeGenerator: # Set a default packageKey and you don't have to write the full `Vendor.Package` prefix every time (but you still can) (optional) packageKey: '' # Folder structure (in array format) leading to your package packageParentFolder: ['DistributionPackages'] # The rendering prototypes # For document, content and collection you can list the additional prototypes to render rendering: document: - template content: - organism - molecule - atom collection: - organism - molecule - atom # List of types you also want to create a CSS file renderCSS: [ 'template', 'organism', 'molecule', 'atom' ] # List of types you also want to create a JS file renderJS: [ 'organism' ] # The file extension used for rendering the CSS file (i.e. `css`, `scss`, `sass`, `less`) cssExtension: 'css' # The file extension used for rendering the JS file (i.e. `js`, `jsx`) jsExtension: 'js' # The name for your extendedRenderer (optional, but required in the default setup since the default templates use this) extendedRenderer: ''
👉🏻 Advanced Setup
Take a look at all the Settings where you can set defaults for how you would like to render your prototypes, change the inheritance and more.
📘 How to use
There are a couple of commands at your disposal:
| Command | Params | Example |
|---|---|---|
generator:prototype |
--nodeType | ./flow generator:prototype Content.TextWithImage |
generator:atom |
--prototypeName | ./flow generator:atom Text |
generator:molecule |
--prototypeName | ./flow generator:molecule TextWithImage |
generator:organism |
--prototypeName | ./flow generator:organism TextWithImage |
generator:template |
--prototypeName | ./flow generator:template Article |
generator:extendedrenderer |
--prototypeName | ./flow generator:extendedrenderer Vendor.Package:ExtendedRenderer |
generator:xlf |
--nodeType | ./flow generator:xlf Content.Text |
💡 All commands support the --force parameter to overwrite files that are already created.
💡 You can use the full name of your prototype, and if you set a packageKey in the settings, you can omit it here. (I.e. Neos.NodeTypes:Content.Text becomes Content.Text)
💡 Nice to know
- The default templates add a
@Todoin the generated files (you can modify this in the Settings) allowing you to use your IDE to see what you still must implement, probably best to remove it after you are done. - You can modify the default templates to your liking using sprintf syntax to substitute strings; the settings show you what you can use.
- You can modify one or multiple templates. Or none if you like the defaults.
- This is build with atomic fusion use in mind, but should be possible to be used without that.
- Did I mention the generator created the content prototype and all atomic parts as well if you want it to? 😎
⚠️ Warning #1
At this point determination of either Document, ContentCollection or Content types is done by the nodename, which will be changed in an upcoming version to look at the superType instead. Using this package now means you have to name your nodeType like this:
Vendor.Package:Document.PageVendor.Package:Content.TextVendor.Package:Collection.Section|Vendor.Package:ContentCollection.Section
🧠 Thought about but not yet implemented...
Generate XLIFF files for all nodeTypes and defined language dimensions #3- Implement more defaults for properties #2
- ...
🤔 Afterthought...
This really was not meant to be ready and could probably be better thought through. However, it works pretty decent for the setup I work with and am very happy with the amount of time saved using this tool. I really hope it makes your Neos development life easier and welcome pull requests of course 😊
Thanks for reading this far and if you like it, let me know 🙂.
— Henjo
upassist/prototypegenerator 适用场景与选型建议
upassist/prototypegenerator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.6k 次下载、GitHub Stars 达 8, 最近一次更新时间为 2021 年 10 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 upassist/prototypegenerator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 upassist/prototypegenerator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.6k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-10-26