Skip to content

Create new npm module for GTFS SQLjs - #1

Merged
chtitux merged 4 commits into
mainfrom
claude/create-gtfs-sqljs-module-011CUpNnKLtuvzDDzXYZFyRm
Nov 5, 2025
Merged

chtitux merged 4 commits into
mainfrom
claude/create-gtfs-sqljs-module-011CUpNnKLtuvzDDzXYZFyRm

Conversation

@chtitux

@chtitux chtitux commented Nov 5, 2025

Copy link
Copy Markdown
Contributor

This commit creates a complete TypeScript npm module for loading and querying GTFS (General Transit Feed Specification) data using sql.js.

Features:

  • Load GTFS data from ZIP files (URL or local path)
  • Load existing SQLite databases from ArrayBuffer
  • Export databases to ArrayBuffer for persistence
  • Full TypeScript support with comprehensive GTFS types
  • Works in both browser and Node.js environments
  • Efficient querying with indexed SQLite database
  • Proper handling of GTFS required/optional fields
  • Active service detection based on calendar/calendar_dates

Implementation includes:

  • Complete GTFS type definitions (stops, routes, trips, etc.)
  • SQLite schema generation matching GTFS specification
  • CSV parser for GTFS text files
  • ZIP loader supporting browser and Node.js
  • Comprehensive query methods for all GTFS entities
  • Full test suite using Vitest
  • CI/CD pipeline with GitHub Actions
  • Comprehensive README with examples and WASM loading instructions

Author: Théophile Helleboid/SysDevRun
License: MIT

This commit creates a complete TypeScript npm module for loading and
querying GTFS (General Transit Feed Specification) data using sql.js.

Features:
- Load GTFS data from ZIP files (URL or local path)
- Load existing SQLite databases from ArrayBuffer
- Export databases to ArrayBuffer for persistence
- Full TypeScript support with comprehensive GTFS types
- Works in both browser and Node.js environments
- Efficient querying with indexed SQLite database
- Proper handling of GTFS required/optional fields
- Active service detection based on calendar/calendar_dates

Implementation includes:
- Complete GTFS type definitions (stops, routes, trips, etc.)
- SQLite schema generation matching GTFS specification
- CSV parser for GTFS text files
- ZIP loader supporting browser and Node.js
- Comprehensive query methods for all GTFS entities
- Full test suite using Vitest
- CI/CD pipeline with GitHub Actions
- Comprehensive README with examples and WASM loading instructions

Author: Théophile Helleboid/SysDevRun
License: MIT
- Fix type error in export() method: create proper ArrayBuffer
- Fix package.json exports order: move 'types' before 'import'/'require'
- All linting, type checking, and tests now pass
@chtitux
chtitux merged commit 4cec1b5 into main Nov 5, 2025
4 checks passed
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