From 72d8a16ac221262a3b4c265570baf184dd109400 Mon Sep 17 00:00:00 2001 From: Zhu Zhanyan Date: Mon, 20 May 2024 10:35:01 +0800 Subject: [PATCH 1/2] refactor(cms): redirect payload to move generated types to cms directory --- apps/cms/src/payload.config.ts | 2 +- packages/types/src/lib/cms.ts => apps/cms/src/types.ts | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) rename packages/types/src/lib/cms.ts => apps/cms/src/types.ts (96%) diff --git a/apps/cms/src/payload.config.ts b/apps/cms/src/payload.config.ts index 8e628176..63a5afce 100644 --- a/apps/cms/src/payload.config.ts +++ b/apps/cms/src/payload.config.ts @@ -79,7 +79,7 @@ export default buildConfig({ // outputFile: path.resolve(__dirname, "payload-types.ts"), outputFile: path.resolve( __dirname, - "../../../packages/types/src/lib/cms.ts" + "types.ts" ), // overridden by PAYLOAD_TS_OUTPUT_PATH env var }, graphQL: { diff --git a/packages/types/src/lib/cms.ts b/apps/cms/src/types.ts similarity index 96% rename from packages/types/src/lib/cms.ts rename to apps/cms/src/types.ts index 7236123c..ece41843 100644 --- a/packages/types/src/lib/cms.ts +++ b/apps/cms/src/types.ts @@ -1,7 +1,6 @@ /* tslint:disable */ -/* eslint-disable */ /** - * This file was automatically generated by Payload. + * This file was automatically generated by Payload CMS. * DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config, * and re-run `payload generate:types` to regenerate this file. */ @@ -90,7 +89,7 @@ export interface User { name?: string; updatedAt: string; createdAt: string; - email: string; + email?: string; resetPasswordToken?: string; resetPasswordExpiration?: string; salt?: string; From f4741417a7bdaed4e350bc70846d1234b41e5ad6 Mon Sep 17 00:00:00 2001 From: Zhu Zhanyan Date: Mon, 20 May 2024 10:45:24 +0800 Subject: [PATCH 2/2] refactor: remove references to moved cms.ts generated types --- CODEOWNERS | 1 - apps/cms/tsconfig.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index e48c2256..71e8c2bb 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -18,7 +18,6 @@ /packages/schemas/lib/cms.graphql @jack-thant /packages/tsconfig/** @chanbakjsd /packages/types/** @chanbakjsd -/packages/types/lib/cms.ts @jack-thant /packages/types/lib/merch.ts @chanbakjsd /packages/ui/** @chanbakjsd diff --git a/apps/cms/tsconfig.json b/apps/cms/tsconfig.json index d2830361..5893934b 100644 --- a/apps/cms/tsconfig.json +++ b/apps/cms/tsconfig.json @@ -13,7 +13,7 @@ "allowSyntheticDefaultImports": true, "paths": { "payload/generated-types": [ - "../../packages/types/lib/cms.ts" // Ensure this matches the path to your typescript outputFile + "./src/types.ts" // Ensure this matches the path to your typescript outputFile ] } },