@vistagenic/vista 0.2.1 → 0.2.3

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 (38) hide show
  1. package/LICENSE +21 -0
  2. package/bin/vista.js +30 -20
  3. package/dist/bin/build-rsc.js +6 -4
  4. package/dist/bin/generate.d.ts +7 -0
  5. package/dist/bin/generate.js +248 -0
  6. package/dist/config.d.ts +19 -0
  7. package/dist/config.js +62 -4
  8. package/dist/server/engine.js +23 -57
  9. package/dist/server/rsc-engine.js +21 -48
  10. package/dist/server/static-generator.js +98 -0
  11. package/dist/server/structure-validator.js +1 -1
  12. package/dist/server/typed-api-runtime.d.ts +16 -0
  13. package/dist/server/typed-api-runtime.js +336 -0
  14. package/dist/stack/client/create-client.d.ts +2 -0
  15. package/dist/stack/client/create-client.js +195 -0
  16. package/dist/stack/client/error.d.ts +18 -0
  17. package/dist/stack/client/error.js +22 -0
  18. package/dist/stack/client/index.d.ts +9 -0
  19. package/dist/stack/client/index.js +13 -0
  20. package/dist/stack/client/types.d.ts +39 -0
  21. package/dist/stack/client/types.js +2 -0
  22. package/dist/stack/index.d.ts +32 -0
  23. package/dist/stack/index.js +45 -0
  24. package/dist/stack/server/executor.d.ts +36 -0
  25. package/dist/stack/server/executor.js +174 -0
  26. package/dist/stack/server/index.d.ts +10 -0
  27. package/dist/stack/server/index.js +23 -0
  28. package/dist/stack/server/merge-routers.d.ts +2 -0
  29. package/dist/stack/server/merge-routers.js +80 -0
  30. package/dist/stack/server/procedure.d.ts +18 -0
  31. package/dist/stack/server/procedure.js +58 -0
  32. package/dist/stack/server/router.d.ts +9 -0
  33. package/dist/stack/server/router.js +80 -0
  34. package/dist/stack/server/serialization.d.ts +9 -0
  35. package/dist/stack/server/serialization.js +119 -0
  36. package/dist/stack/server/types.d.ts +100 -0
  37. package/dist/stack/server/types.js +2 -0
  38. package/package.json +11 -2
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mergeRouters = mergeRouters;
4
+ const procedure_1 = require("./procedure");
5
+ const router_1 = require("./router");
6
+ function isObjectRecord(value) {
7
+ return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
8
+ }
9
+ function mergeProcedureRecords(target, source, currentPath = '') {
10
+ for (const [key, sourceNode] of Object.entries(source)) {
11
+ const scopedPath = [currentPath, key].filter(Boolean).join('/');
12
+ const targetNode = target[key];
13
+ if (targetNode === undefined) {
14
+ target[key] = sourceNode;
15
+ continue;
16
+ }
17
+ if ((0, procedure_1.isOperation)(targetNode) && (0, procedure_1.isOperation)(sourceNode)) {
18
+ throw new Error(`Duplicate procedure found while merging routers: "${scopedPath}"`);
19
+ }
20
+ if (isObjectRecord(targetNode) && isObjectRecord(sourceNode)) {
21
+ target[key] = mergeProcedureRecords(targetNode, sourceNode, scopedPath);
22
+ continue;
23
+ }
24
+ throw new Error(`Incompatible procedure nodes while merging routers: "${scopedPath}"`);
25
+ }
26
+ return target;
27
+ }
28
+ function mergeRouters(...routers) {
29
+ const mergedProcedures = {};
30
+ const mergedRoutes = {};
31
+ const mergedMiddlewares = [];
32
+ let sharedErrorHandler;
33
+ for (const router of routers) {
34
+ mergeProcedureRecords(mergedProcedures, router.procedures);
35
+ for (const [path, operation] of Object.entries(router.routes)) {
36
+ const normalizedPath = (0, router_1.normalizeStackRoutePath)(path);
37
+ if (mergedRoutes[normalizedPath]) {
38
+ throw new Error(`Duplicate route found while merging routers: "${normalizedPath}"`);
39
+ }
40
+ mergedRoutes[normalizedPath] = operation;
41
+ }
42
+ mergedMiddlewares.push(...router.metadata.globalMiddlewares);
43
+ if (router.metadata.errorHandler) {
44
+ if (sharedErrorHandler && sharedErrorHandler !== router.metadata.errorHandler) {
45
+ throw new Error('Cannot merge routers with different error handlers.');
46
+ }
47
+ sharedErrorHandler = router.metadata.errorHandler;
48
+ }
49
+ }
50
+ const procedureMeta = {};
51
+ for (const [path, operation] of Object.entries(mergedRoutes)) {
52
+ procedureMeta[path] = { type: operation.type };
53
+ }
54
+ const metadata = {
55
+ basePath: '',
56
+ globalMiddlewares: mergedMiddlewares,
57
+ procedures: procedureMeta,
58
+ registeredPaths: Object.keys(mergedRoutes),
59
+ errorHandler: sharedErrorHandler,
60
+ };
61
+ return {
62
+ procedures: mergedProcedures,
63
+ routes: mergedRoutes,
64
+ metadata,
65
+ resolve(path, method) {
66
+ const normalizedPath = (0, router_1.normalizeStackRoutePath)(path);
67
+ const operation = mergedRoutes[normalizedPath];
68
+ if (!operation) {
69
+ return null;
70
+ }
71
+ if (operation.type !== String(method).toLowerCase()) {
72
+ return null;
73
+ }
74
+ return {
75
+ path: normalizedPath,
76
+ operation,
77
+ };
78
+ },
79
+ };
80
+ }
@@ -0,0 +1,18 @@
1
+ import type { GetOperation, InferMiddlewareOutput, InferSchemaInput, MiddlewareFunction, PostOperation, Prettify, ProcedureHandler, SchemaLike } from './types';
2
+ type ProcedureOutputFormat = 'json';
3
+ interface ProcedureBuilderState<TEnv> {
4
+ schema?: SchemaLike<any>;
5
+ middlewares: MiddlewareFunction<any, any, TEnv>[];
6
+ outputFormat: ProcedureOutputFormat;
7
+ }
8
+ export interface ProcedureBuilder<TCtx, TEnv, TInput = void> {
9
+ use<TMiddleware extends MiddlewareFunction<TCtx, any, TEnv>>(middleware: TMiddleware): ProcedureBuilder<Prettify<TCtx & InferMiddlewareOutput<TMiddleware>>, TEnv, TInput>;
10
+ input<TSchema extends SchemaLike<any>>(schema: TSchema): ProcedureBuilder<TCtx, TEnv, InferSchemaInput<TSchema>>;
11
+ query<TOutput>(handler: ProcedureHandler<TCtx, TInput, TEnv, TOutput>): GetOperation<TInput, TOutput, TCtx, TEnv>;
12
+ mutation<TOutput>(handler: ProcedureHandler<TCtx, TInput, TEnv, TOutput>): PostOperation<TInput, TOutput, TCtx, TEnv>;
13
+ get<TOutput>(handler: ProcedureHandler<TCtx, TInput, TEnv, TOutput>): GetOperation<TInput, TOutput, TCtx, TEnv>;
14
+ post<TOutput>(handler: ProcedureHandler<TCtx, TInput, TEnv, TOutput>): PostOperation<TInput, TOutput, TCtx, TEnv>;
15
+ }
16
+ export declare function createProcedureBuilder<TCtx = {}, TEnv = unknown, TInput = void>(state?: Partial<ProcedureBuilderState<TEnv>>): ProcedureBuilder<TCtx, TEnv, TInput>;
17
+ export declare function isOperation(value: unknown): value is GetOperation | PostOperation;
18
+ export {};
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createProcedureBuilder = createProcedureBuilder;
4
+ exports.isOperation = isOperation;
5
+ function cloneState(state) {
6
+ return {
7
+ schema: state?.schema,
8
+ middlewares: [...(state?.middlewares ?? [])],
9
+ outputFormat: state?.outputFormat ?? 'json',
10
+ };
11
+ }
12
+ function createOperation(type, state, handler) {
13
+ return {
14
+ type,
15
+ schema: state.schema,
16
+ handler,
17
+ middlewares: [...state.middlewares],
18
+ outputFormat: state.outputFormat,
19
+ };
20
+ }
21
+ function createProcedureBuilder(state) {
22
+ const currentState = cloneState(state);
23
+ return {
24
+ use(middleware) {
25
+ return createProcedureBuilder({
26
+ ...currentState,
27
+ middlewares: [...currentState.middlewares, middleware],
28
+ });
29
+ },
30
+ input(schema) {
31
+ return createProcedureBuilder({
32
+ ...currentState,
33
+ schema,
34
+ });
35
+ },
36
+ query(handler) {
37
+ return createOperation('get', currentState, handler);
38
+ },
39
+ mutation(handler) {
40
+ return createOperation('post', currentState, handler);
41
+ },
42
+ get(handler) {
43
+ return createOperation('get', currentState, handler);
44
+ },
45
+ post(handler) {
46
+ return createOperation('post', currentState, handler);
47
+ },
48
+ };
49
+ }
50
+ function isOperation(value) {
51
+ if (!value || typeof value !== 'object') {
52
+ return false;
53
+ }
54
+ const candidate = value;
55
+ return ((candidate.type === 'get' || candidate.type === 'post') &&
56
+ typeof candidate.handler === 'function' &&
57
+ Array.isArray(candidate.middlewares));
58
+ }
@@ -0,0 +1,9 @@
1
+ import type { MiddlewareFunction, ProcedureRecord, StackErrorHandler, StackRouter } from './types';
2
+ export interface CreateRouterOptions<TEnv = unknown> {
3
+ basePath?: string;
4
+ middlewares?: MiddlewareFunction<any, any, TEnv>[];
5
+ errorHandler?: StackErrorHandler;
6
+ config?: Record<string, unknown>;
7
+ }
8
+ export declare function createRouter<TProcedures extends ProcedureRecord, TCtx = {}, TEnv = unknown>(procedures: TProcedures, options?: CreateRouterOptions<TEnv>): StackRouter<TProcedures, TCtx, TEnv>;
9
+ export declare function normalizeStackRoutePath(path: string): string;
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createRouter = createRouter;
4
+ exports.normalizeStackRoutePath = normalizeStackRoutePath;
5
+ const procedure_1 = require("./procedure");
6
+ function normalizePathSegment(path) {
7
+ return path
8
+ .split('/')
9
+ .map((segment) => segment.trim())
10
+ .filter(Boolean)
11
+ .join('/');
12
+ }
13
+ function normalizeBasePath(basePath = '') {
14
+ const normalized = normalizePathSegment(basePath);
15
+ return normalized ? `/${normalized}` : '';
16
+ }
17
+ function normalizeRoutePath(basePath, relativePath) {
18
+ const normalizedRelativePath = normalizePathSegment(relativePath);
19
+ const normalizedBasePath = normalizeBasePath(basePath);
20
+ const combined = normalizePathSegment([normalizedBasePath, normalizedRelativePath].filter(Boolean).join('/'));
21
+ return combined ? `/${combined}` : '/';
22
+ }
23
+ function flattenProcedures(procedures, basePath, currentPath, routes) {
24
+ for (const [segment, node] of Object.entries(procedures)) {
25
+ const nextPath = [currentPath, segment].filter(Boolean).join('/');
26
+ if ((0, procedure_1.isOperation)(node)) {
27
+ const routePath = normalizeRoutePath(basePath, nextPath);
28
+ if (routes[routePath]) {
29
+ throw new Error(`Duplicate stack route detected: "${routePath}"`);
30
+ }
31
+ routes[routePath] = node;
32
+ continue;
33
+ }
34
+ if (node && typeof node === 'object' && !Array.isArray(node)) {
35
+ flattenProcedures(node, basePath, nextPath, routes);
36
+ continue;
37
+ }
38
+ throw new Error(`Invalid procedure node at "${nextPath || '/'}"`);
39
+ }
40
+ }
41
+ function createRouter(procedures, options = {}) {
42
+ const basePath = options.basePath ?? '';
43
+ const globalMiddlewares = [...(options.middlewares ?? [])];
44
+ const routes = {};
45
+ flattenProcedures(procedures, basePath, '', routes);
46
+ const procedureMeta = {};
47
+ for (const [path, operation] of Object.entries(routes)) {
48
+ procedureMeta[path] = { type: operation.type };
49
+ }
50
+ const metadata = {
51
+ basePath: normalizeBasePath(basePath),
52
+ globalMiddlewares,
53
+ procedures: procedureMeta,
54
+ registeredPaths: Object.keys(routes),
55
+ errorHandler: options.errorHandler,
56
+ config: options.config,
57
+ };
58
+ return {
59
+ procedures,
60
+ routes: routes,
61
+ metadata,
62
+ resolve(path, method) {
63
+ const normalizedPath = normalizeRoutePath('', path);
64
+ const route = routes[normalizedPath];
65
+ if (!route) {
66
+ return null;
67
+ }
68
+ if (route.type !== String(method).toLowerCase()) {
69
+ return null;
70
+ }
71
+ return {
72
+ path: normalizedPath,
73
+ operation: route,
74
+ };
75
+ },
76
+ };
77
+ }
78
+ function normalizeStackRoutePath(path) {
79
+ return normalizeRoutePath('', path);
80
+ }
@@ -0,0 +1,9 @@
1
+ import type { StackSerializationMode } from './types';
2
+ export interface StackSerializer {
3
+ mode: StackSerializationMode;
4
+ serialize(value: unknown): unknown;
5
+ deserialize(value: unknown): unknown;
6
+ }
7
+ export declare function serializeWithMode(value: unknown, mode?: StackSerializationMode): unknown;
8
+ export declare function deserializeWithMode<T = unknown>(value: unknown, mode?: StackSerializationMode): T;
9
+ export declare function createSerializer(mode?: StackSerializationMode): StackSerializer;
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.serializeWithMode = serializeWithMode;
4
+ exports.deserializeWithMode = deserializeWithMode;
5
+ exports.createSerializer = createSerializer;
6
+ const SUPERJSON_TYPE_KEY = '__vistaSuperType';
7
+ const SUPERJSON_VALUE_KEY = 'value';
8
+ function isPlainObject(value) {
9
+ if (!value || typeof value !== 'object') {
10
+ return false;
11
+ }
12
+ return Object.getPrototypeOf(value) === Object.prototype;
13
+ }
14
+ function isTagged(value) {
15
+ if (!isPlainObject(value)) {
16
+ return false;
17
+ }
18
+ return typeof value[SUPERJSON_TYPE_KEY] === 'string' && SUPERJSON_VALUE_KEY in value;
19
+ }
20
+ function encodeSuperJson(value) {
21
+ if (value instanceof Date) {
22
+ return {
23
+ [SUPERJSON_TYPE_KEY]: 'Date',
24
+ [SUPERJSON_VALUE_KEY]: value.toISOString(),
25
+ };
26
+ }
27
+ if (typeof value === 'bigint') {
28
+ return {
29
+ [SUPERJSON_TYPE_KEY]: 'BigInt',
30
+ [SUPERJSON_VALUE_KEY]: value.toString(),
31
+ };
32
+ }
33
+ if (value instanceof Map) {
34
+ return {
35
+ [SUPERJSON_TYPE_KEY]: 'Map',
36
+ [SUPERJSON_VALUE_KEY]: Array.from(value.entries()).map(([key, mapValue]) => [
37
+ encodeSuperJson(key),
38
+ encodeSuperJson(mapValue),
39
+ ]),
40
+ };
41
+ }
42
+ if (value instanceof Set) {
43
+ return {
44
+ [SUPERJSON_TYPE_KEY]: 'Set',
45
+ [SUPERJSON_VALUE_KEY]: Array.from(value.values()).map((entry) => encodeSuperJson(entry)),
46
+ };
47
+ }
48
+ if (Array.isArray(value)) {
49
+ return value.map((entry) => encodeSuperJson(entry));
50
+ }
51
+ if (isPlainObject(value)) {
52
+ const encoded = {};
53
+ for (const [key, entry] of Object.entries(value)) {
54
+ encoded[key] = encodeSuperJson(entry);
55
+ }
56
+ return encoded;
57
+ }
58
+ return value;
59
+ }
60
+ function decodeSuperJson(value) {
61
+ if (Array.isArray(value)) {
62
+ return value.map((entry) => decodeSuperJson(entry));
63
+ }
64
+ if (isTagged(value)) {
65
+ const type = value[SUPERJSON_TYPE_KEY];
66
+ const taggedValue = value[SUPERJSON_VALUE_KEY];
67
+ if (type === 'Date') {
68
+ return new Date(String(taggedValue));
69
+ }
70
+ if (type === 'BigInt') {
71
+ return BigInt(String(taggedValue));
72
+ }
73
+ if (type === 'Map') {
74
+ const entries = Array.isArray(taggedValue) ? taggedValue : [];
75
+ return new Map(entries.map((entry) => {
76
+ const pair = Array.isArray(entry) ? entry : [undefined, undefined];
77
+ return [decodeSuperJson(pair[0]), decodeSuperJson(pair[1])];
78
+ }));
79
+ }
80
+ if (type === 'Set') {
81
+ const values = Array.isArray(taggedValue) ? taggedValue : [];
82
+ return new Set(values.map((entry) => decodeSuperJson(entry)));
83
+ }
84
+ }
85
+ if (isPlainObject(value)) {
86
+ const decoded = {};
87
+ for (const [key, entry] of Object.entries(value)) {
88
+ decoded[key] = decodeSuperJson(entry);
89
+ }
90
+ return decoded;
91
+ }
92
+ return value;
93
+ }
94
+ function cloneJson(value) {
95
+ return JSON.parse(JSON.stringify(value));
96
+ }
97
+ function serializeWithMode(value, mode = 'json') {
98
+ if (mode === 'superjson') {
99
+ return encodeSuperJson(value);
100
+ }
101
+ return cloneJson(value);
102
+ }
103
+ function deserializeWithMode(value, mode = 'json') {
104
+ if (mode === 'superjson') {
105
+ return decodeSuperJson(value);
106
+ }
107
+ return value;
108
+ }
109
+ function createSerializer(mode = 'json') {
110
+ return {
111
+ mode,
112
+ serialize(value) {
113
+ return serializeWithMode(value, mode);
114
+ },
115
+ deserialize(value) {
116
+ return deserializeWithMode(value, mode);
117
+ },
118
+ };
119
+ }
@@ -0,0 +1,100 @@
1
+ export type MaybePromise<T> = T | Promise<T>;
2
+ export type StackSerializationMode = 'json' | 'superjson';
3
+ export interface SchemaLike<T = unknown> {
4
+ parse(value: unknown): T;
5
+ }
6
+ export type InferSchemaInput<TSchema> = TSchema extends SchemaLike<infer T> ? T : void;
7
+ export type Prettify<T> = {
8
+ [K in keyof T]: T[K];
9
+ } & {};
10
+ export type UnionToIntersection<TUnion> = (TUnion extends unknown ? (value: TUnion) => void : never) extends (value: infer TIntersection) => void ? TIntersection : never;
11
+ type JoinPath<TLeft extends string, TRight extends string> = TLeft extends '' ? TRight : `${TLeft}/${TRight}`;
12
+ export interface StackRequestLike {
13
+ method?: string;
14
+ path?: string;
15
+ query?: Record<string, unknown>;
16
+ body?: unknown;
17
+ headers?: Record<string, string | string[] | undefined>;
18
+ [key: string]: unknown;
19
+ }
20
+ export interface StackResponseToolkit {
21
+ json<T>(data: T, init?: number | ResponseInit): Response;
22
+ text(data: string, init?: number | ResponseInit): Response;
23
+ superjson<T>(data: T, init?: number | ResponseInit): Response;
24
+ }
25
+ export interface ProcedureHandlerParams<TCtx, TInput, TEnv> {
26
+ ctx: TCtx;
27
+ input: TInput;
28
+ env: TEnv;
29
+ req: StackRequestLike;
30
+ c: StackResponseToolkit;
31
+ }
32
+ export type ProcedureHandler<TCtx, TInput, TEnv, TOutput> = (params: ProcedureHandlerParams<TCtx, TInput, TEnv>) => MaybePromise<TOutput>;
33
+ export interface MiddlewareParams<TCtx, TEnv> {
34
+ ctx: TCtx;
35
+ env: TEnv;
36
+ req: StackRequestLike;
37
+ c: StackResponseToolkit;
38
+ next<TAdded extends Record<string, unknown> = {}>(extension?: TAdded): Promise<TCtx & TAdded>;
39
+ }
40
+ export type MiddlewareFunction<TCtx = {}, TReturn = void, TEnv = unknown> = (params: MiddlewareParams<TCtx, TEnv>) => MaybePromise<TReturn | void>;
41
+ export type NormalizeMiddlewareResult<TValue> = TValue extends void | undefined ? {} : TValue extends Record<string, unknown> ? TValue : {};
42
+ export interface OperationBase<TInput, TOutput, TCtx, TEnv> {
43
+ schema?: SchemaLike<TInput>;
44
+ handler: ProcedureHandler<TCtx, TInput, TEnv, TOutput>;
45
+ middlewares: MiddlewareFunction<any, any, TEnv>[];
46
+ outputFormat: 'json';
47
+ }
48
+ export interface GetOperation<TInput = void, TOutput = unknown, TCtx = {}, TEnv = unknown> extends OperationBase<TInput, TOutput, TCtx, TEnv> {
49
+ type: 'get';
50
+ }
51
+ export interface PostOperation<TInput = void, TOutput = unknown, TCtx = {}, TEnv = unknown> extends OperationBase<TInput, TOutput, TCtx, TEnv> {
52
+ type: 'post';
53
+ }
54
+ export type OperationType<TInput = unknown, TOutput = unknown, TCtx = {}, TEnv = unknown> = GetOperation<TInput, TOutput, TCtx, TEnv> | PostOperation<TInput, TOutput, TCtx, TEnv>;
55
+ export interface ProcedureRecord {
56
+ [key: string]: ProcedureNode;
57
+ }
58
+ export type ProcedureNode = OperationType<any, any, any, any> | ProcedureRecord;
59
+ type FlatRouteMapUnion<TRecord extends Record<string, any>, TPrefix extends string> = {
60
+ [TKey in Extract<keyof TRecord, string>]: TRecord[TKey] extends OperationType<any, any, any, any> ? {
61
+ [TPath in JoinPath<TPrefix, TKey>]: TRecord[TKey];
62
+ } : TRecord[TKey] extends Record<string, any> ? FlatRouteMapUnion<TRecord[TKey], JoinPath<TPrefix, TKey>> : never;
63
+ }[Extract<keyof TRecord, string>];
64
+ type FlatRouteMapInternal<TRecord extends Record<string, any>> = [
65
+ FlatRouteMapUnion<TRecord, ''>
66
+ ] extends [never] ? {} : UnionToIntersection<FlatRouteMapUnion<TRecord, ''>>;
67
+ export type FlatRouteMap<TRecord extends Record<string, any>> = Prettify<FlatRouteMapInternal<TRecord>>;
68
+ export type InferMiddlewareOutput<TMiddleware> = TMiddleware extends MiddlewareFunction<any, infer TOutput, any> ? NormalizeMiddlewareResult<TOutput> : {};
69
+ export interface StackErrorWithStatus {
70
+ status?: number;
71
+ message?: string;
72
+ }
73
+ export type StackErrorHandler = (error: unknown, req?: StackRequestLike) => Response;
74
+ export interface ResolvedRoute<TEnv = unknown> {
75
+ path: string;
76
+ operation: OperationType<any, any, any, TEnv>;
77
+ }
78
+ export interface RouterMetadata {
79
+ basePath: string;
80
+ globalMiddlewares: unknown[];
81
+ procedures: Record<string, {
82
+ type: 'get' | 'post';
83
+ }>;
84
+ registeredPaths: string[];
85
+ errorHandler?: StackErrorHandler;
86
+ config?: Record<string, unknown>;
87
+ }
88
+ export interface StackRouter<TProcedures extends ProcedureRecord, TCtx = {}, TEnv = unknown> {
89
+ procedures: TProcedures;
90
+ routes: FlatRouteMap<TProcedures>;
91
+ metadata: RouterMetadata;
92
+ resolve(path: string, method: string): ResolvedRoute<TEnv> | null;
93
+ }
94
+ export interface StackExecutionContext<TCtx, TEnv> {
95
+ ctx: TCtx;
96
+ env: TEnv;
97
+ req: StackRequestLike;
98
+ c: StackResponseToolkit;
99
+ }
100
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vistagenic/vista",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "The React Framework for Visionaries - Rust-powered SSR with Server Components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -77,6 +77,14 @@
77
77
  "types": "./dist/config.d.ts",
78
78
  "default": "./dist/config.js"
79
79
  },
80
+ "./stack": {
81
+ "types": "./dist/stack/index.d.ts",
82
+ "default": "./dist/stack/index.js"
83
+ },
84
+ "./stack/client": {
85
+ "types": "./dist/stack/client/index.d.ts",
86
+ "default": "./dist/stack/client/index.js"
87
+ },
80
88
  "./client/rsc-router": {
81
89
  "types": "./dist/client/rsc-router.d.ts",
82
90
  "default": "./dist/client/rsc-router.js"
@@ -124,5 +132,6 @@
124
132
  "@types/webpack": "^5.28.5",
125
133
  "@types/webpack-hot-middleware": "^2.25.9",
126
134
  "typescript": "^5.7.2"
127
- }
135
+ },
136
+ "gitHead": "4a9f1db26023c01465b997f6955b3d3a57b6ac84"
128
137
  }