Keep Soma internals off public alias

active-uix
dev 5 months ago
parent 48e21e5634
commit e7bb709e83

@ -101,6 +101,12 @@ Actualizacion 2026-05-16:
como texto sin enlace.
- Guardia nueva: los links relativos entre README de componentes Soma deben
apuntar a documentos existentes.
- Cerrado: los imports internos de produccion de Soma ya no usan el alias
publico `$soma`; Drawer, Toast, Toggle, Switch, Dismissal, Floating y
`types` pasan a imports relativos.
- Guardia nueva: `src/uix/contracts.test.ts` rechaza imports internos de
Soma hacia su propio alias publico, dejando `$soma/*` para consumidores
externos y tests de superficie.
- Smoke Playwright de rutas `/uix` actuales cerrado:
`/uix`, Accordion, Checkbox, Collapsible, Dialog, Drawer, Popover,
RadioGroup, Switch, Tabs, Toast, Toggle y Tooltip cargan con HTTP 200,

@ -390,6 +390,17 @@ describe('UIX layer contracts', () => {
expect(violations).toEqual([]);
});
it('guards Soma internals from importing their own public alias', () => {
const violations = listSourceFiles(join(HERE, 'soma'))
.filter((file) => {
const source = stripComments(readFileSync(file, 'utf8'));
return /from ['"]\$soma(?:['"]|\/)/.test(source);
})
.map((file) => file.replace(REPO_ROOT, ''));
expect(violations).toEqual([]);
});
it('guards Soma from direct mutable DOM writes', () => {
const violations = grepSources(
join(HERE, 'soma'),

@ -32,7 +32,7 @@ import type { DragDirection } from '../../layers/gesture';
import { DRAWER_LANGS } from './langs';
import { drawerMorfo } from '../../../morfo/components/drawer';
import { type SomaRuntime, type SomaRuntimePart } from '$soma';
import type { SomaRuntime, SomaRuntimePart } from '../../runtime.svelte';
import type { SemaSignatureOverride } from '$uix/sema';
import type { TimerHandle } from '$timer';

@ -1,5 +1,5 @@
<script lang="ts">
import { bindProps } from '$soma/provider';
import { bindProps } from '../../../provider';
import { mergeProps } from '../../../props';
import { createId } from '../../../id';
import { SwitchProvider } from '../switch-provider.svelte';

@ -1,6 +1,6 @@
import { context } from '../../provider';
import { type Active, type State } from '$libs/reactive';
import type { OptsFromProps } from '$soma/provider';
import type { OptsFromProps } from '../../provider';
import type { OnChangeFn, SomaMouseEvent } from '../../types';
import { Soma } from '../../core/soma.svelte';
import type { SomaRuntime, SomaRuntimePart } from '../../runtime.svelte';

@ -4,7 +4,7 @@ import { context } from '../../provider';
import { readableActive, state, type Active, type ActiveProps, type State } from '$libs/reactive';
import type { SomaMouseEvent } from '../../types';
import { Soma } from '../../core/soma.svelte';
import { type SomaRuntime, type SomaRuntimePart } from '$soma';
import type { SomaRuntime, SomaRuntimePart } from '../../runtime.svelte';
import { Presence } from '../../layers/presence.svelte';
import type { TimerHandle } from '$timer';
import type { Toaster, ToastData, SwipeDirection } from './toaster.svelte';

@ -1,7 +1,5 @@
<script lang="ts">
import {
bindProps
} from '$soma/provider';
import { bindProps } from '../../../provider';
import { mergeProps } from '../../../props';
import { createId } from '../../../id';
import { ToggleProvider } from '../toggle-provider.svelte';

@ -1,7 +1,7 @@
import { Soma } from '../../core/soma.svelte';
import { FieldProvider } from '../field/field-provider.svelte';
import { toggleMorfo } from '../../../morfo/components/toggle';
import type { OptsFromProps } from '$soma/provider';
import type { OptsFromProps } from '../../provider';
import type { OnChangeFn, SomaMouseEvent } from '../../types';
import type { ToggleProps } from './types';
import type { SomaRuntime, SomaRuntimePart } from '../../runtime.svelte';

@ -31,7 +31,7 @@ import { tick } from 'svelte';
import { watch } from 'runed';
import { readableActive, type Active } from '$libs/reactive';
import { isElement, isHTMLElement, contains, type ActiveDom } from '$adom';
import { KEYS } from '$soma/keyboard';
import { KEYS } from '../keyboard';
import type { TimerHandle, TimerScheduler } from '$timer';
// ── Types ────────────────────────────────────────────────────────────────────

@ -11,14 +11,14 @@ import {
size
} from '@floating-ui/dom';
import { attachRef, type RefAttachment } from '$libs/reactive';
import { cssToStyleObj, styleToString } from '$soma/css';
import { cssToStyleObj, styleToString } from '../../css';
import type { ActiveDom } from '$adom';
import { state, readableActive, type Active, type ActiveProps } from '$libs/reactive';
import { isNotNull } from '$soma/types';
import { useId } from '$soma/id';
import { context, type SomaContext } from '$soma/provider';
import type { Arrayable, Direction, StyleProperties } from '$soma/types';
import type { WithRefOpts } from '$soma/provider';
import { isNotNull } from '../../types';
import { useId } from '../../id';
import { context, type SomaContext } from '../../provider';
import type { Arrayable, Direction, StyleProperties } from '../../types';
import type { WithRefOpts } from '../../provider';
import { ElementSize, watch } from 'runed';
import { useFloating } from './use-floating.svelte';

@ -10,7 +10,7 @@ import type {
Active,
State
} from '$libs/reactive';
import type { Arrayable, Direction, StyleProperties } from '$soma/types';
import type { Arrayable, Direction, StyleProperties } from '../../types';
import type { Snippet } from 'svelte';
import type { Align, Boundary, Side } from './placement';

@ -22,7 +22,7 @@ export type {
export { isFunction, isNull, isNotNull, isNumberString } from './guards';
export type { Side, Align, Boundary } from '$soma/layers/floating';
export type { Side, Align, Boundary } from '../layers/floating/placement';
export type {
PrimitiveDivAttributes,

Loading…
Cancel
Save

Powered by TurnKey Linux.