refactor(layout): ranger les modules par destin à la migration
Les 25 modules étaient à plat, nommés d'après ce qu'ils font mécaniquement (`store-registry`, `read-model`, `reach`, `caps`). Rien dans l'arborescence ne disait lesquels DEVIENDRONT le vrai SDK, lesquels tiennent lieu du travail que le verifier fera nativement, et lesquels n'existent que parce qu'un wallet est partagé — trois destins sans rapport. Quatre dossiers, les deux fichiers d'entrée restant à la racine pour que l'`exports` du paquet et le code du consommateur ne bougent pas : - `model/` — le modèle d'adressage de la cible, transcrit : vocabulaire pur, pas d'I/O. Survit comme connaissance. - `surface/` — ce que l'app touche, chaque symbole ayant un pendant cible documenté. Supprimé quand l'alias bascule ; le code de l'app est inchangé. - `emulated-verifier/` — les doublures de ce que le verifier fait nativement : possession, dépôt des caps, frontière, non-livraison, traitement des inbox, registres de branche, ouverture de repo. **C'est le dossier où diverger du modèle est possible.** Le préfixe `emulated-` porte le sens : tient lieu de, jamais est — cette bibliothèque ne réside dans aucune couche de la cible, elle les référence. - `shared-wallet/` — n'existe que parce qu'un wallet héberge toutes les identités. Aucun pendant, rien sur quoi s'aligner ; sa seule loi est de rester invisible depuis `surface/`. S'évapore, remplacé par rien. `store-registry-api.ts` devient `surface/placement.ts` : il faisait déjà à la main ce que la frontière de dossier fait structurellement — c'est la meilleure preuve interne du bien-fondé de ce rangement. Ce commit ne fait que déplacer et recâbler les imports (src, test, e2e). Les scissions des modules à cheval suivent. 157 tests unitaires, typecheck src/test/e2e vert.
This commit is contained in:
@@ -20,24 +20,24 @@
|
||||
* away is visible at the import line.
|
||||
*/
|
||||
|
||||
export * from "./types";
|
||||
export { useShape } from "./use-shape";
|
||||
export { watchShape } from "./watch-shape";
|
||||
export type { ShapeQuery, ShapeObservable } from "./watch-shape";
|
||||
export { init, initNg } from "./lifecycle";
|
||||
export * as inbox from "./inbox";
|
||||
export * as docs from "./docs";
|
||||
export { subscribeDoc, subscribeDocs, docChangeType } from "./subscribe";
|
||||
export type { DocChange, DocChangeType, Unsubscribe } from "./subscribe";
|
||||
export * as readModel from "./read-model";
|
||||
export type { UnionSubject } from "./read-model";
|
||||
export * as storeRegistry from "./store-registry-api";
|
||||
export * from "./model/types";
|
||||
export { useShape } from "./surface/use-shape";
|
||||
export { watchShape } from "./surface/watch-shape";
|
||||
export type { ShapeQuery, ShapeObservable } from "./surface/watch-shape";
|
||||
export { init, initNg } from "./surface/lifecycle";
|
||||
export * as inbox from "./surface/inbox";
|
||||
export * as docs from "./surface/docs";
|
||||
export { subscribeDoc, subscribeDocs, docChangeType } from "./surface/subscribe";
|
||||
export type { DocChange, DocChangeType, Unsubscribe } from "./surface/subscribe";
|
||||
export * as readModel from "./surface/read-model";
|
||||
export type { UnionSubject } from "./surface/read-model";
|
||||
export * as storeRegistry from "./surface/placement";
|
||||
|
||||
// SPARQL injection-safety helpers — so the app can reuse the same escaping /
|
||||
// validation when it builds SPARQL by interpolation. `escapeLiteral` for string
|
||||
// literals, `escapeIri` to embed untrusted values in an IRI, `assertNuri` to
|
||||
// validate trusted-shaped NURIs before embedding them in an IRI.
|
||||
export { escapeLiteral, escapeIri, assertNuri } from "./sparql";
|
||||
export { escapeLiteral, escapeIri, assertNuri } from "./surface/sparql";
|
||||
|
||||
// NURI type guards — the doors through which an app's own `string` (read back
|
||||
// from storage, a URL, JSON, a form) becomes a typed `Nuri` or `ReadCap`. `Nuri`
|
||||
@@ -46,7 +46,7 @@ export { escapeLiteral, escapeIri, assertNuri } from "./sparql";
|
||||
// particular, it cannot pass a bare reference where a cap is required. Narrow
|
||||
// with these rather than casting: a cast re-opens exactly the confusion the
|
||||
// types exist to close.
|
||||
export { isNuri, hasReadCap } from "./nuri";
|
||||
export { isNuri, hasReadCap } from "./model/nuri";
|
||||
|
||||
// SDK type re-exports — so the app imports these from @ng-eventually/client too,
|
||||
// not from @ng-org. `export type` is ERASED at build, so this adds NO runtime
|
||||
@@ -55,7 +55,7 @@ export type { ShapeType, BaseType, Schema } from "@ng-org/shex-orm";
|
||||
export type { DeepSignalSet } from "@ng-org/alien-deepsignals";
|
||||
export type { NG } from "@ng-org/web";
|
||||
|
||||
import { makeNg } from "./ng-proxy";
|
||||
import { makeNg } from "./surface/ng-proxy";
|
||||
|
||||
/** SDK-identical `ng` (wrapped). Drop-in replacement for `@ng-org/web`'s `ng`. */
|
||||
export const ng: Record<string, any> = makeNg();
|
||||
|
||||
Reference in New Issue
Block a user