@@ -44,6 +44,7 @@ type OptionKey =
4444 | "githubActions"
4545 | "formattingPreCommitHook"
4646 | "reactQuery"
47+ | "plausible"
4748
4849const options = {
4950 pnpm : { key : "pnpm" , value : "pnpm" , label : "pnpm" } ,
@@ -106,6 +107,11 @@ const options = {
106107 value : "react-query" ,
107108 label : "React Query" ,
108109 } ,
110+ plausible : {
111+ key : "plausible" ,
112+ value : "plausible" ,
113+ label : "Plausible" ,
114+ } ,
109115} satisfies {
110116 [ Key in OptionKey ] : {
111117 key : Key
@@ -150,6 +156,7 @@ const continuousIntegrationOptionKeys = [
150156const serverStateManagementLibraryOptionKeys = [
151157 optionKeys . reactQuery ,
152158] satisfies OptionKey [ ]
159+ const analyticsOptionKeys = [ optionKeys . plausible ] satisfies OptionKey [ ]
153160
154161type ProjectName = string
155162type PackageManager = ( typeof packageManagerOptionKeys ) [ number ]
@@ -162,6 +169,8 @@ type Animation = (typeof animationOptionKeys)[number]
162169type ContinuousIntegration = ( typeof continuousIntegrationOptionKeys ) [ number ]
163170type ServerStateManagementLibrary =
164171 ( typeof serverStateManagementLibraryOptionKeys ) [ number ]
172+ type Analytics = ( typeof analyticsOptionKeys ) [ number ]
173+
165174type TechnologiesFormData = {
166175 projectName : ProjectName
167176 packageManager : PackageManager
@@ -173,6 +182,7 @@ type TechnologiesFormData = {
173182 animation : Animation [ ]
174183 continuousIntegration : ContinuousIntegration [ ]
175184 serverStateManagementLibraries : ServerStateManagementLibrary [ ]
185+ analytics : Analytics [ ]
176186}
177187const defaultFormData : TechnologiesFormData = {
178188 projectName : "my-app" ,
@@ -185,6 +195,7 @@ const defaultFormData: TechnologiesFormData = {
185195 animation : [ optionKeys . framerMotion ] ,
186196 continuousIntegration : [ optionKeys . githubActions ] ,
187197 serverStateManagementLibraries : [ optionKeys . reactQuery ] ,
198+ analytics : [ ] ,
188199}
189200const formDataKeys = objectToKeyToKeyMap ( defaultFormData )
190201
@@ -201,6 +212,7 @@ const categoryLabels = {
201212 animation : "Animation" ,
202213 continuousIntegration : "Continuous Integration" ,
203214 serverStateManagementLibraries : "Server State Management" ,
215+ analytics : "Analytics" ,
204216} as const
205217
206218export const TechnologiesForm : React . FC = ( ) => {
@@ -237,6 +249,7 @@ export const TechnologiesForm: React.FC = () => {
237249 pushArgs ( formData . animation )
238250 pushArgs ( formData . continuousIntegration )
239251 pushArgs ( formData . serverStateManagementLibraries )
252+ pushArgs ( formData . analytics )
240253
241254 const projectNameSegments = formData . projectName . split ( "/" )
242255 const lastPartOfProjectName = projectNameSegments . pop ( ) !
@@ -257,7 +270,8 @@ export const TechnologiesForm: React.FC = () => {
257270 | "iconLibraries"
258271 | "animation"
259272 | "continuousIntegration"
260- | "serverStateManagementLibraries" ,
273+ | "serverStateManagementLibraries"
274+ | "analytics" ,
261275 optionKeys : Array < keyof typeof options > ,
262276 validators ?: {
263277 [ key in keyof typeof options ] ?: Array < {
@@ -409,6 +423,16 @@ export const TechnologiesForm: React.FC = () => {
409423 serverStateManagementLibraryOptionKeys
410424 ) }
411425 </ Flex >
426+
427+ < Flex direction = "column" gap = "4" >
428+ < Heading as = "h3" size = "md" >
429+ { categoryLabels . analytics }
430+ </ Heading >
431+ { CheckboxesOfOptionKeys (
432+ formDataKeys . analytics ,
433+ analyticsOptionKeys
434+ ) }
435+ </ Flex >
412436 </ Flex >
413437
414438 < Flex direction = "column" gap = "8" flexBasis = "100%" >
0 commit comments