Skip to content

chore(release): version packages#12

Merged
faraa2m merged 0 commit into
mainfrom
changeset-release/main
May 10, 2026
Merged

chore(release): version packages#12
faraa2m merged 0 commit into
mainfrom
changeset-release/main

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 10, 2026

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@github-actions github-actions Bot force-pushed the changeset-release/main branch from af0e62d to 2f317e9 Compare May 10, 2026 02:37
@vercel
Copy link
Copy Markdown

vercel Bot commented May 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tokenometer Ready Ready Preview, Comment May 10, 2026 3:35am

@faraa2m faraa2m closed this May 10, 2026
@faraa2m faraa2m reopened this May 10, 2026
@github-actions github-actions Bot force-pushed the changeset-release/main branch from 8352fed to cc745d5 Compare May 10, 2026 03:35
@faraa2m faraa2m merged commit cc745d5 into main May 10, 2026
11 checks passed
faraa2m added a commit that referenced this pull request May 11, 2026
…uto-detect (#13)

* feat: Wave 2 v1.0.0 rollout — config, SARIF, vision, per-file diff, auto-detect

Adds the first batch of feature work toward v1.0.0. Pure additions; no
breaking changes to existing flags or output.

Core lib (`@tokenometer/core`):
- `loadConfig` / `parseConfig` for `.tokenometer.yml` (walk-up; halts at
  filesystem root or git root). Validates models against KNOWN_MODELS and
  formats against the supported set.
- `toSarif` for SARIF 2.1.0 emission (consumed by CLI `--output sarif` and
  by `gh code-scanning`).
- `anthropicVisionTokens`, `openaiVisionTokens`, `googleVisionTokens` —
  documented per-provider formulas; ignores `detail` where the provider
  doesn't expose it.

GitHub Action (`packages/action`):
- Sticky PR comment now includes a top-N changed-file table with per-file
  Δ tokens and Δ USD plus a collapsible "all files" details block.
- New optional `top-n-files` input (1-20, default 5).
- Per-file aggregator extracted to `per-file-diff.ts` for unit tests.
- Action `dist/index.cjs` rebuilt.

CLI (`tokenometer`):
- Auto provider detection: when `--model` is omitted, picks based on which
  of `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GOOGLE_API_KEY`/`GEMINI_API_KEY`
  is set. Stderr note when multiple are present.
- `.tokenometer.yml` config loading; `--no-config` to skip; `--config <path>`
  to point at a specific file. User flags always win.
- `--by-file` per-file token/cost attribution table (no-op for single file).
- `--output table|json|sarif` for machine-readable output.
- `--image <path>` (repeatable) for vision-token cost across providers.

Release workflow:
- Chained `npm run lint:fix` after `changeset version` so Biome compact
  arrays survive Changesets' package.json rewrites — fixes the lint failure
  pattern seen on PR #12.

Mistral integration research memo at `local research notes`
informs Wave 3 Phase H impl: ship `mistral-tokenizer-js` for SentencePiece
family with `approximate: true`, fall back to char-ratio heuristic for Tekken
models, defer empirical mode (no public token-count endpoint).

Test count: 102 → 150 (across 16 files). Lint, typecheck, build all clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(core): defer node:fs/path imports in loadConfig for browser builds

The static `import { existsSync } from 'node:fs'` etc. at the top of
config.ts caused Vite (used by @tokenometer/web) to externalize the
node:* modules for browser builds, then Rollup failed because the
externalized stub doesn't expose named members like `join`.

Move the node:fs / node:fs/promises / node:path imports inside
loadConfig as dynamic imports. Vite stops static-tracing them, so the
browser build succeeds. Node still resolves them normally at runtime.

parseConfig is unchanged — it was already pure.

Fixes the test/build CI step + Vercel preview deploy on PR #13.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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