@verbaly/svelte 0.77.0 → 0.79.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/README.md +3 -3
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ pnpm add @verbaly/svelte
|
|
|
25
25
|
<!-- +layout.svelte -->
|
|
26
26
|
<script>
|
|
27
27
|
import { provideVerbaly } from '@verbaly/svelte';
|
|
28
|
-
import { verbaly } from '
|
|
28
|
+
import { verbaly } from 'verbaly/app';
|
|
29
29
|
|
|
30
30
|
provideVerbaly(verbaly);
|
|
31
31
|
</script>
|
|
@@ -48,9 +48,9 @@ pnpm add @verbaly/svelte
|
|
|
48
48
|
</select>
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
**`provideVerbaly` is optional in the browser.** With none above it, a hook reads the instance `
|
|
51
|
+
**`provideVerbaly` is optional in the browser.** With none above it, a hook reads the instance `verbaly/app` creates, so a single-page app can skip it and a component test renders with no wrapper. On a server it is required, since every request has its own instance.
|
|
52
52
|
|
|
53
|
-
**Keys are typed.** `$t` from `useT()` checks every key and its params against your source catalog, through the types Verbaly generates (`src/verbaly.d.ts`): a key no catalog has does not compile. A key that comes from data, like `$t(item.key)` or a variable typed as a union of keys, passes as it is, and its params are left open; declare it with `defineKeys` from `
|
|
53
|
+
**Keys are typed.** `$t` from `useT()` checks every key and its params against your source catalog, through the types Verbaly generates (`src/verbaly.d.ts`): a key no catalog has does not compile. A key that comes from data, like `$t(item.key)` or a variable typed as a union of keys, passes as it is, and its params are left open; declare it with `defineKeys` from `verbaly/app` when you want `check` to verify it exists.
|
|
54
54
|
|
|
55
55
|
Or skip the keys entirely: write the source text in place and the compiler extracts it, right in your `.svelte` files (script and markup):
|
|
56
56
|
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ function appInstance() {
|
|
|
12
12
|
}
|
|
13
13
|
function useVerbaly() {
|
|
14
14
|
const instance = getContext(KEY) ?? appInstance();
|
|
15
|
-
if (!instance) throw new Error("[verbaly] useVerbaly requires provideVerbaly(...) in a parent: on a server, or before
|
|
15
|
+
if (!instance) throw new Error("[verbaly] useVerbaly requires provideVerbaly(...) in a parent: on a server, or before verbaly/app loads");
|
|
16
16
|
return instance;
|
|
17
17
|
}
|
|
18
18
|
function tStore(instance) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verbaly/svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.79.0",
|
|
4
4
|
"description": "Svelte bindings for Verbaly: stores over the reactive core.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"i18n",
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"svelte": "^5.0.0",
|
|
52
|
-
"verbaly": "^0.
|
|
52
|
+
"verbaly": "^0.79.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@sveltejs/vite-plugin-svelte": "^7.3.1",
|
|
56
56
|
"happy-dom": "^21.0.4",
|
|
57
57
|
"svelte": "^5.57.3",
|
|
58
|
-
"verbaly": "^0.
|
|
58
|
+
"verbaly": "^0.79.0"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "tsdown && node scripts/copy-svelte.mjs",
|