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:
Delete all the other subpackages and apps (otherwise you'll have to jump through these hoops for all of them).
Remove the @devvit/repo-tools and @reddit/faceplate-ui dependencies from public-api/package.json. They're not public, can't install them.
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".
Run npm install in the public-api directory.
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.
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.
Remove the references to PaymentsService in Devvit.ts, as that's not present in the latest @next version we have.
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).
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:
@devvit/repo-tools
and@reddit/faceplate-ui
dependencies frompublic-api/package.json
. They're not public, can't install them.@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"
.npm install
in thepublic-api
directory.@devvit/public-api/types/icons.js
from a published version and put it in thepublic-api/src/types
directory. Generating this would require whatevermake-icons
comes from and the presence of thesrc/types/icons.ts
file, neither of which is available.@devvit/public-api/devvit/internals/semanticColors.js
from a published version and put it in thepublic-api/src/devvit/internals
directory. You can't build this because the script to build it depends on the private@reddit/faceplate-ui
package.PaymentsService
inDevvit.ts
, as that's not present in the latest@next
version we have.tsc
in thepublic-api
directory and it should output a build intopublic-api/dist
. Use output as you see fit (most likely by replacing existing files in thenode_modules/@devvit/public-api
folder of one of your apps).Message author: pitchforkassistant
Discord link: https://discord.com/channels/1050224141732687912/1242689647478308895/1303495416469524491