tina4-nodejs 3.10.32 → 3.10.34
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tina4-nodejs",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.34",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "This is not a framework. Tina4 for Node.js/TypeScript — zero deps, 38 built-in features.",
|
|
6
6
|
"keywords": ["tina4", "framework", "web", "api", "orm", "graphql", "websocket", "typescript"],
|
|
@@ -20,7 +20,7 @@ import { isTruthy } from "./dotenv.js";
|
|
|
20
20
|
|
|
21
21
|
const cpuCount = osCpus().length;
|
|
22
22
|
|
|
23
|
-
const TINA4_VERSION = "3.10.
|
|
23
|
+
const TINA4_VERSION = "3.10.34";
|
|
24
24
|
|
|
25
25
|
// ---------------------------------------------------------------------------
|
|
26
26
|
// Types
|
|
@@ -2009,7 +2009,17 @@ function renderToolbarHtml(ctx: {
|
|
|
2009
2009
|
}): string {
|
|
2010
2010
|
const nodeVersion = process.version;
|
|
2011
2011
|
return `<div id="tina4-dev-toolbar" style="position:fixed;bottom:0;left:0;right:0;background:#333;color:#fff;font-family:monospace;font-size:12px;padding:6px 16px;z-index:99999;display:flex;align-items:center;gap:16px;">
|
|
2012
|
-
<span style="color:#2e7d32;font-weight:bold;">Tina4 v${ctx.version}</span>
|
|
2012
|
+
<span id="tina4-ver-btn" style="color:#2e7d32;font-weight:bold;cursor:pointer;text-decoration:underline dotted;" onclick="tina4VersionModal()" title="Click to check for updates">Tina4 v${ctx.version}</span>
|
|
2013
|
+
<div id="tina4-ver-modal" style="display:none;position:fixed;bottom:3rem;left:1rem;background:#1e1e2e;border:1px solid #2e7d32;border-radius:8px;padding:16px 20px;z-index:100000;min-width:320px;box-shadow:0 8px 32px rgba(0,0,0,0.5);font-family:monospace;font-size:13px;color:#cdd6f4;">
|
|
2014
|
+
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;">
|
|
2015
|
+
<strong style="color:#89b4fa;">Version Info</strong>
|
|
2016
|
+
<span onclick="document.getElementById('tina4-ver-modal').style.display='none'" style="cursor:pointer;color:#888;">×</span>
|
|
2017
|
+
</div>
|
|
2018
|
+
<div id="tina4-ver-body" style="line-height:1.8;">
|
|
2019
|
+
<div>Current: <strong style="color:#a6e3a1;">v${ctx.version}</strong></div>
|
|
2020
|
+
<div id="tina4-ver-latest" style="color:#888;">Checking for updates...</div>
|
|
2021
|
+
</div>
|
|
2022
|
+
</div>
|
|
2013
2023
|
<span style="color:#4caf50;">${ctx.method}</span>
|
|
2014
2024
|
<span>${ctx.path}</span>
|
|
2015
2025
|
<span style="color:#666;">→ ${ctx.matchedPattern}</span>
|
|
@@ -2018,5 +2028,50 @@ function renderToolbarHtml(ctx: {
|
|
|
2018
2028
|
<span style="color:#888;">Node.js ${nodeVersion}</span>
|
|
2019
2029
|
<a href="#" onclick="(function(e){e.preventDefault();var p=document.getElementById('tina4-dev-panel');if(p){p.style.display=p.style.display==='none'?'block':'none';return;}var c=document.createElement('div');c.id='tina4-dev-panel';c.style.cssText='position:fixed;bottom:2rem;right:1rem;width:min(90vw,1200px);height:min(80vh,700px);z-index:99998;transition:all 0.2s';var f=document.createElement('iframe');f.src='/__dev';f.style.cssText='width:100%;height:100%;border:1px solid #2e7d32;border-radius:0.5rem;box-shadow:0 8px 32px rgba(0,0,0,0.5);background:#0f172a';c.appendChild(f);document.body.appendChild(c);})(event)" style="color:#ef9a9a;margin-left:auto;text-decoration:none;cursor:pointer;">Dashboard ↗</a>
|
|
2020
2030
|
<span onclick="this.parentElement.style.display='none'" style="cursor:pointer;color:#888;margin-left:8px;">✕</span>
|
|
2021
|
-
</div
|
|
2031
|
+
</div>
|
|
2032
|
+
<script>
|
|
2033
|
+
function tina4VersionModal(){
|
|
2034
|
+
var m=document.getElementById('tina4-ver-modal');
|
|
2035
|
+
if(m.style.display==='block'){m.style.display='none';return;}
|
|
2036
|
+
m.style.display='block';
|
|
2037
|
+
var el=document.getElementById('tina4-ver-latest');
|
|
2038
|
+
el.innerHTML='Checking for updates...';
|
|
2039
|
+
el.style.color='#888';
|
|
2040
|
+
fetch('https://registry.npmjs.org/tina4-nodejs/latest')
|
|
2041
|
+
.then(function(r){return r.json()})
|
|
2042
|
+
.then(function(d){
|
|
2043
|
+
var latest=d.version;
|
|
2044
|
+
var current='${ctx.version}';
|
|
2045
|
+
if(latest===current){
|
|
2046
|
+
el.innerHTML='Latest: <strong style="color:#a6e3a1;">v'+latest+'</strong> — You are up to date!';
|
|
2047
|
+
el.style.color='#a6e3a1';
|
|
2048
|
+
}else{
|
|
2049
|
+
var cParts=current.split('.').map(Number);
|
|
2050
|
+
var lParts=latest.split('.').map(Number);
|
|
2051
|
+
var isNewer=false;
|
|
2052
|
+
for(var i=0;i<Math.max(cParts.length,lParts.length);i++){
|
|
2053
|
+
var c=cParts[i]||0,l=lParts[i]||0;
|
|
2054
|
+
if(l>c){isNewer=true;break;}
|
|
2055
|
+
if(l<c)break;
|
|
2056
|
+
}
|
|
2057
|
+
if(isNewer){
|
|
2058
|
+
var breaking=(lParts[0]!==cParts[0]||lParts[1]!==cParts[1]);
|
|
2059
|
+
el.innerHTML='Latest: <strong style="color:#f9e2af;">v'+latest+'</strong>';
|
|
2060
|
+
if(breaking){
|
|
2061
|
+
el.innerHTML+='<div style="color:#f38ba8;margin-top:6px;">⚠ Major/minor version change — check the <a href="https://github.com/tina4stack/tina4-nodejs/releases" target="_blank" style="color:#89b4fa;">changelog</a> for breaking changes before upgrading.</div>';
|
|
2062
|
+
}else{
|
|
2063
|
+
el.innerHTML+='<div style="color:#f9e2af;margin-top:6px;">Patch update available. Run: <code style="background:#313244;padding:2px 6px;border-radius:3px;">npm install tina4-nodejs@latest</code></div>';
|
|
2064
|
+
}
|
|
2065
|
+
}else{
|
|
2066
|
+
el.innerHTML='Latest: <strong style="color:#a6e3a1;">v'+latest+'</strong> — You are up to date!';
|
|
2067
|
+
el.style.color='#a6e3a1';
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2070
|
+
})
|
|
2071
|
+
.catch(function(){
|
|
2072
|
+
el.innerHTML='Could not check for updates (offline?)';
|
|
2073
|
+
el.style.color='#f38ba8';
|
|
2074
|
+
});
|
|
2075
|
+
}
|
|
2076
|
+
</script>`;
|
|
2022
2077
|
}
|
|
@@ -1329,10 +1329,24 @@ export class Frond {
|
|
|
1329
1329
|
childBlocks: Record<string, string>,
|
|
1330
1330
|
): string {
|
|
1331
1331
|
const pattern = /\{%[-\s]*block\s+(\w+)\s*[-]?%\}([\s\S]*?)\{%[-\s]*endblock\s*[-]?%\}/g;
|
|
1332
|
+
const engine = this;
|
|
1333
|
+
|
|
1334
|
+
const result = parentSource.replace(pattern, (_match, name: string, parentContent: string) => {
|
|
1335
|
+
const blockSource = childBlocks[name] ?? parentContent;
|
|
1336
|
+
|
|
1337
|
+
// Make parent() and super() available inside child blocks
|
|
1338
|
+
let renderedParent: SafeString | null = null;
|
|
1339
|
+
const getParent = (): SafeString => {
|
|
1340
|
+
if (renderedParent === null) {
|
|
1341
|
+
renderedParent = new SafeString(
|
|
1342
|
+
engine.renderTokens(tokenize(parentContent), context),
|
|
1343
|
+
);
|
|
1344
|
+
}
|
|
1345
|
+
return renderedParent;
|
|
1346
|
+
};
|
|
1332
1347
|
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
return this.renderTokens(tokenize(blockSource), context);
|
|
1348
|
+
const blockCtx = { ...context, parent: getParent, super: getParent };
|
|
1349
|
+
return this.renderTokens(tokenize(blockSource), blockCtx);
|
|
1336
1350
|
});
|
|
1337
1351
|
|
|
1338
1352
|
return this.renderTokens(tokenize(result), context);
|