Skip to content

Commit beedfc4

Browse files
committed
Initial commit
0 parents  commit beedfc4

26 files changed

+9743
-0
lines changed

.editorconfig

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true
7+
8+
[*.{js,json,jsx,yml}]
9+
charset = utf-8
10+
indent_style = space
11+
indent_size = 2

.eslintrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": [
3+
"inferno-app",
4+
"prettier"
5+
],
6+
"env": {
7+
"node": true
8+
},
9+
"parser": "babel-eslint"
10+
}

.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
6+
# testing
7+
/coverage
8+
9+
# production
10+
/build
11+
12+
# misc
13+
.DS_Store
14+
.env.local
15+
.env.development.local
16+
.env.test.local
17+
.env.production.local
18+
19+
npm-debug.log*
20+
yarn-debug.log*
21+
yarn-error.log*
22+
23+
*.orig
24+
package-lock.json

.travis.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
sudo: false
2+
language: node_js
3+
node_js:
4+
- "8"
5+
cache: yarn
6+
script:
7+
- yarn lint
8+
- yarn build

LICENSE

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
The ISC License (ISC)
2+
3+
Copyright (c) 2016, Megh Parikh
4+
5+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

OLD_README.md

+2,159
Large diffs are not rendered by default.

README.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Frontend
2+
3+
This was built with node and inferno (which is a lightweight react alternative).
4+
5+
Styling is automatically enforced by [prettier](https://prettier.io/)
6+
7+
## Installation
8+
9+
* Enter the directory.
10+
* Installing yarn package manager : https://yarnpkg.com/en/docs/install
11+
* We need node version greater than 6. If your distro does not provide that, you can use nvm to install it
12+
13+
```
14+
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
15+
source ~/.bashrc
16+
nvm install node
17+
source ~/.bashrc
18+
```
19+
20+
* Installing dependencies:
21+
22+
```
23+
yarn install
24+
```
25+
26+
## Starting Frontend dev server
27+
28+
This is the dev server which will auto refresh when you edit any file
29+
30+
Open a new window in your Terminal.
31+
Enter the directory.
32+
33+
```
34+
yarn start
35+
```
36+
37+
## Building frontend
38+
39+
This will build the output files and can be used for deployment or when you want to only work on the backend
40+
41+
```
42+
yarn build
43+
```

fixtures/kitchensink/.env

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
INFERNO_APP_X = x-from-original-env
2+
INFERNO_APP_ORIGINAL_1 = from-original-env-1
3+
INFERNO_APP_ORIGINAL_2 = from-original-env-2

fixtures/kitchensink/.env.development

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
INFERNO_APP_X = x-from-development-env
2+
INFERNO_APP_DEVELOPMENT = development

fixtures/kitchensink/.env.production

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
INFERNO_APP_X = x-from-production-env
2+
INFERNO_APP_PRODUCTION = production
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
import { render } from "inferno";
9+
import PublicUrl from "./PublicUrl";
10+
11+
describe("PUBLIC_URL", () => {
12+
it("renders without crashing", () => {
13+
const div = document.createElement("div");
14+
render(<PublicUrl />, div);
15+
});
16+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
import Inferno from "inferno";
9+
import "./assets/style.css";
10+
import { test, version } from "test-integrity";
11+
12+
export default () => {
13+
const v = version();
14+
if (!test() || v !== "2.0.0") {
15+
throw new Error("Functionality test did not pass.");
16+
}
17+
return <p id="feature-linked-modules">{v}</p>;
18+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
import Inferno from "inferno";
9+
import InfernoDOM from "inferno-dom";
10+
import { test, version } from "test-integrity";
11+
import LinkedModules from "./LinkedModules";
12+
13+
describe("linked modules", () => {
14+
it("has integrity", () => {
15+
expect(test());
16+
expect(version() === "2.0.0");
17+
});
18+
19+
it("renders without crashing", () => {
20+
const div = document.createElement("div");
21+
InfernoDOM.render(<LinkedModules />, div);
22+
});
23+
});

fixtures/kitchensink/src/index.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
import { render } from "inferno";
9+
import App from "./App";
10+
11+
render(<App />, document.getElementById("root"));

package.json

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "contest-frontend",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"inferno": "^3.10.1",
7+
"inferno-component": "^3.10.1",
8+
"inferno-scripts": "5.0.0"
9+
},
10+
"devDependencies": {
11+
"babel-eslint": "^8.0.0",
12+
"eslint": "^4.7.1",
13+
"eslint-config-prettier": "^2.9.0",
14+
"husky": "^0.14.3",
15+
"lint-staged": "^6.0.0",
16+
"prettier": "1.9.2"
17+
},
18+
"scripts": {
19+
"start": "inferno-scripts start",
20+
"build": "inferno-scripts build",
21+
"test": "inferno-scripts test --env=jsdom",
22+
"eject": "inferno-scripts eject",
23+
"lint": "eslint src",
24+
"lint:fix": "eslint src --fix",
25+
"precommit": "lint-staged"
26+
},
27+
"lint-staged": {
28+
"*.js": ["prettier --write", "eslint src/", "git add"],
29+
"*.{json,css,md}": ["prettier --write", "git add"]
30+
}
31+
}

public/favicon.ico

1.12 KB
Binary file not shown.

public/index.html

+40
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>Inferno App</title>
23+
</head>
24+
<body>
25+
<div id="app"></div>
26+
<noscript>
27+
You need to enable JavaScript to run this app.
28+
</noscript>
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

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"short_name": "Inferno App",
3+
"name": "Create Inferno App Sample",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "192x192",
8+
"type": "image/png"
9+
}
10+
],
11+
"start_url": "./index.html",
12+
"display": "standalone",
13+
"theme_color": "#000000",
14+
"background_color": "#ffffff"
15+
}

src/App.css

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.App {
2+
text-align: center;
3+
}
4+
5+
.App-logo {
6+
height: 80px;
7+
}
8+
9+
.App-header {
10+
background-color: #f8f8f8;
11+
height: 150px;
12+
padding: 20px;
13+
color: #3d464d;
14+
}
15+
16+
.App-intro {
17+
font-size: large;
18+
}
19+
20+
code {
21+
color: #e73a37;
22+
}

src/App.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { version } from "inferno";
2+
import Component from "inferno-component";
3+
import "./registerServiceWorker";
4+
import Logo from "./logo";
5+
import "./App.css";
6+
7+
class App extends Component {
8+
render() {
9+
return (
10+
<div className="App">
11+
<header className="App-header">
12+
<Logo width="80" height="80" />
13+
<h1>{`Welcome to Inferno ${version}`}</h1>
14+
</header>
15+
<p className="App-intro">
16+
To get started, edit <code>src/App.js</code> and save to reload.
17+
</p>
18+
</div>
19+
);
20+
}
21+
}
22+
23+
export default App;

src/App.test.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { render } from "inferno";
2+
import App from "./App";
3+
4+
it("renders without crashing", () => {
5+
const div = document.createElement("div");
6+
render(<App />, div);
7+
});

src/index.css

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
body {
2+
margin: 0;
3+
padding: 0;
4+
font-family: "Open Sans", "lucida grande", "Segoe UI", arial, verdana,
5+
"lucida sans unicode", tahoma, sans-serif;
6+
}

src/index.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { render } from "inferno";
2+
import App from "./App";
3+
import "./index.css";
4+
5+
render(<App />, document.getElementById("app"));

src/logo.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
export default ({ width, height }) => {
2+
return (
3+
<svg
4+
version="1.0"
5+
xmlns="http://www.w3.org/2000/svg"
6+
viewBox="0 0 320 320"
7+
width={width}
8+
height={height}
9+
preserveAspectRatio="xMidYMid meet"
10+
>
11+
<g fill="#494949" stroke="none">
12+
<path
13+
fill="#FF3232"
14+
d="m144.9 258.5c-43.4-6.1-78.3-46.3-79.2-90-0.7-25.3 8.3-51.7 27-69.1-2 10-8.4 22.4-6.5 34.1 0 14.4 13.7 28.5 28.5 24.6 13.3-3.2 18.3-18.8 14.7-30.8-3.6-16.3-12.1-31.8-9.6-49 2.4-32.4 26.9-58 53.9-73.3 5.5-4 3.6-0.7 1.1 3.2-9.2 14.9-10.5 34-2.6 49.7 11.5 27 34 50.4 35.3 81 0.3 6.3-1.9 22.4 7.3 12 14.6-13.6 13.5-36.2 6.9-53.5-1.8-9.7 9.9 6.6 12.8 9.4 25.3 31.7 26.7 79.9 2.7 112.8-20.1 29.2-57.2 44.9-92.1 38.9z"
15+
/>
16+
<path
17+
d="M139.3 315.4C82.4 307.7 34.8 268.1 16.4 213.1 10.7 196 9.1 185.5 9 165.5c0-12.5 0.4-19.6 1.8-27 11-59.3 54.6-106 112.4-120.6 6.3-1.6 12-2.9 12.8-2.9 2.5 0 1.5 2.1-3.5 7.6-10.7 11.7-19.3 27.7-22.8 42.3l-1.7 7.4-7 4.8C77.3 93 61.3 117.3 56 145.1c-1.9 9.8-2.1 29-0.5 38.1 7.9 43.8 41.7 78.1 85 86.3 16.8 3.2 38.6 1.5 54.3-4.1 31.8-11.4 56-36.3 66-67.9 3.7-11.8 4.8-19.2 4.8-32.3 0-24.5-7-45.2-21.8-64.9-12.9-17.1-28.6-27.9-54.5-37.5-3.3-1.2-7.3-9.7-9.4-19.8-1.6-7.8-0.9-15.2 2.1-22.7 1.5-3.7 2.1-4.2 4.8-4.2 4.9 0 20.8 4.6 31.5 9 45.6 19 79.3 59.9 89.9 109 3.3 15.1 3.7 43.1 0.9 58-14.9 80.2-89.5 134.4-169.9 123.5z"
18+
fill="#494949"
19+
/>
20+
</g>
21+
</svg>
22+
);
23+
};

0 commit comments

Comments
 (0)