Skip to content

Conversation

D-K-P
Copy link
Member

@D-K-P D-K-P commented Sep 15, 2025

No description provided.

Copy link

changeset-bot bot commented Sep 15, 2025

⚠️ No Changeset found

Latest commit: fc4ede4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Sep 15, 2025

Walkthrough

Adds two new documentation pages and updates navigation and introduction listings. docs/docs.json receives entries for guides/example-projects/product-image-generator and guides/examples/replicate-image-generation. New pages are added at docs/guides/example-projects/product-image-generator.mdx and docs/guides/examples/replicate-image-generation.mdx, describing a Product Image Generator example and a Replicate image-generation task (including an example Trigger.dev task and R2 upload flow). docs/guides/introduction.mdx is updated to include rows for these additions. No code, APIs, or exported entities are modified.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request has no description but the repository requires a specific template including "Closes #", a contributor checklist, testing steps, a changelog entry, and screenshots. Because none of these required sections are present the description is incomplete and fails the template requirement. Reviewers cannot verify testing steps or link the PR to an issue from the current description. Please populate the PR description using the repository template: add "Closes #" if applicable, complete the checklist including confirming you followed the contributing guide and ran tests, add a "Testing" section describing how you validated the examples, provide a short "Changelog" summary, and attach screenshots or state "N/A". Including these details will allow reviewers to verify the changes and link the PR to an issue. After updating the description, request re-review.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Added product image generator and replicate examples" succinctly describes the primary change: adding two new example documentation pages. It is concise, a single sentence, and directly matches the files added in the changeset (product-image-generator and replicate-image-generation). A teammate scanning PR history will understand the main intent without extra noise. No changes to the title are necessary.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/product-image-generator

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b6bf1a7 and ce81f1f.

📒 Files selected for processing (1)
  • docs/guides/examples/replicate-image-generation.mdx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/guides/examples/replicate-image-generation.mdx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript-typescript)

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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
Contributor

@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: 0

🧹 Nitpick comments (8)
docs/guides/example-projects/product-image-generator.mdx (2)

13-17: Add basic accessibility to the video.

Include poster and a caption/transcript link for a11y and better UX on slow networks.

-<video
-  controls
-  className="w-full aspect-video"
-  src="https://content.trigger.dev/product-image-generator-example.mp4"
-/>
+<video
+  controls
+  className="w-full aspect-video"
+  poster="/images/product-image-generator/poster.jpg"
+  src="https://content.trigger.dev/product-image-generator-example.mp4"
+/>
+<p className="sr-only">
+  Video: Product image generator demo. <a href="/transcripts/product-image-generator">Read transcript</a>.
+</p>

34-36: Model naming inconsistent with the example task page.

This page says Replicate “google/nano-banana”, while the example task links to “meta/nano-banana-image-to-image”. Standardize the model slug across pages.

Would you like me to align both docs once you confirm the correct Replicate model slug?

docs/guides/examples/replicate-image-generation.mdx (6)

2-4: Title/link/model mismatch.

Title says “nano-banana”; body links to “meta/nano-banana-image-to-image”, but code uses google/nano-banana. Pick one canonical model and use it everywhere (title, link, code).


52-59: Result handling is inconsistent; likely a bug.

wait.forToken<Prediction>(...) returns a result wrapper, but code uses result.output.output. Either unwrap or access the correct property shape from Prediction.

-    const result = await wait.forToken<Prediction>(token);
-    // unwrap() throws a timeout error or returns the result 👆
-
-    if (!result.ok) {
-      throw new Error("Failed to create prediction");
-    }
-
-    const generatedImageUrl = result.output.output;
+    const prediction = await wait.forToken<Prediction>(token).unwrap();
+    // prediction.output can be string | string[] depending on model
+    const out = prediction.output as any;
+    const generatedImageUrl = Array.isArray(out) ? out[0] : out;
+    if (!generatedImageUrl) throw new Error("Prediction returned no output URL");

61-66: Remove unused base64 step.

base64Image isn’t used and wastes CPU/memory for large images.

-    const base64Image = Buffer.from(imageBuffer).toString("base64");

73-81: Tighten R2 upload safety.

Validate required env vars and trim public URL to avoid double slashes.

-    const uploadParams = {
+    const bucket = process.env.R2_BUCKET;
+    if (!bucket) throw new Error("R2_BUCKET env var is required");
+    const uploadParams = {
-      Bucket: process.env.R2_BUCKET,
+      Bucket: bucket,
       Key: r2Key,
       Body: imageBuffer,
       ContentType: "image/png",
       CacheControl: "public, max-age=31536000", // 1 year
     };
-    const publicUrl = `${process.env.R2_PUBLIC_URL}/${r2Key}`;
+    const baseUrl = (process.env.R2_PUBLIC_URL ?? "").replace(/\/$/, "");
+    if (!baseUrl) throw new Error("R2_PUBLIC_URL env var is required");
+    const publicUrl = `${baseUrl}/${r2Key}`;

111-124: Replace irrelevant React Email section with relevant resources.

This section appears copy‑pasted and unrelated.

-## Learn more
-
-### React Email docs
-
-Check out the [React Email docs](https://react.email/docs) and learn how to set up and use React Email, including how to preview your emails locally.
-
-<CardGroup cols={2}>
-  <Card title="Components" icon="puzzle-piece" href="https://react.email/components">
-    Pre-built components you can copy and paste into your emails.
-  </Card>
-  <Card title="Templates" icon="rectangle-list" href="https://react.email/templates">
-    Extensive pre-built templates ready to use.
-  </Card>
-</CardGroup>
+## Learn more
+
+- Replicate docs for your chosen model
+- Trigger.dev Wait tokens (/wait-for-token) and Webhooks
+- Cloudflare R2 S3 API (PUT object, public URLs)

32-33: Nit: TypeScript file extension.

The snippet path ends with .tsx but no JSX is used; consider .ts for accuracy.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0f9b83d and b6bf1a7.

📒 Files selected for processing (4)
  • docs/docs.json (2 hunks)
  • docs/guides/example-projects/product-image-generator.mdx (1 hunks)
  • docs/guides/examples/replicate-image-generation.mdx (1 hunks)
  • docs/guides/introduction.mdx (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (6)
docs/docs.json (2)

346-346: Nav entry added correctly; please sanity‑check route render.

Slug matches the new page path. After deploy, verify the link appears under Guides & examples → Example projects and loads without 404.


381-381: Nav entry added correctly; confirm route and build.

Slug matches the new example page. Please confirm sidebar/nav highlighting and search indexing pick it up.

docs/guides/introduction.mdx (2)

55-56: New example project row looks good; verify repo URL.

Content and ordering match the rest of the table. Double‑check the GitHub path resolves post‑merge.


83-83: New example task row looks good; ensure cross‑link consistency.

Confirm this slug matches the nav entry and the page’s title/sidebarTitle.

docs/guides/example-projects/product-image-generator.mdx (1)

57-61: Verify internal anchors.

Confirm “Batch operations” anchor exists at /triggering#tasks-batchtrigger; if the heading ID differs, update the fragment.

docs/guides/examples/replicate-image-generation.mdx (1)

43-50: Keep image_input; update stale 'Flux' comment

Verified: google/nano-banana expects image_input (an array of image URLs); do not change the key to image.
Location: docs/guides/examples/replicate-image-generation.mdx (lines 43–50) — replace the inline comment "Use Flux with structured prompt" with a neutral comment such as "Create prediction".

Likely an incorrect or invalid review comment.

@D-K-P D-K-P merged commit 04dcb81 into main Sep 16, 2025
7 checks passed
@D-K-P D-K-P deleted the docs/product-image-generator branch September 16, 2025 09:26
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.

2 participants