@antelopejs/dms-database 0.0.6 → 0.0.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.
@@ -6,6 +6,11 @@ import {
6
6
  type VueFlowStore,
7
7
  } from "@vue-flow/core";
8
8
  import dagre from "@dagrejs/dagre";
9
+ import type { ShallowUnwrapRef } from "vue";
10
+ import DiagramNoteNode from "./DiagramNoteNode.vue";
11
+ import DiagramRelationEdge from "./DiagramRelationEdge.vue";
12
+ import DiagramStubNode from "./DiagramStubNode.vue";
13
+ import DiagramTableNode from "./DiagramTableNode.vue";
9
14
  import type { SchemaSummary } from "../composables/useDatabaseSchemas";
10
15
  import type {
11
16
  DiagramNote,
@@ -192,7 +197,9 @@ const {
192
197
  // exposes the full imperative VueFlow controller (setNodes/setEdges/fitView/
193
198
  // viewport/findNode/onNodeDrag…) via a template ref; all the ERD business
194
199
  // logic below (dagre auto-layout, edge routing, undo/redo, notes) stays here.
195
- const canvas = ref<VueFlowStore | null>(null);
200
+ // Vue's expose proxy unwraps the controller's refs: `edges` is the array
201
+ // itself, not a Ref (`edges.value` is undefined and threw on every drag).
202
+ const canvas = shallowRef<ShallowUnwrapRef<VueFlowStore> | null>(null);
196
203
  // Our own wrapper element — used to measure the visible canvas for note placement.
197
204
  const canvasWrapper = ref<HTMLElement | null>(null);
198
205
 
@@ -788,15 +795,19 @@ async function applyChanges() {
788
795
  }
789
796
  }
790
797
 
791
- const nodeTypes = {
792
- [TABLE_NODE_TYPE]: resolveComponent("DmsDatabaseDiagramTableNode"),
793
- [STUB_NODE_TYPE]: resolveComponent("DmsDatabaseDiagramStubNode"),
794
- [NOTE_NODE_TYPE]: resolveComponent("DmsDatabaseDiagramNoteNode"),
795
- };
798
+ // Imported directly, not resolved by name: the DMS registers its global
799
+ // components as async components, and the async relation edge was mounted
800
+ // with the HTML namespace — its <path> was created as an HTML element inside
801
+ // the edges <svg>, so no relation line was drawn.
802
+ const nodeTypes = markRaw({
803
+ [TABLE_NODE_TYPE]: DiagramTableNode,
804
+ [STUB_NODE_TYPE]: DiagramStubNode,
805
+ [NOTE_NODE_TYPE]: DiagramNoteNode,
806
+ });
796
807
 
797
- const edgeTypes = {
798
- [RELATION_EDGE_TYPE]: resolveComponent("DmsDatabaseDiagramRelationEdge"),
799
- };
808
+ const edgeTypes = markRaw({
809
+ [RELATION_EDGE_TYPE]: DiagramRelationEdge,
810
+ });
800
811
 
801
812
  const zoomPercent = computed(
802
813
  () => `${Math.round(liveViewport.value.zoom * 100)}%`,
@@ -810,7 +821,7 @@ function widthForNodeType(type: string | undefined): number {
810
821
  function recomputeEdgesForNode(nodeId: string) {
811
822
  const instance = canvas.value;
812
823
  if (!instance) return;
813
- for (const edge of instance.edges.value) {
824
+ for (const edge of instance.edges) {
814
825
  if (edge.source !== nodeId && edge.target !== nodeId) continue;
815
826
  const sNode = instance.findNode(edge.source);
816
827
  const tNode = instance.findNode(edge.target);
@@ -15,7 +15,7 @@
15
15
  "test": "vitest run"
16
16
  },
17
17
  "dependencies": {
18
- "@antelopejs/interface-core": ">=0.0.13 <1.0.0",
18
+ "@antelopejs/interface-core": ">=0.1.1 <1.0.0",
19
19
  "@antelopejs/interface-database": ">=0.1.7 <1.0.0",
20
20
  "@codemirror/autocomplete": "^6.18.6",
21
21
  "@codemirror/commands": "^6.8.1",
@@ -9,11 +9,11 @@ importers:
9
9
  .:
10
10
  dependencies:
11
11
  '@antelopejs/interface-core':
12
- specifier: '>=0.0.13 <1.0.0'
13
- version: 0.0.13
12
+ specifier: '>=0.1.1 <1.0.0'
13
+ version: 0.1.1
14
14
  '@antelopejs/interface-database':
15
15
  specifier: '>=0.1.7 <1.0.0'
16
- version: 0.1.7(@antelopejs/interface-core@0.0.13)
16
+ version: 0.1.7(@antelopejs/interface-core@0.1.1)
17
17
  '@codemirror/autocomplete':
18
18
  specifier: ^6.18.6
19
19
  version: 6.20.3
@@ -79,8 +79,8 @@ packages:
79
79
  resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==}
80
80
  engines: {node: '>=10'}
81
81
 
82
- '@antelopejs/interface-core@0.0.13':
83
- resolution: {integrity: sha512-zMVhW5OefmVNRLHvd3rPQTaShy+k9w6+cOhqOryyfxgVyRZ18nBlV8VSq9TuPkFIo5OGNAXFybOf54DRSnPVsw==}
82
+ '@antelopejs/interface-core@0.1.1':
83
+ resolution: {integrity: sha512-nGxElt51KGWIwGsUcFdGT7ikQEqDB+mLj4NQ/eFL/DI1+j65GJqq9PdkVT4x3/YKchNA48iMbzXyW7bKUsQ8Iw==}
84
84
 
85
85
  '@antelopejs/interface-database@0.1.7':
86
86
  resolution: {integrity: sha512-2rXQZ0ynLInKxk++2XUPH1fHqd5Sj6k0QC2UxqOzsdfUSoyCyhsfnbELEV/i6jenUHeXGZ2vESkwxXTS9KJpbg==}
@@ -2939,13 +2939,13 @@ snapshots:
2939
2939
 
2940
2940
  '@alloc/quick-lru@5.2.0': {}
2941
2941
 
2942
- '@antelopejs/interface-core@0.0.13':
2942
+ '@antelopejs/interface-core@0.1.1':
2943
2943
  dependencies:
2944
2944
  reflect-metadata: 0.2.2
2945
2945
 
2946
- '@antelopejs/interface-database@0.1.7(@antelopejs/interface-core@0.0.13)':
2946
+ '@antelopejs/interface-database@0.1.7(@antelopejs/interface-core@0.1.1)':
2947
2947
  dependencies:
2948
- '@antelopejs/interface-core': 0.0.13
2948
+ '@antelopejs/interface-core': 0.1.1
2949
2949
 
2950
2950
  '@antfu/install-pkg@2.0.1':
2951
2951
  dependencies:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antelopejs/dms-database",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,6 +9,7 @@
9
9
  "files": [
10
10
  "dist",
11
11
  "!dist/test",
12
+ "!dist/.tsbuildinfo",
12
13
  "frontend-vue"
13
14
  ],
14
15
  "main": "dist/index.js",
@@ -26,13 +27,13 @@
26
27
  "registry": "https://registry.npmjs.org/"
27
28
  },
28
29
  "scripts": {
29
- "build": "rimraf dist && tsc -p tsconfig.build.json",
30
+ "build": "rimraf dist && tsc",
30
31
  "dev:frontend": "pnpm frontend:dev",
31
32
  "dev": "ajs project run -w -p playground",
32
33
  "generate": "ajs module exports generate",
33
34
  "lint:fix": "oxlint --fix --max-warnings=1000000 && oxfmt . && pnpm --dir frontend-vue lint:fix",
34
35
  "lint": "oxlint && oxfmt --check . && pnpm --dir frontend-vue lint",
35
- "typecheck": "tsc -p tsconfig.json",
36
+ "typecheck": "tsc --noEmit",
36
37
  "format": "oxfmt . && pnpm --dir frontend-vue format",
37
38
  "frontend:dev": "cd playground && pnpm frontend:dev",
38
39
  "test": "pnpm run build && ajs module test .",
@@ -44,13 +45,13 @@
44
45
  "dependencies": {
45
46
  "@antelopejs/interface-api": ">=0.0.13 <1.0.0",
46
47
  "@antelopejs/interface-api-util": ">=0.1.2 <1.0.0",
47
- "@antelopejs/interface-core": ">=0.0.13 <1.0.0",
48
+ "@antelopejs/interface-core": ">=0.1.1 <1.0.0",
48
49
  "@antelopejs/interface-database": ">=0.1.7 <1.0.0",
49
50
  "@antelopejs/interface-database-decorators": ">=0.1.6 <1.0.0",
50
- "@antelopejs/interface-dms": ">=0.0.1 <1.0.0"
51
+ "@antelopejs/interface-dms": ">=0.2.0 <1.0.0"
51
52
  },
52
53
  "devDependencies": {
53
- "@antelopejs/core": ">=1.8.0 <2",
54
+ "@antelopejs/core": ">=1.9.1 <2",
54
55
  "@antelopejs/tooling-configs": ">=0.0.6 <1.0.0",
55
56
  "@types/chai": "^5.2.3",
56
57
  "@types/mocha": "^10.0.10",
@@ -66,10 +67,10 @@
66
67
  "release-it": "^19.2.4",
67
68
  "release-it-changelogen": "^0.1.0",
68
69
  "rimraf": "^6.1.3",
69
- "typescript": "^5.9.3"
70
+ "typescript": "^6.0.3"
70
71
  },
71
72
  "optionalDependencies": {
72
- "@antelopejs/interface-dms-automation": ">=0.0.1 <1.0.0"
73
+ "@antelopejs/interface-dms-automation": ">=0.1.0 <1.0.0"
73
74
  },
74
75
  "packageManager": "pnpm@10.2.0",
75
76
  "antelopeJs": {