From 0865a954d43111a933021cac58dbd0722f090c49 Mon Sep 17 00:00:00 2001 From: James Brinkerhoff Date: Thu, 30 Jan 2025 15:56:59 -0700 Subject: [PATCH] fixed builds --- .gitignore | 3 +- apps/website/.env.example | 14 --- .../src/endpoints/seed/contact-page.ts | 70 +++++------ .../website/src/endpoints/seed/home-static.ts | 2 +- apps/website/src/endpoints/seed/home.ts | 6 +- apps/website/src/payload-types.ts | 118 +++++++++--------- package.json | 6 +- turbo.json | 37 ++++++ 8 files changed, 138 insertions(+), 118 deletions(-) delete mode 100644 apps/website/.env.example diff --git a/.gitignore b/.gitignore index eb4b92d..8e6b107 100644 --- a/.gitignore +++ b/.gitignore @@ -317,4 +317,5 @@ test/databaseAdapter.js /filename-compound-index /media-with-relation-preview /media-without-relation-preview -/media-without-cache-tags \ No newline at end of file +/media-without-cache-tags +.vercel diff --git a/apps/website/.env.example b/apps/website/.env.example deleted file mode 100644 index d0ebafa..0000000 --- a/apps/website/.env.example +++ /dev/null @@ -1,14 +0,0 @@ -# Database connection string -DATABASE_URI=postgres://postgres:@127.0.0.1:5432/your-database-name - -# Or use a PG connection string -#DATABASE_URI=postgresql://127.0.0.1:5432/your-database-name - -# Used to encrypt JWT tokens -PAYLOAD_SECRET=YOUR_SECRET_HERE - -# Used to configure CORS, format links and more. No trailing slash -NEXT_PUBLIC_SERVER_URL=http://localhost:3000 - -# Secret used to authenticate cron jobs -CRON_SECRET=YOUR_CRON_SECRET_HERE diff --git a/apps/website/src/endpoints/seed/contact-page.ts b/apps/website/src/endpoints/seed/contact-page.ts index 8c67e29..8352c08 100644 --- a/apps/website/src/endpoints/seed/contact-page.ts +++ b/apps/website/src/endpoints/seed/contact-page.ts @@ -7,41 +7,41 @@ export const contact: Partial = { type: 'none', }, layout: [ - { - blockType: 'formBlock', - enableIntro: true, - form: '{{CONTACT_FORM_ID}}', - introContent: { - root: { - type: 'root', - children: [ - { - type: 'heading', - children: [ - { - type: 'text', - detail: 0, - format: 0, - mode: 'normal', - style: '', - text: 'Example contact form:', - version: 1, - }, - ], - direction: 'ltr', - format: '', - indent: 0, - tag: 'h3', - version: 1, - }, - ], - direction: 'ltr', - format: '', - indent: 0, - version: 1, - }, - }, - }, + // { + // blockType: 'formBlock', + // enableIntro: true, + // form: '{{CONTACT_FORM_ID}}', + // introContent: { + // root: { + // type: 'root', + // children: [ + // { + // type: 'heading', + // children: [ + // { + // type: 'text', + // detail: 0, + // format: 0, + // mode: 'normal', + // style: '', + // text: 'Example contact form:', + // version: 1, + // }, + // ], + // direction: 'ltr', + // format: '', + // indent: 0, + // tag: 'h3', + // version: 1, + // }, + // ], + // direction: 'ltr', + // format: '', + // indent: 0, + // version: 1, + // }, + // }, + // }, ], title: 'Contact', } diff --git a/apps/website/src/endpoints/seed/home-static.ts b/apps/website/src/endpoints/seed/home-static.ts index 91c7558..547a6a7 100644 --- a/apps/website/src/endpoints/seed/home-static.ts +++ b/apps/website/src/endpoints/seed/home-static.ts @@ -84,7 +84,7 @@ export const homeStatic: Page = { title: 'Payload Website Template', }, title: 'Home', - id: '', + id: 0, layout: [], updatedAt: '', createdAt: '', diff --git a/apps/website/src/endpoints/seed/home.ts b/apps/website/src/endpoints/seed/home.ts index 3856eaa..f11ff4b 100644 --- a/apps/website/src/endpoints/seed/home.ts +++ b/apps/website/src/endpoints/seed/home.ts @@ -23,7 +23,7 @@ export const home: RequiredDataFromCollectionSlug<'pages'> = { }, }, ], - media: '{{IMAGE_1}}', + media: 0, richText: { root: { type: 'root', @@ -501,7 +501,7 @@ export const home: RequiredDataFromCollectionSlug<'pages'> = { { blockName: 'Media Block', blockType: 'mediaBlock', - media: '{{IMAGE_2}}', + media: 0, }, { blockName: 'Archive Block', @@ -657,7 +657,7 @@ export const home: RequiredDataFromCollectionSlug<'pages'> = { ], meta: { description: 'An open-source website built with Payload and Next.js.', - image: '{{IMAGE_1}}', + image: 0, title: 'Payload Website Template', }, title: 'Home', diff --git a/apps/website/src/payload-types.ts b/apps/website/src/payload-types.ts index 7051d8f..8d3bbaf 100644 --- a/apps/website/src/payload-types.ts +++ b/apps/website/src/payload-types.ts @@ -42,7 +42,7 @@ export interface Config { 'payload-migrations': PayloadMigrationsSelect | PayloadMigrationsSelect; }; db: { - defaultIDType: string; + defaultIDType: number; }; globals: { header: Header; @@ -90,7 +90,7 @@ export interface UserAuthOperations { * via the `definition` "pages". */ export interface Page { - id: string; + id: number; title: string; hero: { type: 'none' | 'highImpact' | 'mediumImpact' | 'lowImpact'; @@ -117,11 +117,11 @@ export interface Page { reference?: | ({ relationTo: 'pages'; - value: string | Page; + value: number | Page; } | null) | ({ relationTo: 'posts'; - value: string | Post; + value: number | Post; } | null); url?: string | null; label: string; @@ -133,7 +133,7 @@ export interface Page { id?: string | null; }[] | null; - media?: (string | null) | Media; + media?: (number | null) | Media; }; layout: (CallToActionBlock | ContentBlock | MediaBlock | ArchiveBlock | FormBlock)[]; meta?: { @@ -141,7 +141,7 @@ export interface Page { /** * Maximum upload file size: 12MB. Recommended file size for images is <500KB. */ - image?: (string | null) | Media; + image?: (number | null) | Media; description?: string | null; }; publishedAt?: string | null; @@ -156,9 +156,9 @@ export interface Page { * via the `definition` "posts". */ export interface Post { - id: string; + id: number; title: string; - heroImage?: (string | null) | Media; + heroImage?: (number | null) | Media; content: { root: { type: string; @@ -174,18 +174,18 @@ export interface Post { }; [k: string]: unknown; }; - relatedPosts?: (string | Post)[] | null; - categories?: (string | Category)[] | null; + relatedPosts?: (number | Post)[] | null; + categories?: (number | Category)[] | null; meta?: { title?: string | null; /** * Maximum upload file size: 12MB. Recommended file size for images is <500KB. */ - image?: (string | null) | Media; + image?: (number | null) | Media; description?: string | null; }; publishedAt?: string | null; - authors?: (string | User)[] | null; + authors?: (number | User)[] | null; populatedAuthors?: | { id?: string | null; @@ -203,7 +203,7 @@ export interface Post { * via the `definition` "media". */ export interface Media { - id: string; + id: number; alt?: string | null; caption?: { root: { @@ -295,14 +295,14 @@ export interface Media { * via the `definition` "categories". */ export interface Category { - id: string; + id: number; title: string; slug?: string | null; slugLock?: boolean | null; - parent?: (string | null) | Category; + parent?: (number | null) | Category; breadcrumbs?: | { - doc?: (string | null) | Category; + doc?: (number | null) | Category; url?: string | null; label?: string | null; id?: string | null; @@ -316,7 +316,7 @@ export interface Category { * via the `definition` "users". */ export interface User { - id: string; + id: number; name?: string | null; updatedAt: string; createdAt: string; @@ -357,11 +357,11 @@ export interface CallToActionBlock { reference?: | ({ relationTo: 'pages'; - value: string | Page; + value: number | Page; } | null) | ({ relationTo: 'posts'; - value: string | Post; + value: number | Post; } | null); url?: string | null; label: string; @@ -407,11 +407,11 @@ export interface ContentBlock { reference?: | ({ relationTo: 'pages'; - value: string | Page; + value: number | Page; } | null) | ({ relationTo: 'posts'; - value: string | Post; + value: number | Post; } | null); url?: string | null; label: string; @@ -432,7 +432,7 @@ export interface ContentBlock { * via the `definition` "MediaBlock". */ export interface MediaBlock { - media: string | Media; + media: number | Media; id?: string | null; blockName?: string | null; blockType: 'mediaBlock'; @@ -459,12 +459,12 @@ export interface ArchiveBlock { } | null; populateBy?: ('collection' | 'selection') | null; relationTo?: 'posts' | null; - categories?: (string | Category)[] | null; + categories?: (number | Category)[] | null; limit?: number | null; selectedDocs?: | { relationTo: 'posts'; - value: string | Post; + value: number | Post; }[] | null; id?: string | null; @@ -476,7 +476,7 @@ export interface ArchiveBlock { * via the `definition` "FormBlock". */ export interface FormBlock { - form: string | Form; + form: number | Form; enableIntro?: boolean | null; introContent?: { root: { @@ -502,7 +502,7 @@ export interface FormBlock { * via the `definition` "forms". */ export interface Form { - id: string; + id: number; title: string; fields?: | ( @@ -675,7 +675,7 @@ export interface Form { * via the `definition` "redirects". */ export interface Redirect { - id: string; + id: number; /** * You will need to rebuild the website when changing this field. */ @@ -685,11 +685,11 @@ export interface Redirect { reference?: | ({ relationTo: 'pages'; - value: string | Page; + value: number | Page; } | null) | ({ relationTo: 'posts'; - value: string | Post; + value: number | Post; } | null); url?: string | null; }; @@ -701,8 +701,8 @@ export interface Redirect { * via the `definition` "form-submissions". */ export interface FormSubmission { - id: string; - form: string | Form; + id: number; + form: number | Form; submissionData?: | { field: string; @@ -720,18 +720,18 @@ export interface FormSubmission { * via the `definition` "search". */ export interface Search { - id: string; + id: number; title?: string | null; priority?: number | null; doc: { relationTo: 'posts'; - value: string | Post; + value: number | Post; }; slug?: string | null; meta?: { title?: string | null; description?: string | null; - image?: (string | null) | Media; + image?: (number | null) | Media; }; categories?: | { @@ -748,7 +748,7 @@ export interface Search { * via the `definition` "payload-jobs". */ export interface PayloadJob { - id: string; + id: number; /** * Input data provided to the job */ @@ -840,52 +840,52 @@ export interface PayloadJob { * via the `definition` "payload-locked-documents". */ export interface PayloadLockedDocument { - id: string; + id: number; document?: | ({ relationTo: 'pages'; - value: string | Page; + value: number | Page; } | null) | ({ relationTo: 'posts'; - value: string | Post; + value: number | Post; } | null) | ({ relationTo: 'media'; - value: string | Media; + value: number | Media; } | null) | ({ relationTo: 'categories'; - value: string | Category; + value: number | Category; } | null) | ({ relationTo: 'users'; - value: string | User; + value: number | User; } | null) | ({ relationTo: 'redirects'; - value: string | Redirect; + value: number | Redirect; } | null) | ({ relationTo: 'forms'; - value: string | Form; + value: number | Form; } | null) | ({ relationTo: 'form-submissions'; - value: string | FormSubmission; + value: number | FormSubmission; } | null) | ({ relationTo: 'search'; - value: string | Search; + value: number | Search; } | null) | ({ relationTo: 'payload-jobs'; - value: string | PayloadJob; + value: number | PayloadJob; } | null); globalSlug?: string | null; user: { relationTo: 'users'; - value: string | User; + value: number | User; }; updatedAt: string; createdAt: string; @@ -895,10 +895,10 @@ export interface PayloadLockedDocument { * via the `definition` "payload-preferences". */ export interface PayloadPreference { - id: string; + id: number; user: { relationTo: 'users'; - value: string | User; + value: number | User; }; key?: string | null; value?: @@ -918,7 +918,7 @@ export interface PayloadPreference { * via the `definition` "payload-migrations". */ export interface PayloadMigration { - id: string; + id: number; name?: string | null; batch?: number | null; updatedAt: string; @@ -1477,7 +1477,7 @@ export interface PayloadMigrationsSelect { * via the `definition` "header". */ export interface Header { - id: string; + id: number; navItems?: | { link: { @@ -1486,11 +1486,11 @@ export interface Header { reference?: | ({ relationTo: 'pages'; - value: string | Page; + value: number | Page; } | null) | ({ relationTo: 'posts'; - value: string | Post; + value: number | Post; } | null); url?: string | null; label: string; @@ -1506,7 +1506,7 @@ export interface Header { * via the `definition` "footer". */ export interface Footer { - id: string; + id: number; navItems?: | { link: { @@ -1515,11 +1515,11 @@ export interface Footer { reference?: | ({ relationTo: 'pages'; - value: string | Page; + value: number | Page; } | null) | ({ relationTo: 'posts'; - value: string | Post; + value: number | Post; } | null); url?: string | null; label: string; @@ -1587,14 +1587,14 @@ export interface TaskSchedulePublish { doc?: | ({ relationTo: 'pages'; - value: string | Page; + value: number | Page; } | null) | ({ relationTo: 'posts'; - value: string | Post; + value: number | Post; } | null); global?: string | null; - user?: (string | null) | User; + user?: (number | null) | User; }; output?: unknown; } diff --git a/package.json b/package.json index 360faa8..85e3545 100644 --- a/package.json +++ b/package.json @@ -10,18 +10,14 @@ "build:app": "next build", "build:app:analyze": "cross-env ANALYZE=true next build", "build:clean": "pnpm clean:build", - "build:core": "turbo build --filter \"!@payloadcms/plugin-*\" --filter \"!@payloadcms/storage-*\"", + "build:core": "turbo build --filter \"!@payloadcms/plugin-*\"", "build:core:force": "pnpm clean:build && pnpm build:core --no-cache --force", "build:email-resend": "turbo build --filter \"@payloadcms/email-resend\"", "build:force": "pnpm run build:core:force", "build:packages": "turbo build --filter=./packages/*", "build:payload-engaged-cli": "turbo build --filter payload-engaged-cli", - "build:plugin-multi-tenant": "turbo build --filter \"@payloadcms/plugin-multi-tenant\"", - "build:plugin-stripe": "turbo build --filter \"@payloadcms/plugin-stripe\"", "build:plugins": "turbo build --filter \"@payloadcms/plugin-*\"", "build:releaser": "turbo build --filter \"@tools/releaser\"", - "build:storage-s3": "turbo build --filter \"@payloadcms/storage-s3\"", - "build:storage-uploadthing": "turbo build --filter \"@payloadcms/storage-uploadthing\"", "build:tests": "pnpm --filter payload-test-suite run typecheck", "build:tools": "turbo build --filter=./tools/*", "build:ui": "turbo build --filter \"@payloadcms/ui\"", diff --git a/turbo.json b/turbo.json index ae73d0d..95eb558 100644 --- a/turbo.json +++ b/turbo.json @@ -50,5 +50,42 @@ "DATABASE_URI", "PAYLOAD_SECRET", "NEXT_PUBLIC_SERVER_URL" + ], + "globalPassThroughEnv": [ + "NODE_ENV", + "CI", + "VERCEL", + "VERCEL_ENV", + "VERCEL_URL", + "npm_lifecycle_event", + "DATABASE_URL", + "AUTH_DISCORD_ID", + "AUTH_DISCORD_SECRET", + "POSTGRES_PRISMA_URL", + "POSTGRES_URL_NON_POOLING", + "POSTGRES_URL", + "AUTH_REDIRECT_PROXY_URL", + "EXPO_PUBLIC_SUPABASE_ANON_KEY", + "EXPO_PUBLIC_SUPABASE_URL", + "SUPABASE_URL", + "NEXT_PUBLIC_SUPABASE_URL", + "SUPABASE_JWT_SECRET", + "POSTGRES_USER", + "NEXT_PUBLIC_SUPABASE_ANON_KEY", + "SUPABASE_SERVICE_ROLE_KEY", + "AUTH_SECRET", + "PORT", + "GHOST_API_URL", + "GHOST_CONTENT_API_KEY", + "GHOST_ADMIN_API_KEY", + "OPENAI_API_KEY", + "BROWSERBASE_API_KEY", + "BROWSERBASE_PROJECT_ID", + "STRIPE_SK", + "STRIPE_SECRET_KEY_LIVE", + "STRIPE_WEBHOOK_SECRET", + "DATABASE_URI", + "PAYLOAD_SECRET", + "NEXT_PUBLIC_SERVER_URL" ] }