Package Exports
- create-bembajs
- create-bembajs/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (create-bembajs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
create-bembajs
create-bembajs - Create BembaJS apps with one command (like create-next-app) πΏπ²
π Quick Start
Using npm
npm create bembajs@latest my-appUsing npx
npx create-bembajs my-appUsing Bun
bun create bembajs my-appπ Interactive Prompts
When you run create-bembajs, you'll be prompted with:
? What is your project name? βΊ my-app
? Which template would you like to use? βΊ Base (Recommended)
? Would you like to use TypeScript? βΊ No
? Would you like to install dependencies? βΊ Yes
? Would you like to initialize git? βΊ Yes
? Would you like to open in VS Code? βΊ Yesπ― Available Templates
Base (Recommended)
A basic BembaJS application with:
- Home page (
amapeji/index.bemba) - About page (
amapeji/about.bemba) - Button component (
ifikopo/Button.bemba) - Card component (
ifikopo/Card.bemba) - Hello API route (
maapi/hello.bemba)
Dashboard
An admin dashboard template with:
- Dashboard layout
- Analytics components
- Data tables
- Charts and graphs
- User management
E-commerce
An online store template with:
- Product catalog
- Shopping cart
- Checkout process
- User authentication
- Payment integration
Blog
A content management template with:
- Article listing
- Individual post pages
- Author profiles
- Comment system
- Search functionality
ποΈ Generated Project Structure
my-app/
βββ amapeji/ # Pages (like Next.js pages/)
β βββ index.bemba # Home page
β βββ about.bemba # About page
βββ ifikopo/ # Components (like Next.js components/)
β βββ Button.bemba # Reusable button
β βββ Card.bemba # Reusable card
βββ maapi/ # API routes (like Next.js api/)
β βββ hello.bemba # Hello API
β βββ users.bemba # Users API
βββ maungu/ # Static files (like Next.js public/)
β βββ logo.png # BembaJS logo
β βββ style.css # Global styles
βββ .vscode/ # VS Code configuration
β βββ settings.json # Editor settings
β βββ extensions.json # Recommended extensions
β βββ launch.json # Debug configuration
βββ bemba.config.js # BembaJS configuration
βββ package.json # Project dependencies
βββ README.md # Project documentationβοΈ Configuration Options
Project Name
- Required: Yes
- Description: Name of your BembaJS project
- Example:
my-awesome-app
Template Selection
- Base: Basic application structure
- Dashboard: Admin dashboard with analytics
- E-commerce: Online store template
- Blog: Content management system
TypeScript Support
- Default: No
- Description: Enable TypeScript for type safety
- Files: Adds
.tssupport and type definitions
Dependency Installation
- Default: Yes
- Description: Automatically install npm dependencies
- Command: Runs
npm installafter project creation
Git Initialization
- Default: Yes
- Description: Initialize git repository
- Command: Runs
git initand creates initial commit
VS Code Integration
- Default: Yes
- Description: Open project in VS Code after creation
- Command: Runs
code .to open project
π¨ Custom Templates
You can create custom templates by:
- Creating template directory:
mkdir templates/my-template- Adding template files:
templates/my-template/
βββ amapeji/
βββ ifikopo/
βββ maapi/
βββ maungu/
βββ package.json
βββ README.md- Updating template list:
const templates = [
{ name: 'Base', value: 'base' },
{ name: 'Dashboard', value: 'dashboard' },
{ name: 'E-commerce', value: 'ecommerce' },
{ name: 'Blog', value: 'blog' },
{ name: 'My Template', value: 'my-template' } // Add your template
];π§ Advanced Usage
Programmatic Usage
const createBembaApp = require('create-bembajs');
await createBembaApp({
name: 'my-app',
template: 'base',
typescript: false,
install: true,
git: true,
vscode: false
});Custom Options
# Skip prompts with flags
npx create-bembajs my-app --template dashboard --typescript --no-install
# Available flags:
--template <name> # Template to use
--typescript # Enable TypeScript
--no-install # Skip dependency installation
--no-git # Skip git initialization
--no-vscode # Skip VS Code openingπ¦ Dependencies
The generated project includes:
Core Dependencies
bembajs- Main frameworkbembajs-core- Compiler enginereact- UI libraryreact-dom- DOM rendering
Development Dependencies
@types/react- TypeScript types (if TypeScript enabled)@types/react-dom- TypeScript types (if TypeScript enabled)eslint- Code lintingprettier- Code formatting
π Next Steps
After creating your project:
- Navigate to project:
cd my-app- Start development server:
npm run dev
# or
bemba tungulula- Build for production:
npm run build
# or
bemba akha- Deploy:
npm run deployπ Related Packages
- bembajs - Main CLI and SDK
- bembajs-core - Compiler engine
π License
MIT License - see LICENSE file for details.
π€ Contributing
We welcome contributions! Please see our Contributing Guide.
Made with β€οΈ in Zambia πΏπ²