@theholocron/observability 0.7.0-alpha.4 → 0.7.0-alpha.6

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,3 +1,12 @@
1
+ /**
2
+ * `@theholocron/observability/analytics` — product analytics (usage, adoption,
3
+ * retention).
4
+ *
5
+ * `PostHogSink` is the Node adapter for the {@link AnalyticsSink} interface
6
+ * (from `/core`). `posthog-node` is an optional peer dependency; install it
7
+ * alongside this subpath. The caller resolves the project key + host and
8
+ * passes them to the constructor — this module reads no environment.
9
+ */
1
10
  import { t as PostHogSink } from "./posthog-sink-CmQmma-o.mjs";
2
11
  import { i as NoopAnalyticsSink, t as AnalyticsSink } from "./sinks-D5CwDgDL.mjs";
3
12
  export { type AnalyticsSink, NoopAnalyticsSink, PostHogSink };
@@ -1,3 +1,12 @@
1
+ /**
2
+ * `@theholocron/observability/browser/posthog`: the `AnalyticsSink` for a web
3
+ * page or a React app, over `posthog-js`.
4
+ *
5
+ * Importing this entry loads `posthog-js` and nothing else; the Sentry adapter
6
+ * is its own entry (`/browser/sentry`). `posthog-js` is an optional peer
7
+ * dependency. The caller resolves the project key; this module reads no
8
+ * environment and imports no Node built-in.
9
+ */
1
10
  import { t as AnalyticsSink } from "./sinks-D5CwDgDL.mjs";
2
11
  import { t as OnError } from "./safe-6WuLqOVf.mjs";
3
12
  /** The slice of a `posthog-js` instance that {@link PostHogBrowserSink} calls. */
@@ -1,3 +1,13 @@
1
+ /**
2
+ * `@theholocron/observability/browser/sentry`: the `ErrorSink` for a web page
3
+ * or a React app, over `@sentry/browser`.
4
+ *
5
+ * Importing this entry loads `@sentry/browser` and nothing else; the PostHog
6
+ * adapter is its own entry (`/browser/posthog`), so an app that uses only one
7
+ * SDK never has to install the other. `@sentry/browser` is an optional peer
8
+ * dependency. The caller resolves the DSN; this module reads no environment and
9
+ * imports no Node built-in.
10
+ */
1
11
  import { i as scrubEvent, n as SentrySdkLike, r as SentrySinkOptions, t as SentryCompatibleSink } from "./sentry-compatible-sink-D50iTP_8.mjs";
2
12
  import { t as OnError } from "./safe-6WuLqOVf.mjs";
3
13
  /**
package/dist/core.d.mts CHANGED
@@ -1,3 +1,12 @@
1
+ /**
2
+ * `@theholocron/observability/core` — the zero-dependency heart of the library.
3
+ *
4
+ * Interfaces ({@link Logger}, {@link ErrorSink}, {@link AnalyticsSink}), their
5
+ * no-op implementations, and the redaction helpers. Nothing here imports a
6
+ * vendor SDK or a Node built-in beyond what a browser / edge / React Native
7
+ * bundle tolerates, so application and library code can depend on `/core`
8
+ * everywhere; only the process entry point pulls a concrete adapter subpath.
9
+ */
1
10
  import { a as NoopErrorSink, i as NoopAnalyticsSink, n as CommandSpan, r as ErrorSink, t as AnalyticsSink } from "./sinks-D5CwDgDL.mjs";
2
11
  import { a as NoopLogger, i as Logger, n as LogEnv, r as LogLevel, t as LOG_LEVELS } from "./logger-DC6M2rL_.mjs";
3
12
  import { a as redactOptions, i as redactObject, n as REDACT_CENSOR, r as redact, t as REDACTED_PATHS } from "./core-DDpFbotv.mjs";
@@ -1,3 +1,11 @@
1
+ /**
2
+ * `@theholocron/observability/edge/posthog`: the `AnalyticsSink` for an edge or
3
+ * worker runtime, over PostHog's HTTP capture endpoint with `fetch` alone.
4
+ *
5
+ * Importing this entry loads no SDK at all, so it has no peer dependency. The
6
+ * caller resolves the project key; this module reads no environment and
7
+ * imports no Node built-in.
8
+ */
1
9
  import { t as AnalyticsSink } from "./sinks-D5CwDgDL.mjs";
2
10
  import { t as OnError } from "./safe-6WuLqOVf.mjs";
3
11
  /** The part of a `fetch` response the sink reads. */
@@ -1,3 +1,12 @@
1
+ /**
2
+ * `@theholocron/observability/edge/sentry`: the `ErrorSink` for an edge or
3
+ * worker runtime (Cloudflare Workers, Vercel Edge, Deno), over
4
+ * `@sentry/vercel-edge`.
5
+ *
6
+ * Importing this entry loads `@sentry/vercel-edge` and nothing else.
7
+ * `@sentry/vercel-edge` is an optional peer dependency. The caller resolves the
8
+ * DSN; this module reads no environment and imports no Node built-in.
9
+ */
1
10
  import { i as scrubEvent, n as SentrySdkLike, r as SentrySinkOptions, t as SentryCompatibleSink } from "./sentry-compatible-sink-D50iTP_8.mjs";
2
11
  import { t as OnError } from "./safe-6WuLqOVf.mjs";
3
12
  /**
package/dist/errors.d.mts CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * `@theholocron/observability/errors` — error tracking + performance spans.
3
+ *
4
+ * `SentrySink` is the Node adapter for the {@link ErrorSink} interface (from
5
+ * `/core`). `@sentry/node` is an optional peer dependency; install it
6
+ * alongside this subpath. The caller resolves the DSN and passes it to
7
+ * `init()` — this module reads no environment.
8
+ */
1
9
  import { a as NoopErrorSink, n as CommandSpan, r as ErrorSink } from "./sinks-D5CwDgDL.mjs";
2
10
  import { n as scrubError, t as SentrySink } from "./sentry-sink-C0WWmUBS.mjs";
3
11
  export { type CommandSpan, type ErrorSink, NoopErrorSink, SentrySink, scrubError };
package/dist/index.d.mts CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * `@theholocron/observability` — the whole surface in one import.
3
+ *
4
+ * Prefer a subpath (`@theholocron/observability/core`, `/logger`, `/errors`,
5
+ * `/analytics`) so a browser or edge bundle only pulls what it uses and the
6
+ * optional peer dependencies stay optional. The root export is the convenience
7
+ * form for a Node process that wants all of it.
8
+ */
1
9
  import { a as NoopErrorSink, i as NoopAnalyticsSink, n as CommandSpan, r as ErrorSink, t as AnalyticsSink } from "./sinks-D5CwDgDL.mjs";
2
10
  import { a as detectEnv, c as isTelemetryDisabled, d as resolveLevel, f as ConsoleLogger, i as createPinoInstance, l as parseLogLevel, n as PinoLogger, o as generateRunId, r as buildPinoOptions, s as isCI, t as CreatePinoInstanceInput, u as resolveAxiomFromEnv } from "./pino-DIfQGY7z.mjs";
3
11
  import { a as NoopLogger, i as Logger, n as LogEnv, r as LogLevel, t as LOG_LEVELS } from "./logger-DC6M2rL_.mjs";
package/dist/logger.d.mts CHANGED
@@ -1,3 +1,15 @@
1
+ /**
2
+ * `@theholocron/observability/logger` — structured logging.
3
+ *
4
+ * `createLogger()` returns a Pino-backed {@link Logger} with pino-pretty
5
+ * locally, NDJSON in CI, and an Axiom transport when credentials resolve
6
+ * (ADR-0007). `ConsoleLogger` is the zero-dependency alternative for the
7
+ * browser / edge / React Native, behind the same interface.
8
+ *
9
+ * `pino`, `pino-pretty` and `@axiomhq/pino` are optional peer dependencies —
10
+ * install them alongside this subpath. The {@link Logger} interface itself
11
+ * lives in `/core` and needs none of them.
12
+ */
1
13
  import { i as Logger, n as LogEnv, r as LogLevel, t as LOG_LEVELS } from "./logger-DC6M2rL_.mjs";
2
14
  import { a as detectEnv, c as isTelemetryDisabled, d as resolveLevel, f as ConsoleLogger, i as createPinoInstance, l as parseLogLevel, n as PinoLogger, o as generateRunId, r as buildPinoOptions, s as isCI, t as CreatePinoInstanceInput, u as resolveAxiomFromEnv } from "./pino-DIfQGY7z.mjs";
3
15
  import { a as BuildTransportInput, i as AxiomTransportConfig, n as LoggerConfig, o as buildTransport, r as createLogger, t as CreateLoggerResult } from "./create-X1v3LWjb.mjs";
@@ -1,3 +1,15 @@
1
+ /**
2
+ * `@theholocron/observability/react-native`: error tracking and analytics for a
3
+ * React Native app.
4
+ *
5
+ * `SentryReactNativeSink` (over `@sentry/react-native`) implements
6
+ * {@link ErrorSink} and `PostHogReactNativeSink` (over `posthog-react-native`)
7
+ * implements {@link AnalyticsSink}, both from `/core`; for logging use
8
+ * `ConsoleLogger` from `/logger`. Both SDKs need the `react-native` runtime to
9
+ * load, so the app imports them and passes them in; this module imports neither
10
+ * and no Node built-in. The SDKs are optional peer dependencies. The caller
11
+ * resolves the DSN and the project key.
12
+ */
1
13
  import { a as NoopErrorSink, i as NoopAnalyticsSink, r as ErrorSink, t as AnalyticsSink } from "./sinks-D5CwDgDL.mjs";
2
14
  import { t as OnError } from "./safe-6WuLqOVf.mjs";
3
15
  import { i as scrubEvent, n as SentrySdkLike, r as SentrySinkOptions, t as SentryCompatibleSink } from "./sentry-compatible-sink-D50iTP_8.mjs";
@@ -1,3 +1,16 @@
1
+ /**
2
+ * `@theholocron/observability/testing` — vitest-based test doubles for the
3
+ * `/core` interfaces (`Logger`, `ErrorSink`, `AnalyticsSink`). Every consumer
4
+ * that tests code which logs or reports telemetry wants these — hand-rolling
5
+ * the same spy shape per repo is what this subpath replaces.
6
+ *
7
+ * `silenceLogger` swaps `createLogger` for a `NoopLogger` in a vitest setup file.
8
+ *
9
+ * `vitest` is an optional peer dependency: install it alongside this
10
+ * subpath (any repo with a vitest suite already has it as a devDependency).
11
+ * For a non-vitest context that needs a `Logger` but no output, use
12
+ * {@link NoopLogger} from `/core` instead — it records nothing to assert on.
13
+ */
1
14
  import { n as CommandSpan, r as ErrorSink, t as AnalyticsSink } from "./sinks-D5CwDgDL.mjs";
2
15
  import { i as Logger } from "./logger-DC6M2rL_.mjs";
3
16
  import { r as createLogger } from "./create-X1v3LWjb.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/observability",
3
- "version": "0.7.0-alpha.4",
3
+ "version": "0.7.0-alpha.6",
4
4
  "description": "Logging, error tracking, and analytics — one interface, swappable backends.",
5
5
  "keywords": [
6
6
  "typescript",
@@ -84,30 +84,30 @@
84
84
  "dist"
85
85
  ],
86
86
  "dependencies": {
87
- "@theholocron/env-utils": "^1.17.0-alpha.3"
87
+ "@theholocron/env-utils": "^1.17.0-alpha.5"
88
88
  },
89
89
  "devDependencies": {
90
90
  "@axiomhq/pino": "^2.0.0",
91
- "@sentry/browser": "^11.10.0",
92
- "@sentry/node": "^11.10.0",
93
- "@sentry/vercel-edge": "^11.10.0",
91
+ "@sentry/browser": "^11.12.0",
92
+ "@sentry/node": "^11.12.0",
93
+ "@sentry/vercel-edge": "^11.12.0",
94
94
  "@types/node": "^26",
95
95
  "@vitest/coverage-v8": "^5.1.0",
96
96
  "@vitest/eslint-plugin": "^1.6.28",
97
- "eslint": "^10.14.0",
97
+ "eslint": "^10.15.0",
98
98
  "eslint-plugin-n": "^18.5.0",
99
99
  "globals": "^17.14.0",
100
100
  "pino": "^10.4.0",
101
101
  "pino-pretty": "^13.2.0",
102
- "posthog-js": "^1.447.7",
103
- "posthog-node": "^5.61.2",
104
- "tsdown": "^0.23.5",
105
- "typescript": "^5.9.3",
102
+ "posthog-js": "^1.450.0",
103
+ "posthog-node": "^5.74.0",
104
+ "tsdown": "^0.23.7",
105
+ "typescript": "^6.0.3",
106
106
  "vitest": "^5.1.0",
107
- "@theholocron/eslint-config": "^8.9.0-alpha.16",
108
- "@theholocron/tsconfig": "^8.9.0-alpha.16",
109
- "@theholocron/vitest-config": "^8.9.0-alpha.16",
110
- "@theholocron/tsdown-config": "^8.9.0-alpha.16"
107
+ "@theholocron/eslint-config": "^8.9.0-alpha.21",
108
+ "@theholocron/tsdown-config": "^8.9.0-alpha.21",
109
+ "@theholocron/vitest-config": "^8.9.0-alpha.21",
110
+ "@theholocron/tsconfig": "^8.9.0-alpha.21"
111
111
  },
112
112
  "peerDependencies": {
113
113
  "@axiomhq/pino": ">=2",