Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Documentation on local development

default discord avatar
chris-schra12 months ago
1 1

Dear All,

after some time I wanted to work on Payload's core:

  • fix that condition doesn't work for tab fields
  • check and see if I can add an option to show multiple title fields for relationships

So I cloned Payload's monorepo to ./libs in our own monorepo. First issue: as our "parent" monorepo is yarn4 controlled, pnpm won't run (Usage Error: This project is configured to use pnpm).
Adding "packageManager": "pnpm@8.15.4", in package.json fixed that.

But now I can't find any docs regarding the dev setup. If I run pnpm build and point payload in our package.json to the local path, it will try to load ts-files (because payload's package.json exports src/*.ts instead of dist).
I don't get where the transformation (exporting js instead of ts) happens during the release process.. can you help?

  • Selected Answer
    default discord avatar
    chris-schra12 months ago

    Argh, sorry, I overlooked publishConfig 🫣

  • discord user avatar
    DanRibbens
    12 months ago

    Hi @chris-schra,
    First of all, welcome and thank you for wanting to contribute!

    You're right that we did switch to pnpm from yarn so that bit of cleanup is needed.

    As for running Payload to dev against it. You will be able to run pnpm dev fields and that will start the payload from the test/fields/config.ts configuration. I said fields because that is a good one for working on the tabs condition property you mentioned.

    We have a contributing.md for also for your reference. Let us know if you need anything else.
    Thanks!

    2 replies
    default discord avatar
    chris-schra12 months ago

    Thanks @DanRibbens

    I wonder how I can create a local payload package so I can link our repo to it.
    I know that might sound confused, so let me rephrase a question: when / how are the exports in Payload‘s packages/payload package.json transformed (from .ts to .js)?

    Say I currently have a monorepo:
    /Projects/AwesomeSite/packages/frontend
    /Projects/AwesomeSite/packages/backend

    Backend is using Payload. Currently the one from NPM

    to make my modifications, I cloned this repo to
    /Projects/AwesomeSite/libs/payload

    When I now try to use
    libs/payload/packages/payload in my repo it fails - because payload exports *.ts instead of *.js

    default discord avatar
    chris-schra12 months ago

    Argh, sorry, I overlooked publishConfig 🫣

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.