@procedures/splay 0.0.0-stage → 0.2.0

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 (55) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/LICENSE +21 -0
  3. package/README.md +408 -2
  4. package/dist/.tsbuildinfo +1 -0
  5. package/dist/components/define.d.ts +134 -0
  6. package/dist/components/define.d.ts.map +1 -0
  7. package/dist/components/define.js +486 -0
  8. package/dist/components/define.js.map +1 -0
  9. package/dist/components/index.d.ts +39 -0
  10. package/dist/components/index.d.ts.map +1 -0
  11. package/dist/components/index.js +38 -0
  12. package/dist/components/index.js.map +1 -0
  13. package/dist/components/types.d.ts +264 -0
  14. package/dist/components/types.d.ts.map +1 -0
  15. package/dist/components/types.js +46 -0
  16. package/dist/components/types.js.map +1 -0
  17. package/dist/hydrate.d.ts +126 -0
  18. package/dist/hydrate.d.ts.map +1 -0
  19. package/dist/hydrate.js +226 -0
  20. package/dist/hydrate.js.map +1 -0
  21. package/dist/index.d.ts +40 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +53 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/module.d.ts +24 -0
  26. package/dist/module.d.ts.map +1 -0
  27. package/dist/module.js +68 -0
  28. package/dist/module.js.map +1 -0
  29. package/dist/register.d.ts +7 -0
  30. package/dist/register.d.ts.map +1 -0
  31. package/dist/register.js +9 -0
  32. package/dist/register.js.map +1 -0
  33. package/dist/registry.d.ts +60 -0
  34. package/dist/registry.d.ts.map +1 -0
  35. package/dist/registry.js +191 -0
  36. package/dist/registry.js.map +1 -0
  37. package/dist/streaming.d.ts +94 -0
  38. package/dist/streaming.d.ts.map +1 -0
  39. package/dist/streaming.js +422 -0
  40. package/dist/streaming.js.map +1 -0
  41. package/dist/types.d.ts +85 -0
  42. package/dist/types.d.ts.map +1 -0
  43. package/dist/types.js +7 -0
  44. package/dist/types.js.map +1 -0
  45. package/package.json +76 -3
  46. package/src/components/define.ts +600 -0
  47. package/src/components/index.ts +78 -0
  48. package/src/components/types.ts +357 -0
  49. package/src/hydrate.ts +355 -0
  50. package/src/index.ts +110 -0
  51. package/src/module.ts +93 -0
  52. package/src/register.ts +11 -0
  53. package/src/registry.ts +257 -0
  54. package/src/streaming.ts +554 -0
  55. package/src/types.ts +114 -0
@@ -0,0 +1,422 @@
1
+ /**
2
+ * Streaming Registry
3
+ *
4
+ * Creates a splay-compatible StreamingRegistry for components that
5
+ * yield multiple outputs over time (live updates, progressive rendering).
6
+ */
7
+ const setTimer = globalThis.setTimeout;
8
+ const clearTimer = globalThis.clearTimeout;
9
+ // =============================================================================
10
+ // Streaming Registry Implementation
11
+ // =============================================================================
12
+ /**
13
+ * Create a splay-compatible streaming registry backed by client procedures.
14
+ *
15
+ * @param callStreaming - Client's streaming procedure call function
16
+ * @param options - Registry options
17
+ * @returns StreamingRegistry instance
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * import { stream } from "client";
22
+ * import { createStreamingRegistry } from "@procedures/splay";
23
+ *
24
+ * const registry = createStreamingRegistry(stream, {
25
+ * namespace: "live",
26
+ * bufferSize: 10,
27
+ * });
28
+ *
29
+ * // Use for live-updating components
30
+ * for await (const output of registry.get("ticker")!(ctx)) {
31
+ * render(output);
32
+ * }
33
+ * ```
34
+ */
35
+ export function createStreamingRegistry(callStreaming, options = {}) {
36
+ const { namespace, bufferSize = 16 } = options;
37
+ /**
38
+ * Build the procedure path for a component type.
39
+ */
40
+ function buildPath(type) {
41
+ const basePath = ["components"];
42
+ if (namespace) {
43
+ basePath.push(namespace);
44
+ }
45
+ basePath.push(type);
46
+ return basePath;
47
+ }
48
+ /**
49
+ * Create a streaming renderer for a component type.
50
+ */
51
+ function createRenderer(type) {
52
+ const procedurePath = buildPath(type);
53
+ return async function* (ctx) {
54
+ // Build the input for the component procedure
55
+ const input = {
56
+ data: ctx.data,
57
+ size: ctx.size,
58
+ path: ctx.path,
59
+ depth: ctx.depth,
60
+ };
61
+ // Stream from the procedure
62
+ const stream = callStreaming(procedurePath, input);
63
+ // Yield each output with optional buffering
64
+ let buffer = [];
65
+ for await (const output of stream) {
66
+ if (bufferSize <= 1) {
67
+ // No buffering - yield immediately
68
+ yield output;
69
+ }
70
+ else {
71
+ // Add to buffer
72
+ buffer.push(output);
73
+ // Yield when buffer is full
74
+ if (buffer.length >= bufferSize) {
75
+ // Yield the most recent output (discard older ones)
76
+ yield buffer[buffer.length - 1];
77
+ buffer = [];
78
+ }
79
+ }
80
+ }
81
+ // Yield any remaining buffered output
82
+ if (buffer.length > 0) {
83
+ yield buffer[buffer.length - 1];
84
+ }
85
+ };
86
+ }
87
+ // Cache of created renderers
88
+ const rendererCache = new Map();
89
+ return {
90
+ /**
91
+ * Get a streaming renderer for a component type.
92
+ */
93
+ get(type) {
94
+ let renderer = rendererCache.get(type);
95
+ if (renderer) {
96
+ return renderer;
97
+ }
98
+ renderer = createRenderer(type);
99
+ rendererCache.set(type, renderer);
100
+ return renderer;
101
+ },
102
+ /**
103
+ * Check if a streaming renderer exists.
104
+ */
105
+ has(_type) {
106
+ return true; // Optimistic - actual check at call time
107
+ },
108
+ };
109
+ }
110
+ /**
111
+ * Create a dual registry supporting both sync and streaming.
112
+ *
113
+ * @param callSync - Client's sync procedure call function
114
+ * @param callStreaming - Client's streaming procedure call function
115
+ * @param isStreaming - Function to check if a component is streaming
116
+ * @param options - Registry options
117
+ * @returns DualRegistry instance
118
+ */
119
+ export function createDualRegistry(callSync, callStreaming, isStreaming, options = {}) {
120
+ const { namespace } = options;
121
+ function buildPath(type) {
122
+ const basePath = ["components"];
123
+ if (namespace) {
124
+ basePath.push(namespace);
125
+ }
126
+ basePath.push(type);
127
+ return basePath;
128
+ }
129
+ // Create sync renderer
130
+ function createSyncRenderer(type) {
131
+ const path = buildPath(type);
132
+ return async (ctx) => {
133
+ return callSync(path, {
134
+ data: ctx.data,
135
+ size: ctx.size,
136
+ path: ctx.path,
137
+ depth: ctx.depth,
138
+ });
139
+ };
140
+ }
141
+ // Create streaming renderer
142
+ function createStreamingRenderer(type) {
143
+ const path = buildPath(type);
144
+ return async function* (ctx) {
145
+ const input = {
146
+ data: ctx.data,
147
+ size: ctx.size,
148
+ path: ctx.path,
149
+ depth: ctx.depth,
150
+ };
151
+ for await (const output of callStreaming(path, input)) {
152
+ yield output;
153
+ }
154
+ };
155
+ }
156
+ const syncCache = new Map();
157
+ const streamingCache = new Map();
158
+ return {
159
+ sync: {
160
+ get(type) {
161
+ let renderer = syncCache.get(type);
162
+ if (!renderer) {
163
+ renderer = createSyncRenderer(type);
164
+ syncCache.set(type, renderer);
165
+ }
166
+ return renderer;
167
+ },
168
+ has(type) {
169
+ return !isStreaming(type);
170
+ },
171
+ },
172
+ streaming: {
173
+ get(type) {
174
+ let renderer = streamingCache.get(type);
175
+ if (!renderer) {
176
+ renderer = createStreamingRenderer(type);
177
+ streamingCache.set(type, renderer);
178
+ }
179
+ return renderer;
180
+ },
181
+ has(type) {
182
+ return isStreaming(type);
183
+ },
184
+ },
185
+ async *render(type, ctx, preferStreaming = false) {
186
+ const shouldStream = preferStreaming || isStreaming(type);
187
+ if (shouldStream) {
188
+ const renderer = this.streaming.get(type);
189
+ if (renderer) {
190
+ yield* renderer(ctx);
191
+ return;
192
+ }
193
+ }
194
+ // Fall back to sync
195
+ const syncRenderer = this.sync.get(type);
196
+ if (syncRenderer) {
197
+ yield await syncRenderer(ctx);
198
+ }
199
+ else {
200
+ throw new Error(`No renderer found for component type: ${type}`);
201
+ }
202
+ },
203
+ };
204
+ }
205
+ // =============================================================================
206
+ // Stream Utilities
207
+ // =============================================================================
208
+ /** This function ends an iterator and does not wait: a source with a pending item ends after it. */
209
+ function endSource(iterator) {
210
+ try {
211
+ void Promise.resolve(iterator.return?.()).catch(() => undefined);
212
+ }
213
+ catch {
214
+ // A source whose return() throws has nothing more to end
215
+ }
216
+ }
217
+ /**
218
+ * A queue with one writer and one reader: the reader waits on one wake-up, not on each source.
219
+ */
220
+ class Mailbox {
221
+ items = [];
222
+ wake = null;
223
+ ended = false;
224
+ failure = null;
225
+ push(item) {
226
+ this.items.push(item);
227
+ this.notify();
228
+ }
229
+ end(failure) {
230
+ this.ended = true;
231
+ if (failure)
232
+ this.failure = failure;
233
+ this.notify();
234
+ }
235
+ get isEnded() {
236
+ return this.ended;
237
+ }
238
+ notify() {
239
+ const wake = this.wake;
240
+ this.wake = null;
241
+ wake?.();
242
+ }
243
+ /** The items, then the failure (if any) when the writer has ended. */
244
+ async *drain() {
245
+ for (;;) {
246
+ if (this.items.length > 0) {
247
+ yield this.items.shift();
248
+ continue;
249
+ }
250
+ if (this.ended) {
251
+ if (this.failure)
252
+ throw this.failure.error;
253
+ return;
254
+ }
255
+ await new Promise((resolve) => {
256
+ this.wake = resolve;
257
+ });
258
+ }
259
+ }
260
+ }
261
+ /**
262
+ * Merge multiple component streams into one.
263
+ * Yields outputs from all streams as they arrive.
264
+ *
265
+ * Each source has at most one pending `next()`, and the reader waits on one shared wake-up.
266
+ * (Before, each round raced the pending promises of all sources: an idle source collected one
267
+ * reaction per item of the other sources, 81 MiB at 200k items. Deep dive DATA-12.) When the
268
+ * reader stops, or a source fails, the function ends the other sources.
269
+ */
270
+ export async function* mergeStreams(...streams) {
271
+ const iterators = streams.map((stream) => stream[Symbol.asyncIterator]());
272
+ const active = new Set();
273
+ const settled = new Mailbox();
274
+ const pull = (index) => {
275
+ iterators[index].next().then((result) => settled.push({ index, result }), (error) => settled.push({ index, error }));
276
+ };
277
+ iterators.forEach((_, index) => {
278
+ active.add(index);
279
+ pull(index);
280
+ });
281
+ try {
282
+ if (active.size === 0)
283
+ return;
284
+ for await (const item of settled.drain()) {
285
+ if ("error" in item) {
286
+ active.delete(item.index);
287
+ throw item.error;
288
+ }
289
+ if (item.result.done) {
290
+ active.delete(item.index);
291
+ if (active.size === 0)
292
+ return;
293
+ continue;
294
+ }
295
+ yield item.result.value;
296
+ // The next item of this source, after the reader took this one
297
+ pull(item.index);
298
+ }
299
+ }
300
+ finally {
301
+ for (const index of active)
302
+ endSource(iterators[index]);
303
+ }
304
+ }
305
+ /**
306
+ * Read a source in the background and give each item to `onItem`. `onEnd` runs when the source
307
+ * ends or fails, before the outputs end. When the reader stops, the source is not read further.
308
+ */
309
+ async function* timedStream(stream, onItem, onEnd, onStop) {
310
+ const state = {
311
+ iterator: stream[Symbol.asyncIterator](),
312
+ outputs: new Mailbox(),
313
+ stopped: false,
314
+ };
315
+ void (async () => {
316
+ let failure;
317
+ try {
318
+ while (!state.stopped) {
319
+ const result = await state.iterator.next();
320
+ if (result.done || state.stopped)
321
+ break;
322
+ onItem(result.value, state);
323
+ }
324
+ }
325
+ catch (error) {
326
+ failure = { error };
327
+ }
328
+ finally {
329
+ if (!state.stopped)
330
+ onEnd(state);
331
+ state.outputs.end(failure);
332
+ }
333
+ })();
334
+ try {
335
+ yield* state.outputs.drain();
336
+ }
337
+ finally {
338
+ if (!state.outputs.isEnded) {
339
+ // The reader stopped early: no more reads of the source (deep dive DATA-12)
340
+ state.stopped = true;
341
+ onStop();
342
+ endSource(state.iterator);
343
+ }
344
+ }
345
+ }
346
+ /**
347
+ * Throttle a component stream to emit at most once per interval.
348
+ *
349
+ * The first item of an interval goes out at once. The last item that arrives during the
350
+ * interval goes out when the interval ends. (Before, it waited until the source ended: deep
351
+ * dive DATA-12.) When the source ends, a waiting item goes out at once.
352
+ */
353
+ export function throttleStream(stream, intervalMs) {
354
+ let lastEmit = -Infinity;
355
+ let pending = null;
356
+ let timer = null;
357
+ const stopTimer = () => {
358
+ if (timer !== null) {
359
+ clearTimer(timer);
360
+ timer = null;
361
+ }
362
+ };
363
+ return timedStream(stream, (output, state) => {
364
+ const now = Date.now();
365
+ if (timer === null && now - lastEmit >= intervalMs) {
366
+ lastEmit = now;
367
+ state.outputs.push(output);
368
+ return;
369
+ }
370
+ pending = { output };
371
+ if (timer === null) {
372
+ timer = setTimer(() => {
373
+ timer = null;
374
+ if (pending && !state.stopped) {
375
+ lastEmit = Date.now();
376
+ state.outputs.push(pending.output);
377
+ pending = null;
378
+ }
379
+ }, Math.max(0, lastEmit + intervalMs - now));
380
+ }
381
+ }, (state) => {
382
+ stopTimer();
383
+ if (pending) {
384
+ state.outputs.push(pending.output);
385
+ pending = null;
386
+ }
387
+ }, stopTimer);
388
+ }
389
+ /**
390
+ * Debounce a component stream to emit only after a quiet period.
391
+ *
392
+ * When the stream ends, the last output goes out at once (BUGS-2026-07 H29). When the reader
393
+ * stops, the source is not read further (deep dive DATA-12).
394
+ */
395
+ export function debounceStream(stream, waitMs) {
396
+ let latest = null;
397
+ let timer = null;
398
+ const stopTimer = () => {
399
+ if (timer !== null) {
400
+ clearTimer(timer);
401
+ timer = null;
402
+ }
403
+ };
404
+ return timedStream(stream, (output, state) => {
405
+ latest = { output };
406
+ stopTimer();
407
+ timer = setTimer(() => {
408
+ timer = null;
409
+ if (latest && !state.stopped) {
410
+ state.outputs.push(latest.output);
411
+ latest = null;
412
+ }
413
+ }, waitMs);
414
+ }, (state) => {
415
+ stopTimer();
416
+ if (latest) {
417
+ state.outputs.push(latest.output);
418
+ latest = null;
419
+ }
420
+ }, stopTimer);
421
+ }
422
+ //# sourceMappingURL=streaming.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streaming.js","sourceRoot":"","sources":["../src/streaming.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAeH,MAAM,QAAQ,GAAI,UAA0C,CAAC,UAAU,CAAC;AACxE,MAAM,UAAU,GAAI,UAA0C,CAAC,YAAY,CAAC;AAc5E,gFAAgF;AAChF,oCAAoC;AACpC,gFAAgF;AAEhF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,uBAAuB,CACrC,aAAuC,EACvC,OAAO,GAA6B,EAAE;IAEtC,MAAM,EAAE,SAAS,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC;IAE/C;;OAEG;IACH,SAAS,SAAS,CAAC,IAAY;QAC7B,MAAM,QAAQ,GAAG,C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QACH,CAAC,EAAE,MAAM,CAAC,CAAC;IACb,CAAC,EACD,CAAC,KAAK,EAAE,EAAE;QACR,SAAS,EAAE,CAAC;QACZ,IAAI,MAAM,EAAE,CAAC;YACX,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAClC,MAAM,GAAG,IAAI,CAAC;QAChB,CAAC;IACH,CAAC,EACD,SAAS,CACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Bridge Types
3
+ *
4
+ * Types for bridging splay's rendering model with client's procedure system.
5
+ */
6
+ import type { ComponentOutput, Size } from "./components/index.js";
7
+ /**
8
+ * Render context passed to component renderers.
9
+ * Compatible with splay's RenderContext interface.
10
+ */
11
+ export interface RenderContext<TData = unknown> {
12
+ /** Data to render */
13
+ data: TData;
14
+ /** Available size for rendering */
15
+ size: Size;
16
+ /** Path in the render tree */
17
+ path: string;
18
+ /** Depth in the render tree */
19
+ depth: number;
20
+ /** Render a child component */
21
+ render: (data: unknown, size: Size, path: string) => ComponentOutput | Promise<ComponentOutput>;
22
+ }
23
+ /**
24
+ * Component renderer function.
25
+ */
26
+ export type ComponentRenderer<TOutput = ComponentOutput> = (ctx: RenderContext) => TOutput | Promise<TOutput>;
27
+ /**
28
+ * Streaming component renderer function.
29
+ */
30
+ export type StreamingComponentRenderer<TOutput = ComponentOutput> = (ctx: RenderContext) => AsyncIterable<TOutput>;
31
+ /**
32
+ * Registry interface compatible with splay.
33
+ */
34
+ export interface Registry<TOutput = ComponentOutput> {
35
+ /** Get a renderer for a component type */
36
+ get(type: string): ComponentRenderer<TOutput> | undefined;
37
+ /** Check if a renderer exists */
38
+ has(type: string): boolean;
39
+ /** Register a renderer (throws - use client procedures instead) */
40
+ register(type: string, renderer: ComponentRenderer<TOutput>): void;
41
+ }
42
+ /**
43
+ * Streaming registry interface.
44
+ */
45
+ export interface StreamingRegistry<TOutput = ComponentOutput> {
46
+ /** Get a streaming renderer for a component type */
47
+ get(type: string): StreamingComponentRenderer<TOutput> | undefined;
48
+ /** Check if a renderer exists */
49
+ has(type: string): boolean;
50
+ }
51
+ /**
52
+ * Options for creating a client registry.
53
+ */
54
+ export interface ClientRegistryOptions {
55
+ /** Namespace prefix for component lookups (e.g., "ui" → "components.ui.{type}") */
56
+ namespace?: string;
57
+ /** Default size for components without explicit size */
58
+ defaultSize?: Size;
59
+ }
60
+ /**
61
+ * Options for creating a streaming registry.
62
+ */
63
+ export interface StreamingRegistryOptions extends ClientRegistryOptions {
64
+ /** Buffer size for streaming backpressure */
65
+ bufferSize?: number;
66
+ }
67
+ /**
68
+ * Component map for hydration.
69
+ * Maps component type names to framework-specific components.
70
+ */
71
+ export type ComponentMap<TComponent = unknown> = Record<string, TComponent>;
72
+ /**
73
+ * Hydration options.
74
+ */
75
+ export interface HydrateOptions<TComponent = unknown> {
76
+ /** Map of component types to framework components */
77
+ components: ComponentMap<TComponent>;
78
+ /** Fallback component for unknown types */
79
+ fallback?: TComponent;
80
+ /** Handler for null outputs */
81
+ onNull?: () => TComponent | null;
82
+ /** Handler for fragments */
83
+ onFragment?: (children: TComponent[]) => TComponent;
84
+ }
85
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAMnE;;;GAGG;AACH,MAAM,WAAW,aAAa,CAAC,KAAK,GAAG,OAAO;IAC5C,qBAAqB;IACrB,IAAI,EAAE,KAAK,CAAC;IACZ,mCAAmC;IACnC,IAAI,EAAE,IAAI,CAAC;IACX,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,MAAM,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,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AAM,MAAM,YAAY,CAAC,UAAU,GAAG,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,UAAU,GAAG,OAAO;IAClD,qDAAqD;IACrD,UAAU,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IACrC,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,UAAU,GAAG,IAAI,CAAC;IACjC,4BAA4B;IAC5B,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,KAAK,UAAU,CAAC;CACrD"}
package/dist/types.js ADDED
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Bridge Types
3
+ *
4
+ * Types for bridging splay's rendering model with client's procedure system.
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
package/package.json CHANGED
@@ -1,6 +1,79 @@
1
1
  {
2
+ "$schema": "https://json.schemastore.org/package",
2
3
  "name": "@procedures/splay",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
4
+ "version": "0.2.0",
5
+ "description": "Render procedure results with splay: a bridge between the client procedures and the splay recursive renderer, with stream helpers.",
6
+ "keywords": [
7
+ "splay",
8
+ "rendering",
9
+ "components",
10
+ "streams",
11
+ "procedures"
12
+ ],
13
+ "homepage": "https://mark1russell7.github.io/client/",
14
+ "bugs": {
15
+ "url": "https://github.com/mark1russell7/client/issues"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/mark1russell7/client.git",
20
+ "directory": "packages/client-splay"
21
+ },
22
+ "license": "MIT",
23
+ "author": "Mark Russell (https://github.com/mark1russell7)",
24
+ "type": "module",
25
+ "main": "./dist/index.js",
26
+ "types": "./dist/index.d.ts",
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/index.d.ts",
30
+ "import": "./dist/index.js"
31
+ },
32
+ "./module": {
33
+ "types": "./dist/module.d.ts",
34
+ "import": "./dist/module.js"
35
+ },
36
+ "./register": {
37
+ "types": "./dist/register.d.ts",
38
+ "import": "./dist/register.js"
39
+ }
40
+ },
41
+ "files": [
42
+ "dist",
43
+ "src",
44
+ "!src/**/*.test.ts",
45
+ "!src/**/*.test.tsx",
46
+ "!src/**/__tests__",
47
+ "CHANGELOG.md"
48
+ ],
49
+ "sideEffects": [
50
+ "./dist/register.js"
51
+ ],
52
+ "engines": {
53
+ "node": ">=22"
54
+ },
55
+ "publishConfig": {
56
+ "access": "public",
57
+ "provenance": true
58
+ },
59
+ "client": {
60
+ "procedures": "./dist/register.js"
61
+ },
62
+ "devDependencies": {
63
+ "typescript": "^7.0.2",
64
+ "@types/node": "^22.0.0",
65
+ "@mark1russell7/cue": "^1.0.0",
66
+ "vitest": "^5.0.3"
67
+ },
68
+ "dependencies": {
69
+ "@procedures/client": "0.2.0",
70
+ "@mark1russell7/splay": "^0.1.0"
71
+ },
72
+ "scripts": {
73
+ "build": "tsc -b",
74
+ "typecheck": "tsc --noEmit",
75
+ "clean": "rm -rf dist .tsbuildinfo",
76
+ "test": "vitest run",
77
+ "test:watch": "vitest"
78
+ }
6
79
  }