Skip to content

chore: split generated Devvit init auth modes - #13

Merged
imjlk merged 1 commit into
mainfrom
fix/devvit-init-auth-modes
Jul 6, 2026
Merged

imjlk merged 1 commit into
mainfrom
fix/devvit-init-auth-modes

Conversation

@imjlk

@imjlk imjlk commented Jul 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • make generated Devvit init use the default browser auth flow
  • add a copy-paste fallback script for terminals where browser auth is unavailable
  • document both flows in the generated Phaser starter
  • add a Sampo patch changeset for @mpgd/cli

Test Plan

  • node -e "for (const f of ['packages/cli/templates/phaser-game/package.json','packages/cli/templates/phaser-game/apps/target-devvit/package.json']) JSON.parse(require('fs').readFileSync(f,'utf8')); console.log('json ok')"
  • pnpm --filter @mpgd/cli check
  • pnpm validate:starter-workflow
  • pnpm check

Summary by CodeRabbit

  • New Features

    • Added a separate copy-paste-friendly Devvit initialization command for Phaser game templates.
    • The standard initialization flow now uses browser-based authorization by default, with a fallback command available when needed.
  • Documentation

    • Updated Phaser game setup instructions to clearly explain when to use each initialization option and what to expect during the first upload/link step.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3b6e2ed7-4c5f-4293-b51e-9993cd0de6d8

📥 Commits

Reviewing files that changed from the base of the PR and between 07ea536 and f8b00c8.

📒 Files selected for processing (5)
  • .sampo/changesets/cli-devvit-init-auth-modes.md
  • packages/cli/templates/phaser-game/README.md
  • packages/cli/templates/phaser-game/apps/target-devvit/README.md
  • packages/cli/templates/phaser-game/apps/target-devvit/package.json
  • packages/cli/templates/phaser-game/package.json

📝 Walkthrough

Walkthrough

This PR splits the Devvit init script into a default browser-auth flow and a new init:copy-paste fallback script, adds a corresponding devvit:init:copy-paste wrapper in the Phaser game template, updates related README documentation, and includes a changeset entry.

Changes

Devvit Init Auth Mode Split

Layer / File(s) Summary
Script definitions for browser-auth and copy-paste init
packages/cli/templates/phaser-game/apps/target-devvit/package.json, packages/cli/templates/phaser-game/package.json
init now runs devvit upload without --copy-paste; a new init:copy-paste script preserves the old --copy-paste behavior; phaser-game adds a devvit:init:copy-paste wrapper script.
Documentation and changeset updates
packages/cli/templates/phaser-game/README.md, packages/cli/templates/phaser-game/apps/target-devvit/README.md, .sampo/changesets/cli-devvit-init-auth-modes.md
README instructions are reworded to describe the browser-auth default and the pnpm devvit:init:copy-paste fallback; a patch changeset documents the change for npm/@mpgd/cli.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • imjlk/mpgd-kit#7: Updates the same Phaser starter template’s devvit:init/init:copy-paste scripts and documentation.
  • imjlk/mpgd-kit#9: Related changes to the Devvit init workflow split and apps/target-devvit template scripts/docs.

Poem

A hop, a skip, two paths to init,
Browser magic or paste-and-print!
The README now tells it plain,
No more auth-flow refrain.
A patch, a changeset, tidy and neat—
This rabbit's docs are now complete! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: splitting Devvit init auth modes.
Description check ✅ Passed The description covers the summary and test plan well; only the template's Notes section is missing.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/devvit-init-auth-modes

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f8b00c8e4f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"scripts": {
"init": "devvit upload --copy-paste --config devvit.json",
"init": "devvit upload --config devvit.json",
"init:copy-paste": "devvit upload --copy-paste --config devvit.json",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Make the init fallback use the wizard copy-paste path

With the pinned Devvit 0.13 CLI, upload --copy-paste only changes the login auth path: the upload command parses that flag and passes it to getAccessTokenAndLoginIfNeeded, while the first-time App Directory link still calls #initApp()/getCodeFromWizard() without that flag (checked upstream reddit/devvit packages/cli/src/commands/upload.ts). In the documented first-time flow users have already run devvit:login, so on a headless/SSH terminal this new fallback still opens the browser/local-redirect wizard and blocks instead of letting them paste the init code; either wire a real manual init flow or avoid advertising this script as the init fallback.

Useful? React with 👍 / 👎.

@imjlk
imjlk merged commit 80d35a2 into main Jul 6, 2026
6 checks passed
@imjlk
imjlk deleted the fix/devvit-init-auth-modes branch July 6, 2026 02:19
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