@builder-builder/builder 0.0.1
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 +38 -0
- package/dist/assert/assert.d.ts +28 -0
- package/dist/assert/assert.js +28 -0
- package/dist/assert/expectation.d.ts +20 -0
- package/dist/assert/expectation.js +21 -0
- package/dist/assert/index.d.ts +3 -0
- package/dist/assert/index.js +2 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.js +1 -0
- package/dist/core/builder.d.ts +61 -0
- package/dist/core/builder.js +72 -0
- package/dist/core/collection/collection.d.ts +33 -0
- package/dist/core/collection/collection.js +55 -0
- package/dist/core/collection/index.d.ts +4 -0
- package/dist/core/collection/index.js +2 -0
- package/dist/core/collection/method.d.ts +51 -0
- package/dist/core/collection/method.js +11 -0
- package/dist/core/component/component.d.ts +14 -0
- package/dist/core/component/component.js +17 -0
- package/dist/core/component/graph.d.ts +13 -0
- package/dist/core/component/graph.js +52 -0
- package/dist/core/component/index.d.ts +4 -0
- package/dist/core/component/index.js +2 -0
- package/dist/core/component/method.d.ts +13 -0
- package/dist/core/component/method.js +1 -0
- package/dist/core/graph.d.ts +8 -0
- package/dist/core/graph.js +1 -0
- package/dist/core/index.d.ts +8 -0
- package/dist/core/index.js +4 -0
- package/dist/core/option/graph.d.ts +11 -0
- package/dist/core/option/graph.js +78 -0
- package/dist/core/option/index.d.ts +9 -0
- package/dist/core/option/index.js +5 -0
- package/dist/core/option/method.d.ts +52 -0
- package/dist/core/option/method.js +9 -0
- package/dist/core/option/option.d.ts +22 -0
- package/dist/core/option/option.js +49 -0
- package/dist/core/option/select.d.ts +17 -0
- package/dist/core/option/select.js +30 -0
- package/dist/core/option/toggle.d.ts +14 -0
- package/dist/core/option/toggle.js +27 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +6 -0
- package/dist/invariant.d.ts +1 -0
- package/dist/invariant.js +6 -0
- package/dist/paths.d.ts +14 -0
- package/dist/paths.js +8 -0
- package/dist/prettify.d.ts +3 -0
- package/dist/prettify.js +1 -0
- package/dist/resolve/index.d.ts +9 -0
- package/dist/resolve/index.js +5 -0
- package/dist/resolve/instance.d.ts +3 -0
- package/dist/resolve/instance.js +26 -0
- package/dist/resolve/models.d.ts +3 -0
- package/dist/resolve/models.js +10 -0
- package/dist/resolve/order.d.ts +18 -0
- package/dist/resolve/order.js +24 -0
- package/dist/resolve/render.d.ts +21 -0
- package/dist/resolve/render.js +182 -0
- package/dist/resolve/validate.d.ts +32 -0
- package/dist/resolve/validate.js +50 -0
- package/dist/schemas/description.d.ts +5 -0
- package/dist/schemas/description.js +3 -0
- package/dist/schemas/index.d.ts +10 -0
- package/dist/schemas/index.js +5 -0
- package/dist/schemas/layout.d.ts +52 -0
- package/dist/schemas/layout.js +6 -0
- package/dist/schemas/primitives.d.ts +9 -0
- package/dist/schemas/primitives.js +5 -0
- package/dist/schemas/serialise.d.ts +1077 -0
- package/dist/schemas/serialise.js +141 -0
- package/dist/schemas/ui.d.ts +96 -0
- package/dist/schemas/ui.js +23 -0
- package/dist/serialise/deserialise.d.ts +9 -0
- package/dist/serialise/deserialise.js +108 -0
- package/dist/serialise/index.d.ts +4 -0
- package/dist/serialise/index.js +3 -0
- package/dist/serialise/serialise.d.ts +10 -0
- package/dist/serialise/serialise.js +123 -0
- package/dist/ui.d.ts +18 -0
- package/dist/ui.js +35 -0
- package/package.json +70 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { BuilderPathSchema, BuilderPathsSchema, BuilderPrimitiveSchema } from './primitives.js';
|
|
3
|
+
const BuilderSerialisedSelectTypeObject = v.object({
|
|
4
|
+
type: v.literal('select'),
|
|
5
|
+
options: v.pipe(v.tupleWithRest([v.string()], v.string()), v.readonly()),
|
|
6
|
+
defaultValue: v.nullable(v.string()),
|
|
7
|
+
optional: v.boolean(),
|
|
8
|
+
labels: v.record(v.string(), v.string())
|
|
9
|
+
});
|
|
10
|
+
const BuilderSerialisedToggleTypeObject = v.object({
|
|
11
|
+
type: v.literal('toggle'),
|
|
12
|
+
valueType: v.string(),
|
|
13
|
+
defaultValue: v.nullable(v.union([v.boolean(), v.string(), v.number()])),
|
|
14
|
+
optional: v.boolean()
|
|
15
|
+
});
|
|
16
|
+
export const BuilderSelectTypeSerialisedSchema = v.pipe(BuilderSerialisedSelectTypeObject, v.readonly());
|
|
17
|
+
export const BuilderToggleTypeSerialisedSchema = v.pipe(BuilderSerialisedToggleTypeObject, v.readonly());
|
|
18
|
+
export const BuilderValuesSerialisedSchema = v.pipe(v.variant('type', [BuilderSerialisedSelectTypeObject, BuilderSerialisedToggleTypeObject]), v.readonly());
|
|
19
|
+
const BuilderSerialisedOptionEnableConfigObject = v.object({
|
|
20
|
+
type: v.literal('enable'),
|
|
21
|
+
values: v.variant('type', [BuilderSerialisedSelectTypeObject, BuilderSerialisedToggleTypeObject])
|
|
22
|
+
});
|
|
23
|
+
const BuilderSerialisedOptionMatchConfigObject = v.object({
|
|
24
|
+
type: v.literal('match'),
|
|
25
|
+
matchPath: BuilderPathSchema,
|
|
26
|
+
selectMap: v.record(v.string(), v.nullable(v.variant('type', [BuilderSerialisedSelectTypeObject, BuilderSerialisedToggleTypeObject])))
|
|
27
|
+
});
|
|
28
|
+
const BuilderSerialisedOptionUnlessConfigObject = v.object({
|
|
29
|
+
type: v.literal('unless'),
|
|
30
|
+
unlessPath: BuilderPathSchema,
|
|
31
|
+
disabledValues: v.pipe(v.array(BuilderPrimitiveSchema), v.readonly()),
|
|
32
|
+
values: v.variant('type', [BuilderSerialisedSelectTypeObject, BuilderSerialisedToggleTypeObject])
|
|
33
|
+
});
|
|
34
|
+
export const BuilderOptionEnableConfigSerialisedSchema = v.pipe(BuilderSerialisedOptionEnableConfigObject, v.readonly());
|
|
35
|
+
export const BuilderOptionMatchConfigSerialisedSchema = v.pipe(BuilderSerialisedOptionMatchConfigObject, v.readonly());
|
|
36
|
+
export const BuilderOptionUnlessConfigSerialisedSchema = v.pipe(BuilderSerialisedOptionUnlessConfigObject, v.readonly());
|
|
37
|
+
export const BuilderOptionWhenConfigSerialisedSchema = v.pipe(v.variant('type', [
|
|
38
|
+
BuilderSerialisedOptionEnableConfigObject,
|
|
39
|
+
BuilderSerialisedOptionMatchConfigObject,
|
|
40
|
+
BuilderSerialisedOptionUnlessConfigObject
|
|
41
|
+
]), v.readonly());
|
|
42
|
+
export const BuilderOptionSerialisedSchema = v.pipe(v.object({
|
|
43
|
+
name: v.string(),
|
|
44
|
+
values: v.variant('type', [
|
|
45
|
+
BuilderSerialisedSelectTypeObject,
|
|
46
|
+
BuilderSerialisedToggleTypeObject
|
|
47
|
+
]),
|
|
48
|
+
gatePaths: BuilderPathsSchema,
|
|
49
|
+
config: v.nullable(v.variant('type', [
|
|
50
|
+
BuilderSerialisedOptionEnableConfigObject,
|
|
51
|
+
BuilderSerialisedOptionMatchConfigObject,
|
|
52
|
+
BuilderSerialisedOptionUnlessConfigObject
|
|
53
|
+
]))
|
|
54
|
+
}), v.readonly());
|
|
55
|
+
export const BuilderComponentSerialisedSchema = v.pipe(v.object({
|
|
56
|
+
name: v.string(),
|
|
57
|
+
paths: BuilderPathsSchema,
|
|
58
|
+
dependencies: v.pipe(v.array(v.string()), v.readonly())
|
|
59
|
+
}), v.readonly());
|
|
60
|
+
const lazyBuilder = () => v.lazy(() => BuilderSerialisedSchema);
|
|
61
|
+
const BuilderSerialisedCollectionConfigObject = v.object({
|
|
62
|
+
builder: lazyBuilder(),
|
|
63
|
+
min: v.number(),
|
|
64
|
+
max: v.number()
|
|
65
|
+
});
|
|
66
|
+
const BuilderSerialisedCollectionEnableConfigObject = v.object({
|
|
67
|
+
type: v.literal('enable'),
|
|
68
|
+
builder: lazyBuilder(),
|
|
69
|
+
min: v.number(),
|
|
70
|
+
max: v.number()
|
|
71
|
+
});
|
|
72
|
+
const BuilderSerialisedCollectionMatchConfigObject = v.object({
|
|
73
|
+
type: v.literal('match'),
|
|
74
|
+
matchPath: BuilderPathSchema,
|
|
75
|
+
selectMap: v.record(v.string(), v.nullable(BuilderSerialisedCollectionConfigObject))
|
|
76
|
+
});
|
|
77
|
+
const BuilderSerialisedCollectionUnlessConfigObject = v.object({
|
|
78
|
+
type: v.literal('unless'),
|
|
79
|
+
unlessPath: BuilderPathSchema,
|
|
80
|
+
disabledValues: v.pipe(v.array(BuilderPrimitiveSchema), v.readonly()),
|
|
81
|
+
builder: lazyBuilder(),
|
|
82
|
+
min: v.number(),
|
|
83
|
+
max: v.number()
|
|
84
|
+
});
|
|
85
|
+
export const BuilderCollectionConfigSerialisedSchema = v.pipe(BuilderSerialisedCollectionConfigObject, v.readonly());
|
|
86
|
+
export const BuilderCollectionEnableConfigSerialisedSchema = v.pipe(BuilderSerialisedCollectionEnableConfigObject, v.readonly());
|
|
87
|
+
export const BuilderCollectionMatchConfigSerialisedSchema = v.pipe(BuilderSerialisedCollectionMatchConfigObject, v.readonly());
|
|
88
|
+
export const BuilderCollectionUnlessConfigSerialisedSchema = v.pipe(BuilderSerialisedCollectionUnlessConfigObject, v.readonly());
|
|
89
|
+
export const BuilderCollectionWhenConfigSerialisedSchema = v.pipe(v.variant('type', [
|
|
90
|
+
BuilderSerialisedCollectionEnableConfigObject,
|
|
91
|
+
BuilderSerialisedCollectionMatchConfigObject,
|
|
92
|
+
BuilderSerialisedCollectionUnlessConfigObject
|
|
93
|
+
]), v.readonly());
|
|
94
|
+
const BuilderSerialisedCollectionObject = v.object({
|
|
95
|
+
name: v.string(),
|
|
96
|
+
builder: lazyBuilder(),
|
|
97
|
+
min: v.number(),
|
|
98
|
+
max: v.number(),
|
|
99
|
+
gatePaths: BuilderPathsSchema,
|
|
100
|
+
config: v.nullable(v.variant('type', [
|
|
101
|
+
BuilderSerialisedCollectionEnableConfigObject,
|
|
102
|
+
BuilderSerialisedCollectionMatchConfigObject,
|
|
103
|
+
BuilderSerialisedCollectionUnlessConfigObject
|
|
104
|
+
]))
|
|
105
|
+
});
|
|
106
|
+
export const BuilderCollectionSerialisedSchema = v.pipe(BuilderSerialisedCollectionObject, v.readonly());
|
|
107
|
+
export const BuilderSerialisedSchema = v.pipe(v.object({
|
|
108
|
+
options: v.pipe(v.array(BuilderOptionSerialisedSchema), v.readonly()),
|
|
109
|
+
components: v.pipe(v.array(BuilderComponentSerialisedSchema), v.readonly()),
|
|
110
|
+
collections: v.pipe(v.array(BuilderSerialisedCollectionObject), v.readonly())
|
|
111
|
+
}), v.readonly());
|
|
112
|
+
const BuilderSerialisedUIPageObject = v.object({
|
|
113
|
+
type: v.literal('page'),
|
|
114
|
+
label: v.nullable(v.string()),
|
|
115
|
+
paths: BuilderPathsSchema
|
|
116
|
+
});
|
|
117
|
+
const BuilderSerialisedUIDescribeObject = v.object({
|
|
118
|
+
type: v.literal('describe'),
|
|
119
|
+
label: v.nullable(v.string()),
|
|
120
|
+
paths: BuilderPathsSchema
|
|
121
|
+
});
|
|
122
|
+
const lazySerialisedUIItems = () => v.lazy(() => BuilderUIItemsSerialisedSchema);
|
|
123
|
+
const BuilderSerialisedUICollectionObject = v.object({
|
|
124
|
+
type: v.literal('collection'),
|
|
125
|
+
name: v.string(),
|
|
126
|
+
label: v.string(),
|
|
127
|
+
items: lazySerialisedUIItems()
|
|
128
|
+
});
|
|
129
|
+
export const BuilderUIPageSerialisedSchema = v.pipe(BuilderSerialisedUIPageObject, v.readonly());
|
|
130
|
+
export const BuilderUIDescribeSerialisedSchema = v.pipe(BuilderSerialisedUIDescribeObject, v.readonly());
|
|
131
|
+
export const BuilderUICollectionSerialisedSchema = v.pipe(BuilderSerialisedUICollectionObject, v.readonly());
|
|
132
|
+
export const BuilderUIItemSerialisedSchema = v.pipe(v.variant('type', [
|
|
133
|
+
BuilderSerialisedUIPageObject,
|
|
134
|
+
BuilderSerialisedUIDescribeObject,
|
|
135
|
+
BuilderSerialisedUICollectionObject
|
|
136
|
+
]), v.readonly());
|
|
137
|
+
export const BuilderUIItemsSerialisedSchema = v.pipe(v.array(v.variant('type', [
|
|
138
|
+
BuilderSerialisedUIPageObject,
|
|
139
|
+
BuilderSerialisedUIDescribeObject,
|
|
140
|
+
BuilderSerialisedUICollectionObject
|
|
141
|
+
])), v.readonly());
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
export declare const BuilderUIPageSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
3
|
+
readonly type: v.LiteralSchema<"page", undefined>;
|
|
4
|
+
readonly label: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5
|
+
readonly paths: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>, undefined>, v.ReadonlyAction<(readonly (string | number)[])[]>]>;
|
|
6
|
+
}, undefined>, v.ReadonlyAction<{
|
|
7
|
+
type: "page";
|
|
8
|
+
label: string | null;
|
|
9
|
+
readonly paths: readonly (readonly (string | number)[])[];
|
|
10
|
+
}>]>;
|
|
11
|
+
export type BuilderUIPage = v.InferOutput<typeof BuilderUIPageSchema>;
|
|
12
|
+
export declare const BuilderUIDescribeSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
13
|
+
readonly type: v.LiteralSchema<"describe", undefined>;
|
|
14
|
+
readonly label: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
15
|
+
readonly paths: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>, undefined>, v.ReadonlyAction<(readonly (string | number)[])[]>]>;
|
|
16
|
+
}, undefined>, v.ReadonlyAction<{
|
|
17
|
+
type: "describe";
|
|
18
|
+
label: string | null;
|
|
19
|
+
readonly paths: readonly (readonly (string | number)[])[];
|
|
20
|
+
}>]>;
|
|
21
|
+
export type BuilderUIDescribe = v.InferOutput<typeof BuilderUIDescribeSchema>;
|
|
22
|
+
export type BuilderUICollection = {
|
|
23
|
+
readonly type: 'collection';
|
|
24
|
+
readonly name: string;
|
|
25
|
+
readonly label: string;
|
|
26
|
+
readonly items: BuilderUIItems;
|
|
27
|
+
};
|
|
28
|
+
export type BuilderUIItem = BuilderUIPage | BuilderUIDescribe | BuilderUICollection;
|
|
29
|
+
export type BuilderUIItems = ReadonlyArray<BuilderUIItem>;
|
|
30
|
+
type UIItemsSchemaType = v.GenericSchema<BuilderUIItems>;
|
|
31
|
+
export declare const BuilderUICollectionSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
32
|
+
readonly type: v.LiteralSchema<"collection", undefined>;
|
|
33
|
+
readonly name: v.StringSchema<undefined>;
|
|
34
|
+
readonly label: v.StringSchema<undefined>;
|
|
35
|
+
readonly items: v.LazySchema<UIItemsSchemaType>;
|
|
36
|
+
}, undefined>, v.ReadonlyAction<{
|
|
37
|
+
type: "collection";
|
|
38
|
+
name: string;
|
|
39
|
+
label: string;
|
|
40
|
+
items: BuilderUIItems;
|
|
41
|
+
}>]>;
|
|
42
|
+
export declare const BuilderUIItemSchema: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.ObjectSchema<{
|
|
43
|
+
readonly type: v.LiteralSchema<"page", undefined>;
|
|
44
|
+
readonly label: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
45
|
+
readonly paths: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>, undefined>, v.ReadonlyAction<(readonly (string | number)[])[]>]>;
|
|
46
|
+
}, undefined>, v.ObjectSchema<{
|
|
47
|
+
readonly type: v.LiteralSchema<"describe", undefined>;
|
|
48
|
+
readonly label: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
49
|
+
readonly paths: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>, undefined>, v.ReadonlyAction<(readonly (string | number)[])[]>]>;
|
|
50
|
+
}, undefined>, v.ObjectSchema<{
|
|
51
|
+
readonly type: v.LiteralSchema<"collection", undefined>;
|
|
52
|
+
readonly name: v.StringSchema<undefined>;
|
|
53
|
+
readonly label: v.StringSchema<undefined>;
|
|
54
|
+
readonly items: v.LazySchema<UIItemsSchemaType>;
|
|
55
|
+
}, undefined>], undefined>, v.ReadonlyAction<{
|
|
56
|
+
type: "page";
|
|
57
|
+
label: string | null;
|
|
58
|
+
readonly paths: readonly (readonly (string | number)[])[];
|
|
59
|
+
} | {
|
|
60
|
+
type: "describe";
|
|
61
|
+
label: string | null;
|
|
62
|
+
readonly paths: readonly (readonly (string | number)[])[];
|
|
63
|
+
} | {
|
|
64
|
+
type: "collection";
|
|
65
|
+
name: string;
|
|
66
|
+
label: string;
|
|
67
|
+
items: BuilderUIItems;
|
|
68
|
+
}>]>;
|
|
69
|
+
export declare const BuilderUIItemsSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
70
|
+
readonly type: v.LiteralSchema<"page", undefined>;
|
|
71
|
+
readonly label: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
72
|
+
readonly paths: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>, undefined>, v.ReadonlyAction<(readonly (string | number)[])[]>]>;
|
|
73
|
+
}, undefined>, v.ObjectSchema<{
|
|
74
|
+
readonly type: v.LiteralSchema<"describe", undefined>;
|
|
75
|
+
readonly label: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
76
|
+
readonly paths: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>, undefined>, v.ReadonlyAction<(readonly (string | number)[])[]>]>;
|
|
77
|
+
}, undefined>, v.ObjectSchema<{
|
|
78
|
+
readonly type: v.LiteralSchema<"collection", undefined>;
|
|
79
|
+
readonly name: v.StringSchema<undefined>;
|
|
80
|
+
readonly label: v.StringSchema<undefined>;
|
|
81
|
+
readonly items: v.LazySchema<UIItemsSchemaType>;
|
|
82
|
+
}, undefined>], undefined>, undefined>, v.ReadonlyAction<({
|
|
83
|
+
type: "page";
|
|
84
|
+
label: string | null;
|
|
85
|
+
readonly paths: readonly (readonly (string | number)[])[];
|
|
86
|
+
} | {
|
|
87
|
+
type: "describe";
|
|
88
|
+
label: string | null;
|
|
89
|
+
readonly paths: readonly (readonly (string | number)[])[];
|
|
90
|
+
} | {
|
|
91
|
+
type: "collection";
|
|
92
|
+
name: string;
|
|
93
|
+
label: string;
|
|
94
|
+
items: BuilderUIItems;
|
|
95
|
+
})[]>]>;
|
|
96
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { BuilderPathsSchema } from './primitives.js';
|
|
3
|
+
const BuilderUIPageObject = v.object({
|
|
4
|
+
type: v.literal('page'),
|
|
5
|
+
label: v.nullable(v.string()),
|
|
6
|
+
paths: BuilderPathsSchema
|
|
7
|
+
});
|
|
8
|
+
const BuilderUIDescribeObject = v.object({
|
|
9
|
+
type: v.literal('describe'),
|
|
10
|
+
label: v.nullable(v.string()),
|
|
11
|
+
paths: BuilderPathsSchema
|
|
12
|
+
});
|
|
13
|
+
export const BuilderUIPageSchema = v.pipe(BuilderUIPageObject, v.readonly());
|
|
14
|
+
export const BuilderUIDescribeSchema = v.pipe(BuilderUIDescribeObject, v.readonly());
|
|
15
|
+
const BuilderUICollectionObject = v.object({
|
|
16
|
+
type: v.literal('collection'),
|
|
17
|
+
name: v.string(),
|
|
18
|
+
label: v.string(),
|
|
19
|
+
items: v.lazy(() => BuilderUIItemsSchema)
|
|
20
|
+
});
|
|
21
|
+
export const BuilderUICollectionSchema = v.pipe(BuilderUICollectionObject, v.readonly());
|
|
22
|
+
export const BuilderUIItemSchema = v.pipe(v.variant('type', [BuilderUIPageObject, BuilderUIDescribeObject, BuilderUICollectionObject]), v.readonly());
|
|
23
|
+
export const BuilderUIItemsSchema = v.pipe(v.array(v.variant('type', [BuilderUIPageObject, BuilderUIDescribeObject, BuilderUICollectionObject])), v.readonly());
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BuilderGeneric } from '../core/index';
|
|
2
|
+
import type { BuilderUIGeneric } from '../ui';
|
|
3
|
+
export declare const deserialise: {
|
|
4
|
+
builder: typeof deserialiseBuilder;
|
|
5
|
+
ui: typeof deserialiseUI;
|
|
6
|
+
};
|
|
7
|
+
declare function deserialiseBuilder(data: unknown): BuilderGeneric;
|
|
8
|
+
declare function deserialiseUI(builder: BuilderGeneric, data: unknown): BuilderUIGeneric;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { BuilderCollection, BuilderComponent, BuilderComponentGraph, BuilderOption, BuilderOptionGraph, Builder, BuilderSelectType, BuilderToggleType } from '../core/index.js';
|
|
3
|
+
import { BuilderSerialisedSchema, BuilderUIItemsSerialisedSchema } from '../schemas/index.js';
|
|
4
|
+
import { BuilderUI } from '../ui.js';
|
|
5
|
+
export const deserialise = {
|
|
6
|
+
builder: deserialiseBuilder,
|
|
7
|
+
ui: deserialiseUI
|
|
8
|
+
};
|
|
9
|
+
function deserialiseBuilder(data) {
|
|
10
|
+
return buildBuilder(v.parse(BuilderSerialisedSchema, data));
|
|
11
|
+
}
|
|
12
|
+
function deserialiseUI(builder, data) {
|
|
13
|
+
return new BuilderUI(builder, v.parse(BuilderUIItemsSerialisedSchema, data));
|
|
14
|
+
}
|
|
15
|
+
function buildBuilder(data) {
|
|
16
|
+
const options = data.options.map(deserialiseOption);
|
|
17
|
+
const components = data.components.map(deserialiseComponent);
|
|
18
|
+
const collections = data.collections.map(deserialiseCollection);
|
|
19
|
+
const rebuiltOptionGraph = options.reduce((graph, option) => graph.add(option), new BuilderOptionGraph());
|
|
20
|
+
const rebuiltComponentGraph = components.reduce((graph, component) => graph.add(component, rebuiltOptionGraph), new BuilderComponentGraph());
|
|
21
|
+
const collectionComponentGraphs = collections.map((collection) => collection.builder.componentGraph);
|
|
22
|
+
return new Builder(options, collections, components, rebuiltOptionGraph, BuilderComponentGraph.merge(rebuiltComponentGraph, ...collectionComponentGraphs));
|
|
23
|
+
}
|
|
24
|
+
function deserialiseOption(data) {
|
|
25
|
+
const values = deserialiseValues(data.values);
|
|
26
|
+
const config = deserialiseOptionWhenConfig(data.config);
|
|
27
|
+
return new BuilderOption(data.name, values, data.gatePaths, config);
|
|
28
|
+
}
|
|
29
|
+
function deserialiseComponent(data) {
|
|
30
|
+
return new BuilderComponent(data.name, data.paths, data.dependencies);
|
|
31
|
+
}
|
|
32
|
+
function deserialiseCollection(data) {
|
|
33
|
+
const built = buildBuilder(data.builder);
|
|
34
|
+
const config = deserialiseCollectionWhenConfig(data.config);
|
|
35
|
+
return new BuilderCollection(data.name, built, data.min, data.max, data.gatePaths, config);
|
|
36
|
+
}
|
|
37
|
+
function deserialiseValues(data) {
|
|
38
|
+
if (data.type === 'select') {
|
|
39
|
+
const { optional, options, defaultValue, labels } = data;
|
|
40
|
+
const valueSchema = v.union(options.map((value) => v.literal(value)));
|
|
41
|
+
return new BuilderSelectType(options, optional ? v.nullable(valueSchema) : valueSchema, defaultValue, optional, labels);
|
|
42
|
+
}
|
|
43
|
+
const valueSchema = deserialiseToggleValueSchema(data.valueType, data.optional);
|
|
44
|
+
return new BuilderToggleType(valueSchema, data.defaultValue, data.optional);
|
|
45
|
+
}
|
|
46
|
+
function deserialiseToggleValueSchema(valueType, optional) {
|
|
47
|
+
const base = valueType.includes('boolean')
|
|
48
|
+
? v.boolean()
|
|
49
|
+
: valueType.includes('string')
|
|
50
|
+
? v.string()
|
|
51
|
+
: v.number();
|
|
52
|
+
return optional ? v.nullable(base) : base;
|
|
53
|
+
}
|
|
54
|
+
function deserialiseOptionWhenConfig(data) {
|
|
55
|
+
if (data === null) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
switch (data.type) {
|
|
59
|
+
case 'enable': {
|
|
60
|
+
const { type } = data;
|
|
61
|
+
const values = deserialiseValues(data.values);
|
|
62
|
+
return { type, values };
|
|
63
|
+
}
|
|
64
|
+
case 'match': {
|
|
65
|
+
const { matchPath, type } = data;
|
|
66
|
+
const selectMap = Object.fromEntries(Object.entries(data.selectMap).map(([key, value]) => [
|
|
67
|
+
key,
|
|
68
|
+
value ? deserialiseValues(value) : null
|
|
69
|
+
]));
|
|
70
|
+
return { type, matchPath, selectMap };
|
|
71
|
+
}
|
|
72
|
+
case 'unless': {
|
|
73
|
+
const { type, unlessPath, disabledValues } = data;
|
|
74
|
+
const values = deserialiseValues(data.values);
|
|
75
|
+
return { type, unlessPath, disabledValues, values };
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function deserialiseCollectionWhenConfig(data) {
|
|
80
|
+
if (data === null) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
switch (data.type) {
|
|
84
|
+
case 'enable': {
|
|
85
|
+
const { max, min, builder: builderData, type } = data;
|
|
86
|
+
return { type, builder: buildBuilder(builderData), min, max };
|
|
87
|
+
}
|
|
88
|
+
case 'match': {
|
|
89
|
+
const { matchPath, selectMap, type } = data;
|
|
90
|
+
const deserialisedSelectMap = Object.fromEntries(Object.entries(selectMap).map(([key, value]) => {
|
|
91
|
+
if (!value) {
|
|
92
|
+
return [key, null];
|
|
93
|
+
}
|
|
94
|
+
const { builder: builderData, min, max } = value;
|
|
95
|
+
return [key, { builder: buildBuilder(builderData), min, max }];
|
|
96
|
+
}));
|
|
97
|
+
return {
|
|
98
|
+
type,
|
|
99
|
+
matchPath,
|
|
100
|
+
selectMap: deserialisedSelectMap
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
case 'unless': {
|
|
104
|
+
const { disabledValues, max, min, builder: builderData, type, unlessPath } = data;
|
|
105
|
+
return { type, unlessPath, disabledValues, builder: buildBuilder(builderData), min, max };
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { BuilderCollectionSerialised, BuilderCollectionConfigSerialised, BuilderCollectionEnableConfigSerialised, BuilderCollectionMatchConfigSerialised, BuilderCollectionUnlessConfigSerialised, BuilderCollectionWhenConfigSerialised, BuilderComponentSerialised, BuilderOptionSerialised, BuilderOptionEnableConfigSerialised, BuilderOptionMatchConfigSerialised, BuilderOptionUnlessConfigSerialised, BuilderOptionWhenConfigSerialised, BuilderSerialised, BuilderSelectTypeSerialised, BuilderToggleTypeSerialised, BuilderUISerialised, BuilderUICollectionSerialised, BuilderUIDescribeSerialised, BuilderUIItemSerialised, BuilderUIItemsSerialised, BuilderUIPageSerialised, BuilderValuesSerialised } from '../schemas/index';
|
|
2
|
+
export { BuilderCollectionConfigSerialisedSchema, BuilderCollectionEnableConfigSerialisedSchema, BuilderCollectionMatchConfigSerialisedSchema, BuilderCollectionSerialisedSchema, BuilderCollectionUnlessConfigSerialisedSchema, BuilderCollectionWhenConfigSerialisedSchema, BuilderComponentSerialisedSchema, BuilderOptionEnableConfigSerialisedSchema, BuilderOptionMatchConfigSerialisedSchema, BuilderOptionSerialisedSchema, BuilderOptionUnlessConfigSerialisedSchema, BuilderOptionWhenConfigSerialisedSchema, BuilderSerialisedSchema, BuilderSelectTypeSerialisedSchema, BuilderToggleTypeSerialisedSchema, BuilderUICollectionSerialisedSchema, BuilderUIDescribeSerialisedSchema, BuilderUIItemSerialisedSchema, BuilderUIItemsSerialisedSchema, BuilderUIPageSerialisedSchema, BuilderValuesSerialisedSchema } from '../schemas/index.js';
|
|
3
|
+
export { deserialise } from './deserialise.js';
|
|
4
|
+
export { serialise } from './serialise.js';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { BuilderCollectionConfigSerialisedSchema, BuilderCollectionEnableConfigSerialisedSchema, BuilderCollectionMatchConfigSerialisedSchema, BuilderCollectionSerialisedSchema, BuilderCollectionUnlessConfigSerialisedSchema, BuilderCollectionWhenConfigSerialisedSchema, BuilderComponentSerialisedSchema, BuilderOptionEnableConfigSerialisedSchema, BuilderOptionMatchConfigSerialisedSchema, BuilderOptionSerialisedSchema, BuilderOptionUnlessConfigSerialisedSchema, BuilderOptionWhenConfigSerialisedSchema, BuilderSerialisedSchema, BuilderSelectTypeSerialisedSchema, BuilderToggleTypeSerialisedSchema, BuilderUICollectionSerialisedSchema, BuilderUIDescribeSerialisedSchema, BuilderUIItemSerialisedSchema, BuilderUIItemsSerialisedSchema, BuilderUIPageSerialisedSchema, BuilderValuesSerialisedSchema } from '../schemas/index.js';
|
|
2
|
+
export { deserialise } from './deserialise.js';
|
|
3
|
+
export { serialise } from './serialise.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BuilderGeneric } from '../core/index';
|
|
2
|
+
import type { BuilderUIGeneric } from '../ui';
|
|
3
|
+
import type { BuilderSerialised, BuilderUISerialised } from '../schemas/index';
|
|
4
|
+
export declare const serialise: {
|
|
5
|
+
builder: typeof serialiseBuilder;
|
|
6
|
+
ui: typeof serialiseUI;
|
|
7
|
+
};
|
|
8
|
+
declare function serialiseBuilder(builder: BuilderGeneric): BuilderSerialised;
|
|
9
|
+
declare function serialiseUI(input: BuilderUIGeneric): BuilderUISerialised;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { BuilderCollection, BuilderComponent, BuilderOption, BuilderSelectType } from '../core/index.js';
|
|
3
|
+
export const serialise = {
|
|
4
|
+
builder: serialiseBuilder,
|
|
5
|
+
ui: serialiseUI
|
|
6
|
+
};
|
|
7
|
+
function serialiseBuilder(builder) {
|
|
8
|
+
return {
|
|
9
|
+
options: builder.options.map(serialiseOption),
|
|
10
|
+
components: builder.components.map(serialiseComponent),
|
|
11
|
+
collections: builder.collections.map(serialiseCollection)
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function serialiseUI(input) {
|
|
15
|
+
return input.items;
|
|
16
|
+
}
|
|
17
|
+
function serialiseOption(option) {
|
|
18
|
+
return {
|
|
19
|
+
name: option.name,
|
|
20
|
+
values: serialiseValues(option.values),
|
|
21
|
+
gatePaths: option.gatePaths,
|
|
22
|
+
config: serialiseOptionWhenConfig(option.config)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function serialiseComponent(component) {
|
|
26
|
+
return {
|
|
27
|
+
name: component.name,
|
|
28
|
+
paths: component.paths,
|
|
29
|
+
dependencies: component.dependencies
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function serialiseCollection(collection) {
|
|
33
|
+
return {
|
|
34
|
+
name: collection.name,
|
|
35
|
+
builder: serialiseBuilder(collection.builder),
|
|
36
|
+
min: collection.min,
|
|
37
|
+
max: collection.max,
|
|
38
|
+
gatePaths: collection.gatePaths,
|
|
39
|
+
config: serialiseCollectionWhenConfig(collection.config)
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function serialiseValues(optionValues) {
|
|
43
|
+
if (v.is(v.instance(BuilderSelectType), optionValues)) {
|
|
44
|
+
return {
|
|
45
|
+
type: 'select',
|
|
46
|
+
options: optionValues.options,
|
|
47
|
+
defaultValue: optionValues.defaultValue,
|
|
48
|
+
optional: optionValues.isOptional,
|
|
49
|
+
labels: optionValues.optionLabels
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
type: 'toggle',
|
|
54
|
+
valueType: optionValues.valueSchema.expects,
|
|
55
|
+
defaultValue: optionValues.defaultValue,
|
|
56
|
+
optional: optionValues.isOptional
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function serialiseOptionWhenConfig(config) {
|
|
60
|
+
if (config === null) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
switch (config.type) {
|
|
64
|
+
case 'enable': {
|
|
65
|
+
return { type: 'enable', values: serialiseValues(config.values) };
|
|
66
|
+
}
|
|
67
|
+
case 'match': {
|
|
68
|
+
return {
|
|
69
|
+
type: 'match',
|
|
70
|
+
matchPath: config.matchPath,
|
|
71
|
+
selectMap: Object.fromEntries(Object.entries(config.selectMap).map(([key, value]) => [
|
|
72
|
+
key,
|
|
73
|
+
value ? serialiseValues(value) : null
|
|
74
|
+
]))
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
case 'unless': {
|
|
78
|
+
return {
|
|
79
|
+
type: 'unless',
|
|
80
|
+
unlessPath: config.unlessPath,
|
|
81
|
+
disabledValues: config.disabledValues,
|
|
82
|
+
values: serialiseValues(config.values)
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function serialiseCollectionWhenConfig(config) {
|
|
88
|
+
if (config === null) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
switch (config.type) {
|
|
92
|
+
case 'enable': {
|
|
93
|
+
return {
|
|
94
|
+
type: 'enable',
|
|
95
|
+
builder: serialiseBuilder(config.builder),
|
|
96
|
+
min: config.min,
|
|
97
|
+
max: config.max
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
case 'match': {
|
|
101
|
+
return {
|
|
102
|
+
type: 'match',
|
|
103
|
+
matchPath: config.matchPath,
|
|
104
|
+
selectMap: Object.fromEntries(Object.entries(config.selectMap).map(([key, value]) => [
|
|
105
|
+
key,
|
|
106
|
+
value
|
|
107
|
+
? { builder: serialiseBuilder(value.builder), min: value.min, max: value.max }
|
|
108
|
+
: null
|
|
109
|
+
]))
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
case 'unless': {
|
|
113
|
+
return {
|
|
114
|
+
type: 'unless',
|
|
115
|
+
unlessPath: config.unlessPath,
|
|
116
|
+
disabledValues: config.disabledValues,
|
|
117
|
+
builder: serialiseBuilder(config.builder),
|
|
118
|
+
min: config.min,
|
|
119
|
+
max: config.max
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { BuilderModelPaths } from './paths';
|
|
2
|
+
import type { BuilderCollectionNamesOf, BuilderCollectionOf, BuilderGeneric } from './core/index';
|
|
3
|
+
import type { BuilderUIItems } from './schemas/index';
|
|
4
|
+
export type BuilderUIGeneric = BuilderUI<BuilderGeneric>;
|
|
5
|
+
export type BuilderUIFactory<B extends BuilderGeneric = BuilderGeneric> = (ui: BuilderUI<B>) => BuilderUIGeneric;
|
|
6
|
+
export type BuilderUIPart<B extends BuilderGeneric = BuilderGeneric> = BuilderUIGeneric | BuilderUIFactory<B>;
|
|
7
|
+
export type BuilderUIParts<B extends BuilderGeneric = BuilderGeneric> = ReadonlyArray<BuilderUIPart<B>>;
|
|
8
|
+
export declare class BuilderUI<B extends BuilderGeneric = BuilderGeneric> {
|
|
9
|
+
readonly builder: B;
|
|
10
|
+
readonly items: BuilderUIItems;
|
|
11
|
+
constructor(builder: B, items?: BuilderUIItems);
|
|
12
|
+
page(label: string | null, paths: BuilderModelPaths<B>): BuilderUI<B>;
|
|
13
|
+
describe(label: string | null, paths: BuilderModelPaths<B>): BuilderUI<B>;
|
|
14
|
+
collection<const Name extends BuilderCollectionNamesOf<B>>(name: Name, label: string, factory: BuilderUIFactory<CollectionItemBuilder<B, Name>>): BuilderUI<B>;
|
|
15
|
+
}
|
|
16
|
+
export declare function ui<const B extends BuilderGeneric>(builder: B, ...parts: BuilderUIParts<B>): BuilderUI<B>;
|
|
17
|
+
type CollectionItemBuilder<BuilderInput extends BuilderGeneric, Name extends string> = BuilderCollectionOf<BuilderInput, Name>['builder'] extends BuilderGeneric ? BuilderCollectionOf<BuilderInput, Name>['builder'] : BuilderGeneric;
|
|
18
|
+
export {};
|
package/dist/ui.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { invariant } from './invariant.js';
|
|
3
|
+
export class BuilderUI {
|
|
4
|
+
builder;
|
|
5
|
+
items;
|
|
6
|
+
constructor(builder, items = []) {
|
|
7
|
+
this.builder = builder;
|
|
8
|
+
this.items = items;
|
|
9
|
+
}
|
|
10
|
+
page(label, paths) {
|
|
11
|
+
return new BuilderUI(this.builder, [...this.items, { type: 'page', label, paths }]);
|
|
12
|
+
}
|
|
13
|
+
describe(label, paths) {
|
|
14
|
+
return new BuilderUI(this.builder, [...this.items, { type: 'describe', label, paths }]);
|
|
15
|
+
}
|
|
16
|
+
collection(name, label, factory) {
|
|
17
|
+
const foundCollection = this.builder.collections.find((entry) => entry.name === name);
|
|
18
|
+
invariant(foundCollection, `Collection '${String(name)}' not found! ❌`);
|
|
19
|
+
const templateUI = new BuilderUI(foundCollection.builder);
|
|
20
|
+
const result = factory(templateUI);
|
|
21
|
+
return new BuilderUI(this.builder, [
|
|
22
|
+
...this.items,
|
|
23
|
+
{ type: 'collection', name, label, items: result.items }
|
|
24
|
+
]);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export function ui(builder, ...parts) {
|
|
28
|
+
const base = new BuilderUI(builder);
|
|
29
|
+
return parts.reduce((accumulated, part) => {
|
|
30
|
+
if (v.is(v.instance(BuilderUI), part)) {
|
|
31
|
+
return new BuilderUI(accumulated.builder, [...accumulated.items, ...part.items]);
|
|
32
|
+
}
|
|
33
|
+
return new BuilderUI(accumulated.builder, part(accumulated).items);
|
|
34
|
+
}, base);
|
|
35
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@builder-builder/builder",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"default": "./dist/index.js"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"svelte": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"scripts": {
|
|
17
|
+
"dev": "vite dev",
|
|
18
|
+
"predev": "npm run types:db",
|
|
19
|
+
"dev:v": "NO_UPDATE_NOTIFIER=false VERCEL_ENV=development vercel dev",
|
|
20
|
+
"build": "vite build",
|
|
21
|
+
"package": "svelte-kit sync && svelte-package --input src/lib/builder",
|
|
22
|
+
"preview": "vite preview",
|
|
23
|
+
"prepare": "svelte-kit sync || echo ''",
|
|
24
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
25
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
26
|
+
"format": "prettier --write .",
|
|
27
|
+
"lint": "prettier --check . && eslint .",
|
|
28
|
+
"test:unit": "vitest",
|
|
29
|
+
"test": "npm run test:unit -- --run",
|
|
30
|
+
"types:db": "dotenv -e .env.development.local -- supabase gen types typescript --project-id \"$SUPABASE_PROJECT_ID\" --schema public > ./src/lib/db/database.types.ts"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@eslint/compat": "^1.2.5",
|
|
34
|
+
"@eslint/js": "^9.18.0",
|
|
35
|
+
"@sveltejs/adapter-auto": "^6.0.0",
|
|
36
|
+
"@sveltejs/adapter-vercel": "^5.7.2",
|
|
37
|
+
"@sveltejs/kit": "^2.16.0",
|
|
38
|
+
"@sveltejs/package": "^2.5.7",
|
|
39
|
+
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
|
40
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
41
|
+
"@testing-library/svelte": "^5.2.4",
|
|
42
|
+
"dotenv-cli": "^8.0.0",
|
|
43
|
+
"eslint": "^9.18.0",
|
|
44
|
+
"eslint-config-prettier": "^10.0.1",
|
|
45
|
+
"eslint-plugin-svelte": "^3.0.0",
|
|
46
|
+
"globals": "^16.0.0",
|
|
47
|
+
"jsdom": "^26.0.0",
|
|
48
|
+
"prettier": "^3.4.2",
|
|
49
|
+
"prettier-plugin-svelte": "^3.3.3",
|
|
50
|
+
"supabase": "^2.33.9",
|
|
51
|
+
"svelte": "^5.0.0",
|
|
52
|
+
"svelte-check": "^4.0.0",
|
|
53
|
+
"typescript": "^5.0.0",
|
|
54
|
+
"typescript-eslint": "^8.20.0",
|
|
55
|
+
"vite": "^6.2.6",
|
|
56
|
+
"vitest": "^3.0.0"
|
|
57
|
+
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"@floating-ui/dom": "^1.7.2",
|
|
60
|
+
"@lucide/svelte": "^0.525.0",
|
|
61
|
+
"@supabase/supabase-js": "^2.49.8",
|
|
62
|
+
"@upstash/ratelimit": "^2.0.5",
|
|
63
|
+
"@upstash/redis": "^1.35.0",
|
|
64
|
+
"@vercel/kv": "^3.0.0",
|
|
65
|
+
"comlink": "^4.4.2",
|
|
66
|
+
"fast-deep-equal": "^3.1.3",
|
|
67
|
+
"svelte-clerk": "^0.12.3",
|
|
68
|
+
"valibot": "^1.1.0"
|
|
69
|
+
}
|
|
70
|
+
}
|