@dasasian/firebase-structured-logger 0.6.0 → 0.8.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 (40) hide show
  1. package/README.md +669 -103
  2. package/dist/client/logger.d.ts.map +1 -1
  3. package/dist/client/logger.js +16 -2
  4. package/dist/client/logger.js.map +1 -1
  5. package/dist/functions/httpHandler.d.ts +89 -0
  6. package/dist/functions/httpHandler.d.ts.map +1 -0
  7. package/dist/functions/httpHandler.js +115 -0
  8. package/dist/functions/httpHandler.js.map +1 -0
  9. package/dist/functions/index.d.ts +5 -2
  10. package/dist/functions/index.d.ts.map +1 -1
  11. package/dist/functions/index.js +6 -1
  12. package/dist/functions/index.js.map +1 -1
  13. package/dist/functions/logHandler.d.ts +55 -3
  14. package/dist/functions/logHandler.d.ts.map +1 -1
  15. package/dist/functions/logHandler.js +51 -8
  16. package/dist/functions/logHandler.js.map +1 -1
  17. package/dist/functions/logger.d.ts +13 -0
  18. package/dist/functions/logger.d.ts.map +1 -1
  19. package/dist/functions/logger.js +128 -14
  20. package/dist/functions/logger.js.map +1 -1
  21. package/dist/functions/sourceMapCache.d.ts +39 -3
  22. package/dist/functions/sourceMapCache.d.ts.map +1 -1
  23. package/dist/functions/sourceMapCache.js +176 -12
  24. package/dist/functions/sourceMapCache.js.map +1 -1
  25. package/dist/functions/traceContext.d.ts +54 -0
  26. package/dist/functions/traceContext.d.ts.map +1 -0
  27. package/dist/functions/traceContext.js +141 -0
  28. package/dist/functions/traceContext.js.map +1 -0
  29. package/dist/shared/paths.d.ts +59 -0
  30. package/dist/shared/paths.d.ts.map +1 -0
  31. package/dist/shared/paths.js +126 -0
  32. package/dist/shared/paths.js.map +1 -0
  33. package/dist/tools/index.js +13 -4
  34. package/dist/tools/index.js.map +1 -1
  35. package/dist/tools/uploadSourceMaps.d.ts +24 -1
  36. package/dist/tools/uploadSourceMaps.d.ts.map +1 -1
  37. package/dist/tools/uploadSourceMaps.js +31 -4
  38. package/dist/tools/uploadSourceMaps.js.map +1 -1
  39. package/package.json +12 -6
  40. package/skills/query-logs/SKILL.md +14 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dasasian/firebase-structured-logger",
3
- "version": "0.6.0",
4
- "description": "Structured logging for Firebase apps — client, functions, and tools",
3
+ "version": "0.8.0",
4
+ "description": "Structured logging for Firebase and Google Cloud web apps — browser, backend, and tools",
5
5
  "license": "MIT",
6
6
  "author": "Dasasian",
7
7
  "keywords": [
@@ -13,7 +13,10 @@
13
13
  "source-maps",
14
14
  "symbolication",
15
15
  "observability",
16
- "typescript"
16
+ "typescript",
17
+ "google-cloud",
18
+ "cloud-run",
19
+ "error-reporting"
17
20
  ],
18
21
  "homepage": "https://dasasian.com/firebase-structured-logger",
19
22
  "repository": {
@@ -64,11 +67,13 @@
64
67
  "build": "tsc",
65
68
  "build:watch": "tsc --watch",
66
69
  "clean": "rm -rf dist",
67
- "typecheck": "tsc --noEmit",
68
- "test": "tsx tests/logger.ts && tsx tests/breadcrumbs.ts && tsx tests/rateLimiter.ts && tsx tests/errorHandler.ts && tsx tests/attachments.ts && tsx tests/feedback.ts && tsx tests/sourceMapStripping.ts && FUNCTIONS_EMULATOR=true tsx tests/errorPayload.ts && FUNCTIONS_EMULATOR=true tsx tests/requestLogger.ts && FUNCTIONS_EMULATOR=true tsx tests/handler.ts && FUNCTIONS_EMULATOR=true tsx tests/symbolication.ts && FUNCTIONS_EMULATOR=true tsx tests/publicApi.ts && FUNCTIONS_EMULATOR=true tsx tests/configureTwice.ts && tsx tests/productionOutput.ts && tsx tests/handlerSymbolication.ts && tsx tests/releaseResolution.ts && tsx tests/sourceMapCacheBounds.ts",
70
+ "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.check.json",
71
+ "test": "tsx tests/logger.ts && tsx tests/browserBundle.ts && tsx tests/breadcrumbs.ts && tsx tests/rateLimiter.ts && tsx tests/errorHandler.ts && tsx tests/attachments.ts && tsx tests/feedback.ts && tsx tests/paths.ts && tsx tests/loadsWithoutOptionalPeers.ts && tsx tests/sourceMapStripping.ts && FUNCTIONS_EMULATOR=true tsx tests/errorPayload.ts && FUNCTIONS_EMULATOR=true tsx tests/requestLogger.ts && FUNCTIONS_EMULATOR=true tsx tests/handler.ts && FUNCTIONS_EMULATOR=true tsx tests/httpHandler.ts && FUNCTIONS_EMULATOR=true tsx tests/symbolication.ts && FUNCTIONS_EMULATOR=true tsx tests/publicApi.ts && FUNCTIONS_EMULATOR=true tsx tests/configureTwice.ts && tsx tests/productionOutput.ts && tsx tests/storageChain.ts && tsx tests/handlerSymbolication.ts && tsx tests/releaseResolution.ts && tsx tests/sourceMapCacheBounds.ts",
69
72
  "prepublishOnly": "npm run clean && npm run build",
70
73
  "smoke:deploy": "cd smoke/functions && npm install && npm run build && cd .. && firebase deploy --only functions --project $(grep '^FSL_SMOKE_PROJECT=' .env.local | cut -d= -f2)",
71
- "smoke": "tsx smoke/run.ts"
74
+ "smoke:deploy:run": "bash smoke/cloudrun/deploy.sh",
75
+ "smoke": "tsx smoke/run.ts",
76
+ "smoke:install": "tsx smoke/install.ts"
72
77
  },
73
78
  "dependencies": {
74
79
  "@google-cloud/storage": "^7.0.0",
@@ -95,6 +100,7 @@
95
100
  "@google-cloud/logging": "^11.4.0",
96
101
  "@types/jsdom": "^30.0.0",
97
102
  "@types/node": "^26.2.0",
103
+ "esbuild": "^0.28.2",
98
104
  "firebase": "^12.0.0",
99
105
  "firebase-admin": "^14.2.0",
100
106
  "firebase-functions": "^7.0.0",
@@ -30,7 +30,20 @@ App-specific labels are defined in each app's `AppLabels` type.
30
30
 
31
31
  ## Common Queries
32
32
 
33
- ### All errors for a user
33
+ ### Everything one user did, in order
34
+ ```
35
+ labels.userId="<uid>"
36
+ ```
37
+ No severity filter. Frontend and backend entries share the `userId` label, so this
38
+ returns both halves interleaved in time order — the clicks and screen changes that
39
+ led up to a failure, the backend call that failed, and the error the browser saw.
40
+ Filtering to `severity=ERROR` keeps the crash and throws away the story; reach for
41
+ it only when you already know what you are looking for.
42
+
43
+ Add `labels.platform:*` for client entries only, or `labels.functionName:*` for
44
+ server entries only.
45
+
46
+ ### Only the errors for a user
34
47
  ```
35
48
  labels.userId="<uid>" severity=ERROR
36
49
  ```