@kuratchi/js 0.0.19 → 0.0.21
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/README.md +193 -7
- package/dist/cli.js +8 -0
- package/dist/compiler/client-module-pipeline.d.ts +8 -0
- package/dist/compiler/client-module-pipeline.js +181 -30
- package/dist/compiler/compiler-shared.d.ts +23 -0
- package/dist/compiler/component-pipeline.js +9 -1
- package/dist/compiler/config-reading.js +27 -1
- package/dist/compiler/convention-discovery.d.ts +2 -0
- package/dist/compiler/convention-discovery.js +16 -0
- package/dist/compiler/durable-object-pipeline.d.ts +1 -0
- package/dist/compiler/durable-object-pipeline.js +459 -119
- package/dist/compiler/index.js +40 -1
- package/dist/compiler/page-route-pipeline.js +31 -2
- package/dist/compiler/parser.d.ts +1 -0
- package/dist/compiler/parser.js +47 -4
- package/dist/compiler/root-layout-pipeline.js +18 -3
- package/dist/compiler/route-pipeline.d.ts +2 -0
- package/dist/compiler/route-pipeline.js +19 -3
- package/dist/compiler/routes-module-feature-blocks.js +143 -17
- package/dist/compiler/routes-module-types.d.ts +1 -0
- package/dist/compiler/server-module-pipeline.js +24 -0
- package/dist/compiler/template.d.ts +4 -0
- package/dist/compiler/template.js +50 -18
- package/dist/compiler/type-generator.d.ts +8 -0
- package/dist/compiler/type-generator.js +124 -0
- package/dist/compiler/worker-output-pipeline.js +2 -0
- package/dist/compiler/wrangler-sync.d.ts +3 -0
- package/dist/compiler/wrangler-sync.js +25 -11
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/runtime/context.d.ts +9 -1
- package/dist/runtime/context.js +25 -2
- package/dist/runtime/generated-worker.d.ts +1 -0
- package/dist/runtime/generated-worker.js +11 -7
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/navigation.d.ts +8 -0
- package/dist/runtime/navigation.js +8 -0
- package/dist/runtime/request.d.ts +28 -0
- package/dist/runtime/request.js +44 -0
- package/dist/runtime/schema.d.ts +49 -0
- package/dist/runtime/schema.js +148 -0
- package/dist/runtime/types.d.ts +2 -0
- package/dist/runtime/validation.d.ts +26 -0
- package/dist/runtime/validation.js +147 -0
- package/package.json +76 -68
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export declare class SchemaValidationError extends Error {
|
|
2
|
+
readonly isSchemaValidationError = true;
|
|
3
|
+
readonly status = 400;
|
|
4
|
+
constructor(message: string);
|
|
5
|
+
}
|
|
6
|
+
export interface SchemaType<T> {
|
|
7
|
+
parse(input: unknown, path?: string): T;
|
|
8
|
+
}
|
|
9
|
+
export type InferSchema<T extends SchemaType<any>> = T extends SchemaType<infer U> ? U : never;
|
|
10
|
+
declare class BaseSchema<T> implements SchemaType<T> {
|
|
11
|
+
protected readonly parser: (input: unknown, path: string) => T;
|
|
12
|
+
constructor(parser: (input: unknown, path: string) => T);
|
|
13
|
+
parse(input: unknown, path?: string): T;
|
|
14
|
+
optional(defaultValue?: T): SchemaType<T | undefined>;
|
|
15
|
+
list(): SchemaType<T[]>;
|
|
16
|
+
}
|
|
17
|
+
declare class StringSchema extends BaseSchema<string> {
|
|
18
|
+
constructor();
|
|
19
|
+
min(length: number): SchemaType<string>;
|
|
20
|
+
}
|
|
21
|
+
declare class NumberSchema extends BaseSchema<number> {
|
|
22
|
+
constructor();
|
|
23
|
+
min(value: number): SchemaType<number>;
|
|
24
|
+
}
|
|
25
|
+
declare class BooleanSchema extends BaseSchema<boolean> {
|
|
26
|
+
constructor();
|
|
27
|
+
}
|
|
28
|
+
declare class FileSchema extends BaseSchema<File> {
|
|
29
|
+
constructor();
|
|
30
|
+
}
|
|
31
|
+
type ShapeRecord = Record<string, SchemaType<any>>;
|
|
32
|
+
type InferShape<TShape extends ShapeRecord> = {
|
|
33
|
+
[K in keyof TShape]: InferSchema<TShape[K]>;
|
|
34
|
+
};
|
|
35
|
+
declare class ObjectSchema<TShape extends ShapeRecord> extends BaseSchema<InferShape<TShape>> {
|
|
36
|
+
readonly shape: TShape;
|
|
37
|
+
constructor(shape: TShape);
|
|
38
|
+
}
|
|
39
|
+
type SchemaBuilder = {
|
|
40
|
+
<TShape extends ShapeRecord>(shape: TShape): ObjectSchema<TShape>;
|
|
41
|
+
string(): StringSchema;
|
|
42
|
+
number(): NumberSchema;
|
|
43
|
+
boolean(): BooleanSchema;
|
|
44
|
+
file(): FileSchema;
|
|
45
|
+
};
|
|
46
|
+
export declare const schema: SchemaBuilder;
|
|
47
|
+
export declare function validateSchemaInput<T>(schemaDef: SchemaType<T> | undefined, args: unknown[]): unknown[];
|
|
48
|
+
export declare function parseRpcArgsPayload(payload: string | null): any[];
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
export class SchemaValidationError extends Error {
|
|
2
|
+
isSchemaValidationError = true;
|
|
3
|
+
status = 400;
|
|
4
|
+
constructor(message) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.name = 'SchemaValidationError';
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
function formatPath(path) {
|
|
10
|
+
return path || 'value';
|
|
11
|
+
}
|
|
12
|
+
function describe(value) {
|
|
13
|
+
if (value === null)
|
|
14
|
+
return 'null';
|
|
15
|
+
if (typeof File !== 'undefined' && value instanceof File)
|
|
16
|
+
return 'file';
|
|
17
|
+
if (Array.isArray(value))
|
|
18
|
+
return 'array';
|
|
19
|
+
return typeof value;
|
|
20
|
+
}
|
|
21
|
+
function fail(path, message) {
|
|
22
|
+
throw new SchemaValidationError(`${formatPath(path)} ${message}`);
|
|
23
|
+
}
|
|
24
|
+
function isPlainObject(value) {
|
|
25
|
+
return !!value && typeof value === 'object' && !Array.isArray(value) && !(typeof File !== 'undefined' && value instanceof File);
|
|
26
|
+
}
|
|
27
|
+
class BaseSchema {
|
|
28
|
+
parser;
|
|
29
|
+
constructor(parser) {
|
|
30
|
+
this.parser = parser;
|
|
31
|
+
}
|
|
32
|
+
parse(input, path = 'value') {
|
|
33
|
+
return this.parser(input, path);
|
|
34
|
+
}
|
|
35
|
+
optional(defaultValue) {
|
|
36
|
+
return new BaseSchema((input, path) => {
|
|
37
|
+
if (typeof input === 'undefined')
|
|
38
|
+
return defaultValue;
|
|
39
|
+
return this.parse(input, path);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
list() {
|
|
43
|
+
return new BaseSchema((input, path) => {
|
|
44
|
+
if (!Array.isArray(input))
|
|
45
|
+
fail(path, `must be an array, got ${describe(input)}`);
|
|
46
|
+
return input.map((item, index) => this.parse(item, `${path}[${index}]`));
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
class StringSchema extends BaseSchema {
|
|
51
|
+
constructor() {
|
|
52
|
+
super((input, path) => {
|
|
53
|
+
if (typeof input !== 'string')
|
|
54
|
+
fail(path, `must be a string, got ${describe(input)}`);
|
|
55
|
+
return input;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
min(length) {
|
|
59
|
+
return new BaseSchema((input, path) => {
|
|
60
|
+
const value = this.parse(input, path);
|
|
61
|
+
if (value.length < length)
|
|
62
|
+
fail(path, `must be at least ${length} character(s)`);
|
|
63
|
+
return value;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
class NumberSchema extends BaseSchema {
|
|
68
|
+
constructor() {
|
|
69
|
+
super((input, path) => {
|
|
70
|
+
if (typeof input !== 'number' || Number.isNaN(input))
|
|
71
|
+
fail(path, `must be a number, got ${describe(input)}`);
|
|
72
|
+
return input;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
min(value) {
|
|
76
|
+
return new BaseSchema((input, path) => {
|
|
77
|
+
const parsed = this.parse(input, path);
|
|
78
|
+
if (parsed < value)
|
|
79
|
+
fail(path, `must be at least ${value}`);
|
|
80
|
+
return parsed;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
class BooleanSchema extends BaseSchema {
|
|
85
|
+
constructor() {
|
|
86
|
+
super((input, path) => {
|
|
87
|
+
if (typeof input !== 'boolean')
|
|
88
|
+
fail(path, `must be a boolean, got ${describe(input)}`);
|
|
89
|
+
return input;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
class FileSchema extends BaseSchema {
|
|
94
|
+
constructor() {
|
|
95
|
+
super((input, path) => {
|
|
96
|
+
if (typeof File === 'undefined' || !(input instanceof File))
|
|
97
|
+
fail(path, `must be a file, got ${describe(input)}`);
|
|
98
|
+
return input;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
class ObjectSchema extends BaseSchema {
|
|
103
|
+
shape;
|
|
104
|
+
constructor(shape) {
|
|
105
|
+
super((input, path) => {
|
|
106
|
+
if (!isPlainObject(input))
|
|
107
|
+
fail(path, `must be an object, got ${describe(input)}`);
|
|
108
|
+
const out = {};
|
|
109
|
+
for (const key of Object.keys(shape)) {
|
|
110
|
+
out[key] = shape[key].parse(input[key], `${path}.${key}`);
|
|
111
|
+
}
|
|
112
|
+
return out;
|
|
113
|
+
});
|
|
114
|
+
this.shape = shape;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function createSchema(shape) {
|
|
118
|
+
return new ObjectSchema(shape);
|
|
119
|
+
}
|
|
120
|
+
export const schema = Object.assign(createSchema, {
|
|
121
|
+
string: () => new StringSchema(),
|
|
122
|
+
number: () => new NumberSchema(),
|
|
123
|
+
boolean: () => new BooleanSchema(),
|
|
124
|
+
file: () => new FileSchema(),
|
|
125
|
+
});
|
|
126
|
+
export function validateSchemaInput(schemaDef, args) {
|
|
127
|
+
if (!schemaDef)
|
|
128
|
+
return args;
|
|
129
|
+
if (args.length !== 1) {
|
|
130
|
+
throw new SchemaValidationError(`validated RPCs must receive exactly one argument object, got ${args.length}`);
|
|
131
|
+
}
|
|
132
|
+
return [schemaDef.parse(args[0], 'data')];
|
|
133
|
+
}
|
|
134
|
+
export function parseRpcArgsPayload(payload) {
|
|
135
|
+
if (!payload)
|
|
136
|
+
return [];
|
|
137
|
+
let parsed;
|
|
138
|
+
try {
|
|
139
|
+
parsed = JSON.parse(payload);
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
throw new SchemaValidationError('args must be valid JSON');
|
|
143
|
+
}
|
|
144
|
+
if (!Array.isArray(parsed)) {
|
|
145
|
+
throw new SchemaValidationError('args must be a JSON array');
|
|
146
|
+
}
|
|
147
|
+
return parsed;
|
|
148
|
+
}
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -34,6 +34,8 @@ export interface RouteModule {
|
|
|
34
34
|
actions?: Record<string, (formData: FormData, env: Env, ctx: RouteContext) => Promise<any>>;
|
|
35
35
|
/** RPC functions â€" callable from client via fetch */
|
|
36
36
|
rpc?: Record<string, (args: any[], env: Env, ctx: RouteContext) => Promise<any>>;
|
|
37
|
+
/** Optional schemas for RPC inputs, keyed by function name */
|
|
38
|
+
rpcSchemas?: Record<string, any>;
|
|
37
39
|
/** Render function â€" returns route HTML and optional head content from data */
|
|
38
40
|
render: (data: Record<string, any>) => PageRenderOutput;
|
|
39
41
|
/** Layout name (default: 'default') */
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare class RpcValidationError extends Error {
|
|
2
|
+
readonly isRpcValidationError = true;
|
|
3
|
+
readonly status = 400;
|
|
4
|
+
constructor(message: string);
|
|
5
|
+
}
|
|
6
|
+
export interface Validator<T> {
|
|
7
|
+
parse(input: unknown, path?: string): T;
|
|
8
|
+
}
|
|
9
|
+
export type InferValidator<T extends Validator<any>> = T extends Validator<infer U> ? U : never;
|
|
10
|
+
export declare const v: {
|
|
11
|
+
string(): Validator<string>;
|
|
12
|
+
number(): Validator<number>;
|
|
13
|
+
boolean(): Validator<boolean>;
|
|
14
|
+
literal<const T extends string | number | boolean | null>(expected: T): Validator<T>;
|
|
15
|
+
optional<T>(inner: Validator<T>): Validator<T | undefined>;
|
|
16
|
+
nullable<T>(inner: Validator<T>): Validator<T | null>;
|
|
17
|
+
array<T>(inner: Validator<T>): Validator<T[]>;
|
|
18
|
+
object<TShape extends Record<string, Validator<any>>>(shape: TShape): Validator<{ [K in keyof TShape]: InferValidator<TShape[K]>; }>;
|
|
19
|
+
tuple<TItems extends readonly Validator<any>[]>(items: TItems): Validator<{ [K in keyof TItems]: InferValidator<TItems[K]>; }>;
|
|
20
|
+
union<TItems extends readonly Validator<any>[]>(items: TItems): Validator<InferValidator<TItems[number]>>;
|
|
21
|
+
};
|
|
22
|
+
export declare function rpc<TArgs extends any[], TResult>(validator: Validator<TArgs>, handler: (...args: TArgs) => Promise<TResult> | TResult): ((...args: TArgs) => Promise<TResult> | TResult) & {
|
|
23
|
+
__kuratchiRpcValidator: Validator<TArgs>;
|
|
24
|
+
};
|
|
25
|
+
export declare function validateRpcArgs(fn: (...args: any[]) => Promise<unknown> | unknown, args: unknown[]): any[];
|
|
26
|
+
export declare function parseRpcArgsPayload(payload: string | null): any[];
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
export class RpcValidationError extends Error {
|
|
2
|
+
isRpcValidationError = true;
|
|
3
|
+
status = 400;
|
|
4
|
+
constructor(message) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.name = 'RpcValidationError';
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
function formatPath(path) {
|
|
10
|
+
return path || 'value';
|
|
11
|
+
}
|
|
12
|
+
function describe(value) {
|
|
13
|
+
if (value === null)
|
|
14
|
+
return 'null';
|
|
15
|
+
if (Array.isArray(value))
|
|
16
|
+
return 'array';
|
|
17
|
+
return typeof value;
|
|
18
|
+
}
|
|
19
|
+
function fail(path, message) {
|
|
20
|
+
throw new RpcValidationError(`${formatPath(path)} ${message}`);
|
|
21
|
+
}
|
|
22
|
+
function createValidator(parse) {
|
|
23
|
+
return {
|
|
24
|
+
parse(input, path = 'value') {
|
|
25
|
+
return parse(input, path);
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function isPlainObject(value) {
|
|
30
|
+
return !!value && typeof value === 'object' && !Array.isArray(value);
|
|
31
|
+
}
|
|
32
|
+
export const v = {
|
|
33
|
+
string() {
|
|
34
|
+
return createValidator((input, path) => {
|
|
35
|
+
if (typeof input !== 'string')
|
|
36
|
+
fail(path, `must be a string, got ${describe(input)}`);
|
|
37
|
+
return input;
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
number() {
|
|
41
|
+
return createValidator((input, path) => {
|
|
42
|
+
if (typeof input !== 'number' || Number.isNaN(input))
|
|
43
|
+
fail(path, `must be a number, got ${describe(input)}`);
|
|
44
|
+
return input;
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
boolean() {
|
|
48
|
+
return createValidator((input, path) => {
|
|
49
|
+
if (typeof input !== 'boolean')
|
|
50
|
+
fail(path, `must be a boolean, got ${describe(input)}`);
|
|
51
|
+
return input;
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
literal(expected) {
|
|
55
|
+
return createValidator((input, path) => {
|
|
56
|
+
if (input !== expected)
|
|
57
|
+
fail(path, `must be ${JSON.stringify(expected)}`);
|
|
58
|
+
return expected;
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
optional(inner) {
|
|
62
|
+
return createValidator((input, path) => {
|
|
63
|
+
if (typeof input === 'undefined')
|
|
64
|
+
return undefined;
|
|
65
|
+
return inner.parse(input, path);
|
|
66
|
+
});
|
|
67
|
+
},
|
|
68
|
+
nullable(inner) {
|
|
69
|
+
return createValidator((input, path) => {
|
|
70
|
+
if (input === null)
|
|
71
|
+
return null;
|
|
72
|
+
return inner.parse(input, path);
|
|
73
|
+
});
|
|
74
|
+
},
|
|
75
|
+
array(inner) {
|
|
76
|
+
return createValidator((input, path) => {
|
|
77
|
+
if (!Array.isArray(input))
|
|
78
|
+
fail(path, `must be an array, got ${describe(input)}`);
|
|
79
|
+
return input.map((value, index) => inner.parse(value, `${path}[${index}]`));
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
object(shape) {
|
|
83
|
+
return createValidator((input, path) => {
|
|
84
|
+
if (!isPlainObject(input))
|
|
85
|
+
fail(path, `must be an object, got ${describe(input)}`);
|
|
86
|
+
const out = {};
|
|
87
|
+
for (const key of Object.keys(shape)) {
|
|
88
|
+
out[key] = shape[key].parse(input[key], `${path}.${key}`);
|
|
89
|
+
}
|
|
90
|
+
return out;
|
|
91
|
+
});
|
|
92
|
+
},
|
|
93
|
+
tuple(items) {
|
|
94
|
+
return createValidator((input, path) => {
|
|
95
|
+
if (!Array.isArray(input))
|
|
96
|
+
fail(path, `must be an array, got ${describe(input)}`);
|
|
97
|
+
if (input.length !== items.length)
|
|
98
|
+
fail(path, `must contain ${items.length} item(s), got ${input.length}`);
|
|
99
|
+
const out = [];
|
|
100
|
+
for (let index = 0; index < items.length; index++) {
|
|
101
|
+
out.push(items[index].parse(input[index], `${path}[${index}]`));
|
|
102
|
+
}
|
|
103
|
+
return out;
|
|
104
|
+
});
|
|
105
|
+
},
|
|
106
|
+
union(items) {
|
|
107
|
+
return createValidator((input, path) => {
|
|
108
|
+
const messages = [];
|
|
109
|
+
for (const item of items) {
|
|
110
|
+
try {
|
|
111
|
+
return item.parse(input, path);
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
if (error instanceof RpcValidationError)
|
|
115
|
+
messages.push(error.message);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
fail(path, messages.length > 0 ? `did not match any allowed shape: ${messages.join('; ')}` : 'did not match any allowed shape');
|
|
119
|
+
});
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
export function rpc(validator, handler) {
|
|
123
|
+
const rpcHandler = handler;
|
|
124
|
+
rpcHandler.__kuratchiRpcValidator = validator;
|
|
125
|
+
return rpcHandler;
|
|
126
|
+
}
|
|
127
|
+
export function validateRpcArgs(fn, args) {
|
|
128
|
+
const validator = fn.__kuratchiRpcValidator;
|
|
129
|
+
if (!validator)
|
|
130
|
+
return args;
|
|
131
|
+
return validator.parse(args, 'args');
|
|
132
|
+
}
|
|
133
|
+
export function parseRpcArgsPayload(payload) {
|
|
134
|
+
if (!payload)
|
|
135
|
+
return [];
|
|
136
|
+
let parsed;
|
|
137
|
+
try {
|
|
138
|
+
parsed = JSON.parse(payload);
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
throw new RpcValidationError('args must be valid JSON');
|
|
142
|
+
}
|
|
143
|
+
if (!Array.isArray(parsed)) {
|
|
144
|
+
throw new RpcValidationError('args must be a JSON array');
|
|
145
|
+
}
|
|
146
|
+
return parsed;
|
|
147
|
+
}
|
package/package.json
CHANGED
|
@@ -1,68 +1,76 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@kuratchi/js",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "A thin, Cloudflare Workers-native web framework with Svelte-inspired syntax",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"main": "./dist/index.js",
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
|
-
"bin": {
|
|
10
|
-
"kuratchi": "dist/cli.js"
|
|
11
|
-
},
|
|
12
|
-
"files": [
|
|
13
|
-
"dist",
|
|
14
|
-
"README.md",
|
|
15
|
-
"LICENSE"
|
|
16
|
-
],
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "tsc -p tsconfig.build.json",
|
|
19
|
-
"check": "tsc -p tsconfig.build.json --noEmit",
|
|
20
|
-
"test": "bun test",
|
|
21
|
-
"test:watch": "bun test --watch",
|
|
22
|
-
"prepublishOnly": "npm run build"
|
|
23
|
-
},
|
|
24
|
-
"exports": {
|
|
25
|
-
".": {
|
|
26
|
-
"types": "./dist/index.d.ts",
|
|
27
|
-
"import": "./dist/index.js"
|
|
28
|
-
},
|
|
29
|
-
"./runtime/context.js": {
|
|
30
|
-
"types": "./dist/runtime/context.d.ts",
|
|
31
|
-
"import": "./dist/runtime/context.js"
|
|
32
|
-
},
|
|
33
|
-
"./request": {
|
|
34
|
-
"types": "./dist/runtime/request.d.ts",
|
|
35
|
-
"import": "./dist/runtime/request.js"
|
|
36
|
-
},
|
|
37
|
-
"./
|
|
38
|
-
"types": "./dist/runtime/
|
|
39
|
-
"import": "./dist/runtime/
|
|
40
|
-
},
|
|
41
|
-
"./runtime/
|
|
42
|
-
"types": "./dist/runtime/
|
|
43
|
-
"import": "./dist/runtime/
|
|
44
|
-
},
|
|
45
|
-
"./
|
|
46
|
-
"types": "./dist/
|
|
47
|
-
"import": "./dist/
|
|
48
|
-
},
|
|
49
|
-
"./
|
|
50
|
-
"types": "./dist/
|
|
51
|
-
"import": "./dist/
|
|
52
|
-
},
|
|
53
|
-
"./
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@kuratchi/js",
|
|
3
|
+
"version": "0.0.21",
|
|
4
|
+
"description": "A thin, Cloudflare Workers-native web framework with Svelte-inspired syntax",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"bin": {
|
|
10
|
+
"kuratchi": "dist/cli.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"README.md",
|
|
15
|
+
"LICENSE"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc -p tsconfig.build.json",
|
|
19
|
+
"check": "tsc -p tsconfig.build.json --noEmit",
|
|
20
|
+
"test": "bun test",
|
|
21
|
+
"test:watch": "bun test --watch",
|
|
22
|
+
"prepublishOnly": "npm run build"
|
|
23
|
+
},
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./runtime/context.js": {
|
|
30
|
+
"types": "./dist/runtime/context.d.ts",
|
|
31
|
+
"import": "./dist/runtime/context.js"
|
|
32
|
+
},
|
|
33
|
+
"./request": {
|
|
34
|
+
"types": "./dist/runtime/request.d.ts",
|
|
35
|
+
"import": "./dist/runtime/request.js"
|
|
36
|
+
},
|
|
37
|
+
"./navigation": {
|
|
38
|
+
"types": "./dist/runtime/navigation.d.ts",
|
|
39
|
+
"import": "./dist/runtime/navigation.js"
|
|
40
|
+
},
|
|
41
|
+
"./runtime/do.js": {
|
|
42
|
+
"types": "./dist/runtime/do.d.ts",
|
|
43
|
+
"import": "./dist/runtime/do.js"
|
|
44
|
+
},
|
|
45
|
+
"./runtime/schema.js": {
|
|
46
|
+
"types": "./dist/runtime/schema.d.ts",
|
|
47
|
+
"import": "./dist/runtime/schema.js"
|
|
48
|
+
},
|
|
49
|
+
"./runtime/generated-worker.js": {
|
|
50
|
+
"types": "./dist/runtime/generated-worker.d.ts",
|
|
51
|
+
"import": "./dist/runtime/generated-worker.js"
|
|
52
|
+
},
|
|
53
|
+
"./compiler": {
|
|
54
|
+
"types": "./dist/compiler/index.d.ts",
|
|
55
|
+
"import": "./dist/compiler/index.js"
|
|
56
|
+
},
|
|
57
|
+
"./environment": {
|
|
58
|
+
"types": "./dist/index.d.ts",
|
|
59
|
+
"import": "./dist/index.js"
|
|
60
|
+
},
|
|
61
|
+
"./package.json": "./package.json"
|
|
62
|
+
},
|
|
63
|
+
"engines": {
|
|
64
|
+
"node": ">=18"
|
|
65
|
+
},
|
|
66
|
+
"publishConfig": {
|
|
67
|
+
"access": "public"
|
|
68
|
+
},
|
|
69
|
+
"dependencies": {
|
|
70
|
+
"typescript": "^5.8.0"
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@cloudflare/workers-types": "^4.20260223.0",
|
|
74
|
+
"@types/node": "^24.4.0"
|
|
75
|
+
}
|
|
76
|
+
}
|