Skip to content

Add documentation site for ethzig.org#8

Merged
koko1123 merged 2 commits intomainfrom
docs/ethzig-org
Feb 26, 2026
Merged

Add documentation site for ethzig.org#8
koko1123 merged 2 commits intomainfrom
docs/ethzig-org

Conversation

@koko1123
Copy link
Contributor

@koko1123 koko1123 commented Feb 26, 2026

Summary

  • Adds a complete Fumadocs documentation site under docs/ (Next.js 15 + Tailwind v4)
  • 16 content pages across 4 sections: Getting Started, Guides, Reference, Community
  • Follows same conventions as strobe-docs (fumadocs 15.8.5, same theme/layout patterns)
  • Updates README: adds docs badge, fixes install version to v0.2.2, adds ethzig.org link
  • Updates .gitignore to exclude docs build artifacts

Content pages

  • Getting Started: introduction (with benchmark highlights), installation
  • Guides: examples, transactions, contracts, tokens, hd-wallets, comptime selectors, ENS, websockets
  • Reference: full module reference, complete benchmark results (26 ops), library comparison
  • Community: contributing guide, FAQ

Deploy config

  • Root Directory: docs
  • Framework: Next.js (auto-detected)
  • Custom domain: ethzig.org

Test plan

  • pnpm install succeeds (fumadocs-mdx generates types)
  • pnpm build generates all 18 static pages
  • Dev server returns 200 on all routes
  • Deploy to Vercel and configure ethzig.org domain

Summary by CodeRabbit

  • Documentation

    • Launched a full docs website with site navigation, SEO, styling and deploy config.
    • Added comprehensive guides: introduction, installation, modules reference, examples, benchmarks, comparison, comptime selectors, contracts, transactions, HD wallets, ENS, tokens, websockets, contributing, and FAQ.
    • Added runnable examples, benchmarks summary, and reproducibility instructions.
  • Chores

    • Updated README install reference to v0.2.2.
    • Expanded ignore rules to exclude docs build artifacts.

Fumadocs-powered docs site (Next.js 15 + Tailwind v4) with 16 pages
covering guides, API reference, benchmarks, and community resources.
Also fixes README install version to v0.2.2 and adds docs badge.
@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2026

📝 Walkthrough

Walkthrough

Adds a full documentation site under docs/ (content, tooling, Next.js app, styling, and configs), plus minor repo updates: README version bump and .gitignore entries for docs build artifacts.

Changes

Cohort / File(s) Summary
Repo metadata & ignore
/.gitignore, README.md
Bumped dependency reference to v0.2.2, added docs badge to README, and added docs build artifact patterns to root .gitignore.
Docs root ignore
docs/.gitignore
New ignore rules for docs build outputs, dependencies, env files, and misc generated artifacts.
Docs site manifest & tooling
docs/package.json, docs/tsconfig.json, docs/postcss.config.mjs, docs/eslint.config.mjs
Added package manifest and configuration for Next.js + FumaDocs + Tailwind + TypeScript + ESLint used to build the docs site.
Next.js + MDX config
docs/next.config.mjs, docs/source.config.ts, docs/postcss.config.mjs
MDX integration and site-level config for FumaDocs, MDX loader wiring, and PostCSS/Tailwind setup.
Docs site content index
docs/content/docs/meta.json
Navigation metadata added to define the docs site page structure.
Documentation content
docs/content/docs/*.mdx
Added ~15+ MDX pages (introduction, installation, examples, benchmarks, comparison, modules, transactions, contracts, tokens, HD wallets, comptime, ENS, websockets, contributing, faq, etc.).
Next.js app pages & layout
docs/src/app/layout.tsx, docs/src/app/global.css, docs/src/app/[[...slug]]/layout.tsx, docs/src/app/[[...slug]]/page.tsx, docs/src/app/not-found.tsx
App router layouts, global styling, dynamic MDX page rendering, metadata generation, JSON‑LD SEO, theming provider, and a not-found redirect component.
Docs UI helpers
docs/src/lib/layout.shared.tsx, docs/src/lib/source.ts, docs/src/mdx-components.tsx
Shared layout options, FumaDocs source loader wiring, and MDX component merging utility.
Misc docs config files
docs/eslint.config.mjs, docs/postcss.config.mjs, docs/source.config.ts
ESLint FlatCompat config, PostCSS/Tailwind entry, and FumaDocs source/defineConfig exports for the docs build.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 Hoppity hop, the docs took flight,

Pages and examples, shiny and bright.
MDX and Tailwind stitched with care,
eth.zig's guide now dwells there.
A little rabbit cheers — Hooray! ✨🐇

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and directly describes the main change: adding a comprehensive documentation site for ethzig.org. It accurately summarizes the primary objective of the PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/ethzig-org

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

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

🧹 Nitpick comments (5)
docs/src/app/[[...slug]]/page.tsx (1)

13-16: Extract shared page-resolution logic to avoid drift.

Both handlers repeat the same slug resolution + notFound() path. A tiny helper keeps behavior centralized.

♻️ Proposed refactor
+async function resolvePage(paramsPromise: Promise<{ slug?: string[] }>) {
+  const params = await paramsPromise;
+  const page = source.getPage(params.slug);
+  if (!page) notFound();
+  return page;
+}
+
 export default async function Page(props: { params: Promise<{ slug?: string[] }> }) {
-  const params = await props.params;
-  const page = source.getPage(params.slug);
-  if (!page) notFound();
+  const page = await resolvePage(props.params);

   const MDX = page.data.body;
@@
 export async function generateMetadata(
   props: { params: Promise<{ slug?: string[] }> },
 ): Promise<Metadata> {
-  const params = await props.params;
-  const page = source.getPage(params.slug);
-  if (!page) notFound();
+  const page = await resolvePage(props.params);

   return {
     title: page.data.title,

Also applies to: 43-49

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/src/app/`[[...slug]]/page.tsx around lines 13 - 16, Extract the repeated
slug resolution + notFound behavior into a small helper (e.g., getPageOrThrow or
resolvePage) and call it from both handlers instead of duplicating logic; the
helper should accept the incoming params promise (same shape as props.params),
await it, call source.getPage(params.slug) and call notFound() if the result is
falsy, returning the resolved page otherwise so Page (and the other handler) can
just call the helper and proceed.
docs/content/docs/introduction.mdx (1)

45-47: Add a warning comment about the test private key.

The examples.mdx page includes a helpful warning: // WARNING: This is the default Anvil/Hardhat test key. Never use it for real funds. For consistency and to prevent users from accidentally using test keys with real funds, consider adding the same warning here.

📝 Suggested addition
     // Derive an address from a private key
+    // WARNING: This is the default Anvil/Hardhat test key. Never use it for real funds.
     const private_key = try eth.hex.hexToBytesFixed(32, "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80");
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/content/docs/introduction.mdx` around lines 45 - 47, Add a clear warning
comment above the test private key derivation to match examples.mdx: note that
the value passed into eth.hex.hexToBytesFixed (the private_key variable) is the
default Anvil/Hardhat test key and must never be used with real funds; place the
warning immediately before the const private_key declaration and keep it concise
and visible to users who copy the example, mentioning the private_key and the
eth.signer.Signer.init usage to make the context explicit.
docs/src/app/not-found.tsx (2)

9-15: Consider adjusting the redirect timing.

The 100ms delay is too short for users to read the message but adds unnecessary latency. Either redirect immediately (remove the timeout) or increase the delay to ~2 seconds so users can read "Page Not Found" before being redirected.

Option 1: Immediate redirect
  useEffect(() => {
-   const timer = setTimeout(() => {
-     router.push('/introduction');
-   }, 100);
-
-   return () => clearTimeout(timer);
+   router.replace('/introduction');
  }, [router]);
Option 2: Readable delay
  useEffect(() => {
    const timer = setTimeout(() => {
      router.push('/introduction');
-   }, 100);
+   }, 2000);

    return () => clearTimeout(timer);
  }, [router]);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/src/app/not-found.tsx` around lines 9 - 15, The current useEffect in the
NotFound component sets a 100ms timeout before router.push('/introduction'),
which is too short; either remove the timeout so router.push('/introduction')
runs immediately, or increase the delay to a readable duration (e.g., change 100
to 2000) so users can see the "Page Not Found" message; update the timer
variable and cleanup (clearTimeout) in the same useEffect that contains
router.push to keep behavior consistent.

17-30: Consider using Tailwind classes for consistency.

The rest of the docs site uses Tailwind CSS. Using inline styles here creates inconsistency. This is a minor nitpick given this is a transient redirect page.

Tailwind version
  return (
-   <div style={{
-     display: 'flex',
-     flexDirection: 'column',
-     alignItems: 'center',
-     justifyContent: 'center',
-     minHeight: '100vh',
-     padding: '20px',
-     textAlign: 'center'
-   }}>
-     <h1 style={{ fontSize: '2rem', marginBottom: '1rem' }}>Page Not Found</h1>
-     <p style={{ marginBottom: '1rem' }}>Redirecting you to the docs...</p>
+   <div className="flex flex-col items-center justify-center min-h-screen p-5 text-center">
+     <h1 className="text-2xl mb-4">Page Not Found</h1>
+     <p className="mb-4">Redirecting you to the docs...</p>
    </div>
  );
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/src/app/not-found.tsx` around lines 17 - 30, Replace the inline style
object in the Not Found component's returned JSX (the outer div and its children
h1 and p) with Tailwind className strings for consistency with the docs site;
remove the style props on the div, h1, and p and use classes like flex flex-col
items-center justify-center min-h-screen p-5 text-center on the container and
text-2xl mb-4 on the h1 and mb-4 on the p (adjust exact class names to match
your spacing scale), keeping the same markup and redirect behavior.
docs/content/docs/hd-wallets.mdx (1)

35-48: Consider making this example self-contained.

The code references &words (line 38) which is defined only in the previous section. While the context suggests building on the earlier example, readers who copy this snippet in isolation will encounter an undefined reference.

📝 Proposed enhancement for standalone clarity

Add a comment referencing the previous example, or include the words definition:

 const eth = `@import`("eth");

+// Using the 12-word mnemonic from the previous example:
+// const words = [_][]const u8{ "abandon", "abandon", ... };
+
 const seed = try eth.mnemonic.toSeed(&words, "");

Alternatively, make it fully standalone by including the words array definition again.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/content/docs/hd-wallets.mdx` around lines 35 - 48, The snippet uses
&words passed to eth.mnemonic.toSeed but doesn’t define words in this block,
causing an undefined reference when copied standalone; update the example around
eth.mnemonic.toSeed and eth.hd_wallet.deriveEthAccount to either (a) re-declare
the words array (e.g., a mnemonic words variable) before calling
eth.mnemonic.toSeed, or (b) add a brief comment saying “see previous example for
words definition” so readers know to supply the words variable when using
deriveEthAccount; ensure the symbol names eth.mnemonic.toSeed, &words, and
eth.hd_wallet.deriveEthAccount are mentioned to locate the fix.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/content/docs/ens.mdx`:
- Around line 55-64: The Text Records section currently only has a placeholder
comment; either replace it with a concrete usage example or mark the section as
TODO. If the API exists, add a short snippet showing how to call the resolver
text lookup (e.g., reference eth, ens_resolver.getText, allocator and provider
and a sample name like "vitalik.eth" with a key like "avatar"), including proper
allocation/deallocation handling; otherwise remove the placeholder and replace
the block with a one-line note that text record lookup is planned for a future
release.

In `@docs/content/docs/transactions.mdx`:
- Around line 31-37: Update the opening sentence in
docs/content/docs/transactions.mdx to match the table and the
SendTransactionOpts type: change the claim that `to` and `value` are required to
state that all fields on SendTransactionOpts are optional (or explicitly state
which are optional), and note the defaults shown in the table (`to` defaults to
null, `value` defaults to 0, `data` defaults to an empty slice) and that
unspecified fields will be fetched from the provider where applicable; ensure
the text references the SendTransactionOpts name so readers can correlate the
prose with the table.

---

Nitpick comments:
In `@docs/content/docs/hd-wallets.mdx`:
- Around line 35-48: The snippet uses &words passed to eth.mnemonic.toSeed but
doesn’t define words in this block, causing an undefined reference when copied
standalone; update the example around eth.mnemonic.toSeed and
eth.hd_wallet.deriveEthAccount to either (a) re-declare the words array (e.g., a
mnemonic words variable) before calling eth.mnemonic.toSeed, or (b) add a brief
comment saying “see previous example for words definition” so readers know to
supply the words variable when using deriveEthAccount; ensure the symbol names
eth.mnemonic.toSeed, &words, and eth.hd_wallet.deriveEthAccount are mentioned to
locate the fix.

In `@docs/content/docs/introduction.mdx`:
- Around line 45-47: Add a clear warning comment above the test private key
derivation to match examples.mdx: note that the value passed into
eth.hex.hexToBytesFixed (the private_key variable) is the default Anvil/Hardhat
test key and must never be used with real funds; place the warning immediately
before the const private_key declaration and keep it concise and visible to
users who copy the example, mentioning the private_key and the
eth.signer.Signer.init usage to make the context explicit.

In `@docs/src/app/`[[...slug]]/page.tsx:
- Around line 13-16: Extract the repeated slug resolution + notFound behavior
into a small helper (e.g., getPageOrThrow or resolvePage) and call it from both
handlers instead of duplicating logic; the helper should accept the incoming
params promise (same shape as props.params), await it, call
source.getPage(params.slug) and call notFound() if the result is falsy,
returning the resolved page otherwise so Page (and the other handler) can just
call the helper and proceed.

In `@docs/src/app/not-found.tsx`:
- Around line 9-15: The current useEffect in the NotFound component sets a 100ms
timeout before router.push('/introduction'), which is too short; either remove
the timeout so router.push('/introduction') runs immediately, or increase the
delay to a readable duration (e.g., change 100 to 2000) so users can see the
"Page Not Found" message; update the timer variable and cleanup (clearTimeout)
in the same useEffect that contains router.push to keep behavior consistent.
- Around line 17-30: Replace the inline style object in the Not Found
component's returned JSX (the outer div and its children h1 and p) with Tailwind
className strings for consistency with the docs site; remove the style props on
the div, h1, and p and use classes like flex flex-col items-center
justify-center min-h-screen p-5 text-center on the container and text-2xl mb-4
on the h1 and mb-4 on the p (adjust exact class names to match your spacing
scale), keeping the same markup and redirect behavior.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 99a8961 and 659ea57.

⛔ Files ignored due to path filters (1)
  • docs/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (33)
  • .gitignore
  • README.md
  • docs/.gitignore
  • docs/content/docs/benchmarks.mdx
  • docs/content/docs/comparison.mdx
  • docs/content/docs/comptime.mdx
  • docs/content/docs/contracts.mdx
  • docs/content/docs/contributing.mdx
  • docs/content/docs/ens.mdx
  • docs/content/docs/examples.mdx
  • docs/content/docs/faq.mdx
  • docs/content/docs/hd-wallets.mdx
  • docs/content/docs/installation.mdx
  • docs/content/docs/introduction.mdx
  • docs/content/docs/meta.json
  • docs/content/docs/modules.mdx
  • docs/content/docs/tokens.mdx
  • docs/content/docs/transactions.mdx
  • docs/content/docs/websockets.mdx
  • docs/eslint.config.mjs
  • docs/next.config.mjs
  • docs/package.json
  • docs/postcss.config.mjs
  • docs/source.config.ts
  • docs/src/app/[[...slug]]/layout.tsx
  • docs/src/app/[[...slug]]/page.tsx
  • docs/src/app/global.css
  • docs/src/app/layout.tsx
  • docs/src/app/not-found.tsx
  • docs/src/lib/layout.shared.tsx
  • docs/src/lib/source.ts
  • docs/src/mdx-components.tsx
  • docs/tsconfig.json

- ENS: replace placeholder text records section with real getText example
- Transactions: fix SendTransactionOpts description (all fields are optional)
- HD Wallets: clarify words reference in multiple accounts example
- Introduction: add test key warning to quick start example
- NotFound: use Tailwind classes instead of inline styles, increase redirect delay
Copy link

@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.

🧹 Nitpick comments (2)
docs/content/docs/hd-wallets.mdx (1)

55-68: Add a prerequisite note for words in later snippets.

Both Mnemonic Validation and Passphrase examples depend on words; a short note here improves standalone readability.

✏️ Suggested doc tweak
 ## Mnemonic Validation
+Assumes `words` is defined as in the first example.
 
 ```zig
 const eth = `@import`("eth");
@@
 ## BIP-39 Passphrase
 
 You can use an optional passphrase (sometimes called the "25th word") for additional security:
+Assumes `words` is defined as in the first example.
 
 ```zig
 const seed = try eth.mnemonic.toSeed(&words, "my secret passphrase");
</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @docs/content/docs/hd-wallets.mdx around lines 55 - 68, The docs use words
in later snippets without defining it; add a brief prerequisite note before the
BIP-39 Passphrase section stating that words refers to the mnemonic array
defined in the first example (used by eth.mnemonic.validate) so readers know
what to pass into eth.mnemonic.toSeed; reference words,
eth.mnemonic.validate, and eth.mnemonic.toSeed in the note for clarity.


</details>

</blockquote></details>
<details>
<summary>docs/content/docs/ens.mdx (1)</summary><blockquote>

`33-40`: **Clarify snippet prerequisites for copy-paste usability.**

`provider` (and `address` in reverse resolution) are referenced without local setup in these blocks. Add a one-line prerequisite note so readers know these snippets depend on earlier context.


<details>
<summary>✏️ Suggested doc tweak</summary>

```diff
 ## Reverse Resolution
 
 Resolve an address back to an ENS name:
+Assumes `provider` is initialized as shown in Forward Resolution, and `address` is the target Ethereum address.
 
 ```zig
 const eth = `@import`("eth");
@@
 ## Text Records
 
 ENS names can have associated text records (email, URL, avatar, etc.). Use `getText` to look up a record by key:
+Assumes `provider` is initialized as shown in Forward Resolution.
 
 ```zig
 const eth = `@import`("eth");

Also applies to: 59-63

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/content/docs/ens.mdx` around lines 33 - 40, The examples call symbols
like provider, address, eth.ens_reverse.reverseResolve and getText without
showing setup; add a one-line prerequisite note above each snippet (e.g., before
the reverseResolve and forward resolution/getText blocks) stating that provider
has been initialized (and address set) as shown in the Forward Resolution
section so the snippets are copy-paste usable; ensure the note references the
same names "provider" and "address" so readers can find the earlier
initialization.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/content/docs/ens.mdx`:
- Around line 33-40: The examples call symbols like provider, address,
eth.ens_reverse.reverseResolve and getText without showing setup; add a one-line
prerequisite note above each snippet (e.g., before the reverseResolve and
forward resolution/getText blocks) stating that provider has been initialized
(and address set) as shown in the Forward Resolution section so the snippets are
copy-paste usable; ensure the note references the same names "provider" and
"address" so readers can find the earlier initialization.

In `@docs/content/docs/hd-wallets.mdx`:
- Around line 55-68: The docs use `words` in later snippets without defining it;
add a brief prerequisite note before the BIP-39 Passphrase section stating that
`words` refers to the mnemonic array defined in the first example (used by
eth.mnemonic.validate) so readers know what to pass into eth.mnemonic.toSeed;
reference `words`, `eth.mnemonic.validate`, and `eth.mnemonic.toSeed` in the
note for clarity.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 659ea57 and d4fa1fb.

📒 Files selected for processing (5)
  • docs/content/docs/ens.mdx
  • docs/content/docs/hd-wallets.mdx
  • docs/content/docs/introduction.mdx
  • docs/content/docs/transactions.mdx
  • docs/src/app/not-found.tsx
✅ Files skipped from review due to trivial changes (1)
  • docs/content/docs/transactions.mdx
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/src/app/not-found.tsx
  • docs/content/docs/introduction.mdx

@koko1123 koko1123 merged commit a4f225f into main Feb 26, 2026
8 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.

1 participant