@hatk/hatk 0.0.1-alpha.8 → 0.0.1-alpha.80

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 (175) hide show
  1. package/dist/adapter.d.ts +19 -0
  2. package/dist/adapter.d.ts.map +1 -0
  3. package/dist/adapter.js +110 -0
  4. package/dist/backfill.d.ts +21 -2
  5. package/dist/backfill.d.ts.map +1 -1
  6. package/dist/backfill.js +102 -37
  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 +74 -1
  12. package/dist/config.d.ts.map +1 -1
  13. package/dist/config.js +43 -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 +109 -3
  60. package/dist/indexer.d.ts.map +1 -1
  61. package/dist/indexer.js +338 -66
  62. package/dist/jetstream.d.ts +118 -0
  63. package/dist/jetstream.d.ts.map +1 -0
  64. package/dist/jetstream.js +225 -0
  65. package/dist/labels.d.ts +36 -0
  66. package/dist/labels.d.ts.map +1 -1
  67. package/dist/labels.js +71 -6
  68. package/dist/lexicon-resolve.d.ts.map +1 -1
  69. package/dist/lexicon-resolve.js +27 -112
  70. package/dist/lexicons/com/atproto/label/defs.json +75 -0
  71. package/dist/lexicons/com/atproto/moderation/defs.json +30 -0
  72. package/dist/lexicons/com/atproto/repo/strongRef.json +21 -0
  73. package/dist/lexicons/dev/hatk/applyWrites.json +87 -0
  74. package/dist/lexicons/dev/hatk/createRecord.json +40 -0
  75. package/dist/lexicons/dev/hatk/createReport.json +48 -0
  76. package/dist/lexicons/dev/hatk/deleteRecord.json +25 -0
  77. package/dist/lexicons/dev/hatk/describeCollections.json +41 -0
  78. package/dist/lexicons/dev/hatk/describeFeeds.json +29 -0
  79. package/dist/lexicons/dev/hatk/describeLabels.json +45 -0
  80. package/dist/lexicons/dev/hatk/getFeed.json +30 -0
  81. package/dist/lexicons/dev/hatk/getPreferences.json +19 -0
  82. package/dist/lexicons/dev/hatk/getRecord.json +26 -0
  83. package/dist/lexicons/dev/hatk/getRecords.json +32 -0
  84. package/dist/lexicons/dev/hatk/putPreference.json +28 -0
  85. package/dist/lexicons/dev/hatk/putRecord.json +41 -0
  86. package/dist/lexicons/dev/hatk/searchRecords.json +32 -0
  87. package/dist/lexicons/dev/hatk/uploadBlob.json +23 -0
  88. package/dist/logger.d.ts +29 -0
  89. package/dist/logger.d.ts.map +1 -1
  90. package/dist/logger.js +29 -0
  91. package/dist/main.js +161 -72
  92. package/dist/mst.d.ts +18 -1
  93. package/dist/mst.d.ts.map +1 -1
  94. package/dist/mst.js +19 -8
  95. package/dist/oauth/db.d.ts +3 -1
  96. package/dist/oauth/db.d.ts.map +1 -1
  97. package/dist/oauth/db.js +56 -19
  98. package/dist/oauth/discovery.d.ts.map +1 -1
  99. package/dist/oauth/discovery.js +13 -1
  100. package/dist/oauth/server.d.ts +92 -1
  101. package/dist/oauth/server.d.ts.map +1 -1
  102. package/dist/oauth/server.js +352 -37
  103. package/dist/oauth/service-describe.d.ts +31 -0
  104. package/dist/oauth/service-describe.d.ts.map +1 -0
  105. package/dist/oauth/service-describe.js +61 -0
  106. package/dist/oauth/session.d.ts +32 -0
  107. package/dist/oauth/session.d.ts.map +1 -0
  108. package/dist/oauth/session.js +131 -0
  109. package/dist/opengraph.d.ts +10 -0
  110. package/dist/opengraph.d.ts.map +1 -1
  111. package/dist/opengraph.js +80 -40
  112. package/dist/pds-proxy.d.ts +82 -0
  113. package/dist/pds-proxy.d.ts.map +1 -0
  114. package/dist/pds-proxy.js +356 -0
  115. package/dist/private-collections.d.ts +8 -0
  116. package/dist/private-collections.d.ts.map +1 -0
  117. package/dist/private-collections.js +22 -0
  118. package/dist/push.d.ts +54 -0
  119. package/dist/push.d.ts.map +1 -0
  120. package/dist/push.js +367 -0
  121. package/dist/renderer.d.ts +27 -0
  122. package/dist/renderer.d.ts.map +1 -0
  123. package/dist/renderer.js +46 -0
  124. package/dist/resolve-hatk.d.ts +6 -0
  125. package/dist/resolve-hatk.d.ts.map +1 -0
  126. package/dist/resolve-hatk.js +20 -0
  127. package/dist/response.d.ts +16 -0
  128. package/dist/response.d.ts.map +1 -0
  129. package/dist/response.js +69 -0
  130. package/dist/scanner.d.ts +21 -0
  131. package/dist/scanner.d.ts.map +1 -0
  132. package/dist/scanner.js +88 -0
  133. package/dist/seed.d.ts +19 -0
  134. package/dist/seed.d.ts.map +1 -1
  135. package/dist/seed.js +43 -4
  136. package/dist/server-init.d.ts +8 -0
  137. package/dist/server-init.d.ts.map +1 -0
  138. package/dist/server-init.js +62 -0
  139. package/dist/server.d.ts +26 -3
  140. package/dist/server.d.ts.map +1 -1
  141. package/dist/server.js +832 -638
  142. package/dist/setup.d.ts +28 -1
  143. package/dist/setup.d.ts.map +1 -1
  144. package/dist/setup.js +50 -3
  145. package/dist/templates/feed.tpl +14 -0
  146. package/dist/templates/hook.tpl +5 -0
  147. package/dist/templates/label.tpl +15 -0
  148. package/dist/templates/og.tpl +17 -0
  149. package/dist/templates/seed.tpl +11 -0
  150. package/dist/templates/setup.tpl +5 -0
  151. package/dist/templates/test-feed.tpl +19 -0
  152. package/dist/templates/test-xrpc.tpl +19 -0
  153. package/dist/templates/xrpc.tpl +41 -0
  154. package/dist/test.d.ts +1 -1
  155. package/dist/test.d.ts.map +1 -1
  156. package/dist/test.js +41 -32
  157. package/dist/views.js +1 -1
  158. package/dist/vite-plugin.d.ts +1 -1
  159. package/dist/vite-plugin.d.ts.map +1 -1
  160. package/dist/vite-plugin.js +254 -66
  161. package/dist/xrpc.d.ts +82 -11
  162. package/dist/xrpc.d.ts.map +1 -1
  163. package/dist/xrpc.js +196 -39
  164. package/package.json +17 -9
  165. package/public/admin-auth.js +271 -306
  166. package/public/admin.html +177 -61
  167. package/dist/db.d.ts.map +0 -1
  168. package/dist/fts.d.ts.map +0 -1
  169. package/dist/oauth/hooks.d.ts +0 -10
  170. package/dist/oauth/hooks.d.ts.map +0 -1
  171. package/dist/oauth/hooks.js +0 -40
  172. package/dist/schema.d.ts.map +0 -1
  173. package/dist/test-browser.d.ts +0 -14
  174. package/dist/test-browser.d.ts.map +0 -1
  175. 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, pdsXrpc } 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,72 @@ 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
+ pds: async (nsid, options) => {
154
+ if (!_oauthConfig)
155
+ throw new Error('No OAuth config — cannot call the PDS');
156
+ if (!viewer)
157
+ throw new Error('Authentication required to call the PDS');
158
+ return pdsXrpc(_oauthConfig, viewer, nsid, options);
159
+ },
160
+ };
161
+ }
44
162
  const handlers = new Map();
163
+ /** Recursively collect .ts/.js files in a directory, skipping files prefixed with `_`. */
45
164
  function walkDir(dir) {
46
165
  const results = [];
47
166
  try {
@@ -58,6 +177,11 @@ function walkDir(dir) {
58
177
  catch { }
59
178
  return results.sort();
60
179
  }
180
+ /**
181
+ * Discover and load XRPC handler modules from the `xrpc/` directory.
182
+ * Directory nesting maps to NSID segments. Parameters are validated and
183
+ * coerced against the matching lexicon definition.
184
+ */
61
185
  export async function initXrpc(xrpcDir) {
62
186
  const files = walkDir(xrpcDir);
63
187
  if (files.length === 0)
@@ -65,7 +189,7 @@ export async function initXrpc(xrpcDir) {
65
189
  for (const scriptPath of files) {
66
190
  const rel = relative(xrpcDir, scriptPath).replace(/\.(ts|js)$/, '');
67
191
  const name = rel.replace(/[\\/]/g, '.');
68
- const mod = await import(__rewriteRelativeImportExtension(scriptPath));
192
+ const mod = await import(__rewriteRelativeImportExtension(/* @vite-ignore */ `${scriptPath}?t=${Date.now()}`));
69
193
  const handler = mod.default;
70
194
  // Extract param schema from lexicon for validation and defaults
71
195
  const lexicon = getLexicon(name);
@@ -89,51 +213,84 @@ export async function initXrpc(xrpcDir) {
89
213
  throw new InvalidRequestError(`Missing required parameter: ${param}`, 'InvalidRequest');
90
214
  }
91
215
  }
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
- };
216
+ const ctx = buildXrpcContext(params, cursor, limit, viewer, input);
125
217
  return handler.handler(ctx);
126
218
  },
127
219
  });
128
220
  log(`[xrpc] discovered: ${name}`);
129
221
  }
130
222
  }
223
+ /** Register a single XRPC handler from a scanned server/ module. */
224
+ export function registerXrpcHandler(nsid, handlerModule) {
225
+ const lexicon = getLexicon(nsid);
226
+ const paramsDef = lexicon?.defs?.main?.parameters;
227
+ const requiredParams = paramsDef?.required || [];
228
+ const paramProperties = paramsDef?.properties || {};
229
+ handlers.set(nsid, {
230
+ name: nsid,
231
+ execute: async (params, cursor, limit, viewer, input) => {
232
+ for (const [key, def] of Object.entries(paramProperties)) {
233
+ if (params[key] == null && def.default != null) {
234
+ params[key] = String(def.default);
235
+ }
236
+ if (params[key] != null && def.type === 'integer') {
237
+ params[key] = Number(params[key]);
238
+ }
239
+ }
240
+ for (const param of requiredParams) {
241
+ if (!params[param]) {
242
+ throw new InvalidRequestError(`Missing required parameter: ${param}`, 'InvalidRequest');
243
+ }
244
+ }
245
+ const ctx = buildXrpcContext(params, cursor, limit, viewer, input);
246
+ return handlerModule.handler(ctx);
247
+ },
248
+ });
249
+ }
250
+ /** Execute a registered XRPC handler by name. Returns null if no handler matches. */
131
251
  export async function executeXrpc(name, params, cursor, limit, viewer, input) {
132
252
  const handler = handlers.get(name);
133
253
  if (!handler)
134
254
  return null;
135
- return handler.execute(params, cursor, limit, viewer || null, input);
255
+ const elapsed = timer();
256
+ try {
257
+ const result = await handler.execute(params, cursor, limit, viewer || null, input);
258
+ emit('xrpc', name, { duration_ms: elapsed(), params, cursor, limit, viewer: viewer?.did });
259
+ return result;
260
+ }
261
+ catch (err) {
262
+ emit('xrpc', name, { duration_ms: elapsed(), params, cursor, limit, viewer: viewer?.did, error: err.message });
263
+ throw err;
264
+ }
265
+ }
266
+ /** Call a registered XRPC handler directly (no HTTP). For use in SSR renderers. */
267
+ export async function callXrpc(nsid, params = {}, input) {
268
+ const viewer = globalThis.__hatk_viewer ?? null;
269
+ // In externalized module context (e.g. SSR), delegate to the runner's callXrpc via globalThis.
270
+ // The runner's module instance has all registered handlers; this (Node's) instance may not.
271
+ if (handlers.size === 0 && globalThis.__hatk_callXrpc) {
272
+ return globalThis.__hatk_callXrpc(nsid, params, input);
273
+ }
274
+ const stringParams = {};
275
+ for (const [k, v] of Object.entries(params)) {
276
+ if (v != null)
277
+ stringParams[k] = String(v);
278
+ }
279
+ const limit = params.limit ? Number(params.limit) : 20;
280
+ const cursor = params.cursor ?? undefined;
281
+ const result = await executeXrpc(nsid, stringParams, cursor, limit, viewer, input);
282
+ if (result === null)
283
+ throw new Error(`No XRPC handler registered for ${nsid}`);
284
+ return result;
285
+ }
286
+ /**
287
+ * Register a core XRPC handler directly (no XrpcContext wrapping).
288
+ * Used for built-in dev.hatk.* handlers that manage their own dependencies.
289
+ */
290
+ export function registerCoreXrpcHandler(nsid, fn) {
291
+ handlers.set(nsid, { name: nsid, execute: fn });
136
292
  }
293
+ /** Return all registered XRPC method names. */
137
294
  export function listXrpc() {
138
295
  return Array.from(handlers.keys());
139
296
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hatk/hatk",
3
- "version": "0.0.1-alpha.8",
3
+ "version": "0.0.1-alpha.80",
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
  }