Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions apps/cms/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# [LOCAL ENV] - NEVER USE PROD VALUES LOCALLY
# as editing PayloadCMS typescript config INSTANTLY CHANGES DB SCHEMA in dev mode
# The values set here are the default values provided when running `supabase start`.
# Do not add secrets here, this file is git-tracked. Use .env.local instead.
DATABASE_URI=postgresql://postgres:[email protected]:34322/postgres
PAYLOAD_SECRET=secret

S3_BUCKET=cms
S3_ACCESS_KEY_ID=625729a08b95bf1b7ff351a663f3a23c
S3_SECRET_ACCESS_KEY=850181e4652dd023b7a98c58ae0d2d34bd487ee0cc3254aed6eda37307425907
S3_REGION=local
S3_ENDPOINT=http://127.0.0.1:34321/storage/v1/s3

BLOG_APP_URL=http://localhost:3000
NEXT_PUBLIC_SERVER_URL=http://localhost:3000/blog
CRON_SECRET=secret
PREVIEW_SECRET=secret
13 changes: 0 additions & 13 deletions apps/cms/.env.example

This file was deleted.

File renamed without changes.
5 changes: 2 additions & 3 deletions apps/cms/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ yarn-debug.log*
yarn-error.log*

# local env files
.env*.local
!.env
.env.local

# vercel
.vercel
Expand All @@ -38,6 +39,4 @@ yarn-error.log*
*.tsbuildinfo
next-env.d.ts

.env

/media
48 changes: 48 additions & 0 deletions apps/cms/.vercelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Dependencies
node_modules
**/node_modules

# Build artifacts
.next/cache
.turbo
.eslintcache

# Development files
*.log
.env.local
.env.*.local

# Test files
**/*.test.*
**/*.spec.*
__tests__
**/__tests__
coverage

# Documentation
README.md
*.md
docs

# IDE files
.vscode
.idea
*.swp
*.swo

# OS files
.DS_Store
Thumbs.db

# Other apps (since we're only deploying CMS)
../studio
../www
../docs
../design-system
../ui-library
../../examples
../../tests
../../supabase
../../packages/ui-patterns
../../packages/ui
../../packages/shared-data
2 changes: 1 addition & 1 deletion apps/cms/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:
env_file:
- .env

# Uncomment the following to use postgres
# Uncomment the following to use postgres
postgres:
restart: always
image: postgres:latest
Expand Down
19 changes: 18 additions & 1 deletion apps/cms/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
import { withPayload } from '@payloadcms/next/withPayload'

import redirects from './redirects.js'
const redirects = async () => {
const internetExplorerRedirect = {
destination: '/ie-incompatible.html',
has: [
{
type: 'header',
key: 'user-agent',
value: '(.*Trident.*)', // all ie browsers
},
],
permanent: false,
source: '/:path((?!ie-incompatible.html$).*)', // all pages except the incompatibility page
}

const redirects = [internetExplorerRedirect]

return redirects
}

const NEXT_PUBLIC_SERVER_URL = process.env.VERCEL_PROJECT_PRODUCTION_URL
? `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`
Expand Down
48 changes: 32 additions & 16 deletions apps/cms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,59 @@
"license": "MIT",
"scripts": {
"build": "cross-env NODE_OPTIONS=--no-deprecation next build --turbopack",
"ci": "pnpm migrate && pnpm build",
"clean": "rimraf node_modules .next",
"dev": "cross-env NODE_OPTIONS=--no-deprecation next dev --turbopack --port 3030",
"dev:prod": "cross-env NODE_OPTIONS=--no-deprecation rm -rf .next && pnpm build && pnpm start",
"devsafe": "rm -rf .next && cross-env NODE_OPTIONS=--no-deprecation next dev",
"generate:importmap": "cross-env NODE_OPTIONS=--no-deprecation payload generate:importmap",
"generate:types": "cross-env NODE_OPTIONS=--no-deprecation payload generate:types",
"lint": "cross-env NODE_OPTIONS=--no-deprecation next lint",
"migrate": "cross-env NODE_OPTIONS=--no-deprecation tsx scripts/migrate.ts",
"payload": "cross-env NODE_OPTIONS=--no-deprecation payload",
"start": "cross-env NODE_OPTIONS=--no-deprecation next start",
"ci": "cross-env NODE_OPTIONS=--no-deprecation payload migrate && pnpm build",
"clean": "rimraf node_modules .next",
"start": "cross-env NODE_OPTIONS=--no-deprecation next start --port 3030",
"vercel-build": "pnpm migrate && pnpm build",
"typecheck_IGNORED": "tsc --noEmit"
},
"dependencies": {
"@payloadcms/db-postgres": "3.33.0",
"@payloadcms/live-preview-react": "^3.33.0",
"@payloadcms/next": "3.33.0",
"@payloadcms/payload-cloud": "3.33.0",
"@payloadcms/plugin-form-builder": "3.33.0",
"@payloadcms/plugin-nested-docs": "3.33.0",
"@payloadcms/plugin-seo": "3.33.0",
"@payloadcms/richtext-lexical": "3.33.0",
"@payloadcms/storage-s3": "3.33.0",
"@payloadcms/ui": "3.33.0",
"@payloadcms/admin-bar": "^3.50.0",
"@payloadcms/db-postgres": "^3.50.0",
"@payloadcms/live-preview-react": "^3.50.0",
"@payloadcms/next": "3.50.0",
"@payloadcms/payload-cloud": "3.50.0",
"@payloadcms/plugin-form-builder": "3.50.0",
"@payloadcms/plugin-nested-docs": "3.50.0",
"@payloadcms/plugin-seo": "3.50.0",
"@payloadcms/richtext-lexical": "3.50.0",
"@payloadcms/storage-s3": "3.50.0",
"@payloadcms/ui": "3.50.0",
"@radix-ui/react-checkbox": "^1.3.2",
"@radix-ui/react-label": "^2.1.7",
"@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-slot": "^1.2.3",
"class-variance-authority": "^0.7.1",
"clsx": "^1.2.1",
"common": "workspace:*",
"config": "workspace:*",
"cross-env": "^7.0.3",
"eslint-config-supabase": "workspace:*",
"graphql": "^16.8.1",
"graphql": "^16.11.0",
"image-size": "2.0.2",
"lucide-react": "^0.511.0",
"next": "catalog:",
"payload": "3.33.0",
"payload": "3.50.0",
"pg": "^8.16.3",
"prism-react-renderer": "^2.3.1",
"react": "catalog:",
"react-dom": "catalog:",
"sharp": "0.32.6"
"sharp": "0.32.6",
"tailwind-merge": "^1.13.2"
},
"devDependencies": {
"@types/node": "catalog:",
"@types/react": "catalog:",
"@types/react-dom": "catalog:",
"tsx": "^4.19.3",
"typescript": "5.7.3"
}
}
20 changes: 0 additions & 20 deletions apps/cms/redirects.js

This file was deleted.

28 changes: 28 additions & 0 deletions apps/cms/scripts/migrate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import payload from 'payload'
// Use a minimal config for migrations to avoid importing the full app graph during build
import payloadConfig from '../src/payload.migrate.config.ts'

async function run() {
try {
await payload.init({ config: payloadConfig })

// Ensure non-interactive: remove any dev-mode migration sentinel rows
try {
await payload.delete({
collection: 'payload-migrations',
where: { batch: { equals: -1 } },
})
} catch {}

await payload.db.migrate()
// eslint-disable-next-line no-console
console.log('✅ Payload migrations complete')
process.exit(0)
} catch (err) {
// eslint-disable-next-line no-console
console.error('❌ Payload migrations failed:', err)
process.exit(1)
}
}

run()
2 changes: 1 addition & 1 deletion apps/cms/src/access/isAdmin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AccessArgs, FieldAccess } from 'payload'
import type { User } from '@/payload-types'
import type { User } from '../payload-types'

type isAdmin = (args: AccessArgs<User>) => boolean

Expand Down
2 changes: 1 addition & 1 deletion apps/cms/src/access/isAuthenticated.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AccessArgs } from 'payload'

import type { User } from '@/payload-types'
import type { User } from '../payload-types'

type isAuthenticated = (args: AccessArgs<User>) => boolean

Expand Down
65 changes: 0 additions & 65 deletions apps/cms/src/blocks/ArchiveBlock/Component.tsx

This file was deleted.

Loading
Loading