From 123042b047f3242ac95d2c5280de8c07f18a86be Mon Sep 17 00:00:00 2001 From: Mitchell Hamilton Date: Thu, 17 Jun 2021 13:58:25 +1000 Subject: [PATCH] Fix Admin UI generation to allow files returned from `getAdditionalFiles` to overwrite the files generated by Keystone (#5920) * Fix Admin UI generation to allow files returned from `getAdditionalFiles` to overwrite the files generated by Keystone * Revert some changes --- .changeset/hot-hotels-tie.md | 5 +++++ .../keystone/src/admin-ui/system/generateAdminUI.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/hot-hotels-tie.md diff --git a/.changeset/hot-hotels-tie.md b/.changeset/hot-hotels-tie.md new file mode 100644 index 00000000000..2cf3f676b8b --- /dev/null +++ b/.changeset/hot-hotels-tie.md @@ -0,0 +1,5 @@ +--- +'@keystone-next/keystone': patch +--- + +Fixed Admin UI generation to allow files returned from `getAdditionalFiles` to overwrite the files generated by Keystone diff --git a/packages-next/keystone/src/admin-ui/system/generateAdminUI.ts b/packages-next/keystone/src/admin-ui/system/generateAdminUI.ts index d9bfd4b2440..250a48e1249 100644 --- a/packages-next/keystone/src/admin-ui/system/generateAdminUI.ts +++ b/packages-next/keystone/src/admin-ui/system/generateAdminUI.ts @@ -89,7 +89,7 @@ export const generateAdminUI = async ( ); await Promise.all( adminFiles - .filter(x => !uniqueFiles.has(Path.normalize(x.outputPath))) + .filter(x => !uniqueFiles.has(Path.normalize(Path.join(projectAdminPath, x.outputPath)))) .map(file => writeAdminFile(file, projectAdminPath)) );