@verbaly/vue 0.11.0 → 0.13.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 +1 -1
- package/dist/index.cjs +83 -105
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +47 -48
- package/dist/index.d.ts +47 -48
- package/dist/index.js +78 -87
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://raw.githubusercontent.com/AronSoto/verbaly/develop/assets/logo
|
|
2
|
+
<img src="https://raw.githubusercontent.com/AronSoto/verbaly/develop/assets/logo.png" alt="Verbaly" width="300" />
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<p align="center"><em>Vue 3 bindings for Verbaly — composables over the reactive core.</em></p>
|
package/dist/index.cjs
CHANGED
|
@@ -1,119 +1,97 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var index_exports = {};
|
|
22
|
-
__export(index_exports, {
|
|
23
|
-
Trans: () => Trans,
|
|
24
|
-
useLocale: () => useLocale,
|
|
25
|
-
useT: () => useT,
|
|
26
|
-
useVerbaly: () => useVerbaly,
|
|
27
|
-
verbalyPlugin: () => verbalyPlugin
|
|
28
|
-
});
|
|
29
|
-
module.exports = __toCommonJS(index_exports);
|
|
30
|
-
var import_vue = require("vue");
|
|
31
|
-
var import_verbaly = require("verbaly");
|
|
32
|
-
var KEY = /* @__PURE__ */ Symbol("verbaly");
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let vue = require("vue");
|
|
3
|
+
let verbaly = require("verbaly");
|
|
4
|
+
//#region src/index.ts
|
|
5
|
+
const KEY = Symbol("verbaly");
|
|
33
6
|
function verbalyPlugin(instance) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
};
|
|
7
|
+
return { install(app) {
|
|
8
|
+
app.provide(KEY, instance);
|
|
9
|
+
} };
|
|
39
10
|
}
|
|
40
11
|
function useVerbaly() {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
return instance;
|
|
12
|
+
const instance = (0, vue.inject)(KEY, null);
|
|
13
|
+
if (!instance) throw new Error("[verbaly] useVerbaly requires app.use(verbalyPlugin(...))");
|
|
14
|
+
return instance;
|
|
46
15
|
}
|
|
47
16
|
function useT() {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
17
|
+
const instance = useVerbaly();
|
|
18
|
+
const version = trackVersion(instance);
|
|
19
|
+
const t = (first, ...rest) => {
|
|
20
|
+
version.value;
|
|
21
|
+
return instance.t(first, ...rest);
|
|
22
|
+
};
|
|
23
|
+
return t;
|
|
55
24
|
}
|
|
56
25
|
function useLocale() {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
26
|
+
const instance = useVerbaly();
|
|
27
|
+
const version = trackVersion(instance);
|
|
28
|
+
return (0, vue.computed)({
|
|
29
|
+
get: () => {
|
|
30
|
+
version.value;
|
|
31
|
+
return instance.locale;
|
|
32
|
+
},
|
|
33
|
+
set: (locale) => instance.setLocale(locale)
|
|
34
|
+
});
|
|
66
35
|
}
|
|
67
36
|
function trackVersion(instance) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
);
|
|
74
|
-
return version;
|
|
37
|
+
const version = (0, vue.shallowRef)(instance.version);
|
|
38
|
+
(0, vue.onScopeDispose)(instance.subscribe(() => {
|
|
39
|
+
version.value = instance.version;
|
|
40
|
+
}));
|
|
41
|
+
return version;
|
|
75
42
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
43
|
+
const Trans = (0, vue.defineComponent)({
|
|
44
|
+
name: "Trans",
|
|
45
|
+
props: {
|
|
46
|
+
id: {
|
|
47
|
+
type: String,
|
|
48
|
+
required: true
|
|
49
|
+
},
|
|
50
|
+
values: {
|
|
51
|
+
type: Object,
|
|
52
|
+
default: void 0
|
|
53
|
+
},
|
|
54
|
+
components: {
|
|
55
|
+
type: Object,
|
|
56
|
+
default: () => ({})
|
|
57
|
+
},
|
|
58
|
+
links: {
|
|
59
|
+
type: Object,
|
|
60
|
+
default: () => ({})
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
setup(props) {
|
|
64
|
+
const instance = useVerbaly();
|
|
65
|
+
const version = trackVersion(instance);
|
|
66
|
+
return () => {
|
|
67
|
+
version.value;
|
|
68
|
+
return (0, vue.h)(vue.Fragment, toNodes((0, verbaly.parseTags)(instance.t(props.id, props.values)), props.components, props.links));
|
|
69
|
+
};
|
|
70
|
+
}
|
|
96
71
|
});
|
|
97
72
|
function toNodes(nodes, components, links) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
73
|
+
return nodes.map((node) => {
|
|
74
|
+
if (typeof node === "string") return node;
|
|
75
|
+
const children = toNodes(node.children, components, links);
|
|
76
|
+
const fn = components[node.name];
|
|
77
|
+
if (fn) return fn(children);
|
|
78
|
+
const link = links[node.name];
|
|
79
|
+
if (link !== void 0) {
|
|
80
|
+
const def = typeof link === "string" ? { href: link } : link;
|
|
81
|
+
return (0, vue.h)("a", {
|
|
82
|
+
href: (0, verbaly.safeHref)(def.href),
|
|
83
|
+
target: def.target,
|
|
84
|
+
rel: def.rel
|
|
85
|
+
}, children);
|
|
86
|
+
}
|
|
87
|
+
return children;
|
|
88
|
+
});
|
|
110
89
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
});
|
|
90
|
+
//#endregion
|
|
91
|
+
exports.Trans = Trans;
|
|
92
|
+
exports.useLocale = useLocale;
|
|
93
|
+
exports.useT = useT;
|
|
94
|
+
exports.useVerbaly = useVerbaly;
|
|
95
|
+
exports.verbalyPlugin = verbalyPlugin;
|
|
96
|
+
|
|
119
97
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {\n computed,\n defineComponent,\n Fragment,\n h,\n inject,\n onScopeDispose,\n shallowRef,\n type App,\n type InjectionKey,\n type PropType,\n type ShallowRef,\n type VNodeChild,\n type WritableComputedRef,\n} from 'vue';\nimport {\n parseTags,\n safeHref,\n type DictionaryInput,\n type Params,\n type RichLink,\n type TagNode,\n type TFunction,\n type Verbaly,\n} from 'verbaly';\n\nconst KEY: InjectionKey<Verbaly> = Symbol('verbaly');\n\nexport interface VerbalyPlugin {\n install(app: App): void;\n}\n\nexport function verbalyPlugin<D extends DictionaryInput>(instance: Verbaly<D>): VerbalyPlugin {\n return {\n install(app) {\n app.provide(KEY, instance as unknown as Verbaly);\n },\n };\n}\n\nexport function useVerbaly<D extends DictionaryInput = DictionaryInput>(): Verbaly<D> {\n const instance = inject(KEY, null);\n if (!instance) {\n throw new Error('[verbaly] useVerbaly requires app.use(verbalyPlugin(...))');\n }\n return instance as unknown as Verbaly<D>;\n}\n\nexport function useT<D extends DictionaryInput = DictionaryInput>(): TFunction<D> {\n const instance = useVerbaly<D>();\n const version = trackVersion(instance);\n const t = (first: unknown, ...rest: unknown[]): string => {\n void version.value;\n return (instance.t as unknown as (...args: unknown[]) => string)(first, ...rest);\n };\n return t as TFunction<D>;\n}\n\nexport function useLocale(): WritableComputedRef<string> {\n const instance = useVerbaly();\n const version = trackVersion(instance);\n return computed({\n get: () => {\n void version.value;\n return instance.locale;\n },\n set: (locale: string) => instance.setLocale(locale),\n });\n}\n\nfunction trackVersion<D extends DictionaryInput>(instance: Verbaly<D>): ShallowRef<number> {\n const version = shallowRef(instance.version);\n onScopeDispose(\n instance.subscribe(() => {\n version.value = instance.version;\n }),\n );\n return version;\n}\n\nexport type TransComponents = Record<string, (children: VNodeChild[]) => VNodeChild>;\n\n// translated message + element interpolation\nexport const Trans = defineComponent({\n name: 'Trans',\n props: {\n id: { type: String, required: true },\n values: { type: Object as PropType<Params>, default: undefined },\n components: { type: Object as PropType<TransComponents>, default: () => ({}) },\n links: { type: Object as PropType<Record<string, RichLink>>, default: () => ({}) },\n },\n setup(props) {\n const instance = useVerbaly();\n const version = trackVersion(instance);\n return () => {\n void version.value;\n const text = (instance.t as unknown as (id: string, values?: Params) => string)(\n props.id,\n props.values,\n );\n return h(Fragment, toNodes(parseTags(text), props.components, props.links));\n };\n },\n});\n\nfunction toNodes(\n nodes: TagNode[],\n components: TransComponents,\n links: Record<string, RichLink>,\n): VNodeChild[] {\n return nodes.map((node) => {\n if (typeof node === 'string') return node;\n const children = toNodes(node.children, components, links);\n const fn = components[node.name];\n if (fn) return fn(children);\n const link = links[node.name];\n if (link !== undefined) {\n const def: Exclude<RichLink, string> = typeof link === 'string' ? { href: link } : link;\n return h('a', { href: safeHref(def.href), target: def.target, rel: def.rel }, children);\n }\n return children;\n });\n}\n\nexport type { Params, TFunction, Verbaly };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["Fragment"],"sources":["../src/index.ts"],"sourcesContent":["import {\n computed,\n defineComponent,\n Fragment,\n h,\n inject,\n onScopeDispose,\n shallowRef,\n type App,\n type InjectionKey,\n type PropType,\n type ShallowRef,\n type VNodeChild,\n type WritableComputedRef,\n} from 'vue';\nimport {\n parseTags,\n safeHref,\n type DictionaryInput,\n type Params,\n type RichLink,\n type TagNode,\n type TFunction,\n type Verbaly,\n} from 'verbaly';\n\nconst KEY: InjectionKey<Verbaly> = Symbol('verbaly');\n\nexport interface VerbalyPlugin {\n install(app: App): void;\n}\n\nexport function verbalyPlugin<D extends DictionaryInput>(instance: Verbaly<D>): VerbalyPlugin {\n return {\n install(app) {\n app.provide(KEY, instance as unknown as Verbaly);\n },\n };\n}\n\nexport function useVerbaly<D extends DictionaryInput = DictionaryInput>(): Verbaly<D> {\n const instance = inject(KEY, null);\n if (!instance) {\n throw new Error('[verbaly] useVerbaly requires app.use(verbalyPlugin(...))');\n }\n return instance as unknown as Verbaly<D>;\n}\n\nexport function useT<D extends DictionaryInput = DictionaryInput>(): TFunction<D> {\n const instance = useVerbaly<D>();\n const version = trackVersion(instance);\n const t = (first: unknown, ...rest: unknown[]): string => {\n void version.value;\n return (instance.t as unknown as (...args: unknown[]) => string)(first, ...rest);\n };\n return t as TFunction<D>;\n}\n\nexport function useLocale(): WritableComputedRef<string> {\n const instance = useVerbaly();\n const version = trackVersion(instance);\n return computed({\n get: () => {\n void version.value;\n return instance.locale;\n },\n set: (locale: string) => instance.setLocale(locale),\n });\n}\n\nfunction trackVersion<D extends DictionaryInput>(instance: Verbaly<D>): ShallowRef<number> {\n const version = shallowRef(instance.version);\n onScopeDispose(\n instance.subscribe(() => {\n version.value = instance.version;\n }),\n );\n return version;\n}\n\nexport type TransComponents = Record<string, (children: VNodeChild[]) => VNodeChild>;\n\n// translated message + element interpolation\nexport const Trans = defineComponent({\n name: 'Trans',\n props: {\n id: { type: String, required: true },\n values: { type: Object as PropType<Params>, default: undefined },\n components: { type: Object as PropType<TransComponents>, default: () => ({}) },\n links: { type: Object as PropType<Record<string, RichLink>>, default: () => ({}) },\n },\n setup(props) {\n const instance = useVerbaly();\n const version = trackVersion(instance);\n return () => {\n void version.value;\n const text = (instance.t as unknown as (id: string, values?: Params) => string)(\n props.id,\n props.values,\n );\n return h(Fragment, toNodes(parseTags(text), props.components, props.links));\n };\n },\n});\n\nfunction toNodes(\n nodes: TagNode[],\n components: TransComponents,\n links: Record<string, RichLink>,\n): VNodeChild[] {\n return nodes.map((node) => {\n if (typeof node === 'string') return node;\n const children = toNodes(node.children, components, links);\n const fn = components[node.name];\n if (fn) return fn(children);\n const link = links[node.name];\n if (link !== undefined) {\n const def: Exclude<RichLink, string> = typeof link === 'string' ? { href: link } : link;\n return h('a', { href: safeHref(def.href), target: def.target, rel: def.rel }, children);\n }\n return children;\n });\n}\n\nexport type { Params, TFunction, Verbaly };\n"],"mappings":";;;;AA0BA,MAAM,MAA6B,OAAO,SAAS;AAMnD,SAAgB,cAAyC,UAAqC;CAC5F,OAAO,EACL,QAAQ,KAAK;EACX,IAAI,QAAQ,KAAK,QAA8B;CACjD,EACF;AACF;AAEA,SAAgB,aAAsE;CACpF,MAAM,YAAA,GAAA,IAAA,OAAA,CAAkB,KAAK,IAAI;CACjC,IAAI,CAAC,UACH,MAAM,IAAI,MAAM,2DAA2D;CAE7E,OAAO;AACT;AAEA,SAAgB,OAAkE;CAChF,MAAM,WAAW,WAAc;CAC/B,MAAM,UAAU,aAAa,QAAQ;CACrC,MAAM,KAAK,OAAgB,GAAG,SAA4B;EACxD,QAAa;EACb,OAAQ,SAAS,EAAgD,OAAO,GAAG,IAAI;CACjF;CACA,OAAO;AACT;AAEA,SAAgB,YAAyC;CACvD,MAAM,WAAW,WAAW;CAC5B,MAAM,UAAU,aAAa,QAAQ;CACrC,QAAA,GAAA,IAAA,SAAA,CAAgB;EACd,WAAW;GACT,QAAa;GACb,OAAO,SAAS;EAClB;EACA,MAAM,WAAmB,SAAS,UAAU,MAAM;CACpD,CAAC;AACH;AAEA,SAAS,aAAwC,UAA0C;CACzF,MAAM,WAAA,GAAA,IAAA,WAAA,CAAqB,SAAS,OAAO;CAC3C,CAAA,GAAA,IAAA,eAAA,CACE,SAAS,gBAAgB;EACvB,QAAQ,QAAQ,SAAS;CAC3B,CAAC,CACH;CACA,OAAO;AACT;AAKA,MAAa,SAAA,GAAA,IAAA,gBAAA,CAAwB;CACnC,MAAM;CACN,OAAO;EACL,IAAI;GAAE,MAAM;GAAQ,UAAU;EAAK;EACnC,QAAQ;GAAE,MAAM;GAA4B,SAAS,KAAA;EAAU;EAC/D,YAAY;GAAE,MAAM;GAAqC,gBAAgB,CAAC;EAAG;EAC7E,OAAO;GAAE,MAAM;GAA8C,gBAAgB,CAAC;EAAG;CACnF;CACA,MAAM,OAAO;EACX,MAAM,WAAW,WAAW;EAC5B,MAAM,UAAU,aAAa,QAAQ;EACrC,aAAa;GACX,QAAa;GAKb,QAAA,GAAA,IAAA,EAAA,CAASA,IAAAA,UAAU,SAAA,GAAA,QAAA,UAAA,CAJL,SAAS,EACrB,MAAM,IACN,MAAM,MAEgC,CAAC,GAAG,MAAM,YAAY,MAAM,KAAK,CAAC;EAC5E;CACF;AACF,CAAC;AAED,SAAS,QACP,OACA,YACA,OACc;CACd,OAAO,MAAM,KAAK,SAAS;EACzB,IAAI,OAAO,SAAS,UAAU,OAAO;EACrC,MAAM,WAAW,QAAQ,KAAK,UAAU,YAAY,KAAK;EACzD,MAAM,KAAK,WAAW,KAAK;EAC3B,IAAI,IAAI,OAAO,GAAG,QAAQ;EAC1B,MAAM,OAAO,MAAM,KAAK;EACxB,IAAI,SAAS,KAAA,GAAW;GACtB,MAAM,MAAiC,OAAO,SAAS,WAAW,EAAE,MAAM,KAAK,IAAI;GACnF,QAAA,GAAA,IAAA,EAAA,CAAS,KAAK;IAAE,OAAA,GAAA,QAAA,SAAA,CAAe,IAAI,IAAI;IAAG,QAAQ,IAAI;IAAQ,KAAK,IAAI;GAAI,GAAG,QAAQ;EACxF;EACA,OAAO;CACT,CAAC;AACH"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,56 +1,55 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export { Params, TFunction, Verbaly } from 'verbaly';
|
|
5
|
-
|
|
1
|
+
import { App, PropType, VNodeChild, WritableComputedRef } from "vue";
|
|
2
|
+
import { DictionaryInput, Params, RichLink, TFunction, Verbaly } from "verbaly";
|
|
3
|
+
//#region src/index.d.ts
|
|
6
4
|
interface VerbalyPlugin {
|
|
7
|
-
|
|
5
|
+
install(app: App): void;
|
|
8
6
|
}
|
|
9
7
|
declare function verbalyPlugin<D extends DictionaryInput>(instance: Verbaly<D>): VerbalyPlugin;
|
|
10
8
|
declare function useVerbaly<D extends DictionaryInput = DictionaryInput>(): Verbaly<D>;
|
|
11
9
|
declare function useT<D extends DictionaryInput = DictionaryInput>(): TFunction<D>;
|
|
12
10
|
declare function useLocale(): WritableComputedRef<string>;
|
|
13
11
|
type TransComponents = Record<string, (children: VNodeChild[]) => VNodeChild>;
|
|
14
|
-
declare const Trans: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
32
|
-
|
|
33
|
-
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
12
|
+
declare const Trans: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
13
|
+
id: {
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
values: {
|
|
18
|
+
type: PropType<Params>;
|
|
19
|
+
default: undefined;
|
|
20
|
+
};
|
|
21
|
+
components: {
|
|
22
|
+
type: PropType<TransComponents>;
|
|
23
|
+
default: () => {};
|
|
24
|
+
};
|
|
25
|
+
links: {
|
|
26
|
+
type: PropType<Record<string, RichLink>>;
|
|
27
|
+
default: () => {};
|
|
28
|
+
};
|
|
29
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
32
|
+
id: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
required: true;
|
|
35
|
+
};
|
|
36
|
+
values: {
|
|
37
|
+
type: PropType<Params>;
|
|
38
|
+
default: undefined;
|
|
39
|
+
};
|
|
40
|
+
components: {
|
|
41
|
+
type: PropType<TransComponents>;
|
|
42
|
+
default: () => {};
|
|
43
|
+
};
|
|
44
|
+
links: {
|
|
45
|
+
type: PropType<Record<string, RichLink>>;
|
|
46
|
+
default: () => {};
|
|
47
|
+
};
|
|
50
48
|
}>> & Readonly<{}>, {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
55
|
-
|
|
56
|
-
export {
|
|
49
|
+
values: Params;
|
|
50
|
+
components: TransComponents;
|
|
51
|
+
links: Record<string, RichLink>;
|
|
52
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
53
|
+
//#endregion
|
|
54
|
+
export { type Params, type TFunction, Trans, TransComponents, type Verbaly, VerbalyPlugin, useLocale, useT, useVerbaly, verbalyPlugin };
|
|
55
|
+
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,56 +1,55 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export { Params, TFunction, Verbaly } from 'verbaly';
|
|
5
|
-
|
|
1
|
+
import { App, PropType, VNodeChild, WritableComputedRef } from "vue";
|
|
2
|
+
import { DictionaryInput, Params, RichLink, TFunction, Verbaly } from "verbaly";
|
|
3
|
+
//#region src/index.d.ts
|
|
6
4
|
interface VerbalyPlugin {
|
|
7
|
-
|
|
5
|
+
install(app: App): void;
|
|
8
6
|
}
|
|
9
7
|
declare function verbalyPlugin<D extends DictionaryInput>(instance: Verbaly<D>): VerbalyPlugin;
|
|
10
8
|
declare function useVerbaly<D extends DictionaryInput = DictionaryInput>(): Verbaly<D>;
|
|
11
9
|
declare function useT<D extends DictionaryInput = DictionaryInput>(): TFunction<D>;
|
|
12
10
|
declare function useLocale(): WritableComputedRef<string>;
|
|
13
11
|
type TransComponents = Record<string, (children: VNodeChild[]) => VNodeChild>;
|
|
14
|
-
declare const Trans: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
32
|
-
|
|
33
|
-
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
12
|
+
declare const Trans: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
13
|
+
id: {
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
values: {
|
|
18
|
+
type: PropType<Params>;
|
|
19
|
+
default: undefined;
|
|
20
|
+
};
|
|
21
|
+
components: {
|
|
22
|
+
type: PropType<TransComponents>;
|
|
23
|
+
default: () => {};
|
|
24
|
+
};
|
|
25
|
+
links: {
|
|
26
|
+
type: PropType<Record<string, RichLink>>;
|
|
27
|
+
default: () => {};
|
|
28
|
+
};
|
|
29
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
32
|
+
id: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
required: true;
|
|
35
|
+
};
|
|
36
|
+
values: {
|
|
37
|
+
type: PropType<Params>;
|
|
38
|
+
default: undefined;
|
|
39
|
+
};
|
|
40
|
+
components: {
|
|
41
|
+
type: PropType<TransComponents>;
|
|
42
|
+
default: () => {};
|
|
43
|
+
};
|
|
44
|
+
links: {
|
|
45
|
+
type: PropType<Record<string, RichLink>>;
|
|
46
|
+
default: () => {};
|
|
47
|
+
};
|
|
50
48
|
}>> & Readonly<{}>, {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
55
|
-
|
|
56
|
-
export {
|
|
49
|
+
values: Params;
|
|
50
|
+
components: TransComponents;
|
|
51
|
+
links: Record<string, RichLink>;
|
|
52
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
53
|
+
//#endregion
|
|
54
|
+
export { type Params, type TFunction, Trans, TransComponents, type Verbaly, VerbalyPlugin, useLocale, useT, useVerbaly, verbalyPlugin };
|
|
55
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,101 +1,92 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Fragment,
|
|
6
|
-
h,
|
|
7
|
-
inject,
|
|
8
|
-
onScopeDispose,
|
|
9
|
-
shallowRef
|
|
10
|
-
} from "vue";
|
|
11
|
-
import {
|
|
12
|
-
parseTags,
|
|
13
|
-
safeHref
|
|
14
|
-
} from "verbaly";
|
|
15
|
-
var KEY = /* @__PURE__ */ Symbol("verbaly");
|
|
1
|
+
import { Fragment, computed, defineComponent, h, inject, onScopeDispose, shallowRef } from "vue";
|
|
2
|
+
import { parseTags, safeHref } from "verbaly";
|
|
3
|
+
//#region src/index.ts
|
|
4
|
+
const KEY = Symbol("verbaly");
|
|
16
5
|
function verbalyPlugin(instance) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
};
|
|
6
|
+
return { install(app) {
|
|
7
|
+
app.provide(KEY, instance);
|
|
8
|
+
} };
|
|
22
9
|
}
|
|
23
10
|
function useVerbaly() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
return instance;
|
|
11
|
+
const instance = inject(KEY, null);
|
|
12
|
+
if (!instance) throw new Error("[verbaly] useVerbaly requires app.use(verbalyPlugin(...))");
|
|
13
|
+
return instance;
|
|
29
14
|
}
|
|
30
15
|
function useT() {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
16
|
+
const instance = useVerbaly();
|
|
17
|
+
const version = trackVersion(instance);
|
|
18
|
+
const t = (first, ...rest) => {
|
|
19
|
+
version.value;
|
|
20
|
+
return instance.t(first, ...rest);
|
|
21
|
+
};
|
|
22
|
+
return t;
|
|
38
23
|
}
|
|
39
24
|
function useLocale() {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
25
|
+
const instance = useVerbaly();
|
|
26
|
+
const version = trackVersion(instance);
|
|
27
|
+
return computed({
|
|
28
|
+
get: () => {
|
|
29
|
+
version.value;
|
|
30
|
+
return instance.locale;
|
|
31
|
+
},
|
|
32
|
+
set: (locale) => instance.setLocale(locale)
|
|
33
|
+
});
|
|
49
34
|
}
|
|
50
35
|
function trackVersion(instance) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
);
|
|
57
|
-
return version;
|
|
36
|
+
const version = shallowRef(instance.version);
|
|
37
|
+
onScopeDispose(instance.subscribe(() => {
|
|
38
|
+
version.value = instance.version;
|
|
39
|
+
}));
|
|
40
|
+
return version;
|
|
58
41
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
42
|
+
const Trans = defineComponent({
|
|
43
|
+
name: "Trans",
|
|
44
|
+
props: {
|
|
45
|
+
id: {
|
|
46
|
+
type: String,
|
|
47
|
+
required: true
|
|
48
|
+
},
|
|
49
|
+
values: {
|
|
50
|
+
type: Object,
|
|
51
|
+
default: void 0
|
|
52
|
+
},
|
|
53
|
+
components: {
|
|
54
|
+
type: Object,
|
|
55
|
+
default: () => ({})
|
|
56
|
+
},
|
|
57
|
+
links: {
|
|
58
|
+
type: Object,
|
|
59
|
+
default: () => ({})
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
setup(props) {
|
|
63
|
+
const instance = useVerbaly();
|
|
64
|
+
const version = trackVersion(instance);
|
|
65
|
+
return () => {
|
|
66
|
+
version.value;
|
|
67
|
+
return h(Fragment, toNodes(parseTags(instance.t(props.id, props.values)), props.components, props.links));
|
|
68
|
+
};
|
|
69
|
+
}
|
|
79
70
|
});
|
|
80
71
|
function toNodes(nodes, components, links) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
72
|
+
return nodes.map((node) => {
|
|
73
|
+
if (typeof node === "string") return node;
|
|
74
|
+
const children = toNodes(node.children, components, links);
|
|
75
|
+
const fn = components[node.name];
|
|
76
|
+
if (fn) return fn(children);
|
|
77
|
+
const link = links[node.name];
|
|
78
|
+
if (link !== void 0) {
|
|
79
|
+
const def = typeof link === "string" ? { href: link } : link;
|
|
80
|
+
return h("a", {
|
|
81
|
+
href: safeHref(def.href),
|
|
82
|
+
target: def.target,
|
|
83
|
+
rel: def.rel
|
|
84
|
+
}, children);
|
|
85
|
+
}
|
|
86
|
+
return children;
|
|
87
|
+
});
|
|
93
88
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
useT,
|
|
98
|
-
useVerbaly,
|
|
99
|
-
verbalyPlugin
|
|
100
|
-
};
|
|
89
|
+
//#endregion
|
|
90
|
+
export { Trans, useLocale, useT, useVerbaly, verbalyPlugin };
|
|
91
|
+
|
|
101
92
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {\n computed,\n defineComponent,\n Fragment,\n h,\n inject,\n onScopeDispose,\n shallowRef,\n type App,\n type InjectionKey,\n type PropType,\n type ShallowRef,\n type VNodeChild,\n type WritableComputedRef,\n} from 'vue';\nimport {\n parseTags,\n safeHref,\n type DictionaryInput,\n type Params,\n type RichLink,\n type TagNode,\n type TFunction,\n type Verbaly,\n} from 'verbaly';\n\nconst KEY: InjectionKey<Verbaly> = Symbol('verbaly');\n\nexport interface VerbalyPlugin {\n install(app: App): void;\n}\n\nexport function verbalyPlugin<D extends DictionaryInput>(instance: Verbaly<D>): VerbalyPlugin {\n return {\n install(app) {\n app.provide(KEY, instance as unknown as Verbaly);\n },\n };\n}\n\nexport function useVerbaly<D extends DictionaryInput = DictionaryInput>(): Verbaly<D> {\n const instance = inject(KEY, null);\n if (!instance) {\n throw new Error('[verbaly] useVerbaly requires app.use(verbalyPlugin(...))');\n }\n return instance as unknown as Verbaly<D>;\n}\n\nexport function useT<D extends DictionaryInput = DictionaryInput>(): TFunction<D> {\n const instance = useVerbaly<D>();\n const version = trackVersion(instance);\n const t = (first: unknown, ...rest: unknown[]): string => {\n void version.value;\n return (instance.t as unknown as (...args: unknown[]) => string)(first, ...rest);\n };\n return t as TFunction<D>;\n}\n\nexport function useLocale(): WritableComputedRef<string> {\n const instance = useVerbaly();\n const version = trackVersion(instance);\n return computed({\n get: () => {\n void version.value;\n return instance.locale;\n },\n set: (locale: string) => instance.setLocale(locale),\n });\n}\n\nfunction trackVersion<D extends DictionaryInput>(instance: Verbaly<D>): ShallowRef<number> {\n const version = shallowRef(instance.version);\n onScopeDispose(\n instance.subscribe(() => {\n version.value = instance.version;\n }),\n );\n return version;\n}\n\nexport type TransComponents = Record<string, (children: VNodeChild[]) => VNodeChild>;\n\n// translated message + element interpolation\nexport const Trans = defineComponent({\n name: 'Trans',\n props: {\n id: { type: String, required: true },\n values: { type: Object as PropType<Params>, default: undefined },\n components: { type: Object as PropType<TransComponents>, default: () => ({}) },\n links: { type: Object as PropType<Record<string, RichLink>>, default: () => ({}) },\n },\n setup(props) {\n const instance = useVerbaly();\n const version = trackVersion(instance);\n return () => {\n void version.value;\n const text = (instance.t as unknown as (id: string, values?: Params) => string)(\n props.id,\n props.values,\n );\n return h(Fragment, toNodes(parseTags(text), props.components, props.links));\n };\n },\n});\n\nfunction toNodes(\n nodes: TagNode[],\n components: TransComponents,\n links: Record<string, RichLink>,\n): VNodeChild[] {\n return nodes.map((node) => {\n if (typeof node === 'string') return node;\n const children = toNodes(node.children, components, links);\n const fn = components[node.name];\n if (fn) return fn(children);\n const link = links[node.name];\n if (link !== undefined) {\n const def: Exclude<RichLink, string> = typeof link === 'string' ? { href: link } : link;\n return h('a', { href: safeHref(def.href), target: def.target, rel: def.rel }, children);\n }\n return children;\n });\n}\n\nexport type { Params, TFunction, Verbaly };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import {\n computed,\n defineComponent,\n Fragment,\n h,\n inject,\n onScopeDispose,\n shallowRef,\n type App,\n type InjectionKey,\n type PropType,\n type ShallowRef,\n type VNodeChild,\n type WritableComputedRef,\n} from 'vue';\nimport {\n parseTags,\n safeHref,\n type DictionaryInput,\n type Params,\n type RichLink,\n type TagNode,\n type TFunction,\n type Verbaly,\n} from 'verbaly';\n\nconst KEY: InjectionKey<Verbaly> = Symbol('verbaly');\n\nexport interface VerbalyPlugin {\n install(app: App): void;\n}\n\nexport function verbalyPlugin<D extends DictionaryInput>(instance: Verbaly<D>): VerbalyPlugin {\n return {\n install(app) {\n app.provide(KEY, instance as unknown as Verbaly);\n },\n };\n}\n\nexport function useVerbaly<D extends DictionaryInput = DictionaryInput>(): Verbaly<D> {\n const instance = inject(KEY, null);\n if (!instance) {\n throw new Error('[verbaly] useVerbaly requires app.use(verbalyPlugin(...))');\n }\n return instance as unknown as Verbaly<D>;\n}\n\nexport function useT<D extends DictionaryInput = DictionaryInput>(): TFunction<D> {\n const instance = useVerbaly<D>();\n const version = trackVersion(instance);\n const t = (first: unknown, ...rest: unknown[]): string => {\n void version.value;\n return (instance.t as unknown as (...args: unknown[]) => string)(first, ...rest);\n };\n return t as TFunction<D>;\n}\n\nexport function useLocale(): WritableComputedRef<string> {\n const instance = useVerbaly();\n const version = trackVersion(instance);\n return computed({\n get: () => {\n void version.value;\n return instance.locale;\n },\n set: (locale: string) => instance.setLocale(locale),\n });\n}\n\nfunction trackVersion<D extends DictionaryInput>(instance: Verbaly<D>): ShallowRef<number> {\n const version = shallowRef(instance.version);\n onScopeDispose(\n instance.subscribe(() => {\n version.value = instance.version;\n }),\n );\n return version;\n}\n\nexport type TransComponents = Record<string, (children: VNodeChild[]) => VNodeChild>;\n\n// translated message + element interpolation\nexport const Trans = defineComponent({\n name: 'Trans',\n props: {\n id: { type: String, required: true },\n values: { type: Object as PropType<Params>, default: undefined },\n components: { type: Object as PropType<TransComponents>, default: () => ({}) },\n links: { type: Object as PropType<Record<string, RichLink>>, default: () => ({}) },\n },\n setup(props) {\n const instance = useVerbaly();\n const version = trackVersion(instance);\n return () => {\n void version.value;\n const text = (instance.t as unknown as (id: string, values?: Params) => string)(\n props.id,\n props.values,\n );\n return h(Fragment, toNodes(parseTags(text), props.components, props.links));\n };\n },\n});\n\nfunction toNodes(\n nodes: TagNode[],\n components: TransComponents,\n links: Record<string, RichLink>,\n): VNodeChild[] {\n return nodes.map((node) => {\n if (typeof node === 'string') return node;\n const children = toNodes(node.children, components, links);\n const fn = components[node.name];\n if (fn) return fn(children);\n const link = links[node.name];\n if (link !== undefined) {\n const def: Exclude<RichLink, string> = typeof link === 'string' ? { href: link } : link;\n return h('a', { href: safeHref(def.href), target: def.target, rel: def.rel }, children);\n }\n return children;\n });\n}\n\nexport type { Params, TFunction, Verbaly };\n"],"mappings":";;;AA0BA,MAAM,MAA6B,OAAO,SAAS;AAMnD,SAAgB,cAAyC,UAAqC;CAC5F,OAAO,EACL,QAAQ,KAAK;EACX,IAAI,QAAQ,KAAK,QAA8B;CACjD,EACF;AACF;AAEA,SAAgB,aAAsE;CACpF,MAAM,WAAW,OAAO,KAAK,IAAI;CACjC,IAAI,CAAC,UACH,MAAM,IAAI,MAAM,2DAA2D;CAE7E,OAAO;AACT;AAEA,SAAgB,OAAkE;CAChF,MAAM,WAAW,WAAc;CAC/B,MAAM,UAAU,aAAa,QAAQ;CACrC,MAAM,KAAK,OAAgB,GAAG,SAA4B;EACxD,QAAa;EACb,OAAQ,SAAS,EAAgD,OAAO,GAAG,IAAI;CACjF;CACA,OAAO;AACT;AAEA,SAAgB,YAAyC;CACvD,MAAM,WAAW,WAAW;CAC5B,MAAM,UAAU,aAAa,QAAQ;CACrC,OAAO,SAAS;EACd,WAAW;GACT,QAAa;GACb,OAAO,SAAS;EAClB;EACA,MAAM,WAAmB,SAAS,UAAU,MAAM;CACpD,CAAC;AACH;AAEA,SAAS,aAAwC,UAA0C;CACzF,MAAM,UAAU,WAAW,SAAS,OAAO;CAC3C,eACE,SAAS,gBAAgB;EACvB,QAAQ,QAAQ,SAAS;CAC3B,CAAC,CACH;CACA,OAAO;AACT;AAKA,MAAa,QAAQ,gBAAgB;CACnC,MAAM;CACN,OAAO;EACL,IAAI;GAAE,MAAM;GAAQ,UAAU;EAAK;EACnC,QAAQ;GAAE,MAAM;GAA4B,SAAS,KAAA;EAAU;EAC/D,YAAY;GAAE,MAAM;GAAqC,gBAAgB,CAAC;EAAG;EAC7E,OAAO;GAAE,MAAM;GAA8C,gBAAgB,CAAC;EAAG;CACnF;CACA,MAAM,OAAO;EACX,MAAM,WAAW,WAAW;EAC5B,MAAM,UAAU,aAAa,QAAQ;EACrC,aAAa;GACX,QAAa;GAKb,OAAO,EAAE,UAAU,QAAQ,UAJb,SAAS,EACrB,MAAM,IACN,MAAM,MAEgC,CAAC,GAAG,MAAM,YAAY,MAAM,KAAK,CAAC;EAC5E;CACF;AACF,CAAC;AAED,SAAS,QACP,OACA,YACA,OACc;CACd,OAAO,MAAM,KAAK,SAAS;EACzB,IAAI,OAAO,SAAS,UAAU,OAAO;EACrC,MAAM,WAAW,QAAQ,KAAK,UAAU,YAAY,KAAK;EACzD,MAAM,KAAK,WAAW,KAAK;EAC3B,IAAI,IAAI,OAAO,GAAG,QAAQ;EAC1B,MAAM,OAAO,MAAM,KAAK;EACxB,IAAI,SAAS,KAAA,GAAW;GACtB,MAAM,MAAiC,OAAO,SAAS,WAAW,EAAE,MAAM,KAAK,IAAI;GACnF,OAAO,EAAE,KAAK;IAAE,MAAM,SAAS,IAAI,IAAI;IAAG,QAAQ,IAAI;IAAQ,KAAK,IAAI;GAAI,GAAG,QAAQ;EACxF;EACA,OAAO;CACT,CAAC;AACH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verbaly/vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Vue 3 bindings for Verbaly — composables over the reactive core.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"i18n",
|
|
@@ -48,16 +48,16 @@
|
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"vue": "^3.4.0",
|
|
51
|
-
"verbaly": "^0.
|
|
51
|
+
"verbaly": "^0.13.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"happy-dom": "^20.10.6",
|
|
55
55
|
"vue": "^3.5.39",
|
|
56
|
-
"verbaly": "0.
|
|
56
|
+
"verbaly": "0.13.0"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
|
-
"build": "
|
|
60
|
-
"dev": "
|
|
59
|
+
"build": "tsdown",
|
|
60
|
+
"dev": "tsdown --watch",
|
|
61
61
|
"test": "vitest run --passWithNoTests",
|
|
62
62
|
"typecheck": "tsc --noEmit"
|
|
63
63
|
}
|