Controller Software for the Brother PP-1 SKiTCH embroidery machine.
Find a file
Jan-Henrik Bruhn ba380723c0 feature: Refactor PEN parser to decoder with coherent types
Renamed and restructured PEN parsing to match encoder pattern:

Changes:
- Renamed pen/parser.ts → pen/decoder.ts (consistent with encoder.ts)
- Created pen/types.ts for PEN-specific type definitions
- Moved types out of machine.ts (they're format-specific, not machine-specific)
- Unified decoder with encoder test helpers (encoder.test.ts now uses decoder)

New structure:
- decodePenStitch() - decode single 4-byte stitch
- decodeAllPenStitches() - decode all stitches from bytes
- decodePenData() - full decode with color blocks and bounds
- getStitchColor() - helper to get color for a stitch index

Type definitions:
- DecodedPenStitch - individual stitch with coordinates and flags
- PenColorBlock - color block (stitch range for one thread)
- DecodedPenData - complete decoded pattern data

Backward compatibility:
- Added compatibility aliases (isJump, flags, startStitch, endStitch)
- Maintains API compatibility with existing UI code

Also added dist-electron to eslint ignore list.

All tests passing (27/27), build successful, lint clean.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-14 12:27:24 +01:00
.claude Add Electron desktop application support with Electron Forge 2025-12-07 22:39:38 +01:00
.github feature: Add test step to CI workflow 2025-12-14 12:02:32 +01:00
build Add Electron desktop application support with Electron Forge 2025-12-07 22:39:38 +01:00
docs Improve responsive design and simplify typography system 2025-12-10 16:56:43 +01:00
electron feature: Implement Web Worker-based pattern conversion with progress tracking 2025-12-13 13:34:13 +01:00
public Icons 2025-12-08 00:21:31 +01:00
src feature: Refactor PEN parser to decoder with coherent types 2025-12-14 12:27:24 +01:00
.gitignore Add Electron desktop application support with Electron Forge 2025-12-07 22:39:38 +01:00
.node-version feature: use proper node version for used electron version 2025-12-12 20:58:48 +01:00
CLAUDE.md feature: Add autolabeler configuration and commit guidelines 2025-12-12 20:31:44 +01:00
eslint.config.mjs feature: Refactor PEN parser to decoder with coherent types 2025-12-14 12:27:24 +01:00
forge.config.js Fix auto-update structure and macOS manifest URL 2025-12-11 13:22:38 +01:00
index.html Icons 2025-12-08 00:21:31 +01:00
LICENSE.md add license 2025-12-07 22:58:02 +01:00
package-lock.json feature: Add comprehensive tests for PEN encoding logic 2025-12-14 11:44:48 +01:00
package.json feature: Add comprehensive tests for PEN encoding logic 2025-12-14 11:44:48 +01:00
tailwind.config.js Implement comprehensive dark mode support and improve pattern visibility 2025-12-06 20:12:46 +01:00
tsconfig.app.json Add Electron desktop application support with Electron Forge 2025-12-07 22:39:38 +01:00
tsconfig.electron.json Add Electron desktop application support with Electron Forge 2025-12-07 22:39:38 +01:00
tsconfig.json initial 2025-11-30 22:18:14 +01:00
tsconfig.node.json Add Electron desktop application support with Electron Forge 2025-12-07 22:39:38 +01:00
vite.config.electron.mts Add Electron desktop application support with Electron Forge 2025-12-07 22:39:38 +01:00
vite.config.mts feature: Add application version to page title 2025-12-13 23:48:05 +01:00
vitest.config.ts feature: Add comprehensive tests for PEN encoding logic 2025-12-14 11:44:48 +01:00