From 14bb05533c606abe2a180398c934ec1c4e29eff5 Mon Sep 17 00:00:00 2001 From: Chris Campbell Date: Wed, 21 Aug 2024 13:38:46 -0700 Subject: [PATCH] fix: restore exports of non-public perf functions in runtime package (#515) Fixes #514 --- packages/runtime/src/index.spec.ts | 16 ++++++++++++++++ packages/runtime/src/index.ts | 3 +++ 2 files changed, 19 insertions(+) create mode 100644 packages/runtime/src/index.spec.ts diff --git a/packages/runtime/src/index.spec.ts b/packages/runtime/src/index.spec.ts new file mode 100644 index 00000000..bd7e685d --- /dev/null +++ b/packages/runtime/src/index.spec.ts @@ -0,0 +1,16 @@ +// Copyright (c) 2024 Climate Interactive / New Venture Fund + +import { describe, expect, it } from 'vitest' + +import { perfNow, perfElapsed } from './index' + +describe('non-public perf functions', () => { + it('should be exported', () => { + // The `perf` functions are not officially part of the public API, but they should be + // exported for use in experimental tools, so we verify that they are accessible as + // top-level exports + const t0 = perfNow() + const elapsed = perfElapsed(t0) + expect(elapsed).toBeDefined() + }) +}) diff --git a/packages/runtime/src/index.ts b/packages/runtime/src/index.ts index 146e7c84..57b05284 100644 --- a/packages/runtime/src/index.ts +++ b/packages/runtime/src/index.ts @@ -7,3 +7,6 @@ export * from './js-model' export * from './wasm-model' export * from './model-runner' export * from './model-scheduler' + +/** @hidden The `perf` module is not part of the public API, but is exposed for use in performance tools. */ +export * from './perf'