@hitslop/svelte 0.1.0
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 +21 -0
- package/README.md +29 -0
- package/dist/file-store.svelte.d.ts +21 -0
- package/dist/file-store.svelte.js +78 -0
- package/dist/image-store.svelte.d.ts +21 -0
- package/dist/image-store.svelte.js +81 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/json-store.svelte.d.ts +39 -0
- package/dist/json-store.svelte.js +91 -0
- package/dist/sqlite-query.svelte.d.ts +14 -0
- package/dist/sqlite-query.svelte.js +27 -0
- package/package.json +45 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 hitSlop contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# @hitslop/svelte
|
|
2
|
+
|
|
3
|
+
Svelte 5 state adapters for JSON, SQLite, images, and named files in a hitSlop
|
|
4
|
+
document.
|
|
5
|
+
|
|
6
|
+
```svelte
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
import { jsonStore } from "@hitslop/svelte";
|
|
9
|
+
import counterSchema from "../schema";
|
|
10
|
+
|
|
11
|
+
const document = jsonStore({
|
|
12
|
+
schema: counterSchema,
|
|
13
|
+
initial: { count: 0 },
|
|
14
|
+
});
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<button onclick={() => document.current.count += 1}>
|
|
18
|
+
{document.current.count}
|
|
19
|
+
</button>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Exports: `jsonStore`, `sqliteQuery`, `imageStore`, `fileStore`, and their
|
|
23
|
+
class/type counterparts. JSON stores require a Zod 4 schema. The adapter checks
|
|
24
|
+
initial, loaded, externally changed, and outgoing values at the persistence
|
|
25
|
+
boundary; it does not write browser storage.
|
|
26
|
+
|
|
27
|
+
See the [Svelte authoring examples](https://github.com/hitslop/hitslop/tree/main/examples/slops).
|
|
28
|
+
|
|
29
|
+
MIT © 2026 hitSlop contributors.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type FileStoreOptions = {
|
|
2
|
+
accept?: string;
|
|
3
|
+
};
|
|
4
|
+
export declare class FileStore {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly options: FileStoreOptions;
|
|
7
|
+
src: string | null;
|
|
8
|
+
hasCustomFile: boolean;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
error: string | null;
|
|
11
|
+
revision: string | null;
|
|
12
|
+
private unwatch;
|
|
13
|
+
constructor(name: string, options?: FileStoreOptions);
|
|
14
|
+
choose(): void;
|
|
15
|
+
replace(file: File): Promise<void>;
|
|
16
|
+
remove(): Promise<void>;
|
|
17
|
+
reload(): Promise<void>;
|
|
18
|
+
destroy(): void;
|
|
19
|
+
private adopt;
|
|
20
|
+
}
|
|
21
|
+
export declare const fileStore: (name: string, options?: FileStoreOptions) => FileStore;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { slop } from "@hitslop/runtime";
|
|
2
|
+
import { chooseLocalFile, fileToBase64, mediaSourceURL, safeMediaName } from "@hitslop/runtime/adapter";
|
|
3
|
+
export class FileStore {
|
|
4
|
+
name;
|
|
5
|
+
options;
|
|
6
|
+
src = $state(null);
|
|
7
|
+
hasCustomFile = $state(false);
|
|
8
|
+
isLoading = $state(true);
|
|
9
|
+
error = $state(null);
|
|
10
|
+
revision = $state(null);
|
|
11
|
+
unwatch = null;
|
|
12
|
+
constructor(name, options = {}) {
|
|
13
|
+
this.name = name;
|
|
14
|
+
this.options = options;
|
|
15
|
+
safeMediaName(name, "File");
|
|
16
|
+
void this.reload();
|
|
17
|
+
this.unwatch = slop.media.onChange(() => { void this.reload(); });
|
|
18
|
+
}
|
|
19
|
+
choose() {
|
|
20
|
+
chooseLocalFile(this.options.accept ?? "", (file) => { void this.replace(file).catch(() => undefined); });
|
|
21
|
+
}
|
|
22
|
+
async replace(file) {
|
|
23
|
+
this.isLoading = true;
|
|
24
|
+
this.error = null;
|
|
25
|
+
try {
|
|
26
|
+
const data = await fileToBase64(file);
|
|
27
|
+
const result = await slop.media.write(this.name, data, file.type || "application/octet-stream");
|
|
28
|
+
this.adopt(true, result.revision);
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
this.error = error instanceof Error ? error.message : String(error);
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
finally {
|
|
35
|
+
this.isLoading = false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async remove() {
|
|
39
|
+
this.isLoading = true;
|
|
40
|
+
this.error = null;
|
|
41
|
+
try {
|
|
42
|
+
await slop.media.remove(this.name);
|
|
43
|
+
this.adopt(false, null);
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
this.error = error instanceof Error ? error.message : String(error);
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
49
|
+
finally {
|
|
50
|
+
this.isLoading = false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async reload() {
|
|
54
|
+
this.isLoading = true;
|
|
55
|
+
try {
|
|
56
|
+
const result = await slop.media.open(this.name);
|
|
57
|
+
this.adopt(result.exists, result.revision);
|
|
58
|
+
this.error = null;
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
this.error = error instanceof Error ? error.message : String(error);
|
|
62
|
+
this.adopt(false, null);
|
|
63
|
+
}
|
|
64
|
+
finally {
|
|
65
|
+
this.isLoading = false;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
destroy() {
|
|
69
|
+
this.unwatch?.();
|
|
70
|
+
this.unwatch = null;
|
|
71
|
+
}
|
|
72
|
+
adopt(exists, revision) {
|
|
73
|
+
this.hasCustomFile = exists;
|
|
74
|
+
this.revision = revision;
|
|
75
|
+
this.src = exists ? mediaSourceURL(this.name, revision) : null;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export const fileStore = (name, options = {}) => new FileStore(name, options);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type ImageStoreOptions = {
|
|
2
|
+
fallback: string;
|
|
3
|
+
};
|
|
4
|
+
export declare class ImageStore {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly options: ImageStoreOptions;
|
|
7
|
+
src: string;
|
|
8
|
+
hasCustomImage: boolean;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
error: string | null;
|
|
11
|
+
revision: string | null;
|
|
12
|
+
private unwatch;
|
|
13
|
+
constructor(name: string, options: ImageStoreOptions);
|
|
14
|
+
choose(): void;
|
|
15
|
+
replace(file: File): Promise<void>;
|
|
16
|
+
remove(): Promise<void>;
|
|
17
|
+
reload(): Promise<void>;
|
|
18
|
+
destroy(): void;
|
|
19
|
+
private adopt;
|
|
20
|
+
}
|
|
21
|
+
export declare const imageStore: (name: string, options: ImageStoreOptions) => ImageStore;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { slop } from "@hitslop/runtime";
|
|
2
|
+
import { chooseLocalFile, fileToBase64, mediaSourceURL, safeMediaName } from "@hitslop/runtime/adapter";
|
|
3
|
+
export class ImageStore {
|
|
4
|
+
name;
|
|
5
|
+
options;
|
|
6
|
+
src = $state("");
|
|
7
|
+
hasCustomImage = $state(false);
|
|
8
|
+
isLoading = $state(true);
|
|
9
|
+
error = $state(null);
|
|
10
|
+
revision = $state(null);
|
|
11
|
+
unwatch = null;
|
|
12
|
+
constructor(name, options) {
|
|
13
|
+
this.name = name;
|
|
14
|
+
this.options = options;
|
|
15
|
+
safeMediaName(name, "Image");
|
|
16
|
+
this.src = options.fallback;
|
|
17
|
+
void this.reload();
|
|
18
|
+
this.unwatch = slop.media.onChange(() => { void this.reload(); });
|
|
19
|
+
}
|
|
20
|
+
choose() {
|
|
21
|
+
chooseLocalFile("image/*", (file) => { void this.replace(file); });
|
|
22
|
+
}
|
|
23
|
+
async replace(file) {
|
|
24
|
+
if (!file.type.startsWith("image/")) {
|
|
25
|
+
this.error = "Choose an image file.";
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
this.isLoading = true;
|
|
29
|
+
this.error = null;
|
|
30
|
+
try {
|
|
31
|
+
const data = await fileToBase64(file, "image");
|
|
32
|
+
const result = await slop.media.write(this.name, data, file.type);
|
|
33
|
+
this.adopt(true, result.revision);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
this.error = error instanceof Error ? error.message : String(error);
|
|
37
|
+
}
|
|
38
|
+
finally {
|
|
39
|
+
this.isLoading = false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
async remove() {
|
|
43
|
+
this.isLoading = true;
|
|
44
|
+
this.error = null;
|
|
45
|
+
try {
|
|
46
|
+
await slop.media.remove(this.name);
|
|
47
|
+
this.adopt(false, null);
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
this.error = error instanceof Error ? error.message : String(error);
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
this.isLoading = false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async reload() {
|
|
57
|
+
this.isLoading = true;
|
|
58
|
+
try {
|
|
59
|
+
const result = await slop.media.open(this.name);
|
|
60
|
+
this.adopt(result.exists, result.revision);
|
|
61
|
+
this.error = null;
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
this.error = error instanceof Error ? error.message : String(error);
|
|
65
|
+
this.adopt(false, null);
|
|
66
|
+
}
|
|
67
|
+
finally {
|
|
68
|
+
this.isLoading = false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
destroy() {
|
|
72
|
+
this.unwatch?.();
|
|
73
|
+
this.unwatch = null;
|
|
74
|
+
}
|
|
75
|
+
adopt(exists, revision) {
|
|
76
|
+
this.hasCustomImage = exists;
|
|
77
|
+
this.revision = revision;
|
|
78
|
+
this.src = exists ? mediaSourceURL(this.name, revision) : this.options.fallback;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
export const imageStore = (name, options) => new ImageStore(name, options);
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { jsonStore, JsonStore, type JsonStoreOptions } from "./json-store.svelte.js";
|
|
2
|
+
export { imageStore, ImageStore, type ImageStoreOptions } from "./image-store.svelte.js";
|
|
3
|
+
export { fileStore, FileStore, type FileStoreOptions } from "./file-store.svelte.js";
|
|
4
|
+
export { sqliteQuery, SqliteQuery } from "./sqlite-query.svelte.js";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type * as z from "zod";
|
|
2
|
+
export type JsonStoreOptions<Schema extends z.ZodType> = {
|
|
3
|
+
schema: Schema;
|
|
4
|
+
initial: z.input<Schema>;
|
|
5
|
+
};
|
|
6
|
+
type JsonSchema<T> = {
|
|
7
|
+
safeParse(value: unknown): {
|
|
8
|
+
success: true;
|
|
9
|
+
data: T;
|
|
10
|
+
} | {
|
|
11
|
+
success: false;
|
|
12
|
+
error: {
|
|
13
|
+
issues: ReadonlyArray<{
|
|
14
|
+
path: PropertyKey[];
|
|
15
|
+
message: string;
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare class JsonStore<T> {
|
|
21
|
+
current: T;
|
|
22
|
+
isLoading: boolean;
|
|
23
|
+
error: string | null;
|
|
24
|
+
revision: string | null;
|
|
25
|
+
lastChangeSource: string;
|
|
26
|
+
private persister;
|
|
27
|
+
readonly schema: JsonSchema<T>;
|
|
28
|
+
private unwatch;
|
|
29
|
+
private stopEffect;
|
|
30
|
+
constructor(options: {
|
|
31
|
+
schema: JsonSchema<T>;
|
|
32
|
+
initial: unknown;
|
|
33
|
+
});
|
|
34
|
+
reload(): Promise<void>;
|
|
35
|
+
destroy(): void;
|
|
36
|
+
private parse;
|
|
37
|
+
}
|
|
38
|
+
export declare const jsonStore: <Schema extends z.ZodType>(options: JsonStoreOptions<Schema>) => JsonStore<z.output<Schema>>;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { slop } from "@hitslop/runtime";
|
|
2
|
+
import { JsonPersister } from "@hitslop/runtime/adapter";
|
|
3
|
+
import { untrack } from "svelte";
|
|
4
|
+
const snapshot = (value) => {
|
|
5
|
+
const json = JSON.stringify($state.snapshot(value));
|
|
6
|
+
if (json === undefined)
|
|
7
|
+
throw new Error("JsonStore values must be JSON-serializable");
|
|
8
|
+
return { json, value: JSON.parse(json) };
|
|
9
|
+
};
|
|
10
|
+
export class JsonStore {
|
|
11
|
+
current = $state();
|
|
12
|
+
isLoading = $state(true);
|
|
13
|
+
error = $state(null);
|
|
14
|
+
revision = $state(null);
|
|
15
|
+
lastChangeSource = $state("package");
|
|
16
|
+
persister;
|
|
17
|
+
schema;
|
|
18
|
+
unwatch = null;
|
|
19
|
+
stopEffect = null;
|
|
20
|
+
constructor(options) {
|
|
21
|
+
this.schema = options.schema;
|
|
22
|
+
const fallbackSnapshot = snapshot(this.parse(options.initial));
|
|
23
|
+
this.current = fallbackSnapshot.value;
|
|
24
|
+
this.persister = new JsonPersister({
|
|
25
|
+
fallback: fallbackSnapshot,
|
|
26
|
+
io: {
|
|
27
|
+
open: async (initial) => {
|
|
28
|
+
const result = await slop.json.open(initial);
|
|
29
|
+
return { ...result, value: this.parse(result.value) };
|
|
30
|
+
},
|
|
31
|
+
read: async () => {
|
|
32
|
+
const result = await slop.json.read();
|
|
33
|
+
return { ...result, value: this.parse(result.value) };
|
|
34
|
+
},
|
|
35
|
+
write: (value, revision) => slop.json.write(this.parse(value), revision),
|
|
36
|
+
},
|
|
37
|
+
getLocal: () => snapshot(this.parse(this.current)),
|
|
38
|
+
onAdopt: (value, source) => { this.current = value; this.lastChangeSource = source; },
|
|
39
|
+
onRevision: (revision) => { this.revision = revision; },
|
|
40
|
+
onSource: (source) => { this.lastChangeSource = source; },
|
|
41
|
+
onError: (message) => { this.error = message; },
|
|
42
|
+
});
|
|
43
|
+
// Snapshotting reads the complete proxy tree, so one effect run observes all
|
|
44
|
+
// nested mutations. This intentionally favors small, document-sized JSON.
|
|
45
|
+
// The root is not component-owned and must be released by destroy().
|
|
46
|
+
this.stopEffect = $effect.root(() => {
|
|
47
|
+
$effect(() => {
|
|
48
|
+
let local;
|
|
49
|
+
try {
|
|
50
|
+
local = snapshot(this.parse(this.current));
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
untrack(() => { this.error = error instanceof Error ? error.message : String(error); });
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
untrack(() => this.persister.localChanged(local.json, local.value));
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
void this.reload();
|
|
60
|
+
this.unwatch = slop.json.onChange((event) => this.persister.externalChanged(event.revision));
|
|
61
|
+
}
|
|
62
|
+
async reload() {
|
|
63
|
+
this.isLoading = true;
|
|
64
|
+
try {
|
|
65
|
+
await this.persister.reload();
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
this.error = error instanceof Error ? error.message : String(error);
|
|
69
|
+
}
|
|
70
|
+
finally {
|
|
71
|
+
this.isLoading = false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
destroy() {
|
|
75
|
+
this.unwatch?.();
|
|
76
|
+
this.unwatch = null;
|
|
77
|
+
this.stopEffect?.();
|
|
78
|
+
this.stopEffect = null;
|
|
79
|
+
}
|
|
80
|
+
parse(value) {
|
|
81
|
+
const result = this.schema.safeParse(value);
|
|
82
|
+
if (result.success)
|
|
83
|
+
return result.data;
|
|
84
|
+
const detail = result.error.issues.map((issue) => {
|
|
85
|
+
const path = issue.path.length ? issue.path.join(".") : "value";
|
|
86
|
+
return `${path}: ${issue.message}`;
|
|
87
|
+
}).join("; ");
|
|
88
|
+
throw new Error(`JSON schema validation failed: ${detail}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
export const jsonStore = (options) => new JsonStore(options);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type SlopStatement } from "@hitslop/runtime";
|
|
2
|
+
export declare class SqliteQuery<T> {
|
|
3
|
+
private statement;
|
|
4
|
+
current: T[];
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
error: string | null;
|
|
7
|
+
lastChangeSource: string;
|
|
8
|
+
private unwatch;
|
|
9
|
+
constructor(statement: SlopStatement);
|
|
10
|
+
execute(statement: SlopStatement): Promise<void>;
|
|
11
|
+
reload(): Promise<void>;
|
|
12
|
+
destroy(): void;
|
|
13
|
+
}
|
|
14
|
+
export declare const sqliteQuery: <T>(statement: SlopStatement) => SqliteQuery<T>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { slop } from "@hitslop/runtime";
|
|
2
|
+
export class SqliteQuery {
|
|
3
|
+
statement;
|
|
4
|
+
current = $state([]);
|
|
5
|
+
isLoading = $state(true);
|
|
6
|
+
error = $state(null);
|
|
7
|
+
lastChangeSource = $state("package");
|
|
8
|
+
unwatch = null;
|
|
9
|
+
constructor(statement) {
|
|
10
|
+
this.statement = statement;
|
|
11
|
+
void this.reload();
|
|
12
|
+
this.unwatch = slop.db.onChange((event) => { this.lastChangeSource = event.source; void this.reload(); });
|
|
13
|
+
}
|
|
14
|
+
async execute(statement) { await slop.db.execute(statement.sql, statement.parameters ?? []); }
|
|
15
|
+
async reload() { this.isLoading = true; try {
|
|
16
|
+
this.current = await slop.db.query(this.statement.sql, this.statement.parameters ?? []);
|
|
17
|
+
this.error = null;
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
this.error = error instanceof Error ? error.message : String(error);
|
|
21
|
+
}
|
|
22
|
+
finally {
|
|
23
|
+
this.isLoading = false;
|
|
24
|
+
} }
|
|
25
|
+
destroy() { this.unwatch?.(); this.unwatch = null; }
|
|
26
|
+
}
|
|
27
|
+
export const sqliteQuery = (statement) => new SqliteQuery(statement);
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hitslop/svelte",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Svelte 5 state adapters for the hitSlop runtime.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/hitslop/hitslop.git",
|
|
9
|
+
"directory": "packages/svelte"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://hitslop.app",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/hitslop/hitslop/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": ["hitslop", "svelte", "local-first", "mini-apps"],
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"type": "module",
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"exports": {
|
|
24
|
+
".": "./dist/index.js"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "bun ../../scripts/clean-dist.ts && tsc -p tsconfig.build.json",
|
|
28
|
+
"check": "svelte-check --tsgo --tsconfig ./tsconfig.json",
|
|
29
|
+
"test": "bun run --cwd ../runtime build && bun test"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@hitslop/runtime": "0.1.0"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"svelte": "^5.0.0",
|
|
36
|
+
"zod": "^4.0.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"svelte": "^5.57.0",
|
|
40
|
+
"svelte-check": "^4.7.6",
|
|
41
|
+
"@typescript/native": "npm:typescript@^7.0.2",
|
|
42
|
+
"typescript": "^6.0.3",
|
|
43
|
+
"zod": "^4.5.2"
|
|
44
|
+
}
|
|
45
|
+
}
|