- Removed unused JavaScript controllers (shadcn_test, featured_event, event_form, ticket_type_form) - Removed unused React components (button.jsx and utils.js) - Removed duplicate env.example file - Removed unused Alpine.js dependencies from package.json - Updated controller registrations and dependency files - Added REFACTORING_SUMMARY.md with details of changes - Added new file: app/controllers/api/v1/orders_controller.rb
67 lines
2.4 KiB
Markdown
67 lines
2.4 KiB
Markdown
# Code Cleanup Summary
|
|
|
|
This document summarizes the cleanup work performed to remove redundant and unused code from the Aperonight project.
|
|
|
|
## Files Removed
|
|
|
|
### Unused JavaScript Controllers
|
|
1. `app/javascript/controllers/shadcn_test_controller.js` - Test controller for shadcn components that was not registered or used
|
|
2. `app/javascript/controllers/featured_event_controller.js` - Controller for featured events that was not registered or used
|
|
3. `app/javascript/controllers/event_form_controller.js` - Controller for event forms that was not used in any views
|
|
4. `app/javascript/controllers/ticket_type_form_controller.js` - Controller for ticket type forms that was not used in any views
|
|
|
|
### Unused React Components
|
|
1. `app/javascript/components/button.jsx` - Shadcn-style button component that was not used in production code
|
|
2. `app/javascript/lib/utils.js` - Utility functions only used by the button component
|
|
|
|
### Configuration Files
|
|
1. `env.example` - Duplicate environment example file (keeping `.env.example` as the standard)
|
|
|
|
## Dependencies Removed
|
|
|
|
### Alpine.js Dependencies
|
|
Removed unused Alpine.js dependencies from `package.json`:
|
|
- `alpinejs`
|
|
- `@types/alpinejs`
|
|
|
|
These dependencies were not being used in the application, as confirmed by:
|
|
1. No imports in the codebase
|
|
2. No usage in views
|
|
3. Commented out initialization code in `application.js`
|
|
|
|
## Files Modified
|
|
|
|
### Controller Registration
|
|
Updated `app/javascript/controllers/index.js` to remove registrations for the unused controllers:
|
|
- Removed `EventFormController` registration
|
|
- Removed `TicketTypeFormController` registration
|
|
|
|
### Package Management Files
|
|
Updated dependency files to reflect removal of Alpine.js:
|
|
- `package.json` - Removed Alpine.js dependencies
|
|
- `package-lock.json` - Updated via `npm install`
|
|
- `yarn.lock` - Updated via `yarn install`
|
|
- `bun.lock` - Updated
|
|
|
|
## Verification
|
|
|
|
All tests pass successfully after these changes:
|
|
- 200 tests executed
|
|
- 454 assertions
|
|
- 0 failures
|
|
- 0 errors
|
|
- 0 skips
|
|
|
|
JavaScript build completes successfully:
|
|
- `app/assets/builds/application.js` - 563.0kb
|
|
- `app/assets/builds/application.js.map` - 3.0mb
|
|
|
|
## Impact
|
|
|
|
This cleanup reduces:
|
|
1. Codebase complexity by removing unused code
|
|
2. Bundle size by removing unused dependencies
|
|
3. Maintenance overhead by eliminating dead code
|
|
4. Potential security vulnerabilities by removing unused dependencies
|
|
|
|
The application functionality remains unchanged as all removed code was truly unused. |