CodeVetter · Repo Unpack · System map
moment/luxon
The main product is an embeddable library whose public entrypoint exports temporal types and configuration APIs. Implementation modules separate parsing, calendar conversion, formatting, locale handling, and zone behavior. Runtime state consists of object fields, global defaults, and caches; serialization returns values to the caller. Build tooling produces several JavaScript distributions, while a separate static site supplies documentation and examples.
- src/luxon.js exports VERSION 3.7.2, DateTime, Duration, Interval, Info, Settings, Zone, and four concrete zone classes.
- The package routes imports to build/es6/luxon.mjs and require calls to build/node/luxon.js; src/package.json independently marks source files as ES modules.
- DateTime coordinates Zone and Locale state, Duration stores unit values and a conversion matrix, and Interval stores two DateTime endpoints.
- Standard parsing uses regex/extractor pairs; custom parsing uses TokenParser; Formatter delegates localized date output through Locale formatter factories.
- The host supplies time-zone behavior: SystemZone reads Date.getTimezoneOffset, while IANAZone validates names and computes offsets using Intl.DateTimeFormat.
- The inspected state boundary is in memory: Settings owns module-level defaults, Locale caches Intl instances, and DateTime exposes JSON/BSON conversion hooks rather than a storage adapter.
- npm build invokes tasks/buildAll.js; buildAll concurrently generates Node, browser CommonJS, ES module, AMD, global, and global-es6 bundles with source maps.
- The static documentation build combines generated API documentation with docs/site copies; benchmarks run ES-module suites, and CI declares build, formatting, coverage-test, and site-generation steps.