@executablemd/runtime 0.3.0 → 0.4.0
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/esm/apis.js +1 -13
- package/esm/test/stubs.js +2 -2
- package/package.json +1 -1
- package/types/apis.d.ts +1 -1
- package/types/test/stubs.d.ts +2 -2
package/esm/apis.js
CHANGED
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
*
|
|
50
50
|
* Middleware is **scoped** — it only affects operations within the
|
|
51
51
|
* current Effection scope and its children. Install before calling
|
|
52
|
-
* `
|
|
52
|
+
* `execute()` or `durableRun()`.
|
|
53
53
|
*
|
|
54
54
|
* ## Test stubs
|
|
55
55
|
*
|
|
@@ -63,9 +63,6 @@ import { fetch as effectionFetch } from "@effectionx/fetch";
|
|
|
63
63
|
import { readTextFile as fsReadTextFile, stat as fsStat, globToRegExp, walk } from "@effectionx/fs";
|
|
64
64
|
import { exec as processExec } from "@effectionx/process";
|
|
65
65
|
import { each, race, sleep } from "effection";
|
|
66
|
-
// ---------------------------------------------------------------------------
|
|
67
|
-
// Private helpers
|
|
68
|
-
// ---------------------------------------------------------------------------
|
|
69
66
|
function* withTimeout(label, timeout, operation) {
|
|
70
67
|
if (timeout === undefined) {
|
|
71
68
|
return yield* operation;
|
|
@@ -81,9 +78,6 @@ function* withTimeout(label, timeout, operation) {
|
|
|
81
78
|
})(),
|
|
82
79
|
]));
|
|
83
80
|
}
|
|
84
|
-
// ---------------------------------------------------------------------------
|
|
85
|
-
// Context APIs
|
|
86
|
-
// ---------------------------------------------------------------------------
|
|
87
81
|
export const API = {
|
|
88
82
|
/**
|
|
89
83
|
* Subprocess execution.
|
|
@@ -220,12 +214,6 @@ export const API = {
|
|
|
220
214
|
},
|
|
221
215
|
}),
|
|
222
216
|
};
|
|
223
|
-
// ---------------------------------------------------------------------------
|
|
224
|
-
// Convenience operation exports
|
|
225
|
-
//
|
|
226
|
-
// Use these for normal operation calls. Use API.* only when installing
|
|
227
|
-
// middleware with .around().
|
|
228
|
-
// ---------------------------------------------------------------------------
|
|
229
217
|
export const exec = API.Process.operations.exec;
|
|
230
218
|
export const readTextFile = API.Fs.operations.readTextFile;
|
|
231
219
|
export const stat = API.Fs.operations.stat;
|
package/esm/test/stubs.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* These helpers install `around()` middleware on the runtime context APIs
|
|
5
5
|
* to replace real I/O with in-memory implementations. They are scoped to
|
|
6
|
-
* the current Effection scope — call them before `
|
|
6
|
+
* the current Effection scope — call them before `execute()` or
|
|
7
7
|
* `durableRun()` in your test body.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* yield* useStubFs({ "doc.md": "# Hello\n" });
|
|
15
15
|
* yield* useEchoExec();
|
|
16
16
|
*
|
|
17
|
-
* const execution = yield*
|
|
17
|
+
* const execution = yield* execute({ docPath: "doc.md", stream });
|
|
18
18
|
* const output = yield* execution;
|
|
19
19
|
* });
|
|
20
20
|
* ```
|
package/package.json
CHANGED
package/types/apis.d.ts
CHANGED
package/types/test/stubs.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* These helpers install `around()` middleware on the runtime context APIs
|
|
5
5
|
* to replace real I/O with in-memory implementations. They are scoped to
|
|
6
|
-
* the current Effection scope — call them before `
|
|
6
|
+
* the current Effection scope — call them before `execute()` or
|
|
7
7
|
* `durableRun()` in your test body.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* yield* useStubFs({ "doc.md": "# Hello\n" });
|
|
15
15
|
* yield* useEchoExec();
|
|
16
16
|
*
|
|
17
|
-
* const execution = yield*
|
|
17
|
+
* const execution = yield* execute({ docPath: "doc.md", stream });
|
|
18
18
|
* const output = yield* execution;
|
|
19
19
|
* });
|
|
20
20
|
* ```
|