stellar-drive 1.1.15 → 1.1.17
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
CHANGED
|
@@ -1,37 +1,59 @@
|
|
|
1
|
-
# stellar-drive
|
|
1
|
+
# stellar-drive
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/stellar-drive) [](https://supabase.com)
|
|
4
|
+
|
|
5
|
+
**stellar-drive** is an offline-first sync engine for applications built on [Supabase](https://supabase.com) and [Dexie.js](https://dexie.org) (IndexedDB). It solves the hard problems of local-first architecture: all reads come from IndexedDB for instant response, all writes land locally first and queue for background sync, and a conflict resolution system handles concurrent edits across devices. Your app stays fast and fully functional whether the user is online, offline, or on a flaky connection.
|
|
6
|
+
|
|
7
|
+
The core engine is framework-agnostic (vanilla JS/TS), with optional integrations for **SvelteKit** and **Svelte 5**.
|
|
8
|
+
|
|
9
|
+
---
|
|
4
10
|
|
|
5
11
|
## Documentation
|
|
6
12
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
13
|
+
| Document | What it covers |
|
|
14
|
+
|----------|---------------|
|
|
15
|
+
| [API Reference](./API_REFERENCE.md) | Full signatures, parameters, and usage examples for every public export |
|
|
16
|
+
| [Architecture](./ARCHITECTURE.md) | Internal design, data flow, and module responsibilities |
|
|
17
|
+
| [Frameworks](./FRAMEWORKS.md) | Background on the frameworks used in stellar-drive |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Why stellar-drive?
|
|
22
|
+
|
|
23
|
+
Building offline-first sync is notoriously difficult. stellar-drive handles the complexity so you can focus on your product:
|
|
24
|
+
|
|
25
|
+
- **Instant UI** -- Reads always come from local IndexedDB, so your app never waits on a network roundtrip.
|
|
26
|
+
- **Resilient writes** -- Writes land in IndexedDB immediately and sync in the background. If the user goes offline mid-session, nothing is lost.
|
|
27
|
+
- **Smart conflict resolution** -- Instead of "last write wins" for everything, the engine uses a three-tier approach: field-level auto-merge, different-field merge, and same-field resolution with configurable strategies. Numeric fields like counters can merge additively across devices.
|
|
28
|
+
- **Minimal boilerplate** -- Declare your schema once. The engine auto-generates IndexedDB stores, database versioning, TypeScript interfaces, and Supabase SQL.
|
|
29
|
+
- **Bandwidth-efficient** -- 50 rapid writes are coalesced into 1 outbound operation. Column-level selects and cursor-based pulls keep egress low.
|
|
30
|
+
|
|
31
|
+
---
|
|
10
32
|
|
|
11
33
|
## Features
|
|
12
34
|
|
|
13
|
-
- **Schema-driven configuration** --
|
|
14
|
-
- **Intent-based sync operations** --
|
|
15
|
-
- **6-step operation coalescing** -- 50 rapid writes
|
|
16
|
-
- **Three-tier conflict resolution** --
|
|
17
|
-
- **Offline authentication** -- SHA-256 credential caching and offline session tokens let users sign in and work without connectivity
|
|
18
|
-
- **Single-user PIN/password auth** --
|
|
19
|
-
- **Device verification** --
|
|
20
|
-
- **Realtime subscriptions** -- Supabase Realtime WebSocket push with echo suppression and deduplication against polling
|
|
21
|
-
- **Tombstone management** --
|
|
22
|
-
- **Egress optimization** --
|
|
23
|
-
- **CRDT collaborative editing** --
|
|
24
|
-
- **Demo mode** --
|
|
25
|
-
- **Reactive stores** -- Svelte-compatible stores for sync status, auth state, network state, and remote changes
|
|
26
|
-
- **Store factories** -- `createCollectionStore` and `createDetailStore` for boilerplate-free reactive data layers
|
|
27
|
-
- **Svelte actions** -- `remoteChangeAnimation`, `trackEditing`, `triggerLocalAnimation` for declarative UI behavior
|
|
28
|
-
- **SQL generation** --
|
|
29
|
-
- **TypeScript generation** --
|
|
30
|
-
- **Migration generation** --
|
|
31
|
-
- **Diagnostics** --
|
|
32
|
-
- **Debug utilities** --
|
|
33
|
-
- **SvelteKit integration** (optional) --
|
|
34
|
-
- **PWA scaffolding CLI** -- `stellar-drive install pwa` generates a complete SvelteKit PWA project (34+ files)
|
|
35
|
+
- **Schema-driven configuration** -- Declare tables once in a simple object; the engine auto-generates Dexie stores, database versioning, TypeScript interfaces, and Supabase SQL. No manual migration files.
|
|
36
|
+
- **Intent-based sync operations** -- Operations preserve intent (`increment`, `set`, `create`, `delete`) instead of final state. This enables smarter coalescing and prevents conflicts where two users both increment the same counter.
|
|
37
|
+
- **6-step operation coalescing** -- 50 rapid writes compress into 1 outbound operation, dramatically reducing sync traffic and Supabase API calls.
|
|
38
|
+
- **Three-tier conflict resolution** -- Field-level auto-merge for non-overlapping changes, different-field merge, and same-field resolution (`local_pending` > `delete_wins` > `last_write_wins` with device ID tiebreaker). No data silently lost.
|
|
39
|
+
- **Offline authentication** -- SHA-256 credential caching and offline session tokens let users sign in and work without connectivity. Sessions reconcile automatically on reconnect.
|
|
40
|
+
- **Single-user PIN/password auth** -- Simplified gate backed by real Supabase email/password auth. PIN is padded to meet minimum length and verified server-side.
|
|
41
|
+
- **Device verification** -- Email OTP for untrusted devices with configurable trust duration. Prevents unauthorized access from unknown machines.
|
|
42
|
+
- **Realtime subscriptions** -- Supabase Realtime WebSocket push with echo suppression and deduplication against polling. Changes appear instantly across tabs and devices.
|
|
43
|
+
- **Tombstone management** -- Soft deletes with configurable garbage collection. Deleted records sync correctly before being permanently purged.
|
|
44
|
+
- **Egress optimization** -- Column-level selects, operation coalescing, push-only mode when realtime is healthy, and cursor-based pulls minimize bandwidth.
|
|
45
|
+
- **CRDT collaborative editing** -- Optional Yjs-based subsystem for real-time multi-user editing via Supabase Broadcast. Zero database writes per keystroke.
|
|
46
|
+
- **Demo mode** -- Sandboxed database, zero Supabase connections, mock auth. Ship instant onboarding experiences without backend setup.
|
|
47
|
+
- **Reactive stores** -- Svelte-compatible stores for sync status, auth state, network state, and remote changes. Works with Svelte 5 runes.
|
|
48
|
+
- **Store factories** -- `createCollectionStore` and `createDetailStore` for boilerplate-free reactive data layers with auto-refresh on sync.
|
|
49
|
+
- **Svelte actions** -- `remoteChangeAnimation`, `trackEditing`, `triggerLocalAnimation` for declarative UI behavior tied to sync events.
|
|
50
|
+
- **SQL generation** -- Auto-generate `CREATE TABLE` statements, RLS policies, and migrations from your schema config.
|
|
51
|
+
- **TypeScript generation** -- Auto-generate interfaces from schema field definitions.
|
|
52
|
+
- **Migration generation** -- Auto-generate `ALTER TABLE` rename and column rename SQL from `renamedFrom` / `renamedColumns` hints.
|
|
53
|
+
- **Diagnostics** -- Comprehensive runtime diagnostics covering sync, queue, realtime, conflicts, egress, and network state.
|
|
54
|
+
- **Debug utilities** -- Opt-in debug logging and `window` debug utilities for browser console inspection during development.
|
|
55
|
+
- **SvelteKit integration** (optional) -- Layout helpers, server handlers, email confirmation, service worker lifecycle, and auth hydration.
|
|
56
|
+
- **PWA scaffolding CLI** -- `stellar-drive install pwa` generates a complete SvelteKit PWA project (34+ files) with an interactive walkthrough.
|
|
35
57
|
|
|
36
58
|
### Use cases
|
|
37
59
|
|
|
@@ -43,24 +65,29 @@ A plug-and-play, offline-first sync engine for **Supabase + Dexie.js** applicati
|
|
|
43
65
|
- Knowledge bases and note-taking apps
|
|
44
66
|
- Any app needing offline-first multi-device sync
|
|
45
67
|
|
|
68
|
+
---
|
|
69
|
+
|
|
46
70
|
## Quick start
|
|
47
71
|
|
|
48
|
-
|
|
49
|
-
// ─── Install ───────────────────────────────────────────────────────
|
|
50
|
-
// npm install stellar-drive
|
|
72
|
+
### Installation
|
|
51
73
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
74
|
+
```bash
|
|
75
|
+
npm install stellar-drive
|
|
76
|
+
```
|
|
55
77
|
|
|
78
|
+
### 1. Initialize the engine
|
|
79
|
+
|
|
80
|
+
Call once at app startup (e.g., root layout or main entry point). The schema-driven approach lets you declare tables once -- the engine handles IndexedDB setup, database versioning, and Supabase table mapping.
|
|
81
|
+
|
|
82
|
+
```ts
|
|
56
83
|
import { initEngine, startSyncEngine, getDb, resetDatabase } from 'stellar-drive';
|
|
57
84
|
import { initConfig } from 'stellar-drive/config';
|
|
58
85
|
import { resolveAuthState } from 'stellar-drive/auth';
|
|
59
86
|
|
|
60
87
|
initEngine({
|
|
61
|
-
prefix: 'myapp', //
|
|
62
|
-
name: 'My App', // Human-readable
|
|
63
|
-
domain: window.location.origin, // Production domain
|
|
88
|
+
prefix: 'myapp', // Prefixes Supabase table names (e.g., goals -> myapp_goals)
|
|
89
|
+
name: 'My App', // Human-readable name for email templates
|
|
90
|
+
domain: window.location.origin, // Production domain for email confirmation links
|
|
64
91
|
|
|
65
92
|
// Schema-driven: declare tables once, engine handles the rest.
|
|
66
93
|
// System indexes (id, user_id, created_at, updated_at, deleted, _version)
|
|
@@ -77,7 +104,6 @@ initEngine({
|
|
|
77
104
|
},
|
|
78
105
|
|
|
79
106
|
// Auth: flat format with sensible defaults (all fields optional).
|
|
80
|
-
// No nested `singleUser` key needed -- engine normalizes internally.
|
|
81
107
|
auth: {
|
|
82
108
|
gateType: 'code', // 'code' | 'password' (default: 'code')
|
|
83
109
|
codeLength: 6, // 4 | 6 (default: 6)
|
|
@@ -105,11 +131,13 @@ initEngine({
|
|
|
105
131
|
syncIntervalMs: 900000, // Default: 900000 (15 min)
|
|
106
132
|
tombstoneMaxAgeDays: 7, // Default: 7
|
|
107
133
|
});
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### 2. Resolve auth and start the engine
|
|
108
137
|
|
|
109
|
-
|
|
110
|
-
// The engine fetches runtime config (Supabase URL + publishable key) from
|
|
111
|
-
// your /api/config endpoint -- no need to pass a supabase client.
|
|
138
|
+
The engine fetches runtime config (Supabase URL + publishable key) from your `/api/config` endpoint -- no need to pass a Supabase client directly.
|
|
112
139
|
|
|
140
|
+
```ts
|
|
113
141
|
await initConfig();
|
|
114
142
|
const auth = await resolveAuthState();
|
|
115
143
|
|
|
@@ -121,9 +149,11 @@ if (auth.authMode === 'none') {
|
|
|
121
149
|
// Authenticated -- start syncing
|
|
122
150
|
await startSyncEngine();
|
|
123
151
|
}
|
|
152
|
+
```
|
|
124
153
|
|
|
125
|
-
|
|
154
|
+
### 3. CRUD operations
|
|
126
155
|
|
|
156
|
+
```ts
|
|
127
157
|
import {
|
|
128
158
|
engineCreate,
|
|
129
159
|
engineUpdate,
|
|
@@ -166,40 +196,48 @@ const projects = await queryAll('projects');
|
|
|
166
196
|
// Query a single row
|
|
167
197
|
const project = await queryOne('projects', projectId);
|
|
168
198
|
|
|
169
|
-
// Get or create (
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
199
|
+
// Get or create (lookup by indexed field, create with defaults if missing)
|
|
200
|
+
const settings = await engineGetOrCreate(
|
|
201
|
+
'focus_settings', // table
|
|
202
|
+
'user_id', // index to query by
|
|
203
|
+
currentUserId, // value to match
|
|
204
|
+
{ // defaults if creating
|
|
205
|
+
theme: 'dark',
|
|
206
|
+
notifications: true,
|
|
207
|
+
focus_duration: 25,
|
|
208
|
+
},
|
|
209
|
+
{ checkRemote: true } // optional: also check Supabase before creating
|
|
210
|
+
);
|
|
178
211
|
|
|
179
|
-
// Batch writes (multiple operations in one
|
|
212
|
+
// Batch writes (multiple operations in one atomic transaction)
|
|
180
213
|
await engineBatchWrite([
|
|
181
214
|
{ type: 'create', table: 'tasks', data: { id: generateId(), title: 'Task 1', project_id: projectId, order: 1, created_at: now(), updated_at: now(), deleted: false, user_id: 'uid' } },
|
|
182
215
|
{ type: 'create', table: 'tasks', data: { id: generateId(), title: 'Task 2', project_id: projectId, order: 2, created_at: now(), updated_at: now(), deleted: false, user_id: 'uid' } },
|
|
183
|
-
{ type: 'update', table: 'projects', id: projectId,
|
|
216
|
+
{ type: 'update', table: 'projects', id: projectId, fields: { updated_at: now() } },
|
|
184
217
|
]);
|
|
218
|
+
```
|
|
185
219
|
|
|
186
|
-
|
|
220
|
+
### 4. Reactive store factories
|
|
187
221
|
|
|
188
|
-
|
|
222
|
+
```ts
|
|
223
|
+
import { createCollectionStore, createDetailStore, queryAll, queryOne } from 'stellar-drive';
|
|
189
224
|
|
|
190
|
-
// Collection store -- live-updating list from IndexedDB
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
sort: (a, b) => a.order - b.order,
|
|
225
|
+
// Collection store -- live-updating list from IndexedDB with auto-refresh on sync
|
|
226
|
+
const tasksStore = createCollectionStore<Task>({
|
|
227
|
+
load: () => queryAll<Task>('tasks'),
|
|
194
228
|
});
|
|
195
|
-
//
|
|
229
|
+
// Usage: await tasksStore.load(); then subscribe for reactive updates.
|
|
196
230
|
|
|
197
|
-
// Detail store -- single record by ID
|
|
198
|
-
const
|
|
199
|
-
|
|
231
|
+
// Detail store -- single record by ID with auto-refresh on sync
|
|
232
|
+
const taskDetailStore = createDetailStore<Task>({
|
|
233
|
+
load: (id) => queryOne<Task>('tasks', id),
|
|
234
|
+
});
|
|
235
|
+
// Usage: await taskDetailStore.load('task-123');
|
|
236
|
+
```
|
|
200
237
|
|
|
201
|
-
|
|
238
|
+
### 5. Reactive stores
|
|
202
239
|
|
|
240
|
+
```ts
|
|
203
241
|
import {
|
|
204
242
|
syncStatusStore,
|
|
205
243
|
authState,
|
|
@@ -217,9 +255,11 @@ import {
|
|
|
217
255
|
onSyncComplete(() => {
|
|
218
256
|
console.log('Sync cycle finished');
|
|
219
257
|
});
|
|
258
|
+
```
|
|
220
259
|
|
|
221
|
-
|
|
260
|
+
### 6. Svelte actions
|
|
222
261
|
|
|
262
|
+
```ts
|
|
223
263
|
import { remoteChangeAnimation, trackEditing } from 'stellar-drive/actions';
|
|
224
264
|
|
|
225
265
|
// use:remoteChangeAnimation={{ table: 'tasks', id: task.id }}
|
|
@@ -227,9 +267,11 @@ import { remoteChangeAnimation, trackEditing } from 'stellar-drive/actions';
|
|
|
227
267
|
|
|
228
268
|
// use:trackEditing={{ table: 'tasks', id: task.id }}
|
|
229
269
|
// Signals the engine a field is being actively edited (suppresses incoming overwrites).
|
|
270
|
+
```
|
|
230
271
|
|
|
231
|
-
|
|
272
|
+
### 7. CRDT collaborative editing
|
|
232
273
|
|
|
274
|
+
```ts
|
|
233
275
|
import {
|
|
234
276
|
openDocument,
|
|
235
277
|
closeDocument,
|
|
@@ -259,9 +301,11 @@ const unsub = onCollaboratorsChange('doc-1', (collaborators) => {
|
|
|
259
301
|
});
|
|
260
302
|
|
|
261
303
|
await closeDocument('doc-1');
|
|
304
|
+
```
|
|
262
305
|
|
|
263
|
-
|
|
306
|
+
### 8. Demo mode
|
|
264
307
|
|
|
308
|
+
```ts
|
|
265
309
|
import { setDemoMode, isDemoMode } from 'stellar-drive';
|
|
266
310
|
|
|
267
311
|
// Check if demo mode is active
|
|
@@ -276,23 +320,26 @@ if (isDemoMode()) {
|
|
|
276
320
|
// Toggle demo mode from your UI (requires full page reload)
|
|
277
321
|
setDemoMode(true);
|
|
278
322
|
window.location.href = '/';
|
|
323
|
+
```
|
|
279
324
|
|
|
280
|
-
|
|
325
|
+
### 9. SQL and TypeScript generation
|
|
281
326
|
|
|
327
|
+
```ts
|
|
282
328
|
import { generateSupabaseSQL, generateTypeScript } from 'stellar-drive/utils';
|
|
283
329
|
import { getEngineConfig } from 'stellar-drive';
|
|
284
330
|
|
|
285
331
|
const config = getEngineConfig();
|
|
286
332
|
|
|
287
333
|
// Auto-generate Supabase SQL (CREATE TABLE + RLS policies) from schema
|
|
288
|
-
// Pass prefix to generate prefixed table names (e.g., myapp_goals)
|
|
289
334
|
const sql = generateSupabaseSQL(config.schema!, { prefix: config.prefix });
|
|
290
335
|
|
|
291
336
|
// Auto-generate TypeScript interfaces from schema
|
|
292
337
|
const ts = generateTypeScript(config.schema!);
|
|
338
|
+
```
|
|
293
339
|
|
|
294
|
-
|
|
340
|
+
### 10. Diagnostics and debug
|
|
295
341
|
|
|
342
|
+
```ts
|
|
296
343
|
import { setDebugMode, isDebugMode } from 'stellar-drive/utils';
|
|
297
344
|
import { getDiagnostics } from 'stellar-drive';
|
|
298
345
|
|
|
@@ -312,13 +359,17 @@ const diagnostics = await getDiagnostics();
|
|
|
312
359
|
// window.__myappSync.forceFullSync()
|
|
313
360
|
```
|
|
314
361
|
|
|
362
|
+
---
|
|
363
|
+
|
|
315
364
|
## Environment variables
|
|
316
365
|
|
|
317
|
-
| Variable |
|
|
366
|
+
| Variable | When needed | Description |
|
|
318
367
|
|---|---|---|
|
|
319
|
-
| `PUBLIC_SUPABASE_URL` |
|
|
320
|
-
| `PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY` |
|
|
321
|
-
| `DATABASE_URL` |
|
|
368
|
+
| `PUBLIC_SUPABASE_URL` | Always | Your Supabase project URL. Find it at: Dashboard > Settings > API > Project URL. |
|
|
369
|
+
| `PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY` | Always | Your Supabase publishable (anon) key. Find it at: Dashboard > Settings > API > Project API keys > publishable. |
|
|
370
|
+
| `DATABASE_URL` | Only for auto-migration | Postgres connection string for the Vite plugin to push schema migrations directly to Postgres. If not set, migrations are skipped (types are still generated). Find it at: Dashboard > Settings > Database > Connection string (URI). |
|
|
371
|
+
|
|
372
|
+
---
|
|
322
373
|
|
|
323
374
|
## Schema workflow
|
|
324
375
|
|
|
@@ -346,7 +397,8 @@ export default defineConfig({
|
|
|
346
397
|
|
|
347
398
|
In **dev mode**, the plugin watches `src/lib/schema.ts` and reprocesses on save (500ms debounce). In **build mode**, schema is processed once during `buildStart`.
|
|
348
399
|
|
|
349
|
-
Each processing cycle
|
|
400
|
+
**Each processing cycle:**
|
|
401
|
+
|
|
350
402
|
1. Generates TypeScript interfaces from schema field definitions
|
|
351
403
|
2. Loads the previous schema snapshot from `.stellar/schema-snapshot.json`
|
|
352
404
|
3. Diffs old vs new schema to produce `ALTER TABLE` migration SQL
|
|
@@ -361,17 +413,17 @@ If `DATABASE_URL` is not set, types are still generated but migration push is sk
|
|
|
361
413
|
|
|
362
414
|
The schema migration runs automatically during every `vite build`. To enable it in CI/CD:
|
|
363
415
|
|
|
364
|
-
1
|
|
416
|
+
**Step 1: Set environment variables** in your Vercel project settings (Settings > Environment Variables):
|
|
365
417
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
418
|
+
| Variable | Type | Required |
|
|
419
|
+
|---|---|---|
|
|
420
|
+
| `PUBLIC_SUPABASE_URL` | Plain | Yes -- client auth + data access |
|
|
421
|
+
| `PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY` | Plain | Yes -- client auth + data access |
|
|
422
|
+
| `DATABASE_URL` | Secret | Yes -- auto-migration during build |
|
|
371
423
|
|
|
372
|
-
2
|
|
424
|
+
**Step 2: Commit `.stellar/schema-snapshot.json`** to git. This file tracks the last-known schema state. Without it, every build is treated as a first run (full idempotent SQL). The snapshot is updated locally when you run `dev` or `build` and should be committed alongside schema changes.
|
|
373
425
|
|
|
374
|
-
3
|
|
426
|
+
**Step 3: Install the `postgres` npm package** -- `npm install postgres`. This is the Postgres client used by the Vite plugin for direct SQL execution.
|
|
375
427
|
|
|
376
428
|
**How it works on each deploy:**
|
|
377
429
|
- The Vite plugin's `buildStart` hook loads your schema, diffs against the committed snapshot, and pushes only the changes (ALTER TABLE statements) directly to Postgres.
|
|
@@ -382,6 +434,8 @@ The schema migration runs automatically during every `vite build`. To enable it
|
|
|
382
434
|
|
|
383
435
|
See [API Reference -- Vite Plugin](./API_REFERENCE.md#vite-plugin-stellarpwa) for full configuration options.
|
|
384
436
|
|
|
437
|
+
---
|
|
438
|
+
|
|
385
439
|
## Commands
|
|
386
440
|
|
|
387
441
|
### Install PWA
|
|
@@ -412,236 +466,48 @@ Generates **34+ files** for a production-ready SvelteKit 2 + Svelte 5 project:
|
|
|
412
466
|
- **Library (1):** `src/lib/types.ts` with re-exports and app-specific type stubs
|
|
413
467
|
- **Git hooks (1):** `.husky/pre-commit` with lint + format + validate
|
|
414
468
|
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
### Engine Configuration and Lifecycle
|
|
418
|
-
|
|
419
|
-
| Export | Description |
|
|
420
|
-
|---|---|
|
|
421
|
-
| `initEngine(config)` | Initialize the engine with schema, auth, and optional CRDT/demo config |
|
|
422
|
-
| `startSyncEngine()` | Start the sync loop, realtime subscriptions, and event listeners |
|
|
423
|
-
| `stopSyncEngine()` | Tear down sync loop and subscriptions cleanly |
|
|
424
|
-
| `runFullSync()` | Run a complete pull-then-push cycle |
|
|
425
|
-
| `scheduleSyncPush()` | Trigger a debounced push of pending operations |
|
|
426
|
-
| `getEngineConfig()` | Retrieve the current engine config (throws if not initialized) |
|
|
427
|
-
| `validateSupabaseCredentials()` | Verify Supabase URL and publishable key are valid |
|
|
428
|
-
| `validateSchema()` | Validate all configured tables exist in Supabase |
|
|
429
|
-
|
|
430
|
-
### Database
|
|
431
|
-
|
|
432
|
-
| Export | Description |
|
|
433
|
-
|---|---|
|
|
434
|
-
| `getDb()` | Get the Dexie database instance |
|
|
435
|
-
| `resetDatabase()` | Drop and recreate the local IndexedDB database |
|
|
436
|
-
| `clearLocalCache()` | Wipe all local application data |
|
|
437
|
-
| `clearPendingSyncQueue()` | Drop all pending outbound operations |
|
|
438
|
-
| `getSupabaseAsync()` | Async getter that waits for Supabase client initialization |
|
|
439
|
-
| `resetSupabaseClient()` | Tear down and reinitialize the Supabase client |
|
|
440
|
-
|
|
441
|
-
### CRUD and Query Operations
|
|
442
|
-
|
|
443
|
-
| Export | Description |
|
|
444
|
-
|---|---|
|
|
445
|
-
| `engineCreate(table, data)` | Create a record locally and enqueue sync |
|
|
446
|
-
| `engineUpdate(table, id, data)` | Update specific fields locally and enqueue sync |
|
|
447
|
-
| `engineDelete(table, id)` | Soft-delete a record (tombstone) |
|
|
448
|
-
| `engineIncrement(table, id, field, delta)` | Intent-preserving numeric increment |
|
|
449
|
-
| `engineBatchWrite(operations)` | Execute multiple operations in a single sync push |
|
|
450
|
-
| `engineGetOrCreate(table, id, defaults)` | Atomic get-or-create (upsert) |
|
|
451
|
-
| `queryAll(table, options?)` | Query all rows from local IndexedDB |
|
|
452
|
-
| `queryOne(table, id)` | Query a single row by ID |
|
|
453
|
-
| `markEntityModified(table, id)` | Suppress incoming realtime overwrites for a recently modified entity |
|
|
454
|
-
|
|
455
|
-
### Authentication -- Core
|
|
456
|
-
|
|
457
|
-
| Export | Description |
|
|
458
|
-
|---|---|
|
|
459
|
-
| `resolveAuthState()` | Determine current auth state (online, offline, or none) |
|
|
460
|
-
| `signOut()` | Full teardown: stop sync, clear caches, sign out of Supabase |
|
|
461
|
-
| `getValidSession()` | Get a non-expired Supabase session, or `null` |
|
|
462
|
-
| `verifyOtp(tokenHash)` | Verify OTP token hash from email confirmation links |
|
|
463
|
-
| `resendConfirmationEmail()` | Resend signup confirmation email |
|
|
464
|
-
| `getUserProfile()` | Read profile from Supabase user metadata |
|
|
465
|
-
| `updateProfile(data)` | Write profile to Supabase user metadata |
|
|
466
|
-
|
|
467
|
-
### Authentication -- Single-User
|
|
468
|
-
|
|
469
|
-
| Export | Description |
|
|
470
|
-
|---|---|
|
|
471
|
-
| `setupSingleUser(gate, profile, email)` | First-time setup: create gate, Supabase user, and store config |
|
|
472
|
-
| `unlockSingleUser(gate)` | Verify gate and restore session (online or offline) |
|
|
473
|
-
| `lockSingleUser()` | Stop sync and reset auth state without destroying data |
|
|
474
|
-
| `isSingleUserSetUp()` | Check if initial setup is complete |
|
|
475
|
-
| `getSingleUserInfo()` | Get display info (profile, gate type) for the unlock screen |
|
|
476
|
-
| `changeSingleUserGate(oldGate, newGate)` | Change PIN code or password |
|
|
477
|
-
| `updateSingleUserProfile(profile)` | Update profile in IndexedDB and Supabase metadata |
|
|
478
|
-
| `changeSingleUserEmail(newEmail)` | Request email change |
|
|
479
|
-
| `completeSingleUserEmailChange()` | Finalize email change after confirmation |
|
|
480
|
-
| `resetSingleUser()` | Full reset: clear config, sign out, wipe local data |
|
|
481
|
-
| `padPin(pin)` | Pad a PIN to meet Supabase's minimum password length (uses fixed `_app` suffix — same PIN produces same password across all apps on one Supabase project) |
|
|
482
|
-
| `padPinLegacy(pin, prefix)` | Reproduce the pre-migration padded format (per-app prefix suffix); used internally for transparent password migration |
|
|
483
|
-
|
|
484
|
-
### Authentication -- Device Verification
|
|
485
|
-
|
|
486
|
-
| Export | Description |
|
|
487
|
-
|---|---|
|
|
488
|
-
| `completeDeviceVerification(tokenHash?)` | Complete device OTP verification |
|
|
489
|
-
| `sendDeviceVerification()` | Send device verification email |
|
|
490
|
-
| `pollDeviceVerification()` | Poll for device verification completion |
|
|
491
|
-
| `linkSingleUserDevice()` | Link current device to user after verification |
|
|
492
|
-
| `getTrustedDevices()` | List all trusted devices for current user |
|
|
493
|
-
| `removeTrustedDevice(deviceId)` | Remove a trusted device |
|
|
494
|
-
| `getCurrentDeviceId()` | Get the stable device identifier |
|
|
495
|
-
| `fetchRemoteGateConfig()` | Fetch gate config from Supabase for cross-device setup |
|
|
496
|
-
|
|
497
|
-
### Authentication -- Display Utilities
|
|
498
|
-
|
|
499
|
-
| Export | Description |
|
|
500
|
-
|---|---|
|
|
501
|
-
| `resolveFirstName(session, offline, fallback?)` | Resolve display name from session or offline profile |
|
|
502
|
-
| `resolveUserId(session, offline)` | Extract user UUID from session or offline credentials |
|
|
503
|
-
| `resolveAvatarInitial(session, offline, fallback?)` | Single uppercase initial for avatar display |
|
|
504
|
-
|
|
505
|
-
### Reactive Stores
|
|
506
|
-
|
|
507
|
-
| Export | Description |
|
|
508
|
-
|---|---|
|
|
509
|
-
| `syncStatusStore` | Current `SyncStatus`, last sync time, and errors |
|
|
510
|
-
| `authState` | Reactive auth state object (`mode`, `session`, `offlineProfile`, `isLoading`) |
|
|
511
|
-
| `isAuthenticated` | Derived boolean for auth status |
|
|
512
|
-
| `userDisplayInfo` | Derived display name and avatar info |
|
|
513
|
-
| `isOnline` | Reactive boolean reflecting network state |
|
|
514
|
-
| `remoteChangesStore` | Tracks entities recently changed by remote peers |
|
|
515
|
-
| `createRecentChangeIndicator(table, id)` | Derived indicator for UI highlighting of remote changes |
|
|
516
|
-
| `createPendingDeleteIndicator(table, id)` | Derived indicator for entities awaiting delete confirmation |
|
|
517
|
-
| `onSyncComplete(callback)` | Register a callback invoked after each successful sync cycle |
|
|
518
|
-
| `onRealtimeDataUpdate(callback)` | Register a handler for incoming realtime changes |
|
|
519
|
-
|
|
520
|
-
### Store Factories
|
|
521
|
-
|
|
522
|
-
| Export | Description |
|
|
523
|
-
|---|---|
|
|
524
|
-
| `createCollectionStore(table, options?)` | Live-updating list store from IndexedDB with filter and sort |
|
|
525
|
-
| `createDetailStore(table, id)` | Single-record store by ID |
|
|
526
|
-
|
|
527
|
-
### Realtime
|
|
528
|
-
|
|
529
|
-
| Export | Description |
|
|
530
|
-
|---|---|
|
|
531
|
-
| `startRealtimeSubscriptions()` | Start Supabase Realtime channels for all configured tables |
|
|
532
|
-
| `stopRealtimeSubscriptions()` | Stop all Realtime channels |
|
|
533
|
-
| `isRealtimeHealthy()` | Realtime connection health check |
|
|
534
|
-
| `wasRecentlyProcessedByRealtime(table, id)` | Guard against duplicate processing |
|
|
535
|
-
|
|
536
|
-
### Runtime Config
|
|
537
|
-
|
|
538
|
-
| Export | Description |
|
|
539
|
-
|---|---|
|
|
540
|
-
| `initConfig()` | Initialize runtime configuration (fetches Supabase credentials from `/api/config`) |
|
|
541
|
-
| `getConfig()` | Get current config |
|
|
542
|
-
| `setConfig(config)` | Update runtime config |
|
|
543
|
-
| `waitForConfig()` | Async getter that waits for config initialization |
|
|
544
|
-
| `isConfigured()` | Check if config is initialized |
|
|
545
|
-
| `clearConfigCache()` | Clear cached config |
|
|
546
|
-
| `getDexieTableFor(supabaseName)` | Get the Dexie table name for a Supabase table name |
|
|
547
|
-
|
|
548
|
-
### Diagnostics and Debug
|
|
549
|
-
|
|
550
|
-
| Export | Description |
|
|
551
|
-
|---|---|
|
|
552
|
-
| `getDiagnostics()` | Comprehensive runtime diagnostics (sync, queue, realtime, conflict, egress, network) |
|
|
553
|
-
| `setDebugMode(enabled)` | Enable/disable debug logging |
|
|
554
|
-
| `isDebugMode()` | Check if debug mode is active |
|
|
555
|
-
| `debugLog` / `debugWarn` / `debugError` | Prefixed console helpers (gated by debug mode) |
|
|
556
|
-
|
|
557
|
-
When debug mode is enabled, the engine exposes utilities on `window` using your configured prefix (e.g., `window.__myappSyncStats()`, `window.__myappEgress()`, `window.__myappTombstones()`, `window.__myappSync.forceFullSync()`).
|
|
558
|
-
|
|
559
|
-
### Utilities
|
|
469
|
+
---
|
|
560
470
|
|
|
561
|
-
|
|
562
|
-
|---|---|
|
|
563
|
-
| `generateId()` | Generate a UUID |
|
|
564
|
-
| `now()` | Current ISO timestamp string |
|
|
565
|
-
| `calculateNewOrder(before, after)` | Fractional ordering helper for drag-and-drop reorder |
|
|
566
|
-
| `snakeToCamel(str)` | Convert `snake_case` to `camelCase` |
|
|
567
|
-
| `getDeviceId()` | Stable per-device identifier (persisted in localStorage) |
|
|
568
|
-
|
|
569
|
-
### SQL and TypeScript Generation
|
|
570
|
-
|
|
571
|
-
| Export | Description |
|
|
572
|
-
|---|---|
|
|
573
|
-
| `generateSupabaseSQL(schema, options?)` | Generate `CREATE TABLE` statements and RLS policies from schema (accepts `prefix` to prefix table names) |
|
|
574
|
-
| `generateTypeScript(schema)` | Generate TypeScript interfaces from schema |
|
|
575
|
-
| `generateMigrationSQL(oldSchema, newSchema)` | Generate `ALTER TABLE` migration SQL for schema changes |
|
|
471
|
+
## API overview
|
|
576
472
|
|
|
577
|
-
|
|
473
|
+
The full API is documented in the [API Reference](./API_REFERENCE.md). Below is a summary of what is available in each subpath export.
|
|
578
474
|
|
|
579
|
-
|
|
580
|
-
|---|---|
|
|
581
|
-
| `remoteChangeAnimation` | `use:` action that animates an element when a remote change arrives |
|
|
582
|
-
| `trackEditing` | Action that signals the engine a field is being actively edited (suppresses incoming overwrites) |
|
|
583
|
-
| `triggerLocalAnimation` | Programmatically trigger the local-change animation on a node |
|
|
584
|
-
| `truncateTooltip` | Action that shows a tooltip with full text when content is truncated |
|
|
475
|
+
### Subpath exports
|
|
585
476
|
|
|
586
|
-
|
|
477
|
+
Import only what you need:
|
|
587
478
|
|
|
588
|
-
|
|
|
479
|
+
| Subpath | Contents |
|
|
589
480
|
|---|---|
|
|
590
|
-
| `stellar-drive
|
|
591
|
-
| `stellar-drive/
|
|
592
|
-
| `stellar-drive/
|
|
593
|
-
|
|
594
|
-
|
|
481
|
+
| `stellar-drive` | Everything below, re-exported from one barrel import |
|
|
482
|
+
| `stellar-drive/data` | CRUD operations (`engineCreate`, `engineUpdate`, `engineDelete`, `engineIncrement`, `engineBatchWrite`), queries (`queryAll`, `queryOne`, `engineGet`, `engineGetOrCreate`), reorder helpers |
|
|
483
|
+
| `stellar-drive/auth` | All auth functions: Supabase auth core, single-user PIN/password gate, device verification, display utilities |
|
|
484
|
+
| `stellar-drive/stores` | Reactive stores (`syncStatusStore`, `authState`, `isOnline`, `remoteChangesStore`), store factories (`createCollectionStore`, `createDetailStore`), event hooks (`onSyncComplete`, `onRealtimeDataUpdate`) |
|
|
485
|
+
| `stellar-drive/types` | All TypeScript type definitions (zero runtime code) |
|
|
486
|
+
| `stellar-drive/utils` | Utilities (`generateId`, `now`, `calculateNewOrder`), debug helpers, diagnostics, SQL/TypeScript generation |
|
|
487
|
+
| `stellar-drive/actions` | Svelte `use:` actions (`remoteChangeAnimation`, `trackEditing`, `triggerLocalAnimation`, `truncateTooltip`) |
|
|
488
|
+
| `stellar-drive/config` | Runtime config management (`initConfig`, `getConfig`, `setConfig`, `getDexieTableFor`) |
|
|
489
|
+
| `stellar-drive/vite` | Vite plugin (`stellarPWA`) for service worker builds, asset manifests, and schema auto-generation |
|
|
490
|
+
| `stellar-drive/kit` | SvelteKit helpers: server route factories, layout loaders, email confirmation, SW lifecycle, auth hydration |
|
|
491
|
+
| `stellar-drive/crdt` | CRDT collaborative editing: document lifecycle, shared types, presence/cursors, offline persistence |
|
|
492
|
+
| `stellar-drive/components/*` | Svelte components: `SyncStatus`, `DeferredChangesBanner`, `DemoBanner` |
|
|
595
493
|
|
|
596
|
-
|
|
494
|
+
### Key categories at a glance
|
|
597
495
|
|
|
598
|
-
|
|
599
|
-
|---|---|
|
|
600
|
-
| Layout load functions | `resolveAuthState` integration for `+layout.ts` |
|
|
601
|
-
| Server handlers | Factory functions for API routes (`getServerConfig`, `createServerSupabaseClient(prefix?)`, `createValidateHandler`, `deployToVercel`) |
|
|
602
|
-
| Email confirmation | `handleEmailConfirmation()`, `broadcastAuthConfirmed()` |
|
|
603
|
-
| SW lifecycle | `monitorSwLifecycle()`, `handleSwUpdate()`, `pollForNewServiceWorker()` |
|
|
604
|
-
| Auth hydration | `hydrateAuthState()` for `+layout.svelte` |
|
|
496
|
+
**Engine lifecycle:** `initEngine`, `startSyncEngine`, `stopSyncEngine`, `runFullSync`, `scheduleSyncPush`, `getEngineConfig`, `validateSupabaseCredentials`, `validateSchema`
|
|
605
497
|
|
|
606
|
-
|
|
498
|
+
**Database:** `getDb`, `resetDatabase`, `clearLocalCache`, `clearPendingSyncQueue`, `getSupabaseAsync`, `resetSupabaseClient`
|
|
607
499
|
|
|
608
|
-
|
|
609
|
-
|---|---|
|
|
610
|
-
| `openDocument(docId, pageId, options?)` | Open a collaborative document via Supabase Broadcast |
|
|
611
|
-
| `closeDocument(docId)` | Close and clean up a document |
|
|
612
|
-
| `createSharedText(doc)` | Create a shared Yjs text type |
|
|
613
|
-
| `createBlockDocument(doc)` | Create a block-based document structure |
|
|
614
|
-
| `updateCursor(docId, cursor)` | Update cursor position for presence |
|
|
615
|
-
| `getCollaborators(docId)` | Get current collaborators |
|
|
616
|
-
| `onCollaboratorsChange(docId, callback)` | Subscribe to collaborator changes |
|
|
617
|
-
| `enableOffline(docId)` / `disableOffline(docId)` | Toggle offline persistence |
|
|
500
|
+
**CRUD and queries:** `engineCreate`, `engineUpdate`, `engineDelete`, `engineIncrement`, `engineBatchWrite`, `engineGetOrCreate`, `queryAll`, `queryOne`, `engineGet`, `markEntityModified`
|
|
618
501
|
|
|
619
|
-
|
|
502
|
+
**Authentication:** `resolveAuthState`, `signOut`, `getValidSession`, `setupSingleUser`, `unlockSingleUser`, `lockSingleUser`, `resetSingleUser`, device verification functions, display helpers (`resolveFirstName`, `resolveUserId`, `resolveAvatarInitial`)
|
|
620
503
|
|
|
621
|
-
|
|
504
|
+
**Reactive stores:** `syncStatusStore`, `authState`, `isAuthenticated`, `userDisplayInfo`, `isOnline`, `remoteChangesStore`, `createCollectionStore`, `createDetailStore`, `onSyncComplete`, `onRealtimeDataUpdate`
|
|
622
505
|
|
|
623
|
-
|
|
506
|
+
**Utilities:** `generateId`, `now`, `calculateNewOrder`, `setDebugMode`, `getDiagnostics`, `generateSupabaseSQL`, `generateTypeScript`, `generateMigrationSQL`
|
|
624
507
|
|
|
625
|
-
|
|
508
|
+
For full signatures, parameters, return types, and usage examples, see the [API Reference](./API_REFERENCE.md).
|
|
626
509
|
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
| Subpath | Contents |
|
|
630
|
-
|---|---|
|
|
631
|
-
| `stellar-drive` | Core: `initEngine`, `startSyncEngine`, `runFullSync`, `getDb`, `resetDatabase`, `getDiagnostics`, CRUD, auth, stores, and all re-exports |
|
|
632
|
-
| `stellar-drive/data` | CRUD + query operations + helpers |
|
|
633
|
-
| `stellar-drive/auth` | All auth functions |
|
|
634
|
-
| `stellar-drive/stores` | Reactive stores + store factories + event subscriptions |
|
|
635
|
-
| `stellar-drive/types` | All type exports |
|
|
636
|
-
| `stellar-drive/utils` | Utilities + debug + diagnostics + SQL/TS generation |
|
|
637
|
-
| `stellar-drive/actions` | Svelte `use:` actions |
|
|
638
|
-
| `stellar-drive/config` | Runtime config + `getDexieTableFor` |
|
|
639
|
-
| `stellar-drive/vite` | Vite plugin |
|
|
640
|
-
| `stellar-drive/kit` | SvelteKit helpers (optional) |
|
|
641
|
-
| `stellar-drive/crdt` | CRDT collaborative editing |
|
|
642
|
-
| `stellar-drive/components/SyncStatus` | Sync indicator component |
|
|
643
|
-
| `stellar-drive/components/DeferredChangesBanner` | Conflict banner component |
|
|
644
|
-
| `stellar-drive/components/DemoBanner` | Demo mode banner component |
|
|
510
|
+
---
|
|
645
511
|
|
|
646
512
|
## Demo mode
|
|
647
513
|
|
|
@@ -674,17 +540,19 @@ setDemoMode(true);
|
|
|
674
540
|
window.location.href = '/'; // Full reload required
|
|
675
541
|
```
|
|
676
542
|
|
|
543
|
+
---
|
|
544
|
+
|
|
677
545
|
## Multi-Tenant Supabase
|
|
678
546
|
|
|
679
|
-
Multiple stellar-drive apps can share a **single Supabase instance**
|
|
547
|
+
Multiple stellar-drive apps can share a **single Supabase instance** -- same Postgres database, Auth, Realtime, and SMTP server. Each app's tables are automatically isolated via name prefixing.
|
|
680
548
|
|
|
681
549
|
### How it works
|
|
682
550
|
|
|
683
|
-
Given `prefix: 'stellar'` and schema key `goals`, the Supabase table becomes `stellar_goals`. This is automatic
|
|
551
|
+
Given `prefix: 'stellar'` and schema key `goals`, the Supabase table becomes `stellar_goals`. This is automatic -- consumers still write `goals` in their schema and API calls.
|
|
684
552
|
|
|
685
|
-
**Shared across apps (unprefixed
|
|
686
|
-
- `auth.users` (Supabase Auth)
|
|
687
|
-
- `trusted_devices`
|
|
553
|
+
**Shared across apps (unprefixed, per-app rows):**
|
|
554
|
+
- `auth.users` (Supabase Auth) -- same user account works in every app
|
|
555
|
+
- `trusted_devices` -- single table with an `app_prefix` column (default `'stellar'`). The unique constraint is `(user_id, device_id, app_prefix)`, so trusting a device in one app does not grant trust in another. All device verification queries filter by prefix automatically.
|
|
688
556
|
- `crdt_documents` (CRDT collaborative editing)
|
|
689
557
|
- Helper functions: `set_user_id()`, `update_updated_at_column()`
|
|
690
558
|
|
|
@@ -696,11 +564,11 @@ Given `prefix: 'stellar'` and schema key `goals`, the Supabase table becomes `st
|
|
|
696
564
|
- `padPin()` uses a fixed `_app` suffix, so the same email + same PIN produces the same Supabase password in every app. Users set up in one app can authenticate in another without re-registering. A `padPinLegacy()` helper handles migration from the old per-app-prefix format.
|
|
697
565
|
|
|
698
566
|
**What does NOT change:**
|
|
699
|
-
- IndexedDB (Dexie)
|
|
700
|
-
- Consumer schema files
|
|
701
|
-
- Consumer API calls
|
|
702
|
-
- Generated TypeScript types
|
|
703
|
-
- Auth flow
|
|
567
|
+
- IndexedDB (Dexie) -- already namespaced by `${prefix}DB`
|
|
568
|
+
- Consumer schema files -- still write `goals`, not `stellar_goals`
|
|
569
|
+
- Consumer API calls -- `engineCreate('goals', data)` works as before
|
|
570
|
+
- Generated TypeScript types -- still `Goal`, not `StellarGoal`
|
|
571
|
+
- Auth flow -- same Supabase Auth, same user accounts across apps
|
|
704
572
|
|
|
705
573
|
### Auto-migration
|
|
706
574
|
|
|
@@ -724,6 +592,8 @@ On managed Supabase (Free tier), no configuration changes are needed. For self-h
|
|
|
724
592
|
- Realtime `max_concurrent_users`: increase via `REALTIME_MAX_CONCURRENT_USERS` env var
|
|
725
593
|
- PostgREST pool: `PGRST_DB_POOL=50` in docker-compose
|
|
726
594
|
|
|
595
|
+
---
|
|
596
|
+
|
|
727
597
|
## License
|
|
728
598
|
|
|
729
599
|
Private -- not yet published under an open-source license.
|
package/dist/bin/install-pwa.js
CHANGED
|
@@ -80,6 +80,20 @@ export interface SchemaConfig {
|
|
|
80
80
|
* @default false
|
|
81
81
|
*/
|
|
82
82
|
includeCRDT?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Path(s) to custom `.sql` files that are appended to the generated schema
|
|
85
|
+
* SQL and executed on every build alongside it. Useful for app-specific RPC
|
|
86
|
+
* functions, views, or triggers that stellar-drive doesn't generate.
|
|
87
|
+
*
|
|
88
|
+
* Paths are resolved relative to the project root. The SQL should be
|
|
89
|
+
* idempotent (`CREATE OR REPLACE`, `IF NOT EXISTS`, etc.) since it runs
|
|
90
|
+
* on every build.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* schema: { customSQL: 'src/lib/custom.sql' }
|
|
94
|
+
* schema: { customSQL: ['src/lib/rpc.sql', 'src/lib/views.sql'] }
|
|
95
|
+
*/
|
|
96
|
+
customSQL?: string | string[];
|
|
83
97
|
}
|
|
84
98
|
/**
|
|
85
99
|
* Configuration options for the stellarPWA Vite plugin.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../../../src/sw/build/vite-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAmBH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../../../src/sw/build/vite-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAmBH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC/B;AAMD;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;CACjC;AAmXD,wBAAgB,UAAU,CAAC,MAAM,EAAE,QAAQ;;;;4BA+Hf;QACtB,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAChE,OAAO,EAAE;YAAE,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,CAAA;SAAE,CAAC;KACtE;EAiFJ"}
|
|
@@ -124,14 +124,16 @@ function resolveSchemaOpts(schema) {
|
|
|
124
124
|
path: schema.path || 'src/lib/schema.ts',
|
|
125
125
|
typesOutput: schema.typesOutput || 'src/lib/types.generated.ts',
|
|
126
126
|
autoMigrate: schema.autoMigrate !== false,
|
|
127
|
-
includeCRDT: schema.includeCRDT === true
|
|
127
|
+
includeCRDT: schema.includeCRDT === true,
|
|
128
|
+
customSQL: schema.customSQL
|
|
128
129
|
};
|
|
129
130
|
}
|
|
130
131
|
return {
|
|
131
132
|
path: 'src/lib/schema.ts',
|
|
132
133
|
typesOutput: 'src/lib/types.generated.ts',
|
|
133
134
|
autoMigrate: true,
|
|
134
|
-
includeCRDT: false
|
|
135
|
+
includeCRDT: false,
|
|
136
|
+
customSQL: undefined
|
|
135
137
|
};
|
|
136
138
|
}
|
|
137
139
|
/**
|
|
@@ -225,12 +227,34 @@ async function processLoadedSchema(schema, appName, prefix, schemaOpts, projectR
|
|
|
225
227
|
return;
|
|
226
228
|
}
|
|
227
229
|
console.log(`[stellar-drive] Syncing ${tableNames.length} tables: ${tableNames.join(', ')}`);
|
|
228
|
-
|
|
230
|
+
let fullSQL = generateSupabaseSQL(schema, {
|
|
229
231
|
appName,
|
|
230
232
|
prefix,
|
|
231
233
|
includeHelperFunctions: true,
|
|
232
234
|
includeCRDT: schemaOpts.includeCRDT
|
|
233
235
|
});
|
|
236
|
+
/* 3. Append custom SQL files (app-specific RPC functions, views, etc.). */
|
|
237
|
+
if (schemaOpts.customSQL) {
|
|
238
|
+
const sqlPaths = Array.isArray(schemaOpts.customSQL)
|
|
239
|
+
? schemaOpts.customSQL
|
|
240
|
+
: [schemaOpts.customSQL];
|
|
241
|
+
for (const sqlPath of sqlPaths) {
|
|
242
|
+
const absPath = resolve(projectRoot, sqlPath);
|
|
243
|
+
if (existsSync(absPath)) {
|
|
244
|
+
const custom = readFileSync(absPath, 'utf-8').trim();
|
|
245
|
+
if (custom) {
|
|
246
|
+
fullSQL += `\n\n-- Custom SQL: ${sqlPath}\n${custom}\n`;
|
|
247
|
+
console.log(`[stellar-drive] Appended custom SQL: ${sqlPath} (${custom.length} chars, first line: "${custom
|
|
248
|
+
.split('\n')
|
|
249
|
+
.find((l) => l.trim() && !l.trim().startsWith('--'))
|
|
250
|
+
?.trim() || ''}")`);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
console.warn(`[stellar-drive] Custom SQL file not found: ${sqlPath}`);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
234
258
|
await pushSchema(fullSQL, schemaOpts, projectRoot);
|
|
235
259
|
}
|
|
236
260
|
/**
|
|
@@ -292,6 +316,8 @@ async function pushSchema(sql, opts, root) {
|
|
|
292
316
|
};
|
|
293
317
|
const sql_client = postgres(databaseUrl, { max: 1, idle_timeout: 5, onnotice });
|
|
294
318
|
try {
|
|
319
|
+
const stmtCount = sql.split(';').filter((s) => s.trim()).length;
|
|
320
|
+
console.log(`[stellar-drive] Pushing schema (${stmtCount} statements, ${sql.length} chars)...`);
|
|
295
321
|
await sql_client.unsafe(sql);
|
|
296
322
|
console.log('[stellar-drive] \u2705 Schema pushed successfully');
|
|
297
323
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-plugin.js","sourceRoot":"","sources":["../../../src/sw/build/vite-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EACL,YAAY,EACZ,aAAa,EACb,WAAW,EACX,QAAQ,EACR,UAAU,EAC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