Wizzi is a generation framework implemented by plugins.
Kernel modules themself have a pluggable architecture. The wizzi-mtree package is a plugin that implements an api for building tree structures from ITTF documents . The wizzi-repo package is a plugin that implements an api for locating and retrieving ITTF documents.
A Wizzi plugin exposes to the Wizzi factory the methods for retrieving its:
- Wizzi schema definitions
- Wizzi models and their factories
- Wizzi model transformers
- Artifact generators
A plugin package must export the
createFactoryPlugin
method in its
index.js
file. The
FactoryPlugin
class instance returned to the caller must implement the
wizzi-plugin.factoryPlugin
API (see below).
1 set module.exports 2 { 3 ... 4 @ createFactoryPlugin 5 function 6 { wizziPackage 7 { options 8 [ items 9 string pluginNameOrFile 10 string pluginsBaseFolder 11 default process.cwd() 12 callback 13 ... 14 return 15 _ callback 16 @ null 17 { factoryPlugin 18 api-ref wizzi-plugin.factoryPlugin
A Wizzi plugin should have a standard folder structure so that modules can be located given the short public name of the required item.
1 ... 2 {package-name} 3 package.json 4 ... 5 lib 6 artifacts 7 {schema-name} 8 {artifact-name} 9 gen 10 main.js 11 ... 12 {transformer-name} 13 trans 14 main.js 15 ... 16 ... 17 utils 18 ... 19 wizzi 20 models 21 {schema-name}-model.g.js 22 {schema-name}-factory.g.js 23 {schema-name}-schema.g.json 24 ... 25 index.js