Skip to content

Conversation

sametcodes
Copy link
Collaborator

This pull request introduces significant updates to the tedris app and shared workspace configurations, focusing on improving modularity, aligning dependencies, and enhancing ESLint and TypeScript configurations. The changes include migrating to shared configurations, updating imports, and introducing new shared ESLint and TypeScript configurations.

Updates to tedris app:

Dependency and import updates:

  • Updated imports in apps/tedris/app/api/auth/[...nextauth]/route.ts to use authOptions from web/lib/auth_options instead of apps/tedris/lib/auth_options. (apps/tedris/app/api/auth/[...nextauth]/route.tsL1-R1)
  • Replaced @madrasah/ui imports with more specific paths (e.g., @madrasah/ui/components/button) in multiple files for better modularity. [1] [2] [3]
  • Updated apps/tedris/app/layout.tsx to use a shared global stylesheet from @madrasah/ui/globals.css.

Configuration updates:

  • Replaced the local Tailwind CSS configuration and PostCSS setup with shared configurations from @madrasah/ui. [1] [2] [3]
  • Updated tsconfig.json to include more comprehensive TypeScript options, such as moduleResolution: bundler and additional libraries.

New components:

  • Added a new Test page in apps/tedris/app/test/page.tsx showcasing usage of Button and Alert components from @madrasah/ui.

Shared workspace enhancements:

ESLint configuration:

  • Introduced a shared ESLint configuration package (@madrasah/eslint-config) with base, Next.js, and React-specific configurations. These configurations include plugins like eslint-plugin-react, eslint-plugin-react-hooks, and eslint-plugin-turbo. [1] [2] [3] [4] [5]

TypeScript configuration:

  • Updated shared/hooks/tsconfig.json to extend from the new shared TypeScript configuration (@madrasah/typescript-config/base.json) for consistency across the workspace.

Package updates:

  • Added new dependencies (@radix-ui/react-slot, class-variance-authority, lucide-react) to apps/tedris/package.json and introduced resolutions for React 19.0.0 to ensure compatibility. [1] [2]
  • Updated shared/hooks/package.json to fix the module field, aligning it with the main entry point.

- Add @madrasah/eslint-config with base, next, and react-internal configs
- Add @madrasah/typescript-config with base, nextjs, and react-library configs
- Centralize configuration management across monorepo
- Add resolutions and overrides to ensure consistent React 19.0.0 across monorepo
- Update root tsconfig to reference new base configuration
- Ensure all packages use same React version for compatibility
- Update @madrasah/hooks, @madrasah/types, @madrasah/utils packages
- Use new @madrasah/typescript-config and @madrasah/eslint-config
- Standardize package.json and tsconfig.json across shared packages
- Restructure @madrasah/ui to use new component structure (moved from ui/ to components/)
- Add comprehensive README documentation for UI library
- Add new components: Badge, Checkbox, Input, Select
- Update Alert and Button components with improved variants
- Add PostCSS and Tailwind configurations
- Add ESLint configuration for UI package
- Add TypeScript declarations and build outputs
- Update design tokens CSS structure
- Update package.json to use shared @madrasah configurations
- Update Tailwind, PostCSS, and Next.js configurations
- Update TypeScript configuration to use shared base
- Update global styles to use design tokens
- Update layout and pages to use new UI components
- Add test page for UI component development
- Update Keycloak logout component
- Update API auth route configuration
Copy link
Collaborator

@MuhammedAlmaz MuhammedAlmaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hocam öncelikle emeğine sağlık. Çok ufak bir önerim olacak. shared/ui/src/components klasörünün altındaki componentleri ayrı klasörler içerisine toplasak daha uygun olabilir. Örneğin shared/ui/src/components/button/.... ya da shared/ui/src/components/select.

@sametcodes
Copy link
Collaborator Author

Hocam öncelikle emeğine sağlık. Çok ufak bir önerim olacak. shared/ui/src/components klasörünün altındaki componentleri ayrı klasörler içerisine toplasak daha uygun olabilir. Örneğin shared/ui/src/components/button/.... ya da shared/ui/src/components/select.

Öneri için teşekkürler hocam. Klasör olarak tutmanın avantajları nedir? Düşünelim.

Ben burada shadcn'nin kendi pratiğini takip ettim. Çoğunlukla UI componentlerini npx shadcn ile yükleyeceğimiz için onun konfigürasyonunu bozmak istemedim. Ayrıca @madrasah/ui paketi içerisindeki UI componentleri çoğunlukla core componentler olacak, app spesifik componentleri burada tutmayacağız.

İkinci olarak core componentlerin çoğu stateless olarak çalışıyor, çoğunlukla radix-ui componentlerini extend ediyor. Component-specific hooks veya utils fonksiyonları muhtemelen bulunmayacak, yani karmaşık bi structure olmaz diye düşünüyorum. Component dizini tarafında da aynı sadeliği koruyabiliriz.

@MuhammedAlmaz
Copy link
Collaborator

MuhammedAlmaz commented Aug 4, 2025

Hocam öncelikle emeğine sağlık. Çok ufak bir önerim olacak. shared/ui/src/components klasörünün altındaki componentleri ayrı klasörler içerisine toplasak daha uygun olabilir. Örneğin shared/ui/src/components/button/.... ya da shared/ui/src/components/select.

Öneri için teşekkürler hocam. Klasör olarak tutmanın avantajları nedir? Düşünelim.

Ben burada shadcn'nin kendi pratiğini takip ettim. Çoğunlukla UI componentlerini npx shadcn ile yükleyeceğimiz için onun konfigürasyonunu bozmak istemedim. Ayrıca @madrasah/ui paketi içerisindeki UI componentleri çoğunlukla core componentler olacak, app spesifik componentleri burada tutmayacağız.

İkinci olarak core componentlerin çoğu stateless olarak çalışıyor, çoğunlukla radix-ui componentlerini extend ediyor. Component-specific hooks veya utils fonksiyonları muhtemelen bulunmayacak, yani karmaşık bi structure olmaz diye düşünüyorum. Component dizini tarafında da aynı sadeliği koruyabiliriz.

İlerleyen zamanlarda shared ui components yapılarının artmayacağını ön görebiliyorsak pek sorun olmayacaktır. Fakat ilerleyen zamanlarda datagrid, autocomplete input, modals, switch, datepicker vb. componenler de bu geliştirmelere dahil olduğunda klasörde geliştirme yapmayı biraz zorlaştırabilir. Ek olarak her component için ayrı test dosyaları ya da storybook tanımladığımızda dikeyde klasörün boyutu bir hayli fazla olacaktır. Flat File Structure ile de devam edebiliriz ilerleyen zamanlarda karmaşıklık arttığı durumda ihtiyaca göre Modular Folder Structure ile değiştirebiliriz 👍

@MuhammedAlmaz MuhammedAlmaz self-requested a review August 4, 2025 04:18
@MuhammedAlmaz MuhammedAlmaz merged commit eec0ed6 into main Aug 4, 2025
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.

2 participants