@verbaly/vue 0.77.0 → 0.78.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.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ pnpm add verbaly @verbaly/vue
|
|
|
22
22
|
```ts
|
|
23
23
|
// main.ts
|
|
24
24
|
import { verbalyPlugin } from '@verbaly/vue';
|
|
25
|
-
import { verbaly } from '
|
|
25
|
+
import { verbaly } from 'verbaly/app';
|
|
26
26
|
|
|
27
27
|
app.use(verbalyPlugin(verbaly));
|
|
28
28
|
```
|
|
@@ -39,9 +39,9 @@ app.use(verbalyPlugin(verbaly));
|
|
|
39
39
|
</template>
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
**The plugin is optional in the browser.** With none above it, a hook reads the instance `
|
|
42
|
+
**The plugin 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.
|
|
43
43
|
|
|
44
|
-
**Keys are typed.** `useT()` checks every key and its params against your source catalog, through the types Verbaly generates (`src/verbaly.d.ts` in a Vite app, `.nuxt/verbaly.d.ts` in Nuxt): 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 `
|
|
44
|
+
**Keys are typed.** `useT()` checks every key and its params against your source catalog, through the types Verbaly generates (`src/verbaly.d.ts` in a Vite app, `.nuxt/verbaly.d.ts` in Nuxt): 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.
|
|
45
45
|
|
|
46
46
|
Or skip the keys entirely: write the source text in place and the compiler extracts it, right in your `.vue` files (script and template):
|
|
47
47
|
|
package/dist/index.cjs
CHANGED
|
@@ -15,7 +15,7 @@ function appInstance() {
|
|
|
15
15
|
}
|
|
16
16
|
function useVerbaly() {
|
|
17
17
|
const instance = (0, vue.inject)(KEY, null) ?? appInstance();
|
|
18
|
-
if (!instance) throw new Error("[verbaly] useVerbaly requires app.use(verbalyPlugin(...)): on a server, or before
|
|
18
|
+
if (!instance) throw new Error("[verbaly] useVerbaly requires app.use(verbalyPlugin(...)): on a server, or before verbaly/app loads");
|
|
19
19
|
return instance;
|
|
20
20
|
}
|
|
21
21
|
function useT() {
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ function appInstance() {
|
|
|
14
14
|
}
|
|
15
15
|
function useVerbaly() {
|
|
16
16
|
const instance = inject(KEY, null) ?? appInstance();
|
|
17
|
-
if (!instance) throw new Error("[verbaly] useVerbaly requires app.use(verbalyPlugin(...)): on a server, or before
|
|
17
|
+
if (!instance) throw new Error("[verbaly] useVerbaly requires app.use(verbalyPlugin(...)): on a server, or before verbaly/app loads");
|
|
18
18
|
return instance;
|
|
19
19
|
}
|
|
20
20
|
function useT() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verbaly/vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.78.0",
|
|
4
4
|
"description": "Vue 3 bindings for Verbaly: composables over the reactive core.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"i18n",
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"verbaly": "^0.
|
|
54
|
+
"verbaly": "^0.78.0",
|
|
55
55
|
"vue": "^3.4.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"happy-dom": "^21.0.4",
|
|
59
|
-
"verbaly": "^0.
|
|
59
|
+
"verbaly": "^0.78.0",
|
|
60
60
|
"vue": "^3.5.44"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|