@stanlemon/app-template 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.coverage/App.tsx.html +197 -0
- package/.coverage/base.css +224 -0
- package/.coverage/block-navigation.js +87 -0
- package/.coverage/coverage-final.json +3 -0
- package/.coverage/favicon.png +0 -0
- package/.coverage/index.html +132 -0
- package/.coverage/index.tsx.html +101 -0
- package/.coverage/lcov-report/App.tsx.html +197 -0
- package/.coverage/lcov-report/base.css +224 -0
- package/.coverage/lcov-report/block-navigation.js +87 -0
- package/.coverage/lcov-report/favicon.png +0 -0
- package/.coverage/lcov-report/index.html +132 -0
- package/.coverage/lcov-report/index.tsx.html +101 -0
- package/.coverage/lcov-report/prettify.css +1 -0
- package/.coverage/lcov-report/prettify.js +2 -0
- package/.coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/.coverage/lcov-report/sorter.js +196 -0
- package/.coverage/lcov-report/template/coverage/block-navigation.js.html +347 -0
- package/.coverage/lcov-report/template/coverage/index.html +147 -0
- package/.coverage/lcov-report/template/coverage/lcov-report/block-navigation.js.html +347 -0
- package/.coverage/lcov-report/template/coverage/lcov-report/index.html +147 -0
- package/.coverage/lcov-report/template/coverage/lcov-report/prettify.js.html +92 -0
- package/.coverage/lcov-report/template/coverage/lcov-report/sorter.js.html +674 -0
- package/.coverage/lcov-report/template/coverage/prettify.js.html +92 -0
- package/.coverage/lcov-report/template/coverage/sorter.js.html +674 -0
- package/.coverage/lcov-report/template/index.html +132 -0
- package/.coverage/lcov-report/template/jest.config.js.html +86 -0
- package/.coverage/lcov-report/template/src/App.tsx.html +197 -0
- package/.coverage/lcov-report/template/src/index.html +132 -0
- package/.coverage/lcov-report/template/src/index.tsx.html +101 -0
- package/.coverage/lcov-report/template/webpack.config.js.html +89 -0
- package/.coverage/lcov.info +41 -0
- package/.coverage/prettify.css +1 -0
- package/.coverage/prettify.js +2 -0
- package/.coverage/sort-arrow-sprite.png +0 -0
- package/.coverage/sorter.js +196 -0
- package/.coverage/template/coverage/block-navigation.js.html +347 -0
- package/.coverage/template/coverage/index.html +147 -0
- package/.coverage/template/coverage/lcov-report/block-navigation.js.html +347 -0
- package/.coverage/template/coverage/lcov-report/index.html +147 -0
- package/.coverage/template/coverage/lcov-report/prettify.js.html +92 -0
- package/.coverage/template/coverage/lcov-report/sorter.js.html +674 -0
- package/.coverage/template/coverage/prettify.js.html +92 -0
- package/.coverage/template/coverage/sorter.js.html +674 -0
- package/.coverage/template/index.html +132 -0
- package/.coverage/template/jest.config.js.html +86 -0
- package/.coverage/template/src/App.tsx.html +197 -0
- package/.coverage/template/src/index.html +132 -0
- package/.coverage/template/src/index.tsx.html +101 -0
- package/.coverage/template/webpack.config.js.html +89 -0
- package/.eslintrc.json +5 -0
- package/index.html +17 -0
- package/jest.config.js +1 -0
- package/package.json +19 -0
- package/src/App.less +5 -0
- package/src/App.test.tsx +19 -0
- package/src/App.tsx +19 -0
- package/src/Header.jsx +4 -0
- package/src/Input.tsx +37 -0
- package/src/index.tsx +4 -0
- package/tsconfig.json +3 -0
- package/webpack.config.js +1 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
<title>Code coverage report for template/webpack.config.js</title>
|
|
7
|
+
<meta charset="utf-8" />
|
|
8
|
+
<link rel="stylesheet" href="../prettify.css" />
|
|
9
|
+
<link rel="stylesheet" href="../base.css" />
|
|
10
|
+
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
|
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
+
<style type='text/css'>
|
|
13
|
+
.coverage-summary .sorter {
|
|
14
|
+
background-image: url(../sort-arrow-sprite.png);
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<div class='wrapper'>
|
|
21
|
+
<div class='pad1'>
|
|
22
|
+
<h1><a href="../index.html">All files</a> / <a href="index.html">template</a> webpack.config.js</h1>
|
|
23
|
+
<div class='clearfix'>
|
|
24
|
+
|
|
25
|
+
<div class='fl pad1y space-right2'>
|
|
26
|
+
<span class="strong">0% </span>
|
|
27
|
+
<span class="quiet">Statements</span>
|
|
28
|
+
<span class='fraction'>0/0</span>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<div class='fl pad1y space-right2'>
|
|
33
|
+
<span class="strong">0% </span>
|
|
34
|
+
<span class="quiet">Branches</span>
|
|
35
|
+
<span class='fraction'>0/0</span>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
<div class='fl pad1y space-right2'>
|
|
40
|
+
<span class="strong">0% </span>
|
|
41
|
+
<span class="quiet">Functions</span>
|
|
42
|
+
<span class='fraction'>0/0</span>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<div class='fl pad1y space-right2'>
|
|
47
|
+
<span class="strong">0% </span>
|
|
48
|
+
<span class="quiet">Lines</span>
|
|
49
|
+
<span class='fraction'>0/0</span>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
<p class="quiet">
|
|
55
|
+
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
|
+
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
</div>
|
|
64
|
+
<div class='status-line low'></div>
|
|
65
|
+
<pre><table class="coverage">
|
|
66
|
+
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
|
+
<a name='L2'></a><a href='#L2'>2</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
68
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">export { default } from "@stanlemon/webdev/webpack.config.js";
|
|
69
|
+
</pre></td></tr></table></pre>
|
|
70
|
+
|
|
71
|
+
<div class='push'></div><!-- for sticky footer -->
|
|
72
|
+
</div><!-- /wrapper -->
|
|
73
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
|
74
|
+
Code coverage generated by
|
|
75
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener">istanbul</a>
|
|
76
|
+
at Thu Dec 16 2021 19:53:58 GMT-0500 (Eastern Standard Time)
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
<script src="../prettify.js"></script>
|
|
80
|
+
<script>
|
|
81
|
+
window.onload = function () {
|
|
82
|
+
prettyPrint();
|
|
83
|
+
};
|
|
84
|
+
</script>
|
|
85
|
+
<script src="../sorter.js"></script>
|
|
86
|
+
<script src="../block-navigation.js"></script>
|
|
87
|
+
</body>
|
|
88
|
+
</html>
|
|
89
|
+
|
package/index.html
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<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
|
+
<title>App</title>
|
|
8
|
+
</head>
|
|
9
|
+
|
|
10
|
+
<body>
|
|
11
|
+
<noscript>
|
|
12
|
+
You need to enable JavaScript to run this app.
|
|
13
|
+
</noscript>
|
|
14
|
+
<div id="root"></div>
|
|
15
|
+
</body>
|
|
16
|
+
|
|
17
|
+
</html>
|
package/jest.config.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@stanlemon/webdev/jest.config.js";
|
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stanlemon/app-template",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "A template for creating apps using the webdev package.",
|
|
5
|
+
"author": "Stan Lemon <stanlemon@users.noreply.github.com>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"start": "webpack serve",
|
|
10
|
+
"build": "NODE_ENV=production webpack",
|
|
11
|
+
"test": "jest",
|
|
12
|
+
"test:coverage": "jest --coverage",
|
|
13
|
+
"lint": "eslint --ext js,jsx,ts,tsx ./src/",
|
|
14
|
+
"lint:format": "eslint --fix --ext js,jsx,ts,tsx ./src/"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@stanlemon/webdev": "*"
|
|
18
|
+
}
|
|
19
|
+
}
|
package/src/App.less
ADDED
package/src/App.test.tsx
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { render, screen, fireEvent } from "@testing-library/react";
|
|
2
|
+
import userEvent from "@testing-library/user-event";
|
|
3
|
+
import App from "./App";
|
|
4
|
+
|
|
5
|
+
test("<App/>", () => {
|
|
6
|
+
render(<App />);
|
|
7
|
+
|
|
8
|
+
// The header is present
|
|
9
|
+
expect(screen.getByRole("heading")).toHaveTextContent("Hello World!");
|
|
10
|
+
|
|
11
|
+
// Type some data into the input
|
|
12
|
+
userEvent.type(screen.getByRole("textbox"), "The first item");
|
|
13
|
+
|
|
14
|
+
// Click the add button
|
|
15
|
+
fireEvent.click(screen.getByRole("button"));
|
|
16
|
+
|
|
17
|
+
// Now we should have a list item with the text we entered
|
|
18
|
+
expect(screen.getByRole("listitem")).toHaveTextContent("The first item");
|
|
19
|
+
});
|
package/src/App.tsx
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import "./App.less";
|
|
3
|
+
import Header from "./Header";
|
|
4
|
+
import Input from "./Input";
|
|
5
|
+
|
|
6
|
+
export default function App() {
|
|
7
|
+
const [items, setItems] = useState<string[]>([]);
|
|
8
|
+
return (
|
|
9
|
+
<div>
|
|
10
|
+
<Header />
|
|
11
|
+
<Input onClick={(item) => setItems([...items, item])} />
|
|
12
|
+
<ul>
|
|
13
|
+
{items.map((item, i) => (
|
|
14
|
+
<li key={i}>{item}</li>
|
|
15
|
+
))}
|
|
16
|
+
</ul>
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
}
|
package/src/Header.jsx
ADDED
package/src/Input.tsx
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
|
|
3
|
+
export default function Input({
|
|
4
|
+
onClick,
|
|
5
|
+
}: {
|
|
6
|
+
onClick: (value: string) => void;
|
|
7
|
+
}) {
|
|
8
|
+
const [value, setValue] = useState("");
|
|
9
|
+
|
|
10
|
+
const handleChange = (e: React.ChangeEvent<HTMLInputElement>): void => {
|
|
11
|
+
setValue(e.currentTarget.value);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const handleKeyPress = (e: React.KeyboardEvent<HTMLInputElement>): void => {
|
|
15
|
+
if (e.key === "Enter") {
|
|
16
|
+
e.preventDefault();
|
|
17
|
+
handleClick();
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const handleClick = () => {
|
|
22
|
+
onClick(value);
|
|
23
|
+
setValue("");
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<>
|
|
28
|
+
<input
|
|
29
|
+
type="text"
|
|
30
|
+
onChange={handleChange}
|
|
31
|
+
onKeyPress={handleKeyPress}
|
|
32
|
+
value={value}
|
|
33
|
+
/>
|
|
34
|
+
<button onClick={handleClick}>Add</button>
|
|
35
|
+
</>
|
|
36
|
+
);
|
|
37
|
+
}
|
package/src/index.tsx
ADDED
package/tsconfig.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@stanlemon/webdev/webpack.config.js";
|