pinia-plugin-subscription 0.1.7-beta.1 → 0.1.8

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/CHANGELOG.md CHANGED
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.1.8]
9
+
10
+ ### Added
11
+ - Added `onError` parameter to `storeOnActionSubscription` method
12
+ - Added `onError` property to `StoreOnActionCallbackParameters` interface
13
+
14
+ ### Changed
15
+ - Changing the directory structure
16
+
8
17
  ## [0.1.7]
9
18
 
10
19
  ### Changed
@@ -14,7 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
14
23
  - Tightened internal store checks to avoid `hasOwnProperty` collisions.
15
24
  - Reduced library bundle overhead by stripping the Vue plugin from the library build and treeshaking the published bundle more aggressively.
16
25
  - Added additive sub-exports for helper-only imports and a strict type-only public surface to keep the core API stable while improving bundle clarity.
17
- - Added a real bundle-size check command to measure the emitted output before deciding whether a heavier split is justified.
26
+ - Added a real bundle-size check command to measure the emitted output before deciding whether a heavier split is justified : `npm run bundle:check`.
18
27
  - Documented Nuxt / SSR best practices for `hydration: 'defer'`, `runtimeEnvironment`, and browser-only access in hydrated stores.
19
28
 
20
29
  ## [0.1.6]
package/README.md CHANGED
@@ -28,12 +28,6 @@ For type-only imports, prefer the dedicated public types entry:
28
28
  import type { PluginSubscriptionOptions } from 'pinia-plugin-subscription/types'
29
29
  ```
30
30
 
31
- The project also includes a bundle check command to measure the real output size before introducing a heavier split strategy:
32
-
33
- ```bash
34
- npm run bundle:check
35
- ```
36
-
37
31
  ```typescript
38
32
  import { createApp } from 'vue'
39
33
  import { createPinia } from 'pinia'
@@ -251,7 +245,7 @@ An object with at least an `invoke(context: PiniaPluginContext, debug?: boolean)
251
245
 
252
246
  ## The `PluginSubscriber` Abstract Class
253
247
 
254
- The project provides an abstract `PluginSubscriber` implementation (see [src/plugins/pluginSubscriber.ts](src/plugins/pluginSubscriber.ts)) to simplify creating reusable subscribers.
248
+ The project provides an abstract `PluginSubscriber` implementation (see [src/core/PluginSubscriber.ts](src/core/PluginSubscriber.ts)) to simplify creating reusable subscribers.
255
249
 
256
250
  **Typical usage:**
257
251
 
@@ -227,7 +227,7 @@ class P extends C {
227
227
  return new this(e, r, o, i);
228
228
  }
229
229
  hasDeniedFirstChar(e) {
230
- return I(e[0]);
230
+ return I(e);
231
231
  }
232
232
  static hasRequiredKeys(e) {
233
233
  return this._requiredKeys !== void 0 && this._requiredKeys?.every((r) => !!e[r]);
@@ -1,4 +1,4 @@
1
- import Store from "../core/Store";
1
+ import Store from "./Store";
2
2
  import type { PiniaPluginContext, Store as PiniaStore } from "pinia";
3
3
  import type { AnyObject } from "../types";
4
4
  import type { PluginExecutionOptions, PluginHydrationScheduler, PluginSubscriber as PluginSubscriberInterface, PluginSubscriptions, StoreMutationSubscription, StoreOnActionSubscription } from "../types/plugin";
@@ -1,4 +1,4 @@
1
- export { default as PluginSubscriber } from '../plugins/pluginSubscriber';
1
+ export { default as PluginSubscriber } from '../core/PluginSubscriber';
2
2
  export { default as Store } from '../core/Store';
3
3
  export { CustomConsole } from '../system/log';
4
4
  export { isEmpty } from '../utils/validation';
package/dist/helpers.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as a, a as r, S as e, i } from "./chunks/index-ByASkYCc.js";
1
+ import { C as a, a as r, S as e, i } from "./chunks/index-B-zO0yrr.js";
2
2
  export {
3
3
  a as CustomConsole,
4
4
  r as PluginSubscriber,
@@ -1,5 +1,5 @@
1
- import PluginSubscriber from '../plugins/pluginSubscriber';
2
- import PluginSubscription from '../plugins/pluginSubscription';
1
+ import PluginSubscriber from '../core/PluginSubscriber';
2
+ import PluginSubscription from '../core/PluginSubscription';
3
3
  import Store from '../core/Store';
4
4
  export { createPlugin } from "../plugins/createPlugin";
5
5
  export { createHydrationPlugin } from "../plugins/createHydrationPlugin";
@@ -1,8 +1,8 @@
1
1
  var S = Object.defineProperty;
2
2
  var y = (r, o, e) => o in r ? S(r, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[o] = e;
3
3
  var c = (r, o, e) => y(r, typeof o != "symbol" ? o + "" : o, e);
4
- import { D as g, i as l, P as _ } from "./chunks/index-ByASkYCc.js";
5
- import { C as w, p as O, a as j, S as x, d as H, b as K, g as R, c as M, e as L, s as T } from "./chunks/index-ByASkYCc.js";
4
+ import { D as g, i as l, P as _ } from "./chunks/index-B-zO0yrr.js";
5
+ import { C as w, p as O, a as j, S as x, d as H, b as K, g as R, c as M, e as L, s as T } from "./chunks/index-B-zO0yrr.js";
6
6
  const f = "PluginSubscription", m = {
7
7
  environment: "both",
8
8
  hydration: "immediate"
@@ -193,8 +193,8 @@ class p extends g {
193
193
  }
194
194
  storeOnActionSubscription(e) {
195
195
  const { store: i, callback: t } = e();
196
- i.$onAction(({ after: s, args: n, name: d }) => {
197
- this.debugLog(`storeOnActionSubscription ${i.$id}`, { after: s, args: n, name: d, store: i }), t({ after: s, args: n, name: d });
196
+ i.$onAction(({ after: s, args: n, name: d, onError: u }) => {
197
+ this.debugLog(`storeOnActionSubscription ${i.$id}`, { after: s, args: n, name: d, store: i }), t({ after: s, args: n, name: d, onError: u });
198
198
  });
199
199
  }
200
200
  storeMutationSubscription(e) {
@@ -37,6 +37,7 @@ export interface StoreOnActionCallbackParameters {
37
37
  after: Function;
38
38
  args: any[] | object;
39
39
  name: string;
40
+ onError?: Error | unknown;
40
41
  }
41
42
  export interface PluginSubscription {
42
43
  stores?: Store[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinia-plugin-subscription",
3
- "version": "0.1.7-beta.1",
3
+ "version": "0.1.8",
4
4
  "description": "Pinia plugin for Vue.js that helps building Pinia plugins by centralizing subscriber registration and providing a Store base class for store helpers.",
5
5
  "type": "module",
6
6
  "sideEffects": false,