How helixmorphe/yeezy-dates works
Project type and purpose
• This is an open-source Node.js/TypeScript library called “yeezy-dates.”
• Purpose: Expose a single API (parseDate(input: string) → Array<{label, date}>) that parses human-friendly date strings and returns an array of labeled Date suggestions.
File structure
• Top-level:
• package.json, tsconfig.json, build/test configs, CI workflows
• src/ — the library’s implementation
• Under src/:
• constants.ts — core constants (e.g. time units, locale formats)
• index.ts — entry point exporting parseDate
• repositories/ — loading and managing template definitions
• templates/ — concrete template classes (e.g. relative-day, time patterns) and a factory to instantiate them
• services/ — modular pipeline steps:
– date-parsing-service: turn raw template+input into base Date(s)
– suggestion-generation-service: combine templates + parsed data into candidate suggestions
– suggestion-filter-service: prune/filter/sort suggestions
– template-suggestion-service: coordinate the overall pipeline per template
• tests (spec/test files) — ensure each module’s correctness
README for additional insights
• Confirms the single function API, expected output format
• Use cases: scheduling UIs, chatbots, natural-language interfaces
• No external services or databases; fully in-process
Detail & essential elements
• Every module/service as its own component
• Template repository/factory path separately from the service pipeline
• Conditional logic (e.g., SuggestionFilterService’s criteria)