Skip to content

docs: refactor/extract demo components to modules#225

Merged
ibrahimcesar merged 12 commits intomainfrom
refactor/extract-demo-components-to-modules
Nov 20, 2025
Merged

docs: refactor/extract demo components to modules#225
ibrahimcesar merged 12 commits intomainfrom
refactor/extract-demo-components-to-modules

Conversation

@ibrahimcesar
Copy link
Copy Markdown
Owner

New documentation

Ibrahim Cesar Nogueira Bevilacqua and others added 12 commits November 15, 2025 17:09
… modules

This refactoring improves maintainability and organization of the demo application by:

## Component Modularization
- Created `/demo/components/` folder structure with:
  - `Header.js` - Page header with title, description, and version info
  - `Footer.js` - Footer with resource links
  - `Navigation.js` - Quick navigation component
  - `/examples/` folder containing 11 separate example components

- Reduced `demo/pages/index.js` from 1,249 lines to 178 lines (86% reduction)
- Each example is now self-contained in its own file for easier maintenance

## CSS Module Extraction
- Created dedicated CSS module files:
  - `Navigation.module.css` - Navigation component styles
  - `Footer.module.css` - Footer component styles
  - `EventsExample.module.css` - EventsExample component styles (40+ classes)

- Removed all inline styles from:
  - Navigation.js (reduced from 54 to 24 lines)
  - Footer.js (removed all inline styles)
  - EventsExample.js (removed 150+ lines of inline style objects)

## Benefits
- βœ… Better code organization and separation of concerns
- βœ… Easier to locate and edit specific examples
- βœ… Cleaner git diffs for future changes
- βœ… Improved performance (styles compiled at build time)
- βœ… Consistent styling pattern across all components
- βœ… Better maintainability with scoped CSS modules

## Technical Details
- All functionality preserved - no breaking changes
- Proper use of CSS modules with scoped class names
- Template literals for combining multiple CSS classes
- Maintained all existing component features and event handlers

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added 5rem padding-bottom to .madeWidth class to improve visual
spacing at the bottom of the page.

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Merged latest changes from main branch, incorporating the publishConfig
addition for npm package publication settings.

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Install all-contributors-cli package
- Add All Contributors badge to README
- Create Contributors section in README
- Add Nate (@natesct) as first contributor for bug report (#222)
- Add npm scripts for managing contributors

This enables recognizing all types of contributions including
bug reports, documentation, code, and more.

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Create automated workflow to add contributors via GitHub UI
- Support all contribution types with dropdown selection
- Automatically creates PR with contributor changes
- Add comprehensive CONTRIBUTORS.md guide

This makes it easy to recognize all types of contributions
including bug reports, documentation, code, and more.

Usage:
1. Go to Actions β†’ Add Contributor
2. Fill in username and contribution type
3. Workflow creates a PR automatically

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Create script to automatically add all git contributors
- Add all-contributors:add-historical npm script
- Successfully added 10+ historical code contributors
- Update CONTRIBUTORS.md with historical import guide

Contributors added:
- @ibrahimcesar (repository owner)
- @tmcw, @avaleriani (auto-detected)
- @lachlanjc, @perbergland, @humet
- @afzalsayed96, @LichLord91, @FunctionDJ
- @theodorusclarence, @elbotho

Script features:
- Parses git log for all committers
- Extracts GitHub usernames from emails
- Optional GitHub API integration for better detection
- Lists contributors needing manual addition

Usage:
  npm run contributors:add-historical

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Install Docusaurus 3.9 in demo/docs folder
- Configure for react-lite-youtube-embed project
- Update branding, URLs, and navigation
- Disable blog, focus on documentation
- Install local package for live examples
- Set up for GitHub Pages deployment

Next steps:
- Create video-focused homepage
- Add documentation pages
- Migrate examples from Next.js demo

To run docs locally:
  cd demo/docs && npm start

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Replace default homepage with custom video-first design
- Add live LiteYouTubeEmbed demo prominently in hero section
- Create "Why" section with 6 key features (Fast, Private, Tiny, etc.)
- Add Quick Start section with install/usage code
- Add Performance Comparison table (iframe vs lite embed)
- Implement beautiful gradient hero with glassmorphism
- Add video stats display (< 5KB, ~500KB saved, 0 cookies)
- Fully responsive design with mobile optimizations
- Dark mode support with adjusted gradients

The homepage now immediately demonstrates the component
with a real embedded video, making the value prop crystal clear.

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Move demo/docs to top-level docs/
- Delete old demo folder (Next.js examples)
- Update docusaurus.config.ts editUrl path
- Update .gitignore for top-level docs

This simplifies the project structure and makes
documentation more prominent.

To run docs:
  cd docs && npm start

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Resolved conflicts in .gitignore by merging both branches
- Kept simplified README from refactor branch
- Removed demo files that were refactored out
- Regenerated package-lock.json from main branch
- Integrated badge updates and build improvements from main
@ibrahimcesar ibrahimcesar merged commit 26faa55 into main Nov 20, 2025
1 check was pending
@github-actions
Copy link
Copy Markdown
Contributor

size-limit report πŸ“¦

Path Size
ES Module 3.08 KB (0%)
CommonJS 3.08 KB (0%)
CSS 1.22 KB (0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant