@verbaly/vue 0.76.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 +2 -3
- package/dist/index.d.cts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +2 -3
- package/package.json +7 -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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let vue = require("vue");
|
|
3
3
|
let verbaly = require("verbaly");
|
|
4
|
-
|
|
4
|
+
// src/index.ts
|
|
5
5
|
const KEY = Symbol("verbaly");
|
|
6
6
|
function verbalyPlugin(instance) {
|
|
7
7
|
return { install(app) {
|
|
@@ -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() {
|
|
@@ -100,7 +100,6 @@ function toNodes(nodes, components, links, richTags) {
|
|
|
100
100
|
return children;
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
|
-
//#endregion
|
|
104
103
|
exports.Trans = Trans;
|
|
105
104
|
exports.useLocale = useLocale;
|
|
106
105
|
exports.useT = useT;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { App, PropType, VNodeChild, WritableComputedRef } from "vue";
|
|
2
2
|
import { DictionaryInput, Params, RichLink, TFunction, Verbaly } from "verbaly";
|
|
3
|
-
//#region src/index.d.ts
|
|
4
3
|
export interface VerbalyPlugin {
|
|
5
4
|
install(app: App): void;
|
|
6
5
|
}
|
|
@@ -68,5 +67,4 @@ export declare const Trans: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
68
67
|
richTags: string[];
|
|
69
68
|
links: Record<string, RichLink>;
|
|
70
69
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
71
|
-
//#endregion
|
|
72
70
|
export type { Params, TFunction, Verbaly };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { App, PropType, VNodeChild, WritableComputedRef } from "vue";
|
|
2
2
|
import { DictionaryInput, Params, RichLink, TFunction, Verbaly } from "verbaly";
|
|
3
|
-
//#region src/index.d.ts
|
|
4
3
|
export interface VerbalyPlugin {
|
|
5
4
|
install(app: App): void;
|
|
6
5
|
}
|
|
@@ -68,5 +67,4 @@ export declare const Trans: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
68
67
|
richTags: string[];
|
|
69
68
|
links: Record<string, RichLink>;
|
|
70
69
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
71
|
-
//#endregion
|
|
72
70
|
export type { Params, TFunction, Verbaly };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, computed, defineComponent, h, inject, onScopeDispose, shallowRef } from "vue";
|
|
2
2
|
import { RICH_TAGS, VOID_TAGS, normalizeLink, parseTags } from "verbaly";
|
|
3
|
-
|
|
3
|
+
// src/index.ts
|
|
4
4
|
const KEY = Symbol("verbaly");
|
|
5
5
|
function verbalyPlugin(instance) {
|
|
6
6
|
return { install(app) {
|
|
@@ -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() {
|
|
@@ -99,5 +99,4 @@ function toNodes(nodes, components, links, richTags) {
|
|
|
99
99
|
return children;
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
-
//#endregion
|
|
103
102
|
export { Trans, useLocale, useT, useVerbaly, verbalyPlugin };
|
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",
|
|
@@ -19,6 +19,10 @@
|
|
|
19
19
|
"bugs": {
|
|
20
20
|
"url": "https://github.com/AronSoto/verbaly/issues"
|
|
21
21
|
},
|
|
22
|
+
"funding": {
|
|
23
|
+
"type": "github",
|
|
24
|
+
"url": "https://github.com/sponsors/AronSoto"
|
|
25
|
+
},
|
|
22
26
|
"type": "module",
|
|
23
27
|
"main": "./dist/index.cjs",
|
|
24
28
|
"module": "./dist/index.js",
|
|
@@ -47,12 +51,12 @@
|
|
|
47
51
|
"access": "public"
|
|
48
52
|
},
|
|
49
53
|
"peerDependencies": {
|
|
50
|
-
"verbaly": "^0.
|
|
54
|
+
"verbaly": "^0.78.0",
|
|
51
55
|
"vue": "^3.4.0"
|
|
52
56
|
},
|
|
53
57
|
"devDependencies": {
|
|
54
58
|
"happy-dom": "^21.0.4",
|
|
55
|
-
"verbaly": "^0.
|
|
59
|
+
"verbaly": "^0.78.0",
|
|
56
60
|
"vue": "^3.5.44"
|
|
57
61
|
},
|
|
58
62
|
"scripts": {
|