Skip to content

feat(docs): enable run button on create-token-with-metadata cookbook#1470

Merged
ZYJLiu merged 1 commit into
mainfrom
chore/dev-596-docs-add-plugin-examples
May 22, 2026
Merged

feat(docs): enable run button on create-token-with-metadata cookbook#1470
ZYJLiu merged 1 commit into
mainfrom
chore/dev-596-docs-add-plugin-examples

Conversation

@amilz

@amilz amilz commented May 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add flags="r" to the <CodeTabs> block on create-token-with-metadata.mdx so the snippet is executable via the docs code runner.
  • Metaplex Token Metadata is now reachable in the surfpool/surfnet sandbox via lazy account cloning, so the example runs end-to-end.

Test Plan

  • Locally: pnpm --filter @workspace/docs-examples test -- create-token-with-metadata against surfpool.
  • On Vercel preview: open the page and click Run, confirm output shows transaction signature, mint address, and metadata fields.

Audit notes

Other /en/ cookbook pages still missing flags="r" were reviewed; most are intentional (filesystem access, long-running subscriptions, offline flow, RPC-only construction). tokens/fetch-token-metadata.mdx is a candidate for a follow-up if we want to enable it (uses a mainnet USDC mint that surfpool would need to clone).

Closes DEV-596

Surfpool now clones the Metaplex Token Metadata program lazily, so the
snippet can execute end-to-end in the docs code runner.

Refs: DEV-596
@linear

linear Bot commented May 22, 2026

Copy link
Copy Markdown

DEV-596

@vercel

vercel Bot commented May 22, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
solana-com-docs Ready Ready Preview, Comment May 22, 2026 2:25am
5 Skipped Deployments
Project Deployment Actions Updated (UTC)
solana-com Skipped Skipped May 22, 2026 2:25am
solana-com-accelerate Skipped Skipped May 22, 2026 2:25am
solana-com-breakpoint-2 Skipped Skipped May 22, 2026 2:25am
solana-com-media Skipped Skipped May 22, 2026 2:25am
templates Skipped Skipped May 22, 2026 2:25am

Request Review

@greptile-apps

greptile-apps Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR enables the interactive "Run" button on the create-token-with-metadata cookbook page by adding flags="r" to the <CodeTabs> component. It relies on surfpool's newly supported lazy account cloning for the Metaplex Token Metadata Program, allowing the snippet to execute end-to-end in the sandbox.

  • The only file changed is create-token-with-metadata.mdx — a single-attribute addition to the <CodeTabs> block.
  • The referenced kit.ts example targets localhost:8899 (surfpool's default RPC port), airdrops SOL, creates a fungible token with Metaplex metadata, and logs the signature, mint address, and metadata fields.

Confidence Score: 5/5

Safe to merge — the change is a one-attribute addition that gates the run button, with no logic or content modified.

The diff is a single-attribute change (flags="r") on a documentation component. The underlying kit.ts example was already in the repo and correctly targets the surfpool sandbox RPC. No application logic, routing, or data handling is affected.

No files require special attention.

Important Files Changed

Filename Overview
apps/docs/content/cookbook/tokens/create-token-with-metadata.mdx Single-attribute change: adds flags="r" to <CodeTabs> to enable the code runner; no logic or content modified.

Sequence Diagram

sequenceDiagram
    actor User
    participant Browser
    participant Surfpool as Surfpool Sandbox(localhost:8899)
    participant Metaplex as Metaplex Token Metadata Program

    User->>Browser: Click Run button
    Browser->>Surfpool: Airdrop 1 SOL to payer
    Surfpool-->>Browser: Airdrop confirmed
    Browser->>Surfpool: sendTransaction(createV1Instruction)
    Note over Surfpool,Metaplex: Lazy-clones Metaplex program on first use
    Surfpool->>Metaplex: Execute CreateV1
    Metaplex-->>Surfpool: Metadata PDA created
    Surfpool-->>Browser: Transaction Signature
    Browser->>Surfpool: fetchMetadataFromSeeds(mint)
    Surfpool-->>Browser: name, symbol, uri
    Browser->>User: Logs signature, mint address, name, symbol, uri
Loading

Reviews (1): Last reviewed commit: "feat(docs): enable run button on create-..." | Re-trigger Greptile

@ZYJLiu ZYJLiu merged commit fc78ef1 into main May 22, 2026
23 checks passed
@ZYJLiu ZYJLiu deleted the chore/dev-596-docs-add-plugin-examples branch May 22, 2026 15:12
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