Skip to content

Commit 7294bdc

Browse files
committed
update template for hyperapp 2
1 parent b6fc89c commit 7294bdc

9 files changed

Lines changed: 57 additions & 34 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-hyperapp",
3-
"version": "0.2.0",
3+
"version": "0.3.0",
44
"description": "Create Hyperapps with no build configuration",
55
"bin": {
66
"create-hyperapp": "./bin/index.js"

template/public/index.html

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
4-
<head>
5-
<meta charset="utf-8">
6-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7-
<meta name="theme-color" content="#000000">
8-
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.png">
9-
<!--
10-
manifest.json provides metadata used when your web app is added to the
11-
homescreen on Android. See https://developers.google.com/web/fundamentals/web-app-manifest/
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<meta
9+
name="description"
10+
content="Web site created using create-react-app"
11+
/>
12+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13+
<!--
14+
manifest.json provides metadata used when your web app is installed on a
15+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
1216
-->
13-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
14-
<!--
17+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18+
<!--
1519
Notice the use of %PUBLIC_URL% in the tags above.
1620
It will be replaced with the URL of the `public` folder during the build.
1721
Only files inside the `public` folder can be referenced from the HTML.
@@ -20,14 +24,15 @@
2024
work correctly both with client-side routing and a non-root public URL.
2125
Learn how to configure a non-root public URL by running `npm run build`.
2226
-->
23-
<title>Hyperapp</title>
24-
</head>
27+
<title>Hyperapp</title>
28+
</head>
2529

26-
<body>
27-
<noscript>
28-
You need to enable JavaScript to run this app.
29-
</noscript>
30-
<!--
30+
<body>
31+
<noscript>
32+
You need to enable JavaScript to run this app.
33+
</noscript>
34+
<div id="app"></div>
35+
<!--
3136
This HTML file is a template.
3237
If you open it directly in the browser, you will see an empty page.
3338
@@ -37,6 +42,5 @@
3742
To begin the development, run `npm start` or `yarn start`.
3843
To create a production bundle, use `npm run build` or `yarn build`.
3944
-->
40-
</body>
41-
42-
</html>
45+
</body>
46+
</html>

template/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": "Hyperapp",
3+
"name": "Create Hyperapp Sample",
4+
"icons": [
5+
{
6+
"src": "favicon.png",
7+
"type": "image/png",
8+
"sizes": "256x256"
9+
}
10+
],
11+
"start_url": ".",
12+
"display": "standalone",
13+
"theme_color": "#000000",
14+
"background_color": "#ffffff"
15+
}

template/public/robots.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://www.robotstxt.org/robotstxt.html
2+
User-agent: *
3+
Disallow:

template/src/App.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@
33
}
44

55
.App-logo {
6-
animation: App-logo-spin infinite 20s linear;
76
height: 40vmin;
7+
pointer-events: none;
8+
}
9+
10+
@media (prefers-reduced-motion: no-preference) {
11+
.App-logo {
12+
animation: App-logo-spin infinite 20s linear;
13+
}
814
}
915

1016
.App-header {

template/src/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const App = () => (
1111
</p>
1212
<a
1313
className="App-link"
14-
href="https://hyperapp.js.org"
14+
href="https://hyperapp.dev"
1515
target="_blank"
1616
rel="noopener noreferrer"
1717
>

template/src/App.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import { h, app } from "hyperapp";
22
import App from "./App";
33

44
it("renders without crashing", () => {
5-
app({}, {}, () => <App />, document.body);
5+
app({ view: () => <App />, node: document.getElementById("app") });
66
});

template/src/index.css

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
body {
22
margin: 0;
3-
padding: 0;
4-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
5-
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
3+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4+
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
65
sans-serif;
76
-webkit-font-smoothing: antialiased;
87
-moz-osx-font-smoothing: grayscale;
98
}
109

1110
code {
12-
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
11+
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
1312
monospace;
1413
}

template/src/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,4 @@ import { h, app } from "hyperapp";
22
import "./index.css";
33
import App from "./App";
44

5-
const state = {};
6-
7-
const actions = {};
8-
9-
app(state, actions, () => <App />, document.body);
5+
app({ view: () => <App />, node: document.getElementById("app") });

0 commit comments

Comments
 (0)