@molecule/api-error-tracking-console 1.0.0 → 1.0.1
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 +94 -0
- package/package.json +5 -4
package/README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
3
|
+
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
|
+
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
|
+
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
+
Generated: 2026-08-04T01:48:09.433Z
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
# @molecule/api-error-tracking-console
|
|
10
|
+
|
|
11
|
+
> **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
|
|
12
|
+
> It is written to be read by coding agents as much as by people, and is generated from this
|
|
13
|
+
> package's source — edit `src/index.ts` JSDoc, not this file.
|
|
14
|
+
|
|
15
|
+
Console (logger-based) error tracking provider for molecule.dev.
|
|
16
|
+
|
|
17
|
+
Zero-credential development default: captures are written as structured
|
|
18
|
+
log lines through the bonded logger instead of being sent to a remote
|
|
19
|
+
service. Swap in a remote bond (e.g. `@molecule/api-error-tracking-sentry`)
|
|
20
|
+
for production without changing any consumer code.
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { setProvider, captureException } from '@molecule/api-error-tracking'
|
|
26
|
+
import { provider } from '@molecule/api-error-tracking-console'
|
|
27
|
+
|
|
28
|
+
// Bond at startup (e.g. in setupBonds()) — no credentials needed
|
|
29
|
+
setProvider(provider)
|
|
30
|
+
|
|
31
|
+
// Logs a structured "error-tracking: exception captured" line
|
|
32
|
+
captureException(new Error('boom'), { tags: { source: 'worker' } })
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Type
|
|
36
|
+
|
|
37
|
+
`provider`
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install @molecule/api-error-tracking-console @molecule/api-bond @molecule/api-error-tracking
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## API
|
|
46
|
+
|
|
47
|
+
### Constants
|
|
48
|
+
|
|
49
|
+
#### `provider`
|
|
50
|
+
|
|
51
|
+
Console error tracking provider. Logs structured captures through the
|
|
52
|
+
bonded logger and reports a generated event id, mirroring the remote
|
|
53
|
+
providers' behavior so app code works identically in development.
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
const provider: ErrorTrackingProvider
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Core Interface
|
|
60
|
+
|
|
61
|
+
Implements `@molecule/api-error-tracking` interface.
|
|
62
|
+
|
|
63
|
+
## Bond Wiring
|
|
64
|
+
|
|
65
|
+
Setup function to register this provider with the core interface:
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
import { setProvider } from '@molecule/api-error-tracking'
|
|
69
|
+
import { provider } from '@molecule/api-error-tracking-console'
|
|
70
|
+
|
|
71
|
+
export function setupErrorTrackingConsole(): void {
|
|
72
|
+
setProvider(provider)
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Injection Notes
|
|
77
|
+
|
|
78
|
+
### Requirements
|
|
79
|
+
|
|
80
|
+
Peer dependencies:
|
|
81
|
+
|
|
82
|
+
- `@molecule/api-bond` ^1.0.1
|
|
83
|
+
- `@molecule/api-error-tracking` ^1.0.1
|
|
84
|
+
|
|
85
|
+
### Runtime Dependencies
|
|
86
|
+
|
|
87
|
+
- `@molecule/api-bond`
|
|
88
|
+
- `@molecule/api-error-tracking`
|
|
89
|
+
|
|
90
|
+
- Requires no configuration or credentials — safe in every environment.
|
|
91
|
+
- Each capture gets a generated event id (returned and logged), mirroring
|
|
92
|
+
remote providers so consumer code behaves identically in development.
|
|
93
|
+
- `setUser()` scopes subsequent captures like a remote provider's user
|
|
94
|
+
scope; `flush()` trivially resolves `true` (nothing is buffered).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/api-error-tracking-console",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Console (logger-based) error tracking provider for molecule.dev — zero-credential development default.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
20
|
-
"dist"
|
|
20
|
+
"dist",
|
|
21
|
+
"README.md"
|
|
21
22
|
],
|
|
22
23
|
"keywords": [
|
|
23
24
|
"molecule",
|
|
@@ -32,8 +33,8 @@
|
|
|
32
33
|
"vitest": "4.1.10"
|
|
33
34
|
},
|
|
34
35
|
"peerDependencies": {
|
|
35
|
-
"@molecule/api-bond": "^1.0.
|
|
36
|
-
"@molecule/api-error-tracking": "^1.0.
|
|
36
|
+
"@molecule/api-bond": "^1.0.1",
|
|
37
|
+
"@molecule/api-error-tracking": "^1.0.1"
|
|
37
38
|
},
|
|
38
39
|
"repository": {
|
|
39
40
|
"type": "git",
|