@igniter-js/cli 0.1.0 → 0.1.2
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/index.js +12 -1
- package/dist/templates/copilot.feature.instructions.hbs +145 -0
- package/dist/templates/copilot.igniter.instructions.hbs +753 -0
- package/dist/templates/copilot.next.instructions.hbs +67 -0
- package/dist/templates/copilot.review.instructions.hbs +42 -0
- package/dist/templates/copilot.test.instructions.hbs +55 -0
- package/dist/templates/eslintrc.hbs +5 -2
- package/dist/templates/feature.controller.hbs +3 -1
- package/dist/templates/feature.interface.hbs +33 -23
- package/dist/templates/globals.hbs +1 -1
- package/dist/templates/layout.hbs +15 -22
- package/dist/templates/page.hbs +76 -239
- package/dist/templates/route.hbs +4 -0
- package/dist/templates/vscode.settings.hbs +50 -0
- package/dist/utils/consts.d.ts +5 -7
- package/dist/utils/consts.js +11 -8
- package/dist/utils/handlebars-helpers.js +20 -0
- package/dist/utils/prisma-schema-parser.d.ts +1 -0
- package/dist/utils/prisma-schema-parser.js +92 -29
- package/package.json +1 -1
package/dist/templates/page.hbs
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import Link from "next/link"
|
|
5
|
+
|
|
1
6
|
import { Badge } from "@/core/design-system/badge"
|
|
2
7
|
import { Button } from "@/core/design-system/button"
|
|
3
|
-
import { Card, CardContent
|
|
4
|
-
import { ArrowRight, Code2, Github,
|
|
8
|
+
import { Card, CardContent } from "@/core/design-system/card"
|
|
9
|
+
import { ArrowRight, ChevronDown, Code2, Github, Twitter, Youtube } from "lucide-react"
|
|
5
10
|
import { FileText } from "lucide-react"
|
|
6
|
-
import {
|
|
11
|
+
import { Moon, Sun } from "lucide-react"
|
|
12
|
+
import { useTheme } from "next-themes"
|
|
13
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/core/design-system/dropdown-menu"
|
|
7
14
|
|
|
8
|
-
export default
|
|
15
|
+
export default function Home() {
|
|
9
16
|
return (
|
|
10
17
|
<div className="min-h-screen flex flex-col pt-12 space-y-12">
|
|
11
18
|
<header className="max-w-2xl w-full space-y-8 mx-auto my-auto">
|
|
@@ -15,15 +22,15 @@ export default async function Home() {
|
|
|
15
22
|
</Badge>
|
|
16
23
|
|
|
17
24
|
<h1 className="text-4xl sm:text-5xl font-bold tracking-tight bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent">
|
|
18
|
-
Welcome to <br />Igniter
|
|
25
|
+
Welcome to <br />Igniter Boilerplate
|
|
19
26
|
</h1>
|
|
20
27
|
<p className="text-base sm:text-lg text-muted-foreground max-w-md mx-auto leading-relaxed">
|
|
21
|
-
|
|
28
|
+
Igniter is a modern, type-safe HTTP framework designed to streamline the development of scalable TypeScript applications.
|
|
22
29
|
</p>
|
|
23
30
|
|
|
24
31
|
<div className="flex items-center justify-center gap-4">
|
|
25
32
|
<Button variant="outline" size="icon" asChild>
|
|
26
|
-
<a href="https://github.com/
|
|
33
|
+
<a href="https://github.com/felipebarcelospro/igniter-js" target="_blank" rel="noopener noreferrer">
|
|
27
34
|
<Github className="h-4 w-4" />
|
|
28
35
|
<span className="sr-only">GitHub Repository</span>
|
|
29
36
|
</a>
|
|
@@ -35,194 +42,18 @@ export default async function Home() {
|
|
|
35
42
|
</a>
|
|
36
43
|
</Button>
|
|
37
44
|
<Button variant="outline" size="icon" asChild>
|
|
38
|
-
<a href="https://youtube.com/@
|
|
45
|
+
<a href="https://youtube.com/@vibedev.official" target="_blank" rel="noopener noreferrer">
|
|
39
46
|
<Youtube className="h-4 w-4" />
|
|
40
47
|
<span className="sr-only">YouTube Channel</span>
|
|
41
48
|
</a>
|
|
42
49
|
</Button>
|
|
43
50
|
</div>
|
|
44
51
|
</div>
|
|
45
|
-
<section aria-labelledby="getting-started-title" className="relative">
|
|
46
|
-
<div className="absolute inset-0 bg-gradient-to-b from-transparent to-background/10 pointer-events-none" aria-hidden="true" />
|
|
47
|
-
<Card className="rounded-3xl shadow-lg backdrop-blur-sm border bg-card/50 overflow-hidden">
|
|
48
|
-
<CardContent className="p-6 sm:p-8">
|
|
49
|
-
<Tabs defaultValue="getting-started" className="space-y-6 flex flex-col items-center">
|
|
50
|
-
<TabsList className="inline-flex h-12 items-center justify-center rounded-full bg-muted p-1 text-muted-foreground">
|
|
51
|
-
<TabsTrigger
|
|
52
|
-
value="getting-started"
|
|
53
|
-
className="inline-flex w-fit items-center justify-center whitespace-nowrap rounded-full px-6 py-2.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm"
|
|
54
|
-
>
|
|
55
|
-
<Code2 className="mr-2 h-4 w-4" />
|
|
56
|
-
Getting Started
|
|
57
|
-
</TabsTrigger>
|
|
58
|
-
<TabsTrigger
|
|
59
|
-
value="first-feature"
|
|
60
|
-
className="inline-flex items-center justify-center whitespace-nowrap rounded-full px-6 py-2.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm"
|
|
61
|
-
>
|
|
62
|
-
<FileText className="mr-2 h-4 w-4" />
|
|
63
|
-
First Feature
|
|
64
|
-
</TabsTrigger>
|
|
65
|
-
<TabsTrigger
|
|
66
|
-
value="extensions"
|
|
67
|
-
className="inline-flex items-center justify-center whitespace-nowrap rounded-full px-6 py-2.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm"
|
|
68
|
-
>
|
|
69
|
-
<SparkleIcon className="mr-2 h-4 w-4" />
|
|
70
|
-
Add your first Spark (Comming Soon)
|
|
71
|
-
</TabsTrigger>
|
|
72
|
-
</TabsList>
|
|
73
|
-
|
|
74
|
-
<TabsContent value="getting-started" className="space-y-6 w-full">
|
|
75
|
-
<div className="space-y-2 text-center flex flex-col items-center justify-center">
|
|
76
|
-
<h2 className="text-2xl font-bold tracking-tight">Getting Started</h2>
|
|
77
|
-
<p className="text-muted-foreground">Follow these steps to set up your development environment.</p>
|
|
78
|
-
</div>
|
|
79
|
-
|
|
80
|
-
<div className="space-y-4">
|
|
81
|
-
<div className="group rounded-2xl border p-4 transition-colors hover:bg-accent">
|
|
82
|
-
<p className="font-medium text-foreground mb-2">1. Install dependencies</p>
|
|
83
|
-
<code className="relative rounded-xl bg-muted border px-4 py-3 font-mono text-sm block group-hover:border-accent transition-colors">
|
|
84
|
-
npm install
|
|
85
|
-
</code>
|
|
86
|
-
</div>
|
|
87
|
-
|
|
88
|
-
<div className="group rounded-2xl border p-4 transition-colors hover:bg-accent">
|
|
89
|
-
<p className="font-medium text-foreground mb-2">2. Start development server</p>
|
|
90
|
-
<code className="relative rounded-xl bg-muted border px-4 py-3 font-mono text-sm block group-hover:border-accent transition-colors">
|
|
91
|
-
npm run dev
|
|
92
|
-
</code>
|
|
93
|
-
</div>
|
|
94
|
-
|
|
95
|
-
<div className="group rounded-2xl border p-4 transition-colors hover:bg-accent">
|
|
96
|
-
<p className="font-medium text-foreground mb-2">3. View your application</p>
|
|
97
|
-
<div className="flex items-center gap-2">
|
|
98
|
-
<span className="h-2 w-2 rounded-full bg-green-500 animate-pulse"></span>
|
|
99
|
-
<code className="text-primary">http://localhost:3000</code>
|
|
100
|
-
</div>
|
|
101
|
-
</div>
|
|
102
|
-
</div>
|
|
103
|
-
</TabsContent>
|
|
104
|
-
|
|
105
|
-
<TabsContent value="first-feature" className="space-y-6 w-full">
|
|
106
|
-
<div className="space-y-2 text-center flex flex-col items-center justify-center">
|
|
107
|
-
<h2 className="text-2xl font-bold tracking-tight">Create Your First Feature</h2>
|
|
108
|
-
<p className="text-muted-foreground">Follow these steps to create and configure a new feature.</p>
|
|
109
|
-
</div>
|
|
110
|
-
|
|
111
|
-
<div className="space-y-4">
|
|
112
|
-
<div className="group rounded-2xl border p-4 transition-colors hover:bg-accent">
|
|
113
|
-
<p className="font-medium text-foreground mb-2">1. Add your entity on schema.prisma</p>
|
|
114
|
-
<code className="relative rounded-xl bg-muted border px-4 py-3 font-mono text-sm block group-hover:border-accent transition-colors">
|
|
115
|
-
{`// Example:
|
|
116
|
-
model Post {
|
|
117
|
-
id Int @id @default(autoincrement())
|
|
118
|
-
title String
|
|
119
|
-
content String?
|
|
120
|
-
createdAt DateTime @default(now())
|
|
121
|
-
updatedAt DateTime @updatedAt
|
|
122
|
-
}`}
|
|
123
|
-
</code>
|
|
124
|
-
</div>
|
|
125
|
-
|
|
126
|
-
<div className="group rounded-2xl border p-4 transition-colors hover:bg-accent">
|
|
127
|
-
<p className="font-medium text-foreground mb-2">2. Run CLI and select features to generate</p>
|
|
128
|
-
<code className="relative rounded-xl bg-muted border px-4 py-3 font-mono text-sm block group-hover:border-accent transition-colors">
|
|
129
|
-
igniter generate feature
|
|
130
|
-
</code>
|
|
131
|
-
</div>
|
|
132
|
-
|
|
133
|
-
<div className="group rounded-2xl border p-4 transition-colors hover:bg-accent">
|
|
134
|
-
<p className="font-medium text-foreground mb-2">4. Add to /src/igniter.router.ts</p>
|
|
135
|
-
<code className="relative rounded-xl bg-muted border px-4 py-3 font-mono text-sm block group-hover:border-accent transition-colors">
|
|
136
|
-
{`// Example:
|
|
137
|
-
import { PostFeature } from '@/features/post'
|
|
138
|
-
|
|
139
|
-
export const router = new IgniterRouter()
|
|
140
|
-
.use(postFeature.controller)
|
|
141
|
-
`}
|
|
142
|
-
</code>
|
|
143
|
-
</div>
|
|
144
|
-
|
|
145
|
-
<div className="group rounded-2xl border p-4 transition-colors hover:bg-accent">
|
|
146
|
-
<p className="font-medium text-foreground mb-2">5. Use in your application</p>
|
|
147
|
-
<p className="text-sm text-muted-foreground">
|
|
148
|
-
{`// Server Component Example:
|
|
149
|
-
import { PostFeature } from '@/features/post'
|
|
150
|
-
|
|
151
|
-
export default async function Page() {
|
|
152
|
-
const getPosts = router.bind('post', 'get')
|
|
153
|
-
const posts = await getPosts()
|
|
154
|
-
|
|
155
|
-
return <pre>{JSON.stringify(posts, null, 2)}</pre>
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// Client Component Example:
|
|
159
|
-
'use client'
|
|
160
|
-
|
|
161
|
-
import { PostFeature } from '@/features/post'
|
|
162
|
-
import { useAction } from '@igniter/hooks'
|
|
163
|
-
|
|
164
|
-
export default function Page() {
|
|
165
|
-
const { data, execute } = useAction({
|
|
166
|
-
action: router.bind('post', 'get')
|
|
167
|
-
})
|
|
168
|
-
|
|
169
|
-
return (
|
|
170
|
-
<>
|
|
171
|
-
<button onClick={execute}>Load Posts</button>
|
|
172
|
-
<pre>{JSON.stringify(data, null, 2)}</pre>
|
|
173
|
-
</>
|
|
174
|
-
)
|
|
175
|
-
}
|
|
176
|
-
`}
|
|
177
|
-
</p >
|
|
178
|
-
</div>
|
|
179
|
-
</div>
|
|
180
|
-
</TabsContent>
|
|
181
|
-
|
|
182
|
-
<TabsContent value="extensions" className="space-y-6 w-full">
|
|
183
|
-
<div className="space-y-2 text-center flex flex-col items-center justify-center">
|
|
184
|
-
<h2 className="text-2xl font-bold tracking-tight">Ignite Sparks</h2>
|
|
185
|
-
<p className="text-muted-foreground">Add powerful features that ignite your application.</p>
|
|
186
|
-
</div>
|
|
187
|
-
|
|
188
|
-
<div className="space-y-4">
|
|
189
|
-
<div className="group rounded-2xl border p-4 transition-colors hover:bg-accent">
|
|
190
|
-
<p className="font-medium text-foreground mb-2">1. Discover available Sparks</p>
|
|
191
|
-
<code className="relative rounded-xl bg-muted border px-4 py-3 font-mono text-sm block group-hover:border-accent transition-colors">
|
|
192
|
-
npm run igniter spark:list
|
|
193
|
-
</code>
|
|
194
|
-
</div>
|
|
195
|
-
|
|
196
|
-
<div className="group rounded-2xl border p-4 transition-colors hover:bg-accent">
|
|
197
|
-
<p className="font-medium text-foreground mb-2">2. Ignite a single Spark</p>
|
|
198
|
-
<code className="relative rounded-xl bg-muted border px-4 py-3 font-mono text-sm block group-hover:border-accent transition-colors">
|
|
199
|
-
npm run igniter spark:add auth
|
|
200
|
-
</code>
|
|
201
|
-
</div>
|
|
202
|
-
|
|
203
|
-
<div className="group rounded-2xl border p-4 transition-colors hover:bg-accent">
|
|
204
|
-
<p className="font-medium text-foreground mb-2">3. Ignite multiple Sparks</p>
|
|
205
|
-
<code className="relative rounded-xl bg-muted border px-4 py-3 font-mono text-sm block group-hover:border-accent transition-colors">
|
|
206
|
-
npm run igniter spark:add email storage payment
|
|
207
|
-
</code>
|
|
208
|
-
</div>
|
|
209
|
-
</div>
|
|
210
|
-
</TabsContent>
|
|
211
|
-
</Tabs>
|
|
212
|
-
</CardContent>
|
|
213
|
-
<CardFooter className="flex flex-col items-center justify-center border-t pt-8">
|
|
214
|
-
<Button variant="outline" size="lg" className="w-full rounded-xl">
|
|
215
|
-
Read Docs
|
|
216
|
-
<ArrowRight className="w-4 h-4 ml-auto" aria-hidden="true" />
|
|
217
|
-
</Button>
|
|
218
|
-
</CardFooter>
|
|
219
|
-
</Card>
|
|
220
|
-
</section>
|
|
221
52
|
|
|
222
53
|
<section className="grid gap-4 sm:grid-cols-2" aria-label="Resources">
|
|
223
54
|
<article>
|
|
224
55
|
<Card className="rounded-2xl shadow-sm hover:shadow-md transition-shadow bg-card">
|
|
225
|
-
<CardContent className="
|
|
56
|
+
<CardContent className="space-y-2">
|
|
226
57
|
<span className="h-10 w-10 rounded-lg border border-cyan-300/10 bg-cyan-500/10 flex items-center justify-center mb-4">
|
|
227
58
|
<FileText className="w-5 h-5 text-cyan-500" aria-hidden="true" />
|
|
228
59
|
</span>
|
|
@@ -232,9 +63,11 @@ export default function Page() {
|
|
|
232
63
|
<p className="text-sm text-muted-foreground">
|
|
233
64
|
Learn more about Igniter Framework features and API.
|
|
234
65
|
</p>
|
|
235
|
-
<Button variant="outline" className="w-full !mt-8 rounded-xl">
|
|
236
|
-
|
|
237
|
-
|
|
66
|
+
<Button variant="outline" className="w-full !mt-8 rounded-xl" asChild>
|
|
67
|
+
<Link href="https://github.com/felipebarcelospro/igniter-js">
|
|
68
|
+
Read Docs
|
|
69
|
+
<ArrowRight className="w-4 h-4 ml-auto" aria-hidden="true" />
|
|
70
|
+
</Link>
|
|
238
71
|
</Button>
|
|
239
72
|
</CardContent>
|
|
240
73
|
</Card>
|
|
@@ -242,19 +75,21 @@ export default function Page() {
|
|
|
242
75
|
|
|
243
76
|
<article>
|
|
244
77
|
<Card className="rounded-2xl shadow-sm hover:shadow-md transition-shadow bg-card">
|
|
245
|
-
<CardContent className="
|
|
78
|
+
<CardContent className="space-y-2">
|
|
246
79
|
<span className="h-10 w-10 rounded-lg border border-cyan-300/10 bg-cyan-500/10 flex items-center justify-center mb-4">
|
|
247
80
|
<Code2 className="w-5 h-5 text-cyan-500" aria-hidden="true" />
|
|
248
81
|
</span>
|
|
249
82
|
<div className="flex items-center gap-2">
|
|
250
|
-
<h3 className="font-semibold">
|
|
83
|
+
<h3 className="font-semibold">Igniter CLI</h3>
|
|
251
84
|
</div>
|
|
252
85
|
<p className="text-sm text-muted-foreground">
|
|
253
|
-
|
|
86
|
+
Generate code and manage your Igniter projects.
|
|
254
87
|
</p>
|
|
255
|
-
<Button variant="outline" className="w-full !mt-8 rounded-xl">
|
|
256
|
-
|
|
257
|
-
|
|
88
|
+
<Button variant="outline" className="w-full !mt-8 rounded-xl" asChild>
|
|
89
|
+
<Link href="https://github.com/felipebarcelospro/igniter-cli">
|
|
90
|
+
Get Started
|
|
91
|
+
<ArrowRight className="w-4 h-4 ml-auto" aria-hidden="true" />
|
|
92
|
+
</Link>
|
|
258
93
|
</Button>
|
|
259
94
|
</CardContent>
|
|
260
95
|
</Card>
|
|
@@ -262,52 +97,54 @@ export default function Page() {
|
|
|
262
97
|
</section>
|
|
263
98
|
</header>
|
|
264
99
|
|
|
265
|
-
<footer className="border-t
|
|
266
|
-
<
|
|
267
|
-
<
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
aria-label="Visit Next.js website"
|
|
285
|
-
>
|
|
286
|
-
Next.js 15
|
|
287
|
-
</a>
|
|
288
|
-
{", "}
|
|
289
|
-
<a
|
|
290
|
-
href="https://www.prisma.io"
|
|
291
|
-
target="_blank"
|
|
292
|
-
rel="noopener noreferrer"
|
|
293
|
-
className="font-medium underline underline-offset-4 hover:text-primary transition-colors"
|
|
294
|
-
aria-label="Visit Prisma website"
|
|
295
|
-
>
|
|
296
|
-
Prisma
|
|
297
|
-
</a>
|
|
298
|
-
{", and "}
|
|
299
|
-
<a
|
|
300
|
-
href="https://zod.dev"
|
|
301
|
-
target="_blank"
|
|
302
|
-
rel="noopener noreferrer"
|
|
303
|
-
className="font-medium underline underline-offset-4 hover:text-primary transition-colors"
|
|
304
|
-
aria-label="Visit Zod website"
|
|
305
|
-
>
|
|
306
|
-
Zod
|
|
307
|
-
</a>
|
|
308
|
-
</p>
|
|
309
|
-
</nav>
|
|
100
|
+
<footer className="border-t py-6 text-center w-full text-sm text-muted-foreground">
|
|
101
|
+
<div className="container max-w-2xl mx-auto flex items-center justify-between">
|
|
102
|
+
<nav aria-label="Footer Links">
|
|
103
|
+
<p>
|
|
104
|
+
Built by{" "}
|
|
105
|
+
<a
|
|
106
|
+
href="https://x.com/feldbarcelospro"
|
|
107
|
+
target="_blank"
|
|
108
|
+
rel="noopener noreferrer"
|
|
109
|
+
className="font-medium underline underline-offset-4 hover:text-primary transition-colors"
|
|
110
|
+
aria-label="Visit shadcn/ui website"
|
|
111
|
+
>
|
|
112
|
+
@felipebarcelospro
|
|
113
|
+
</a>
|
|
114
|
+
</p>
|
|
115
|
+
</nav>
|
|
116
|
+
|
|
117
|
+
<ModeToggle />
|
|
118
|
+
</div>
|
|
310
119
|
</footer>
|
|
311
120
|
</div>
|
|
312
121
|
)
|
|
313
122
|
}
|
|
123
|
+
export function ModeToggle() {
|
|
124
|
+
const { setTheme, theme } = useTheme()
|
|
125
|
+
|
|
126
|
+
return (
|
|
127
|
+
<DropdownMenu>
|
|
128
|
+
<DropdownMenuTrigger asChild>
|
|
129
|
+
<Button variant="outline" className="space-x-2 flex items-center rounded-full">
|
|
130
|
+
<Sun className="h-[1.2rem] w-[1.2rem] transition-all dark:hidden dark:scale-0" />
|
|
131
|
+
<Moon className="h-[1.2rem] w-[1.2rem] transition-all hidden dark:flex dark:scale-100" />
|
|
132
|
+
<span>{theme === "light" ? "Light" : theme === "dark" ? "Dark" : "System"}</span>
|
|
133
|
+
|
|
134
|
+
<ChevronDown className="h-4 w-4 ml-auto" />
|
|
135
|
+
</Button>
|
|
136
|
+
</DropdownMenuTrigger>
|
|
137
|
+
<DropdownMenuContent align="end">
|
|
138
|
+
<DropdownMenuItem onClick={() => setTheme("light")}>
|
|
139
|
+
Light
|
|
140
|
+
</DropdownMenuItem>
|
|
141
|
+
<DropdownMenuItem onClick={() => setTheme("dark")}>
|
|
142
|
+
Dark
|
|
143
|
+
</DropdownMenuItem>
|
|
144
|
+
<DropdownMenuItem onClick={() => setTheme("system")}>
|
|
145
|
+
System
|
|
146
|
+
</DropdownMenuItem>
|
|
147
|
+
</DropdownMenuContent>
|
|
148
|
+
</DropdownMenu>
|
|
149
|
+
)
|
|
150
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Git Settings
|
|
3
|
+
"git.ignoreLimitWarning": true,
|
|
4
|
+
|
|
5
|
+
// Chat General Settings
|
|
6
|
+
"chat.promptFiles": true,
|
|
7
|
+
|
|
8
|
+
// GitHub Copilot Chat Settings
|
|
9
|
+
"github.copilot.chat.edits.codesearch.enabled": true, // Enable code search in chat edits
|
|
10
|
+
"github.copilot.chat.edits.suggestRelatedFilesFromGitHistory": true, // Suggest related files from git history
|
|
11
|
+
"github.copilot.chat.edits.temporalContext.enabled": true, // Enable temporal context in chat edits
|
|
12
|
+
|
|
13
|
+
// GitHub Copilot Instructions Configuration
|
|
14
|
+
"github.copilot.chat.codeGeneration.useInstructionFiles": true,
|
|
15
|
+
"github.copilot.chat.codeGeneration.instructions": [
|
|
16
|
+
{
|
|
17
|
+
"file": "/.github/copilot.instructions.md" // General instructions
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"file": "/.github/copilot.feature.instructions.md" // Feature-specific instructions
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"file": "/.github/copilot.igniter.instructions.md" // Igniter.js specific instructions
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"file": "/.github/copilot.next.instructions.md" // Next.js specific instructions
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
|
|
30
|
+
// Test Generation Instructions
|
|
31
|
+
"github.copilot.chat.testGeneration.instructions": [
|
|
32
|
+
{
|
|
33
|
+
"file": "/.github/copilot.test.instructions.md" // Test-specific instructions
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
|
|
37
|
+
// Code Review Instructions
|
|
38
|
+
"github.copilot.chat.reviewSelection.instructions": [
|
|
39
|
+
{
|
|
40
|
+
"file": "/.github/copilot.review.instructions.md" // Review-specific instructions
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
|
|
44
|
+
// Commit Message Configuration
|
|
45
|
+
"github.copilot.chat.commitMessageGeneration.instructions": [
|
|
46
|
+
{
|
|
47
|
+
"text": "Follow Conventional Commits format. For example, 'feat: add new feature'." // Commit message format instructions
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
package/dist/utils/consts.d.ts
CHANGED
|
@@ -7,18 +7,16 @@ export declare const PROJECT_STRUCTURE: {
|
|
|
7
7
|
'src/core/design-system': never[];
|
|
8
8
|
'src/core/utils': never[];
|
|
9
9
|
'src/core/providers': never[];
|
|
10
|
+
'src/app/api/[[...all]]': never[];
|
|
10
11
|
'src/features': string[];
|
|
11
12
|
};
|
|
12
|
-
export declare const LIA_FILES: {
|
|
13
|
-
'project_requirement.md': string;
|
|
14
|
-
'detailed_app_flow.md': string;
|
|
15
|
-
'tech_stack_and_packages.md': string;
|
|
16
|
-
'file_structure.md': string;
|
|
17
|
-
'schema_design.md': string;
|
|
18
|
-
};
|
|
19
13
|
export declare const DEPENDENCIES: {
|
|
20
14
|
required: string[];
|
|
21
15
|
};
|
|
16
|
+
export declare const LIA_FILES: {
|
|
17
|
+
name: string;
|
|
18
|
+
template: string;
|
|
19
|
+
}[];
|
|
22
20
|
export declare const CONFIG_FILES: {
|
|
23
21
|
name: string;
|
|
24
22
|
template: string;
|
package/dist/utils/consts.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.INTERACTIVE_COMMANDS = exports.CONFIG_FILES = exports.
|
|
3
|
+
exports.INTERACTIVE_COMMANDS = exports.CONFIG_FILES = exports.LIA_FILES = exports.DEPENDENCIES = exports.PROJECT_STRUCTURE = void 0;
|
|
4
4
|
exports.PROJECT_STRUCTURE = {
|
|
5
5
|
docs: ['.gitkeep'],
|
|
6
6
|
public: [],
|
|
@@ -10,18 +10,21 @@ exports.PROJECT_STRUCTURE = {
|
|
|
10
10
|
'src/core/design-system': [],
|
|
11
11
|
'src/core/utils': [],
|
|
12
12
|
'src/core/providers': [],
|
|
13
|
+
'src/app/api/[[...all]]': [],
|
|
13
14
|
'src/features': ['.gitkeep'],
|
|
14
15
|
};
|
|
15
|
-
exports.LIA_FILES = {
|
|
16
|
-
'project_requirement.md': '',
|
|
17
|
-
'detailed_app_flow.md': '',
|
|
18
|
-
'tech_stack_and_packages.md': '',
|
|
19
|
-
'file_structure.md': '',
|
|
20
|
-
'schema_design.md': ''
|
|
21
|
-
};
|
|
22
16
|
exports.DEPENDENCIES = {
|
|
23
17
|
required: ['docker', 'node', 'npm'],
|
|
24
18
|
};
|
|
19
|
+
exports.LIA_FILES = [
|
|
20
|
+
{ name: '.github/copilot.feature.instructions.md', template: 'copilot.feature.instructions.hbs' },
|
|
21
|
+
{ name: '.github/copilot.igniter.instructions.md', template: 'copilot.igniter.instructions.hbs' },
|
|
22
|
+
{ name: '.github/copilot.instructions.md', template: 'copilot.instructions.hbs' },
|
|
23
|
+
{ name: '.github/copilot.next.instructions.md', template: 'copilot.next.instructions.hbs' },
|
|
24
|
+
{ name: '.github/copilot.review.instructions.md', template: 'copilot.review.instructions.hbs' },
|
|
25
|
+
{ name: '.github/copilot.test.instructions.md', template: 'copilot.test.instructions.hbs' },
|
|
26
|
+
{ name: '.vscode/settings.json', template: 'vscode.settings.hbs' }
|
|
27
|
+
];
|
|
25
28
|
exports.CONFIG_FILES = [
|
|
26
29
|
{ name: 'README.md', template: 'readme' },
|
|
27
30
|
{ name: 'eslintrc.json', template: 'eslintrc' },
|
|
@@ -31,6 +31,17 @@ function registerHelpers() {
|
|
|
31
31
|
handlebars_1.default.registerHelper('lowerCase', (str) => {
|
|
32
32
|
return str.toLowerCase();
|
|
33
33
|
});
|
|
34
|
+
handlebars_1.default.registerHelper('getTypeFormat', (type, isRelation) => {
|
|
35
|
+
const primitiveTypes = ['string', 'number', 'boolean', 'date', 'datetime', 'any', 'bigint', 'undefined', 'null', 'never', 'unknown', 'void'];
|
|
36
|
+
const formattedType = type.toLowerCase();
|
|
37
|
+
if (formattedType === 'datetime') {
|
|
38
|
+
return 'Date';
|
|
39
|
+
}
|
|
40
|
+
if (primitiveTypes.includes(formattedType) && !isRelation) {
|
|
41
|
+
return formattedType;
|
|
42
|
+
}
|
|
43
|
+
return type;
|
|
44
|
+
});
|
|
34
45
|
/**
|
|
35
46
|
* Handlebars helper to compare if two values are equal
|
|
36
47
|
* @param {string} firstValue - First value to compare
|
|
@@ -40,4 +51,13 @@ function registerHelpers() {
|
|
|
40
51
|
handlebars_1.default.registerHelper('equals', (firstValue, secondValue) => {
|
|
41
52
|
return firstValue === secondValue;
|
|
42
53
|
});
|
|
54
|
+
/**
|
|
55
|
+
* Handlebars helper to concatenate two strings
|
|
56
|
+
*/
|
|
57
|
+
handlebars_1.default.registerHelper('concat', (str1, str2) => {
|
|
58
|
+
return str1 + str2;
|
|
59
|
+
});
|
|
60
|
+
handlebars_1.default.registerHelper('ne', (a, b) => {
|
|
61
|
+
return a !== b;
|
|
62
|
+
});
|
|
43
63
|
}
|