create-flexireact 2.0.1 → 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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-router.d.ts","sourceRoot":"","sources":["../../src/templates/app-router.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,
|
|
1
|
+
{"version":3,"file":"app-router.d.ts","sourceRoot":"","sources":["../../src/templates/app-router.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,CAkRpE"}
|
|
@@ -17,7 +17,8 @@ export function appRouterTemplate(projectName) {
|
|
|
17
17
|
dependencies: {
|
|
18
18
|
react: '^18.2.0',
|
|
19
19
|
'react-dom': '^18.2.0',
|
|
20
|
-
'@flexireact/core': '^2.
|
|
20
|
+
'@flexireact/core': '^2.4.0',
|
|
21
|
+
'@flexireact/flexi-ui': '^2.0.1',
|
|
21
22
|
clsx: '^2.1.0',
|
|
22
23
|
'tailwind-merge': '^2.2.0',
|
|
23
24
|
},
|
|
@@ -83,48 +84,106 @@ export default function RootLayout({ children }: { children: React.ReactNode })
|
|
|
83
84
|
}
|
|
84
85
|
`,
|
|
85
86
|
'app/page.tsx': `import React from 'react';
|
|
87
|
+
import { Button, Card, Badge, Stat, StatGroup } from '@flexireact/flexi-ui';
|
|
88
|
+
|
|
89
|
+
const features = [
|
|
90
|
+
{ icon: '⚡', title: 'Lightning Fast', desc: 'Powered by esbuild for instant builds' },
|
|
91
|
+
{ icon: '🎨', title: 'FlexiUI', desc: '50+ beautiful components included' },
|
|
92
|
+
{ icon: '📘', title: 'TypeScript', desc: 'Full type safety out of the box' },
|
|
93
|
+
{ icon: '🏝️', title: 'Islands', desc: 'Partial hydration for max performance' },
|
|
94
|
+
{ icon: '🌐', title: 'Edge Ready', desc: 'Deploy anywhere: Node, Bun, Deno, CF' },
|
|
95
|
+
{ icon: '🚀', title: 'SSR + PPR', desc: 'Streaming SSR & Partial Prerendering' },
|
|
96
|
+
];
|
|
86
97
|
|
|
87
98
|
export default function HomePage() {
|
|
88
99
|
return (
|
|
89
|
-
<main className="min-h-screen
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
100
|
+
<main className="min-h-screen">
|
|
101
|
+
{/* Hero */}
|
|
102
|
+
<section className="relative py-32 px-4 overflow-hidden">
|
|
103
|
+
<div className="absolute inset-0 bg-gradient-to-b from-[#00FF9C]/5 to-transparent" />
|
|
104
|
+
<div className="relative max-w-5xl mx-auto text-center">
|
|
105
|
+
<Badge className="mb-6">v2.4 — Edge Runtime + FlexiUI</Badge>
|
|
106
|
+
|
|
107
|
+
<h1 className="text-6xl font-bold mb-6">
|
|
108
|
+
Build faster with{' '}
|
|
109
|
+
<span className="text-[#00FF9C]">FlexiReact</span>
|
|
110
|
+
</h1>
|
|
111
|
+
|
|
112
|
+
<p className="text-xl text-gray-400 mb-10 max-w-2xl mx-auto">
|
|
113
|
+
The modern React framework with TypeScript, Tailwind, SSR, Islands,
|
|
114
|
+
Edge Runtime, and 50+ UI components. Better than Next.js.
|
|
115
|
+
</p>
|
|
116
|
+
|
|
117
|
+
<div className="flex gap-4 justify-center">
|
|
118
|
+
<Button size="lg">
|
|
119
|
+
Get Started →
|
|
120
|
+
</Button>
|
|
121
|
+
<Button variant="outline" size="lg">
|
|
122
|
+
Documentation
|
|
123
|
+
</Button>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
</section>
|
|
127
|
+
|
|
128
|
+
{/* Stats */}
|
|
129
|
+
<section className="py-16 px-4 border-y border-gray-800">
|
|
130
|
+
<div className="max-w-5xl mx-auto">
|
|
131
|
+
<StatGroup columns={4}>
|
|
132
|
+
<Stat label="Components" value="50+" />
|
|
133
|
+
<Stat label="Bundle Size" value="~90kb" />
|
|
134
|
+
<Stat label="Build Time" value="<1s" />
|
|
135
|
+
<Stat label="Lighthouse" value="100" />
|
|
136
|
+
</StatGroup>
|
|
93
137
|
</div>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
href="https://github.com/nicksdev/flexireact"
|
|
112
|
-
className="px-6 py-3 border border-gray-700 rounded-lg hover:border-[#00FF9C] transition"
|
|
113
|
-
>
|
|
114
|
-
Documentation
|
|
115
|
-
</a>
|
|
138
|
+
</section>
|
|
139
|
+
|
|
140
|
+
{/* Features */}
|
|
141
|
+
<section className="py-24 px-4">
|
|
142
|
+
<div className="max-w-5xl mx-auto">
|
|
143
|
+
<h2 className="text-3xl font-bold text-center mb-12">
|
|
144
|
+
Everything you need
|
|
145
|
+
</h2>
|
|
146
|
+
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
147
|
+
{features.map((f, i) => (
|
|
148
|
+
<Card key={i} className="p-6 bg-gray-900/50 border-gray-800 hover:border-[#00FF9C]/50 transition">
|
|
149
|
+
<div className="text-3xl mb-3">{f.icon}</div>
|
|
150
|
+
<h3 className="font-semibold text-lg mb-2">{f.title}</h3>
|
|
151
|
+
<p className="text-gray-400 text-sm">{f.desc}</p>
|
|
152
|
+
</Card>
|
|
153
|
+
))}
|
|
154
|
+
</div>
|
|
116
155
|
</div>
|
|
117
|
-
</
|
|
156
|
+
</section>
|
|
157
|
+
|
|
158
|
+
{/* CTA */}
|
|
159
|
+
<section className="py-24 px-4">
|
|
160
|
+
<div className="max-w-2xl mx-auto text-center">
|
|
161
|
+
<Card className="p-12 bg-gradient-to-b from-gray-900 to-gray-900/50 border-gray-800">
|
|
162
|
+
<h2 className="text-3xl font-bold mb-4">Ready to build?</h2>
|
|
163
|
+
<p className="text-gray-400 mb-8">Create your app in seconds</p>
|
|
164
|
+
<code className="block bg-black/50 rounded-lg p-4 mb-8 text-[#00FF9C]">
|
|
165
|
+
npx create-flexireact my-app
|
|
166
|
+
</code>
|
|
167
|
+
<Button size="lg">Start Building →</Button>
|
|
168
|
+
</Card>
|
|
169
|
+
</div>
|
|
170
|
+
</section>
|
|
171
|
+
|
|
172
|
+
{/* Footer */}
|
|
173
|
+
<footer className="py-8 px-4 border-t border-gray-800 text-center text-gray-500">
|
|
174
|
+
Built with ❤️ by FlexiReact Team
|
|
175
|
+
</footer>
|
|
118
176
|
</main>
|
|
119
177
|
);
|
|
120
178
|
}
|
|
121
179
|
`,
|
|
122
180
|
'app/loading.tsx': `import React from 'react';
|
|
181
|
+
import { Spinner } from '@flexireact/flexi-ui';
|
|
123
182
|
|
|
124
183
|
export default function Loading() {
|
|
125
184
|
return (
|
|
126
185
|
<div className="min-h-screen flex items-center justify-center">
|
|
127
|
-
<
|
|
186
|
+
<Spinner size="lg" />
|
|
128
187
|
</div>
|
|
129
188
|
);
|
|
130
189
|
}
|
|
@@ -132,40 +191,36 @@ export default function Loading() {
|
|
|
132
191
|
'app/error.tsx': `'use client';
|
|
133
192
|
|
|
134
193
|
import React from 'react';
|
|
194
|
+
import { Button, Alert } from '@flexireact/flexi-ui';
|
|
135
195
|
|
|
136
196
|
export default function Error({ error, reset }: { error: Error; reset: () => void }) {
|
|
137
197
|
return (
|
|
138
198
|
<div className="min-h-screen flex flex-col items-center justify-center p-8">
|
|
139
|
-
<
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
>
|
|
145
|
-
Try again
|
|
146
|
-
</button>
|
|
199
|
+
<Alert variant="error" className="max-w-md mb-8">
|
|
200
|
+
<h2 className="font-bold text-lg mb-2">Something went wrong</h2>
|
|
201
|
+
<p>{error.message}</p>
|
|
202
|
+
</Alert>
|
|
203
|
+
<Button onClick={reset}>Try again</Button>
|
|
147
204
|
</div>
|
|
148
205
|
);
|
|
149
206
|
}
|
|
150
207
|
`,
|
|
151
208
|
'app/not-found.tsx': `import React from 'react';
|
|
209
|
+
import { Button } from '@flexireact/flexi-ui';
|
|
152
210
|
|
|
153
211
|
export default function NotFound() {
|
|
154
212
|
return (
|
|
155
213
|
<div className="min-h-screen flex flex-col items-center justify-center p-8">
|
|
156
|
-
<h1 className="text-
|
|
214
|
+
<h1 className="text-8xl font-bold text-[#00FF9C] mb-4">404</h1>
|
|
157
215
|
<p className="text-gray-400 text-xl mb-8">Page not found</p>
|
|
158
|
-
<
|
|
159
|
-
href="/"
|
|
160
|
-
|
|
161
|
-
>
|
|
162
|
-
← Back Home
|
|
163
|
-
</a>
|
|
216
|
+
<Button asChild>
|
|
217
|
+
<a href="/">← Back Home</a>
|
|
218
|
+
</Button>
|
|
164
219
|
</div>
|
|
165
220
|
);
|
|
166
221
|
}
|
|
167
222
|
`,
|
|
168
|
-
'app/globals.css': `@import "tailwindcss";
|
|
223
|
+
'app/globals.css': `@import "tailwindcss" source("..");
|
|
169
224
|
|
|
170
225
|
@theme {
|
|
171
226
|
--color-background: #0a0a0a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-router.js","sourceRoot":"","sources":["../../src/templates/app-router.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,UAAU,iBAAiB,CAAC,WAAmB;IACnD,OAAO;QACL,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC;YAC7B,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,GAAG,EAAE,+BAA+B;gBACpC,KAAK,EAAE,iCAAiC;gBACxC,KAAK,EAAE,kBAAkB;gBACzB,GAAG,EAAE,2EA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