Skip to content

docs: style pass — modern test pattern, realloc/resize note, American English, lint#16

Merged
mikemaccana merged 1 commit into
mainfrom
docs/style-pass-2026-05-12
May 13, 2026
Merged

docs: style pass — modern test pattern, realloc/resize note, American English, lint#16
mikemaccana merged 1 commit into
mainfrom
docs/style-pass-2026-05-12

Conversation

@mikemaccana
Copy link
Copy Markdown
Collaborator

@mikemaccana mikemaccana commented May 12, 2026

Docs and config-cleanup style pass across the repo. The only behavior-affecting code change is anchor.ts in the Token-2022 NFT metadata-pointer Next.js client, which moves a leaked API key out of source into .env.local. The other handful of non-.md edits (make_offer.rs, update_fee.rs, hello.ts, one Anchor.toml) are pure URL/dead-config cleanup in comments and config metadata — no runtime behavior changes. No tests, lockfiles, CI workflows, or production-relevant Cargo.toml/package.json files were touched.

Summary of changes

  • Modernized test guidance. Top-level CONTRIBUTING.md rewritten to reflect the actual toolchain: pnpm, Biome, node:test via npx tsx --test --test-reporter=spec, solana-kite, @solana/kit, Codama clients. Removed references to ts-mocha, mocha, anchor test --validator legacy, solana-test-validator, anchor.workspace, and program.methods.X().rpc(). Stale yarn and yarn add ts-mocha instructions in per-example READMEs were replaced with pnpm install / pnpm test.
  • reallocresize note. Added a new basics/realloc/README.md explaining that AccountInfo::realloc is deprecated in favor of AccountInfo::resize (see solana-foundation/anchor#4526), while noting that the macro-level #[account(realloc = ...)] constraint is not renamed and is still correct. The pre-existing tokens/.../tests-rs/README.md was already accurate on resize and is left as-is.
  • Deletionist prose pass. Heavy trims on the largest READMEs (tokens/token-swap/, tokens/nft-operations/anchor/, tokens/token-fundraiser/anchor/, tokens/token-extensions/nft-meta-data-pointer/anchor-example/, several transfer-hook READMEs). Removed filler phrases ("Welcome to the world of...", "Let the exploration begin!", "TLDR/TRDR"), trailing whitespace blocks, dead Seahorse notes, and "Personal preference: Helius RPCs" provider plugs — replaced with neutral, factual setup instructions.
  • Solana terminology fixes. Replaced "Smart contract" with "Program" in pblock-list/README.md's repo-layout bullet (Solana has programs, not smart contracts). Changed "instruction" to "instruction handler" (or "handler") in prose where the sentence describes what a Rust function does, not what an on-chain instruction message contains — e.g. "the pull_lever instruction does a CPI" → "the pull_lever instruction handler does a CPI". Section headers ## Instructions that list handlers and what they do are now ## Instruction handlers (in pblock-list/README.md and token-swap/README.md). Instances where "instruction" correctly refers to the on-chain object (e.g. "the program receives one instruction at a time", "Smaller instructions touch fewer accounts", the Token-2022 transfer-hook execute instruction name, the Solana Sysvar Instructions account) are left as-is. Code identifiers (process_instruction, sysvar_instruction, instructions/init.rs paths) are untouched.
  • American English in prose. Standardized on American spelling — "behavior", "initialize", "favor", "centralized", "optimized", "serialization", "organized", "color", etc. Code identifiers, package names, and CLI commands are left as-is.
  • Markdown hygiene. One H1 per file. Fenced code blocks now have language tags (rust, typescript, bash, toml, text). Trailing whitespace removed; double-blank-line runs collapsed. Renamed readme.MD / readme.md to README.md for tokens/nft-operations/anchor/, tokens/token-fundraiser/anchor/, and four transfer-hook READMEs so the casing is consistent.
  • Broken / stale URL sweep. Fixed dead and redirected documentation links across the repo: solanacookbook.comsolana.com/developers/cookbook (domain retired), docs.anza.xyz/developing/programming-model/transactionssolana.com/docs/core/transactions, docs.rs/solana-program/.../system_instruction/create_accountsolana-system-interface crate (post-monolith split), github.com/febo/pinocchiogithub.com/anza-xyz/pinocchio (org transfer), github.com/magicblock-labs/gum-program-librarymagicblock-labs/session-keys (repo rename), Metaplex Shank / Solita doc pages → GitHub repos (Metaplex retired the pages), Pyth Solana docs path update, Next.js docs path update, Anchor docs path update. Switchboard vrf-flip link removed (repo archived). Each replacement was verified with HTTP status + body inspection.
  • Moved leaked Helius API key out of source. The NFT metadata-pointer Next.js app had a hardcoded Helius URL with an API key (originally added upstream in solana-developers/program-examples#68, 2024). Replaced with a NEXT_PUBLIC_METAPLEX_READAPI_RPC env var read from .env.local, added a .env.local.example documenting all three env vars, and updated the app README to mention the setup step. .env*.local is already in the repo's .gitignore. The original key remains in the upstream repo's git history; worth a follow-up notification to upstream so it can be rotated.
  • Diff: 56 files changed, +954 / −1837 (≈ 883 lines net deletion).

Two related cleanup PRs landed separately and this branch has been rebased onto current main to incorporate them:

Things I intentionally did not change

  • Runtime code, tests, lockfiles, CI workflows, or any production-relevant Cargo.toml/package.json/Anchor.toml. Exceptions are deliberate and limited: anchor.ts was changed to remove a leaked API key (env-var refactor, see above); make_offer.rs, update_fee.rs, and pages/api/hello.ts had URLs in code comments updated as part of the broken-URL sweep; one Anchor.toml had a dead [registry] block (https://anchor.projectserum.com, Project Serum shut down 2022) replaced with a comment noting why it was removed.
  • The #[account(realloc = ..., realloc::payer = ..., realloc::zero = ...)] macro constraint stays as realloc. The runtime method AccountInfo::realloc was the only thing renamed in anchor#4526.
  • .reference/ANCHOR-1.0-MIGRATION.md. Historical migration notes — left untouched.
  • GitHub Action badge links in the top-level README.md resolve on GitHub but not on disk; that's expected.
  • Two embedded image URLs in tokens/.assets/{nft,spl-token}.json (Homer Simpson image 500, Solana coin PNG 403 hotlink) — both files are orphans in this repo; every test that uses these fixtures fetches them from the upstream mirror, so patching local copies would diverge from upstream without changing any test outcome.
  • Code/doc mismatches I noticed but did not fix (out of scope, flagging for follow-up):
    • compression/cutils/anchor still pins Anchor 0.26.0 due to mpl-bubblegum constraints — the README now mentions this, but the upstream pin itself wasn't changed.
    • Several per-example test scripts in package.json files still reference ts-mocha / solana-test-validator (didn't audit individually — out of scope).
    • The basics/counter/mpl-stack example still requires a manual edit to ts/generated/accounts/Counter.ts line 58; documented as a temporary workaround in the README.

Testing

Effectively a docs-only PR. The only behavior-affecting change is the env-var refactor in anchor.ts to remove a leaked API key; all other non-.md edits are URL-in-comment updates or dead-config removal. Nothing to run beyond the existing CI on the base branch. Markdown link sweep showed only the expected GitHub-relative badge links as "broken" on disk (they resolve correctly on GitHub).

Comment thread tokens/token-extensions/transfer-hook/pblock-list/README.md
@mikemaccana mikemaccana changed the title docs: style pass — modern test pattern, realloc/resize note, British English, lint docs: style pass — modern test pattern, realloc/resize note, American English, lint May 13, 2026
@mikemaccana mikemaccana force-pushed the docs/style-pass-2026-05-12 branch 6 times, most recently from 43515d1 to f34b3d9 Compare May 13, 2026 17:13
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f34b3d9. Configure here.

@mikemaccana mikemaccana force-pushed the docs/style-pass-2026-05-12 branch 3 times, most recently from c1db94c to 2256758 Compare May 13, 2026 18:47
Docs and config-cleanup style pass across the repo. The only behavior-affecting
code change is anchor.ts in the Token-2022 NFT metadata-pointer Next.js client,
which moves a leaked API key out of source into .env.local. The other
non-.md edits (make_offer.rs, update_fee.rs, hello.ts, one Anchor.toml) are
pure URL/dead-config cleanup in comments and config metadata — no runtime
behavior changes.

Highlights:
- Modernized test guidance in CONTRIBUTING and per-example READMEs: pnpm,
  Biome, node:test via npx tsx, solana-kite, @solana/kit, Codama clients.
- New basics/realloc/README.md noting AccountInfo::realloc is deprecated in
  favor of AccountInfo::resize (anchor#4526) while #[account(realloc=...)]
  is unchanged.
- Deletionist prose pass: removed filler phrases, dead Seahorse notes, and
  personal RPC plugs from the largest READMEs.
- American English standardization (behavior, initialize, etc.). Code
  identifiers and CLI commands unchanged.
- Markdown hygiene: one H1 per file, fenced code blocks tagged, readme.md /
  readme.MD renamed to README.md where casing was inconsistent.
- Broken / stale URL sweep: solanacookbook.com → solana.com/developers/
  cookbook, docs.anza.xyz transactions → solana.com/docs/core/transactions,
  docs.rs/solana-program system instructions → solana-system-interface
  (post-monolith-split), github.com/febo/pinocchio → anza-xyz/pinocchio
  (org transfer), magicblock-labs/gum-program-library → session-keys
  (rename), Metaplex Shank/Solita docs → GitHub repos (pages retired),
  Pyth/Next.js/Anchor docs path updates, Switchboard vrf-flip delinked
  (archived). Dead [registry] block (anchor.projectserum.com, Project
  Serum shut down 2022) removed from one Anchor.toml.
- Moved a leaked Helius API key out of NFT metadata-pointer source into
  NEXT_PUBLIC_METAPLEX_READAPI_RPC env var (.env.local.example added).
@mikemaccana mikemaccana force-pushed the docs/style-pass-2026-05-12 branch from 2256758 to 75b1ad9 Compare May 13, 2026 18:56
@mikemaccana mikemaccana merged commit 8abb5d1 into main May 13, 2026
20 checks passed
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