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", "trailingComma": "all",
"printWidth": 100, "printWidth": 100,
"semi": false "semi": true
} }

@ -1,24 +1,24 @@
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* 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. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
import { NotFoundPage, generatePageMetadata } from '@payloadcms/next/views' import { NotFoundPage, generatePageMetadata } from "@payloadcms/next/views";
import { importMap } from '../importMap' import { importMap } from "../importMap";
type Args = { type Args = {
params: { params: {
segments: string[] segments: string[];
} };
searchParams: { searchParams: {
[key: string]: string | string[] [key: string]: string | string[];
} };
} };
export const generateMetadata = ({ params, searchParams }: Args): Promise<Metadata> => export const generateMetadata = ({ params, searchParams }: Args): Promise<Metadata> =>
generatePageMetadata({ config, params, searchParams }) generatePageMetadata({ config, params, searchParams });
const NotFound = ({ params, searchParams }: Args) => 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. */ /* 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. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
import { RootPage, generatePageMetadata } from '@payloadcms/next/views' import { RootPage, generatePageMetadata } from "@payloadcms/next/views";
import { importMap } from '../importMap' import { importMap } from "../importMap";
type Args = { type Args = {
params: { params: {
segments: string[] segments: string[];
} };
searchParams: { searchParams: {
[key: string]: string | string[] [key: string]: string | string[];
} };
} };
export const generateMetadata = ({ params, searchParams }: Args): Promise<Metadata> => export const generateMetadata = ({ params, searchParams }: Args): Promise<Metadata> =>
generatePageMetadata({ config, params, searchParams }) generatePageMetadata({ config, params, searchParams });
const Page = ({ params, searchParams }: Args) => 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. */ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
/* DO NOT MODIFY it because it could be re-written at any time. */ /* DO NOT MODIFY it because it could be re-written at any time. */
import config from '@payload-config' import config from "@payload-config";
import { REST_DELETE, REST_GET, REST_OPTIONS, REST_PATCH, REST_POST } from '@payloadcms/next/routes' import {
REST_DELETE,
REST_GET,
REST_OPTIONS,
REST_PATCH,
REST_POST,
} from "@payloadcms/next/routes";
export const GET = REST_GET(config) export const GET = REST_GET(config);
export const POST = REST_POST(config) export const POST = REST_POST(config);
export const DELETE = REST_DELETE(config) export const DELETE = REST_DELETE(config);
export const PATCH = REST_PATCH(config) export const PATCH = REST_PATCH(config);
export const OPTIONS = REST_OPTIONS(config) export const OPTIONS = REST_OPTIONS(config);

@ -1,6 +1,6 @@
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
/* DO NOT MODIFY it because it could be re-written at any time. */ /* DO NOT MODIFY it because it could be re-written at any time. */
import config from '@payload-config' import config from "@payload-config";
import { GRAPHQL_PLAYGROUND_GET } from '@payloadcms/next/routes' 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. */ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
/* DO NOT MODIFY it because it could be re-written at any time. */ /* DO NOT MODIFY it because it could be re-written at any time. */
import config from '@payload-config' import config from "@payload-config";
import { GRAPHQL_POST } from '@payloadcms/next/routes' 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. */ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
import configPromise from '@payload-config' import configPromise from "@payload-config";
import '@payloadcms/next/css' import "@payloadcms/next/css";
import { RootLayout } from '@payloadcms/next/layouts' import { RootLayout } from "@payloadcms/next/layouts";
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
import React from 'react' import React from "react";
import './custom.scss' import "./custom.scss";
import { importMap } from './admin/importMap' import { importMap } from "./admin/importMap";
type Args = { type Args = {
children: React.ReactNode children: React.ReactNode;
} };
const Layout = ({ children }: Args) => ( const Layout = ({ children }: Args) => (
<RootLayout importMap={importMap} config={configPromise}> <RootLayout importMap={importMap} config={configPromise}>
{children} {children}
</RootLayout> </RootLayout>
) );
export default Layout export default Layout;

@ -1,14 +1,14 @@
import configPromise from '@payload-config' import configPromise from "@payload-config";
import { getPayload } from 'payload' import { getPayload } from "payload";
export const GET = async () => { export const GET = async () => {
const payload = await getPayload({ const payload = await getPayload({
config: configPromise, config: configPromise,
}) });
const data = await payload.find({ 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 = { export const Media: CollectionConfig = {
slug: 'media', slug: "media",
access: { access: {
read: () => true, read: () => true,
}, },
fields: [ fields: [
{ {
name: 'alt', name: "alt",
type: 'text', type: "text",
required: true, required: true,
}, },
], ],
upload: true, upload: true,
} };

@ -1,13 +1,13 @@
import type { CollectionConfig } from 'payload' import type { CollectionConfig } from "payload";
export const Users: CollectionConfig = { export const Users: CollectionConfig = {
slug: 'users', slug: "users",
admin: { admin: {
useAsTitle: 'email', useAsTitle: "email",
}, },
auth: true, auth: true,
fields: [ fields: [
// Email added by default // Email added by default
// Add more fields as needed // Add more fields as needed
], ],
} };

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

@ -1,16 +1,16 @@
// storage-adapter-import-placeholder // storage-adapter-import-placeholder
import { mongooseAdapter } from '@payloadcms/db-mongodb' import { mongooseAdapter } from "@payloadcms/db-mongodb";
import { lexicalEditor } from '@payloadcms/richtext-lexical' import { lexicalEditor } from "@payloadcms/richtext-lexical";
import path from 'path' import path from "path";
import { buildConfig } from 'payload' import { buildConfig } from "payload";
import { fileURLToPath } from 'url' import { fileURLToPath } from "url";
import sharp from 'sharp' import sharp from "sharp";
import { Users } from './collections/Users' import { Users } from "./collections/Users";
import { Media } from './collections/Media' import { Media } from "./collections/Media";
const filename = fileURLToPath(import.meta.url) const filename = fileURLToPath(import.meta.url);
const dirname = path.dirname(filename) const dirname = path.dirname(filename);
export default buildConfig({ export default buildConfig({
admin: { admin: {
@ -21,15 +21,15 @@ export default buildConfig({
}, },
collections: [Users, Media], collections: [Users, Media],
editor: lexicalEditor(), editor: lexicalEditor(),
secret: process.env.PAYLOAD_SECRET || '', secret: process.env.PAYLOAD_SECRET || "",
typescript: { typescript: {
outputFile: path.resolve(dirname, 'payload-types.ts'), outputFile: path.resolve(dirname, "payload-types.ts"),
}, },
db: mongooseAdapter({ db: mongooseAdapter({
url: process.env.DATABASE_URI || '', url: process.env.DATABASE_URI || "",
}), }),
sharp, sharp,
plugins: [ plugins: [
// storage-adapter-placeholder // storage-adapter-placeholder
], ],
}) });

Loading…
Cancel
Save