From c56d0e7699586d87c1c670d068ad5d9be7588ae3 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 02:43:55 +0000 Subject: [PATCH] style: format code with Prettier This commit fixes the style issues introduced in 75be8fe according to the output from Prettier. Details: None --- .rules/architecture/constraints.md | 45 ++++++- .rules/architecture/patterns.md | 123 ++++++++--------- .rules/architecture/principles.md | 48 ++++--- .rules/instructions.md | 5 + .rules/project/overview.md | 18 ++- .rules/project/progress.md | 126 +++++++++++------- .rules/project/structure.md | 47 ++++--- .rules/project/workflow.md | 27 +++- .rules/references/external.md | 34 ++++- CLAUDE.md | 40 +++++- docs/features/rokkit-ui-features.md | 8 +- docs/forms/readme.md | 4 +- packages/helpers/spec/mocks/element.spec.js | 4 +- packages/helpers/src/mocks/element.js | 1 - sites/learn/CODEVIEWER_USAGE.md | 6 +- .../learn/src/lib/components/Story/README.md | 47 +++++-- .../palette/fragments/02-multiple-colors.js | 18 +-- .../(learn)/chart-elements/palette/stories.js | 2 +- .../patterns/fragments/02-multiple.js | 38 +++--- .../chart-elements/patterns/stories.js | 2 +- .../symbols/fragments/03-custom-attributes.js | 42 +++--- .../(learn)/chart-elements/symbols/stories.js | 2 +- .../charts/plot/fragments/02-chart-types.js | 48 +++---- .../routes/(learn)/charts/plot/intro/cars.js | 2 +- .../src/routes/(learn)/charts/plot/stories.js | 2 +- .../elements/accordion/fragments/02-fields.js | 34 ++--- .../accordion/fragments/03-nested-fields.js | 14 +- .../(learn)/elements/accordion/stories.js | 2 +- .../(learn)/elements/breadcrumbs/stories.js | 2 +- .../(learn)/elements/drop-down/stories.js | 2 +- .../list/fragments/02-field-mapping.js | 6 +- .../list/fragments/03-component-field.js | 2 +- .../routes/(learn)/elements/list/stories.js | 2 +- .../(learn)/elements/multi-select/stories.js | 2 +- .../routes/(learn)/elements/select/stories.js | 2 +- .../routes/(learn)/elements/switch/stories.js | 2 +- .../elements/table/fragments/02-columns.js | 26 ++-- .../routes/(learn)/elements/table/stories.js | 2 +- .../(learn)/elements/tabs/fields/data.js | 2 +- .../routes/(learn)/elements/tabs/stories.js | 2 +- .../(learn)/elements/tabs/using/data.js | 2 +- .../routes/(learn)/elements/tree/stories.js | 2 +- .../routes/(learn)/forms/advanced/stories.js | 2 +- .../routes/(learn)/forms/builder/stories.js | 2 +- .../routes/(learn)/forms/inputs/stories.js | 2 +- .../routes/(learn)/forms/layout/stories.js | 2 +- .../routes/(learn)/forms/overview/stories.js | 2 +- .../routes/(learn)/forms/schema/stories.js | 2 +- .../(learn)/forms/validation/stories.js | 2 +- .../routes/(learn)/input/calendar/stories.js | 2 +- .../(learn)/input/inputfield/stories.js | 2 +- .../src/routes/(learn)/input/range/stories.js | 2 +- .../routes/(learn)/input/rating/stories.js | 2 +- .../(learn)/layout/nav-content/stories.js | 2 +- .../fragments/02-custom-css.css | 2 +- .../(learn)/layout/responsive-grid/stories.js | 2 +- .../routes/(learn)/layout/stepper/stories.js | 2 +- .../routes/(learn)/primitives/item/stories.js | 2 +- .../routes/(learn)/primitives/pill/stories.js | 2 +- .../templates/editor/fragments/01-schema.js | 106 +++++++-------- .../(learn)/templates/editor/stories.js | 2 +- .../fragments/05-theme-customization.js | 2 +- .../routes/(learn)/theming/colors/stories.js | 2 +- .../(learn)/utilities/connector/stories.js | 2 +- .../fragments/02-dynamic-validation.js | 58 ++++---- .../utilities/validation-report/stories.js | 2 +- .../welcome/getting-started/stories.js | 2 +- 67 files changed, 643 insertions(+), 412 deletions(-) diff --git a/.rules/architecture/constraints.md b/.rules/architecture/constraints.md index c983e25d7..5a6c42c37 100644 --- a/.rules/architecture/constraints.md +++ b/.rules/architecture/constraints.md @@ -5,18 +5,21 @@ ### Framework Dependencies #### Svelte 5 Requirements + - **Minimum Version**: Svelte ^5.0.0 - **Reasoning**: Runes system is fundamental to our reactive architecture - **Impact**: Cannot support Svelte 4 components without major API changes - **Migration Path**: Wrapper components for legacy support #### Node.js Compatibility + - **Minimum Version**: Node.js >= 18.0.0 - **Reasoning**: ESM support, modern JavaScript features - **Build Targets**: ES2022+ for optimal performance - **Legacy Support**: Transpilation for older browsers via build tools #### TypeScript Integration + - **Requirement**: Full TypeScript support for all public APIs - **Generic Support**: Components must support generic type parameters - **Type Safety**: Runtime validation only in development mode @@ -25,12 +28,14 @@ ### Bundle Size Constraints #### Core Package Limits + - **@rokkit/core**: < 15KB gzipped - **@rokkit/ui**: < 50KB gzipped (full bundle) - **Individual Components**: < 5KB gzipped each - **Tree Shaking**: All exports must be tree-shakeable #### Performance Budgets + - **Initial Load**: < 100KB total for basic usage - **Component Import**: < 10KB additional per component - **Runtime Overhead**: < 5% compared to vanilla implementation @@ -38,17 +43,20 @@ ### Browser Support #### Modern Browsers (Primary Support) + - Chrome >= 90 - Firefox >= 88 - Safari >= 14 - Edge >= 90 #### Legacy Support (Best Effort) + - IE: Not supported - Chrome < 90: Via build tool transpilation - Safari < 14: Limited feature support #### Required Features + - ES Modules - CSS Custom Properties - ResizeObserver @@ -59,7 +67,9 @@ ### API Consistency Requirements #### Component Interface Pattern + All selection components MUST follow: + ```typescript interface SelectionComponent { items: T[] @@ -70,6 +80,7 @@ interface SelectionComponent { ``` #### Event Pattern Consistency + ```typescript interface ComponentEvents { select: CustomEvent<{ value: T }> @@ -78,6 +89,7 @@ interface ComponentEvents { ``` #### Field Mapping System + - MUST support nested field access - MUST provide default field mappings - MUST be runtime configurable @@ -86,12 +98,14 @@ interface ComponentEvents { ### Component Composability Rules #### Snippet System Requirements + - All components MUST support snippet-based customization - Default snippets MUST be provided for all render points - Snippet parameters MUST be consistently typed - No component should require external styling #### Using System Constraints + - Component override system MUST work with any Svelte component - Default components MUST be replaceable - Type system MUST understand component swapping @@ -100,18 +114,21 @@ interface ComponentEvents { ### Accessibility Constraints #### WCAG 2.1 AA Compliance + - All interactive components MUST meet AA standards - Keyboard navigation MUST be complete and intuitive - Screen reader support MUST be comprehensive - Focus management MUST be proper #### Required ARIA Support + - All components MUST have appropriate roles - Dynamic content MUST announce changes - Complex widgets MUST have proper relationships - Error states MUST be announced #### Keyboard Navigation Standards + - Arrow keys for list navigation - Enter/Space for activation - Escape for dismissal @@ -122,18 +139,21 @@ interface ComponentEvents { ### Svelte-Specific Constraints #### Reactivity System Limitations + - Cannot break reactivity chains with intermediate functions - Derived values must be pure computations - Effects must handle cleanup properly - State mutations must be direct for reactivity #### Component System Limits + - Circular component references not supported - Dynamic component imports require specific patterns - Context API has performance implications at scale - SSR requires careful hydration handling #### Bundle Strategy Constraints + - Components cannot share complex internal state - Tree shaking requires careful export structure - Code splitting boundaries must be component-level @@ -142,12 +162,14 @@ interface ComponentEvents { ### Data Flow Constraints #### Field Mapping Limitations + - Deep nesting has performance implications (>5 levels) - Circular references in data cause infinite loops - Function-based mappings break SSR - Dynamic field changes trigger full re-renders #### Performance Boundaries + - Lists >1000 items require virtual scrolling - Deep object comparison is O(n) complexity - Frequent field mapping changes cause thrashing @@ -156,12 +178,14 @@ interface ComponentEvents { ### bits-ui Integration Constraints #### Wrapper Layer Requirements + - Cannot modify bits-ui component internals - Must maintain API compatibility layer - Event handling must be proxied - Styling must work through CSS variables #### Feature Gaps + - Some Rokkit features have no bits-ui equivalent - Custom behaviors require workaround implementations - Performance characteristics may differ @@ -172,12 +196,14 @@ interface ComponentEvents { ### Package Distribution #### NPM Publishing Requirements + - All packages MUST use same versioning scheme - Dependencies MUST be explicitly declared - Peer dependencies MUST be minimal - Breaking changes MUST follow semver #### CDN Delivery Constraints + - UMD builds for script tag usage - ES modules for modern bundlers - CSS must be separately loadable @@ -186,12 +212,14 @@ interface ComponentEvents { ### Framework Integration Limits #### SvelteKit Compatibility + - Must work with both SSR and SPA modes - Cannot rely on browser-only APIs during SSR - Hydration must be seamless - App directory structure must be respected #### Build Tool Requirements + - Vite: Primary support with official plugin - Webpack: Community support only - Rollup: Basic compatibility @@ -200,18 +228,21 @@ interface ComponentEvents { ## Security Constraints ### XSS Prevention + - No innerHTML usage without sanitization - User content must be escaped by default - Dynamic script execution prohibited - Event handlers must be properly scoped ### Content Security Policy + - No inline styles in components (CSP compliance) - No eval() or Function() constructor usage - External resource loading must be explicit - Script sources must be whitelisted ### Dependency Security + - Regular security audits required - No dependencies with known vulnerabilities - Minimal dependency tree to reduce attack surface @@ -220,18 +251,21 @@ interface ComponentEvents { ## Data Processing Constraints ### Memory Management + - Components must not leak memory - Event listeners must be properly cleaned up - Large datasets must use streaming approaches - Circular references must be avoided ### Performance Limits + - Initial render: < 16ms for 60fps - Update operations: < 5ms for smooth interaction - Memory usage: < 10MB for typical applications - CPU usage: < 10% for idle state ### Scalability Boundaries + - Maximum recommended items per component: 10,000 - Maximum nesting depth: 10 levels - Maximum concurrent components: 1,000 @@ -240,18 +274,21 @@ interface ComponentEvents { ## Future Constraint Considerations ### Svelte Evolution + - Must be adaptable to future Svelte versions - Cannot rely on unstable internal APIs - Must follow Svelte ecosystem best practices - Should leverage new features when stable ### Web Standards Evolution + - Must work with evolving browser standards - Should adopt new web APIs when beneficial - Must maintain backwards compatibility - Should progressive enhance with new features ### Ecosystem Changes + - Must adapt to CSS framework evolution - Should integrate with new accessibility tools - Must work with evolving build tools @@ -260,18 +297,21 @@ interface ComponentEvents { ## Breaking Change Policy ### Allowed Breaking Changes + - Major version bumps only - 6-month minimum notice period - Clear migration path provided - Deprecated API support for 2 versions ### Protected APIs + - Core component props (items, value, fields) - Event emission patterns - Basic accessibility features - Field mapping system fundamentals ### Change Management + - RFC process for major changes - Community feedback period - Beta releases for validation @@ -280,19 +320,22 @@ interface ComponentEvents { ## Exception Handling ### Constraint Violations + - Document all exceptions with rationale - Time-bound exceptions with review dates - Alternative solutions must be provided - Impact assessment required ### Emergency Overrides + - Critical security issues - Major browser breaking changes - Ecosystem-wide migrations - Performance critical optimizations ### Review Process + - Quarterly constraint review - Exception audit and cleanup - Performance budget adjustments -- Technology update assessments \ No newline at end of file +- Technology update assessments diff --git a/.rules/architecture/patterns.md b/.rules/architecture/patterns.md index e3e3ecd48..c79fb0b3a 100644 --- a/.rules/architecture/patterns.md +++ b/.rules/architecture/patterns.md @@ -10,7 +10,7 @@ Every Rokkit component follows this structural pattern: