@coroboros/sparkline 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +7 -59
  2. package/README.md +3 -3
  3. package/package.json +13 -15
package/CHANGELOG.md CHANGED
@@ -1,65 +1,13 @@
1
1
  # Changelog
2
2
 
3
- All notable changes to this package will be documented in this file.
3
+ ## v1.0.1 - 10/05/2026
4
4
 
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
+ ### CI
6
+ - Switch publish from OIDC trusted publisher to npm token (`NPM_TOKEN` secret).
7
7
 
8
- ## [Unreleased]
8
+ ### Documentation
9
+ - Tighten phrasing in `README.md` Requirements section.
9
10
 
10
- ### Added
11
- - Initial release under the `@coroboros` scope.
12
- - TypeScript source (migrated from the legacy JavaScript implementation).
13
- - Dual ESM + CJS build via [tsdown](https://tsdown.dev).
14
- - Vitest test suite, Biome linting and formatting.
15
- - `title` option — injects a `<title>` element, `role="img"` and `aria-label`.
16
- - `ariaLabel` option — explicit `aria-label` override for the accessible name.
17
- - `description` option — injects a `<desc>` element for screen-reader long-form context.
18
- - `precision` option (default `2`) — integer in `[0, 6]` controlling decimal
19
- places emitted on every coordinate.
20
- - `EMPTY_VALUES` error code for `values: []`.
21
- - Broader color support: CSS named colors, hex (3/4/6/8 digits), functional
22
- notations (`rgb()`, `rgba()`, `hsl()`, `hsla()`, `hwb()`, `lab()`, `lch()`,
23
- `oklab()`, `oklch()`, `color()`), plus `currentColor` and `transparent`.
24
- - `SparklineError` now accepts an `Error.cause` for wrapping underlying errors.
25
- - `mitata`-powered benchmark suite (`pnpm bench`) and baseline file at
26
- `bench/baseline.md`.
27
- - Property-based tests with `fast-check` (SVG shape, coordinate bounds,
28
- decimal budget, stroke-color fallback).
29
- - `"sideEffects": false` for tree-shaking.
11
+ ## v1.0.0 - 22/04/2026
30
12
 
31
- ### Changed
32
- - **BREAKING: positional API** — `sparkline(values, options?)` replaces
33
- `sparkline({ values, ...options })`. Mirrors the `fetch(url, init)` idiom.
34
- - **BREAKING: default stroke color** — now `#C9A96E` (Coroboros sand) instead
35
- of `#57bd0f`.
36
- - **Polyline inset** — points are inset by `strokeWidth / 2` so stroke caps no
37
- longer clip the viewBox edges.
38
- - **Decorative-by-default accessibility** — when none of `title`, `ariaLabel`,
39
- or `description` is provided, the SVG renders `aria-hidden="true"`. Pass any
40
- of them to opt into an accessible image with `role="img"`.
41
- - **SVG output format** — polyline points are now standard `x,y x,y` pairs that
42
- span the full `0 → width` range. The previous quirky `"0, y x, y x, …"`
43
- format (with leading `'0'` and orphan trailing number) is replaced.
44
- - **Error class** — `LibError` → `SparklineError`, with a simpler constructor
45
- `new SparklineError(code, message)` and a `name` fixed to `'SparklineError'`.
46
- - **Runtime validation** — strict and non-polymorphic. String-to-number
47
- coercion for numeric options is removed. Invalid style options fall back to
48
- defaults; invalid `values` throw.
49
- - **Width / height minimum** — reduced from `>= 10` to `> 0`.
50
- - **Debugging** — replaces the in-tree debugger with Node's built-in
51
- [`util.debuglog`](https://nodejs.org/api/util.html#utildebuglogsection-callback).
52
- Enable with `NODE_DEBUG=sparkline` (previously `DEBUG=sparkline:*`).
53
- - `strokeWidth: 0` and `strokeOpacity: 0` are now honored instead of being
54
- replaced by the defaults.
55
-
56
- ### Removed
57
- - In-tree zero-dep re-implementation of the `debug` package (`src/debug/`).
58
- - `src/helpers/` polymorphic cast / object / math utilities.
59
- - `src/LibError/` class and `src/Sparkline/` internal class.
60
- - `src/settings/` module — defaults are inlined in `src/index.ts`.
61
- - Default export — only named exports are shipped.
62
-
63
- ### Security
64
- - XML-escape user-supplied `title`, `ariaLabel`, `description`, and `stroke`
65
- values before injecting them into the SVG string.
13
+ Initial release of `@coroboros/sparkline`.
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  Calculates polyline points from a numeric series and returns a pure SVG string. Tune width, height, stroke, coordinate precision, and accessibility metadata.
11
11
 
12
12
  [![npm](https://img.shields.io/npm/v/@coroboros/sparkline?style=flat-square&color=000000)](https://www.npmjs.com/package/@coroboros/sparkline)
13
- [![ci](https://img.shields.io/github/actions/workflow/status/coroboros/sparkline/ci.yml?branch=develop&style=flat-square&label=ci&color=000000)](https://github.com/coroboros/sparkline/actions/workflows/ci.yml)
13
+ [![ci](https://img.shields.io/github/actions/workflow/status/coroboros/sparkline/ci.yml?branch=main&style=flat-square&label=ci&color=000000)](https://github.com/coroboros/sparkline/actions/workflows/ci.yml)
14
14
  [![license](https://img.shields.io/badge/license-MIT-000000?style=flat-square)](https://opensource.org/licenses/MIT)
15
15
  [![stars](https://img.shields.io/github/stars/coroboros/sparkline?style=flat-square&label=stars&color=000000)](https://github.com/coroboros/sparkline)
16
16
  [![coroboros.com](https://img.shields.io/badge/coroboros.com-000000?style=flat-square&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iMTAiLz48cGF0aCBkPSJNMiAxMmgyME0xMiAyYTE1LjMgMTUuMyAwIDAgMSA0IDEwIDE1LjMgMTUuMyAwIDAgMS00IDEwIDE1LjMgMTUuMyAwIDAgMS00LTEwIDE1LjMgMTUuMyAwIDAgMSA0LTEweiIvPjwvc3ZnPg==)](https://coroboros.com)
@@ -19,7 +19,7 @@ Calculates polyline points from a numeric series and returns a pure SVG string.
19
19
 
20
20
  ## Requirements
21
21
 
22
- - Node.js `>=22` LTS. We recommend [fnm](https://github.com/Schniz/fnm) for version management (Rust-based, faster than nvm).
22
+ - Node.js `>=22` LTS. Use [fnm](https://github.com/Schniz/fnm) for version management Rust-based, faster than nvm.
23
23
  - Any of the following package managers: `pnpm`, `npm`, `yarn`, `bun`.
24
24
 
25
25
  ## Install
@@ -153,7 +153,7 @@ Bug reports and PRs welcome.
153
153
  - Open an issue before submitting non-trivial PRs.
154
154
  - Commits follow [Conventional Commits](https://www.conventionalcommits.org/).
155
155
  - Run `pnpm lint && pnpm typecheck && pnpm test` before pushing.
156
- - Target the `develop` branch.
156
+ - Target the `main` branch.
157
157
 
158
158
  ## License
159
159
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coroboros/sparkline",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Lightweight, zero-dependency SVG sparkline generator for Node.js.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -26,18 +26,6 @@
26
26
  "LICENSE.md",
27
27
  "CHANGELOG.md"
28
28
  ],
29
- "scripts": {
30
- "build": "tsdown",
31
- "dev": "tsdown --watch",
32
- "lint": "biome check .",
33
- "lint:fix": "biome check --write .",
34
- "typecheck": "tsc --noEmit",
35
- "test": "vitest run",
36
- "test:watch": "vitest",
37
- "test:coverage": "vitest run --coverage",
38
- "bench": "pnpm build && node bench/sparkline.bench.mjs",
39
- "prepublishOnly": "pnpm lint && pnpm typecheck && pnpm test && pnpm build"
40
- },
41
29
  "keywords": [
42
30
  "coroboros",
43
31
  "sparkline",
@@ -60,7 +48,6 @@
60
48
  "engines": {
61
49
  "node": ">=22"
62
50
  },
63
- "packageManager": "pnpm@10.33.0",
64
51
  "publishConfig": {
65
52
  "access": "public"
66
53
  },
@@ -77,5 +64,16 @@
77
64
  "tsdown": "^0.21.9",
78
65
  "typescript": "^6.0.3",
79
66
  "vitest": "^4.1.4"
67
+ },
68
+ "scripts": {
69
+ "build": "tsdown",
70
+ "dev": "tsdown --watch",
71
+ "lint": "biome check .",
72
+ "lint:fix": "biome check --write .",
73
+ "typecheck": "tsc --noEmit",
74
+ "test": "vitest run",
75
+ "test:watch": "vitest",
76
+ "test:coverage": "vitest run --coverage",
77
+ "bench": "pnpm build && node bench/sparkline.bench.mjs"
80
78
  }
81
- }
79
+ }