Skip to content

feat: replace synapse code snippet image with live twoslash-verified code block#284

Open
nijoe1 wants to merge 1 commit intoFilOzone:mainfrom
nijoe1:feat/synapse-code-block-with-twoslash
Open

feat: replace synapse code snippet image with live twoslash-verified code block#284
nijoe1 wants to merge 1 commit intoFilOzone:mainfrom
nijoe1:feat/synapse-code-block-with-twoslash

Conversation

@nijoe1
Copy link
Copy Markdown

@nijoe1 nijoe1 commented Apr 10, 2026

📝 Description

Replaces the static .webp image of the Synapse SDK code snippet with a live, syntax-highlighted code block. The code is type-checked at build time using twoslash — if @filoz/synapse-sdk introduces breaking API changes, the build fails. Also adds a cron-based GitHub Action to check for new SDK versions every 5 days.

  • Type: New feature

🛠️ Key Changes

  • Replaced <Image> with Shiki-highlighted code block, colors matched to original design
  • Added twoslash build-time type verification for the code snippet
  • Responsive scaling via CSS container query units (cqi) — code block scales like an image
  • Added synapse-sdk-check.yml workflow: auto-creates PR on compatible update, opens issue on breaking change

📌 To-Do Before Merging

  • Verify code block renders correctly on desktop and mobile
  • Confirm "Copy code snippet" button copies clean code
  • Create synapse-sdk-update label for the automated issue workflow

🧪 How to Test

  • Setup: npm install && npm run build
  • Steps to Test:
    1. Run npm run dev and navigate to /warm-storage-service
    2. Verify the code block appears with syntax highlighting
    3. Click "Copy code snippet" and paste — should be clean TypeScript
    4. Break a type in synapse-code-snippet.ts (e.g. rename .upload to .uploadX) and run npm run build — should fail with a type error
  • Expected Results: build fails on invalid SDK usage
  • Additional Notes: The workflow can be tested manually via workflow_dispatch

📸 Screenshots

Note: Styling is ~85% matched to the original design. Minor refinements to spacing, font size, or colors may be needed after visual review.

image

🔖 Resources

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 2026

@nijoe1 is attempting to deploy a commit to the FilOz Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
filecoin-cloud Ready Ready Preview, Comment Apr 10, 2026 10:57am

Request Review

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