@likec4/core 0.52.0 → 0.54.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.
@@ -1,3 +1,3 @@
1
1
  import type { Opaque } from './opaque';
2
- export type NonEmptyArray<T> = [T, ...T[]];
2
+ export type NonEmptyArray<T> = [T, ...T[]] | [...T[], T];
3
3
  export type IconUrl = Opaque<string, 'IconUrl'>;
@@ -24,12 +24,13 @@ export interface DiagramNode extends ComputedNode {
24
24
  };
25
25
  labels: DiagramLabel[];
26
26
  position: Point;
27
- depth?: number;
28
27
  }
29
28
  export interface DiagramEdge extends ComputedEdge {
30
29
  points: NonEmptyArray<Point>;
31
30
  headArrow?: NonEmptyArray<Point>;
31
+ headArrowPoint?: Point;
32
32
  tailArrow?: NonEmptyArray<Point>;
33
+ tailArrowPoint?: Point;
33
34
  labels?: NonEmptyArray<DiagramLabel>;
34
35
  labelBBox?: BBox;
35
36
  }
@@ -1,5 +1,6 @@
1
- import type { Opaque } from './opaque';
1
+ import type { NonEmptyArray } from './_common';
2
2
  import type { Fqn, Tag } from './element';
3
+ import type { Opaque } from './opaque';
3
4
  import type { ThemeColor } from './theme';
4
5
  export type RelationID = Opaque<string, 'RelationID'>;
5
6
  export type RelationshipKind = Opaque<string, 'RelationshipKind'>;
@@ -13,7 +14,7 @@ export interface Relation {
13
14
  readonly source: Fqn;
14
15
  readonly target: Fqn;
15
16
  readonly title: string;
16
- readonly tags?: Tag[];
17
+ readonly tags?: NonEmptyArray<Tag>;
17
18
  readonly kind?: RelationshipKind;
18
19
  readonly color?: ThemeColor;
19
20
  readonly line?: RelationshipLineType;
@@ -27,7 +27,7 @@ export declare function ancestorsFqn(fqn: Fqn): Fqn[];
27
27
  * - Positive number if a is deeper than b.
28
28
  * - Negative number if b is deeper than a.
29
29
  */
30
- export declare function compareFqnHierarchically(a: string, b: string): number;
30
+ export declare function compareFqnHierarchically<T extends string = string>(a: T, b: T): number;
31
31
  export declare function compareByFqnHierarchically<T extends {
32
32
  id: Fqn;
33
33
  }>(a: T, b: T): number;
@@ -1,3 +1,3 @@
1
1
  import type { Opaque } from './opaque';
2
- export type NonEmptyArray<T> = [T, ...T[]];
2
+ export type NonEmptyArray<T> = [T, ...T[]] | [...T[], T];
3
3
  export type IconUrl = Opaque<string, 'IconUrl'>;
@@ -24,12 +24,13 @@ export interface DiagramNode extends ComputedNode {
24
24
  };
25
25
  labels: DiagramLabel[];
26
26
  position: Point;
27
- depth?: number;
28
27
  }
29
28
  export interface DiagramEdge extends ComputedEdge {
30
29
  points: NonEmptyArray<Point>;
31
30
  headArrow?: NonEmptyArray<Point>;
31
+ headArrowPoint?: Point;
32
32
  tailArrow?: NonEmptyArray<Point>;
33
+ tailArrowPoint?: Point;
33
34
  labels?: NonEmptyArray<DiagramLabel>;
34
35
  labelBBox?: BBox;
35
36
  }
@@ -1,5 +1,6 @@
1
- import type { Opaque } from './opaque';
1
+ import type { NonEmptyArray } from './_common';
2
2
  import type { Fqn, Tag } from './element';
3
+ import type { Opaque } from './opaque';
3
4
  import type { ThemeColor } from './theme';
4
5
  export type RelationID = Opaque<string, 'RelationID'>;
5
6
  export type RelationshipKind = Opaque<string, 'RelationshipKind'>;
@@ -13,7 +14,7 @@ export interface Relation {
13
14
  readonly source: Fqn;
14
15
  readonly target: Fqn;
15
16
  readonly title: string;
16
- readonly tags?: Tag[];
17
+ readonly tags?: NonEmptyArray<Tag>;
17
18
  readonly kind?: RelationshipKind;
18
19
  readonly color?: ThemeColor;
19
20
  readonly line?: RelationshipLineType;
@@ -27,7 +27,7 @@ export declare function ancestorsFqn(fqn: Fqn): Fqn[];
27
27
  * - Positive number if a is deeper than b.
28
28
  * - Negative number if b is deeper than a.
29
29
  */
30
- export declare function compareFqnHierarchically(a: string, b: string): number;
30
+ export declare function compareFqnHierarchically<T extends string = string>(a: T, b: T): number;
31
31
  export declare function compareByFqnHierarchically<T extends {
32
32
  id: Fqn;
33
33
  }>(a: T, b: T): number;
@@ -1,4 +1,4 @@
1
1
  import type { Opaque } from './opaque';
2
- export type NonEmptyArray<T> = [T, ...T[]];
2
+ export type NonEmptyArray<T> = [T, ...T[]] | [...T[], T];
3
3
  export type IconUrl = Opaque<string, 'IconUrl'>;
4
4
  //# sourceMappingURL=_common.d.ts.map
@@ -24,12 +24,13 @@ export interface DiagramNode extends ComputedNode {
24
24
  };
25
25
  labels: DiagramLabel[];
26
26
  position: Point;
27
- depth?: number;
28
27
  }
29
28
  export interface DiagramEdge extends ComputedEdge {
30
29
  points: NonEmptyArray<Point>;
31
30
  headArrow?: NonEmptyArray<Point>;
31
+ headArrowPoint?: Point;
32
32
  tailArrow?: NonEmptyArray<Point>;
33
+ tailArrowPoint?: Point;
33
34
  labels?: NonEmptyArray<DiagramLabel>;
34
35
  labelBBox?: BBox;
35
36
  }
@@ -1,5 +1,6 @@
1
- import type { Opaque } from './opaque';
1
+ import type { NonEmptyArray } from './_common';
2
2
  import type { Fqn, Tag } from './element';
3
+ import type { Opaque } from './opaque';
3
4
  import type { ThemeColor } from './theme';
4
5
  export type RelationID = Opaque<string, 'RelationID'>;
5
6
  export type RelationshipKind = Opaque<string, 'RelationshipKind'>;
@@ -13,7 +14,7 @@ export interface Relation {
13
14
  readonly source: Fqn;
14
15
  readonly target: Fqn;
15
16
  readonly title: string;
16
- readonly tags?: Tag[];
17
+ readonly tags?: NonEmptyArray<Tag>;
17
18
  readonly kind?: RelationshipKind;
18
19
  readonly color?: ThemeColor;
19
20
  readonly line?: RelationshipLineType;
@@ -27,7 +27,7 @@ export declare function ancestorsFqn(fqn: Fqn): Fqn[];
27
27
  * - Positive number if a is deeper than b.
28
28
  * - Negative number if b is deeper than a.
29
29
  */
30
- export declare function compareFqnHierarchically(a: string, b: string): number;
30
+ export declare function compareFqnHierarchically<T extends string = string>(a: T, b: T): number;
31
31
  export declare function compareByFqnHierarchically<T extends {
32
32
  id: Fqn;
33
33
  }>(a: T, b: T): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@likec4/core",
3
- "version": "0.52.0",
3
+ "version": "0.54.0",
4
4
  "license": "MIT",
5
5
  "homepage": "https://likec4.dev",
6
6
  "author": "Denis Davydkov <denis@davydkov.com>",
@@ -78,7 +78,7 @@
78
78
  },
79
79
  "dependencies": {
80
80
  "rambdax": "^9.1.1",
81
- "remeda": "^1.29.0",
81
+ "remeda": "^1.30.0",
82
82
  "safe-stable-stringify": "^2.4.3",
83
83
  "ts-custom-error": "^3.3.1"
84
84
  },
@@ -86,7 +86,7 @@
86
86
  "execa": "^8.0.1",
87
87
  "typescript": "^5.3.3",
88
88
  "unbuild": "^2.0.0",
89
- "vitest": "^1.0.4"
89
+ "vitest": "^1.1.3"
90
90
  },
91
91
  "packageManager": "yarn@4.0.2",
92
92
  "volta": {