This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
weapp-tailwindcss is a Turbo-based monorepo that brings TailwindCSS atomic styling to mini-program (小程序) developers. It provides comprehensive TailwindCSS support for WeChat Mini Programs, Taro, uni-app, remax, rax, mpx, and other mini-program frameworks across webpack, vite, rspack, rollup, rolldown, and gulp build tools.
-
packages/ - Core packages including:
weapp-tailwindcss- Main package with CLI (weapp-tailwindcssorweapp-tw)@weapp-tailwindcss/shared- Shared utilities@weapp-tailwindcss/postcss- PostCSS plugin@weapp-tailwindcss/babel- Babel transformations@weapp-tailwindcss/logger- Logging utilitiestailwindcss-injector,tailwindcss-core-plugins-extractor,tailwindcss-config- Build tool integrations
-
packages-runtime/ - Runtime-specific implementations (vite, webpack integrations)
-
apps/ - Example applications (react-app, vue-app, native, taro-app, vite-native)
-
demo/ - Framework-specific demo projects (native, taro, uni-app, rax, mpx, gulp)
-
templates/ - Project templates for different frameworks
-
website/ - Documentation website
-
benchmark/ - Performance benchmarking tools
-
e2e/ - End-to-end tests with CSS snapshot testing
pnpm build # Build all packages (uses turbo cache)
pnpm build:nocache # Build without cache (TURBO_FORCE=1)
pnpm build:apps # Build apps only
pnpm build:pkgs # Build packages only
pnpm build:docs # Build documentation website
pnpm build:demo # Build demo appspnpm test # Run all tests (vitest)
pnpm test:dev # Run tests in watch mode
pnpm test:core # Run main package tests
pnpm test:plugins # Run plugin package tests
pnpm test:typography # Run typography tests
pnpm test:ui # Run tests with UI
pnpm e2e # Run end-to-end tests
pnpm e2e:u # Update e2e snapshots
pnpm bench # Run benchmarkspnpm dev:apps # Run all apps in development mode
pnpm format # Format code with prettier
pnpm lint # Lint code
pnpm lint:fix # Fix linting issuespnpm release # Create changeset
pnpm pr # Enter alpha prerelease mode
pnpm pr:beta # Enter beta prerelease mode
pnpm pr:exit # Exit prerelease mode
pnpm publish-packages # Build, test, version, and publishpnpm demo:install # Install dependencies for demos
pnpm demo:install:beta # Install beta versions for demos
pnpm demo:install:alpha # Install alpha versions for demosThe main weapp-tailwindcss package exports multiple entry points for different use cases:
- Default: webpack/vite plugin
./webpack4: PostCSS 7 + webpack 4 compatibility./vite,./webpack,./gulp,./core: Build-specific integrations./escape,./types,./defaults,./presets: Utilities- CSS exports:
./preflight.css,./theme.css,./utilities.css,./uni-app-x.css
- Uses turbo for task orchestration and caching
- Build dependencies are defined in
turbo.json packages/*andpackages-runtime/*must build beforeapps/*anddemo/*
- Uses pnpm workspaces with
catalog:for centralized dependency versioning (seepnpm-workspace.yaml) - Internal packages reference each other with
workspace:*
- Root
vitest.config.tsdynamically discovers all package vitest configs from workspace - E2E tests use CSS snapshot testing (
e2e/update-snapshotsscript syncs snapshots)
- Root package requires
node >= 18.0.0 - Main
weapp-tailwindcsspackage requiresnode ^18.17.0 || >=20.5.0 - Package manager: pnpm@10.26.1
- Supports TailwindCSS v4, v3, and v2 JIT
- Different entry points handle different TailwindCSS versions
The package provides a CLI via bin/weapp-tailwindcss.js:
weapp-tailwindcss patch # Patch TailwindCSS for mini-program compatibility
weapp-tw patch # Shorthand alias- ES modules throughout (
type: "module") - TypeScript strict mode
- Changesets for version management
- Commitlint enforces conventional commits
- Primary documentation is in Chinese (tw.icebreaker.top)