kalxjs CLI
Modern CLI tooling for kalxjs development workflow.
Installation
npm install -g @kalxjs/cli
yarn global add @kalxjs/cli
pnpm add -g @kalxjs/cli
Quick Start
kalxjs create my-app
✔ Add Router support? Yes
✔ Add State Management? Yes
✔ Add SCSS support? Yes
✔ Add Single File Components support? Yes
✔ Add Composition API support? Yes
✔ Add API integration utilities? Yes
✔ Add Performance optimization utilities? Yes
✔ Add Plugin system support? Yes
✔ Add Testing setup? Yes
✔ Add ESLint setup? Yes
✔ Add Custom Renderer support? Yes
Commands
Project Creation
kalxjs create my-app
kalxjs create my-app --router --state --scss --testing --linting
kalxjs create my-app --skip-prompts
kalxjs create my-app --skip-install
Component Generation
kalxjs component MyComponent
kalxjs component MyComponent --dir src/components --style scss --test --props --state --methods --lifecycle
kalxjs c MyComponent
Development Workflow
kalxjs serve
kalxjs serve --port 8080
kalxjs build
Project Structure
When you create a new project with kalxjs CLI, it generates the following structure:
my-app/
├── app/ # Application source code
│ ├── components/ # Reusable components
│ ├── core/ # Core application files
│ ├── navigation/ # Router configuration (if enabled)
│ ├── pages/ # Page components (if router enabled)
│ ├── state/ # State management (if enabled)
│ ├── styles/ # Global styles (if SCSS enabled)
│ ├── services/ # API services (if API enabled)
│ ├── hooks/ # Composition hooks (if enabled)
│ ├── extensions/ # Plugins (if enabled)
│ ├── utils/ # Utility functions
│ ├── renderer/ # Custom renderer (if enabled)
│ └── templates/ # Templates for rendering (if enabled)
├── assets/ # Static assets
├── config/ # Configuration files
│ └── app.config.js # Application configuration
├── docs/ # Documentation
├── public/ # Public files
└── index.html # HTML entry point
Configuration
The project configuration is stored in config/app.config.js
:
const config = {
name: 'my-app',
version: '0.1.0',
description: 'A powerful KALXJS application',
env: {
development: {
apiBaseUrl: 'http://localhost:3000/api',
debug: true
},
production: {
apiBaseUrl: '/api',
debug: false
}
},
features: {
router: true,
state: true,
scss: true,
sfc: true,
composition: true,
api: true,
performance: true,
plugins: true,
testing: true,
linting: true,
customRenderer: true
}
};
export default config;
Upcoming Features
The following features are planned for future releases:
- Full TypeScript support
- Advanced component generation
- View/page generation
- API service generation
- Store module generation
- Unit and E2E testing commands
- Production build optimization
- Deployment to various platforms
- Docker container support
- Plugin system
- Custom template support
Troubleshooting
Common Issues
Installation Problems
If you encounter issues during installation, try:
npm install -g @kalxjs/cli --force
Dependency Conflicts
If you see dependency conflicts when creating a new project:
cd my-app
npm install --legacy-peer-deps
npm install --force
Port Already in Use
If the default port (3000) is already in use, the CLI will automatically find an available port. You can also specify a port:
kalxjs serve --port 8080
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
)
- Commit your changes (
git commit -m 'Add some amazing feature'
)
- Push to the branch (
git push origin feature/amazing-feature
)
- Open a Pull Request
License
This project is licensed under the MIT License.