likec4 1.23.0 → 1.23.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.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{c as pt,f as yp,m as mt,g as Ji,a as Ep,b as xa,T as Dp,N as Ma,i as vp,n as Xi,C as $p,d as _p,e as qa,h as Ua,t as wp,p as bp,u as K,l as Ap,w as Cp,j as Sp,k as Rp,o as zt,q as Ha,r as Va,L as gt,s as Op,v as yt,x as Ip,y as Fp,z as Pp,A as dr,B as za,D as Np,E as Sr,F as Qi,G as Ga,H as Tp,Q as Lp}from"../shared/likec4.D7xos_Vh.mjs";import Te,{hrtime as jp,cwd as Zi,exit as Wa,stdout as kp,argv as Bp}from"node:process";import{strictEqual as xp,notStrictEqual as Mp}from"assert";import es,{
2
+ import{c as pt,f as yp,m as mt,g as Ji,a as Ep,b as xa,T as Dp,N as Ma,i as vp,n as Xi,C as $p,d as _p,e as qa,h as Ua,t as wp,p as bp,u as K,l as Ap,w as Cp,j as Sp,k as Rp,o as zt,q as Ha,r as Va,L as gt,s as Op,v as yt,x as Ip,y as Fp,z as Pp,A as dr,B as za,D as Np,E as Sr,F as Qi,G as Ga,H as Tp,Q as Lp}from"../shared/likec4.BguysIDg.mjs";import Te,{hrtime as jp,cwd as Zi,exit as Wa,stdout as kp,argv as Bp}from"node:process";import{strictEqual as xp,notStrictEqual as Mp}from"assert";import es,{
3
3
  resolve as Qe,dirname as ts,normalize as qp,relative as Up,extname as Hp,basename as Vp}from"path";import{statSync as Ka,readdirSync as zp,readFileSync as rs,writeFile as Gp}from"fs";import Ya,{format as Ja,inspect as Wp}from"util";import{fileURLToPath as Kp}from"url";import be,{resolve as De,dirname as Gt,join as Rr,relative as Wt,extname as Or,isAbsolute as ns,basename as on}from"node:path";import ge,{existsSync as Pt,copyFileSync as Xa,readdirSync as Yp,rmSync as is}from"node:fs";import{mkdtemp as an,
4
4
  writeFile as Kt,mkdir as $t,stat as ss,copyFile as Jp,rm as Xp}from"node:fs/promises";import Ir,{tmpdir as un}from"node:os";import{fileURLToPath as Qa}from"node:url";import Za from"@vitejs/plugin-react";import{sortNaturalByFqn as eu,compareNatural as Qp,hasAtLeast as Zp,invariant as os,nonexhaustive as tu,delay as ru}from"@likec4/core";import{build as Fr,createServer as em,preview as tm}from"vite";import{chromium as nu}from"playwright";import rm from"node:net";import{setTimeout as nm}from"node:timers/promises";
5
5
  import{promisify as Me,isDeepStrictEqual as im}from"node:util";import Pr from"node:crypto";import sm from"node:assert";import"tty";import"os";import"crypto";import"net";import"child_process";import"@likec4/core/types";import"events";import"buffer";import"@hpcc-js/wasm-graphviz";import"@likec4/core/compute-view";import"boxen";import"node:child_process";import"node:events";import"node:stream/promises";import"fs/promises";import"@likec4/core/model";const cn=Object.create(null),Nr=t=>globalThis.process?.
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import"@likec4/core";export{LikeC4DeploymentModel,LikeC4Model,LikeC4ViewModel}from"@likec4/core/model";export{L as LikeC4}from"./shared/likec4.D7xos_Vh.mjs";import"node:fs";import"node:path";import"node:url";import"tty";import"node:util";import"util";import"path";import"os";import"crypto";import"net";import"url";import"fs";import"child_process";import"@likec4/core/types";import"events";import"buffer";import"@hpcc-js/wasm-graphviz";import"@likec4/core/compute-view";import"node:process";import"boxen";
1
+ import"@likec4/core";export{LikeC4DeploymentModel,LikeC4Model,LikeC4ViewModel}from"@likec4/core/model";export{L as LikeC4}from"./shared/likec4.BguysIDg.mjs";import"node:fs";import"node:path";import"node:url";import"tty";import"node:util";import"util";import"path";import"os";import"crypto";import"net";import"url";import"fs";import"child_process";import"@likec4/core/types";import"events";import"buffer";import"@hpcc-js/wasm-graphviz";import"@likec4/core/compute-view";import"node:process";import"boxen";
2
2
  import"node:child_process";import"node:events";import"node:fs/promises";import"node:stream/promises";import"node:os";import"fs/promises";
@@ -1508,24 +1508,24 @@ es@91"}}]}},{"$type":"Type","name":"DeploymentNodeOrElementKind","type":{"$type"
1508
1508
  :"WhereExpression","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@59"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@71"}}]}},{"$type":"Type","name":"DeploymentElement","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@97"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@99"}}]}},{"$type":"Type","name":"Referenceable","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@97"}},{"$type\
1509
1509
  ":"SimpleType","typeRef":{"$ref":"#/rules@99"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@17"}}]}},{"$type":"Type","name":"FqnReferenceable","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/types@7"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@17"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@21"}}]}},{"$type":"Type","name":"SizeProperty","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@136"}},{"$type":"SimpleT\
1510
1510
  ype","typeRef":{"$ref":"#/rules@137"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@138"}}]}}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"interfaces":[],"usedGrammars":[]}`)),uv={languageId:"likec4",fileExtensions:[".c4",".likec4",".like-c4"],caseInsensitive:!1,mode:"production"},bU={skipValidations:!0,recoveryEnabled:!0,nodeLocationTracking:"full"},RU={AstReflection:()=>new j0},$U={Grammar:()=>wU(),LanguageMetaData:()=>uv,parser:{ParserConfig:()=>bU}},Xe=ln.getChild("server");
1511
- function lv(t){Xe.error(ea(t))}function Re(t){Xe.warn(ea(t))}const kU={fileSystemProvider:()=>new EU},TU=t=>uv.fileExtensions.some(e=>t.endsWith(e));class EU extends CB{async readDirectory(e){const n=[];try{const r=await new AB.fdir().withSymlinks().withFullPaths().filter(TU).crawl(e.fsPath).withPromise();for(const i of r)n.push({isFile:!0,isDirectory:!1,uri:Vt.file(i)})}catch(r){lv(r)}return n}}var SU=Object.getOwnPropertyNames,_U=Object.getOwnPropertySymbols,AU=Object.prototype.hasOwnProperty;
1512
- function U0(t,e){return function(r,i,s){return t(r,i,s)&&e(r,i,s)}}function sp(t){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,i);var s=i.cache,a=s.get(n),o=s.get(r);if(a&&o)return a===r&&o===n;s.set(n,r),s.set(r,n);var c=t(n,r,i);return s.delete(n),s.delete(r),c}}function W0(t){return SU(t).concat(_U(t))}var CU=Object.hasOwn||function(t,e){return AU.call(t,e)};function qs(t,e){return t===e||!t&&!e&&t!==t&&e!==e}var PU="__v",xU="__o",NU="_owner",H0=Object.
1513
- getOwnPropertyDescriptor,K0=Object.keys;function DU(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function IU(t,e){return qs(t.getTime(),e.getTime())}function OU(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function LU(t,e){return t===e}function V0(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),s=t.entries(),a,o,c=0;(a=s.next())&&!a.done;){for(var u=e.entries(),
1514
- l=!1,d=0;(o=u.next())&&!o.done;){if(i[d]){d++;continue}var f=a.value,h=o.value;if(n.equals(f[0],h[0],c,d,t,e,n)&&n.equals(f[1],h[1],f[0],h[0],t,e,n)){l=i[d]=!0;break}d++}if(!l)return!1;c++}return!0}var MU=qs;function zU(t,e,n){var r=K0(t),i=r.length;if(K0(e).length!==i)return!1;for(;i-- >0;)if(!Y0(t,e,n,r[i]))return!1;return!0}function jl(t,e,n){var r=W0(t),i=r.length;if(W0(e).length!==i)return!1;for(var s,a,o;i-- >0;)if(s=r[i],!Y0(t,e,n,s)||(a=H0(t,s),o=H0(e,s),(a||o)&&(!a||!o||a.configurable!==
1515
- o.configurable||a.enumerable!==o.enumerable||a.writable!==o.writable)))return!1;return!0}function FU(t,e){return qs(t.valueOf(),e.valueOf())}function qU(t,e){return t.source===e.source&&t.flags===e.flags}function X0(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),s=t.values(),a,o;(a=s.next())&&!a.done;){for(var c=e.values(),u=!1,l=0;(o=c.next())&&!o.done;){if(!i[l]&&n.equals(a.value,o.value,a.value,o.value,t,e,n)){u=i[l]=!0;break}l++}if(!u)return!1}return!0}function GU(t,e){
1516
- var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function jU(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function Y0(t,e,n,r){return(r===NU||r===xU||r===PU)&&(t.$$typeof||e.$$typeof)?!0:CU(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}var BU="[object Arguments]",UU="[object Boolean]",WU="[object Date]",HU="[object Error]",KU="[object Map]",VU="[\
1517
- object Number]",XU="[object Object]",YU="[object RegExp]",JU="[object Set]",QU="[object String]",ZU="[object URL]",eW=Array.isArray,J0=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Q0=Object.assign,tW=Object.prototype.toString.call.bind(Object.prototype.toString);function nW(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areErrorsEqual,i=t.areFunctionsEqual,s=t.areMapsEqual,a=t.areNumbersEqual,o=t.areObjectsEqual,c=t.arePrimitiveWrappersEqual,u=t.areRegExpsEqual,l=t.
1518
- areSetsEqual,d=t.areTypedArraysEqual,f=t.areUrlsEqual;return function(g,R,$){if(g===R)return!0;if(g==null||R==null)return!1;var w=typeof g;if(w!==typeof R)return!1;if(w!=="object")return w==="number"?a(g,R,$):w==="function"?i(g,R,$):!1;var E=g.constructor;if(E!==R.constructor)return!1;if(E===Object)return o(g,R,$);if(eW(g))return e(g,R,$);if(J0!=null&&J0(g))return d(g,R,$);if(E===Date)return n(g,R,$);if(E===RegExp)return u(g,R,$);if(E===Map)return s(g,R,$);if(E===Set)return l(g,R,$);var S=tW(g);
1519
- return S===WU?n(g,R,$):S===YU?u(g,R,$):S===KU?s(g,R,$):S===JU?l(g,R,$):S===XU?typeof g.then!="function"&&typeof R.then!="function"&&o(g,R,$):S===ZU?f(g,R,$):S===HU?r(g,R,$):S===BU?o(g,R,$):S===UU||S===VU||S===QU?c(g,R,$):!1}}function rW(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?jl:DU,areDatesEqual:IU,areErrorsEqual:OU,areFunctionsEqual:LU,areMapsEqual:r?U0(V0,jl):V0,areNumbersEqual:MU,areObjectsEqual:r?jl:zU,arePrimitiveWrappersEqual:FU,areRegExpsEqual:qU,areSetsEqual:r?
1520
- U0(X0,jl):X0,areTypedArraysEqual:r?jl:GU,areUrlsEqual:jU};if(n&&(i=Q0({},i,n(i))),e){var s=sp(i.areArraysEqual),a=sp(i.areMapsEqual),o=sp(i.areObjectsEqual),c=sp(i.areSetsEqual);i=Q0({},i,{areArraysEqual:s,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:c})}return i}function iW(t){return function(e,n,r,i,s,a,o){return t(e,n,o)}}function sW(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,s=t.strict;if(r)return function(c,u){var l=r(),d=l.cache,f=d===void 0?e?new WeakMap:void 0:d,h=l.meta;
1521
- return n(c,u,{cache:f,equals:i,meta:h,strict:s})};if(e)return function(c,u){return n(c,u,{cache:new WeakMap,equals:i,meta:void 0,strict:s})};var a={cache:void 0,equals:i,meta:void 0,strict:s};return function(c,u){return n(c,u,a)}}var dv=Li();Li({strict:!0}),Li({circular:!0}),Li({circular:!0,strict:!0}),Li({createInternalComparator:function(){return qs}}),Li({strict:!0,createInternalComparator:function(){return qs}}),Li({circular:!0,createInternalComparator:function(){return qs}}),Li({circular:!0,
1522
- createInternalComparator:function(){return qs},strict:!0});function Li(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,s=t.strict,a=s===void 0?!1:s,o=rW(t),c=nW(o),u=r?r(c):iW(c);return sW({circular:n,comparator:c,createState:i,equals:u,strict:a})}function Z0(t,e){const n=t.nodes.map(i=>{const s=e.nodes[i.id];if(!s)return i;const{x:a,y:o,width:c,height:u}=s;return{...i,width:c,height:u,position:[a,o]}}),r=t.edges.map(i=>{const s=e.edges[i.id];
1523
- return s?{...i,...s}:i});return{...t,bounds:{x:e.x,y:e.y,width:e.width,height:e.height},nodes:n,edges:r}}const e_=(t,e)=>t.width>e.width+10||t.height>e.height+10;function aW(t,e){if(t.hash===e.hash)return{diagram:Z0(t,e)};if(dv(t.autoLayout,e.autoLayout)&&t.nodes.every(r=>{const i=e.nodes[r.id];return!!i&&(r.children.length>0&&i.isCompound||r.children.length===0&&!i.isCompound)&&(i.isCompound||e_(r,i)===!1)})&&t.edges.every(r=>{const i=e.edges[r.id];return!!i&&(!r.labelBBox&&!i.labelBBox||!!r.labelBBox&&
1524
- !!i.labelBBox&&r.labelBBox.width<=i.labelBBox.width&&r.labelBBox.height<=i.labelBBox.height)}))return{diagram:Z0(t,e)};const n=t.nodes.reduce((r,i)=>{const s=e.nodes[i.id];if(i.children.length>0||!s)return r;const a={id:i.id,center:{x:Math.round(s.x+s.width/2),y:Math.round(s.y+s.height/2)}};return s.isCompound||e_(i,s)||(a.fixedsize={width:s.width,height:s.height}),r.push(a),r},[]);return{relayout:{x:e.x,y:e.y,height:e.height,nodes:n,edges:Wf(e.edges).flatMap(([r,i])=>i.dotpos?{id:r,dotpos:i.dotpos}:
1525
- [])}}}function t_(t){return typeof t=="object"&&t!==null&&typeof t.id=="string"}function fv(t){return typeof t=="object"&&t!==null&&t.$$type==="Node"&&typeof t.id=="string"}function n_(t){return fv(t)||t_(t)}function Bl(t){return typeof t=="string"||n_(t)}function oW(t){return Array.isArray(t)&&t.every(Bl)}function cW(t){return["n","ne","e","se","s","sw","w","nw","c"].includes(t)}function r_(t){if(n_(t))return t;const[e,n,r]=t.split(":");return cW(r)?{id:e,port:n,compass:r}:{id:e,port:n}}function uW(t){
1526
- if(t.length<2&&(Bl(t[0])&&Bl(t[1]))===!1)throw Error("EdgeTargets must have at least 2 elements.");return t.map(e=>r_(e))}const ap=Object.seal({Graph:null,Digraph:null,Subgraph:null,Node:null,Edge:null});function lW(t){return Object.assign(Object.seal(Object.assign({},ap)),t)}function dW(...t){const[e,...n]=t;return(...r)=>n.reduce((i,s)=>s(i),e(...r))}function Xn(t,...e){return dW(t,...e)}const fW=t=>(...e)=>n=>t(n,...e),hW=t=>({[Symbol.iterator]:t}),lr=fW((t,e)=>Array.from(hW(function*(){for(const n of t)
1527
- yield e(n)})));class i_{options;getLocation(){return this.options?.locationFunction?.()??null}constructor(e){this.options=e}createElement(e,n,r=[]){return{location:this.getLocation(),...n,type:e,children:r}}}const Ze=i_.prototype.createElement.bind(new i_),pW=/\r?\n/;function dr(t){return e=>e.join(t)}function mW(t){return e=>t+e+t}function Mi(t,e){return n=>t+n+e}function op(t){return e=>t+e}const s_=t=>t.replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/"/g,'\\"'),cp=t=>t.split(pW),Ul=(t,e,n)=>Xn(
1528
- cp,lr(op(t==="space"?" ".repeat(e):`
1511
+ function lv(t){Xe.error(ea(t))}function Re(t){Xe.warn(ea(t))}const kU={fileSystemProvider:()=>new EU},TU=t=>uv.fileExtensions.some(e=>t.endsWith(e));class EU extends CB{async readDirectory(e){const n=[];try{const r=await new AB.fdir().withSymlinks({resolvePaths:!1}).withFullPaths().filter(TU).crawl(e.fsPath).withPromise();for(const i of r)n.push({isFile:!0,isDirectory:!1,uri:Vt.file(i)})}catch(r){lv(r)}return n}}var SU=Object.getOwnPropertyNames,_U=Object.getOwnPropertySymbols,AU=Object.prototype.
1512
+ hasOwnProperty;function U0(t,e){return function(r,i,s){return t(r,i,s)&&e(r,i,s)}}function sp(t){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,i);var s=i.cache,a=s.get(n),o=s.get(r);if(a&&o)return a===r&&o===n;s.set(n,r),s.set(r,n);var c=t(n,r,i);return s.delete(n),s.delete(r),c}}function W0(t){return SU(t).concat(_U(t))}var CU=Object.hasOwn||function(t,e){return AU.call(t,e)};function qs(t,e){return t===e||!t&&!e&&t!==t&&e!==e}var PU="__v",xU="__o",NU="_o\
1513
+ wner",H0=Object.getOwnPropertyDescriptor,K0=Object.keys;function DU(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function IU(t,e){return qs(t.getTime(),e.getTime())}function OU(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function LU(t,e){return t===e}function V0(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),s=t.entries(),a,o,c=0;(a=s.next())&&!a.done;){
1514
+ for(var u=e.entries(),l=!1,d=0;(o=u.next())&&!o.done;){if(i[d]){d++;continue}var f=a.value,h=o.value;if(n.equals(f[0],h[0],c,d,t,e,n)&&n.equals(f[1],h[1],f[0],h[0],t,e,n)){l=i[d]=!0;break}d++}if(!l)return!1;c++}return!0}var MU=qs;function zU(t,e,n){var r=K0(t),i=r.length;if(K0(e).length!==i)return!1;for(;i-- >0;)if(!Y0(t,e,n,r[i]))return!1;return!0}function jl(t,e,n){var r=W0(t),i=r.length;if(W0(e).length!==i)return!1;for(var s,a,o;i-- >0;)if(s=r[i],!Y0(t,e,n,s)||(a=H0(t,s),o=H0(e,s),(a||o)&&(!a||
1515
+ !o||a.configurable!==o.configurable||a.enumerable!==o.enumerable||a.writable!==o.writable)))return!1;return!0}function FU(t,e){return qs(t.valueOf(),e.valueOf())}function qU(t,e){return t.source===e.source&&t.flags===e.flags}function X0(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),s=t.values(),a,o;(a=s.next())&&!a.done;){for(var c=e.values(),u=!1,l=0;(o=c.next())&&!o.done;){if(!i[l]&&n.equals(a.value,o.value,a.value,o.value,t,e,n)){u=i[l]=!0;break}l++}if(!u)return!1}
1516
+ return!0}function GU(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function jU(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function Y0(t,e,n,r){return(r===NU||r===xU||r===PU)&&(t.$$typeof||e.$$typeof)?!0:CU(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}var BU="[object Arguments]",UU="[object Boolean]",WU="[object Date]",HU="[object Error\
1517
+ ]",KU="[object Map]",VU="[object Number]",XU="[object Object]",YU="[object RegExp]",JU="[object Set]",QU="[object String]",ZU="[object URL]",eW=Array.isArray,J0=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Q0=Object.assign,tW=Object.prototype.toString.call.bind(Object.prototype.toString);function nW(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areErrorsEqual,i=t.areFunctionsEqual,s=t.areMapsEqual,a=t.areNumbersEqual,o=t.areObjectsEqual,c=t.arePrimitiveWrappersEqual,
1518
+ u=t.areRegExpsEqual,l=t.areSetsEqual,d=t.areTypedArraysEqual,f=t.areUrlsEqual;return function(g,R,$){if(g===R)return!0;if(g==null||R==null)return!1;var w=typeof g;if(w!==typeof R)return!1;if(w!=="object")return w==="number"?a(g,R,$):w==="function"?i(g,R,$):!1;var E=g.constructor;if(E!==R.constructor)return!1;if(E===Object)return o(g,R,$);if(eW(g))return e(g,R,$);if(J0!=null&&J0(g))return d(g,R,$);if(E===Date)return n(g,R,$);if(E===RegExp)return u(g,R,$);if(E===Map)return s(g,R,$);if(E===Set)return l(
1519
+ g,R,$);var S=tW(g);return S===WU?n(g,R,$):S===YU?u(g,R,$):S===KU?s(g,R,$):S===JU?l(g,R,$):S===XU?typeof g.then!="function"&&typeof R.then!="function"&&o(g,R,$):S===ZU?f(g,R,$):S===HU?r(g,R,$):S===BU?o(g,R,$):S===UU||S===VU||S===QU?c(g,R,$):!1}}function rW(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?jl:DU,areDatesEqual:IU,areErrorsEqual:OU,areFunctionsEqual:LU,areMapsEqual:r?U0(V0,jl):V0,areNumbersEqual:MU,areObjectsEqual:r?jl:zU,arePrimitiveWrappersEqual:FU,areRegExpsEqual:qU,
1520
+ areSetsEqual:r?U0(X0,jl):X0,areTypedArraysEqual:r?jl:GU,areUrlsEqual:jU};if(n&&(i=Q0({},i,n(i))),e){var s=sp(i.areArraysEqual),a=sp(i.areMapsEqual),o=sp(i.areObjectsEqual),c=sp(i.areSetsEqual);i=Q0({},i,{areArraysEqual:s,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:c})}return i}function iW(t){return function(e,n,r,i,s,a,o){return t(e,n,o)}}function sW(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,s=t.strict;if(r)return function(c,u){var l=r(),d=l.cache,f=d===void 0?e?new WeakMap:
1521
+ void 0:d,h=l.meta;return n(c,u,{cache:f,equals:i,meta:h,strict:s})};if(e)return function(c,u){return n(c,u,{cache:new WeakMap,equals:i,meta:void 0,strict:s})};var a={cache:void 0,equals:i,meta:void 0,strict:s};return function(c,u){return n(c,u,a)}}var dv=Li();Li({strict:!0}),Li({circular:!0}),Li({circular:!0,strict:!0}),Li({createInternalComparator:function(){return qs}}),Li({strict:!0,createInternalComparator:function(){return qs}}),Li({circular:!0,createInternalComparator:function(){return qs}}),
1522
+ Li({circular:!0,createInternalComparator:function(){return qs},strict:!0});function Li(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,s=t.strict,a=s===void 0?!1:s,o=rW(t),c=nW(o),u=r?r(c):iW(c);return sW({circular:n,comparator:c,createState:i,equals:u,strict:a})}function Z0(t,e){const n=t.nodes.map(i=>{const s=e.nodes[i.id];if(!s)return i;const{x:a,y:o,width:c,height:u}=s;return{...i,width:c,height:u,position:[a,o]}}),r=t.edges.map(i=>{const s=e.
1523
+ edges[i.id];return s?{...i,...s}:i});return{...t,bounds:{x:e.x,y:e.y,width:e.width,height:e.height},nodes:n,edges:r}}const e_=(t,e)=>t.width>e.width+10||t.height>e.height+10;function aW(t,e){if(t.hash===e.hash)return{diagram:Z0(t,e)};if(dv(t.autoLayout,e.autoLayout)&&t.nodes.every(r=>{const i=e.nodes[r.id];return!!i&&(r.children.length>0&&i.isCompound||r.children.length===0&&!i.isCompound)&&(i.isCompound||e_(r,i)===!1)})&&t.edges.every(r=>{const i=e.edges[r.id];return!!i&&(!r.labelBBox&&!i.labelBBox||
1524
+ !!r.labelBBox&&!!i.labelBBox&&r.labelBBox.width<=i.labelBBox.width&&r.labelBBox.height<=i.labelBBox.height)}))return{diagram:Z0(t,e)};const n=t.nodes.reduce((r,i)=>{const s=e.nodes[i.id];if(i.children.length>0||!s)return r;const a={id:i.id,center:{x:Math.round(s.x+s.width/2),y:Math.round(s.y+s.height/2)}};return s.isCompound||e_(i,s)||(a.fixedsize={width:s.width,height:s.height}),r.push(a),r},[]);return{relayout:{x:e.x,y:e.y,height:e.height,nodes:n,edges:Wf(e.edges).flatMap(([r,i])=>i.dotpos?{id:r,
1525
+ dotpos:i.dotpos}:[])}}}function t_(t){return typeof t=="object"&&t!==null&&typeof t.id=="string"}function fv(t){return typeof t=="object"&&t!==null&&t.$$type==="Node"&&typeof t.id=="string"}function n_(t){return fv(t)||t_(t)}function Bl(t){return typeof t=="string"||n_(t)}function oW(t){return Array.isArray(t)&&t.every(Bl)}function cW(t){return["n","ne","e","se","s","sw","w","nw","c"].includes(t)}function r_(t){if(n_(t))return t;const[e,n,r]=t.split(":");return cW(r)?{id:e,port:n,compass:r}:{id:e,
1526
+ port:n}}function uW(t){if(t.length<2&&(Bl(t[0])&&Bl(t[1]))===!1)throw Error("EdgeTargets must have at least 2 elements.");return t.map(e=>r_(e))}const ap=Object.seal({Graph:null,Digraph:null,Subgraph:null,Node:null,Edge:null});function lW(t){return Object.assign(Object.seal(Object.assign({},ap)),t)}function dW(...t){const[e,...n]=t;return(...r)=>n.reduce((i,s)=>s(i),e(...r))}function Xn(t,...e){return dW(t,...e)}const fW=t=>(...e)=>n=>t(n,...e),hW=t=>({[Symbol.iterator]:t}),lr=fW((t,e)=>Array.from(
1527
+ hW(function*(){for(const n of t)yield e(n)})));class i_{options;getLocation(){return this.options?.locationFunction?.()??null}constructor(e){this.options=e}createElement(e,n,r=[]){return{location:this.getLocation(),...n,type:e,children:r}}}const Ze=i_.prototype.createElement.bind(new i_),pW=/\r?\n/;function dr(t){return e=>e.join(t)}function mW(t){return e=>t+e+t}function Mi(t,e){return n=>t+n+e}function op(t){return e=>t+e}const s_=t=>t.replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/"/g,'\\"'),
1528
+ cp=t=>t.split(pW),Ul=(t,e,n)=>Xn(cp,lr(op(t==="space"?" ".repeat(e):`
1529
1529
  `)),dr(n)),Gs=t=>{switch(t){case"crlf":return`\r
1530
1530
  `;case"lf":return`
1531
1531
  `}},gW={match(t){return t.type==="AttributeList"},print(t,e){if(e.children.length===0)return`${e.kind.toLocaleLowerCase()} [];`;const n=Gs(t.endOfLine);return Xn(lr(t.print),dr(n),Ul(t.indentStyle,t.indentSize,n),Mi(`${e.kind.toLocaleLowerCase()} [${n}`,`${n}];`))(e.children)}},yW={match(t){return t.type==="Attribute"},print(t,e){return`${t.print(e.key)} = ${t.print(e.value)};`}},vW={match(t){return t.type==="Comment"},print(t,e){const n=Gs(t.endOfLine);switch(e.kind){case"Block":return Xn(cp,lr(
@@ -3576,7 +3576,7 @@ const H=C+q;if(await t(H,{pathExt:E,ignoreErrors:!0})){if(!R.all)return H;S.push
3576
3576
  class o6{dotpath;unflattenpath;constructor(e){this.dotpath=e||OA.sync("dot"),this.unflattenpath=OA.sync("unflatten")}async unflatten(e){return await ew(async()=>{const n=ln.getChild("graphviz-binary");let r;try{const i=await rd(this.unflattenpath,["-l 1","-c 3"],{timeout:1e4,stdin:{string:e}});r=i.stdout,Lt(i.stderr)||n.warn`Command ${i.command} has stderr:\n${i.stderr}`}catch(i){n.error("FAILED GraphvizBinaryAdapter.unflatten",{error:i}),i instanceof Ks&&!Lt(i.stdout)&&(n.warn`Command: '${i.command}' returned result but also failed (exitcode ${i.
3577
3577
  exitCode}): "${i.stderr}"`,r=i.stdout)}return r&&(e=r.replaceAll(/\t\[/g," [").replaceAll(/\t/g," ")),e})}async layoutJson(e){return await ew(async()=>{const n=ln.getChild("graphviz-binary");let r;try{const i=await rd(this.dotpath,["-Tjson","-y"],{timeout:1e4,stdin:{string:e}});r=i.stdout,Lt(i.stderr)||n.warn`Command ${i.command} has stderr:\n${i.stderr}`}catch(i){if(n.error("FAILED GraphvizBinaryAdapter.layoutJson",{error:i}),n.warn(`FAILED DOT:
3578
3578
  ${e}`),i instanceof Ks&&!Lt(i.stdout))n.warn(`Command: '${i.command}' returned result but also failed (exitcode ${i.exitCode}): "${i.stderr}"`),r=i.stdout;else throw i}return r})}async acyclic(e){return Promise.reject(new Error("Method not implemented."))}async svg(e){return await ew(async()=>{const n=ln.getChild("graphviz-binary");let r;try{const i=await rd(this.dotpath,["-Tsvg","-y"],{timeout:1e4,stdin:{string:e}});r=i.stdout,Lt(i.stderr)||n.warn`Command ${i.command} has stderr:\n${i.stderr}`}catch(i){
3579
- if(n.error("FAILED GraphvizBinaryAdapter.svg",{error:i}),n.warn`FAILED DOT:\n${e}`,i instanceof Ks&&!Lt(i.stdout))n.warn`Command: '${i.command}' returned result but also failed (exitcode ${i.exitCode}): "${i.stderr}"`,r=i.stdout;else throw i}return r})}}const c6="likec4",LA="1.23.0",MA=t=>Number.isFinite(t)?t:0;function u6(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(
3579
+ if(n.error("FAILED GraphvizBinaryAdapter.svg",{error:i}),n.warn`FAILED DOT:\n${e}`,i instanceof Ks&&!Lt(i.stdout))n.warn`Command: '${i.command}' returned result but also failed (exitcode ${i.exitCode}): "${i.stderr}"`,r=i.stdout;else throw i}return r})}}const c6="likec4",LA="1.23.1",MA=t=>Number.isFinite(t)?t:0;function u6(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(
3580
3580
  MA(t*1e3)%1e3),nanoseconds:Math.trunc(MA(t*1e6)%1e3)}}function l6(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function d6(t){switch(typeof t){case"number":{if(Number.isFinite(t))return u6(t);break}case"bigint":return l6(t)}throw new TypeError("Expected a finite number or bigint")}const f6=t=>t===0||t===0n,h6=(t,e)=>e===1||e===1n?t:`${t}s`,p6=1e-7,m6=24n*60n*60n*1000n;function g6(t,e){const n=typeof t==
3581
3581
  "bigint";if(!n&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};const r=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[];const s=(l,d)=>{const f=Math.floor(l*10**d+p6);return(Math.round(f)/10**d).toFixed(d)},a=(l,d,f,h)=>{if(!((i.length===0||!e.colonNotation)&&f6(l)&&!(e.colonNotation&&f==="m"))){if(h??=
3582
3582
  String(l),e.colonNotation){const g=h.includes(".")?h.split(".")[0].length:h.length,R=i.length>0?2:1;h="0".repeat(Math.max(0,R-g))+h}else h+=e.verbose?" "+h6(d,l):f;i.push(h)}},o=d6(t),c=BigInt(o.days);if(e.hideYearAndDays?a(BigInt(c)*24n+BigInt(o.hours),"hour","h"):(e.hideYear?a(c,"day","d"):(a(c/365n,"year","y"),a(c%365n,"day","d")),a(Number(o.hours),"hour","h")),a(Number(o.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3){const l=Number(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "likec4",
3
- "version": "1.23.0",
3
+ "version": "1.23.1",
4
4
  "license": "MIT",
5
5
  "homepage": "https://likec4.dev",
6
6
  "author": "Denis Davydkov <denis@davydkov.com>",
@@ -70,7 +70,7 @@
70
70
  "rollup": "4.34.6",
71
71
  "type-fest": "4.34.1",
72
72
  "vite": "5.4.14",
73
- "@likec4/core": "~1.23.0"
73
+ "@likec4/core": "~1.23.1"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@dagrejs/dagre": "1.1.4",
@@ -147,13 +147,13 @@
147
147
  "vitest": "^3.0.4",
148
148
  "which": "^5.0.0",
149
149
  "yargs": "17.7.2",
150
- "@likec4/diagram": "1.23.0",
151
- "@likec4/generators": "1.23.0",
152
- "@likec4/icons": "1.23.0",
153
- "@likec4/layouts": "1.23.0",
154
- "@likec4/language-server": "1.23.0",
155
- "@likec4/log": "1.23.0",
156
- "@likec4/tsconfig": "1.23.0"
150
+ "@likec4/diagram": "1.23.1",
151
+ "@likec4/icons": "1.23.1",
152
+ "@likec4/generators": "1.23.1",
153
+ "@likec4/language-server": "1.23.1",
154
+ "@likec4/layouts": "1.23.1",
155
+ "@likec4/log": "1.23.1",
156
+ "@likec4/tsconfig": "1.23.1"
157
157
  },
158
158
  "scripts": {
159
159
  "turbo-build": "turbo run build --log-prefix=none --log-order=grouped",