Skip to content

Commit

Permalink
Fix Admin UI generation to allow files returned from `getAdditionalFi…
Browse files Browse the repository at this point in the history
…les` to overwrite the files generated by Keystone
  • Loading branch information
emmatown committed Jun 17, 2021
1 parent 4e5634b commit 520f1fc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/hot-hotels-tie.md
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions examples-staging/basic/keystone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@ export default auth.withAuth(
// NOTE -- this is not implemented, keystone currently always provides an admin ui at /
// path: '/admin',
// isAccessAllowed,
getAdditionalFiles: [
() => [{ mode: 'write', outputPath: 'next.config.js', src: 'module.exports =whatever' }],
],
},
images: { upload: 'local' },
files: { upload: 'local' },
lists,
extendGraphqlSchema,

session: statelessSessions({ maxAge: sessionMaxAge, secret: sessionSecret }),
// TODO -- Create a separate example for stored/redis sessions
// session: storedSessions({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
);

Expand Down

0 comments on commit 520f1fc

Please sign in to comment.