@emeryld/rrroutes-contract 2.7.7 → 2.7.8
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/dist/export/defaultViewerTemplate.d.ts +1 -1
- package/dist/index.cjs +12 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +12 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/tools/finalized-leaves-viewer.html +38 -23
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const DEFAULT_VIEWER_TEMPLATE = "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>Finalized Leaves Viewer</title>\n <style>\n :root {\n --bg: #
|
|
1
|
+
export declare const DEFAULT_VIEWER_TEMPLATE = "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>Finalized Leaves Viewer</title>\n <style>\n :root {\n --bg: #212121;\n --surface: #2a2a2a;\n --border: #4a4a4a;\n --text: #fffafa;\n --muted: #c8c2c2;\n --accent: #a764d3;\n }\n body {\n margin: 0;\n font-family: 'Iosevka Web', 'SFMono-Regular', Menlo, Consolas, monospace;\n color: var(--text);\n background: var(--bg);\n }\n .wrap { max-width: 1100px; margin: 0 auto; padding: 20px; }\n .card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }\n .meta { color: var(--muted); font-size: 12px; }\n #results { margin-top: 12px; display: grid; gap: 8px; }\n details { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }\n summary { cursor: pointer; font-weight: 700; color: var(--accent); }\n pre { margin: 10px 0 0; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: #303030; color: var(--text); }\n </style>\n </head>\n <body>\n <div class=\"wrap\">\n <h1>Finalized Leaves Viewer (Baked)</h1>\n <div class=\"card\">\n <div id=\"status\" class=\"meta\">Waiting for baked payload...</div>\n </div>\n <div id=\"results\"></div>\n </div>\n\n <!--__FINALIZED_LEAVES_BAKED_PAYLOAD__-->\n\n <script>\n const statusEl = document.getElementById('status')\n const resultsEl = document.getElementById('results')\n const payload = window.__FINALIZED_LEAVES_PAYLOAD\n\n if (!payload || !Array.isArray(payload.leaves)) {\n statusEl.textContent = 'No baked payload found in this HTML file.'\n } else {\n statusEl.textContent = 'Loaded baked payload with ' + payload.leaves.length + ' routes.'\n\n const toHref = (source) => {\n if (!source || !source.file) return null\n const normalizedPath = String(source.file).replace(/\\\\/g, '/')\n const prefix = normalizedPath.startsWith('/') ? 'file://' : 'file:///'\n return prefix + encodeURI(normalizedPath)\n }\n\n const sourceDisplay = (source) => {\n return ''\n }\n\n payload.leaves.forEach((leaf) => {\n const details = document.createElement('details')\n const summary = document.createElement('summary')\n summary.textContent = String(leaf.method || '').toUpperCase() + ' ' + (leaf.path || '')\n\n const pre = document.createElement('pre')\n pre.textContent = JSON.stringify(leaf, null, 2)\n\n const source = payload.sourceByLeaf && payload.sourceByLeaf[leaf.key]\n let sourceWrap = null\n if (source) {\n sourceWrap = document.createElement('div')\n sourceWrap.className = 'meta'\n\n const definitionHref = toHref(source.definition)\n if (definitionHref) {\n const label = document.createElement('div')\n const link = document.createElement('a')\n link.href = definitionHref\n link.target = '_blank'\n link.rel = 'noopener noreferrer'\n link.textContent = 'definition'\n label.appendChild(link)\n sourceWrap.appendChild(label)\n }\n\n if (source.schemas && typeof source.schemas === 'object') {\n Object.entries(source.schemas).forEach(([name, schema]) => {\n if (!schema) return\n const href = toHref(schema)\n const row = document.createElement('div')\n if (href) {\n const link = document.createElement('a')\n link.href = href\n link.target = '_blank'\n link.rel = 'noopener noreferrer'\n link.textContent =\n name + ': ' + (schema.sourceName || schema.tag || '<anonymous>')\n row.appendChild(link)\n } else {\n row.textContent = name + ': ' + (schema.sourceName || schema.tag || '<anonymous>')\n }\n sourceWrap.appendChild(row)\n })\n }\n\n }\n\n details.appendChild(summary)\n if (sourceWrap) details.appendChild(sourceWrap)\n details.appendChild(pre)\n resultsEl.appendChild(details)\n })\n }\n </script>\n </body>\n</html>\n";
|
package/dist/index.cjs
CHANGED
|
@@ -754,18 +754,18 @@ var DEFAULT_VIEWER_TEMPLATE = `<!doctype html>
|
|
|
754
754
|
<title>Finalized Leaves Viewer</title>
|
|
755
755
|
<style>
|
|
756
756
|
:root {
|
|
757
|
-
--bg: #
|
|
758
|
-
--surface: #
|
|
759
|
-
--border: #
|
|
760
|
-
--text: #
|
|
761
|
-
--muted: #
|
|
762
|
-
--accent: #
|
|
757
|
+
--bg: #212121;
|
|
758
|
+
--surface: #2a2a2a;
|
|
759
|
+
--border: #4a4a4a;
|
|
760
|
+
--text: #fffafa;
|
|
761
|
+
--muted: #c8c2c2;
|
|
762
|
+
--accent: #a764d3;
|
|
763
763
|
}
|
|
764
764
|
body {
|
|
765
765
|
margin: 0;
|
|
766
766
|
font-family: 'Iosevka Web', 'SFMono-Regular', Menlo, Consolas, monospace;
|
|
767
767
|
color: var(--text);
|
|
768
|
-
background:
|
|
768
|
+
background: var(--bg);
|
|
769
769
|
}
|
|
770
770
|
.wrap { max-width: 1100px; margin: 0 auto; padding: 20px; }
|
|
771
771
|
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
|
|
@@ -773,7 +773,7 @@ var DEFAULT_VIEWER_TEMPLATE = `<!doctype html>
|
|
|
773
773
|
#results { margin-top: 12px; display: grid; gap: 8px; }
|
|
774
774
|
details { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
|
|
775
775
|
summary { cursor: pointer; font-weight: 700; color: var(--accent); }
|
|
776
|
-
pre { margin: 10px 0 0; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: #
|
|
776
|
+
pre { margin: 10px 0 0; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: #303030; color: var(--text); }
|
|
777
777
|
</style>
|
|
778
778
|
</head>
|
|
779
779
|
<body>
|
|
@@ -804,6 +804,10 @@ var DEFAULT_VIEWER_TEMPLATE = `<!doctype html>
|
|
|
804
804
|
return prefix + encodeURI(normalizedPath)
|
|
805
805
|
}
|
|
806
806
|
|
|
807
|
+
const sourceDisplay = (source) => {
|
|
808
|
+
return ''
|
|
809
|
+
}
|
|
810
|
+
|
|
807
811
|
payload.leaves.forEach((leaf) => {
|
|
808
812
|
const details = document.createElement('details')
|
|
809
813
|
const summary = document.createElement('summary')
|
|
@@ -827,16 +831,6 @@ var DEFAULT_VIEWER_TEMPLATE = `<!doctype html>
|
|
|
827
831
|
link.rel = 'noopener noreferrer'
|
|
828
832
|
link.textContent = 'definition'
|
|
829
833
|
label.appendChild(link)
|
|
830
|
-
const location = document.createElement('span')
|
|
831
|
-
location.textContent =
|
|
832
|
-
' (' +
|
|
833
|
-
source.definition.file +
|
|
834
|
-
':' +
|
|
835
|
-
source.definition.line +
|
|
836
|
-
':' +
|
|
837
|
-
source.definition.column +
|
|
838
|
-
')'
|
|
839
|
-
label.appendChild(location)
|
|
840
834
|
sourceWrap.appendChild(label)
|
|
841
835
|
}
|
|
842
836
|
|
|
@@ -853,10 +847,6 @@ var DEFAULT_VIEWER_TEMPLATE = `<!doctype html>
|
|
|
853
847
|
link.textContent =
|
|
854
848
|
name + ': ' + (schema.sourceName || schema.tag || '<anonymous>')
|
|
855
849
|
row.appendChild(link)
|
|
856
|
-
const location = document.createElement('span')
|
|
857
|
-
location.textContent =
|
|
858
|
-
' (' + schema.file + ':' + schema.line + ':' + schema.column + ')'
|
|
859
|
-
row.appendChild(location)
|
|
860
850
|
} else {
|
|
861
851
|
row.textContent = name + ': ' + (schema.sourceName || schema.tag || '<anonymous>')
|
|
862
852
|
}
|