likec4 1.59.4 → 1.60.0

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.
Files changed (96) hide show
  1. package/__app__/codegen/react.mjs +6 -6
  2. package/__app__/codegen/webcomponent.mjs +147 -69
  3. package/__app__/src/aichat/index.mjs +10 -5
  4. package/__app__/src/chunks/AIChat.mjs +1134 -693
  5. package/__app__/src/chunks/LikeC4Styles.mjs +3995 -1779
  6. package/__app__/src/chunks/ProjectsOverview.mjs +624 -334
  7. package/__app__/src/chunks/es.mjs +515 -335
  8. package/__app__/src/chunks/hooks.mjs +578 -369
  9. package/__app__/src/chunks/libs/@floating-ui.mjs +2720 -1966
  10. package/__app__/src/chunks/libs/@mantine.mjs +13920 -10057
  11. package/__app__/src/chunks/libs/@tanstack-ai.mjs +2266 -1146
  12. package/__app__/src/chunks/libs/@tanstack.mjs +3152 -1926
  13. package/__app__/src/chunks/libs/@xstate/react.mjs +2924 -1468
  14. package/__app__/src/chunks/libs/@xyflow/react.mjs +6627 -4067
  15. package/__app__/src/chunks/libs/bezier-js.mjs +1312 -726
  16. package/__app__/src/chunks/libs/d3.mjs +3219 -1505
  17. package/__app__/src/chunks/libs/fast-equals.mjs +434 -210
  18. package/__app__/src/chunks/libs/framer.mjs +9251 -3846
  19. package/__app__/src/chunks/libs/nanostores.mjs +174 -0
  20. package/__app__/src/chunks/libs/zod.mjs +4591 -2363
  21. package/__app__/src/chunks/rolldown-runtime.mjs +39 -23
  22. package/__app__/src/chunks/styled-system.mjs +2279 -1951
  23. package/__app__/src/fonts.css +112 -1
  24. package/__app__/src/main.mjs +40817 -21840
  25. package/__app__/src/style.css +18488 -1
  26. package/config/schema.json +122 -97
  27. package/dist/app/render-view-client.css +1 -1
  28. package/dist/app/render-view-client.js +508 -334
  29. package/dist/chunks/enableServer.mjs +1 -1
  30. package/dist/chunks/filenames.mjs +11 -9
  31. package/dist/chunks/generate-likec4.mjs +5 -0
  32. package/dist/chunks/index.d.mts +243 -183
  33. package/dist/chunks/index2.d.mts +2865 -1977
  34. package/dist/chunks/libs/@chevrotain/gast.mjs +27 -1
  35. package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +81 -9
  36. package/dist/chunks/libs/@chevrotain/types.d.mts +4 -1
  37. package/dist/chunks/libs/@logtape/logtape.mjs +5 -4
  38. package/dist/chunks/libs/@lume/kiwi.mjs +1 -1
  39. package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -1
  40. package/dist/chunks/libs/birpc.mjs +1 -1
  41. package/dist/chunks/libs/chevrotain-allstar.mjs +2 -2
  42. package/dist/chunks/libs/chevrotain.mjs +87 -35
  43. package/dist/chunks/libs/eventemitter3.mjs +1 -1
  44. package/dist/chunks/libs/json5.mjs +4 -4
  45. package/dist/chunks/libs/langium.d.mts +9038 -6193
  46. package/dist/chunks/libs/langium.mjs +16 -24
  47. package/dist/chunks/libs/merge-error-cause.mjs +1 -1
  48. package/dist/chunks/libs/p-limit.mjs +1 -0
  49. package/dist/chunks/libs/p-queue.mjs +1 -1
  50. package/dist/chunks/libs/package-manager-detector.mjs +1 -1
  51. package/dist/chunks/libs/pako.mjs +1 -1
  52. package/dist/chunks/libs/pretty-ms.mjs +1 -1
  53. package/dist/chunks/libs/remeda.mjs +1 -1
  54. package/dist/chunks/libs/ufo.mjs +1 -1
  55. package/dist/chunks/libs/unstorage.mjs +1 -1
  56. package/dist/chunks/libs/which.mjs +1 -1
  57. package/dist/chunks/node.mjs +59 -58
  58. package/dist/chunks/rolldown-runtime.mjs +1 -1
  59. package/dist/chunks/sequence-view.mjs +1 -1
  60. package/dist/chunks/vite-plugin.mjs +45 -45
  61. package/dist/cli/index.mjs +207 -1315
  62. package/dist/config/index.d.mts +2 -2
  63. package/dist/generators/likec4.d.mts +6578 -0
  64. package/dist/generators/likec4.mjs +1 -0
  65. package/dist/model/index.d.mts +4 -1
  66. package/dist/vite-plugin/index.d.mts +4 -1
  67. package/dist/vite-plugin/index.mjs +1 -1
  68. package/dist/vite-plugin/internal/chunks/rolldown-runtime.mjs +9 -0
  69. package/dist/vite-plugin/internal/index.d.mts +6 -5
  70. package/dist/vite-plugin/internal/index.mjs +83 -30
  71. package/generators/likec4/package.json +4 -0
  72. package/package.json +113 -106
  73. package/react/index.d.mts +8500 -26659
  74. package/react/index.mjs +534 -63936
  75. package/react/rolldown-runtime-DnkiqaRY.js +1 -0
  76. package/skills/likec4-dsl/SKILL.md +428 -0
  77. package/skills/likec4-dsl/evals/evals-public.json +202 -0
  78. package/skills/likec4-dsl/evals/grading-spec.json +589 -0
  79. package/skills/likec4-dsl/references/bridge-leanix-drawio.md +42 -0
  80. package/skills/likec4-dsl/references/cli.md +139 -0
  81. package/skills/likec4-dsl/references/configuration.md +266 -0
  82. package/skills/likec4-dsl/references/deployment.md +160 -0
  83. package/skills/likec4-dsl/references/dynamic-views.md +455 -0
  84. package/skills/likec4-dsl/references/examples.md +370 -0
  85. package/skills/likec4-dsl/references/identifier-validity.md +90 -0
  86. package/skills/likec4-dsl/references/include-predicates-wildcards.md +179 -0
  87. package/skills/likec4-dsl/references/model.md +151 -0
  88. package/skills/likec4-dsl/references/predicates.md +123 -0
  89. package/skills/likec4-dsl/references/relationships-bidirectional.md +176 -0
  90. package/skills/likec4-dsl/references/specification.md +75 -0
  91. package/skills/likec4-dsl/references/style-tokens-colors.md +150 -0
  92. package/skills/likec4-dsl/references/troubleshooting.md +96 -0
  93. package/skills/likec4-dsl/references/views.md +329 -0
  94. package/dist/chunks/libs/picomatch.mjs +0 -1
  95. package/dist/chunks/libs/zod.d.mts +0 -3840
  96. package/dist/chunks/libs/zod.mjs +0 -65
@@ -0,0 +1 @@
1
+ import{r as e}from"../chunks/rolldown-runtime.mjs";import{A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as f,M as p,N as m,O as h,P as g,R as _,S as v,T as y,U as b,V as x,W as S,X as C,Y as w,Z as T,_ as E,a as D,d as O,f as k,g as A,h as j,i as M,j as N,k as P,l as F,m as I,n as L,o as R,p as z,q as B,r as V,s as H,t as U,u as W,w as G,x as K,y as q,z as J}from"../chunks/generate-likec4.mjs";var Y=/* @__PURE__ */ e({base:()=>v,body:()=>r,deployment:()=>I,deploymentView:()=>D,deployments:()=>j,dynamicView:()=>R,eachOnFresh:()=>G,elementView:()=>H,eq:()=>y,expr:()=>E,expression:()=>A,foreach:()=>a,foreachNewLine:()=>i,guard:()=>h,indent:()=>P,inlineText:()=>t,join:()=>N,lazy:()=>p,likec4data:()=>M,lines:()=>m,markdown:()=>g,markdownOrString:()=>o,materialize:()=>l,merge:()=>f,model:()=>k,models:()=>z,newline:()=>_,noop:()=>J,print:()=>n,printProperty:()=>x,property:()=>c,props:()=>q,select:()=>b,separateComma:()=>S,separateNewLine:()=>s,separateWith:()=>d,space:()=>B,spaceBetween:()=>u,specification:()=>W,specifications:()=>O,text:()=>w,views:()=>F,when:()=>C,withctx:()=>T});export{U as generate,P as indent,l as materialize,Y as ops,L as print,V as printWithTabIndent,K as schemas,T as withctx};
@@ -4,7 +4,7 @@ import { BBox, LayoutedDynamicView, NodeId, ViewId } from "@likec4/core/types";
4
4
  import { Connection, ConnectionModel, DeployedInstanceModel, DeploymentConnectionModel, DeploymentElementModel, DeploymentNodeModel, DeploymentRelationEndpoint, DeploymentRelationModel, EdgeModel, ElementModel, LikeC4DeploymentModel, LikeC4Model, LikeC4Model as LikeC4Model$1, LikeC4ViewModel, NodeModel, RelationshipModel, deploymentConnection, differenceConnections, findAscendingConnections, findDeepestNestedConnection, findDescendantConnections, hasSameSource, hasSameSourceTarget, hasSameTarget, isAnyInOut, isDeployedInstanceModel, isDeploymentElementModel, isDeploymentNodeModel, isDeploymentRelationModel, isEdgeModel, isElementModel, isIncoming, isLikeC4ViewModel, isNestedConnection, isNestedElementOfDeployedInstanceModel, isNodeModel, isOutgoing, isRelationModel, mergeConnections, modelConnection, sortConnectionsByBoundaryHierarchy, sortDeepestFirst } from "@likec4/core/model";
5
5
  import { ComputedProjectEdge, ComputedProjectNode, ComputedProjectsView, LayoutedProjectEdge, LayoutedProjectNode, LayoutedProjectsView } from "@likec4/core/compute-view";
6
6
  export type * from "@likec4/core/types";
7
- //#region ../layouts/dist/sequence/index.d.mts
7
+ //#region ../layouts/dist/sequence/_types.d.mts
8
8
  //#region src/sequence/_types.d.ts
9
9
  interface SequenceActorStepPort {
10
10
  id: string;
@@ -47,9 +47,12 @@ interface SequenceViewLayout {
47
47
  bounds: BBox;
48
48
  }
49
49
  //#endregion
50
+ //#endregion
51
+ //#region ../layouts/dist/sequence/sequence-view.d.mts
50
52
  //#region src/sequence/sequence-view.d.ts
51
53
  export declare function calcSequenceLayout(view: LayoutedDynamicView): LayoutedDynamicView.Sequence.Layout;
52
54
  //#endregion
55
+ //#endregion
53
56
  //#region src/model/index.d.ts
54
57
  export type UnknownLayouted = types.UnknownLayouted;
55
58
  /**
@@ -4,7 +4,7 @@ import { i as LikeC4LanguageServices } from "../chunks/index2.mjs";
4
4
  import "@likec4/core";
5
5
  import { PluginOption } from "vite";
6
6
  import { AnyTextAdapter } from "@tanstack/ai";
7
- //#region ../vite-plugin/dist/index.d.mts
7
+ //#region ../vite-plugin/dist/virtuals/app-config.d.mts
8
8
  //#region src/virtuals/app-config.d.ts
9
9
  interface AppConfig {
10
10
  /**
@@ -29,6 +29,8 @@ interface AppConfig {
29
29
  theme?: 'light' | 'dark' | undefined;
30
30
  }
31
31
  //#endregion
32
+ //#endregion
33
+ //#region ../vite-plugin/dist/plugin.d.mts
32
34
  //#region src/plugin.d.ts
33
35
  interface AIOptions<TAdapter extends AnyTextAdapter = AnyTextAdapter> {
34
36
  /**
@@ -140,4 +142,5 @@ type LikeC4VitePluginOptions = SharedOptions & ({
140
142
  });
141
143
  export declare function LikeC4VitePlugin({ environments, appConfig, ai: _ai, ...pluginOpts }: LikeC4VitePluginOptions): PluginOption;
142
144
  //#endregion
145
+ //#endregion
143
146
  export type { LikeC4VitePluginOptions };
@@ -1 +1 @@
1
- import{t as e}from"../chunks/vite-plugin.mjs";export{e as LikeC4VitePlugin};
1
+ export{t as LikeC4VitePlugin}from"../chunks/vite-plugin.mjs";
@@ -0,0 +1,9 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __name = (target, value) => __defProp(target, "name", {
4
+ value,
5
+ configurable: true
6
+ });
7
+
8
+ //#endregion
9
+ export { __name as t };
@@ -1,9 +1,10 @@
1
+ import { t as __name } from "./chunks/rolldown-runtime.mjs";
1
2
  import { LikeC4Model } from "@likec4/core/model";
2
3
  import { DependencyList } from "react";
3
4
  import { LayoutedElementView, LayoutedLikeC4ModelData, LayoutedView, ProjectId, ViewChange, ViewId } from "@likec4/core/types";
4
5
  import { AdhocViewPredicate } from "@likec4/core/compute-view";
5
6
  //#region ../vite-plugin/dist/internal/index.d.mts
6
- //#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/atom/index.d.ts
7
+ //#region ../../node_modules/.pnpm/nanostores@1.5.5/node_modules/nanostores/atom/index.d.ts
7
8
  type AllKeys<T> = T extends any ? keyof T : never;
8
9
  type Primitive = boolean | number | string;
9
10
  type ReadonlyIfObject<Value> = Value extends undefined ? Value : Value extends ((...args: any) => any) ? Value : Value extends Primitive ? Value : Value extends object ? Readonly<Value> : Value;
@@ -143,7 +144,7 @@ type Atom<Value = any> = ReadableAtom<Value> | WritableAtom<Value>;
143
144
  */
144
145
  export declare function atom<Value, StoreExt = object>(...args: undefined extends Value ? [] | [Value] : [Value]): PreinitializedWritableAtom<Value> & StoreExt;
145
146
  //#endregion
146
- //#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/map/index.d.ts
147
+ //#region ../../node_modules/.pnpm/nanostores@1.5.5/node_modules/nanostores/map/index.d.ts
147
148
  type KeyofBase = keyof any;
148
149
  type Get<T, K extends KeyofBase> = T extends any ? K extends keyof T ? T[K] : never : never;
149
150
  type HasIndexSignature<T> = string extends keyof T ? true : false;
@@ -257,12 +258,12 @@ export declare function map<Value extends object, StoreExt extends object = obje
257
258
  */
258
259
  export declare function map<Value extends object, StoreExt extends object = object>(value?: Value): PreinitializedMapStore<Partial<Value>> & StoreExt;
259
260
  //#endregion
260
- //#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/task/index.d.ts
261
+ //#region ../../node_modules/.pnpm/nanostores@1.5.5/node_modules/nanostores/task/index.d.ts
261
262
  interface Task<Value> extends Promise<Value> {
262
263
  t: true;
263
264
  }
264
265
  //#endregion
265
- //#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/computed/index.d.ts
266
+ //#region ../../node_modules/.pnpm/nanostores@1.5.5/node_modules/nanostores/computed/index.d.ts
266
267
  type StoreValues<Stores extends readonly Gettable[]> = { -readonly [Index in keyof Stores]: StoreValue<Stores[Index]>; };
267
268
  interface Computed {
268
269
  /**
@@ -343,7 +344,7 @@ interface LikeC4VitePluginRpc {
343
344
  }): Promise<LayoutedElementView>;
344
345
  }
345
346
  //#endregion
346
- //#region ../../node_modules/.pnpm/@nanostores+react@1.1.0_nanostores@1.5.3_react@19.2.8/node_modules/@nanostores/react/index.d.ts
347
+ //#region ../../node_modules/.pnpm/@nanostores+react@2.0.1_nanostores@1.5.5_react@19.3.0/node_modules/@nanostores/react/index.d.ts
347
348
  type StoreKeys<T> = T extends {
348
349
  setKey: (k: infer K, v: any) => unknown;
349
350
  } ? K : never;
@@ -1,7 +1,8 @@
1
+ import { t as __name } from "./chunks/rolldown-runtime.mjs";
1
2
  import { LikeC4Model } from "@likec4/core/model";
2
3
  import { useCallback, useMemo, useRef, useSyncExternalStore } from "react";
3
4
 
4
- //#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/atom/index.js
5
+ //#region ../../node_modules/.pnpm/nanostores@1.5.5/node_modules/nanostores/atom/index.js
5
6
  let listenerQueue = [];
6
7
  let lqIndex = 0;
7
8
  let batchSeen = null;
@@ -13,6 +14,11 @@ let drainQueue = () => {
13
14
  while (lqIndex < listenerQueue.length) {
14
15
  i = lqIndex;
15
16
  lqIndex += QUEUE_ITEMS_PER_LISTENER;
17
+ let pendingStores = batchSeen?.get(listenerQueue[i]);
18
+ if (pendingStores) {
19
+ if (!pendingStores.has(listenerQueue[i + 1])) continue;
20
+ pendingStores.clear();
21
+ }
16
22
  try {
17
23
  listenerQueue[i](listenerQueue[i + 1].value, listenerQueue[i + 2], listenerQueue[i + 3]);
18
24
  } catch (e) {
@@ -35,7 +41,8 @@ const atom = /* @__NO_SIDE_EFFECTS__ */ (initialValue) => {
35
41
  listen(listener) {
36
42
  $atom.lc = listeners.push(listener);
37
43
  return () => {
38
- for (let i = lqIndex; i < listenerQueue.length;) if (listenerQueue[i] === listener) listenerQueue.splice(i, QUEUE_ITEMS_PER_LISTENER);
44
+ batchSeen?.get(listener)?.delete($atom);
45
+ for (let i = lqIndex; i < listenerQueue.length;) if (listenerQueue[i] === listener && listenerQueue[i + 1] === $atom) listenerQueue.splice(i, QUEUE_ITEMS_PER_LISTENER);
39
46
  else i += QUEUE_ITEMS_PER_LISTENER;
40
47
  let index = listeners.indexOf(listener);
41
48
  if (~index) {
@@ -48,8 +55,12 @@ const atom = /* @__NO_SIDE_EFFECTS__ */ (initialValue) => {
48
55
  nanostoresGlobal.epoch++;
49
56
  let runListenerQueue = !listenerQueue.length && !batchSeen;
50
57
  for (let listener of listeners) {
51
- if (batchSeen?.has(listener)) continue;
52
- batchSeen?.add(listener);
58
+ if (batchSeen) {
59
+ let pendingStores = batchSeen.get(listener);
60
+ if (!pendingStores) batchSeen.set(listener, pendingStores = /* @__PURE__ */ new Set());
61
+ if (pendingStores.has($atom)) continue;
62
+ pendingStores.add($atom);
63
+ }
53
64
  listenerQueue.push(listener, $atom, oldValue, batchSeen ? void 0 : changedKey);
54
65
  }
55
66
  if (runListenerQueue) drainQueue();
@@ -73,7 +84,7 @@ const atom = /* @__NO_SIDE_EFFECTS__ */ (initialValue) => {
73
84
  };
74
85
 
75
86
  //#endregion
76
- //#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/lifecycle/index.js
87
+ //#region ../../node_modules/.pnpm/nanostores@1.5.5/node_modules/nanostores/lifecycle/index.js
77
88
  const MOUNT = 5;
78
89
  const UNMOUNT = 6;
79
90
  const REVERT_MUTATION = 10;
@@ -134,7 +145,7 @@ let onMount = ($store, initialize) => {
134
145
  };
135
146
 
136
147
  //#endregion
137
- //#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/computed/index.js
148
+ //#region ../../node_modules/.pnpm/nanostores@1.5.5/node_modules/nanostores/computed/index.js
138
149
  let computedStore = (stores, cb, batched) => {
139
150
  if (!Array.isArray(stores)) stores = [stores];
140
151
  let previousArgs;
@@ -179,7 +190,7 @@ const computed = /* @__NO_SIDE_EFFECTS__ */ (stores, fn) => computedStore(stores
179
190
  const batched = /* @__NO_SIDE_EFFECTS__ */ (stores, fn) => computedStore(stores, fn, true);
180
191
 
181
192
  //#endregion
182
- //#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/deep-map/path.js
193
+ //#region ../../node_modules/.pnpm/nanostores@1.5.5/node_modules/nanostores/deep-map/path.js
183
194
  function getPath(obj, path) {
184
195
  let allKeys = getAllKeysFromPath(path);
185
196
  let res = obj;
@@ -202,16 +213,17 @@ function getKeyAndIndicesFromKey(key) {
202
213
  }
203
214
 
204
215
  //#endregion
205
- //#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/listen-keys/index.js
216
+ //#region ../../node_modules/.pnpm/nanostores@1.5.5/node_modules/nanostores/listen-keys/index.js
206
217
  function listenKeys($store, keys, listener) {
207
218
  let keysSet = new Set(keys);
208
219
  return $store.listen((value, oldValue, changed) => {
209
- if (changed === void 0 ? keys.some((key) => oldValue === void 0 || value[key] !== oldValue[key] || getPath(value, key) !== getPath(oldValue, key)) : keysSet.has(changed) || keysSet.has(changed.split(/\.|\[/)[0])) listener(value, oldValue, changed);
220
+ let pathChanged = (key) => !Object.is(getPath(value, key), getPath(oldValue, key));
221
+ if (changed === void 0 ? keys.some((key) => oldValue === void 0 || ($store.eqKey ? !$store.eqKey(oldValue[key], value[key], key) : pathChanged(key))) : keysSet.has(changed) || typeof changed === "string" && (keysSet.has(changed.split(/\.|\[/)[0]) || !$store.eqKey && oldValue !== void 0 && keys.some(pathChanged))) listener(value, oldValue, changed);
210
222
  });
211
223
  }
212
224
 
213
225
  //#endregion
214
- //#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/map/index.js
226
+ //#region ../../node_modules/.pnpm/nanostores@1.5.5/node_modules/nanostores/map/index.js
215
227
  const map = /* @__NO_SIDE_EFFECTS__ */ (initial = {}) => {
216
228
  let $map = /* @__PURE__ */ atom(initial);
217
229
  $map.eqKey = Object.is;
@@ -233,7 +245,7 @@ const map = /* @__NO_SIDE_EFFECTS__ */ (initial = {}) => {
233
245
  };
234
246
 
235
247
  //#endregion
236
- //#region ../../node_modules/.pnpm/@nanostores+react@1.1.0_nanostores@1.5.3_react@19.2.8/node_modules/@nanostores/react/index.js
248
+ //#region ../../node_modules/.pnpm/@nanostores+react@2.0.1_nanostores@1.5.5_react@19.3.0/node_modules/@nanostores/react/index.js
237
249
  let emit = (snapshotRef, onChange) => (value) => {
238
250
  if (snapshotRef.current === value) return;
239
251
  snapshotRef.current = value;
@@ -401,7 +413,8 @@ function createBirpc($functions, options) {
401
413
  }
402
414
  if (msg.t === "q") {
403
415
  const { m: method, a: args, o: optional } = msg;
404
- let result, error;
416
+ let result;
417
+ let error;
405
418
  let fn = await (resolver ? resolver.call(rpc, method, $functions[method]) : $functions[method]);
406
419
  if (optional) fn ||= () => void 0;
407
420
  if (!fn) error = /* @__PURE__ */ new Error(`[birpc] function "${method}" not found`);
@@ -451,9 +464,10 @@ function createBirpc($functions, options) {
451
464
  }
452
465
 
453
466
  //#endregion
454
- //#region ../../node_modules/.pnpm/fast-equals@6.0.3/node_modules/fast-equals/dist/es/index.mjs
467
+ //#region ../../node_modules/.pnpm/fast-equals@6.1.1/node_modules/fast-equals/dist/es/index.mjs
455
468
  const { getOwnPropertyNames, getOwnPropertySymbols } = Object;
456
- const { hasOwnProperty } = Object.prototype;
469
+ const { hasOwnProperty, toString: toString$1 } = Object.prototype;
470
+ const OBJECT_TAG = "[object Object]";
457
471
  /**
458
472
  * Combine two comparators into a single comparators.
459
473
  */
@@ -494,12 +508,27 @@ function getStrictProperties(object) {
494
508
  * Whether the object contains the property passed as an own property.
495
509
  */
496
510
  const hasOwn = Object.hasOwn || ((object, property) => hasOwnProperty.call(object, property));
511
+ /**
512
+ * Whether a null-prototype object is being compared with a plain object. Only one side can be
513
+ * null-prototype when the constructors differ. The other side must be a plain object by
514
+ * constructor, or by tag when it comes from another realm.
515
+ */
516
+ function isNullPrototypeComparable(a, b) {
517
+ const aConstructor = a.constructor;
518
+ const bConstructor = b.constructor;
519
+ if (aConstructor == null) return bConstructor === Object || toString$1.call(b) === OBJECT_TAG;
520
+ if (bConstructor == null) return aConstructor === Object || toString$1.call(a) === OBJECT_TAG;
521
+ return false;
522
+ }
497
523
  const PREACT_VNODE = "__v";
498
524
  const PREACT_OWNER = "__o";
499
525
  const REACT_OWNER = "_owner";
500
- const HAS_FLOAT_16_ARRAY = typeof Float16Array !== "undefined";
501
526
  const { getOwnPropertyDescriptor, keys } = Object;
502
527
  /**
528
+ * Identify the element type of TypedArrays across realms and subclasses.
529
+ */
530
+ const getTypedArrayTag = getOwnPropertyDescriptor(Object.getPrototypeOf(Int8Array.prototype), Symbol.toStringTag).get;
531
+ /**
503
532
  * Whether the values passed are equal based on a [SameValue](https://262.ecma-international.org/7.0/#sec-samevalue) basis.
504
533
  * Simplified, this maps to if the two values are referentially equal to one another (`a === b`) or both are `NaN`.
505
534
  *
@@ -673,7 +702,8 @@ function areSetsEqual(a, b, state) {
673
702
  function areTypedArraysEqual(a, b) {
674
703
  let index = a.length;
675
704
  if (b.length !== index || a.byteOffset !== b.byteOffset) return false;
676
- if (a instanceof Float64Array || a instanceof Float32Array || HAS_FLOAT_16_ARRAY && a instanceof Float16Array) {
705
+ const tag = getTypedArrayTag.call(a);
706
+ if (tag === "Float64Array" || tag === "Float32Array" || tag === "Float16Array") {
677
707
  while (index-- > 0) if (a[index] !== b[index] && (a[index] === a[index] || b[index] === b[index])) return false;
678
708
  return true;
679
709
  }
@@ -715,13 +745,38 @@ function isPropertyEqual(a, b, state, property) {
715
745
  if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE) && (a.$$typeof || b.$$typeof)) return true;
716
746
  return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);
717
747
  }
718
- const toString = Object.prototype.toString;
748
+ const { toString } = Object.prototype;
719
749
  /**
720
750
  * Create a comparator method based on the type-specific equality comparators passed.
721
751
  */
722
752
  function createEqualityComparator(config) {
723
753
  const supportedComparatorMap = createSupportedComparatorMap(config);
724
- const { areArraysEqual, areDatesEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, areRegExpsEqual, areSetsEqual, getUnsupportedCustomComparator } = config;
754
+ const { areArraysEqual, areDatesEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, areRegExpsEqual, areSetsEqual, getUnsupportedCustomComparator, strictNullPrototypeComparison } = config;
755
+ /**
756
+ * Whether the custom objects are equal in value, based on their string tag. If not matching any tags
757
+ * that require a specific type of comparison, then we hard-code false because the only thing remaining
758
+ * is strict equality, which has already been compared. This is for a few reasons:
759
+ * - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only
760
+ * comparison that can be made.
761
+ * - For types that can be introspected but do not have an objective definition of what
762
+ * equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.
763
+ * In all cases, these decisions should be reevaluated based on changes to the language and
764
+ * common development practices.
765
+ *
766
+ * Capturing the tag is reasonably performant in modern environments like v8 and SpiderMonkey. This is
767
+ * kept out of the main comparator so that it stays within the engine's bytecode budget for inlining.
768
+ * See [#207](https://github.com/planttheidea/fast-equals/pull/207) for more details.
769
+ */
770
+ const areTaggedObjectsEqual = getUnsupportedCustomComparator ? function areTaggedObjectsEqual(a, b, state) {
771
+ const tag = toString.call(a);
772
+ const supportedComparator = supportedComparatorMap[tag];
773
+ if (supportedComparator) return supportedComparator(a, b, state);
774
+ const unsupportedCustomComparator = getUnsupportedCustomComparator(a, b, state, tag);
775
+ return unsupportedCustomComparator ? unsupportedCustomComparator(a, b, state) : false;
776
+ } : function areTaggedObjectsEqual(a, b, state) {
777
+ const supportedComparator = supportedComparatorMap[toString.call(a)];
778
+ return supportedComparator ? supportedComparator(a, b, state) : false;
779
+ };
725
780
  /**
726
781
  * compare the value of the two objects and return true if they are equivalent in values
727
782
  */
@@ -736,27 +791,23 @@ function createEqualityComparator(config) {
736
791
  return false;
737
792
  }
738
793
  const constructor = a.constructor;
739
- if (constructor !== b.constructor) return false;
794
+ if (constructor !== b.constructor) return strictNullPrototypeComparison ? false : isNullPrototypeComparable(a, b) && areObjectsEqual(a, b, state);
740
795
  if (constructor === Object) return areObjectsEqual(a, b, state);
741
796
  if (constructor === Array) return areArraysEqual(a, b, state);
742
797
  if (constructor === Date) return areDatesEqual(a, b, state);
743
798
  if (constructor === RegExp) return areRegExpsEqual(a, b, state);
744
799
  if (constructor === Map) return areMapsEqual(a, b, state);
745
800
  if (constructor === Set) return areSetsEqual(a, b, state);
801
+ if (constructor == null) return areObjectsEqual(a, b, state);
746
802
  if (constructor === Promise) return false;
747
803
  if (Array.isArray(a)) return areArraysEqual(a, b, state);
748
- const tag = toString.call(a);
749
- const supportedComparator = supportedComparatorMap[tag];
750
- if (supportedComparator) return supportedComparator(a, b, state);
751
- const unsupportedCustomComparator = getUnsupportedCustomComparator && getUnsupportedCustomComparator(a, b, state, tag);
752
- if (unsupportedCustomComparator) return unsupportedCustomComparator(a, b, state);
753
- return false;
804
+ return areTaggedObjectsEqual(a, b, state);
754
805
  };
755
806
  }
756
807
  /**
757
808
  * Create the configuration object used for building comparators.
758
809
  */
759
- function createEqualityComparatorConfig({ circular, createCustomConfig, strict }) {
810
+ function createEqualityComparatorConfig({ circular, createCustomConfig, strict, strictNullPrototypeComparison = true }) {
760
811
  let config = {
761
812
  areArrayBuffersEqual,
762
813
  areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
@@ -772,7 +823,8 @@ function createEqualityComparatorConfig({ circular, createCustomConfig, strict }
772
823
  areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
773
824
  areTypedArraysEqual: strict ? combineComparators(areTypedArraysEqual, areObjectsEqualStrict) : areTypedArraysEqual,
774
825
  areUrlsEqual,
775
- getUnsupportedCustomComparator: void 0
826
+ getUnsupportedCustomComparator: void 0,
827
+ strictNullPrototypeComparison
776
828
  };
777
829
  if (createCustomConfig) config = Object.assign({}, config, createCustomConfig(config));
778
830
  if (circular) {
@@ -936,7 +988,7 @@ function createCustomEqual(options = {}) {
936
988
  }
937
989
 
938
990
  //#endregion
939
- //#region ../../node_modules/.pnpm/remeda@2.45.0/node_modules/remeda/dist/lazyDataLastImpl--3B10z3s.js
991
+ //#region ../../node_modules/.pnpm/remeda@2.51.0/node_modules/remeda/dist/lazyDataLastImpl--3B10z3s.js
940
992
  function e(e, t, n) {
941
993
  let r = (n) => e(n, ...t);
942
994
  return n === void 0 ? r : Object.assign(r, {
@@ -946,16 +998,17 @@ function e(e, t, n) {
946
998
  }
947
999
 
948
1000
  //#endregion
949
- //#region ../../node_modules/.pnpm/remeda@2.45.0/node_modules/remeda/dist/purry.js
1001
+ //#region ../../node_modules/.pnpm/remeda@2.51.0/node_modules/remeda/dist/purry.js
950
1002
  function t$1(t, n, r) {
951
1003
  let i = t.length - n.length;
952
1004
  if (i === 0) return t(...n);
953
1005
  if (i === 1) return e(t, n, r);
954
1006
  throw Error(`Wrong number of arguments`);
955
1007
  }
1008
+ __name(t$1, "t");
956
1009
 
957
1010
  //#endregion
958
- //#region ../../node_modules/.pnpm/remeda@2.45.0/node_modules/remeda/dist/mapValues.js
1011
+ //#region ../../node_modules/.pnpm/remeda@2.51.0/node_modules/remeda/dist/mapValues.js
959
1012
  function t(...t) {
960
1013
  return t$1(n, t);
961
1014
  }
@@ -0,0 +1,4 @@
1
+ {
2
+ "types": "../../dist/generators/likec4.d.mts",
3
+ "module": "../../dist/generators/likec4.mjs"
4
+ }