@nanostores/logger 0.2.2 → 0.2.4

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.
@@ -1,18 +1,13 @@
1
1
  import type { AnyStore, MapStore } from 'nanostores'
2
2
 
3
- import type {
4
- LoggerOptions,
5
- LoggerOptionsMessages
6
- } from '../build-logger/index.js'
7
-
8
- interface CreatorLoggerOptionsMessages extends LoggerOptionsMessages {
3
+ interface CreatorLoggerOptionsMessages {
9
4
  /**
10
5
  * Disable build logs.
11
6
  */
12
7
  build?: boolean
13
8
  }
14
9
 
15
- export interface CreatorLoggerOptions extends LoggerOptions {
10
+ export interface CreatorLoggerOptions {
16
11
  messages?: CreatorLoggerOptionsMessages
17
12
 
18
13
  /**
@@ -22,17 +17,17 @@ export interface CreatorLoggerOptions extends LoggerOptions {
22
17
  * @param store Store built by the creator.
23
18
  * @returns Custom store name.
24
19
  */
25
- nameGetter: (creatorName: string, store: MapStore) => string
20
+ nameGetter?: (creatorName: string, store: MapStore) => string
26
21
  }
27
22
 
28
- interface EventBuildStartPayload {
23
+ interface EventBuildPayload {
29
24
  creatorName: string
30
25
  store: MapStore
31
26
  storeName: string
32
27
  }
33
28
 
34
29
  interface BuildCreatorLoggerEvents {
35
- build?: (payload: EventBuildPayloadBase) => void
30
+ build: (payload: EventBuildPayload) => void
36
31
  }
37
32
 
38
33
  /**
@@ -58,5 +53,5 @@ export function buildCreatorLogger(
58
53
  store: AnyStore,
59
54
  storeName: string,
60
55
  events: BuildCreatorLoggerEvents,
61
- opts?: LoggerOptions
56
+ opts?: CreatorLoggerOptions
62
57
  ): () => void
@@ -1,6 +1,6 @@
1
1
  import type { AnyStore, Store, StoreValue } from 'nanostores'
2
2
 
3
- export interface LoggerOptionsMessages {
3
+ interface LoggerOptionsMessages {
4
4
  /**
5
5
  * Disable action logs.
6
6
  */
@@ -1,6 +1,7 @@
1
1
  import type { MapCreator } from 'nanostores'
2
2
 
3
3
  import type { CreatorLoggerOptions } from '../build-creator-logger/index.js'
4
+ import type { LoggerOptions } from '../build-logger/index.js'
4
5
 
5
6
  /**
6
7
  * Displays Nano Stores events in browser console.
@@ -10,5 +11,5 @@ import type { CreatorLoggerOptions } from '../build-creator-logger/index.js'
10
11
  */
11
12
  export function creatorLogger(
12
13
  creators: { [key: string]: MapCreator },
13
- opts?: CreatorLoggerOptions
14
+ opts?: CreatorLoggerOptions & LoggerOptions
14
15
  ): () => void
package/index.d.ts CHANGED
@@ -1,5 +1,8 @@
1
- export { buildCreatorLogger } from './build-creator-logger/index.js'
2
- export { buildLogger } from './build-logger/index.js'
1
+ export {
2
+ buildCreatorLogger,
3
+ CreatorLoggerOptions
4
+ } from './build-creator-logger/index.js'
5
+ export { buildLogger, LoggerOptions } from './build-logger/index.js'
3
6
  export { creatorLogger } from './creator-logger/index.js'
4
7
  export { logger } from './logger/index.js'
5
8
  export { group, groupEnd, log } from './printer/index.js'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanostores/logger",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Pretty logger of lifecycles, changes and actions for Nano Stores",
5
5
  "keywords": [
6
6
  "nanostores",