style: 🎨 update Prettier config and format files

main
RaviAnand Mohabir 4 weeks ago
parent 93273f6fa9
commit ab5cd05b55

@ -1,6 +1,6 @@
{
"singleQuote": true,
"singleQuote": false,
"trailingComma": "all",
"printWidth": 100,
"semi": false
"semi": true
}

@ -1,24 +1,24 @@
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
import type { Metadata } from 'next'
import type { Metadata } from "next";
import config from '@payload-config'
import config from "@payload-config";
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
import { NotFoundPage, generatePageMetadata } from '@payloadcms/next/views'
import { importMap } from '../importMap'
import { NotFoundPage, generatePageMetadata } from "@payloadcms/next/views";
import { importMap } from "../importMap";
type Args = {
params: {
segments: string[]
}
segments: string[];
};
searchParams: {
[key: string]: string | string[]
}
}
[key: string]: string | string[];
};
};
export const generateMetadata = ({ params, searchParams }: Args): Promise<Metadata> =>
generatePageMetadata({ config, params, searchParams })
generatePageMetadata({ config, params, searchParams });
const NotFound = ({ params, searchParams }: Args) =>
NotFoundPage({ config, params, searchParams, importMap })
NotFoundPage({ config, params, searchParams, importMap });
export default NotFound
export default NotFound;

@ -1,24 +1,24 @@
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
import type { Metadata } from 'next'
import type { Metadata } from "next";
import config from '@payload-config'
import config from "@payload-config";
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
import { RootPage, generatePageMetadata } from '@payloadcms/next/views'
import { importMap } from '../importMap'
import { RootPage, generatePageMetadata } from "@payloadcms/next/views";
import { importMap } from "../importMap";
type Args = {
params: {
segments: string[]
}
segments: string[];
};
searchParams: {
[key: string]: string | string[]
}
}
[key: string]: string | string[];
};
};
export const generateMetadata = ({ params, searchParams }: Args): Promise<Metadata> =>
generatePageMetadata({ config, params, searchParams })
generatePageMetadata({ config, params, searchParams });
const Page = ({ params, searchParams }: Args) =>
RootPage({ config, params, searchParams, importMap })
RootPage({ config, params, searchParams, importMap });
export default Page
export default Page;

@ -1 +1 @@
export const importMap = {}
export const importMap = {};

@ -1,10 +1,16 @@
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
/* DO NOT MODIFY it because it could be re-written at any time. */
import config from '@payload-config'
import { REST_DELETE, REST_GET, REST_OPTIONS, REST_PATCH, REST_POST } from '@payloadcms/next/routes'
import config from "@payload-config";
import {
REST_DELETE,
REST_GET,
REST_OPTIONS,
REST_PATCH,
REST_POST,
} from "@payloadcms/next/routes";
export const GET = REST_GET(config)
export const POST = REST_POST(config)
export const DELETE = REST_DELETE(config)
export const PATCH = REST_PATCH(config)
export const OPTIONS = REST_OPTIONS(config)
export const GET = REST_GET(config);
export const POST = REST_POST(config);
export const DELETE = REST_DELETE(config);
export const PATCH = REST_PATCH(config);
export const OPTIONS = REST_OPTIONS(config);

@ -1,6 +1,6 @@
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
/* DO NOT MODIFY it because it could be re-written at any time. */
import config from '@payload-config'
import { GRAPHQL_PLAYGROUND_GET } from '@payloadcms/next/routes'
import config from "@payload-config";
import { GRAPHQL_PLAYGROUND_GET } from "@payloadcms/next/routes";
export const GET = GRAPHQL_PLAYGROUND_GET(config)
export const GET = GRAPHQL_PLAYGROUND_GET(config);

@ -1,6 +1,6 @@
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
/* DO NOT MODIFY it because it could be re-written at any time. */
import config from '@payload-config'
import { GRAPHQL_POST } from '@payloadcms/next/routes'
import config from "@payload-config";
import { GRAPHQL_POST } from "@payloadcms/next/routes";
export const POST = GRAPHQL_POST(config)
export const POST = GRAPHQL_POST(config);

@ -1,21 +1,21 @@
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
import configPromise from '@payload-config'
import '@payloadcms/next/css'
import { RootLayout } from '@payloadcms/next/layouts'
import configPromise from "@payload-config";
import "@payloadcms/next/css";
import { RootLayout } from "@payloadcms/next/layouts";
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
import React from 'react'
import React from "react";
import './custom.scss'
import { importMap } from './admin/importMap'
import "./custom.scss";
import { importMap } from "./admin/importMap";
type Args = {
children: React.ReactNode
}
children: React.ReactNode;
};
const Layout = ({ children }: Args) => (
<RootLayout importMap={importMap} config={configPromise}>
{children}
</RootLayout>
)
);
export default Layout
export default Layout;

@ -1,14 +1,14 @@
import configPromise from '@payload-config'
import { getPayload } from 'payload'
import configPromise from "@payload-config";
import { getPayload } from "payload";
export const GET = async () => {
const payload = await getPayload({
config: configPromise,
})
});
const data = await payload.find({
collection: 'users',
})
collection: "users",
});
return Response.json(data)
}
return Response.json(data);
};

@ -1,16 +1,16 @@
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: true,
}
};

@ -1,13 +1,13 @@
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: [
// Email added by default
// Add more fields as needed
],
}
};

@ -13,8 +13,8 @@ export interface Config {
collections: {
users: User;
media: Media;
'payload-preferences': PayloadPreference;
'payload-migrations': PayloadMigration;
"payload-preferences": PayloadPreference;
"payload-migrations": PayloadMigration;
};
db: {
defaultIDType: string;
@ -22,7 +22,7 @@ export interface Config {
globals: {};
locale: null;
user: User & {
collection: 'users';
collection: "users";
};
}
export interface UserAuthOperations {
@ -86,7 +86,7 @@ export interface Media {
export interface PayloadPreference {
id: string;
user: {
relationTo: 'users';
relationTo: "users";
value: string | User;
};
key?: string | null;
@ -121,7 +121,6 @@ export interface Auth {
[k: string]: unknown;
}
declare module 'payload' {
declare module "payload" {
export interface GeneratedTypes extends Config {}
}

@ -1,16 +1,16 @@
// storage-adapter-import-placeholder
import { mongooseAdapter } from '@payloadcms/db-mongodb'
import { lexicalEditor } from '@payloadcms/richtext-lexical'
import path from 'path'
import { buildConfig } from 'payload'
import { fileURLToPath } from 'url'
import sharp from 'sharp'
import { mongooseAdapter } from "@payloadcms/db-mongodb";
import { lexicalEditor } from "@payloadcms/richtext-lexical";
import path from "path";
import { buildConfig } from "payload";
import { fileURLToPath } from "url";
import sharp from "sharp";
import { Users } from './collections/Users'
import { Media } from './collections/Media'
import { Users } from "./collections/Users";
import { Media } from "./collections/Media";
const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename)
const filename = fileURLToPath(import.meta.url);
const dirname = path.dirname(filename);
export default buildConfig({
admin: {
@ -21,15 +21,15 @@ export default buildConfig({
},
collections: [Users, Media],
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"),
},
db: mongooseAdapter({
url: process.env.DATABASE_URI || '',
url: process.env.DATABASE_URI || "",
}),
sharp,
plugins: [
// storage-adapter-placeholder
],
})
});

Loading…
Cancel
Save