@moku-labs/common 0.1.1 → 0.2.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/index.mjs CHANGED
@@ -394,6 +394,19 @@ function createLogApi(ctx) {
394
394
  */
395
395
  reset() {
396
396
  state.entries.length = 0;
397
+ },
398
+ /**
399
+ * Remove all registered output sinks; the in-memory trace (`entries`) is
400
+ * unaffected, so `trace()`/`expect()` keep working.
401
+ *
402
+ * @example
403
+ * ```ts
404
+ * log.clearSinks();
405
+ * log.addSink(brandedSink()); // from @moku-labs/common/cli
406
+ * ```
407
+ */
408
+ clearSinks() {
409
+ state.sinks.length = 0;
397
410
  }
398
411
  };
399
412
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moku-labs/common",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "Shared framework plugins for the Moku family, built on @moku-labs/core.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -17,6 +17,16 @@
17
17
  "default": "./dist/index.cjs"
18
18
  }
19
19
  },
20
+ "./cli": {
21
+ "import": {
22
+ "types": "./dist/cli.d.mts",
23
+ "default": "./dist/cli.mjs"
24
+ },
25
+ "require": {
26
+ "types": "./dist/cli.d.cts",
27
+ "default": "./dist/cli.cjs"
28
+ }
29
+ },
20
30
  "./browser": {
21
31
  "import": {
22
32
  "types": "./dist/browser.d.mts",
@@ -25,8 +35,15 @@
25
35
  }
26
36
  },
27
37
  "sideEffects": false,
28
- "files": ["dist", "LICENSE", "README.md"],
29
- "engines": { "node": ">=24.0.0", "bun": ">=1.3.14" },
38
+ "files": [
39
+ "dist",
40
+ "LICENSE",
41
+ "README.md"
42
+ ],
43
+ "engines": {
44
+ "node": ">=24.0.0",
45
+ "bun": ">=1.3.14"
46
+ },
30
47
  "author": "Oleksandr Kucherenko",
31
48
  "license": "MIT",
32
49
  "repository": {
@@ -43,7 +60,8 @@
43
60
  "framework",
44
61
  "typescript",
45
62
  "logging",
46
- "env"
63
+ "env",
64
+ "cli"
47
65
  ],
48
66
  "publishConfig": {
49
67
  "access": "public",