@fluojs/studio 1.0.2 → 1.0.3
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.
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const c of r.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();function h(e){return typeof e=="object"&&e!==null}function $(e,t){return Object.hasOwn(e,t)}function A(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function L(e){return e==="ready"||e==="not-ready"||e==="degraded"}function C(e){return e==="healthy"||e==="unhealthy"||e==="degraded"}function k(e){return e==="error"||e==="warning"||e==="info"}function R(e){if(!h(e))return null;if(typeof e.generatedAt!="string"||!h(e.readiness)||!h(e.health)||!Array.isArray(e.components)||!Array.isArray(e.diagnostics))throw new Error("Invalid platform snapshot payload.");if(!L(e.readiness.status)||typeof e.readiness.critical!="boolean")throw new Error("Invalid aggregate readiness in platform snapshot payload.");if(!C(e.health.status))throw new Error("Invalid aggregate health in platform snapshot payload.");for(const t of e.components){if(!h(t))throw new Error("Invalid component entry in platform snapshot payload.");if(typeof t.id!="string"||typeof t.kind!="string"||typeof t.state!="string"||!h(t.readiness)||!h(t.health)||!A(t.dependencies)||!h(t.telemetry)||!h(t.ownership)||!h(t.details))throw new Error("Invalid component shape in platform snapshot payload.");if(!L(t.readiness.status)||typeof t.readiness.critical!="boolean")throw new Error("Invalid component readiness in platform snapshot payload.");if(!C(t.health.status))throw new Error("Invalid component health in platform snapshot payload.");if(typeof t.telemetry.namespace!="string"||!h(t.telemetry.tags)||typeof t.ownership.ownsResources!="boolean"||typeof t.ownership.externallyManaged!="boolean")throw new Error("Invalid component telemetry/ownership in platform snapshot payload.")}for(const t of e.diagnostics){if(!h(t))throw new Error("Invalid diagnostics issue entry in platform snapshot payload.");if(typeof t.code!="string"||!k(t.severity)||typeof t.componentId!="string"||typeof t.message!="string")throw new Error("Invalid diagnostics issue shape in platform snapshot payload.");if(t.cause!==void 0&&typeof t.cause!="string"||t.fixHint!==void 0&&typeof t.fixHint!="string"||t.docsUrl!==void 0&&typeof t.docsUrl!="string"||t.dependsOn!==void 0&&!A(t.dependsOn))throw new Error("Invalid optional diagnostics issue fields in platform snapshot payload.")}return e}function F(e){if(!h(e))return null;if(e.version!==1)throw new Error("Unsupported bootstrap timing version. Expected version: 1.");if(typeof e.totalMs!="number"||!Array.isArray(e.phases))throw new Error("Invalid bootstrap timing payload.");for(const t of e.phases)if(!h(t)||typeof t.name!="string"||typeof t.durationMs!="number")throw new Error("Invalid phase entry in bootstrap timing payload.");return e}function J(e){if(!h(e))throw new Error("Invalid inspect report summary payload.");if(typeof e.componentCount!="number"||typeof e.diagnosticCount!="number"||typeof e.errorCount!="number"||!C(e.healthStatus)||!L(e.readinessStatus)||typeof e.timingTotalMs!="number"||typeof e.warningCount!="number")throw new Error("Invalid inspect report summary payload.");return e}function q(e,t,n){const s=t.diagnostics.filter(r=>r.severity==="error").length,o=t.diagnostics.filter(r=>r.severity==="warning").length;if(e.componentCount!==t.components.length||e.diagnosticCount!==t.diagnostics.length||e.errorCount!==s||e.healthStatus!==t.health.status||e.readinessStatus!==t.readiness.status||e.timingTotalMs!==n.totalMs||e.warningCount!==o)throw new Error("Inspect report summary does not match snapshot and timing payload data.")}function H(e){return e.summary!==void 0||$(e,"snapshot")&&$(e,"timing")&&($(e,"generatedAt")||$(e,"version"))}function P(e,t,n){if(!h(e)||!H(e))return null;if(e.summary===void 0||e.version!==1||typeof e.generatedAt!="string"||!t||!n)throw new Error("Invalid inspect report artifact payload.");const s=J(e.summary);return q(s,t,n),{generatedAt:e.generatedAt,snapshot:t,summary:s,timing:n,version:1}}function U(e){const t=JSON.parse(e),n=h(t)?t:void 0,s=n!==void 0&&$(n,"snapshot"),o=n!==void 0&&$(n,"timing"),r=n!==void 0&&!s&&!o&&$(n,"version")&&$(n,"totalMs")&&$(n,"phases"),c=R(s?n.snapshot:r?void 0:t),l=F(o?n.timing:c?void 0:t),a=P(t,c,l);if(!c&&!l)throw new Error("Unsupported file format. Expected platform snapshot JSON or timing JSON.");return{payload:{...a?{report:a}:{},...c?{snapshot:c}:{},...l?{timing:l}:{}},rawJson:e}}function _(e,t){const n=t.query.trim().toLowerCase(),s=e.components.filter(r=>t.readinessStatuses.length>0&&!t.readinessStatuses.includes(r.readiness.status)?!1:n?r.id.toLowerCase().includes(n)||r.kind.toLowerCase().includes(n)||r.dependencies.some(c=>c.toLowerCase().includes(n)):!0),o=e.diagnostics.filter(r=>{var c,l,a,g;return t.severities.length>0&&!t.severities.includes(r.severity)?!1:n?r.code.toLowerCase().includes(n)||r.componentId.toLowerCase().includes(n)||r.message.toLowerCase().includes(n)||(((c=r.cause)==null?void 0:c.toLowerCase().includes(n))??!1)||(((l=r.fixHint)==null?void 0:l.toLowerCase().includes(n))??!1)||(((a=r.docsUrl)==null?void 0:a.toLowerCase().includes(n))??!1)||(((g=r.dependsOn)==null?void 0:g.some(f=>f.toLowerCase().includes(n)))??!1):!0});return{...e,components:s,diagnostics:o}}function b(e){return e.replaceAll("\\","\\\\").replaceAll('"','\\"').replaceAll(`\r
|
|
2
2
|
`,"\\n").replaceAll("\r","\\n").replaceAll(`
|
|
3
|
-
`,"\\n")}function
|
|
4
|
-
`);for(const[c,l]of e.components.entries()){const
|
|
5
|
-
`)}function p(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function
|
|
3
|
+
`,"\\n")}function z(e){return e.replaceAll(/[^a-zA-Z0-9_]/g,"_")}function Y(e){let t=2166136261;for(const n of e)t^=n.codePointAt(0)??0,t=Math.imul(t,16777619)>>>0;return t.toString(16).padStart(8,"0")}function B(e){return`EXT_${z(e)}_${Y(e)}`}function O(e){const t=["graph TD"],n=new Map,s=new Map;if(e.components.length===0)return t.push(' EMPTY["No registered platform components"]'),t.join(`
|
|
4
|
+
`);for(const[c,l]of e.components.entries()){const a=`C${String(c+1)}`;n.set(l.id,a),t.push(` ${a}["${b(l.id)}\\nkind: ${b(l.kind)}\\nreadiness: ${l.readiness.status}\\nhealth: ${l.health.status}"]`)}for(const c of e.components){const l=n.get(c.id);if(l)for(const a of c.dependencies){const g=n.get(a);if(g){t.push(` ${l} --> ${g}`);continue}let f=s.get(a);f||(f=B(a),s.set(a,f),t.push(` ${f}["${b(a)}"]`)),t.push(` ${l} --> ${f}`)}}const o=[],r=[];for(const c of e.components){const l=n.get(c.id);l&&(c.readiness.status==="degraded"&&o.push(l),c.readiness.status==="not-ready"&&r.push(l))}return o.length>0&&(t.push(` class ${o.join(",")} degraded`),t.push(" classDef degraded stroke:#f59e0b,stroke-width:2px")),r.length>0&&(t.push(` class ${r.join(",")} notReady`),t.push(" classDef notReady stroke:#ef4444,stroke-width:2px")),t.join(`
|
|
5
|
+
`)}function p(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function X(e){try{const t=new URL(e);if(t.protocol==="https:"||t.protocol==="http:")return t.href}catch{return}}function V(e){const t=X(e),n=p(e);return t?`<p><strong>docs:</strong> <a href="${p(t)}" target="_blank" rel="noopener noreferrer">${n}</a></p>`:`<p><strong>docs:</strong> <span>${n}</span></p>`}function M(e){const t=new Set(e.map(o=>o.id)),n=[],s=new Set;for(const o of e)for(const r of o.dependencies)t.has(r)||s.has(r)||(s.add(r),n.push(r));return n}function G(e,t,n){const s=Math.min(t,n)/2-70,o=t/2,r=n/2,c=new Map,l=M(e.components),a=[...e.components.map(g=>g.id),...l];return a.forEach((g,f)=>{const u=Math.PI*2*f/Math.max(a.length,1);c.set(g,{x:o+s*Math.cos(u),y:r+s*Math.sin(u)})}),c}function K(e,t){const o=e.components,r=G(e,900,460),c=M(o),l=o.flatMap(f=>f.dependencies.map(u=>{const v=r.get(f.id),S=r.get(u);return!v||!S?"":`<line x1="${v.x}" y1="${v.y}" x2="${S.x}" y2="${S.y}" class="edge-line" marker-end="url(#arrow)" />`})).join(""),a=o.map(f=>{const u=r.get(f.id);if(!u)return"";const S=["module-node",f.readiness.status==="not-ready"?"component-not-ready":f.readiness.status==="degraded"?"component-degraded":"component-ready",f.id===t?"module-selected":""].filter(Boolean).join(" ");return`<g>
|
|
6
6
|
<circle cx="${u.x}" cy="${u.y}" r="34" class="${S}" data-component="${p(f.id)}" />
|
|
7
7
|
<text x="${u.x}" y="${u.y+4}" text-anchor="middle" class="module-label">${p(f.id)}</text>
|
|
8
|
-
</g>`}).join(""),
|
|
8
|
+
</g>`}).join(""),g=c.map(f=>{const u=r.get(f);return u?`<g>
|
|
9
9
|
<rect x="${u.x-42}" y="${u.y-20}" width="84" height="40" rx="10" class="module-node component-external" />
|
|
10
10
|
<text x="${u.x}" y="${u.y+4}" text-anchor="middle" class="module-label">${p(f)}</text>
|
|
11
11
|
</g>`:""}).join("");return`<svg viewBox="0 0 900 460" role="img" aria-label="Platform component dependency graph">
|
|
@@ -15,19 +15,19 @@
|
|
|
15
15
|
</marker>
|
|
16
16
|
</defs>
|
|
17
17
|
${l}
|
|
18
|
-
${
|
|
19
|
-
${
|
|
20
|
-
</svg>`}function
|
|
21
|
-
${e.diagnostics.map(t=>{const n=t.dependsOn&&t.dependsOn.length>0?`<div class="chips">${t.dependsOn.map(
|
|
18
|
+
${a}
|
|
19
|
+
${g}
|
|
20
|
+
</svg>`}function Q(e){return e?e.diagnostics.length===0?'<p class="muted">No diagnostics issues.</p>':`<div class="diagnostics-list">
|
|
21
|
+
${e.diagnostics.map(t=>{const n=t.dependsOn&&t.dependsOn.length>0?`<div class="chips">${t.dependsOn.map(s=>`<span class="chip">dependsOn: ${p(s)}</span>`).join("")}</div>`:"";return`<article class="card issue severity-${p(t.severity)}">
|
|
22
22
|
<h3>${p(t.code)}</h3>
|
|
23
23
|
<p><strong>severity:</strong> ${p(t.severity)} · <strong>component:</strong> ${p(t.componentId)}</p>
|
|
24
24
|
<p>${p(t.message)}</p>
|
|
25
25
|
${t.cause?`<p><strong>cause:</strong> ${p(t.cause)}</p>`:""}
|
|
26
26
|
${t.fixHint?`<p><strong>fix hint:</strong> ${p(t.fixHint)}</p>`:""}
|
|
27
|
-
${t.docsUrl?
|
|
27
|
+
${t.docsUrl?V(t.docsUrl):""}
|
|
28
28
|
${n}
|
|
29
29
|
</article>`}).join("")}
|
|
30
|
-
</div>`:'<p class="muted">No platform snapshot loaded.</p>'}const j=document.querySelector("#app");if(!j)throw new Error("App root not found.");const
|
|
30
|
+
</div>`:'<p class="muted">No platform snapshot loaded.</p>'}const j=document.querySelector("#app");if(!j)throw new Error("App root not found.");const W=j,Z=["ready","degraded","not-ready"],ee=["error","warning","info"],d={filter:{query:"",readinessStatuses:[],severities:[]}};function te(e,t){const n=new Blob([t],{type:"application/json"}),s=URL.createObjectURL(n),o=document.createElement("a");o.href=s,o.download=e,o.click(),URL.revokeObjectURL(s)}async function I(e){if(!navigator.clipboard)throw new Error("Clipboard API is unavailable.");await navigator.clipboard.writeText(e)}function N(e,t){return e.includes(t)?e.filter(n=>n!==t):[...e,t]}function D(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement}function ne(){const e=document.activeElement;if(!(!D(e)||!e.id))return{id:e.id,selectionEnd:e.selectionEnd,selectionStart:e.selectionStart}}function re(e){if(!e)return;const t=document.getElementById(e.id);D(t)&&(t.focus({preventScroll:!0}),e.selectionStart!==null&&e.selectionEnd!==null&&t.setSelectionRange(e.selectionStart,e.selectionEnd))}function T(e,t){return!e||e.components.length===0?void 0:(t?e.components.find(s=>s.id===t):void 0)??e.components[0]}function x(){var n;const e=(n=d.payload)==null?void 0:n.snapshot;if(!e){d.filteredSnapshot=void 0,d.selectedComponentId=void 0;return}d.filteredSnapshot=_(e,d.filter);const t=T(d.filteredSnapshot,d.selectedComponentId);d.selectedComponentId=t==null?void 0:t.id}function oe(e){if(!e)return'<p class="muted">No component selected.</p>';const t=e.dependencies.length>0?e.dependencies.map(n=>`<span class="chip">dependsOn: ${p(n)}</span>`).join(""):'<span class="chip">dependsOn: none</span>';return`
|
|
31
31
|
<h3>${p(e.id)}</h3>
|
|
32
32
|
<p class="muted">kind: <strong>${p(e.kind)}</strong> · state: <strong>${p(e.state)}</strong></p>
|
|
33
33
|
<div class="chips">
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
${e.phases.map(n=>`<tr><td>${p(n.name)}</td><td>${n.durationMs.toFixed(3)}</td></tr>`).join("")}
|
|
51
51
|
</tbody>
|
|
52
52
|
</table>
|
|
53
|
-
`:'<p class="muted">Timing not collected.</p>'}function
|
|
53
|
+
`:'<p class="muted">Timing not collected.</p>'}function ie(e){if(!e)return'<p class="muted">No platform snapshot loaded.</p>';const t={degraded:e.components.filter(n=>n.readiness.status==="degraded").length,notReady:e.components.filter(n=>n.readiness.status==="not-ready").length,ready:e.components.filter(n=>n.readiness.status==="ready").length};return`
|
|
54
54
|
<div class="chips">
|
|
55
55
|
<span class="chip">generatedAt: ${p(e.generatedAt)}</span>
|
|
56
56
|
<span class="chip">aggregate readiness: ${p(e.readiness.status)}</span>
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
<span class="chip">diagnostics: ${String(e.diagnostics.length)}</span>
|
|
60
60
|
<span class="chip">ready/degraded/not-ready: ${t.ready}/${t.degraded}/${t.notReady}</span>
|
|
61
61
|
</div>
|
|
62
|
-
`}function
|
|
62
|
+
`}function m(e={}){const t=typeof e=="string"?e:e.message,n=typeof e=="string"||!e.preserveFocus?void 0:ne(),s=d.filteredSnapshot,o=T(s,d.selectedComponentId),r=s?O(s):"",c=s&&s.components.length>0?K(s,o==null?void 0:o.id):'<p class="muted">No platform components loaded.</p>';W.innerHTML=`
|
|
63
63
|
<main>
|
|
64
64
|
<header>
|
|
65
65
|
<h1>Fluo Studio Platform Snapshot Viewer</h1>
|
|
@@ -73,14 +73,14 @@
|
|
|
73
73
|
<div class="actions">
|
|
74
74
|
<button id="download-json" ${d.rawJson?"":"disabled"}>Download loaded JSON</button>
|
|
75
75
|
<button id="copy-json" ${d.rawJson?"":"disabled"}>Copy loaded JSON</button>
|
|
76
|
-
<button id="copy-mermaid" ${
|
|
76
|
+
<button id="copy-mermaid" ${s?"":"disabled"}>Copy Mermaid</button>
|
|
77
77
|
</div>
|
|
78
78
|
${t?`<p class="notice">${p(t)}</p>`:""}
|
|
79
79
|
</section>
|
|
80
80
|
|
|
81
81
|
<section class="card">
|
|
82
82
|
<h2>Snapshot summary</h2>
|
|
83
|
-
${
|
|
83
|
+
${ie(s)}
|
|
84
84
|
</section>
|
|
85
85
|
|
|
86
86
|
<section class="split-grid">
|
|
@@ -93,12 +93,12 @@
|
|
|
93
93
|
|
|
94
94
|
<div class="filter-row">
|
|
95
95
|
<span>Component readiness</span>
|
|
96
|
-
${
|
|
96
|
+
${Z.map(i=>`<label><input type="checkbox" id="readiness-${i}" data-readiness="${i}" ${d.filter.readinessStatuses.includes(i)?"checked":""}/> ${i}</label>`).join("")}
|
|
97
97
|
</div>
|
|
98
98
|
|
|
99
99
|
<div class="filter-row">
|
|
100
100
|
<span>Diagnostic severity</span>
|
|
101
|
-
${
|
|
101
|
+
${ee.map(i=>`<label><input type="checkbox" id="severity-${i}" data-severity="${i}" ${d.filter.severities.includes(i)?"checked":""}/> ${i}</label>`).join("")}
|
|
102
102
|
</div>
|
|
103
103
|
</div>
|
|
104
104
|
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
<section class="split-grid">
|
|
118
118
|
<div class="card" id="details-panel">
|
|
119
119
|
<h2>Component details</h2>
|
|
120
|
-
${
|
|
120
|
+
${oe(o)}
|
|
121
121
|
</div>
|
|
122
122
|
<div class="card">
|
|
123
123
|
<h2>Mermaid output</h2>
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
<section class="card">
|
|
129
129
|
<h2>Diagnostics issues</h2>
|
|
130
130
|
<p class="muted">Fix hints and dependency chains are rendered from <code>diagnostics.fixHint</code> and <code>diagnostics.dependsOn</code>.</p>
|
|
131
|
-
${
|
|
131
|
+
${Q(s)}
|
|
132
132
|
</section>
|
|
133
133
|
</main>
|
|
134
|
-
`;const l=document.querySelector("#file-input"),
|
|
134
|
+
`;const l=document.querySelector("#file-input"),a=document.querySelector("#drop-zone"),g=document.querySelector("#search"),f=document.querySelector("#copy-json"),u=document.querySelector("#download-json"),v=document.querySelector("#copy-mermaid"),S=async i=>{const w=await i.text();try{const y=U(w);d.payload=y.payload,d.rawJson=y.rawJson,x(),m("Diagnostics file loaded successfully.")}catch(y){d.payload=void 0,d.filteredSnapshot=void 0,d.selectedComponentId=void 0,d.rawJson=void 0,m(y instanceof Error?y.message:"Failed to parse diagnostics file.")}};l==null||l.addEventListener("change",async i=>{var E;const y=(E=i.target.files)==null?void 0:E[0];y&&await S(y)}),a==null||a.addEventListener("dragover",i=>{i.preventDefault(),a.classList.add("drag-active")}),a==null||a.addEventListener("dragleave",()=>{a.classList.remove("drag-active")}),a==null||a.addEventListener("drop",async i=>{var y,E;i.preventDefault(),a.classList.remove("drag-active");const w=(E=(y=i.dataTransfer)==null?void 0:y.files)==null?void 0:E[0];w&&await S(w)}),g==null||g.addEventListener("input",i=>{const w=i.target;d.filter.query=w.value,x(),m({preserveFocus:!0})}),document.querySelectorAll("input[data-readiness]").forEach(i=>{i.addEventListener("change",()=>{d.filter.readinessStatuses=N(d.filter.readinessStatuses,i.dataset.readiness),x(),m({preserveFocus:!0})})}),document.querySelectorAll("input[data-severity]").forEach(i=>{i.addEventListener("change",()=>{d.filter.severities=N(d.filter.severities,i.dataset.severity),x(),m({preserveFocus:!0})})}),f==null||f.addEventListener("click",async()=>{if(d.rawJson)try{await I(d.rawJson),m("Loaded JSON copied to clipboard.")}catch(i){m(i instanceof Error?i.message:"Failed to copy JSON.")}}),u==null||u.addEventListener("click",()=>{d.rawJson&&(te("fluo-diagnostics.json",d.rawJson),m("Loaded JSON downloaded."))}),v==null||v.addEventListener("click",async()=>{if(s)try{await I(O(s)),m("Mermaid copied to clipboard.")}catch(i){m(i instanceof Error?i.message:"Failed to copy Mermaid text.")}}),document.querySelectorAll("[data-component]").forEach(i=>{i.addEventListener("click",()=>{const w=i.dataset.component;w&&(d.selectedComponentId=w,m())})}),re(n)}x();m();
|
package/dist/contracts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAEtF;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG,uBAAuB,CAAC,UAAU,CAAC,CAAC;AAE7E;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,qBAAqB,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;IACxD,eAAe,EAAE,qBAAqB,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC9D,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,qBAAqB,CAAC;IAChC,OAAO,EAAE,mBAAmB,CAAC;IAC7B,MAAM,EAAE,0BAA0B,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC,MAAM,CAAC,EAAE,0BAA0B,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,uBAAuB,EAAE,CAAC;IAC7C,UAAU,EAAE,0BAA0B,EAAE,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,aAAa,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB;
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAEtF;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG,uBAAuB,CAAC,UAAU,CAAC,CAAC;AAE7E;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,qBAAqB,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;IACxD,eAAe,EAAE,qBAAqB,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC9D,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,qBAAqB,CAAC;IAChC,OAAO,EAAE,mBAAmB,CAAC;IAC7B,MAAM,EAAE,0BAA0B,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC,MAAM,CAAC,EAAE,0BAA0B,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,uBAAuB,EAAE,CAAC;IAC7C,UAAU,EAAE,0BAA0B,EAAE,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,aAAa,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB;AA0MD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,CA4BjE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,qBAAqB,EAAE,MAAM,EAAE,WAAW,GAAG,qBAAqB,CAwCxG;AA8BD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,qBAAqB,GAAG,MAAM,CAsErE"}
|
package/dist/contracts.js
CHANGED
|
@@ -113,6 +113,13 @@ function validateReportSummary(value) {
|
|
|
113
113
|
}
|
|
114
114
|
return value;
|
|
115
115
|
}
|
|
116
|
+
function validateReportSummaryConsistency(summary, snapshot, timing) {
|
|
117
|
+
const errorCount = snapshot.diagnostics.filter(diagnostic => diagnostic.severity === 'error').length;
|
|
118
|
+
const warningCount = snapshot.diagnostics.filter(diagnostic => diagnostic.severity === 'warning').length;
|
|
119
|
+
if (summary.componentCount !== snapshot.components.length || summary.diagnosticCount !== snapshot.diagnostics.length || summary.errorCount !== errorCount || summary.healthStatus !== snapshot.health.status || summary.readinessStatus !== snapshot.readiness.status || summary.timingTotalMs !== timing.totalMs || summary.warningCount !== warningCount) {
|
|
120
|
+
throw new Error('Inspect report summary does not match snapshot and timing payload data.');
|
|
121
|
+
}
|
|
122
|
+
}
|
|
116
123
|
function isReportArtifactEnvelope(value) {
|
|
117
124
|
return value.summary !== undefined || hasOwn(value, 'snapshot') && hasOwn(value, 'timing') && (hasOwn(value, 'generatedAt') || hasOwn(value, 'version'));
|
|
118
125
|
}
|
|
@@ -123,10 +130,12 @@ function validateReport(value, snapshot, timing) {
|
|
|
123
130
|
if (value.summary === undefined || value.version !== 1 || typeof value.generatedAt !== 'string' || !snapshot || !timing) {
|
|
124
131
|
throw new Error('Invalid inspect report artifact payload.');
|
|
125
132
|
}
|
|
133
|
+
const summary = validateReportSummary(value.summary);
|
|
134
|
+
validateReportSummaryConsistency(summary, snapshot, timing);
|
|
126
135
|
return {
|
|
127
136
|
generatedAt: value.generatedAt,
|
|
128
137
|
snapshot,
|
|
129
|
-
summary
|
|
138
|
+
summary,
|
|
130
139
|
timing,
|
|
131
140
|
version: 1
|
|
132
141
|
};
|
package/dist/index.html
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Fluo Studio</title>
|
|
7
|
-
<script type="module" crossorigin src="
|
|
8
|
-
<link rel="stylesheet" crossorigin href="
|
|
7
|
+
<script type="module" crossorigin src="./assets/index-DgzYYxRA.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="./assets/index-CQ_tQzq9.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="app"></div>
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"module-graph",
|
|
10
10
|
"devtools"
|
|
11
11
|
],
|
|
12
|
-
"version": "1.0.
|
|
12
|
+
"version": "1.0.3",
|
|
13
13
|
"private": false,
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"repository": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dist"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@fluojs/runtime": "^1.1.
|
|
44
|
+
"@fluojs/runtime": "^1.1.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"happy-dom": "^20.9.0",
|