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
|
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
|
import { playwright } from '@vitest/browser-playwright';
|
|
|
|
|
import { sveltekit } from '@sveltejs/kit/vite';
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
plugins: [sveltekit()],
|
|
|
|
|
test: {
|
|
|
|
|
expect: { requireAssertions: true },
|
|
|
|
|
projects: [
|
|
|
|
|
{
|
|
|
|
|
extends: './vite.config.ts',
|
|
|
|
|
test: {
|
|
|
|
|
name: 'client',
|
|
|
|
|
browser: {
|
|
|
|
|
enabled: true,
|
|
|
|
|
provider: playwright(),
|
|
|
|
|
instances: [{ browser: 'chromium', headless: true }]
|
|
|
|
|
},
|
|
|
|
|
include: ['src/**/*.svelte.{test,spec}.{js,ts}'],
|
|
|
|
|
exclude: ['src/libs/server/**']
|
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
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
extends: './vite.config.ts',
|
|
|
|
|
test: {
|
|
|
|
|
name: 'server',
|
|
|
|
|
environment: 'node',
|
|
|
|
|
include: ['src/**/*.{test,spec}.{js,ts}'],
|
|
|
|
|
exclude: ['src/**/*.svelte.{test,spec}.{js,ts}']
|
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
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
});
|