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",
|
|
|
|
|
"license": "UNLICENSED",
|
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
|
|
|
"type": "module",
|
|
|
|
|
"sideEffects": [
|
|
|
|
|
"**/*.css",
|
|
|
|
|
"**/*.svelte"
|
|
|
|
|
],
|
|
|
|
|
"repository": {
|
|
|
|
|
"type": "git",
|
|
|
|
|
"url": "https://192.168.18.112/go/active-svelte.git"
|
|
|
|
|
},
|
|
|
|
|
"bugs": {
|
|
|
|
|
"url": "https://192.168.18.112/go/active-svelte/issues"
|
|
|
|
|
},
|
|
|
|
|
"homepage": "https://192.168.18.112/go/active-svelte#readme",
|
|
|
|
|
"engines": {
|
|
|
|
|
"node": ">=22"
|
|
|
|
|
},
|
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:typecheck": "npm run check",
|
|
|
|
|
"test:bundle": "node scripts/bundle-smoke.mjs",
|
|
|
|
|
"test:static": "node scripts/static-smoke.mjs",
|
Bloque A — sweep stale aliases and `App.<Capitalized>` references
Audit P1: documentation must stop teaching APIs the runtime no
longer exposes. The svelte.config.js aliases are full words now
(`$cache`, `$session`, `$connection`, `$timer`, `$logger`,
`$format`, `$storage`, `$active-app`, `$bus`); the legacy 4-letter
forms (`$cach`, `$sess`, `$conn`, `$timr`, `$logr`, `$fmts`,
`$stor`, `$aapp`, `$buss`) were retired earlier but still lived in
READMEs, demo pages, comments and a few code docstrings.
Likewise, the `App.<service>` surface is lowercase for declarable
services. The capitalized form is reserved for the four-piece core
(`Logger`, `Bus`, `Timers`, `Orca`). References like `App.Cache`,
`App.Sess`, `App.Storage`, `App.Format`, `App.Frontend`, `App.Lang`,
`App.Auth`, `App.Perms`, `App.Http`, `App.Dom`, `App.Sium` were
either ported to the new lowercase or migrated where it made sense.
Mechanical sweep across `src/`, then a guard script:
- `scripts/check-aliases.mjs` walks `src/`, fails the run if any
forbidden alias or `App.<forbidden capitalized>` appears in any
`.ts` / `.svelte` / `.md` / `.txt` / `.js` / `.mjs` file.
`arts/active-app/types.ts` is allowlisted because its block
comment explicitly documents the legacy uppercase surface as
"removed".
- `npm run test:aliases` exposes the script.
- `npm run test:all` now includes the alias check.
No runtime change; tests still 1486 / 1486.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
|
|
|
"test:aliases": "node scripts/check-aliases.mjs",
|
|
|
|
|
"test:all": "npm run check && npm test && npm run build && npm run test:aliases && npm run test:static && npm run test:bundle",
|
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
|
|
|
"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
|
|
|
}
|
|
|
|
|
}
|