Skip to content

feat(js): buckaroo-js-core exports its own version - #1094

Merged
paddymul merged 2 commits into
mainfrom
feat/js-core-export-version
Oct 21, 2026
Merged

paddymul merged 2 commits into
mainfrom
feat/js-core-export-version

Conversation

@paddymul

@paddymul paddymul commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

An app that bundles buckaroo-js-core cannot ask the renderer it is running which version it is. The version lives in package.json, and a bundle carries only the code. tallyman pins buckaroo (the Python server) and buckaroo-js-core to the same version and has hit the failure that follows when they drift: a renderer older than the server does not send ?caps=stats_update, so the server computes every summary stat before the first row and the grid is slow to appear, with no error. Checking node_modules or a stamp file in dist can disagree with what the page actually runs. Asking the renderer cannot.

Change

src/version.ts exports version, read from package.json, and index.ts exposes it as a named export and on the default export.

The Release workflow already runs npm version <release> --no-git-tag-version before pnpm run build, so a published bundle reports the version it was released as. package.json in the repo stays at 0.12.0, so a local build reports 0.12.0.

Two build settings change because src/version.ts imports package.json:

  • tsconfig.json lists package.json in include. A composite project refuses an import of a file outside that list (TS6307), and vite-plugin-dts printed it as an error on every build.
  • vite.config.ts stops vite-plugin-dts from writing dist/package.json.d.ts, which would otherwise hold the whole package.json as a type and ship in the package. version is declared as string, so the emitted .d.ts does not import ../package.json, which is not published next to dist/.

Tests

src/version.test.ts checks that version equals the package.json version, looks like a dotted version, and is also on the default export. It failed on CI before the fix commit (run 39493929890, JS / Build + Test: 3 failed, 371 passed). The red commit types the export loosely so that tsc in the pre-commit hook passes and the failure is in the assertions. The fix commit switches to typed imports.

Locally: the core jest suite passes (374 tests) and pnpm run build prints no diagnostics. The file list under dist/ matches main's apart from the new dist/src/version.d.ts. After npm version 9.9.9 --no-git-tag-version, pnpm run build puts "9.9.9" in index.esm.js, index.es.js and index.cjs.js.

Not in this PR: a release, and the tallyman side that compares this version with the server's /health version and the version it pins.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

📦 TestPyPI package published

pip install --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo==0.15.10.dev39494803321

or with uv:

uv pip install --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo==0.15.10.dev39494803321

MCP server for Claude Code

claude mcp add buckaroo-table -- uvx --from "buckaroo[mcp]==0.15.10.dev39494803321" --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo-table

📖 Docs preview

🎨 Storybook preview

The Release workflow runs npm version before the build, so the exported
version is the one the bundle was released as. A consumer can compare it
with the Python server's /health version and with what it pinned.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@paddymul
paddymul marked this pull request as ready for review October 20, 2026 21:02
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T21:04:58.465612Z c3455ca Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@paddymul
paddymul added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit f6fbe55 Oct 21, 2026
28 checks passed
paddymul added a commit to buckaroo-data/tallyman that referenced this pull request Oct 21, 2026
0.15.11 is the first release whose buckaroo-js-core exports its version
(buckaroo-data/buckaroo#1094).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
testpypi — c3455ca6 Deployed Oct 20, 2026 by paddymul via Publish to TestPyPI #1822
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant