@kdsp/create-plugin
v1.0.5
Published
CLI to create new Kernel Module Federation plugins
Downloads
503
Maintainers
Readme
@kdsp/create-plugin
(KDSP - Kernel Development Service Package) CLI tool to create new kernel Module Federation plugins with built-in versioning, source maps, and standardized architecture.
Installation
# Install globally
npm install -g @kdsp/create-plugin
# Or use npx (recommended)
npx @kdsp/create-pluginUsage
Interactive Mode
npx @kdsp/create-pluginThis will prompt you for:
- Plugin name (must start with
kdsp-) - Dev server port
- Description
- Author
- Whether to include example component
Quick Mode
# Create plugin with defaults
npx @kdsp/create-plugin kdsp-my-feature --yes
# Specify port
npx @kdsp/create-plugin kdsp-my-feature --port 9010
# Skip npm install
npx @kdsp/create-plugin kdsp-my-feature --no-install
# Create in specific directory
npx @kdsp/create-plugin kdsp-my-feature --directory ./pluginsWhat Gets Created
kdsp-my-feature/
├── package.json
├── tsconfig.json
├── rspack.config.ts
├── module-federation.config.ts
├── postcss.config.js
├── index.html
├── README.md
└── src/
├── index.ts
├── index.css
├── App.tsx
├── version.ts
├── global.d.ts
└── components/
├── index.ts
└── kdspMyFeatureMain.tsxFeatures Included
✅ Version Tracking
- Version from package.json in filenames
- Console logging on load
window.__MF_PLUGIN_VERSIONS__registry
✅ Source Maps
- Full source map support for Chrome DevTools
- Debug original TypeScript files
✅ Single File Bundle
- Each exposed module as single file
- No chunk splitting
✅ Module Federation
- Ready-to-use MF configuration
- Versioned remote entry file
✅ Material UI
- Pre-configured with MUI
- Example component included
After Creation
cd kdsp-my-feature
npm startPlugin available at: http://localhost:{port}
Remote entry: http://localhost:{port}/kdsp-my-feature.v0.0.1.js
Adding to Host App
- Add to host's Module Federation config:
remotes: {
kdsp_my_feature: "kdsp_my_feature@http://localhost:{port}/mf-manifest.json",
}- Import in host app:
const MyFeatureMain = lazy(() => import("kdsp_my_feature/kdspMyFeatureMain"));License
MIT
