Initial commit: lang + logr libraries with SvelteKit scaffold
lang — type-safe i18n engine (zero-deps):
- Pure engine (createEngineLang) with explicit locale per call
- Svelte 5 reactive wrapper (createActiveLang) via $state
- Fallback chain, Intl.PluralRules, cross-key references, JSON round-trip
- Type-safe paths with inference from schema
logr — structured logger (zero-deps, decoupled from i18n):
- 6 levels (TRACE..FATAL) aligned with pino/Log4j/OpenTelemetry/Sentry
- Auto-generated entry.id (UUID v4 / hex fallback)
- globalContext, child(), time/timeEnd, lazy messages, source capture
- Dynamic transports with per-sink minLevel/filter, buffer + writeBatch
- Hybrid dispatch: sync loop, transports may be async
- Failure routing with deniedFor and cascade guard
- Adapters: console, http, callback, sentry, datadog, logtail, loki, otel
Test pages at /test/lang and /test/logr. 180 unit tests passing.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
{
|
|
|
|
|
"name": "active",
|
|
|
|
|
"private": true,
|
|
|
|
|
"version": "0.0.1",
|
|
|
|
|
"type": "module",
|
|
|
|
|
"sideEffects": [
|
|
|
|
|
"**/*.css",
|
|
|
|
|
"**/*.svelte"
|
|
|
|
|
],
|
Initial commit: lang + logr libraries with SvelteKit scaffold
lang — type-safe i18n engine (zero-deps):
- Pure engine (createEngineLang) with explicit locale per call
- Svelte 5 reactive wrapper (createActiveLang) via $state
- Fallback chain, Intl.PluralRules, cross-key references, JSON round-trip
- Type-safe paths with inference from schema
logr — structured logger (zero-deps, decoupled from i18n):
- 6 levels (TRACE..FATAL) aligned with pino/Log4j/OpenTelemetry/Sentry
- Auto-generated entry.id (UUID v4 / hex fallback)
- globalContext, child(), time/timeEnd, lazy messages, source capture
- Dynamic transports with per-sink minLevel/filter, buffer + writeBatch
- Hybrid dispatch: sync loop, transports may be async
- Failure routing with deniedFor and cascade guard
- Adapters: console, http, callback, sentry, datadog, logtail, loki, otel
Test pages at /test/lang and /test/logr. 180 unit tests passing.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
"scripts": {
|
|
|
|
|
"dev": "vite dev",
|
|
|
|
|
"build": "vite build",
|
|
|
|
|
"preview": "vite preview",
|
|
|
|
|
"prepare": "svelte-kit sync || echo ''",
|
|
|
|
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
|
|
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
|
|
|
"dev:conn-chat": "node scripts/conn-chat-server.mjs",
|
Initial commit: lang + logr libraries with SvelteKit scaffold
lang — type-safe i18n engine (zero-deps):
- Pure engine (createEngineLang) with explicit locale per call
- Svelte 5 reactive wrapper (createActiveLang) via $state
- Fallback chain, Intl.PluralRules, cross-key references, JSON round-trip
- Type-safe paths with inference from schema
logr — structured logger (zero-deps, decoupled from i18n):
- 6 levels (TRACE..FATAL) aligned with pino/Log4j/OpenTelemetry/Sentry
- Auto-generated entry.id (UUID v4 / hex fallback)
- globalContext, child(), time/timeEnd, lazy messages, source capture
- Dynamic transports with per-sink minLevel/filter, buffer + writeBatch
- Hybrid dispatch: sync loop, transports may be async
- Failure routing with deniedFor and cascade guard
- Adapters: console, http, callback, sentry, datadog, logtail, loki, otel
Test pages at /test/lang and /test/logr. 180 unit tests passing.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
"lint": "prettier --check . && eslint .",
|
|
|
|
|
"format": "prettier --write .",
|
|
|
|
|
"test:unit": "vitest",
|
|
|
|
|
"test": "npm run test:unit -- --run"
|
|
|
|
|
},
|
|
|
|
|
"devDependencies": {
|
|
|
|
|
"@eslint/compat": "^2.0.4",
|
|
|
|
|
"@eslint/js": "^10.0.1",
|
|
|
|
|
"@sveltejs/adapter-static": "^3.0.10",
|
|
|
|
|
"@sveltejs/kit": "^2.57.0",
|
|
|
|
|
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
|
|
|
|
"@types/node": "^22",
|
|
|
|
|
"@vitest/browser-playwright": "^4.1.3",
|
|
|
|
|
"eslint": "^10.2.0",
|
|
|
|
|
"eslint-config-prettier": "^10.1.8",
|
|
|
|
|
"eslint-plugin-svelte": "^3.17.0",
|
|
|
|
|
"globals": "^17.4.0",
|
|
|
|
|
"jsdom": "^29.1.0",
|
Initial commit: lang + logr libraries with SvelteKit scaffold
lang — type-safe i18n engine (zero-deps):
- Pure engine (createEngineLang) with explicit locale per call
- Svelte 5 reactive wrapper (createActiveLang) via $state
- Fallback chain, Intl.PluralRules, cross-key references, JSON round-trip
- Type-safe paths with inference from schema
logr — structured logger (zero-deps, decoupled from i18n):
- 6 levels (TRACE..FATAL) aligned with pino/Log4j/OpenTelemetry/Sentry
- Auto-generated entry.id (UUID v4 / hex fallback)
- globalContext, child(), time/timeEnd, lazy messages, source capture
- Dynamic transports with per-sink minLevel/filter, buffer + writeBatch
- Hybrid dispatch: sync loop, transports may be async
- Failure routing with deniedFor and cascade guard
- Adapters: console, http, callback, sentry, datadog, logtail, loki, otel
Test pages at /test/lang and /test/logr. 180 unit tests passing.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
"playwright": "^1.59.1",
|
|
|
|
|
"prettier": "^3.8.1",
|
|
|
|
|
"prettier-plugin-svelte": "^3.5.1",
|
|
|
|
|
"svelte": "^5.55.2",
|
|
|
|
|
"svelte-check": "^4.4.6",
|
|
|
|
|
"typescript": "^6.0.2",
|
|
|
|
|
"typescript-eslint": "^8.58.1",
|
|
|
|
|
"vite": "^8.0.7",
|
|
|
|
|
"vitest": "^4.1.3",
|
|
|
|
|
"vitest-browser-svelte": "^2.1.0"
|
|
|
|
|
},
|
|
|
|
|
"dependencies": {
|
|
|
|
|
"@floating-ui/core": "^1.7.1",
|
|
|
|
|
"@floating-ui/dom": "^1.7.1",
|
Add vitals, entry.id, per-level transport routing and buffering
logr:
- entry.id auto-generated (UUID v4 / hex fallback) — survives backend dedup, batched-retry, cross-transport correlation.
- Transport.levels replaces minLevel — per-level { enabled, filter? } record. More flexible: enable/disable individual levels, attach per-level filters. Helper levelsAtLeast(level) for the common min-level case; allLevels() for the permissive case.
- Transport buffering: buffer, flushIntervalMs, writeBatch on the Transport interface. Logger tracks per-transport queues, flushes on size/time/flush()/detach/beforeunload. httpTransport and lokiTransport implement writeBatch for true batched HTTP delivery.
- logger.flush() to drain all buffered transports manually.
- Web Vitals integration (src/arts/logr/vitals.ts): registerWebVitals(logger, webVitalsSDK, options?) turns LCP/INP/CLS/FCP/TTFB samples into structured log entries tagged with route/rating. Zero-deps in logr — SDK is injected.
- ConsoleTransportOptions now exposes filter so vitals can be silenced on console while still flowing to Sentry/Datadog/Loki.
- Runtime name constant: `engine_logger` (via src/arts/logr/consts.ts) replaces hardcoded 'logr' string in failure reports, console prefix and synthetic entry tags.
lang:
- README expanded with a dedicated section on ts() and the LangString type: plain strings, LangRecord, LangRef; the `message: LangString` prop pattern for generic components; when to use the isLang* guards.
Tests: 185 passing (added vitals + buffer + entry.id coverage).
Docs: logr README now documents vitals (hot-zone patterns for LogQL / Sentry Discover / Datadog), buffering, the levels config, and the helpers.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
"@sentry/browser": "^10.50.0",
|
|
|
|
|
"csstype": "^3.2.3",
|
|
|
|
|
"esm-env": "^1.1.2",
|
|
|
|
|
"runed": "0.37.1",
|
|
|
|
|
"tabbable": "^6.2.0",
|
|
|
|
|
"web-vitals": "^5.2.0"
|
Initial commit: lang + logr libraries with SvelteKit scaffold
lang — type-safe i18n engine (zero-deps):
- Pure engine (createEngineLang) with explicit locale per call
- Svelte 5 reactive wrapper (createActiveLang) via $state
- Fallback chain, Intl.PluralRules, cross-key references, JSON round-trip
- Type-safe paths with inference from schema
logr — structured logger (zero-deps, decoupled from i18n):
- 6 levels (TRACE..FATAL) aligned with pino/Log4j/OpenTelemetry/Sentry
- Auto-generated entry.id (UUID v4 / hex fallback)
- globalContext, child(), time/timeEnd, lazy messages, source capture
- Dynamic transports with per-sink minLevel/filter, buffer + writeBatch
- Hybrid dispatch: sync loop, transports may be async
- Failure routing with deniedFor and cascade guard
- Adapters: console, http, callback, sentry, datadog, logtail, loki, otel
Test pages at /test/lang and /test/logr. 180 unit tests passing.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
}
|
|
|
|
|
}
|