Skip to content

Commit

Permalink
feat: configure gql-codegen scripts, move to app directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierniki committed Sep 4, 2023
1 parent 53497c6 commit ac11596
Show file tree
Hide file tree
Showing 11 changed files with 270 additions and 21 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# 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
gql/fragment-masking.ts
gql/gql.ts
gql/graphql.ts
gql/index.ts

# dependencies
node_modules
Expand Down
5 changes: 5 additions & 0 deletions app/api/health/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { NextResponse } from "next/server"

export async function GET() {
return NextResponse.json({ status: "ok" }, { status: 200 })
}
13 changes: 13 additions & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import "../styles/tailwind.css"

import "../canvas"

export default function Web({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
<main className="main">{children}</main>
</body>
</html>
)
}
59 changes: 59 additions & 0 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import Head from "next/head"
import { Button } from "components/Button/Button"
import { LP_GRID_ITEMS } from "../lp-items"

export default function Web() {
return (
<>
<Head>
<meta property="og:url" content="https://next-enterprise.vercel.app/" />
<meta
property="og:image"
content="https://raw.githubusercontent.com/Blazity/next-enterprise/main/project-logo.png"
/>
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta name="twitter:card" content="summary_large_image" />
<title>Next.js Enterprise Boilerplate</title>
</Head>
<section className="bg-white dark:bg-gray-900">
<div className="mx-auto grid max-w-screen-xl px-4 py-8 text-center lg:py-16">
<div className="mx-auto place-self-center">
<h1 className="mb-4 max-w-2xl text-4xl font-extrabold leading-none tracking-tight dark:text-white md:text-5xl xl:text-6xl">
Next.js Enterprise Boilerplate
</h1>
<p className="mb-6 max-w-2xl font-light text-gray-500 dark:text-gray-400 md:text-lg lg:mb-8 lg:text-xl">
Jumpstart your enterprise project with our feature-packed, high-performance Next.js boilerplate!
Experience rapid UI development, AI-powered code reviews, and an extensive suite of tools for a smooth and
enjoyable development process.
</p>
<Button href="https://github.com/Blazity/next-enterprise" className="mr-3">
Get started
</Button>
<Button
href="https://vercel.com/new/git/external?repository-url=https://github.com/Blazity/next-enterprise"
intent="secondary"
>
Deploy Now
</Button>
</div>
</div>
</section>
<section className="bg-white dark:bg-gray-900">
<div className="mx-auto max-w-screen-xl px-4 py-8 sm:py-16 lg:px-6">
<div className="justify-center space-y-8 md:grid md:grid-cols-2 md:gap-12 md:space-y-0 lg:grid-cols-3">
{LP_GRID_ITEMS.map((singleItem) => (
<div key={singleItem.title} className="flex flex-col items-center justify-center text-center">
<div className="mb-4 flex h-10 w-10 items-center justify-center rounded-full bg-primary-100 p-1.5 text-blue-700 dark:bg-primary-900 lg:h-12 lg:w-12">
{singleItem.icon}
</div>
<h3 className="mb-2 text-xl font-bold dark:text-white">{singleItem.title}</h3>
<p className="text-gray-500 dark:text-gray-400">{singleItem.description}</p>
</div>
))}
</div>
</div>
</section>
</>
)
}
4 changes: 2 additions & 2 deletions codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { CodegenConfig } from "@graphql-codegen/cli"

const config: CodegenConfig = {
schema: process.env.HYGRAPH_CONTENT_API_URL,
documents: ["src/**/*.ts"],
documents: ["./**/*.ts"],
ignoreNoDocuments: true, // for better experience with the watcher
generates: {
"./src/gql/": {
"./gql/": {
preset: "client",
plugins: [],
},
Expand Down
1 change: 1 addition & 0 deletions env.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ export const env = createEnv({
client: {},
runtimeEnv: {
ANALYZE: process.env.ANALYZE,
HYGRAPH_CONTENT_API_URL: process.env.HYGRAPH_CONTENT_API_URL,
},
})
Empty file added gql/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference types="next/navigation-types/compat/navigation" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "cross-env FORCE_COLOR=1 next dev",
"dev": "npm-run-all --parallel \"development\" \"codegen --watch\"",
"development": "cross-env FORCE_COLOR=1 next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
Expand All @@ -21,8 +22,8 @@
"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",
"prebuild": "graphql-codegen --require dotenv/config --config codegen.ts",
"codegen": "graphql-codegen --require dotenv/config --config codegen.ts --watch"
"codegen": "graphql-codegen --require dotenv/config --config codegen.ts",
"prebuild": "codegen"
},
"dependencies": {
"@next/bundle-analyzer": "^13.3.0",
Expand Down Expand Up @@ -81,6 +82,7 @@
"@typescript-eslint/parser": "^5.54.1",
"all-contributors-cli": "^6.24.0",
"autoprefixer": "^10.4.14",
"concurrently": "^8.2.1",
"cross-env": "^7.0.3",
"dotenv": "^16.3.1",
"eslint": "8.46.0",
Expand All @@ -94,6 +96,7 @@
"fetch-mock": "^9.11.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"npm-run-all": "^4.1.5",
"patch-package": "^8.0.0",
"postcss": "^8.4.21",
"postinstall-postinstall": "^2.1.0",
Expand All @@ -110,4 +113,4 @@
"node": ">=18.15.0"
},
"packageManager": "[email protected]"
}
}
25 changes: 21 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
"display": "Next.js",
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
Expand All @@ -16,8 +20,21 @@
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"baseUrl": "."
"baseUrl": ".",
"plugins": [
{
"name": "next"
}
]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.mjs"],
"exclude": ["node_modules"]
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"**/*.mjs",
".next/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}
Loading

0 comments on commit ac11596

Please sign in to comment.