Skip to content

Commit

Permalink
feat: add codegen, temporarily remove semantic-relase
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierniki committed Sep 4, 2023
1 parent fa9a0bc commit 53497c6
Show file tree
Hide file tree
Showing 5 changed files with 1,590 additions and 2,272 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# codegen
src/gql/fragment-masking.ts
src/gql/gql.ts
src/gql/graphql.ts
src/gql/index.ts

# dependencies
node_modules
.pnp
Expand All @@ -24,6 +30,7 @@ yarn-error.log*
.pnpm-debug.log*

# local env files
.env
.env.local
.env.development.local
.env.test.local
Expand Down
15 changes: 15 additions & 0 deletions codegen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { CodegenConfig } from "@graphql-codegen/cli"

const config: CodegenConfig = {
schema: process.env.HYGRAPH_CONTENT_API_URL,
documents: ["src/**/*.ts"],
ignoreNoDocuments: true, // for better experience with the watcher
generates: {
"./src/gql/": {
preset: "client",
plugins: [],
},
},
}

export default config
1 change: 1 addition & 0 deletions env.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const env = createEnv({
.enum(["true", "false"])
.optional()
.transform((value) => value === "true"),
HYGRAPH_CONTENT_API_URL: z.string(),
},
client: {},
runtimeEnv: {
Expand Down
18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"postinstall": "npx patch-package -y",
"preinstall": "npx only-allow yarn",
"coupling-graph": "npx madge --extensions js,jsx,ts,tsx,css,md,mdx ./ --exclude '.next|tailwind.config.js|reset.d.ts|prettier.config.js|postcss.config.js|playwright.config.ts|next.config.js|next-env.d.ts|instrumentation.ts|e2e/|README.md|.storybook/|.eslintrc.js' --image graph.svg"
"coupling-graph": "npx madge --extensions js,jsx,ts,tsx,css,md,mdx ./ --exclude '.next|tailwind.config.js|reset.d.ts|prettier.config.js|postcss.config.js|playwright.config.ts|next.config.js|next-env.d.ts|instrumentation.ts|e2e/|README.md|.storybook/|.eslintrc.js' --image graph.svg",
"prebuild": "graphql-codegen --require dotenv/config --config codegen.ts",
"codegen": "graphql-codegen --require dotenv/config --config codegen.ts --watch"
},
"dependencies": {
"@next/bundle-analyzer": "^13.3.0",
Expand All @@ -39,15 +41,11 @@
"@radix-ui/react-tabs": "^1.0.3",
"@radix-ui/react-toggle-group": "^1.0.3",
"@radix-ui/react-tooltip": "^1.0.5",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^10.0.0",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^9.0.0",
"@semantic-release/npm": "^10.0.3",
"@semantic-release/release-notes-generator": "^11.0.1",
"@t3-oss/env-nextjs": "^0.6.0",
"@vercel/otel": "^0.3.0",
"class-variance-authority": "^0.7.0",
"graphql": "^16.8.0",
"graphql-request": "^6.1.0",
"lodash": "^4.17.21",
"next": "^13.3.0",
"next-compose-plugins": "^2.2.1",
Expand All @@ -58,8 +56,12 @@
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@graphql-codegen/cli": "^5.0.0",
"@graphql-codegen/client-preset": "^4.1.0",
"@graphql-typed-document-node/core": "^3.2.0",
"@jest/globals": "^29.5.0",
"@opentelemetry/api": "^1.4.1",
"@parcel/watcher": "^2.3.0",
"@playwright/test": "^1.32.3",
"@storybook/addon-essentials": "^7.0.5",
"@storybook/addon-interactions": "^7.0.5",
Expand All @@ -80,6 +82,7 @@
"all-contributors-cli": "^6.24.0",
"autoprefixer": "^10.4.14",
"cross-env": "^7.0.3",
"dotenv": "^16.3.1",
"eslint": "8.46.0",
"eslint-config-next": "13.4.19",
"eslint-config-prettier": "^9.0.0",
Expand All @@ -96,7 +99,6 @@
"postinstall-postinstall": "^2.1.0",
"prettier": "latest",
"prettier-plugin-tailwindcss": "^0.4.0",
"semantic-release": "^21.0.1",
"storybook": "^7.0.5",
"tailwindcss": "^3.2.7",
"ts-jest": "^29.1.0",
Expand Down
Loading

0 comments on commit 53497c6

Please sign in to comment.