@ontrails/vite 1.0.0-beta.15

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.
@@ -0,0 +1 @@
1
+ $ tsc -b
@@ -0,0 +1,3 @@
1
+ $ oxlint ./src
2
+ Found 0 warnings and 0 errors.
3
+ Finished in 77ms on 2 files with 93 rules using 24 threads.
@@ -0,0 +1 @@
1
+ $ tsc --noEmit
package/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ # @ontrails/vite
2
+
3
+ ## 1.0.0-beta.15
package/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # `@ontrails/vite`
2
+
3
+ Bridge a fetch-based Trails HTTP surface into Vite's dev-server middleware stack.
4
+
5
+ ```ts
6
+ import { createApp } from '@ontrails/hono';
7
+ import { vite } from '@ontrails/vite';
8
+ import { defineConfig } from 'vite';
9
+
10
+ import { graph } from './src/app';
11
+
12
+ export default defineConfig({
13
+ plugins: [
14
+ {
15
+ name: 'trails-surface',
16
+ configureServer(server) {
17
+ server.middlewares.use('/api', vite(createApp(graph)));
18
+ },
19
+ },
20
+ ],
21
+ });
22
+ ```
23
+
24
+ Mount the middleware under the path segment you want Vite to delegate to Trails.
@@ -0,0 +1,15 @@
1
+ import type { IncomingMessage, ServerResponse } from 'node:http';
2
+ export interface FetchSurface {
3
+ fetch(request: Request): Response | Promise<Response>;
4
+ }
5
+ export type ViteMiddlewareNext = (error?: unknown) => void;
6
+ export type ViteMiddleware = (req: IncomingMessage, res: ServerResponse, next: ViteMiddlewareNext) => void | Promise<void>;
7
+ /**
8
+ * Convert a fetch-based HTTP surface into Vite/Connect middleware.
9
+ *
10
+ * Mount it under the path segment that should resolve through Trails:
11
+ *
12
+ * `server.middlewares.use('/api', vite(createApp(graph)))`
13
+ */
14
+ export declare const vite: (app: FetchSurface) => ViteMiddleware;
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAKjE,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACvD;AAED,MAAM,MAAM,kBAAkB,GAAG,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;AAE3D,MAAM,MAAM,cAAc,GAAG,CAC3B,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE,kBAAkB,KACrB,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AA+G1B;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,GACd,KAAK,YAAY,KAAG,cASpB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,94 @@
1
+ import { Readable } from 'node:stream';
2
+ import { pipeline } from 'node:stream/promises';
3
+ const BODYLESS_METHODS = new Set(['GET', 'HEAD']);
4
+ const appendHeader = (headers, name, value) => {
5
+ if (typeof value === 'string') {
6
+ headers.append(name, value);
7
+ return;
8
+ }
9
+ for (const item of value) {
10
+ headers.append(name, item);
11
+ }
12
+ };
13
+ const toRequestHeaders = (req) => {
14
+ const headers = new Headers();
15
+ for (const [name, value] of Object.entries(req.headers)) {
16
+ if (value === undefined) {
17
+ continue;
18
+ }
19
+ appendHeader(headers, name, value);
20
+ }
21
+ return headers;
22
+ };
23
+ const toRequestInit = (req) => {
24
+ const method = req.method ?? 'GET';
25
+ const headers = toRequestHeaders(req);
26
+ if (BODYLESS_METHODS.has(method)) {
27
+ return { headers, method };
28
+ }
29
+ return {
30
+ body: Readable.toWeb(req),
31
+ duplex: 'half',
32
+ headers,
33
+ method,
34
+ };
35
+ };
36
+ const toRequest = (req) => {
37
+ const host = req.headers.host ?? 'localhost';
38
+ const url = new URL(req.url ?? '/', `http://${host}`);
39
+ return new Request(url, toRequestInit(req));
40
+ };
41
+ const readSetCookieHeaders = (headers) => {
42
+ const cookieHeaders = headers;
43
+ if (typeof cookieHeaders.getSetCookie === 'function') {
44
+ return cookieHeaders.getSetCookie();
45
+ }
46
+ if (typeof cookieHeaders.getAll === 'function') {
47
+ return cookieHeaders.getAll('set-cookie');
48
+ }
49
+ const value = headers.get('set-cookie');
50
+ return value === null ? [] : [value];
51
+ };
52
+ const writeHeaders = (response, res) => {
53
+ const setCookie = readSetCookieHeaders(response.headers);
54
+ if (setCookie.length > 0) {
55
+ res.setHeader('set-cookie', [...setCookie]);
56
+ }
57
+ for (const [name, value] of response.headers) {
58
+ if (name.toLowerCase() === 'set-cookie') {
59
+ continue;
60
+ }
61
+ res.setHeader(name, value);
62
+ }
63
+ };
64
+ const writeResponse = async (req, res, response) => {
65
+ res.statusCode = response.status;
66
+ if (response.statusText.length > 0) {
67
+ res.statusMessage = response.statusText;
68
+ }
69
+ writeHeaders(response, res);
70
+ if (req.method === 'HEAD' || response.body === null) {
71
+ res.end();
72
+ return;
73
+ }
74
+ const body = Readable.fromWeb(response.body);
75
+ await pipeline(body, res);
76
+ };
77
+ /**
78
+ * Convert a fetch-based HTTP surface into Vite/Connect middleware.
79
+ *
80
+ * Mount it under the path segment that should resolve through Trails:
81
+ *
82
+ * `server.middlewares.use('/api', vite(createApp(graph)))`
83
+ */
84
+ export const vite = (app) => async (req, res, next) => {
85
+ try {
86
+ const response = await app.fetch(toRequest(req));
87
+ await writeResponse(req, res, response);
88
+ }
89
+ catch (error) {
90
+ // oxlint-disable-next-line promise/prefer-await-to-callbacks -- Connect middleware reports errors through next(error)
91
+ next(error);
92
+ }
93
+ };
94
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAA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AC"}
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "@ontrails/vite",
3
+ "version": "1.0.0-beta.15",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": "./src/index.ts",
7
+ "./package.json": "./package.json"
8
+ },
9
+ "scripts": {
10
+ "build": "tsc -b",
11
+ "test": "bun test",
12
+ "typecheck": "tsc --noEmit",
13
+ "lint": "oxlint ./src",
14
+ "clean": "rm -rf dist *.tsbuildinfo"
15
+ },
16
+ "devDependencies": {
17
+ "@ontrails/core": "^1.0.0-beta.14",
18
+ "@ontrails/hono": "^1.0.0-beta.14",
19
+ "zod": "^4.3.5"
20
+ }
21
+ }
@@ -0,0 +1,115 @@
1
+ import { describe, expect, test } from 'bun:test';
2
+ import { once } from 'node:events';
3
+ import { createServer } from 'node:http';
4
+ import type { IncomingMessage, ServerResponse } from 'node:http';
5
+ import type { AddressInfo } from 'node:net';
6
+
7
+ import { Result, trail, topo } from '@ontrails/core';
8
+ import { createApp } from '@ontrails/hono';
9
+ import { z } from 'zod';
10
+
11
+ import { vite } from '../index.js';
12
+ import type { ViteMiddleware } from '../index.js';
13
+
14
+ const echoTrail = trail('echo', {
15
+ blaze: (input) => Result.ok({ reply: input.message }),
16
+ input: z.object({ message: z.string() }),
17
+ intent: 'read',
18
+ output: z.object({ reply: z.string() }),
19
+ });
20
+
21
+ const submitTrail = trail('submit', {
22
+ blaze: (input) => Result.ok({ accepted: input.message }),
23
+ input: z.object({ message: z.string() }),
24
+ output: z.object({ accepted: z.string() }),
25
+ });
26
+
27
+ const graph = topo('vite-adapter', { echoTrail, submitTrail });
28
+
29
+ const handleMiddleware = async (
30
+ middleware: ViteMiddleware,
31
+ req: IncomingMessage,
32
+ res: ServerResponse
33
+ ): Promise<void> => {
34
+ const completion = Promise.withResolvers<undefined>();
35
+
36
+ // oxlint-disable-next-line promise/prefer-await-to-callbacks -- Connect middleware completes through next(error?)
37
+ const middlewarePromise = middleware(req, res, (error) => {
38
+ if (error !== undefined) {
39
+ completion.reject(error);
40
+ return;
41
+ }
42
+
43
+ completion.resolve();
44
+ });
45
+
46
+ try {
47
+ await Promise.race([middlewarePromise, completion.promise]);
48
+ } catch (error) {
49
+ res.statusCode = 500;
50
+ res.end(error instanceof Error ? error.message : String(error));
51
+ }
52
+ };
53
+
54
+ const startServer = async (
55
+ middleware: ViteMiddleware
56
+ ): Promise<{ readonly close: () => Promise<void>; readonly url: string }> => {
57
+ const server = createServer(async (req, res) => {
58
+ try {
59
+ await handleMiddleware(middleware, req, res);
60
+ } catch (error: unknown) {
61
+ res.statusCode = 500;
62
+ res.end(error instanceof Error ? error.message : String(error));
63
+ }
64
+ });
65
+
66
+ server.listen(0, '127.0.0.1');
67
+ await once(server, 'listening');
68
+
69
+ const address = server.address();
70
+ if (address === null || typeof address === 'string') {
71
+ throw new Error('Expected an ephemeral TCP address for the test server');
72
+ }
73
+
74
+ return {
75
+ close: async () => {
76
+ server.close();
77
+ await once(server, 'close');
78
+ },
79
+ url: `http://127.0.0.1:${(address as AddressInfo).port}`,
80
+ };
81
+ };
82
+
83
+ describe('Vite runtime adapter', () => {
84
+ test('vite(createApp(graph)) serves read trails through query params', async () => {
85
+ const handle = await startServer(vite(createApp(graph)));
86
+
87
+ try {
88
+ const response = await fetch(new URL('/echo?message=hello', handle.url));
89
+
90
+ expect(response.status).toBe(200);
91
+ expect(await response.json()).toEqual({ data: { reply: 'hello' } });
92
+ } finally {
93
+ await handle.close();
94
+ }
95
+ });
96
+
97
+ test('forwards JSON request bodies to write trails', async () => {
98
+ const handle = await startServer(vite(createApp(graph)));
99
+
100
+ try {
101
+ const response = await fetch(new URL('/submit', handle.url), {
102
+ body: JSON.stringify({ message: 'saved' }),
103
+ headers: { 'content-type': 'application/json' },
104
+ method: 'POST',
105
+ });
106
+
107
+ expect(response.status).toBe(200);
108
+ expect(await response.json()).toEqual({
109
+ data: { accepted: 'saved' },
110
+ });
111
+ } finally {
112
+ await handle.close();
113
+ }
114
+ });
115
+ });
package/src/index.ts ADDED
@@ -0,0 +1,144 @@
1
+ import type { IncomingMessage, ServerResponse } from 'node:http';
2
+ import { Readable } from 'node:stream';
3
+ import { pipeline } from 'node:stream/promises';
4
+ import type { ReadableStream as NodeReadableStream } from 'node:stream/web';
5
+
6
+ export interface FetchSurface {
7
+ fetch(request: Request): Response | Promise<Response>;
8
+ }
9
+
10
+ export type ViteMiddlewareNext = (error?: unknown) => void;
11
+
12
+ export type ViteMiddleware = (
13
+ req: IncomingMessage,
14
+ res: ServerResponse,
15
+ next: ViteMiddlewareNext
16
+ ) => void | Promise<void>;
17
+
18
+ type CookieReadableHeaders = Headers & {
19
+ readonly getAll?: (name: string) => string[];
20
+ readonly getSetCookie?: () => string[];
21
+ };
22
+
23
+ const BODYLESS_METHODS = new Set(['GET', 'HEAD']);
24
+
25
+ const appendHeader = (
26
+ headers: Headers,
27
+ name: string,
28
+ value: string | readonly string[]
29
+ ): void => {
30
+ if (typeof value === 'string') {
31
+ headers.append(name, value);
32
+ return;
33
+ }
34
+
35
+ for (const item of value) {
36
+ headers.append(name, item);
37
+ }
38
+ };
39
+
40
+ const toRequestHeaders = (req: IncomingMessage): Headers => {
41
+ const headers = new Headers();
42
+
43
+ for (const [name, value] of Object.entries(req.headers)) {
44
+ if (value === undefined) {
45
+ continue;
46
+ }
47
+
48
+ appendHeader(headers, name, value);
49
+ }
50
+
51
+ return headers;
52
+ };
53
+
54
+ const toRequestInit = (
55
+ req: IncomingMessage
56
+ ): RequestInit & { duplex?: 'half' } => {
57
+ const method = req.method ?? 'GET';
58
+ const headers = toRequestHeaders(req);
59
+
60
+ if (BODYLESS_METHODS.has(method)) {
61
+ return { headers, method };
62
+ }
63
+
64
+ return {
65
+ body: Readable.toWeb(req) as unknown as BodyInit,
66
+ duplex: 'half',
67
+ headers,
68
+ method,
69
+ };
70
+ };
71
+
72
+ const toRequest = (req: IncomingMessage): Request => {
73
+ const host = req.headers.host ?? 'localhost';
74
+ const url = new URL(req.url ?? '/', `http://${host}`);
75
+ return new Request(url, toRequestInit(req));
76
+ };
77
+
78
+ const readSetCookieHeaders = (headers: Headers): readonly string[] => {
79
+ const cookieHeaders = headers as CookieReadableHeaders;
80
+ if (typeof cookieHeaders.getSetCookie === 'function') {
81
+ return cookieHeaders.getSetCookie();
82
+ }
83
+ if (typeof cookieHeaders.getAll === 'function') {
84
+ return cookieHeaders.getAll('set-cookie');
85
+ }
86
+
87
+ const value = headers.get('set-cookie');
88
+ return value === null ? [] : [value];
89
+ };
90
+
91
+ const writeHeaders = (response: Response, res: ServerResponse): void => {
92
+ const setCookie = readSetCookieHeaders(response.headers);
93
+ if (setCookie.length > 0) {
94
+ res.setHeader('set-cookie', [...setCookie]);
95
+ }
96
+
97
+ for (const [name, value] of response.headers) {
98
+ if (name.toLowerCase() === 'set-cookie') {
99
+ continue;
100
+ }
101
+ res.setHeader(name, value);
102
+ }
103
+ };
104
+
105
+ const writeResponse = async (
106
+ req: IncomingMessage,
107
+ res: ServerResponse,
108
+ response: Response
109
+ ): Promise<void> => {
110
+ res.statusCode = response.status;
111
+ if (response.statusText.length > 0) {
112
+ res.statusMessage = response.statusText;
113
+ }
114
+ writeHeaders(response, res);
115
+
116
+ if (req.method === 'HEAD' || response.body === null) {
117
+ res.end();
118
+ return;
119
+ }
120
+
121
+ const body = Readable.fromWeb(
122
+ response.body as unknown as NodeReadableStream<Uint8Array>
123
+ );
124
+ await pipeline(body, res);
125
+ };
126
+
127
+ /**
128
+ * Convert a fetch-based HTTP surface into Vite/Connect middleware.
129
+ *
130
+ * Mount it under the path segment that should resolve through Trails:
131
+ *
132
+ * `server.middlewares.use('/api', vite(createApp(graph)))`
133
+ */
134
+ export const vite =
135
+ (app: FetchSurface): ViteMiddleware =>
136
+ async (req, res, next) => {
137
+ try {
138
+ const response = await app.fetch(toRequest(req));
139
+ await writeResponse(req, res, response);
140
+ } catch (error: unknown) {
141
+ // oxlint-disable-next-line promise/prefer-await-to-callbacks -- Connect middleware reports errors through next(error)
142
+ next(error);
143
+ }
144
+ };
package/tsconfig.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "dist",
5
+ "rootDir": "src"
6
+ },
7
+ "include": ["src"],
8
+ "exclude": ["**/__tests__/**", "**/*.test.ts", "dist"]
9
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "noEmit": true,
5
+ "rootDir": "./src",
6
+ "types": ["bun"]
7
+ },
8
+ "include": ["src/**/*.test.ts", "src/__tests__/**/*.ts"],
9
+ "exclude": []
10
+ }
@@ -0,0 +1 @@
1
+ {"root":["./src/index.ts"],"version":"5.9.3"}