Skip to content

Releases: RomneyDa/mapthis

@dromney/mapthis 0.1.0

10 Apr 06:10

Choose a tag to compare

Initial release of @dromney/mapthis — an open-source location intelligence toolkit. Parse freeform text, HTML, and URLs into geocoded locations, with types and React components for rendering maps.

Install

npm install @dromney/mapthis

Subpath exports

Subpath What it contains
@dromney/mapthis Re-exports types + utils (lightweight only)
@dromney/mapthis/types Zod schemas and plain TS domain types (PlaceMap, Place, PlaceGroup, ParsedLocation, ...)
@dromney/mapthis/utils Pure helpers: text, color, number, stopwatch, geo (61 cities)
@dromney/mapthis/scrape getHtmlFromUrl, htmlToText, getTextFromUrl
@dromney/mapthis/search createSearchClient (Google Custom Search)
@dromney/mapthis/ai createLocationParser, createOpenAiBackend, summarizeText, prompts
@dromney/mapthis/geocoding createGeocoder with pluggable GeocodingProvider
@dromney/mapthis/generate createMapGenerator — composes parser + geocoder into a pure orchestrator
@dromney/mapthis/react MapProvider, GoogleMapsViewer, PlaceMarker, autofit, browser autocomplete

Design principles

  • No `process.env` reads. All secrets (OpenAI, Google Maps, Google CSE) are passed to factory functions by the consumer — the package is portable and testable.
  • Framework-agnostic. Core modules are pure TypeScript. React components live behind the `/react` subpath so server-side consumers can skip them.
  • Plain domain types. Types are hand-rolled TS with matching Zod schemas, so consumers aren't forced into a particular ORM.
  • Optional peer deps for heavy things (`openai`, `js-tiktoken`, `html-to-text`, `@googlemaps/google-maps-services-js`, `react`, `react-dom`, `@vis.gl/react-google-maps`). Install only what the subpaths you use need.
  • Dual ESM / CJS with full .d.ts and source maps (with embedded `sourcesContent`) for every subpath.

License

Apache 2.0