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.

How to build Payload locally and test changes?

default discord avatar
Tinoutilast year
9

Hey folks! I'd like to contribute to the Payload repo with a very simple css one-liner change, but I'm a bit of a newbie in the open-source community, and I'm currently struggling to figure out how to build Payload locally to test my changes (the instructions in

contributing.md

aren't really helping in that regard unfortunately).


Any pointers? 👀 🙏



How to build Payload locally and test changes?

  • discord user avatar
    denolfe
    last year

    Happy to help. Are you running into something specific?



    The flow should be something like this:



    - Clone payload repo


    - yarn


    - create new git branch

    feat/some-feature

    - Make code changes


    - Run the code locally and verify changes via one of the test directories ex.

    yarn dev fields

    would run the code in the

    test/fields

    directory


    - Once verified, make PR

  • default discord avatar
    ElliotYoYolast year
  • default discord avatar
    Tinoutilast year

    Oh that's helpful, thanks you two.



    - Run the code locally and verify changes via one of the test directories ex. yarn dev fields would run the code in the test/fields directory

    This one was the step I was unsure about. But James explanation in that thread you linked Elliot helped clear things out!


    Gonna give these at try! 😊 🙏



    @denolfe follow up question: if my fix requires a slight change of the test config (in my case, I needed to add one field positioned in the sidebar), what's the process here? Should I commit the changes to the test along with my fix?



    Or just mention in details the test I've ran in the pull request but don't commit anything related to test?

  • default discord avatar
    Jarrodlast year

    If your fixed required a test (an integration(backend) or E2E(UI)) then I would say commit the change. BUT, some fixes, esp css changes do not always require tests so you could just omit the changes you made to the test config.



    there may be other collections in the test folder that use a sidebar and you could just boot that config up



    and just to throw more resources out there 🙂

    https://github.com/payloadcms/payload/blob/master/contributing.md
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..