@fnndsc/fond 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -6
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @fnndsc/fond
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The pieces every layer of mise needs, whatever the backend: the small, generic base that the engine (`@fnndsc/brasa`), the session host (`@fnndsc/calypso`) and a backend's own packages all stand on.
|
|
4
4
|
|
|
5
5
|
The name is from the kitchen, like the rest of the stack: *fonds de cuisine* are the base stocks a kitchen cooks everything else from.
|
|
6
6
|
|
|
@@ -10,9 +10,9 @@ npm install @fnndsc/fond
|
|
|
10
10
|
|
|
11
11
|
## Why it exists
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
A backend such as ChRIS (CUBE) brings its own client and its own world. The pieces every layer needs, whatever the backend, live here rather than in a backend's package, so a layer that is not about CUBE can use them without loading CUBE (see [docs/backend-neutral.adoc](https://github.com/FNNDSC/mise/blob/main/docs/backend-neutral.adoc)).
|
|
14
14
|
|
|
15
|
-
fond
|
|
15
|
+
fond's one rule: **it depends on nothing in `@fnndsc`**. CI holds it to that (`npm run lint:fond`).
|
|
16
16
|
|
|
17
17
|
## What's in it
|
|
18
18
|
|
|
@@ -22,8 +22,6 @@ fond is where those pieces go instead. Its one rule: **it depends on nothing in
|
|
|
22
22
|
| `errorStack` | The process-wide message stack that failures are reported on, with context-isolated scopes and checkpoints. |
|
|
23
23
|
| `errorStack_configure`, `errorStack_getAllOfType`, `StackMessage` | Configuration, a convenience reader, and the message type. |
|
|
24
24
|
|
|
25
|
-
The steps after this one add the VFS framework (mount interface and dispatcher) and the output sink and surface interfaces the engine and the session host share.
|
|
26
|
-
|
|
27
25
|
## Using `Result`
|
|
28
26
|
|
|
29
27
|
A failure carries no payload of its own: the reason goes on the error stack, where a surface can show it, and the `Result` says only that it failed.
|
|
@@ -83,7 +81,7 @@ const reasons: StackMessage[] = errorStack.checkpoint_drain(mark);
|
|
|
83
81
|
|
|
84
82
|
## One instance, whoever loads it
|
|
85
83
|
|
|
86
|
-
The error stack only works if the whole process shares one. fond is built as CommonJS, so packages that `require` it (cumin) and packages that `import` it (salsa, brasa, calypso) load the same module and so the same stack. `@fnndsc/cumin` re-exports fond's `Result` and `errorStack` rather than keeping copies, so code that
|
|
84
|
+
The error stack only works if the whole process shares one. fond is built as CommonJS, so packages that `require` it (cumin) and packages that `import` it (salsa, brasa, calypso) load the same module and so the same stack. `@fnndsc/cumin` re-exports fond's `Result` and `errorStack` rather than keeping copies, so code that imports them from cumin shares that stack too. If you bundle code that uses fond, keep it to one copy.
|
|
87
85
|
|
|
88
86
|
## Where it sits
|
|
89
87
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file fond: the neutral base under mise's engine and session host.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* The pieces every layer needs, whatever the backend, so a layer that is not
|
|
5
|
+
* about CUBE can use them without loading CUBE's client. fond depends on
|
|
6
|
+
* nothing in `@fnndsc` (docs/backend-neutral.adoc, held by
|
|
7
7
|
* `npm run lint:fond`).
|
|
8
8
|
*
|
|
9
9
|
* @module
|
package/dist/index.js
CHANGED
|
@@ -17,9 +17,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
/**
|
|
18
18
|
* @file fond: the neutral base under mise's engine and session host.
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* The pieces every layer needs, whatever the backend, so a layer that is not
|
|
21
|
+
* about CUBE can use them without loading CUBE's client. fond depends on
|
|
22
|
+
* nothing in `@fnndsc` (docs/backend-neutral.adoc, held by
|
|
23
23
|
* `npm run lint:fond`).
|
|
24
24
|
*
|
|
25
25
|
* @module
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fnndsc/fond",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "The
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "The pieces every layer of mise needs, whatever the backend. Depends on nothing in @fnndsc.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/FNNDSC/mise.git",
|