miki-template 2.0.0 → 2.2.2
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/.github/workflows/ci.yml +14 -10
- package/.github/workflows/docs.yml +105 -0
- package/.github/workflows/npm-publish-github-packages.yml +36 -0
- package/README.md +142 -26
- package/assets/logo.png +0 -0
- package/benchmarks/ejs-results.json +17 -0
- package/benchmarks/ejs.js +36 -0
- package/benchmarks/handlebars-results.json +17 -0
- package/benchmarks/handlebars.js +48 -0
- package/benchmarks/miki-results.json +17 -0
- package/benchmarks/miki.js +36 -0
- package/benchmarks/pug-results.json +17 -0
- package/benchmarks/pug.js +36 -0
- package/benchmarks/run.js +69 -37
- package/benchmarks/stress.mjs +1 -1
- package/docs/api/async-render.md +85 -0
- package/docs/api/cache.md +87 -0
- package/docs/api/compile.md +128 -0
- package/docs/api/context-processors.md +77 -0
- package/docs/api/filters.md +217 -0
- package/docs/api/finder.md +94 -0
- package/docs/api/helpers.md +53 -0
- package/docs/api/i18n.md +157 -0
- package/docs/api/index.md +54 -0
- package/docs/api/libraries.md +207 -0
- package/docs/api/render-partial.md +81 -0
- package/docs/api/render.md +92 -0
- package/docs/api/security.md +145 -0
- package/docs/api/setup-express.md +76 -0
- package/docs/api/tags.md +134 -0
- package/docs/assets/banner.png +0 -0
- package/docs/assets/logo.png +0 -0
- package/docs/guide/advanced-usage.md +397 -0
- package/docs/guide/async-rendering.md +308 -0
- package/docs/guide/context-processors.md +257 -0
- package/docs/guide/custom-filters.md +311 -0
- package/docs/guide/custom-tags.md +271 -0
- package/docs/guide/filters.md +642 -0
- package/docs/guide/getting-started.md +102 -0
- package/docs/guide/installation.md +95 -0
- package/docs/guide/partial-templates.md +367 -0
- package/docs/guide/quick-start.md +222 -0
- package/docs/guide/security.md +345 -0
- package/docs/guide/tags.md +783 -0
- package/docs/guide/template-discovery.md +170 -0
- package/docs/guide/template-inheritance.md +273 -0
- package/docs/guide/what-is-miki-template.md +28 -0
- package/docs/guide/why-miki-template.md +75 -0
- package/docs/index.md +104 -0
- package/docs/integrations/elysia.md +78 -0
- package/docs/integrations/express.md +219 -0
- package/docs/integrations/fastify.md +77 -0
- package/docs/integrations/hono.md +78 -0
- package/docs/integrations/index.md +68 -0
- package/docs/integrations/koa.md +88 -0
- package/docs/integrations/nestjs.md +78 -0
- package/docs/integrations/tsed.md +81 -0
- package/docs/javascripts/extra.js +174 -0
- package/docs/performance.md +37 -0
- package/docs/stylesheets/extra.css +819 -0
- package/live-test/integrations/elysia-example.js +16 -0
- package/live-test/integrations/express-example.js +24 -0
- package/live-test/integrations/fastify-example.js +20 -0
- package/live-test/integrations/hono-example.js +16 -0
- package/live-test/integrations/koa-example.js +30 -0
- package/live-test/integrations/nestjs-example.js +25 -0
- package/live-test/integrations/smoke-test.js +166 -0
- package/live-test/integrations/tsed-example.js +23 -0
- package/live-test/package-lock.json +235 -0
- package/live-test/package.json +4 -0
- package/live-test/views/home.html +17 -0
- package/mkdocs.yml +217 -0
- package/overrides/main.html +26 -0
- package/overrides/partials/footer.html +9 -0
- package/package.json +16 -6
- package/requirements-docs.txt +1 -0
- package/tests/integration/partial-render.test.cjs +13 -0
- package/docs/README.md +0 -18
- package/docs/advanced_usage.md +0 -71
- package/docs/api.md +0 -122
- package/docs/filters.md +0 -708
- package/docs/installation.md +0 -106
- package/docs/overview.md +0 -79
- package/docs/partialdef.md +0 -70
- package/docs/security.md +0 -27
- package/docs/tags.md +0 -673
- package/docs/usage.md +0 -646
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import miki from '../../src/esm.mjs';
|
|
4
|
+
|
|
5
|
+
const app = new Elysia();
|
|
6
|
+
|
|
7
|
+
app.get('/', async () => {
|
|
8
|
+
const html = await miki.asyncRender('home', {}, { views: path.resolve('./live-test/views') });
|
|
9
|
+
return new Response(html, { headers: { 'Content-Type': 'text/html' } });
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export async function start(port = 3004) {
|
|
13
|
+
return app.listen({ port });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (import.meta.url === `file://${process.argv[1]}`) start().then(() => console.log('Elysia example listening on 3004'));
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const miki = require('../../');
|
|
4
|
+
|
|
5
|
+
const app = express();
|
|
6
|
+
miki.setupExpress(app, { extension: 'html', views: path.resolve(__dirname, '..', 'views') });
|
|
7
|
+
|
|
8
|
+
app.get('/', (req, res) => res.render('home', { user: 'ExpressUser', title: 'ExpressCard' }));
|
|
9
|
+
app.get('/partial', (req, res) => res.render('home#card', { user: 'ExpressUser', title: 'ExpressCard' }));
|
|
10
|
+
|
|
11
|
+
function start(port = 3000, host = '127.0.0.1') {
|
|
12
|
+
return new Promise((resolve, reject) => {
|
|
13
|
+
try {
|
|
14
|
+
const srv = app.listen(port, host, () => {
|
|
15
|
+
console.log('Express example listening on', port);
|
|
16
|
+
resolve(srv);
|
|
17
|
+
});
|
|
18
|
+
} catch (err) { reject(err); }
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (require.main === module) start().catch(err => { console.error(err); process.exit(1); });
|
|
23
|
+
|
|
24
|
+
module.exports = { app, start };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const Fastify = require('fastify');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const miki = require('../../');
|
|
4
|
+
|
|
5
|
+
const app = Fastify();
|
|
6
|
+
|
|
7
|
+
app.get('/', async (request, reply) => {
|
|
8
|
+
const html = await miki.asyncRender('home', { user: 'FastifyUser', title: 'FastifyCard' }, { views: path.resolve(__dirname, '..', 'views') });
|
|
9
|
+
reply.type('text/html').send(html);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
function start(port = 3002, host = '127.0.0.1') {
|
|
13
|
+
return app.listen({ port, host });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (require.main === module) {
|
|
17
|
+
start().then(() => console.log('Fastify example listening on 3002')).catch(err => { console.error('Fastify failed to start', err); process.exit(1); });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = { app, start };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
import miki from '../../src/esm.mjs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
|
|
5
|
+
const app = new Hono();
|
|
6
|
+
|
|
7
|
+
app.get('/', async (c) => {
|
|
8
|
+
const html = await miki.asyncRender('home', {}, { views: path.resolve('./live-test/views') });
|
|
9
|
+
return c.html(html);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export async function start(port = 3005) {
|
|
13
|
+
return app.listen({ port });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (import.meta.url === `file://${process.argv[1]}`) start().then(() => console.log('Hono example listening on 3005'));
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const Koa = require('koa');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const miki = require('../../');
|
|
4
|
+
|
|
5
|
+
const app = new Koa();
|
|
6
|
+
|
|
7
|
+
app.context.render = async function (view, locals = {}) {
|
|
8
|
+
const html = await miki.asyncRender(view, locals, { views: path.resolve(__dirname, '..', 'views') });
|
|
9
|
+
this.type = 'text/html';
|
|
10
|
+
this.body = html;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
app.use(async (ctx) => {
|
|
14
|
+
await ctx.render('home', { user: 'KoaUser', title: 'KoaCard' });
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
function start(port = 3001, host = '127.0.0.1') {
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
try {
|
|
20
|
+
const srv = app.listen(port, host, () => {
|
|
21
|
+
console.log('Koa example listening on', port);
|
|
22
|
+
resolve(srv);
|
|
23
|
+
});
|
|
24
|
+
} catch (err) { reject(err); }
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (require.main === module) start().catch(err => { console.error(err); process.exit(1); });
|
|
29
|
+
|
|
30
|
+
module.exports = { app, start };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Minimal NestJS integration example (TypeScript flavor shown).
|
|
3
|
+
|
|
4
|
+
This file is an illustrative snippet and is NOT executed by the
|
|
5
|
+
smoke-test (NestJS requires heavier deps). Use it as a guide.
|
|
6
|
+
|
|
7
|
+
// main.ts
|
|
8
|
+
import { NestFactory } from '@nestjs/core';
|
|
9
|
+
import { AppModule } from './app.module';
|
|
10
|
+
import * as miki from 'miki-template';
|
|
11
|
+
|
|
12
|
+
async function bootstrap() {
|
|
13
|
+
const app = await NestFactory.create(AppModule);
|
|
14
|
+
const expressApp = app.getHttpAdapter().getInstance();
|
|
15
|
+
// Wire miki into underlying Express instance
|
|
16
|
+
miki.setupExpress(expressApp, { extension: 'html', views: './views' });
|
|
17
|
+
await app.listen(3006);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
bootstrap();
|
|
21
|
+
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
// Plain JS note: If you use Nest with JS, the same pattern applies:
|
|
25
|
+
// obtain the underlying Express instance and call miki.setupExpress(...)
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
const { spawn } = require('child_process');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const http = require('http');
|
|
4
|
+
|
|
5
|
+
async function start(scriptPath) {
|
|
6
|
+
// Skip optional ESM integrations when their deps are missing
|
|
7
|
+
const missing = {
|
|
8
|
+
'elysia-example.js': 'elysia',
|
|
9
|
+
'hono-example.js': 'hono'
|
|
10
|
+
};
|
|
11
|
+
const basename = path.basename(scriptPath);
|
|
12
|
+
if (missing[basename]) {
|
|
13
|
+
try { require.resolve(missing[basename]); }
|
|
14
|
+
catch {
|
|
15
|
+
console.warn(`Skipping ${basename}: ${missing[basename]} is not installed`);
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Require the example module and call its exported start() which
|
|
21
|
+
// returns a Promise or a server instance.
|
|
22
|
+
const mod = require(scriptPath);
|
|
23
|
+
if (mod && typeof mod.start === 'function') {
|
|
24
|
+
let res;
|
|
25
|
+
try {
|
|
26
|
+
res = mod.start();
|
|
27
|
+
} catch (err) {
|
|
28
|
+
console.warn(`Skipping ${basename}: start() failed: ${err.message}`);
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
// Fastify returns a Promise resolving to server address; Koa/Express
|
|
32
|
+
// return a server instance synchronously — normalize both.
|
|
33
|
+
if (res && typeof res.then === 'function') {
|
|
34
|
+
try {
|
|
35
|
+
await res;
|
|
36
|
+
return res;
|
|
37
|
+
} catch (err) {
|
|
38
|
+
console.warn(`Skipping ${basename}: start() promise rejected: ${err.message}`);
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return res;
|
|
43
|
+
}
|
|
44
|
+
// Fallback: spawn as a child process
|
|
45
|
+
return new Promise((resolve, reject) => {
|
|
46
|
+
const child = spawn(process.execPath, [scriptPath], { stdio: 'inherit' });
|
|
47
|
+
child.on('error', reject);
|
|
48
|
+
setTimeout(() => resolve(child), 800);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function fetch(url) {
|
|
53
|
+
return new Promise((resolve, reject) => {
|
|
54
|
+
http.get(url, res => {
|
|
55
|
+
let data = '';
|
|
56
|
+
res.on('data', c => data += c.toString());
|
|
57
|
+
res.on('end', () => resolve({ status: res.statusCode, body: data }));
|
|
58
|
+
}).on('error', reject);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function main() {
|
|
63
|
+
const root = path.resolve(__dirname);
|
|
64
|
+
const servers = [
|
|
65
|
+
{ file: path.join(root, 'express-example.js'), url: 'http://localhost:3000/' },
|
|
66
|
+
{ file: path.join(root, 'koa-example.js'), url: 'http://localhost:3001/' },
|
|
67
|
+
{ file: path.join(root, 'fastify-example.js'), url: 'http://localhost:3002/' }
|
|
68
|
+
];
|
|
69
|
+
// Add ESM-based examples (elysia, hono). These will be spawned as
|
|
70
|
+
// child processes if they cannot be required as modules.
|
|
71
|
+
servers.push({ file: path.join(root, 'elysia-example.js'), url: 'http://localhost:3004/' });
|
|
72
|
+
servers.push({ file: path.join(root, 'hono-example.js'), url: 'http://localhost:3005/' });
|
|
73
|
+
|
|
74
|
+
const procs = [];
|
|
75
|
+
for (const s of servers) {
|
|
76
|
+
procs.push(await start(s.file));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Test each server
|
|
80
|
+
for (let i = 0; i < servers.length; i++) {
|
|
81
|
+
const s = servers[i];
|
|
82
|
+
const p = procs[i];
|
|
83
|
+
if (!p) {
|
|
84
|
+
console.warn(`Skipping smoke-test for ${path.basename(s.file)} (not running)`);
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
const res = await fetch(s.url);
|
|
89
|
+
console.log(`${s.url} -> ${res.status} length=${res.body.length}`);
|
|
90
|
+
} catch (e) {
|
|
91
|
+
console.error(`Failed to fetch ${s.url}:`, e.message || e);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Test partial route on express
|
|
96
|
+
try {
|
|
97
|
+
const res = await fetch('http://localhost:3000/partial');
|
|
98
|
+
console.log(`/partial -> ${res.status} length=${res.body.length}`);
|
|
99
|
+
} catch (e) { console.error('Partial fetch failed', e.message || e); }
|
|
100
|
+
|
|
101
|
+
// Programmatic engine tests: render('home#card') via the engine APIs
|
|
102
|
+
try {
|
|
103
|
+
// Try requiring as if the package were installed; fallback to local
|
|
104
|
+
let miki;
|
|
105
|
+
try { miki = require('miki-template'); } catch (e) { miki = require('../..'); }
|
|
106
|
+
|
|
107
|
+
// For each framework, test programmatic partial rendering and finder behavior
|
|
108
|
+
const frameworks = ['express', 'koa', 'fastify', 'elysia', 'hono'];
|
|
109
|
+
for (const name of frameworks) {
|
|
110
|
+
const viewsDir = path.resolve(__dirname, '..', 'views');
|
|
111
|
+
try {
|
|
112
|
+
const asyncHtml = await miki.asyncRender('home#card', { user: name + 'Async', title: name + 'Card' }, { views: viewsDir });
|
|
113
|
+
console.log(`${name}: asyncRender(home#card) length=${asyncHtml.length}`);
|
|
114
|
+
} catch (e) { console.error(`${name}: asyncRender failed`, e && e.message ? e.message : e); }
|
|
115
|
+
|
|
116
|
+
try {
|
|
117
|
+
const syncHtml = miki.render('home#card', { user: name + 'Sync', title: name + 'Card' }, { views: viewsDir });
|
|
118
|
+
console.log(`${name}: render(home#card) length=${syncHtml.length}`);
|
|
119
|
+
} catch (e) { console.error(`${name}: render failed`, e && e.message ? e.message : e); }
|
|
120
|
+
|
|
121
|
+
// Finder tests: simulate multiple view roots including nested app-template dirs
|
|
122
|
+
try {
|
|
123
|
+
const found = miki.findTemplateInViews('home', [viewsDir, path.resolve(__dirname, '..')]);
|
|
124
|
+
console.log(`${name}: finder resolved -> ${found ? found : 'not found'}`);
|
|
125
|
+
} catch (e) { console.error(`${name}: finder error`, e && e.message ? e.message : e); }
|
|
126
|
+
}
|
|
127
|
+
} catch (e) {
|
|
128
|
+
console.error('Engine partial render failed:', e && e.stack ? e.stack : e);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Cleanup: attempt graceful shutdown for each started server
|
|
132
|
+
for (let i = 0; i < procs.length; i++) {
|
|
133
|
+
const p = procs[i];
|
|
134
|
+
if (!p) continue;
|
|
135
|
+
try {
|
|
136
|
+
if (typeof p.kill === 'function') {
|
|
137
|
+
p.kill();
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
if (typeof p.close === 'function') {
|
|
141
|
+
p.close();
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
// Fastify may return an address string; try to require module and call exported stop/close
|
|
145
|
+
try {
|
|
146
|
+
const mod = require(servers[i].file);
|
|
147
|
+
if (mod) {
|
|
148
|
+
if (typeof mod.stop === 'function') await mod.stop();
|
|
149
|
+
else if (typeof mod.close === 'function') await mod.close();
|
|
150
|
+
else if (mod.app && typeof mod.app.close === 'function') mod.app.close();
|
|
151
|
+
}
|
|
152
|
+
} catch (e) {
|
|
153
|
+
// ignore
|
|
154
|
+
}
|
|
155
|
+
} catch (e) {
|
|
156
|
+
// ignore errors during cleanup
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (require.main === module) {
|
|
162
|
+
main().catch(err => {
|
|
163
|
+
console.error('smoke-test failed', err && err.stack ? err.stack : err);
|
|
164
|
+
process.exit(1);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Ts.ED integration (Express adapter)
|
|
3
|
+
|
|
4
|
+
This is an example snippet for Ts.ED users. Ts.ED can run on Express
|
|
5
|
+
or Koa — when using the Express adapter, obtain the raw Express app
|
|
6
|
+
and call `miki.setupExpress()` as shown.
|
|
7
|
+
|
|
8
|
+
// server.ts (snippet)
|
|
9
|
+
import { ServerLoader } from '@tsed/di';
|
|
10
|
+
import * as miki from 'miki-template';
|
|
11
|
+
|
|
12
|
+
async function bootstrap() {
|
|
13
|
+
const server = await ServerLoader.bootstrap();
|
|
14
|
+
// server.rawApp is the underlying Express/Koa instance depending on adapter
|
|
15
|
+
miki.setupExpress(server.rawApp, { extension: 'html', views: './views' });
|
|
16
|
+
await server.listen();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
bootstrap();
|
|
20
|
+
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
// Plain JS: same approach — call setupExpress on the underlying app.
|
|
@@ -10,8 +10,59 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"express": "^5.2.1",
|
|
12
12
|
"miki-template": "file:../miki-template-2.0.0.tgz"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"elysia": "^1.4.30",
|
|
16
|
+
"hono": "^4.13.7"
|
|
13
17
|
}
|
|
14
18
|
},
|
|
19
|
+
"node_modules/@borewit/text-codec": {
|
|
20
|
+
"version": "0.2.2",
|
|
21
|
+
"resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.2.2.tgz",
|
|
22
|
+
"integrity": "sha512-DDaRehssg1aNrH4+2hnj1B7vnUGEjU6OIlyRdkMd0aUdIUvKXrJfXsy8LVtXAy7DRvYVluWbMspsRhz2lcW0mQ==",
|
|
23
|
+
"dev": true,
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"peer": true,
|
|
26
|
+
"funding": {
|
|
27
|
+
"type": "github",
|
|
28
|
+
"url": "https://github.com/sponsors/Borewit"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"node_modules/@sinclair/typebox": {
|
|
32
|
+
"version": "0.34.52",
|
|
33
|
+
"resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.52.tgz",
|
|
34
|
+
"integrity": "sha512-XiMQh7qqVlxZzcVD+kkGMNGMzcTrDMLWI7S4x7z1MkCkbDPrekpZXEUK0eZqZFMuHQg2a2DZOcDIh9o5v3Gonw==",
|
|
35
|
+
"dev": true,
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"peer": true
|
|
38
|
+
},
|
|
39
|
+
"node_modules/@tokenizer/inflate": {
|
|
40
|
+
"version": "0.4.1",
|
|
41
|
+
"resolved": "https://registry.npmjs.org/@tokenizer/inflate/-/inflate-0.4.1.tgz",
|
|
42
|
+
"integrity": "sha512-2mAv+8pkG6GIZiF1kNg1jAjh27IDxEPKwdGul3snfztFerfPGI1LjDezZp3i7BElXompqEtPmoPx6c2wgtWsOA==",
|
|
43
|
+
"dev": true,
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"peer": true,
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"debug": "^4.4.3",
|
|
48
|
+
"token-types": "^6.1.1"
|
|
49
|
+
},
|
|
50
|
+
"engines": {
|
|
51
|
+
"node": ">=18"
|
|
52
|
+
},
|
|
53
|
+
"funding": {
|
|
54
|
+
"type": "github",
|
|
55
|
+
"url": "https://github.com/sponsors/Borewit"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"node_modules/@tokenizer/token": {
|
|
59
|
+
"version": "0.3.0",
|
|
60
|
+
"resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz",
|
|
61
|
+
"integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==",
|
|
62
|
+
"dev": true,
|
|
63
|
+
"license": "MIT",
|
|
64
|
+
"peer": true
|
|
65
|
+
},
|
|
15
66
|
"node_modules/accepts": {
|
|
16
67
|
"version": "2.0.0",
|
|
17
68
|
"resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz",
|
|
@@ -196,6 +247,49 @@
|
|
|
196
247
|
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
|
|
197
248
|
"license": "MIT"
|
|
198
249
|
},
|
|
250
|
+
"node_modules/elysia": {
|
|
251
|
+
"version": "1.4.30",
|
|
252
|
+
"resolved": "https://registry.npmjs.org/elysia/-/elysia-1.4.30.tgz",
|
|
253
|
+
"integrity": "sha512-S2qqV0CbM4faB1hQQ5IYoeYnAUinjHlzRduxaBc4OoNqh0GjOc8k6tt3hv5ozWcG6Svr6hugw6JL4zNke4jwfA==",
|
|
254
|
+
"dev": true,
|
|
255
|
+
"license": "MIT",
|
|
256
|
+
"dependencies": {
|
|
257
|
+
"cookie": "^1.1.1",
|
|
258
|
+
"exact-mirror": "^0.2.7",
|
|
259
|
+
"fast-decode-uri-component": "^1.0.1",
|
|
260
|
+
"memoirist": "^0.4.0"
|
|
261
|
+
},
|
|
262
|
+
"peerDependencies": {
|
|
263
|
+
"@sinclair/typebox": ">= 0.34.0 < 1",
|
|
264
|
+
"@types/bun": ">= 1.2.0",
|
|
265
|
+
"exact-mirror": ">= 0.0.9",
|
|
266
|
+
"file-type": ">= 20.0.0",
|
|
267
|
+
"openapi-types": ">= 12.0.0",
|
|
268
|
+
"typescript": ">= 5.0.0"
|
|
269
|
+
},
|
|
270
|
+
"peerDependenciesMeta": {
|
|
271
|
+
"@types/bun": {
|
|
272
|
+
"optional": true
|
|
273
|
+
},
|
|
274
|
+
"typescript": {
|
|
275
|
+
"optional": true
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
"node_modules/elysia/node_modules/cookie": {
|
|
280
|
+
"version": "1.1.1",
|
|
281
|
+
"resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz",
|
|
282
|
+
"integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==",
|
|
283
|
+
"dev": true,
|
|
284
|
+
"license": "MIT",
|
|
285
|
+
"engines": {
|
|
286
|
+
"node": ">=18"
|
|
287
|
+
},
|
|
288
|
+
"funding": {
|
|
289
|
+
"type": "opencollective",
|
|
290
|
+
"url": "https://opencollective.com/express"
|
|
291
|
+
}
|
|
292
|
+
},
|
|
199
293
|
"node_modules/encodeurl": {
|
|
200
294
|
"version": "2.0.0",
|
|
201
295
|
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
|
|
@@ -250,6 +344,21 @@
|
|
|
250
344
|
"node": ">= 0.6"
|
|
251
345
|
}
|
|
252
346
|
},
|
|
347
|
+
"node_modules/exact-mirror": {
|
|
348
|
+
"version": "0.2.7",
|
|
349
|
+
"resolved": "https://registry.npmjs.org/exact-mirror/-/exact-mirror-0.2.7.tgz",
|
|
350
|
+
"integrity": "sha512-+MeEmDcLA4o/vjK2zujgk+1VTxPR4hdp23qLqkWfStbECtAq9gmsvQa3LW6z/0GXZyHJobrCnmy1cdeE7BjsYg==",
|
|
351
|
+
"dev": true,
|
|
352
|
+
"license": "MIT",
|
|
353
|
+
"peerDependencies": {
|
|
354
|
+
"@sinclair/typebox": "^0.34.15"
|
|
355
|
+
},
|
|
356
|
+
"peerDependenciesMeta": {
|
|
357
|
+
"@sinclair/typebox": {
|
|
358
|
+
"optional": true
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
},
|
|
253
362
|
"node_modules/express": {
|
|
254
363
|
"version": "5.2.1",
|
|
255
364
|
"resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz",
|
|
@@ -293,6 +402,33 @@
|
|
|
293
402
|
"url": "https://opencollective.com/express"
|
|
294
403
|
}
|
|
295
404
|
},
|
|
405
|
+
"node_modules/fast-decode-uri-component": {
|
|
406
|
+
"version": "1.0.1",
|
|
407
|
+
"resolved": "https://registry.npmjs.org/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz",
|
|
408
|
+
"integrity": "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==",
|
|
409
|
+
"dev": true,
|
|
410
|
+
"license": "MIT"
|
|
411
|
+
},
|
|
412
|
+
"node_modules/file-type": {
|
|
413
|
+
"version": "22.0.2",
|
|
414
|
+
"resolved": "https://registry.npmjs.org/file-type/-/file-type-22.0.2.tgz",
|
|
415
|
+
"integrity": "sha512-0H8TsCUGBLx+V5adH3EY52hTAcyLKbV1D4gq5cIOJ6DnQAHeV9Z2Hhuc5CoBX4YmvB2oL+JIC84z0qO7JsCoNw==",
|
|
416
|
+
"dev": true,
|
|
417
|
+
"license": "MIT",
|
|
418
|
+
"peer": true,
|
|
419
|
+
"dependencies": {
|
|
420
|
+
"@tokenizer/inflate": "^0.4.1",
|
|
421
|
+
"strtok3": "^10.3.5",
|
|
422
|
+
"token-types": "^6.1.2",
|
|
423
|
+
"uint8array-extras": "^1.5.0"
|
|
424
|
+
},
|
|
425
|
+
"engines": {
|
|
426
|
+
"node": ">=22"
|
|
427
|
+
},
|
|
428
|
+
"funding": {
|
|
429
|
+
"url": "https://github.com/sindresorhus/file-type?sponsor=1"
|
|
430
|
+
}
|
|
431
|
+
},
|
|
296
432
|
"node_modules/finalhandler": {
|
|
297
433
|
"version": "2.1.1",
|
|
298
434
|
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz",
|
|
@@ -423,6 +559,16 @@
|
|
|
423
559
|
"he": "bin/he"
|
|
424
560
|
}
|
|
425
561
|
},
|
|
562
|
+
"node_modules/hono": {
|
|
563
|
+
"version": "4.13.7",
|
|
564
|
+
"resolved": "https://registry.npmjs.org/hono/-/hono-4.13.7.tgz",
|
|
565
|
+
"integrity": "sha512-c8/gF9ac8Y78/agExVocyLevgR+JlpNB444Py0FSX8pJoPdYUfUzRcXtYEYGwt6l19qIlVZPN5Mfsw9jFShmQQ==",
|
|
566
|
+
"dev": true,
|
|
567
|
+
"license": "MIT",
|
|
568
|
+
"engines": {
|
|
569
|
+
"node": ">=16.9.0"
|
|
570
|
+
}
|
|
571
|
+
},
|
|
426
572
|
"node_modules/http-errors": {
|
|
427
573
|
"version": "2.0.1",
|
|
428
574
|
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",
|
|
@@ -459,6 +605,28 @@
|
|
|
459
605
|
"url": "https://opencollective.com/express"
|
|
460
606
|
}
|
|
461
607
|
},
|
|
608
|
+
"node_modules/ieee754": {
|
|
609
|
+
"version": "1.2.1",
|
|
610
|
+
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
|
|
611
|
+
"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
|
|
612
|
+
"dev": true,
|
|
613
|
+
"funding": [
|
|
614
|
+
{
|
|
615
|
+
"type": "github",
|
|
616
|
+
"url": "https://github.com/sponsors/feross"
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
"type": "patreon",
|
|
620
|
+
"url": "https://www.patreon.com/feross"
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
"type": "consulting",
|
|
624
|
+
"url": "https://feross.org/support"
|
|
625
|
+
}
|
|
626
|
+
],
|
|
627
|
+
"license": "BSD-3-Clause",
|
|
628
|
+
"peer": true
|
|
629
|
+
},
|
|
462
630
|
"node_modules/inherits": {
|
|
463
631
|
"version": "2.0.4",
|
|
464
632
|
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
|
@@ -502,6 +670,13 @@
|
|
|
502
670
|
"url": "https://opencollective.com/express"
|
|
503
671
|
}
|
|
504
672
|
},
|
|
673
|
+
"node_modules/memoirist": {
|
|
674
|
+
"version": "0.4.0",
|
|
675
|
+
"resolved": "https://registry.npmjs.org/memoirist/-/memoirist-0.4.0.tgz",
|
|
676
|
+
"integrity": "sha512-zxTgA0mSYELa66DimuNQDvyLq36AwDlTuVRbnQtB+VuTcKWm5Qc4z3WkSpgsFWHNhexqkIooqpv4hdcqrX5Nmg==",
|
|
677
|
+
"dev": true,
|
|
678
|
+
"license": "MIT"
|
|
679
|
+
},
|
|
505
680
|
"node_modules/merge-descriptors": {
|
|
506
681
|
"version": "2.0.0",
|
|
507
682
|
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz",
|
|
@@ -617,6 +792,14 @@
|
|
|
617
792
|
"wrappy": "1"
|
|
618
793
|
}
|
|
619
794
|
},
|
|
795
|
+
"node_modules/openapi-types": {
|
|
796
|
+
"version": "12.1.3",
|
|
797
|
+
"resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.3.tgz",
|
|
798
|
+
"integrity": "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==",
|
|
799
|
+
"dev": true,
|
|
800
|
+
"license": "MIT",
|
|
801
|
+
"peer": true
|
|
802
|
+
},
|
|
620
803
|
"node_modules/parseurl": {
|
|
621
804
|
"version": "1.3.3",
|
|
622
805
|
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
|
|
@@ -847,6 +1030,24 @@
|
|
|
847
1030
|
"node": ">= 0.8"
|
|
848
1031
|
}
|
|
849
1032
|
},
|
|
1033
|
+
"node_modules/strtok3": {
|
|
1034
|
+
"version": "10.3.5",
|
|
1035
|
+
"resolved": "https://registry.npmjs.org/strtok3/-/strtok3-10.3.5.tgz",
|
|
1036
|
+
"integrity": "sha512-ki4hZQfh5rX0QDLLkOCj+h+CVNkqmp/CMf8v8kZpkNVK6jGQooMytqzLZYUVYIZcFZ6yDB70EfD8POcFXiF5oA==",
|
|
1037
|
+
"dev": true,
|
|
1038
|
+
"license": "MIT",
|
|
1039
|
+
"peer": true,
|
|
1040
|
+
"dependencies": {
|
|
1041
|
+
"@tokenizer/token": "^0.3.0"
|
|
1042
|
+
},
|
|
1043
|
+
"engines": {
|
|
1044
|
+
"node": ">=18"
|
|
1045
|
+
},
|
|
1046
|
+
"funding": {
|
|
1047
|
+
"type": "github",
|
|
1048
|
+
"url": "https://github.com/sponsors/Borewit"
|
|
1049
|
+
}
|
|
1050
|
+
},
|
|
850
1051
|
"node_modules/toidentifier": {
|
|
851
1052
|
"version": "1.0.1",
|
|
852
1053
|
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
|
|
@@ -856,6 +1057,26 @@
|
|
|
856
1057
|
"node": ">=0.6"
|
|
857
1058
|
}
|
|
858
1059
|
},
|
|
1060
|
+
"node_modules/token-types": {
|
|
1061
|
+
"version": "6.1.2",
|
|
1062
|
+
"resolved": "https://registry.npmjs.org/token-types/-/token-types-6.1.2.tgz",
|
|
1063
|
+
"integrity": "sha512-dRXchy+C0IgK8WPC6xvCHFRIWYUbqqdEIKPaKo/AcTUNzwLTK6AH7RjdLWsEZcAN/TBdtfUw3PYEgPr5VPr6ww==",
|
|
1064
|
+
"dev": true,
|
|
1065
|
+
"license": "MIT",
|
|
1066
|
+
"peer": true,
|
|
1067
|
+
"dependencies": {
|
|
1068
|
+
"@borewit/text-codec": "^0.2.1",
|
|
1069
|
+
"@tokenizer/token": "^0.3.0",
|
|
1070
|
+
"ieee754": "^1.2.1"
|
|
1071
|
+
},
|
|
1072
|
+
"engines": {
|
|
1073
|
+
"node": ">=14.16"
|
|
1074
|
+
},
|
|
1075
|
+
"funding": {
|
|
1076
|
+
"type": "github",
|
|
1077
|
+
"url": "https://github.com/sponsors/Borewit"
|
|
1078
|
+
}
|
|
1079
|
+
},
|
|
859
1080
|
"node_modules/type-is": {
|
|
860
1081
|
"version": "2.1.0",
|
|
861
1082
|
"resolved": "https://registry.npmjs.org/type-is/-/type-is-2.1.0.tgz",
|
|
@@ -887,6 +1108,20 @@
|
|
|
887
1108
|
"url": "https://opencollective.com/express"
|
|
888
1109
|
}
|
|
889
1110
|
},
|
|
1111
|
+
"node_modules/uint8array-extras": {
|
|
1112
|
+
"version": "1.5.0",
|
|
1113
|
+
"resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.5.0.tgz",
|
|
1114
|
+
"integrity": "sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A==",
|
|
1115
|
+
"dev": true,
|
|
1116
|
+
"license": "MIT",
|
|
1117
|
+
"peer": true,
|
|
1118
|
+
"engines": {
|
|
1119
|
+
"node": ">=18"
|
|
1120
|
+
},
|
|
1121
|
+
"funding": {
|
|
1122
|
+
"url": "https://github.com/sponsors/sindresorhus"
|
|
1123
|
+
}
|
|
1124
|
+
},
|
|
890
1125
|
"node_modules/unpipe": {
|
|
891
1126
|
"version": "1.0.0",
|
|
892
1127
|
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
|
package/live-test/package.json
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>Home</title>
|
|
5
|
+
</head>
|
|
6
|
+
<body>
|
|
7
|
+
<h1>Welcome, {{ user }}</h1>
|
|
8
|
+
|
|
9
|
+
{% partialdef card %}
|
|
10
|
+
<div class="card">Card: {{ title }}</div>
|
|
11
|
+
{% endpartialdef %}
|
|
12
|
+
|
|
13
|
+
<div id="content">
|
|
14
|
+
{% partial card %}
|
|
15
|
+
</div>
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|