Zova Bean Use Babel Plugin

raw JSON →
1.1.8 verified Sat Apr 25 auth: no javascript

A Babel plugin (v1.1.8) specific to the Zova framework that transforms bean usage in JavaScript/TypeScript projects. It enables the '@beanUse' decorator pattern to inject dependencies or services. This plugin targets a niche Zova ecosystem and has low release cadence. It is not suitable outside Zova. Other IOC or DI Babel plugins like babel-plugin-transform-decorators may serve broader needs.

error ReferenceError: exports is not defined
cause Using ES module import syntax with this plugin which expects CommonJS.
fix
Use require('babel-plugin-zova-bean-use') instead of import.
error Error: Cannot find module 'babel-plugin-zova-bean-use'
cause Plugin not installed, or incorrect package name in config.
fix
Run npm install --save-dev babel-plugin-zova-bean-use and use full name in plugins.
error SyntaxError: Support for the experimental syntax '@' isn't currently enabled
cause Decorators not enabled in Babel config.
fix
Add '@babel/plugin-proposal-decorators' before this plugin.
gotcha Plugin only works within Zova framework context; using it elsewhere may break builds.
fix Ensure your project is a Zova application.
breaking Requires Babylon 7+ (Babel 7). Not compatible with Babel 6.
fix Upgrade to Babel 7+.
deprecated Plugin is specific to an early version of Zova; may not be maintained.
fix Contact Zova maintainers for current approach.
npm install babel-plugin-zova-bean-use
yarn add babel-plugin-zova-bean-use
pnpm add babel-plugin-zova-bean-use

Shows how to add the plugin to Babel config for transforming the @beanUse decorator in classes.

module.exports = {
  presets: [
    ['@babel/preset-env', { targets: { node: 'current' } }],
  ],
  plugins: ['babel-plugin-zova-bean-use']
};

// Then in your code:
class MyClass {
  @beanUse MyService;
  // ...
}