@koderlabs/tasks-sdk-vue 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 +85 -5
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,9 +1,89 @@
1
- # Proprietary Software
1
+ # @koderlabs/tasks-sdk-vue
2
2
 
3
- KoderLabs proprietary. All rights reserved.
3
+ > Runtime: browser DOM with Vue **3** only. Vue 2 is not supported.
4
4
 
5
- See the bundled `LICENSE` for terms. No grant of any rights, express or
6
- implied, is conferred by access to or possession of this package. A
7
- separate signed written licence from KoderLabs is required for any use.
5
+ Vue 3 plugin for the InstantTasks SDK. Initialises the core client at `app.use(...)` and wires `app.config.errorHandler` so unhandled Vue render errors are reported. Provides the client to the entire component tree via Vue's `provide` / `inject`.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @koderlabs/tasks-sdk @koderlabs/tasks-sdk-vue
11
+ # plus integrations as needed:
12
+ npm install @koderlabs/tasks-sdk-web-errors @koderlabs/tasks-sdk-web-network @koderlabs/tasks-sdk-web-reporter
13
+ ```
14
+
15
+ Using pnpm or yarn:
16
+
17
+ ```bash
18
+ pnpm add @koderlabs/tasks-sdk @koderlabs/tasks-sdk-vue
19
+ # or
20
+ yarn add @koderlabs/tasks-sdk @koderlabs/tasks-sdk-vue
21
+ ```
22
+
23
+ Peer: `vue: ^3`.
24
+
25
+ ## Usage
26
+
27
+ ```ts
28
+ // main.ts
29
+ import { createApp } from 'vue';
30
+ import App from './App.vue';
31
+ import { createInstantTasksPlugin } from '@koderlabs/tasks-sdk-vue';
32
+ import { errorsIntegration } from '@koderlabs/tasks-sdk-web-errors';
33
+ import { reporterIntegration } from '@koderlabs/tasks-sdk-web-reporter';
34
+
35
+ createApp(App)
36
+ .use(
37
+ createInstantTasksPlugin({
38
+ projectId: 'FE',
39
+ accessKey: import.meta.env.VITE_IT_ACCESS_KEY,
40
+ integrations: [errorsIntegration(), reporterIntegration()],
41
+ }),
42
+ )
43
+ .mount('#app');
44
+ ```
45
+
46
+ Inside any component (Composition API):
47
+
48
+ ```ts
49
+ import { injectInstantTasks } from '@koderlabs/tasks-sdk-vue';
50
+
51
+ const client = injectInstantTasks();
52
+ (client as any).errors?.notify(new Error('oops'));
53
+ (client as any).reporter?.show();
54
+ ```
55
+
56
+ ## API
57
+
58
+ | Export | Purpose |
59
+ |---|---|
60
+ | `createInstantTasksPlugin(opts: InitOptions)` | Factory returning a Vue 3 Plugin. Pass `app.use(...)`. |
61
+ | `injectInstantTasks(): Client` | Composition-API helper. Throws if called outside `setup()` or when the plugin is not installed. |
62
+ | `installInstantTasks(app, opts)` | Lower-level installer that returns `{ client, uninstall }`. Used by the plugin internally; call directly if you need an explicit teardown handle (Vite HMR / tests). |
63
+ | `INSTANTTASKS_KEY` | Vue injection key (rarely needed). |
64
+
65
+ ## Error-handler chain
66
+
67
+ `installInstantTasks` wraps any pre-existing `app.config.errorHandler` so the **host's handler runs first**, then the SDK observes/reports. This matches the framework-first convention used by Pinia, Vue Router, and vue-i18n.
68
+
69
+ On `uninstall()`, the original handler is restored — calling install/uninstall repeatedly does not stack wrappers.
70
+
71
+ ## Caveats
72
+
73
+ - Vue 2 is **not** supported. Peer dependency pins `vue: ^3`.
74
+ - `app.use(plugin)` is idempotent in Vue but `init()` itself is also idempotent — a re-mount tears down the prior client cleanly.
75
+ - `injectInstantTasks()` throws when called outside `setup()` (e.g. at module top-level) or when the plugin wasn't installed on the active app. Catch in tests if you need to.
76
+ - Vue has no first-class "App unmount" event; if you need clean teardown (Vite HMR, tests), use `installInstantTasks(app, opts)` and call the returned `uninstall()` yourself.
77
+ - The plugin only catches errors that go through `app.config.errorHandler` — unhandled promise rejections and global `window.onerror` need `@koderlabs/tasks-sdk-web-errors`.
78
+
79
+ ---
80
+
81
+ ## Suite overview
82
+
83
+ Full SDK suite map + platform availability matrix: [docs/sdk/overview.md](https://github.com/jawaidgadiwala/instant-tasks/blob/main/docs/sdk/overview.md).
84
+
85
+ ## License
86
+
87
+ KoderLabs proprietary. See [`LICENSE`](./LICENSE) for terms. Use of this package requires a separate signed written agreement with KoderLabs; access alone confers no rights.
8
88
 
9
89
  Licensing inquiries: jawaidgadiwala@gmail.com
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koderlabs/tasks-sdk-vue",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Vue 3 plugin for the InstantTasks SDK.",
5
5
  "keywords": [
6
6
  "instanttasks",
@@ -39,7 +39,7 @@
39
39
  ],
40
40
  "sideEffects": false,
41
41
  "dependencies": {
42
- "@koderlabs/tasks-sdk": "0.1.0"
42
+ "@koderlabs/tasks-sdk": "0.1.2"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "vue": "^3"
@@ -56,7 +56,7 @@
56
56
  "node": ">=20"
57
57
  },
58
58
  "publishConfig": {
59
- "access": "restricted"
59
+ "access": "public"
60
60
  },
61
61
  "scripts": {
62
62
  "build": "tsup",