@tailorkit/app 0.1.0-beta.29 → 0.1.0-beta.32
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.
- package/LICENSE.md +47 -174
- package/README.md +37 -38
- package/dist/chunk-7ZQPXG7O.js +34 -0
- package/dist/chunk-PJBDA2RU.js +415 -0
- package/dist/{chunk-STTKSRAI.js → chunk-UDXPIO6D.js} +267 -112
- package/dist/{chunk-ANTVMHDZ.js → chunk-YX3JURMG.js} +100 -59
- package/dist/client/connection.d.ts +11 -11
- package/dist/client/query-store.d.ts +2 -2
- package/dist/client/reference.d.ts +4 -4
- package/dist/client/session.d.ts +27 -4
- package/dist/client/tools.d.ts +11 -5
- package/dist/client-connection.js +4 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +3 -3
- package/dist/database/definition.d.ts +1 -1
- package/dist/database/schema.d.ts +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/preact.d.ts +5 -5
- package/dist/protocol.d.ts +23 -23
- package/dist/protocol.js +11 -9
- package/dist/routing.d.ts +4 -4
- package/dist/server/builder.d.ts +6 -6
- package/dist/server/bundle.d.ts +1 -6
- package/dist/server/functions.d.ts +19 -19
- package/dist/server/instances.d.ts +5 -4
- package/dist/server.d.ts +1 -1
- package/dist/server.js +4 -4
- package/dist/views.d.ts +4 -3
- package/package.json +34 -22
- package/dist/builder/client-views.d.ts +0 -16
- package/dist/builder/database-paths.d.ts +0 -4
- package/dist/builder/define-view.d.ts +0 -3
- package/dist/builder/drizzle.d.ts +0 -2
- package/dist/builder/file-routes.d.ts +0 -34
- package/dist/builder/generate-migrations.d.ts +0 -6
- package/dist/builder/index.d.ts +0 -11
- package/dist/builder/instances.d.ts +0 -19
- package/dist/builder/migrations.d.ts +0 -6
- package/dist/builder/schema-check.d.ts +0 -2
- package/dist/builder/server.d.ts +0 -6
- package/dist/builder/upload-manifest.d.ts +0 -20
- package/dist/builder.js +0 -1531
- package/dist/chunk-DA2TE2FW.js +0 -27
- package/dist/chunk-IJBQ77AH.js +0 -35
- package/dist/chunk-L5ECQGR7.js +0 -26
- package/dist/chunk-SWBQZDWT.js +0 -321
- package/dist/config/config.d.ts +0 -86
- package/dist/config/index.d.ts +0 -1
- package/dist/config/loader.d.ts +0 -7
- package/dist/config-loader.js +0 -7
- package/dist/config.js +0 -8
- package/dist/preact-version.d.ts +0 -7
package/dist/protocol.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ContractRouterClient } from "@orpc/contract";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export declare const invocationSchema: z.ZodObject<{
|
|
4
|
-
name: z.ZodString;
|
|
5
4
|
args: z.ZodOptional<z.ZodUnknown>;
|
|
5
|
+
name: z.ZodString;
|
|
6
6
|
}, z.core.$strict>;
|
|
7
7
|
export type Invocation = z.infer<typeof invocationSchema>;
|
|
8
8
|
export type MutationInvocation = Invocation & {
|
|
@@ -10,58 +10,58 @@ export type MutationInvocation = Invocation & {
|
|
|
10
10
|
};
|
|
11
11
|
/** Public wire contract; implementations and clients both depend on this definition. */
|
|
12
12
|
export declare const appContract: {
|
|
13
|
-
|
|
14
|
-
name: z.ZodString;
|
|
13
|
+
actions: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<z.ZodObject<{
|
|
15
14
|
args: z.ZodOptional<z.ZodUnknown>;
|
|
15
|
+
name: z.ZodString;
|
|
16
16
|
}, z.core.$strict>, import("@orpc/contract").Schema<unknown, unknown>, {
|
|
17
17
|
BAD_REQUEST: {};
|
|
18
|
-
UNAUTHORIZED: {};
|
|
19
|
-
FORBIDDEN: {};
|
|
20
|
-
NOT_FOUND: {};
|
|
21
18
|
CONFLICT: {};
|
|
19
|
+
FORBIDDEN: {};
|
|
22
20
|
INCOMPATIBLE_VERSION: {};
|
|
23
|
-
UNAVAILABLE: {};
|
|
24
21
|
INTERNAL_SERVER_ERROR: {};
|
|
22
|
+
NOT_FOUND: {};
|
|
23
|
+
UNAUTHORIZED: {};
|
|
24
|
+
UNAVAILABLE: {};
|
|
25
25
|
}>;
|
|
26
26
|
mutations: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<z.ZodObject<{
|
|
27
|
-
name: z.ZodString;
|
|
28
27
|
args: z.ZodOptional<z.ZodUnknown>;
|
|
28
|
+
name: z.ZodString;
|
|
29
29
|
requestId: z.ZodUUID;
|
|
30
30
|
}, z.core.$strict>, import("@orpc/contract").Schema<unknown, unknown>, {
|
|
31
31
|
BAD_REQUEST: {};
|
|
32
|
-
UNAUTHORIZED: {};
|
|
33
|
-
FORBIDDEN: {};
|
|
34
|
-
NOT_FOUND: {};
|
|
35
32
|
CONFLICT: {};
|
|
33
|
+
FORBIDDEN: {};
|
|
36
34
|
INCOMPATIBLE_VERSION: {};
|
|
37
|
-
UNAVAILABLE: {};
|
|
38
35
|
INTERNAL_SERVER_ERROR: {};
|
|
36
|
+
NOT_FOUND: {};
|
|
37
|
+
UNAUTHORIZED: {};
|
|
38
|
+
UNAVAILABLE: {};
|
|
39
39
|
}>;
|
|
40
|
-
|
|
41
|
-
name: z.ZodString;
|
|
40
|
+
queries: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<z.ZodObject<{
|
|
42
41
|
args: z.ZodOptional<z.ZodUnknown>;
|
|
42
|
+
name: z.ZodString;
|
|
43
43
|
}, z.core.$strict>, import("@orpc/contract").Schema<unknown, unknown>, {
|
|
44
44
|
BAD_REQUEST: {};
|
|
45
|
-
UNAUTHORIZED: {};
|
|
46
|
-
FORBIDDEN: {};
|
|
47
|
-
NOT_FOUND: {};
|
|
48
45
|
CONFLICT: {};
|
|
46
|
+
FORBIDDEN: {};
|
|
49
47
|
INCOMPATIBLE_VERSION: {};
|
|
50
|
-
UNAVAILABLE: {};
|
|
51
48
|
INTERNAL_SERVER_ERROR: {};
|
|
49
|
+
NOT_FOUND: {};
|
|
50
|
+
UNAUTHORIZED: {};
|
|
51
|
+
UNAVAILABLE: {};
|
|
52
52
|
}>;
|
|
53
53
|
subscribe: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<z.ZodObject<{
|
|
54
|
-
name: z.ZodString;
|
|
55
54
|
args: z.ZodOptional<z.ZodUnknown>;
|
|
55
|
+
name: z.ZodString;
|
|
56
56
|
}, z.core.$strict>, import("@orpc/contract").Schema<AsyncIterableIterator<unknown>, AsyncIterableIterator<unknown>>, {
|
|
57
57
|
BAD_REQUEST: {};
|
|
58
|
-
UNAUTHORIZED: {};
|
|
59
|
-
FORBIDDEN: {};
|
|
60
|
-
NOT_FOUND: {};
|
|
61
58
|
CONFLICT: {};
|
|
59
|
+
FORBIDDEN: {};
|
|
62
60
|
INCOMPATIBLE_VERSION: {};
|
|
63
|
-
UNAVAILABLE: {};
|
|
64
61
|
INTERNAL_SERVER_ERROR: {};
|
|
62
|
+
NOT_FOUND: {};
|
|
63
|
+
UNAUTHORIZED: {};
|
|
64
|
+
UNAVAILABLE: {};
|
|
65
65
|
}>;
|
|
66
66
|
};
|
|
67
67
|
export type PlatformClient = ContractRouterClient<typeof appContract>;
|
package/dist/protocol.js
CHANGED
|
@@ -2,23 +2,25 @@
|
|
|
2
2
|
import { oc, type } from "@orpc/contract";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
var invocationSchema = z.strictObject({
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
args: z.unknown().optional(),
|
|
6
|
+
name: z.string().max(512).regex(
|
|
7
|
+
/^(?:[a-zA-Z][a-zA-Z0-9_]{0,63}|_tailorkit)(?:\.[a-zA-Z][a-zA-Z0-9_]{0,63})*$/u
|
|
8
|
+
)
|
|
7
9
|
});
|
|
8
10
|
var procedure = oc.errors({
|
|
9
11
|
BAD_REQUEST: {},
|
|
10
|
-
UNAUTHORIZED: {},
|
|
11
|
-
FORBIDDEN: {},
|
|
12
|
-
NOT_FOUND: {},
|
|
13
12
|
CONFLICT: {},
|
|
13
|
+
FORBIDDEN: {},
|
|
14
14
|
INCOMPATIBLE_VERSION: {},
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
INTERNAL_SERVER_ERROR: {},
|
|
16
|
+
NOT_FOUND: {},
|
|
17
|
+
UNAUTHORIZED: {},
|
|
18
|
+
UNAVAILABLE: {}
|
|
17
19
|
});
|
|
18
20
|
var appContract = {
|
|
19
|
-
queries: procedure.input(invocationSchema).output(type()),
|
|
20
|
-
mutations: procedure.input(invocationSchema.extend({ requestId: z.uuid() })).output(type()),
|
|
21
21
|
actions: procedure.input(invocationSchema).output(type()),
|
|
22
|
+
mutations: procedure.input(invocationSchema.extend({ requestId: z.uuid() })).output(type()),
|
|
23
|
+
queries: procedure.input(invocationSchema).output(type()),
|
|
22
24
|
// A pass-through type schema preserves the private hibernation iterator instance.
|
|
23
25
|
subscribe: procedure.input(invocationSchema).output(type())
|
|
24
26
|
};
|
package/dist/routing.d.ts
CHANGED
|
@@ -7,9 +7,9 @@ export interface RouteDefinition {
|
|
|
7
7
|
readonly shellComponent: ComponentType<ShellProps>;
|
|
8
8
|
}
|
|
9
9
|
/** Define the shell in an app or slot root.tsx. */
|
|
10
|
-
export declare
|
|
10
|
+
export declare const defineRoute: (options: RouteDefinition) => RouteDefinition;
|
|
11
11
|
/** Render the next layout or selected view inside a root shell or layout. */
|
|
12
|
-
export declare
|
|
12
|
+
export declare const Route: () => string | number | bigint | boolean | object | import("preact").ComponentChild[] | import("preact").VNode<any> | null;
|
|
13
13
|
export interface RouteModule {
|
|
14
14
|
filename: string;
|
|
15
15
|
definition: unknown;
|
|
@@ -24,11 +24,11 @@ export interface FileLayoutModule extends RouteModule {
|
|
|
24
24
|
/** The app builder generates this registration; apps only export their files.
|
|
25
25
|
* @internal
|
|
26
26
|
*/
|
|
27
|
-
export declare
|
|
27
|
+
export declare const createFileClient: (options: {
|
|
28
28
|
root?: RouteModule;
|
|
29
29
|
roots: (RouteModule & {
|
|
30
30
|
slot: string;
|
|
31
31
|
})[];
|
|
32
32
|
layouts: FileLayoutModule[];
|
|
33
33
|
views: FileViewModule[];
|
|
34
|
-
})
|
|
34
|
+
}) => TailorKitClientWithMeta;
|
package/dist/server/builder.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
1
|
import type { AnyRelations, EmptyRelations } from "drizzle-orm/relations";
|
|
3
|
-
import
|
|
4
|
-
import type {
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import type { DatabaseDefinition } from "#database/definition";
|
|
4
|
+
import type { MutationDatabase, QueryDatabase } from "#database/types";
|
|
5
5
|
import type { ActionContext, FunctionKind, Functions, Identity } from "./functions";
|
|
6
6
|
type HandlerContext<K extends FunctionKind, A extends z.ZodType, F extends Functions, D extends AnyRelations> = {
|
|
7
7
|
input: z.output<A>;
|
|
@@ -37,9 +37,9 @@ declare class FunctionBuilder<K extends FunctionKind, A extends z.ZodType, R ext
|
|
|
37
37
|
database<const E extends AnyRelations>(this: FunctionBuilder<K, A, R, F, D> & (K extends "action" ? never : unknown), database: DatabaseDefinition<E>): FunctionBuilder<K, A, R, F, E>;
|
|
38
38
|
handler<O extends OutputInput<R>>(handler: (context: HandlerContext<K, A, F, D>) => HandlerOutput<K, O>): BuiltFunction<K, A, R, O, F, D>;
|
|
39
39
|
}
|
|
40
|
-
export declare const
|
|
41
|
-
query: FunctionBuilder<"query", z.ZodUndefined, undefined, {}, EmptyRelations>;
|
|
42
|
-
mutation: FunctionBuilder<"mutation", z.ZodUndefined, undefined, {}, EmptyRelations>;
|
|
40
|
+
export declare const fn: Readonly<{
|
|
43
41
|
action: FunctionBuilder<"action", z.ZodUndefined, undefined, {}, EmptyRelations>;
|
|
42
|
+
mutation: FunctionBuilder<"mutation", z.ZodUndefined, undefined, {}, EmptyRelations>;
|
|
43
|
+
query: FunctionBuilder<"query", z.ZodUndefined, undefined, {}, EmptyRelations>;
|
|
44
44
|
}>;
|
|
45
45
|
export {};
|
package/dist/server/bundle.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { AppMigration } from "#protocol";
|
|
1
2
|
import type { AppDefinition } from "./functions";
|
|
2
|
-
import type { AppMigration } from "../protocol";
|
|
3
3
|
/** Interface between an uploaded application module and the server runtime. */
|
|
4
4
|
export interface RuntimeManifest {
|
|
5
5
|
apiVersion: number;
|
|
@@ -10,8 +10,3 @@ export interface ApplicationModule {
|
|
|
10
10
|
migrations: readonly AppMigration[];
|
|
11
11
|
runtimeManifest: RuntimeManifest;
|
|
12
12
|
}
|
|
13
|
-
/** Emitted by this SDK's builder; breaking interface changes increment apiVersion. */
|
|
14
|
-
export declare const runtimeManifest: {
|
|
15
|
-
readonly apiVersion: 1;
|
|
16
|
-
readonly requires: readonly ["database", "actions", "database-relations", "tools"];
|
|
17
|
-
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { TailorKitServerTools } from "../client/tools";
|
|
2
|
-
import type { z } from "zod";
|
|
3
1
|
import type { AnyRelations, EmptyRelations } from "drizzle-orm/relations";
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
2
|
+
import type { z } from "zod";
|
|
3
|
+
import type { TailorKitServerTools } from "#client/tools";
|
|
4
|
+
import type { DatabaseDefinition } from "#database/definition";
|
|
5
|
+
import type { QueryDatabase, MutationDatabase } from "#database/types";
|
|
6
6
|
export interface Identity {
|
|
7
7
|
readonly subjectId?: string;
|
|
8
8
|
readonly scope: {
|
|
9
9
|
name: string;
|
|
10
|
-
value: Record<string,
|
|
10
|
+
value: Record<string, z.output<ReturnType<typeof z.json>>>;
|
|
11
11
|
};
|
|
12
12
|
readonly toolUrl: string;
|
|
13
13
|
readonly projectId: string;
|
|
@@ -25,11 +25,11 @@ export type FunctionResult<D> = D extends {
|
|
|
25
25
|
export type FunctionCalls<F, K extends "query" | "mutation"> = {
|
|
26
26
|
readonly [N in keyof F as F[N] extends {
|
|
27
27
|
kind: FunctionKind;
|
|
28
|
-
} ?
|
|
28
|
+
} ? F[N] extends {
|
|
29
29
|
kind: K;
|
|
30
|
-
} ? N : never
|
|
30
|
+
} ? N : never : N]: F[N] extends {
|
|
31
31
|
args: infer A extends z.ZodType;
|
|
32
|
-
handler: (context: never) =>
|
|
32
|
+
handler: (context: never) => infer _Output;
|
|
33
33
|
} ? K extends "mutation" ? (...args: undefined extends z.input<A> ? [args?: z.input<A>, options?: {
|
|
34
34
|
requestId?: string;
|
|
35
35
|
}] : [args: z.input<A>, options?: {
|
|
@@ -57,27 +57,27 @@ export interface FunctionDefinition<K extends FunctionKind, A extends z.ZodType,
|
|
|
57
57
|
identity: Identity;
|
|
58
58
|
})) => K extends "action" ? O | Promise<O> : O;
|
|
59
59
|
}
|
|
60
|
-
export declare
|
|
60
|
+
export declare const query: <A extends z.ZodType, O, const D extends AnyRelations = EmptyRelations>(definition: Omit<FunctionDefinition<"query", A, O, Record<never, never>, D>, "kind"> & {
|
|
61
61
|
handler: FunctionDefinition<"query", A, O, Record<never, never>, D>["handler"] & ([O] extends [never] ? unknown : O extends PromiseLike<unknown> ? never : unknown);
|
|
62
|
-
})
|
|
62
|
+
}) => Readonly<{
|
|
63
63
|
args: A;
|
|
64
64
|
database?: DatabaseDefinition<D> | undefined;
|
|
65
65
|
result?: z.ZodType<O, unknown, z.core.$ZodTypeInternals<O, unknown>> | undefined;
|
|
66
66
|
handler: FunctionDefinition<"query", A, O, Record<never, never>, D>["handler"] & ([O] extends [never] ? unknown : O extends PromiseLike<unknown> ? never : unknown);
|
|
67
67
|
kind: "query";
|
|
68
68
|
}>;
|
|
69
|
-
export declare
|
|
69
|
+
export declare const mutation: <A extends z.ZodType, O, const D extends AnyRelations = EmptyRelations>(definition: Omit<FunctionDefinition<"mutation", A, O, Record<never, never>, D>, "kind"> & {
|
|
70
70
|
handler: FunctionDefinition<"mutation", A, O, Record<never, never>, D>["handler"] & ([O] extends [never] ? unknown : O extends PromiseLike<unknown> ? never : unknown);
|
|
71
|
-
})
|
|
71
|
+
}) => Readonly<{
|
|
72
72
|
args: A;
|
|
73
73
|
database?: DatabaseDefinition<D> | undefined;
|
|
74
74
|
result?: z.ZodType<O, unknown, z.core.$ZodTypeInternals<O, unknown>> | undefined;
|
|
75
75
|
handler: FunctionDefinition<"mutation", A, O, Record<never, never>, D>["handler"] & ([O] extends [never] ? unknown : O extends PromiseLike<unknown> ? never : unknown);
|
|
76
76
|
kind: "mutation";
|
|
77
77
|
}>;
|
|
78
|
-
export declare
|
|
78
|
+
export declare const action: <A extends z.ZodType, O, const F extends Functions = Record<never, never>>(definition: Omit<FunctionDefinition<"action", A, O, F>, "kind"> & {
|
|
79
79
|
functions?: F;
|
|
80
|
-
})
|
|
80
|
+
}) => Readonly<{
|
|
81
81
|
args: A;
|
|
82
82
|
database?: undefined;
|
|
83
83
|
result?: z.ZodType<O, unknown, z.core.$ZodTypeInternals<O, unknown>> | undefined;
|
|
@@ -87,19 +87,19 @@ export declare function action<A extends z.ZodType, O, const F extends Functions
|
|
|
87
87
|
functions?: F;
|
|
88
88
|
kind: "action";
|
|
89
89
|
}>;
|
|
90
|
-
export
|
|
90
|
+
export interface RegisteredFunction<TOutput = unknown> {
|
|
91
91
|
kind: FunctionKind;
|
|
92
92
|
args: z.ZodType;
|
|
93
93
|
result?: z.ZodType;
|
|
94
|
-
handler: (context: never) =>
|
|
94
|
+
handler: (context: never) => TOutput;
|
|
95
95
|
functions?: Functions;
|
|
96
96
|
database?: DatabaseDefinition;
|
|
97
|
-
}
|
|
97
|
+
}
|
|
98
98
|
export interface Functions {
|
|
99
99
|
readonly [name: string]: RegisteredFunction | Functions;
|
|
100
100
|
}
|
|
101
|
-
export declare
|
|
102
|
-
export declare
|
|
101
|
+
export declare const isFunction: (value: RegisteredFunction | Functions) => value is RegisteredFunction;
|
|
102
|
+
export declare const defineServer: <const F extends Functions>(functions: F) => Readonly<{
|
|
103
103
|
functions: F;
|
|
104
104
|
}>;
|
|
105
105
|
export type AppDefinition = ReturnType<typeof defineServer>;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import type { ViewDataFields } from "#views";
|
|
2
3
|
import type { AppDefinition, Identity } from "./functions";
|
|
3
|
-
interface InstanceResolver {
|
|
4
|
+
interface InstanceResolver<TOutput = unknown> {
|
|
4
5
|
slot: string;
|
|
5
6
|
path: string;
|
|
6
7
|
dataSchema: z.ZodType;
|
|
7
8
|
resolve: (context: {
|
|
8
|
-
context:
|
|
9
|
+
context: ViewDataFields;
|
|
9
10
|
identity: Identity;
|
|
10
11
|
signal: AbortSignal;
|
|
11
12
|
queries: unknown;
|
|
12
|
-
}) =>
|
|
13
|
+
}) => TOutput;
|
|
13
14
|
}
|
|
14
15
|
/** Build-generated actions run through the existing authenticated action runtime. */
|
|
15
|
-
export declare
|
|
16
|
+
export declare const withInstanceResolvers: (app: AppDefinition, resolvers: readonly InstanceResolver[]) => AppDefinition;
|
|
16
17
|
export {};
|
package/dist/server.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { defineServer, query, mutation, action } from "./server/functions";
|
|
2
2
|
export { defineDatabase } from "./database/definition";
|
|
3
3
|
export type { DatabaseDefinition } from "./database/definition";
|
|
4
|
-
export {
|
|
4
|
+
export { fn } from "./server/builder";
|
|
5
5
|
export { withInstanceResolvers } from "./server/instances";
|
|
6
6
|
export type { QueryDatabase, MutationDatabase } from "./database/types";
|
|
7
7
|
export type { Identity, FunctionDefinition, AppDefinition, ActionContext, FunctionKind, } from "./server/functions";
|
package/dist/server.js
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
defineServer,
|
|
9
9
|
desc,
|
|
10
10
|
eq,
|
|
11
|
+
fn,
|
|
11
12
|
gt,
|
|
12
13
|
gte,
|
|
13
14
|
inArray,
|
|
@@ -23,12 +24,11 @@ import {
|
|
|
23
24
|
real,
|
|
24
25
|
table,
|
|
25
26
|
text,
|
|
26
|
-
tk,
|
|
27
27
|
withInstanceResolvers
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-YX3JURMG.js";
|
|
29
29
|
import {
|
|
30
30
|
AppError
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-7ZQPXG7O.js";
|
|
32
32
|
export {
|
|
33
33
|
AppError,
|
|
34
34
|
action,
|
|
@@ -40,6 +40,7 @@ export {
|
|
|
40
40
|
defineServer,
|
|
41
41
|
desc,
|
|
42
42
|
eq,
|
|
43
|
+
fn,
|
|
43
44
|
gt,
|
|
44
45
|
gte,
|
|
45
46
|
inArray,
|
|
@@ -55,6 +56,5 @@ export {
|
|
|
55
56
|
real,
|
|
56
57
|
table,
|
|
57
58
|
text,
|
|
58
|
-
tk,
|
|
59
59
|
withInstanceResolvers
|
|
60
60
|
};
|
package/dist/views.d.ts
CHANGED
|
@@ -8,9 +8,10 @@ export interface TailorKitSlots {
|
|
|
8
8
|
}
|
|
9
9
|
export interface TailorKitServerFunctions {
|
|
10
10
|
}
|
|
11
|
+
export type ViewDataFields = Record<string, unknown>;
|
|
11
12
|
export interface ViewInstance<TData = unknown> {
|
|
12
13
|
key: string;
|
|
13
|
-
metadata:
|
|
14
|
+
metadata: ViewDataFields;
|
|
14
15
|
data: TData;
|
|
15
16
|
}
|
|
16
17
|
export interface InstanceResolverContext<TPath extends AppViewPath> {
|
|
@@ -96,7 +97,7 @@ type ViewOptions<TPath extends AppViewPath, TSlot extends SlotName, TSchema exte
|
|
|
96
97
|
[S in TSlot]: {
|
|
97
98
|
slot: S;
|
|
98
99
|
view: TPath;
|
|
99
|
-
component: View
|
|
100
|
+
component: View;
|
|
100
101
|
} & (TPath extends SlotView<S> ? unknown : {
|
|
101
102
|
readonly __tailorkit_error__: "View is not supported by this slot";
|
|
102
103
|
}) & (TailorKitSlots[S] extends {
|
|
@@ -112,7 +113,7 @@ type ViewOptions<TPath extends AppViewPath, TSlot extends SlotName, TSchema exte
|
|
|
112
113
|
export declare function defineView<const TPath extends AppViewPath = AppViewPath, TSchema extends z.ZodType = z.ZodType>(options: {
|
|
113
114
|
slot?: never;
|
|
114
115
|
view?: TPath;
|
|
115
|
-
component: View
|
|
116
|
+
component: View;
|
|
116
117
|
instances?: ViewInstances<TPath, TSchema>;
|
|
117
118
|
}): ViewDefinition<TPath, z.output<TSchema>>;
|
|
118
119
|
export declare function defineView<const TPath extends AppViewPath, const TSlot extends SlotName, TSchema extends z.ZodType>(options: ViewOptions<TPath, TSlot, TSchema>): ViewDefinition<TPath, z.output<TSchema>, TSlot> & SlotInstanceDefinition<TSlot>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tailorkit/app",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.32",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,23 +11,35 @@
|
|
|
11
11
|
"dist"
|
|
12
12
|
],
|
|
13
13
|
"type": "module",
|
|
14
|
+
"imports": {
|
|
15
|
+
"#env": "./src/env.ts",
|
|
16
|
+
"#*": {
|
|
17
|
+
"development": [
|
|
18
|
+
"./src/*",
|
|
19
|
+
"./src/*.ts",
|
|
20
|
+
"./src/*.tsx",
|
|
21
|
+
"./src/*/index.ts",
|
|
22
|
+
"./src/*/index.tsx"
|
|
23
|
+
],
|
|
24
|
+
"types": [
|
|
25
|
+
"./dist/*",
|
|
26
|
+
"./dist/*.d.ts",
|
|
27
|
+
"./dist/*/index.d.ts"
|
|
28
|
+
],
|
|
29
|
+
"default": [
|
|
30
|
+
"./src/*",
|
|
31
|
+
"./src/*.ts",
|
|
32
|
+
"./src/*.tsx",
|
|
33
|
+
"./src/*/index.ts",
|
|
34
|
+
"./src/*/index.tsx"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
},
|
|
14
38
|
"exports": {
|
|
15
39
|
".": {
|
|
16
40
|
"types": "./dist/index.d.ts",
|
|
17
41
|
"import": "./dist/index.js"
|
|
18
42
|
},
|
|
19
|
-
"./config": {
|
|
20
|
-
"types": "./dist/config/index.d.ts",
|
|
21
|
-
"import": "./dist/config.js"
|
|
22
|
-
},
|
|
23
|
-
"./config/loader": {
|
|
24
|
-
"types": "./dist/config/loader.d.ts",
|
|
25
|
-
"import": "./dist/config-loader.js"
|
|
26
|
-
},
|
|
27
|
-
"./builder": {
|
|
28
|
-
"types": "./dist/builder/index.d.ts",
|
|
29
|
-
"import": "./dist/builder.js"
|
|
30
|
-
},
|
|
31
43
|
"./client": {
|
|
32
44
|
"types": "./dist/client.d.ts",
|
|
33
45
|
"import": "./dist/client.js"
|
|
@@ -49,24 +61,22 @@
|
|
|
49
61
|
"access": "public"
|
|
50
62
|
},
|
|
51
63
|
"dependencies": {
|
|
52
|
-
"@nanostores/preact": "1.1.
|
|
64
|
+
"@nanostores/preact": "1.1.1",
|
|
53
65
|
"@orpc/client": "2.0.0-beta.40",
|
|
54
66
|
"@orpc/contract": "2.0.0-beta.40",
|
|
55
|
-
"cosmiconfig": "^10.0.1",
|
|
56
67
|
"drizzle-orm": "1.0.0-rc.4-5d5b77c",
|
|
57
|
-
"nanostores": "1.5.
|
|
58
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@1.0.0",
|
|
68
|
+
"nanostores": "1.5.5",
|
|
59
69
|
"zod": "^4.6.5"
|
|
60
70
|
},
|
|
61
71
|
"devDependencies": {
|
|
62
|
-
"@tailorkit/asset-delivery": "0.0.0",
|
|
63
72
|
"@tailorkit/config": "0.0.0",
|
|
64
73
|
"@types/node": "26.6.4",
|
|
65
|
-
"happy-dom": "^20.14.
|
|
66
|
-
"preact": "^11.0.
|
|
74
|
+
"happy-dom": "^20.14.6",
|
|
75
|
+
"preact": "^11.0.1",
|
|
67
76
|
"tsup": "^8.5.1",
|
|
68
77
|
"typescript": "^7.0.2",
|
|
69
|
-
"vite
|
|
78
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@1.1.0",
|
|
79
|
+
"vite-plus": "1.1.0"
|
|
70
80
|
},
|
|
71
81
|
"peerDependencies": {
|
|
72
82
|
"preact": "^11.0.0"
|
|
@@ -74,6 +84,8 @@
|
|
|
74
84
|
"scripts": {
|
|
75
85
|
"build": "tsup --config tsup.config.ts && tsc -p tsconfig.build.json",
|
|
76
86
|
"check-types": "tsc --noEmit",
|
|
77
|
-
"test": "vp test run"
|
|
87
|
+
"test": "vp test run",
|
|
88
|
+
"lint": "vp lint .",
|
|
89
|
+
"lint:fix": "vp lint --fix ."
|
|
78
90
|
}
|
|
79
91
|
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { InstanceRegistration } from "./instances";
|
|
2
|
-
export declare function readClientViews(filename: string): Promise<{
|
|
3
|
-
slot: string;
|
|
4
|
-
path: string;
|
|
5
|
-
instances?: true | undefined;
|
|
6
|
-
disabled?: true | undefined;
|
|
7
|
-
}[]>;
|
|
8
|
-
export declare function readClientManifest(filename: string): Promise<{
|
|
9
|
-
views: {
|
|
10
|
-
slot: string;
|
|
11
|
-
path: string;
|
|
12
|
-
instances?: true | undefined;
|
|
13
|
-
disabled?: true | undefined;
|
|
14
|
-
}[];
|
|
15
|
-
instanceResolvers: InstanceRegistration[];
|
|
16
|
-
}>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from "vite";
|
|
2
|
-
export declare function fileViewLocation(filename: string, root: string): {
|
|
3
|
-
slot: string;
|
|
4
|
-
path: string;
|
|
5
|
-
} | undefined;
|
|
6
|
-
/** Fill missing defineView options before instance extraction, on both build sides. */
|
|
7
|
-
export declare function inferFileView(source: string, filename: string, root: string): string;
|
|
8
|
-
export declare function discoverFileRoutes(root: string): Promise<{
|
|
9
|
-
root: {
|
|
10
|
-
filename: string;
|
|
11
|
-
} | undefined;
|
|
12
|
-
roots: {
|
|
13
|
-
filename: string;
|
|
14
|
-
slot: string;
|
|
15
|
-
}[];
|
|
16
|
-
layouts: {
|
|
17
|
-
filename: string;
|
|
18
|
-
slot: string;
|
|
19
|
-
path: string;
|
|
20
|
-
}[];
|
|
21
|
-
views: {
|
|
22
|
-
filename: string;
|
|
23
|
-
slot: string;
|
|
24
|
-
}[];
|
|
25
|
-
}>;
|
|
26
|
-
/** Root, layout, view and binding sources to check before deployment. */
|
|
27
|
-
export declare function getClientSourceFiles(root: string): Promise<string[]>;
|
|
28
|
-
/** A generated entry in build output lets the bundler track imports normally.
|
|
29
|
-
* Directory watching also covers routes that did not exist at the first build. */
|
|
30
|
-
export declare function createFileRouteEntry(root: string, output: string, watching: boolean): Promise<{
|
|
31
|
-
entry: string;
|
|
32
|
-
close(): Promise<void>;
|
|
33
|
-
}>;
|
|
34
|
-
export declare function fileRoutesPlugin(root: string): Plugin;
|
package/dist/builder/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { createTailorKitUploadManifest, tailorkitUploadManifestSchema, type TailorKitUploadManifest, } from "./upload-manifest";
|
|
2
|
-
export { generateAppMigrations, type GenerateAppMigrationsOptions } from "./generate-migrations";
|
|
3
|
-
export { getClientSourceFiles } from "./file-routes";
|
|
4
|
-
export interface BuildAppOptions {
|
|
5
|
-
configPath?: string;
|
|
6
|
-
cwd?: string;
|
|
7
|
-
mode?: string;
|
|
8
|
-
outDir?: string;
|
|
9
|
-
watch?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare const buildApp: (options?: BuildAppOptions) => Promise<unknown>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from "vite";
|
|
2
|
-
export interface InstanceModule {
|
|
3
|
-
filename: string;
|
|
4
|
-
names: string[];
|
|
5
|
-
}
|
|
6
|
-
export interface InstanceRegistration {
|
|
7
|
-
slot: string;
|
|
8
|
-
path: string;
|
|
9
|
-
resolver: string;
|
|
10
|
-
}
|
|
11
|
-
export declare function extractInstances(filename: string, source: string, root: string, includedNames?: string[]): Promise<{
|
|
12
|
-
names: string[];
|
|
13
|
-
server: string;
|
|
14
|
-
browser: string;
|
|
15
|
-
} | undefined>;
|
|
16
|
-
export declare function instanceExtractionPlugin(root: string, serverConfigured: boolean, modules: Map<string, InstanceModule>): Plugin;
|
|
17
|
-
export declare function instanceServerPlugin(root: string, modules: InstanceModule[]): Plugin;
|
|
18
|
-
export declare function instanceServerImports(modules: InstanceModule[]): string;
|
|
19
|
-
export declare function instanceServerBindings(modules: InstanceModule[], registrations: InstanceRegistration[]): string;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { AppMigration } from "../protocol";
|
|
2
|
-
/** Read the timestamped migration folders produced by the workspace's Drizzle Kit version. */
|
|
3
|
-
export declare function readAppMigrations(directory: string, optional?: boolean): Promise<{
|
|
4
|
-
migrations: AppMigration[];
|
|
5
|
-
files: string[];
|
|
6
|
-
}>;
|
package/dist/builder/server.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { LoadedTailorKitConfig } from "../config/loader";
|
|
2
|
-
import type { InstanceModule, InstanceRegistration } from "./instances";
|
|
3
|
-
/** Bundle the private app backend and migrations. */
|
|
4
|
-
export declare function buildServer(loaded: LoadedTailorKitConfig, watch?: boolean, buildOutDir?: string, instances?: InstanceModule[], registrations?: InstanceRegistration[]): Promise<import("@voidzero-dev/vite-plus-core/rolldown").RolldownOutput[] | import("@voidzero-dev/vite-plus-core/rolldown").RolldownOutput | import("@voidzero-dev/vite-plus-core/rolldown").RolldownWatcher | undefined>;
|
|
5
|
-
/** Check before either build can empty an output directory. */
|
|
6
|
-
export declare function validateServerBuildOutput(loaded: LoadedTailorKitConfig, output: string): void;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const tailorkitUploadManifestSchema: z.ZodObject<{
|
|
3
|
-
assets: z.ZodObject<{
|
|
4
|
-
client: z.ZodLiteral<"client/client.js">;
|
|
5
|
-
server: z.ZodOptional<z.ZodLiteral<"server/server.js">>;
|
|
6
|
-
logos: z.ZodOptional<z.ZodObject<{
|
|
7
|
-
dark: z.ZodOptional<z.ZodString>;
|
|
8
|
-
light: z.ZodOptional<z.ZodString>;
|
|
9
|
-
}, z.core.$strip>>;
|
|
10
|
-
}, z.core.$strip>;
|
|
11
|
-
views: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
12
|
-
slot: z.ZodString;
|
|
13
|
-
path: z.ZodString;
|
|
14
|
-
instances: z.ZodOptional<z.ZodLiteral<true>>;
|
|
15
|
-
disabled: z.ZodOptional<z.ZodLiteral<true>>;
|
|
16
|
-
}, z.core.$strip>>>;
|
|
17
|
-
version: z.ZodLiteral<1>;
|
|
18
|
-
}, z.core.$strip>;
|
|
19
|
-
export type TailorKitUploadManifest = z.output<typeof tailorkitUploadManifestSchema>;
|
|
20
|
-
export declare const createTailorKitUploadManifest: (logos?: TailorKitUploadManifest["assets"]["logos"], server?: boolean, views?: TailorKitUploadManifest["views"]) => TailorKitUploadManifest;
|