Browse Source

fix tsconfig and export WebView in index

KaFai Choi 6 years ago
parent
commit
ad40610c33
5 changed files with 38 additions and 34 deletions
  1. 3
    0
      index.js
  2. 2
    2
      package.json
  3. 2
    10
      src/index.ts
  4. 19
    19
      tsconfig.base.json
  5. 12
    3
      yarn.lock

+ 3
- 0
index.js View File

@@ -0,0 +1,3 @@
1
+import WebView from "./WebView";
2
+
3
+export { WebView };

+ 2
- 2
package.json View File

@@ -13,7 +13,7 @@
13 13
   "scripts": {
14 14
     "prebuild": "rimraf lib",
15 15
     "prepare": "yarn run build",
16
-    "build": "tsc",
16
+    "build": "tsc -p tsconfig.base.json && cp ./index.js ./lib/index.js",
17 17
     "ci:publish": "yarn semantic-release",
18 18
     "ci:test": "yarn ci:test:build",
19 19
     "ci:test:build": "yarn build",
@@ -31,7 +31,7 @@
31 31
     "@semantic-release/git": "7.0.5",
32 32
     "@types/invariant": "^2.2.29",
33 33
     "@types/react": "^16.4.18",
34
-    "@types/react-native": "^0.57.6",
34
+    "@types/react-native": "^0.57.6",    
35 35
     "react-native": "^0.57",
36 36
     "rimraf": "^2.6.2",
37 37
     "semantic-release": "15.10.3",

+ 2
- 10
src/index.ts View File

@@ -1,10 +1,2 @@
1
-import IOSWebView from "./WebView.ios"; 
2
-import AndroidWebView from "./WebView.android"; 
3
-
4
-declare var _test1: typeof IOSWebView;
5
-declare var _test2: typeof AndroidWebView;
6
-console.log('_test1', _test1)
7
-console.log('_test2', _test2)
8
-
9
-/// export to get the shape of the module
10
-export default { WebView: IOSWebView}
1
+export * from './types/WebViewTypes'
2
+export * from './WebView.ios'

+ 19
- 19
tsconfig.base.json View File

@@ -1,28 +1,28 @@
1 1
 {
2 2
   "compilerOptions": {
3
+    "strictNullChecks": false,
4
+    "alwaysStrict": true,
5
+    "allowSyntheticDefaultImports": true,
3 6
     "declaration": true,
4
-    "declarationDir": "lib",    
7
+    "declarationDir": "lib",
8
+    "emitDecoratorMetadata": false,
5 9
     "esModuleInterop": true,
6
-    "isolatedModules": false,
7
-    "outDir": "./lib",
8
-    "moduleResolution": "node",
9
-    "module": "esnext",
10
-    "experimentalDecorators": true,
11
-    "allowSyntheticDefaultImports": true,
12
-    "lib": ["es6"],
13
-    "sourceMap": true,
14
-    "removeComments": true,
10
+    "outDir": "lib",
15 11
     "jsx": "react-native",
16
-    "strict": true,
12
+    "lib": ["es6"],
13
+    "module": "esnext",
14
+    "moduleResolution": "node",
15
+    "noFallthroughCasesInSwitch": true,
17 16
     "noImplicitAny": true,
18
-    "strictNullChecks": false,
19
-    "strictFunctionTypes": true,
17
+    "noImplicitReturns": true,
20 18
     "noImplicitThis": true,
21
-    "alwaysStrict": true,
22 19
     "noUnusedLocals": true,
23
-    "noImplicitReturns": true,
24
-    "noFallthroughCasesInSwitch": true,
25
-    "resolveJsonModule": true,
26
-    "target": "esnext"
20
+    "noUnusedParameters": true,
21
+    "pretty": true,
22
+    "removeComments": true,
23
+    "sourceMap": true,
24
+    "strict": true,
25
+    "stripInternal": true,
26
+    "target": "es5"
27 27
   }
28
-}
28
+}

+ 12
- 3
yarn.lock View File

@@ -749,19 +749,28 @@
749 749
   resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.5.6.tgz#9c03d3fed70a8d517c191b7734da2879b50ca26c"
750 750
 
751 751
 "@types/react-native@^0.57.6":
752
-  version "0.57.6"
753
-  resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.57.6.tgz#b53afeebcb19f7ba353f0937b6778d39c2cf10d0"
752
+  version "0.57.13"
753
+  resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.57.13.tgz#02dc7b8f5b291b290e047fb0da3ceaa27d7c71b9"
754
+  integrity sha512-0r6XoeIz4rujZx7ZKKE58ilSxlReXbIVBFAquTuzrIV0SP+EDjI+ePwIhfnMn/F3Wt2b2R/GXqFsW643lKwmLA==
754 755
   dependencies:
755 756
     "@types/prop-types" "*"
756 757
     "@types/react" "*"
757 758
 
758
-"@types/react@*", "@types/react@^16.4.18":
759
+"@types/react@*":
759 760
   version "16.4.18"
760 761
   resolved "https://registry.yarnpkg.com/@types/react/-/react-16.4.18.tgz#2e28a2e7f92d3fa7d6a65f2b73275c3e3138a13d"
761 762
   dependencies:
762 763
     "@types/prop-types" "*"
763 764
     csstype "^2.2.0"
764 765
 
766
+"@types/react@^16.4.18":
767
+  version "16.7.7"
768
+  resolved "https://registry.yarnpkg.com/@types/react/-/react-16.7.7.tgz#1e5e23e7dd922968ed4b484cdec00a5402c9f31b"
769
+  integrity sha512-dJiq7CKxD1XJ/GqmbnsQisFnzG4z5lntKBw9X9qeSrguxFbrrhGa8cK9s0ONBp8wL1EfGfofEDVhjen26U46pw==
770
+  dependencies:
771
+    "@types/prop-types" "*"
772
+    csstype "^2.2.0"
773
+
765 774
 JSONStream@^1.0.4, JSONStream@^1.3.4:
766 775
   version "1.3.5"
767 776
   resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0"