feat: enable public app distribution in brevo app create - #30
Conversation
Accept --distribution public (remove the coming-soon rejection) and enable the Public option in the interactive prompt. Scaffolded app-config.json now writes the actual distribution type into auth.type and drops the redundant top-level distribution key; legacy configs are read transparently by backfilling auth.type from the old key. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Enables creating public OAuth apps via brevo app create --distribution public, updates the interactive prompt to allow selecting Public, and aligns scaffolded app-config.json with the app’s real distribution type while keeping older scaffolded projects compatible via config backfill.
Changes:
- Allow
--distribution publicinapp create(removed “coming soon” rejection) and update CLI examples/docs accordingly. - Update scaffolded
app-config.jsonto store distribution inauth.typevia new{{DISTRIBUTION}}template var; remove redundant top-leveldistribution. - Add config compatibility logic + tests to backfill
auth.typefrom legacy top-leveldistribution.
Blocking note: This is user-visible behavior; the repo guidelines require a Changeset, but .changeset/ currently contains only README.md (no pending changeset file).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/templates/files/app-config.json.tmpl | Writes distribution into auth.type via {{DISTRIBUTION}} and removes legacy top-level distribution. |
| src/lib/config.ts | Removes ProjectConfig.distribution and backfills auth.type from legacy top-level distribution. |
| src/lang/en.ts | Removes the stale “public distribution coming soon” message. |
| src/commands/definitions.ts | Adds --distribution public example and documents `private |
| src/commands/app/scaffold.ts | Adds {{DISTRIBUTION}} template variable sourced from the remote app’s distribution_type. |
| src/commands/app/create.ts | Allows public distribution via flag/prompt and passes distribution_type: 'public' to the API. |
| src/tests/lib/config.test.ts | Adds tests covering legacy distribution backfill and precedence rules. |
| src/tests/commands/app/update.test.ts | Removes the legacy distribution key from config fixtures. |
| src/tests/commands/app/create.test.ts | Updates test to assert public app creation payload instead of “coming soon” rejection. |
| agent-context/SKILL.md | Documents --distribution <private|public> guidance for agents. |
| agent-context/AGENTS.md | Updates command surface docs to include public distribution semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| createdAt?: string; | ||
| updatedAt?: string; | ||
| auth: { | ||
| /** Distribution type of the app: 'private' or 'public' */ |
There was a problem hiding this comment.
Please add add changelog file, please add default url during submission
Add TESTING.md as a running checklist of verification criteria (seeded with the enable-public-app changes) and TODO.md as a work tracker. First tracked task: migrate old users' app-config.json distribution type into auth.type on `brevo app update`, dropping the legacy top-level `distribution` key so existing projects converge to the new format. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reword APP_CREATE_REDIRECT_HINT so the localhost default is explicitly labeled a local test-server callback URL (used by `brevo app start oauth`), with a reminder to add a production callback URL before going live. - Update create.test.ts assertions to match the new wording - Append the hint change to the existing changeset (minor bump unchanged) - Add a TESTING.md verification entry, per the new working-docs convention documented in CLAUDE.md Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…31) * fix(config): migrate legacy distribution key on write-back (BEX-327) readProjectConfig() backfilled auth.type from the legacy top-level distribution key on read, but never stopped forwarding that legacy key into the object callers eventually write back to disk, so it round-tripped forever instead of converging old projects to the new shape. Now dropped centrally in readProjectConfig(), so every write-back path (update.ts, start.ts) migrates automatically. Also narrows auth.type from string to 'private' | 'public'. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(config): move distribution_type to a top-level field (BEX-327) Per the resolved discussion on the Product solutioning doc ("distribution_type would be moved out and reflect auth as well"), ProjectConfig now carries distribution_type as a top-level field matching the real brevo app upload payload shape, instead of the nested auth.type introduced earlier today. auth is back to just { scopes, redirectUrls }. readProjectConfig() backfills distribution_type from whichever shape is on disk, in precedence order: top-level distribution_type -> interim auth.type (never released) -> oldest legacy top-level distribution (every currently-published scaffold) -> defaults to 'private'. All legacy shapes are dropped on the next write-back. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
|



Summary
Enables
--distribution publiconbrevo app create— the "coming soon" rejection is removed and the Public option in the interactive prompt is no longer disabled.brevo app create --distribution publicnow creates a public app instead of erroring; theAPP_CREATE_PUBLIC_UNAVAILABLEmessage is removed.app-config.jsonnow writes the app's actual distribution type intoauth.type(via a new{{DISTRIBUTION}}template variable) and drops the redundant top-leveldistributionkey.readProjectConfig()transparently backfillsauth.typefrom the legacy top-leveldistributionkey, so previously scaffolded projects keep working;auth.typewins when both are present.agent-context/AGENTS.mdandagent-context/SKILL.mdupdated to document the new--distribution <private|public>surface.Test Plan
app createtest:--distribution publicnow creates the app withdistribution_type: 'public'and asserts the API payload.configtests covering the legacydistributionkey: backfill intoauth.type, precedence ofauth.typewhen both exist, and new-format configs without the key.distributionfixture key fromapp updatetests.🤖 Generated with Claude Code