svg-path-commander 2.3.3 → 2.3.4
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.
- package/AGENTS.md +94 -43
- package/CHANGELOG.md +41 -1
- package/LICENSE +0 -0
- package/README.md +374 -345
- package/dist/index.d.ts +130 -270
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +181 -240
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +4 -2
- package/dist/index.min.js.map +1 -1
- package/dist/util.d.ts +90 -248
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +177 -233
- package/dist/util.js.map +1 -1
- package/package.json +50 -43
package/AGENTS.md
CHANGED
|
@@ -2,77 +2,92 @@
|
|
|
2
2
|
|
|
3
3
|
## Project Overview
|
|
4
4
|
|
|
5
|
-
SVGPathCommander v2.3.
|
|
5
|
+
SVGPathCommander v2.3.4 — TypeScript library for manipulating SVG `<path>` `d` attributes. Works in browser and Node.js.
|
|
6
6
|
|
|
7
7
|
## Commands
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
vp install # Install dependencies
|
|
11
|
+
vpr dev # Serve docs on localhost:3000
|
|
12
|
+
vpr test # Run all tests (Vitest + Istanbul coverage)
|
|
13
|
+
vpr test-ui # Run tests with UI
|
|
14
|
+
vpr test -- class.test.ts # Run a single test file
|
|
15
|
+
vpr test -- -t "Test name" # Run a single test by name
|
|
16
|
+
vpr bench # Benchmark vs svgpath (results embedded in README)
|
|
17
|
+
vpr lint # oxlint src + tsc --noEmit
|
|
18
|
+
vpr lint:ts # oxlint src
|
|
19
|
+
vpr fix:ts # oxlint src --fix
|
|
20
|
+
vpr format # oxfmt src
|
|
21
|
+
vpr build # Build with tsdown (vp pack) + copy the bundle to docs/
|
|
22
|
+
vpr check:ts # tsc --noEmit (type check only)
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
Always run `vpr lint` and `vpr test` after making changes.
|
|
26
|
+
|
|
25
27
|
Deno equivalents (via `deno.json`):
|
|
26
28
|
|
|
27
29
|
```bash
|
|
28
30
|
deno task test # vitest run
|
|
29
31
|
deno task lint # deno lint src
|
|
30
32
|
deno task check # deno check src (no --sloppy-imports needed)
|
|
31
|
-
deno task
|
|
32
|
-
deno publish
|
|
33
|
+
deno task format # deno fmt src
|
|
34
|
+
deno publish --dry-run --allow-dirty # JSR dry run
|
|
33
35
|
```
|
|
34
36
|
|
|
37
|
+
## CI Workflows
|
|
38
|
+
|
|
39
|
+
The GitHub Actions workflows are driven by Vite+; they use the `voidzero-dev/setup-vp` action (pinned to the exact release that ships with the pinned Vite+ version — never the frozen `v1` tag), which installs the `vp`/`vpr`/`vpx` binaries, the Node.js runtime, the package manager and the dependency cache.
|
|
40
|
+
|
|
41
|
+
- `.github/workflows/ci.yml` — runs on pushes and pull requests; `vpr lint`, `vpr build` and `vpr test` (with `vp exec playwright install` for the browsers), then uploads the coverage report to Coveralls.
|
|
42
|
+
- `.github/workflows/publish.yml` — runs on a published GitHub Release; sets up Deno as well, then publishes to npm with `vp pm publish` (provenance, `--ignore-scripts` so the release is built from the committed sources instead of the `prepublishOnly` dependency bump) and to JSR with `deno publish --allow-dirty` (the build step regenerates the committed `dist/` and `docs/` artifacts).
|
|
43
|
+
- `.github/workflows/codeql.yml` — CodeQL analysis; the build step uses `vpr build` so the job has the same toolchain as the other workflows.
|
|
44
|
+
|
|
45
|
+
Keep the `paths` filters of all three workflows in sync when adding a file that affects the build, the tests or the toolchain.
|
|
46
|
+
|
|
35
47
|
## Tech Stack
|
|
36
48
|
|
|
37
49
|
- **Language:** TypeScript (strict, ES2020 target, `allowImportingTsExtensions`)
|
|
38
|
-
- **Package manager:** pnpm
|
|
39
|
-
- **Build:** tsdown (ESM + UMD outputs)
|
|
40
|
-
- **Test:** Vitest + Istanbul coverage (`test/class.test.ts`, `test/static.test.ts`)
|
|
41
|
-
- **Lint/Format:**
|
|
50
|
+
- **Package manager:** vite-plus aka vp — dependencies are pinned through the `catalog:` in `pnpm-workspace.yaml`
|
|
51
|
+
- **Build:** tsdown via `vp pack` (ESM + UMD outputs), wired through `vite.config.ts`
|
|
52
|
+
- **Test:** Vitest 5 in **browser mode** (Playwright + Chromium, headless) + Istanbul coverage (`test/class.test.ts`, `test/static.test.ts`)
|
|
53
|
+
- **Lint/Format:** Vite+ (oxlint / oxfmt via `vp lint src` and `vp fmt src`) — not Deno; `deno lint` / `deno fmt` still gate the JSR publish
|
|
42
54
|
- **JSR:** `deno.json` publishes as `@thednp/svg-path-commander` — `deno check src`, `deno lint src` and `deno publish --dry-run --allow-dirty` must all pass
|
|
43
|
-
- **Dependency:** `@thednp/dommatrix` `^3.1.
|
|
55
|
+
- **Dependency:** `@thednp/dommatrix` `^3.1.3` (DOMMatrix shim)
|
|
44
56
|
|
|
45
57
|
## Source Structure (`src/`)
|
|
46
58
|
|
|
47
|
-
| Directory
|
|
48
|
-
|
|
49
|
-
| `index.ts`
|
|
50
|
-
| `main.ts`
|
|
51
|
-
| `types.ts`
|
|
52
|
-
| `interface.ts` | Interfaces (Options, TransformObject, PathBBox, shape attrs)
|
|
53
|
-
| `util.ts`
|
|
54
|
-
| `convert/`
|
|
55
|
-
| `parser/`
|
|
56
|
-
| `process/`
|
|
57
|
-
| `math/`
|
|
58
|
-
| `morph/`
|
|
59
|
-
| `util/`
|
|
60
|
-
| `options/`
|
|
59
|
+
| Directory | Purpose |
|
|
60
|
+
| -------------- | ----------------------------------------------------------------------- |
|
|
61
|
+
| `index.ts` | Main entry — exports SVGPathCommander class + all types |
|
|
62
|
+
| `main.ts` | SVGPathCommander class (core, chainable instance methods) |
|
|
63
|
+
| `types.ts` | TypeScript type definitions (PathCommand, PathSegment, PathArray, etc.) |
|
|
64
|
+
| `interface.ts` | Interfaces (Options, TransformObject, PathBBox, shape attrs) |
|
|
65
|
+
| `util.ts` | Re-export of all static methods (tree-shakeable entry) |
|
|
66
|
+
| `convert/` | Path format conversion (absolute, relative, curve, string) |
|
|
67
|
+
| `parser/` | SVG path string tokenizer/scanner |
|
|
68
|
+
| `process/` | Manipulation algorithms (normalize, optimize, reverse, transform, etc.) |
|
|
69
|
+
| `math/` | Low-level math (bezier, cubic, quad, line, arc, polygon tools) |
|
|
70
|
+
| `morph/` | Path morphing (equalize, split, sample, classify, match) |
|
|
71
|
+
| `util/` | Query helpers (bbox, length, point-at-length, intersection, etc.) |
|
|
72
|
+
| `options/` | Default configuration |
|
|
61
73
|
|
|
62
74
|
## Code Conventions
|
|
63
75
|
|
|
64
76
|
### Imports
|
|
77
|
+
|
|
65
78
|
- Use `.ts` extension on all imports: `import { foo } from "./bar.ts"`
|
|
66
79
|
- Path alias `~/*` maps to `src/` (e.g., `import SVGPathCommander from '~/index'`)
|
|
67
80
|
- Group imports: external libs → internal modules → types
|
|
68
81
|
- Use `import type` for type-only imports
|
|
69
82
|
|
|
70
83
|
### Formatting & Linting
|
|
84
|
+
|
|
71
85
|
- **No comments** unless explicitly asked
|
|
72
|
-
- Run `
|
|
73
|
-
-
|
|
86
|
+
- Run `vpr format` then `vpr lint:ts` before committing
|
|
87
|
+
- Vite+ formatter and linter enforced (`vp fmt`, `vp lint`); `deno fmt` / `deno lint` still gate the JSR publish
|
|
74
88
|
|
|
75
89
|
### TypeScript
|
|
90
|
+
|
|
76
91
|
- Strict mode enabled — no `any`, no implicit `any`
|
|
77
92
|
- `noUnusedLocals` and `noUnusedParameters` enforced
|
|
78
93
|
- `noImplicitReturns` enforced
|
|
@@ -80,6 +95,7 @@ deno publish # JSR dry run: deno publish --dry-run --allow-dirty
|
|
|
80
95
|
- Use `type` aliases for unions, `interface` for object shapes
|
|
81
96
|
|
|
82
97
|
### Naming Conventions
|
|
98
|
+
|
|
83
99
|
- **Classes:** PascalCase (`SVGPathCommander`, `PathParser`)
|
|
84
100
|
- **Functions/Methods:** camelCase (`parsePathString`, `normalizePath`)
|
|
85
101
|
- **Types:** PascalCase ending in semantic suffix (`PathArray`, `NormalSegment`, `IteratorCallback`)
|
|
@@ -88,19 +104,22 @@ deno publish # JSR dry run: deno publish --dry-run --allow-dirty
|
|
|
88
104
|
- **Test descriptions:** Start with `Test` (`Test init with no parameter`)
|
|
89
105
|
|
|
90
106
|
### Error Handling
|
|
107
|
+
|
|
91
108
|
- Throw `TypeError` with descriptive message for invalid inputs
|
|
92
109
|
- Use the shared `error` prefix from `~/util/error.ts`
|
|
93
110
|
- Validate inputs early, fail fast with clear messages
|
|
94
111
|
- Static methods return safe defaults for empty/invalid input (e.g., `getPathBBox('')`)
|
|
95
112
|
|
|
96
113
|
### Class Design
|
|
114
|
+
|
|
97
115
|
- Instance methods are chainable — always `return this`
|
|
98
116
|
- Expose functionality as both instance methods and static methods
|
|
99
117
|
- Use getters for computed properties (`get bbox()`, `get length()`)
|
|
100
118
|
- Instance options validated in constructor with fallback to `defaultOptions`
|
|
101
119
|
|
|
102
120
|
### Testing
|
|
103
|
-
|
|
121
|
+
|
|
122
|
+
- Tests run with Vitest + Istanbul coverage via `vpr test`
|
|
104
123
|
- Test files: `test/class.test.ts` (instance API), `test/static.test.ts` (static methods)
|
|
105
124
|
- Fixtures in `test/fixtures/`
|
|
106
125
|
- Use `expect().to.deep.equal()` for object comparison, `expect().to.equal()` for primitives
|
|
@@ -108,9 +127,41 @@ deno publish # JSR dry run: deno publish --dry-run --allow-dirty
|
|
|
108
127
|
|
|
109
128
|
## Build Outputs
|
|
110
129
|
|
|
111
|
-
| File
|
|
112
|
-
|
|
130
|
+
| File | Description |
|
|
131
|
+
| ------------------- | -------------------------------------------------------- |
|
|
113
132
|
| `dist/index.min.js` | UMD bundle (minified, browser-ready, includes dommatrix) |
|
|
114
|
-
| `dist/index.js`
|
|
115
|
-
| `dist/util.js`
|
|
116
|
-
| `dist/index.d.ts`
|
|
133
|
+
| `dist/index.js` | ESM bundle (tree-shakeable, neutral platform) |
|
|
134
|
+
| `dist/util.js` | Static methods only (tree-shakeable) |
|
|
135
|
+
| `dist/index.d.ts` | Type declarations |
|
|
136
|
+
|
|
137
|
+
<!--VITE PLUS START-->
|
|
138
|
+
|
|
139
|
+
# Using Vite+, the Unified Toolchain for the Web
|
|
140
|
+
|
|
141
|
+
This project is using Vite+, a unified toolchain built on top of Vite, Rolldown, Vitest, tsdown, Oxlint, Oxfmt, and Vite Task. Vite+ wraps runtime management, package management, and frontend tooling in a single global CLI called `vp`. Vite+ is distinct from Vite, and it invokes Vite through `vp dev` and `vp build`. Run `vp help` to print a list of commands and `vp <command> --help` for information about a specific command.
|
|
142
|
+
|
|
143
|
+
Docs are local at `node_modules/vite-plus/docs` or online at https://viteplus.dev/guide/.
|
|
144
|
+
|
|
145
|
+
## Built-in Commands vs Scripts
|
|
146
|
+
|
|
147
|
+
`vp <name>` runs a built-in command. `vp run <name>` runs a `package.json` script or a `vite.config.ts` task. Scripts cannot overwrite built-ins, so `vp dev` and `vp run dev` may do different things. Check `package.json` and `vite.config.ts` first, and run `vp run <name>` when the project defines a script or task with that name.
|
|
148
|
+
|
|
149
|
+
## Running Scripts
|
|
150
|
+
|
|
151
|
+
Run TypeScript and JavaScript files with `vpx <file>`, for example `vpx ./scripts/seed.ts --dry-run`. It handles enums, decorators, JSX, and tsconfig `paths`, so do not add `tsx` or `ts-node` to run scripts. `vpx --watch <file>` reruns the file when a file it uses changes, in place of `tsx watch`. `vp node <file>` runs plain Node.js.
|
|
152
|
+
|
|
153
|
+
## Tool Versions
|
|
154
|
+
|
|
155
|
+
Run `vp toolchain` to show versions and relationships in the active Vite+
|
|
156
|
+
release. Add a tool name to select part of the graph. For example, run
|
|
157
|
+
`vp toolchain vite`. Use `--global` to ignore the local `vite-plus` package. Use
|
|
158
|
+
`vp why <package>` to show the package-manager dependency graph.
|
|
159
|
+
|
|
160
|
+
## Review Checklist
|
|
161
|
+
|
|
162
|
+
- [ ] Run `vp install` after pulling remote changes and before getting started.
|
|
163
|
+
- [ ] Run `vp check` and `vp test` to format, lint, type check and test changes.
|
|
164
|
+
- [ ] Check if there are `vite.config.ts` tasks or `package.json` scripts necessary for validation, run via `vp run <script>`.
|
|
165
|
+
- [ ] If setup, runtime, or package-manager behavior looks wrong, run `vp env doctor` and include its output when asking for help.
|
|
166
|
+
|
|
167
|
+
<!--VITE PLUS END-->
|
package/CHANGELOG.md
CHANGED
|
@@ -1,50 +1,80 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.3.4] - 2026-11-14
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- `getPathBBox()` returned mirrored extrema for elliptical arcs rotated by more than 90 degrees ([#65](https://github.com/thednp/svg-path-commander/issues/65)) — `getArcBBox()` (`src/math/arcTools.ts:440`) assumed the same extremum order for the X and Y axis, but the extrema swap sides when `cos(alpha) < 0`, so e.g. `M-4 0A22 5 156 0 0 3 -21` reported `[-34.21, -21, 3, 6.26]` instead of `[-4, -27.26, 33.21, 0]`
|
|
8
|
+
- `S`/`s` smooth-cubic shorthand no longer reflects a control point that does not exist ([#65](https://github.com/thednp/svg-path-commander/issues/65)) — per the SVG spec the control point of an `S` is only reflected when the previous command is a `C`/`c`/`S`/`s`, otherwise it coincides with the current point; `normalizePath()`, `pathToCurve()` and `optimizePath()` read the reflectable control point from the previous segment whatever its type, so an `S` after a `Q` or an `A` reflected a quadratic control point or even an arc flag, and a legitimate `0` coordinate was treated as a missing value
|
|
9
|
+
- `reversePath()` no longer produces `NaN` coordinates for a path with a trailing moveto or a segment following a `Z` ([#65](https://github.com/thednp/svg-path-commander/issues/65)) — the previous point was read from the previous segment, which has no coordinates for a `Z` segment
|
|
10
|
+
- `reverse()` no longer collapses the control points of an `S` segment that is not preceded by a cubic ([#66](https://github.com/thednp/svg-path-commander/issues/66)) — the reversed segment kept the `S` shorthand although the reflected control point cannot be recovered from the previous segment of the reversed path, so the control points collapsed onto the current point and the path length changed
|
|
11
|
+
- `optimize()` no longer rewrites a cubic as a smooth cubic when the control points do not match ([#66](https://github.com/thednp/svg-path-commander/issues/66)) — `shortenSegment()` (`src/process/shortenSegment.ts:54`) checked a second, unrelated condition that ignored the control points of the cubic, so any cubic following a segment whose control point matched its end point was shortened to an `s`, changing the shape of the path
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- `ParserParams.x2` / `ParserParams.y2` are now `number | null`, `null` marks a previous segment without a reflectable control point (the same sentinel used by `ParserParams.qx` / `ParserParams.qy`)
|
|
16
|
+
- `normalizeSegment()` accepts the command of the previous segment as an optional third argument, required to tell a reflectable control point from a missing one
|
|
17
|
+
- Migrated the toolchain from pnpm to Vite+ (`vp`) — the `package.json` scripts now run through `vp` / `vpr` (`vp test`, `vp pack`, `vp lint src`, `vp fmt src`), the shared dependencies are pinned through the `catalog:` in `pnpm-workspace.yaml` and the GitHub Actions workflows are driven by the `voidzero-dev/setup-vp` action (`vpr lint`, `vpr build`, `vpr test`, `vp pm publish`)
|
|
18
|
+
- The source is now formatted with oxfmt (`vp fmt src`) instead of `deno fmt src`, and linted with oxlint (`vp lint src`) instead of `deno lint src`; `deno lint` / `deno check` still gate the JSR publish
|
|
19
|
+
- The `lint` script now runs the type check as well (`vpr lint:ts && vpr check:ts`), so `vpr lint` covers both oxlint and `tsc --noEmit`
|
|
20
|
+
- Updated dev dependencies: `vitest` / `@vitest/*` `^5.1.0`, `vite` `^8.3.8`, `happy-dom` `^21.0.4`, `playwright` `^1.65.1`, `tsdown` `0.23.7`, `@types/node` `^26.6.6`
|
|
21
|
+
- Updated dependencies: `@thednp/dommatrix` `^3.1.3`
|
|
22
|
+
- Rebuilt `dist` and `docs` bundles
|
|
23
|
+
|
|
3
24
|
## [2.3.3] - 2026-09-02
|
|
4
25
|
|
|
5
26
|
### Changed
|
|
27
|
+
|
|
6
28
|
- Updated dependencies: `@thednp/dommatrix` `^3.1.2`
|
|
7
29
|
|
|
8
30
|
## [2.3.2] - 2026-09-02
|
|
9
31
|
|
|
10
32
|
### Fixed
|
|
33
|
+
|
|
11
34
|
- `T`/`t` smooth-quadratic shorthand without a preceding `Q`/`q`/`T`/`t` now correctly uses the current point as control point per the SVG spec ([#64](https://github.com/thednp/svg-path-commander/pull/64), thanks @nattyluke) — `normalizeSegment` (`src/process/normalizeSegment.ts:4`), `getPathBBox` (`src/util/getPathBBox.ts:12`) and `getTotalLength` (`src/util/getTotalLength.ts:12`) previously reflected a `0`-defaulted control point, so a `t` following a non-`Q` command (e.g. Illustrator `c...t` output) produced an inflated control/bbox/length (thanks @nattyluke)
|
|
12
35
|
|
|
13
36
|
### Changed
|
|
37
|
+
|
|
14
38
|
- Updated dev dependencies: `@types/node` `^26.4.1`, `vitest` / `@vitest/*` `^4.1.11`, `happy-dom` `^20.12.2`, `vite` `^8.2.2`
|
|
15
39
|
- Rebuilt `dist` and `docs` bundles
|
|
16
40
|
|
|
17
41
|
## [2.3.1] - 2026-08-05
|
|
18
42
|
|
|
19
43
|
### Changed
|
|
44
|
+
|
|
20
45
|
- Updated `@thednp/dommatrix` to `^3.1.1` — the 3.1.x line carries the shim's matrix-math rework (specialized `translate` / `scale` / `skew` / `multiply` and constructor fast paths), which directly accelerates the 3D transform path through `getSVGMatrix()` and `projection2d()`; 3.1.1 makes `setMatrixValue()` mutate the instance in place and return `this`, matching native `DOMMatrix` (SVGPathCommander does not use `setMatrixValue()`, so output is byte-identical and the 2D single-pass fast path is untouched)
|
|
21
46
|
- Rebuilt `dist` and `docs` bundles
|
|
22
47
|
|
|
23
48
|
## [2.3.0] - 2026-08-04
|
|
24
49
|
|
|
25
50
|
### Added
|
|
51
|
+
|
|
26
52
|
- `pnpm bench` — head-to-head benchmark against the [SvgPath](https://github.com/fontello/svgpath) library (vendored reference in `scripts/svgpath/`), comparing parse / bbox / transform / string output, with results embedded in the README
|
|
27
53
|
|
|
28
54
|
### Changed
|
|
55
|
+
|
|
29
56
|
- **Performance**: allocation-free parsing — `scanParam()` converts validated number substrings without allocating new strings, `finalizeSegment()` builds segments with pre-sized arrays and index-based slicing instead of `splice()`
|
|
30
57
|
- **Performance**: single-pass 2D transforms — `transformPath()` now uses a dedicated `transform2D()` fast path that transforms segments in place (no per-segment absolutize / copy / DOMMatrix projection), falling back to the 3D-capable `iterate()` path for 3D matrices; output is byte-identical to the previous implementation (~2.8x faster 2D transforms)
|
|
31
58
|
- **Performance**: fast 2D branch in `projection2d()`, char-code based command detection in `iterate()` / `getPathBBox()`, allocation-free rounding in `pathToString()`, and a dedicated `C` case in `absolutizeSegment()`
|
|
32
59
|
- Rebuilt `dist` and `docs` bundles
|
|
33
60
|
|
|
34
61
|
## [2.2.4] - 2026-08-04
|
|
62
|
+
|
|
35
63
|
### Fixed
|
|
64
|
+
|
|
36
65
|
- Build warnings: UMD bundle now uses a dedicated `src/browser.ts` entry so the `SVGPathCommander` global remains the class itself (no mixed-exports namespace), and the `output.dir`/`output.file` conflict is resolved — tree-shaking, named exports and type declarations are unaffected
|
|
37
66
|
- ESM bundle exports the `SVGPathCommander` named export alongside the default, with all types available in `dist/index.d.ts`
|
|
38
67
|
|
|
39
|
-
|
|
40
68
|
## [2.2.3] - 2026-08-04
|
|
41
69
|
|
|
42
70
|
### Added
|
|
71
|
+
|
|
43
72
|
- Named `SVGPathCommander` export alongside the default export for better JSR documentation rendering
|
|
44
73
|
- Full JSDoc coverage for all class statics, instance properties, getters and every interface / type member — zero undocumented symbols per `deno doc --json` on both `index` and `util` entry points
|
|
45
74
|
- JSR `./util` subpath export in `deno.json`, mirroring the npm `svg-path-commander/util` entry
|
|
46
75
|
|
|
47
76
|
### Changed
|
|
77
|
+
|
|
48
78
|
- Documentation moved from the GitHub wiki into the repository `wiki/` folder — the GitHub-hosted wiki pages are no longer available, and the README and wiki pages now reference the local `wiki/` folder instead
|
|
49
79
|
- Merged `NPM.md` and `JSR.md` into a single `Installation.md` (npm, pnpm, bun, Deno/JSR and CDN installation)
|
|
50
80
|
- Updated `Usage-Examples.md` with corrected output values verified against the current implementation
|
|
@@ -53,12 +83,14 @@
|
|
|
53
83
|
## [2.2.2] - 2026-08-03
|
|
54
84
|
|
|
55
85
|
### Added
|
|
86
|
+
|
|
56
87
|
- `getBezierLengthAtT()` / `bezierLengthAtT()` — arc length up to a `t` ratio via Gauss-Legendre quadrature
|
|
57
88
|
- `arcLength()` / `arcLengthAtAngle()` / `arcLengthBetween()` — Gauss-Legendre ellipse arc length helpers
|
|
58
89
|
- Static-method cross-consistency tests (length/point lookup, conversions, transforms, geometry measurements, intersections)
|
|
59
90
|
- Native browser API parity tests — `getBBox()`, `getTotalLength()`, `getPointAtLength()` verified against real Chromium
|
|
60
91
|
|
|
61
92
|
### Fixed
|
|
93
|
+
|
|
62
94
|
- `getPointAtLength()` returning the start of the next segment at interior distances on a `Z` (closing line) segment (#61)
|
|
63
95
|
- `getPointAtLength()` returning stale coordinates for distances beyond the path end
|
|
64
96
|
- Arc length accuracy for `getTotalLength()` and `getPointAtLength()` (Gauss-Legendre quadrature)
|
|
@@ -66,6 +98,7 @@
|
|
|
66
98
|
- Deno minimum-dependency-age policy blocking fresh `@thednp/dommatrix` releases — `minimumDependencyAge` disabled in `deno.json` (mirrors the pnpm `minimumReleaseAgeExclude` in `pnpm-workspace.yaml`)
|
|
67
99
|
|
|
68
100
|
### Changed
|
|
101
|
+
|
|
69
102
|
- Migrated tests to Vitest browser mode (Playwright Chromium) with Istanbul coverage — 100% line, branch, function and statement coverage
|
|
70
103
|
- Updated test fixtures and expected values to match the current implementation
|
|
71
104
|
- Rebuilt `dist` and `docs` bundles
|
|
@@ -73,20 +106,24 @@
|
|
|
73
106
|
- Upgraded `@thednp/dommatrix` to v3.0.6 and toolchain (tsdown, Vite, Vitest, pnpm 11)
|
|
74
107
|
|
|
75
108
|
### Added
|
|
109
|
+
|
|
76
110
|
- `llms.txt` with an LLM-friendly project summary
|
|
77
111
|
- README installation section for JSR (`deno add jsr:@thednp/svg-path-commander`, raw TypeScript import) and JSR badge fix
|
|
78
112
|
|
|
79
113
|
## [2.2.1] - 2026-04-06
|
|
80
114
|
|
|
81
115
|
### Added
|
|
116
|
+
|
|
82
117
|
- Reorganized intersection tools into `src/intersect/` — `pathsIntersection()`, `boundingBoxIntersect()`, `isPointInsideBBox()`, `interHelper()`
|
|
83
118
|
|
|
84
119
|
### Changed
|
|
120
|
+
|
|
85
121
|
- tsdown config and CI workflow versions, `.npmignore` cleanup, demo fixes
|
|
86
122
|
|
|
87
123
|
## [2.2.0] - 2026-04-06
|
|
88
124
|
|
|
89
125
|
### Added
|
|
126
|
+
|
|
90
127
|
- **Path intersection** — `pathsIntersection()`, `boundingBoxIntersect()`, `isPointInsideBBox()`
|
|
91
128
|
- **Path equalization** — `equalizePaths()`, `equalizeSegments()` for matching segment counts
|
|
92
129
|
- Full JSDoc coverage with `@param`, `@returns`, `@example` tags
|
|
@@ -96,13 +133,16 @@
|
|
|
96
133
|
- CHANGELOG.md and AGENTS.md
|
|
97
134
|
|
|
98
135
|
### Removed
|
|
136
|
+
|
|
99
137
|
- badge workflow and script in package.json
|
|
100
138
|
|
|
101
139
|
### Fixed
|
|
140
|
+
|
|
102
141
|
- **pathToCurve** inconsistencies
|
|
103
142
|
- reworked all exports as named exports
|
|
104
143
|
|
|
105
144
|
### Changed
|
|
145
|
+
|
|
106
146
|
- Added a separate export for utilities in `svg-path-commander/util`
|
|
107
147
|
- Migrated test runner from Playwright to happy-dom
|
|
108
148
|
- updated tests
|
package/LICENSE
CHANGED
|
File without changes
|