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

"payload-types.ts" in website template always outdated #9864

Open
bormm opened this issue Dec 10, 2024 · 0 comments · May be fixed by #9901
Open

"payload-types.ts" in website template always outdated #9864

bormm opened this issue Dec 10, 2024 · 0 comments · May be fixed by #9901
Assignees

Comments

@bormm
Copy link

bormm commented Dec 10, 2024

Describe the Bug

This is not a regular runtime bug, but I noticed in previous versions and now again in 3.5.0 that the "payload-types.ts" is changed without changing anything in the code. I reproduced this now with a fresh payload app.
Previous fields in meta was removed without having changed something myself:
Image

With 3.5.0 its 46 changes, I think all are string to number, happening:
Image

I think that's a process workflow issue: I guess people are making code changes in collections and so one, but then are not rerunning the "payload generate:types" process. As the changes often do not cause a runtime issue by the nature of the "flexible types handling", nobody is noticing that there is a drift.

My recommendation is that the "run payload generate:types" is put into the PR process and either it fails when there is a change needed, or it applies change automatically and if everything runs is merged.

Why we should care: The template should be consistent and correct from the beginning. Otherwise it will happen that developers waste time analysing why the types are changes to much after running "payload generate:types", only to find out it wasn't anything they have done in the code.

Link to the code that reproduces this issue

https://github.com/payloadcms/payload

Reproduction Steps

  1. run "npx create-payload-app payload-sample -t website"
  2. backup "\src\payload-types.ts"
  3. run "npm run payload generate:types"
  4. compare

Which area(s) are affected? (Select all that apply)

Not sure

Environment Info

Binaries:
  Node: 20.14.0
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  payload: 3.5.0
  next: 15.0.4
  @payloadcms/email-nodemailer: 3.5.0
  @payloadcms/graphql: 3.5.0
  @payloadcms/live-preview: 3.5.0
  @payloadcms/live-preview-react: 3.5.0
  @payloadcms/next/utilities: 3.5.0
  @payloadcms/payload-cloud: 3.5.0
  @payloadcms/plugin-form-builder: 3.5.0
  @payloadcms/plugin-nested-docs: 3.5.0
  @payloadcms/plugin-redirects: 3.5.0
  @payloadcms/plugin-search: 3.5.0
  @payloadcms/plugin-seo: 3.5.0
  @payloadcms/richtext-lexical: 3.5.0
  @payloadcms/translations: 3.5.0
  @payloadcms/ui/shared: 3.5.0
  react: 19.0.0
  react-dom: 19.0.0
Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 130168
  Available CPU cores: 32
@bormm bormm added status: needs-triage Possible bug which hasn't been reproduced yet validate-reproduction labels Dec 10, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants