keystone
keystone copied to clipboard
Use app router template
ref #9183
Blocked by
- [x] #9189
This PR updates the template to generate the App router, default to typescript version which can be turned off by setting config.ui.tsx = false
What is completed/Verified:
- [x] generate app routes in
app/(admin)folder (creates admin route specific layout page. ifsrcpage exist, it generates it in `src/app/(admin) - [x] Stop generating
next.config.jsfile, this should be generated fromcreate-keystone-appgoing forward (TODO) - [x] ~~set default
ui.basePathto/admin~~ can setui.basePathto/adminor any other sub path - [x] No longer copies admin files or generates pages export copy as they are no longer needed
- [x] Does not clear the admin folder files if exist, only overwrites the special config files which contains up to date admin meta and view cache, this should be removed before GA
- [x] Verified custom pages
- [x] Verified custom fields and field views
- [x] can use relative path or even "paths" from typescript (
@fields/text/myView) - [x] Added
--reset-adminflag todevcommand to force clean(admin)folder, useful in regenerate the admin template if updated in future. should never be needed except braking upgrade - [x] fix build and start script
- [x]
@keystone-6/authtemplates - [x] page middleware
Pending:
- [ ] Documentation
- [ ] fixing final set of failing tests
@dcousens can you create a v-next branch which should be actual target for these PRs instead of main
For anyone interested in testing this out, I have published temporary packages (use at your own risk) I have been using it with very large project of mine.
@k6js-next/[email protected]
@k6js-next/[email protected]
to use this you have to specify resolutions, for yarn I do it like this in (root package.json in monorepo)
"resolutions": {
"graphql": "16.8.1",
"next": "14.2.5",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"@keystone-6/core": "npm:@k6js-next/[email protected]",
"@keystone-6/auth": "npm:@k6js-next/[email protected]"
}