@dbml/cli 10.2.0 → 10.2.1-expose-diagnostic-filepath.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.
Files changed (47) hide show
  1. package/__tests__/db2dbml/mssql/dbml-error.log +54 -859
  2. package/__tests__/db2dbml/mysql/dbml-error.log +10 -1113
  3. package/__tests__/db2dbml/oracle/dbml-error.log +69 -1203
  4. package/__tests__/db2dbml/postgres/dbml-error.log +25 -599
  5. package/__tests__/dbml2sql/filename --mysql --out-file/out-files/schema.sql +1 -1
  6. package/__tests__/dbml2sql/filename --oracle --out-file/out-files/schema.sql +1 -1
  7. package/__tests__/dbml2sql/filename --out-file/out-files/schema.sql +1 -1
  8. package/__tests__/dbml2sql/filename --postgres --out-file/out-files/schema.sql +1 -1
  9. package/__tests__/dbml2sql/filenames --mysql --out-file/out-files/schema.sql +1 -1
  10. package/__tests__/dbml2sql/filenames --oracle --out-file/out-files/schema.sql +1 -1
  11. package/__tests__/dbml2sql/filenames --out-file/out-files/schema.sql +1 -1
  12. package/__tests__/dbml2sql/filenames --postgres --out-file/out-files/schema.sql +1 -1
  13. package/__tests__/dbml2sql/multifile error entry-syntax-error/dbml-error.log +7 -279
  14. package/__tests__/dbml2sql/multifile error import-not-found/dbml-error.log +5117 -30821
  15. package/__tests__/dbml2sql/multifile error imported-syntax-error/dbml-error.log +7 -210
  16. package/__tests__/dbml2sql/multifile error transitive-use-not-visible/dbml-error.log +5 -173
  17. package/__tests__/dbml2sql/multiple_schema_mssql/dbml-error.log +0 -30
  18. package/__tests__/dbml2sql/multiple_schema_mssql/out-files/multiple_schema.out.sql +1 -1
  19. package/__tests__/dbml2sql/multiple_schema_mysql/dbml-error.log +0 -30
  20. package/__tests__/dbml2sql/multiple_schema_mysql/out-files/multiple_schema.out.sql +1 -1
  21. package/__tests__/dbml2sql/multiple_schema_oracle/out-files/multiple_schema.out.sql +1 -1
  22. package/__tests__/dbml2sql/multiple_schema_pg/dbml-error.log +0 -30
  23. package/__tests__/dbml2sql/multiple_schema_pg/out-files/multiple_schema.out.sql +1 -1
  24. package/__tests__/dbml2sql/syntax-error/dbml-error.log +7 -426
  25. package/__tests__/sql2dbml/custom-error-alter-table-column-not-found --oracle/dbml-error.log +5 -343
  26. package/__tests__/sql2dbml/custom-error-alter-table-table-not-found --oracle/dbml-error.log +5 -343
  27. package/__tests__/sql2dbml/custom-error-column-comment-column-not-found --oracle/dbml-error.log +5 -343
  28. package/__tests__/sql2dbml/custom-error-column-comment-table-not-found --oracle/dbml-error.log +5 -339
  29. package/__tests__/sql2dbml/custom-error-create-index-table-not-found --oracle/dbml-error.log +5 -339
  30. package/__tests__/sql2dbml/custom-error-table-comment-table-not-found --oracle/dbml-error.log +5 -339
  31. package/__tests__/sql2dbml/filename --mysql --out-file/out-files/schema.dbml +6 -6
  32. package/__tests__/sql2dbml/filename --oracle --out-file/out-files/schema.dbml +12 -12
  33. package/__tests__/sql2dbml/filename --out-file/out-files/schema.dbml +6 -6
  34. package/__tests__/sql2dbml/filename --postgres --out-file/out-files/schema.dbml +6 -6
  35. package/__tests__/sql2dbml/filenames --mysql --out-file/out-files/schema.dbml +15 -15
  36. package/__tests__/sql2dbml/filenames --out-file/out-files/schema.dbml +15 -15
  37. package/__tests__/sql2dbml/filenames --postgres --out-file/out-files/schema.dbml +15 -15
  38. package/__tests__/sql2dbml/multiple_schema_mssql/out-files/multiple_schema.out.dbml +1 -1
  39. package/__tests__/sql2dbml/multiple_schema_mysql/out-files/multiple_schema.out.dbml +8 -8
  40. package/__tests__/sql2dbml/multiple_schema_pg/out-files/multiple_schema.out.dbml +7 -7
  41. package/__tests__/sql2dbml/syntax-error/dbml-error.log +5 -314
  42. package/__tests__/sql2dbml/syntax-error-duplicate-endpoints --mssql/dbml-error.log +5 -311
  43. package/__tests__/sql2dbml/syntax-error-duplicate-endpoints --mysql/dbml-error.log +5 -307
  44. package/lib/index.js +14 -9
  45. package/package.json +5 -5
  46. package/src/NodeProjectLayout.ts +12 -4
  47. package/dbml-error.log +0 -3
@@ -1,322 +1,20 @@
1
- 2026-04-11T10:16:02.804Z
2
- undefined
3
-
4
- 2026-04-11T10:19:47.074Z
5
- undefined
6
-
7
- 2026-04-11T10:53:31.236Z
8
- undefined
9
-
10
- 2026-04-11T10:55:59.352Z
11
- undefined
12
-
13
- 2026-04-11T11:14:08.082Z
14
- undefined
15
-
16
- 2026-04-11T15:33:24.319Z
17
- undefined
18
-
19
- 2026-04-17T08:28:12.644Z
20
- undefined
21
-
22
- 2026-04-17T08:30:04.522Z
23
- undefined
24
-
25
- 2026-04-21T10:03:46.911Z
26
- undefined
27
-
28
- 2026-04-25T14:23:24.290Z
29
- undefined
30
-
31
- 2026-04-25T14:24:44.457Z
32
- undefined
33
-
34
- 2026-04-25T14:26:03.853Z
35
- undefined
36
-
37
- 2026-04-25T14:27:23.238Z
38
- undefined
39
-
40
- 2026-04-25T14:28:44.260Z
41
- undefined
42
-
43
- 2026-04-25T14:39:04.973Z
44
- undefined
45
-
46
- 2026-04-25T14:42:09.694Z
47
- undefined
48
-
49
- 2026-04-25T14:46:18.763Z
50
- undefined
51
-
52
- 2026-04-25T14:49:45.147Z
53
- undefined
54
-
55
- 2026-04-25T14:52:17.585Z
56
- undefined
57
-
58
- 2026-04-25T14:54:06.309Z
59
- undefined
60
-
61
- 2026-04-25T14:55:33.033Z
62
- undefined
63
-
64
- 2026-04-25T14:57:29.835Z
65
- undefined
66
-
67
- 2026-04-25T14:59:18.940Z
68
- undefined
69
-
70
- 2026-04-25T15:18:52.479Z
71
- undefined
72
-
73
- 2026-04-25T15:45:10.950Z
74
- undefined
75
-
76
- 2026-04-30T02:24:16.181Z
77
- undefined
78
-
79
- 2026-04-30T02:27:03.580Z
80
- undefined
81
-
82
- 2026-05-03T12:50:13.032Z
83
- undefined
84
-
85
- 2026-05-03T12:55:31.060Z
86
- undefined
87
-
88
- 2026-05-03T13:24:02.658Z
89
- undefined
90
-
91
- 2026-05-04T15:14:09.165Z
92
- undefined
93
-
94
- 2026-05-04T17:05:56.541Z
95
- undefined
96
-
97
- 2026-05-04T17:07:08.426Z
98
- undefined
99
-
100
- 2026-05-06T08:11:35.478Z
101
-
102
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
103
-
104
- 2026-05-06T08:14:31.766Z
105
-
106
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
107
-
108
- 2026-05-06T08:18:06.210Z
109
- undefined
110
-
111
- 2026-05-06T10:17:42.282Z
112
-
113
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
114
-
115
- 2026-05-07T08:41:24.076Z
116
-
117
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
118
-
119
- 2026-05-07T08:43:21.697Z
120
-
121
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
122
-
123
- 2026-05-12T10:00:50.634Z
124
-
125
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
126
-
127
- 2026-05-14T03:42:31.059Z
128
-
129
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
130
-
131
- 2026-05-14T03:44:37.478Z
132
-
133
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
134
-
135
- 2026-05-14T03:45:52.813Z
136
-
137
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
138
-
139
- 2026-05-14T08:28:58.786Z
140
-
141
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
142
-
143
- 2026-05-14T08:30:23.569Z
144
-
145
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
146
-
147
- 2026-05-14T08:37:11.577Z
148
-
149
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
150
-
151
- 2026-05-14T08:48:22.035Z
152
-
153
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
154
-
155
- 2026-05-14T15:05:05.577Z
156
-
157
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
158
-
159
- 2026-06-01T03:38:22.087Z
160
-
161
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
162
-
163
- 2026-06-01T03:39:40.845Z
164
-
165
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
166
-
167
- 2026-06-01T04:54:22.032Z
168
-
169
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
170
-
171
- 2026-07-01T10:22:55.876Z
172
-
173
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
174
-
175
- 2026-07-01T10:24:34.924Z
176
-
177
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
178
-
179
- 2026-07-01T10:26:53.668Z
180
-
181
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
182
-
183
- 2026-07-01T10:28:45.199Z
184
-
185
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
186
-
187
- 2026-07-01T10:30:18.059Z
188
-
189
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
190
-
191
- 2026-07-01T10:32:03.594Z
192
-
193
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
194
-
195
- 2026-07-01T10:37:33.682Z
196
-
197
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
198
-
199
- 2026-07-01T10:39:09.289Z
200
-
201
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
202
-
203
- 2026-07-01T10:40:26.517Z
204
-
205
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
206
-
207
- 2026-07-01T10:41:56.635Z
208
-
209
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
210
-
211
- 2026-07-01T10:43:29.769Z
212
-
213
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
214
-
215
- 2026-07-01T10:53:34.912Z
216
-
217
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
218
-
219
- 2026-07-03T05:21:26.498Z
220
-
221
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
222
-
223
- 2026-07-03T08:51:08.423Z
224
-
225
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
226
-
227
- 2026-07-03T08:52:45.565Z
228
-
229
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
230
-
231
- 2026-07-03T10:23:30.387Z
232
-
233
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
234
-
235
- 2026-07-06T03:00:27.417Z
236
-
237
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
238
-
239
- 2026-07-06T03:05:13.828Z
240
-
241
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
242
-
243
- 2026-07-06T03:34:55.638Z
244
-
245
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
246
-
247
- 2026-07-06T03:59:43.571Z
248
-
249
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
250
-
251
- 2026-07-06T04:53:52.021Z
252
-
253
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
254
-
255
- 2026-07-06T05:26:58.069Z
256
-
257
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
258
-
259
- 2026-07-06T05:32:05.597Z
260
-
261
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
262
-
263
- 2026-07-06T09:40:30.653Z
264
-
265
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
266
-
267
- 2026-07-06T09:53:39.955Z
268
-
269
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
270
-
271
- 2026-07-06T10:06:33.100Z
272
-
273
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
274
-
275
- 2026-07-08T04:47:04.595Z
276
-
277
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
278
-
279
- 2026-07-08T04:47:54.063Z
280
-
281
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
282
-
283
- 2026-07-08T04:48:47.816Z
284
-
285
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
286
-
287
- 2026-07-08T04:51:13.801Z
288
-
289
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
290
-
291
- 2026-07-08T04:52:01.871Z
292
-
293
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
294
-
295
- 2026-07-13T09:30:26.602Z
296
-
297
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
298
-
299
- 2026-07-15T09:01:16.118Z
300
-
301
- You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
302
-
303
- 2026-07-15T11:09:23.348Z
1
+ 2026-06-15T10:58:17.125Z
304
2
 
305
3
  You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
306
4
 
307
- 2026-07-17T09:13:43.886Z
5
+ 2026-06-15T10:59:19.725Z
308
6
 
309
7
  You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
310
8
 
311
- 2026-07-30T02:49:53.636Z
9
+ 2026-07-22T11:04:06.639Z
312
10
 
313
11
  You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
314
12
 
315
- 2026-07-30T02:51:32.829Z
13
+ 2026-07-22T11:07:39.465Z
316
14
 
317
15
  You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
318
16
 
319
- 2026-08-06T04:04:01.691Z
17
+ 2026-07-22T11:10:21.392Z
320
18
 
321
19
  You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
322
20
 
package/lib/index.js CHANGED
@@ -39,7 +39,7 @@ let node_fs = require("node:fs");
39
39
  var package_default = {
40
40
  $schema: "https://json.schemastore.org/package",
41
41
  name: "@dbml/cli",
42
- version: "10.2.0",
42
+ version: "10.2.1-expose-diagnostic-filepath.1",
43
43
  description: "",
44
44
  main: "lib/index.js",
45
45
  license: "Apache-2.0",
@@ -66,9 +66,9 @@ var package_default = {
66
66
  keywords: ["dbml", "dbml-cli"],
67
67
  dependencies: {
68
68
  "@babel/cli": "^7.21.0",
69
- "@dbml/connector": "^10.2.0",
70
- "@dbml/core": "^10.2.0",
71
- "@dbml/parse": "^10.2.0",
69
+ "@dbml/connector": "^10.2.1-expose-diagnostic-filepath.1",
70
+ "@dbml/core": "^10.2.1-expose-diagnostic-filepath.1",
71
+ "@dbml/parse": "^10.2.1-expose-diagnostic-filepath.1",
72
72
  "bluebird": "^3.5.5",
73
73
  "chalk": "^2.4.2",
74
74
  "commander": "^2.20.0",
@@ -79,7 +79,7 @@ var package_default = {
79
79
  "strip-ansi": "^5.2.0",
80
80
  "winston": "^3.2.1"
81
81
  },
82
- gitHead: "c0844906edf50438efe35207712d1c06eac53ef0",
82
+ gitHead: "70c531b58c2a045c1e573fc642b76b9a82e8b49a",
83
83
  engines: { "node": ">=18" }
84
84
  };
85
85
  //#endregion
@@ -2651,20 +2651,25 @@ var NodeProjectLayout = class {
2651
2651
  constructor(entryPoints) {
2652
2652
  this.entryPoints = [...entryPoints];
2653
2653
  }
2654
+ resolveFileSpecifier(currentFilepath, relativePath) {
2655
+ if (!_dbml_parse.Filepath.isRelative(relativePath)) return void 0;
2656
+ const resolved = _dbml_parse.Filepath.resolve(currentFilepath.dirname, relativePath);
2657
+ return resolved.absolute.endsWith(".dbml") ? resolved : _dbml_parse.Filepath.from(resolved.absolute + ".dbml");
2658
+ }
2654
2659
  getSource(filePath) {
2655
- return safeReadFileSync(filePath.absolute, "utf-8");
2660
+ return safeReadFileSync(filePath.fsPath, "utf-8");
2656
2661
  }
2657
2662
  exists(filePath) {
2658
2663
  return this.isFile(filePath) || this.isDirectory(filePath);
2659
2664
  }
2660
2665
  isFile(filePath) {
2661
- return safeStatSync(filePath.absolute, { throwIfNoEntry: false })?.isFile() ?? false;
2666
+ return safeStatSync(filePath.fsPath, { throwIfNoEntry: false })?.isFile() ?? false;
2662
2667
  }
2663
2668
  isDirectory(filePath) {
2664
- return safeStatSync(filePath.absolute, { throwIfNoEntry: false })?.isDirectory() ?? false;
2669
+ return safeStatSync(filePath.fsPath, { throwIfNoEntry: false })?.isDirectory() ?? false;
2665
2670
  }
2666
2671
  listDirectory(dirPath) {
2667
- const basePath = dirPath?.absolute ?? "/";
2672
+ const basePath = dirPath ? dirPath.fsPath : "/";
2668
2673
  return safeReaddirSync(basePath)?.map((entry) => basePath + entry).sort().map(_dbml_parse.Filepath.from) ?? [];
2669
2674
  }
2670
2675
  getEntrypoints() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@dbml/cli",
4
- "version": "10.2.0",
4
+ "version": "10.2.1-expose-diagnostic-filepath.1",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "license": "Apache-2.0",
@@ -33,9 +33,9 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@babel/cli": "^7.21.0",
36
- "@dbml/connector": "^10.2.0",
37
- "@dbml/core": "^10.2.0",
38
- "@dbml/parse": "^10.2.0",
36
+ "@dbml/connector": "^10.2.1-expose-diagnostic-filepath.1",
37
+ "@dbml/core": "^10.2.1-expose-diagnostic-filepath.1",
38
+ "@dbml/parse": "^10.2.1-expose-diagnostic-filepath.1",
39
39
  "bluebird": "^3.5.5",
40
40
  "chalk": "^2.4.2",
41
41
  "commander": "^2.20.0",
@@ -46,7 +46,7 @@
46
46
  "strip-ansi": "^5.2.0",
47
47
  "winston": "^3.2.1"
48
48
  },
49
- "gitHead": "c0844906edf50438efe35207712d1c06eac53ef0",
49
+ "gitHead": "70c531b58c2a045c1e573fc642b76b9a82e8b49a",
50
50
  "engines": {
51
51
  "node": ">=18"
52
52
  }
@@ -18,8 +18,16 @@ export class NodeProjectLayout implements DbmlProjectLayout {
18
18
  this.entryPoints = [...entryPoints];
19
19
  }
20
20
 
21
+ // From the currentFilepath, resolve the relativePath to an absolute path
22
+ // Append `.dbml` if relativePath does not ends with `.dbml`
23
+ resolveFileSpecifier (currentFilepath: Filepath, relativePath: string): Filepath | undefined {
24
+ if (!Filepath.isRelative(relativePath)) return undefined;
25
+ const resolved = Filepath.resolve(currentFilepath.dirname, relativePath);
26
+ return resolved.absolute.endsWith('.dbml') ? resolved : Filepath.from(resolved.absolute + '.dbml');
27
+ }
28
+
21
29
  getSource (filePath: Filepath): string | undefined {
22
- return safeReadFileSync(filePath.absolute, 'utf-8');
30
+ return safeReadFileSync(filePath.fsPath, 'utf-8');
23
31
  }
24
32
 
25
33
  exists (filePath: Filepath): boolean {
@@ -27,19 +35,19 @@ export class NodeProjectLayout implements DbmlProjectLayout {
27
35
  }
28
36
 
29
37
  isFile (filePath: Filepath): boolean {
30
- return safeStatSync(filePath.absolute, {
38
+ return safeStatSync(filePath.fsPath, {
31
39
  throwIfNoEntry: false,
32
40
  })?.isFile() ?? false;
33
41
  }
34
42
 
35
43
  isDirectory (filePath: Filepath): boolean {
36
- return safeStatSync(filePath.absolute, {
44
+ return safeStatSync(filePath.fsPath, {
37
45
  throwIfNoEntry: false,
38
46
  })?.isDirectory() ?? false;
39
47
  }
40
48
 
41
49
  listDirectory (dirPath?: Filepath): Filepath[] {
42
- const basePath = dirPath?.absolute ?? '/';
50
+ const basePath = dirPath ? dirPath.fsPath : '/';
43
51
  return safeReaddirSync(basePath)?.map((entry) => basePath + entry).sort().map(Filepath.from) ?? [];
44
52
  }
45
53
 
package/dbml-error.log DELETED
@@ -1,3 +0,0 @@
1
- 2026-04-11T10:16:28.713Z
2
- undefined
3
-