v0.16.0
Project Generator Plugins
This release enables project-generators
to chain series of plugins like component generators. This helps in re-using the default generators strategy
, plugin configs
and then extending their functionality using the plugins. For example
Let's take @teleporthq/teleeport-project-generator-next
helps in generating a NextJS project with styled-jsx
by default. But what is we need a NextJS with StyledComponents or NextJS with React-JSS. These project-plugins helps in enabling that flexibility.
const nextProjectGenerator = createNextProjectGenerator()
nextProjectGenerator.addPlugin(pluginNextStyledComponents)
With nextStyledComponentsProjectGenerators
we can generate NextJS projects with StyledComponents. No additional configurations and additional templates needed to maintain.
Working with Plugins
- Using plugins we can add
dependencies
ordevDependencies
or delete any. - We have access to all files generated using
template
and from thecomponent-generators
. And we can change the content of any files with respect to our needed. - We cannot change the template using a
project-generator-plugin
. Because, the plugins are mainly designed by basing on the files and folders present in the config. If a plugin decides to change the template in middle. All the next plugins in the pipeline might start to fail. - Every plugin has 2 life cycle methods.
runBefore
andrunAfter
. runBefore
is executed right after validating the ProjectUIDL and so, we can want to add any additional plugins or remove any or even change the generators.runAfter
is executed after the components/pages/style sheets/routers are generated. Basically right before packing the project, so we can quickly change any configs to meet our needs.
More details and implementations of the plugins can be found here #514
Plugins that are currently released with the current release are
- Next + CSS-Modules here
- Next + StyledComponents here
- Next + ReactJSS here
- Gatsby + StyledComponents here
Out of the box, now @teleporthq/teleport-code-generator helps in generating pre-configured 14 different projects 🎉
What's Changed
- chore(changelog): post release clean-up and updating changelog by @JayaKrishnaNamburu in #519
- chore(core): upgrading to use esm version of prettier by @JayaKrishnaNamburu in #527
- fix(plugin-css): Add styles when only token is used to style a element by @JayaKrishnaNamburu in #525
- refactor(react-jss): React JSS will use hooks add styles to nodes. by @JayaKrishnaNamburu in #526
- fix(validator): Throwing error if the UIDL has 'null' or 'undefined' by @JayaKrishnaNamburu in #528
- fix(styles): Fix for importing and handling project-stylesheet if only tokens are used. by @JayaKrishnaNamburu in #530
- (feat): Plugins for project-generators by @JayaKrishnaNamburu in #514
- chore(deps): bump ini from 1.3.5 to 1.3.8 by @dependabot in #532
- feat(proj-plugins): cross-check for project-plugins and project-generators by @JayaKrishnaNamburu in #534
- fix(css): importing global style sheet by default in the root of the project by @JayaKrishnaNamburu in #537
Full Changelog: v0.15.0...v0.16.0