@skyroc/scripts 2.5.0 → 2.5.2
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/README.md +6 -3
- package/dist/cli.mjs +2 -2
- package/dist/{config-BKkdncJS.mjs → config-Cj9IzlRz.mjs} +105 -5
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/templates/admin/package.json +5 -3
- package/templates/admin/src/assets/svg-icon/logo.svg +2 -14
- package/templates/admin/src/features/router/routeTree.gen.ts +71 -1
- package/templates/admin/src/pages/(auth)/login/code-login.tsx +79 -0
- package/templates/admin/src/pages/(auth)/login/index.tsx +22 -1
- package/templates/admin/src/pages/(auth)/login/layout.tsx +25 -23
- package/templates/admin/src/pages/(auth)/login/modules/Header.tsx +25 -0
- package/templates/admin/src/pages/(auth)/login/register.tsx +86 -0
- package/templates/admin/src/pages/(auth)/login/reset-pwd.tsx +73 -0
- package/templates/admin/uno.config.ts +1 -1
- package/templates/admin-root/.agents/skills/component-doc/SKILL.md +304 -0
- package/templates/admin-root/.agents/skills/component-refactoring/SKILL.md +483 -0
- package/templates/admin-root/.agents/skills/component-refactoring/references/complexity-patterns.md +493 -0
- package/templates/admin-root/.agents/skills/component-refactoring/references/component-splitting.md +477 -0
- package/templates/admin-root/.agents/skills/component-refactoring/references/hook-extraction.md +317 -0
- package/templates/admin-root/.agents/skills/doc-coauthoring/SKILL.md +375 -0
- package/templates/admin-root/.agents/skills/feature-dev/SKILL.md +78 -0
- package/templates/admin-root/.agents/skills/frontend-code-review/SKILL.md +73 -0
- package/templates/admin-root/.agents/skills/frontend-code-review/references/business-logic.md +15 -0
- package/templates/admin-root/.agents/skills/frontend-code-review/references/code-quality.md +44 -0
- package/templates/admin-root/.agents/skills/frontend-code-review/references/performance.md +45 -0
- package/templates/admin-root/.agents/skills/frontend-design/LICENSE.txt +177 -0
- package/templates/admin-root/.agents/skills/frontend-design/SKILL.md +42 -0
- package/templates/admin-root/.agents/skills/frontend-testing/SKILL.md +325 -0
- package/templates/admin-root/.agents/skills/frontend-testing/assets/component-test.template.tsx +293 -0
- package/templates/admin-root/.agents/skills/frontend-testing/assets/hook-test.template.ts +207 -0
- package/templates/admin-root/.agents/skills/frontend-testing/assets/utility-test.template.ts +154 -0
- package/templates/admin-root/.agents/skills/frontend-testing/references/async-testing.md +345 -0
- package/templates/admin-root/.agents/skills/frontend-testing/references/checklist.md +205 -0
- package/templates/admin-root/.agents/skills/frontend-testing/references/common-patterns.md +449 -0
- package/templates/admin-root/.agents/skills/frontend-testing/references/domain-components.md +523 -0
- package/templates/admin-root/.agents/skills/frontend-testing/references/mocking.md +512 -0
- package/templates/admin-root/.agents/skills/frontend-testing/references/workflow.md +269 -0
- package/templates/admin-root/.agents/skills/migrate-nativewind-to-uniwind/SKILL.md +734 -0
- package/templates/admin-root/.agents/skills/migrate-oxfmt/SKILL.md +202 -0
- package/templates/admin-root/.agents/skills/migrate-oxlint/SKILL.md +196 -0
- package/templates/admin-root/.agents/skills/native-component-doc/SKILL.md +245 -0
- package/templates/admin-root/.agents/skills/senior-frontend/SKILL.md +209 -0
- package/templates/admin-root/.agents/skills/senior-frontend/references/frontend_best_practices.md +103 -0
- package/templates/admin-root/.agents/skills/senior-frontend/references/nextjs_optimization_guide.md +103 -0
- package/templates/admin-root/.agents/skills/senior-frontend/references/react_patterns.md +103 -0
- package/templates/admin-root/.agents/skills/senior-frontend/scripts/bundle_analyzer.py +114 -0
- package/templates/admin-root/.agents/skills/senior-frontend/scripts/component_generator.py +114 -0
- package/templates/admin-root/.agents/skills/senior-frontend/scripts/frontend_scaffolder.py +114 -0
- package/templates/admin-root/.agents/skills/skill-creator/SKILL.md +355 -0
- package/templates/admin-root/.agents/skills/skill-creator/references/output-patterns.md +86 -0
- package/templates/admin-root/.agents/skills/skill-creator/references/workflows.md +28 -0
- package/templates/admin-root/.agents/skills/skill-creator/scripts/init_skill.py +300 -0
- package/templates/admin-root/.agents/skills/skill-creator/scripts/package_skill.py +110 -0
- package/templates/admin-root/.agents/skills/skill-creator/scripts/quick_validate.py +97 -0
- package/templates/admin-root/.agents/skills/skyroc-admin-prd-prototype/SKILL.md +163 -0
- package/templates/admin-root/.agents/skills/skyroc-admin-prd-prototype/references/acceptance-checklist.md +75 -0
- package/templates/admin-root/.agents/skills/skyroc-admin-prd-prototype/references/evidence-order.md +109 -0
- package/templates/admin-root/.agents/skills/skyroc-admin-prd-prototype/references/prd-rules.md +103 -0
- package/templates/admin-root/.agents/skills/skyroc-admin-prd-prototype/references/prototype-rules.md +85 -0
- package/templates/admin-root/.agents/skills/skyroc-admin-prd-prototype/scripts/verify-prototypes.mjs +144 -0
- package/templates/admin-root/.agents/skills/skyroc-admin-prd-prototype/templates/admin-page.html +771 -0
- package/templates/admin-root/.agents/skills/skyroc-admin-prd-prototype/templates/prd.md +182 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/SKILL.md +292 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/styles.csv +68 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/templates/admin-root/.agents/skills/ui-ux-pro-max/scripts/search.py +114 -0
- package/templates/admin-root/.agents/skills/uniwind/SKILL.md +64 -0
- package/templates/admin-root/.agents/skills/uniwind/references/component-bindings.md +338 -0
- package/templates/admin-root/.agents/skills/uniwind/references/css-and-utilities.md +325 -0
- package/templates/admin-root/.agents/skills/uniwind/references/integrations.md +75 -0
- package/templates/admin-root/.agents/skills/uniwind/references/pro.md +354 -0
- package/templates/admin-root/.agents/skills/uniwind/references/setup.md +144 -0
- package/templates/admin-root/.agents/skills/uniwind/references/styling-patterns.md +237 -0
- package/templates/admin-root/.agents/skills/uniwind/references/theming.md +309 -0
- package/templates/admin-root/.agents/skills/uniwind/references/troubleshooting.md +179 -0
- package/templates/admin-root/.agents/skills/uniwind/references/variants-and-selectors.md +224 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/AGENTS.md +2934 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/SKILL.md +136 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/async-defer-await.md +80 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/templates/admin-root/.agents/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
- package/templates/admin-root/.claude/settings.json +5 -0
- package/templates/admin-root/.claude/skills/component-doc/SKILL.md +304 -0
- package/templates/admin-root/.claude/skills/component-refactoring/SKILL.md +483 -0
- package/templates/admin-root/.claude/skills/component-refactoring/references/complexity-patterns.md +493 -0
- package/templates/admin-root/.claude/skills/component-refactoring/references/component-splitting.md +477 -0
- package/templates/admin-root/.claude/skills/component-refactoring/references/hook-extraction.md +317 -0
- package/templates/admin-root/.claude/skills/doc-coauthoring/SKILL.md +375 -0
- package/templates/admin-root/.claude/skills/feature-dev/SKILL.md +78 -0
- package/templates/admin-root/.claude/skills/frontend-code-review/SKILL.md +73 -0
- package/templates/admin-root/.claude/skills/frontend-code-review/references/business-logic.md +15 -0
- package/templates/admin-root/.claude/skills/frontend-code-review/references/code-quality.md +44 -0
- package/templates/admin-root/.claude/skills/frontend-code-review/references/performance.md +45 -0
- package/templates/admin-root/.claude/skills/frontend-design/LICENSE.txt +177 -0
- package/templates/admin-root/.claude/skills/frontend-design/SKILL.md +42 -0
- package/templates/admin-root/.claude/skills/frontend-testing/SKILL.md +325 -0
- package/templates/admin-root/.claude/skills/frontend-testing/assets/component-test.template.tsx +293 -0
- package/templates/admin-root/.claude/skills/frontend-testing/assets/hook-test.template.ts +207 -0
- package/templates/admin-root/.claude/skills/frontend-testing/assets/utility-test.template.ts +154 -0
- package/templates/admin-root/.claude/skills/frontend-testing/references/async-testing.md +345 -0
- package/templates/admin-root/.claude/skills/frontend-testing/references/checklist.md +205 -0
- package/templates/admin-root/.claude/skills/frontend-testing/references/common-patterns.md +449 -0
- package/templates/admin-root/.claude/skills/frontend-testing/references/domain-components.md +523 -0
- package/templates/admin-root/.claude/skills/frontend-testing/references/mocking.md +512 -0
- package/templates/admin-root/.claude/skills/frontend-testing/references/workflow.md +269 -0
- package/templates/admin-root/.claude/skills/migrate-nativewind-to-uniwind +1 -0
- package/templates/admin-root/.claude/skills/native-component-doc/SKILL.md +245 -0
- package/templates/admin-root/.claude/skills/senior-frontend/SKILL.md +209 -0
- package/templates/admin-root/.claude/skills/senior-frontend/references/frontend_best_practices.md +103 -0
- package/templates/admin-root/.claude/skills/senior-frontend/references/nextjs_optimization_guide.md +103 -0
- package/templates/admin-root/.claude/skills/senior-frontend/references/react_patterns.md +103 -0
- package/templates/admin-root/.claude/skills/senior-frontend/scripts/bundle_analyzer.py +114 -0
- package/templates/admin-root/.claude/skills/senior-frontend/scripts/component_generator.py +114 -0
- package/templates/admin-root/.claude/skills/senior-frontend/scripts/frontend_scaffolder.py +114 -0
- package/templates/admin-root/.claude/skills/skill-creator/SKILL.md +355 -0
- package/templates/admin-root/.claude/skills/skill-creator/references/output-patterns.md +86 -0
- package/templates/admin-root/.claude/skills/skill-creator/references/workflows.md +28 -0
- package/templates/admin-root/.claude/skills/skill-creator/scripts/init_skill.py +300 -0
- package/templates/admin-root/.claude/skills/skill-creator/scripts/package_skill.py +110 -0
- package/templates/admin-root/.claude/skills/skill-creator/scripts/quick_validate.py +97 -0
- package/templates/admin-root/.claude/skills/ui-ux-pro-max/SKILL.md +386 -0
- package/templates/admin-root/.claude/skills/ui-ux-pro-max/data +1 -0
- package/templates/admin-root/.claude/skills/ui-ux-pro-max/scripts +1 -0
- package/templates/admin-root/.claude/skills/uniwind +1 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/AGENTS.md +2934 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/SKILL.md +136 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/async-defer-await.md +80 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/templates/admin-root/.claude/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
- package/templates/admin-root/.cursor/settings.json +10 -0
- package/templates/admin-root/.editorconfig +19 -0
- package/templates/admin-root/.gitattributes +16 -0
- package/templates/admin-root/.oxfmtrc.json +35 -0
- package/templates/admin-root/AGENTS.md +297 -0
- package/templates/admin-root/CLAUDE.md +1 -0
- package/templates/admin-root/skills-lock.json +27 -0
- package/templates/admin-root.manifest.json +1317 -0
- package/templates/admin-shell/theme/antd/AntdProvider.tsx +1 -0
- package/templates/admin-shell/theme/antd/shared.ts +3 -3
- package/templates/admin-shell/theme/antd-algorithm/algorithm/dark/colors.ts +3 -3
- package/templates/admin-shell/theme/antd-algorithm/algorithm/default/colors.ts +1 -1
- package/templates/admin-shell/theme/presets/default.json +1 -1
- package/templates/admin.meta.json +10 -6
- package/LICENSE +0 -21
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
## Uniwind Pro
|
|
2
|
+
|
|
3
|
+
Paid upgrade with 100% API compatibility. Built on a 2nd-generation C++ engine for apps that demand the best performance. Graduated pricing (billed annually): **$99/seat** (1-3), **$49** (4-6), **$29** (7-15), **$1** (16+). Pricing and licensing: [https://uniwind.dev/pricing](https://uniwind.dev/pricing)
|
|
4
|
+
|
|
5
|
+
### Pricing & Licensing
|
|
6
|
+
|
|
7
|
+
- **Graduated per-seat pricing** (billed annually, VAT excluded unless applicable): $99 for seats 1-3, $49 for 4-6, $29 for 7-15, $1 for 16+
|
|
8
|
+
- **Individual License**: Personal Pro license per engineer
|
|
9
|
+
- **Team License**: Single key management — add or remove members instantly
|
|
10
|
+
- **CI/CD License**: Full support for automated and headless build environments
|
|
11
|
+
- **Enterprise**: Custom plans available (contact support@uniwind.dev)
|
|
12
|
+
- **Priority Support**: Critical issues resolved with priority response times
|
|
13
|
+
|
|
14
|
+
### Overview
|
|
15
|
+
|
|
16
|
+
- **C++ style engine**: Forged on the 2nd-gen Unistyles C++ engine. Injects styles directly into the ShadowTree without triggering React re-renders — a direct, optimized highway between classNames and the native layer
|
|
17
|
+
- **Performance**: Benchmarked at ~55ms (vs StyleSheet 49ms, traditional Uniwind 81ms, NativeWind 197ms) — near-native speed
|
|
18
|
+
- **55+ className props** update without re-renders across 20 components (all component bindings listed above)
|
|
19
|
+
- **Reanimated animations**: `animate-*` and `transition-*` via className (Reanimated v4)
|
|
20
|
+
- **Native insets & runtime values**: Automatic safe area injection, device rotation, and font size updates — no `SafeAreaListener` setup needed
|
|
21
|
+
- **Theme transitions**: Native animated transitions when switching themes (fade, slide, circle mask)
|
|
22
|
+
- **Group variants**: Tailwind `group-active:*` / `group-focus:*` propagate parent interaction state through the C++ shadow tree with zero re-renders
|
|
23
|
+
- **Default styles**: Experimental `1.2.0+` feature for styling default React Native components from CSS selectors like `View { ... }` and `Text { ... }`
|
|
24
|
+
- **Priority support**: Don't let technical hurdles slow your team down
|
|
25
|
+
|
|
26
|
+
Package: `"uniwind": "npm:uniwind-pro@latest"` in `package.json`.
|
|
27
|
+
|
|
28
|
+
### Installation
|
|
29
|
+
|
|
30
|
+
1. Set dependency alias in `package.json`:
|
|
31
|
+
```json
|
|
32
|
+
{ "dependencies": { "uniwind": "npm:uniwind-pro@latest" } }
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
2. Install peer dependencies:
|
|
36
|
+
```bash
|
|
37
|
+
npm install react-native-nitro-modules react-native-reanimated react-native-worklets
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
3. Authenticate: `npx uniwind-pro` (interactive — select "Login with GitHub")
|
|
41
|
+
|
|
42
|
+
4. Add Babel plugin — APPEND `react-native-worklets/plugin` to your existing `plugins` array. Do NOT replace your presets (keep `babel-preset-expo` for Expo, or your bare-RN preset):
|
|
43
|
+
```js
|
|
44
|
+
// babel.config.js
|
|
45
|
+
module.exports = {
|
|
46
|
+
// your existing presets and config — leave untouched
|
|
47
|
+
plugins: [
|
|
48
|
+
// ...other plugins
|
|
49
|
+
'react-native-worklets/plugin',
|
|
50
|
+
],
|
|
51
|
+
};
|
|
52
|
+
```
|
|
53
|
+
If you already use Reanimated, you may already have the worklets plugin configured.
|
|
54
|
+
|
|
55
|
+
5. Whitelist postinstall if needed:
|
|
56
|
+
- **bun**: Add `"trustedDependencies": ["uniwind"]` to `package.json`
|
|
57
|
+
- **yarn v2+**: Configure in `.yarnrc.yml`
|
|
58
|
+
- **pnpm**: `pnpm config set enable-pre-post-scripts true`
|
|
59
|
+
|
|
60
|
+
6. Rebuild native app:
|
|
61
|
+
```bash
|
|
62
|
+
npx expo prebuild --clean && npx expo run:ios
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Pro does **NOT** work with Expo Go. Requires native rebuild.
|
|
66
|
+
|
|
67
|
+
**Verify installation**: Check for native modules (`.cpp`, `.mm` files) in `node_modules/uniwind`.
|
|
68
|
+
|
|
69
|
+
### Reanimated Animations (Requires Reanimated v4.0.0+)
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
<View className="size-32 bg-primary rounded animate-spin" />
|
|
73
|
+
<View className="size-32 bg-primary rounded animate-bounce" />
|
|
74
|
+
<View className="size-32 bg-primary rounded animate-pulse" />
|
|
75
|
+
<View className="size-32 bg-primary rounded animate-ping" />
|
|
76
|
+
|
|
77
|
+
// Loading spinner
|
|
78
|
+
<View className="size-8 border-4 border-gray-200 border-t-blue-500 rounded-full animate-spin" />
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Custom keyframe animations beyond Tailwind defaults:
|
|
82
|
+
|
|
83
|
+
| Class | Description |
|
|
84
|
+
|-------|-------------|
|
|
85
|
+
| `animate-wiggle` | Rotational wiggle |
|
|
86
|
+
| `animate-shake` | Horizontal shake |
|
|
87
|
+
| `animate-flash` | Opacity flash on/off |
|
|
88
|
+
| `animate-rubber-band` | Elastic scale stretch |
|
|
89
|
+
| `animate-swing` | Pendulum swing |
|
|
90
|
+
| `animate-tada` | Scale + rotate attention seeker |
|
|
91
|
+
| `animate-heartbeat` | Double-pulse heartbeat |
|
|
92
|
+
| `animate-jello` | Rotational jello wobble |
|
|
93
|
+
| `animate-float` | Gentle vertical float |
|
|
94
|
+
| `animate-breathe` | Subtle breathing scale |
|
|
95
|
+
| `animate-tilt` | Alternating tilt rotation |
|
|
96
|
+
| `animate-glitch` | Rapid horizontal jitter |
|
|
97
|
+
|
|
98
|
+
Components auto-swap to Animated versions when animation classes detected:
|
|
99
|
+
|
|
100
|
+
| Component | Animated Version |
|
|
101
|
+
|-----------|------------------|
|
|
102
|
+
| `View` | `Animated.View` |
|
|
103
|
+
| `Text` | `Animated.Text` |
|
|
104
|
+
| `Image` | `Animated.Image` |
|
|
105
|
+
| `ImageBackground` | `Animated.ImageBackground` |
|
|
106
|
+
| `ScrollView` | `Animated.ScrollView` |
|
|
107
|
+
| `FlatList` | `Animated.FlatList` |
|
|
108
|
+
| `TextInput` | `Animated.TextInput` |
|
|
109
|
+
| `Pressable` | `Animated.Pressable` |
|
|
110
|
+
|
|
111
|
+
### Entering & Exiting Animations
|
|
112
|
+
|
|
113
|
+
Drive Reanimated's entering/exiting animations via className — no Reanimated imports needed. Components auto-upgrade when `uw-*` classes are detected.
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
// Bounce in, bounce out
|
|
117
|
+
{visible && <View className="size-20 bg-primary rounded-xl uw-entering-bounce-in uw-exiting-bounce-out" />}
|
|
118
|
+
|
|
119
|
+
// Fade in slowly (1000ms)
|
|
120
|
+
{visible && <View className="size-20 bg-primary rounded-xl uw-entering-fade-in uw-entering-duration-1000 uw-exiting-fade-out" />}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Entering presets**: `uw-entering-fade-in` `uw-entering-fade-in-right` `uw-entering-fade-in-left` `uw-entering-fade-in-up` `uw-entering-fade-in-down` `uw-entering-slide-in-right` `uw-entering-slide-in-left` `uw-entering-slide-in-up` `uw-entering-slide-in-down` `uw-entering-zoom-in` `uw-entering-zoom-in-rotate` `uw-entering-zoom-in-left` `uw-entering-zoom-in-right` `uw-entering-zoom-in-up` `uw-entering-zoom-in-down` `uw-entering-zoom-in-easy-up` `uw-entering-zoom-in-easy-down` `uw-entering-bounce-in` `uw-entering-bounce-in-down` `uw-entering-bounce-in-up` `uw-entering-bounce-in-left` `uw-entering-bounce-in-right` `uw-entering-flip-in-x-up` `uw-entering-flip-in-x-down` `uw-entering-flip-in-y-left` `uw-entering-flip-in-y-right` `uw-entering-flip-in-easy-x` `uw-entering-flip-in-easy-y` `uw-entering-stretch-in-x` `uw-entering-stretch-in-y` `uw-entering-rotate-in-down-left` `uw-entering-rotate-in-down-right` `uw-entering-rotate-in-up-left` `uw-entering-rotate-in-up-right` `uw-entering-roll-in-left` `uw-entering-roll-in-right` `uw-entering-pinwheel-in` `uw-entering-light-speed-in-right` `uw-entering-light-speed-in-left`
|
|
124
|
+
|
|
125
|
+
**Exiting presets**: `uw-exiting-fade-out` `uw-exiting-fade-out-right` `uw-exiting-fade-out-left` `uw-exiting-fade-out-up` `uw-exiting-fade-out-down` `uw-exiting-slide-out-right` `uw-exiting-slide-out-left` `uw-exiting-slide-out-up` `uw-exiting-slide-out-down` `uw-exiting-zoom-out` `uw-exiting-zoom-out-rotate` `uw-exiting-zoom-out-left` `uw-exiting-zoom-out-right` `uw-exiting-zoom-out-up` `uw-exiting-zoom-out-down` `uw-exiting-zoom-out-easy-up` `uw-exiting-zoom-out-easy-down` `uw-exiting-bounce-out` `uw-exiting-bounce-out-down` `uw-exiting-bounce-out-up` `uw-exiting-bounce-out-left` `uw-exiting-bounce-out-right` `uw-exiting-flip-out-x-up` `uw-exiting-flip-out-x-down` `uw-exiting-flip-out-y-left` `uw-exiting-flip-out-y-right` `uw-exiting-flip-out-easy-x` `uw-exiting-flip-out-easy-y` `uw-exiting-stretch-out-x` `uw-exiting-stretch-out-y` `uw-exiting-rotate-out-down-left` `uw-exiting-rotate-out-down-right` `uw-exiting-rotate-out-up-left` `uw-exiting-rotate-out-up-right` `uw-exiting-roll-out-left` `uw-exiting-roll-out-right` `uw-exiting-pinwheel-out` `uw-exiting-light-speed-out-right` `uw-exiting-light-speed-out-left`
|
|
126
|
+
|
|
127
|
+
**Animation modifiers** (pattern: `uw-{entering|exiting|layout}-{modifier}`):
|
|
128
|
+
- Duration: `uw-{type}-duration-75` `uw-{type}-duration-100` ... `uw-{type}-duration-1000` or arbitrary `uw-{type}-duration-{ms}`
|
|
129
|
+
- Delay: `uw-{type}-delay-75` ... `uw-{type}-delay-1000` or arbitrary `uw-{type}-delay-{ms}`
|
|
130
|
+
- Easing: `uw-{type}-ease-linear` `uw-{type}-ease-in` `uw-{type}-ease-out` `uw-{type}-ease-in-out` `uw-{type}-ease-bounce`
|
|
131
|
+
- Spring: `uw-{type}-springify` `uw-{type}-damping-{value}` `uw-{type}-stiffness-{value}` `uw-{type}-mass-{value}`
|
|
132
|
+
|
|
133
|
+
### Layout Transitions
|
|
134
|
+
|
|
135
|
+
Animate position/size changes when siblings are added or removed:
|
|
136
|
+
|
|
137
|
+
```tsx
|
|
138
|
+
<View className="w-full gap-2">
|
|
139
|
+
{items.map(item => (
|
|
140
|
+
<View key={item.id} className={`h-14 ${item.color} rounded-xl uw-entering-fade-in uw-exiting-fade-out uw-layout-linear-transition`} />
|
|
141
|
+
))}
|
|
142
|
+
</View>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
| Class | Description |
|
|
146
|
+
|-------|-------------|
|
|
147
|
+
| `uw-layout-linear-transition` | Smooth linear repositioning |
|
|
148
|
+
| `uw-layout-fading-transition` | Fade during repositioning |
|
|
149
|
+
| `uw-layout-jumping-transition` | Bouncy jump to new position |
|
|
150
|
+
| `uw-layout-curved-transition` | Curved path repositioning |
|
|
151
|
+
| `uw-layout-sequenced-transition` | Sequenced repositioning |
|
|
152
|
+
| `uw-layout-entry-exit-transition` | Combined entry/exit during layout |
|
|
153
|
+
|
|
154
|
+
### Transitions
|
|
155
|
+
|
|
156
|
+
Smooth property changes when className or state changes:
|
|
157
|
+
|
|
158
|
+
```tsx
|
|
159
|
+
// Color transition on press
|
|
160
|
+
<Pressable className="bg-primary active:bg-red-500 transition-colors duration-300" />
|
|
161
|
+
|
|
162
|
+
// Opacity transition
|
|
163
|
+
<View className={`transition-opacity duration-500 ${visible ? 'opacity-100' : 'opacity-0'}`} />
|
|
164
|
+
|
|
165
|
+
// Transform transition
|
|
166
|
+
<Pressable className="active:scale-95 transition-transform duration-150" />
|
|
167
|
+
|
|
168
|
+
// All properties
|
|
169
|
+
<Pressable className="bg-primary px-6 py-3 rounded-lg active:scale-95 active:bg-primary/80 transition-all duration-150">
|
|
170
|
+
<Text className="text-white font-semibold">Animated Button</Text>
|
|
171
|
+
</Pressable>
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
| Class | Properties |
|
|
175
|
+
|-------|------------|
|
|
176
|
+
| `transition-none` | No transition |
|
|
177
|
+
| `transition-all` | All properties |
|
|
178
|
+
| `transition-colors` | Background, border, text colors |
|
|
179
|
+
| `transition-opacity` | Opacity |
|
|
180
|
+
| `transition-shadow` | Box shadow |
|
|
181
|
+
| `transition-transform` | Scale, rotate, translate |
|
|
182
|
+
|
|
183
|
+
Duration: `duration-75` `duration-100` `duration-150` `duration-200` `duration-300` `duration-500` `duration-700` `duration-1000`
|
|
184
|
+
|
|
185
|
+
Easing: `ease-linear` `ease-in` `ease-out` `ease-in-out`
|
|
186
|
+
|
|
187
|
+
Delay: `delay-75` `delay-100` `delay-150` `delay-200` `delay-300` `delay-500` `delay-700` `delay-1000`
|
|
188
|
+
|
|
189
|
+
### Using Reanimated Directly
|
|
190
|
+
|
|
191
|
+
Still works with Uniwind classes:
|
|
192
|
+
|
|
193
|
+
```tsx
|
|
194
|
+
import Animated, { FadeIn, FlipInXUp, LinearTransition } from 'react-native-reanimated';
|
|
195
|
+
|
|
196
|
+
<Animated.Text entering={FadeIn.delay(500)} className="text-foreground text-lg">
|
|
197
|
+
Fading in
|
|
198
|
+
</Animated.Text>
|
|
199
|
+
|
|
200
|
+
<Animated.FlatList
|
|
201
|
+
data={data}
|
|
202
|
+
className="flex-none"
|
|
203
|
+
contentContainerClassName="px-2"
|
|
204
|
+
layout={LinearTransition}
|
|
205
|
+
renderItem={({ item }) => (
|
|
206
|
+
<Animated.Text entering={FlipInXUp} className="text-foreground py-2">
|
|
207
|
+
{item}
|
|
208
|
+
</Animated.Text>
|
|
209
|
+
)}
|
|
210
|
+
/>
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Shadow Tree Updates
|
|
214
|
+
|
|
215
|
+
No code changes needed — props connect directly to C++ engine, eliminating re-renders automatically.
|
|
216
|
+
|
|
217
|
+
### Shadow Tree Diagnostics
|
|
218
|
+
|
|
219
|
+
Development-only API to observe what the C++ engine is doing — when components register/unregister with the shadow tree and how styles flow through it. Import from `uniwind/diagnostics`:
|
|
220
|
+
|
|
221
|
+
```tsx
|
|
222
|
+
import { enableDiagnostics } from 'uniwind/diagnostics';
|
|
223
|
+
|
|
224
|
+
enableDiagnostics({
|
|
225
|
+
reportMounts: true, // log when components register with the shadow tree
|
|
226
|
+
reportUnmounts: true, // log when components unregister
|
|
227
|
+
reportUpdates: true, // log style updates with property-level detail
|
|
228
|
+
});
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
All three options default to `false` — enable only what you need (logging everything on a complex screen gets noisy). Update logs are grouped into 🔥 C++ updates (applied via the shadow tree) and ✨ Native updates (props set directly on native views) — both happen with zero React re-renders.
|
|
232
|
+
|
|
233
|
+
Use for: debugging theme switches (`reportUpdates`), detecting memory leaks (mount/unmount counts should return to zero when navigating away), and verifying zero re-renders.
|
|
234
|
+
|
|
235
|
+
Platform support: full diagnostics on iOS and Android. On Web, `enableDiagnostics` is a no-op stub that produces no output.
|
|
236
|
+
|
|
237
|
+
### Group Variants
|
|
238
|
+
|
|
239
|
+
Tailwind `group` variants propagate parent interaction state to descendants through the C++ shadow tree. No re-renders, no context providers.
|
|
240
|
+
|
|
241
|
+
```tsx
|
|
242
|
+
// Basic group — descendants react to parent press
|
|
243
|
+
<Pressable className="group p-4 bg-base rounded-xl">
|
|
244
|
+
<Text className="text-default group-active:text-primary">Press the card</Text>
|
|
245
|
+
<View className="size-8 bg-blue-500 rounded group-active:bg-red-500" />
|
|
246
|
+
</Pressable>
|
|
247
|
+
|
|
248
|
+
// Named groups — descendants pick which ancestor to follow
|
|
249
|
+
<Pressable className="group/card p-4 bg-base rounded-xl">
|
|
250
|
+
<Pressable className="group/button px-3 py-1 bg-primary rounded">
|
|
251
|
+
<Text className="text-white group-active/card:opacity-50 group-active/button:font-bold">
|
|
252
|
+
Nested groups
|
|
253
|
+
</Text>
|
|
254
|
+
</Pressable>
|
|
255
|
+
</Pressable>
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
**Supported variants**: `group-active:*` (press), `group-focus:*` (focus). Named variants: `group-active/{name}:*`, `group-focus/{name}:*`.
|
|
259
|
+
|
|
260
|
+
**Supported group parents**: `Pressable` (press + focus), `Text` (press — requires `onPress`, even empty). `TouchableOpacity`, `TouchableHighlight`, `TouchableWithoutFeedback`, and `TextInput` do **not** act as group parents — wrap in a `Pressable` marked `group`.
|
|
261
|
+
|
|
262
|
+
**Not supported**: `group-hover:*` (no pointer hover on native), `group-disabled:*` (parsed but no shadow tree trigger), arbitrary `group-[.selector]:*` variants, implicit `in-*` variants.
|
|
263
|
+
|
|
264
|
+
### Default Styles (Pro 1.2.0+, Experimental)
|
|
265
|
+
|
|
266
|
+
Default styles let Pro users define baseline styles for built-in React Native components directly in CSS. They are disabled by default and require an experimental flag.
|
|
267
|
+
|
|
268
|
+
```js
|
|
269
|
+
// metro.config.js
|
|
270
|
+
module.exports = withUniwindConfig(config, {
|
|
271
|
+
cssEntryFile: './global.css',
|
|
272
|
+
experimental: {
|
|
273
|
+
defaultStyles: true,
|
|
274
|
+
},
|
|
275
|
+
});
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
```css
|
|
279
|
+
/* global.css */
|
|
280
|
+
View {
|
|
281
|
+
border-color: var(--color-primary);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
Text {
|
|
285
|
+
font-family: Inter;
|
|
286
|
+
font-size: 16px;
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
Effect: every `View` gets `border-color: var(--color-primary)`, every `Text` gets `font-family: Inter` and `font-size: 16px`, unless more specific styles override them.
|
|
291
|
+
|
|
292
|
+
Rules:
|
|
293
|
+
- Available only in Uniwind Pro `1.2.0+`
|
|
294
|
+
- Disabled by default; enable `experimental.defaultStyles: true`
|
|
295
|
+
- Experimental; may not work for every use case and may change in future releases
|
|
296
|
+
- Use React Native component names as selectors, not HTML tags
|
|
297
|
+
- Treat as baseline styles; direct `className` styles can override them
|
|
298
|
+
|
|
299
|
+
Supported component selectors: `ActivityIndicator`, `FlatList`, `Image`, `ImageBackground`, `InputAccessoryView`, `KeyboardAvoidingView`, `Modal`, `Pressable`, `RefreshControl`, `SafeAreaView`, `ScrollView`, `SectionList`, `Switch`, `Text`, `TextInput`, `TouchableHighlight`, `TouchableNativeFeedback`, `TouchableOpacity`, `TouchableWithoutFeedback`, `View`, `VirtualizedList`.
|
|
300
|
+
|
|
301
|
+
### Suspense Support
|
|
302
|
+
|
|
303
|
+
Components inside React `Suspense` boundaries are handled correctly. While a subtree is suspended, Uniwind keeps the C++ shadow entries alive so theme updates and runtime changes (dark mode, orientation, etc.) still reach suspended nodes. When the tree unsuspends, styles are already up to date — no flash of stale theme.
|
|
304
|
+
|
|
305
|
+
### Native Insets
|
|
306
|
+
|
|
307
|
+
Remove `SafeAreaListener` setup — insets injected from native layer:
|
|
308
|
+
|
|
309
|
+
```tsx
|
|
310
|
+
// With Pro — just use safe area classes directly
|
|
311
|
+
<View className="pt-safe pb-safe">{/* content */}</View>
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### Theme Transitions (Pro)
|
|
315
|
+
|
|
316
|
+
Native animated transitions when switching themes. Supported on iOS, Android, and Web.
|
|
317
|
+
|
|
318
|
+
```tsx
|
|
319
|
+
import { Uniwind, ThemeTransitionPreset } from 'uniwind';
|
|
320
|
+
|
|
321
|
+
// Fade transition
|
|
322
|
+
Uniwind.setTheme('dark', { preset: ThemeTransitionPreset.Fade });
|
|
323
|
+
|
|
324
|
+
// Slide transitions
|
|
325
|
+
Uniwind.setTheme('dark', { preset: ThemeTransitionPreset.SlideRightToLeft });
|
|
326
|
+
Uniwind.setTheme('light', { preset: ThemeTransitionPreset.SlideLeftToRight });
|
|
327
|
+
|
|
328
|
+
// Circle mask transitions (expand from a corner or center)
|
|
329
|
+
Uniwind.setTheme('ocean', { preset: ThemeTransitionPreset.CircleCenter });
|
|
330
|
+
|
|
331
|
+
// Blur transitions
|
|
332
|
+
Uniwind.setTheme('dark', { preset: ThemeTransitionPreset.Blur });
|
|
333
|
+
Uniwind.setTheme('dark', { preset: ThemeTransitionPreset.BlurRightToLeft });
|
|
334
|
+
|
|
335
|
+
// No animation
|
|
336
|
+
Uniwind.setTheme('light');
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
Available presets:
|
|
340
|
+
|
|
341
|
+
| Preset | Effect |
|
|
342
|
+
|--------|--------|
|
|
343
|
+
| `ThemeTransitionPreset.None` | Instant switch, no animation |
|
|
344
|
+
| `ThemeTransitionPreset.Fade` | Crossfade between themes |
|
|
345
|
+
| `ThemeTransitionPreset.SlideRightToLeft` | Slide new theme in from right |
|
|
346
|
+
| `ThemeTransitionPreset.SlideLeftToRight` | Slide new theme in from left |
|
|
347
|
+
| `ThemeTransitionPreset.CircleTopRight` | Circle mask expanding from top-right |
|
|
348
|
+
| `ThemeTransitionPreset.CircleTopLeft` | Circle mask expanding from top-left |
|
|
349
|
+
| `ThemeTransitionPreset.CircleBottomRight` | Circle mask expanding from bottom-right |
|
|
350
|
+
| `ThemeTransitionPreset.CircleBottomLeft` | Circle mask expanding from bottom-left |
|
|
351
|
+
| `ThemeTransitionPreset.CircleCenter` | Circle mask expanding from center |
|
|
352
|
+
| `ThemeTransitionPreset.Blur` | Blur out animation |
|
|
353
|
+
| `ThemeTransitionPreset.BlurRightToLeft` | Directional blur from right to left |
|
|
354
|
+
| `ThemeTransitionPreset.BlurLeftToRight` | Directional blur from left to right |
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
## Setup
|
|
2
|
+
|
|
3
|
+
### Installation
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
# or other package manager
|
|
7
|
+
bun install uniwind tailwindcss
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Requires **Tailwind CSS v4+**.
|
|
11
|
+
|
|
12
|
+
### global.css
|
|
13
|
+
|
|
14
|
+
Create a CSS entry file:
|
|
15
|
+
|
|
16
|
+
```css
|
|
17
|
+
@import 'tailwindcss';
|
|
18
|
+
@import 'uniwind';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Import in your **App component** (e.g., `App.tsx` or `app/_layout.tsx`), **NOT** in `index.ts`/`index.js` — importing there breaks hot reload:
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
// app/_layout.tsx or App.tsx
|
|
25
|
+
import './global.css';
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The directory containing `global.css` is the app root — Tailwind scans for classNames starting from this directory.
|
|
29
|
+
|
|
30
|
+
### Metro Configuration
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
const { getDefaultConfig } = require('expo/metro-config');
|
|
34
|
+
// Bare RN: const { getDefaultConfig } = require('@react-native/metro-config');
|
|
35
|
+
const { withUniwindConfig } = require('uniwind/metro');
|
|
36
|
+
|
|
37
|
+
const config = getDefaultConfig(__dirname);
|
|
38
|
+
|
|
39
|
+
// withUniwindConfig MUST be the OUTERMOST wrapper
|
|
40
|
+
module.exports = withUniwindConfig(config, {
|
|
41
|
+
cssEntryFile: './global.css', // Required — relative path from project root
|
|
42
|
+
polyfills: { rem: 16 }, // Optional — base rem value (default 16)
|
|
43
|
+
extraThemes: ['ocean', 'sunset'], // Optional — custom themes beyond light/dark
|
|
44
|
+
dtsFile: './uniwind-types.d.ts', // Optional — TypeScript types output path
|
|
45
|
+
debug: true, // Optional — log unsupported CSS in dev
|
|
46
|
+
isTV: false, // Optional — enable TV platform support
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
For most flows, keep defaults, only provide `cssEntryFile`.
|
|
51
|
+
|
|
52
|
+
Wrapper order — Uniwind must wrap everything else:
|
|
53
|
+
|
|
54
|
+
```js
|
|
55
|
+
// CORRECT
|
|
56
|
+
module.exports = withUniwindConfig(withOtherConfig(config, opts), { cssEntryFile: './global.css' });
|
|
57
|
+
|
|
58
|
+
// WRONG — Uniwind is NOT outermost
|
|
59
|
+
module.exports = withOtherConfig(withUniwindConfig(config, { cssEntryFile: './global.css' }), opts);
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Vite Configuration (v1.2.0+)
|
|
63
|
+
|
|
64
|
+
If user has storybook setup, add extra vite config:
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
68
|
+
import { uniwind } from 'uniwind/vite';
|
|
69
|
+
import { defineConfig } from 'vite';
|
|
70
|
+
|
|
71
|
+
export default defineConfig({
|
|
72
|
+
plugins: [
|
|
73
|
+
tailwindcss(),
|
|
74
|
+
uniwind({
|
|
75
|
+
cssEntryFile: './src/global.css',
|
|
76
|
+
dtsFile: './src/uniwind-types.d.ts',
|
|
77
|
+
}),
|
|
78
|
+
],
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### TypeScript
|
|
83
|
+
|
|
84
|
+
Uniwind auto-generates a `.d.ts` file (default: `./uniwind-types.d.ts`) after running Metro. Place it in `src/` or `app/` for auto-inclusion, or add to `tsconfig.json`:
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{ "include": ["./uniwind-types.d.ts"] }
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
If user has some typescript errors related to classNames, just run metro server to build the d.ts file.
|
|
91
|
+
|
|
92
|
+
### Expo Router Placement
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
project/
|
|
96
|
+
├── app/_layout.tsx ← import '../global.css' here
|
|
97
|
+
├── components/
|
|
98
|
+
├── global.css ← project root (best location)
|
|
99
|
+
└── metro.config.js ← cssEntryFile: './global.css'
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
If `global.css` is in `app/` dir, add `@source` for sibling directories:
|
|
103
|
+
|
|
104
|
+
```css
|
|
105
|
+
@import 'tailwindcss';
|
|
106
|
+
@import 'uniwind';
|
|
107
|
+
@source '../components';
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Tailwind IntelliSense (VS Code / Cursor / Windsurf)
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"tailwindCSS.classAttributes": [
|
|
115
|
+
"class", "className", "headerClassName",
|
|
116
|
+
"contentContainerClassName", "columnWrapperClassName",
|
|
117
|
+
"endFillColorClassName", "imageClassName", "tintColorClassName",
|
|
118
|
+
"ios_backgroundColorClassName", "thumbColorClassName",
|
|
119
|
+
"trackColorOnClassName", "trackColorOffClassName",
|
|
120
|
+
"selectionColorClassName", "cursorColorClassName",
|
|
121
|
+
"underlineColorAndroidClassName", "placeholderTextColorClassName",
|
|
122
|
+
"selectionHandleColorClassName", "colorsClassName",
|
|
123
|
+
"progressBackgroundColorClassName", "titleColorClassName",
|
|
124
|
+
"underlayColorClassName", "colorClassName",
|
|
125
|
+
"backdropColorClassName", "backgroundColorClassName",
|
|
126
|
+
"statusBarBackgroundColorClassName", "drawerBackgroundColorClassName",
|
|
127
|
+
"ListFooterComponentClassName", "ListHeaderComponentClassName"
|
|
128
|
+
],
|
|
129
|
+
"tailwindCSS.classFunctions": ["useResolveClassNames"]
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Monorepo Support
|
|
134
|
+
|
|
135
|
+
Add `@source` directives in `global.css` for packages outside the CSS entry file's directory:
|
|
136
|
+
|
|
137
|
+
```css
|
|
138
|
+
@import 'tailwindcss';
|
|
139
|
+
@import 'uniwind';
|
|
140
|
+
@source "../../packages/ui/src";
|
|
141
|
+
@source "../../packages/shared/src";
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Also needed for `node_modules` packages that contain Uniwind classes (e.g., shared UI libraries).
|