Registry / web-framework / lunarx

lunarx

JSON →
library0.3.2jsnpmunverified

LunarX is a lightweight SSR framework for React that emphasizes simplicity and flexibility, positioning itself as an alternative to Next.js and Remix. The current stable version is 0.3.2. It features file-based routing with minimal configuration, aiming for a simplified developer experience. Released under the MIT license, LunarX targets Node.js 16.8.0+. As an early-stage project (pre-1.0), it may undergo breaking changes. Key differentiators include a focus on being lightweight and less opinionated than established frameworks, though it lacks the ecosystem and maturity of Next.js or Remix.

npm install lunarx
INSTALL
IMPORT
SIG · LUNARX
L
lunarx
web-frameworkjavascriptv0.3.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LunarX
import { LunarX } from 'lunarx'
import LunarX from 'lunarx'
LunarX is a named export, not a default export. Common mistake for new users.
defineConfig
import { defineConfig } from 'lunarx/config'
import { defineConfig } from 'lunarx'
The config helper is exported from a subpath 'lunarx/config', not the main package.
useRouter
import { useRouter } from 'lunarx/router'
import { useRouter } from 'lunarx'
Router hooks are available from 'lunarx/router' since v0.2.0.

Creates a LunarX app with file-based routing from a 'pages' directory and starts the server on port 3000.

import { LunarX } from 'lunarx'; const app = LunarX.createApp({ routes: 'pages', engine: { port: 3000, }, }); // pages/index.tsx export default function Home() { return <h1>Hello LunarX!</h1>; } app.start().then(() => { console.log('Server running on http://localhost:3000'); });
lunarx --version
Debug
Known issues
gotchaFile-based routing expects pages in a 'pages' directory by default; cannot be changed easily.
fix
Ensure your project has a 'pages' folder at root or configure with 'routes' option.
affects: >=0.1.0
deprecatedThe 'engine' option in createApp is deprecated in favor of 'server' since v0.3.0.
fix
Use { server: { port: 3000 } } instead of { engine: { port: 3000 } }.
affects: >=0.3.0
gotchaLunarX is in early development (pre-1.0); breaking changes may occur without major version bumps.
fix
Pin exact version and test upgrades carefully.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'lunarx/config'
Missing or incorrect import path for configuration utilities.
fix
Use 'import { defineConfig } from 'lunarx/config'' after installing the package.
TypeError: LunarX.createApp is not a function
Default import used instead of named import.
fix
Change to 'import { LunarX } from 'lunarx''.
Error: ENOENT: no such file or directory, open 'pages/index.jsx'
Missing pages directory or incorrect filename.
fix
Create a 'pages' directory with an index.jsx or index.tsx file.
Upgrade
Version history
0.3.2latest on npm
Audit
Dependencies
reactrequiredPeer dependency for rendering components.
react-domrequiredPeer dependency for server-side rendering of React components.
Agent activity
2 hits · last 30 days
node
2
Resources
lunarx — npm install lunarx · libregistry