@jhm1909/ag-kit 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/ARCHITECTURE.md +189 -0
- package/.agent/known-registries.json +181 -0
- package/.agent/mcp_config.json +19 -0
- package/.agent/rules/clean-code.md +107 -0
- package/.agent/rules/documents.md +177 -0
- package/.agent/rules/git-workflow.md +68 -0
- package/.agent/rules/nano-banana.md +46 -0
- package/.agent/rules/research.md +35 -0
- package/.agent/rules/skill-loading.md +100 -0
- package/.agent/rules/skill-suggestion.md +47 -0
- package/.agent/rules/testing.md +52 -0
- package/.agent/rules/workflow-advisor.md +108 -0
- package/.agent/rules/workflow-skill-convention.md +127 -0
- package/.agent/skills/ai-engineer/SKILL.md +824 -0
- package/.agent/skills/ai-engineer/references/agentic-patterns.md +329 -0
- package/.agent/skills/ai-engineer/references/evaluation.md +493 -0
- package/.agent/skills/ai-engineer/references/llm.md +490 -0
- package/.agent/skills/ai-engineer/references/rag-advanced.md +444 -0
- package/.agent/skills/ai-engineer/references/serving-optimization.md +531 -0
- package/.agent/skills/ai-engineer/vector-db/README.md +137 -0
- package/.agent/skills/app-builder/SKILL.md +75 -0
- package/.agent/skills/app-builder/agent-coordination.md +71 -0
- package/.agent/skills/app-builder/feature-building.md +53 -0
- package/.agent/skills/app-builder/project-detection.md +34 -0
- package/.agent/skills/app-builder/scaffolding.md +118 -0
- package/.agent/skills/app-builder/tech-stack.md +41 -0
- package/.agent/skills/app-builder/templates/SKILL.md +39 -0
- package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +122 -0
- package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +122 -0
- package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +169 -0
- package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +134 -0
- package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +119 -0
- package/.agent/skills/backend-developer/SKILL.md +763 -0
- package/.agent/skills/backend-developer/references/general-patterns.md +65 -0
- package/.agent/skills/backend-developer/references/go-echo.md +68 -0
- package/.agent/skills/backend-developer/references/go-gin.md +76 -0
- package/.agent/skills/backend-developer/references/java-springboot.md +83 -0
- package/.agent/skills/backend-developer/references/node-express.md +64 -0
- package/.agent/skills/backend-developer/references/node-nestjs.md +69 -0
- package/.agent/skills/backend-developer/references/python-django.md +67 -0
- package/.agent/skills/backend-developer/references/python-fastapi.md +80 -0
- package/.agent/skills/blockchain-engineer/SKILL.md +975 -0
- package/.agent/skills/blockchain-engineer/references/deployment.md +28 -0
- package/.agent/skills/blockchain-engineer/references/evm.md +14 -0
- package/.agent/skills/blockchain-engineer/references/mechanisms.md +32 -0
- package/.agent/skills/blockchain-engineer/references/solidity.md +32 -0
- package/.agent/skills/business-analysis/SKILL.md +85 -0
- package/.agent/skills/business-analysis/references/best-practices/diagrams.md +141 -0
- package/.agent/skills/business-analysis/references/domains/ai-agent.md +94 -0
- package/.agent/skills/business-analysis/references/domains/blockchain-dapp.md +86 -0
- package/.agent/skills/business-analysis/references/domains/ecommerce.md +77 -0
- package/.agent/skills/business-analysis/references/domains/education.md +42 -0
- package/.agent/skills/business-analysis/references/domains/fintech.md +44 -0
- package/.agent/skills/business-analysis/references/domains/fnb.md +82 -0
- package/.agent/skills/business-analysis/references/domains/healthtech.md +44 -0
- package/.agent/skills/business-analysis/references/domains/internal-tools.md +38 -0
- package/.agent/skills/business-analysis/references/domains/marketplace.md +52 -0
- package/.agent/skills/business-analysis/references/domains/saas.md +36 -0
- package/.agent/skills/business-analysis/references/workflows/collaboration.md +41 -0
- package/.agent/skills/business-analysis/scripts/verify_mermaid.py +86 -0
- package/.agent/skills/business-analysis/templates/brd.md +46 -0
- package/.agent/skills/business-analysis/templates/change-request.md +41 -0
- package/.agent/skills/business-analysis/templates/prd-functional.md +38 -0
- package/.agent/skills/business-analysis/templates/use-case.md +40 -0
- package/.agent/skills/business-analysis/templates/user-story-detailed.md +36 -0
- package/.agent/skills/code-review/SKILL.md +113 -0
- package/.agent/skills/code-review/references/code-review-reception.md +209 -0
- package/.agent/skills/code-review/references/differential_review.md +59 -0
- package/.agent/skills/code-review/references/requesting-code-review.md +105 -0
- package/.agent/skills/code-review/references/spec_compliance.md +43 -0
- package/.agent/skills/code-review/references/verification-before-completion.md +139 -0
- package/.agent/skills/context-engineering/SKILL.md +68 -0
- package/.agent/skills/context-engineering/references/context-compression.md +84 -0
- package/.agent/skills/context-engineering/references/context-degradation.md +93 -0
- package/.agent/skills/context-engineering/references/context-fundamentals.md +75 -0
- package/.agent/skills/context-engineering/references/context-optimization.md +82 -0
- package/.agent/skills/context-engineering/references/evaluation.md +89 -0
- package/.agent/skills/context-engineering/references/memory-systems.md +88 -0
- package/.agent/skills/context-engineering/references/multi-agent-patterns.md +90 -0
- package/.agent/skills/context-engineering/references/project-development.md +97 -0
- package/.agent/skills/context-engineering/references/tool-design.md +86 -0
- package/.agent/skills/debugging/SKILL.md +60 -0
- package/.agent/skills/debugging/references/defense-in-depth.md +130 -0
- package/.agent/skills/debugging/references/root-cause-tracing.md +177 -0
- package/.agent/skills/debugging/references/systematic-debugging.md +295 -0
- package/.agent/skills/debugging/references/verification-before-completion.md +142 -0
- package/.agent/skills/designer/SKILL.md +159 -0
- package/.agent/skills/designer/concepts/apple-glass.md +48 -0
- package/.agent/skills/designer/concepts/aurora-gradients.md +26 -0
- package/.agent/skills/designer/concepts/bento-grids.md +14 -0
- package/.agent/skills/designer/concepts/claymorphism.md +27 -0
- package/.agent/skills/designer/concepts/neo-brutalism.md +32 -0
- package/.agent/skills/designer/data/app-interface.csv +31 -0
- package/.agent/skills/designer/data/charts.csv +26 -0
- package/.agent/skills/designer/data/colors.csv +162 -0
- package/.agent/skills/designer/data/design.csv +1776 -0
- package/.agent/skills/designer/data/icons.csv +106 -0
- package/.agent/skills/designer/data/landing.csv +35 -0
- package/.agent/skills/designer/data/products.csv +162 -0
- package/.agent/skills/designer/data/react-performance.csv +45 -0
- package/.agent/skills/designer/data/styles.csv +85 -0
- package/.agent/skills/designer/data/typography.csv +74 -0
- package/.agent/skills/designer/data/ui-reasoning.csv +162 -0
- package/.agent/skills/designer/data/ux-guidelines.csv +100 -0
- package/.agent/skills/designer/references/accessibility.md +172 -0
- package/.agent/skills/designer/references/branding.md +88 -0
- package/.agent/skills/designer/references/color-theory.md +139 -0
- package/.agent/skills/designer/references/creation.md +118 -0
- package/.agent/skills/designer/references/design-systems.md +219 -0
- package/.agent/skills/designer/references/frontend_design_aesthetics.md +57 -0
- package/.agent/skills/designer/references/layout.md +200 -0
- package/.agent/skills/designer/references/motion.md +92 -0
- package/.agent/skills/designer/references/review.md +100 -0
- package/.agent/skills/designer/references/trends.md +209 -0
- package/.agent/skills/designer/references/typography.md +190 -0
- package/.agent/skills/designer/scripts/remove_background.py +135 -0
- package/.agent/skills/designer/scripts/ui-search/__pycache__/core.cpython-314.pyc +0 -0
- package/.agent/skills/designer/scripts/ui-search/__pycache__/design_system.cpython-314.pyc +0 -0
- package/.agent/skills/designer/scripts/ui-search/core.py +217 -0
- package/.agent/skills/designer/scripts/ui-search/design_system.py +1067 -0
- package/.agent/skills/designer/scripts/ui-search/search.py +114 -0
- package/.agent/skills/designer/templates/design-motion-spec.md +30 -0
- package/.agent/skills/devops-engineer/SKILL.md +90 -0
- package/.agent/skills/devops-engineer/docker-compose/README.md +47 -0
- package/.agent/skills/devops-engineer/references/ci-cd-pipelines.md +76 -0
- package/.agent/skills/devops-engineer/references/cloud-providers.md +57 -0
- package/.agent/skills/devops-engineer/references/codebase-normalization.md +104 -0
- package/.agent/skills/devops-engineer/references/container-orchestration.md +69 -0
- package/.agent/skills/devops-engineer/references/iac-tools.md +63 -0
- package/.agent/skills/devops-engineer/references/observability-security.md +45 -0
- package/.agent/skills/devops-engineer/references/vercel-supabase.md +17 -0
- package/.agent/skills/devops-engineer/templates/release-notes.md +8 -0
- package/.agent/skills/frontend-developer/SKILL.md +125 -0
- package/.agent/skills/frontend-developer/react-nextjs/README.md +90 -0
- package/.agent/skills/frontend-developer/references/angular.md +52 -0
- package/.agent/skills/frontend-developer/references/composition_patterns.md +60 -0
- package/.agent/skills/frontend-developer/references/core-performance.md +68 -0
- package/.agent/skills/frontend-developer/references/modern-signals.md +43 -0
- package/.agent/skills/frontend-developer/references/react_performance_rules.md +55 -0
- package/.agent/skills/frontend-developer/references/vue-nuxt.md +55 -0
- package/.agent/skills/frontend-developer/scripts/validate_compliance.py +65 -0
- package/.agent/skills/frontend-developer/threejs/README.md +89 -0
- package/.agent/skills/frontend-developer/threejs/animation.md +552 -0
- package/.agent/skills/frontend-developer/threejs/fundamentals.md +488 -0
- package/.agent/skills/frontend-developer/threejs/geometry.md +548 -0
- package/.agent/skills/frontend-developer/threejs/interaction.md +660 -0
- package/.agent/skills/frontend-developer/threejs/lighting.md +481 -0
- package/.agent/skills/frontend-developer/threejs/loaders.md +623 -0
- package/.agent/skills/frontend-developer/threejs/materials.md +520 -0
- package/.agent/skills/frontend-developer/threejs/postprocessing.md +602 -0
- package/.agent/skills/frontend-developer/threejs/router.json +181 -0
- package/.agent/skills/frontend-developer/threejs/shaders.md +642 -0
- package/.agent/skills/frontend-developer/threejs/textures.md +628 -0
- package/.agent/skills/game-development/2d-games/SKILL.md +119 -0
- package/.agent/skills/game-development/3d-games/SKILL.md +135 -0
- package/.agent/skills/game-development/SKILL.md +167 -0
- package/.agent/skills/game-development/game-art/SKILL.md +185 -0
- package/.agent/skills/game-development/game-audio/SKILL.md +190 -0
- package/.agent/skills/game-development/game-design/SKILL.md +129 -0
- package/.agent/skills/game-development/mobile-games/SKILL.md +108 -0
- package/.agent/skills/game-development/multiplayer/SKILL.md +132 -0
- package/.agent/skills/game-development/pc-games/SKILL.md +144 -0
- package/.agent/skills/game-development/vr-ar/SKILL.md +123 -0
- package/.agent/skills/game-development/web-games/SKILL.md +150 -0
- package/.agent/skills/lead-architect/SKILL.md +85 -0
- package/.agent/skills/lead-architect/references/application-architecture.md +70 -0
- package/.agent/skills/lead-architect/references/infrastructure.md +51 -0
- package/.agent/skills/lead-architect/references/process.md +42 -0
- package/.agent/skills/lead-architect/references/system-architecture.md +62 -0
- package/.agent/skills/lead-architect/references/web-fullstack.md +82 -0
- package/.agent/skills/lead-architect/templates/adr.md +62 -0
- package/.agent/skills/lead-architect/templates/rfc.md +46 -0
- package/.agent/skills/lead-architect/templates/sdd.md +62 -0
- package/.agent/skills/lead-architect/templates/technical-spec.md +61 -0
- package/.agent/skills/marketer/SKILL.md +66 -0
- package/.agent/skills/marketer/remotion-best-practices/SKILL.md +58 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/3d.md +86 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/animations.md +29 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +108 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/assets.md +78 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/audio.md +172 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/calculate-metadata.md +104 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/can-decode.md +75 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/charts.md +58 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/compositions.md +146 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/display-captions.md +126 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/extract-frames.md +229 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/fonts.md +152 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/get-audio-duration.md +58 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/get-video-dimensions.md +68 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/get-video-duration.md +58 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/gifs.md +138 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/images.md +130 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/import-srt-captions.md +67 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/lottie.md +68 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/measuring-dom-nodes.md +35 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/measuring-text.md +143 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/sequencing.md +106 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/tailwind.md +11 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/text-animations.md +20 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/timing.md +179 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/transcribe-captions.md +19 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/transitions.md +122 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/trimming.md +53 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/videos.md +171 -0
- package/.agent/skills/mcp-builder/SKILL.md +76 -0
- package/.agent/skills/mcp-builder/references/evaluation.md +602 -0
- package/.agent/skills/mcp-builder/references/mcp_best_practices.md +249 -0
- package/.agent/skills/mcp-builder/references/node_mcp_server.md +970 -0
- package/.agent/skills/mcp-builder/references/python_mcp_server.md +719 -0
- package/.agent/skills/mobile-developer/SKILL.md +83 -0
- package/.agent/skills/mobile-developer/api-routes/SKILL.md +389 -0
- package/.agent/skills/mobile-developer/building-ui/SKILL.md +335 -0
- package/.agent/skills/mobile-developer/building-ui/references/animations.md +220 -0
- package/.agent/skills/mobile-developer/building-ui/references/controls.md +270 -0
- package/.agent/skills/mobile-developer/building-ui/references/form-sheet.md +227 -0
- package/.agent/skills/mobile-developer/building-ui/references/gradients.md +106 -0
- package/.agent/skills/mobile-developer/building-ui/references/icons.md +213 -0
- package/.agent/skills/mobile-developer/building-ui/references/media.md +198 -0
- package/.agent/skills/mobile-developer/building-ui/references/route-structure.md +229 -0
- package/.agent/skills/mobile-developer/building-ui/references/search.md +248 -0
- package/.agent/skills/mobile-developer/building-ui/references/storage.md +121 -0
- package/.agent/skills/mobile-developer/building-ui/references/tabs.md +368 -0
- package/.agent/skills/mobile-developer/building-ui/references/visual-effects.md +197 -0
- package/.agent/skills/mobile-developer/building-ui/references/webgpu-three.md +605 -0
- package/.agent/skills/mobile-developer/cicd-workflows/SKILL.md +107 -0
- package/.agent/skills/mobile-developer/cicd-workflows/scripts/fetch.js +109 -0
- package/.agent/skills/mobile-developer/cicd-workflows/scripts/package.json +11 -0
- package/.agent/skills/mobile-developer/cicd-workflows/scripts/validate.js +84 -0
- package/.agent/skills/mobile-developer/data-fetching/SKILL.md +508 -0
- package/.agent/skills/mobile-developer/deployment/SKILL.md +207 -0
- package/.agent/skills/mobile-developer/deployment/references/app-store-metadata.md +479 -0
- package/.agent/skills/mobile-developer/deployment/references/ios-app-store.md +355 -0
- package/.agent/skills/mobile-developer/deployment/references/play-store.md +246 -0
- package/.agent/skills/mobile-developer/deployment/references/testflight.md +58 -0
- package/.agent/skills/mobile-developer/deployment/references/workflows.md +200 -0
- package/.agent/skills/mobile-developer/dev-client/SKILL.md +181 -0
- package/.agent/skills/mobile-developer/tailwind-setup/SKILL.md +501 -0
- package/.agent/skills/mobile-developer/upgrading-expo/SKILL.md +116 -0
- package/.agent/skills/mobile-developer/upgrading-expo/references/new-architecture.md +79 -0
- package/.agent/skills/mobile-developer/upgrading-expo/references/react-19.md +79 -0
- package/.agent/skills/mobile-developer/upgrading-expo/references/react-compiler.md +59 -0
- package/.agent/skills/mobile-developer/use-dom/SKILL.md +434 -0
- package/.agent/skills/modern-python/SKILL.md +122 -0
- package/.agent/skills/project-manager/SKILL.md +110 -0
- package/.agent/skills/project-manager/references/ba-collaboration.md +62 -0
- package/.agent/skills/project-manager/references/discovery_process.md +52 -0
- package/.agent/skills/project-manager/references/jobs_to_be_done.md +51 -0
- package/.agent/skills/project-manager/references/prd_development.md +52 -0
- package/.agent/skills/project-manager/references/rules-guide.md +55 -0
- package/.agent/skills/project-manager/references/skill-creation.md +98 -0
- package/.agent/skills/project-manager/references/strategic-frameworks.md +62 -0
- package/.agent/skills/project-manager/references/task-decomposition.md +194 -0
- package/.agent/skills/project-manager/references/workflows-guide.md +44 -0
- package/.agent/skills/project-manager/router.json +160 -0
- package/.agent/skills/project-manager/scripts/compare_skill.py +177 -0
- package/.agent/skills/project-manager/scripts/encoding_utils.py +36 -0
- package/.agent/skills/project-manager/scripts/init_skill.py +190 -0
- package/.agent/skills/project-manager/scripts/quick_validate.py +123 -0
- package/.agent/skills/project-manager/templates/pm-strategy-one-pager.md +6 -0
- package/.agent/skills/project-manager/templates/prd-strategic.md +38 -0
- package/.agent/skills/project-manager/templates/skill-questionnaire.md +118 -0
- package/.agent/skills/project-manager/templates/user-story-simple.md +14 -0
- package/.agent/skills/prompt-engineer/SKILL.md +319 -0
- package/.agent/skills/prompt-engineer/skill-creator/README.md +47 -0
- package/.agent/skills/qa-tester/SKILL.md +142 -0
- package/.agent/skills/qa-tester/assets/README.md +8 -0
- package/.agent/skills/qa-tester/references/accessibility_testing.md +35 -0
- package/.agent/skills/qa-tester/references/agent_browser.md +38 -0
- package/.agent/skills/qa-tester/references/automation/api_testing.md +23 -0
- package/.agent/skills/qa-tester/references/automation/best_practices.md +14 -0
- package/.agent/skills/qa-tester/references/automation/jest_vitest.md +26 -0
- package/.agent/skills/qa-tester/references/automation/playwright.md +30 -0
- package/.agent/skills/qa-tester/references/e2e_testing.md +46 -0
- package/.agent/skills/qa-tester/references/integration_testing.md +39 -0
- package/.agent/skills/qa-tester/references/performance_testing.md +44 -0
- package/.agent/skills/qa-tester/references/property_based_testing.md +44 -0
- package/.agent/skills/qa-tester/references/security_audit.md +53 -0
- package/.agent/skills/qa-tester/references/security_testing.md +30 -0
- package/.agent/skills/qa-tester/references/sharp_edges.md +49 -0
- package/.agent/skills/qa-tester/references/static_analysis.md +52 -0
- package/.agent/skills/qa-tester/references/supply_chain_audit.md +54 -0
- package/.agent/skills/qa-tester/references/test_case_standards.md +96 -0
- package/.agent/skills/qa-tester/references/test_report_template.md +32 -0
- package/.agent/skills/qa-tester/references/unit_testing.md +50 -0
- package/.agent/skills/qa-tester/references/visual_testing.md +32 -0
- package/.agent/skills/qa-tester/templates/uat-plan.md +34 -0
- package/.agent/skills/research-first/SKILL.md +118 -0
- package/.agent/skills-manifest.json +264 -0
- package/.agent/workflows/absorb.md +176 -0
- package/.agent/workflows/bootstrap.md +91 -0
- package/.agent/workflows/brainstorm.md +168 -0
- package/.agent/workflows/break-tasks.md +77 -0
- package/.agent/workflows/commit.md +349 -0
- package/.agent/workflows/custom-behavior.md +64 -0
- package/.agent/workflows/debug.md +65 -0
- package/.agent/workflows/development.md +49 -0
- package/.agent/workflows/documentation.md +221 -0
- package/.agent/workflows/gen-tests.md +53 -0
- package/.agent/workflows/guide.md +196 -0
- package/.agent/workflows/implement-feature.md +182 -0
- package/.agent/workflows/install-skill.md +193 -0
- package/.agent/workflows/qa.md +54 -0
- package/.agent/workflows/ui-ux-design.md +108 -0
- package/LICENSE +21 -0
- package/README.md +258 -0
- package/cli/index.js +345 -0
- package/cli/migrate-skills.js +113 -0
- package/cli/verify.js +291 -0
- package/package.json +49 -0
|
@@ -0,0 +1,501 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tailwind-setup
|
|
3
|
+
description: >
|
|
4
|
+
Set up Tailwind CSS v4 in Expo with react-native-css and NativeWind v5 for universal styling
|
|
5
|
+
license: MIT
|
|
6
|
+
compatibility: Claude Code, Cursor, Gemini CLI, GitHub Copilot
|
|
7
|
+
metadata:
|
|
8
|
+
author: jhm1909
|
|
9
|
+
version: "2.0.0"
|
|
10
|
+
domain: mobile
|
|
11
|
+
estimated_tokens: 6000
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Tailwind CSS Setup for Expo
|
|
15
|
+
|
|
16
|
+
Universal styling with Tailwind v4, react-native-css, and NativeWind v5.
|
|
17
|
+
|
|
18
|
+
## Knowledge Graph
|
|
19
|
+
|
|
20
|
+
- **extends**: []
|
|
21
|
+
- **requires**: []
|
|
22
|
+
- **suggests**: []
|
|
23
|
+
- **conflicts**: []
|
|
24
|
+
- **enhances**: [[mobile-developer]], [[frontend-developer]], [[building-ui]]
|
|
25
|
+
- **moc**: [[mobile-development-moc]]
|
|
26
|
+
|
|
27
|
+
## Overview
|
|
28
|
+
|
|
29
|
+
# Tailwind CSS Setup for Expo with react-native-css
|
|
30
|
+
|
|
31
|
+
This guide covers setting up Tailwind CSS v4 in Expo using react-native-css and NativeWind v5 for universal styling across iOS, Android, and Web.
|
|
32
|
+
|
|
33
|
+
## Overview
|
|
34
|
+
|
|
35
|
+
This setup uses:
|
|
36
|
+
|
|
37
|
+
- **Tailwind CSS v4** - Modern CSS-first configuration
|
|
38
|
+
- **react-native-css** - CSS runtime for React Native
|
|
39
|
+
- **NativeWind v5** - Metro transformer for Tailwind in React Native
|
|
40
|
+
- **@tailwindcss/postcss** - PostCSS plugin for Tailwind v4
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Install dependencies
|
|
46
|
+
npx expo install tailwindcss@^4 nativewind@5.0.0-preview.2 react-native-css@0.0.0-nightly.5ce6396 @tailwindcss/postcss tailwind-merge clsx
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Add resolutions for lightningcss compatibility:
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
// package.json
|
|
53
|
+
{
|
|
54
|
+
"resolutions": {
|
|
55
|
+
"lightningcss": "1.30.1"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
- autoprefixer is not needed in Expo because of lightningcss
|
|
61
|
+
- postcss is included in expo by default
|
|
62
|
+
|
|
63
|
+
## Configuration Files
|
|
64
|
+
|
|
65
|
+
### Metro Config
|
|
66
|
+
|
|
67
|
+
Create or update `metro.config.js`:
|
|
68
|
+
|
|
69
|
+
```js
|
|
70
|
+
// metro.config.js
|
|
71
|
+
const { getDefaultConfig } = require("expo/metro-config");
|
|
72
|
+
const { withNativewind } = require("nativewind/metro");
|
|
73
|
+
|
|
74
|
+
/** @type {import('expo/metro-config').MetroConfig} */
|
|
75
|
+
const config = getDefaultConfig(__dirname);
|
|
76
|
+
|
|
77
|
+
module.exports = withNativewind(config, {
|
|
78
|
+
// inline variables break PlatformColor in CSS variables
|
|
79
|
+
inlineVariables: false,
|
|
80
|
+
// We add className support manually
|
|
81
|
+
globalClassNamePolyfill: false,
|
|
82
|
+
});
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### PostCSS Config
|
|
86
|
+
|
|
87
|
+
Create `postcss.config.mjs`:
|
|
88
|
+
|
|
89
|
+
```js
|
|
90
|
+
// postcss.config.mjs
|
|
91
|
+
export default {
|
|
92
|
+
plugins: {
|
|
93
|
+
"@tailwindcss/postcss": {},
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Global CSS
|
|
99
|
+
|
|
100
|
+
Create `src/global.css`:
|
|
101
|
+
|
|
102
|
+
```css
|
|
103
|
+
@import "tailwindcss/theme.css" layer(theme);
|
|
104
|
+
@import "tailwindcss/preflight.css" layer(base);
|
|
105
|
+
@import "tailwindcss/utilities.css";
|
|
106
|
+
|
|
107
|
+
/* Platform-specific font families */
|
|
108
|
+
@media android {
|
|
109
|
+
:root {
|
|
110
|
+
--font-mono: monospace;
|
|
111
|
+
--font-rounded: normal;
|
|
112
|
+
--font-serif: serif;
|
|
113
|
+
--font-sans: normal;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@media ios {
|
|
118
|
+
:root {
|
|
119
|
+
--font-mono: ui-monospace;
|
|
120
|
+
--font-serif: ui-serif;
|
|
121
|
+
--font-sans: system-ui;
|
|
122
|
+
--font-rounded: ui-rounded;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## IMPORTANT: No Babel Config Needed
|
|
128
|
+
|
|
129
|
+
With Tailwind v4 and NativeWind v5, you do NOT need a babel.config.js for Tailwind. Remove any NativeWind babel presets if present:
|
|
130
|
+
|
|
131
|
+
```js
|
|
132
|
+
// DELETE babel.config.js if it only contains NativeWind config
|
|
133
|
+
// The following is NO LONGER needed:
|
|
134
|
+
// module.exports = function (api) {
|
|
135
|
+
// api.cache(true);
|
|
136
|
+
// return {
|
|
137
|
+
// presets: [
|
|
138
|
+
// ["babel-preset-expo", { jsxImportSource: "nativewind" }],
|
|
139
|
+
// "nativewind/babel",
|
|
140
|
+
// ],
|
|
141
|
+
// };
|
|
142
|
+
// };
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## CSS Component Wrappers
|
|
146
|
+
|
|
147
|
+
Since react-native-css requires explicit CSS element wrapping, create reusable components:
|
|
148
|
+
|
|
149
|
+
### Main Components (`src/tw/index.tsx`)
|
|
150
|
+
|
|
151
|
+
```tsx
|
|
152
|
+
import {
|
|
153
|
+
useCssElement,
|
|
154
|
+
useNativeVariable as useFunctionalVariable,
|
|
155
|
+
} from "react-native-css";
|
|
156
|
+
|
|
157
|
+
import { Link as RouterLink } from "expo-router";
|
|
158
|
+
import Animated from "react-native-reanimated";
|
|
159
|
+
import React from "react";
|
|
160
|
+
import {
|
|
161
|
+
View as RNView,
|
|
162
|
+
Text as RNText,
|
|
163
|
+
Pressable as RNPressable,
|
|
164
|
+
ScrollView as RNScrollView,
|
|
165
|
+
TouchableHighlight as RNTouchableHighlight,
|
|
166
|
+
TextInput as RNTextInput,
|
|
167
|
+
StyleSheet,
|
|
168
|
+
} from "react-native";
|
|
169
|
+
|
|
170
|
+
// CSS-enabled Link
|
|
171
|
+
export const Link = (
|
|
172
|
+
props: React.ComponentProps<typeof RouterLink> & { className?: string }
|
|
173
|
+
) => {
|
|
174
|
+
return useCssElement(RouterLink, props, { className: "style" });
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
Link.Trigger = RouterLink.Trigger;
|
|
178
|
+
Link.Menu = RouterLink.Menu;
|
|
179
|
+
Link.MenuAction = RouterLink.MenuAction;
|
|
180
|
+
Link.Preview = RouterLink.Preview;
|
|
181
|
+
|
|
182
|
+
// CSS Variable hook
|
|
183
|
+
export const useCSSVariable =
|
|
184
|
+
process.env.EXPO_OS !== "web"
|
|
185
|
+
? useFunctionalVariable
|
|
186
|
+
: (variable: string) => `var(${variable})`;
|
|
187
|
+
|
|
188
|
+
// View
|
|
189
|
+
export type ViewProps = React.ComponentProps<typeof RNView> & {
|
|
190
|
+
className?: string;
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
export const View = (props: ViewProps) => {
|
|
194
|
+
return useCssElement(RNView, props, { className: "style" });
|
|
195
|
+
};
|
|
196
|
+
View.displayName = "CSS(View)";
|
|
197
|
+
|
|
198
|
+
// Text
|
|
199
|
+
export const Text = (
|
|
200
|
+
props: React.ComponentProps<typeof RNText> & { className?: string }
|
|
201
|
+
) => {
|
|
202
|
+
return useCssElement(RNText, props, { className: "style" });
|
|
203
|
+
};
|
|
204
|
+
Text.displayName = "CSS(Text)";
|
|
205
|
+
|
|
206
|
+
// ScrollView
|
|
207
|
+
export const ScrollView = (
|
|
208
|
+
props: React.ComponentProps<typeof RNScrollView> & {
|
|
209
|
+
className?: string;
|
|
210
|
+
contentContainerClassName?: string;
|
|
211
|
+
}
|
|
212
|
+
) => {
|
|
213
|
+
return useCssElement(RNScrollView, props, {
|
|
214
|
+
className: "style",
|
|
215
|
+
contentContainerClassName: "contentContainerStyle",
|
|
216
|
+
});
|
|
217
|
+
};
|
|
218
|
+
ScrollView.displayName = "CSS(ScrollView)";
|
|
219
|
+
|
|
220
|
+
// Pressable
|
|
221
|
+
export const Pressable = (
|
|
222
|
+
props: React.ComponentProps<typeof RNPressable> & { className?: string }
|
|
223
|
+
) => {
|
|
224
|
+
return useCssElement(RNPressable, props, { className: "style" });
|
|
225
|
+
};
|
|
226
|
+
Pressable.displayName = "CSS(Pressable)";
|
|
227
|
+
|
|
228
|
+
// TextInput
|
|
229
|
+
export const TextInput = (
|
|
230
|
+
props: React.ComponentProps<typeof RNTextInput> & { className?: string }
|
|
231
|
+
) => {
|
|
232
|
+
return useCssElement(RNTextInput, props, { className: "style" });
|
|
233
|
+
};
|
|
234
|
+
TextInput.displayName = "CSS(TextInput)";
|
|
235
|
+
|
|
236
|
+
// AnimatedScrollView
|
|
237
|
+
export const AnimatedScrollView = (
|
|
238
|
+
props: React.ComponentProps<typeof Animated.ScrollView> & {
|
|
239
|
+
className?: string;
|
|
240
|
+
contentClassName?: string;
|
|
241
|
+
contentContainerClassName?: string;
|
|
242
|
+
}
|
|
243
|
+
) => {
|
|
244
|
+
return useCssElement(Animated.ScrollView, props, {
|
|
245
|
+
className: "style",
|
|
246
|
+
contentClassName: "contentContainerStyle",
|
|
247
|
+
contentContainerClassName: "contentContainerStyle",
|
|
248
|
+
});
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
// TouchableHighlight with underlayColor extraction
|
|
252
|
+
function XXTouchableHighlight(
|
|
253
|
+
props: React.ComponentProps<typeof RNTouchableHighlight>
|
|
254
|
+
) {
|
|
255
|
+
const { underlayColor, ...style } = StyleSheet.flatten(props.style) || {};
|
|
256
|
+
return (
|
|
257
|
+
<RNTouchableHighlight
|
|
258
|
+
underlayColor={underlayColor}
|
|
259
|
+
{...props}
|
|
260
|
+
style={style}
|
|
261
|
+
/>
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export const TouchableHighlight = (
|
|
266
|
+
props: React.ComponentProps<typeof RNTouchableHighlight>
|
|
267
|
+
) => {
|
|
268
|
+
return useCssElement(XXTouchableHighlight, props, { className: "style" });
|
|
269
|
+
};
|
|
270
|
+
TouchableHighlight.displayName = "CSS(TouchableHighlight)";
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Image Component (`src/tw/image.tsx`)
|
|
274
|
+
|
|
275
|
+
```tsx
|
|
276
|
+
import { useCssElement } from "react-native-css";
|
|
277
|
+
import React from "react";
|
|
278
|
+
import { StyleSheet } from "react-native";
|
|
279
|
+
import Animated from "react-native-reanimated";
|
|
280
|
+
import { Image as RNImage } from "expo-image";
|
|
281
|
+
|
|
282
|
+
const AnimatedExpoImage = Animated.createAnimatedComponent(RNImage);
|
|
283
|
+
|
|
284
|
+
export type ImageProps = React.ComponentProps<typeof Image>;
|
|
285
|
+
|
|
286
|
+
function CSSImage(props: React.ComponentProps<typeof AnimatedExpoImage>) {
|
|
287
|
+
// @ts-expect-error: Remap objectFit style to contentFit property
|
|
288
|
+
const { objectFit, objectPosition, ...style } =
|
|
289
|
+
StyleSheet.flatten(props.style) || {};
|
|
290
|
+
|
|
291
|
+
return (
|
|
292
|
+
<AnimatedExpoImage
|
|
293
|
+
contentFit={objectFit}
|
|
294
|
+
contentPosition={objectPosition}
|
|
295
|
+
{...props}
|
|
296
|
+
source={
|
|
297
|
+
typeof props.source === "string" ? { uri: props.source } : props.source
|
|
298
|
+
}
|
|
299
|
+
// @ts-expect-error: Style is remapped above
|
|
300
|
+
style={style}
|
|
301
|
+
/>
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export const Image = (
|
|
306
|
+
props: React.ComponentProps<typeof CSSImage> & { className?: string }
|
|
307
|
+
) => {
|
|
308
|
+
return useCssElement(CSSImage, props, { className: "style" });
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
Image.displayName = "CSS(Image)";
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### Animated Components (`src/tw/animated.tsx`)
|
|
315
|
+
|
|
316
|
+
```tsx
|
|
317
|
+
import * as TW from "./index";
|
|
318
|
+
import RNAnimated from "react-native-reanimated";
|
|
319
|
+
|
|
320
|
+
export const Animated = {
|
|
321
|
+
...RNAnimated,
|
|
322
|
+
View: RNAnimated.createAnimatedComponent(TW.View),
|
|
323
|
+
};
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
## Usage
|
|
327
|
+
|
|
328
|
+
Import CSS-wrapped components from your tw directory:
|
|
329
|
+
|
|
330
|
+
```tsx
|
|
331
|
+
import { View, Text, ScrollView, Image } from "@/tw";
|
|
332
|
+
|
|
333
|
+
export default function MyScreen() {
|
|
334
|
+
return (
|
|
335
|
+
<ScrollView className="flex-1 bg-white">
|
|
336
|
+
<View className="p-4 gap-4">
|
|
337
|
+
<Text className="text-xl font-bold text-gray-900">Hello Tailwind!</Text>
|
|
338
|
+
<Image
|
|
339
|
+
className="w-full h-48 rounded-lg object-cover"
|
|
340
|
+
source={{ uri: "https://example.com/image.jpg" }}
|
|
341
|
+
/>
|
|
342
|
+
</View>
|
|
343
|
+
</ScrollView>
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
## Custom Theme Variables
|
|
349
|
+
|
|
350
|
+
Add custom theme variables in your global.css using `@theme`:
|
|
351
|
+
|
|
352
|
+
```css
|
|
353
|
+
@layer theme {
|
|
354
|
+
@theme {
|
|
355
|
+
/* Custom fonts */
|
|
356
|
+
--font-rounded: "SF Pro Rounded", sans-serif;
|
|
357
|
+
|
|
358
|
+
/* Custom line heights */
|
|
359
|
+
--text-xs--line-height: calc(1em / 0.75);
|
|
360
|
+
--text-sm--line-height: calc(1.25em / 0.875);
|
|
361
|
+
--text-base--line-height: calc(1.5em / 1);
|
|
362
|
+
|
|
363
|
+
/* Custom leading scales */
|
|
364
|
+
--leading-tight: 1.25em;
|
|
365
|
+
--leading-snug: 1.375em;
|
|
366
|
+
--leading-normal: 1.5em;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
## Platform-Specific Styles
|
|
372
|
+
|
|
373
|
+
Use platform media queries for platform-specific styling:
|
|
374
|
+
|
|
375
|
+
```css
|
|
376
|
+
@media ios {
|
|
377
|
+
:root {
|
|
378
|
+
--font-sans: system-ui;
|
|
379
|
+
--font-rounded: ui-rounded;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
@media android {
|
|
384
|
+
:root {
|
|
385
|
+
--font-sans: normal;
|
|
386
|
+
--font-rounded: normal;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
## Apple System Colors with CSS Variables
|
|
392
|
+
|
|
393
|
+
Create a CSS file for Apple semantic colors:
|
|
394
|
+
|
|
395
|
+
```css
|
|
396
|
+
/* src/css/sf.css */
|
|
397
|
+
@layer base {
|
|
398
|
+
html {
|
|
399
|
+
color-scheme: light;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
:root {
|
|
404
|
+
/* Accent colors with light/dark mode */
|
|
405
|
+
--sf-blue: light-dark(rgb(0 122 255), rgb(10 132 255));
|
|
406
|
+
--sf-green: light-dark(rgb(52 199 89), rgb(48 209 89));
|
|
407
|
+
--sf-red: light-dark(rgb(255 59 48), rgb(255 69 58));
|
|
408
|
+
|
|
409
|
+
/* Gray scales */
|
|
410
|
+
--sf-gray: light-dark(rgb(142 142 147), rgb(142 142 147));
|
|
411
|
+
--sf-gray-2: light-dark(rgb(174 174 178), rgb(99 99 102));
|
|
412
|
+
|
|
413
|
+
/* Text colors */
|
|
414
|
+
--sf-text: light-dark(rgb(0 0 0), rgb(255 255 255));
|
|
415
|
+
--sf-text-2: light-dark(rgb(60 60 67 / 0.6), rgb(235 235 245 / 0.6));
|
|
416
|
+
|
|
417
|
+
/* Background colors */
|
|
418
|
+
--sf-bg: light-dark(rgb(255 255 255), rgb(0 0 0));
|
|
419
|
+
--sf-bg-2: light-dark(rgb(242 242 247), rgb(28 28 30));
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/* iOS native colors via platformColor */
|
|
423
|
+
@media ios {
|
|
424
|
+
:root {
|
|
425
|
+
--sf-blue: platformColor(systemBlue);
|
|
426
|
+
--sf-green: platformColor(systemGreen);
|
|
427
|
+
--sf-red: platformColor(systemRed);
|
|
428
|
+
--sf-gray: platformColor(systemGray);
|
|
429
|
+
--sf-text: platformColor(label);
|
|
430
|
+
--sf-text-2: platformColor(secondaryLabel);
|
|
431
|
+
--sf-bg: platformColor(systemBackground);
|
|
432
|
+
--sf-bg-2: platformColor(secondarySystemBackground);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/* Register as Tailwind theme colors */
|
|
437
|
+
@layer theme {
|
|
438
|
+
@theme {
|
|
439
|
+
--color-sf-blue: var(--sf-blue);
|
|
440
|
+
--color-sf-green: var(--sf-green);
|
|
441
|
+
--color-sf-red: var(--sf-red);
|
|
442
|
+
--color-sf-gray: var(--sf-gray);
|
|
443
|
+
--color-sf-text: var(--sf-text);
|
|
444
|
+
--color-sf-text-2: var(--sf-text-2);
|
|
445
|
+
--color-sf-bg: var(--sf-bg);
|
|
446
|
+
--color-sf-bg-2: var(--sf-bg-2);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
Then use in components:
|
|
452
|
+
|
|
453
|
+
```tsx
|
|
454
|
+
<Text className="text-sf-text">Primary text</Text>
|
|
455
|
+
<Text className="text-sf-text-2">Secondary text</Text>
|
|
456
|
+
<View className="bg-sf-bg">...</View>
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
## Using CSS Variables in JavaScript
|
|
460
|
+
|
|
461
|
+
Use the `useCSSVariable` hook:
|
|
462
|
+
|
|
463
|
+
```tsx
|
|
464
|
+
import { useCSSVariable } from "@/tw";
|
|
465
|
+
|
|
466
|
+
function MyComponent() {
|
|
467
|
+
const blue = useCSSVariable("--sf-blue");
|
|
468
|
+
|
|
469
|
+
return <View style={{ borderColor: blue }} />;
|
|
470
|
+
}
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
## Key Differences from NativeWind v4 / Tailwind v3
|
|
474
|
+
|
|
475
|
+
1. **No babel.config.js** - Configuration is now CSS-first
|
|
476
|
+
2. **PostCSS plugin** - Uses `@tailwindcss/postcss` instead of `tailwindcss`
|
|
477
|
+
3. **CSS imports** - Use `@import "tailwindcss/..."` instead of `@tailwind` directives
|
|
478
|
+
4. **Theme config** - Use `@theme` in CSS instead of `tailwind.config.js`
|
|
479
|
+
5. **Component wrappers** - Must wrap components with `useCssElement` for className support
|
|
480
|
+
6. **Metro config** - Use `withNativewind` with different options (`inlineVariables: false`)
|
|
481
|
+
|
|
482
|
+
## Troubleshooting
|
|
483
|
+
|
|
484
|
+
### Styles not applying
|
|
485
|
+
|
|
486
|
+
1. Ensure you have the CSS file imported in your app entry
|
|
487
|
+
2. Check that components are wrapped with `useCssElement`
|
|
488
|
+
3. Verify Metro config has `withNativewind` applied
|
|
489
|
+
|
|
490
|
+
### Platform colors not working
|
|
491
|
+
|
|
492
|
+
1. Use `platformColor()` in `@media ios` blocks
|
|
493
|
+
2. Fall back to `light-dark()` for web/Android
|
|
494
|
+
|
|
495
|
+
### TypeScript errors
|
|
496
|
+
|
|
497
|
+
Add className to component props:
|
|
498
|
+
|
|
499
|
+
```tsx
|
|
500
|
+
type Props = React.ComponentProps<typeof RNView> & { className?: string };
|
|
501
|
+
```
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: upgrading-expo
|
|
3
|
+
description: >
|
|
4
|
+
Guidelines for upgrading Expo SDK versions and fixing dependency issues
|
|
5
|
+
license: MIT
|
|
6
|
+
compatibility: Claude Code, Cursor, Gemini CLI, GitHub Copilot
|
|
7
|
+
metadata:
|
|
8
|
+
author: jhm1909
|
|
9
|
+
version: "2.0.0"
|
|
10
|
+
domain: mobile
|
|
11
|
+
estimated_tokens: 2500
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Upgrading Expo
|
|
15
|
+
|
|
16
|
+
## Knowledge Graph
|
|
17
|
+
|
|
18
|
+
- **extends**: [[mobile-developer]]
|
|
19
|
+
- **requires**: []
|
|
20
|
+
- **suggests**: []
|
|
21
|
+
- **conflicts**: []
|
|
22
|
+
- **enhances**: []
|
|
23
|
+
- **moc**: [[mobile-development-moc]]
|
|
24
|
+
|
|
25
|
+
## References
|
|
26
|
+
|
|
27
|
+
- ./references/new-architecture.md -- SDK +53: New Architecture migration guide
|
|
28
|
+
- ./references/react-19.md -- SDK +54: React 19 changes (useContext → use, Context.Provider → Context, forwardRef removal)
|
|
29
|
+
- ./references/react-compiler.md -- SDK +54: React Compiler setup and migration guide
|
|
30
|
+
|
|
31
|
+
## Step-by-Step Upgrade Process
|
|
32
|
+
|
|
33
|
+
1. Upgrade Expo and dependencies
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npx expo install expo@latest
|
|
37
|
+
npx expo install --fix
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
2. Run diagnostics: `npx expo-doctor`
|
|
41
|
+
|
|
42
|
+
3. Clear caches and reinstall
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx expo export -p ios --clear
|
|
46
|
+
rm -rf node_modules .expo
|
|
47
|
+
watchman watch-del-all
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Breaking Changes Checklist
|
|
51
|
+
|
|
52
|
+
- Check for removed APIs in release notes
|
|
53
|
+
- Update import paths for moved modules
|
|
54
|
+
- Review native module changes requiring prebuild
|
|
55
|
+
- Test all camera, audio, and video features
|
|
56
|
+
- Verify navigation still works correctly
|
|
57
|
+
|
|
58
|
+
## Prebuild for Native Changes
|
|
59
|
+
|
|
60
|
+
If upgrading requires native changes:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npx expo prebuild --clean
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
This regenerates the `ios` and `android` directories. Ensure the project is not a bare workflow app before running this command.
|
|
67
|
+
|
|
68
|
+
## Clear caches for bare workflow
|
|
69
|
+
|
|
70
|
+
- Clear the cocoapods cache for iOS: `cd ios && pod install --repo-update`
|
|
71
|
+
- Clear derived data for Xcode: `npx expo run:ios --no-build-cache`
|
|
72
|
+
- Clear the Gradle cache for Android: `cd android && ./gradlew clean`
|
|
73
|
+
|
|
74
|
+
## Housekeeping
|
|
75
|
+
|
|
76
|
+
- Review release notes for the target SDK version at https://expo.dev/changelog
|
|
77
|
+
- If using Expo SDK 54 or later, ensure react-native-worklets is installed — this is required for react-native-reanimated to work.
|
|
78
|
+
- Enable React Compiler in SDK 54+ by adding `"experiments": { "reactCompiler": true }` to app.json — it's stable and recommended
|
|
79
|
+
- Delete sdkVersion from `app.json` to let Expo manage it automatically
|
|
80
|
+
- Remove implicit packages from `package.json`: `@babel/core`, `babel-preset-expo`, `expo-constants`.
|
|
81
|
+
- If the babel.config.js only contains 'babel-preset-expo', delete the file
|
|
82
|
+
- If the metro.config.js only contains expo defaults, delete the file
|
|
83
|
+
|
|
84
|
+
## Deprecated Packages
|
|
85
|
+
|
|
86
|
+
| Old Package | Replacement |
|
|
87
|
+
| -------------------- | ---------------------------------------------------- |
|
|
88
|
+
| `expo-av` | `expo-audio` and `expo-video` |
|
|
89
|
+
| `expo-permissions` | Individual package permission APIs |
|
|
90
|
+
| `@expo/vector-icons` | `expo-symbols` (for SF Symbols) |
|
|
91
|
+
| `AsyncStorage` | `expo-sqlite/localStorage/install` |
|
|
92
|
+
| `expo-app-loading` | `expo-splash-screen` |
|
|
93
|
+
| expo-linear-gradient | experimental_backgroundImage + CSS gradients in View |
|
|
94
|
+
|
|
95
|
+
## Removing patches
|
|
96
|
+
|
|
97
|
+
Check if there are any outdated patches in the `patches/` directory. Remove them if they are no longer needed.
|
|
98
|
+
|
|
99
|
+
## Postcss
|
|
100
|
+
|
|
101
|
+
- `autoprefixer` isn't needed in SDK +53.
|
|
102
|
+
- Use `postcss.config.mjs` in SDK +53.
|
|
103
|
+
|
|
104
|
+
## Metro
|
|
105
|
+
|
|
106
|
+
Remove redundant metro config options:
|
|
107
|
+
|
|
108
|
+
- resolver.unstable_enablePackageExports is enabled by default in SDK +53.
|
|
109
|
+
- `experimentalImportSupport` is enabled by default in SDK +54.
|
|
110
|
+
- `EXPO_USE_FAST_RESOLVER=1` is removed in SDK +54.
|
|
111
|
+
- cjs and mjs extensions are supported by default in SDK +50.
|
|
112
|
+
- Expo webpack is deprecated, migrate to [Expo Router and Metro web](https://docs.expo.dev/router/migrate/from-expo-webpack/).
|
|
113
|
+
|
|
114
|
+
## New Architecture
|
|
115
|
+
|
|
116
|
+
The new architecture is enabled by default, the app.json field `"newArchEnabled": true` is no longer needed as it's the default. Expo Go only supports the new architecture as of SDK +53.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# New Architecture
|
|
2
|
+
|
|
3
|
+
The New Architecture is enabled by default in Expo SDK 53+. It replaces the legacy bridge with a faster, synchronous communication layer between JavaScript and native code.
|
|
4
|
+
|
|
5
|
+
## Documentation
|
|
6
|
+
|
|
7
|
+
Full guide: https://docs.expo.dev/guides/new-architecture/
|
|
8
|
+
|
|
9
|
+
## What Changed
|
|
10
|
+
|
|
11
|
+
- **JSI (JavaScript Interface)** — Direct synchronous calls between JS and native
|
|
12
|
+
- **Fabric** — New rendering system with concurrent features
|
|
13
|
+
- **TurboModules** — Lazy-loaded native modules with type safety
|
|
14
|
+
|
|
15
|
+
## SDK Compatibility
|
|
16
|
+
|
|
17
|
+
| SDK Version | New Architecture Status |
|
|
18
|
+
| ----------- | ----------------------- |
|
|
19
|
+
| SDK 53+ | Enabled by default |
|
|
20
|
+
| SDK 52 | Opt-in via app.json |
|
|
21
|
+
| SDK 51- | Experimental |
|
|
22
|
+
|
|
23
|
+
## Configuration
|
|
24
|
+
|
|
25
|
+
New Architecture is enabled by default. To explicitly disable (not recommended):
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"expo": {
|
|
30
|
+
"newArchEnabled": false
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Expo Go
|
|
36
|
+
|
|
37
|
+
Expo Go only supports the New Architecture as of SDK 53. Apps using the old architecture must use development builds.
|
|
38
|
+
|
|
39
|
+
## Common Migration Issues
|
|
40
|
+
|
|
41
|
+
### Native Module Compatibility
|
|
42
|
+
|
|
43
|
+
Some older native modules may not support the New Architecture. Check:
|
|
44
|
+
|
|
45
|
+
1. Module documentation for New Architecture support
|
|
46
|
+
2. GitHub issues for compatibility discussions
|
|
47
|
+
3. Consider alternatives if module is unmaintained
|
|
48
|
+
|
|
49
|
+
### Reanimated
|
|
50
|
+
|
|
51
|
+
React Native Reanimated requires `react-native-worklets` in SDK 54+:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npx expo install react-native-worklets
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Layout Animations
|
|
58
|
+
|
|
59
|
+
Some layout animations behave differently. Test thoroughly after upgrading.
|
|
60
|
+
|
|
61
|
+
## Verifying New Architecture
|
|
62
|
+
|
|
63
|
+
Check if New Architecture is active:
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
import { Platform } from "react-native";
|
|
67
|
+
|
|
68
|
+
// Returns true if Fabric is enabled
|
|
69
|
+
const isNewArch = global._IS_FABRIC !== undefined;
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Verify from the command line if the currently running app uses the New Architecture: `bunx xcobra expo eval "_IS_FABRIC"` -> `true`
|
|
73
|
+
|
|
74
|
+
## Troubleshooting
|
|
75
|
+
|
|
76
|
+
1. **Clear caches** — `npx expo start --clear`
|
|
77
|
+
2. **Clean prebuild** — `npx expo prebuild --clean`
|
|
78
|
+
3. **Check native modules** — Ensure all dependencies support New Architecture
|
|
79
|
+
4. **Review console warnings** — Legacy modules log compatibility warnings
|