CLI utilities for Ecopages
npm install ecopages> DRAFT / EXPERIMENTAL
> This package is currently in a draft state and is subject to significant changes.
ecopages is a CLI tool for the Ecopages framework. It provides:
- Project scaffolding: Quickly initialize new Ecopages projects from templates using bunx ecopages init
- Command utilities: Namespaced commands that wrap common Bun operations, automatically detecting and applying your eco.config.ts
Initialize a new project:
``bash`
bunx ecopages init my-app
cd my-app
bun install
bun dev
| Command | Description | Bun Equivalent |
| :--------------------------- | :----------------------------------------------- | :------------------------------ |
| ecopages init
| Initialize a new Ecopages project | scaffolding tool |
| ecopages dev [entry] | Start the development server | bun run [entry] --dev |
| ecopages dev:watch [entry] | Start with watch mode (restarts on file changes) | bun --watch run [entry] --dev |
| ecopages dev:hot [entry] | Start with hot reload (HMR without restart) | bun --hot run [entry] --dev |
| ecopages build [entry] | Build for production | bun run [entry] --build |
| ecopages start [entry] | Start production server | bun run [entry] |
| ecopages preview [entry] | Preview production build | bun run [entry] --preview |> Note:
[entry] defaults to app.ts if not provided.$3
All server commands (
dev, dev:watch, dev:hot, start, preview) support the following options:| Option | Environment Variable | Description |
| :------------------------- | :---------------------- | :---------------------------- |
|
-p, --port | ECOPAGES_PORT | Server port (default 3000) |
| -n, --hostname | ECOPAGES_HOSTNAME | Server hostname |
| -b, --base-url | ECOPAGES_BASE_URL | Base URL for the app |
| -d, --debug | ECOPAGES_LOGGER_DEBUG | Enable debug logging |
| -r, --react-fast-refresh | - | Enable React Fast Refresh HMR |Example:
`bash
Start dev server on port 8080 with debug logging
ecopages dev --port 8080 --debugStart dev server with React Fast Refresh
ecopages dev -rStart production server with custom hostname
ecopages start --hostname 0.0.0.0 --port 3001
`Ecopages Packages
The Ecopages ecosystem consists of individual framework packages published to JSR. Import them directly in your project:
`typescript
import { eco } from '@ecopages/core';
import { kitajsPlugin } from '@ecopages/kitajs';
`$3
| Package | Description | JSR Link |
| :-------------------------------- | :-------------------------------------------------------- | :---------------------------------------------------- |
|
@ecopages/browser-router | Client-side navigation and view transitions for Ecopages. | JSR |
| @ecopages/bun-inline-css-plugin | Bun plugin to process CSS files using CSS Processors. | JSR |
| @ecopages/bun-mdx-kitajs-loader | Bun loader to load MDX files with KitaJS. | JSR |
| @ecopages/bun-postcss-loader | Bun loader to load PostCSS files. | JSR |
| @ecopages/core | Foundational layer of the Ecopages ecosystem. | JSR |
| @ecopages/file-system | Runtime-agnostic file system utilities (Bun/Node.js). | JSR |
| @ecopages/image-processor | Image processing library for optimized responsive images. | JSR |
| @ecopages/kitajs | KitaJS plugin for Ecopages integration. | JSR |
| @ecopages/lit | Lit plugin for Ecopages integration. | JSR |
| @ecopages/mdx | MDX plugin for Ecopages integration. | JSR |
| @ecopages/postcss-processor | Utility functions for processing CSS with PostCSS. | JSR |
| @ecopages/react | React plugin for Ecopages integration. | JSR |
| @ecopages/react-router | Client-side SPA router for Ecopages React apps. | JSR |Explore all packages at jsr.io/@ecopages.
Installation
`bash
bun add ecopages
`To use Ecopages packages in your project, create a
.npmrc file in the root of your project to configure JSR registry resolution:`ini
@jsr:registry=https://npm.jsr.io
`Then add the packages you need:
`bash
bun jsr add @ecopages/core @ecopages/kitajs
``MIT