@hatk/hatk 0.0.1-alpha.7 → 0.0.1-alpha.70

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 (169) hide show
  1. package/dist/adapter.d.ts +19 -0
  2. package/dist/adapter.d.ts.map +1 -0
  3. package/dist/adapter.js +108 -0
  4. package/dist/backfill.d.ts +21 -2
  5. package/dist/backfill.d.ts.map +1 -1
  6. package/dist/backfill.js +116 -43
  7. package/dist/car.d.ts +42 -10
  8. package/dist/car.d.ts.map +1 -1
  9. package/dist/car.js +154 -14
  10. package/dist/cli.js +243 -1043
  11. package/dist/config.d.ts +32 -1
  12. package/dist/config.d.ts.map +1 -1
  13. package/dist/config.js +41 -9
  14. package/dist/database/adapter-factory.d.ts +6 -0
  15. package/dist/database/adapter-factory.d.ts.map +1 -0
  16. package/dist/database/adapter-factory.js +20 -0
  17. package/dist/database/adapters/duckdb-search.d.ts +12 -0
  18. package/dist/database/adapters/duckdb-search.d.ts.map +1 -0
  19. package/dist/database/adapters/duckdb-search.js +27 -0
  20. package/dist/database/adapters/duckdb.d.ts +25 -0
  21. package/dist/database/adapters/duckdb.d.ts.map +1 -0
  22. package/dist/database/adapters/duckdb.js +161 -0
  23. package/dist/database/adapters/sqlite-search.d.ts +23 -0
  24. package/dist/database/adapters/sqlite-search.d.ts.map +1 -0
  25. package/dist/database/adapters/sqlite-search.js +74 -0
  26. package/dist/database/adapters/sqlite.d.ts +18 -0
  27. package/dist/database/adapters/sqlite.d.ts.map +1 -0
  28. package/dist/database/adapters/sqlite.js +88 -0
  29. package/dist/{db.d.ts → database/db.d.ts} +57 -6
  30. package/dist/database/db.d.ts.map +1 -0
  31. package/dist/{db.js → database/db.js} +755 -552
  32. package/dist/database/dialect.d.ts +45 -0
  33. package/dist/database/dialect.d.ts.map +1 -0
  34. package/dist/database/dialect.js +72 -0
  35. package/dist/{fts.d.ts → database/fts.d.ts} +7 -0
  36. package/dist/database/fts.d.ts.map +1 -0
  37. package/dist/{fts.js → database/fts.js} +116 -32
  38. package/dist/database/index.d.ts +7 -0
  39. package/dist/database/index.d.ts.map +1 -0
  40. package/dist/database/index.js +6 -0
  41. package/dist/database/ports.d.ts +50 -0
  42. package/dist/database/ports.d.ts.map +1 -0
  43. package/dist/database/ports.js +1 -0
  44. package/dist/{schema.d.ts → database/schema.d.ts} +14 -3
  45. package/dist/database/schema.d.ts.map +1 -0
  46. package/dist/{schema.js → database/schema.js} +81 -41
  47. package/dist/dev-entry.d.ts +8 -0
  48. package/dist/dev-entry.d.ts.map +1 -0
  49. package/dist/dev-entry.js +119 -0
  50. package/dist/feeds.d.ts +12 -8
  51. package/dist/feeds.d.ts.map +1 -1
  52. package/dist/feeds.js +51 -6
  53. package/dist/hooks.d.ts +85 -0
  54. package/dist/hooks.d.ts.map +1 -0
  55. package/dist/hooks.js +163 -0
  56. package/dist/hydrate.d.ts +7 -6
  57. package/dist/hydrate.d.ts.map +1 -1
  58. package/dist/hydrate.js +4 -16
  59. package/dist/indexer.d.ts +43 -0
  60. package/dist/indexer.d.ts.map +1 -1
  61. package/dist/indexer.js +246 -38
  62. package/dist/labels.d.ts +36 -0
  63. package/dist/labels.d.ts.map +1 -1
  64. package/dist/labels.js +71 -6
  65. package/dist/lexicon-resolve.d.ts.map +1 -1
  66. package/dist/lexicon-resolve.js +27 -112
  67. package/dist/lexicons/com/atproto/label/defs.json +75 -0
  68. package/dist/lexicons/com/atproto/moderation/defs.json +30 -0
  69. package/dist/lexicons/com/atproto/repo/strongRef.json +21 -0
  70. package/dist/lexicons/dev/hatk/applyWrites.json +87 -0
  71. package/dist/lexicons/dev/hatk/createRecord.json +40 -0
  72. package/dist/lexicons/dev/hatk/createReport.json +48 -0
  73. package/dist/lexicons/dev/hatk/deleteRecord.json +25 -0
  74. package/dist/lexicons/dev/hatk/describeCollections.json +41 -0
  75. package/dist/lexicons/dev/hatk/describeFeeds.json +29 -0
  76. package/dist/lexicons/dev/hatk/describeLabels.json +45 -0
  77. package/dist/lexicons/dev/hatk/getFeed.json +30 -0
  78. package/dist/lexicons/dev/hatk/getPreferences.json +19 -0
  79. package/dist/lexicons/dev/hatk/getRecord.json +26 -0
  80. package/dist/lexicons/dev/hatk/getRecords.json +32 -0
  81. package/dist/lexicons/dev/hatk/putPreference.json +28 -0
  82. package/dist/lexicons/dev/hatk/putRecord.json +41 -0
  83. package/dist/lexicons/dev/hatk/searchRecords.json +32 -0
  84. package/dist/lexicons/dev/hatk/uploadBlob.json +23 -0
  85. package/dist/logger.d.ts +29 -0
  86. package/dist/logger.d.ts.map +1 -1
  87. package/dist/logger.js +29 -0
  88. package/dist/main.js +148 -68
  89. package/dist/mst.d.ts +18 -1
  90. package/dist/mst.d.ts.map +1 -1
  91. package/dist/mst.js +19 -8
  92. package/dist/oauth/db.d.ts +3 -1
  93. package/dist/oauth/db.d.ts.map +1 -1
  94. package/dist/oauth/db.js +56 -19
  95. package/dist/oauth/discovery.d.ts.map +1 -1
  96. package/dist/oauth/discovery.js +13 -1
  97. package/dist/oauth/server.d.ts +38 -0
  98. package/dist/oauth/server.d.ts.map +1 -1
  99. package/dist/oauth/server.js +228 -31
  100. package/dist/oauth/session.d.ts +11 -0
  101. package/dist/oauth/session.d.ts.map +1 -0
  102. package/dist/oauth/session.js +65 -0
  103. package/dist/opengraph.d.ts +10 -0
  104. package/dist/opengraph.d.ts.map +1 -1
  105. package/dist/opengraph.js +80 -40
  106. package/dist/pds-proxy.d.ts +60 -0
  107. package/dist/pds-proxy.d.ts.map +1 -0
  108. package/dist/pds-proxy.js +277 -0
  109. package/dist/private-collections.d.ts +8 -0
  110. package/dist/private-collections.d.ts.map +1 -0
  111. package/dist/private-collections.js +22 -0
  112. package/dist/push.d.ts +34 -0
  113. package/dist/push.d.ts.map +1 -0
  114. package/dist/push.js +186 -0
  115. package/dist/renderer.d.ts +27 -0
  116. package/dist/renderer.d.ts.map +1 -0
  117. package/dist/renderer.js +46 -0
  118. package/dist/resolve-hatk.d.ts +6 -0
  119. package/dist/resolve-hatk.d.ts.map +1 -0
  120. package/dist/resolve-hatk.js +20 -0
  121. package/dist/response.d.ts +16 -0
  122. package/dist/response.d.ts.map +1 -0
  123. package/dist/response.js +69 -0
  124. package/dist/scanner.d.ts +21 -0
  125. package/dist/scanner.d.ts.map +1 -0
  126. package/dist/scanner.js +88 -0
  127. package/dist/seed.d.ts +19 -0
  128. package/dist/seed.d.ts.map +1 -1
  129. package/dist/seed.js +43 -4
  130. package/dist/server-init.d.ts +8 -0
  131. package/dist/server-init.d.ts.map +1 -0
  132. package/dist/server-init.js +62 -0
  133. package/dist/server.d.ts +26 -3
  134. package/dist/server.d.ts.map +1 -1
  135. package/dist/server.js +729 -638
  136. package/dist/setup.d.ts +28 -1
  137. package/dist/setup.d.ts.map +1 -1
  138. package/dist/setup.js +50 -3
  139. package/dist/templates/feed.tpl +14 -0
  140. package/dist/templates/hook.tpl +5 -0
  141. package/dist/templates/label.tpl +15 -0
  142. package/dist/templates/og.tpl +17 -0
  143. package/dist/templates/seed.tpl +11 -0
  144. package/dist/templates/setup.tpl +5 -0
  145. package/dist/templates/test-feed.tpl +19 -0
  146. package/dist/templates/test-xrpc.tpl +19 -0
  147. package/dist/templates/xrpc.tpl +41 -0
  148. package/dist/test.d.ts +1 -1
  149. package/dist/test.d.ts.map +1 -1
  150. package/dist/test.js +41 -32
  151. package/dist/views.js +1 -1
  152. package/dist/vite-plugin.d.ts +1 -1
  153. package/dist/vite-plugin.d.ts.map +1 -1
  154. package/dist/vite-plugin.js +254 -66
  155. package/dist/xrpc.d.ts +75 -11
  156. package/dist/xrpc.d.ts.map +1 -1
  157. package/dist/xrpc.js +189 -39
  158. package/package.json +17 -9
  159. package/public/admin-auth.js +271 -306
  160. package/public/admin.html +177 -61
  161. package/dist/db.d.ts.map +0 -1
  162. package/dist/fts.d.ts.map +0 -1
  163. package/dist/oauth/hooks.d.ts +0 -10
  164. package/dist/oauth/hooks.d.ts.map +0 -1
  165. package/dist/oauth/hooks.js +0 -40
  166. package/dist/schema.d.ts.map +0 -1
  167. package/dist/test-browser.d.ts +0 -14
  168. package/dist/test-browser.d.ts.map +0 -1
  169. package/dist/test-browser.js +0 -26
package/dist/xrpc.js CHANGED
@@ -6,12 +6,40 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
6
6
  }
7
7
  return path;
8
8
  };
9
+ /**
10
+ * XRPC method handler system for serving AT Protocol endpoints.
11
+ *
12
+ * Place handler modules in the `xrpc/` directory, nested by NSID segments
13
+ * (e.g. `xrpc/app/bsky/feed/getAuthorFeed.ts` → `app.bsky.feed.getAuthorFeed`).
14
+ * Each module default-exports a `{ handler }` function that receives an
15
+ * {@link XrpcContext} with database access, query params, pagination, and
16
+ * viewer auth.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * // xrpc/xyz/statusphere/getStatuses.ts
21
+ * import { defineXrpc } from '../../hatk.generated.ts'
22
+ *
23
+ * export default defineXrpc('xyz.statusphere.getStatuses', async (ctx) => {
24
+ * const rows = await ctx.db.query('SELECT * FROM statusphere_status LIMIT ?', [ctx.limit])
25
+ * return { statuses: rows }
26
+ * })
27
+ * ```
28
+ */
9
29
  import { resolve, relative } from 'node:path';
10
30
  import { readdirSync, statSync } from 'node:fs';
11
- import { log } from "./logger.js";
12
- import { querySQL, runSQL, packCursor, unpackCursor, isTakendownDid, filterTakendownDids, searchRecords, findUriByFields, lookupByFieldBatch, countByFieldBatch, queryLabelsForUris, } from "./db.js";
13
- import { resolveRecords } from "./hydrate.js";
14
- import { getLexicon } from "./schema.js";
31
+ import { log, emit, timer } from "./logger.js";
32
+ import { querySQL, runSQL, packCursor, unpackCursor, isTakendownDid, filterTakendownDids, searchRecords, findUriByFields, } from "./database/db.js";
33
+ import { resolveRecords, buildBaseContext } from "./hydrate.js";
34
+ import { getLexicon } from "./database/schema.js";
35
+ import { createHmac } from 'node:crypto';
36
+ import { pdsCreateRecord, pdsPutRecord, pdsDeleteRecord, pdsApplyWrites } from "./pds-proxy.js";
37
+ let _oauthConfig = null;
38
+ /** Set the OAuth config used for record write helpers. Called once during boot. */
39
+ export function configureOAuth(config) {
40
+ _oauthConfig = config;
41
+ }
42
+ /** Thrown from XRPC handlers to return a 400 response with an error message. */
15
43
  export class InvalidRequestError extends Error {
16
44
  status = 400;
17
45
  errorName;
@@ -20,6 +48,7 @@ export class InvalidRequestError extends Error {
20
48
  this.errorName = errorName;
21
49
  }
22
50
  }
51
+ /** Thrown from XRPC handlers to return a 404 response. */
23
52
  export class NotFoundError extends InvalidRequestError {
24
53
  status = 404;
25
54
  constructor(message = 'Not found') {
@@ -27,9 +56,36 @@ export class NotFoundError extends InvalidRequestError {
27
56
  }
28
57
  }
29
58
  let _relayUrl = '';
59
+ let _cdn = null;
60
+ /** Set the relay URL used for blob URL generation. Called once during boot. */
30
61
  export function configureRelay(relay) {
31
62
  _relayUrl = relay;
32
63
  }
64
+ /** Set the CDN config for imgproxy URL signing. Called once during boot. */
65
+ export function configureCdn(cdn) {
66
+ if (cdn) {
67
+ _cdn = {
68
+ url: cdn.url.replace(/\/$/, ''),
69
+ key: Buffer.from(cdn.key, 'hex'),
70
+ salt: Buffer.from(cdn.salt, 'hex'),
71
+ };
72
+ }
73
+ else {
74
+ _cdn = null;
75
+ }
76
+ }
77
+ /** Sign an imgproxy path with HMAC-SHA256 (URL-safe base64). */
78
+ function signPath(path) {
79
+ const hmac = createHmac('sha256', _cdn.key);
80
+ hmac.update(_cdn.salt);
81
+ hmac.update(path);
82
+ const sig = hmac.digest('base64url');
83
+ return `/${sig}${path}`;
84
+ }
85
+ /**
86
+ * Generate a CDN URL for a blob ref. Uses the PDS directly in local dev,
87
+ * a configured imgproxy CDN if available, or the Bluesky CDN as fallback.
88
+ */
33
89
  export function blobUrl(did, ref, preset = 'avatar') {
34
90
  if (!ref)
35
91
  return undefined;
@@ -39,9 +95,65 @@ export function blobUrl(did, ref, preset = 'avatar') {
39
95
  if (_relayUrl.includes('localhost:2583')) {
40
96
  return `http://localhost:2583/xrpc/com.atproto.sync.getBlob?did=${did}&cid=${p.ref.$link}`;
41
97
  }
98
+ if (_cdn) {
99
+ const path = `/${preset}/plain/${did}/${p.ref.$link}`;
100
+ return `${_cdn.url}${signPath(path)}`;
101
+ }
42
102
  return `https://cdn.bsky.app/img/${preset}/plain/${did}/${p.ref.$link}@jpeg`;
43
103
  }
104
+ /** Build a full XrpcContext from request parameters. Reuses buildBaseContext for shared fields. */
105
+ export function buildXrpcContext(params, cursor, limit, viewer, input) {
106
+ const base = buildBaseContext(viewer);
107
+ return {
108
+ ...base,
109
+ db: { query: querySQL, run: runSQL },
110
+ params,
111
+ input: input || {},
112
+ cursor,
113
+ limit,
114
+ packCursor,
115
+ unpackCursor,
116
+ isTakendown: isTakendownDid,
117
+ filterTakendownDids,
118
+ search: searchRecords,
119
+ resolve: resolveRecords,
120
+ exists: async (collection, filters) => {
121
+ const conditions = Object.entries(filters).map(([field, value]) => ({ field, value }));
122
+ const uri = await findUriByFields(collection, conditions);
123
+ return uri !== null;
124
+ },
125
+ createRecord: async (collection, record, opts) => {
126
+ if (!_oauthConfig)
127
+ throw new Error('No OAuth config — cannot write to PDS');
128
+ if (!viewer)
129
+ throw new Error('Authentication required to write records');
130
+ return pdsCreateRecord(_oauthConfig, viewer, { collection, record, rkey: opts?.rkey });
131
+ },
132
+ putRecord: async (collection, rkey, record) => {
133
+ if (!_oauthConfig)
134
+ throw new Error('No OAuth config — cannot write to PDS');
135
+ if (!viewer)
136
+ throw new Error('Authentication required to write records');
137
+ return pdsPutRecord(_oauthConfig, viewer, { collection, rkey, record });
138
+ },
139
+ deleteRecord: async (collection, rkey) => {
140
+ if (!_oauthConfig)
141
+ throw new Error('No OAuth config — cannot write to PDS');
142
+ if (!viewer)
143
+ throw new Error('Authentication required to write records');
144
+ await pdsDeleteRecord(_oauthConfig, viewer, { collection, rkey });
145
+ },
146
+ applyWrites: async (writes) => {
147
+ if (!_oauthConfig)
148
+ throw new Error('No OAuth config — cannot write to PDS');
149
+ if (!viewer)
150
+ throw new Error('Authentication required to write records');
151
+ return pdsApplyWrites(_oauthConfig, viewer, { writes });
152
+ },
153
+ };
154
+ }
44
155
  const handlers = new Map();
156
+ /** Recursively collect .ts/.js files in a directory, skipping files prefixed with `_`. */
45
157
  function walkDir(dir) {
46
158
  const results = [];
47
159
  try {
@@ -58,6 +170,11 @@ function walkDir(dir) {
58
170
  catch { }
59
171
  return results.sort();
60
172
  }
173
+ /**
174
+ * Discover and load XRPC handler modules from the `xrpc/` directory.
175
+ * Directory nesting maps to NSID segments. Parameters are validated and
176
+ * coerced against the matching lexicon definition.
177
+ */
61
178
  export async function initXrpc(xrpcDir) {
62
179
  const files = walkDir(xrpcDir);
63
180
  if (files.length === 0)
@@ -65,7 +182,7 @@ export async function initXrpc(xrpcDir) {
65
182
  for (const scriptPath of files) {
66
183
  const rel = relative(xrpcDir, scriptPath).replace(/\.(ts|js)$/, '');
67
184
  const name = rel.replace(/[\\/]/g, '.');
68
- const mod = await import(__rewriteRelativeImportExtension(scriptPath));
185
+ const mod = await import(__rewriteRelativeImportExtension(/* @vite-ignore */ `${scriptPath}?t=${Date.now()}`));
69
186
  const handler = mod.default;
70
187
  // Extract param schema from lexicon for validation and defaults
71
188
  const lexicon = getLexicon(name);
@@ -89,51 +206,84 @@ export async function initXrpc(xrpcDir) {
89
206
  throw new InvalidRequestError(`Missing required parameter: ${param}`, 'InvalidRequest');
90
207
  }
91
208
  }
92
- const ctx = {
93
- db: { query: querySQL, run: runSQL },
94
- params,
95
- input: input || {},
96
- cursor,
97
- limit,
98
- viewer,
99
- packCursor,
100
- unpackCursor,
101
- isTakendown: isTakendownDid,
102
- filterTakendownDids,
103
- search: searchRecords,
104
- resolve: resolveRecords,
105
- lookup: async (collection, field, values) => {
106
- if (values.length === 0)
107
- return new Map();
108
- const unique = [...new Set(values.filter(Boolean))];
109
- return lookupByFieldBatch(collection, field, unique);
110
- },
111
- count: async (collection, field, values) => {
112
- if (values.length === 0)
113
- return new Map();
114
- const unique = [...new Set(values.filter(Boolean))];
115
- return countByFieldBatch(collection, field, unique);
116
- },
117
- exists: async (collection, filters) => {
118
- const conditions = Object.entries(filters).map(([field, value]) => ({ field, value }));
119
- const uri = await findUriByFields(collection, conditions);
120
- return uri !== null;
121
- },
122
- labels: queryLabelsForUris,
123
- blobUrl,
124
- };
209
+ const ctx = buildXrpcContext(params, cursor, limit, viewer, input);
125
210
  return handler.handler(ctx);
126
211
  },
127
212
  });
128
213
  log(`[xrpc] discovered: ${name}`);
129
214
  }
130
215
  }
216
+ /** Register a single XRPC handler from a scanned server/ module. */
217
+ export function registerXrpcHandler(nsid, handlerModule) {
218
+ const lexicon = getLexicon(nsid);
219
+ const paramsDef = lexicon?.defs?.main?.parameters;
220
+ const requiredParams = paramsDef?.required || [];
221
+ const paramProperties = paramsDef?.properties || {};
222
+ handlers.set(nsid, {
223
+ name: nsid,
224
+ execute: async (params, cursor, limit, viewer, input) => {
225
+ for (const [key, def] of Object.entries(paramProperties)) {
226
+ if (params[key] == null && def.default != null) {
227
+ params[key] = String(def.default);
228
+ }
229
+ if (params[key] != null && def.type === 'integer') {
230
+ params[key] = Number(params[key]);
231
+ }
232
+ }
233
+ for (const param of requiredParams) {
234
+ if (!params[param]) {
235
+ throw new InvalidRequestError(`Missing required parameter: ${param}`, 'InvalidRequest');
236
+ }
237
+ }
238
+ const ctx = buildXrpcContext(params, cursor, limit, viewer, input);
239
+ return handlerModule.handler(ctx);
240
+ },
241
+ });
242
+ }
243
+ /** Execute a registered XRPC handler by name. Returns null if no handler matches. */
131
244
  export async function executeXrpc(name, params, cursor, limit, viewer, input) {
132
245
  const handler = handlers.get(name);
133
246
  if (!handler)
134
247
  return null;
135
- return handler.execute(params, cursor, limit, viewer || null, input);
248
+ const elapsed = timer();
249
+ try {
250
+ const result = await handler.execute(params, cursor, limit, viewer || null, input);
251
+ emit('xrpc', name, { duration_ms: elapsed(), params, cursor, limit, viewer: viewer?.did });
252
+ return result;
253
+ }
254
+ catch (err) {
255
+ emit('xrpc', name, { duration_ms: elapsed(), params, cursor, limit, viewer: viewer?.did, error: err.message });
256
+ throw err;
257
+ }
258
+ }
259
+ /** Call a registered XRPC handler directly (no HTTP). For use in SSR renderers. */
260
+ export async function callXrpc(nsid, params = {}, input) {
261
+ const viewer = globalThis.__hatk_viewer ?? null;
262
+ // In externalized module context (e.g. SSR), delegate to the runner's callXrpc via globalThis.
263
+ // The runner's module instance has all registered handlers; this (Node's) instance may not.
264
+ if (handlers.size === 0 && globalThis.__hatk_callXrpc) {
265
+ return globalThis.__hatk_callXrpc(nsid, params, input);
266
+ }
267
+ const stringParams = {};
268
+ for (const [k, v] of Object.entries(params)) {
269
+ if (v != null)
270
+ stringParams[k] = String(v);
271
+ }
272
+ const limit = params.limit ? Number(params.limit) : 20;
273
+ const cursor = params.cursor ?? undefined;
274
+ const result = await executeXrpc(nsid, stringParams, cursor, limit, viewer, input);
275
+ if (result === null)
276
+ throw new Error(`No XRPC handler registered for ${nsid}`);
277
+ return result;
278
+ }
279
+ /**
280
+ * Register a core XRPC handler directly (no XrpcContext wrapping).
281
+ * Used for built-in dev.hatk.* handlers that manage their own dependencies.
282
+ */
283
+ export function registerCoreXrpcHandler(nsid, fn) {
284
+ handlers.set(nsid, { name: nsid, execute: fn });
136
285
  }
286
+ /** Return all registered XRPC method names. */
137
287
  export function listXrpc() {
138
288
  return Array.from(handlers.keys());
139
289
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hatk/hatk",
3
- "version": "0.0.1-alpha.7",
3
+ "version": "0.0.1-alpha.70",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "hatk": "dist/cli.js"
@@ -20,27 +20,35 @@
20
20
  "./xrpc-client": "./dist/xrpc-client.js",
21
21
  "./views": "./dist/views.js",
22
22
  "./seed": "./dist/seed.js",
23
+ "./hooks": "./dist/hooks.js",
23
24
  "./setup": "./dist/setup.js",
24
25
  "./test": "./dist/test.js",
25
- "./test/browser": "./dist/test-browser.js",
26
- "./vite-plugin": "./dist/vite-plugin.js"
26
+ "./config": "./dist/config.js",
27
+ "./vite-plugin": "./dist/vite-plugin.js",
28
+ "./renderer": "./dist/renderer.js"
27
29
  },
28
30
  "scripts": {
29
- "build": "tsc -p tsconfig.build.json",
30
- "prepublishOnly": "npm run build"
31
+ "clean": "rm -rf dist",
32
+ "build": "npm run clean && tsc -p tsconfig.build.json && cp -r src/templates dist/templates && cp -r src/lexicons dist/lexicons",
33
+ "prepublishOnly": "npm run build",
34
+ "test": "vitest run"
31
35
  },
32
36
  "dependencies": {
33
- "@bigmoves/lexicon": "^0.2.1",
37
+ "@bigmoves/lexicon": "^0.2.2",
34
38
  "@duckdb/node-api": "^1.4.4-r.1",
35
39
  "@hatk/oauth-client": "*",
36
40
  "@resvg/resvg-js": "^2.6.2",
37
- "satori": "^0.19.2",
41
+ "better-sqlite3": "^12.6.2",
42
+ "satori": "^0.28.1",
38
43
  "vitest": "^4",
39
44
  "yaml": "^2.7.0"
40
45
  },
41
46
  "devDependencies": {
42
- "@playwright/test": "^1.58.2",
47
+ "@types/better-sqlite3": "^7.6.13",
43
48
  "@types/react": "^19.2.14",
44
- "vite": "^6"
49
+ "vite": "^8.0.0"
50
+ },
51
+ "peerDependencies": {
52
+ "vite": "^8.0.0"
45
53
  }
46
54
  }