@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
createAppBootstrap a fougere application.
orderSeedsSeeds in dependency order: a ref() target before its referrer.
runSeedsPlants seeds in the order given, through the storage.
seedingThe boot's seeding step, named so a host can replace it.
AppLifecycleRuns application extensions up in order and down in reverse order.
checkingThe schema check every boot runs: the database is read against the entities, never written.
migratingThe schema slot filled by a process that writes its own schema — its database is born with it.
defineFougereTypes a fougere.config.ts while keeping its literals.
Protocols
servesWhether protocols: names this one — read by a host that imports no adapter, so by name.
statesModuleWhether a key names a module rather than a frond.
keyedFrondEntriesEvery frond the config states, the ones inheriting from nothing first.
nestedThe tree a boot stamps, for a reader that does not boot.
WITHOUT_GLOBAL_INSTALL
buildGraphEach entity of the fronds, with what it names and what names it.
clusterEntitiesThe entities a ref() joins, whichever way it points, each group named by its most referenced.
suggestSplitSplits one big cluster at the entity with the fewest cross-links.
MirrorA repository that fills itself from a source it cannot query: its author writes pull, refresh(since) writes every page.
PresentPresent<Order>: each method is a computed field, handed the page and answering one value per row.
presentedFieldsThe fields a Present<Post> chain computes — what GraphQL types, beside the boot that runs them.
CollectCollect<User>: collect fills a parameter of that type, missing refuses when a required one found nothing.
RepositoryThe 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.
InvocationCanonical invocation shared by every entry and transport.
CallOne normalized request, frozen: where it goes and what the caller supplied.
RouteAddressCanonical identity of one callable operation.
DispatchLifecyclePublishes dispatch transitions without participating in dispatch decisions.
DispatcherRuns 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.
releaseThe rows that name a key, every refusal asked first, then taken out or emptied deepest FIRST.
releasingWhat a release asks the boot, built once per app — the same RowHosts the guard reads.
JOURNAL
DispatchEventImmutable transition observed across one dispatch lifecycle.
DoorEventImmutable transition of one request at a door, observed beside the calls it makes.
StateThe caller's state, read and written by the names state: declares; signed before it leaves. Ex: addToCart(id: Product['id'], state: State).
States
ambient
DoorRequestOne request a door received — a REST request, a GraphQL document, a command — and not a call: it may make several.
answerAtThe one cycle every door runs.
PageWhat a paged operation answers: the rows, and what the storage said about the rest.
asPageThe value read as a page, or nothing; a row with a field named items stays a row.
driftOfWhat a consumer's synced copy no longer matches in what the producer serves.
agreesWhether anything at all separates the two cards.
explainThe drift, in the words a deploy needs.
wordsOfgetOrCreatePost → ['get', 'or', 'create', 'post']; hash never becomes has.
Verbs
resolveEffectiveOperationsResolve the complete operation model without starting the application.
FougereErrorA refusal, and which one; Code narrows to what an operation can refuse.
ErrorCode
validationErrorsOfThe refusals behind a VALIDATION_FAILED, or nothing.
assertIdentityCardThe shape a card must have to be walked — fronds, and each frond's entities and facades.
RPC_ADDRESS
ENVELOPE_BYTES
maxBodyBytes
maxFrameBytesWhat a forwarding process may frame: the caller's limit, plus the envelope's room.
readWithinA body as text, refused past max: on its declared length first, then while counting.
setMaxBodyBytesSet by applyConfig from maxBodyBytes:.
OPERATION_KINDS
CARDINALITIES
PLACEMENTS
createLocalRunnerBuild the local runner — the reference realization of Transport.
createAppRunnerThe app runner: a call follows the app's topology, local or remote.
frondState a frond without reading a disk.
identityCardOfSerialize what the app hosts, for one audience.
declaredTopologyOfRead from the config and the scan, never from a call, so nothing has to answer for it.
refusalsOf
addressOf
listensWhether an op is called by an announcement, through a Fact<T> or a Pipe<T>.
callValueOfThe call value, from a class and a verb or from a raw address. Ex: callValueOf(Post, 'list', { query }).
toHttpErrorMap any thrown error to { status, body } for HTTP bridges.
toPublicErrorSerialize an application error for an untrusted caller.
LineBufferWhere one boot's lines wait until a destination exists; bounded, dropping the oldest.
Logger
envLevelThe level the PROCESS was started with.
formatted
logLevelWhat the level is now — the dual, so a reload can report what it changed.
setLogLevelSet the level for every logger in this process, at once.
argumentTextAn argument of a log line, as text.
LogLineOne log line, announced like any other fact.
CARRIES_LINE
LOG_LINE
applyConfigWhat a re-read config changes in a running process.
isChange
TurnsWrites on one key, one after the other: a row lock for a store that has none.
StorageA 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); } }.
togetherKeyOfThe container key of a frame, spelled as the type is written. Ex: [['Account', 'Ledger']] → Together<[Account, Ledger]>.
hasForeignKeyWhether one source holds both rows and keeps the relation between them as a foreign key.
sourceViewOfWhat a source holds of these fronds — every entity, or the ones holds keeps and the rest named.
Sources
Transports
storageOver
BootRefusalA boot stopped by what it was handed rather than by a bug; a host shows it without a stack.
FougereValueWhere a source that holds rows keeps a value: one row per entity, keyed by its name.
FOUGERE_VALUE
FougereTargetA row another source holds, as the source naming it marks it: live while writes name it, gone once its release began.
FOUGERE_TARGET
markOfThe id a target's mark is kept under — user#ada.
Env
valuingReads, completes, judges and registers each value in its frond's scope.
DEFAULT_CONVENTIONS
frondDirsOfThe frond vocabulary — every directory the scan reads.
frondPackageThe package name a frond answers to.
resolveConventionsThe convention, with a project's exceptions folded in.
isScannedWhether the frond was read from this project's sources, rather than written with frond().
AUTH
FrondsWhat this app hosts, with the questions everyone was asking it by hand.
verifyWhether this app survives being split into processes.
signEnvelopeSign one call, whole.
verifyEnvelopeEstablish the caller, or throw.
identityFromEnvWhat 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
ExtensionOne process-level extension and its lifecycle.
ProtocolConfigThe protocols this app serves — a key per protocol, its options as the adapter states them.
ProtocolTypeA protocol an adapter serves: what its entry admits. A host reads the rest by name.
FougereProtocols
FougereOperationProtocols
FougereFrondProtocols
FougereConfig
ServerConfigWhat stands around the requests fougere serve answers beside its envelope, outside in.
ServerMiddlewareA middleware in srvx's shape. Ex: cors().
FrondEntriesWhat the config says about the fronds this app is made of.
FrondEntryAn entry: { remote }, { options }, or the frond itself. Ex: auth: betterAuth({ … }).
KeyedFrondEntryOne entry of the config, read whole.
AnswerForWhat may answer a port — its own realizations, or any class name where nothing was generated.
FougereNamesThe names the scan found, per kind. Augmented from the generated file, empty otherwise.
FougerePortsEach port, and the classes that extend it.
NameOfOne kind's union of names, or string where nothing was generated.
PortChoiceThe ports of this app, each mapped to what may answer it.
FrondConfig
DeclaredOperationAn operation written by hand: what TypeScript erases of its method. Ex: publish: { params: { id: [Post, 'id'] }, output: Post }.
DeclaredParamA parameter, required unless it says otherwise.
DeclaredTypeWhat a parameter is — a schema, a field of an entity ([Post, 'id']), a primitive, or State, the caller's kept state.
OperationOverridePer-operation override.
DomainCluster
EntityNode
RefreshedWhat one refresh did — enough to log it, and to decide whether to run again.
PresenterViewsThe view a computed field emits, one or many. Ex: OrderItemView, [OrderItemView].
InvocationContext
PartialInvocation
ReleasingWhat the guard hands a release: who depends on an entity, and how to reach their rows.
DependentA ref() read from the TARGET's side: rows that name it, and what becomes of them.
JournalWhat writes a release down while it happens, so a sweep can finish what a stopped process began.
DoorStage
DeclaredStateOne name of state:, its keeper resolved and what it is told judged.
KeeperEntryOne name a keeper keeps, and what state: told it.
StateKeeperA way to keep a caller's state between two requests, handed every name it keeps at once. Ex: a cookie, a session.
StorageForWhere a keeper reaches the rows of the fronds it brought.
WrittenNameA name the request's calls wrote, signed — undefined forgets it.
FougereStates
StateEntryOne name of state: — kept one way, with what that way is told: { cookie: { maxAge: '7d' } }.
AmbientWhat runs now, carried without being handed along; each package keeps its own slot.
SlotOne value carried across awaits — what the code running now is inside of.
AnsweringRunning one request through a door — app.answer, or answerAt for a host holding no app.
DoorA way in, as the package that brings it writes it.
DoorCycleWhat the cycle needs of the app: where a request is entered, who watches it, who stands around it.
DoorOutcomeWhat a door's calls answered, or the refusal it is to say instead — already fit for its caller.
CallPageOne page of the ring.
CallRecordWhat crosses the facade.
CardDriftWhat separates the copy a consumer holds from what the producer actually serves.
OperationContractThe contract of one operation — everything the façade needs to serve a call.
OperationsMapMap of operation name → its contract.
ParamOne parameter of a signature.
TypeRefA type reference — primitives, entities, arrays, generics.
EffectiveOperation
ModuleLoaderModule loader — can be swapped (e.g.
AppMiddlewareA middleware answers what the chain answered: the same type, whatever it does with the value.
AppNextWhat a middleware holds: the rest of the chain, and the answer it will hand back.
OperationContext
OperationKind
Cardinality
Placement
DeclaredA class on its own — a port, which is abstract, included — or a class with what it asks for.
DeclaredSubjectWhat a subject needs beyond its class, when its constructor names a frame or a port.
FrondDeclarationWhat a declaration states about one frond. Everything else is derived from the classes.
RefusableThe little of an operation this reads — so a card op and an effective one both fit.
BindingOne argument's source, as the plan states it.
AddressesThe addresses this app answers at, or any string until a scan has said otherwise.
AnswerWhat one operation of a handler answers, unwrapped; a storage's list reads as a page.
AnyHandlerA facade whose operations no type describes — an ungenerated project's, and a form's.
FacadeNameOne facade: its address, as a literal, and the handler that answers there.
FougereHandlersThe handler behind each address, as the scan writes it.
FougereOperationsWhat one facade answers for, keyed address.op — surface:address.op for a named surface.
HandlerOfThe handler that answers at one address, or any facade when nothing was generated.
RefusedWhat one call can come back refusing, the frond's codes and the framework's.
RowsThe row inside what an operation answers: a list, a page or a single row.
FacadeThe facade in front of a handler: it takes what the handler takes, and always answers a promise.
FrondCallTarget of a call — which façade operation, wherever it lives.
TransportA transport executes a call somewhere else. Failures surface as thrown FougereError.
IdentityCardWhat an app hosts — the wire projection of its scanned fronds.
CardOpOne operation, as a caller from another process meets it.
TopologyReportThe shape of the system as ONE process discovered it — the answer to rpc.topology.
FrondPlacementA frond this process knows about, and whether it runs here.
EdgeOne frond calling another — an edge of the graph, counted where the call was made.
DeclaredTopologyWhat the config says, beside what the runtime saw.
DeclaredFrondA frond the config knows of, and where it says to reach it.
DeclaredEdgeOne frond reaching another, read from a handler's dependencies rather than from a call.
EmitWhat an emitter injects; partial, because announcing fills the fact's created() fields.
FactWhat a subscriber accepts; what it answers reaches only an announcer that waits.
PipeThe same fact before it is final: an op taking one answers what every subscriber then receives.
LogRecordOne line, before it was formatted for a terminal.
LogSinkWhere a line goes once it is written — @fougere/log ships one, observability another.
RenderedOne line, ready for a terminal: the console arguments and the method that takes them.
ListOptions
ListResultWhat list() answers: an array carrying what the storage said about the rest of the rows.
StorageFactoryBuilds the storage of one entity; called by the boot for each.
TogetherTogether<[Account, Ledger]> — writes that stand or fall as one.
ChangeA row computed from the one it replaces, while no other write reaches that row.
ConstraintA promise the judge at the facade cannot keep, because it is about rows it never sees.
SourceA place rows live, whatever realizes it.
SourceConfigOne entry of sources: — what its type admits, and the entities it holds.
SourceViewThe app as ONE source sees it: the entities it holds, by the name the scan wrote down.
SourceTypeA source type: what its entry admits, and how a place is opened from one.
TransportTypeWhat carries a call to an address whose scheme names it. Ex: http for remote: 'http://…'.
FougereSources
StoreInstances addressed by key — what an adapter supplies, and all of it.
ValuesOne instance, as every realization hands it over.
AppThe App object returned by createApp().
CreateAppOptionsOptions for createApp().
ScanResultResult of scanning a project directory.
DiagnosticOne thing that does not hold, in the terms of whoever has to fix it.
ValueSourcesThe entities sources: holds as one value each.
Conventions
ConventionsInputWhat a fougere.config.ts may state: only the names that differ.
CollectorEntryA discovered collector (resolves handler input params from invocation context).
EntityEntry
FrondDescriptor
FrondSourceWhere a frond lives on disk.
HandlerEntryA discovered handler (controls what a service exposes).
PresenterEntryA discovered presenter (computed fields for an entity's output).
PresenterFieldMetaReturn type metadata for a presenter computed field.
ProviderEntryA class of services/, injected by type.
SeedEntryA discovered seed file (array of records or async factory).
AuthRuntimeWhat an auth extension registers under {@link AUTH} once it has risen.
MisplacedA subject declared in one frond and reached from another — the rules below find no other kind.
CallIdentityThe two halves a boot needs, and the environment they come from.
FrondIdentityWhat a deployment hands a frond that CALLS: its own key, and the root's word for it.
SignedCallEverything a caller's envelope covers — the call as the sender meant it.
PluggedWhat answers one extension point in this app, as a report.
Built with Fougere and Nuxt, hosted on GitHub Pages.