@campxdev/react-native-blueprint 0.1.7 → 0.1.8
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 +82 -8
- package/package.json +15 -6
package/README.md
CHANGED
|
@@ -105,7 +105,9 @@ module.exports = {
|
|
|
105
105
|
};
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
-
### 5. Configure Metro
|
|
108
|
+
### 5. Configure Bundler (Metro or Re.Pack)
|
|
109
|
+
|
|
110
|
+
**Option A: Metro (Standard)**
|
|
109
111
|
|
|
110
112
|
Update `metro.config.js`:
|
|
111
113
|
|
|
@@ -118,6 +120,36 @@ const config = getDefaultConfig(__dirname);
|
|
|
118
120
|
module.exports = withNativeWind(config, { input: './global.css' });
|
|
119
121
|
```
|
|
120
122
|
|
|
123
|
+
**Option B: Re.Pack + Rspack (5x Faster - Used in Example App)**
|
|
124
|
+
|
|
125
|
+
The example app in this repository uses [Re.Pack 5](https://re-pack.dev) with Rspack for **5x faster builds**. See [MIGRATION_REPACK.md](MIGRATION_REPACK.md) for details.
|
|
126
|
+
|
|
127
|
+
If you want to use Re.Pack in your project:
|
|
128
|
+
|
|
129
|
+
1. Install Re.Pack:
|
|
130
|
+
```sh
|
|
131
|
+
npx @callstack/repack-init
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
2. Install NativeWind plugin:
|
|
135
|
+
```sh
|
|
136
|
+
npm install @callstack/repack-plugin-nativewind
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
3. Update `rspack.config.js`:
|
|
140
|
+
```js
|
|
141
|
+
import { NativeWindPlugin } from '@callstack/repack-plugin-nativewind';
|
|
142
|
+
|
|
143
|
+
export default (env) => ({
|
|
144
|
+
// ... other config
|
|
145
|
+
plugins: [
|
|
146
|
+
new NativeWindPlugin({
|
|
147
|
+
input: './global.css',
|
|
148
|
+
}),
|
|
149
|
+
],
|
|
150
|
+
});
|
|
151
|
+
```
|
|
152
|
+
|
|
121
153
|
## Usage
|
|
122
154
|
|
|
123
155
|
### Basic Example
|
|
@@ -241,15 +273,40 @@ function App() {
|
|
|
241
273
|
|
|
242
274
|
## Example App
|
|
243
275
|
|
|
244
|
-
Check out the `/example` directory for a complete demo app showcasing all components
|
|
276
|
+
Check out the `/example` directory for a complete demo app showcasing all components with **Storybook integration** and **Re.Pack + Rspack** for 5x faster builds.
|
|
277
|
+
|
|
278
|
+
### Run Normal App Mode
|
|
279
|
+
|
|
280
|
+
```sh
|
|
281
|
+
yarn example:app # From root (recommended)
|
|
282
|
+
# or
|
|
283
|
+
cd example
|
|
284
|
+
yarn app:ios # Run on iOS simulator
|
|
285
|
+
yarn app:android # Run on Android emulator
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### Run Storybook Mode
|
|
289
|
+
|
|
290
|
+
The example app includes 16 interactive component stories using [Storybook for React Native](https://storybook.js.org/tutorials/intro-to-storybook/react-native/):
|
|
245
291
|
|
|
246
292
|
```sh
|
|
293
|
+
yarn example:storybook # From root (recommended)
|
|
294
|
+
# or
|
|
247
295
|
cd example
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
npm run android # Run on Android emulator
|
|
296
|
+
yarn storybook:ios # Run Storybook on iOS
|
|
297
|
+
yarn storybook:android # Run Storybook on Android
|
|
251
298
|
```
|
|
252
299
|
|
|
300
|
+
### Build Performance
|
|
301
|
+
|
|
302
|
+
The example app uses **Re.Pack 5 + Rspack** instead of Metro for:
|
|
303
|
+
- ⚡ **5x faster cold builds**
|
|
304
|
+
- ⚡ **5x faster hot module reload (HMR)**
|
|
305
|
+
- 📦 **Zero package duplications**
|
|
306
|
+
- 🎨 **Full NativeWind support**
|
|
307
|
+
|
|
308
|
+
See [MIGRATION_REPACK.md](MIGRATION_REPACK.md) for complete migration details and architecture.
|
|
309
|
+
|
|
253
310
|
## TypeScript Support
|
|
254
311
|
|
|
255
312
|
All components are fully typed with TypeScript. Import types as needed:
|
|
@@ -347,10 +404,19 @@ Contributions are welcome! Please follow these steps:
|
|
|
347
404
|
```
|
|
348
405
|
|
|
349
406
|
2. Run the example app:
|
|
407
|
+
|
|
408
|
+
**Normal App Mode:**
|
|
350
409
|
```sh
|
|
351
|
-
yarn example
|
|
352
|
-
#
|
|
353
|
-
|
|
410
|
+
yarn example:app # Start dev server
|
|
411
|
+
cd example && yarn app:ios # Or run on iOS
|
|
412
|
+
cd example && yarn app:android # Or run on Android
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
**Storybook Mode (Component Library):**
|
|
416
|
+
```sh
|
|
417
|
+
yarn example:storybook # Start Storybook
|
|
418
|
+
cd example && yarn storybook:ios # Or run on iOS
|
|
419
|
+
cd example && yarn storybook:android # Or run on Android
|
|
354
420
|
```
|
|
355
421
|
|
|
356
422
|
3. Make your changes in `/src`
|
|
@@ -366,6 +432,14 @@ Contributions are welcome! Please follow these steps:
|
|
|
366
432
|
yarn prepare
|
|
367
433
|
```
|
|
368
434
|
|
|
435
|
+
### Example App Tech Stack
|
|
436
|
+
|
|
437
|
+
The example app showcases modern React Native development with:
|
|
438
|
+
- **Re.Pack 5 + Rspack** - 5x faster than Metro bundler
|
|
439
|
+
- **Storybook React Native** - Interactive component development
|
|
440
|
+
- **NativeWind v4** - Tailwind CSS for React Native
|
|
441
|
+
- **Command-based mode switching** - Easy switching between app and Storybook modes
|
|
442
|
+
|
|
369
443
|
## Publishing
|
|
370
444
|
|
|
371
445
|
For maintainers who need to publish new versions of the package, we provide a comprehensive automated script.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@campxdev/react-native-blueprint",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "This is a react-native package for mobile apps",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -35,15 +35,16 @@
|
|
|
35
35
|
],
|
|
36
36
|
"scripts": {
|
|
37
37
|
"example": "yarn workspace react-native-blueprint-example",
|
|
38
|
+
"example:app": "yarn example app",
|
|
39
|
+
"example:storybook": "yarn example storybook",
|
|
38
40
|
"test": "jest",
|
|
39
41
|
"typecheck": "tsc",
|
|
40
42
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
41
43
|
"clean": "del-cli lib",
|
|
44
|
+
"clean:all": "rm -rf node_modules example/node_modules && yarn install",
|
|
42
45
|
"prepare": "bob build",
|
|
43
46
|
"release": "release-it --only-version",
|
|
44
|
-
"publish-package": "./scripts/publish.sh"
|
|
45
|
-
"android": "expo run:android",
|
|
46
|
-
"ios": "expo run:ios"
|
|
47
|
+
"publish-package": "./scripts/publish.sh"
|
|
47
48
|
},
|
|
48
49
|
"keywords": [
|
|
49
50
|
"react-native",
|
|
@@ -103,6 +104,16 @@
|
|
|
103
104
|
"example"
|
|
104
105
|
],
|
|
105
106
|
"packageManager": "yarn@3.6.1",
|
|
107
|
+
"resolutions": {
|
|
108
|
+
"react": "19.1.0",
|
|
109
|
+
"react-dom": "19.1.0",
|
|
110
|
+
"react-native": "0.81.4",
|
|
111
|
+
"nativewind": "4.2.1",
|
|
112
|
+
"tailwindcss": "3.4.17",
|
|
113
|
+
"tailwindcss-animate": "1.0.7",
|
|
114
|
+
"@rspack/core": "1.5.8",
|
|
115
|
+
"@babel/core": "^7.28.4"
|
|
116
|
+
},
|
|
106
117
|
"jest": {
|
|
107
118
|
"preset": "react-native",
|
|
108
119
|
"modulePathIgnorePatterns": [
|
|
@@ -202,8 +213,6 @@
|
|
|
202
213
|
"expo-font": "^14.0.9",
|
|
203
214
|
"figma-squircle": "^1.1.0",
|
|
204
215
|
"lucide-react-native": "^0.546.0",
|
|
205
|
-
"react": "19.1.0",
|
|
206
|
-
"react-native": "0.81.4",
|
|
207
216
|
"react-native-figma-squircle": "^0.4.0",
|
|
208
217
|
"react-native-floating-action": "^1.22.0",
|
|
209
218
|
"react-native-gesture-handler": "^2.28.0",
|