Browse Source

Build using bob

Janic Duplessis 5 years ago
parent
commit
3ddfc2a33c
2 changed files with 23 additions and 5 deletions
  1. 1
    1
      example/App.tsx
  2. 22
    4
      package.json

+ 1
- 1
example/App.tsx View File

18
 } from 'react-native/Libraries/NewAppScreen';
18
 } from 'react-native/Libraries/NewAppScreen';
19
 
19
 
20
 // import { SafeAreaProvider, useSafeArea } from 'react-native-safe-area-context'; in your app.
20
 // import { SafeAreaProvider, useSafeArea } from 'react-native-safe-area-context'; in your app.
21
-import { SafeAreaProvider, useSafeArea } from '..';
21
+import { SafeAreaProvider, useSafeArea } from '../src';
22
 
22
 
23
 type ForceInsets = 'always' | 'never';
23
 type ForceInsets = 'always' | 'never';
24
 
24
 

+ 22
- 4
package.json View File

2
   "name": "react-native-safe-area-context",
2
   "name": "react-native-safe-area-context",
3
   "version": "0.3.1",
3
   "version": "0.3.1",
4
   "description": "A flexible way to handle safe area, also works on Android and web.",
4
   "description": "A flexible way to handle safe area, also works on Android and web.",
5
-  "main": "src/index",
6
-  "module": "src/index",
5
+  "main": "lib/commonjs/index.js",
6
+  "module": "lib/module/index.js",
7
+  "react-native": "src/index.tsx",
8
+  "types": "lib/typescript/src/index.d.ts",
7
   "sideEffects": false,
9
   "sideEffects": false,
8
   "files": [
10
   "files": [
11
+    "/src",
12
+    "/lib",
9
     "/android",
13
     "/android",
10
     "!/android/build",
14
     "!/android/build",
11
     "/ios",
15
     "/ios",
12
-    "/src",
13
     "/*.podspec"
16
     "/*.podspec"
14
   ],
17
   ],
15
   "author": "Janic Duplessis <janicduplessis@gmail.com>",
18
   "author": "Janic Duplessis <janicduplessis@gmail.com>",
23
     "test": "yarn validate:prettier && yarn validate:eslint && yarn validate:typescript",
26
     "test": "yarn validate:prettier && yarn validate:eslint && yarn validate:typescript",
24
     "validate:eslint": "eslint \"src/**/*.{js,ts,tsx}\" \"example/**/*.{js,ts,tsx}\"",
27
     "validate:eslint": "eslint \"src/**/*.{js,ts,tsx}\" \"example/**/*.{js,ts,tsx}\"",
25
     "validate:typescript": "tsc --project ./ --noEmit",
28
     "validate:typescript": "tsc --project ./ --noEmit",
26
-    "validate:prettier": "prettier \"src/**/*.{js,ts,tsx}\" \"example/**/*.{js,ts,tsx}\" --check"
29
+    "validate:prettier": "prettier \"src/**/*.{js,ts,tsx}\" \"example/**/*.{js,ts,tsx}\" --check",
30
+    "prepare": "bob build"
27
   },
31
   },
28
   "keywords": [
32
   "keywords": [
29
     "react-native",
33
     "react-native",
58
   "repository": {
62
   "repository": {
59
     "type": "git",
63
     "type": "git",
60
     "url": "https://github.com/th3rdwave/react-native-safe-area-context.git"
64
     "url": "https://github.com/th3rdwave/react-native-safe-area-context.git"
65
+  },
66
+  "jest": {
67
+    "modulePathIgnorePatterns": [
68
+      "<rootDir>/lib/"
69
+    ]
70
+  },
71
+  "@react-native-community/bob": {
72
+    "source": "src",
73
+    "output": "lib",
74
+    "targets": [
75
+      "commonjs",
76
+      "module",
77
+      "typescript"
78
+    ]
61
   }
79
   }
62
 }
80
 }