fix: syntax issues
This commit is contained in:
+100
-21
@@ -1,31 +1,110 @@
|
|||||||
node_modules
|
# =============================================================
|
||||||
.pnpm-store
|
# SoftVowels — gitignore
|
||||||
dist
|
# Grouped by purpose. Patterns are anchored to the repo root
|
||||||
.output
|
# unless explicitly written with a leading "/" or "apps/...".
|
||||||
.astro
|
# =============================================================
|
||||||
.cache
|
|
||||||
.vercel
|
# ---------- Dependencies ----------------------------------------
|
||||||
.turbo
|
# pnpm content-addressed store
|
||||||
|
.pnpm-store/
|
||||||
|
# npm/yarn/pnpm lockfile caches
|
||||||
|
.npm/
|
||||||
|
.yarn/cache/
|
||||||
|
.yarn/build-state.yml
|
||||||
|
.yarn/install-state.gz
|
||||||
|
# Generic node_modules (covers root and every workspace)
|
||||||
|
node_modules/
|
||||||
|
**/node_modules/
|
||||||
|
|
||||||
|
# ---------- Build output ---------------------------------------
|
||||||
|
# Astro
|
||||||
|
.astro/
|
||||||
|
dist/
|
||||||
|
.output/
|
||||||
|
|
||||||
|
# Next.js / PayloadCMS
|
||||||
|
.next/
|
||||||
|
out/
|
||||||
|
build/
|
||||||
|
.cache/
|
||||||
|
|
||||||
|
# Vite
|
||||||
|
.vite/
|
||||||
|
|
||||||
|
# Deployment platforms (kept here in case we ever add them)
|
||||||
|
.vercel/
|
||||||
|
.netlify/
|
||||||
|
.turbo/
|
||||||
|
|
||||||
|
# ---------- Test / coverage ------------------------------------
|
||||||
|
coverage/
|
||||||
|
.nyc_output/
|
||||||
|
junit.xml
|
||||||
|
|
||||||
|
# ---------- Environment files ----------------------------------
|
||||||
|
# Never commit secrets. The .env.example templates are kept.
|
||||||
.env
|
.env
|
||||||
.env.*
|
.env.*
|
||||||
|
.env.local
|
||||||
|
.env.*.local
|
||||||
!.env.example
|
!.env.example
|
||||||
.DS_Store
|
|
||||||
|
# ---------- Logs -----------------------------------------------
|
||||||
*.log
|
*.log
|
||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
pnpm-debug.log*
|
pnpm-debug.log*
|
||||||
.idea
|
lerna-debug.log*
|
||||||
.vscode
|
|
||||||
.history
|
|
||||||
|
|
||||||
apps/cms/dist
|
# ---------- OS / editor cruft ---------------------------------
|
||||||
apps/cms/build
|
# macOS
|
||||||
apps/cms/.cache
|
.DS_Store
|
||||||
|
.AppleDouble
|
||||||
|
.LSOverride
|
||||||
|
# Windows
|
||||||
|
Thumbs.db
|
||||||
|
ehthumbs.db
|
||||||
|
Desktop.ini
|
||||||
|
$RECYCLE.BIN/
|
||||||
|
# Linux
|
||||||
|
*~
|
||||||
|
.nfs*
|
||||||
|
# Editors
|
||||||
|
.idea/
|
||||||
|
.vscode/
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
*~
|
||||||
|
.history/
|
||||||
|
|
||||||
apps/web/.astro
|
# ---------- Astro / Payload runtime artifacts -----------------
|
||||||
apps/web/dist
|
# Static site build (regenerated on every release)
|
||||||
apps/web/node_modules/.cache
|
apps/web/dist/
|
||||||
|
apps/web/.astro/
|
||||||
|
|
||||||
apps/cms/media
|
# CMS build artifacts and caches
|
||||||
apps/cms/uploads
|
apps/cms/.next/
|
||||||
|
apps/cms/.cache/
|
||||||
|
apps/cms/dist/
|
||||||
|
apps/cms/build/
|
||||||
|
|
||||||
.opencode
|
# CMS media uploads — stored in a Docker volume in production,
|
||||||
|
# not in the repo. Editors upload via /admin.
|
||||||
|
apps/cms/media/
|
||||||
|
apps/cms/uploads/
|
||||||
|
# Note: apps/cms/src/payload-types.ts is GENERATED but conventionally
|
||||||
|
# committed (drives IDE autocomplete and CI type-checks).
|
||||||
|
|
||||||
|
# ---------- Tooling caches -------------------------------------
|
||||||
|
# Prettier
|
||||||
|
.prettier-cache/
|
||||||
|
# ESLint
|
||||||
|
.eslintcache
|
||||||
|
.eslintcache.*
|
||||||
|
# TypeScript
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
# ---------- OpenCode (assistant runtime, not project code) ----
|
||||||
|
.opencode/
|
||||||
|
.opencode.json
|
||||||
|
|||||||
Vendored
+1
-1
@@ -2,4 +2,4 @@
|
|||||||
/// <reference types="next/image-types/global" />
|
/// <reference types="next/image-types/global" />
|
||||||
|
|
||||||
// NOTE: This file should not be edited
|
// NOTE: This file should not be edited
|
||||||
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
||||||
|
|||||||
Generated
+6720
File diff suppressed because it is too large
Load Diff
@@ -21,7 +21,7 @@
|
|||||||
"@payloadcms/richtext-lexical": "3.36.0",
|
"@payloadcms/richtext-lexical": "3.36.0",
|
||||||
"cross-env": "7.0.3",
|
"cross-env": "7.0.3",
|
||||||
"graphql": "16.10.0",
|
"graphql": "16.10.0",
|
||||||
"next": "15.1.4",
|
"next": "15.2.3",
|
||||||
"payload": "3.36.0",
|
"payload": "3.36.0",
|
||||||
"react": "19.0.0",
|
"react": "19.0.0",
|
||||||
"react-dom": "19.0.0",
|
"react-dom": "19.0.0",
|
||||||
|
|||||||
@@ -1,3 +1 @@
|
|||||||
{
|
export const importMap = {};
|
||||||
"importMap": {}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import config from '@payload-config';
|
|||||||
import '@payloadcms/next/css';
|
import '@payloadcms/next/css';
|
||||||
import type { ServerFunctionClient } from 'payload';
|
import type { ServerFunctionClient } from 'payload';
|
||||||
import { handleServerFunctions, RootLayout } from '@payloadcms/next/layouts';
|
import { handleServerFunctions, RootLayout } from '@payloadcms/next/layouts';
|
||||||
import { importMap } from '../../../admin/importMap';
|
import { importMap } from '../../../../admin/importMap';
|
||||||
|
|
||||||
type Args = { children: React.ReactNode };
|
type Args = { children: React.ReactNode };
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import type { Metadata } from 'next';
|
import type { Metadata } from 'next';
|
||||||
import config from '@payload-config';
|
import config from '@payload-config';
|
||||||
import { generatePageMetadata, RootPage } from '@payloadcms/next/views';
|
import { generatePageMetadata, RootPage } from '@payloadcms/next/views';
|
||||||
import { importMap } from '../../admin/importMap';
|
import { importMap } from '../../../../admin/importMap';
|
||||||
|
|
||||||
type Args = {
|
type Args = {
|
||||||
params: Promise<{ segments: string[] }>;
|
params: Promise<{ segments: string[] }>;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import config from '@payload-config';
|
|||||||
import '@payloadcms/next/css';
|
import '@payloadcms/next/css';
|
||||||
import type { ServerFunctionClient } from 'payload';
|
import type { ServerFunctionClient } from 'payload';
|
||||||
import { handleServerFunctions, RootLayout } from '@payloadcms/next/layouts';
|
import { handleServerFunctions, RootLayout } from '@payloadcms/next/layouts';
|
||||||
import { importMap } from './admin/importMap';
|
import { importMap } from '../admin/importMap';
|
||||||
import './custom.scss';
|
import './custom.scss';
|
||||||
|
|
||||||
type Args = {
|
type Args = {
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import type { CollectionConfig } from 'payload';
|
||||||
|
import { revalidateAstro } from '../hooks/revalidateAstro';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a new collection config that appends the Astro revalidation hook
|
||||||
|
* to `hooks.afterChange` without mutating the original module-level config.
|
||||||
|
*/
|
||||||
|
export function withRevalidate<T extends CollectionConfig>(config: T): T {
|
||||||
|
const existing = (config.hooks?.afterChange ?? []) as NonNullable<
|
||||||
|
NonNullable<CollectionConfig['hooks']>['afterChange']
|
||||||
|
>;
|
||||||
|
return {
|
||||||
|
...config,
|
||||||
|
hooks: {
|
||||||
|
...config.hooks,
|
||||||
|
afterChange: [...existing, revalidateAstro],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -13,7 +13,7 @@ import { Tags } from './collections/Tags';
|
|||||||
import { Editions } from './collections/Editions';
|
import { Editions } from './collections/Editions';
|
||||||
import { Subscribers } from './collections/Subscribers';
|
import { Subscribers } from './collections/Subscribers';
|
||||||
|
|
||||||
import { revalidateAstro } from './hooks/revalidateAstro';
|
import { withRevalidate } from './lib/withRevalidate';
|
||||||
|
|
||||||
const filename = fileURLToPath(import.meta.url);
|
const filename = fileURLToPath(import.meta.url);
|
||||||
const dirname = path.dirname(filename);
|
const dirname = path.dirname(filename);
|
||||||
@@ -23,6 +23,13 @@ const corsOrigins = (process.env.CORS_ORIGINS || '')
|
|||||||
.map((s) => s.trim())
|
.map((s) => s.trim())
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
|
|
||||||
|
// Wrap each publishing collection so a save fires the Astro rebuild webhook.
|
||||||
|
const articles = withRevalidate(Articles);
|
||||||
|
const authors = withRevalidate(Authors);
|
||||||
|
const categories = withRevalidate(Categories);
|
||||||
|
const tags = withRevalidate(Tags);
|
||||||
|
const editions = withRevalidate(Editions);
|
||||||
|
|
||||||
export default buildConfig({
|
export default buildConfig({
|
||||||
serverURL: process.env.SERVER_URL,
|
serverURL: process.env.SERVER_URL,
|
||||||
cors: corsOrigins,
|
cors: corsOrigins,
|
||||||
@@ -34,7 +41,7 @@ export default buildConfig({
|
|||||||
titleSuffix: ' · SoftVowels CMS',
|
titleSuffix: ' · SoftVowels CMS',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
collections: [Users, Media, Articles, Authors, Categories, Tags, Editions, Subscribers],
|
collections: [Users, Media, articles, authors, categories, tags, editions, Subscribers],
|
||||||
editor: lexicalEditor(),
|
editor: lexicalEditor(),
|
||||||
secret: process.env.PAYLOAD_SECRET || 'dev-secret-change-me',
|
secret: process.env.PAYLOAD_SECRET || 'dev-secret-change-me',
|
||||||
typescript: {
|
typescript: {
|
||||||
@@ -45,7 +52,6 @@ export default buildConfig({
|
|||||||
connectionString: process.env.DATABASE_URI || '',
|
connectionString: process.env.DATABASE_URI || '',
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
sharp: (sharp) => sharp,
|
|
||||||
upload: {
|
upload: {
|
||||||
limits: {
|
limits: {
|
||||||
fileSize: 25_000_000,
|
fileSize: 25_000_000,
|
||||||
@@ -53,6 +59,10 @@ export default buildConfig({
|
|||||||
},
|
},
|
||||||
endpoints: [],
|
endpoints: [],
|
||||||
hooks: {
|
hooks: {
|
||||||
afterChange: [revalidateAstro],
|
afterError: [
|
||||||
|
async (err) => {
|
||||||
|
console.error('[payload] afterError', err.error);
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
+30
-6
@@ -1,7 +1,11 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2022",
|
"target": "ES2022",
|
||||||
"lib": ["DOM", "DOM.Iterable", "ES2022"],
|
"lib": [
|
||||||
|
"DOM",
|
||||||
|
"DOM.Iterable",
|
||||||
|
"ES2022"
|
||||||
|
],
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "Bundler",
|
"moduleResolution": "Bundler",
|
||||||
"jsx": "preserve",
|
"jsx": "preserve",
|
||||||
@@ -16,10 +20,30 @@
|
|||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./src/*"],
|
"@/*": [
|
||||||
"@payload-config": ["./src/payload.config.ts"]
|
"./src/*"
|
||||||
}
|
],
|
||||||
|
"@payload-config": [
|
||||||
|
"./src/payload.config.ts"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"include": ["src/**/*", "next-env.d.ts", "**/*.ts", "**/*.tsx"],
|
"plugins": [
|
||||||
"exclude": ["node_modules", "dist", "build", ".next"]
|
{
|
||||||
|
"name": "next"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"**/*.ts",
|
||||||
|
"**/*.tsx",
|
||||||
|
"next-env.d.ts",
|
||||||
|
"src/**/*",
|
||||||
|
".next/types/**/*.ts"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"node_modules",
|
||||||
|
"dist",
|
||||||
|
"build",
|
||||||
|
".next"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user