Skip to content

Commit 2755ab5

Browse files
authored
Merge pull request #4 from spivx/set-not-skipable
feat: add skippable property to wizard steps, IDEs, frameworks, and f…
2 parents be5fdab + 91baae8 commit 2755ab5

File tree

5 files changed

+46
-12
lines changed

5 files changed

+46
-12
lines changed

components/instructions-wizard.tsx

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ const mapAnswerSourceToWizard = (answer: DataAnswerSource): WizardAnswer => {
139139
isDefault: answer.isDefault,
140140
disabled: answer.disabled,
141141
disabledLabel: answer.disabledLabel,
142+
skippable: answer.skippable,
142143
}
143144
}
144145

@@ -154,6 +155,7 @@ const buildStepFromQuestionSet = (
154155
question: question.question,
155156
allowMultiple: question.allowMultiple,
156157
answers: question.answers.map(mapAnswerSourceToWizard),
158+
skippable: question.skippable,
157159
})),
158160
})
159161

@@ -165,6 +167,7 @@ const idesStep: WizardStep = {
165167
id: "preferredIdes",
166168
question: "Which IDEs should we prepare instructions for?",
167169
allowMultiple: true,
170+
skippable: false,
168171
answers: (rawIdes as IdeConfig[]).map((ide) => ({
169172
value: ide.id,
170173
label: ide.label,
@@ -179,6 +182,7 @@ const idesStep: WizardStep = {
179182
disabled: ide.enabled === false,
180183
disabledLabel: ide.enabled === false ? "Soon" : undefined,
181184
docs: ide.docs,
185+
skippable: ide.skippable,
182186
})),
183187
},
184188
],
@@ -191,13 +195,15 @@ const frameworksStep: WizardStep = {
191195
{
192196
id: FRAMEWORK_QUESTION_ID,
193197
question: "Which framework are you working with?",
198+
skippable: false,
194199
answers: (rawFrameworks as FrameworkConfig[]).map((framework) => ({
195200
value: framework.id,
196201
label: framework.label,
197202
icon: framework.icon,
198203
disabled: framework.enabled === false,
199204
disabledLabel: framework.enabled === false ? "Soon" : undefined,
200205
docs: framework.docs,
206+
skippable: framework.skippable,
201207
})),
202208
},
203209
],
@@ -241,6 +247,7 @@ const filesStep: WizardStep = {
241247
id: "outputFiles",
242248
question: "Which instruction files should we generate?",
243249
allowMultiple: true,
250+
skippable: false,
244251
answers: (filesData as FileOutputConfig[]).map((file) => {
245252
const infoLines: string[] = []
246253
if (file.filename) {
@@ -259,6 +266,7 @@ const filesStep: WizardStep = {
259266
tags: file.format ? [file.format] : undefined,
260267
disabled: file.enabled === false,
261268
disabledLabel: file.enabled === false ? "Soon" : undefined,
269+
skippable: file.skippable,
262270
}
263271
}),
264272
},
@@ -374,6 +382,7 @@ export function InstructionsWizard({ onClose }: InstructionsWizardProps) {
374382
id: question.id,
375383
question: question.question,
376384
allowMultiple: question.allowMultiple,
385+
skippable: question.skippable,
377386
answers: question.answers.map((answer) => {
378387
const infoLines: string[] = []
379388
if (answer.pros && answer.pros.length > 0) {
@@ -390,6 +399,7 @@ export function InstructionsWizard({ onClose }: InstructionsWizardProps) {
390399
example: answer.example,
391400
infoLines: infoLines.length > 0 ? infoLines : undefined,
392401
docs: answer.docs,
402+
skippable: answer.skippable,
393403
}
394404
}),
395405
}))
@@ -473,6 +483,10 @@ export function InstructionsWizard({ onClose }: InstructionsWizardProps) {
473483
}
474484

475485
const skipQuestion = () => {
486+
if (currentQuestion.skippable === false) {
487+
return
488+
}
489+
476490
setResponses((prev) => ({
477491
...prev,
478492
[currentQuestion.id]: null,
@@ -722,9 +736,11 @@ export function InstructionsWizard({ onClose }: InstructionsWizardProps) {
722736
<h1 className="text-3xl font-semibold text-foreground">
723737
{currentQuestion.question}
724738
</h1>
725-
<Button variant="ghost" onClick={skipQuestion} className="shrink-0">
726-
Skip
727-
</Button>
739+
{currentQuestion.skippable !== false ? (
740+
<Button variant="ghost" onClick={skipQuestion} className="shrink-0">
741+
Skip
742+
</Button>
743+
) : null}
728744
</header>
729745

730746
<section className="rounded-3xl border border-border/80 bg-card/95 p-6 shadow-md">

data/files.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"format": "markdown",
77
"enabled": true,
88
"icon": "markdown",
9-
"docs": "https://docs.github.com/en/copilot"
9+
"docs": "https://docs.github.com/en/copilot",
10+
"skippable": false
1011
},
1112
{
1213
"id": "agents-md",
@@ -15,15 +16,17 @@
1516
"format": "markdown",
1617
"enabled": true,
1718
"icon": "markdown",
18-
"docs": "https://docs.github.com/en/copilot"
19+
"docs": "https://docs.github.com/en/copilot",
20+
"skippable": false
1921
},
2022
{
2123
"id": "cursor-rules",
2224
"label": "Cursor Rules",
2325
"filename": ".cursor/rules",
2426
"format": "cursor-rules",
2527
"enabled": false,
26-
"docs": "https://docs.cursor.com/workflows/rules"
28+
"docs": "https://docs.cursor.com/workflows/rules",
29+
"skippable": false
2730
},
2831
{
2932
"id": "json-rules",
@@ -32,6 +35,7 @@
3235
"format": "json",
3336
"enabled": false,
3437
"icon": "json",
35-
"docs": "https://json-schema.org/"
38+
"docs": "https://json-schema.org/",
39+
"skippable": false
3640
}
37-
]
41+
]

data/frameworks.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,23 @@
44
"label": "React",
55
"icon": "react",
66
"enabled": true,
7-
"docs": "https://react.dev/learn"
7+
"docs": "https://react.dev/learn",
8+
"skippable": false
89
},
910
{
1011
"id": "nextjs",
1112
"label": "Next.js",
1213
"icon": "nextdotjs",
1314
"enabled": true,
14-
"docs": "https://nextjs.org/docs"
15+
"docs": "https://nextjs.org/docs",
16+
"skippable": false
1517
},
1618
{
1719
"id": "angular",
1820
"label": "Angular",
1921
"icon": "angular",
2022
"enabled": false,
21-
"docs": "https://angular.io/docs"
23+
"docs": "https://angular.io/docs",
24+
"skippable": false
2225
}
2326
]

data/ides.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"icon": "visualstudiocode",
66
"enabled": true,
77
"docs": "https://code.visualstudio.com/docs",
8+
"skippable": false,
89
"outputFiles": [
910
"instructions-md",
1011
"agents-md"
@@ -16,6 +17,7 @@
1617
"icon": "/icons/cursor.svg",
1718
"enabled": false,
1819
"docs": "https://docs.cursor.com/",
20+
"skippable": false,
1921
"outputFiles": [
2022
"cursor-rules",
2123
"json-rules"
@@ -27,6 +29,7 @@
2729
"icon": "/icons/jetbrains.svg",
2830
"enabled": false,
2931
"docs": "https://www.jetbrains.com/help/",
32+
"skippable": false,
3033
"outputFiles": [
3134
"instructions-md"
3235
]
@@ -37,9 +40,10 @@
3740
"icon": "windsurf",
3841
"enabled": false,
3942
"docs": "https://codeium.com/windsurf",
43+
"skippable": false,
4044
"outputFiles": [
4145
"instructions-md",
4246
"json-rules"
4347
]
4448
}
45-
]
49+
]

types/wizard.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export type IdeConfig = {
55
enabled?: boolean
66
outputFiles?: string[]
77
docs?: string
8+
skippable?: boolean
89
}
910

1011
export type FrameworkConfig = {
@@ -13,6 +14,7 @@ export type FrameworkConfig = {
1314
icon?: string
1415
enabled?: boolean
1516
docs?: string
17+
skippable?: boolean
1618
}
1719

1820
export type DataAnswerSource = {
@@ -27,13 +29,15 @@ export type DataAnswerSource = {
2729
isDefault?: boolean
2830
disabled?: boolean
2931
disabledLabel?: string
32+
skippable?: boolean
3033
}
3134

3235
export type DataQuestionSource = {
3336
id: string
3437
question: string
3538
allowMultiple?: boolean
3639
answers: DataAnswerSource[]
40+
skippable?: boolean
3741
}
3842

3943
export type FileOutputConfig = {
@@ -44,6 +48,7 @@ export type FileOutputConfig = {
4448
enabled?: boolean
4549
icon?: string
4650
docs?: string
51+
skippable?: boolean
4752
}
4853

4954
export type WizardAnswer = {
@@ -57,13 +62,15 @@ export type WizardAnswer = {
5762
disabled?: boolean
5863
disabledLabel?: string
5964
docs?: string
65+
skippable?: boolean
6066
}
6167

6268
export type WizardQuestion = {
6369
id: string
6470
question: string
6571
allowMultiple?: boolean
6672
answers: WizardAnswer[]
73+
skippable?: boolean
6774
}
6875

6976
export type WizardStep = {

0 commit comments

Comments
 (0)