Skip to content

Commit

Permalink
Add Prisma to website
Browse files Browse the repository at this point in the history
  • Loading branch information
akd-io committed Jun 24, 2023
1 parent 39371f8 commit 122d9dc
Showing 1 changed file with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type OptionKey =
| "plausible"
| "vercel"
| "netlify"
| "prisma"

const options = {
pnpm: { key: "pnpm", value: "pnpm", label: "pnpm" },
Expand Down Expand Up @@ -124,6 +125,11 @@ const options = {
value: "netlify",
label: "Netlify",
},
prisma: {
key: "prisma",
value: "prisma",
label: "Prisma",
},
} satisfies {
[Key in OptionKey]: {
key: Key
Expand Down Expand Up @@ -173,6 +179,7 @@ const deploymentOptionKeys = [
optionKeys.vercel,
optionKeys.netlify,
] satisfies OptionKey[]
const ormOptionKeys = [optionKeys.prisma] satisfies OptionKey[]

type ProjectName = string
type PackageManager = (typeof packageManagerOptionKeys)[number]
Expand All @@ -187,6 +194,7 @@ type ServerStateManagementLibrary =
(typeof serverStateManagementLibraryOptionKeys)[number]
type Analytics = (typeof analyticsOptionKeys)[number]
type Deployment = (typeof deploymentOptionKeys)[number]
type ORM = (typeof ormOptionKeys)[number]

type TechnologiesFormData = {
projectName: ProjectName
Expand All @@ -201,6 +209,7 @@ type TechnologiesFormData = {
serverStateManagementLibraries: ServerStateManagementLibrary[]
analytics: Analytics[]
deployment: Deployment[]
orm: ORM[]
}
const defaultFormData: TechnologiesFormData = {
projectName: "my-app",
Expand All @@ -215,6 +224,7 @@ const defaultFormData: TechnologiesFormData = {
serverStateManagementLibraries: [optionKeys.reactQuery],
analytics: [],
deployment: [optionKeys.vercel],
orm: [],
}
const formDataKeys = objectToKeyToKeyMap(defaultFormData)

Expand All @@ -233,6 +243,7 @@ const categoryLabels = {
serverStateManagementLibraries: "Server State Management",
analytics: "Analytics",
deployment: "Deployment",
orm: "ORMs",
} as const

export const TechnologiesForm: React.FC = () => {
Expand Down Expand Up @@ -271,6 +282,7 @@ export const TechnologiesForm: React.FC = () => {
pushArgs(formData.serverStateManagementLibraries)
pushArgs(formData.analytics)
pushArgs(formData.deployment)
pushArgs(formData.orm)

const projectNameSegments = formData.projectName.split("/")
const lastPartOfProjectName = projectNameSegments.pop()!
Expand All @@ -293,7 +305,8 @@ export const TechnologiesForm: React.FC = () => {
| "continuousIntegration"
| "serverStateManagementLibraries"
| "analytics"
| "deployment",
| "deployment"
| "orm",
optionKeys: Array<keyof typeof options>,
validators?: {
[key in keyof typeof options]?: Array<{
Expand Down Expand Up @@ -455,6 +468,13 @@ export const TechnologiesForm: React.FC = () => {
analyticsOptionKeys
)}
</Flex>

<Flex direction="column" gap="4">
<Heading as="h3" size="md">
{categoryLabels.orm}
</Heading>
{CheckboxesOfOptionKeys(formDataKeys.orm, ormOptionKeys)}
</Flex>
</Flex>

<Flex direction="column" gap="8" flexBasis="100%">
Expand Down

0 comments on commit 122d9dc

Please sign in to comment.