feature: the entry point /shared exports the types and constants a server and its web application share.
Release / release (push) Failing after 17m12s
Release / release (push) Failing after 17m12s
This commit is contained in:
1 parent
3d3a700f11
commit
cd6ef1c120
7 files changed
+42
-6
No files matched your search
@@ -118,3 +118,20 @@ Consequences: Every application of the store works on the same rows and refuses
|
||||
conflicts, and changes of the tables reach them with a release of the toolkit. The objects' keys
|
||||
are in `jsonb`'s order. The store is tested against a real PostgreSQL server, which the release
|
||||
workflow does not have, so `npm test` runs on the developer's machine.
|
||||
|
||||
## ADR-6: A fourth entry point, /shared, exports the shared types and constants
|
||||
|
||||
Status: Accepted
|
||||
|
||||
Context: An application keeps the types of its API in one file that its server and its web
|
||||
application both import. When those types name types of the toolkit, such as `TfModule`, the file
|
||||
must import them from an entry point both sides can resolve: `/server` brings Fastify and `pg`
|
||||
into the web application's type check, `/web` brings React and MUI into the server's.
|
||||
|
||||
Decision: `shared/index.ts` is the entry point `/shared`, built and exported like the other three.
|
||||
It exports the types and constants of `shared/`, the credential types and the types and name
|
||||
patterns of the tfvars store, and no code that needs a peer dependency. `/server` and `/web` keep
|
||||
exporting them too.
|
||||
|
||||
Consequences: An application's shared API types import from `/shared` without the code of either
|
||||
side. A type added to `shared/` is exported from `/shared` as well as from the side that uses it.
|
||||
Reference in new issue
Block a user