Skip to content

fix: resolve security vulnerabilities, CSV parsing, and TypeScript compatibility#5

Open
2refocus wants to merge 8 commits intoacheronfail:masterfrom
2refocus:fix/security-vulnerabilities
Open

fix: resolve security vulnerabilities, CSV parsing, and TypeScript compatibility#5
2refocus wants to merge 8 commits intoacheronfail:masterfrom
2refocus:fix/security-vulnerabilities

Conversation

@2refocus
Copy link
Copy Markdown

@2refocus 2refocus commented Apr 9, 2026

Summary

This PR addresses security vulnerabilities, a CSV parsing bug, and TypeScript/CI compatibility issues.

Changes

Security (13 vulnerabilities → 0)

Ran npm audit fix and upgraded core tooling:

  • vite: ^5.4.1^6.4.2 (fixes esbuild dev-server CVE)
  • @sveltejs/vite-plugin-svelte: ^4.0.0-next.7^5.0.0
  • vitest: ^2.1.0^3.2.4
  • svelte: ^5.0.0-next.243^5.0.0 (stable)
  • svelte-check: ^3.8.6^4.0.0
  • Auto-fixed: lodash, form-data, rollup, minimatch, brace-expansion, picomatch, @babel/runtime, yaml, glob

Bug fix: numeric state codes in CSV parser (src/lib/parse/float-control.ts)

Float Control CSVs can export the State column as numeric codes (e.g. 1, 3, 9) rather than string names. The parser now uses the existing stateCodeMap to translate these, eliminating Unknown state console warnings and downstream errors (invalid SVG rotations, Leaflet bounds errors).

TypeScript fix: Map.ts

Removed explicit typeof Leaflet.Control return type annotation from createMapButtonControl.extend() is no longer assignable to that type in newer TypeScript. TypeScript correctly infers the return type.

CI: workflows (.github/workflows/)

Updated ci.yml and pages.yml to delete package-lock.json before install. This works around a known npm bug where macOS-generated lockfiles prevent Linux CI runners from installing platform-specific rollup binaries.

Validation

  • npm audit — 0 vulnerabilities ✓
  • npm run build — passes ✓
  • npm run checks (types + svelte-check + tests) — all pass ✓
  • GitHub Pages deployment — live ✓

Warp conversation

Co-Authored-By: Oz oz-agent@warp.dev

2refocus and others added 7 commits April 9, 2026 20:52
- Run npm audit fix to resolve 5 vulnerabilities (lodash, form-data,
  minimatch, brace-expansion, rollup, glob, picomatch, babel/runtime, yaml)
- Upgrade vite from ^5.4.1 to ^6.4.2 (esbuild ^0.25.0 fixes CVE)
- Upgrade @sveltejs/vite-plugin-svelte from ^4.0.0-next.7 to ^5.0.0
- Upgrade vitest from ^2.1.0 to ^3.2.4
- Upgrade svelte from ^5.0.0-next.243 to ^5.0.0 (stable)
- Upgrade svelte-check from ^3.8.6 to ^4.0.0

Resolves 2 critical, 5 high, and 6 moderate severity vulnerabilities.
npm audit now reports 0 vulnerabilities.

Co-Authored-By: Oz <oz-agent@warp.dev>
Float Control CSVs can export the State column as numeric codes
(e.g. 1, 3, 9) rather than string names. Use the existing stateCodeMap
to translate these codes to their corresponding State enum values,
eliminating 'Unknown state' warnings and downstream errors (invalid
chart rotations, Leaflet bounds errors).

Co-Authored-By: Oz <oz-agent@warp.dev>
The peer dependency conflict between @sveltejs/vite-plugin-svelte v5
and its inspector sub-package requires --legacy-peer-deps. Update
npm ci calls in both workflows to match.

Co-Authored-By: Oz <oz-agent@warp.dev>
…inaries

npm ci fails on Linux when the lockfile was generated on macOS because
platform-specific optional binaries (@rollup/rollup-linux-x64-gnu) are
missing from the lockfile. Use npm install to resolve this.

Co-Authored-By: Oz <oz-agent@warp.dev>
When the lockfile is generated on macOS, the Linux-specific rollup
binary (@rollup/rollup-linux-x64-gnu) is absent from the lockfile.
npm install --force ensures all optional platform binaries are installed
correctly on the CI runner.

Co-Authored-By: Oz <oz-agent@warp.dev>
Per the npm bug (npm/cli#4828), the lockfile
generated on macOS prevents npm from installing the Linux-specific
rollup binary. Deleting it before install forces npm to resolve the
correct platform binary on the CI runner.

Co-Authored-By: Oz <oz-agent@warp.dev>
Control.extend() return type is no longer assignable to typeof Control
in newer TypeScript. Remove the annotation and let TypeScript infer it.

Co-Authored-By: Oz <oz-agent@warp.dev>
@2refocus 2refocus changed the title fix: resolve 13 npm security vulnerabilities fix: resolve security vulnerabilities, CSV parsing, and TypeScript compatibility Apr 9, 2026
Filter out rows with undefined/null time values before segmenting to
prevent TypeError on toFixed calls. Add guard clause in segment logging
as a safety net. Add tests covering missing time data scenarios.

Co-Authored-By: Oz <oz-agent@warp.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant