Skip to content

Commit

Permalink
fix: Failed build due to duplicate identifier of GeneratedTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
m453h committed Jul 17, 2024
1 parent ed6d830 commit 774ddbc
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 42 deletions.
72 changes: 30 additions & 42 deletions apps/roboshield/payload-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ export interface Config {
media: Media;
pages: Page;
users: User;
"payload-preferences": PayloadPreference;
"payload-migrations": PayloadMigration;
'payload-preferences': PayloadPreference;
'payload-migrations': PayloadMigration;
};
globals: {
"settings-site": SettingsSite;
'settings-site': SettingsSite;
};
}
/**
Expand Down Expand Up @@ -53,7 +53,7 @@ export interface Page {
subtitle: string;
id?: string | null;
blockName?: string | null;
blockType: "page-header";
blockType: 'page-header';
}
| SiteHero
| {
Expand All @@ -65,30 +65,30 @@ export interface Page {
}[];
id?: string | null;
blockName?: string | null;
blockType: "richtext";
blockType: 'richtext';
}
| {
image: string | Media;
id?: string | null;
blockName?: string | null;
blockType: "mediaBlock";
blockType: 'mediaBlock';
}
| {
externalEmbedFields?: {
embedType?: ("url" | "code") | null;
embedType?: ('url' | 'code') | null;
url?: string | null;
caption?: string | null;
code?: string | null;
};
id?: string | null;
blockName?: string | null;
blockType: "externalEmbed";
blockType: 'externalEmbed';
}
)[]
| null;
id?: string | null;
blockName?: string | null;
blockType: "content";
blockType: 'content';
}
| {
title: string;
Expand All @@ -105,7 +105,7 @@ export interface Page {
| null;
id?: string | null;
blockName?: string | null;
blockType: "statistics";
blockType: 'statistics';
}
| {
steps?:
Expand All @@ -124,7 +124,7 @@ export interface Page {
fetch: string;
id?: string | null;
blockName?: string | null;
blockType: "existing-robots-txt";
blockType: 'existing-robots-txt';
}
| {
title: string;
Expand All @@ -147,7 +147,7 @@ export interface Page {
};
id?: string | null;
blockName?: string | null;
blockType: "delays";
blockType: 'delays';
}
| {
title: string;
Expand All @@ -170,7 +170,7 @@ export interface Page {
};
id?: string | null;
blockName?: string | null;
blockType: "paths";
blockType: 'paths';
}
| {
title: string;
Expand All @@ -189,7 +189,7 @@ export interface Page {
};
id?: string | null;
blockName?: string | null;
blockType: "block-bots";
blockType: 'block-bots';
}
| {
title: string;
Expand All @@ -201,7 +201,7 @@ export interface Page {
placeholder: string;
id?: string | null;
blockName?: string | null;
blockType: "site-maps";
blockType: 'site-maps';
}
| {
title: string;
Expand All @@ -213,7 +213,7 @@ export interface Page {
placeholder: string;
id?: string | null;
blockName?: string | null;
blockType: "finish";
blockType: 'finish';
}
)[]
| null;
Expand All @@ -227,7 +227,7 @@ export interface Page {
};
id?: string | null;
blockName?: string | null;
blockType: "robots-txt-generator";
blockType: 'robots-txt-generator';
}
)[]
| null;
Expand All @@ -247,7 +247,7 @@ export interface Page {
| null;
updatedAt: string;
createdAt: string;
_status?: ("draft" | "published") | null;
_status?: ('draft' | 'published') | null;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
Expand All @@ -256,7 +256,7 @@ export interface Page {
export interface SiteHero {
heroHeaders?:
| {
headingType?: ("largeHeading" | "subHeading" | "rotatingText") | null;
headingType?: ('largeHeading' | 'subHeading' | 'rotatingText') | null;
title?: string | null;
id?: string | null;
}[]
Expand All @@ -267,7 +267,7 @@ export interface SiteHero {
heroCallToAction?: string | null;
id?: string | null;
blockName?: string | null;
blockType: "page-hero";
blockType: 'page-hero';
}
/**
* This interface was referenced by `Config`'s JSON-Schema
Expand All @@ -277,7 +277,7 @@ export interface User {
id: string;
firstName: string;
lastName: string;
roles: ("admin" | "editor")[];
roles: ('admin' | 'editor')[];
updatedAt: string;
createdAt: string;
email: string;
Expand All @@ -298,7 +298,7 @@ export interface User {
export interface PayloadPreference {
id: string;
user: {
relationTo: "users";
relationTo: 'users';
value: string | User;
};
key?: string | null;
Expand Down Expand Up @@ -341,27 +341,25 @@ export interface SettingsSite {
menus?:
| {
label: string;
linkType?: ("custom" | "internal") | null;
linkType?: ('custom' | 'internal') | null;
doc?: {
relationTo: "pages";
relationTo: 'pages';
value: string | Page;
} | null;
url?: string | null;
href: string;
id?: string | null;
}[]
| null;
connect?:
| ("Facebook" | "Twitter" | "Instagram" | "Linkedin" | "Github" | "Slack")
| null;
connect?: ('Facebook' | 'Twitter' | 'Instagram' | 'Linkedin' | 'Github' | 'Slack') | null;
};
secondaryNavigation?: {
menus?:
| {
label: string;
linkType?: ("custom" | "internal") | null;
linkType?: ('custom' | 'internal') | null;
doc?: {
relationTo: "pages";
relationTo: 'pages';
value: string | Page;
} | null;
url?: string | null;
Expand All @@ -374,13 +372,7 @@ export interface SettingsSite {
title: string;
links?:
| {
platform:
| "Facebook"
| "Twitter"
| "Instagram"
| "Linkedin"
| "Github"
| "Slack";
platform: 'Facebook' | 'Twitter' | 'Instagram' | 'Linkedin' | 'Github' | 'Slack';
url: string;
id?: string | null;
}[]
Expand All @@ -400,9 +392,9 @@ export interface SettingsSite {
name: string;
logo: string | Media;
label: string;
linkType?: ("custom" | "internal") | null;
linkType?: ('custom' | 'internal') | null;
doc?: {
relationTo: "pages";
relationTo: 'pages';
value: string | Page;
} | null;
url?: string | null;
Expand All @@ -414,7 +406,3 @@ export interface SettingsSite {
updatedAt?: string | null;
createdAt?: string | null;
}

declare module "payload" {
export interface GeneratedTypes extends Config {}
}
8 changes: 8 additions & 0 deletions apps/roboshield/payload.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { s3Adapter } from "@payloadcms/plugin-cloud-storage/s3";
import Users from "./src/payload/collections/Users";
import { defaultLocale, locales } from "./src/payload/utils/locales";
import { loadEnvConfig } from "@next/env";
import { Config } from "./payload-types";

const projectDir = process.cwd();
loadEnvConfig(projectDir);
Expand Down Expand Up @@ -122,4 +123,11 @@ export default buildConfig({
}),
] as any[],
telemetry: process?.env?.NODE_ENV !== "production",
typescript: {
declare: false, // defaults to true if not set
},
});

declare module "payload" {
export interface PayloadGeneratedTypes extends Config {}
}

0 comments on commit 774ddbc

Please sign in to comment.