Vydra JS CLI is the official command-line interface for building ultra-fast SPA and Microfrontend applications using Web Components and the Vydra Framework.
Install Vydra CLI globally using your favorite package manager:
npm install -g @vydra-js/cli
# or
pnpm add -g @vydra-js/cliCreate a new microfrontend application or a root shell:
# Create a microfrontend app
vydra new app my-awesome-app
# Create a root shell (orchestrator)
vydra new root my-shellVydra distinguishes between two main project types:
A standalone application that can run in two modes:
- SPA Mode: Standard Single Page Application with its own
index.html. - MFE Mode: Build as a library/module to be consumed by a Root Shell.
The orchestrator or "parent" application. It is responsible for:
- Loading and mounting microfrontends.
- Managing global state and event bus communication.
- Shared services like Authentication and Configuration.
Scaffolds a new Vydra project.
- type:
app(microfrontend) orroot(shell). - name: Name of the project and directory.
- prefix: (Optional) Custom prefix for Web Components (default:
vydra).
Generates boilerplate for different entities using the project's design system.
# Generate a new page
vydra g page product-detail
# Generate a new component
vydra g component user-cardCommands specific to microfrontend applications.
# Start development server
vydra app serve
# Build for production
# Use --mode spa for a standalone app
# Use --mode mfe for a microfrontend module
vydra app build --mode [spa|mfe]
# Preview the production build
vydra app previewCommands specific to the root shell/orchestrator.
# Start development server
vydra root serve
# Build for production
vydra root build
# Preview the production build
vydra root previewEvery Vydra project contains a vydra.json file to manage its metadata and scaffolding behavior:
{
"vydra-cli": "0.0.1",
"version": "1.0.0",
"project": {
"name": "my-app",
"prefix": "vydra",
"type": "app",
"schematics": {
"page": {
"styles": true,
"test": true
},
"component": {
"styles": true,
"test": true
}
}
}
}Vydra CLI is designed to work seamlessly with the Vydra core packages:
- @vydra-js/core: Core framework logic.
- @vydra-js/router: Lightning fast routing.
- @vydra-js/bus: Event-driven communication.
- @vydra-js/forms: Reactive forms for Web Components.
- @vydra-js/i18n: Multi-language support.
MIT © Vydra Team