Skip to content

Commit b123621

Browse files
committed
Migrate from NativeWind to UniWind, update dependencies, and refactor styles
1 parent 03aa224 commit b123621

17 files changed

Lines changed: 1009 additions & 866 deletions

File tree

.agents/skills/migrate-nativewind-to-uniwind/SKILL.md

Lines changed: 719 additions & 0 deletions
Large diffs are not rendered by default.

.vscode/settings.json

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,38 @@
1515
"files.exclude": {
1616
// "**/assets/icons/src/*": true
1717
},
18-
"typescript.tsdk": "node_modules\\typescript\\lib"
18+
"typescript.tsdk": "node_modules\\typescript\\lib",
19+
"tailwindCSS.classAttributes": [
20+
"class",
21+
"className",
22+
"headerClassName",
23+
"contentContainerClassName",
24+
"columnWrapperClassName",
25+
"endFillColorClassName",
26+
"imageClassName",
27+
"tintColorClassName",
28+
"ios_backgroundColorClassName",
29+
"thumbColorClassName",
30+
"trackColorOnClassName",
31+
"trackColorOffClassName",
32+
"selectionColorClassName",
33+
"cursorColorClassName",
34+
"underlineColorAndroidClassName",
35+
"placeholderTextColorClassName",
36+
"selectionHandleColorClassName",
37+
"colorsClassName",
38+
"progressBackgroundColorClassName",
39+
"titleColorClassName",
40+
"underlayColorClassName",
41+
"colorClassName",
42+
"drawerBackgroundColorClassName",
43+
"statusBarBackgroundColorClassName",
44+
"backdropColorClassName",
45+
"backgroundColorClassName",
46+
"ListFooterComponentClassName",
47+
"ListHeaderComponentClassName"
48+
],
49+
"tailwindCSS.classFunctions": ["useResolveClassNames"]
1950
// "editor.codeActionsOnSave": {
2051
// "source.organizeImports": "always"
2152
// }

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
presets: ['module:@react-native/babel-preset', 'nativewind/babel'],
2+
presets: ['module:@react-native/babel-preset' /* , 'nativewind/babel' */],
33
plugins: [
44
[
55
'module-resolver',

bun.lock

Lines changed: 150 additions & 816 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

global.css

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1-
@tailwind base;
2-
@tailwind components;
3-
@tailwind utilities;
1+
/* @tailwind base; */
2+
/* @tailwind components; */
3+
/* @tailwind utilities; */
4+
@import 'tailwindcss';
5+
@import 'uniwind';
6+
7+
@theme {
8+
--color-accent: #0a84ff;
9+
--color-g2: #3866D5;
10+
--color-g1: #8101E9;
11+
--color-app-icon-bg: #191C21;
12+
}
413

514
.d {
615
@apply border border-red-500;

metro.config.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config')
2-
const { withNativeWind } = require('nativewind/metro')
2+
// const { withNativeWind } = require('nativewind/metro')
3+
const { withUniwindConfig } = require('uniwind/metro')
34
const { wrapWithReanimatedMetroConfig } = require('react-native-reanimated/metro-config')
45
// const path = require('path')
56
const defaultConfig = getDefaultConfig(__dirname)
@@ -21,4 +22,8 @@ const config = mergeConfig(defaultConfig, {
2122
},
2223
})
2324

24-
module.exports = wrapWithReanimatedMetroConfig(withNativeWind(config, { input: './global.css' }))
25+
// module.exports = wrapWithReanimatedMetroConfig(withNativeWind(config, { input: './global.css' }))
26+
module.exports = withUniwindConfig(wrapWithReanimatedMetroConfig(config), {
27+
cssEntryFile: './global.css',
28+
polyfills: { rem: 14 },
29+
})

nativewind-env.d.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
/// <reference types="nativewind/types" />
2-
3-
// NOTE: This file should not be edited and should be committed with your source code. It is generated by NativeWind.
1+
// /// <reference types="nativewind/types" />
2+
/// <reference types="uniwind/types" />

package.json

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@shopify/react-native-skia"
2626
],
2727
"dependencies": {
28-
"@react-native-community/netinfo": "^11.4.1",
28+
"@react-native-community/netinfo": "^12.0.1",
2929
"@react-native-masked-view/masked-view": "^0.3.2",
3030
"@react-navigation/bottom-tabs": "^7.15.2",
3131
"@react-navigation/native": "^7.1.31",
@@ -36,20 +36,21 @@
3636
"clsx": "^2.1.1",
3737
"hono": "^4.7.11",
3838
"lottie-react-native": "7.3.6",
39-
"nativewind": "^4.1.23",
4039
"react": "19.2.3",
41-
"react-native": "0.84.0",
42-
"react-native-device-info": "^14.0.4",
40+
"react-native": "0.84.1",
41+
"react-native-device-info": "^15.0.2",
4342
"react-native-geolocation-service": "^5.3.1",
4443
"react-native-gesture-handler": "^2.30.0",
4544
"react-native-linear-gradient": "^2.8.3",
46-
"react-native-mmkv": "3.3.3",
45+
"react-native-mmkv": "^4.1.2",
46+
"react-native-nitro-modules": "^0.34.1",
4747
"react-native-reanimated": "4.2.2",
4848
"react-native-safe-area-context": "^5.7.0",
4949
"react-native-screens": "4.24.0",
5050
"react-native-svg": "^15.12.1",
5151
"react-native-worklets": "0.7.4",
5252
"tailwind-merge": "^3.3.1",
53+
"uniwind": "^1.4.0",
5354
"zod": "^3.25.47",
5455
"zustand": "^5.0.7"
5556
},
@@ -62,10 +63,10 @@
6263
"@react-native-community/cli": "20.1.0",
6364
"@react-native-community/cli-platform-android": "20.1.0",
6465
"@react-native-community/cli-platform-ios": "20.1.0",
65-
"@react-native/babel-preset": "0.84.0",
66-
"@react-native/eslint-config": "0.84.0",
67-
"@react-native/metro-config": "0.84.0",
68-
"@react-native/typescript-config": "0.84.0",
66+
"@react-native/babel-preset": "0.84.1",
67+
"@react-native/eslint-config": "0.84.1",
68+
"@react-native/metro-config": "0.84.1",
69+
"@react-native/typescript-config": "0.84.1",
6970
"@tanstack/eslint-plugin-query": "^5.78.0",
7071
"@types/jest": "^29.5.14",
7172
"@types/node": "^25.3.2",
@@ -81,10 +82,13 @@
8182
"prettier-plugin-tailwindcss": "^0.6.14",
8283
"react-native-svg-transformer": "^1.5.1",
8384
"react-test-renderer": "19.2.3",
84-
"tailwindcss": "^3.4.17",
85+
"tailwindcss": "^4.2.1",
8586
"typescript": "^5.8.3"
8687
},
8788
"engines": {
8889
"node": ">= 22.11.0"
90+
},
91+
"patchedDependencies": {
92+
"react-native-mmkv@4.1.2": "patches/react-native-mmkv@4.1.2.patch"
8993
}
9094
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
diff --git a/android/CMakeLists.txt b/android/CMakeLists.txt
2+
index 33696a2ef090ae6392d093c02fca2090f379f0fa..36ed966f899904a7c1c4d98027264c40d18f751a 100644
3+
--- a/android/CMakeLists.txt
4+
+++ b/android/CMakeLists.txt
5+
@@ -22,6 +22,14 @@ add_library(${PACKAGE_NAME} SHARED
6+
# Find MMKV prefab package (from mmkv-shared gradle dependency)
7+
find_package(mmkv REQUIRED CONFIG)
8+
9+
+# Fix MMKV 2.2.x header path (headers are in include/MMKV/ subdirectory)
10+
+get_target_property(MMKV_INCLUDE_DIRS mmkv::mmkv INTERFACE_INCLUDE_DIRECTORIES)
11+
+foreach(dir ${MMKV_INCLUDE_DIRS})
12+
+ if(IS_DIRECTORY "${dir}/MMKV")
13+
+ target_include_directories(${PACKAGE_NAME} PRIVATE "${dir}/MMKV")
14+
+ endif()
15+
+endforeach()
16+
+
17+
# Add Nitrogen specs :)
18+
include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/NitroMmkv+autolinking.cmake)
19+

skills-lock.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"version": 1,
3+
"skills": {
4+
"migrate-nativewind-to-uniwind": {
5+
"source": "uni-stack/uniwind",
6+
"sourceType": "github",
7+
"computedHash": "ed862e5d3f404e2105b1ed8c92f696ed1a975cbc93b3d5859877272a7c54f8bf"
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)