kempo-server 3.1.0 → 3.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/LICENSE.md +60 -0
- package/docs/caching.html +60 -12
- package/docs/cli-utils.html +60 -12
- package/docs/configuration.html +60 -12
- package/docs/examples.html +60 -12
- package/docs/fs-utils.html +60 -12
- package/docs/getting-started.html +60 -12
- package/docs/index.html +60 -12
- package/docs/middleware.html +60 -12
- package/docs/request-response.html +60 -12
- package/docs/routing.html +60 -12
- package/docs/templating.html +61 -13
- package/docs/theme.css +1 -1
- package/docs-src/nav.fragment.html +60 -12
- package/package.json +4 -1
- package/tests/router-custom-route-ssr.node-test.js +5 -5
|
@@ -14,13 +14,35 @@
|
|
|
14
14
|
class="d-if ph"
|
|
15
15
|
style="align-items: center"
|
|
16
16
|
>
|
|
17
|
-
<img
|
|
17
|
+
<img
|
|
18
|
+
src="./media/icon32.png"
|
|
19
|
+
alt="Kempo Server Icon"
|
|
20
|
+
class="pr"
|
|
21
|
+
/>
|
|
18
22
|
Kempo Server
|
|
19
23
|
</a>
|
|
20
24
|
<div class="flex"></div>
|
|
21
|
-
<a
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
<a
|
|
26
|
+
href="https://github.com/dustinpoissant/kempo-server?tab=License-1-ov-file#creative-commons-attribution-noncommercial-sharealike-20"
|
|
27
|
+
target="_blank"
|
|
28
|
+
><k-icon name="license"></k-icon></a>
|
|
29
|
+
<a
|
|
30
|
+
href="https://www.npmjs.com/package/kempo-server"
|
|
31
|
+
target="_blank"
|
|
32
|
+
><k-icon name="npm"></k-icon></a>
|
|
33
|
+
<a
|
|
34
|
+
href="https://github.com/dustinpoissant/kempo-server"
|
|
35
|
+
target="_blank"
|
|
36
|
+
><k-icon name="github-mark"></k-icon></a>
|
|
37
|
+
<k-theme-switcher
|
|
38
|
+
class="mr"
|
|
39
|
+
style="
|
|
40
|
+
--padding: 0.5rem;
|
|
41
|
+
--c_active: var(--tc_on_primary);
|
|
42
|
+
--tc_active: var(--c_primary);
|
|
43
|
+
--c_inactive__hover: rgba(255, 255, 255, 0.1);
|
|
44
|
+
"
|
|
45
|
+
></k-theme-switcher>
|
|
24
46
|
</k-nav>
|
|
25
47
|
<div style="width: 100%; height: 4rem;"></div>
|
|
26
48
|
<k-aside
|
|
@@ -28,24 +50,50 @@
|
|
|
28
50
|
state="offscreen"
|
|
29
51
|
>
|
|
30
52
|
<menu>
|
|
31
|
-
<a
|
|
53
|
+
<a
|
|
54
|
+
href="./"
|
|
55
|
+
class="ta-center bb mb r0"
|
|
56
|
+
>
|
|
32
57
|
<h1 class="tc-primary">Kempo Server</h1>
|
|
33
|
-
<img
|
|
58
|
+
<img
|
|
59
|
+
src="./media/icon128.png"
|
|
60
|
+
alt="Kempo UI Icon"
|
|
61
|
+
/>
|
|
34
62
|
</a>
|
|
35
63
|
<location name="links" />
|
|
36
64
|
</menu>
|
|
65
|
+
<k-aside-spacer></k-aside-spacer>
|
|
66
|
+
<k-theme-switcher
|
|
67
|
+
labels
|
|
68
|
+
style="--padding:var(--spacer_h);margin:var(--spacer_h) auto"
|
|
69
|
+
></k-theme-switcher>
|
|
37
70
|
</k-aside>
|
|
38
|
-
<script
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<script
|
|
71
|
+
<script
|
|
72
|
+
src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3/src/components/Aside.js"
|
|
73
|
+
type="module"
|
|
74
|
+
></script>
|
|
75
|
+
<script
|
|
76
|
+
src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3/src/components/Main.js"
|
|
77
|
+
type="module"
|
|
78
|
+
></script>
|
|
79
|
+
<script
|
|
80
|
+
src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3/src/components/Nav.js"
|
|
81
|
+
type="module"
|
|
82
|
+
></script>
|
|
83
|
+
<script
|
|
84
|
+
src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3/src/components/Icon.js"
|
|
85
|
+
type="module"
|
|
86
|
+
></script>
|
|
87
|
+
<script
|
|
88
|
+
src="https://cdn.jsdelivr.net/npm/kempo-ui@0.3/src/components/ThemeSwitcher.js"
|
|
89
|
+
type="module"
|
|
90
|
+
></script>
|
|
43
91
|
<script>
|
|
44
92
|
document.getElementById('toggleNavSideMenu').addEventListener('click', async () => {
|
|
45
93
|
await window.customElements.whenDefined('k-aside');
|
|
46
94
|
document.getElementById('navSideMenu').toggle();
|
|
47
95
|
});
|
|
48
|
-
document.addEventListener('click', function(e) {
|
|
96
|
+
document.addEventListener('click', function (e) {
|
|
49
97
|
if (e.target.matches('a[href^="#"]')) {
|
|
50
98
|
e.preventDefault();
|
|
51
99
|
const targetId = e.target.getAttribute('href').replace('#', '');
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kempo-server",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.1",
|
|
5
5
|
"description": "A lightweight, zero-dependency, file based routing server.",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./rescan": "./dist/rescan.js",
|
|
@@ -32,5 +32,8 @@
|
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|
|
34
34
|
"url": "https://github.com/dustinpoissant/kempo-server"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"kempo-ui": "^0.3.17"
|
|
35
38
|
}
|
|
36
39
|
}
|
|
@@ -23,7 +23,7 @@ export default {
|
|
|
23
23
|
const template = '<html><body><location name="main" /></body></html>';
|
|
24
24
|
const page = '<page template="default"><content location="main"><h1>Admin Page</h1></content></page>';
|
|
25
25
|
|
|
26
|
-
await write(dir, '
|
|
26
|
+
await write(dir, 'public/default.template.html', template);
|
|
27
27
|
await write(dir, 'admin/dashboard.page.html', page);
|
|
28
28
|
await write(dir, 'public/index.html', '<h1>root</h1>');
|
|
29
29
|
|
|
@@ -57,7 +57,7 @@ export default {
|
|
|
57
57
|
const template = '<html><body><location name="main" /></body></html>';
|
|
58
58
|
const page = '<page template="default"><content location="main"><h1>Section Index</h1></content></page>';
|
|
59
59
|
|
|
60
|
-
await write(dir, '
|
|
60
|
+
await write(dir, 'public/default.template.html', template);
|
|
61
61
|
await write(dir, 'admin/users/index.page.html', page);
|
|
62
62
|
await write(dir, 'public/index.html', '<h1>root</h1>');
|
|
63
63
|
|
|
@@ -115,15 +115,15 @@ export default {
|
|
|
115
115
|
}
|
|
116
116
|
},
|
|
117
117
|
|
|
118
|
-
'wildcard custom route SSR uses
|
|
118
|
+
'wildcard custom route SSR uses public root for template/fragment lookup': async ({pass, fail}) => {
|
|
119
119
|
try {
|
|
120
120
|
await withTempDir(async (dir) => {
|
|
121
121
|
const template = '<html><fragment name="nav" /><location name="main" /></html>';
|
|
122
122
|
const fragment = '<nav>Custom Nav</nav>';
|
|
123
123
|
const page = '<page template="default"><content location="main"><p>Content</p></content></page>';
|
|
124
124
|
|
|
125
|
-
await write(dir, '
|
|
126
|
-
await write(dir, '
|
|
125
|
+
await write(dir, 'public/default.template.html', template);
|
|
126
|
+
await write(dir, 'public/nav.fragment.html', fragment);
|
|
127
127
|
await write(dir, 'admin/about.page.html', page);
|
|
128
128
|
await write(dir, 'public/index.html', '<h1>root</h1>');
|
|
129
129
|
|