@noy-db/in-pinia 0.7.0-pre.9 → 0.7.1-pre.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.
Files changed (2) hide show
  1. package/README.md +15 -4
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @noy-db/in-pinia
2
2
 
3
+ <!-- prose-preamble
4
+ // Bindings the illustrative blocks below elide. Typed on purpose (#1310).
5
+ import { defineNoydbStore } from '@noy-db/in-pinia'
6
+ import { z } from 'zod'
7
+ const InvoiceSchema = z.object({ id: z.string(), status: z.string(), dueDate: z.date() })
8
+ declare const invoices: ReturnType<ReturnType<typeof defineNoydbStore<z.infer<typeof InvoiceSchema>>>>
9
+ -->
10
+
3
11
  > Pinia integration for [noy-db](https://github.com/vLannaAi/noy-db) — drop-in encrypted Pinia stores for Vue 3 / Nuxt 4.
4
12
 
5
13
  ```bash
@@ -24,7 +32,7 @@ interface Invoice {
24
32
  }
25
33
 
26
34
  export const useInvoices = defineNoydbStore<Invoice>('invoices', {
27
- compartment: 'C101',
35
+ vault: 'C101',
28
36
  });
29
37
  ```
30
38
 
@@ -37,10 +45,13 @@ import { toFile } from '@noy-db/to-file';
37
45
  import { setActiveNoydb } from '@noy-db/in-pinia';
38
46
  import App from './App.vue';
39
47
 
48
+ // `createNoydb` takes the resolved secret string. (The `secret: () => …`
49
+ // thunk form belongs to `createNoydbPiniaPlugin`, which resolves it for you
50
+ // — use that path when the secret comes from a prompt at plugin-install time.)
40
51
  const db = await createNoydb({
41
- adapter: toFile({ dir: './data' }),
52
+ store: toFile({ dir: './data' }),
42
53
  user: 'owner',
43
- secret: () => prompt('Secret')!,
54
+ secret: prompt('Secret')!,
44
55
  });
45
56
 
46
57
  setActiveNoydb(db);
@@ -115,7 +126,7 @@ const InvoiceSchema = z.object({
115
126
  });
116
127
 
117
128
  export const useInvoices = defineNoydbStore<z.infer<typeof InvoiceSchema>>('invoices', {
118
- compartment: 'C101',
129
+ vault: 'C101',
119
130
  schema: InvoiceSchema,
120
131
  });
121
132
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noy-db/in-pinia",
3
- "version": "0.7.0-pre.9",
3
+ "version": "0.7.1-pre.0",
4
4
  "description": "Pinia integration for noy-db — defineNoydbStore() and the augmentation plugin for existing stores",
5
5
  "license": "MIT",
6
6
  "author": "vLannaAi <vicio@lanna.ai>",
@@ -34,16 +34,16 @@
34
34
  "peerDependencies": {
35
35
  "pinia": "^2.1.0 || ^3.0.0",
36
36
  "vue": "^3.4.0",
37
- "@noy-db/hub": "^0.7.0-pre.9",
38
- "@noy-db/in-vue": "0.7.0-pre.9"
37
+ "@noy-db/hub": "^0.7.1-pre.0",
38
+ "@noy-db/in-vue": "^0.7.1-pre.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@vue/test-utils": "^2.4.6",
42
- "happy-dom": "^15.11.7",
42
+ "happy-dom": "^18.0.0",
43
43
  "pinia": "^3.0.1",
44
44
  "vue": "^3.5.32",
45
- "@noy-db/hub": "0.7.0-pre.9",
46
- "@noy-db/in-vue": "0.7.0-pre.9"
45
+ "@noy-db/in-vue": "0.7.1-pre.0",
46
+ "@noy-db/hub": "0.7.1-pre.0"
47
47
  },
48
48
  "keywords": [
49
49
  "noy-db",