@executablemd/runtime 0.9.0 → 0.9.1

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 CHANGED
@@ -476,6 +476,7 @@ export function exec(options) {
476
476
  }
477
477
  export const readTextFile = API.Fs.operations.readTextFile;
478
478
  export const stat = API.Fs.operations.stat;
479
+ export const lstat = API.Fs.operations.lstat;
479
480
  export const glob = API.Fs.operations.glob;
480
481
  export const writeTextFile = API.Fs.operations.writeTextFile;
481
482
  export const ensureDir = API.Fs.operations.ensureDir;
package/esm/mod.js CHANGED
@@ -25,7 +25,7 @@
25
25
  */
26
26
  import "./_dnt.polyfills.js";
27
27
  export { API } from "./apis.js";
28
- export { exec, readTextFile, writeTextFile, stat, glob, realpath, ensureDir, rename, remove, fetch, cwd, env, platform, command, compile, useQuietProcessOutput, } from "./apis.js";
28
+ export { exec, readTextFile, writeTextFile, stat, lstat, glob, realpath, ensureDir, rename, remove, fetch, cwd, env, platform, command, compile, useQuietProcessOutput, } from "./apis.js";
29
29
  export { Service, SERVICE_HOSTNAME, SERVICE_READY_PREFIX, ServiceProcessExitBeforeReadyError, ServiceProtocolDuplicateError, ServiceProtocolHostnameMismatchError, ServiceProtocolIncompatibleError, ServiceProtocolMalformedError, ServiceProtocolTokenMismatchError, ServiceProviderError, ServiceStartupTimeoutError, ServiceTeardownError, ServiceUnexpectedExitError, parseServiceReadyRecord, startService, } from "./service.js";
30
30
  export { Config, timeout, timeoutExec, timeoutFetch } from "./config.js";
31
31
  export { asDuration, durationError, parseDuration } from "./duration.js";
package/esm/test/stubs.js CHANGED
@@ -43,6 +43,8 @@ export function* useStubService(endpoint) {
43
43
  *
44
44
  * - `readTextFile` returns content from the `files` map; throws ENOENT for missing keys.
45
45
  * - `stat` returns `{ exists: true, isFile: true }` for keys in the map.
46
+ * - `lstat` answers the same, with `isSymbolicLink: false`: an in-memory map
47
+ * holds file content, so nothing in it is a link to somewhere else.
46
48
  * - `glob` throws (not stubbed). Install `API.Fs.around()` directly if needed.
47
49
  * - the writing half — `writeTextFile`, `ensureDir`, `rename`, `remove`, and
48
50
  * `realpath` — is not stubbed and reaches the real filesystem. A test that
@@ -65,6 +67,10 @@ export function* useStubFs(files) {
65
67
  const exists = path in files;
66
68
  return { exists, isFile: exists, isDirectory: false };
67
69
  },
70
+ *lstat([path], _next) {
71
+ const exists = path in files;
72
+ return { exists, isFile: exists, isDirectory: false, isSymbolicLink: false };
73
+ },
68
74
  *glob(_args, _next) {
69
75
  throw new Error("glob not stubbed");
70
76
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@executablemd/runtime",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Runtime host APIs for executable.md documents.",
5
5
  "homepage": "https://executable.md",
6
6
  "repository": {
package/types/apis.d.ts CHANGED
@@ -287,6 +287,7 @@ export declare function exec(options: ProcessExecOptions & {
287
287
  }>;
288
288
  export declare const readTextFile: typeof API.Fs.operations.readTextFile;
289
289
  export declare const stat: typeof API.Fs.operations.stat;
290
+ export declare const lstat: typeof API.Fs.operations.lstat;
290
291
  export declare const glob: typeof API.Fs.operations.glob;
291
292
  export declare const writeTextFile: typeof API.Fs.operations.writeTextFile;
292
293
  export declare const ensureDir: typeof API.Fs.operations.ensureDir;
package/types/mod.d.ts CHANGED
@@ -25,7 +25,7 @@
25
25
  */
26
26
  import "./_dnt.polyfills.js";
27
27
  export { API } from "./apis.js";
28
- export { exec, readTextFile, writeTextFile, stat, glob, realpath, ensureDir, rename, remove, fetch, cwd, env, platform, command, compile, useQuietProcessOutput, } from "./apis.js";
28
+ export { exec, readTextFile, writeTextFile, stat, lstat, glob, realpath, ensureDir, rename, remove, fetch, cwd, env, platform, command, compile, useQuietProcessOutput, } from "./apis.js";
29
29
  export type { EvalBlock, FetchInit, FetchOperation, LinkStatResult, ResponseHeaders, RuntimeFetchResponse, StatResult, } from "./apis.js";
30
30
  export { Service, SERVICE_HOSTNAME, SERVICE_READY_PREFIX, ServiceProcessExitBeforeReadyError, ServiceProtocolDuplicateError, ServiceProtocolHostnameMismatchError, ServiceProtocolIncompatibleError, ServiceProtocolMalformedError, ServiceProtocolTokenMismatchError, ServiceProviderError, ServiceStartupTimeoutError, ServiceTeardownError, ServiceUnexpectedExitError, parseServiceReadyRecord, startService, } from "./service.js";
31
31
  export type { ServiceEndpoint, ServiceHandler, ServiceAttachment, ServiceStartOptions, } from "./service.js";
@@ -28,6 +28,8 @@ export declare function useStubService(endpoint: ServiceEndpoint): Operation<voi
28
28
  *
29
29
  * - `readTextFile` returns content from the `files` map; throws ENOENT for missing keys.
30
30
  * - `stat` returns `{ exists: true, isFile: true }` for keys in the map.
31
+ * - `lstat` answers the same, with `isSymbolicLink: false`: an in-memory map
32
+ * holds file content, so nothing in it is a link to somewhere else.
31
33
  * - `glob` throws (not stubbed). Install `API.Fs.around()` directly if needed.
32
34
  * - the writing half — `writeTextFile`, `ensureDir`, `rename`, `remove`, and
33
35
  * `realpath` — is not stubbed and reaches the real filesystem. A test that