diff --git a/README.md b/README.md index deb599b..03a531a 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,22 @@ ## Description sizeofvar allows you to get a realistic memory size of any variable upon initialization or variable setting. +## ✨ What's New + +### Latest: v1.0.13 (October 2026) + +- **Dev-tooling dependency bump ([#32](https://github.com/CLDMV/sizeofvar/pull/32))** — `@cldmv/fix-headers` moves from 2.1.1 to 2.1.4, the tool that maintains the repository's file headers. It produced no header changes here, so only `package.json` and the lockfile changed. The `sizeofvar()` function is unchanged; it's a drop-in replacement for the previous version. +- [View full v1.0.13 Changelog](https://github.com/CLDMV/sizeofvar/blob/master/docs/changelog/v1/v1.0.13.md) + +### Recent Releases + +- **v1.0.12** (October 2026) — CI only: the in-repo PR mirror job now always runs and reports under a non-required name instead of being skipped ([Changelog](https://github.com/CLDMV/sizeofvar/blob/master/docs/changelog/v1/v1.0.12.md)) +- **v1.0.11** (October 2026) — CI only: a skipped PR-run mirror job no longer satisfies the `✅ Required PR Check` ruleset gate ([Changelog](https://github.com/CLDMV/sizeofvar/blob/master/docs/changelog/v1/v1.0.11.md)) +- **v1.0.10** (October 2026) — workflows synced to the CLDMV/.github v4.29.2 templates, bundle-size workflow, shared fix-headers config (comment-only header in `sizeofvar.js`); no runtime change ([Changelog](https://github.com/CLDMV/sizeofvar/blob/master/docs/changelog/v1/v1.0.10.md)) +- **v1.0.9** (September 2026) — vitest 5 test toolchain, a CI Node matrix of 22.12.0–26, and signed hotfix-redirector cherry-picks; no runtime change ([Changelog](https://github.com/CLDMV/sizeofvar/blob/master/docs/changelog/v1/v1.0.9.md)) + +📚 **For complete version history and detailed release notes, see the [docs/changelog/](https://github.com/CLDMV/sizeofvar/tree/master/docs/changelog/) folder.** + ## Install ```bash npm i @cldmv/sizeofvar --save diff --git a/docs/changelog/v1/v1.0.1.md b/docs/changelog/v1/v1.0.1.md new file mode 100644 index 0000000..6c9e9b6 --- /dev/null +++ b/docs/changelog/v1/v1.0.1.md @@ -0,0 +1,30 @@ +# sizeofvar v1.0.1 Changelog + +**Release Date**: March 2018 +**Release Type**: Patch + +--- + +## Overview + +First release of sizeofvar, published to npm as `@cldmv/sizeofvar` (an unscoped `sizeofvar` package was published and withdrawn the same day). It bundles everything from the initial import on 2018-03-01 through the scoping of the package to CLDMV. + +--- + +## ✨ Features + +- **`sizeofvar(value)`** estimates the V8 memory footprint of a value at initialization or assignment time. `sizeofvar.js` exports a single function that works out the type of the value (boolean, number, string, object, array) and returns a byte count using per-type base sizes. +- **Recursion** — objects and arrays are walked recursively; nested members are costed with their own per-type adjustments, and objects with several keys add a per-key-group overhead. Top-level values and nested values use different base sizes. +- **Numbers above 2^31** add an extra allocation, and numbers stored in arrays carry a small additional cost. +- **Memory test harness** — `test/test-mem.js` plus per-type scripts under `test/sizeofvar/` (array, bool, number, object, object-complex, object-key-length, object-string, string) compare the returned number against what Node reports. It is run with `node --expose-gc test/test-mem.js [-v]`, where `-v` enables verbose output. The harness uses `yargs` (a dev dependency) for argument parsing. +- **Package** — scoped as `@cldmv/sizeofvar`, GPL-3.0, entry point `sizeofvar.js`, with a README covering install, usage and the test commands. + +## 📚 Documentation + +- **NEW:** [docs/changelog/v1/v1.0.1.md](./v1.0.1.md) — this changelog (added retroactively). + +--- + +## Upgrade notes + +- First release; there is nothing to upgrade from. Install with `npm i @cldmv/sizeofvar --save`. diff --git a/docs/changelog/v1/v1.0.10.md b/docs/changelog/v1/v1.0.10.md new file mode 100644 index 0000000..63d41d1 --- /dev/null +++ b/docs/changelog/v1/v1.0.10.md @@ -0,0 +1,41 @@ +# sizeofvar v1.0.10 Changelog + +**Release Date**: October 2026 +**Release Type**: Patch + +--- + +## Overview + +A large CI and tooling sync. The only change to `sizeofvar.js` is an added comment header, so runtime behaviour is unchanged. + +--- + +## 🔧 CI & tooling + +### Sync with CLDMV/.github v4.29.2 templates ([#21](https://github.com/CLDMV/sizeofvar/pull/21)) + +Refreshes all workflow callers and adds `member-auto-merge.yml` (enables auto-merge on org members' PRs into `next`/`hotfixes`; does not approve), `pr-notify.yml`, `provenance.yml` (SLSA provenance on release) and `release-merge.yml`. `ci.yml`'s `max_node_major` now defaults to blank, inheriting the reusable workflow's default. + +### Bundle-size workflow ([#22](https://github.com/CLDMV/sizeofvar/pull/22)) + +Adds `bundle-size.yml` (diffs `*.js` after `npm run build:ci` on PRs to `master`) and restores the full workflow list in the release-merge workflow. + +### Shared fix-headers config and uniform headers ([#24](https://github.com/CLDMV/sizeofvar/pull/24)) + +Adds a `fix:headers` script and `.configs/fix-headers.json` extending `@cldmv/configs/fix-headers.json`, and stamps a uniform comment header onto `sizeofvar.js`, the tests and the workflow files. Comment headers only; no code changed in `sizeofvar.js`. + +## 🔧 Dependencies + +- New dev dependencies `@cldmv/configs` (`^1.2.0`) and `@cldmv/fix-headers` (`^2.1.1`). +- vitest group and patch bumps ([#18](https://github.com/CLDMV/sizeofvar/pull/18), [#19](https://github.com/CLDMV/sizeofvar/pull/19), [#25](https://github.com/CLDMV/sizeofvar/pull/25), [#26](https://github.com/CLDMV/sizeofvar/pull/26)): `vitest` and `@vitest/coverage-v8` 5.0.0 → 5.0.2 in the lockfile only; `package.json` ranges stay `^5.0.0`. Dev dependencies, test/CI toolchain only. + +## 📚 Documentation + +- **NEW:** [docs/changelog/v1/v1.0.10.md](./v1.0.10.md) — this changelog (added retroactively). + +--- + +## Upgrade notes + +- No breaking changes — drop-in for v1.0.9. No runtime code changed. diff --git a/docs/changelog/v1/v1.0.11.md b/docs/changelog/v1/v1.0.11.md new file mode 100644 index 0000000..ba311a8 --- /dev/null +++ b/docs/changelog/v1/v1.0.11.md @@ -0,0 +1,28 @@ +# sizeofvar v1.0.11 Changelog + +**Release Date**: October 2026 +**Release Type**: Patch + +--- + +## Overview + +CI-only fix to the required-check job. No runtime code changed. + +--- + +## 🔧 CI & tooling + +### Stop the skipped PR-run mirror from satisfying Required PR Check ([#28](https://github.com/CLDMV/sizeofvar/pull/28)) + +On an in-repo feature PR the `pull_request` run skipped the `✅ Required PR Check` mirror job, and GitHub treats a skipped required check as passing, so a PR could become mergeable before the push run's tests finished. The job name became an expression so the skipped job no longer posts under the required name. + +## 📚 Documentation + +- **NEW:** [docs/changelog/v1/v1.0.11.md](./v1.0.11.md) — this changelog (added retroactively). + +--- + +## Upgrade notes + +- No breaking changes — drop-in for v1.0.10. No runtime code changed. diff --git a/docs/changelog/v1/v1.0.12.md b/docs/changelog/v1/v1.0.12.md new file mode 100644 index 0000000..167278f --- /dev/null +++ b/docs/changelog/v1/v1.0.12.md @@ -0,0 +1,28 @@ +# sizeofvar v1.0.12 Changelog + +**Release Date**: October 2026 +**Release Type**: Patch + +--- + +## Overview + +CI-only follow-up to v1.0.11. No runtime code changed. + +--- + +## 🔧 CI & tooling + +### Run the in-repo PR mirror job instead of skipping it ([#30](https://github.com/CLDMV/sizeofvar/pull/30)) + +GitHub does not evaluate the `name:` of a skipped job, so v1.0.11's skipped job showed raw expression text. The mirror job now always runs; on the in-repo PR path it reports as `⏭️ Required PR Check (reported by the push run)` and exits as a no-op, while every status-owning path reports `✅ Required PR Check`. + +## 📚 Documentation + +- **NEW:** [docs/changelog/v1/v1.0.12.md](./v1.0.12.md) — this changelog (added retroactively). + +--- + +## Upgrade notes + +- No breaking changes — drop-in for v1.0.11. No runtime code changed. diff --git a/docs/changelog/v1/v1.0.13.md b/docs/changelog/v1/v1.0.13.md new file mode 100644 index 0000000..5083831 --- /dev/null +++ b/docs/changelog/v1/v1.0.13.md @@ -0,0 +1,30 @@ +# sizeofvar v1.0.13 Changelog + +**Release Date**: October 2026 +**Release Type**: Patch +**Branch**: `next` → `master` + +--- + +## Overview + +A single dev-tooling dependency patch. `@cldmv/fix-headers`, which maintains the comment headers at the top of the repository's source, test, config and workflow files, moves from 2.1.1 to 2.1.4. No runtime code changed: `sizeofvar.js` is exactly as in v1.0.12, and the package still has no runtime dependencies. + +The bump was made with a header restamp in mind, but fix-headers 2.1.4 produced no header changes in this repository, so the only files touched are `package.json` and `package-lock.json`. + +--- + +## 🔧 Dependencies + +- **`@cldmv/fix-headers` `2.1.1` → `2.1.4`** ([#32](https://github.com/CLDMV/sizeofvar/pull/32)), dev dependency. The 2.1.x line no longer stamps a header into files that have no usable comment syntax (strict JSON such as `package.json`, and Markdown unless explicitly forced), never walks into `node_modules` or other dependency folders, and processes every repeated `--input` value instead of only the last. It only runs through the `fix:headers` script; nothing that ships depends on it. + +## 📚 Documentation + +- **NEW:** [docs/changelog/v1/v1.0.13.md](./v1.0.13.md) — this changelog. +- Changelogs for earlier releases that shipped without one were added in the same pass (see the [docs/changelog/](https://github.com/CLDMV/sizeofvar/tree/master/docs/changelog/) folder). + +--- + +## Upgrade notes + +- No breaking changes, and no runtime code changed. It's a drop-in replacement for v1.0.12. diff --git a/docs/changelog/v1/v1.0.2.md b/docs/changelog/v1/v1.0.2.md new file mode 100644 index 0000000..bdb882c --- /dev/null +++ b/docs/changelog/v1/v1.0.2.md @@ -0,0 +1,22 @@ +# sizeofvar v1.0.2 Changelog + +**Release Date**: March 2018 +**Release Type**: Patch + +--- + +## Overview + +Version-only bump. `package.json` moved from 1.0.1 to 1.0.2 and nothing else changed. There are no code changes in this release and it was not published to npm. + +--- + +## 📚 Documentation + +- **NEW:** [docs/changelog/v1/v1.0.2.md](./v1.0.2.md) — this changelog (added retroactively). + +--- + +## Upgrade notes + +- No breaking changes. No code changes; this version was tagged but not published to npm, so v1.0.1 → v1.0.3 is the effective upgrade path. diff --git a/docs/changelog/v1/v1.0.3.md b/docs/changelog/v1/v1.0.3.md new file mode 100644 index 0000000..54d2f6a --- /dev/null +++ b/docs/changelog/v1/v1.0.3.md @@ -0,0 +1,23 @@ +# sizeofvar v1.0.3 Changelog + +**Release Date**: March 2018 +**Release Type**: Patch + +--- + +## Overview + +Documentation fix: the README install command now uses the scoped package name. No runtime code changed. + +--- + +## 📚 Documentation + +- README install command changed from `npm i sizeofvar --save` to `npm i @cldmv/sizeofvar --save`. +- **NEW:** [docs/changelog/v1/v1.0.3.md](./v1.0.3.md) — this changelog (added retroactively). + +--- + +## Upgrade notes + +- No breaking changes — drop-in for v1.0.2. Only the README and version changed; `sizeofvar.js` is untouched. diff --git a/docs/changelog/v1/v1.0.4.md b/docs/changelog/v1/v1.0.4.md new file mode 100644 index 0000000..43b5b94 --- /dev/null +++ b/docs/changelog/v1/v1.0.4.md @@ -0,0 +1,23 @@ +# sizeofvar v1.0.4 Changelog + +**Release Date**: March 2018 +**Release Type**: Patch + +--- + +## Overview + +Documentation fix: the README usage example now requires the scoped package name. No runtime code changed. + +--- + +## 📚 Documentation + +- README usage example changed from `require('sizeofvar')` to `require('@cldmv/sizeofvar')`. +- **NEW:** [docs/changelog/v1/v1.0.4.md](./v1.0.4.md) — this changelog (added retroactively). + +--- + +## Upgrade notes + +- No breaking changes — drop-in for v1.0.3. Only the README and version changed; `sizeofvar.js` is untouched. diff --git a/docs/changelog/v1/v1.0.5.md b/docs/changelog/v1/v1.0.5.md new file mode 100644 index 0000000..9813967 --- /dev/null +++ b/docs/changelog/v1/v1.0.5.md @@ -0,0 +1,47 @@ +# sizeofvar v1.0.5 Changelog + +**Release Date**: August 2026 +**Release Type**: Patch + +--- + +## Overview + +First release through the CLDMV v4 `next` → `master` release flow, and the first after a long gap: the previous release was v1.0.4 in 2018. It adds the CI/release workflows and replaces the old memory-harness scripts with a vitest suite. `sizeofvar.js` is unchanged, so runtime behaviour is identical to v1.0.4. + +It also carries a 2019 README addition (a contributors section) that had never been released. + +--- + +## 🔧 CI & tooling + +### Adopt CLDMV @v4 workflows + vitest-runner tests ([#2](https://github.com/CLDMV/sizeofvar/pull/2)) + +Adds the v4 staging-branch workflow set under `.github/workflows/` (CI, publish, feature-pr, next-release, hotfixes-release, next-reset, hotfix-redirector, labeler, pr-title-normalizer, master-commit-audit, release-notify, tag-health, update-major-version-tags, v4-bootstrap, cla, codeql, scorecard, dependency-review, dependabot-auto-merge, stale, welcome, branch-retention), all thin callers of `CLDMV/.github` reusables pinned `@v4`, plus `.github/dependabot.yml`. Releases now go through the `next` → `master` release PR. + +### Build script stub for the coverage job ([#4](https://github.com/CLDMV/sizeofvar/pull/4)) + +Adds `build` and `build:ci` scripts that only echo, because the coverage-badge job runs `npm run build`. The package has no build step. + +### Vitest suite replaces the memory harness ([#2](https://github.com/CLDMV/sizeofvar/pull/2)) + +- The old `test/test-mem.js` harness and the `test/sizeofvar/*.js` scripts are removed, replaced by vitest tests in `tests/` (arrays, booleans, edge types, numbers, objects, random properties, strings) with `.configs/vitest.config.mjs` and a `tests/run-vitest.mjs` runner. +- New scripts: `test`, `test:watch`, `coverage`, `ci:coverage`. The previous `test` script was an `echo` stub. +- The `node --expose-gc test/test-mem.js` instructions are no longer applicable. + +## 🔧 Dependencies + +- Removed the `yargs` devDependency. Its only use at the previous release (`git grep`) was argument parsing in the deleted `test/test-mem.js` harness, so nothing remained that used it. +- Added dev dependencies `@cldmv/vitest-runner`, `vitest` and `@vitest/coverage-v8` (`^4.1.10`). These affect only the test/CI toolchain, not consumers. +- Added `publishConfig.access: public`. + +## 📚 Documentation + +- README gains a Contributors section (committed in 2019, first released here). +- **NEW:** [docs/changelog/v1/v1.0.5.md](./v1.0.5.md) — this changelog (added retroactively). + +--- + +## Upgrade notes + +- No breaking changes — drop-in for v1.0.4. The exported function is unchanged; only repository tooling, tests and dev dependencies changed. diff --git a/docs/changelog/v1/v1.0.6.md b/docs/changelog/v1/v1.0.6.md new file mode 100644 index 0000000..da161b7 --- /dev/null +++ b/docs/changelog/v1/v1.0.6.md @@ -0,0 +1,29 @@ +# sizeofvar v1.0.6 Changelog + +**Release Date**: August 2026 +**Release Type**: Patch + +--- + +## Overview + +Test-file rename. Test files move to the fleet-wide `*.test.vitest.mjs` naming convention and the vitest config and runner are updated to match. No runtime code changed. + +--- + +## 🔧 CI & tooling + +### Wire vitest config + runner to the new test-file suffix ([#6](https://github.com/CLDMV/sizeofvar/pull/6)) + +- `tests/*.test.mjs` renamed to `tests/*.test.vitest.mjs` (pure renames, contents unchanged). +- `.configs/vitest.config.mjs`, `tests/run-vitest.mjs` and the `package.json` scripts updated to the new pattern. + +## 📚 Documentation + +- **NEW:** [docs/changelog/v1/v1.0.6.md](./v1.0.6.md) — this changelog (added retroactively). + +--- + +## Upgrade notes + +- No breaking changes — drop-in for v1.0.5. No runtime code changed. diff --git a/docs/changelog/v1/v1.0.7.md b/docs/changelog/v1/v1.0.7.md new file mode 100644 index 0000000..419f6ca --- /dev/null +++ b/docs/changelog/v1/v1.0.7.md @@ -0,0 +1,28 @@ +# sizeofvar v1.0.7 Changelog + +**Release Date**: August 2026 +**Release Type**: Patch + +--- + +## Overview + +CI-only release. The CI concurrency rules are changed so release-relevant runs are never cancelled. No runtime code changed. + +--- + +## 🔧 CI & tooling + +### Never supersede release-relevant CI runs ([#8](https://github.com/CLDMV/sizeofvar/pull/8)) + +`ci.yml` concurrency now gives pushes to the release base branch, to `next`/`hotfixes`, and the `next`/`hotfixes` release PRs a unique concurrency group per run; feature branches still cancel superseded runs. Previously a burst of pushes during a release could cancel a pending run and leave a red cancelled check on the release PR. + +## 📚 Documentation + +- **NEW:** [docs/changelog/v1/v1.0.7.md](./v1.0.7.md) — this changelog (added retroactively). + +--- + +## Upgrade notes + +- No breaking changes — drop-in for v1.0.6. No runtime code changed. diff --git a/docs/changelog/v1/v1.0.8.md b/docs/changelog/v1/v1.0.8.md new file mode 100644 index 0000000..5cba395 --- /dev/null +++ b/docs/changelog/v1/v1.0.8.md @@ -0,0 +1,34 @@ +# sizeofvar v1.0.8 Changelog + +**Release Date**: August 2026 +**Release Type**: Patch + +--- + +## Overview + +Dev-dependency lockfile refresh plus a bot-identity CI fix. No runtime code changed. + +--- + +## 🔧 CI & tooling + +### Bot identity secrets ([#11](https://github.com/CLDMV/sizeofvar/pull/11)) + +`feature-pr.yml`, `next-release.yml` and `hotfixes-release.yml` pass `BOT_NAME` and `BOT_EMAIL` (from `CLDMV_BOT_NAME` / `CLDMV_BOT_EMAIL`) so bot-authored commits and PRs use the real bot identity. + +## 🔧 Dependencies + +### Patch group bump ([#10](https://github.com/CLDMV/sizeofvar/pull/10)) + +Lockfile-only update of the vitest toolchain's transitive packages (for example `rolldown` and `@oxc-project/types`). `package.json` ranges did not change. These are dev dependencies and only affect the test/CI toolchain. + +## 📚 Documentation + +- **NEW:** [docs/changelog/v1/v1.0.8.md](./v1.0.8.md) — this changelog (added retroactively). + +--- + +## Upgrade notes + +- No breaking changes — drop-in for v1.0.7. No runtime code changed. diff --git a/docs/changelog/v1/v1.0.9.md b/docs/changelog/v1/v1.0.9.md new file mode 100644 index 0000000..11c49df --- /dev/null +++ b/docs/changelog/v1/v1.0.9.md @@ -0,0 +1,40 @@ +# sizeofvar v1.0.9 Changelog + +**Release Date**: September 2026 +**Release Type**: Patch + +--- + +## Overview + +Moves the test toolchain to vitest 5 and updates the CI node matrix and signing secrets to match. No runtime code changed. + +--- + +## 🔧 Dependencies + +### vitest 5 ([#15](https://github.com/CLDMV/sizeofvar/pull/15)) + +`vitest` and `@vitest/coverage-v8` move from `^4.1.10` to `^5.0.0` in `package.json`. Both are dev dependencies and affect only the test/CI toolchain. The lockfile also refreshes transitive packages (`rolldown`, `@oxc-project/types`). + +## 🔧 CI & tooling + +### Node CI matrix for vitest 5 ([#17](https://github.com/CLDMV/sizeofvar/pull/17)) + +`ci.yml` / `publish.yml` defaults: `min_node_version` 20 → `22.12.0` (vitest 5's real floor) and `max_node_major` 22 → `26`. `dependabot.yml` gains groups that keep `vitest` + `@vitest/*` (and the eslint and prettier families) bumping together. + +## 🔒 Security & supply chain + +### hotfix-redirector GPG secrets ([#13](https://github.com/CLDMV/sizeofvar/pull/13)) + +`hotfix-redirector.yml` maps `BOT_NAME`, `BOT_EMAIL`, `BOT_GPG_PRIVATE_KEY` and `BOT_GPG_PASSPHRASE` so Dependabot security PRs redirected away from `master` are cherry-picked as signed commits. + +## 📚 Documentation + +- **NEW:** [docs/changelog/v1/v1.0.9.md](./v1.0.9.md) — this changelog (added retroactively). + +--- + +## Upgrade notes + +- No breaking changes — drop-in for v1.0.8. No runtime code changed. Note that the CI matrix floor is now Node 22.12.0 (development/test only; the package declares no `engines`).