obsidian-integration-testing 6.0.0 → 7.0.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/README.md +43 -6
- package/dist/lib/cjs/appium-session-config.cjs +9 -1
- package/dist/lib/cjs/appium-session-config.d.cts +22 -4
- package/dist/lib/cjs/connect-to-cdp.cjs +1 -1
- package/dist/lib/cjs/connect-to-cdp.d.cts +5 -4
- package/dist/lib/cjs/device-readiness.cjs +43 -0
- package/dist/lib/cjs/device-readiness.d.cts +55 -0
- package/dist/lib/cjs/eval-in-obsidian.cjs +1 -1
- package/dist/lib/cjs/eval-in-obsidian.d.cts +119 -87
- package/dist/lib/cjs/index.cjs +4 -1
- package/dist/lib/cjs/index.d.cts +3 -1
- package/dist/lib/cjs/lib-registry.cjs +59 -0
- package/dist/lib/cjs/lib-registry.d.cts +67 -0
- package/dist/lib/cjs/library.cjs +1 -1
- package/dist/lib/cjs/namespace-bootstrap.cjs +14 -5
- package/dist/lib/cjs/transport-factory.cjs +90 -12
- package/dist/lib/cjs/transport-options.cjs +1 -1
- package/dist/lib/cjs/transport-options.d.cts +29 -0
- package/dist/lib/esm/appium-session-config.d.mts +22 -4
- package/dist/lib/esm/appium-session-config.mjs +7 -1
- package/dist/lib/esm/connect-to-cdp.d.mts +5 -4
- package/dist/lib/esm/connect-to-cdp.mjs +1 -1
- package/dist/lib/esm/device-readiness.d.mts +55 -0
- package/dist/lib/esm/device-readiness.mjs +17 -0
- package/dist/lib/esm/eval-in-obsidian.d.mts +119 -87
- package/dist/lib/esm/eval-in-obsidian.mjs +1 -1
- package/dist/lib/esm/index.d.mts +3 -1
- package/dist/lib/esm/index.mjs +3 -1
- package/dist/lib/esm/lib-registry.d.mts +67 -0
- package/dist/lib/esm/lib-registry.mjs +32 -0
- package/dist/lib/esm/library.mjs +1 -1
- package/dist/lib/esm/namespace-bootstrap.mjs +17 -5
- package/dist/lib/esm/transport-factory.mjs +97 -13
- package/dist/lib/esm/transport-options.d.mts +29 -0
- package/dist/obsidian-integration-testing-7.0.0.tgz +0 -0
- package/package.json +1 -1
- package/dist/obsidian-integration-testing-6.0.0.tgz +0 -0
|
@@ -16,17 +16,109 @@ export interface CommonArgs {
|
|
|
16
16
|
* The Obsidian {@link App} instance.
|
|
17
17
|
*/
|
|
18
18
|
app: App;
|
|
19
|
+
/**
|
|
20
|
+
* The shared library bag injected into every callback — see {@link Lib}.
|
|
21
|
+
*
|
|
22
|
+
* Never empty: the harness pre-populates a **base** set of renderer-driving
|
|
23
|
+
* helpers (trusted input — `typeIntoEditor` / `pressKey` / `moveMouse` /
|
|
24
|
+
* `hoverElement` / `unhoverElement` — and `waitUntil`), and provider packages
|
|
25
|
+
* (chiefly `obsidian-dev-utils`) `Object.assign` their whole renderer-safe
|
|
26
|
+
* library on top via {@link registerLibResolver}. A serialized closure reaches
|
|
27
|
+
* every shared helper through `lib` — `lib.typeIntoEditor({ editor, text })`,
|
|
28
|
+
* `lib.getFileOrNull({ app, … })` — instead of importing or hand-rolling them.
|
|
29
|
+
*/
|
|
30
|
+
lib: Lib;
|
|
31
|
+
/**
|
|
32
|
+
* The `obsidian` module, resolved at runtime inside the Obsidian process.
|
|
33
|
+
*/
|
|
34
|
+
obsidianModule: typeof obsidian;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Parameters for {@link evalInObsidian}.
|
|
38
|
+
*/
|
|
39
|
+
export interface EvalInObsidianParams<Args extends GenericObject, Result, TContextId extends ContextId<unknown> | undefined = undefined> {
|
|
40
|
+
/**
|
|
41
|
+
* Additional arguments to pass to the function. Values may include functions —
|
|
42
|
+
* they are serialized via `toString()`.
|
|
43
|
+
*/
|
|
44
|
+
readonly args?: Args;
|
|
45
|
+
/**
|
|
46
|
+
* A {@link ContextId} linking this call to a persistent store on `window`
|
|
47
|
+
* in the Obsidian process. The callback receives a typed `context` object
|
|
48
|
+
* that survives across calls sharing the same ID.
|
|
49
|
+
*
|
|
50
|
+
* When omitted, `context` is a fresh empty object each call.
|
|
51
|
+
*/
|
|
52
|
+
readonly contextId?: TContextId;
|
|
53
|
+
/**
|
|
54
|
+
* The function to evaluate in the Obsidian context.
|
|
55
|
+
*/
|
|
56
|
+
fn(args: Args & CommonArgs & ContextArgs<TContextId>): Promisable<Result>;
|
|
57
|
+
/**
|
|
58
|
+
* Skips pre-flight checks (vault registration, CLI availability).
|
|
59
|
+
* Used internally by vault registration functions.
|
|
60
|
+
*
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
readonly shouldSkipPreflightChecks?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Override the transport for this call. When omitted, uses the transport
|
|
66
|
+
* configured via the context provider (set by the framework adapter's global setup).
|
|
67
|
+
*/
|
|
68
|
+
readonly transport?: ObsidianTransport;
|
|
69
|
+
/**
|
|
70
|
+
* The path to the Obsidian vault. Defaults to `process.cwd()`.
|
|
71
|
+
*/
|
|
72
|
+
readonly vaultPath?: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* A plain object with string keys.
|
|
76
|
+
*/
|
|
77
|
+
export type GenericObject = Record<string, unknown>;
|
|
78
|
+
/**
|
|
79
|
+
* Parameters for {@link CommonArgs.hoverElement}.
|
|
80
|
+
*/
|
|
81
|
+
export interface HoverElementParams {
|
|
82
|
+
/**
|
|
83
|
+
* The element to hover. The pointer is moved to its center. This is a live
|
|
84
|
+
* renderer DOM node — the callback runs in-renderer, so no cross-process
|
|
85
|
+
* serialization is needed (same as {@link TypeIntoEditorParams.editor}).
|
|
86
|
+
*/
|
|
87
|
+
readonly element: HTMLElement;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The shared library bag injected into every {@link evalInObsidian} callback as
|
|
91
|
+
* {@link CommonArgs.lib}.
|
|
92
|
+
*
|
|
93
|
+
* Two layers compose into this one bag. The **base** — the harness-provided
|
|
94
|
+
* renderer-driving helpers declared below (the trusted-input primitives and
|
|
95
|
+
* {@link Lib.waitUntil}) — is always present. On top, provider packages register
|
|
96
|
+
* a renderer-side resolver via {@link registerLibResolver} to `Object.assign`
|
|
97
|
+
* their whole renderer-safe library at runtime, and augment this **augmentable**
|
|
98
|
+
* interface (the `i18next` `CustomTypeOptions` idiom) via
|
|
99
|
+
* `declare module 'obsidian-integration-testing'` to type it. Multiple providers
|
|
100
|
+
* compose: their exports merge at runtime and their augmentations merge in the
|
|
101
|
+
* type system (`interface Lib extends …`).
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* declare module 'obsidian-integration-testing' {
|
|
106
|
+
* interface Lib extends (typeof import('obsidian-dev-utils/__merged')) {}
|
|
107
|
+
* }
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
export interface Lib {
|
|
19
111
|
/**
|
|
20
112
|
* Moves the mouse pointer to the center of an element using **trusted**
|
|
21
113
|
* Electron pointer input, then polls until the element actually matches
|
|
22
114
|
* `:hover`.
|
|
23
115
|
*
|
|
24
|
-
* Because the move is trusted (see {@link
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
116
|
+
* Because the move is trusted (see {@link Lib.moveMouse}), the real `:hover`
|
|
117
|
+
* state takes effect in the CSS engine — real theme `var()` values and real
|
|
118
|
+
* compositing — instead of a hand-simulated cascade. It polls the live
|
|
119
|
+
* `element.matches(':hover')` state (not a fixed delay), so it is robust under
|
|
120
|
+
* shared-instance load. It targets the single shared window's **global**
|
|
121
|
+
* pointer, so only one element is hovered at a time.
|
|
30
122
|
*
|
|
31
123
|
* @param params - The element to hover.
|
|
32
124
|
* @returns A {@link Promise} that resolves once the element matches `:hover`.
|
|
@@ -44,41 +136,35 @@ export interface CommonArgs {
|
|
|
44
136
|
*
|
|
45
137
|
* This is the low-level primitive: it performs a single move and does **not**
|
|
46
138
|
* wait for any state to settle (callers poll their own readiness signal).
|
|
47
|
-
* Prefer {@link
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* viewport width).
|
|
139
|
+
* Prefer {@link Lib.hoverElement} / {@link Lib.unhoverElement} for
|
|
140
|
+
* element-relative moves; use `moveMouse` directly when an element-relative
|
|
141
|
+
* target does not fit (e.g. an element spanning the full viewport width).
|
|
51
142
|
*
|
|
52
143
|
* @param params - The web-contents DIP coordinates to move to.
|
|
53
144
|
* @returns A {@link Promise} that resolves once the move has been injected.
|
|
54
145
|
*/
|
|
55
146
|
moveMouse(this: void, params: MoveMouseParams): Promise<void>;
|
|
56
|
-
/**
|
|
57
|
-
* The `obsidian` module, resolved at runtime inside the Obsidian process.
|
|
58
|
-
*/
|
|
59
|
-
obsidianModule: typeof obsidian;
|
|
60
147
|
/**
|
|
61
148
|
* Presses a single key (optionally with modifiers) using **trusted** Electron
|
|
62
149
|
* keyboard input, firing the full real key pipeline —
|
|
63
150
|
* `keydown` → `keypress` → `beforeinput` → `input` → `keyup`.
|
|
64
151
|
*
|
|
65
|
-
* This is the key-press analog of {@link
|
|
66
|
-
*
|
|
152
|
+
* This is the key-press analog of {@link Lib.typeIntoEditor}: it injects a
|
|
153
|
+
* trusted `keyDown` → `char` → `keyUp` sequence via Electron's
|
|
67
154
|
* `webContents.sendInputEvent`, so it is delivered to the window's DOM-focused
|
|
68
155
|
* element and flows through the real input pipeline — unlike
|
|
69
156
|
* `dispatchEvent(new KeyboardEvent(...))`, which is untrusted (`isTrusted:
|
|
70
157
|
* false`) and ignored by CodeMirror and most key handlers. Use it for special
|
|
71
158
|
* keys (`'Enter'`, `'Escape'`, `'Tab'`, arrow keys) and modifier combinations
|
|
72
|
-
* (`Shift+Enter`, `Ctrl+A`) that {@link
|
|
73
|
-
*
|
|
159
|
+
* (`Shift+Enter`, `Ctrl+A`) that {@link Lib.typeIntoEditor} (which types
|
|
160
|
+
* printable text) does not cover.
|
|
74
161
|
*
|
|
75
162
|
* This is the low-level primitive: it injects the key press and does **not**
|
|
76
163
|
* poll for any effect (a key press has no universal observable outcome —
|
|
77
164
|
* `Enter` edits the document, `Escape` closes a modal, `ArrowDown` moves the
|
|
78
165
|
* selection). The caller focuses the intended target first, then awaits the
|
|
79
|
-
* expected effect via {@link
|
|
80
|
-
*
|
|
81
|
-
* the key.
|
|
166
|
+
* expected effect via {@link Lib.waitUntil}. It targets the single shared
|
|
167
|
+
* window's **global** focus, so only the DOM-focused element receives the key.
|
|
82
168
|
*
|
|
83
169
|
* @param params - The key to press and any modifiers to hold.
|
|
84
170
|
* @returns A {@link Promise} that resolves once the key press has been
|
|
@@ -91,11 +177,10 @@ export interface CommonArgs {
|
|
|
91
177
|
*
|
|
92
178
|
* Typing is pressing each character key in turn: this focuses the editor
|
|
93
179
|
* (caret to end) and presses every code point of `text` via
|
|
94
|
-
* {@link
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
* focus**.
|
|
180
|
+
* {@link Lib.pressKey} — the same trusted `keyDown` → `char` → `keyUp` a real
|
|
181
|
+
* user produces. Each keystroke is delivered to the window's DOM-focused
|
|
182
|
+
* element and flows through CodeMirror's real input pipeline, so the typed
|
|
183
|
+
* text reaches the document **only if the editor genuinely holds focus**.
|
|
99
184
|
* This makes "the user typed into the editor" a faithful end-to-end check,
|
|
100
185
|
* unlike `dispatchEvent(new KeyboardEvent(...))` (untrusted — ignored by
|
|
101
186
|
* CodeMirror) or `execCommand('insertText')` (mutates the selection even
|
|
@@ -114,11 +199,11 @@ export interface CommonArgs {
|
|
|
114
199
|
* using a **trusted** Electron pointer move, then polls until the element no
|
|
115
200
|
* longer matches `:hover`.
|
|
116
201
|
*
|
|
117
|
-
* The inverse of {@link
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
202
|
+
* The inverse of {@link Lib.hoverElement}. It targets the single shared
|
|
203
|
+
* window's **global** pointer, so only one element is hovered at a time. When
|
|
204
|
+
* an element spans the full viewport (no point outside its box is reachable),
|
|
205
|
+
* use {@link Lib.moveMouse} directly to move the pointer to a known empty
|
|
206
|
+
* coordinate instead.
|
|
122
207
|
*
|
|
123
208
|
* @param params - The element to move the pointer away from.
|
|
124
209
|
* @returns A {@link Promise} that resolves once the element no longer matches
|
|
@@ -133,9 +218,9 @@ export interface CommonArgs {
|
|
|
133
218
|
* asynchronous effect to settle (a view to open, a DOM node to appear, a
|
|
134
219
|
* setting to apply). Because the callback is serialized via `toString()` and
|
|
135
220
|
* cannot import modules, it can't reuse `obsidian-dev-utils`'
|
|
136
|
-
* `retryWithTimeout` / `runWithTimeout`. This helper is the shared,
|
|
137
|
-
*
|
|
138
|
-
*
|
|
221
|
+
* `retryWithTimeout` / `runWithTimeout`. This helper is the shared, injected
|
|
222
|
+
* replacement for the per-closure poll loops consumers would otherwise
|
|
223
|
+
* hand-roll.
|
|
139
224
|
*
|
|
140
225
|
* The `predicate` may be synchronous or asynchronous — it is awaited on every
|
|
141
226
|
* poll. It is checked immediately, then re-checked every
|
|
@@ -149,59 +234,6 @@ export interface CommonArgs {
|
|
|
149
234
|
*/
|
|
150
235
|
waitUntil(this: void, params: WaitUntilParams): Promise<void>;
|
|
151
236
|
}
|
|
152
|
-
/**
|
|
153
|
-
* Parameters for {@link evalInObsidian}.
|
|
154
|
-
*/
|
|
155
|
-
export interface EvalInObsidianParams<Args extends GenericObject, Result, TContextId extends ContextId<unknown> | undefined = undefined> {
|
|
156
|
-
/**
|
|
157
|
-
* Additional arguments to pass to the function. Values may include functions —
|
|
158
|
-
* they are serialized via `toString()`.
|
|
159
|
-
*/
|
|
160
|
-
readonly args?: Args;
|
|
161
|
-
/**
|
|
162
|
-
* A {@link ContextId} linking this call to a persistent store on `window`
|
|
163
|
-
* in the Obsidian process. The callback receives a typed `context` object
|
|
164
|
-
* that survives across calls sharing the same ID.
|
|
165
|
-
*
|
|
166
|
-
* When omitted, `context` is a fresh empty object each call.
|
|
167
|
-
*/
|
|
168
|
-
readonly contextId?: TContextId;
|
|
169
|
-
/**
|
|
170
|
-
* The function to evaluate in the Obsidian context.
|
|
171
|
-
*/
|
|
172
|
-
fn(args: Args & CommonArgs & ContextArgs<TContextId>): Promisable<Result>;
|
|
173
|
-
/**
|
|
174
|
-
* Skips pre-flight checks (vault registration, CLI availability).
|
|
175
|
-
* Used internally by vault registration functions.
|
|
176
|
-
*
|
|
177
|
-
* @internal
|
|
178
|
-
*/
|
|
179
|
-
readonly shouldSkipPreflightChecks?: boolean;
|
|
180
|
-
/**
|
|
181
|
-
* Override the transport for this call. When omitted, uses the transport
|
|
182
|
-
* configured via the context provider (set by the framework adapter's global setup).
|
|
183
|
-
*/
|
|
184
|
-
readonly transport?: ObsidianTransport;
|
|
185
|
-
/**
|
|
186
|
-
* The path to the Obsidian vault. Defaults to `process.cwd()`.
|
|
187
|
-
*/
|
|
188
|
-
readonly vaultPath?: string;
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* A plain object with string keys.
|
|
192
|
-
*/
|
|
193
|
-
export type GenericObject = Record<string, unknown>;
|
|
194
|
-
/**
|
|
195
|
-
* Parameters for {@link CommonArgs.hoverElement}.
|
|
196
|
-
*/
|
|
197
|
-
export interface HoverElementParams {
|
|
198
|
-
/**
|
|
199
|
-
* The element to hover. The pointer is moved to its center. This is a live
|
|
200
|
-
* renderer DOM node — the callback runs in-renderer, so no cross-process
|
|
201
|
-
* serialization is needed (same as {@link TypeIntoEditorParams.editor}).
|
|
202
|
-
*/
|
|
203
|
-
readonly element: HTMLElement;
|
|
204
|
-
}
|
|
205
237
|
/**
|
|
206
238
|
* Parameters for {@link CommonArgs.moveMouse}.
|
|
207
239
|
*/
|
package/dist/lib/cjs/index.cjs
CHANGED
|
@@ -25,6 +25,7 @@ __export(index_exports, {
|
|
|
25
25
|
connectToCdp: () => import_connect_to_cdp.connectToCdp,
|
|
26
26
|
createTransportFromOptions: () => import_transport_factory.createTransportFromOptions,
|
|
27
27
|
evalInObsidian: () => import_eval_in_obsidian.evalInObsidian,
|
|
28
|
+
registerLibResolver: () => import_lib_registry.registerLibResolver,
|
|
28
29
|
registerVault: () => import_vault_registry.registerVault,
|
|
29
30
|
setTransportOptionsResolver: () => import_context_provider.setTransportOptionsResolver,
|
|
30
31
|
setVaultPathResolver: () => import_context_provider.setVaultPathResolver,
|
|
@@ -35,6 +36,7 @@ var import_connect_to_cdp = require("./connect-to-cdp.cjs");
|
|
|
35
36
|
var import_context_id = require("./context-id.cjs");
|
|
36
37
|
var import_context_provider = require("./context-provider.cjs");
|
|
37
38
|
var import_eval_in_obsidian = require("./eval-in-obsidian.cjs");
|
|
39
|
+
var import_lib_registry = require("./lib-registry.cjs");
|
|
38
40
|
var import_temp_vault = require("./temp-vault.cjs");
|
|
39
41
|
var import_transport_appium = require("./transport-appium.cjs");
|
|
40
42
|
var import_transport_desktop_cdp = require("./transport-desktop-cdp.cjs");
|
|
@@ -49,9 +51,10 @@ var import_vault_registry = require("./vault-registry.cjs");
|
|
|
49
51
|
connectToCdp,
|
|
50
52
|
createTransportFromOptions,
|
|
51
53
|
evalInObsidian,
|
|
54
|
+
registerLibResolver,
|
|
52
55
|
registerVault,
|
|
53
56
|
setTransportOptionsResolver,
|
|
54
57
|
setVaultPathResolver,
|
|
55
58
|
unregisterVault
|
|
56
59
|
});
|
|
57
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
60
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vc3JjL2luZGV4LnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyIvKipcbiAqIEBmaWxlXG4gKlxuICogQ29udGFpbnMgdGhlIGVudHJ5IHBvaW50IGZvciB0aGUgaW50ZWdyYXRpb24gdGVzdGluZyBtb2R1bGUuXG4gKi9cblxuZXhwb3J0IHR5cGUge1xuICBDZHBDb25uZWN0aW9uLFxuICBDb25uZWN0VG9DZHBPcHRpb25zXG59IGZyb20gJy4vY29ubmVjdC10by1jZHAuY2pzJztcbmV4cG9ydCB7IGNvbm5lY3RUb0NkcCB9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QUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFVQSw0QkFBNkI7QUFDN0Isd0JBQTBCO0FBSzFCLDhCQUdPO0FBV1AsOEJBQStCO0FBRS9CLDBCQUFvQztBQUtwQyx3QkFBMEI7QUFLMUIsOEJBQWdDO0FBTWhDLG1DQUFvQztBQUNwQywrQkFBMkM7QUFVM0MsNEJBR087IiwKICAibmFtZXMiOiBbXQp9Cg==
|
package/dist/lib/cjs/index.d.cts
CHANGED
|
@@ -8,8 +8,10 @@ export { connectToCdp } from './connect-to-cdp.cjs';
|
|
|
8
8
|
export { ContextId } from './context-id.cjs';
|
|
9
9
|
export type { TransportOptionsResolver, VaultPathResolver } from './context-provider.cjs';
|
|
10
10
|
export { setTransportOptionsResolver, setVaultPathResolver } from './context-provider.cjs';
|
|
11
|
-
export type { EvalInObsidianParams, HoverElementParams, MoveMouseParams, PressKeyParams, TypeIntoEditorParams, UnhoverElementParams, WaitUntilParams } from './eval-in-obsidian.cjs';
|
|
11
|
+
export type { EvalInObsidianParams, HoverElementParams, Lib, MoveMouseParams, PressKeyParams, TypeIntoEditorParams, UnhoverElementParams, WaitUntilParams } from './eval-in-obsidian.cjs';
|
|
12
12
|
export { evalInObsidian } from './eval-in-obsidian.cjs';
|
|
13
|
+
export type { LibResolver } from './lib-registry.cjs';
|
|
14
|
+
export { registerLibResolver } from './lib-registry.cjs';
|
|
13
15
|
export type { PopulateFileContent, PopulateFilesParams } from './temp-vault.cjs';
|
|
14
16
|
export { TempVault } from './temp-vault.cjs';
|
|
15
17
|
export type { AppiumSessionInfo, AppiumTransportConfig } from './transport-appium.cjs';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var lib_registry_exports = {};
|
|
20
|
+
__export(lib_registry_exports, {
|
|
21
|
+
computeBootstrapVersion: () => computeBootstrapVersion,
|
|
22
|
+
getBootstrapVersion: () => getBootstrapVersion,
|
|
23
|
+
getRegisteredLibResolvers: () => getRegisteredLibResolvers,
|
|
24
|
+
registerLibResolver: () => registerLibResolver
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(lib_registry_exports);
|
|
27
|
+
var import_library = require("./library.cjs");
|
|
28
|
+
const libResolvers = [];
|
|
29
|
+
const registeredResolverSources = /* @__PURE__ */ new Set();
|
|
30
|
+
function computeBootstrapVersion(version, resolvers) {
|
|
31
|
+
if (resolvers.length === 0) {
|
|
32
|
+
return version;
|
|
33
|
+
}
|
|
34
|
+
const SEPARATOR = "\0";
|
|
35
|
+
const sources = resolvers.map((resolver) => resolver.toString()).join(SEPARATOR);
|
|
36
|
+
return `${version}${SEPARATOR}${sources}`;
|
|
37
|
+
}
|
|
38
|
+
function getBootstrapVersion() {
|
|
39
|
+
return computeBootstrapVersion(import_library.LIBRARY_VERSION, libResolvers);
|
|
40
|
+
}
|
|
41
|
+
function getRegisteredLibResolvers() {
|
|
42
|
+
return libResolvers;
|
|
43
|
+
}
|
|
44
|
+
function registerLibResolver(resolver) {
|
|
45
|
+
const source = resolver.toString();
|
|
46
|
+
if (registeredResolverSources.has(source)) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
registeredResolverSources.add(source);
|
|
50
|
+
libResolvers.push(resolver);
|
|
51
|
+
}
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
computeBootstrapVersion,
|
|
55
|
+
getBootstrapVersion,
|
|
56
|
+
getRegisteredLibResolvers,
|
|
57
|
+
registerLibResolver
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vc3JjL2xpYi1yZWdpc3RyeS50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAZmlsZVxuICpcbiAqIFJlZ2lzdHJ5IG9mIHJlbmRlcmVyLXNpZGUgcmVzb2x2ZXJzIHRoYXQgcG9wdWxhdGUgdGhlIGBsaWJgIGFyZ3VtZW50IGluamVjdGVkXG4gKiBpbnRvIGV2ZXJ5IHtAbGluayBldmFsSW5PYnNpZGlhbn0gY2FsbGJhY2suXG4gKlxuICogQSBwcm92aWRlciBwYWNrYWdlIChlLmcuIGBvYnNpZGlhbi1kZXYtdXRpbHNgKSByZWdpc3RlcnMgYSByZXNvbHZlciB2aWFcbiAqIHtAbGluayByZWdpc3RlckxpYlJlc29sdmVyfSBmcm9tIGl0cyBwZXItd29ya2VyIHRlc3Qgc2V0dXAgKGBzZXR1cEZpbGVzYCksXG4gKiBsaWtlIHRoZSBjb250ZXh0IHJlc29sdmVycyBpbiBgY29udGV4dC1wcm92aWRlci50c2AgXHUyMDE0IHJlZ2lzdHJhdGlvbiBtdXN0IGhhcHBlblxuICogaW4gdGhlIHdvcmtlciBiZWNhdXNlIHRoZSBuYW1lc3BhY2UgYm9vdHN0cmFwIGlzIGdlb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lib` argument injected
|
|
5
|
+
* into every {@link evalInObsidian} callback.
|
|
6
|
+
*
|
|
7
|
+
* A provider package (e.g. `obsidian-dev-utils`) registers a resolver via
|
|
8
|
+
* {@link registerLibResolver} from its per-worker test setup (`setupFiles`),
|
|
9
|
+
* like the context resolvers in `context-provider.ts` — registration must happen
|
|
10
|
+
* in the worker because the namespace bootstrap is generated per-worker. Each
|
|
11
|
+
* resolver is a self-contained function that runs inside the Obsidian renderer
|
|
12
|
+
* and returns an object; the harness serializes it into the bootstrap and
|
|
13
|
+
* `Object.assign`s every resolver's result into the single `lib` bag.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* A self-contained function, evaluated inside the Obsidian renderer, that returns
|
|
17
|
+
* an object whose own enumerable properties are merged (via `Object.assign`) into
|
|
18
|
+
* the injected `lib` bag.
|
|
19
|
+
*
|
|
20
|
+
* It is serialized via `toString()` and must not close over any module scope
|
|
21
|
+
* (imports are unavailable in the serialized renderer closure); read a renderer
|
|
22
|
+
* global instead (e.g. a value a fixture plugin published on `window`). Returning
|
|
23
|
+
* `null`/`undefined` is tolerated at runtime (`Object.assign` ignores it).
|
|
24
|
+
*
|
|
25
|
+
* @returns The object whose own enumerable properties are merged into `lib`.
|
|
26
|
+
*/
|
|
27
|
+
export type LibResolver = (this: void) => object;
|
|
28
|
+
/**
|
|
29
|
+
* Computes the namespace-bootstrap version string, folding the registered
|
|
30
|
+
* resolver sources into the base library version so that a changed resolver set
|
|
31
|
+
* forces a re-bootstrap of the shared Obsidian instance.
|
|
32
|
+
*
|
|
33
|
+
* Pure — takes the resolver array explicitly so it can be unit-tested without
|
|
34
|
+
* touching the module-level registry.
|
|
35
|
+
*
|
|
36
|
+
* @param version - The base library version.
|
|
37
|
+
* @param resolvers - The registered resolvers.
|
|
38
|
+
* @returns The base version when `resolvers` is empty; otherwise the base version
|
|
39
|
+
* combined with every resolver's source text.
|
|
40
|
+
*/
|
|
41
|
+
export declare function computeBootstrapVersion(version: string, resolvers: readonly LibResolver[]): string;
|
|
42
|
+
/**
|
|
43
|
+
* Returns the namespace-bootstrap version for the currently registered
|
|
44
|
+
* resolvers — {@link computeBootstrapVersion} applied to
|
|
45
|
+
* {@link getRegisteredLibResolvers}.
|
|
46
|
+
*
|
|
47
|
+
* @returns The bootstrap version string.
|
|
48
|
+
*/
|
|
49
|
+
export declare function getBootstrapVersion(): string;
|
|
50
|
+
/**
|
|
51
|
+
* Returns every registered {@link LibResolver}, in registration order.
|
|
52
|
+
*
|
|
53
|
+
* @returns The registered resolvers.
|
|
54
|
+
*/
|
|
55
|
+
export declare function getRegisteredLibResolvers(): readonly LibResolver[];
|
|
56
|
+
/**
|
|
57
|
+
* Registers a renderer-side resolver whose result is merged into the `lib`
|
|
58
|
+
* argument of every {@link evalInObsidian} callback. Call from a provider's
|
|
59
|
+
* per-worker test setup (`setupFiles`), like the context resolvers.
|
|
60
|
+
*
|
|
61
|
+
* Registration is idempotent by source text: registering a resolver whose
|
|
62
|
+
* `toString()` matches an already-registered one is a no-op, so a setup module
|
|
63
|
+
* evaluated more than once does not merge the same library twice.
|
|
64
|
+
*
|
|
65
|
+
* @param resolver - The resolver function.
|
|
66
|
+
*/
|
|
67
|
+
export declare function registerLibResolver(resolver: LibResolver): void;
|
package/dist/lib/cjs/library.cjs
CHANGED
|
@@ -21,7 +21,7 @@ __export(library_exports, {
|
|
|
21
21
|
LIBRARY_VERSION: () => LIBRARY_VERSION
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(library_exports);
|
|
24
|
-
const LIBRARY_VERSION = false ? "dev" : "
|
|
24
|
+
const LIBRARY_VERSION = false ? "dev" : "6.2.0";
|
|
25
25
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
26
|
0 && (module.exports = {
|
|
27
27
|
LIBRARY_VERSION
|