docs(compute): Deploy Button page and generator (repository-url) - #8116
docs(compute): Deploy Button page and generator (repository-url)#8116ankur-arch wants to merge 7 commits into
Conversation
Adds a Deploy Button reference page under Compute integrations: what the button does, supported templates, URL format with attribution parameters, troubleshooting, and copy-paste Markdown/HTML snippets. Includes an interactive generator component and a hosted "Deploy with Prisma" SVG badge for third-party READMEs to hot-link. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (3)
WalkthroughThe PR adds a client-side Deploy Button generator to the Compute documentation. It validates repository and environment-variable inputs, generates deploy URLs and embedding snippets, registers the component in MDX, and documents setup and troubleshooting. ChangesDeploy Button
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant DeployButtonDocs
participant DeployButtonGenerator
participant Console
User->>DeployButtonDocs: Open Deploy Button documentation
DeployButtonDocs->>DeployButtonGenerator: Render generator
User->>DeployButtonGenerator: Enter repository and optional parameters
DeployButtonGenerator->>DeployButtonGenerator: Validate inputs and generate snippets
DeployButtonGenerator->>Console: Provide deploy-button URL
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
🍈 Lychee Link Check Report15 links: ✅ All links are working!Full Statistics Table
|
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
|
Closing this. The Deploy Button contract changed to repository-url (Vercel parity) instead of template IDs, so the docs page and generator need a different shape. See the revised spec in pdp-control-plane projects/templates-deploy-button/spec.md. |
The button's contract is now a repository URL: any public GitHub repository with a root prisma.compute.json, a package.json, and a lockfile is deployable — no registration or catalog entry. The page documents the minimal repository contract and the /new/clone?repository-url=… format, and the generator takes a repository URL plus optional project-name and attribution. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- prisma.compute.json example uses the real schema (app.httpPort, not top-level name/port — the old example failed validation verbatim). - Document the validation limits (file count/size caps, no workflows, no symlinks/submodules, single-app, region key rejected). - Match the Console's actual copy for the name-conflict error, the 15-minute authorization window, commit display and pinning behavior, the workspace picker, and the private-by-default visibility. - Qualify push-to-recover advice by whether the project was created. - Generator: project-name field shows its own validation hint, copy buttons get distinct accessible names, HTML snippet escapes ampersands in the href. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
574175e to
8619b8b
Compare
- Fix the main button: a literal anchor + img instead of the markdown image, which the docs pipeline wrapped in ImageZoom and made unclickable - Remove the early-access note - Document the env / env-example-<NAME> URL parameters and add an Environment variables section (names in the URL, values prompted in Console, DATABASE_URL provisioned automatically) - Generator: rows for required env-var names + safe example values, emitted on the URL, Markdown, and HTML outputs Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ke the Console The generator now rejects example values with control characters, the same rule the Console applies, so a pasted tab fails for the author instead of for their users. The env-var section documents the second source of prompts: app.env.vars entries in prisma.compute.json appear on the deploy form with the committed value as the prefill. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@apps/docs/content/docs/compute/deploy-button.mdx`:
- Around line 108-111: Update the safety guidance in the “Two rules keep this
safe” section to acknowledge that deploy-button URLs may include names and
optional public example values, while explicitly stating that secret values must
never be supplied. Ensure the surrounding README and browser-history guidance
matches this behavior and remains consistent with the env-example-RESEND_API_KEY
example.
In `@apps/docs/src/components/deploy-button-generator.tsx`:
- Line 138: Update envVarsValid and the validation around envRowValid to reject
duplicate environment-variable names after trimming whitespace. Mark every
conflicting row invalid before output generation, while preserving the existing
validation for other row fields and preventing later duplicate rows from being
silently discarded.
🪄 Autofix
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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: b5f33b43-5450-40b3-b450-c6c10aa4d6b4
⛔ Files ignored due to path filters (1)
apps/docs/public/img/deploy-button.svgis excluded by!**/*.svg
📒 Files selected for processing (4)
apps/docs/content/docs/compute/deploy-button.mdxapps/docs/content/docs/compute/meta.jsonapps/docs/src/components/deploy-button-generator.tsxapps/docs/src/mdx-components.tsx
| Two rules keep this safe: | ||
|
|
||
| - **The URL carries names, never values.** The user types each value (or accepts your example) in the Console form. Values never appear in the link, in browser history, or in the GitHub authorization round-trip. | ||
| - **Examples must be safe to publish.** An `env-example-<NAME>` value appears in your README for anyone to read, so use obvious placeholders like `re_example_123`, never a real key. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Correct the env-example URL statement.
Line 103 puts an env-example-RESEND_API_KEY value in the URL. These lines then say URLs carry names only and values never appear in links or browser history. State that links carry names and optional public example values, and that secret values must never be supplied.
🤖 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 `@apps/docs/content/docs/compute/deploy-button.mdx` around lines 108 - 111,
Update the safety guidance in the “Two rules keep this safe” section to
acknowledge that deploy-button URLs may include names and optional public
example values, while explicitly stating that secret values must never be
supplied. Ensure the surrounding README and browser-history guidance matches
this behavior and remains consistent with the env-example-RESEND_API_KEY
example.
| ); | ||
| const projectNameValid = | ||
| projectName.trim() === "" || PROJECT_NAME_PATTERN.test(projectName.trim()); | ||
| const envVarsValid = envVars.every(envRowValid); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Reject duplicate environment-variable names.
envVarsValid accepts duplicate trimmed names. Lines 151-155 silently discard each later row. If examples differ, the form generates a snippet that retains only the first example. Detect duplicates and mark the conflicting row invalid before generating output.
Suggested validation
+function envVarsAreValid(rows: EnvVarRow[]): boolean {
+ const names = new Set<string>();
+
+ return rows.every((row) => {
+ if (!envRowValid(row)) return false;
+ const name = row.name.trim();
+ if (name === "") return true;
+ if (names.has(name)) return false;
+ names.add(name);
+ return true;
+ });
+}
+
- const envVarsValid = envVars.every(envRowValid);
+ const envVarsValid = envVarsAreValid(envVars);📝 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.
| const envVarsValid = envVars.every(envRowValid); | |
| function envVarsAreValid(rows: EnvVarRow[]): boolean { | |
| const names = new Set<string>(); | |
| return rows.every((row) => { | |
| if (!envRowValid(row)) return false; | |
| const name = row.name.trim(); | |
| if (name === "") return true; | |
| if (names.has(name)) return false; | |
| names.add(name); | |
| return true; | |
| }); | |
| } | |
| const envVarsValid = envVarsAreValid(envVars); |
🤖 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 `@apps/docs/src/components/deploy-button-generator.tsx` at line 138, Update
envVarsValid and the validation around envRowValid to reject duplicate
environment-variable names after trimming whitespace. Mark every conflicting row
invalid before output generation, while preserving the existing validation for
other row fields and preventing later duplicate rows from being silently
discarded.
What this is
The public Deploy Button docs page (
/docs/compute/deploy-button) plus an interactive generator. Authors paste a repo URL, optionally declare env vars, and copy a ready-to-paste badge.flowchart LR A["Author opens\ndocs generator"] --> B["Enter repo URL\n+ env vars"] B --> C["Client-side validation\n(same rules as Console)"] C --> D["Copy URL /\nMarkdown / HTML"] D --> E["Badge in README"] E --> F["Visitor clicks,\nConsole takes over"]Review in 3 checks
repository-urlplus optionalproject-name,env,env-example-<NAME>,utm_*. Validation matches the Console: uppercase names, 10 max, 100-char examples, no control characters.app.env.varsinprisma.compute.json(with a copy-paste example).Where to look
apps/docs/src/components/deploy-button-generator.tsxapps/docs/content/docs/compute/deploy-button.mdxapps/docs/public/img/deploy-button.svgTesting
Merge order
flowchart LR A["#4770\nConsole"] --> B["smoke test\n+ GA"] --> C["this PR"] --> D["example repo\nbadge swap"]Nothing depends on this PR except the final badge swap in the example repo.
Summary by CodeRabbit
New Features
Documentation