@mearie/svelte 0.0.0 → 0.0.1-next.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 ADDED
@@ -0,0 +1,49 @@
1
+ # @mearie/svelte
2
+
3
+ Svelte bindings for Mearie GraphQL client.
4
+
5
+ This package provides Svelte stores and utilities for using Mearie in Svelte
6
+ applications.
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npm install mearie @mearie/svelte
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ ```svelte
17
+ <script lang="ts">
18
+ import { createClient, httpLink, cacheLink, graphql } from 'mearie';
19
+ import { createQuery } from '@mearie/svelte';
20
+
21
+ interface Props {
22
+ userId: string;
23
+ }
24
+
25
+ let { userId }: Props = $props();
26
+
27
+ const query = createQuery(
28
+ graphql(`
29
+ query GetUser($id: ID!) {
30
+ user(id: $id) {
31
+ id
32
+ name
33
+ }
34
+ }
35
+ `),
36
+ () => ({ id: userId }),
37
+ );
38
+ </script>
39
+
40
+ {#if query.loading}
41
+ <div>Loading...</div>
42
+ {:else}
43
+ <h1>{query.data.user.name}</h1>
44
+ {/if}
45
+ ```
46
+
47
+ ## Documentation
48
+
49
+ Full documentation is available at <https://mearie.dev/frameworks/svelte>.
package/package.json CHANGED
@@ -1,19 +1,20 @@
1
1
  {
2
2
  "name": "@mearie/svelte",
3
- "version": "0.0.0",
4
- "description": "Svelte integration for Mearie",
5
- "license": "MIT",
3
+ "version": "0.0.1-next.1",
4
+ "sideEffects": false,
6
5
  "type": "module",
7
- "main": "./src/index.svelte.ts",
6
+ "main": "./dist/index.svelte.cjs",
8
7
  "files": [
9
- "dist"
8
+ "dist",
9
+ "package.json",
10
+ "README.md"
10
11
  ],
11
12
  "dependencies": {
12
- "@mearie/client": "0.0.0"
13
+ "@mearie/client": "0.0.1-next.1"
13
14
  },
14
15
  "devDependencies": {
15
- "svelte": "^5.0.0",
16
- "tsdown": "^0.15.7"
16
+ "svelte": "^5.41.0",
17
+ "tsdown": "^0.15.8"
17
18
  },
18
19
  "peerDependencies": {
19
20
  "svelte": "^5.0.0"
@@ -30,6 +31,9 @@
30
31
  "types": "./dist/index.svelte.d.ts",
31
32
  "import": "./dist/index.svelte.js",
32
33
  "require": "./dist/index.svelte.cjs"
33
- }
34
- }
34
+ },
35
+ "./package.json": "./package.json"
36
+ },
37
+ "module": "./dist/index.svelte.js",
38
+ "types": "./dist/index.svelte.d.ts"
35
39
  }
@@ -1,9 +0,0 @@
1
- export { setClient, getClient } from './client-context.svelte.ts';
2
- export { createQuery, type CreateQueryReturn } from './create-query.svelte.ts';
3
- export {
4
- createSubscription,
5
- type CreateSubscriptionReturn,
6
- type CreateSubscriptionOptions,
7
- } from './create-subscription.svelte.ts';
8
- export { createMutation, type CreateMutationReturn } from './create-mutation.svelte.ts';
9
- export { createFragment, type CreateFragmentReturn } from './create-fragment.svelte.ts';