changes to version, ssg, and storage
This commit is contained in:
1 parent
402a7f69aa
commit
2fef051c2f
32 files changed
+3311
-2743
No files matched your search
@@ -1,17 +1,17 @@
|
||||
export const dynamic = 'force-dynamic'
|
||||
|
||||
import IndexLink from "@/components/home-page-link";
|
||||
import Rule from "@/components/horizontal-rule";
|
||||
import { getHome } from "@/services/home-service";
|
||||
import { Mail } from "lucide-react";
|
||||
import Image from "next/image";
|
||||
|
||||
import ProfileImage from "../../../public/images/liam_pietralla.jpg";
|
||||
|
||||
const IndexPage = async () => {
|
||||
const home = await getHome();
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-4 justify-center items-center h-screen">
|
||||
<Image className="rounded-full" src="/images/liam_pietralla.jpg" width={200} height={200} alt="Liam Pietralla" />
|
||||
<Image className="rounded-full max-w-[200px]" src={ProfileImage} alt="Liam Pietralla" />
|
||||
<h1 className="text-5xl font-bold">Liam Pietralla</h1>
|
||||
<div className="flex flex-col md:flex-row gap-0 md:gap-[7px]">
|
||||
<h2 className="text-xl text-center">Enthusiastic Software Developer</h2>
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
export const dynamic = 'force-dynamic'
|
||||
|
||||
import ProjectCard from "@/components/project-card";
|
||||
import Rule from "@/components/horizontal-rule";
|
||||
import { getProjects } from "@/services/projects-service";
|
||||
@@ -7,12 +5,14 @@ import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { Fragment } from "react";
|
||||
|
||||
import ProfileImage from "../../../../public/images/liam_pietralla.jpg";
|
||||
|
||||
const ProjectsPage = async () => {
|
||||
const projects = await getProjects();
|
||||
return (
|
||||
<div className="flex flex-col gap-4 justify-center items-center my-15">
|
||||
<div className="flex flex-row items-center gap-2 my-2">
|
||||
<Image src="/images/liam_pietralla.jpg" width={50} height={50} alt="Liam Pietralla" className="rounded-full" />
|
||||
<Image src={ProfileImage} alt="Liam Pietralla" className="rounded-full max-w-[50px]" />
|
||||
<Link href="/" className="group leading-relaxed font-semi-bold">
|
||||
Liam Pietralla
|
||||
<span className="block max-w-0 group-hover:max-w-full transition-all duration-500 h-0.5 bg-white"></span>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
|
||||
import { S3ClientUploadHandler as S3ClientUploadHandler_f97aa6c64367fa259c5bc0567239ef24 } from '@payloadcms/storage-s3/client'
|
||||
import { CollectionCards as CollectionCards_ab83ff7e88da8d3530831f296ec4756a } from '@payloadcms/ui/rsc'
|
||||
|
||||
export const importMap = {
|
||||
|
||||
"@payloadcms/storage-s3/client#S3ClientUploadHandler": S3ClientUploadHandler_f97aa6c64367fa259c5bc0567239ef24,
|
||||
"@payloadcms/ui/rsc#CollectionCards": CollectionCards_ab83ff7e88da8d3530831f296ec4756a
|
||||
}
|
||||
@@ -1,27 +1,26 @@
|
||||
import type { CollectionConfig } from 'payload'
|
||||
import type { CollectionConfig } from "payload"
|
||||
|
||||
export const Media: CollectionConfig = {
|
||||
slug: 'media',
|
||||
slug: "media",
|
||||
access: {
|
||||
read: () => true,
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'alt',
|
||||
type: 'text',
|
||||
name: "alt",
|
||||
type: "text",
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
upload: {
|
||||
staticDir: 'portfolio-data/media',
|
||||
imageSizes: [
|
||||
{
|
||||
name: "thumbnail",
|
||||
width: 150,
|
||||
height: 150,
|
||||
position: 'centre',
|
||||
position: "centre",
|
||||
}
|
||||
],
|
||||
adminThumbnail: 'thumbnail',
|
||||
adminThumbnail: "thumbnail",
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { CollectionConfig } from "payload";
|
||||
|
||||
export const Projects: CollectionConfig = {
|
||||
@@ -44,5 +45,17 @@ export const Projects: CollectionConfig = {
|
||||
type: "text",
|
||||
required: false,
|
||||
}
|
||||
]
|
||||
],
|
||||
hooks: {
|
||||
afterChange: [
|
||||
async () => {
|
||||
revalidatePath("/projects");
|
||||
}
|
||||
],
|
||||
afterDelete: [
|
||||
async () => {
|
||||
revalidatePath("/projects");
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { CollectionConfig } from 'payload'
|
||||
import type { CollectionConfig } from "payload"
|
||||
|
||||
export const Users: CollectionConfig = {
|
||||
slug: 'users',
|
||||
slug: "users",
|
||||
admin: {
|
||||
useAsTitle: 'email',
|
||||
useAsTitle: "email",
|
||||
},
|
||||
auth: true,
|
||||
fields: [
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import Link from "next/link";
|
||||
import { DynamicIcon, IconName } from 'lucide-react/dynamic';
|
||||
import { DynamicIcon, IconName } from "lucide-react/dynamic";
|
||||
import { lucidIconMap } from "@/lib/lucid-options";
|
||||
|
||||
interface HomePageLinkProps {
|
||||
title: string;
|
||||
@@ -11,14 +12,14 @@ interface HomePageLinkProps {
|
||||
|
||||
const HomePageLink = ({ title, icon, url, isPopover }: HomePageLinkProps) => {
|
||||
const isRelative = !url.startsWith("http");
|
||||
const dynIcon = <DynamicIcon name={icon as IconName} />
|
||||
const IconComponent = lucidIconMap[icon as IconName];
|
||||
|
||||
if (isPopover) {
|
||||
if (isRelative) {
|
||||
return (
|
||||
<div className="relative group">
|
||||
<Link href={url} className="flex items-center space-x-2">
|
||||
{dynIcon}
|
||||
{icon && <IconComponent />}
|
||||
</Link>
|
||||
<div className="absolute left-1/2 -translate-x-1/2 z-10 hidden p-2 px-4 text-sm text-black bg-white rounded-md group-hover:block text-center">
|
||||
{title}
|
||||
@@ -29,7 +30,7 @@ const HomePageLink = ({ title, icon, url, isPopover }: HomePageLinkProps) => {
|
||||
return (
|
||||
<div className="relative group">
|
||||
<a href={url} className="flex items-center space-x-2">
|
||||
{dynIcon}
|
||||
{icon && <IconComponent />}
|
||||
</a>
|
||||
<div className="absolute left-1/2 -translate-x-1/2 z-10 hidden p-2 px-4 text-sm text-black bg-white rounded-md group-hover:block text-center">
|
||||
{title}
|
||||
@@ -41,14 +42,14 @@ const HomePageLink = ({ title, icon, url, isPopover }: HomePageLinkProps) => {
|
||||
if (isRelative) {
|
||||
return (
|
||||
<Link href={url} className="group leading-relaxed">
|
||||
<span className="flex flex-row gap-2">{dynIcon} {title}</span>
|
||||
<span className="flex flex-row gap-2">{icon && <IconComponent />} {title}</span>
|
||||
<span className="block max-w-0 group-hover:max-w-full transition-all duration-500 h-0.5 bg-white"></span>
|
||||
</Link>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<a href={url} className="group leading-relaxed">
|
||||
<span className="flex flex-row gap-2">{dynIcon} {title}</span>
|
||||
<span className="flex flex-row gap-2">{icon && <IconComponent />} {title}</span>
|
||||
<span className="block max-w-0 group-hover:max-w-full transition-all duration-500 h-0.5 bg-white"></span>
|
||||
</a>
|
||||
)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { lucideOptions } from "@/lib/lucid-options";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { GlobalConfig } from "payload";
|
||||
|
||||
export const Home: GlobalConfig = {
|
||||
@@ -54,4 +55,11 @@ export const Home: GlobalConfig = {
|
||||
],
|
||||
},
|
||||
],
|
||||
hooks: {
|
||||
afterChange: [
|
||||
async () => {
|
||||
revalidatePath("/projects");
|
||||
}
|
||||
],
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,15 @@
|
||||
import { Code2, Github, Linkedin, LucideIcon, Notebook } from "lucide-react"
|
||||
|
||||
export const lucideOptions: { label: string, value: string }[] = [
|
||||
{ label: "Code 2", value: "code-2" },
|
||||
{ label: "Notebook", value: "notebook" },
|
||||
{ label: "Github", value: "github" },
|
||||
{ label: "Linkedin", value: "linkedin" },
|
||||
]
|
||||
];
|
||||
|
||||
export const lucidIconMap: Record<string, LucideIcon> = {
|
||||
"code-2": Code2,
|
||||
"notebook": Notebook,
|
||||
"github": Github,
|
||||
"linkedin": Linkedin,
|
||||
};
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,193 +0,0 @@
|
||||
import { MigrateUpArgs, MigrateDownArgs, sql } from '@payloadcms/db-sqlite'
|
||||
|
||||
export async function up({ db }: MigrateUpArgs): Promise<void> {
|
||||
await db.run(sql`CREATE TABLE \`users_sessions\` (
|
||||
\`_order\` integer NOT NULL,
|
||||
\`_parent_id\` integer NOT NULL,
|
||||
\`id\` text PRIMARY KEY NOT NULL,
|
||||
\`created_at\` text,
|
||||
\`expires_at\` text NOT NULL,
|
||||
FOREIGN KEY (\`_parent_id\`) REFERENCES \`users\`(\`id\`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
`)
|
||||
await db.run(sql`CREATE INDEX \`users_sessions_order_idx\` ON \`users_sessions\` (\`_order\`);`)
|
||||
await db.run(sql`CREATE INDEX \`users_sessions_parent_id_idx\` ON \`users_sessions\` (\`_parent_id\`);`)
|
||||
await db.run(sql`CREATE TABLE \`users\` (
|
||||
\`id\` integer PRIMARY KEY NOT NULL,
|
||||
\`updated_at\` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL,
|
||||
\`created_at\` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL,
|
||||
\`email\` text NOT NULL,
|
||||
\`reset_password_token\` text,
|
||||
\`reset_password_expiration\` text,
|
||||
\`salt\` text,
|
||||
\`hash\` text,
|
||||
\`login_attempts\` numeric DEFAULT 0,
|
||||
\`lock_until\` text
|
||||
);
|
||||
`)
|
||||
await db.run(sql`CREATE INDEX \`users_updated_at_idx\` ON \`users\` (\`updated_at\`);`)
|
||||
await db.run(sql`CREATE INDEX \`users_created_at_idx\` ON \`users\` (\`created_at\`);`)
|
||||
await db.run(sql`CREATE UNIQUE INDEX \`users_email_idx\` ON \`users\` (\`email\`);`)
|
||||
await db.run(sql`CREATE TABLE \`media\` (
|
||||
\`id\` integer PRIMARY KEY NOT NULL,
|
||||
\`alt\` text NOT NULL,
|
||||
\`updated_at\` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL,
|
||||
\`created_at\` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL,
|
||||
\`url\` text,
|
||||
\`thumbnail_u_r_l\` text,
|
||||
\`filename\` text,
|
||||
\`mime_type\` text,
|
||||
\`filesize\` numeric,
|
||||
\`width\` numeric,
|
||||
\`height\` numeric,
|
||||
\`focal_x\` numeric,
|
||||
\`focal_y\` numeric,
|
||||
\`sizes_thumbnail_url\` text,
|
||||
\`sizes_thumbnail_width\` numeric,
|
||||
\`sizes_thumbnail_height\` numeric,
|
||||
\`sizes_thumbnail_mime_type\` text,
|
||||
\`sizes_thumbnail_filesize\` numeric,
|
||||
\`sizes_thumbnail_filename\` text
|
||||
);
|
||||
`)
|
||||
await db.run(sql`CREATE INDEX \`media_updated_at_idx\` ON \`media\` (\`updated_at\`);`)
|
||||
await db.run(sql`CREATE INDEX \`media_created_at_idx\` ON \`media\` (\`created_at\`);`)
|
||||
await db.run(sql`CREATE UNIQUE INDEX \`media_filename_idx\` ON \`media\` (\`filename\`);`)
|
||||
await db.run(sql`CREATE INDEX \`media_sizes_thumbnail_sizes_thumbnail_filename_idx\` ON \`media\` (\`sizes_thumbnail_filename\`);`)
|
||||
await db.run(sql`CREATE TABLE \`project_tags\` (
|
||||
\`_order\` integer NOT NULL,
|
||||
\`_parent_id\` integer NOT NULL,
|
||||
\`id\` text PRIMARY KEY NOT NULL,
|
||||
\`tag\` text NOT NULL,
|
||||
FOREIGN KEY (\`_parent_id\`) REFERENCES \`project\`(\`id\`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
`)
|
||||
await db.run(sql`CREATE INDEX \`project_tags_order_idx\` ON \`project_tags\` (\`_order\`);`)
|
||||
await db.run(sql`CREATE INDEX \`project_tags_parent_id_idx\` ON \`project_tags\` (\`_parent_id\`);`)
|
||||
await db.run(sql`CREATE TABLE \`project\` (
|
||||
\`id\` integer PRIMARY KEY NOT NULL,
|
||||
\`title\` text NOT NULL,
|
||||
\`description\` text NOT NULL,
|
||||
\`featured_image_id\` integer,
|
||||
\`view_link\` text,
|
||||
\`repository_link\` text,
|
||||
\`updated_at\` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL,
|
||||
\`created_at\` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL,
|
||||
FOREIGN KEY (\`featured_image_id\`) REFERENCES \`media\`(\`id\`) ON UPDATE no action ON DELETE set null
|
||||
);
|
||||
`)
|
||||
await db.run(sql`CREATE INDEX \`project_featured_image_idx\` ON \`project\` (\`featured_image_id\`);`)
|
||||
await db.run(sql`CREATE INDEX \`project_updated_at_idx\` ON \`project\` (\`updated_at\`);`)
|
||||
await db.run(sql`CREATE INDEX \`project_created_at_idx\` ON \`project\` (\`created_at\`);`)
|
||||
await db.run(sql`CREATE TABLE \`payload_locked_documents\` (
|
||||
\`id\` integer PRIMARY KEY NOT NULL,
|
||||
\`global_slug\` text,
|
||||
\`updated_at\` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL,
|
||||
\`created_at\` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL
|
||||
);
|
||||
`)
|
||||
await db.run(sql`CREATE INDEX \`payload_locked_documents_global_slug_idx\` ON \`payload_locked_documents\` (\`global_slug\`);`)
|
||||
await db.run(sql`CREATE INDEX \`payload_locked_documents_updated_at_idx\` ON \`payload_locked_documents\` (\`updated_at\`);`)
|
||||
await db.run(sql`CREATE INDEX \`payload_locked_documents_created_at_idx\` ON \`payload_locked_documents\` (\`created_at\`);`)
|
||||
await db.run(sql`CREATE TABLE \`payload_locked_documents_rels\` (
|
||||
\`id\` integer PRIMARY KEY NOT NULL,
|
||||
\`order\` integer,
|
||||
\`parent_id\` integer NOT NULL,
|
||||
\`path\` text NOT NULL,
|
||||
\`users_id\` integer,
|
||||
\`media_id\` integer,
|
||||
\`project_id\` integer,
|
||||
FOREIGN KEY (\`parent_id\`) REFERENCES \`payload_locked_documents\`(\`id\`) ON UPDATE no action ON DELETE cascade,
|
||||
FOREIGN KEY (\`users_id\`) REFERENCES \`users\`(\`id\`) ON UPDATE no action ON DELETE cascade,
|
||||
FOREIGN KEY (\`media_id\`) REFERENCES \`media\`(\`id\`) ON UPDATE no action ON DELETE cascade,
|
||||
FOREIGN KEY (\`project_id\`) REFERENCES \`project\`(\`id\`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
`)
|
||||
await db.run(sql`CREATE INDEX \`payload_locked_documents_rels_order_idx\` ON \`payload_locked_documents_rels\` (\`order\`);`)
|
||||
await db.run(sql`CREATE INDEX \`payload_locked_documents_rels_parent_idx\` ON \`payload_locked_documents_rels\` (\`parent_id\`);`)
|
||||
await db.run(sql`CREATE INDEX \`payload_locked_documents_rels_path_idx\` ON \`payload_locked_documents_rels\` (\`path\`);`)
|
||||
await db.run(sql`CREATE INDEX \`payload_locked_documents_rels_users_id_idx\` ON \`payload_locked_documents_rels\` (\`users_id\`);`)
|
||||
await db.run(sql`CREATE INDEX \`payload_locked_documents_rels_media_id_idx\` ON \`payload_locked_documents_rels\` (\`media_id\`);`)
|
||||
await db.run(sql`CREATE INDEX \`payload_locked_documents_rels_project_id_idx\` ON \`payload_locked_documents_rels\` (\`project_id\`);`)
|
||||
await db.run(sql`CREATE TABLE \`payload_preferences\` (
|
||||
\`id\` integer PRIMARY KEY NOT NULL,
|
||||
\`key\` text,
|
||||
\`value\` text,
|
||||
\`updated_at\` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL,
|
||||
\`created_at\` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL
|
||||
);
|
||||
`)
|
||||
await db.run(sql`CREATE INDEX \`payload_preferences_key_idx\` ON \`payload_preferences\` (\`key\`);`)
|
||||
await db.run(sql`CREATE INDEX \`payload_preferences_updated_at_idx\` ON \`payload_preferences\` (\`updated_at\`);`)
|
||||
await db.run(sql`CREATE INDEX \`payload_preferences_created_at_idx\` ON \`payload_preferences\` (\`created_at\`);`)
|
||||
await db.run(sql`CREATE TABLE \`payload_preferences_rels\` (
|
||||
\`id\` integer PRIMARY KEY NOT NULL,
|
||||
\`order\` integer,
|
||||
\`parent_id\` integer NOT NULL,
|
||||
\`path\` text NOT NULL,
|
||||
\`users_id\` integer,
|
||||
FOREIGN KEY (\`parent_id\`) REFERENCES \`payload_preferences\`(\`id\`) ON UPDATE no action ON DELETE cascade,
|
||||
FOREIGN KEY (\`users_id\`) REFERENCES \`users\`(\`id\`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
`)
|
||||
await db.run(sql`CREATE INDEX \`payload_preferences_rels_order_idx\` ON \`payload_preferences_rels\` (\`order\`);`)
|
||||
await db.run(sql`CREATE INDEX \`payload_preferences_rels_parent_idx\` ON \`payload_preferences_rels\` (\`parent_id\`);`)
|
||||
await db.run(sql`CREATE INDEX \`payload_preferences_rels_path_idx\` ON \`payload_preferences_rels\` (\`path\`);`)
|
||||
await db.run(sql`CREATE INDEX \`payload_preferences_rels_users_id_idx\` ON \`payload_preferences_rels\` (\`users_id\`);`)
|
||||
await db.run(sql`CREATE TABLE \`payload_migrations\` (
|
||||
\`id\` integer PRIMARY KEY NOT NULL,
|
||||
\`name\` text,
|
||||
\`batch\` numeric,
|
||||
\`updated_at\` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL,
|
||||
\`created_at\` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL
|
||||
);
|
||||
`)
|
||||
await db.run(sql`CREATE INDEX \`payload_migrations_updated_at_idx\` ON \`payload_migrations\` (\`updated_at\`);`)
|
||||
await db.run(sql`CREATE INDEX \`payload_migrations_created_at_idx\` ON \`payload_migrations\` (\`created_at\`);`)
|
||||
await db.run(sql`CREATE TABLE \`home_main_links\` (
|
||||
\`_order\` integer NOT NULL,
|
||||
\`_parent_id\` integer NOT NULL,
|
||||
\`id\` text PRIMARY KEY NOT NULL,
|
||||
\`title\` text NOT NULL,
|
||||
\`url\` text NOT NULL,
|
||||
\`icon\` text NOT NULL,
|
||||
FOREIGN KEY (\`_parent_id\`) REFERENCES \`home\`(\`id\`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
`)
|
||||
await db.run(sql`CREATE INDEX \`home_main_links_order_idx\` ON \`home_main_links\` (\`_order\`);`)
|
||||
await db.run(sql`CREATE INDEX \`home_main_links_parent_id_idx\` ON \`home_main_links\` (\`_parent_id\`);`)
|
||||
await db.run(sql`CREATE TABLE \`home_popover_links\` (
|
||||
\`_order\` integer NOT NULL,
|
||||
\`_parent_id\` integer NOT NULL,
|
||||
\`id\` text PRIMARY KEY NOT NULL,
|
||||
\`title\` text NOT NULL,
|
||||
\`url\` text NOT NULL,
|
||||
\`icon\` text NOT NULL,
|
||||
FOREIGN KEY (\`_parent_id\`) REFERENCES \`home\`(\`id\`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
`)
|
||||
await db.run(sql`CREATE INDEX \`home_popover_links_order_idx\` ON \`home_popover_links\` (\`_order\`);`)
|
||||
await db.run(sql`CREATE INDEX \`home_popover_links_parent_id_idx\` ON \`home_popover_links\` (\`_parent_id\`);`)
|
||||
await db.run(sql`CREATE TABLE \`home\` (
|
||||
\`id\` integer PRIMARY KEY NOT NULL,
|
||||
\`updated_at\` text,
|
||||
\`created_at\` text
|
||||
);
|
||||
`)
|
||||
}
|
||||
|
||||
export async function down({ db }: MigrateDownArgs): Promise<void> {
|
||||
await db.run(sql`DROP TABLE \`users_sessions\`;`)
|
||||
await db.run(sql`DROP TABLE \`users\`;`)
|
||||
await db.run(sql`DROP TABLE \`media\`;`)
|
||||
await db.run(sql`DROP TABLE \`project_tags\`;`)
|
||||
await db.run(sql`DROP TABLE \`project\`;`)
|
||||
await db.run(sql`DROP TABLE \`payload_locked_documents\`;`)
|
||||
await db.run(sql`DROP TABLE \`payload_locked_documents_rels\`;`)
|
||||
await db.run(sql`DROP TABLE \`payload_preferences\`;`)
|
||||
await db.run(sql`DROP TABLE \`payload_preferences_rels\`;`)
|
||||
await db.run(sql`DROP TABLE \`payload_migrations\`;`)
|
||||
await db.run(sql`DROP TABLE \`home_main_links\`;`)
|
||||
await db.run(sql`DROP TABLE \`home_popover_links\`;`)
|
||||
await db.run(sql`DROP TABLE \`home\`;`)
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import * as migration_20250828_224637 from './20250828_224637';
|
||||
|
||||
export const migrations = [
|
||||
{
|
||||
up: migration_20250828_224637.up,
|
||||
down: migration_20250828_224637.down,
|
||||
name: '20250828_224637'
|
||||
},
|
||||
];
|
||||
@@ -70,6 +70,7 @@ export interface Config {
|
||||
users: User;
|
||||
media: Media;
|
||||
project: Project;
|
||||
'payload-kv': PayloadKv;
|
||||
'payload-locked-documents': PayloadLockedDocument;
|
||||
'payload-preferences': PayloadPreference;
|
||||
'payload-migrations': PayloadMigration;
|
||||
@@ -79,6 +80,7 @@ export interface Config {
|
||||
users: UsersSelect<false> | UsersSelect<true>;
|
||||
media: MediaSelect<false> | MediaSelect<true>;
|
||||
project: ProjectSelect<false> | ProjectSelect<true>;
|
||||
'payload-kv': PayloadKvSelect<false> | PayloadKvSelect<true>;
|
||||
'payload-locked-documents': PayloadLockedDocumentsSelect<false> | PayloadLockedDocumentsSelect<true>;
|
||||
'payload-preferences': PayloadPreferencesSelect<false> | PayloadPreferencesSelect<true>;
|
||||
'payload-migrations': PayloadMigrationsSelect<false> | PayloadMigrationsSelect<true>;
|
||||
@@ -86,6 +88,7 @@ export interface Config {
|
||||
db: {
|
||||
defaultIDType: number;
|
||||
};
|
||||
fallbackLocale: null;
|
||||
globals: {
|
||||
home: Home;
|
||||
};
|
||||
@@ -192,6 +195,23 @@ export interface Project {
|
||||
updatedAt: string;
|
||||
createdAt: string;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "payload-kv".
|
||||
*/
|
||||
export interface PayloadKv {
|
||||
id: number;
|
||||
key: string;
|
||||
data:
|
||||
| {
|
||||
[k: string]: unknown;
|
||||
}
|
||||
| unknown[]
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| null;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "payload-locked-documents".
|
||||
@@ -326,6 +346,14 @@ export interface ProjectSelect<T extends boolean = true> {
|
||||
updatedAt?: T;
|
||||
createdAt?: T;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "payload-kv_select".
|
||||
*/
|
||||
export interface PayloadKvSelect<T extends boolean = true> {
|
||||
key?: T;
|
||||
data?: T;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "payload-locked-documents_select".
|
||||
|
||||
+33
-18
@@ -1,14 +1,15 @@
|
||||
import { lexicalEditor } from '@payloadcms/richtext-lexical'
|
||||
import path from 'path'
|
||||
import { buildConfig } from 'payload'
|
||||
import { fileURLToPath } from 'url'
|
||||
import sharp from 'sharp'
|
||||
import { sqliteAdapter } from '@payloadcms/db-sqlite'
|
||||
import { postgresAdapter } from "@payloadcms/db-postgres"
|
||||
import { lexicalEditor } from "@payloadcms/richtext-lexical"
|
||||
import path from "path"
|
||||
import { buildConfig } from "payload"
|
||||
import { s3Storage } from "@payloadcms/storage-s3"
|
||||
import sharp from "sharp"
|
||||
import { fileURLToPath } from "url"
|
||||
|
||||
import { Users } from './collections/Users'
|
||||
import { Media } from './collections/Media'
|
||||
import { Media } from "./collections/Media"
|
||||
import { Projects } from "./collections/Projects"
|
||||
import { Home } from './globals/home'
|
||||
import { Users } from "./collections/Users"
|
||||
import { Home } from "./globals/home"
|
||||
|
||||
const filename = fileURLToPath(import.meta.url)
|
||||
const dirname = path.dirname(filename)
|
||||
@@ -23,17 +24,31 @@ export default buildConfig({
|
||||
collections: [Users, Media, Projects],
|
||||
globals: [Home],
|
||||
editor: lexicalEditor(),
|
||||
secret: process.env.PAYLOAD_SECRET || '',
|
||||
secret: process.env.PAYLOAD_SECRET || "",
|
||||
typescript: {
|
||||
outputFile: path.resolve(dirname, 'payload-types.ts'),
|
||||
outputFile: path.resolve(dirname, "payload-types.ts"),
|
||||
},
|
||||
/**
|
||||
* Both our media and db will reside in the 'portfolio-data' directory
|
||||
* We can use a docker volume to persist this data
|
||||
*/
|
||||
db: sqliteAdapter({
|
||||
client: { url: "file:./portfolio-data/data.db" }
|
||||
db: postgresAdapter({
|
||||
pool: {
|
||||
connectionString: process.env.DATABASE_URL || "",
|
||||
},
|
||||
}),
|
||||
sharp,
|
||||
plugins: [],
|
||||
plugins: [
|
||||
s3Storage({
|
||||
collections: {
|
||||
media: true,
|
||||
},
|
||||
bucket: process.env.S3_BUCKET || "",
|
||||
config: {
|
||||
forcePathStyle: true,
|
||||
region: process.env.S3_REGION || "",
|
||||
credentials: {
|
||||
accessKeyId: process.env.S3_ACCESS_KEY_ID || "",
|
||||
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY || "",
|
||||
},
|
||||
endpoint: process.env.S3_ENDPOINT || undefined,
|
||||
}
|
||||
}),
|
||||
],
|
||||
})
|
||||
Reference in new issue
Block a user