@kaokei/use-vue-service 4.0.4 → 4.0.5

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 CHANGED
@@ -25,10 +25,3 @@
25
25
  ## Todo List
26
26
 
27
27
  1. 改成tsdown来打包代码
28
- 2. 开发devtools工具-浏览器插件
29
-
30
- 4. 表格宽度应该限制在装饰器页面
31
- 3. 开发nuxt插件,自动导入API
32
- 4. 装饰器是否加小括号的表格
33
- 4. 装饰器是否加小括号的类型兼容
34
- 5. 整理note笔记
@@ -0,0 +1,16 @@
1
+ /**
2
+ * 方法装饰器:自动绑定方法的 this 到实例(Vue 响应式兼容版)
3
+ *
4
+ * 与 @kaokei/di 原始 autobind 的区别:
5
+ * - 原始版:value.bind(this) — 绑定到原始实例,reactive() 后方法内修改丢失响应式
6
+ * - 本版:value.bind(reactive(this)) — 利用 Vue 3 reactive() 幂等性,this 指向 proxy
7
+ *
8
+ * 调用场景全覆盖:
9
+ * - proxy.method() → this = proxy → 响应式生效 ✅
10
+ * - const m = proxy.method; m() → this = proxy → 响应式生效 ✅
11
+ * - Promise.then(service.method) → this = proxy → 响应式生效 ✅
12
+ * - setTimeout(service.method, 0) → this = proxy → 响应式生效 ✅
13
+ *
14
+ * @Raw 兼容:通过 context.metadata[RAW_CLASS_KEY] 判断,@Raw 类直接 bind raw
15
+ */
16
+ export declare function autobind<T extends (...args: any[]) => any>(value: T, context: ClassMethodDecoratorContext): void;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * 方法装饰器:自动绑定方法的 this 到实例(Vue 响应式兼容版)
3
+ *
4
+ * 与 @kaokei/di 原始 autobind 的区别:
5
+ * - 原始版:value.bind(this) — 绑定到原始实例,reactive() 后方法内修改丢失响应式
6
+ * - 本版:value.bind(reactive(this)) — 利用 Vue 3 reactive() 幂等性,this 指向 proxy
7
+ *
8
+ * 调用场景全覆盖:
9
+ * - proxy.method() → this = proxy → 响应式生效 ✅
10
+ * - const m = proxy.method; m() → this = proxy → 响应式生效 ✅
11
+ * - Promise.then(service.method) → this = proxy → 响应式生效 ✅
12
+ * - setTimeout(service.method, 0) → this = proxy → 响应式生效 ✅
13
+ *
14
+ * @Raw 兼容:通过 context.metadata[RAW_CLASS_KEY] 判断,@Raw 类直接 bind raw
15
+ */
16
+ export declare function autobind<T extends (...args: any[]) => any>(value: T, context: ClassMethodDecoratorContext): void;
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@kaokei/di"),o=require("vue"),y=new c.Token("FIND_CHILD_SERVICE"),P=new c.Token("FIND_CHILDREN_SERVICES"),C=Symbol("SCOPE_KEY"),N="__raw__",u=Symbol("CONTAINER_TOKEN");function k(n){const e=n,t=o.effectScope(!0);return e[C]=t,t}function b(n){return n[C]}function V(n){const e=n;if(e){const t=b(e);t&&(t.stop(),delete e[C])}}function D(n){const e=b(n);return e||k(n)}function S(n,e,t,r){if(n){for(const i of n)if(i.isCurrentBound(e)&&(t.push(i.get(e)),r)||S(i.getChildren(),e,t,r))return!0}return!1}function F(n,e){const t=[];return S(e.getChildren(),n,t,!0),t[0]}function H(n,e){const t=[];return S(e.getChildren(),n,t,!1),t}function L(n,e,t){return c.isObject(e)?c.getOwnMetadata(N,t)?o.markRaw(e):o.reactive(e):e}function K(n){return V(n)}function W({container:n}){return e=>F(e,n)}function Y({container:n}){return e=>H(e,n)}function h(n){let e;return n?e=n.createChild():e=new c.Container,e.bind(y).toDynamicValue(W),e.bind(P).toDynamicValue(Y),e.onActivation(L),e.onDeactivation(K),e}const l=h();function s(n,e){if(typeof e=="function")e(n);else for(let t=0;t<e.length;t++)n.bind(e[t]).toSelf()}function A(){const n=o.getCurrentInstance();if(n){const e=u,t=n.provides,r=n.parent&&n.parent.provides;if(t&&t!==r&&c.hasOwn(t,e))return t[e]}}function j(n){if(!o.hasInjectionContext())throw new Error(`${n} must inside setup.`)}function g(){return o.inject(u,l)}function q(n){return j("useService"),(A()||g()).get(n)}function M(n){j("declareProviders");const e=A();if(e)s(e,n);else{const t=g(),r=h(t);s(r,n),o.provide(u,r),o.onUnmounted(()=>{r.destroy()})}}function U(n){return l.get(n)}function z(n){s(l,n)}function B(n,e){return e.runWithContext(()=>g().get(n))}function T(n,e){e.runWithContext(()=>{const t=o.inject(u,null);if(t)s(t,n);else{const r=h(l);s(r,n),e.provide(u,r),e.onUnmount(()=>{r.destroy()})}})}function G(n){return e=>T(n,e)}function _(n,e){const t=e.name;return function(){const r=this,i=o.toRaw(this),E=D(i),R=n;let p,f=Object.getPrototypeOf(i);for(;f;){const a=Object.getOwnPropertyDescriptor(f,t);if(a&&a.set){p=a.set;break}f=Object.getPrototypeOf(f)}const I=p?E.run(()=>o.computed({get:()=>R.call(r),set:a=>p.call(r,a)})):E.run(()=>o.computed(()=>R.call(r)));return Object.defineProperty(i,t,{value:I,writable:!0,configurable:!0,enumerable:!0}),I}}function $(n,e){return typeof n=="function"&&(e==null?void 0:e.kind)==="getter"?_(n,e):_}function d(n){return c.isObject(n)?o.markRaw(n):n}function O(n,e){const t=e.name;return e.addInitializer(function(){let r=this[t];Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get(){return r},set(i){r=d(i)}})}),d}function m(n,e){return{get(){return n.get.call(o.toRaw(this))},set(t){n.set.call(o.toRaw(this),d(t))},init:d}}function v(n,e){e.metadata&&(e.metadata[N]=!0)}function J(n,e){return(e==null?void 0:e.kind)==="field"?O(n,e):(e==null?void 0:e.kind)==="accessor"?m(n):(e==null?void 0:e.kind)==="class"?v(n,e):(t,r)=>(r==null?void 0:r.kind)==="field"?O(t,r):(r==null?void 0:r.kind)==="accessor"?m(t):v(t,r)}function w(n,e){return function(...t){const i=D(this).run(()=>o.effectScope());return i.run(()=>n.call(this,...t)),i}}function Q(n,e){return typeof n=="function"&&(e==null?void 0:e.kind)==="method"?w(n):w}exports.CONTAINER_TOKEN=u;exports.Computed=$;exports.FIND_CHILDREN_SERVICES=P;exports.FIND_CHILD_SERVICE=y;exports.Raw=J;exports.RunInScope=Q;exports.declareAppProviders=T;exports.declareAppProvidersPlugin=G;exports.declareProviders=M;exports.declareRootProviders=z;exports.useAppService=B;exports.useRootService=U;exports.useService=q;Object.keys(c).forEach(n=>{n!=="default"&&!Object.prototype.hasOwnProperty.call(exports,n)&&Object.defineProperty(exports,n,{enumerable:!0,get:()=>c[n]})});
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@kaokei/di"),i=require("vue"),y=new c.Token("FIND_CHILD_SERVICE"),P=new c.Token("FIND_CHILDREN_SERVICES"),S=Symbol("SCOPE_KEY"),h="__raw__",u=Symbol("CONTAINER_TOKEN");function k(n){const e=n,t=i.effectScope(!0);return e[S]=t,t}function N(n){return n[S]}function V(n){const e=n;if(e){const t=N(e);t&&(t.stop(),delete e[S])}}function D(n){const e=N(n);return e||k(n)}function g(n,e,t,r){if(n){for(const o of n)if(o.isCurrentBound(e)&&(t.push(o.get(e)),r)||g(o.getChildren(),e,t,r))return!0}return!1}function F(n,e){const t=[];return g(e.getChildren(),n,t,!0),t[0]}function H(n,e){const t=[];return g(e.getChildren(),n,t,!1),t}function L(n,e,t){return c.isObject(e)?c.getOwnMetadata(h,t)?i.markRaw(e):i.reactive(e):e}function K(n){return V(n)}function M({container:n}){return e=>F(e,n)}function W({container:n}){return e=>H(e,n)}function m(n){let e;return n?e=n.createChild():e=new c.Container,e.bind(y).toDynamicValue(M),e.bind(P).toDynamicValue(W),e.onActivation(L),e.onDeactivation(K),e}const p=m();function f(n,e){if(typeof e=="function")e(n);else for(let t=0;t<e.length;t++)n.bind(e[t]).toSelf()}function A(){const n=i.getCurrentInstance();if(n){const e=u,t=n.provides,r=n.parent&&n.parent.provides;if(t&&t!==r&&c.hasOwn(t,e))return t[e]}}function j(n){if(!i.hasInjectionContext())throw new Error(`${n} must inside setup.`)}function R(){return i.inject(u,p)}function Y(n){return j("useService"),(A()||R()).get(n)}function q(n){j("declareProviders");const e=A();if(e)f(e,n);else{const t=R(),r=m(t);f(r,n),i.provide(u,r),i.onUnmounted(()=>{r.destroy()})}}function z(n){return p.get(n)}function U(n){f(p,n)}function B(n,e){return e.runWithContext(()=>R().get(n))}function T(n,e){e.runWithContext(()=>{const t=i.inject(u,null);if(t)f(t,n);else{const r=m(p);f(r,n),e.provide(u,r),e.onUnmount(()=>{r.destroy()})}})}function G(n){return e=>T(n,e)}function $(n,e){const t=e.name,r=n;e.addInitializer(function(){var a;const o=((a=e.metadata)==null?void 0:a[h])===!0;this[t]=o?r.bind(this):r.bind(i.reactive(this))})}function _(n,e){const t=e.name;return function(){const r=this,o=i.toRaw(this),a=D(o),E=n;let C,d=Object.getPrototypeOf(o);for(;d;){const s=Object.getOwnPropertyDescriptor(d,t);if(s&&s.set){C=s.set;break}d=Object.getPrototypeOf(d)}const I=C?a.run(()=>i.computed({get:()=>E.call(r),set:s=>C.call(r,s)})):a.run(()=>i.computed(()=>E.call(r)));return Object.defineProperty(o,t,{value:I,writable:!0,configurable:!0,enumerable:!0}),I}}function J(n,e){return typeof n=="function"&&(e==null?void 0:e.kind)==="getter"?_(n,e):_}function l(n){return c.isObject(n)?i.markRaw(n):n}function O(n,e){const t=e.name;return e.addInitializer(function(){let r=this[t];Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get(){return r},set(o){r=l(o)}})}),l}function v(n,e){return{get(){return n.get.call(i.toRaw(this))},set(t){n.set.call(i.toRaw(this),l(t))},init:l}}function w(n,e){e.metadata&&(e.metadata[h]=!0)}function Q(n,e){return(e==null?void 0:e.kind)==="field"?O(n,e):(e==null?void 0:e.kind)==="accessor"?v(n):(e==null?void 0:e.kind)==="class"?w(n,e):(t,r)=>(r==null?void 0:r.kind)==="field"?O(t,r):(r==null?void 0:r.kind)==="accessor"?v(t):w(t,r)}function b(n,e){return function(...t){const o=D(this).run(()=>i.effectScope());return o.run(()=>n.call(this,...t)),o}}function X(n,e){return typeof n=="function"&&(e==null?void 0:e.kind)==="method"?b(n):b}exports.CONTAINER_TOKEN=u;exports.Computed=J;exports.FIND_CHILDREN_SERVICES=P;exports.FIND_CHILD_SERVICE=y;exports.Raw=Q;exports.RunInScope=X;exports.autobind=$;exports.declareAppProviders=T;exports.declareAppProvidersPlugin=G;exports.declareProviders=q;exports.declareRootProviders=U;exports.useAppService=B;exports.useRootService=z;exports.useService=Y;Object.keys(c).forEach(n=>{n!=="default"&&!Object.prototype.hasOwnProperty.call(exports,n)&&Object.defineProperty(exports,n,{enumerable:!0,get:()=>c[n]})});
package/dist/index.d.cts CHANGED
@@ -2,6 +2,7 @@ export * from '@kaokei/di';
2
2
  export { useService, declareProviders, useRootService, declareRootProviders, useAppService, declareAppProviders, declareAppProvidersPlugin, } from './core.ts';
3
3
  export { FIND_CHILD_SERVICE, FIND_CHILDREN_SERVICES, CONTAINER_TOKEN } from './constants.ts';
4
4
  export type { FindChildService, FindChildrenServices } from './interface.ts';
5
+ export { autobind } from './autobind.ts';
5
6
  export { Computed } from './computed.ts';
6
7
  export { Raw } from './raw.ts';
7
8
  export { RunInScope } from './effect-scope.ts';
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from '@kaokei/di';
2
2
  export { useService, declareProviders, useRootService, declareRootProviders, useAppService, declareAppProviders, declareAppProvidersPlugin, } from './core.ts';
3
3
  export { FIND_CHILD_SERVICE, FIND_CHILDREN_SERVICES, CONTAINER_TOKEN } from './constants.ts';
4
4
  export type { FindChildService, FindChildrenServices } from './interface.ts';
5
+ export { autobind } from './autobind.ts';
5
6
  export { Computed } from './computed.ts';
6
7
  export { Raw } from './raw.ts';
7
8
  export { RunInScope } from './effect-scope.ts';
package/dist/index.js CHANGED
@@ -1,47 +1,47 @@
1
- import { Token as D, Container as H, isObject as v, getOwnMetadata as j, hasOwn as K } from "@kaokei/di";
1
+ import { Token as D, Container as j, isObject as N, getOwnMetadata as K, hasOwn as L } from "@kaokei/di";
2
2
  export * from "@kaokei/di";
3
- import { effectScope as N, markRaw as P, reactive as L, inject as b, provide as W, onUnmounted as Y, hasInjectionContext as U, getCurrentInstance as z, toRaw as l, computed as E } from "vue";
4
- const B = new D(
3
+ import { effectScope as v, markRaw as P, reactive as k, inject as A, provide as W, onUnmounted as Y, hasInjectionContext as z, getCurrentInstance as M, toRaw as p, computed as I } from "vue";
4
+ const U = new D(
5
5
  "FIND_CHILD_SERVICE"
6
- ), G = new D(
6
+ ), B = new D(
7
7
  "FIND_CHILDREN_SERVICES"
8
- ), p = Symbol("SCOPE_KEY"), k = "__raw__", u = Symbol("CONTAINER_TOKEN");
9
- function M(n) {
10
- const e = n, t = N(!0);
11
- return e[p] = t, t;
8
+ ), C = Symbol("SCOPE_KEY"), h = "__raw__", c = Symbol("CONTAINER_TOKEN");
9
+ function G(n) {
10
+ const e = n, t = v(!0);
11
+ return e[C] = t, t;
12
12
  }
13
- function A(n) {
14
- return n[p];
13
+ function T(n) {
14
+ return n[C];
15
15
  }
16
16
  function $(n) {
17
17
  const e = n;
18
18
  if (e) {
19
- const t = A(e);
20
- t && (t.stop(), delete e[p]);
19
+ const t = T(e);
20
+ t && (t.stop(), delete e[C]);
21
21
  }
22
22
  }
23
- function T(n) {
24
- const e = A(n);
25
- return e || M(n);
23
+ function V(n) {
24
+ const e = T(n);
25
+ return e || G(n);
26
26
  }
27
- function C(n, e, t, r) {
27
+ function S(n, e, t, r) {
28
28
  if (n) {
29
29
  for (const i of n)
30
- if (i.isCurrentBound(e) && (t.push(i.get(e)), r) || C(i.getChildren(), e, t, r))
30
+ if (i.isCurrentBound(e) && (t.push(i.get(e)), r) || S(i.getChildren(), e, t, r))
31
31
  return !0;
32
32
  }
33
33
  return !1;
34
34
  }
35
35
  function q(n, e) {
36
36
  const t = [];
37
- return C(e.getChildren(), n, t, !0), t[0];
37
+ return S(e.getChildren(), n, t, !0), t[0];
38
38
  }
39
39
  function J(n, e) {
40
40
  const t = [];
41
- return C(e.getChildren(), n, t, !1), t;
41
+ return S(e.getChildren(), n, t, !1), t;
42
42
  }
43
43
  function Q(n, e, t) {
44
- return v(e) ? j(k, t) ? P(e) : L(e) : e;
44
+ return N(e) ? K(h, t) ? P(e) : k(e) : e;
45
45
  }
46
46
  function X(n) {
47
47
  return $(n);
@@ -54,65 +54,65 @@ function x({
54
54
  }) {
55
55
  return (e) => J(e, n);
56
56
  }
57
- function S(n) {
57
+ function m(n) {
58
58
  let e;
59
- return n ? e = n.createChild() : e = new H(), e.bind(B).toDynamicValue(Z), e.bind(G).toDynamicValue(x), e.onActivation(Q), e.onDeactivation(X), e;
59
+ return n ? e = n.createChild() : e = new j(), e.bind(U).toDynamicValue(Z), e.bind(B).toDynamicValue(x), e.onActivation(Q), e.onDeactivation(X), e;
60
60
  }
61
- const f = S();
62
- function c(n, e) {
61
+ const d = m();
62
+ function s(n, e) {
63
63
  if (typeof e == "function")
64
64
  e(n);
65
65
  else
66
66
  for (let t = 0; t < e.length; t++)
67
67
  n.bind(e[t]).toSelf();
68
68
  }
69
- function V() {
70
- const n = z();
69
+ function F() {
70
+ const n = M();
71
71
  if (n) {
72
- const e = u, t = n.provides, r = n.parent && n.parent.provides;
73
- if (t && t !== r && K(t, e))
72
+ const e = c, t = n.provides, r = n.parent && n.parent.provides;
73
+ if (t && t !== r && L(t, e))
74
74
  return t[e];
75
75
  }
76
76
  }
77
- function F(n) {
78
- if (!U())
77
+ function H(n) {
78
+ if (!z())
79
79
  throw new Error(`${n} must inside setup.`);
80
80
  }
81
- function h() {
82
- return b(u, f);
81
+ function g() {
82
+ return A(c, d);
83
83
  }
84
84
  function re(n) {
85
- return F("useService"), (V() || h()).get(n);
85
+ return H("useService"), (F() || g()).get(n);
86
86
  }
87
87
  function ie(n) {
88
- F("declareProviders");
89
- const e = V();
88
+ H("declareProviders");
89
+ const e = F();
90
90
  if (e)
91
- c(e, n);
91
+ s(e, n);
92
92
  else {
93
- const t = h(), r = S(t);
94
- c(r, n), W(u, r), Y(() => {
93
+ const t = g(), r = m(t);
94
+ s(r, n), W(c, r), Y(() => {
95
95
  r.destroy();
96
96
  });
97
97
  }
98
98
  }
99
99
  function oe(n) {
100
- return f.get(n);
100
+ return d.get(n);
101
101
  }
102
102
  function ue(n) {
103
- c(f, n);
103
+ s(d, n);
104
104
  }
105
105
  function ce(n, e) {
106
- return e.runWithContext(() => h().get(n));
106
+ return e.runWithContext(() => g().get(n));
107
107
  }
108
108
  function ee(n, e) {
109
109
  e.runWithContext(() => {
110
- const t = b(u, null);
110
+ const t = A(c, null);
111
111
  if (t)
112
- c(t, n);
112
+ s(t, n);
113
113
  else {
114
- const r = S(f);
115
- c(r, n), e.provide(u, r), e.onUnmount(() => {
114
+ const r = m(d);
115
+ s(r, n), e.provide(c, r), e.onUnmount(() => {
116
116
  r.destroy();
117
117
  });
118
118
  }
@@ -121,40 +121,48 @@ function ee(n, e) {
121
121
  function se(n) {
122
122
  return (e) => ee(n, e);
123
123
  }
124
- function I(n, e) {
124
+ function ae(n, e) {
125
+ const t = e.name, r = n;
126
+ e.addInitializer(function() {
127
+ var o;
128
+ const i = ((o = e.metadata) == null ? void 0 : o[h]) === !0;
129
+ this[t] = i ? r.bind(this) : r.bind(k(this));
130
+ });
131
+ }
132
+ function w(n, e) {
125
133
  const t = e.name;
126
134
  return function() {
127
- const r = this, i = l(this), g = T(i), m = n;
128
- let d, s = Object.getPrototypeOf(i);
129
- for (; s; ) {
130
- const o = Object.getOwnPropertyDescriptor(s, t);
131
- if (o && o.set) {
132
- d = o.set;
135
+ const r = this, i = p(this), o = V(i), _ = n;
136
+ let l, a = Object.getPrototypeOf(i);
137
+ for (; a; ) {
138
+ const u = Object.getOwnPropertyDescriptor(a, t);
139
+ if (u && u.set) {
140
+ l = u.set;
133
141
  break;
134
142
  }
135
- s = Object.getPrototypeOf(s);
143
+ a = Object.getPrototypeOf(a);
136
144
  }
137
- const _ = d ? g.run(
138
- () => E({
139
- get: () => m.call(r),
140
- set: (o) => d.call(r, o)
145
+ const E = l ? o.run(
146
+ () => I({
147
+ get: () => _.call(r),
148
+ set: (u) => l.call(r, u)
141
149
  })
142
- ) : g.run(() => E(() => m.call(r)));
150
+ ) : o.run(() => I(() => _.call(r)));
143
151
  return Object.defineProperty(i, t, {
144
- value: _,
152
+ value: E,
145
153
  writable: !0,
146
154
  configurable: !0,
147
155
  enumerable: !0
148
- }), _;
156
+ }), E;
149
157
  };
150
158
  }
151
- function ae(n, e) {
152
- return typeof n == "function" && (e == null ? void 0 : e.kind) === "getter" ? I(n, e) : I;
159
+ function fe(n, e) {
160
+ return typeof n == "function" && (e == null ? void 0 : e.kind) === "getter" ? w(n, e) : w;
153
161
  }
154
- function a(n) {
155
- return v(n) ? P(n) : n;
162
+ function f(n) {
163
+ return N(n) ? P(n) : n;
156
164
  }
157
- function w(n, e) {
165
+ function O(n, e) {
158
166
  const t = e.name;
159
167
  return e.addInitializer(function() {
160
168
  let r = this[t];
@@ -165,44 +173,45 @@ function w(n, e) {
165
173
  return r;
166
174
  },
167
175
  set(i) {
168
- r = a(i);
176
+ r = f(i);
169
177
  }
170
178
  });
171
- }), a;
179
+ }), f;
172
180
  }
173
- function O(n, e) {
181
+ function R(n, e) {
174
182
  return {
175
183
  get() {
176
- return n.get.call(l(this));
184
+ return n.get.call(p(this));
177
185
  },
178
186
  set(t) {
179
- n.set.call(l(this), a(t));
187
+ n.set.call(p(this), f(t));
180
188
  },
181
- init: a
189
+ init: f
182
190
  };
183
191
  }
184
- function R(n, e) {
185
- e.metadata && (e.metadata[k] = !0);
192
+ function y(n, e) {
193
+ e.metadata && (e.metadata[h] = !0);
186
194
  }
187
- function fe(n, e) {
188
- return (e == null ? void 0 : e.kind) === "field" ? w(n, e) : (e == null ? void 0 : e.kind) === "accessor" ? O(n) : (e == null ? void 0 : e.kind) === "class" ? R(n, e) : (t, r) => (r == null ? void 0 : r.kind) === "field" ? w(t, r) : (r == null ? void 0 : r.kind) === "accessor" ? O(t) : R(t, r);
195
+ function de(n, e) {
196
+ return (e == null ? void 0 : e.kind) === "field" ? O(n, e) : (e == null ? void 0 : e.kind) === "accessor" ? R(n) : (e == null ? void 0 : e.kind) === "class" ? y(n, e) : (t, r) => (r == null ? void 0 : r.kind) === "field" ? O(t, r) : (r == null ? void 0 : r.kind) === "accessor" ? R(t) : y(t, r);
189
197
  }
190
- function y(n, e) {
198
+ function b(n, e) {
191
199
  return function(...t) {
192
- const i = T(this).run(() => N());
200
+ const i = V(this).run(() => v());
193
201
  return i.run(() => n.call(this, ...t)), i;
194
202
  };
195
203
  }
196
- function de(n, e) {
197
- return typeof n == "function" && (e == null ? void 0 : e.kind) === "method" ? y(n) : y;
204
+ function le(n, e) {
205
+ return typeof n == "function" && (e == null ? void 0 : e.kind) === "method" ? b(n) : b;
198
206
  }
199
207
  export {
200
- u as CONTAINER_TOKEN,
201
- ae as Computed,
202
- G as FIND_CHILDREN_SERVICES,
203
- B as FIND_CHILD_SERVICE,
204
- fe as Raw,
205
- de as RunInScope,
208
+ c as CONTAINER_TOKEN,
209
+ fe as Computed,
210
+ B as FIND_CHILDREN_SERVICES,
211
+ U as FIND_CHILD_SERVICE,
212
+ de as Raw,
213
+ le as RunInScope,
214
+ ae as autobind,
206
215
  ee as declareAppProviders,
207
216
  se as declareAppProvidersPlugin,
208
217
  ie as declareProviders,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaokei/use-vue-service",
3
- "version": "4.0.4",
3
+ "version": "4.0.5",
4
4
  "type": "module",
5
5
  "description": "Lightweight Vue 3 state management with dependency injection, inspired by Angular services.",
6
6
  "main": "./dist/index.cjs",
@@ -20,7 +20,7 @@
20
20
  "./package.json": "./package.json"
21
21
  },
22
22
  "sideEffects": false,
23
- "homepage": "https://github.com/kaokei/use-vue-service",
23
+ "homepage": "https://use-vue-service.kaokei.com/",
24
24
  "author": "kaokei",
25
25
  "license": "MIT",
26
26
  "bugs": {
@@ -52,10 +52,10 @@
52
52
  "docs:preview": "vitepress preview docs"
53
53
  },
54
54
  "peerDependencies": {
55
- "@kaokei/di": "^5.0.8"
55
+ "@kaokei/di": "^5.0.9"
56
56
  },
57
57
  "devDependencies": {
58
- "@kaokei/di": "^5.0.8",
58
+ "@kaokei/di": "^5.0.9",
59
59
  "@types/node": "^22.15.17",
60
60
  "@vitejs/plugin-vue": "^6.0.0",
61
61
  "@vitest/coverage-v8": "^3.1.1",