@fougere/core
The core — scan, call contract, façades, remote stand-ins.
Entries: @fougere/core · @fougere/core/node · @fougere/core/contract · @fougere/core/descriptor · @fougere/core/tsconfig
What you import
| name | |
|---|---|
createApp | Bootstrap a fougere application. |
orderSeeds | Seeds in dependency order: a ref() target before its referrer. |
runSeeds | Plants seeds in the order given, through the storage. |
seeding | The boot's seeding step, named so a host can replace it. |
AppLifecycle | Runs application extensions up in order and down in reverse order. |
checking | The schema check every boot runs: the database is read against the entities, never written. |
migrating | The schema slot filled by a process that writes its own schema — its database is born with it. |
defineFougere | Types a fougere.config.ts while keeping its literals. |
Protocols | |
serves | Whether protocols: names this one — read by a host that imports no adapter, so by name. |
statesModule | Whether a key names a module rather than a frond. |
keyedFrondEntries | Every frond the config states, the ones inheriting from nothing first. |
nested | The tree a boot stamps, for a reader that does not boot. |
WITHOUT_GLOBAL_INSTALL | |
buildGraph | Each entity of the fronds, with what it names and what names it. |
clusterEntities | The entities a ref() joins, whichever way it points, each group named by its most referenced. |
suggestSplit | Splits one big cluster at the entity with the fewest cross-links. |
Mirror | A repository that fills itself from a source it cannot query: its author writes pull, refresh(since) writes every page. |
Present | Present<Order>: each method is a computed field, handed the page and answering one value per row. |
presentedFields | The fields a Present<Post> chain computes — what GraphQL types, beside the boot that runs them. |
Collect | Collect<User>: collect fills a parameter of that type, missing refuses when a required one found nothing. |
Repository | The rows of an entity; extended by a handler, it serves list, findById, create, update, delete. Ex: Repository<Account, Ledger> owns both tables and forwards nothing. |
Invocation | Canonical invocation shared by every entry and transport. |
Call | One normalized request, frozen: where it goes and what the caller supplied. |
RouteAddress | Canonical identity of one callable operation. |
DispatchLifecycle | Publishes dispatch transitions without participating in dispatch decisions. |
Dispatcher | Runs every call through the same lifecycle, and the port a link stands in front of. Ex: Dispatcher for its frond, Dispatcher<PostHandler> for that handler. |
release | The rows that name a key, every refusal asked first, then taken out or emptied deepest FIRST. |
releasing | What a release asks the boot, built once per app — the same RowHosts the guard reads. |
JOURNAL | |
DispatchEvent | Immutable transition observed across one dispatch lifecycle. |
DoorEvent | Immutable transition of one request at a door, observed beside the calls it makes. |
State | The caller's state, read and written by the names state: declares; signed before it leaves. Ex: addToCart(id: Product['id'], state: State). |
States | |
ambient | |
DoorRequest | One request a door received — a REST request, a GraphQL document, a command — and not a call: it may make several. |
answerAt | The one cycle every door runs. |
Page | What a paged operation answers: the rows, and what the storage said about the rest. |
asPage | The value read as a page, or nothing; a row with a field named items stays a row. |
driftOf | What a consumer's synced copy no longer matches in what the producer serves. |
agrees | Whether anything at all separates the two cards. |
explain | The drift, in the words a deploy needs. |
wordsOf | getOrCreatePost → ['get', 'or', 'create', 'post']; hash never becomes has. |
Verbs | |
resolveEffectiveOperations | Resolve the complete operation model without starting the application. |
FougereError | A refusal, and which one; Code narrows to what an operation can refuse. |
ErrorCode | |
validationErrorsOf | The refusals behind a VALIDATION_FAILED, or nothing. |
assertIdentityCard | The shape a card must have to be walked — fronds, and each frond's entities and facades. |
RPC_ADDRESS | |
ENVELOPE_BYTES | |
maxBodyBytes | |
maxFrameBytes | What a forwarding process may frame: the caller's limit, plus the envelope's room. |
readWithin | A body as text, refused past max: on its declared length first, then while counting. |
setMaxBodyBytes | Set by applyConfig from maxBodyBytes:. |
OPERATION_KINDS | |
CARDINALITIES | |
PLACEMENTS | |
createLocalRunner | Build the local runner — the reference realization of Transport. |
createAppRunner | The app runner: a call follows the app's topology, local or remote. |
frond | State a frond without reading a disk. |
identityCardOf | Serialize what the app hosts, for one audience. |
declaredTopologyOf | Read from the config and the scan, never from a call, so nothing has to answer for it. |
refusalsOf | |
addressOf | |
listens | Whether an op is called by an announcement, through a Fact<T> or a Pipe<T>. |
callValueOf | The call value, from a class and a verb or from a raw address. Ex: callValueOf(Post, 'list', { query }). |
toHttpError | Map any thrown error to { status, body } for HTTP bridges. |
toPublicError | Serialize an application error for an untrusted caller. |
LineBuffer | Where one boot's lines wait until a destination exists; bounded, dropping the oldest. |
Logger | |
envLevel | The level the PROCESS was started with. |
formatted | |
logLevel | What the level is now — the dual, so a reload can report what it changed. |
setLogLevel | Set the level for every logger in this process, at once. |
argumentText | An argument of a log line, as text. |
LogLine | One log line, announced like any other fact. |
CARRIES_LINE | |
LOG_LINE | |
applyConfig | What a re-read config changes in a running process. |
isChange | |
Turns | Writes on one key, one after the other: a row lock for a store that has none. |
Storage | A storage standing in front of another: the base a wrapper extends, forwarding what it does not override. Ex: class Audit extends Storage { constructor(private inner: Storage) { super(inner); } }. |
togetherKeyOf | The container key of a frame, spelled as the type is written. Ex: [['Account', 'Ledger']] → Together<[Account, Ledger]>. |
hasForeignKey | Whether one source holds both rows and keeps the relation between them as a foreign key. |
sourceViewOf | What a source holds of these fronds — every entity, or the ones holds keeps and the rest named. |
Sources | |
Transports | |
storageOver | |
BootRefusal | A boot stopped by what it was handed rather than by a bug; a host shows it without a stack. |
FougereValue | Where a source that holds rows keeps a value: one row per entity, keyed by its name. |
FOUGERE_VALUE | |
FougereTarget | A row another source holds, as the source naming it marks it: live while writes name it, gone once its release began. |
FOUGERE_TARGET | |
markOf | The id a target's mark is kept under — user#ada. |
Env | |
valuing | Reads, completes, judges and registers each value in its frond's scope. |
DEFAULT_CONVENTIONS | |
frondDirsOf | The frond vocabulary — every directory the scan reads. |
frondPackage | The package name a frond answers to. |
resolveConventions | The convention, with a project's exceptions folded in. |
isScanned | Whether the frond was read from this project's sources, rather than written with frond(). |
AUTH | |
Fronds | What this app hosts, with the questions everyone was asking it by hand. |
verify | Whether this app survives being split into processes. |
signEnvelope | Sign one call, whole. |
verifyEnvelope | Establish the caller, or throw. |
identityFromEnv | What the deployment injected, read once at boot. |
Types
TypeScript types only — they do not run. Import them with import type to type your own code: a variable, a parameter, an option object.
| name | |
|---|---|
Extension | One process-level extension and its lifecycle. |
ProtocolConfig | The protocols this app serves — a key per protocol, its options as the adapter states them. |
ProtocolType | A protocol an adapter serves: what its entry admits. A host reads the rest by name. |
FougereProtocols | |
FougereOperationProtocols | |
FougereFrondProtocols | |
FougereConfig | |
ServerConfig | What stands around the requests fougere serve answers beside its envelope, outside in. |
ServerMiddleware | A middleware in srvx's shape. Ex: cors(). |
FrondEntries | What the config says about the fronds this app is made of. |
FrondEntry | An entry: { remote }, { options }, or the frond itself. Ex: auth: betterAuth({ … }). |
KeyedFrondEntry | One entry of the config, read whole. |
AnswerFor | What may answer a port — its own realizations, or any class name where nothing was generated. |
FougereNames | The names the scan found, per kind. Augmented from the generated file, empty otherwise. |
FougerePorts | Each port, and the classes that extend it. |
NameOf | One kind's union of names, or string where nothing was generated. |
PortChoice | The ports of this app, each mapped to what may answer it. |
FrondConfig | |
DeclaredOperation | An operation written by hand: what TypeScript erases of its method. Ex: publish: { params: { id: [Post, 'id'] }, output: Post }. |
DeclaredParam | A parameter, required unless it says otherwise. |
DeclaredType | What a parameter is — a schema, a field of an entity ([Post, 'id']), a primitive, or State, the caller's kept state. |
OperationOverride | Per-operation override. |
DomainCluster | |
EntityNode | |
Refreshed | What one refresh did — enough to log it, and to decide whether to run again. |
PresenterViews | The view a computed field emits, one or many. Ex: OrderItemView, [OrderItemView]. |
InvocationContext | |
PartialInvocation | |
Releasing | What the guard hands a release: who depends on an entity, and how to reach their rows. |
Dependent | A ref() read from the TARGET's side: rows that name it, and what becomes of them. |
Journal | What writes a release down while it happens, so a sweep can finish what a stopped process began. |
DoorStage | |
DeclaredState | One name of state:, its keeper resolved and what it is told judged. |
KeeperEntry | One name a keeper keeps, and what state: told it. |
StateKeeper | A way to keep a caller's state between two requests, handed every name it keeps at once. Ex: a cookie, a session. |
StorageFor | Where a keeper reaches the rows of the fronds it brought. |
WrittenName | A name the request's calls wrote, signed — undefined forgets it. |
FougereStates | |
StateEntry | One name of state: — kept one way, with what that way is told: { cookie: { maxAge: '7d' } }. |
Ambient | What runs now, carried without being handed along; each package keeps its own slot. |
Slot | One value carried across awaits — what the code running now is inside of. |
Answering | Running one request through a door — app.answer, or answerAt for a host holding no app. |
Door | A way in, as the package that brings it writes it. |
DoorCycle | What the cycle needs of the app: where a request is entered, who watches it, who stands around it. |
DoorOutcome | What a door's calls answered, or the refusal it is to say instead — already fit for its caller. |
CallPage | One page of the ring. |
CallRecord | What crosses the facade. |
CardDrift | What separates the copy a consumer holds from what the producer actually serves. |
OperationContract | The contract of one operation — everything the façade needs to serve a call. |
OperationsMap | Map of operation name → its contract. |
Param | One parameter of a signature. |
TypeRef | A type reference — primitives, entities, arrays, generics. |
EffectiveOperation | |
ModuleLoader | Module loader — can be swapped (e.g. |
AppMiddleware | A middleware answers what the chain answered: the same type, whatever it does with the value. |
AppNext | What a middleware holds: the rest of the chain, and the answer it will hand back. |
OperationContext | |
OperationKind | |
Cardinality | |
Placement | |
Declared | A class on its own — a port, which is abstract, included — or a class with what it asks for. |
DeclaredSubject | What a subject needs beyond its class, when its constructor names a frame or a port. |
FrondDeclaration | What a declaration states about one frond. Everything else is derived from the classes. |
Refusable | The little of an operation this reads — so a card op and an effective one both fit. |
Binding | One argument's source, as the plan states it. |
Addresses | The addresses this app answers at, or any string until a scan has said otherwise. |
Answer | What one operation of a handler answers, unwrapped; a storage's list reads as a page. |
AnyHandler | A facade whose operations no type describes — an ungenerated project's, and a form's. |
FacadeName | One facade: its address, as a literal, and the handler that answers there. |
FougereHandlers | The handler behind each address, as the scan writes it. |
FougereOperations | What one facade answers for, keyed address.op — surface:address.op for a named surface. |
HandlerOf | The handler that answers at one address, or any facade when nothing was generated. |
Refused | What one call can come back refusing, the frond's codes and the framework's. |
Rows | The row inside what an operation answers: a list, a page or a single row. |
Facade | The facade in front of a handler: it takes what the handler takes, and always answers a promise. |
FrondCall | Target of a call — which façade operation, wherever it lives. |
Transport | A transport executes a call somewhere else. Failures surface as thrown FougereError. |
IdentityCard | What an app hosts — the wire projection of its scanned fronds. |
CardOp | One operation, as a caller from another process meets it. |
TopologyReport | The shape of the system as ONE process discovered it — the answer to rpc.topology. |
FrondPlacement | A frond this process knows about, and whether it runs here. |
Edge | One frond calling another — an edge of the graph, counted where the call was made. |
DeclaredTopology | What the config says, beside what the runtime saw. |
DeclaredFrond | A frond the config knows of, and where it says to reach it. |
DeclaredEdge | One frond reaching another, read from a handler's dependencies rather than from a call. |
Emit | What an emitter injects; partial, because announcing fills the fact's created() fields. |
Fact | What a subscriber accepts; what it answers reaches only an announcer that waits. |
Pipe | The same fact before it is final: an op taking one answers what every subscriber then receives. |
LogRecord | One line, before it was formatted for a terminal. |
LogSink | Where a line goes once it is written — @fougere/log ships one, observability another. |
Rendered | One line, ready for a terminal: the console arguments and the method that takes them. |
ListOptions | |
ListResult | What list() answers: an array carrying what the storage said about the rest of the rows. |
StorageFactory | Builds the storage of one entity; called by the boot for each. |
Together | Together<[Account, Ledger]> — writes that stand or fall as one. |
Change | A row computed from the one it replaces, while no other write reaches that row. |
Constraint | A promise the judge at the facade cannot keep, because it is about rows it never sees. |
Source | A place rows live, whatever realizes it. |
SourceConfig | One entry of sources: — what its type admits, and the entities it holds. |
SourceView | The app as ONE source sees it: the entities it holds, by the name the scan wrote down. |
SourceType | A source type: what its entry admits, and how a place is opened from one. |
TransportType | What carries a call to an address whose scheme names it. Ex: http for remote: 'http://…'. |
FougereSources | |
Store | Instances addressed by key — what an adapter supplies, and all of it. |
Values | One instance, as every realization hands it over. |
App | The App object returned by createApp(). |
CreateAppOptions | Options for createApp(). |
ScanResult | Result of scanning a project directory. |
Diagnostic | One thing that does not hold, in the terms of whoever has to fix it. |
ValueSources | The entities sources: holds as one value each. |
Conventions | |
ConventionsInput | What a fougere.config.ts may state: only the names that differ. |
CollectorEntry | A discovered collector (resolves handler input params from invocation context). |
EntityEntry | |
FrondDescriptor | |
FrondSource | Where a frond lives on disk. |
HandlerEntry | A discovered handler (controls what a service exposes). |
PresenterEntry | A discovered presenter (computed fields for an entity's output). |
PresenterFieldMeta | Return type metadata for a presenter computed field. |
ProviderEntry | A class of services/, injected by type. |
SeedEntry | A discovered seed file (array of records or async factory). |
AuthRuntime | What an auth extension registers under {@link AUTH} once it has risen. |
Misplaced | A subject declared in one frond and reached from another — the rules below find no other kind. |
CallIdentity | The two halves a boot needs, and the environment they come from. |
FrondIdentity | What a deployment hands a frond that CALLS: its own key, and the root's word for it. |
SignedCall | Everything a caller's envelope covers — the call as the sender meant it. |
Plugged | What answers one extension point in this app, as a report. |