Improve process for building and testing public repo

Open
#111 1 comment 0 reactions 1 assignee View on GitHub

@slowcooked99 is already working on this.

Since Nov 8, 2024.

Assessment

This issue has not been assessed yet.

Description

contributing
Details

It's difficult for devs to build the reddit/devvit public repo. For example there are dependencies referencing npm packages that don't exist publicly.

PitchforkAssitant has detailed the steps below for how they got the repo working, but the process should not be so complex.

Additional info

Discord message:

Steps to compile the public-api subpackage:

  1. Delete all the other subpackages and apps (otherwise you'll have to jump through these hoops for all of them).
  2. Remove the @devvit/repo-tools and @reddit/faceplate-ui dependencies from public-api/package.json. They're not public, can't install them.
  3. Change the @devvit/protos, @devvit/shared-types, and @devvit/tsconfig dependencies from -dev to the latest -next version. This is because the matching version aren't present on the GitHub monorepo. For example "@devvit/protos": "0.11.3-dev", would become "@devvit/protos": "0.11.3-next-2024-10-31-9ef830d31.0".
  4. Run npm install in the public-api directory.
  5. Get @devvit/public-api/types/icons.js from a published version and put it in the public-api/src/types directory. Generating this would require whatever make-icons comes from and the presence of the src/types/icons.ts file, neither of which is available.
  6. Get @devvit/public-api/devvit/internals/semanticColors.js from a published version and put it in the public-api/src/devvit/internals directory. You can't build this because the script to build it depends on the private @reddit/faceplate-ui package.
  7. Remove the references to PaymentsService in Devvit.ts, as that's not present in the latest @next version we have.
  8. Now you can do tsc in the public-api directory and it should output a build into public-api/dist. Use output as you see fit (most likely by replacing existing files in the node_modules/@devvit/public-api folder of one of your apps).

Message author: pitchforkassistant

Discord link: https://discord.com/channels/1050224141732687912/1242689647478308895/1303495416469524491

Dominant language
TypeScript
Stars
210
Forks
88
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from reddit/devvit

All issues in reddit/devvit

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.