@forwardimpact/libcli 0.1.15 → 0.1.16
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/package.json +1 -1
- package/src/embed.js +14 -0
- package/src/index.js +1 -0
package/package.json
CHANGED
package/src/embed.js
CHANGED
|
@@ -47,6 +47,20 @@ export function embeddedAssetsActive() {
|
|
|
47
47
|
return registry.size > 0;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Clear every registered mount, restoring the unregistered state in which
|
|
52
|
+
* {@link embeddedAssetsActive} is false and {@link withEmbeddedAssets} is a
|
|
53
|
+
* no-op. Production never calls this: a compiled binary registers once at
|
|
54
|
+
* startup via the generated barrel and never resets. It exists so a test
|
|
55
|
+
* exercising the on-disk (unregistered) branch is hermetic regardless of the
|
|
56
|
+
* order tests run in a shared `bun test` process — `registerAssets` writes a
|
|
57
|
+
* module-global registry, so a test that registers a mount would otherwise leak
|
|
58
|
+
* the active flag into every later test file.
|
|
59
|
+
*/
|
|
60
|
+
export function resetEmbeddedAssets() {
|
|
61
|
+
registry.clear();
|
|
62
|
+
}
|
|
63
|
+
|
|
50
64
|
/**
|
|
51
65
|
* True when this process is a `bun build --compile` standalone binary.
|
|
52
66
|
*
|