This document outlines common tasks and workflows for the Nuxtware project.
- Install dependencies with
npm install - Start the development server with
npm run dev - Test changes in the playground environment
- Create the component file in the appropriate subdirectory of
app/components/ - Define props using TypeScript interfaces
- Use
<script setup lang="ts">syntax - Add necessary translations to i18n files
- Document component usage and props
- Follow the component implementation best practices:
- Use existing composables instead of direct API calls
- Properly type all props, emits, and data
- Leverage Foundation components for UI elements
- Use theme tokens instead of hardcoded colors/values
- Ensure all text is internationalized
- Apply accessibility best practices
- Identify untranslated text in components
- Add keys to appropriate translation files
- Implement translations in all language files
- Replace hardcoded text with
$t()calls - Test with language switching to verify
- Search for hardcoded text in Vue files
- Create appropriate translation keys
- Add translations to all language files
- Replace hardcoded text with translation calls
- Verify everything works with language switching
- Use the Shopware composables for data fetching
- Follow the established patterns for product and category display
- Test thoroughly with the Shopware API
- Use the
useCart()composable for cart operations - Use the
useApiErrorsResolver()composable for error handling - Implement proper error handling with TypeScript types
- Use
getFormattedPrice()fromusePrice()for all price displays - Handle all cart states: loading, empty, error, and populated
- Test cart operations to ensure they update properly
- Ensure proper internationalization of all cart-related text
- Use the
useGlobalNotifications()composable to manage notifications - Display different types of notifications (success, error, warning, info)
- Configure notification behavior:
- Set duration for auto-dismissal
- Configure notification position for both desktop and mobile
- Set maximum number of visible notifications
- For manual control, use methods like:
addNotification()for custom notificationsremoveNotification()to dismiss specific notificationsclearNotifications()to remove all notificationsupdateConfig()to modify global settings
- For common notification types, use convenience methods:
success()for success messageserror()for error messageswarning()for warning messagesinfo()for informational messages
- Ensure notifications follow accessibility best practices:
- Use
aria-live="polite"for screen reader announcements - Provide clear messages with appropriate context
- Include visual cues through colors and icons
- Use
- Create a new page in the
app/pages/directory - Implement the page using existing components
- Add any required translations
- Test navigation and functionality
- Use Tailwind utility classes for most styling needs
- For complex components, use the component-specific CSS files
- Follow the project's design system for colors and spacing