@emberkit/cli 0.6.0 → 0.6.1-alpha.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/dist/cli.js +44 -10
- package/dist/commands/create.js +10 -22
- package/dist/templates/action/index.js +12 -0
- package/dist/templates/apiRoute/index.js +20 -0
- package/dist/templates/component/index.js +14 -0
- package/dist/templates/config/index.js +13 -0
- package/dist/templates/context/index.js +21 -0
- package/dist/templates/entry/index.js +15 -0
- package/dist/templates/errorBoundary/index.js +17 -0
- package/dist/templates/form/index.js +59 -0
- package/dist/templates/layout/index.js +16 -0
- package/dist/templates/layoutRoutes/index.js +9 -0
- package/dist/templates/loader/index.js +10 -0
- package/dist/templates/project-templates/_shared/base.js +139 -0
- package/dist/templates/project-templates/api/api.js +209 -0
- package/dist/templates/project-templates/blog/blog.js +283 -0
- package/dist/templates/project-templates/dashboard/dashboard.js +331 -0
- package/dist/templates/project-templates/minimal/minimal.js +21 -0
- package/dist/templates/project-templates/saas/saas.js +461 -0
- package/dist/templates/project-templates/starter-kit/starter.js +209 -0
- package/dist/templates/project-templates/starter-kit/with-ui.js +365 -0
- package/dist/templates/route/index.js +12 -0
- package/dist/templates/signal/index.js +25 -0
- package/dist/utils/generator.js +13 -13
- package/package.json +1 -2
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import { buildPackageJson, buildTsConfig, buildViteConfig, buildIndexHtml, buildEntryFile, GITIGNORE, } from "../_shared/base.js";
|
|
2
|
+
const INTER_FONT = "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap";
|
|
3
|
+
export const withUiTemplate = {
|
|
4
|
+
"package.json": buildPackageJson({ hasTailwind: true, hasUI: true }),
|
|
5
|
+
"tsconfig.json": buildTsConfig(),
|
|
6
|
+
"vite.config.ts": buildViteConfig(true),
|
|
7
|
+
"index.html": buildIndexHtml({ fonts: [INTER_FONT] }),
|
|
8
|
+
".gitignore": GITIGNORE,
|
|
9
|
+
"src/index.tsx": buildEntryFile({ hasLayout: true, hasCss: true }),
|
|
10
|
+
"src/styles.css": `@import "tailwindcss";
|
|
11
|
+
|
|
12
|
+
@theme {
|
|
13
|
+
--color-ember-50: #fff7ed;
|
|
14
|
+
--color-ember-100: #ffedd5;
|
|
15
|
+
--color-ember-200: #fed7aa;
|
|
16
|
+
--color-ember-300: #fdba74;
|
|
17
|
+
--color-ember-400: #fb923c;
|
|
18
|
+
--color-ember-500: #f97316;
|
|
19
|
+
--color-ember-600: #ea580c;
|
|
20
|
+
--color-ember-700: #c2410c;
|
|
21
|
+
--color-ember-800: #9a3412;
|
|
22
|
+
--color-ember-900: #7c2d12;
|
|
23
|
+
--font-family-sans: 'Inter', system-ui, sans-serif;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@keyframes float {
|
|
27
|
+
0%, 100% { transform: translateY(0px); }
|
|
28
|
+
50% { transform: translateY(-20px); }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@keyframes fade-in-up {
|
|
32
|
+
from { opacity: 0; transform: translateY(20px); }
|
|
33
|
+
to { opacity: 1; transform: translateY(0); }
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@keyframes fade-in-down {
|
|
37
|
+
from { opacity: 0; transform: translateY(-20px); }
|
|
38
|
+
to { opacity: 1; transform: translateY(0); }
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@keyframes pulse-glow {
|
|
42
|
+
0%, 100% { opacity: 0.4; transform: scale(1); }
|
|
43
|
+
50% { opacity: 0.6; transform: scale(1.05); }
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
body {
|
|
47
|
+
@apply bg-[#0b0f19] text-slate-200 font-sans;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
a {
|
|
51
|
+
@apply text-inherit no-underline;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.animate-float { animation: float 6s ease-in-out infinite; }
|
|
55
|
+
.animate-fade-in-up { animation: fade-in-up 0.6s ease-out forwards; }
|
|
56
|
+
.animate-fade-in-down { animation: fade-in-down 0.6s ease-out forwards; }
|
|
57
|
+
.animate-pulse-glow { animation: pulse-glow 4s ease-in-out infinite; }`,
|
|
58
|
+
"src/routes/_layout.tsx": `import type { RouteComponent } from '@emberkit/core';
|
|
59
|
+
import { Head } from '@emberkit/core';
|
|
60
|
+
import { DefaultLayout } from '@emberkit/ui';
|
|
61
|
+
|
|
62
|
+
const Layout: RouteComponent = ({ children }) => {
|
|
63
|
+
return (
|
|
64
|
+
<>
|
|
65
|
+
<Head>
|
|
66
|
+
<title>{{name}}</title>
|
|
67
|
+
<meta name="description" content="Built with EmberKit UI" />
|
|
68
|
+
</Head>
|
|
69
|
+
<div className="relative min-h-screen">
|
|
70
|
+
<div className="pointer-events-none fixed inset-0 overflow-hidden">
|
|
71
|
+
<div className="absolute -top-40 -right-40 w-96 h-96 rounded-full bg-ember-500/10 blur-[120px] animate-pulse-glow" />
|
|
72
|
+
<div className="absolute -bottom-40 -left-40 w-96 h-96 rounded-full bg-amber-500/5 blur-[120px] animate-pulse-glow" style={{ animationDelay: '2s' }} />
|
|
73
|
+
</div>
|
|
74
|
+
<DefaultLayout
|
|
75
|
+
logo={
|
|
76
|
+
<span className="flex items-center gap-2">
|
|
77
|
+
<span className="text-2xl animate-float">🔥</span>
|
|
78
|
+
<span className="font-bold text-xl bg-gradient-to-r from-ember-400 to-ember-600 bg-clip-text text-transparent">{{name}}</span>
|
|
79
|
+
</span>
|
|
80
|
+
}
|
|
81
|
+
navItems={[
|
|
82
|
+
{ label: 'Home', href: '/' },
|
|
83
|
+
{ label: 'About', href: '/about' },
|
|
84
|
+
{ label: 'Docs', href: 'https://emberkit.dev/docs', external: true },
|
|
85
|
+
]}
|
|
86
|
+
>
|
|
87
|
+
{children}
|
|
88
|
+
</DefaultLayout>
|
|
89
|
+
</div>
|
|
90
|
+
</>
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export default Layout;`,
|
|
95
|
+
"src/routes/index.tsx": `import type { RouteComponent } from '@emberkit/core';
|
|
96
|
+
import { Button, Card, Heading, Text, Badge, Input } from '@emberkit/ui';
|
|
97
|
+
import { signal } from '@emberkit/core';
|
|
98
|
+
|
|
99
|
+
const HomePage: RouteComponent = () => {
|
|
100
|
+
const email = signal('');
|
|
101
|
+
const activeTab = signal('buttons');
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<div className="relative space-y-24">
|
|
105
|
+
{/* Hero */}
|
|
106
|
+
<section className="relative text-center py-20">
|
|
107
|
+
<div className="pointer-events-none absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 h-[400px] w-[400px] rounded-full bg-ember-500/15 blur-[150px] animate-pulse-glow" />
|
|
108
|
+
|
|
109
|
+
<div className="relative z-10 animate-fade-in-down">
|
|
110
|
+
<Badge variant="primary" className="mb-6 inline-flex">
|
|
111
|
+
✨ Built with EmberKit UI
|
|
112
|
+
</Badge>
|
|
113
|
+
<Heading level="h1" size="4xl" weight="bold" className="mb-6">
|
|
114
|
+
Welcome to {' '}
|
|
115
|
+
<span className="bg-gradient-to-r from-ember-400 via-ember-500 to-amber-500 bg-clip-text text-transparent">
|
|
116
|
+
{{name}}
|
|
117
|
+
</span>
|
|
118
|
+
</Heading>
|
|
119
|
+
<Text size="xl" color="muted" className="max-w-2xl mx-auto mb-10">
|
|
120
|
+
A modern starter template with EmberKit UI components and Tailwind CSS.
|
|
121
|
+
Build beautiful interfaces with our pre-built component library.
|
|
122
|
+
</Text>
|
|
123
|
+
<div className="flex gap-4 justify-center">
|
|
124
|
+
<Button variant="primary" size="lg" className="shadow-lg shadow-ember-500/20 hover:shadow-ember-500/40 transition-shadow">
|
|
125
|
+
Get Started
|
|
126
|
+
</Button>
|
|
127
|
+
<Button variant="secondary" size="lg">
|
|
128
|
+
View Docs →
|
|
129
|
+
</Button>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</section>
|
|
133
|
+
|
|
134
|
+
{/* Features Grid */}
|
|
135
|
+
<section>
|
|
136
|
+
<Heading level="h2" size="2xl" weight="semibold" className="mb-2 text-center">
|
|
137
|
+
Why EmberKit?
|
|
138
|
+
</Heading>
|
|
139
|
+
<Text color="muted" className="text-center mb-10 max-w-lg mx-auto">
|
|
140
|
+
Everything you need to build fast, beautiful web applications.
|
|
141
|
+
</Text>
|
|
142
|
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
|
|
143
|
+
{[
|
|
144
|
+
{ icon: '⚡', title: 'Lightning Fast', desc: 'Sub-10KB runtime with tree-shakeable architecture' },
|
|
145
|
+
{ icon: '🔯', title: 'TypeScript First', desc: 'Full type safety with intelligent autocomplete' },
|
|
146
|
+
{ icon: '🛖', title: 'File-Based Routing', desc: 'Routes automatically created from your file structure' },
|
|
147
|
+
].map((f, i) => (
|
|
148
|
+
<Card key={f.title} padding="lg" className="relative group hover:border-ember-500/50 transition-all duration-300 hover:-translate-y-1" style={{ animationDelay: \`\${i * 100}ms\` }}>
|
|
149
|
+
<div className="absolute inset-0 rounded-xl bg-gradient-to-br from-ember-500/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity" />
|
|
150
|
+
<div className="relative">
|
|
151
|
+
<div className="w-12 h-12 rounded-xl bg-ember-500/10 flex items-center justify-center text-2xl mb-4 group-hover:scale-110 transition-transform">
|
|
152
|
+
{f.icon}
|
|
153
|
+
</div>
|
|
154
|
+
<Heading level="h3" size="lg" weight="semibold" className="mb-2">
|
|
155
|
+
{f.title}
|
|
156
|
+
</Heading>
|
|
157
|
+
<Text color="muted">{f.desc}</Text>
|
|
158
|
+
</div>
|
|
159
|
+
</Card>
|
|
160
|
+
))}
|
|
161
|
+
</div>
|
|
162
|
+
</section>
|
|
163
|
+
|
|
164
|
+
{/* Component Showcase */}
|
|
165
|
+
<section>
|
|
166
|
+
<Heading level="h2" size="2xl" weight="semibold" className="mb-2 text-center">
|
|
167
|
+
UI Components
|
|
168
|
+
</Heading>
|
|
169
|
+
<Text color="muted" className="text-center mb-8">
|
|
170
|
+
Explore our pre-built component library.
|
|
171
|
+
</Text>
|
|
172
|
+
|
|
173
|
+
{/* Tabs */}
|
|
174
|
+
<div className="flex justify-center mb-8">
|
|
175
|
+
<div className="inline-flex p-1 rounded-lg bg-slate-800/50 border border-slate-700/50">
|
|
176
|
+
{[
|
|
177
|
+
{ id: 'buttons', label: 'Buttons' },
|
|
178
|
+
{ id: 'cards', label: 'Cards' },
|
|
179
|
+
{ id: 'forms', label: 'Forms' },
|
|
180
|
+
].map((tab) => (
|
|
181
|
+
<button
|
|
182
|
+
key={tab.id}
|
|
183
|
+
className={\`px-4 py-2 text-sm font-medium rounded-md transition-all \${activeTab.value === tab.id ? 'bg-ember-500 text-white shadow-md' : 'text-slate-400 hover:text-slate-200'}\`}
|
|
184
|
+
onClick={() => { activeTab.value = tab.id; }}
|
|
185
|
+
>
|
|
186
|
+
{tab.label}
|
|
187
|
+
</button>
|
|
188
|
+
))}
|
|
189
|
+
</div>
|
|
190
|
+
</div>
|
|
191
|
+
|
|
192
|
+
{/* Tab Content */}
|
|
193
|
+
{activeTab.value === 'buttons' && (
|
|
194
|
+
<Card padding="xl" className="max-w-2xl mx-auto">
|
|
195
|
+
<div className="text-center mb-6">
|
|
196
|
+
<Badge variant="primary" className="mb-2">Buttons</Badge>
|
|
197
|
+
<Heading level="h3" size="lg" weight="semibold">Button Variants</Heading>
|
|
198
|
+
</div>
|
|
199
|
+
<div className="flex flex-wrap gap-3 justify-center">
|
|
200
|
+
<Button variant="primary">Primary</Button>
|
|
201
|
+
<Button variant="secondary">Secondary</Button>
|
|
202
|
+
<Button variant="ghost">Ghost</Button>
|
|
203
|
+
<Button variant="primary" size="sm">Small</Button>
|
|
204
|
+
<Button variant="secondary" size="lg">Large</Button>
|
|
205
|
+
</div>
|
|
206
|
+
<div className="mt-6 pt-6 border-t border-slate-700/50">
|
|
207
|
+
<Heading level="h4" size="sm" weight="semibold" className="mb-3 text-slate-400">With Icons</Heading>
|
|
208
|
+
<div className="flex flex-wrap gap-3 justify-center">
|
|
209
|
+
<Button variant="primary">⚡ Get Started</Button>
|
|
210
|
+
<Button variant="secondary">Learn More →</Button>
|
|
211
|
+
<Button variant="ghost">❤ Like</Button>
|
|
212
|
+
</div>
|
|
213
|
+
</div>
|
|
214
|
+
</Card>
|
|
215
|
+
)}
|
|
216
|
+
|
|
217
|
+
{activeTab.value === 'cards' && (
|
|
218
|
+
<div className="grid md:grid-cols-2 gap-6 max-w-3xl mx-auto">
|
|
219
|
+
<Card padding="lg" className="hover:border-ember-500/50 transition-colors">
|
|
220
|
+
<Badge variant="success" className="mb-3">Analytics</Badge>
|
|
221
|
+
<Heading level="h3" size="lg" weight="semibold" className="mb-2">
|
|
222
|
+
Revenue Growth
|
|
223
|
+
</Heading>
|
|
224
|
+
<div className="text-3xl font-bold text-ember-400 mb-1">$45,231</div>
|
|
225
|
+
<Text color="muted" className="text-sm">+20.1% from last month</Text>
|
|
226
|
+
<div className="mt-4 h-2 rounded-full bg-slate-700 overflow-hidden">
|
|
227
|
+
<div className="h-full w-3/4 rounded-full bg-gradient-to-r from-ember-500 to-amber-500" />
|
|
228
|
+
</div>
|
|
229
|
+
</Card>
|
|
230
|
+
<Card padding="lg" className="hover:border-ember-500/50 transition-colors">
|
|
231
|
+
<Badge variant="info" className="mb-3">Users</Badge>
|
|
232
|
+
<Heading level="h3" size="lg" weight="semibold" className="mb-2">
|
|
233
|
+
Active Users
|
|
234
|
+
</Heading>
|
|
235
|
+
<div className="text-3xl font-bold text-blue-400 mb-1">2,338</div>
|
|
236
|
+
<Text color="muted" className="text-sm">+15.3% from last month</Text>
|
|
237
|
+
<div className="mt-4 h-2 rounded-full bg-slate-700 overflow-hidden">
|
|
238
|
+
<div className="h-full w-1/2 rounded-full bg-gradient-to-r from-blue-500 to-cyan-500" />
|
|
239
|
+
</div>
|
|
240
|
+
</Card>
|
|
241
|
+
</div>
|
|
242
|
+
)}
|
|
243
|
+
|
|
244
|
+
{activeTab.value === 'forms' && (
|
|
245
|
+
<Card padding="xl" className="max-w-md mx-auto">
|
|
246
|
+
<div className="text-center mb-6">
|
|
247
|
+
<Badge variant="info" className="mb-2">Forms</Badge>
|
|
248
|
+
<Heading level="h3" size="lg" weight="semibold">Newsletter Signup</Heading>
|
|
249
|
+
</div>
|
|
250
|
+
<div className="space-y-4">
|
|
251
|
+
<Input
|
|
252
|
+
label="Name"
|
|
253
|
+
placeholder="John Doe"
|
|
254
|
+
/>
|
|
255
|
+
<Input
|
|
256
|
+
label="Email"
|
|
257
|
+
type="email"
|
|
258
|
+
placeholder="you@example.com"
|
|
259
|
+
value={email.value}
|
|
260
|
+
onChange={(e) => { email.value = e.currentTarget.value; }}
|
|
261
|
+
/>
|
|
262
|
+
<Button variant="primary" className="w-full shadow-lg shadow-ember-500/20">
|
|
263
|
+
Subscribe ➤
|
|
264
|
+
</Button>
|
|
265
|
+
</div>
|
|
266
|
+
</Card>
|
|
267
|
+
)}
|
|
268
|
+
</section>
|
|
269
|
+
|
|
270
|
+
{/* CTA */}
|
|
271
|
+
<section className="relative py-20">
|
|
272
|
+
<div className="pointer-events-none absolute inset-0 flex items-center justify-center">
|
|
273
|
+
<div className="w-[500px] h-[200px] rounded-full bg-ember-500/10 blur-[100px]" />
|
|
274
|
+
</div>
|
|
275
|
+
<div className="relative z-10 text-center">
|
|
276
|
+
<Heading level="h2" size="2xl" weight="semibold" className="mb-4">
|
|
277
|
+
Ready to build something amazing?
|
|
278
|
+
</Heading>
|
|
279
|
+
<Text color="muted" className="max-w-xl mx-auto mb-8">
|
|
280
|
+
Start building your next project with EmberKit's powerful components and TypeScript-first API.
|
|
281
|
+
</Text>
|
|
282
|
+
<Button variant="primary" size="lg" className="shadow-lg shadow-ember-500/25 hover:shadow-ember-500/40 transition-shadow">
|
|
283
|
+
Create Project ➤
|
|
284
|
+
</Button>
|
|
285
|
+
</div>
|
|
286
|
+
</section>
|
|
287
|
+
</div>
|
|
288
|
+
);
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
export default HomePage;`,
|
|
292
|
+
"src/routes/about.tsx": `import type { RouteComponent } from '@emberkit/core';
|
|
293
|
+
import { Head } from '@emberkit/core';
|
|
294
|
+
import { Heading, Text, Button, Card, Badge } from '@emberkit/ui';
|
|
295
|
+
|
|
296
|
+
const AboutPage: RouteComponent = () => {
|
|
297
|
+
return (
|
|
298
|
+
<>
|
|
299
|
+
<Head>
|
|
300
|
+
<title>About - {{name}}</title>
|
|
301
|
+
</Head>
|
|
302
|
+
<div className="max-w-3xl mx-auto py-12 space-y-12">
|
|
303
|
+
{/* Header */}
|
|
304
|
+
<div className="text-center">
|
|
305
|
+
<Badge variant="primary" className="mb-4 inline-flex">About</Badge>
|
|
306
|
+
<Heading level="h1" size="3xl" weight="bold">
|
|
307
|
+
About {' '}
|
|
308
|
+
<span className="bg-gradient-to-r from-ember-400 to-ember-600 bg-clip-text text-transparent">{{name}}</span>
|
|
309
|
+
</Heading>
|
|
310
|
+
</div>
|
|
311
|
+
|
|
312
|
+
{/* Description */}
|
|
313
|
+
<Card padding="xl" className="border-ember-500/20">
|
|
314
|
+
<Text size="lg" color="muted" className="leading-relaxed">
|
|
315
|
+
This project was created with EmberKit and the UI component library.
|
|
316
|
+
It demonstrates how to build modern, beautiful interfaces with our
|
|
317
|
+
pre-built components and Tailwind CSS.
|
|
318
|
+
</Text>
|
|
319
|
+
</Card>
|
|
320
|
+
|
|
321
|
+
{/* Features */}
|
|
322
|
+
<div className="grid sm:grid-cols-2 gap-4">
|
|
323
|
+
{[
|
|
324
|
+
{ icon: '🔌', title: 'TypeScript-first', desc: 'Full type safety with intelligent autocomplete' },
|
|
325
|
+
{ icon: '🎨', title: 'UI Components', desc: 'Pre-built atoms, molecules, and organisms' },
|
|
326
|
+
{ icon: '🌈', title: 'Tailwind CSS', desc: 'Utility-first styling with custom theme' },
|
|
327
|
+
{ icon: '🛖', title: 'File Routing', desc: 'Automatic routes from your file structure' },
|
|
328
|
+
].map((f) => (
|
|
329
|
+
<Card key={f.title} padding="lg" className="hover:border-ember-500/50 transition-all hover:-translate-y-0.5">
|
|
330
|
+
<div className="text-2xl mb-3">{f.icon}</div>
|
|
331
|
+
<Heading level="h3" size="md" weight="semibold" className="mb-1">
|
|
332
|
+
{f.title}
|
|
333
|
+
</Heading>
|
|
334
|
+
<Text color="muted" size="sm">{f.desc}</Text>
|
|
335
|
+
</Card>
|
|
336
|
+
))}
|
|
337
|
+
</div>
|
|
338
|
+
|
|
339
|
+
{/* Tech Stack */}
|
|
340
|
+
<Card padding="xl">
|
|
341
|
+
<Heading level="h3" size="lg" weight="semibold" className="mb-4 text-center">
|
|
342
|
+
Tech Stack
|
|
343
|
+
</Heading>
|
|
344
|
+
<div className="flex flex-wrap gap-2 justify-center">
|
|
345
|
+
{['EmberKit', 'TypeScript', 'Tailwind CSS', 'Vite', 'JSX'].map((tech) => (
|
|
346
|
+
<Badge key={tech} variant="primary" className="px-3 py-1.5">
|
|
347
|
+
{tech}
|
|
348
|
+
</Badge>
|
|
349
|
+
))}
|
|
350
|
+
</div>
|
|
351
|
+
</Card>
|
|
352
|
+
|
|
353
|
+
{/* Back */}
|
|
354
|
+
<div className="text-center">
|
|
355
|
+
<Button variant="secondary">
|
|
356
|
+
← Back to Home
|
|
357
|
+
</Button>
|
|
358
|
+
</div>
|
|
359
|
+
</div>
|
|
360
|
+
</>
|
|
361
|
+
);
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
export default AboutPage;`,
|
|
365
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export const signalTemplate = `import { signal, computed, effect } from '@emberkit/core';
|
|
2
|
+
|
|
3
|
+
// Writable signal
|
|
4
|
+
const count = signal(0);
|
|
5
|
+
|
|
6
|
+
// Computed value
|
|
7
|
+
const doubled = computed(() => count.value * 2);
|
|
8
|
+
|
|
9
|
+
// Side effect
|
|
10
|
+
effect(() => {
|
|
11
|
+
console.log('Count changed to:', count.value);
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
// Update
|
|
15
|
+
count.value++;
|
|
16
|
+
|
|
17
|
+
// Batch updates
|
|
18
|
+
import { batch } from '@emberkit/core';
|
|
19
|
+
|
|
20
|
+
batch(() => {
|
|
21
|
+
count.value = 10;
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export { count, doubled };
|
|
25
|
+
`;
|
package/dist/utils/generator.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, writeFileSync } from "fs";
|
|
2
2
|
import { dirname, join } from "path";
|
|
3
3
|
import { formatTemplate, toKebabCase } from "../templates/index.js";
|
|
4
|
-
import { routeTemplate } from "../templates/route.js";
|
|
5
|
-
import { componentTemplate } from "../templates/component.js";
|
|
6
|
-
import { layoutTemplate } from "../templates/layout.js";
|
|
7
|
-
import { errorBoundaryTemplate } from "../templates/errorBoundary.js";
|
|
8
|
-
import { loaderTemplate } from "../templates/loader.js";
|
|
9
|
-
import { actionTemplate } from "../templates/action.js";
|
|
10
|
-
import { apiRouteTemplate } from "../templates/apiRoute.js";
|
|
11
|
-
import { configTemplate } from "../templates/config.js";
|
|
12
|
-
import { indexTemplate } from "../templates/entry.js";
|
|
13
|
-
import { layoutRoutesTemplate } from "../templates/layoutRoutes.js";
|
|
14
|
-
import { signalTemplate } from "../templates/signal.js";
|
|
15
|
-
import { contextTemplate } from "../templates/context.js";
|
|
16
|
-
import { formTemplate } from "../templates/form.js";
|
|
4
|
+
import { routeTemplate } from "../templates/route/index.js";
|
|
5
|
+
import { componentTemplate } from "../templates/component/index.js";
|
|
6
|
+
import { layoutTemplate } from "../templates/layout/index.js";
|
|
7
|
+
import { errorBoundaryTemplate } from "../templates/errorBoundary/index.js";
|
|
8
|
+
import { loaderTemplate } from "../templates/loader/index.js";
|
|
9
|
+
import { actionTemplate } from "../templates/action/index.js";
|
|
10
|
+
import { apiRouteTemplate } from "../templates/apiRoute/index.js";
|
|
11
|
+
import { configTemplate } from "../templates/config/index.js";
|
|
12
|
+
import { indexTemplate } from "../templates/entry/index.js";
|
|
13
|
+
import { layoutRoutesTemplate } from "../templates/layoutRoutes/index.js";
|
|
14
|
+
import { signalTemplate } from "../templates/signal/index.js";
|
|
15
|
+
import { contextTemplate } from "../templates/context/index.js";
|
|
16
|
+
import { formTemplate } from "../templates/form/index.js";
|
|
17
17
|
export async function generate(options) {
|
|
18
18
|
const { name, path, template, params = {} } = options;
|
|
19
19
|
const fullPath = join(process.cwd(), path);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emberkit/cli",
|
|
3
|
-
"version": "0.6.0",
|
|
3
|
+
"version": "0.6.1-alpha.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "CLI tool for EmberKit projects",
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"commander": "^11.1.0",
|
|
41
40
|
"inquirer": "^9.2.0"
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|