Skip to content

v0.16.0

Compare
Choose a tag to compare
@JayaKrishnaNamburu JayaKrishnaNamburu released this 04 Feb 15:13
· 399 commits to development since this release

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 or devDependencies or delete any.
  • We have access to all files generated using template and from the component-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 and runAfter.
  • 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

Full Changelog: v0.15.0...v0.16.0