Skip to content

Commit fcc41df

Browse files
committed
Add empty react-js web example app
1 parent 9d9ed6f commit fcc41df

13 files changed

+8963
-3
lines changed

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@
2323
],
2424
"scripts": {
2525
"test": "NODE_ENV=test JEST_JUNIT_OUTPUT_DIR=reports TZ=UTC jest",
26-
"lint": "eslint src/ tests/ example/",
26+
"lint": "eslint src/ tests/ example/ web_example/",
2727
"typescript": "tsc --noEmit",
2828
"prepare": "bob build",
2929
"release": "release-it",
3030
"example": "yarn --cwd example",
31+
"web_example": "yarn --cwd web_example",
3132
"pods": "cd example && pod-install --quiet",
32-
"bootstrap": "yarn example && yarn && yarn pods"
33+
"bootstrap": "yarn example && yarn web_example && yarn && yarn pods"
3334
},
3435
"keywords": [
3536
"react-native",

tsconfig.build.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

22
{
33
"extends": "./tsconfig",
4-
"exclude": ["example"]
4+
"exclude": ["example", "web_example"]
55
}

web_example/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
This example was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2+
3+
It is linked to the react-native-ui-kit package in the parent directory for development purposes.
4+
5+
You can run `yarn install` and then `yarn start` to test your package.

web_example/package.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "react-native-ui-kit-example",
3+
"homepage": ".",
4+
"version": "0.0.0",
5+
"private": true,
6+
"scripts": {
7+
"start": "react-scripts start",
8+
"build": "react-scripts build",
9+
"test": "react-scripts test",
10+
"eject": "react-scripts eject"
11+
},
12+
"dependencies": {
13+
"react": "17.0.2",
14+
"react-dom": "17.0.2",
15+
"react-native-ui-kit": "link:..",
16+
"typescript": "link:../node_modules/typescript"
17+
},
18+
"devDependencies": {
19+
"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
20+
"@types/react": "17.0.2",
21+
"@types/react-dom": "17.0.2",
22+
"react-scripts": "^5.0.1"
23+
},
24+
"browserslist": {
25+
"production": [
26+
">0.2%",
27+
"not dead",
28+
"not op_mini all"
29+
],
30+
"development": [
31+
"last 1 chrome version",
32+
"last 1 firefox version",
33+
"last 1 safari version"
34+
]
35+
}
36+
}

web_example/public/favicon.ico

3.78 KB
Binary file not shown.

web_example/public/index.html

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

web_example/public/manifest.json

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

web_example/src/App.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import React from 'react';
2+
3+
const App = () => (
4+
<span>Hola!</span>
5+
);
6+
7+
export default App;

web_example/src/index.css

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
body {
2+
margin: 0;
3+
padding: 0;
4+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
5+
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
6+
sans-serif;
7+
-webkit-font-smoothing: antialiased;
8+
-moz-osx-font-smoothing: grayscale;
9+
}
10+
11+
code {
12+
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
13+
monospace;
14+
}

web_example/src/index.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import './index.css';
2+
3+
import React from 'react';
4+
import ReactDOM from 'react-dom';
5+
import App from './App';
6+
7+
ReactDOM.render( <App />, document.getElementById( 'root' ) );

web_example/src/react-app-env.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="react-scripts" />

web_example/tsconfig.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"compilerOptions": {
3+
"outDir": "dist",
4+
"module": "esnext",
5+
"lib": ["dom", "esnext"],
6+
"moduleResolution": "node",
7+
"jsx": "react",
8+
"sourceMap": true,
9+
"declaration": true,
10+
"esModuleInterop": true,
11+
"noImplicitReturns": true,
12+
"noImplicitThis": true,
13+
"noImplicitAny": true,
14+
"strictNullChecks": true,
15+
"suppressImplicitAnyIndexErrors": true,
16+
"noUnusedLocals": true,
17+
"noUnusedParameters": true,
18+
"allowSyntheticDefaultImports": true
19+
},
20+
"include": ["src"],
21+
"exclude": ["node_modules", "build"]
22+
}

0 commit comments

Comments
 (0)