How miquelabella/sereni-ui works
Main Components
• Web Component Source Code:
– The core of the project is the components found under the src/components directory.
– Each component (e.g., my-component, sereni-button, sereni-tooltip) resides in its subdirectory and consists of multiple files (TypeScript/TSX, CSS/SCSS, tests, and even a component-specific README).
• Stencil Compilation Pipeline:
– The Stencil compiler (configured via stencil.config.ts and tsconfig.json) transforms your TypeScript, JSX, and styles into standard Web Components.
– This pipeline handles lazy-loading and custom elements generation.
• Entry Point & Utilities:
– src/index.ts and src/index.html serve as the application or demo entry points.
– Additional utilities in src/utils provide shared functions used by the components or examples.
• Testing and Documentation Layers:
– Test files (.spec.ts, .e2e.ts) provided within each component ensure functionality.
– The README files (both project-wide and within some components) and configuration files (.editorconfig, .prettierrc.json, package.json) document usage and coding standards.
Relationships and Interactions
• Developers write and maintain the source code (i.e., component logic, styling, and tests) under src/components and src/utils.
• The Stencil compiler processes this source code through its build pipeline (configured via stencil.config.ts) converting TypeScript/JSX into browser-compatible Web Components.
• The output (which might be a standalone custom elements distribution) can then be consumed by various applications (e.g., through lazy-loading or direct import as described in the README).
• Testing frameworks (unit and e2e tests) interact directly with the components to verify behavior during development.
Architectural Patterns and Design Principles
• Component-Based Architecture:
– Each UI or functional piece is encapsulated as a reusable Web Component with its styles, behavior, and tests.
• Build-Time Transformation:
– Utilizing a compile-time pipeline (Stencil) to optimize runtime performance and produce standards-based Web Components.
• Separation of Concerns:
– Testing files are co-located with component code enabling focused development and maintainability.
Inclusion of Relevant Technologies, Frameworks, and Tools
• Stencil: The primary framework driving the compile-time process for creating Web Components.
• TypeScript/JSX: The language and syntax used to author the components.
• SCSS/CSS: Styling technologies used for components’ presentation.
• Testing tools: Likely Jest or similar testing libraries that work with Stencil (as seen by the .spec.ts and .e2e.ts files).
• Configuration and Build Tools: Managed via package.json, tsconfig.json, and stencil.config.ts.