$ show ing-bank/lion
Lion is a monorepo maintained by ING Bank that provides a comprehensive, white-label web component library built on LitElement. It focuses on accessible, performant, and extensible form controls (inputs, checkboxes, radio groups, selects, datepickers, IBAN, phone, file, etc.), overlays (dialog, tooltip, popover, drawer), navigation components (accordion, tabs, pagination, steps), and localization/internationalization utilities. The library is architected around a rich mixin system (e.g., FormControlMixin, ValidateMixin, OverlayMixin, LocalizeMixin) that allows deep customization without sacrificing encapsulation. It also includes Node.js tooling: an AST-based dependency analyzer (providence-analytics), a documentation publishing tool, and a Babel plugin for extending docs. The codebase demonstrates strong software engineering practices: extensive test suites, accessibility-first design, scoped custom element registries, and a modular export map. However, there are signs of technical drift (outdated dependencies like ESLint 8, TypeScript 4.9, Chai 4) and some duplicated code (e.g., localizeNamespaceLoader switch statements repeated across packages, translation drift). The monorepo uses changesets for versioning and has active CI/CD.
The LLM identified 4 files worth highlighting for reuse:
A lightweight fetch-based AJAX client with a request/response interceptor pipeline, cache management (TTL, size limits, invalidation), and built-in support for XSRF headers and JSON handling. It is self-contained (depends only on standard fetch and internal cache modules), making it extractable for any project needing a configurable HTTP client with caching.
A singleton manager that enables multiple versions of a library to share a single instance keyed by name and version. It uses a lazy Proxy to defer instantiation until the singleton is actually accessed, avoiding initialization order issues. This pattern solves a common cross-package singleton problem and can be extracted as a standalone utility.
A configurable memoization utility supporting LFU and LRU cache eviction strategies with a maximum cache size. It wraps any function, provides a cache key generator, and exposes a clear method. This is a generic, reusable caching utility that can be extracted and applied to any expensive function call.
A base Validator class that encapsulates validation logic with sync/async execution, configurable messages via getMessage, parameter passing, and lifecycle hooks (onFormControlConnect). It defines a clean interface (validatorName, execute, getMessage) that can be extended to create domain-specific validators. This pattern is reusable across any form framework.