Skip to content

fix(devvit.json): pass devvit upload schema validation + entry resolution#20

Merged
ComBba merged 2 commits into
mainfrom
fix/devvit-json-schema-validation
May 13, 2026
Merged

fix(devvit.json): pass devvit upload schema validation + entry resolution#20
ComBba merged 2 commits into
mainfrom
fix/devvit-json-schema-validation

Conversation

@ComBba
Copy link
Copy Markdown
Contributor

@ComBba ComBba commented May 13, 2026

Why

npx devvit upload (CLI 0.12.23) rejected our devvit.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 PR devvit upload succeeds (app is now live at developers.reddit.com/apps/vibe-mod).

The four fixes (devvit.json)

  1. Removed top-level "version": "0.1.0" — the config schema's top-level object is additionalProperties: false and version isn't in it. App versioning is managed by devvit upload --bump / package.json.
  2. dev.subreddit: "vibe-mod-playtest""vibemod_playtest" — subreddit names must match ^[a-zA-Z][a-zA-Z0-9_]*$; hyphens aren't allowed.
  3. settings.global.openaiApiKey: dropped "defaultValue": ""GlobalStringSetting has a conditional: if isSecret === true then NOT required(defaultValue). A secret can't carry a default. Kept isSecret: true.
  4. server: { "entry": "dist/server/index.cjs" }{ "dir": "dist/server", "entry": "index.cjs" }server.entry is the bundle filename within server.dir (default dist/server), not a path from the project root. The old value made Devvit look for dist/server/dist/server/index.cjsCannot read config.server.entry file. (vite.config.ts still outputs to dist/server/index.cjs — only the devvit.json field changed.)

Also

  • scripts/devvit-doctor.ts: removed the now-incorrect version "missing" hard-check → replaced with "fail if a top-level version is present"; added a check that server.entry is a bare filename (catches regression ci: Bump actions/checkout from 4 to 6 #4); removed the obsolete .devvit-app-id soft-check (the 0.12.x CLI identifies the app by name in devvit.json, it doesn't write that dotfile). npm run doctor is now 0 hard / 0 warnings on a logged-in machine.
  • Synced the dist/server / dev.subreddit references in vite.config.ts, HANDOFF.md, and docs/devvit-{conformance-notes,setup-guide}.md.

Verification

npx devvit upload → ✅ "Visit https://developers.reddit.com/apps/vibe-mod". npm run doctor 0/0, npm run acceptance 4/4, npm test 170 pass (1 skip), tsc --noEmit clean, ESLint 0 warnings, Prettier clean, vite builddist/server/index.cjs.

Follow-up (not in this PR)

scripts/acceptance.ts G1 does targeted devvit.json checks but not a full validate against the official JSON schema — adding that (vendor config-file.v1.json or 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

릴리스 노트

  • 문서

    • Devvit 빌드 설정 및 플레이테스트 구성에 대한 전체 문서 업데이트
    • 개발 환경 설정 및 빌드 파이프라인 가이드 개선
  • 설정 개선

    • OpenAI API 키 도움말 텍스트 개선 (공유 키 사용 및 서브레딧별 BYOK 설정 지원)
    • 기본 플레이테스트 서브레딧 이름 변경
    • 개발 도구의 검증 로직 강화 및 CLI 인증 확인 개선

Review Change Stack

…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>
@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Warning

Rate limit exceeded

@ComBba has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 23 minutes and 45 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1eb0e7e6-7c40-4f64-b14a-3d33979b8598

📥 Commits

Reviewing files that changed from the base of the PR and between 0f9b776 and 017f4b3.

📒 Files selected for processing (1)
  • README.md

Walkthrough

이 PR은 Devvit 빌드 구성을 개선하여 서버 진입점 경로를 분할된 dir과 entry 필드로 재구성하고, 플레이테스트 서브레딧 기본값을 동기화하며, 검증 로직과 문서를 정렬합니다.

Changes

Devvit Configuration and Build Path Alignment

Layer / File(s) Summary
devvit.json Configuration Updates
devvit.json
서버 구성이 dir (dist/server)과 상대 entry (index.cjs)로 분할되고, openaiApiKey helpText가 공유 키 사용 및 서브레딧별 BYOK 오버라이드 방법을 설명하도록 업데이트되며, 기본 플레이테스트 서브레딧이 vibe-mod-playtest에서 vibemod_playtest로 변경되었습니다.
devvit-doctor.ts Validation for Server Structure
scripts/devvit-doctor.ts
검증 스크립트에 선택적 server.dir과 server.entry 필드를 포함하는 새로운 devvit 타입이 추가되고, 소프트 체크 설명이 devvit 로그인을 참조하도록 명확하게 되며, server.entry가 경로 구분자 없는 단순 파일명이어야 함을 강제하는 검증 로직이 추가되었습니다.
Documentation and Comment Updates
docs/devvit-conformance-notes.md, docs/devvit-setup-guide.md, vite.config.ts, HANDOFF.md
설정 가이드, 준수 노트, 빌드 구성 설명이 새로운 플레이테스트 서브레딧 기본값(vibemod_playtest)을 반영하도록 업데이트되고, vite.config.ts 출력 경로와 devvit.json 서버 구성 간의 동기화가 명확하게 설명됩니다.

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 서버의 경로를 고르게 정렬하고
플레이테스트 새 집을 마련했네
devvit.json과 스크립트가 춤을 추고
문서도 함께 노래 부르네
빌드 파이프라인, 이제 더 깔끔하도다!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: fixing devvit.json schema validation and entry resolution, which is the core objective of this PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/devvit-json-schema-validation

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 value

helpText 길이 확인 권장

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

📥 Commits

Reviewing files that changed from the base of the PR and between a08dfa4 and 0f9b776.

📒 Files selected for processing (6)
  • HANDOFF.md
  • devvit.json
  • docs/devvit-conformance-notes.md
  • docs/devvit-setup-guide.md
  • scripts/devvit-doctor.ts
  • vite.config.ts

Comment thread scripts/devvit-doctor.ts
Comment on lines +63 to +66
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}"`,
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | 💤 Low value

🧩 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:


🏁 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.

Comment thread vite.config.ts
Comment on lines +4 to +8
// 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

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.

Suggested change
// 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>
@ComBba ComBba merged commit a650e24 into main May 13, 2026
2 checks passed
@ComBba ComBba deleted the fix/devvit-json-schema-validation branch May 14, 2026 06:37
ComBba added a commit that referenced this pull request May 15, 2026
…idation

fix(devvit.json): pass `devvit upload` schema validation + entry resolution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant