data-peek/package.json
Rohith Gilla 626dcbfbe9
feat: multi-statement step-through + notebook polish (#160)
* feat(step): add shared types for step-through sessions

* feat(step): add statement parser with line-range metadata and DDL detection

* feat(step): add StepSessionRegistry with state machine and lifecycle management

Implements the session registry that holds open DB clients across user-pause gaps,
managing state transitions (paused/running/errored/done) for multi-statement step-through.
Also fixes root test script and excludes pre-broken sqlite native module tests from vitest.

* feat(step): add IPC handlers and wire session registry to app lifecycle

* fix(step): widen state type to avoid stale TS narrowing in continue()

* feat(step): expose step IPC via window.api.step

* feat(step): add Zustand store for step-through session state

* feat(step): add ribbon component with progress, controls, and keyboard shortcuts

* feat(step): add pinned + current results tab strip

* feat(step): wire Step button, ribbon, decorations, and breakpoint gutter

* fix(step): register Monaco commands for keybindings + sync cursor from server

Replace window-level keydown listener for Cmd+Shift+Enter with a Monaco
addAction registration so it takes precedence over Monaco's built-in Shift+Enter
handling. Also adds in-session Shift+Enter (next) and Escape (stop) as Monaco
actions, active only while a step session is running.

Add cursorIndex to all step response types (NextStepResponse, SkipStepResponse,
ContinueStepResponse, RetryStepResponse) and populate it from the server in
step-session.ts. The store now uses the server-provided value instead of
computing cursorIndex + 1 on the client, eliminating the 0/3 counter drift bug.

* fix(notebook): index result rows by column name

Rows from window.api.db.query are Record<string, unknown>[], not unknown[][].
ResultTable was calling row.map, throwing TypeError at runtime.

* feat(notebook): syntax highlighting via Monaco SQLEditor

Replace plain textarea/pre with the existing SQLEditor in compact mode
so notebook SQL cells get syntax highlighting, autocomplete (schemas,
keywords, functions), and the same theme as the main query editor.
Editor height grows with content up to 400px.

Pinned results are stored as unknown[][] but the renderer now indexes
rows by column name, so convert in both directions when pinning and
when rendering pinned snapshots.

* feat(notebook): drag-to-reorder cells with dnd-kit

Wrap the cells map in DndContext + SortableContext (vertical strategy)
and make NotebookCell sortable. Drag listeners attach only to the grip
button so Monaco editor pointer events keep working. Calls existing
reorderCells store action on drop, persisting the new order.

* fix(step): propagate real errors, clean up failed starts, harden cleanup

- Extend IPC response types with SessionSnapshot base + error fields
- start() wraps connect+BEGIN with cleanup on failure (prevents connection leak)
- continue() catch logs + sets errored state (no more silent swallows)
- executeCurrent logs errors and includes them in response
- stop() reports rollbackError so UI can surface ROLLBACK failures
- before-quit preventsDefault + awaits cleanup (3s timeout)
- parse-statements fallback path logs, computes correct endLine, stops silent drift
- Replace 'Query failed' placeholder in store with actual error message
- stoppedAt is now number | null (no more -1 sentinel)

* fix(step): renderer polish — toasts, Escape hijack, monaco bundle size

- Gate Step button and Monaco action to postgresql-only connections
- Toast on all IPC failures in step-store (replaces console.error)
- Surface ROLLBACK errors from stop() via destructive toast
- Roll back optimistic breakpoint state on setBreakpoints IPC failure
- Remove global Escape keydown listener (Monaco already handles it)
- Remove 'monaco-editor' namespace import; use onMount's monaco arg instead
  (drops ~1-2MB from renderer bundle)

* test(step): add coverage for critical gaps

- start() cleanup on connect/BEGIN failure
- Empty/whitespace SQL rejection without creating a client
- Concurrent next() race (may reveal known limitation)
- Continue with breakpoint at current cursor (skip-own-breakpoint semantics)
- stop() idempotency
- retry() state guards (paused, done)
- skip on last statement transitions to done
- Parser: dollar-quoted blocks with internal semicolons
- Parser: duplicate statement bodies get distinct lines
- Parser: CRLF line endings
- Parser: no trailing semicolon on last statement
2026-04-15 18:05:25 +05:30

59 lines
2.1 KiB
JSON

{
"name": "data-peek",
"version": "0.20.1",
"description": "",
"main": "index.js",
"scripts": {
"test": "pnpm --filter @data-peek/desktop exec vitest run",
"dev": "turbo run dev --filter=@data-peek/desktop",
"dev:web": "turbo run dev --filter=@data-peek/web",
"dev:webapp": "turbo run dev --filter=@data-peek/webapp",
"dev:docs": "turbo run dev --filter=docs",
"dev:video": "turbo run dev --filter=@data-peek/video",
"render:video": "turbo run render --filter=@data-peek/video",
"build": "turbo run build",
"build:desktop": "turbo run build --filter=@data-peek/desktop",
"build:web": "turbo run build --filter=@data-peek/web",
"build:webapp": "turbo run build --filter=@data-peek/webapp",
"build:docs": "turbo run build --filter=docs",
"lint": "turbo run lint",
"typecheck": "turbo run typecheck types:check",
"postinstall": "pnpm --filter @data-peek/desktop exec electron-builder install-app-deps || true",
"setup": "pnpm install && pnpm setup:electron",
"setup:electron": "pnpm --filter @data-peek/desktop exec electron-builder install-app-deps",
"rebuild": "pnpm rebuild better-sqlite3 && pnpm setup:electron",
"clean": "rm -rf node_modules apps/*/node_modules packages/*/node_modules pnpm-lock.yaml .turbo",
"clean:install": "pnpm clean && pnpm install",
"build:win": "turbo run build:win --filter=@data-peek/desktop",
"build:mac": "turbo run build:mac --filter=@data-peek/desktop",
"build:linux": "turbo run build:linux --filter=@data-peek/desktop",
"release": "bumpp package.json apps/*/package.json packages/*/package.json"
},
"devDependencies": {
"@types/papaparse": "^5.5.2",
"bumpp": "^10.3.2",
"prettier": "^3.2.0",
"turbo": "^2.6.1",
"typescript": "^5.4.0"
},
"keywords": [],
"author": "",
"license": "ISC",
"packageManager": "pnpm@10.22.0",
"pnpm": {
"onlyBuiltDependencies": [
"@clerk/shared",
"better-sqlite3",
"core-js",
"cpu-features",
"electron",
"esbuild",
"sharp",
"ssh2",
"unrs-resolver"
]
},
"dependencies": {
"papaparse": "^5.5.3"
}
}