@culpritsql/devtools 0.0.1 → 0.5.7
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.
- package/README.md +12 -0
- package/dist/styles.css +208 -9
- package/package.json +20 -4
package/README.md
CHANGED
|
@@ -83,6 +83,18 @@ export function DevOverlay() {
|
|
|
83
83
|
|
|
84
84
|
---
|
|
85
85
|
|
|
86
|
+
## Live Full-Stack Playground
|
|
87
|
+
|
|
88
|
+
Run the zero-Docker SQLite + React 19 + WebAssembly playground in [`demo/`](./demo) to trigger live N+1 query bursts, compare batched fixes, emit `reylo:query` `diagnostics_channel` telemetry, and inspect interactive `EXPLAIN` flow graphs:
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
git clone https://github.com/culpritsql/culprit-devtools.git
|
|
92
|
+
cd culprit-devtools && bun install && bun run demo
|
|
93
|
+
# Open http://127.0.0.1:4321
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
86
98
|
## Framework & Driver Integrations
|
|
87
99
|
|
|
88
100
|
### Reylo (`diagnostics_channel`)
|
package/dist/styles.css
CHANGED
|
@@ -350,9 +350,35 @@
|
|
|
350
350
|
|
|
351
351
|
.culprit-pv.pv-root,
|
|
352
352
|
.culprit-pv.pv-diff {
|
|
353
|
+
container: pv-shell / inline-size;
|
|
353
354
|
display: flex;
|
|
354
355
|
flex-direction: column;
|
|
355
356
|
gap: 12px;
|
|
357
|
+
padding: var(--pv-pad, 14px 16px 18px);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
@container pv-shell (max-width: 520px) {
|
|
361
|
+
.culprit-pv.pv-root,
|
|
362
|
+
.culprit-pv.pv-diff {
|
|
363
|
+
padding: var(--pv-pad, 10px 12px 14px);
|
|
364
|
+
gap: 10px;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
@media (max-width: 560px) {
|
|
369
|
+
.culprit-pv.pv-root,
|
|
370
|
+
.culprit-pv.pv-diff {
|
|
371
|
+
padding: var(--pv-pad, 10px 12px 14px);
|
|
372
|
+
gap: 10px;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.culprit-pv .pv-canvas-bar {
|
|
377
|
+
display: flex;
|
|
378
|
+
align-items: center;
|
|
379
|
+
justify-content: space-between;
|
|
380
|
+
flex-wrap: wrap;
|
|
381
|
+
gap: 8px 14px;
|
|
356
382
|
}
|
|
357
383
|
|
|
358
384
|
.culprit-pv .pv-toolbar {
|
|
@@ -574,6 +600,9 @@
|
|
|
574
600
|
|
|
575
601
|
.culprit-pv .seg {
|
|
576
602
|
display: inline-flex;
|
|
603
|
+
flex-wrap: wrap;
|
|
604
|
+
gap: 2px;
|
|
605
|
+
max-width: 100%;
|
|
577
606
|
padding: 2px;
|
|
578
607
|
border-radius: 7px;
|
|
579
608
|
background: var(--sunken);
|
|
@@ -1229,10 +1258,13 @@
|
|
|
1229
1258
|
|
|
1230
1259
|
.culprit-pv.plan,
|
|
1231
1260
|
.culprit-pv .plan {
|
|
1261
|
+
container: plan-box / inline-size;
|
|
1232
1262
|
border: 1px solid var(--border);
|
|
1233
1263
|
border-radius: var(--radius);
|
|
1234
1264
|
overflow: hidden;
|
|
1235
1265
|
background: var(--surface);
|
|
1266
|
+
--plan-cols: minmax(0, 1fr) 164px 86px;
|
|
1267
|
+
--indent-step: 12px;
|
|
1236
1268
|
}
|
|
1237
1269
|
|
|
1238
1270
|
.culprit-pv .plan-head {
|
|
@@ -1260,7 +1292,7 @@
|
|
|
1260
1292
|
.culprit-pv .plan-cols,
|
|
1261
1293
|
.culprit-pv .pnode {
|
|
1262
1294
|
display: grid;
|
|
1263
|
-
grid-template-columns:
|
|
1295
|
+
grid-template-columns: var(--plan-cols);
|
|
1264
1296
|
align-items: center;
|
|
1265
1297
|
gap: 10px;
|
|
1266
1298
|
padding: 0 12px;
|
|
@@ -1274,6 +1306,13 @@
|
|
|
1274
1306
|
font-weight: 600;
|
|
1275
1307
|
}
|
|
1276
1308
|
|
|
1309
|
+
.culprit-pv .plan-cols span {
|
|
1310
|
+
min-width: 0;
|
|
1311
|
+
overflow: hidden;
|
|
1312
|
+
text-overflow: ellipsis;
|
|
1313
|
+
white-space: nowrap;
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1277
1316
|
.culprit-pv .plan-cols span:not(:first-child) {
|
|
1278
1317
|
text-align: end;
|
|
1279
1318
|
}
|
|
@@ -1281,8 +1320,8 @@
|
|
|
1281
1320
|
.culprit-pv .pnode {
|
|
1282
1321
|
align-items: start;
|
|
1283
1322
|
min-height: 30px;
|
|
1284
|
-
padding-top:
|
|
1285
|
-
padding-bottom:
|
|
1323
|
+
padding-top: 5px;
|
|
1324
|
+
padding-bottom: 5px;
|
|
1286
1325
|
width: 100%;
|
|
1287
1326
|
text-align: start;
|
|
1288
1327
|
border-inline-start: 2px solid transparent;
|
|
@@ -1304,6 +1343,7 @@
|
|
|
1304
1343
|
display: flex;
|
|
1305
1344
|
align-items: flex-start;
|
|
1306
1345
|
min-width: 0;
|
|
1346
|
+
overflow: hidden;
|
|
1307
1347
|
}
|
|
1308
1348
|
|
|
1309
1349
|
.culprit-pv .pnode .lines {
|
|
@@ -1325,6 +1365,7 @@
|
|
|
1325
1365
|
.culprit-pv .pnode .op-icon {
|
|
1326
1366
|
display: inline-grid;
|
|
1327
1367
|
place-items: center;
|
|
1368
|
+
flex-shrink: 0;
|
|
1328
1369
|
color: var(--text-3);
|
|
1329
1370
|
margin-inline-end: 2px;
|
|
1330
1371
|
}
|
|
@@ -1346,6 +1387,7 @@
|
|
|
1346
1387
|
.culprit-pv .pnode .indent {
|
|
1347
1388
|
display: inline-block;
|
|
1348
1389
|
flex-shrink: 0;
|
|
1390
|
+
width: calc(var(--depth, 0) * var(--indent-step, 12px));
|
|
1349
1391
|
}
|
|
1350
1392
|
|
|
1351
1393
|
.culprit-pv .pnode .twisty {
|
|
@@ -1361,11 +1403,15 @@
|
|
|
1361
1403
|
.culprit-pv .pnode .opname {
|
|
1362
1404
|
font-weight: 600;
|
|
1363
1405
|
white-space: nowrap;
|
|
1364
|
-
|
|
1406
|
+
overflow: hidden;
|
|
1407
|
+
text-overflow: ellipsis;
|
|
1408
|
+
min-width: 0;
|
|
1409
|
+
flex: 0 1 auto;
|
|
1365
1410
|
}
|
|
1366
1411
|
|
|
1367
1412
|
.culprit-pv .pnode .obj {
|
|
1368
|
-
min-width:
|
|
1413
|
+
min-width: 0;
|
|
1414
|
+
flex: 0 9999 auto;
|
|
1369
1415
|
color: var(--text-2);
|
|
1370
1416
|
white-space: nowrap;
|
|
1371
1417
|
overflow: hidden;
|
|
@@ -1376,12 +1422,26 @@
|
|
|
1376
1422
|
|
|
1377
1423
|
.culprit-pv .pnode .rows,
|
|
1378
1424
|
.culprit-pv .pnode .cost {
|
|
1425
|
+
min-width: 0;
|
|
1426
|
+
overflow: hidden;
|
|
1379
1427
|
text-align: end;
|
|
1380
1428
|
font-variant-numeric: tabular-nums;
|
|
1381
1429
|
font-size: var(--fs-meta);
|
|
1382
1430
|
white-space: nowrap;
|
|
1383
1431
|
}
|
|
1384
1432
|
|
|
1433
|
+
.culprit-pv .pnode .rows {
|
|
1434
|
+
display: flex;
|
|
1435
|
+
align-items: center;
|
|
1436
|
+
justify-content: flex-end;
|
|
1437
|
+
flex-wrap: wrap;
|
|
1438
|
+
gap: 2px 4px;
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
.culprit-pv .pnode .rows-pair {
|
|
1442
|
+
white-space: nowrap;
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1385
1445
|
.culprit-pv .pnode .rows .arrow {
|
|
1386
1446
|
color: var(--text-3);
|
|
1387
1447
|
}
|
|
@@ -1394,6 +1454,7 @@
|
|
|
1394
1454
|
}
|
|
1395
1455
|
|
|
1396
1456
|
.culprit-pv .tree-flag {
|
|
1457
|
+
flex-shrink: 0;
|
|
1397
1458
|
display: inline-grid;
|
|
1398
1459
|
place-items: center;
|
|
1399
1460
|
min-width: 16px;
|
|
@@ -1417,6 +1478,7 @@
|
|
|
1417
1478
|
.culprit-pv .heat {
|
|
1418
1479
|
width: 38px;
|
|
1419
1480
|
height: 6px;
|
|
1481
|
+
flex-shrink: 0;
|
|
1420
1482
|
border-radius: 3px;
|
|
1421
1483
|
background: var(--sunken);
|
|
1422
1484
|
overflow: hidden;
|
|
@@ -1444,6 +1506,7 @@
|
|
|
1444
1506
|
}
|
|
1445
1507
|
|
|
1446
1508
|
.culprit-pv .mis {
|
|
1509
|
+
flex-shrink: 0;
|
|
1447
1510
|
display: inline-flex;
|
|
1448
1511
|
align-items: center;
|
|
1449
1512
|
height: 17px;
|
|
@@ -1453,7 +1516,76 @@
|
|
|
1453
1516
|
font-weight: 600;
|
|
1454
1517
|
background: var(--high-bg);
|
|
1455
1518
|
color: var(--high-text);
|
|
1456
|
-
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
@container plan-box (max-width: 580px) {
|
|
1522
|
+
.culprit-pv.plan,
|
|
1523
|
+
.culprit-pv .plan {
|
|
1524
|
+
--plan-cols: minmax(0, 1fr) 132px 72px;
|
|
1525
|
+
--indent-step: 9px;
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
.culprit-pv .plan-cols,
|
|
1529
|
+
.culprit-pv .pnode {
|
|
1530
|
+
gap: 8px;
|
|
1531
|
+
padding-inline: 10px;
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
.culprit-pv .pnode .line1 {
|
|
1535
|
+
flex-wrap: wrap;
|
|
1536
|
+
row-gap: 1px;
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
.culprit-pv .pnode .obj {
|
|
1540
|
+
flex: 1 1 100%;
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
.culprit-pv .heat {
|
|
1544
|
+
width: 24px;
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
.culprit-pv .plan-head .plan-search {
|
|
1548
|
+
flex: 1 1 168px;
|
|
1549
|
+
max-width: none;
|
|
1550
|
+
min-width: 140px;
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
@container plan-box (max-width: 440px) {
|
|
1555
|
+
.culprit-pv .plan-cols {
|
|
1556
|
+
display: none;
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
.culprit-pv .pnode {
|
|
1560
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
1561
|
+
grid-template-areas:
|
|
1562
|
+
"label cost"
|
|
1563
|
+
"rows rows";
|
|
1564
|
+
row-gap: 3px;
|
|
1565
|
+
padding: 6px 10px;
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
.culprit-pv .pnode .label {
|
|
1569
|
+
grid-area: label;
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
.culprit-pv .pnode .cost {
|
|
1573
|
+
grid-area: cost;
|
|
1574
|
+
align-self: start;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
.culprit-pv .pnode .rows {
|
|
1578
|
+
grid-area: rows;
|
|
1579
|
+
justify-content: flex-start;
|
|
1580
|
+
text-align: start;
|
|
1581
|
+
padding-inline-start: calc(var(--depth, 0) * var(--indent-step, 9px) + 18px);
|
|
1582
|
+
font-size: var(--fs-ui-sm);
|
|
1583
|
+
color: var(--text-2);
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
.culprit-pv .pnode .rows:empty {
|
|
1587
|
+
display: none;
|
|
1588
|
+
}
|
|
1457
1589
|
}
|
|
1458
1590
|
|
|
1459
1591
|
.culprit-pv .cost-strip {
|
|
@@ -2341,6 +2473,11 @@
|
|
|
2341
2473
|
gap: 8px;
|
|
2342
2474
|
}
|
|
2343
2475
|
|
|
2476
|
+
.culprit-pv .compare-pickers .pv-meta {
|
|
2477
|
+
flex-wrap: wrap;
|
|
2478
|
+
row-gap: 4px;
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2344
2481
|
.culprit-pv .cmp-sync.on {
|
|
2345
2482
|
color: var(--link);
|
|
2346
2483
|
}
|
|
@@ -2723,6 +2860,22 @@
|
|
|
2723
2860
|
margin: 4px 16px;
|
|
2724
2861
|
}
|
|
2725
2862
|
|
|
2863
|
+
.culprit-pv .cmp-canvas-bar {
|
|
2864
|
+
display: flex;
|
|
2865
|
+
align-items: center;
|
|
2866
|
+
justify-content: space-between;
|
|
2867
|
+
flex-wrap: wrap;
|
|
2868
|
+
gap: 8px 18px;
|
|
2869
|
+
padding-top: 2px;
|
|
2870
|
+
}
|
|
2871
|
+
|
|
2872
|
+
.culprit-pv .cmp-canvas-controls {
|
|
2873
|
+
display: inline-flex;
|
|
2874
|
+
align-items: center;
|
|
2875
|
+
flex-wrap: wrap;
|
|
2876
|
+
gap: 8px;
|
|
2877
|
+
}
|
|
2878
|
+
|
|
2726
2879
|
.culprit-pv .cmp-legend {
|
|
2727
2880
|
display: flex;
|
|
2728
2881
|
flex-wrap: wrap;
|
|
@@ -2751,11 +2904,42 @@
|
|
|
2751
2904
|
|
|
2752
2905
|
.culprit-pv .compare-sides {
|
|
2753
2906
|
display: grid;
|
|
2754
|
-
grid-template-columns: repeat(auto-fit, minmax(
|
|
2907
|
+
grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr));
|
|
2755
2908
|
gap: 12px;
|
|
2756
2909
|
align-items: start;
|
|
2757
2910
|
}
|
|
2758
2911
|
|
|
2912
|
+
@container pv-shell (max-width: 560px) {
|
|
2913
|
+
.culprit-pv .cmp-verdict {
|
|
2914
|
+
padding: 12px 14px;
|
|
2915
|
+
}
|
|
2916
|
+
|
|
2917
|
+
.culprit-pv .cmp-change {
|
|
2918
|
+
grid-template-columns: minmax(0, 1fr);
|
|
2919
|
+
gap: 4px;
|
|
2920
|
+
padding: 8px 12px;
|
|
2921
|
+
}
|
|
2922
|
+
|
|
2923
|
+
.culprit-pv .cmp-prop {
|
|
2924
|
+
grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr);
|
|
2925
|
+
row-gap: 2px;
|
|
2926
|
+
padding: 6px 12px;
|
|
2927
|
+
}
|
|
2928
|
+
|
|
2929
|
+
.culprit-pv .cmp-prop-label {
|
|
2930
|
+
grid-column: 1 / -1;
|
|
2931
|
+
font-size: var(--fs-micro);
|
|
2932
|
+
}
|
|
2933
|
+
|
|
2934
|
+
.culprit-pv .cmp-prop.head > span:first-child {
|
|
2935
|
+
display: none;
|
|
2936
|
+
}
|
|
2937
|
+
|
|
2938
|
+
.culprit-pv .ins-body {
|
|
2939
|
+
padding: 0 12px 12px 14px;
|
|
2940
|
+
}
|
|
2941
|
+
}
|
|
2942
|
+
|
|
2759
2943
|
.culprit-pv .compare-side {
|
|
2760
2944
|
display: flex;
|
|
2761
2945
|
flex-direction: column;
|
|
@@ -2780,13 +2964,26 @@
|
|
|
2780
2964
|
/* ───────── deadlocks (DeadlockViewer & DeadlockGraph) ───────── */
|
|
2781
2965
|
|
|
2782
2966
|
.culprit-pv.dl-detail {
|
|
2967
|
+
container: pv-deadlock / inline-size;
|
|
2783
2968
|
min-width: 0;
|
|
2784
|
-
padding: 18px 22px 26px;
|
|
2969
|
+
padding: var(--pv-pad, 18px 22px 26px);
|
|
2785
2970
|
border: 1px solid var(--border);
|
|
2786
2971
|
border-radius: var(--radius);
|
|
2787
2972
|
background: var(--bg);
|
|
2788
2973
|
}
|
|
2789
2974
|
|
|
2975
|
+
@container pv-deadlock (max-width: 520px) {
|
|
2976
|
+
.culprit-pv.dl-detail {
|
|
2977
|
+
padding: var(--pv-pad, 14px 14px 18px);
|
|
2978
|
+
}
|
|
2979
|
+
}
|
|
2980
|
+
|
|
2981
|
+
@media (max-width: 560px) {
|
|
2982
|
+
.culprit-pv.dl-detail {
|
|
2983
|
+
padding: var(--pv-pad, 14px 14px 18px);
|
|
2984
|
+
}
|
|
2985
|
+
}
|
|
2986
|
+
|
|
2790
2987
|
.culprit-pv .dl-detail-meta {
|
|
2791
2988
|
display: flex;
|
|
2792
2989
|
align-items: center;
|
|
@@ -2822,6 +3019,7 @@
|
|
|
2822
3019
|
padding: 12px 14px 8px;
|
|
2823
3020
|
border: 1px solid var(--border);
|
|
2824
3021
|
border-radius: 10px;
|
|
3022
|
+
overflow-x: auto;
|
|
2825
3023
|
background-color: var(--sunken);
|
|
2826
3024
|
background-image: radial-gradient(color-mix(in srgb, var(--text-3) 22%, transparent) 1px, transparent 1px);
|
|
2827
3025
|
background-size: 16px 16px;
|
|
@@ -2831,6 +3029,7 @@
|
|
|
2831
3029
|
.culprit-pv .dl-graph svg {
|
|
2832
3030
|
display: block;
|
|
2833
3031
|
width: 100%;
|
|
3032
|
+
min-width: 480px;
|
|
2834
3033
|
max-width: 720px;
|
|
2835
3034
|
height: auto;
|
|
2836
3035
|
max-height: 380px;
|
|
@@ -3051,7 +3250,7 @@
|
|
|
3051
3250
|
|
|
3052
3251
|
.culprit-pv .dl-procs {
|
|
3053
3252
|
display: grid;
|
|
3054
|
-
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
|
3253
|
+
grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
|
|
3055
3254
|
gap: 10px;
|
|
3056
3255
|
}
|
|
3057
3256
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@culpritsql/devtools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"description": "In-app SQL DevTools HUD, N+1 burst detector, and interactive EXPLAIN plan inspector for React and Node.js.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -25,15 +25,30 @@
|
|
|
25
25
|
},
|
|
26
26
|
"./styles.css": "./dist/styles.css"
|
|
27
27
|
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "node scripts/build.mjs",
|
|
30
|
+
"typecheck": "tsc -p tsconfig.check.json",
|
|
31
|
+
"test": "bun test",
|
|
32
|
+
"demo": "npm run build && node demo/run.mjs"
|
|
33
|
+
},
|
|
28
34
|
"dependencies": {
|
|
29
|
-
"@culpritsql/plan-viewer": "^0.5.
|
|
30
|
-
"@culpritsql/plans": "^0.5.
|
|
35
|
+
"@culpritsql/plan-viewer": "^0.5.8",
|
|
36
|
+
"@culpritsql/plans": "^0.5.7",
|
|
31
37
|
"lucide-react": "^1.16.0"
|
|
32
38
|
},
|
|
33
39
|
"peerDependencies": {
|
|
34
40
|
"react": "^18.0.0 || ^19.0.0",
|
|
35
41
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
36
42
|
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/node": "^22.15.3",
|
|
45
|
+
"@types/react": "^19.2.14",
|
|
46
|
+
"@types/react-dom": "^19.2.3",
|
|
47
|
+
"esbuild": "^0.25.4",
|
|
48
|
+
"react": "^19.2.4",
|
|
49
|
+
"react-dom": "^19.2.4",
|
|
50
|
+
"typescript": "^5.9.3"
|
|
51
|
+
},
|
|
37
52
|
"repository": {
|
|
38
53
|
"type": "git",
|
|
39
54
|
"url": "git+https://github.com/culpritsql/culprit-devtools.git"
|
|
@@ -43,7 +58,8 @@
|
|
|
43
58
|
"url": "https://github.com/culpritsql/culprit-devtools/issues"
|
|
44
59
|
},
|
|
45
60
|
"publishConfig": {
|
|
46
|
-
"access": "public"
|
|
61
|
+
"access": "public",
|
|
62
|
+
"provenance": true
|
|
47
63
|
},
|
|
48
64
|
"keywords": [
|
|
49
65
|
"sql",
|