From 594500d2e5563957003c32c807d2bb91ecd71991 Mon Sep 17 00:00:00 2001 From: Dylan Gattey Date: Fri, 29 Dec 2023 17:14:43 -0800 Subject: [PATCH] [Monorepo] redo codegen to be next to operation files and simpler (#424) Closes DG-136 ## What changed? Why? Dependency upgrades, tiny meta tweak, and redo codegen to be next to operation files and simpler setup with a turbo clean that works --- .gitignore | 3 - README.md | 2 +- apps/web/package.json | 8 +- apps/web/src/api/parsers.ts | 2 +- .../contentful/api.generated.ts} | 0 .../fetchCurrentLocation.generated.ts | 2 +- .../server/contentful/fetchCurrentLocation.ts | 2 +- .../contentful}/fetchFooterLinks.generated.ts | 2 +- .../api/server/contentful/fetchFooterLinks.ts | 4 +- .../fetchIntroContent.generated.ts | 2 +- .../server/contentful/fetchIntroContent.ts | 4 +- .../fetchPrivacyContent.generated.ts | 2 +- .../server/contentful/fetchPrivacyContent.ts | 4 +- .../contentful}/fetchProjects.generated.ts | 2 +- .../api/server/contentful/fetchProjects.ts | 4 +- .../github/api.generated.ts} | 0 .../github}/fetchRepoVersion.generated.ts | 2 +- .../src/api/server/github/fetchRepoVersion.ts | 2 +- apps/web/src/api/types/MapLocation.ts | 4 +- apps/web/src/components/ContentCard.tsx | 2 +- .../src/components/ContentWrappingLink.tsx | 2 +- apps/web/src/components/Footer.tsx | 2 +- apps/web/src/components/Image.tsx | 2 +- apps/web/src/components/Meta.tsx | 2 +- apps/web/src/components/RichText.tsx | 2 +- .../src/components/homepage/ProjectCard.tsx | 2 +- apps/web/src/hooks/useLinkWithName.ts | 2 +- packages/codegen/config.ts | 102 +--------- packages/codegen/createApiGenerator.ts | 97 ++++++++++ packages/codegen/package.json | 1 + packages/eslint-config-dg/library.js | 1 - packages/eslint-config-dg/next.js | 1 - packages/og/package.json | 2 +- packages/ui/package.json | 4 +- packages/webhooks/config.ts | 158 ---------------- pnpm-lock.yaml | 176 +++++++++--------- turbo.json | 3 +- 37 files changed, 228 insertions(+), 384 deletions(-) rename apps/web/src/api/{types/generated/contentfulApi.generated.ts => server/contentful/api.generated.ts} (100%) rename apps/web/src/api/{types/generated => server/contentful}/fetchCurrentLocation.generated.ts (93%) rename apps/web/src/api/{types/generated => server/contentful}/fetchFooterLinks.generated.ts (92%) rename apps/web/src/api/{types/generated => server/contentful}/fetchIntroContent.generated.ts (97%) rename apps/web/src/api/{types/generated => server/contentful}/fetchPrivacyContent.generated.ts (97%) rename apps/web/src/api/{types/generated => server/contentful}/fetchProjects.generated.ts (94%) rename apps/web/src/api/{types/generated/githubApi.generated.ts => server/github/api.generated.ts} (100%) rename apps/web/src/api/{types/generated => server/github}/fetchRepoVersion.generated.ts (90%) create mode 100644 packages/codegen/createApiGenerator.ts delete mode 100644 packages/webhooks/config.ts diff --git a/.gitignore b/.gitignore index 2869c11b..3ad3d497 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,3 @@ npm-debug.log* .vercel tsconfig.tsbuildinfo .eslintcache - -# Generated files -*/api/server/generated diff --git a/README.md b/README.md index f173d18b..83ca097f 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Pretty standard Next app here. `/public` contains static files, `/src` contains - [MUI System](https://mui.com/system/getting-started/overview/) provides the styling system for layouts/usages of `sx` on props, running on `emotion` under the hood. -- [GraphQL Codegen](https://www.graphql-code-generator.com) makes all the `generated` files. It reads Github + Contentful's API schema + creates types out of them automatically. I run it on command when I write new queries/etc to get their types. +- [GraphQL Codegen](https://www.graphql-code-generator.com) makes all the `*.generated.ts` files. It reads Github + Contentful's API schema + creates types out of them automatically. I run it on command when I write new queries/etc to get their types. - [PlanetScale](https://planetscale.com) powers a distributed DB. This DB is used to persist auth tokens for Spotify/Strava beyond the lifetime of a deploy + refresh the token as needed. diff --git a/apps/web/package.json b/apps/web/package.json index 8e57df27..2b8104c3 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -15,20 +15,20 @@ "@contentful/rich-text-react-renderer": "15.19.0", "@contentful/rich-text-types": "16.3.0", "@emotion/cache": "11.11.0", - "@emotion/react": "11.11.1", + "@emotion/react": "11.11.3", "@emotion/styled": "11.11.0", "@fortawesome/fontawesome-svg-core": "6.5.1", "@fortawesome/free-brands-svg-icons": "6.5.1", "@fortawesome/free-solid-svg-icons": "6.5.1", "@fortawesome/react-fontawesome": "0.2.0", - "@mui/material": "5.15.1", + "@mui/material": "5.15.2", "@next/bundle-analyzer": "14.0.4", "animate-css-grid": "1.5.1", "db": "workspace:*", "dotenv-mono": "1.3.13", "graphql": "16.8.1", "graphql-request": "6.1.0", - "lucide-react": "0.300.0", + "lucide-react": "0.303.0", "mapbox-gl": "3.0.1", "next": "14.0.4", "og": "workspace:*", @@ -47,7 +47,7 @@ "@next/eslint-plugin-next": "14.0.4", "@types/mapbox-gl": "2.7.19", "@types/node": "18.17.1", - "@types/react": "18.2.45", + "@types/react": "18.2.46", "@types/react-dom": "18.2.18", "eslint-config-dg": "workspace:*", "tsconfig": "workspace:*", diff --git a/apps/web/src/api/parsers.ts b/apps/web/src/api/parsers.ts index 9b33f9ef..ee66dc1f 100644 --- a/apps/web/src/api/parsers.ts +++ b/apps/web/src/api/parsers.ts @@ -1,4 +1,4 @@ -import type { Link, Project, TextBlock } from 'api/types/generated/contentfulApi.generated'; +import type { Link, Project, TextBlock } from 'api/server/contentful/api.generated'; /** * Type guard to get a link out diff --git a/apps/web/src/api/types/generated/contentfulApi.generated.ts b/apps/web/src/api/server/contentful/api.generated.ts similarity index 100% rename from apps/web/src/api/types/generated/contentfulApi.generated.ts rename to apps/web/src/api/server/contentful/api.generated.ts diff --git a/apps/web/src/api/types/generated/fetchCurrentLocation.generated.ts b/apps/web/src/api/server/contentful/fetchCurrentLocation.generated.ts similarity index 93% rename from apps/web/src/api/types/generated/fetchCurrentLocation.generated.ts rename to apps/web/src/api/server/contentful/fetchCurrentLocation.generated.ts index 99da201b..da077b82 100644 --- a/apps/web/src/api/types/generated/fetchCurrentLocation.generated.ts +++ b/apps/web/src/api/server/contentful/fetchCurrentLocation.generated.ts @@ -1,4 +1,4 @@ -import type * as Types from './contentfulApi.generated'; +import type * as Types from './api.generated'; export type MyLocationQueryVariables = Types.Exact<{ [key: string]: never }>; diff --git a/apps/web/src/api/server/contentful/fetchCurrentLocation.ts b/apps/web/src/api/server/contentful/fetchCurrentLocation.ts index 038136a4..1a94fc75 100644 --- a/apps/web/src/api/server/contentful/fetchCurrentLocation.ts +++ b/apps/web/src/api/server/contentful/fetchCurrentLocation.ts @@ -1,8 +1,8 @@ import { gql } from 'graphql-request'; import { isNotNullish } from 'shared-core/helpers/typeguards'; -import type { MyLocationQuery } from 'api/types/generated/fetchCurrentLocation.generated'; import type { MapLocation } from 'api/types/MapLocation'; import { contentfulClient } from '../networkClients/contentfulClient'; +import type { MyLocationQuery } from './fetchCurrentLocation.generated'; /** * Grabs the home location using a known id for it diff --git a/apps/web/src/api/types/generated/fetchFooterLinks.generated.ts b/apps/web/src/api/server/contentful/fetchFooterLinks.generated.ts similarity index 92% rename from apps/web/src/api/types/generated/fetchFooterLinks.generated.ts rename to apps/web/src/api/server/contentful/fetchFooterLinks.generated.ts index 154328b9..b55f3712 100644 --- a/apps/web/src/api/types/generated/fetchFooterLinks.generated.ts +++ b/apps/web/src/api/server/contentful/fetchFooterLinks.generated.ts @@ -1,4 +1,4 @@ -import type * as Types from './contentfulApi.generated'; +import type * as Types from './api.generated'; export type FooterQueryVariables = Types.Exact<{ [key: string]: never }>; diff --git a/apps/web/src/api/server/contentful/fetchFooterLinks.ts b/apps/web/src/api/server/contentful/fetchFooterLinks.ts index 5e337d82..fc92b0d6 100644 --- a/apps/web/src/api/server/contentful/fetchFooterLinks.ts +++ b/apps/web/src/api/server/contentful/fetchFooterLinks.ts @@ -1,9 +1,9 @@ import { gql } from 'graphql-request'; import { isNotNullish } from 'shared-core/helpers/typeguards'; import { isLink } from 'api/parsers'; -import type { Link } from 'api/types/generated/contentfulApi.generated'; -import type { FooterQuery } from 'api/types/generated/fetchFooterLinks.generated'; import { contentfulClient } from '../networkClients/contentfulClient'; +import type { Link } from './api.generated'; +import type { FooterQuery } from './fetchFooterLinks.generated'; /** * Grabs the contentful sections with the title of footer. Should diff --git a/apps/web/src/api/types/generated/fetchIntroContent.generated.ts b/apps/web/src/api/server/contentful/fetchIntroContent.generated.ts similarity index 97% rename from apps/web/src/api/types/generated/fetchIntroContent.generated.ts rename to apps/web/src/api/server/contentful/fetchIntroContent.generated.ts index 54b6697d..78ec59f3 100644 --- a/apps/web/src/api/types/generated/fetchIntroContent.generated.ts +++ b/apps/web/src/api/server/contentful/fetchIntroContent.generated.ts @@ -1,4 +1,4 @@ -import type * as Types from './contentfulApi.generated'; +import type * as Types from './api.generated'; export type IntroBlockQueryVariables = Types.Exact<{ [key: string]: never }>; diff --git a/apps/web/src/api/server/contentful/fetchIntroContent.ts b/apps/web/src/api/server/contentful/fetchIntroContent.ts index 524588cd..93dabe50 100644 --- a/apps/web/src/api/server/contentful/fetchIntroContent.ts +++ b/apps/web/src/api/server/contentful/fetchIntroContent.ts @@ -1,8 +1,8 @@ import { gql } from 'graphql-request'; import { isTextBlock } from 'api/parsers'; -import type { TextBlock } from 'api/types/generated/contentfulApi.generated'; -import type { IntroBlockQuery } from 'api/types/generated/fetchIntroContent.generated'; import { contentfulClient } from '../networkClients/contentfulClient'; +import type { TextBlock } from './api.generated'; +import type { IntroBlockQuery } from './fetchIntroContent.generated'; /** * Grabs the contentful sections with the title of header. Should diff --git a/apps/web/src/api/types/generated/fetchPrivacyContent.generated.ts b/apps/web/src/api/server/contentful/fetchPrivacyContent.generated.ts similarity index 97% rename from apps/web/src/api/types/generated/fetchPrivacyContent.generated.ts rename to apps/web/src/api/server/contentful/fetchPrivacyContent.generated.ts index d5ce94a5..82af2021 100644 --- a/apps/web/src/api/types/generated/fetchPrivacyContent.generated.ts +++ b/apps/web/src/api/server/contentful/fetchPrivacyContent.generated.ts @@ -1,4 +1,4 @@ -import type * as Types from './contentfulApi.generated'; +import type * as Types from './api.generated'; export type PrivacyBlockQueryVariables = Types.Exact<{ [key: string]: never }>; diff --git a/apps/web/src/api/server/contentful/fetchPrivacyContent.ts b/apps/web/src/api/server/contentful/fetchPrivacyContent.ts index 03ff551d..e08217d9 100644 --- a/apps/web/src/api/server/contentful/fetchPrivacyContent.ts +++ b/apps/web/src/api/server/contentful/fetchPrivacyContent.ts @@ -1,8 +1,8 @@ import { gql } from 'graphql-request'; import { isTextBlock } from 'api/parsers'; -import type { PrivacyBlockQuery } from 'api/types/generated/fetchPrivacyContent.generated'; import { contentfulClient } from '../networkClients/contentfulClient'; -import type { TextBlock } from '../../types/generated/contentfulApi.generated'; +import type { TextBlock } from './api.generated'; +import type { PrivacyBlockQuery } from './fetchPrivacyContent.generated'; /** * Grabs the Contentful text block for the privacy page - should be diff --git a/apps/web/src/api/types/generated/fetchProjects.generated.ts b/apps/web/src/api/server/contentful/fetchProjects.generated.ts similarity index 94% rename from apps/web/src/api/types/generated/fetchProjects.generated.ts rename to apps/web/src/api/server/contentful/fetchProjects.generated.ts index 8d8acf28..9d79cbf4 100644 --- a/apps/web/src/api/types/generated/fetchProjects.generated.ts +++ b/apps/web/src/api/server/contentful/fetchProjects.generated.ts @@ -1,4 +1,4 @@ -import type * as Types from './contentfulApi.generated'; +import type * as Types from './api.generated'; export type ProjectsQueryVariables = Types.Exact<{ [key: string]: never }>; diff --git a/apps/web/src/api/server/contentful/fetchProjects.ts b/apps/web/src/api/server/contentful/fetchProjects.ts index a7fc8656..32d48c37 100644 --- a/apps/web/src/api/server/contentful/fetchProjects.ts +++ b/apps/web/src/api/server/contentful/fetchProjects.ts @@ -1,8 +1,8 @@ import { gql } from 'graphql-request'; import { isProject } from 'api/parsers'; -import type { Project } from 'api/types/generated/contentfulApi.generated'; -import type { ProjectsQuery } from 'api/types/generated/fetchProjects.generated'; import { contentfulClient } from '../networkClients/contentfulClient'; +import type { Project } from './api.generated'; +import type { ProjectsQuery } from './fetchProjects.generated'; /** * Grabs all projects to display diff --git a/apps/web/src/api/types/generated/githubApi.generated.ts b/apps/web/src/api/server/github/api.generated.ts similarity index 100% rename from apps/web/src/api/types/generated/githubApi.generated.ts rename to apps/web/src/api/server/github/api.generated.ts diff --git a/apps/web/src/api/types/generated/fetchRepoVersion.generated.ts b/apps/web/src/api/server/github/fetchRepoVersion.generated.ts similarity index 90% rename from apps/web/src/api/types/generated/fetchRepoVersion.generated.ts rename to apps/web/src/api/server/github/fetchRepoVersion.generated.ts index b98c660a..40c98fff 100644 --- a/apps/web/src/api/types/generated/fetchRepoVersion.generated.ts +++ b/apps/web/src/api/server/github/fetchRepoVersion.generated.ts @@ -1,4 +1,4 @@ -import type * as Types from './githubApi.generated'; +import type * as Types from './api.generated'; export type GithubRepoVersionQueryVariables = Types.Exact<{ [key: string]: never }>; diff --git a/apps/web/src/api/server/github/fetchRepoVersion.ts b/apps/web/src/api/server/github/fetchRepoVersion.ts index 3f5a159d..17c63f36 100644 --- a/apps/web/src/api/server/github/fetchRepoVersion.ts +++ b/apps/web/src/api/server/github/fetchRepoVersion.ts @@ -1,6 +1,6 @@ import { gql } from 'graphql-request'; -import type { GithubRepoVersionQuery } from 'api/types/generated/fetchRepoVersion.generated'; import { githubClient } from '../networkClients/githubClient'; +import type { GithubRepoVersionQuery } from './fetchRepoVersion.generated'; /** * This, strictly speaking, is usually overkill. We fetch the 100 most recently diff --git a/apps/web/src/api/types/MapLocation.ts b/apps/web/src/api/types/MapLocation.ts index 9603154f..30b3a9e2 100644 --- a/apps/web/src/api/types/MapLocation.ts +++ b/apps/web/src/api/types/MapLocation.ts @@ -1,5 +1,5 @@ -import type { Asset } from 'api/types/generated/contentfulApi.generated'; -import type { MyLocationQuery } from 'api/types/generated/fetchCurrentLocation.generated'; +import type { Asset } from 'api/server/contentful/api.generated'; +import type { MyLocationQuery } from 'api/server/contentful/fetchCurrentLocation.generated'; /** * Represents a location along with some metadata diff --git a/apps/web/src/components/ContentCard.tsx b/apps/web/src/components/ContentCard.tsx index 9bfeb395..e9908eeb 100644 --- a/apps/web/src/components/ContentCard.tsx +++ b/apps/web/src/components/ContentCard.tsx @@ -4,7 +4,7 @@ import { Card, Typography } from '@mui/material'; import { mixinSx } from 'ui/helpers/mixinSx'; import type { SxProps } from 'ui/theme'; import { truncated } from 'ui/helpers/truncated'; -import type { Link } from 'api/types/generated/contentfulApi.generated'; +import type { Link } from 'api/server/contentful/api.generated'; import { ContentWrappingLink } from './ContentWrappingLink'; export type ContentCardProps = Pick< diff --git a/apps/web/src/components/ContentWrappingLink.tsx b/apps/web/src/components/ContentWrappingLink.tsx index 437329b2..b9950409 100644 --- a/apps/web/src/components/ContentWrappingLink.tsx +++ b/apps/web/src/components/ContentWrappingLink.tsx @@ -1,5 +1,5 @@ import type { SxProps } from 'ui/theme'; -import type { Link as LinkType } from 'api/types/generated/contentfulApi.generated'; +import type { Link as LinkType } from 'api/server/contentful/api.generated'; import { Link } from 'components/Link'; type ContentWrappingLinkProps = Pick, 'children'> & { diff --git a/apps/web/src/components/Footer.tsx b/apps/web/src/components/Footer.tsx index 0fe351de..498cd7d4 100644 --- a/apps/web/src/components/Footer.tsx +++ b/apps/web/src/components/Footer.tsx @@ -2,7 +2,7 @@ import { Container } from '@mui/material'; import { Section } from 'ui/core/Section'; import { Nav, NavGroup, NavItem } from 'ui/core/Nav'; import { HorizontalStack } from 'ui/core/HorizontalStack'; -import type { Link as LinkType } from 'api/types/generated/contentfulApi.generated'; +import type { Link as LinkType } from 'api/server/contentful/api.generated'; import { useData } from 'api/useData'; import { Link } from './Link'; diff --git a/apps/web/src/components/Image.tsx b/apps/web/src/components/Image.tsx index c5b86f34..23bf8b51 100644 --- a/apps/web/src/components/Image.tsx +++ b/apps/web/src/components/Image.tsx @@ -1,7 +1,7 @@ import { styled } from '@mui/material'; import NextImage from 'next/image'; import { BREAKPOINT_MAX_SIZES } from 'ui/helpers/imageSizes'; -import type { Asset } from 'api/types/generated/contentfulApi.generated'; +import type { Asset } from 'api/server/contentful/api.generated'; type ImageProps = Partial & { url: Asset['url']; diff --git a/apps/web/src/components/Meta.tsx b/apps/web/src/components/Meta.tsx index fa98b7c1..b2c0764f 100644 --- a/apps/web/src/components/Meta.tsx +++ b/apps/web/src/components/Meta.tsx @@ -120,7 +120,7 @@ export function Meta({ title, description }: MetaProps) { // Construct url-encoded title and subtitle for the og image const imageTitle = encodeURIComponent(title ?? SITE_NAME); - const imageSubtitle = encodeURIComponent(title === HOMEPAGE_TITLE ? SITE_NAME : HOMEPAGE_TITLE); + const imageSubtitle = encodeURIComponent(title ? SITE_NAME : HOMEPAGE_TITLE); const theme = useTheme(); return ( diff --git a/apps/web/src/components/RichText.tsx b/apps/web/src/components/RichText.tsx index 14e51011..c6fae622 100644 --- a/apps/web/src/components/RichText.tsx +++ b/apps/web/src/components/RichText.tsx @@ -7,7 +7,7 @@ import { isNotNullish } from 'shared-core/helpers/typeguards'; import type { SxProps } from 'ui/theme'; import { PROJECT_MAX_IMAGE_DIMENSION } from 'ui/helpers/imageSizes'; import { isLink, isProject } from 'api/parsers'; -import type { Asset, Entry, TextBlockContent } from 'api/types/generated/contentfulApi.generated'; +import type { Asset, Entry, TextBlockContent } from 'api/server/contentful/api.generated'; import { ProjectCard } from 'components/homepage/ProjectCard'; import { Image } from './Image'; import { Link } from './Link'; diff --git a/apps/web/src/components/homepage/ProjectCard.tsx b/apps/web/src/components/homepage/ProjectCard.tsx index 1a919b18..bdb7671c 100644 --- a/apps/web/src/components/homepage/ProjectCard.tsx +++ b/apps/web/src/components/homepage/ProjectCard.tsx @@ -1,6 +1,6 @@ import { useState } from 'react'; import { useCurrentImageSizes } from 'ui/helpers/useCurrentImageSizes'; -import type { Project } from 'api/types/generated/contentfulApi.generated'; +import type { Project } from 'api/server/contentful/api.generated'; import type { ContentCardProps } from 'components/ContentCard'; import { ContentCard } from 'components/ContentCard'; import { HoverableContainer } from 'components/HoverableContainer'; diff --git a/apps/web/src/hooks/useLinkWithName.ts b/apps/web/src/hooks/useLinkWithName.ts index 0386550b..780dc7a4 100644 --- a/apps/web/src/hooks/useLinkWithName.ts +++ b/apps/web/src/hooks/useLinkWithName.ts @@ -1,6 +1,6 @@ import { useMemo } from 'react'; import { findLinkWithName } from 'api/parsers'; -import type { Link as LinkProps } from 'api/types/generated/contentfulApi.generated'; +import type { Link as LinkProps } from 'api/server/contentful/api.generated'; import { useData } from 'api/useData'; /** diff --git a/packages/codegen/config.ts b/packages/codegen/config.ts index f5753e6d..2feb37f2 100644 --- a/packages/codegen/config.ts +++ b/packages/codegen/config.ts @@ -1,109 +1,9 @@ -import path from 'node:path'; import type { CodegenConfig } from '@graphql-codegen/cli'; import { dotenvLoad } from 'dotenv-mono'; +import { createApiGenerator } from './createApiGenerator'; dotenvLoad(); -// Get path from package root to `apps/web/src` folder -const ROOT = __dirname.split('/').slice(0, -2).join('/'); - -// Where all our documents to parse live by default -const BASE_FOLDER = path.join(ROOT, 'apps/web/src/api/server'); - -// Relative to BASE_FOLDER, where our generated files live -const GENERATED_FOLDER = '../types/generated'; - -// Standard options for the files generated from operations or the main api file -const SHARED_CONFIG = { - avoidOptionals: true, - immutableTypes: true, - skipTypename: true, - useTypeImports: true, - maybeValue: 'T | undefined', -}; - -// Standard options for the *api.generated.ts files -const API_CONFIG = { - ...SHARED_CONFIG, - constEnums: true, - enumsAsTypes: true, - defaultScalarType: 'unknown', -}; - -/** - * Hi! Complicated file, read me to understand! This creates generators for - * `@graphql-codegen` so we can have nice types for the APIs we use and the queries/ - * mutations we write. - * - * This function creates two generators for a given API configuration. One is for - * a main shared "xApi.generated.ts" file. The other generator creates one file - * per file that has operations in it, with types for each operation. The resulting - * object from this function is spread into the `generates` key in the options below. - * - * You'll notice that every API has the same configuration except for the name, - * scalars, and endpoint/authorization. That's intentional! - */ -const createApiGenerator = ( - name: string, - { - schemaEndpoint, - token, - scalars, - onlyOperationTypes, - }: { - schemaEndpoint: string; - token: string; - scalars: Record; - onlyOperationTypes: boolean; - }, -): CodegenConfig['generates'] => { - const documents = `${BASE_FOLDER}/${name}/*.ts`; - const baseTypesPath = `${GENERATED_FOLDER}/${name}Api.generated.ts`; - const schemas = [ - { - [schemaEndpoint]: { - headers: { - /** - * Required for Github to generate properly - */ - 'User-Agent': 'dylangattey.com', - Authorization: `Bearer ${token}`, - }, - }, - }, - ]; - - return { - // Creates the main `${name}Api.generated.ts` file - [`${BASE_FOLDER}/${baseTypesPath}`]: { - documents, - schema: schemas, - plugins: ['typescript'], - config: { - ...API_CONFIG, - onlyOperationTypes, - scalars, - }, - }, - - // Creates individual `.generated.ts` files for each .ts file that has operations - [`${BASE_FOLDER}/${name}/`]: { - documents, - schema: schemas, - plugins: ['typescript-operations'], - preset: 'near-operation-file', - presetConfig: { - baseTypesPath: `../${baseTypesPath}`, - folder: `../${GENERATED_FOLDER}`, - }, - config: { - ...SHARED_CONFIG, - preResolveTypes: true, - }, - }, - }; -}; - // For the Contentful API const contentfulGenerators = createApiGenerator('contentful', { schemaEndpoint: `https://graphql.contentful.com/content/v1/spaces/${process.env.CONTENTFUL_SPACE_ID}`, diff --git a/packages/codegen/createApiGenerator.ts b/packages/codegen/createApiGenerator.ts new file mode 100644 index 00000000..be2ec442 --- /dev/null +++ b/packages/codegen/createApiGenerator.ts @@ -0,0 +1,97 @@ +import path from 'node:path'; +import type { CodegenConfig } from '@graphql-codegen/cli'; + +// Fun dance to pull out the union type for Schema +type Schema = Extract['schema']; + +// This is our root directory above packages/apps folder, needs to change if packages/codegen moves +const ROOT = __dirname.split('/').slice(0, -2).join('/'); + +// The generated api files are named this +const GENERATED_API_FILE_NAME = 'api.generated.ts'; + +// Standard options for the files generated from operations or the main api file +const SHARED_CONFIG = { + avoidOptionals: true, + immutableTypes: true, + skipTypename: true, + useTypeImports: true, + maybeValue: 'T | undefined', +}; + +/** + * Hi! Complicated file, read me to understand! This creates generators for + * `@graphql-codegen` so we can have nice types for the APIs we use and the queries/ + * mutations we write. + * + * This function creates two generators for a given API configuration. One is for + * a main shared "xApi.generated.ts" file. The other generator creates one file + * per file that has operations in it, with types for each operation. The resulting + * object from this function is spread into the `generates` key in the options below. + * + * You'll notice that every API has the same configuration except for the name, + * scalars, and endpoint/authorization. That's intentional! + */ +export function createApiGenerator( + name: string, + { + schemaEndpoint, + token, + scalars, + onlyOperationTypes, + }: { + schemaEndpoint: string; + token: string; + scalars: Record; + onlyOperationTypes: boolean; + }, +): CodegenConfig['generates'] { + // Absolute path for the API folder root + const apiFolder = path.join(ROOT, `apps/web/src/api/server/${name}`); + + // A glob for all the source operation documents, relative to project root + const sourceDocumentsGlob = `${apiFolder}/!(*.generated).ts`; + + // Adds extra headers for the endpoints to ensure we can authorize and we have a unique user agent + const schema: Schema = { + [schemaEndpoint]: { + headers: { + 'User-Agent': 'dylangattey.com', + Authorization: `Bearer ${token}`, + }, + }, + }; + + return { + // Creates the generated API file without any imports, just types + [`${apiFolder}/${GENERATED_API_FILE_NAME}`]: { + documents: sourceDocumentsGlob, + schema, + plugins: ['typescript'], + config: { + ...SHARED_CONFIG, + constEnums: true, + enumsAsTypes: true, + defaultScalarType: 'unknown', + onlyOperationTypes, + scalars, + }, + }, + + // Creates individual `.generated.ts` files for each .ts file that has operations, right next to it + [apiFolder]: { + documents: sourceDocumentsGlob, + schema, + plugins: ['typescript-operations'], + preset: 'near-operation-file', + presetConfig: { + // Relative to the location of all of these files (`apiFolder` right now). This creates an import statement for typescript + baseTypesPath: GENERATED_API_FILE_NAME, + }, + config: { + ...SHARED_CONFIG, + preResolveTypes: true, + }, + }, + }; +} diff --git a/packages/codegen/package.json b/packages/codegen/package.json index 9b16a324..bae2f5cf 100644 --- a/packages/codegen/package.json +++ b/packages/codegen/package.json @@ -2,6 +2,7 @@ "name": "codegen", "private": true, "scripts": { + "clean": "find ../../ -type f -name '*.generated.ts' -delete", "codegen": "graphql-codegen --config config.ts", "format": "prettier --write .", "lint": "eslint . --fix", diff --git a/packages/eslint-config-dg/library.js b/packages/eslint-config-dg/library.js index 31576670..bee0889c 100644 --- a/packages/eslint-config-dg/library.js +++ b/packages/eslint-config-dg/library.js @@ -44,7 +44,6 @@ module.exports = { '.vercel/', '.turbo/', '**/*.generated.*', - '**/generated/*', 'migrations/', ], rules, diff --git a/packages/eslint-config-dg/next.js b/packages/eslint-config-dg/next.js index dae0aaba..adddc088 100644 --- a/packages/eslint-config-dg/next.js +++ b/packages/eslint-config-dg/next.js @@ -48,7 +48,6 @@ module.exports = { '.vercel/', '.turbo/', '**/*.generated.*', - '**/generated/*', 'migrations/', ], rules, diff --git a/packages/og/package.json b/packages/og/package.json index 7cdd1aa8..0ac27c92 100644 --- a/packages/og/package.json +++ b/packages/og/package.json @@ -12,7 +12,7 @@ "ui": "workspace:*" }, "devDependencies": { - "@types/react": "18.2.45", + "@types/react": "18.2.46", "dotenv-mono": "1.3.13", "eslint-config-dg": "workspace:*", "tsconfig": "workspace:*", diff --git a/packages/ui/package.json b/packages/ui/package.json index 8d6d883e..efe5b9ab 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -7,13 +7,13 @@ "lint:types": "tsc" }, "dependencies": { - "@mui/material": "5.15.1", + "@mui/material": "5.15.2", "react": "18.2.0", "shared-core": "workspace:*", "use-breakpoint": "4.0.1" }, "devDependencies": { - "@types/react": "18.2.45", + "@types/react": "18.2.46", "dotenv-mono": "1.3.13", "eslint-config-dg": "workspace:*", "tsconfig": "workspace:*", diff --git a/packages/webhooks/config.ts b/packages/webhooks/config.ts deleted file mode 100644 index f5753e6d..00000000 --- a/packages/webhooks/config.ts +++ /dev/null @@ -1,158 +0,0 @@ -import path from 'node:path'; -import type { CodegenConfig } from '@graphql-codegen/cli'; -import { dotenvLoad } from 'dotenv-mono'; - -dotenvLoad(); - -// Get path from package root to `apps/web/src` folder -const ROOT = __dirname.split('/').slice(0, -2).join('/'); - -// Where all our documents to parse live by default -const BASE_FOLDER = path.join(ROOT, 'apps/web/src/api/server'); - -// Relative to BASE_FOLDER, where our generated files live -const GENERATED_FOLDER = '../types/generated'; - -// Standard options for the files generated from operations or the main api file -const SHARED_CONFIG = { - avoidOptionals: true, - immutableTypes: true, - skipTypename: true, - useTypeImports: true, - maybeValue: 'T | undefined', -}; - -// Standard options for the *api.generated.ts files -const API_CONFIG = { - ...SHARED_CONFIG, - constEnums: true, - enumsAsTypes: true, - defaultScalarType: 'unknown', -}; - -/** - * Hi! Complicated file, read me to understand! This creates generators for - * `@graphql-codegen` so we can have nice types for the APIs we use and the queries/ - * mutations we write. - * - * This function creates two generators for a given API configuration. One is for - * a main shared "xApi.generated.ts" file. The other generator creates one file - * per file that has operations in it, with types for each operation. The resulting - * object from this function is spread into the `generates` key in the options below. - * - * You'll notice that every API has the same configuration except for the name, - * scalars, and endpoint/authorization. That's intentional! - */ -const createApiGenerator = ( - name: string, - { - schemaEndpoint, - token, - scalars, - onlyOperationTypes, - }: { - schemaEndpoint: string; - token: string; - scalars: Record; - onlyOperationTypes: boolean; - }, -): CodegenConfig['generates'] => { - const documents = `${BASE_FOLDER}/${name}/*.ts`; - const baseTypesPath = `${GENERATED_FOLDER}/${name}Api.generated.ts`; - const schemas = [ - { - [schemaEndpoint]: { - headers: { - /** - * Required for Github to generate properly - */ - 'User-Agent': 'dylangattey.com', - Authorization: `Bearer ${token}`, - }, - }, - }, - ]; - - return { - // Creates the main `${name}Api.generated.ts` file - [`${BASE_FOLDER}/${baseTypesPath}`]: { - documents, - schema: schemas, - plugins: ['typescript'], - config: { - ...API_CONFIG, - onlyOperationTypes, - scalars, - }, - }, - - // Creates individual `.generated.ts` files for each .ts file that has operations - [`${BASE_FOLDER}/${name}/`]: { - documents, - schema: schemas, - plugins: ['typescript-operations'], - preset: 'near-operation-file', - presetConfig: { - baseTypesPath: `../${baseTypesPath}`, - folder: `../${GENERATED_FOLDER}`, - }, - config: { - ...SHARED_CONFIG, - preResolveTypes: true, - }, - }, - }; -}; - -// For the Contentful API -const contentfulGenerators = createApiGenerator('contentful', { - schemaEndpoint: `https://graphql.contentful.com/content/v1/spaces/${process.env.CONTENTFUL_SPACE_ID}`, - token: process.env.CONTENTFUL_ACCESS_TOKEN ?? '', - onlyOperationTypes: false, - scalars: { - DateTime: 'string', - Dimension: 'number', - HexColor: 'string', - JSON: '{ nodeType: string, data: Record | undefined, value: string | undefined, content: Array<{ nodeType: string, data: Record | undefined, value: string | undefined, content: Array<{ nodeType: string, data: Record | undefined, value: string | undefined, content: Array<{ nodeType: string, data: Record | undefined, value: string | undefined, content: Array<{ nodeType: string, data: Record | undefined, value: string | undefined, content: Array | undefined }> | undefined }> | undefined }> | undefined }> | undefined }', - Quality: 'number', - }, -}); - -// For the Github API -const githubGenerators = createApiGenerator('github', { - schemaEndpoint: 'https://api.github.com/graphql', - token: process.env.GITHUB_AUTHENTICATION_TOKEN ?? '', - onlyOperationTypes: true, - scalars: { - Base64String: 'string', - Date: 'string', - DateTime: 'string', - GitObjectID: 'string', - GitSSHRemote: 'string', - GitTimestamp: 'string', - HTML: 'string', - PreciseDateTime: 'string', - URI: 'string', - X509Certificate: 'string', - }, -}); - -/** - * These are all the options for codegen itself. We format with - * prettier after running generation for Contentful and Github, - * and overwrite existing files. - */ -const config: CodegenConfig = { - overwrite: true, - hooks: { - afterAllFileWrite: ['prettier --write'], - }, - generates: { - ...contentfulGenerators, - ...githubGenerators, - }, -}; - -// We export as default so we can actually use it in a script -// eslint-disable-next-line import/no-default-export -export default config; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 528b0da3..e8026d5b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -46,11 +46,11 @@ importers: specifier: 11.11.0 version: 11.11.0 '@emotion/react': - specifier: 11.11.1 - version: 11.11.1(@types/react@18.2.45)(react@18.2.0) + specifier: 11.11.3 + version: 11.11.3(@types/react@18.2.46)(react@18.2.0) '@emotion/styled': specifier: 11.11.0 - version: 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.45)(react@18.2.0) + version: 11.11.0(@emotion/react@11.11.3)(@types/react@18.2.46)(react@18.2.0) '@fortawesome/fontawesome-svg-core': specifier: 6.5.1 version: 6.5.1 @@ -64,8 +64,8 @@ importers: specifier: 0.2.0 version: 0.2.0(@fortawesome/fontawesome-svg-core@6.5.1)(react@18.2.0) '@mui/material': - specifier: 5.15.1 - version: 5.15.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.45)(react-dom@18.2.0)(react@18.2.0) + specifier: 5.15.2 + version: 5.15.2(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0) '@next/bundle-analyzer': specifier: 14.0.4 version: 14.0.4 @@ -85,8 +85,8 @@ importers: specifier: 6.1.0 version: 6.1.0(graphql@16.8.1) lucide-react: - specifier: 0.300.0 - version: 0.300.0(react@18.2.0) + specifier: 0.303.0 + version: 0.303.0(react@18.2.0) mapbox-gl: specifier: 3.0.1 version: 3.0.1 @@ -137,8 +137,8 @@ importers: specifier: 18.17.1 version: 18.17.1 '@types/react': - specifier: 18.2.45 - version: 18.2.45 + specifier: 18.2.46 + version: 18.2.46 '@types/react-dom': specifier: 18.2.18 version: 18.2.18 @@ -260,8 +260,8 @@ importers: version: link:../ui devDependencies: '@types/react': - specifier: 18.2.45 - version: 18.2.45 + specifier: 18.2.46 + version: 18.2.46 dotenv-mono: specifier: 1.3.13 version: 1.3.13 @@ -307,8 +307,8 @@ importers: packages/ui: dependencies: '@mui/material': - specifier: 5.15.1 - version: 5.15.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.45)(react-dom@18.2.0)(react@18.2.0) + specifier: 5.15.2 + version: 5.15.2(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0) react: specifier: 18.2.0 version: 18.2.0 @@ -320,8 +320,8 @@ importers: version: 4.0.1(react-dom@18.2.0)(react@18.2.0) devDependencies: '@types/react': - specifier: 18.2.45 - version: 18.2.45 + specifier: 18.2.46 + version: 18.2.46 dotenv-mono: specifier: 1.3.13 version: 1.3.13 @@ -1062,8 +1062,8 @@ packages: regenerator-runtime: 0.14.0 dev: true - /@babel/runtime@7.23.6: - resolution: {integrity: sha512-zHd0eUrf5GZoOWVCXp6koAKQTfZV07eit6bGPmJgnZdnSAvvZee6zniW2XMF7Cmc4ISOOnPy3QaSiIJGJkVEDQ==} + /@babel/runtime@7.23.7: + resolution: {integrity: sha512-w06OXVOFso7LcbzMiDGt+3X7Rh7Ho8MmgPoWU3rarH+8upf+wSU/grlGbWzQyr3DkdN6ZeuMFjpdwW0Q+HxobA==} engines: {node: '>=6.9.0'} dependencies: regenerator-runtime: 0.14.1 @@ -1244,8 +1244,8 @@ packages: resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} dev: false - /@emotion/react@11.11.1(@types/react@18.2.45)(react@18.2.0): - resolution: {integrity: sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==} + /@emotion/react@11.11.3(@types/react@18.2.46)(react@18.2.0): + resolution: {integrity: sha512-Cnn0kuq4DoONOMcnoVsTOR8E+AdnKFf//6kUWc4LCdnxj31pZWn7rIULd6Y7/Js1PiPHzn7SKCM9vB/jBni8eA==} peerDependencies: '@types/react': '*' react: '>=16.8.0' @@ -1253,14 +1253,14 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.22.15 + '@babel/runtime': 7.23.7 '@emotion/babel-plugin': 11.11.0 '@emotion/cache': 11.11.0 - '@emotion/serialize': 1.1.2 + '@emotion/serialize': 1.1.3 '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@18.2.0) '@emotion/utils': 1.2.1 '@emotion/weak-memoize': 0.3.1 - '@types/react': 18.2.45 + '@types/react': 18.2.46 hoist-non-react-statics: 3.3.2 react: 18.2.0 dev: false @@ -1275,11 +1275,21 @@ packages: csstype: 3.1.2 dev: false + /@emotion/serialize@1.1.3: + resolution: {integrity: sha512-iD4D6QVZFDhcbH0RAG1uVu1CwVLMWUkCvAqqlewO/rxf8+87yIBAlt4+AxMiiKPLs5hFc0owNk/sLLAOROw3cA==} + dependencies: + '@emotion/hash': 0.9.1 + '@emotion/memoize': 0.8.1 + '@emotion/unitless': 0.8.1 + '@emotion/utils': 1.2.1 + csstype: 3.1.3 + dev: false + /@emotion/sheet@1.2.2: resolution: {integrity: sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==} dev: false - /@emotion/styled@11.11.0(@emotion/react@11.11.1)(@types/react@18.2.45)(react@18.2.0): + /@emotion/styled@11.11.0(@emotion/react@11.11.3)(@types/react@18.2.46)(react@18.2.0): resolution: {integrity: sha512-hM5Nnvu9P3midq5aaXj4I+lnSfNi7Pmd4EWk1fOZ3pxookaQTNew6bp4JaCBYM4HVFZF9g7UjJmsUmC2JlxOng==} peerDependencies: '@emotion/react': ^11.0.0-rc.0 @@ -1292,11 +1302,11 @@ packages: '@babel/runtime': 7.22.15 '@emotion/babel-plugin': 11.11.0 '@emotion/is-prop-valid': 1.2.1 - '@emotion/react': 11.11.1(@types/react@18.2.45)(react@18.2.0) + '@emotion/react': 11.11.3(@types/react@18.2.46)(react@18.2.0) '@emotion/serialize': 1.1.2 '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@18.2.0) '@emotion/utils': 1.2.1 - '@types/react': 18.2.45 + '@types/react': 18.2.46 react: 18.2.0 dev: false @@ -2626,8 +2636,8 @@ packages: resolution: {integrity: sha512-9b8mPpKrfeGRuhFH5iO1iwCLeIIsV6+H1sRfxbkoGXIyQE2BTsPd9zqSqQJ+pv5sJ/hT5M1zvOFL02MnEezFug==} dev: true - /@mui/base@5.0.0-beta.28(@types/react@18.2.45)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-KIoSc5sUFceeCaZTq5MQBapFzhHqMo4kj+4azWaCAjorduhcRQtN+BCgVHmo+gvEjix74bUfxwTqGifnu2fNTg==} + /@mui/base@5.0.0-beta.29(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-OXfUssYrB6ch/xpBVHMKAjThPlI9VyGGKdvQLMXef2j39wXfcxPlUVQlwia/lmE3rxWIGvbwkZsDtNYzLMsDUg==} engines: {node: '>=12.0.0'} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 @@ -2637,24 +2647,24 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.23.7 '@floating-ui/react-dom': 2.0.4(react-dom@18.2.0)(react@18.2.0) - '@mui/types': 7.2.11(@types/react@18.2.45) - '@mui/utils': 5.15.1(@types/react@18.2.45)(react@18.2.0) + '@mui/types': 7.2.11(@types/react@18.2.46) + '@mui/utils': 5.15.2(@types/react@18.2.46)(react@18.2.0) '@popperjs/core': 2.11.8 - '@types/react': 18.2.45 - clsx: 2.0.0 + '@types/react': 18.2.46 + clsx: 2.1.0 prop-types: 15.8.1 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@mui/core-downloads-tracker@5.15.1: - resolution: {integrity: sha512-y/nUEsWHyBzaKYp9zLtqJKrLod/zMNEWpMj488FuQY9QTmqBiyUhI2uh7PVaLqLewXRtdmG6JV0b6T5exyuYRw==} + /@mui/core-downloads-tracker@5.15.2: + resolution: {integrity: sha512-0vk4ckS2w1F5PmkSXSd7F/QuRlNcPqWTJ8CPl+HQRLTIhJVS/VKEI+3dQufOdKfn2wS+ecnvlvXerbugs+xZ8Q==} dev: false - /@mui/material@5.15.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.45)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-WA5DVyvacxDakVyAhNqu/rRT28ppuuUFFw1bLpmRzrCJ4uw/zLTATcd4WB3YbB+7MdZNEGG/SJNWTDLEIyn3xQ==} + /@mui/material@5.15.2(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-JnoIrpNmEHG5uC1IyEdgsnDiaiuCZnUIh7f9oeAr87AvBmNiEJPbo7XrD7kBTFWwp+b97rQ12QdSs9CLhT2n/A==} engines: {node: '>=12.0.0'} peerDependencies: '@emotion/react': ^11.5.0 @@ -2670,17 +2680,17 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.23.6 - '@emotion/react': 11.11.1(@types/react@18.2.45)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.45)(react@18.2.0) - '@mui/base': 5.0.0-beta.28(@types/react@18.2.45)(react-dom@18.2.0)(react@18.2.0) - '@mui/core-downloads-tracker': 5.15.1 - '@mui/system': 5.15.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.45)(react@18.2.0) - '@mui/types': 7.2.11(@types/react@18.2.45) - '@mui/utils': 5.15.1(@types/react@18.2.45)(react@18.2.0) - '@types/react': 18.2.45 + '@babel/runtime': 7.23.7 + '@emotion/react': 11.11.3(@types/react@18.2.46)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.3)(@types/react@18.2.46)(react@18.2.0) + '@mui/base': 5.0.0-beta.29(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0) + '@mui/core-downloads-tracker': 5.15.2 + '@mui/system': 5.15.2(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.46)(react@18.2.0) + '@mui/types': 7.2.11(@types/react@18.2.46) + '@mui/utils': 5.15.2(@types/react@18.2.46)(react@18.2.0) + '@types/react': 18.2.46 '@types/react-transition-group': 4.4.10 - clsx: 2.0.0 + clsx: 2.1.0 csstype: 3.1.3 prop-types: 15.8.1 react: 18.2.0 @@ -2689,8 +2699,8 @@ packages: react-transition-group: 4.4.5(react-dom@18.2.0)(react@18.2.0) dev: false - /@mui/private-theming@5.15.1(@types/react@18.2.45)(react@18.2.0): - resolution: {integrity: sha512-wTbzuy5KjSvCPE9UVJktWHJ0b/tD5biavY9wvF+OpYDLPpdXK52vc1hTDxSbdkHIFMkJExzrwO9GvpVAHZBnFQ==} + /@mui/private-theming@5.15.2(@types/react@18.2.46)(react@18.2.0): + resolution: {integrity: sha512-KlXx5TH1Mw9omSY+Q6rz5TA/P71meSYaAOeopiW8s6o433+fnOxS17rZbmd1RnDZGCo+j24TfCavQuCMBAZnQA==} engines: {node: '>=12.0.0'} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 @@ -2699,15 +2709,15 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.23.6 - '@mui/utils': 5.15.1(@types/react@18.2.45)(react@18.2.0) - '@types/react': 18.2.45 + '@babel/runtime': 7.23.7 + '@mui/utils': 5.15.2(@types/react@18.2.46)(react@18.2.0) + '@types/react': 18.2.46 prop-types: 15.8.1 react: 18.2.0 dev: false - /@mui/styled-engine@5.15.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0): - resolution: {integrity: sha512-7WDZTJLqGexWDjqE9oAgjU8ak6hEtUw2yQU7SIYID5kLVO2Nj/Wi/KicbLsXnTsJNvSqePIlUIWTBSXwWJCPZw==} + /@mui/styled-engine@5.15.2(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(react@18.2.0): + resolution: {integrity: sha512-fYEN3IZzbebeHwAmQHhxwruiOIi8W74709qXg/7tgtHV4byQSmPgnnKsZkg0hFlzjEbcJIRZyZI0qEecgpR2cg==} engines: {node: '>=12.0.0'} peerDependencies: '@emotion/react': ^11.4.1 @@ -2719,17 +2729,17 @@ packages: '@emotion/styled': optional: true dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.23.7 '@emotion/cache': 11.11.0 - '@emotion/react': 11.11.1(@types/react@18.2.45)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.45)(react@18.2.0) + '@emotion/react': 11.11.3(@types/react@18.2.46)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.3)(@types/react@18.2.46)(react@18.2.0) csstype: 3.1.3 prop-types: 15.8.1 react: 18.2.0 dev: false - /@mui/system@5.15.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.45)(react@18.2.0): - resolution: {integrity: sha512-LAnP0ls69rqW9eBgI29phIx/lppv+WDGI7b3EJN7VZIqw0RezA0GD7NRpV12BgEYJABEii6z5Q9B5tg7dsX0Iw==} + /@mui/system@5.15.2(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.46)(react@18.2.0): + resolution: {integrity: sha512-I7CzLiHDtU/BTobJgSk+wPGGWG95K8lYfdFEnq//wOgSrLDAdOVvl2gleDxJWO+yAbGz4RKEOnR9KuD+xQZH4A==} engines: {node: '>=12.0.0'} peerDependencies: '@emotion/react': ^11.5.0 @@ -2744,21 +2754,21 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.23.6 - '@emotion/react': 11.11.1(@types/react@18.2.45)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.45)(react@18.2.0) - '@mui/private-theming': 5.15.1(@types/react@18.2.45)(react@18.2.0) - '@mui/styled-engine': 5.15.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) - '@mui/types': 7.2.11(@types/react@18.2.45) - '@mui/utils': 5.15.1(@types/react@18.2.45)(react@18.2.0) - '@types/react': 18.2.45 - clsx: 2.0.0 + '@babel/runtime': 7.23.7 + '@emotion/react': 11.11.3(@types/react@18.2.46)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.3)(@types/react@18.2.46)(react@18.2.0) + '@mui/private-theming': 5.15.2(@types/react@18.2.46)(react@18.2.0) + '@mui/styled-engine': 5.15.2(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(react@18.2.0) + '@mui/types': 7.2.11(@types/react@18.2.46) + '@mui/utils': 5.15.2(@types/react@18.2.46)(react@18.2.0) + '@types/react': 18.2.46 + clsx: 2.1.0 csstype: 3.1.3 prop-types: 15.8.1 react: 18.2.0 dev: false - /@mui/types@7.2.11(@types/react@18.2.45): + /@mui/types@7.2.11(@types/react@18.2.46): resolution: {integrity: sha512-KWe/QTEsFFlFSH+qRYf3zoFEj3z67s+qAuSnMMg+gFwbxG7P96Hm6g300inQL1Wy///gSRb8juX7Wafvp93m3w==} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 @@ -2766,11 +2776,11 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.2.45 + '@types/react': 18.2.46 dev: false - /@mui/utils@5.15.1(@types/react@18.2.45)(react@18.2.0): - resolution: {integrity: sha512-V1/d0E3Bju5YdB59HJf2G0tnHrFEvWLN+f8hAXp9+JSNy/LC2zKyqUfPPahflR6qsI681P8G9r4mEZte/SrrYA==} + /@mui/utils@5.15.2(@types/react@18.2.46)(react@18.2.0): + resolution: {integrity: sha512-6dGM9/guFKBlFRHA7/mbM+E7wE7CYDy9Ny4JLtD3J+NTyhi8nd8YxlzgAgTaTVqY0BpdQ2zdfB/q6+p2EdGM0w==} engines: {node: '>=12.0.0'} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 @@ -2779,9 +2789,9 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.23.7 '@types/prop-types': 15.7.11 - '@types/react': 18.2.45 + '@types/react': 18.2.46 prop-types: 15.8.1 react: 18.2.0 react-is: 18.2.0 @@ -3383,17 +3393,17 @@ packages: /@types/react-dom@18.2.18: resolution: {integrity: sha512-TJxDm6OfAX2KJWJdMEVTwWke5Sc/E/RlnPGvGfS0W7+6ocy2xhDVQVh/KvC2Uf7kACs+gDytdusDSdWfWkaNzw==} dependencies: - '@types/react': 18.2.45 + '@types/react': 18.2.46 dev: true /@types/react-transition-group@4.4.10: resolution: {integrity: sha512-hT/+s0VQs2ojCX823m60m5f0sL5idt9SO6Tj6Dg+rdphGPIeJbJ6CxvBYkgkGKrYeDjvIpKTR38UzmtHJOGW3Q==} dependencies: - '@types/react': 18.2.45 + '@types/react': 18.2.46 dev: false - /@types/react@18.2.45: - resolution: {integrity: sha512-TtAxCNrlrBp8GoeEp1npd5g+d/OejJHFxS3OWmrPBMFaVQMSN0OFySozJio5BHxTuTeug00AVXVAjfDSfk+lUg==} + /@types/react@18.2.46: + resolution: {integrity: sha512-nNCvVBcZlvX4NU1nRRNV/mFl1nNRuTuslAJglQsq+8ldXe5Xv0Wd2f7WTE3jOxhLH2BFfiZGC6GCp+kHQbgG+w==} dependencies: '@types/prop-types': 15.7.11 '@types/scheduler': 0.16.8 @@ -4849,8 +4859,8 @@ packages: engines: {node: '>=0.8'} dev: true - /clsx@2.0.0: - resolution: {integrity: sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==} + /clsx@2.1.0: + resolution: {integrity: sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==} engines: {node: '>=6'} dev: false @@ -5300,7 +5310,7 @@ packages: /dom-helpers@5.2.1: resolution: {integrity: sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==} dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.23.7 csstype: 3.1.3 dev: false @@ -8131,8 +8141,8 @@ packages: es5-ext: 0.10.62 dev: true - /lucide-react@0.300.0(react@18.2.0): - resolution: {integrity: sha512-rQxUUCmWAvNLoAsMZ5j04b2+OJv6UuNLYMY7VK0eVlm4aTwUEjEEHc09/DipkNIlhXUSDn2xoyIzVT0uh7dRsg==} + /lucide-react@0.303.0(react@18.2.0): + resolution: {integrity: sha512-B0B9T3dLEFBYPCUlnUS1mvAhW1craSbF9HO+JfBjAtpFUJ7gMIqmEwNSclikY3RiN2OnCkj/V1ReAQpaHae8Bg==} peerDependencies: react: ^16.5.1 || ^17.0.0 || ^18.0.0 dependencies: @@ -9369,7 +9379,7 @@ packages: react: '>=16.6.0' react-dom: '>=16.6.0' dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.23.7 dom-helpers: 5.2.1 loose-envify: 1.4.0 prop-types: 15.8.1 diff --git a/turbo.json b/turbo.json index 90fe1e96..f42fe9f7 100644 --- a/turbo.json +++ b/turbo.json @@ -81,8 +81,7 @@ }, "codegen": { "cache": false, - "inputs": ["apps/web/src/api/server/*"], - "outputs": ["apps/web/src/api/types/generated/*"] + "inputs": ["apps/web/src/api/server/*"] }, "webhook": { "cache": false