@critical-path/svelte 0.1.0 → 0.1.2

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.
Files changed (2) hide show
  1. package/README.md +51 -0
  2. package/package.json +3 -3
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # @critical-path/svelte
2
+
3
+ > **Svelte Stores & Reactive Helpers for Critical Path.**
4
+
5
+ `@critical-path/svelte` provides store factories for building project management UIs in Svelte and SvelteKit applications.
6
+
7
+ ---
8
+
9
+ ## 📦 Installation
10
+
11
+ ```bash
12
+ npm install @critical-path/svelte
13
+ # or
14
+ pnpm add @critical-path/svelte
15
+ ```
16
+
17
+ ---
18
+
19
+ ## 💡 Usage Example
20
+
21
+ ```svelte
22
+ <script lang="ts">
23
+ import { onMount } from 'svelte';
24
+ import { createCriticalPathClient, createProjectStore, createTaskStore } from '@critical-path/svelte';
25
+
26
+ const client = createCriticalPathClient({ baseUrl: '/api/critical-path' });
27
+ const projectStore = createProjectStore(client);
28
+ const taskStore = createTaskStore(client, 'proj_1');
29
+
30
+ onMount(() => {
31
+ projectStore.fetch();
32
+ taskStore.fetch();
33
+ });
34
+ </script>
35
+
36
+ {#if $taskStore.loading}
37
+ <p>Loading tasks...</p>
38
+ {:else}
39
+ <ul>
40
+ {#each $taskStore.data as task}
41
+ <li><strong>{task.title}</strong> - {task.status}</li>
42
+ {/each}
43
+ </ul>
44
+ {/if}
45
+ ```
46
+
47
+ ---
48
+
49
+ ## 📄 License
50
+
51
+ MIT © [Critical Path](https://github.com/Pixerate/Critical-Path)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@critical-path/svelte",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Svelte stores and reactive integrations for Critical Path headless project management framework",
5
5
  "author": "Jack James",
6
6
  "license": "MIT",
@@ -14,8 +14,8 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@critical-path/client": "0.1.0",
18
- "@critical-path/core": "0.1.0"
17
+ "@critical-path/core": "0.1.2",
18
+ "@critical-path/client": "0.1.2"
19
19
  },
20
20
  "peerDependencies": {
21
21
  "svelte": "^4.0.0 || ^5.0.0"