You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte-kit-vice/svelte.config.js

64 lines
2.9 KiB

import adapter from '@sveltejs/adapter-static';
import { resolve, dirname } from 'path';
import { fileURLToPath } from 'url';
const __dirname = dirname(fileURLToPath(import.meta.url));
/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
adapter: adapter({ fallback: '200.html' }),
files: {
routes: 'web/routes'
},
alias: {
// Sincronizado con vite.config.ts para que TypeScript,
// el compilador de Svelte y Vitest resuelvan el mismo alias.
deprecate src/lib + wire new ecosystem aliases (Phase 0+1) Phase 0 — mark legacy as deprecated: - Add @deprecated JSDoc header to all 27 top-level barrels under src/lib (ext/{app,lang,dates,money,nums,units,presentation}, {actx,ling,logr,glob,sium,util}, root index.ts). - Add src/lib/README.md with the migration map: legacy module → new equivalent under src/arts + src/libs + src/svrs. - Zero behavior change. Only IDE strikethrough at usage sites. Phase 1 — wire new ecosystem aliases in vite.config.ts and svelte.config.js: - 18 new $arts/* aliases: $active-app, $adom, $auth, $bus, $cache, $connection, $format, $frontend, $http, $lang, $logger, $orca, $perm, $prefs, $session, $sium, $storage, $timer. - $libs (src/libs), $locale (src/libs/locale), $svrs (src/svrs). - $reactive rewired from src/lib/util/reactive to src/libs/reactive (export surfaces verified compatible — same symbols, drop-in). - Legacy aliases ($lib, $glob, $langs, @/ling, @/logr, @/glob, @/actx, @/uiux) preserved for backwards compat during migration. - SvelteKit auto-regenerates .svelte-kit/tsconfig.json paths from svelte.config.js, so TS resolution updates without manual edits. The migration plan (Phases 2-6) lives in src/lib/README.md: Phase 2 — sweep src/lib/util/* imports to $libs/* (drop-in). Phase 3 — morfo/schema.ts: 3 imports to $libs/standard-schema. Phase 4 — soma's App.create() composition to createActiveApp with explicit service slots (including semantic for sema). Only step that changes architecture. Phase 5 — sweep ~82 test pages to use new aliases. Phase 6 — remove src/lib/{glob,ling,actx} after verifying no consumers; investigate sium and util/{dates,times,timers}. Verification: smoke 68/68, morfo-check 66/66. svelte-check baseline unchanged for the alias rewire (no Cannot-find-module errors). The 2 dialog-provider possibly-undefined errors at lines 113-114 are pre-existing (this.soma vs this.soma! after Soma.get() returning Soma | undefined) — not introduced by this commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
// ── Runtime artifacts (src/arts) ────────────────────────────────
deprecate src/lib + wire new ecosystem aliases (Phase 0+1) Phase 0 — mark legacy as deprecated: - Add @deprecated JSDoc header to all 27 top-level barrels under src/lib (ext/{app,lang,dates,money,nums,units,presentation}, {actx,ling,logr,glob,sium,util}, root index.ts). - Add src/lib/README.md with the migration map: legacy module → new equivalent under src/arts + src/libs + src/svrs. - Zero behavior change. Only IDE strikethrough at usage sites. Phase 1 — wire new ecosystem aliases in vite.config.ts and svelte.config.js: - 18 new $arts/* aliases: $active-app, $adom, $auth, $bus, $cache, $connection, $format, $frontend, $http, $lang, $logger, $orca, $perm, $prefs, $session, $sium, $storage, $timer. - $libs (src/libs), $locale (src/libs/locale), $svrs (src/svrs). - $reactive rewired from src/lib/util/reactive to src/libs/reactive (export surfaces verified compatible — same symbols, drop-in). - Legacy aliases ($lib, $glob, $langs, @/ling, @/logr, @/glob, @/actx, @/uiux) preserved for backwards compat during migration. - SvelteKit auto-regenerates .svelte-kit/tsconfig.json paths from svelte.config.js, so TS resolution updates without manual edits. The migration plan (Phases 2-6) lives in src/lib/README.md: Phase 2 — sweep src/lib/util/* imports to $libs/* (drop-in). Phase 3 — morfo/schema.ts: 3 imports to $libs/standard-schema. Phase 4 — soma's App.create() composition to createActiveApp with explicit service slots (including semantic for sema). Only step that changes architecture. Phase 5 — sweep ~82 test pages to use new aliases. Phase 6 — remove src/lib/{glob,ling,actx} after verifying no consumers; investigate sium and util/{dates,times,timers}. Verification: smoke 68/68, morfo-check 66/66. svelte-check baseline unchanged for the alias rewire (no Cannot-find-module errors). The 2 dialog-provider possibly-undefined errors at lines 113-114 are pre-existing (this.soma vs this.soma! after Soma.get() returning Soma | undefined) — not introduced by this commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
'$active-app': resolve(__dirname, 'src/arts/active-app'),
'$adom': resolve(__dirname, 'src/arts/adom'),
'$auth': resolve(__dirname, 'src/arts/auth'),
'$bus': resolve(__dirname, 'src/arts/bus'),
'$cache': resolve(__dirname, 'src/arts/cache'),
'$connection': resolve(__dirname, 'src/arts/connection'),
'$format': resolve(__dirname, 'src/arts/format'),
'$http': resolve(__dirname, 'src/arts/http'),
'$langs': resolve(__dirname, 'src/arts/langs'),
deprecate src/lib + wire new ecosystem aliases (Phase 0+1) Phase 0 — mark legacy as deprecated: - Add @deprecated JSDoc header to all 27 top-level barrels under src/lib (ext/{app,lang,dates,money,nums,units,presentation}, {actx,ling,logr,glob,sium,util}, root index.ts). - Add src/lib/README.md with the migration map: legacy module → new equivalent under src/arts + src/libs + src/svrs. - Zero behavior change. Only IDE strikethrough at usage sites. Phase 1 — wire new ecosystem aliases in vite.config.ts and svelte.config.js: - 18 new $arts/* aliases: $active-app, $adom, $auth, $bus, $cache, $connection, $format, $frontend, $http, $lang, $logger, $orca, $perm, $prefs, $session, $sium, $storage, $timer. - $libs (src/libs), $locale (src/libs/locale), $svrs (src/svrs). - $reactive rewired from src/lib/util/reactive to src/libs/reactive (export surfaces verified compatible — same symbols, drop-in). - Legacy aliases ($lib, $glob, $langs, @/ling, @/logr, @/glob, @/actx, @/uiux) preserved for backwards compat during migration. - SvelteKit auto-regenerates .svelte-kit/tsconfig.json paths from svelte.config.js, so TS resolution updates without manual edits. The migration plan (Phases 2-6) lives in src/lib/README.md: Phase 2 — sweep src/lib/util/* imports to $libs/* (drop-in). Phase 3 — morfo/schema.ts: 3 imports to $libs/standard-schema. Phase 4 — soma's App.create() composition to createActiveApp with explicit service slots (including semantic for sema). Only step that changes architecture. Phase 5 — sweep ~82 test pages to use new aliases. Phase 6 — remove src/lib/{glob,ling,actx} after verifying no consumers; investigate sium and util/{dates,times,timers}. Verification: smoke 68/68, morfo-check 66/66. svelte-check baseline unchanged for the alias rewire (no Cannot-find-module errors). The 2 dialog-provider possibly-undefined errors at lines 113-114 are pre-existing (this.soma vs this.soma! after Soma.get() returning Soma | undefined) — not introduced by this commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
'$logger': resolve(__dirname, 'src/arts/logger'),
'$orca': resolve(__dirname, 'src/arts/orca'),
'$perm': resolve(__dirname, 'src/arts/perm'),
'$prefs': resolve(__dirname, 'src/arts/prefs'),
'$session': resolve(__dirname, 'src/arts/session'),
'$sium': resolve(__dirname, 'src/arts/sium'),
'$storage': resolve(__dirname, 'src/arts/storage'),
'$timer': resolve(__dirname, 'src/arts/timer'),
// ── Pure helpers (src/libs) ─────────────────────────────────────
deprecate src/lib + wire new ecosystem aliases (Phase 0+1) Phase 0 — mark legacy as deprecated: - Add @deprecated JSDoc header to all 27 top-level barrels under src/lib (ext/{app,lang,dates,money,nums,units,presentation}, {actx,ling,logr,glob,sium,util}, root index.ts). - Add src/lib/README.md with the migration map: legacy module → new equivalent under src/arts + src/libs + src/svrs. - Zero behavior change. Only IDE strikethrough at usage sites. Phase 1 — wire new ecosystem aliases in vite.config.ts and svelte.config.js: - 18 new $arts/* aliases: $active-app, $adom, $auth, $bus, $cache, $connection, $format, $frontend, $http, $lang, $logger, $orca, $perm, $prefs, $session, $sium, $storage, $timer. - $libs (src/libs), $locale (src/libs/locale), $svrs (src/svrs). - $reactive rewired from src/lib/util/reactive to src/libs/reactive (export surfaces verified compatible — same symbols, drop-in). - Legacy aliases ($lib, $glob, $langs, @/ling, @/logr, @/glob, @/actx, @/uiux) preserved for backwards compat during migration. - SvelteKit auto-regenerates .svelte-kit/tsconfig.json paths from svelte.config.js, so TS resolution updates without manual edits. The migration plan (Phases 2-6) lives in src/lib/README.md: Phase 2 — sweep src/lib/util/* imports to $libs/* (drop-in). Phase 3 — morfo/schema.ts: 3 imports to $libs/standard-schema. Phase 4 — soma's App.create() composition to createActiveApp with explicit service slots (including semantic for sema). Only step that changes architecture. Phase 5 — sweep ~82 test pages to use new aliases. Phase 6 — remove src/lib/{glob,ling,actx} after verifying no consumers; investigate sium and util/{dates,times,timers}. Verification: smoke 68/68, morfo-check 66/66. svelte-check baseline unchanged for the alias rewire (no Cannot-find-module errors). The 2 dialog-provider possibly-undefined errors at lines 113-114 are pre-existing (this.soma vs this.soma! after Soma.get() returning Soma | undefined) — not introduced by this commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
'$libs': resolve(__dirname, 'src/libs'),
'$locale': resolve(__dirname, 'src/libs/locale'),
'$reactive': resolve(__dirname, 'src/libs/reactive'),
// ── Server-authoritative engines (src/svrs) ─────────────────────
deprecate src/lib + wire new ecosystem aliases (Phase 0+1) Phase 0 — mark legacy as deprecated: - Add @deprecated JSDoc header to all 27 top-level barrels under src/lib (ext/{app,lang,dates,money,nums,units,presentation}, {actx,ling,logr,glob,sium,util}, root index.ts). - Add src/lib/README.md with the migration map: legacy module → new equivalent under src/arts + src/libs + src/svrs. - Zero behavior change. Only IDE strikethrough at usage sites. Phase 1 — wire new ecosystem aliases in vite.config.ts and svelte.config.js: - 18 new $arts/* aliases: $active-app, $adom, $auth, $bus, $cache, $connection, $format, $frontend, $http, $lang, $logger, $orca, $perm, $prefs, $session, $sium, $storage, $timer. - $libs (src/libs), $locale (src/libs/locale), $svrs (src/svrs). - $reactive rewired from src/lib/util/reactive to src/libs/reactive (export surfaces verified compatible — same symbols, drop-in). - Legacy aliases ($lib, $glob, $langs, @/ling, @/logr, @/glob, @/actx, @/uiux) preserved for backwards compat during migration. - SvelteKit auto-regenerates .svelte-kit/tsconfig.json paths from svelte.config.js, so TS resolution updates without manual edits. The migration plan (Phases 2-6) lives in src/lib/README.md: Phase 2 — sweep src/lib/util/* imports to $libs/* (drop-in). Phase 3 — morfo/schema.ts: 3 imports to $libs/standard-schema. Phase 4 — soma's App.create() composition to createActiveApp with explicit service slots (including semantic for sema). Only step that changes architecture. Phase 5 — sweep ~82 test pages to use new aliases. Phase 6 — remove src/lib/{glob,ling,actx} after verifying no consumers; investigate sium and util/{dates,times,timers}. Verification: smoke 68/68, morfo-check 66/66. svelte-check baseline unchanged for the alias rewire (no Cannot-find-module errors). The 2 dialog-provider possibly-undefined errors at lines 113-114 are pre-existing (this.soma vs this.soma! after Soma.get() returning Soma | undefined) — not introduced by this commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
'$svrs': resolve(__dirname, 'src/svrs'),
// ── UIX layers (src/uix) ────────────────────────────────────────
active-uix: introduce UIX layer between active-app and components Decouples the UIX layer (soma / morfo runtime / sema / eidos) from the App composition layer (`active-app`). UIX components no longer import `\$active-app` directly — they read services through `getActiveUix()`. Two boot paths produce the same `ActiveUix`: - **Standalone** — `createActiveUix({ lang, semantic, … })` bootstraps an `ActiveApp` internally with the UIX services plus any `extraServices`. Owns the app — `dispose()` propagates. - **Attach** — `attachActiveUix(externalApp)` wraps an app the application composed itself (typically when it has services beyond UIX: cache, session, http, …). The external app must declare the UIX services; helper `defineUixServices(options)` returns the slice ready to spread into `createActiveApp({ services })`. Does NOT own the app. In both cases components see only `ActiveUix`. They have no way to tell which boot path was used. Module: src/uix/active-uix/ ├── index.ts barrel ($active-uix) ├── types.ts ActiveUix, ActiveUixOptions, AttachActiveUixOptions ├── services.ts defineUixServices() + UIX_REQUIRED_SERVICES ├── active-uix.svelte.ts createActiveUix() + attachActiveUix() + ActiveUixImpl ├── components/uix.svelte <Uix uix={...}> wrapper (sets context + creates Soma) └── svelte/context.svelte.ts setActiveUix() / getActiveUix() / tryGetActiveUix() Surface exposed by `ActiveUix`: - UIX services: lang, frontend, format (optional), dom, semantic - Core: logger, bus, timers, prefs - Config: somaPortalTo - `app` escape hatch for advanced integration code (NOT for UIX components) Wiring done by active-uix at boot: - `App.lang.extend('components', componentLangs)` — soma component translations always available without per-app boilerplate. - Frontend service auto-configured with `applyDom: true` + `target: () => document.documentElement` so theme/dir/density land on `<html>` automatically. Migration: - `Soma.create()` reads `getActiveUix()` instead of `getActiveApp()`. Soma class no longer imports `\$active-app`. - 3 layouts (test/eidos, test/sium, test/soma) replace `createActiveApp + setActiveApp + <Soma>` with `createActiveUix + <Uix>`. Boilerplate drops ~20 lines per layout. - 7 sium pages replace `getActiveApp() + app.lang.setLocale(…)` with `getActiveUix() + uix.lang.setLocale(…)`. Validation: - `attachActiveUix(app)` throws `ActiveUixMissingServiceError` if the external app didn't declare lang/frontend/dom/semantic. - `getActiveUix()` throws `ActiveUixNoContextError` if no `<Uix>` ancestor mounted. `\$active-uix` alias wired in svelte.config.js + vite.config.ts (both client and server projects). Verified: vitest 197/197, smoke 68/68, morfo-check 66/66, playwright probe (4 routes including dialog with sound) zero page/console errors.
5 months ago
'$uix': resolve(__dirname, 'src/uix'),
'$active-uix': resolve(__dirname, 'src/uix/active-uix'),
'$soma': resolve(__dirname, 'src/uix/soma'),
deprecate src/lib + wire new ecosystem aliases (Phase 0+1) Phase 0 — mark legacy as deprecated: - Add @deprecated JSDoc header to all 27 top-level barrels under src/lib (ext/{app,lang,dates,money,nums,units,presentation}, {actx,ling,logr,glob,sium,util}, root index.ts). - Add src/lib/README.md with the migration map: legacy module → new equivalent under src/arts + src/libs + src/svrs. - Zero behavior change. Only IDE strikethrough at usage sites. Phase 1 — wire new ecosystem aliases in vite.config.ts and svelte.config.js: - 18 new $arts/* aliases: $active-app, $adom, $auth, $bus, $cache, $connection, $format, $frontend, $http, $lang, $logger, $orca, $perm, $prefs, $session, $sium, $storage, $timer. - $libs (src/libs), $locale (src/libs/locale), $svrs (src/svrs). - $reactive rewired from src/lib/util/reactive to src/libs/reactive (export surfaces verified compatible — same symbols, drop-in). - Legacy aliases ($lib, $glob, $langs, @/ling, @/logr, @/glob, @/actx, @/uiux) preserved for backwards compat during migration. - SvelteKit auto-regenerates .svelte-kit/tsconfig.json paths from svelte.config.js, so TS resolution updates without manual edits. The migration plan (Phases 2-6) lives in src/lib/README.md: Phase 2 — sweep src/lib/util/* imports to $libs/* (drop-in). Phase 3 — morfo/schema.ts: 3 imports to $libs/standard-schema. Phase 4 — soma's App.create() composition to createActiveApp with explicit service slots (including semantic for sema). Only step that changes architecture. Phase 5 — sweep ~82 test pages to use new aliases. Phase 6 — remove src/lib/{glob,ling,actx} after verifying no consumers; investigate sium and util/{dates,times,timers}. Verification: smoke 68/68, morfo-check 66/66. svelte-check baseline unchanged for the alias rewire (no Cannot-find-module errors). The 2 dialog-provider possibly-undefined errors at lines 113-114 are pre-existing (this.soma vs this.soma! after Soma.get() returning Soma | undefined) — not introduced by this commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
sema/morfo/eidos: typed selector builder + dialog wrapper + emerge color sema architecture - sema-map: 5-channel registry (motion / sound / color / presence / haptic) via SemaChannelSignatures declaration merging; engine stamps data-event-* tokens; flat CSS-style cascade replaces the eventLabel-overrides middle layer. - sema-map: emerge family gains base.color so intent deltas can shift hue / saturation / intensity. Without a base, the resolver was skipping the channel and Dialog open with intent='threat' rendered as neutral blue in the Sema tab visualisation. - types: SEMA_FAMILY_POLICY const drives compile-time + runtime intent requirements per family. Object shape so future per-family policy fields fit alongside. Emerge events MAY now declare intent (canon update — a Dialog confirming threat carries it in its very appearance). - chans: rename vibra→haptic, add HapticChannel V1 (Vibration API); SoundChannel eager-init on first user gesture (autoplay race fix). morfo selector discipline - morfo/selectors.ts (new): semaSelector(morfo, partKebab, matchers?) — type-checked against morfo.parts and morfo.events. Sema cascade rules MUST use it; hand-written strings are an architecture violation that breaks silently when morfo renames a part. - dialog morfo: open carries intent via fromProp; close-cancel / close-dismiss / close-dismiss-outside drop intent (cancellation has no evaluative load); close-save stays hardcoded fulfill (commit fulfils the user's decision regardless of dialog context). eidos dialog migration (4th pilot) - eidos/components/dialog/: full subdirectory wrapper — flat <Dialog> + compound Provider/Trigger/Overlay/Content/Title/Description/Close/Header/ Footer; size + position responsive props; sheet auto-form on narrow viewports; closePosition for the auto-X. - sema/components/dialog.ts: cascade rules use semaSelector(dialogMorfo, 'content', matchers?). Intent block adds character (haptic kind / pattern) but never overrides pitch / gain / contour — those are intent.deltas signature ownership and overriding flattens per-intent perceptual difference. demo controls + dialog page - src/lib/_demo (DemoSwitch / DemoEnum / DemoText / DemoRange) — unified controls reused across all component demos. - web/routes/dialog: live preview always rendered above tabs; per-event Sema tab with independent intent probe; signature visualisation + Play buttons with fallback target chain. documentation - CLAUDE.md: intent.deltas signature ownership rule; eidos drift defense doctrine (types over lint); 2026-05-09 hand-off entry. - morfo/README: Typed selector builder section. - eidos/README: linter section reframed as opt-in safety net for plain CSS recipes; the architectural mechanism is compile-time typing. - sema/README: open channel registry + flat cascade docs + override semantics + intent policy const + selector builder discipline. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
// ── Demo controls (src/lib/_demo) ───────────────────────────────
'$demo': resolve(__dirname, 'src/lib/_demo'),
deprecate src/lib + wire new ecosystem aliases (Phase 0+1) Phase 0 — mark legacy as deprecated: - Add @deprecated JSDoc header to all 27 top-level barrels under src/lib (ext/{app,lang,dates,money,nums,units,presentation}, {actx,ling,logr,glob,sium,util}, root index.ts). - Add src/lib/README.md with the migration map: legacy module → new equivalent under src/arts + src/libs + src/svrs. - Zero behavior change. Only IDE strikethrough at usage sites. Phase 1 — wire new ecosystem aliases in vite.config.ts and svelte.config.js: - 18 new $arts/* aliases: $active-app, $adom, $auth, $bus, $cache, $connection, $format, $frontend, $http, $lang, $logger, $orca, $perm, $prefs, $session, $sium, $storage, $timer. - $libs (src/libs), $locale (src/libs/locale), $svrs (src/svrs). - $reactive rewired from src/lib/util/reactive to src/libs/reactive (export surfaces verified compatible — same symbols, drop-in). - Legacy aliases ($lib, $glob, $langs, @/ling, @/logr, @/glob, @/actx, @/uiux) preserved for backwards compat during migration. - SvelteKit auto-regenerates .svelte-kit/tsconfig.json paths from svelte.config.js, so TS resolution updates without manual edits. The migration plan (Phases 2-6) lives in src/lib/README.md: Phase 2 — sweep src/lib/util/* imports to $libs/* (drop-in). Phase 3 — morfo/schema.ts: 3 imports to $libs/standard-schema. Phase 4 — soma's App.create() composition to createActiveApp with explicit service slots (including semantic for sema). Only step that changes architecture. Phase 5 — sweep ~82 test pages to use new aliases. Phase 6 — remove src/lib/{glob,ling,actx} after verifying no consumers; investigate sium and util/{dates,times,timers}. Verification: smoke 68/68, morfo-check 66/66. svelte-check baseline unchanged for the alias rewire (no Cannot-find-module errors). The 2 dialog-provider possibly-undefined errors at lines 113-114 are pre-existing (this.soma vs this.soma! after Soma.get() returning Soma | undefined) — not introduced by this commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
// ── @/ catch-all ────────────────────────────────────────────────
'@': resolve(__dirname, 'src'),
},
},
vitePlugin: {
dynamicCompileOptions: ({ filename }) =>
filename.includes('node_modules') ? undefined : { runes: true }
}
};
export default config;

Powered by TurnKey Linux.