Skip to content

Commit bfb8eac

Browse files
committed
feat: first commit
0 parents  commit bfb8eac

File tree

20 files changed

+10240
-0
lines changed

20 files changed

+10240
-0
lines changed

.gitignore

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
project.xcworkspace
24+
25+
# Android/IntelliJ
26+
#
27+
build/
28+
.idea
29+
.gradle
30+
local.properties
31+
*.iml
32+
33+
# node.js
34+
#
35+
node_modules/
36+
npm-debug.log
37+
yarn-error.log
38+
39+
# BUCK
40+
#
41+
buck-out/
42+
\.buckd/
43+
*.keystore
44+
45+
# fastlane
46+
#
47+
*/fastlane/report.xml
48+
*/fastlane/Preview.html
49+
*/fastlane/screenshots
50+
51+
# Platforms
52+
#
53+
/ios
54+
/android
55+
56+
# Tests
57+
#
58+
/coverage

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# React Native Web with Typescript
2+
3+
## install
4+
5+
```sh
6+
git clone [email protected]:ethanneff/react-native-web-typescript.git
7+
cd react-native-typescript
8+
yarn install
9+
yarn rebuild
10+
```
11+
12+
### run
13+
14+
```sh
15+
yarn ios
16+
```
17+
18+
```sh
19+
yarn android
20+
```
21+
22+
```sh
23+
yarn web
24+
```
25+
26+
### lint
27+
28+
```sh
29+
yarn lint
30+
```
31+
32+
### test
33+
34+
```sh
35+
yarn test
36+
```
37+
38+
### deploy
39+
40+
```sh
41+
yarn build
42+
```

app.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "example",
3+
"displayName": "example"
4+
}

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// app entry
2+
import App from "./src";
3+
export default App;

package.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"name": "example",
3+
"version": "0.0.1",
4+
"private": true,
5+
"scripts": {
6+
"web": "react-scripts-ts start",
7+
"build": "react-scripts-ts build",
8+
"ios": "react-native run-ios",
9+
"android": "react-native run-android",
10+
"test": "jest --coverage",
11+
"lint": "tslint -c tslint.json 'src/**/*.ts{,x}'",
12+
"rebuild": "rm -rf ios; rm -rf android; react-native upgrade; rm -f .babelrc; rm -f .buckconfig; rm -f .flowconfig; rm -f .watchmanconfig; rm -f .gitattributes;"
13+
},
14+
"dependencies": {
15+
"react": "^16.3.2",
16+
"react-dom": "^16.3.2",
17+
"react-native": "0.55.4",
18+
"react-native-web": "^0.7.2",
19+
"react-scripts-ts": "^2.16.0"
20+
},
21+
"devDependencies": {
22+
"@types/jest": "^22.2.3",
23+
"@types/react": "^16.3.14",
24+
"@types/react-native": "^0.55.15",
25+
"@types/react-test-renderer": "^16.0.1",
26+
"babel-jest": "22.4.4",
27+
"babel-preset-react-native": "4.0.0",
28+
"jest": "22.4.4",
29+
"prettier": "^1.12.1",
30+
"react-art": "^16.3.2",
31+
"react-native-typescript-transformer": "^1.2.5",
32+
"react-test-renderer": "^16.3.2",
33+
"ts-jest": "^22.4.6",
34+
"typescript": "^2.8.3"
35+
},
36+
"babel": {
37+
"presets": ["react-native"]
38+
},
39+
"jest": {
40+
"preset": "react-native",
41+
"transform": {
42+
"^.+\\.jsx?$": "<rootDir>/node_modules/babel-jest",
43+
"^.+\\.tsx?$": "ts-jest"
44+
},
45+
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
46+
"moduleFileExtensions": [
47+
"ts",
48+
"tsx",
49+
"js",
50+
"jsx",
51+
"json",
52+
"node"
53+
],
54+
"globals": {
55+
"ts-jest": {
56+
"useBabelrc": true
57+
}
58+
}
59+
}
60+
}

public/favicon.ico

3.78 KB
Binary file not shown.

public/index.html

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6+
<meta name="theme-color" content="#000000">
7+
<!--
8+
manifest.json provides metadata used when your web app is added to the
9+
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
10+
-->
11+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
12+
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
13+
<!--
14+
Notice the use of %PUBLIC_URL% in the tags above.
15+
It will be replaced with the URL of the `public` folder during the build.
16+
Only files inside the `public` folder can be referenced from the HTML.
17+
18+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
19+
work correctly both with client-side routing and a non-root public URL.
20+
Learn how to configure a non-root public URL by running `npm run build`.
21+
-->
22+
<title>React App</title>
23+
</head>
24+
<body>
25+
<noscript>
26+
You need to enable JavaScript to run this app.
27+
</noscript>
28+
<div id="root"></div>
29+
<!--
30+
This HTML file is a template.
31+
If you open it directly in the browser, you will see an empty page.
32+
33+
You can add webfonts, meta tags, or analytics to this file.
34+
The build step will place the bundled scripts into the <body> tag.
35+
36+
To begin the development, run `npm start` or `yarn start`.
37+
To create a production bundle, use `npm run build` or `yarn build`.
38+
-->
39+
</body>
40+
</html>

public/manifest.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"short_name": "React App",
3+
"name": "Create React App Sample",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
}
10+
],
11+
"start_url": "./index.html",
12+
"display": "standalone",
13+
"theme_color": "#000000",
14+
"background_color": "#ffffff"
15+
}

rn-cli.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
getTransformModulePath() {
3+
return require.resolve("react-native-typescript-transformer");
4+
},
5+
getSourceExts() {
6+
return ["ts", "tsx"];
7+
}
8+
};

0 commit comments

Comments
 (0)