Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use app router template #9186

Open
wants to merge 126 commits into
base: v-next
Choose a base branch
from
Open

Use app router template #9186

wants to merge 126 commits into from

Conversation

gautamsi
Copy link
Member

@gautamsi gautamsi commented Jun 25, 2024

ref #9183

Blocked by

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:

  • generate app routes in app/(admin) folder (creates admin route specific layout page. if src page exist, it generates it in `src/app/(admin)
  • Stop generating next.config.js file, this should be generated from create-keystone-app going forward (TODO)
  • set default ui.basePath to /admin can set ui.basePath to /admin or any other sub path
  • No longer copies admin files or generates pages export copy as they are no longer needed
  • 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
  • Verified custom pages
  • Verified custom fields and field views
  • can use relative path or even "paths" from typescript (@fields/text/myView)
  • Added --reset-admin flag to dev command to force clean (admin) folder, useful in regenerate the admin template if updated in future. should never be needed except braking upgrade
  • fix build and start script
  • @keystone-6/auth templates
  • 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/core-next@0.0.0-20240905-01
@k6js-next/auth-next@0.0.0-20240905-01

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/core-next@0.0.0-20240905-01",
    "@keystone-6/auth": "npm:@k6js-next/auth-next@0.0.0-20240905-01"
  }

@gautamsi gautamsi force-pushed the #9183#1 branch 4 times, most recently from 29477ea to 19ab9c5 Compare June 25, 2024 06:08
@dcousens dcousens changed the base branch from main to v-next June 25, 2024 06:31
Copy link

codesandbox-ci bot commented Jun 25, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 3e6d294:

Sandbox Source
@keystone-6/sandbox Configuration

@gautamsi
Copy link
Member Author

gautamsi commented Jun 25, 2024

@dcousens I will need some help in fixing tests,
* smoke tests never finishes
* wired error in package unit tests, it has mismatch on keystone error message in build but unable to trace.
* random test failure with checkForTooManyEngines prisma error

I have disabled some ui tests, they need fixes but we can do that before merging to main

@dcousens I have fixed most test cases, these tests definitely helped me fix a lot of issues.

I see that document-field test can not be fixed due to static generation, I may have missed something.

Test live-reloading.test is not behaving properly, same thing, trying to fix some page router vs app router thing. I am having trouble debugging locally on windows for some reason.

@dcousens
Copy link
Member

dcousens commented Jun 25, 2024

@gautamsi I'm super busy and can't engage on this this week, but, I'll wrap back around as soon as I can and help move this forward 💛

@gautamsi gautamsi force-pushed the #9183#1 branch 14 times, most recently from 303b060 to f86b3fd Compare June 30, 2024 12:31
@gautamsi
Copy link
Member Author

gautamsi commented Jun 30, 2024

@dcousens I have not generated default files for all the example/test projects, have modified the code as such it will generate all the required nextjs files for dev and build. User would need to commit them in git.

The file generation is one time except the .admin/index file which generates the admin meta has and static keystone props for admin.

isLiveReload: boolean
) {
// when we're not doing a live reload, we want to clear everything out except the .next directory (not the .next directory because it has caches)
// so that at least every so often, we'll clear out anything that the deleting we do during live reloads doesn't (should just be directories)
if (!isLiveReload) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of live reload is not needed, we do not even need to figure out file linking from main dir to isolated dir anymore

@gautamsi
Copy link
Member Author

gautamsi commented Jul 7, 2024

@dcousens do you plan to check this out soon?

renovate bot added 2 commits July 23, 2024 10:46
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate bot and others added 17 commits November 5, 2024 15:10
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Cousens <dcousens@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…list view (keystonejs#9401)

Co-authored-by: pnodet <paul.nodet@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Copy link

socket-security bot commented Dec 8, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@apollo/client@3.12.2 network +3 7.4 MB apollo-bot
npm/@apollo/server@4.11.2 environment, network Transitive: filesystem +31 6.29 MB apollo-bot
npm/@astrojs/node@8.3.4 None 0 28.4 kB matthewp
npm/@aws-sdk/client-s3@3.705.0 Transitive: environment, filesystem, network, shell +90 8.02 MB aws-sdk-bot
npm/@aws-sdk/lib-storage@3.705.0 filesystem Transitive: environment, network +26 1.38 MB aws-sdk-bot
npm/@aws-sdk/s3-request-presigner@3.705.0 Transitive: environment, filesystem, network +32 1.66 MB aws-sdk-bot
npm/@babel/core@7.26.0 environment, filesystem, unsafe +21 8.43 MB nicolo-ribaudo
npm/@babel/plugin-transform-runtime@7.25.9 unsafe Transitive: environment, filesystem +23 7.11 MB nicolo-ribaudo
npm/@babel/preset-env@7.26.0 environment Transitive: filesystem, unsafe +93 9.1 MB nicolo-ribaudo
npm/@babel/preset-react@7.26.3 Transitive: environment +22 6.49 MB nicolo-ribaudo
npm/@babel/preset-typescript@7.26.0 Transitive: environment +27 7.3 MB nicolo-ribaudo
npm/@babel/runtime@7.26.0 None 0 248 kB nicolo-ribaudo
npm/@changesets/cli@2.27.10 environment, filesystem, shell +18 849 kB changesets-release-bot
npm/@changesets/get-release-plan@4.0.5 Transitive: environment, filesystem +13 501 kB changesets-release-bot
npm/@dnd-kit/core@6.3.1 environment +2 1.18 MB clauderic
npm/@dnd-kit/modifiers@9.0.0 environment +1 137 kB clauderic
npm/@dnd-kit/sortable@10.0.0 environment +1 322 kB clauderic
npm/@emotion/cache@11.14.0 Transitive: environment +3 53.4 kB
npm/@emotion/css@11.13.5 Transitive: environment +21 6.92 MB emotion-release-bot
npm/@emotion/react@11.13.5 Transitive: environment +23 7.73 MB emotion-release-bot
npm/@eslint/js@9.16.0 None 0 14.9 kB eslintbot
npm/@keystar/ui@0.7.14 Transitive: environment +108 22.2 MB thinkmill-release-bot
npm/@keystatic/core@0.5.42 Transitive: environment, eval, network +36 11.4 MB thinkmill-release-bot
npm/@nodelib/fs.walk@3.0.1 None +2 62.2 kB mrmlnc
npm/@preconstruct/cli@2.8.10 Transitive: environment, filesystem, unsafe +27 7.36 MB preconstruct-release-bot
npm/@prisma/client@5.19.0 environment, filesystem, shell 0 8.46 MB prismabot
npm/@prisma/client@5.22.0 environment, filesystem, shell 0 8.38 MB prismabot
npm/@prisma/generator-helper@5.22.0 environment, shell +1 94.2 kB prismabot
npm/@prisma/internals@5.22.0 environment, eval, filesystem, network, shell +8 7.89 MB prismabot
npm/@prisma/migrate@5.22.0 environment, eval, filesystem, shell +3 9.5 MB prismabot
npm/@redis/client@1.6.0 network 0 614 kB leibale
npm/@stylistic/eslint-plugin-ts@2.11.0 None +5 1.5 MB eslint-stylistic-bot
npm/@testing-library/react@16.1.0 environment +5 3.04 MB testing-library-bot
npm/@types/async-retry@1.4.9 None +1 14 kB types
npm/@types/bytes@3.1.5 None 0 5.12 kB types
npm/@types/cookie@1.0.0 None 0 1.72 kB types
npm/@types/jest@29.5.14 None 0 78.8 kB types
npm/@types/jsonwebtoken@9.0.7 None 0 13.8 kB types
npm/@types/node-fetch@2.6.12 None 0 11.9 kB types
npm/@types/node@20.17.9 None 0 2.22 MB types
npm/@types/node@22.10.1 None 0 2.28 MB types
npm/@types/passport@1.0.17 None 0 45.2 kB types
npm/@types/react-dom@18.3.2 None 0 29.9 kB types
npm/@types/react-transition-group@4.4.11 None 0 18.5 kB types
npm/@types/react@18.3.14 None +1 423 kB types
npm/@types/ws@8.5.13 None 0 21.6 kB types
npm/@vercel/og@0.6.4 environment, filesystem, network +1 7.67 MB vercel-release-bot
npm/astro@4.16.17 Transitive: environment, filesystem +32 27.5 MB fredkschott
npm/async-retry@1.3.3 None 0 5.21 kB leerobinson
npm/bcryptjs@2.4.3 None 0 221 kB dcode
npm/body-parser@1.20.3 network 0 62.6 kB ulisesgascon

🚮 Removed packages: npm/@apollo/client@3.10.8, npm/@apollo/server@4.10.4, npm/@aws-sdk/client-s3@3.614.0, npm/@aws-sdk/lib-storage@3.614.0, npm/@aws-sdk/s3-request-presigner@3.614.0, npm/@babel/core@7.24.9, npm/@babel/plugin-transform-runtime@7.24.7, npm/@babel/preset-env@7.24.8, npm/@babel/preset-react@7.24.7, npm/@babel/preset-typescript@7.24.7, npm/@babel/runtime@7.24.8, npm/@changesets/cli@2.27.7, npm/@changesets/get-release-plan@4.0.3, npm/@dnd-kit/core@6.1.0, npm/@dnd-kit/modifiers@7.0.0, npm/@dnd-kit/sortable@8.0.0, npm/@emotion/cache@11.11.0, npm/@emotion/css@11.11.2, npm/@emotion/hash@0.9.1, npm/@emotion/react@11.11.4, npm/@eslint/js@9.7.0, npm/@keystar/ui@0.7.8, npm/@keystatic/core@0.5.27, npm/@keystone-ui/button@7.0.2, npm/@keystone-ui/core@5.0.2, npm/@keystone-ui/fields@7.2.0, npm/@keystone-ui/icons@6.0.2, npm/@keystone-ui/tooltip@6.0.2, npm/@nodelib/fs.walk@2.0.0, npm/@preconstruct/cli@2.8.7, npm/@prisma/client@5.17.0, npm/@prisma/generator-helper@5.17.0, npm/@prisma/internals@5.17.0, npm/@prisma/migrate@5.17.0, npm/@redis/client@1.5.17, npm/@testing-library/react@16.0.0, npm/@types/async-retry@1.4.8, npm/@types/bytes@3.1.4, npm/@types/jest@29.5.12, npm/@types/jsonwebtoken@9.0.6, npm/@types/node-fetch@2.6.11, npm/@types/node@20.14.11, npm/@types/passport@1.0.16, npm/@types/react-dom@18.3.0, npm/@types/react-transition-group@4.4.10, npm/@types/react@18.3.3, npm/@types/ws@8.5.11, npm/@vercel/og@0.6.2

View full report↗︎

dwidge and others added 7 commits December 9, 2024 08:28
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.