@dasasian/firebase-structured-logger 0.9.0 → 1.1.0

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 (59) hide show
  1. package/README.md +191 -32
  2. package/dist/client/breadcrumbs.d.ts +11 -1
  3. package/dist/client/breadcrumbs.d.ts.map +1 -1
  4. package/dist/client/breadcrumbs.js +18 -0
  5. package/dist/client/breadcrumbs.js.map +1 -1
  6. package/dist/client/index.d.ts +1 -1
  7. package/dist/client/index.d.ts.map +1 -1
  8. package/dist/client/index.js +2 -1
  9. package/dist/client/index.js.map +1 -1
  10. package/dist/client/logger.d.ts +6 -2
  11. package/dist/client/logger.d.ts.map +1 -1
  12. package/dist/client/logger.js +26 -8
  13. package/dist/client/logger.js.map +1 -1
  14. package/dist/client/navigation.d.ts +34 -0
  15. package/dist/client/navigation.d.ts.map +1 -0
  16. package/dist/client/navigation.js +89 -0
  17. package/dist/client/navigation.js.map +1 -0
  18. package/dist/client/rateLimiter.d.ts +12 -5
  19. package/dist/client/rateLimiter.d.ts.map +1 -1
  20. package/dist/client/rateLimiter.js +61 -12
  21. package/dist/client/rateLimiter.js.map +1 -1
  22. package/dist/functions/httpHandler.d.ts +1 -1
  23. package/dist/functions/httpHandler.js +1 -1
  24. package/dist/functions/index.d.ts +1 -1
  25. package/dist/functions/index.d.ts.map +1 -1
  26. package/dist/functions/logHandler.d.ts +10 -5
  27. package/dist/functions/logHandler.d.ts.map +1 -1
  28. package/dist/functions/logHandler.js +16 -5
  29. package/dist/functions/logHandler.js.map +1 -1
  30. package/dist/functions/logger.js +1 -1
  31. package/dist/functions/logger.js.map +1 -1
  32. package/dist/functions/sourceMapCache.js +1 -1
  33. package/dist/functions/sourceMapCache.js.map +1 -1
  34. package/dist/shared/deprecate.d.ts +4 -0
  35. package/dist/shared/deprecate.d.ts.map +1 -0
  36. package/dist/shared/deprecate.js +30 -0
  37. package/dist/shared/deprecate.js.map +1 -0
  38. package/dist/shared/nodeModules.d.ts +39 -0
  39. package/dist/shared/nodeModules.d.ts.map +1 -0
  40. package/dist/shared/nodeModules.js +120 -0
  41. package/dist/shared/nodeModules.js.map +1 -0
  42. package/dist/shared/types.d.ts +17 -0
  43. package/dist/shared/types.d.ts.map +1 -1
  44. package/dist/shared/versionRange.d.ts +17 -0
  45. package/dist/shared/versionRange.d.ts.map +1 -0
  46. package/dist/shared/versionRange.js +48 -0
  47. package/dist/shared/versionRange.js.map +1 -0
  48. package/dist/tools/doctor.d.ts +54 -0
  49. package/dist/tools/doctor.d.ts.map +1 -0
  50. package/dist/tools/doctor.js +381 -0
  51. package/dist/tools/doctor.js.map +1 -0
  52. package/dist/tools/index.js +34 -5
  53. package/dist/tools/index.js.map +1 -1
  54. package/dist/tools/uploadSourceMaps.d.ts +7 -0
  55. package/dist/tools/uploadSourceMaps.d.ts.map +1 -1
  56. package/dist/tools/uploadSourceMaps.js.map +1 -1
  57. package/package.json +18 -11
  58. package/skills/logs/SKILL.md +10 -0
  59. package/skills/query-logs/SKILL.md +18 -1
@@ -170,6 +170,16 @@ bc.nav(screen: string): void // on navigation
170
170
  bc.error(type: string, data?: Record<string, unknown>): void // on errors
171
171
  ```
172
172
 
173
+ Import `enableNavigation` from `firebase-structured-logger/client/navigation`:
174
+ ```ts
175
+ enableNavigation(options?: { routeFor?: (path: string) => string | undefined; cleanPath?: (path: string) => string; path?: false }): void
176
+ ```
177
+ - Call once at startup. Every route change becomes a `nav` breadcrumb, and every entry
178
+ gets `route` (the pattern, `/orders/:id`), `path` (the real path) and `routeSource`.
179
+ - When an app has called it, do not flag a missing `bc.nav` on route changes — it is
180
+ automatic. Suggest it for a single-page app that hand-writes `bc.nav` everywhere.
181
+ - A separate import on purpose: apps that do not use it ship none of it.
182
+
173
183
  Import `sendFeedback` from `firebase-structured-logger/client`:
174
184
  ```ts
175
185
  sendFeedback(text: string, extras?: { labels?: Partial<AppLabels>; attachments?: Record<string, Blob | File | string> }): void
@@ -8,6 +8,20 @@ The `firebase_functions_logs` MCP tool reads from:
8
8
  - **Production**: Google Cloud Logging (default)
9
9
  - **Development**: Local JSONL file when `DEV_LOG_FILE` env var is set in the MCP server
10
10
 
11
+ ## Missing or odd logs? Check the setup first
12
+
13
+ Before reading logs to explain why something is missing — no entries at all, stacks that
14
+ stay minified, no attachments — run the setup check. Most of those failures are silent
15
+ misconfigurations, and doctor reads them straight off disk:
16
+
17
+ ```
18
+ npx fsl doctor --json
19
+ ```
20
+
21
+ `findings` lists anything wrong, each with an `id`, `level` and `fix`; `setup` says how
22
+ logging, trace ids and Storage will behave. An empty `findings` means the setup is not
23
+ the problem, and the answer is in the logs.
24
+
11
25
  ## Queryable Labels
12
26
 
13
27
  All entries written by firebase-structured-logger include these labels:
@@ -16,7 +30,10 @@ All entries written by firebase-structured-logger include these labels:
16
30
  |-------|-------------|
17
31
  | `appId` | Application identifier (e.g. `acme`, `store`) |
18
32
  | `userId` | Firebase Auth UID |
19
- | `screen` | Current screen name |
33
+ | `screen` | Current screen name (falls back to `route` when the app never set one) |
34
+ | `route` | Route pattern, e.g. `/orders/:id/items` — group by this (apps using `enableNavigation`) |
35
+ | `path` | Real path, e.g. `/orders/1042/items` — one specific page or record; query string never stored |
36
+ | `routeSource` | `router` (the app named the route) or `pattern` (ids replaced by rule) |
20
37
  | `releaseId` | Git short hash or explicit release ID |
21
38
  | `platform` | `ios`, `android`, `macos`, `windows`, `web` |
22
39
  | `browser` | `chrome`, `firefox`, `safari`, `edge` |