Metadata-Version: 2.4
Name: size-report
Version: 3.2.0
Summary: Tracking how the volume of code and documents grows across git history: raw / min / tokens
Author: vernikr
License: MIT License
        
        Copyright (c) 2026 vernikr
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/vernikr/size-report-v2
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: tokens
Requires-Dist: tiktoken>=0.7; extra == "tokens"
Dynamic: license-file

# size-report

Watches how much code and documentation a project carries, commit by commit. Every file is measured
as written (`raw`), minified (`min`) and in tokens for a language model (`tok`), so a person sees
where a project swells and an agent sees what a change weighs in its own context. It forbids nothing
and blocks nothing: it only shows.

The report is a single self-contained page — no server, no network — written where you name it,
outside the repository too. A project needs no settings to start: with no config file the tool
derives them from the project and says so in one line.

One canonical JavaScript engine (`src/`) ships in two registries from the same release tag:

- **npm (`@vernikr/size-report`)** for JavaScript/TypeScript repositories (`Node >= 20.19`).
- **PyPI (`size-report`)** for Python-first (`uv` / `pyproject.toml`) repositories with zero
  `package.json` or `node_modules/` clutter in the consumer workspace.

## Install

### Python (`uv` / PyPI)

```bash
uv add --dev "size-report[tokens]"   # or `uv add --dev size-report` without tiktoken
uvx size-report --help               # one-off run without adding to the project
```

The Python package exposes `size`, `size-report`, and `python -m size_report`. It reuses a local
`node >= 20.19` when present, or downloads, SHA-256-verifies, and caches the pinned standalone Node
runtime in the user's cache directory (never inside the repository). Installing the `[tokens]` extra
provides exact `o200k_base` / `cl100k_base` token counts via `tiktoken`.

### JavaScript / Node (`pnpm` / npm)

```bash
pnpm add -D @vernikr/size-report     # npm i -D / yarn add -D work too
```

Needs a git repository with history and Node ≥ 20.19.

## Use

```bash
# Python-first (uv) — or substitute `pnpm exec size` in Node projects
uv run size                       # the sizes now (with "output" in settings: verify the stored report)
uv run size --write ../r.html     # build the report there — any path; settings are derived if absent
uv run size --init                # pin what was derived into pyproject.toml [tool.size-report] (or size-table.config.json)
uv run size check                 # did anything in the history go past the columns?
uv run size explain <commit>      # why one commit has no row
uv run size diff --tree           # how much the last commit moved the sizes, folder by folder
uv run size diff --worktree       # the same for uncommitted changes
uv run size now --tree            # the sizes now, where they live, the biggest first
uv run size log                   # the last 20 commits that changed the sizes, and by how much
uv run size doctor                # all diagnostics in one answer
uv run size install-hook ../r.html  # rebuild it there after every commit and merge (never commits)
```

For Python-first projects, [`templates/ci-python.yml`](templates/ci-python.yml) provides the GitHub
Actions check and [`.pre-commit-hooks.yaml`](.pre-commit-hooks.yaml) provides `size-verify` and
`size-check` hooks for `pre-commit`.

## Where the rest is

- [`docs/architecture.md`](docs/architecture.md) — how the tool is built, dual distribution, the
  checks and the gate against bloat.
- [`docs/wiring.md`](docs/wiring.md) — wiring it into npm or Python (`uv`) projects, migrating from
  synthetic `package.json`, settings, and the surface for an agent.
- [`docs/files.md`](docs/files.md) — what is in this repository.
- [`AGENTS.md`](AGENTS.md) — how to work inside this repository.

## License

MIT
