Skip to content

chore: replace shortid with nanoid and modernize dependencies#383

Merged
dambrisco merged 2 commits intotrunkfrom
claude/update-deprecated-dependencies-BsBXH
Feb 16, 2026
Merged

chore: replace shortid with nanoid and modernize dependencies#383
dambrisco merged 2 commits intotrunkfrom
claude/update-deprecated-dependencies-BsBXH

Conversation

@dambrisco
Copy link
Contributor

Summary

This PR modernizes the project's dependencies and updates the codebase to use more modern alternatives. The main changes involve replacing the deprecated shortid library with nanoid, updating the CSV parsing library, and removing unnecessary middleware packages in favor of Express built-ins.

Key Changes

  • ID Generation: Replaced all instances of shortid.generate() with nanoid() across 9 files (series, teams, admin_groups, banned_players, divisions, players, playoffSeries, registration, roles, and seasons)
  • CSV Processing: Updated from json2csv v5 to @json2csv/plainjs v7 with new API (Parser class instead of parse function)
  • Express Middleware: Replaced body-parser middleware with Express built-in express.json() and express.urlencoded() methods
  • Type Definitions: Removed custom TypeScript declarations for redirect-https and json2csv (no longer needed with updated packages)
  • Dependencies Removed:
    • shortid and @types/shortid
    • body-parser and @types/body-parser
    • bluebird and @types/bluebird
    • redirect-https
    • json2csv
  • Dependencies Added:
    • @json2csv/plainjs (modern CSV parser)
    • nanoid (lightweight ID generator)

Implementation Details

  • nanoid() is called without arguments, using default configuration (21-character URL-friendly IDs)
  • CSV parsing updated to use the new Parser class constructor pattern with field configuration
  • All ID generation calls are consistent across the codebase with the new nanoid() syntax

https://claude.ai/code/session_01XjQhFY22UkjDR9sBhbWWd4

- shortid (deprecated) → nanoid@3 across 10 page files; VARCHAR(50) id
  columns accommodate nanoid's 21-char URL-safe output without schema changes
- body-parser (deprecated) → express.json() / express.urlencoded() built-ins
- json2csv v5 → @json2csv/plainjs (official successor package)
- remove bluebird (unused dependency)
- remove redirect-https (unused dependency; type declaration removed too)

https://claude.ai/code/session_01XjQhFY22UkjDR9sBhbWWd4
@dambrisco dambrisco changed the title Replace shortid with nanoid and modernize dependencies chore: replace shortid with nanoid and modernize dependencies Feb 16, 2026
@dambrisco dambrisco merged commit 7452a48 into trunk Feb 16, 2026
5 checks passed
@dambrisco dambrisco deleted the claude/update-deprecated-dependencies-BsBXH branch February 16, 2026 04:07
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.

2 participants

Comments