fix(devvit.json): pass devvit upload schema validation + entry resolution#20
Conversation
…ion + entry resolution
`npx devvit upload` (CLI 0.12.23) rejected devvit.json on four counts; fixed all:
1. removed the top-level `"version": "0.1.0"` — not in the config schema's allowed
top-level keys (versioning is managed by `devvit upload --bump`).
2. `dev.subreddit`: `"vibe-mod-playtest"` → `"vibemod_playtest"` — subreddit names
must match `^[a-zA-Z][a-zA-Z0-9_]*$` (no hyphens).
3. `settings.global.openaiApiKey`: dropped `"defaultValue": ""` — the schema's
GlobalStringSetting forbids `defaultValue` when `isSecret: true` (a secret has
no default). Kept `isSecret: true`.
4. `server`: `{ "entry": "dist/server/index.cjs" }` → `{ "dir": "dist/server",
"entry": "index.cjs" }` — `entry` is the filename *within* `server.dir`
(default `dist/server`), not a path from the project root, so the old value
resolved to `dist/server/dist/server/index.cjs` and upload couldn't find it.
After these, `npx devvit upload` succeeds → app live at developers.reddit.com/apps/vibe-mod.
Also updated `scripts/devvit-doctor.ts`: dropped the now-wrong `version` "missing"
hard-check (replaced with: fail if a top-level `version` is *present*), added a
check that `server.entry` is a bare filename, and removed the obsolete
`.devvit-app-id` soft check (the 0.12.x CLI tracks the app by `name`, not a
dotfile). And synced the `dist/server` / `dev.subreddit` references in
vite.config.ts, HANDOFF.md, and the two devvit docs.
`npm run doctor` 0 hard / 0 warnings, acceptance 4/4, 170 tests, tsc/lint/prettier clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. Walkthrough이 PR은 Devvit 빌드 구성을 개선하여 서버 진입점 경로를 분할된 dir과 entry 필드로 재구성하고, 플레이테스트 서브레딧 기본값을 동기화하며, 검증 로직과 문서를 정렬합니다. ChangesDevvit Configuration and Build Path Alignment
🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
scripts/devvit-doctor.ts (1)
147-156: 💤 Low value주석 헤딩 업데이트 제안
Line 147의 주석이 "Devvit CLI / app id (soft)"라고 되어 있지만, 실제로는 CLI 로그인 상태만 확인하고 app id는 더 이상 체크하지 않습니다. 주석을 "Devvit CLI (soft)" 정도로 단순화하면 코드와 더 일치할 것 같습니다.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/devvit-doctor.ts` around lines 147 - 156, The comment heading "Devvit CLI / app id (soft)" is outdated because the code only checks CLI login; update the heading text to something like "Devvit CLI (soft)" to match behavior—locate the console.log call that prints '\nDevvit CLI' and the preceding comment string "Devvit CLI / app id (soft)" and change that comment to the simplified form so the comment and code reflect that only CLI login is being checked.devvit.json (1)
17-17: 💤 Low valuehelpText 길이 확인 권장
helpText가 약 240자로 상당히 깁니다. Devvit 설정 UI에서 이 텍스트가 잘리거나 가독성이 떨어질 가능성이 있습니다. playtest 중 설정 패널에서 전체 텍스트가 정상적으로 표시되는지 확인하시고, 필요시 핵심 정보만 남기고 상세 내용은 별도 문서로 분리하는 것을 고려해보세요.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@devvit.json` at line 17, helpText 값이 너무 길어 설정 UI에서 잘릴 수 있으니 devvit.json의 "helpText" 키 값을 간결한 한두 문장으로 줄이고 상세 설명(예: per-install BYOK override, daily quota, 설정 커맨드 npx devvit settings set openaiApiKey 등)은 외부 문서나 README로 옮긴 뒤 helpText에 문서 링크 또는 “자세한 정보는 문서 참조” 문구만 남기세요; 변경 대상은 devvit.json의 "helpText" 항목이며 변경 후 설정 패널에서 표시되는지(playtest) 확인하세요.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/devvit-doctor.ts`:
- Around line 63-66: The error message referencing a non-existent server.dir and
wrong default should be corrected: update the check that uses
devvit.server?.entry and the fail(...) call so the message no longer mentions
"server.dir (default dist/server)" and instead states the correct default
location (src/server/index.js) or simply asks for a bare filename; ensure the
fail call for devvit.server.entry includes the actual value via
"${devvit.server.entry}" and references devvit.server.entry in the message.
In `@vite.config.ts`:
- Around line 4-8: The comment ending with "The Devvit Web runtime requires CJS
— ESM server output is not" is truncated; update that comment in vite.config.ts
(the block referencing "dist/server/index.cjs", devvit.json's server.entry,
outDir and entryFileNames) to complete the sentence (e.g., "is not supported")
or rephrase to a full sentence clarifying that the Devvit Web runtime requires
CommonJS and does not support ESM server output.
---
Nitpick comments:
In `@devvit.json`:
- Line 17: helpText 값이 너무 길어 설정 UI에서 잘릴 수 있으니 devvit.json의 "helpText" 키 값을 간결한
한두 문장으로 줄이고 상세 설명(예: per-install BYOK override, daily quota, 설정 커맨드 npx devvit
settings set openaiApiKey 등)은 외부 문서나 README로 옮긴 뒤 helpText에 문서 링크 또는 “자세한 정보는 문서
참조” 문구만 남기세요; 변경 대상은 devvit.json의 "helpText" 항목이며 변경 후 설정 패널에서 표시되는지(playtest)
확인하세요.
In `@scripts/devvit-doctor.ts`:
- Around line 147-156: The comment heading "Devvit CLI / app id (soft)" is
outdated because the code only checks CLI login; update the heading text to
something like "Devvit CLI (soft)" to match behavior—locate the console.log call
that prints '\nDevvit CLI' and the preceding comment string "Devvit CLI / app id
(soft)" and change that comment to the simplified form so the comment and code
reflect that only CLI login is being checked.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 234d7459-9204-4872-9236-f6b21ef1308b
📒 Files selected for processing (6)
HANDOFF.mddevvit.jsondocs/devvit-conformance-notes.mddocs/devvit-setup-guide.mdscripts/devvit-doctor.tsvite.config.ts
| if (devvit.server?.entry && devvit.server.entry.includes('/')) | ||
| fail( | ||
| `server.entry must be a bare filename within server.dir (default dist/server), not a path — got "${devvit.server.entry}"`, | ||
| ); |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
What is the default value for server.dir in Devvit config schema when not specified?
💡 Result:
There is no server.dir property in the Devvit config schema (devvit.json). The server object only has an entry property, which specifies the server bundle filename and has a default value of "src/server/index.js" [1][2][3]. The dir property is used in the post object for web view configuration (e.g., "public" or "dist/client"), but not under server [1][4].
Citations:
- 1: https://developers.reddit.com/docs/next/capabilities/devvit-web/devvit_web_configuration
- 2: https://developers.reddit.com/docs/capabilities/devvit-web/devvit_web_configuration
- 3: https://defaultvalue.info/
- 4: https://developers.reddit.com/docs/capabilities/server/launch_screen_and_entry_points/view_modes_entry_points
🏁 Script executed:
cat -n scripts/devvit-doctor.ts | sed -n '60,70p'Repository: Two-Weeks-Team/vibe-mod
Length of output: 596
에러 메시지의 부정확한 정보 수정 필요
에러 메시지가 존재하지 않는 server.dir 속성을 언급하고 있습니다. Devvit 공식 문서에 따르면 server 객체에는 dir 속성이 없으며, server.entry의 기본값은 dist/server가 아니라 src/server/index.js입니다. "within server.dir (default dist/server)" 부분을 삭제하고 더 정확한 메시지로 수정하세요.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@scripts/devvit-doctor.ts` around lines 63 - 66, The error message referencing
a non-existent server.dir and wrong default should be corrected: update the
check that uses devvit.server?.entry and the fail(...) call so the message no
longer mentions "server.dir (default dist/server)" and instead states the
correct default location (src/server/index.js) or simply asks for a bare
filename; ensure the fail call for devvit.server.entry includes the actual value
via "${devvit.server.entry}" and references devvit.server.entry in the message.
| // CommonJS file at dist/server/index.cjs. devvit.json declares this as | ||
| // `server: { dir: "dist/server", entry: "index.cjs" }` — `entry` is the filename | ||
| // *within* `dir`, not a path from the project root, so it must stay in sync with | ||
| // `outDir` + `entryFileNames` below. The Devvit Web runtime requires CJS — ESM | ||
| // server output is not |
There was a problem hiding this comment.
Line 8의 불완전한 문장
주석 Line 8이 "The Devvit Web runtime requires CJS — ESM server output is not"로 끝나면서 문장이 중간에 끊긴 것처럼 보입니다. "is not supported" 같은 식으로 완성되어야 할 것 같습니다.
📝 제안된 수정
-// server output is not
+// server output is not supported.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // CommonJS file at dist/server/index.cjs. devvit.json declares this as | |
| // `server: { dir: "dist/server", entry: "index.cjs" }` — `entry` is the filename | |
| // *within* `dir`, not a path from the project root, so it must stay in sync with | |
| // `outDir` + `entryFileNames` below. The Devvit Web runtime requires CJS — ESM | |
| // server output is not | |
| // CommonJS file at dist/server/index.cjs. devvit.json declares this as | |
| // `server: { dir: "dist/server", entry: "index.cjs" }` — `entry` is the filename | |
| // *within* `dir`, not a path from the project root, so it must stay in sync with | |
| // `outDir` + `entryFileNames` below. The Devvit Web runtime requires CJS — ESM | |
| // server output is not supported. |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@vite.config.ts` around lines 4 - 8, The comment ending with "The Devvit Web
runtime requires CJS — ESM server output is not" is truncated; update that
comment in vite.config.ts (the block referencing "dist/server/index.cjs",
devvit.json's server.entry, outDir and entryFileNames) to complete the sentence
(e.g., "is not supported") or rephrase to a full sentence clarifying that the
Devvit Web runtime requires CommonJS and does not support ESM server output.
developers.reddit.com's README renderer shows `<!-- ... -->` blocks as literal text, so the "TODO: add screenshots" comments + commented-out image tags were visible on the public App Directory page. Replaced with a single plain-text note. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…idation fix(devvit.json): pass `devvit upload` schema validation + entry resolution
Why
npx devvit upload(CLI 0.12.23) rejected ourdevvit.json. The repo's config was written against an older/assumed schema; the live one is stricter. Four blocking issues, all fixed here — after this PRdevvit uploadsucceeds (app is now live atdevelopers.reddit.com/apps/vibe-mod).The four fixes (
devvit.json)"version": "0.1.0"— the config schema's top-level object isadditionalProperties: falseandversionisn't in it. App versioning is managed bydevvit upload --bump/package.json.dev.subreddit:"vibe-mod-playtest"→"vibemod_playtest"— subreddit names must match^[a-zA-Z][a-zA-Z0-9_]*$; hyphens aren't allowed.settings.global.openaiApiKey: dropped"defaultValue": ""—GlobalStringSettinghas a conditional:if isSecret === true then NOT required(defaultValue). A secret can't carry a default. KeptisSecret: true.server:{ "entry": "dist/server/index.cjs" }→{ "dir": "dist/server", "entry": "index.cjs" }—server.entryis the bundle filename withinserver.dir(defaultdist/server), not a path from the project root. The old value made Devvit look fordist/server/dist/server/index.cjs→Cannot read config.server.entry file. (vite.config.tsstill outputs todist/server/index.cjs— only thedevvit.jsonfield changed.)Also
scripts/devvit-doctor.ts: removed the now-incorrectversion"missing" hard-check → replaced with "fail if a top-levelversionis present"; added a check thatserver.entryis a bare filename (catches regression ci: Bump actions/checkout from 4 to 6 #4); removed the obsolete.devvit-app-idsoft-check (the 0.12.x CLI identifies the app bynameindevvit.json, it doesn't write that dotfile).npm run doctoris now 0 hard / 0 warnings on a logged-in machine.dist/server/dev.subredditreferences invite.config.ts,HANDOFF.md, anddocs/devvit-{conformance-notes,setup-guide}.md.Verification
npx devvit upload→ ✅ "Visit https://developers.reddit.com/apps/vibe-mod".npm run doctor0/0,npm run acceptance4/4,npm test170 pass (1 skip),tsc --noEmitclean, ESLint 0 warnings, Prettier clean,vite build→dist/server/index.cjs.Follow-up (not in this PR)
scripts/acceptance.tsG1 does targeteddevvit.jsonchecks but not a full validate against the official JSON schema — adding that (vendorconfig-file.v1.jsonor fetch it) would have caught all four of these at CI time. Worth doing; left out to keep this PR focused.🤖 Generated with Claude Code
Summary by CodeRabbit
릴리스 노트
문서
설정 개선