@stravigor/devtools 0.4.5 → 0.4.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stravigor/devtools",
3
- "version": "0.4.5",
3
+ "version": "0.4.7",
4
4
  "type": "module",
5
5
  "description": "Debug inspector and performance monitor for the Strav framework",
6
6
  "license": "MIT",
@@ -18,7 +18,7 @@
18
18
  "tsconfig.json"
19
19
  ],
20
20
  "peerDependencies": {
21
- "@stravigor/core": "0.4.4"
21
+ "@stravigor/core": "0.4.5"
22
22
  },
23
23
  "scripts": {
24
24
  "test": "bun test tests/",
@@ -16,9 +16,11 @@ export default class JobCollector extends Collector {
16
16
  private dispatchedListener: Listener | null = null
17
17
  private processedListener: Listener | null = null
18
18
  private failedListener: Listener | null = null
19
+ private getBatchId: () => string
19
20
 
20
- constructor(store: EntryStore, options: CollectorOptions) {
21
+ constructor(store: EntryStore, options: CollectorOptions, getBatchId: () => string) {
21
22
  super(store, options)
23
+ this.getBatchId = getBatchId
22
24
  }
23
25
 
24
26
  register(): void {
@@ -30,7 +32,7 @@ export default class JobCollector extends Collector {
30
32
  queue: string
31
33
  payload: unknown
32
34
  }) => {
33
- const batchId = crypto.randomUUID()
35
+ const batchId = this.getBatchId()
34
36
 
35
37
  this.record(
36
38
  'job',
@@ -53,7 +55,7 @@ export default class JobCollector extends Collector {
53
55
  queue: string
54
56
  duration: number
55
57
  }) => {
56
- const batchId = crypto.randomUUID()
58
+ const batchId = this.getBatchId()
57
59
 
58
60
  this.record(
59
61
  'job',
@@ -77,7 +79,7 @@ export default class JobCollector extends Collector {
77
79
  error: string
78
80
  duration: number
79
81
  }) => {
80
- const batchId = crypto.randomUUID()
82
+ const batchId = this.getBatchId()
81
83
 
82
84
  this.record(
83
85
  'job',
@@ -120,7 +120,8 @@ export default class DevtoolsManager {
120
120
 
121
121
  const jobCollector = new JobCollector(
122
122
  DevtoolsManager._entryStore,
123
- DevtoolsManager._config.collectors.job
123
+ DevtoolsManager._config.collectors.job,
124
+ getBatchId
124
125
  )
125
126
 
126
127
  DevtoolsManager._collectors = [