feat(book): component gallery Vite app in apps/ - #12442
Merged
Merged
Conversation
A plain Vite + React SPA that renders Maskbook's shared UI components, imported from source via the `mask-src` export condition (mirrors packages/mask/.webpack/config.ts). No Storybook. - apps/book: Vite app, hash router, auto-discovered `*.demo.tsx` demos via import.meta.glob, MaskThemeProvider + light/dark toggle - Sections: Foundation (colors, typography, shadows), Components (ActionButton, Alert, Indicators, LoadingBase, Tabs, TextField), Icons (full @masknet/icons gallery) - Shadow-root portals disabled for normal-DOM rendering - vite-plugin-wasm for tiny-secp256k1 pulled in via @masknet/shared-base - pnpm-workspace.yaml: add apps/*; root scripts: `book`, `book:build` - vercel.json for deploy from apps/book Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013SLkuieqJXCMg1xoL98jij
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
apps/book— a plain Vite + React SPA that renders Maskbook's shared UI components. Not Storybook (removed in #10977); this is hand-rolled and deliberately small. Plan discussion in #12439.Components are imported from source via the
mask-srcexport condition, so the gallery tracks the packages with no build step of their own.How it works
*.demo.tsxundersrc/demos/<section>/;import.meta.globinsrc/registry.tspicks it up. First path segment = sidebar section.vite.config.tssetsresolve.conditions: ['mask-src'], mirroringpackages/mask/.webpack/config.ts. Without it@masknet/themeresolves to a.d.ts.src/providers.tsx) —MaskThemeProvider+ light/dark toggle (localStorage),DialogStackingProvider, andDisableShadowRootContextso components render in the normal DOM instead of the extension's shadow roots.vite-plugin-wasmis required because@masknet/shared-basere-exports@masknet/base, which loadstiny-secp256k1's wasm.Sections
maskColorswatches), typography, shadows@masknet/iconsgallery — 405 icons, filter + click-to-copyWiring
pnpm-workspace.yaml: addapps/*package.json:pnpm book(dev),pnpm book:buildapps/book/vercel.jsonfor deploy (Root Directoryapps/book; build/install commandscdto repo root for the workspace)Verification
pnpm book:buildpasses (main chunk ~1.1 MB / 298 KB gzip, from the@masknet/basegraph)StacktakesalignItemsonly viasx, not as a prop — it was leaking to the DOMNot in scope
Injection and Plugins sections need a mock layer (background
Services.*, site-adaptor context, web3 providers) — tracked as P4/P5 in #12439.🤖 Generated with Claude Code
https://claude.ai/code/session_013SLkuieqJXCMg1xoL98jij