Skip to content

Commit

Permalink
feat: add global blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
asbhogal committed Nov 28, 2024
1 parent b317e19 commit d74fdf4
Show file tree
Hide file tree
Showing 65 changed files with 1,272 additions and 5,019 deletions.
17 changes: 0 additions & 17 deletions codegen.ts

This file was deleted.

16 changes: 0 additions & 16 deletions next.config.mjs

This file was deleted.

7 changes: 7 additions & 0 deletions next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { NextConfig } from 'next';

const nextConfig: NextConfig = {
/* config options here */
};

export default nextConfig;
20 changes: 3 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"version": "3.0.0",
"description": "A personal portfolio site created for the repo owner (Aman Singh Bhogal.)",
"private": true,
"type": "module",
"scripts": {
"dev": "concurrently \"next dev --turbopack\" \"stylelint\" \"typed-scss-modules './src/**/*.scss' --watch\"",
"devturbo": "pnpm dev --turbo",
"devsafe": "rm -rf .next && pnpm dev",
"build": "cross-env NODE_OPTIONS=--no-deprecation next build",
"start": "cross-env NODE_OPTIONS=--no-deprecation next start",
Expand All @@ -16,10 +16,7 @@
"test": "playwright test",
"prepare": "husky",
"payload": "payload",
"codegen": "cross-env TS_NODE_PROJECT=tsconfig.codegen.json graphql-codegen --config codegen.ts",
"generate:types": "payload generate:types",
"generate:schema": "payload-graphql generate:schema",
"standalone-script": "payload run ./src/scripts/standalone-script.ts",
"generate:importmap": "cross-env NODE_OPTIONS=--no-deprecation payload generate:importmap"
},
"repository": {
Expand All @@ -39,7 +36,6 @@
"dependencies": {
"@axe-core/playwright": "^4.10.1",
"@payloadcms/ui": "latest",
"@splidejs/react-splide": "^0.7.12",
"@payloadcms/db-mongodb": "latest",
"@payloadcms/live-preview-react": "latest",
"@payloadcms/next": "latest",
Expand All @@ -50,16 +46,11 @@
"@payloadcms/plugin-search": "latest",
"@payloadcms/plugin-seo": "latest",
"@payloadcms/richtext-lexical": "latest",
"@splidejs/react-splide": "^0.7.12",
"@vercel/analytics": "^0.1.11",
"@vercel/speed-insights": "^1.1.0",
"babel-plugin-react-compiler": "0.0.0-experimental-fe484b5-20240912",
"classnames": "^2.5.1",
"cross-env": "^7.0.3",
"framer-motion": "^9.1.7",
"graphql": "^16.8.2",
"jsonwebtoken": "9.0.2",
"graphql-request": "^7.1.2",
"graphql-tag": "^2.12.6",
"mongodb": "^6.10.0",
"next": "15.0.3",
"payload": "latest",
Expand All @@ -75,11 +66,6 @@
"devDependencies": {
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "9.14.0",
"@graphql-codegen/cli": "^5.0.3",
"@graphql-codegen/client-preset": "^4.5.0",
"@graphql-codegen/typescript": "^4.1.1",
"@graphql-codegen/typescript-graphql-request": "^6.2.0",
"@graphql-codegen/typescript-operations": "^4.3.1",
"@innovixx/eslint-config": "^1.3.3",
"@playwright/test": "^1.48.2",
"@types/eslint__js": "^8.42.3",
Expand All @@ -89,7 +75,7 @@
"@typescript-eslint/eslint-plugin": "^8.14.0",
"@typescript-eslint/parser": "^8.14.0",
"concurrently": "^9.1.0",
"eslint": "^9.14.0",
"eslint": "9.14.0",
"eslint-config-next": "^15.0.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
Expand Down
34 changes: 34 additions & 0 deletions payload-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ export interface Config {
defaultIDType: string;
};
globals: {
'header-menu': HeaderMenu;
'footer-menu': FooterMenu;
};
globalsSelect: {
'header-menu': HeaderMenuSelect<false> | HeaderMenuSelect<true>;
'footer-menu': FooterMenuSelect<false> | FooterMenuSelect<true>;
};
locale: null;
Expand Down Expand Up @@ -672,6 +674,22 @@ export interface PayloadMigrationsSelect<T extends boolean = true> {
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "header-menu".
*/
export interface HeaderMenu {
id: string;
headerMenu?:
| {
linkText?: string | null;
linkUrl?: string | null;
id?: string | null;
}[]
| null;
updatedAt?: string | null;
createdAt?: string | null;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "footer-menu".
Expand All @@ -696,6 +714,22 @@ export interface FooterMenu {
updatedAt?: string | null;
createdAt?: string | null;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "header-menu_select".
*/
export interface HeaderMenuSelect<T extends boolean = true> {
headerMenu?:
| T
| {
linkText?: T;
linkUrl?: T;
id?: T;
};
updatedAt?: T;
createdAt?: T;
globalType?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "footer-menu_select".
Expand Down
13 changes: 7 additions & 6 deletions payload.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import { mongooseAdapter } from '@payloadcms/db-mongodb';
import { buildConfig } from 'payload';
import sharp from 'sharp';
import { fileURLToPath } from 'url';
import { Users } from './src/collections/users';
import { Pages } from './src/collections/pages';
import { Media } from './src/collections/media';
import { Projects } from './src/collections/projects';
import { Footer } from './src/globals/footer';
import { Users } from './src/payload/collections/users';
import { Pages } from './src/payload/collections/pages';
import { Media } from './src/payload/collections/media';
import { Projects } from './src/payload/collections/projects';
import { Footer } from './src/payload/globals/footer';
import { Header } from './src/payload/globals/header';

const filename = fileURLToPath(import.meta.url);
const dirname = path.dirname(filename);
Expand All @@ -36,7 +37,7 @@ export default buildConfig({
}),
editor: lexicalEditor(),

globals: [Footer],
globals: [Header, Footer],

i18n: {
supportedLanguages: { en },
Expand Down
Loading

0 comments on commit d74fdf4

Please sign in to comment.