@float.js/core 2.0.6 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +118 -0
- package/dist/cli/index.js +358 -114
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +368 -124
- package/dist/index.js.map +1 -1
- package/dist/server/index.js +296 -52
- package/dist/server/index.js.map +1 -1
- package/package.json +14 -3
package/README.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Float.js ⚡
|
|
2
|
+
|
|
3
|
+
> Ultra Modern Web Framework for React
|
|
4
|
+
|
|
5
|
+
Float.js is a blazing-fast, full-stack React framework with file-based routing, server-side rendering, and an exceptional developer experience.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- ⚡ **HMR Ultra Rápido** - Hot Module Replacement instantáneo con WebSockets
|
|
10
|
+
- 📁 **File-based Routing** - Rutas automáticas basadas en estructura de carpetas
|
|
11
|
+
- 🖥️ **SSR** - Server-Side Rendering integrado
|
|
12
|
+
- 📡 **API Routes** - Crea APIs con archivos `route.ts`
|
|
13
|
+
- 🤖 **AI Ready** - Soporte nativo para streaming con OpenAI/Anthropic
|
|
14
|
+
- 📊 **Dev Dashboard** - Panel de desarrollo en `/__float`
|
|
15
|
+
- 🎨 **Tailwind CSS** - Auto-setup automático con PostCSS
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Create a new project
|
|
21
|
+
npx create-float my-app
|
|
22
|
+
cd my-app
|
|
23
|
+
|
|
24
|
+
# Or install in existing project
|
|
25
|
+
npm install @float.js/core react react-dom
|
|
26
|
+
|
|
27
|
+
# Start development server
|
|
28
|
+
npx float dev
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Project Structure
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
my-app/
|
|
35
|
+
├── app/
|
|
36
|
+
│ ├── page.tsx → /
|
|
37
|
+
│ ├── about/
|
|
38
|
+
│ │ └── page.tsx → /about
|
|
39
|
+
│ ├── blog/
|
|
40
|
+
│ │ └── [slug]/
|
|
41
|
+
│ │ └── page.tsx → /blog/:slug
|
|
42
|
+
│ └── api/
|
|
43
|
+
│ └── hello/
|
|
44
|
+
│ └── route.ts → /api/hello
|
|
45
|
+
├── public/
|
|
46
|
+
└── package.json
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Pages
|
|
50
|
+
|
|
51
|
+
Create React components in the `app/` directory:
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
// app/page.tsx
|
|
55
|
+
export default function Home() {
|
|
56
|
+
return <h1>Welcome to Float.js!</h1>
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## API Routes
|
|
61
|
+
|
|
62
|
+
Create API endpoints with `route.ts` files:
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
// app/api/hello/route.ts
|
|
66
|
+
export function GET(request: Request) {
|
|
67
|
+
return Response.json({ message: 'Hello from Float!' })
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function POST(request: Request) {
|
|
71
|
+
return Response.json({ status: 'created' }, { status: 201 })
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Tailwind CSS
|
|
76
|
+
|
|
77
|
+
Float.js automatically sets up Tailwind CSS when you run `float dev`. If Tailwind isn't configured, it will:
|
|
78
|
+
|
|
79
|
+
1. Create `tailwind.config.js`
|
|
80
|
+
2. Create `postcss.config.js`
|
|
81
|
+
3. Create `app/globals.css` with Tailwind directives
|
|
82
|
+
4. Create `app/layout.tsx` to import global styles
|
|
83
|
+
|
|
84
|
+
Install Tailwind dependencies:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npm install -D tailwindcss postcss autoprefixer
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Your components will automatically use Tailwind classes:
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
export default function Home() {
|
|
94
|
+
return (
|
|
95
|
+
<div className="flex items-center justify-center min-h-screen">
|
|
96
|
+
<h1 className="text-4xl font-bold text-blue-600">Hello Float!</h1>
|
|
97
|
+
</div>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## CLI Commands
|
|
103
|
+
|
|
104
|
+
| Command | Description |
|
|
105
|
+
|---------|-------------|
|
|
106
|
+
| `float dev` | Start development server with HMR |
|
|
107
|
+
| `float build` | Build for production |
|
|
108
|
+
| `float start` | Start production server |
|
|
109
|
+
| `float info` | Show environment information |
|
|
110
|
+
|
|
111
|
+
## Requirements
|
|
112
|
+
|
|
113
|
+
- Node.js 18+
|
|
114
|
+
- React 18.2+ or React 19+
|
|
115
|
+
|
|
116
|
+
## License
|
|
117
|
+
|
|
118
|
+
MIT © Float.js
|