A Babel plugin that automatically generates path strings for Kea logic stores based on the file path. Version 3.0.0 is the latest stable release. It eliminates the need to manually specify a `path` property in every `kea()` call, with support for dynamic keys and custom path prefix configuration. Unlike manual path management, this plugin ensures consistency and reduces boilerplate in Kea-based projects. It requires Kea 3.x and is intended for build-time usage with Babel.
npm install babel-plugin-keaVerified import paths — ran on the pinned version, not inferred.
Basic Babel configuration enabling the plugin and an example with custom path prefix to trim root directory.
Upgrade Kea to 3.x or use babel-plugin-kea@2.x for Kea 2.x.
Remove explicit path from kea() calls to let plugin generate them automatically.
Use the 'path' option to trim a prefix (e.g., './src') to keep paths stable if files move under src.
Use path: () => [...] for dynamic paths; static paths as arrays are not modified.
Run 'npm install babel-plugin-kea --save-dev' or 'yarn add babel-plugin-kea --dev'.
Use 'const plugin = require('babel-plugin-kea')' (no .default).Use [['babel-plugin-kea', { path: './src' }]] not ['babel-plugin-kea', { path: './src' }].