Version 2.4.1 of the TypeScript codegen plugin is out

Version 2.4.1 of the xp-codegen-plugin is out

I had a chance to work on a new feature and some bugfixes for this plugin over the summer vacation… :palm_tree:

About the plugin

The xp-codegen-plugin is a Gradle-plugin that reads all the xml-files in your project, and creates TypeScript-types for the shapes of your content in XP.

It can be run as a task in your Gradle-build.

New features

  • XML-files inside included jars are now also parsed to create TypeScript-types. This includes mixins you are using from XP-libraries :star_struck:. (#51)
  • Add /site/mixins/index.d.ts that re-exports all generated shapes for Mixins (#57)

Bug fixes

  • Prevent duplicate string literals in unions (#54)
  • Prevent site/styles.xml to overwrite the result from site/site.xml . (#55)
  • Fix failing task when there is no include in dependencies in build.gradle (#61)
  • Fix failing task when there is no appName in in gradle.properties. (#62)

What’s next? Edit: What came out in 2.5.0?

  • A new Gradle-task generateI18nPhrases that parses all the xml-files and create a file i18n/phrases.tmp.properties that contains all the [i18n] keys/default values, that doesn’t have translations yet. (#49)

Happy coding everyone!
– Tom Arild

Release 2.5.0 is out now with a new Gradle-task “generateI18nPhrases” that creates a file phrases.tmp.properties with all the i18n-keys in your XML-files that is lacking translations in your phrases.properties file.

Hi Tom, I hope you’re well

Today I started checking the codegen plugin and got a question: I saw it creates a .xp-codegen folder, with the typedefs; am I doing it correctly?
I ask that as I thought, after reading the readme, that the typedefs would be set inside the enonic’s regular folder structure.

It’s a very handy plugin and for sure we’ll be including in our dev process.

Best regards,
Marco