@skillstate/bench 2.0.0 → 2.0.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -1,8 +1,7 @@
1
1
  // @skillstate/bench — deterministic local benchmark harness.
2
2
  //
3
- // NOTE: re-exporting `./run.js` also evaluates its top-level `main()`
4
- // (the `npm run bench` entry), exactly like importing the historical
5
- // `dist/bench/run.js` directly.
3
+ // NOTE: re-exporting `./run.js` is side-effect free `main` only executes
4
+ // when `run.js` is the process entry (`node dist/run.js`), never on import.
6
5
  export * from './harness.js';
7
6
  export * from './run.js';
8
7
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,EAAE;AACF,sEAAsE;AACtE,qEAAqE;AACrE,gCAAgC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,EAAE;AACF,2EAA2E;AAC3E,4EAA4E;AAC5E,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
package/dist/run.d.ts CHANGED
@@ -2,6 +2,10 @@
2
2
  * `npm run bench` entry point (zero-deps, runs from compiled dist).
3
3
  *
4
4
  * @non-paper — local deterministic harness CLI, not part of the paper.
5
+ *
6
+ * Importing this module is side-effect free: the benchmark only runs when
7
+ * this file is the process entry (`node dist/run.js`, the `npm run bench`
8
+ * path), never when `@skillstate/bench` is imported as a library.
5
9
  */
6
10
  import type { BenchResult } from './harness.js';
7
11
  /** Run all horizons, print the table plus machine-readable JSON. */
package/dist/run.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,oEAAoE;AACpE,wBAAsB,IAAI,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAKnD"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,oEAAoE;AACpE,wBAAsB,IAAI,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAKnD"}
package/dist/run.js CHANGED
@@ -2,7 +2,12 @@
2
2
  * `npm run bench` entry point (zero-deps, runs from compiled dist).
3
3
  *
4
4
  * @non-paper — local deterministic harness CLI, not part of the paper.
5
+ *
6
+ * Importing this module is side-effect free: the benchmark only runs when
7
+ * this file is the process entry (`node dist/run.js`, the `npm run bench`
8
+ * path), never when `@skillstate/bench` is imported as a library.
5
9
  */
10
+ import { pathToFileURL } from 'node:url';
6
11
  import { BENCH_T_VALUES, runAll, formatTable } from './harness.js';
7
12
  /** Run all horizons, print the table plus machine-readable JSON. */
8
13
  export async function main() {
@@ -11,5 +16,9 @@ export async function main() {
11
16
  console.log(JSON.stringify(results, null, 2));
12
17
  return results;
13
18
  }
14
- void main();
19
+ const isEntry = process.argv[1] !== undefined &&
20
+ pathToFileURL(process.argv[1]).href === import.meta.url;
21
+ if (isEntry) {
22
+ await main();
23
+ }
15
24
  //# sourceMappingURL=run.js.map
package/dist/run.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"run.js","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,CAAC;AACf,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skillstate/bench",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Deterministic local benchmark harness for the skillstate runtime (entry only).",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -12,7 +12,9 @@
12
12
  },
13
13
  "./package.json": "./package.json"
14
14
  },
15
- "files": ["dist"],
15
+ "files": [
16
+ "dist"
17
+ ],
16
18
  "sideEffects": false,
17
19
  "engines": {
18
20
  "node": ">=20"