-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: add .env file to .gitignore * feat: add sanity integration * feat: add sanity schema for navs * fix: import formatting in page.tsx and sanity.ts * chore(sanity): update sanity POC * chore(codegen): include codegen * chore(sanity): include markdown plugin * chore(sanity): update POC wiht sanity + codegen * chore(sanity): remove POC of page * chore(sanity): define first schema * chore(sanity): generating static pages --------- Co-authored-by: Irwing Naranjo <[email protected]>
- Loading branch information
Showing
41 changed files
with
20,645 additions
and
5,764 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
NEXT_PUBLIC_POSTHOG_KEY= | ||
NEXT_PUBLIC_POSTHOG_HOST= | ||
NEXT_PUBLIC_POSTHOG_UI_HOST= | ||
|
||
NEXT_PUBLIC_SANITY_PROJECT_ID= | ||
NEXT_PUBLIC_SANITY_DATASET= | ||
|
||
SANITY_API_READ_TOKEN= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,4 +36,8 @@ yarn-error.log* | |
next-env.d.ts | ||
|
||
# eslint | ||
.eslintcache | ||
.eslintcache | ||
.env | ||
|
||
.sanity | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# # GQL / code-generation | ||
src/api/**/* | ||
src/**/*.generated.* | ||
app/**/*.gener |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import type { CodegenConfig } from '@graphql-codegen/cli'; | ||
import defaultConfig from "./graphql.config"; | ||
|
||
const noTypeCheckingPlugin = { | ||
add: { | ||
content: [ | ||
"/* eslint-disable */", | ||
"/* @ts-nocheck */", | ||
"/* prettier-ignore */", | ||
"/* This file is automatically generated. Please do not modify it manually. */", | ||
], | ||
}, | ||
}; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment | ||
const config: CodegenConfig = { | ||
...defaultConfig, | ||
ignoreNoDocuments: true, | ||
generates: { | ||
"src/api/schema.gql": { | ||
plugins: ["schema-ast"], | ||
}, | ||
"src/api/types.ts": { | ||
plugins: [ | ||
"typescript", | ||
"typescript-operations", | ||
"typescript-graphql-request", | ||
noTypeCheckingPlugin, | ||
], | ||
config: { | ||
avoidOptionals: true, | ||
useTypeImports: true, | ||
defaultScalarType: "unknown", | ||
}, | ||
}, | ||
}, | ||
} satisfies CodegenConfig; | ||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import type { IGraphQLConfig } from "graphql-config"; | ||
import { loadEnvConfig } from "@next/env"; | ||
|
||
loadEnvConfig(process.cwd()); | ||
|
||
const projectId = process.env.NEXT_PUBLIC_SANITY_PROJECT_ID | ||
const dataset = process.env.NEXT_PUBLIC_SANITY_DATASET | ||
|
||
const config: IGraphQLConfig = { | ||
schema: `https://${projectId}.api.sanity.io/v1/graphql/${dataset}/default`, | ||
documents: ["src/**/*.gql"], | ||
}; | ||
|
||
export default config; |
Oops, something went wrong.