homebridge-plugin-utils 2.0.0 → 2.1.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/dist/backpressure.d.ts +1 -1
- package/dist/backpressure.js +4 -4
- package/dist/backpressure.js.map +1 -1
- package/dist/cli/index.d.ts +73 -2
- package/dist/cli/index.js +221 -25
- package/dist/cli/index.js.map +1 -1
- package/dist/clock-double.js +2 -2
- package/dist/clock-double.js.map +1 -1
- package/dist/disposable-stack.d.ts +59 -0
- package/dist/disposable-stack.js +155 -0
- package/dist/disposable-stack.js.map +1 -0
- package/dist/docChrome.d.ts +260 -0
- package/dist/docChrome.js +361 -0
- package/dist/docChrome.js.map +1 -0
- package/dist/featureOptions-docs.d.ts +2 -2
- package/dist/featureOptions-docs.js +1 -1
- package/dist/featureOptions.d.ts +5 -5
- package/dist/featureOptions.js +6 -6
- package/dist/ffmpeg/exec.d.ts +2 -2
- package/dist/ffmpeg/exec.js +2 -2
- package/dist/ffmpeg/mp4-assembler.d.ts +45 -4
- package/dist/ffmpeg/mp4-assembler.js +45 -8
- package/dist/ffmpeg/mp4-assembler.js.map +1 -1
- package/dist/ffmpeg/mp4-parser.d.ts +1 -1
- package/dist/ffmpeg/mp4-parser.js +1 -1
- package/dist/ffmpeg/options.js +3 -3
- package/dist/ffmpeg/options.js.map +1 -1
- package/dist/ffmpeg/process.d.ts +1 -1
- package/dist/ffmpeg/process.js +4 -4
- package/dist/ffmpeg/process.js.map +1 -1
- package/dist/ffmpeg/record.d.ts +26 -1
- package/dist/ffmpeg/record.js +12 -0
- package/dist/ffmpeg/record.js.map +1 -1
- package/dist/ffmpeg/recording-process-double.d.ts +13 -0
- package/dist/ffmpeg/recording-process-double.js +22 -0
- package/dist/ffmpeg/recording-process-double.js.map +1 -1
- package/dist/ffmpeg/rtp-parser.d.ts +1 -1
- package/dist/ffmpeg/rtp-parser.js +1 -1
- package/dist/ffmpeg/rtp.d.ts +4 -4
- package/dist/ffmpeg/rtp.js +7 -6
- package/dist/ffmpeg/rtp.js.map +1 -1
- package/dist/ffmpeg/stream.js +1 -1
- package/dist/ffmpeg/stream.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/logclient/auth.d.ts +3 -3
- package/dist/logclient/auth.js +2 -2
- package/dist/logclient/auth.js.map +1 -1
- package/dist/logclient/cli-run.js +2 -2
- package/dist/logclient/cli-run.js.map +1 -1
- package/dist/logclient/cli.js +2 -2
- package/dist/logclient/client.js +2 -2
- package/dist/logclient/client.js.map +1 -1
- package/dist/logclient/rest.js +1 -1
- package/dist/logclient/socket-double.d.ts +1 -1
- package/dist/logclient/socket-double.js +1 -1
- package/dist/logclient/socket.js +5 -5
- package/dist/logclient/socket.js.map +1 -1
- package/dist/logclient/time-window.d.ts +1 -1
- package/dist/mqttClient.d.ts +1 -1
- package/dist/mqttClient.js +3 -3
- package/dist/mqttClient.js.map +1 -1
- package/dist/ui/featureOptions.js +6 -6
- package/dist/ui/pluginConfigSession.mjs +1 -1
- package/dist/ui/webUi-featureOptions/effects/persist.mjs +2 -2
- package/dist/ui/webUi-featureOptions/effects/theme.mjs +1 -1
- package/dist/ui/webUi-featureOptions/effects/tokens.mjs +1 -1
- package/dist/ui/webUi-featureOptions/rendering.mjs +2 -2
- package/dist/ui/webUi-featureOptions/selectors.mjs +3 -3
- package/dist/ui/webUi-featureOptions/state.mjs +6 -6
- package/dist/ui/webUi-featureOptions/store.mjs +1 -1
- package/dist/ui/webUi-featureOptions/utils.mjs +14 -1
- package/dist/ui/webUi-featureOptions/views/connectionError.mjs +1 -1
- package/dist/ui/webUi-featureOptions/views/nav.mjs +42 -28
- package/dist/ui/webUi-featureOptions/views/options.mjs +2 -2
- package/dist/ui/webUi-featureOptions/views/search.mjs +2 -2
- package/dist/ui/webUi-featureOptions.mjs +57 -32
- package/dist/ui/webUi.mjs +43 -11
- package/dist/util.d.ts +89 -12
- package/dist/util.js +62 -14
- package/dist/util.js.map +1 -1
- package/package.json +9 -9
package/dist/backpressure.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { Writable } from "node:stream";
|
|
|
4
4
|
* Thrown synchronously by {@link BackpressureWriter.write} when the pending queue is already at the configured {@link BackpressureWriterInit.highWaterMark} and
|
|
5
5
|
* accepting the new chunk would push it over.
|
|
6
6
|
*
|
|
7
|
-
* Separate from the "writer has aborted" and "underlying stream is dead" failure modes so callers can
|
|
7
|
+
* Separate from the "writer has aborted" and "underlying stream is dead" failure modes so callers can distinguish backpressure-overflow (back off and retry later)
|
|
8
8
|
* from terminal failures (give up or escalate) by type rather than by inspecting error message text.
|
|
9
9
|
*
|
|
10
10
|
* @category Utilities
|
package/dist/backpressure.js
CHANGED
|
@@ -17,7 +17,7 @@ import { once } from "node:events";
|
|
|
17
17
|
* Thrown synchronously by {@link BackpressureWriter.write} when the pending queue is already at the configured {@link BackpressureWriterInit.highWaterMark} and
|
|
18
18
|
* accepting the new chunk would push it over.
|
|
19
19
|
*
|
|
20
|
-
* Separate from the "writer has aborted" and "underlying stream is dead" failure modes so callers can
|
|
20
|
+
* Separate from the "writer has aborted" and "underlying stream is dead" failure modes so callers can distinguish backpressure-overflow (back off and retry later)
|
|
21
21
|
* from terminal failures (give up or escalate) by type rather than by inspecting error message text.
|
|
22
22
|
*
|
|
23
23
|
* @category Utilities
|
|
@@ -109,7 +109,7 @@ export class BackpressureWriter {
|
|
|
109
109
|
// Single teardown convergence point. `onAbort` registers the one-shot teardown handler AND handles the pre-aborted-signal edge case where `addEventListener`
|
|
110
110
|
// would otherwise skip the handler. Rejects every pending entry - including the in-flight entry when the drain loop is parked on
|
|
111
111
|
// `events.once(stream, "drain", { signal })`. The drain loop's catch branch may also reject the in-flight resolver under the same abort; promise resolvers are
|
|
112
|
-
//
|
|
112
|
+
// inert after first settlement, so the second call is a no-op. Rejecting from here unconditionally is required in the stream-error escalation path,
|
|
113
113
|
// where the drain loop shifts the in-flight entry before calling `this.#controller.abort(...)` - by the time the listener runs, only the queued entries remain
|
|
114
114
|
// in the queue, and leaving any of them unrejected would orphan the caller's promise.
|
|
115
115
|
onAbort(this.signal, () => this.#teardown());
|
|
@@ -131,7 +131,7 @@ export class BackpressureWriter {
|
|
|
131
131
|
*/
|
|
132
132
|
async write(chunk) {
|
|
133
133
|
// Pre-aborted short-circuit: a write issued after teardown has nothing live to attach to. Rejecting with the signal's reason keeps semantics uniform with the
|
|
134
|
-
// mid-write abort path - callers
|
|
134
|
+
// mid-write abort path - callers branch on `signal.reason` / `isHbpuAbortReason` in either case.
|
|
135
135
|
if (this.signal.aborted) {
|
|
136
136
|
throw this.signal.reason;
|
|
137
137
|
}
|
|
@@ -256,7 +256,7 @@ export class BackpressureWriter {
|
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
// Teardown convergence point, fired exactly once when `this.signal` aborts. Rejects every pending entry with the signal's reason, regardless of whether the drain
|
|
259
|
-
// loop is currently processing. Promise resolvers are
|
|
259
|
+
// loop is currently processing. Promise resolvers are inert after first settlement, so if the drain loop's catch branch also rejects the in-flight resolver
|
|
260
260
|
// (e.g., when `events.once(..., { signal })` rejects on the same abort), the second call is a no-op. Draining the queue unconditionally here prevents the
|
|
261
261
|
// stream-error escalation path from orphaning queued resolvers - `#drain`'s catch shifts the in-flight entry and then calls `this.#controller.abort(...)`, which
|
|
262
262
|
// fires this listener synchronously while the remaining queued entries are still in the queue.
|
package/dist/backpressure.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backpressure.js","sourceRoot":"","sources":["../src/backpressure.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AACH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC;;;;;;;;GAQG;AACH,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAEzB,I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AA0J;IAC1J,iKAAiK;IACjK,+FAA+F;IAC/F,SAAS;QAEP,kKAAkK;QAClK,gIAAgI;QAChI,MAAM,MAAM,GAAY,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QAC3C,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAEtC,KAAI,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAE3B,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;CACF"}
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* The homebridge-plugin-utils CLI, exposed to consumers via the `bin` field in `package.json`. A single cohesive module: the content-hash helper, the `prepareUi`,
|
|
4
|
+
* `prepareDocs`, and `prepareChrome` transforms, the `runCli` dispatcher, and the entry-point execution all live here with no inter-file relative VALUE imports.
|
|
5
|
+
*
|
|
6
|
+
* That single-file shape is deliberate, not incidental. A bin is invoked through an `npm`-managed symlink in `node_modules/.bin`; if the entry imported a sibling
|
|
7
|
+
* module by relative path AT LOAD TIME, that import would resolve against the symlink's directory under symlink-preserving or copied-package layouts and fail. With
|
|
8
|
+
* every runtime edge pointing only at `node:` builtins, there is nothing to fracture - the CLI runs identically whether reached directly, through a symlink, through
|
|
9
|
+
* a `file:` dependency, or under `--preserve-symlinks`. The lone `import type` of the renderer's signatures is fully erased by the compiler and emits no runtime edge,
|
|
10
|
+
* so it carries the SSOT types without reintroducing a load-time relative dependency; when `prepareDocs` actually needs the renderer it reaches it through a computed
|
|
11
|
+
* dynamic import the dispatch site supplies, the same indirection the `hblog` bin uses.
|
|
12
|
+
*
|
|
13
|
+
* The module is simultaneously the executable (run via the bin) and a side-effect-free library surface (`prepareUi` / `prepareDocs` / `prepareChrome` / `runCli` /
|
|
14
|
+
* `USAGE`) that the test suite imports. The entry block at the bottom only executes when this module is the program entry point, detected by comparing canonicalized
|
|
15
|
+
* real paths - see its comment for why a raw path comparison is insufficient.
|
|
16
|
+
*
|
|
17
|
+
* @module
|
|
18
|
+
*/
|
|
19
|
+
import type { parseDocChromeManifest, parseProjectEntries, renderDevBadges, renderDocIndex, renderMasthead, renderProjects } from "../docChrome.ts";
|
|
2
20
|
import type { renderFeatureOptionsReference, spliceMarkedRegion } from "../featureOptions-docs.ts";
|
|
3
21
|
/**
|
|
4
22
|
* Usage banner shown on no command or an unknown command. Kept as an exported constant so tests assert against its text without
|
|
@@ -12,12 +30,12 @@ export declare const USAGE: string;
|
|
|
12
30
|
* injects a trailing-slash importmap entry that prefixes every `./lib/` import with the hashed-versioned path. Transitive imports inherit the prefix through
|
|
13
31
|
* relative-URL resolution, so cache-busting reaches files the importmap never names.
|
|
14
32
|
*
|
|
15
|
-
* The content hash is
|
|
33
|
+
* The content hash is what makes the maintainer-iteration use case work. A semver-only subdir name would stay constant across the maintainer's
|
|
16
34
|
* edit/rebuild/test cycle (version doesn't bump on every save), and the browser would happily serve cached copies of the stale URLs. Hashing the tree means any
|
|
17
35
|
* source change produces a different subdir name, which produces different URLs, which forces fresh fetches. Same code path serves the published-release case: a
|
|
18
36
|
* release ships with a fixed hash, and every consumer fetching it sees the same URL space and caches aggressively within it.
|
|
19
37
|
*
|
|
20
|
-
* Operates
|
|
38
|
+
* Operates repeatably. A re-run against unchanged source content produces the same subdir name + same contents + same manifest. Stale prior-build subdirs are
|
|
21
39
|
* removed in the same pass; non-version-shaped entries in the destination are left untouched so a plugin's own files (assets, sibling tooling, README copies)
|
|
22
40
|
* survive across runs.
|
|
23
41
|
*
|
|
@@ -71,6 +89,58 @@ export declare function prepareDocs({ catalogModulePath, docPath, render, splice
|
|
|
71
89
|
render: typeof renderFeatureOptionsReference;
|
|
72
90
|
splice: typeof spliceMarkedRegion;
|
|
73
91
|
}): Promise<void>;
|
|
92
|
+
interface DocChromeModule {
|
|
93
|
+
readonly DEV_BADGES_BEGIN: string;
|
|
94
|
+
readonly DEV_BADGES_END: string;
|
|
95
|
+
readonly DOCUMENTATION_BEGIN: string;
|
|
96
|
+
readonly DOCUMENTATION_END: string;
|
|
97
|
+
readonly MASTHEAD_BEGIN: string;
|
|
98
|
+
readonly MASTHEAD_END: string;
|
|
99
|
+
readonly PROJECTS_BEGIN: string;
|
|
100
|
+
readonly PROJECTS_END: string;
|
|
101
|
+
readonly parseDocChromeManifest: typeof parseDocChromeManifest;
|
|
102
|
+
readonly parseProjectEntries: typeof parseProjectEntries;
|
|
103
|
+
readonly renderDevBadges: typeof renderDevBadges;
|
|
104
|
+
readonly renderDocIndex: typeof renderDocIndex;
|
|
105
|
+
readonly renderMasthead: typeof renderMasthead;
|
|
106
|
+
readonly renderProjects: typeof renderProjects;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Stamp a plugin's documentation-chrome regions - the masthead, the documentation index, the dashboard badges, and the project list - across its README, every content
|
|
110
|
+
* doc, and its webUI Support tab, from one per-plugin manifest. This is the multi-region, multi-file counterpart to {@link prepareDocs}: where that regenerates one
|
|
111
|
+
* feature-options region in one doc, this regenerates several named regions in many files, so a plugin's masthead and navigation cannot drift between the surfaces that
|
|
112
|
+
* repeat them.
|
|
113
|
+
*
|
|
114
|
+
* Pure-by-injection like {@link prepareDocs}: the `docChrome` renderers and validator arrive through the injected `chrome` namespace and the splice helper through
|
|
115
|
+
* `splice`, so this function is unit-testable against the real exports without a built `dist/`, and the CLI's single-file no-static-relative-import discipline is
|
|
116
|
+
* preserved. `fetchImpl` is injected (defaulting to the global `fetch`) so the remote project-source path is testable without network access.
|
|
117
|
+
*
|
|
118
|
+
* The manifest is loaded (a typed module or a static JSON file), validated with a field-naming diagnostic, and its optional project source resolved to inline data. The
|
|
119
|
+
* per-file edit plan is then built - the README carries the masthead, the documentation index, and the dashboard badges; each content doc carries the masthead (unless
|
|
120
|
+
* its entry opts out) and a self-omitting footer index; the webUI, when present, carries the documentation index and the project list. Every region is spliced against
|
|
121
|
+
* its own marker pair through the shared, ambiguity-rejecting splice primitive.
|
|
122
|
+
*
|
|
123
|
+
* The write is all-or-nothing across files in the realistic failure mode. Splicing happens entirely in memory first, so a missing or ambiguous marker in any file
|
|
124
|
+
* aborts the run before a single write. The writes then proceed in two phases - every file's new content is staged in a sibling `.tmp`, and only once all temps exist
|
|
125
|
+
* are they renamed over their targets - so a staging failure leaves every original untouched and each promotion is an atomic rename.
|
|
126
|
+
*
|
|
127
|
+
* @param args
|
|
128
|
+
* @param args.chrome - The injected `docChrome` module namespace (its renderers, marker constants, and validators).
|
|
129
|
+
* @param args.fetchImpl - The `fetch` implementation used to resolve a remote project source. Defaults to the global `fetch`; tests inject a fake.
|
|
130
|
+
* @param args.manifestPath - Absolute path to the plugin's manifest - a compiled module or a `.json` file.
|
|
131
|
+
* @param args.pluginRoot - Absolute path to the plugin root that the manifest's surface and file references resolve against.
|
|
132
|
+
* @param args.splice - The injected {@link spliceMarkedRegion} from `featureOptions-docs.ts`.
|
|
133
|
+
*
|
|
134
|
+
* @throws When the manifest is mis-shaped, when a resolved project source is malformed, when a target file cannot be read, or when any region's marker pair is absent or
|
|
135
|
+
* ambiguous - propagating the splice's own framed errors so the dispatch site frames them uniformly.
|
|
136
|
+
*/
|
|
137
|
+
export declare function prepareChrome({ chrome, fetchImpl, manifestPath, pluginRoot, splice }: {
|
|
138
|
+
chrome: DocChromeModule;
|
|
139
|
+
fetchImpl?: typeof fetch;
|
|
140
|
+
manifestPath: string;
|
|
141
|
+
pluginRoot: string;
|
|
142
|
+
splice: typeof spliceMarkedRegion;
|
|
143
|
+
}): Promise<void>;
|
|
74
144
|
/**
|
|
75
145
|
* Run the CLI against a synthetic argv vector. Returns the process exit code that the entry block propagates. Pure-by-injection: takes its `cwd`, `stderr`, and
|
|
76
146
|
* `sourceRoot` as arguments rather than reading them from globals, so tests exercise the full dispatch path against a captured stderr, a tmpdir source root, and a
|
|
@@ -92,4 +162,5 @@ export declare function runCli({ argv, cwd, sourceRoot, stderr }: {
|
|
|
92
162
|
write: (chunk: string) => unknown;
|
|
93
163
|
};
|
|
94
164
|
}): Promise<number>;
|
|
165
|
+
export {};
|
|
95
166
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/cli/index.js
CHANGED
|
@@ -11,23 +11,6 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
|
|
|
11
11
|
}
|
|
12
12
|
return path;
|
|
13
13
|
};
|
|
14
|
-
/**
|
|
15
|
-
* The homebridge-plugin-utils CLI, exposed to consumers via the `bin` field in `package.json`. A single cohesive module: the content-hash helper, the `prepareUi`
|
|
16
|
-
* and `prepareDocs` transforms, the `runCli` dispatcher, and the entry-point execution all live here with no inter-file relative VALUE imports.
|
|
17
|
-
*
|
|
18
|
-
* That single-file shape is deliberate, not incidental. A bin is invoked through an `npm`-managed symlink in `node_modules/.bin`; if the entry imported a sibling
|
|
19
|
-
* module by relative path AT LOAD TIME, that import would resolve against the symlink's directory under symlink-preserving or copied-package layouts and fail. With
|
|
20
|
-
* every runtime edge pointing only at `node:` builtins, there is nothing to fracture - the CLI runs identically whether reached directly, through a symlink, through
|
|
21
|
-
* a `file:` dependency, or under `--preserve-symlinks`. The lone `import type` of the renderer's signatures is fully erased by the compiler and emits no runtime edge,
|
|
22
|
-
* so it carries the SSOT types without reintroducing a load-time relative dependency; when `prepareDocs` actually needs the renderer it reaches it through a computed
|
|
23
|
-
* dynamic import the dispatch site supplies, the same indirection the `hblog` bin uses.
|
|
24
|
-
*
|
|
25
|
-
* The module is simultaneously the executable (run via the bin) and a side-effect-free library surface (`prepareUi` / `prepareDocs` / `runCli` / `USAGE`) that the
|
|
26
|
-
* test suite imports. The entry block at the bottom only executes when this module is the program entry point, detected by comparing canonicalized real paths - see
|
|
27
|
-
* its comment for why a raw path comparison is insufficient.
|
|
28
|
-
*
|
|
29
|
-
* @module
|
|
30
|
-
*/
|
|
31
14
|
import { cp, mkdir, readFile, readdir, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
32
15
|
import { dirname, join, relative, resolve, sep } from "node:path";
|
|
33
16
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -51,7 +34,8 @@ const HASH_LENGTH = 16;
|
|
|
51
34
|
*/
|
|
52
35
|
export const USAGE = "Usage: homebridge-plugin-utils <command> [options]\n\n" +
|
|
53
36
|
"Commands:\n prepare-ui <destination> Mirror HBPU's webUI into the plugin's lib directory.\n" +
|
|
54
|
-
" prepare-docs <catalog-module> [--doc <path>] Generate the Feature Options reference into the plugin's docs.\n"
|
|
37
|
+
" prepare-docs <catalog-module> [--doc <path>] Generate the Feature Options reference into the plugin's docs.\n" +
|
|
38
|
+
" prepare-chrome <manifest> [--root <dir>] Stamp the doc-chrome regions (masthead, nav, badges, projects) across the plugin's docs, README, and webUI.\n";
|
|
55
39
|
/**
|
|
56
40
|
* Compute a deterministic content hash over `root`'s file tree. Walks every file in lexicographic order of relative POSIX path so two runs against the same content
|
|
57
41
|
* produce the same hash regardless of underlying filesystem ordering or the absolute path the tree sits at. Mixes both the relative path and the file bytes into
|
|
@@ -102,12 +86,12 @@ async function computeContentHash(root) {
|
|
|
102
86
|
* injects a trailing-slash importmap entry that prefixes every `./lib/` import with the hashed-versioned path. Transitive imports inherit the prefix through
|
|
103
87
|
* relative-URL resolution, so cache-busting reaches files the importmap never names.
|
|
104
88
|
*
|
|
105
|
-
* The content hash is
|
|
89
|
+
* The content hash is what makes the maintainer-iteration use case work. A semver-only subdir name would stay constant across the maintainer's
|
|
106
90
|
* edit/rebuild/test cycle (version doesn't bump on every save), and the browser would happily serve cached copies of the stale URLs. Hashing the tree means any
|
|
107
91
|
* source change produces a different subdir name, which produces different URLs, which forces fresh fetches. Same code path serves the published-release case: a
|
|
108
92
|
* release ships with a fixed hash, and every consumer fetching it sees the same URL space and caches aggressively within it.
|
|
109
93
|
*
|
|
110
|
-
* Operates
|
|
94
|
+
* Operates repeatably. A re-run against unchanged source content produces the same subdir name + same contents + same manifest. Stale prior-build subdirs are
|
|
111
95
|
* removed in the same pass; non-version-shaped entries in the destination are left untouched so a plugin's own files (assets, sibling tooling, README copies)
|
|
112
96
|
* survive across runs.
|
|
113
97
|
*
|
|
@@ -152,7 +136,7 @@ export async function prepareUi({ dest, sourceRoot }) {
|
|
|
152
136
|
const absDest = resolve(dest);
|
|
153
137
|
await mkdir(absDest, { recursive: true });
|
|
154
138
|
const versionedDest = join(absDest, subdir);
|
|
155
|
-
//
|
|
139
|
+
// Repeatable reset of the versioned subdir. Wipe first so the copy step always starts from a known-empty target; the same-content stability is upheld
|
|
156
140
|
// by the hash being a deterministic function of the source, so re-running with unchanged content produces the same subdir name + same contents + same manifest,
|
|
157
141
|
// even though the implementation re-does the work. `force: true` swallows ENOENT so a first run against an empty destination doesn't surface the missing-target
|
|
158
142
|
// as an error.
|
|
@@ -244,6 +228,185 @@ export async function prepareDocs({ catalogModulePath, docPath, render, splice }
|
|
|
244
228
|
await writeFile(docPath + ".tmp", updated, "utf8");
|
|
245
229
|
await rename(docPath + ".tmp", docPath);
|
|
246
230
|
}
|
|
231
|
+
// The diagnostic thrown when the manifest's `projects` field is neither an inline array nor a { file } / { url } reference. Named so the two guard clauses in
|
|
232
|
+
// resolveProjects share one message rather than duplicating the string.
|
|
233
|
+
const PROJECTS_SOURCE_ERROR = "The manifest `projects` field must be an array, a { file } reference, or a { url } reference.";
|
|
234
|
+
// Parse JSON, re-throwing a parse failure as a framed error that names where the invalid JSON lives. Plain `JSON.parse` throws a bare `SyntaxError` with no source
|
|
235
|
+
// attribution; wrapping it keeps a malformed manifest or project list reporting the same "names the source" quality as the shape validators.
|
|
236
|
+
function parseJsonFramed(raw, describe) {
|
|
237
|
+
try {
|
|
238
|
+
return JSON.parse(raw);
|
|
239
|
+
}
|
|
240
|
+
catch (error) {
|
|
241
|
+
throw new Error(describe + " is not valid JSON: " + (error instanceof Error ? error.message : String(error)) + ".");
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
// Load a documentation-chrome manifest, dispatching on the path's extension: a `.json` file is read and parsed as data, while a `.js`/`.mjs` module is dynamically
|
|
245
|
+
// imported and its `docChrome` (or default) export taken. Both paths converge on one in-memory value the caller validates, so a plugin may author its manifest as a
|
|
246
|
+
// typed module or a static JSON file with no change to the mechanism. The dynamic import goes through a `file:` URL for the same portability reason `prepareDocs`
|
|
247
|
+
// converts the catalog path.
|
|
248
|
+
async function loadDocChromeManifest(manifestPath) {
|
|
249
|
+
if (manifestPath.endsWith(".json")) {
|
|
250
|
+
return parseJsonFramed(await readFile(manifestPath, "utf8"), "Doc-chrome manifest " + manifestPath);
|
|
251
|
+
}
|
|
252
|
+
const namespace = await import(__rewriteRelativeImportExtension(pathToFileURL(manifestPath).href));
|
|
253
|
+
return namespace.docChrome ?? namespace.default;
|
|
254
|
+
}
|
|
255
|
+
// Resolve the manifest's project source to an inline array of entries. The source may be omitted (no project region is stamped), an inline array, a local file relative
|
|
256
|
+
// to the plugin root, or a remote URL fetched at stamp time. The remote form is what lets a family-wide project list live in one external file that every plugin's build
|
|
257
|
+
// pulls from, keeping this library free of any plugin-specific data. The injected `parseEntries` validates the resolved entries and returns them typed, so every
|
|
258
|
+
// manifest-shape check stays the single responsibility of `docChrome.ts`.
|
|
259
|
+
async function resolveProjects(source, { fetchImpl, manifestPath, parseEntries, pluginRoot }) {
|
|
260
|
+
if (source === undefined) {
|
|
261
|
+
return undefined;
|
|
262
|
+
}
|
|
263
|
+
// An inline array is validated against the manifest path, since that is where it was authored.
|
|
264
|
+
if (Array.isArray(source)) {
|
|
265
|
+
return parseEntries(source, manifestPath);
|
|
266
|
+
}
|
|
267
|
+
if ((typeof source !== "object") || (source === null)) {
|
|
268
|
+
throw new Error(PROJECTS_SOURCE_ERROR);
|
|
269
|
+
}
|
|
270
|
+
// A remote reference is fetched at stamp time; a non-OK response is a framed error naming the URL and status. We read the body as text and parse it ourselves so a
|
|
271
|
+
// malformed remote list reports through the same framed-JSON path as a local one.
|
|
272
|
+
if (("url" in source) && (typeof source.url === "string")) {
|
|
273
|
+
const response = await fetchImpl(source.url);
|
|
274
|
+
if (!response.ok) {
|
|
275
|
+
throw new Error("Failed to fetch the project list from " + source.url + ": HTTP " + String(response.status) + ".");
|
|
276
|
+
}
|
|
277
|
+
return parseEntries(parseJsonFramed(await response.text(), "The project list fetched from " + source.url), source.url);
|
|
278
|
+
}
|
|
279
|
+
// A local-file reference is read relative to the plugin root and parsed as JSON.
|
|
280
|
+
if (("file" in source) && (typeof source.file === "string")) {
|
|
281
|
+
const filePath = resolve(pluginRoot, source.file);
|
|
282
|
+
return parseEntries(parseJsonFramed(await readFile(filePath, "utf8"), "The project list at " + filePath), filePath);
|
|
283
|
+
}
|
|
284
|
+
throw new Error(PROJECTS_SOURCE_ERROR);
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Stamp a plugin's documentation-chrome regions - the masthead, the documentation index, the dashboard badges, and the project list - across its README, every content
|
|
288
|
+
* doc, and its webUI Support tab, from one per-plugin manifest. This is the multi-region, multi-file counterpart to {@link prepareDocs}: where that regenerates one
|
|
289
|
+
* feature-options region in one doc, this regenerates several named regions in many files, so a plugin's masthead and navigation cannot drift between the surfaces that
|
|
290
|
+
* repeat them.
|
|
291
|
+
*
|
|
292
|
+
* Pure-by-injection like {@link prepareDocs}: the `docChrome` renderers and validator arrive through the injected `chrome` namespace and the splice helper through
|
|
293
|
+
* `splice`, so this function is unit-testable against the real exports without a built `dist/`, and the CLI's single-file no-static-relative-import discipline is
|
|
294
|
+
* preserved. `fetchImpl` is injected (defaulting to the global `fetch`) so the remote project-source path is testable without network access.
|
|
295
|
+
*
|
|
296
|
+
* The manifest is loaded (a typed module or a static JSON file), validated with a field-naming diagnostic, and its optional project source resolved to inline data. The
|
|
297
|
+
* per-file edit plan is then built - the README carries the masthead, the documentation index, and the dashboard badges; each content doc carries the masthead (unless
|
|
298
|
+
* its entry opts out) and a self-omitting footer index; the webUI, when present, carries the documentation index and the project list. Every region is spliced against
|
|
299
|
+
* its own marker pair through the shared, ambiguity-rejecting splice primitive.
|
|
300
|
+
*
|
|
301
|
+
* The write is all-or-nothing across files in the realistic failure mode. Splicing happens entirely in memory first, so a missing or ambiguous marker in any file
|
|
302
|
+
* aborts the run before a single write. The writes then proceed in two phases - every file's new content is staged in a sibling `.tmp`, and only once all temps exist
|
|
303
|
+
* are they renamed over their targets - so a staging failure leaves every original untouched and each promotion is an atomic rename.
|
|
304
|
+
*
|
|
305
|
+
* @param args
|
|
306
|
+
* @param args.chrome - The injected `docChrome` module namespace (its renderers, marker constants, and validators).
|
|
307
|
+
* @param args.fetchImpl - The `fetch` implementation used to resolve a remote project source. Defaults to the global `fetch`; tests inject a fake.
|
|
308
|
+
* @param args.manifestPath - Absolute path to the plugin's manifest - a compiled module or a `.json` file.
|
|
309
|
+
* @param args.pluginRoot - Absolute path to the plugin root that the manifest's surface and file references resolve against.
|
|
310
|
+
* @param args.splice - The injected {@link spliceMarkedRegion} from `featureOptions-docs.ts`.
|
|
311
|
+
*
|
|
312
|
+
* @throws When the manifest is mis-shaped, when a resolved project source is malformed, when a target file cannot be read, or when any region's marker pair is absent or
|
|
313
|
+
* ambiguous - propagating the splice's own framed errors so the dispatch site frames them uniformly.
|
|
314
|
+
*/
|
|
315
|
+
export async function prepareChrome({ chrome, fetchImpl = fetch, manifestPath, pluginRoot, splice }) {
|
|
316
|
+
const { DEV_BADGES_BEGIN, DEV_BADGES_END, DOCUMENTATION_BEGIN, DOCUMENTATION_END, MASTHEAD_BEGIN, MASTHEAD_END, PROJECTS_BEGIN, PROJECTS_END, parseDocChromeManifest, parseProjectEntries, renderDevBadges, renderDocIndex, renderMasthead, renderProjects } = chrome;
|
|
317
|
+
// Load and validate the manifest up front so a mis-shaped manifest fails with a diagnostic naming the offending field rather than a downstream render error. Parsing
|
|
318
|
+
// returns the same value typed as a validated manifest, so every field access below is type-checked.
|
|
319
|
+
const manifest = parseDocChromeManifest(await loadDocChromeManifest(manifestPath), manifestPath);
|
|
320
|
+
// Resolve the optional project source to inline data before rendering; the renderers never perform I/O.
|
|
321
|
+
const projects = await resolveProjects(manifest.projects, { fetchImpl, manifestPath, parseEntries: parseProjectEntries, pluginRoot });
|
|
322
|
+
// Build the per-file edit plan. Each target file collects the ordered marked-region splices that apply to it; a file may carry more than one region (the README
|
|
323
|
+
// carries three), each spliced independently against its own marker pair.
|
|
324
|
+
const plan = new Map();
|
|
325
|
+
const addRegion = (path, begin, end, content) => {
|
|
326
|
+
const edits = plan.get(path) ?? [];
|
|
327
|
+
edits.push({ begin, content, end });
|
|
328
|
+
plan.set(path, edits);
|
|
329
|
+
};
|
|
330
|
+
// The README: the masthead, the documentation index, and - when declared - the dashboard badges.
|
|
331
|
+
const readmePath = resolve(pluginRoot, manifest.surfaces?.readme ?? "README.md");
|
|
332
|
+
addRegion(readmePath, MASTHEAD_BEGIN, MASTHEAD_END, renderMasthead(manifest));
|
|
333
|
+
addRegion(readmePath, DOCUMENTATION_BEGIN, DOCUMENTATION_END, renderDocIndex({ manifest, surface: "readme" }));
|
|
334
|
+
if ((manifest.devBadges !== undefined) && (manifest.devBadges.length > 0)) {
|
|
335
|
+
addRegion(readmePath, DEV_BADGES_BEGIN, DEV_BADGES_END, renderDevBadges(manifest));
|
|
336
|
+
}
|
|
337
|
+
// Each content doc: the masthead (unless the entry opts out, as the changelog does) and a self-omitting footer index.
|
|
338
|
+
for (const section of manifest.nav) {
|
|
339
|
+
for (const entry of section.entries) {
|
|
340
|
+
if (entry.kind !== "doc") {
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
const docPath = resolve(pluginRoot, entry.file);
|
|
344
|
+
if (entry.masthead !== false) {
|
|
345
|
+
addRegion(docPath, MASTHEAD_BEGIN, MASTHEAD_END, renderMasthead(manifest));
|
|
346
|
+
}
|
|
347
|
+
addRegion(docPath, DOCUMENTATION_BEGIN, DOCUMENTATION_END, renderDocIndex({ currentFile: entry.file, manifest, surface: "doc-footer" }));
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
// The webUI Support tab is optional: a plugin without a custom config UI has no target to stamp, so we include its regions only when the file exists. The
|
|
351
|
+
// documentation index is always stamped there; the project list only when a source resolved.
|
|
352
|
+
const webuiPath = resolve(pluginRoot, manifest.surfaces?.webui ?? "homebridge-ui/public/index.html");
|
|
353
|
+
let webuiExists = true;
|
|
354
|
+
try {
|
|
355
|
+
await stat(webuiPath);
|
|
356
|
+
}
|
|
357
|
+
catch (error) {
|
|
358
|
+
// A missing webUI is expected for a plugin without a custom config UI; any other stat failure (a permissions error, say) is a genuine problem we must surface rather
|
|
359
|
+
// than silently treat as "no webUI".
|
|
360
|
+
if ((error instanceof Error) && ("code" in error) && (error.code === "ENOENT")) {
|
|
361
|
+
webuiExists = false;
|
|
362
|
+
}
|
|
363
|
+
else {
|
|
364
|
+
throw error;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
if (webuiExists) {
|
|
368
|
+
addRegion(webuiPath, DOCUMENTATION_BEGIN, DOCUMENTATION_END, renderDocIndex({ manifest, surface: "webui" }));
|
|
369
|
+
if (projects !== undefined) {
|
|
370
|
+
addRegion(webuiPath, PROJECTS_BEGIN, PROJECTS_END, renderProjects(projects));
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
// Validate-all: read each target and splice every region in memory. Splicing validates each marker pair, so a missing, inverted, or duplicated marker anywhere aborts
|
|
374
|
+
// the whole run here - before any file is written - rather than leaving a partial stamp behind.
|
|
375
|
+
const staged = await Promise.all([...plan].map(async ([path, edits]) => {
|
|
376
|
+
let content;
|
|
377
|
+
try {
|
|
378
|
+
content = await readFile(path, "utf8");
|
|
379
|
+
}
|
|
380
|
+
catch {
|
|
381
|
+
throw new Error("Target file " + path + " could not be read; ensure it exists and carries the required markers.");
|
|
382
|
+
}
|
|
383
|
+
// Splice each region against its own marker pair; a malformed marker throws, rejecting the whole collection (per the validate-all note above).
|
|
384
|
+
for (const edit of edits) {
|
|
385
|
+
content = splice(content, edit.content, { beginMarker: edit.begin, endMarker: edit.end });
|
|
386
|
+
}
|
|
387
|
+
return { content, path };
|
|
388
|
+
}));
|
|
389
|
+
// Write-all in two phases for strong cross-file atomicity. Stage every file's new content in a sibling `.tmp` first; if any staging write fails, remove the temps
|
|
390
|
+
// already written and abort with every original untouched. Only once all temps exist do we rename them over their targets, so the promotion phase - a set of atomic
|
|
391
|
+
// renames - cannot leave a half-spliced file behind.
|
|
392
|
+
const tmpPaths = staged.map(({ path }) => path + ".tmp");
|
|
393
|
+
try {
|
|
394
|
+
await Promise.all(staged.map(({ content, path }) => writeFile(path + ".tmp", content, "utf8")));
|
|
395
|
+
}
|
|
396
|
+
catch (error) {
|
|
397
|
+
await Promise.all(tmpPaths.map((tmpPath) => rm(tmpPath, { force: true })));
|
|
398
|
+
throw error;
|
|
399
|
+
}
|
|
400
|
+
try {
|
|
401
|
+
await Promise.all(staged.map(({ path }) => rename(path + ".tmp", path)));
|
|
402
|
+
}
|
|
403
|
+
catch (error) {
|
|
404
|
+
// A rename-phase failure is rare - every temp staged successfully - but it can leave some targets promoted and others not. Best-effort remove any temp that survives
|
|
405
|
+
// so a failed run does not litter the tree; the already-promoted targets are left as they are, since their content is the intended new content.
|
|
406
|
+
await Promise.all(tmpPaths.map((tmpPath) => rm(tmpPath, { force: true })));
|
|
407
|
+
throw error;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
247
410
|
/**
|
|
248
411
|
* Run the CLI against a synthetic argv vector. Returns the process exit code that the entry block propagates. Pure-by-injection: takes its `cwd`, `stderr`, and
|
|
249
412
|
* `sourceRoot` as arguments rather than reading them from globals, so tests exercise the full dispatch path against a captured stderr, a tmpdir source root, and a
|
|
@@ -261,7 +424,7 @@ export async function runCli({ argv, cwd, sourceRoot, stderr }) {
|
|
|
261
424
|
// parseArgs runs in strict mode, so an unrecognized flag (e.g. a typo'd `--docs`) throws `ERR_PARSE_ARGS_UNKNOWN_OPTION` here rather than falling through to the
|
|
262
425
|
// usage banner. That throw is intentionally uncaught - the per-case try/catch blocks below wrap only the subcommand work - so it surfaces as a rejected `runCli`
|
|
263
426
|
// promise at the entry point, distinct from the default case's banner handling for an unknown positional command.
|
|
264
|
-
const { positionals, values } = parseArgs({ allowPositionals: true, args: [...argv], options: { doc: { type: "string" } }, strict: true });
|
|
427
|
+
const { positionals, values } = parseArgs({ allowPositionals: true, args: [...argv], options: { doc: { type: "string" }, root: { type: "string" } }, strict: true });
|
|
265
428
|
const [command, ...rest] = positionals;
|
|
266
429
|
switch (command) {
|
|
267
430
|
case "prepare-ui": {
|
|
@@ -310,6 +473,39 @@ export async function runCli({ argv, cwd, sourceRoot, stderr }) {
|
|
|
310
473
|
}
|
|
311
474
|
return 0;
|
|
312
475
|
}
|
|
476
|
+
case "prepare-chrome": {
|
|
477
|
+
const [manifestArg] = rest;
|
|
478
|
+
if (!manifestArg) {
|
|
479
|
+
stderr.write("homebridge-plugin-utils prepare-chrome: missing required manifest argument.\n");
|
|
480
|
+
return 1;
|
|
481
|
+
}
|
|
482
|
+
// Resolve the manifest path and the plugin root that the manifest's surface and file references resolve against. The root defaults to the working directory.
|
|
483
|
+
const manifestPath = resolve(cwd, manifestArg);
|
|
484
|
+
const pluginRoot = resolve(cwd, values.root ?? ".");
|
|
485
|
+
// Reach HBPU's own doc-chrome renderers and the splice primitive through computed dynamic imports of their compiled modules - never static relative imports - so
|
|
486
|
+
// the single-file bin stays symlink-safe. A failed import means HBPU itself has not been built, a distinct and actionable condition from a downstream failure.
|
|
487
|
+
const chromePath = join(sourceRoot, "dist", "docChrome.js");
|
|
488
|
+
const splicePath = join(sourceRoot, "dist", "featureOptions-docs.js");
|
|
489
|
+
let chrome;
|
|
490
|
+
let splicer;
|
|
491
|
+
try {
|
|
492
|
+
chrome = await import(__rewriteRelativeImportExtension(pathToFileURL(chromePath).href));
|
|
493
|
+
splicer = await import(__rewriteRelativeImportExtension(pathToFileURL(splicePath).href));
|
|
494
|
+
}
|
|
495
|
+
catch {
|
|
496
|
+
stderr.write("homebridge-plugin-utils prepare-chrome: HBPU has not been built: " + chromePath + " or " + splicePath + " is missing. Run `npm run build` in " +
|
|
497
|
+
"HBPU first.\n");
|
|
498
|
+
return 1;
|
|
499
|
+
}
|
|
500
|
+
try {
|
|
501
|
+
await prepareChrome({ chrome, manifestPath, pluginRoot, splice: splicer.spliceMarkedRegion });
|
|
502
|
+
}
|
|
503
|
+
catch (error) {
|
|
504
|
+
stderr.write("homebridge-plugin-utils prepare-chrome: " + (error instanceof Error ? error.message : String(error)) + "\n");
|
|
505
|
+
return 1;
|
|
506
|
+
}
|
|
507
|
+
return 0;
|
|
508
|
+
}
|
|
313
509
|
default: {
|
|
314
510
|
stderr.write(USAGE);
|
|
315
511
|
// A bare `homebridge-plugin-utils` invocation (no command at all) is treated as a help request and exits 0; an unknown command is a misuse and exits 1. Both
|
|
@@ -322,11 +518,11 @@ export async function runCli({ argv, cwd, sourceRoot, stderr }) {
|
|
|
322
518
|
* Decide whether this module is the program entry point (run as the bin) versus imported as a library (by the test suite). Canonicalizes the real path of both the
|
|
323
519
|
* launch path (`process.argv[1]`) and this module's own URL before comparing them.
|
|
324
520
|
*
|
|
325
|
-
* The realpath normalization is the
|
|
521
|
+
* The realpath normalization is the detail that matters. npm exposes a bin as a symlink in `node_modules/.bin`, so under default Node the launch path is the
|
|
326
522
|
* symlink while `import.meta.url` is the resolved target - a raw string comparison never matches and the CLI silently does nothing. Canonicalizing both sides
|
|
327
523
|
* collapses that indirection (and any `file:`-dependency, copied-package, or `--preserve-symlinks` layout) to a single real path, so the check holds however the
|
|
328
524
|
* launcher reached this file. We keep this explicit realpath comparison rather than deferring to `import.meta.main`: the symlink and copied-package indirection is the
|
|
329
|
-
*
|
|
525
|
+
* concern the entry-point check exists to handle, and resolving it explicitly keeps that handling visible at the call site.
|
|
330
526
|
*
|
|
331
527
|
* @returns `true` when invoked as the program entry, `false` when imported or when the launch path cannot be resolved.
|
|
332
528
|
*/
|
|
@@ -344,7 +540,7 @@ function isEntryPoint() {
|
|
|
344
540
|
}
|
|
345
541
|
}
|
|
346
542
|
// Execute the CLI when this module is the program entry point. When imported by the test suite instead, `isEntryPoint()` is false and the module exposes
|
|
347
|
-
// `prepareUi` / `prepareDocs` / `runCli` / `USAGE` as a side-effect-free library surface.
|
|
543
|
+
// `prepareUi` / `prepareDocs` / `prepareChrome` / `runCli` / `USAGE` as a side-effect-free library surface.
|
|
348
544
|
if (isEntryPoint()) {
|
|
349
545
|
// Resolve HBPU's package root from this file's real location. The compiled CLI sits at `dist/cli/index.js`; walking two segments up from its real directory
|
|
350
546
|
// reaches the package root regardless of how the package is installed (a plugin's `node_modules`, a workspace symlink, a global install) or which Node
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA;;;GAGG;;;;;;;;;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,4JAA4J;AAC5J,kKAAkK;AAClK,sJAAsJ;AACtJ,4JAA4J;AAC5J,mDAAmD;AACnD,MAAM,eAAe,GAAG,4CAA4C,CAAC;AAErE,gKAAgK;AAChK,qKAAqK;AACrK,iKAAiK;AACjK,2BAA2B;AAC3B,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB;;;GAG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delay` produces when its signal aborts, matching `node:timers/promises` `setTimeout` exactly: a plain `Error` whose `name`
|
|
8
8
|
* is `"AbortError"` and whose `code` is the STRING `"ABORT_ERR"`. The real primitive's rejection is a dedicated internal class (not a `DOMException`, whose `code` is the
|
|
9
9
|
* numeric `20`, and there is no constructable `AbortError` global), so the double cannot match the constructor or prototype identity - it matches the observable `name`
|
|
10
|
-
* and `code` a consumer
|
|
10
|
+
* and `code` a consumer branches on, which is the contract that matters.
|
|
11
11
|
*
|
|
12
12
|
* @returns The `AbortError`-shaped rejection.
|
|
13
13
|
*/
|
|
@@ -129,7 +129,7 @@ export class TestClock {
|
|
|
129
129
|
get pending() {
|
|
130
130
|
return this.#pending.length;
|
|
131
131
|
}
|
|
132
|
-
// Remove `entry` from `#pending` by identity.
|
|
132
|
+
// Remove `entry` from `#pending` by identity. A guarded `indexOf` + `splice` makes a second removal (e.g. an abort that races a resolve) a safe no-op and
|
|
133
133
|
// never removes the wrong entry, so `#pending` stays consistent across any resolve-and-abort interleaving.
|
|
134
134
|
#remove(entry) {
|
|
135
135
|
const index = this.#pending.indexOf(entry);
|
package/dist/clock-double.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clock-double.js","sourceRoot":"","sources":["../src/clock-double.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAcpC;;;;;;;GAOG;AACH,SAAS,UAAU;IAEjB,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAErD,KAAK,CAAC,IAAI,GAAG,YAAY,CAAC;IAE1B,+JAA+J;IAC/J,2GAA2G;IAC1G,KAAkC,CAAC,IAAI,GAAG,WAAW,CAAC;IAEvD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,OAAO,SAAS;IAEpB,mFAAmF;IACnF,IAAI,CAAS;IAEb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