Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .sampo/changesets/cli-devvit-init-auth-modes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
npm/@mpgd/cli: patch (Changed)
---

Split generated Devvit init commands into browser-auth default and copy-paste fallback.
3 changes: 2 additions & 1 deletion packages/cli/templates/phaser-game/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ pnpm devvit:playtest

`devvit:login` authenticates your Reddit account. `devvit:init` performs the
first App Directory upload/link step for the app name in
`apps/target-devvit/devvit.json` using Devvit's copy-paste flow. After init, use
`apps/target-devvit/devvit.json`. Use `pnpm devvit:init:copy-paste` if browser
authorization is not available in the current terminal session. After init, use
`pnpm devvit:playtest`, `pnpm devvit:upload`, and `pnpm devvit:publish` from
this game root.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ pnpm devvit:playtest
```

`devvit:init` performs the first App Directory upload/link step with Devvit's
copy-paste flow. Login proves who you are; init uploads and links the
Reddit-side app record for the `name` in `devvit.json`. After that, use
logged-in account. It may open a browser for authorization. Use
`pnpm devvit:init:copy-paste` from the game root if the browser flow is not
available and the CLI asks for a manual code. After that, use
`pnpm devvit:playtest`, `pnpm devvit:upload`, and `pnpm devvit:publish` from the
game root.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"version": "0.0.0",
"type": "module",
"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 👍 / 👎.

"dev": "devvit playtest --config devvit.json",
"dev:prepare": "pnpm --dir ../.. build:devvit:staging",
"dev:client": "APP_TARGET=reddit APP_VERSION=0.0.0-dev BUILD_ID=devvit-watch pnpm --dir ../.. exec vite build --mode staging --watch --outDir apps/target-devvit/dist/client",
Expand Down
1 change: 1 addition & 0 deletions packages/cli/templates/phaser-game/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"build:devvit:staging": "pnpm exec mpgd target build reddit staging --targets-file ./mpgd.targets.json --kit-path ${MPGD_KIT_PATH:-__DEFAULT_KIT_PATH__}",
"smoke:devvit": "pnpm exec mpgd target smoke reddit --targets-file ./mpgd.targets.json --kit-path ${MPGD_KIT_PATH:-__DEFAULT_KIT_PATH__}",
"devvit:init": "pnpm --dir apps/target-devvit run init",
"devvit:init:copy-paste": "pnpm --dir apps/target-devvit run init:copy-paste",
"devvit:login": "pnpm --dir apps/target-devvit exec devvit login",
"devvit:login:copy-paste": "pnpm --dir apps/target-devvit exec devvit login --copy-paste",
"devvit:whoami": "pnpm --dir apps/target-devvit run whoami",
Expand Down