pinia-plugin-subscription 1.0.0-beta.14 → 1.0.0-beta.15

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +21 -16
  2. package/CONTRIBUTING.md +10 -1
  3. package/README.md +11 -20
  4. package/SECURITY.md +2 -2
  5. package/dist/chunks/PluginSubscription-GJDsym1O.js +668 -0
  6. package/dist/core/PluginSubscriber.d.ts +1 -1
  7. package/dist/core/Store.d.ts +1 -1
  8. package/dist/helpers/index.d.ts +1 -5
  9. package/dist/helpers.js +42 -49
  10. package/dist/pinia-plugin-subscription.js +18 -45
  11. package/dist/system/TraceEmitter.d.ts +1 -2
  12. package/dist/types/index.d.ts +1 -2
  13. package/dist/types/plugin.d.ts +2 -9
  14. package/dist/types/trace.d.ts +18 -155
  15. package/dist/utils/constants.d.ts +1 -2
  16. package/dist/utils/traceGroups.d.ts +0 -2
  17. package/docs/authoring-plugins.md +12 -6
  18. package/docs/using-plugins.md +11 -7
  19. package/package.json +8 -11
  20. package/dist/chunks/trace-registry-Cm_2un0x.js +0 -1009
  21. package/dist/chunks/trace-registry-Cm_2un0x.js.map +0 -1
  22. package/dist/chunks/traceGroups-DfxYkUpm.js +0 -105
  23. package/dist/chunks/traceGroups-DfxYkUpm.js.map +0 -1
  24. package/dist/devtools/components.d.ts +0 -40
  25. package/dist/devtools/index.d.ts +0 -9
  26. package/dist/devtools/model.d.ts +0 -17
  27. package/dist/devtools/styles.d.ts +0 -1
  28. package/dist/devtools.js +0 -377
  29. package/dist/devtools.js.map +0 -1
  30. package/dist/factories/trace-listener.d.ts +0 -9
  31. package/dist/factories/trace-registry.d.ts +0 -2
  32. package/dist/helpers.js.map +0 -1
  33. package/dist/pinia-plugin-subscription.js.map +0 -1
  34. package/dist/system/TraceJournal.d.ts +0 -6
  35. package/dist/system/Tracer.d.ts +0 -27
  36. package/dist/tests/defineAStore.test-d.d.ts +0 -1
  37. package/dist/tests/storeOptionsExtensions.test-d.d.ts +0 -12
  38. package/dist/types/devtools.d.ts +0 -60
  39. package/dist/utils/environment.d.ts +0 -7
  40. package/dist/utils/redact.d.ts +0 -15
  41. package/dist/utils/toSerializable.d.ts +0 -10
  42. package/dist/utils/traceContext.d.ts +0 -7
  43. package/docs/tracing.md +0 -276
package/CHANGELOG.md CHANGED
@@ -8,44 +8,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
  ## [Unreleased]
9
9
 
10
10
  ### Added
11
- - `addScopesListener(scopes, context?, handler?)` accepts a custom trace handler; custom `handler` / `filter` listeners are the supported way to consume trace events, documented in `docs/tracing.md`
12
- - `createPlugin(subscribers, { devtools: true })` automatically creates a redacting trace journal (or reuses the supplied registry journal), imports a conventional SSR snapshot, and dynamically mounts the in-page panel in development browsers; supports devtools options and is documented in `README.md` and `docs/tracing.md`
13
- - `pinia-plugin-subscription/devtools`: `mountTraceDevtools(registry, options?)` mounts an in-page aside (Vue, Shadow DOM) reading the journal: per-store timeline with events grouped by action, client and server interleaved, filters, expandable payloads, and a Context tab; documented in `docs/tracing.md`
14
- - `journal.serialize()` / `journal.import()` and `stringifyTraceSnapshot()` (helpers) to carry server traces to the browser; payloads are bounded and made JSON-safe by `toSerializable`, imports are validated. The SSR demo embeds the server journal in the page and loads it through `createPlugin()` without handling it from the main module
15
- - `createTracerRegistry({ journal, side })`: opt-in per-store journal (`registry.journal`) recording every trace event with `seq`, `side` and the `actionId` correlating the events of one store action; ring buffer per store and side (default 1000, context and error events kept separately), `getEvents()`, `getScopes()`, `getDropped()`, `subscribe()`, `clear()`; documented in `docs/tracing.md`
11
+ - `pinia-plugin-subscription-devtools` package with `createTraceDevtools(options?)`, `createTracerRegistry()`, `mountTraceDevtools()` and the tracing documentation (`packages/devtools/docs/tracing.md`).
12
+ - `addScopesListener(scopes, context?, handler?)` groups events from selected store scopes and accepts a custom trace handler; custom `handler` / `filter` listeners are the supported way to consume trace events, documented in `packages/devtools/docs/tracing.md`
13
+ - `journal.serialize()` / `journal.import()` and `stringifyTraceSnapshot()` to carry server traces to the browser; payloads are bounded and made JSON-safe by `toSerializable`, imports are validated. The SSR demo embeds the server journal in the page and loads it through `createTraceDevtools()`
14
+ - `pinia-plugin-subscription-devtools`: `createTracerRegistry({ journal, side })` enables a per-store journal (`registry.journal`) recording every trace event with `seq`, `side` and the `actionId` correlating the events of one store action; ring buffer per store and side (default 1000, context and error events kept separately), `getEvents()`, `getScopes()`, `getDropped()`, `subscribe()`, `clear()`; documented in `packages/devtools/docs/tracing.md`
16
15
  - SSR demo subscribers are now class-based (`PluginSubscriber` + a `Store` subclass) and emit traces through the tracer `PluginSubscription` provides (`this.trace()` / `this.traceError()`): hydration start/done, errors, and the `onMutation` trace group, all scoped to the store; the per-request tracer registry also listens on the server, so server traces print in the Node terminal and browser traces in the devtools console
17
16
  - SSR demo shows a concrete case of environment-aware hydration: one store filled by a server-only subscriber (request data) and a client-only deferred subscriber (browser data), with a server/browser panel layout and a hydration timeline; the `Accept-Language` header is validated before being serialized
18
17
  - Added a Vite SSR demo server (`npm run dev:ssr`) with per-request app/plugin instances, async server-side subscriber hydration, and Pinia state serialization for client hydration
19
18
  - Demo: `defineAStoreCtx` enhanced-store example; the demo app now resolves the package to `src/` through Vite aliases (no build needed)
20
19
  - Added `pinia-plugin-subscription` to the package `keywords`
21
- - Added `addScopesListener(scopes, context?)` to `createTracerRegistry()` for grouping events from selected store scopes; documented in `docs/tracing.md`
22
20
  - `traceGroups` glossary, exported from `pinia-plugin-subscription/helpers`, building the `groupId` emitted by `PluginSubscription` (`onActionAfter`, `onActionError`, `onMutation`, `reset`); documented in `docs/tracing.md`
23
21
  - `createPluginSubscriber(name, invoke, optionalProps?)` factory, exported from `pinia-plugin-subscription/helpers`, to build plain-object subscribers; documented in `docs/authoring-plugins.md` and used by the demo plugin
24
22
  - Added a dedicated tracing guide, `docs/tracing.md`; the README now only presents tracing and links to it
25
23
  - Moved the API reference, import subpaths, development, `Store` summary and testing sections from `README.md` to `docs/authoring-plugins.md`
26
- - `createTracerRegistry({ redact })`: opt-in redaction of event payloads before they reach listeners. `true` masks a default list of sensitive keys (`password`, `token`, `secret`, `authorization`, API/private keys, `credential`, `cookie`, `cipher`...); an object adds custom `keys`, a `replacement`, or drops the defaults with `includeDefaults: false`. It works on a copy, covers arrays/`Map`/`Set`, handles circular references, and replaces the payload by `__traceRedactionError` if redaction fails. `defaultRedactedKeys` and `TraceRedactOptions` are exported
27
- - `createTracerRegistry({ enabled })`: tracing is now disabled by default in production builds (`process.env.NODE_ENV === 'production'`); `addListener()` becomes a no-op unless `enabled: true` is passed. `enabled: false` forces it off in any environment. Error reporting through `console.error` is unchanged
28
- - Added `createTracerRegistry()` to create isolated trace listeners and tracers for each application or Pinia instance
29
- - Added the `Tracer` class and registry methods `addTraceListener()`, `clearTraceListeners()` and `hasTraceListeners()`
30
- - Added metadata-based trace filter criteria with `equals`, `contains`, `startsWith` and `endsWith` comparators, combined with `every` or `some`
24
+ - `pinia-plugin-subscription-devtools`: `createTracerRegistry({ redact })` opts into redaction of event payloads before they reach listeners. `true` masks a default list of sensitive keys (`password`, `token`, `secret`, `authorization`, API/private keys, `credential`, `cookie`, `cipher`...); an object adds custom `keys`, a `replacement`, or drops the defaults with `includeDefaults: false`. It works on a copy, covers arrays/`Map`/`Set`, handles circular references, and replaces the payload by `__traceRedactionError` if redaction fails. `defaultRedactedKeys` and `TraceRedactOptions` are exported
25
+ - `createTracerRegistry({ enabled })` in `pinia-plugin-subscription-devtools`: tracing is now disabled by default in production builds (`process.env.NODE_ENV === 'production'`); `addListener()` becomes a no-op unless `enabled: true` is passed. `enabled: false` forces it off in any environment. Error reporting through `console.error` is unchanged
26
+ - `pinia-plugin-subscription-devtools`: added `createTracerRegistry()` to create isolated trace listeners and tracers for each application or Pinia instance
27
+ - `pinia-plugin-subscription-devtools`: added the `Tracer` class and registry methods `addTraceListener()`, `clearTraceListeners()` and `hasTraceListeners()`
28
+ - `pinia-plugin-subscription-devtools`: added metadata-based trace filter criteria with `equals`, `contains`, `startsWith` and `endsWith` comparators, combined with `every` or `some`
31
29
  - Added `trace()` and `traceError()` to `Store` and `PluginSubscription`
32
- - Added trace types: `TraceEvent`, `TraceEventMetadata`, `TraceFilter`, `TraceHandler`, `TraceLevel`, `TraceListener`, `TraceListenerRemover`, `TracePayload`, `TracerOptions`
30
+ - Added trace types: `TraceEvent`, `TraceEventMetadata`, `TraceHandler`, `TraceLevel`, `TraceListener`, `TraceListenerRemover` and `TracePayload`
33
31
  - Added `check:leaks` script and `scripts/check-dist-leaks.mjs`, guarding published artifacts against non-peer dependency imports in `dist/` (`.js` and `.d.ts`)
34
32
  - Added the leak guard to `npm run build` and to the CI workflow
35
33
  - Added unit tests covering the tracing system and the leak detection logic
36
34
 
37
35
  ### Changed
36
+ - Devtools: refs and computed attached to a trace are now displayed through their value instead of as raw objects (`toSerializable` unwraps them)
38
37
  - **Breaking:** removed the built-in console output of traces (`createConsoleGroupTraceListener`, `ConsoleTraceGroupListener`, `TraceGroupListener`, `TraceListenerGroupBy`, the `groupBy` option of `addListener()`, and the internal console printers). Listeners now only forward events to their own `handler` (a no-op when omitted); `startGroup` / `closeGroup` only maintain the open-group stack that sets `groupId`. Fixed `tracerHandler.journal` not being exposed by the registry
39
38
  - Trace groups follow the lifecycles of a store: `groupId` is now a `/` separated path (`<storeId>/plugin`, `<storeId>/onAction:<name>#<n>`, with `/after` and `/onError` sub-groups, `<storeId>/onMutation#<n>`, `<storeId>/reset#<n>`, `<storeId>/plugin/deferred:<subscriber>#<n>`). Every trace emitted for a store while a group is open, including those of subscribers and `Store` subclasses, joins the innermost one. `traceGroups` builders take the call counter; `TraceGroupId` is removed, and `groupId` is lifted from the payload to the event like `actionId`
40
39
  - Devtools: the timeline nests events by lifecycle instead of by raw `actionId` (no more `#<n>` ids), events without `error` / `payload` are no longer expandable, `P` (payload) and `E` (error) chips flag the events carrying them, the floating button reads `Devtools` with a debug icon, and the Context tab lists subscribers by name (with their execution options) and shows options without `actions`
41
- - Console trace groups now prefer `payload.groupId` over the configured `groupBy` key; events sharing a key across overlapping groups are buffered until all those groups close, while events without an open group are printed immediately. See `docs/tracing.md`
42
40
  - `storeMutationSubscription` now supports several subscribers per store, like `storeOnActionSubscription`: a single `$subscribe` is registered per store and dispatches to every callback. A failing callback is reported through `traceError` without blocking the others, subscriber names are tracked, and the hook is unsubscribed when the store is disposed
43
41
  - `storeOnActionSubscription` now receives the Pinia plugin context; action trace labels include the invoked action name
44
42
  - Subscribers deferred with `hydration: 'defer'` now run inside their own trace group (label `subscriber:deferred`, keyed by store scope), which stays open until their asynchronous `hydrate()` / `afterHydration()` settle, so their traces are no longer emitted outside any group once `plugin()` has closed its `context` group. A hydration that never settles can no longer buffer the store's traces forever: the group is force-closed after `deferredTraceGroupTimeout` ms (new option, default 2500) and a `subscriber:deferred:timeout` error is traced
45
43
  - Moved the demo application from `src/demo/` to the repository-level `demo/` directory, separating example code from the library source and tracking the demo files in version control.
46
44
  - Clarified that SSR tracing registries and plugin instances must be created per request, and added coverage for listener isolation between registries
47
45
  - Replaced the `Debug` abstract class with composition: `Store` and `PluginSubscription` no longer extend it and now own a `Tracer`
48
- - `createPlugin()` accepts `PluginSubscriptionOptions`, including a `createTracer` factory to connect a tracer registry to plugin and store trace events
49
46
  - Trace errors with no matching listener, and failures in listener filters or handlers, are now reported with `console.error` instead of rethrowing the original error
50
47
  - Deprecated `createHydrationPlugin()` in favor of `createPlugin()` with hydration options
51
48
  - Trace payloads are now lazily resolved, so unobserved tracing no longer builds log arguments
@@ -58,6 +55,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
58
55
  - `Tracer` listener matching no longer allocates intermediate arrays beyond the matched set, and duplicated unhandled-error reporting was factored out
59
56
  - The `pluginsubscription` namespace prefix is now a shared constant (`pluginSubscriptionNamespace`) instead of a hard-coded string
60
57
 
58
+ ### Changed (breaking)
59
+ - The tracing solution moved to the new `pinia-plugin-subscription-devtools` package (`packages/devtools/`, same repository). `pinia-plugin-subscription` now only emits trace events through the `Tracer` / `TracerHandler` contract exported from `pinia-plugin-subscription/types`; without a `tracerHandler` it emits nothing. The compressed package drops from about 117 kB to about 50 kB, and the new package weighs about 19 kB.
60
+ - `createTracerRegistry`, `Tracer` (class), `defaultRedactedKeys`, `stringifyTraceSnapshot`, `getTraceGroupName` and `mountTraceDevtools` are now exported by `pinia-plugin-subscription-devtools` instead of `pinia-plugin-subscription/helpers` and `pinia-plugin-subscription/devtools`. `traceGroups` stays in `pinia-plugin-subscription/helpers`.
61
+ - The `Tracer` export of `pinia-plugin-subscription/helpers` is now the `Tracer` interface of `pinia-plugin-subscription/types`.
62
+ - `TracerHandler.createTracer(source)` no longer takes options, and `TracerHandler` no longer exposes `journal`; the registry's handler of the devtools package does.
63
+ - Source maps are no longer published.
64
+
61
65
  ### Documentation
62
66
  - Added `demo/README.md` mapping each use case to its demo files and docs; documented the `pinia-plugin-subscription` topic in the Ecosystem section
63
67
  - Reference implementation section lists the demo files and what each one illustrates; README links the demo and the `pinia-plugin-subscription` topic
@@ -77,7 +81,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
81
  - Subscriber, subscription, action and rollback tracking keys now encode store IDs and names without delimiter collisions; disposing a store removes only its own tracking entries
78
82
  - Trace groups opened by `onAction`, `$subscribe` and `$reset` are now always closed (also when the action fails or a callback throws), so grouped events no longer stay buffered forever
79
83
  - Listener definitions passed to `addListener()` are no longer mutated when their `filter` is an array of criteria
80
- - `TracerHandler` and `TraceRegistry` types now match the implementation (`createTracer(source, options?)`, `void` group callbacks, `addListener()` with options, `tracerHandler`); `createTracerRegistry()` is explicitly typed as `TraceRegistry`
81
84
  - `CustomConsole.rebuildArgs()` no longer returns `undefined` for unsupported argument types
82
85
  - `clearTraceListeners()` now empties the shared listener list in place, so tracers created before the call stop delivering to cleared listeners and see listeners registered afterwards
83
86
 
@@ -89,7 +92,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
89
92
  - **Breaking:** removed the legacy `debug` and `console` accessors from `Store` and `PluginSubscription`
90
93
  - Removed the internal `src/system/Debug.ts` abstract class (was never publicly exported)
91
94
  - **Breaking:** replaced module-global trace-listener functions with methods on a `createTracerRegistry()` instance
92
- - Removed Performance monitoring utilities.
95
+ - Removed Performance monitoring utilities
96
+ - The `devtools` option of `createPlugin()` and the `pinia-plugin-subscription/devtools` entry point; install `pinia-plugin-subscription-devtools` and use `createTraceDevtools()` with `tracerHandler: registry.tracerHandler`
97
+ - Types `TraceFilter`, `TraceJournal`, `TraceRegistry`, `TracerOptions`, `TracerRegistryOptions` and the other registry types from `pinia-plugin-subscription/types`; they are exported by `pinia-plugin-subscription-devtools`
93
98
 
94
99
  ## [0.2.1]
95
100
 
package/CONTRIBUTING.md CHANGED
@@ -23,6 +23,15 @@ Please be respectful and constructive in all interactions with other contributor
23
23
  git checkout -b feature/your-feature-name
24
24
  ```
25
25
 
26
+ ## Repository Layout
27
+
28
+ This repository is an npm workspace with two published packages:
29
+
30
+ - `pinia-plugin-subscription` (repository root, `src/`): the plugin. It only *emits* trace events through the `TracerHandler` contract (`src/types/trace.ts`) and must never import the devtools package.
31
+ - `pinia-plugin-subscription-devtools` (`packages/devtools/`): consumes trace events (registry, journal, redaction, in-page panel). It depends on the plugin through types only.
32
+
33
+ Core tests use the in-memory tracer in `src/tests/support/testTracer.ts`; end-to-end tracing tests live in `packages/devtools/src/tests/`.
34
+
26
35
  ## Development Workflow
27
36
 
28
37
  ### Running Tests
@@ -36,7 +45,7 @@ npm run coverage # Generate coverage report
36
45
  ### Building
37
46
 
38
47
  ```bash
39
- npm run build # Run tests, build, and generate types
48
+ npm run build # Run tests, then build and check both packages
40
49
  ```
41
50
 
42
51
  ### Preview Changes
package/README.md CHANGED
@@ -35,7 +35,7 @@ The package serves two audiences:
35
35
  | --- | --- |
36
36
  | Use a compatible plugin (e.g. `pinia-plugin-extending-store`, `pinia-plugin-persist-state`) or this package's built-in store features (`defineAStore`, `$reset`, state rollback) in your app | [Using compatible plugins](docs/using-plugins.md) |
37
37
  | Build your own pinia plugin on top of `pinia-plugin-subscription` (API reference, `Store` class, import subpaths, development and testing) | [Plugin authoring guide](docs/authoring-plugins.md) |
38
- | Debug stores and plugins with structured trace events | [Tracing](docs/tracing.md) |
38
+ | Debug stores and plugins with structured trace events | [Tracing](packages/devtools/docs/tracing.md) |
39
39
 
40
40
  A runnable example lives in [`demo/`](demo/) (`npm run dev` for SPA mode or `npm run dev:ssr` for Vite SSR). The SSR example hydrates **one store from two environments**: a server-only subscriber loads request data (awaited before rendering and serializing Pinia state) and a client-only, deferred subscriber fills browser data after hydration, with a visual timeline; see the [reference implementation](docs/authoring-plugins.md#reference-implementation). Plugins built on this package are discoverable through the [`pinia-plugin-subscription` GitHub topic](https://github.com/topics/pinia-plugin-subscription).
41
41
 
@@ -65,38 +65,29 @@ app.mount('#app')
65
65
 
66
66
  ## Advanced Features
67
67
 
68
- - **Structured tracing:** Subscribe to typed trace events and filter them at runtime, per store or per namespace, and consume them with your own `handler` — see [Tracing](#tracing).
69
- - **Scope-based trace listeners:** Use `addScopesListener(scopes, context?, handler?)` to receive events from selected stores — see [Tracing](docs/tracing.md#filtering-events).
70
- - **Trace journal:** `createTracerRegistry({ journal: true })` records every event per store (with `actionId`, `seq` and `side`) so a store trace can be read back at any time — see [Tracing](docs/tracing.md#journal).
71
- - **In-page trace panel:** enable it with `createPlugin(subscribers, { devtools: true })` in development, or mount it manually with `mountTraceDevtools()` (from `pinia-plugin-subscription/devtools`) — see [Tracing](docs/tracing.md#in-page-trace-panel).
68
+ - **Structured tracing:** the plugin and `Store` emit typed trace events through an optional `tracerHandler`. Tracing itself (listeners, journal, redaction, in-page panel) lives in the separate [`pinia-plugin-subscription-devtools`](packages/devtools/) package, so apps that do not debug stay lean — see [Tracing](#tracing).
72
69
  - **Reset callbacks:** Define `resetStoreCallback` to run custom logic when a store is reset.
73
70
  - **SSR and hydration control:** Configure whether each subscribed plugin runs on the server, the client, or only after client hydration.
74
71
  - **Lifecycle safety:** Internal hydration ordering is now guarded so `hydrate()` completes before `afterHydration()` and disposed stores do not retain stale subscriber metadata.
75
72
 
76
73
  ## Tracing
77
74
 
78
- A built-in, opt-in debugging solution: plugins and stores emit structured trace events that you select with filters, optionally redact, and consume with your own handler (or inspect in the devtools panel). The package no longer prints traces to the console itself. It is disabled by default in production builds and costs nothing when unused.
75
+ The plugin only *emits* structured trace events; without a `tracerHandler` it emits nothing and costs nothing. Install [`pinia-plugin-subscription-devtools`](packages/devtools/) (usually as a development dependency) to consume them with filtered listeners, a per-store journal, payload redaction and an in-page panel:
76
+
77
+ ```bash
78
+ npm install -D pinia-plugin-subscription-devtools
79
+ ```
79
80
 
80
81
  ```ts
81
82
  import { createPlugin } from 'pinia-plugin-subscription'
82
- import { createTracerRegistry } from 'pinia-plugin-subscription/helpers'
83
+ import { createTraceDevtools } from 'pinia-plugin-subscription-devtools'
83
84
 
84
- const registry = createTracerRegistry({ redact: true })
85
- registry.addListener({
86
- filter: [{ target: 'scope', value: 'cart' }],
87
- handler: event => console.log(event.label, event.payload)
88
- })
85
+ const { registry } = createTraceDevtools() // mounts the in-page panel in development browsers
89
86
 
90
87
  pinia.use(createPlugin(subscribers, { tracerHandler: registry.tracerHandler }))
91
88
  ```
92
89
 
93
- See the [Tracing documentation](docs/tracing.md) for filtering, redaction, production safety, event shape and error reporting.
94
-
95
- For a development-only in-page trace panel, no separate registry or devtools import is needed. If the page contains a JSON script with the default ID `pinia-traces`, its SSR journal snapshot is imported automatically:
96
-
97
- ```ts
98
- pinia.use(createPlugin(subscribers, { devtools: true }))
99
- ```
90
+ See the [Tracing documentation](packages/devtools/docs/tracing.md) for filtering, redaction, production safety, event shape and error reporting. Plugin authors only need the `Tracer` and `TracerHandler` types from `pinia-plugin-subscription/types`, and `createTracer` / `this.trace()` to emit events.
100
91
 
101
92
  ## License
102
93
 
@@ -104,4 +95,4 @@ MIT
104
95
 
105
96
  ## Publishing
106
97
 
107
- Releases are published to npm via GitHub Actions. GitHub releases marked as pre-releases are published with the `beta` dist-tag using `npm publish --tag beta`; stable releases use the default `latest` tag. The workflow uses npm provenance for better supply-chain security and requires a `NPM_TOKEN` secret in the repository settings.
98
+ Both packages (`pinia-plugin-subscription` and `pinia-plugin-subscription-devtools`) are published to npm via GitHub Actions on the same release. GitHub releases marked as pre-releases are published with the `beta` dist-tag using `npm publish --tag beta`; stable releases use the default `latest` tag. The workflow uses npm provenance for better supply-chain security and requires a `NPM_TOKEN` secret in the repository settings.
package/SECURITY.md CHANGED
@@ -38,7 +38,7 @@ When using pinia-plugin-subscription:
38
38
 
39
39
  ### Tracing and Production Logging
40
40
 
41
- Normal trace events are opt-in: the plugin requires an explicitly configured `tracerHandler` and matching listeners to deliver them. `createTracerRegistry()` ignores `addListener()` in production builds (`process.env.NODE_ENV === 'production'`) unless `createTracerRegistry({ enabled: true })` is passed. This guard relies on the consuming bundler replacing `process.env.NODE_ENV`; without it, tracing is considered enabled. Production tracing can be useful for incident diagnosis, but should only be enabled deliberately and with controlled access to its output.
41
+ Tracing is provided by the separate `pinia-plugin-subscription-devtools` package. Normal trace events are opt-in: the plugin requires an explicitly configured `tracerHandler` and matching listeners to deliver them. `createTracerRegistry()` ignores `addListener()` in production builds (`process.env.NODE_ENV === 'production'`) unless `createTracerRegistry({ enabled: true })` is passed. This guard relies on the consuming bundler replacing `process.env.NODE_ENV`; without it, tracing is considered enabled. Production tracing can be useful for incident diagnosis, but should only be enabled deliberately and with controlled access to its output.
42
42
 
43
43
  Trace events are not redacted by default. Depending on the event, they may contain action arguments, store state, mutations, plugin options, subscriptions, or error details. These values can include application secrets or personal data. `createTracerRegistry({ redact: true })` masks values stored under sensitive keys (passwords, tokens, secrets, authorization, API keys, cookies...) before any listener receives them, but it inspects keys only: it does not detect secrets under innocuous keys, and it does not redact `event.error`. A listener can expose them through the browser console, server logs, or an external logging service. The absence of a production block is not, by itself, a vulnerability; the disclosure risk depends on the data emitted, the logging destination, and who can access it.
44
44
 
@@ -53,7 +53,7 @@ When configuring tracing:
53
53
 
54
54
  For production, handle error events with a matching listener that reports only sanitized details, and ensure listener filters and handlers do not throw sensitive errors. Review the application's console and error logging policy as well; do not silently discard operational errors to prevent disclosure.
55
55
 
56
- See [Tracing](./docs/tracing.md) for configuration and event details.
56
+ See [Tracing](./packages/devtools/docs/tracing.md) for configuration and event details.
57
57
 
58
58
  ## Dependencies Security
59
59