-
Notifications
You must be signed in to change notification settings - Fork 0
feat: FSD 아키텍처 구현 및 Tailwind CSS 4.x 업그레이드, 모나코 에디터로 변경 #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add Monaco Editor for code editing - Add Legend State for reactive state management - Add Radix UI + Tailwind CSS for modern UI components - Add react-resizable-panels for layout management - Add @radix-ui/react-icons for icon components Dependencies added: - @monaco-editor/react: Code editor component - @legendapp/state: Reactive state management - @legendapp/state/react: React integration for Legend State - @radix-ui/themes: UI component library - @radix-ui/react-icons: Icon components - react-resizable-panels: Resizable layout panels - tailwindcss: Utility-first CSS framework - postcss: CSS post-processor - autoprefixer: CSS vendor prefixer
Implement Feature-Sliced Design (FSD) architecture for better code organization: 📁 app/ - index.tsx: Main app component - providers.tsx: Global providers (Legend State, Radix UI) 📁 pages/editor/ - EditorPage.tsx: Main editor page with split layout 📁 widgets/ - code-editor/CodeEditor.tsx: Monaco Editor wrapper with Cmd+Enter binding - output-panel/OutputPanel.tsx: Console output display - tab-bar/TabBar.tsx: Multi-tab management UI 📁 features/ - execute-code/model.ts: Code execution state and API - manage-tabs/model.ts: Tab management with localStorage sync 📁 shared/ - types/index.ts: Common TypeScript interfaces - lib/storage.ts: localStorage helper functions - ui/Button.tsx: Reusable button component - ui/Panel.tsx: Reusable panel component This structure follows FSD principles: - Clear layer separation (app → pages → widgets → features → shared) - Dependency rules enforcement - Better maintainability and scalability
- Remove legacy App.tsx, App.css, App.test.tsx - Update main.tsx to import from app/index.tsx - Complete migration to FSD architecture Changes: - Delete src/App.tsx (replaced by src/app/index.tsx) - Delete src/App.css (replaced by Tailwind CSS) - Delete src/App.test.tsx (replaced by FSD test files) - Update src/main.tsx to use new app structure This completes the transition from traditional React structure to FSD architecture.
- Upgrade to Tailwind CSS v4 (latest version) - Configure PostCSS for CSS processing - Implement modern UI styling with Radix UI integration - Add custom component styles for editor layout Changes: - Update src/index.css with @import 'tailwindcss' (v4 syntax) - Add postcss.config.js for CSS processing - Remove tailwind.config.js (not needed in v4) - Add custom styles for editor-container and panel-resize-handle - Integrate with Radix UI color system Features: - Dark theme support - Responsive design - Custom component styling - Smooth transitions and hover effects
- Add comprehensive FSD (Feature-Sliced Design) architecture guide - Document Legend State usage patterns and examples - Add Radix UI + Tailwind CSS integration guide - Update development guide with new tech stack New documentation sections: 📚 FSD Architecture - Folder structure explanation - Layer responsibilities and dependencies - Best practices and patterns 📚 Legend State - Basic usage examples - Action patterns for state management - Observable patterns 📚 UI Components - Radix UI integration guide - Tailwind CSS class usage - Component composition patterns This provides developers with comprehensive guidance for working with the new architecture.
- Add FSD (Feature-Sliced Design) architecture rules - Update tech stack documentation - Add Legend State and Radix UI guidelines - Define layer dependencies and responsibilities New rules added: 🏗️ FSD Architecture Rules - Folder structure guidelines - Dependency rules between layers - Layer responsibilities 🎨 Updated Tech Stack - Legend State for reactive state management - Radix UI + Tailwind CSS for UI components - Monaco Editor for code editing - React 19 with modern patterns This ensures consistent development practices and helps developers follow the established architecture patterns.
- Update lockfile to reflect all newly added dependencies - Ensure consistent dependency resolution across environments - Include Monaco Editor, Legend State, Radix UI, and other UI libraries This ensures that all team members will have the exact same dependency versions when running pnpm install.
- Remove LegendStateProvider import and usage - Legend State v2 doesn't require a provider wrapper - Keep only Radix UI Theme provider for styling According to Legend State documentation: - No boilerplate required - No contexts, actions, reducers, dispatchers needed - Just use observable() and useObservable() directly - Provider pattern is not needed in v2 This fixes the SyntaxError: Importing binding name 'LegendStateProvider' is not found.
- Fix useObservable to use function syntax with .get() - Legend State v2 requires function wrapper for reactive updates - This should resolve the blank screen issue Changes: - useObservable(tabsState.tabs) → useObservable(() => tabsState.tabs.get()) - useObservable(tabsState.activeTabId) → useObservable(() => tabsState.activeTabId.get()) - useObservable(executionState.result) → useObservable(() => executionState.result.get()) - useObservable(executionState.isExecuting) → useObservable(() => executionState.isExecuting.get()) This follows the correct Legend State v2 pattern for reactive updates in React components.
- Add initial tab creation in tabsState observable - Fix getActiveTab function to use .get() properly - Add debugging logs for tab management - Prevent duplicate tab loading in loadFromStorage - Use proper ObservableArray methods for tab operations This resolves the issue where activeTab was null and Monaco Editor wasn't rendering.
- Use .get() method to extract values from Legend State observables - Fix React key prop to use actual string values instead of Proxy objects - Add proper variable extraction for tabs array and activeTabId - Resolve 'unsupported type Proxy' error in React rendering This fixes the TabBar component rendering issues and Legend State warnings.
- Use .get() method to extract values from Legend State observables - Add proper variable extraction for result and isExecuting observables - Fix all references to use extracted values instead of raw observables - Resolve Legend State primitive usage warnings This ensures proper rendering of execution results and loading states.
- Use .get() method to extract values from activeTab observable - Fix activeTab.code and activeTab.id access patterns - Add proper null checking for activeTab before accessing properties - Improve conditional rendering logic for CodeEditor component - Add loading state display when no active tab is available This resolves the Monaco Editor rendering issues and Legend State warnings.
- Add try-catch block in handleEditorDidMount for better error handling - Add null checks for monaco.KeyMod and monaco.KeyCode before using - Add console.error logging for Monaco Editor mount errors - Improve robustness of Monaco Editor initialization This prevents Monaco Editor initialization errors from crashing the app.
- Add conditional devtools opening in debug mode - Enable easier debugging during development - Only activate in debug_assertions build This helps with debugging the Tauri application during development.
- OutputPanel.tsx → output-panel.tsx - CodeEditor.tsx → code-editor.tsx - Button.tsx → button.tsx - Panel.tsx → panel.tsx - CodeEditor.test.tsx → code-editor.test.tsx FSD 아키텍처의 kebab-case 파일명 규칙을 준수하도록 변경
- EditorPage.tsx에서 새로운 kebab-case 파일명으로 import 경로 수정 - CodeEditor.test.tsx에서 code-editor import 경로 수정 - 모든 컴포넌트가 올바른 경로로 참조되도록 수정
- Fix icon.ico format to resolve Windows Resource Compiler error - Update pnpm-workspace.yaml configuration
- Upgrade from Tailwind CSS 3.x to 4.x - Add @tailwindcss/vite plugin dependency - Update pnpm-lock.yaml with new dependencies
- Import @tailwindcss/vite plugin - Add tailwindcss() to Vite plugins array - Enable seamless Tailwind CSS integration with Vite
- Ensure proper Tailwind CSS class usage in EditorPage - Update code editor component styling - Remove redundant h-screen classes for better layout
- Add index.ts files to each FSD layer - Use export * from pattern for cleaner re-exports - Enable proper module resolution and clean imports
- Rename EditorPage.tsx to editor-page.tsx - Rename EditorPage.test.tsx to editor-page.test.tsx - Follow FSD naming conventions for better consistency
- Add baseUrl and paths configuration - Map @/* to ./src/* for cleaner imports - Enable absolute import paths throughout the project
- Add resolve.alias for @ to ./src - Ensure Vite can resolve @ imports correctly - Match TypeScript path mapping configuration
- Replace relative imports with @ alias - Update editor-page.tsx, app/index.tsx, main.tsx - Improve import readability and maintainability
- Update @import statement for Tailwind CSS 4.x compatibility - Ensure proper CSS compilation with new Tailwind setup
- Add Feature-Sliced Design (FSD) architecture guidelines - Include layer dependency rules and naming conventions - Add Tailwind CSS 4.x and path alias documentation - Update coding conventions for FSD compliance
- Fix model.test.ts to use correct useExecutionStore API - Add path alias configuration to vitest.config.ts - Update test logic to properly handle Zustand state changes - Resolve @ path alias resolution issues in tests All tests now pass and TypeScript compilation succeeds.
- Remove trailing spaces - Add missing comma in object literal - Improve code readability and consistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements Feature-Sliced Design (FSD) architecture and upgrades to Tailwind CSS 4.x with Monaco Editor integration. The changes improve maintainability through clear layer separation, better developer experience with path aliases, and enhanced styling capabilities.
Key Changes:
- Restructured codebase following FSD architecture patterns with proper layer separation (app, pages, widgets, features, shared)
- Upgraded Tailwind CSS from 3.x to 4.x with Vite plugin integration
- Replaced code editor with Monaco Editor for enhanced editing capabilities
Reviewed Changes
Copilot reviewed 34 out of 36 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Added @parcel/watcher to onlyBuiltDependencies |
| docs/docs/guide/development.mdx | Updated architecture documentation with FSD structure details |
| apps/executeJS/vitest.config.ts | Added path alias configuration for tests |
| apps/executeJS/vite.config.ts | Added Tailwind CSS 4.x plugin and path alias |
| apps/executeJS/tsconfig.json | Configured TypeScript path mapping for @ alias |
| apps/executeJS/src/widgets/output-panel/output-panel.tsx | New output panel component using Radix UI |
| apps/executeJS/src/widgets/code-editor/code-editor.tsx | New Monaco editor wrapper component |
| apps/executeJS/src/pages/editor/editor-page.tsx | Refactored editor page with FSD imports |
| apps/executeJS/src/features/execute-code/model.ts | New execution state management using Zustand |
| apps/executeJS/src/app/index.tsx | New app entry point with providers |
| apps/executeJS/src/main.tsx | Updated to import from FSD structure |
| apps/executeJS/src/index.css | Refactored to use Tailwind CSS 4.x syntax |
| apps/executeJS/package.json | Added Monaco, Radix UI, Tailwind CSS 4.x dependencies |
| agent.md | Updated documentation with FSD architecture details |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
feat: FSD 아키텍처 구현 및 Tailwind CSS 4.x 업그레이드, 모나코 에디터로 변경
feat: FSD 아키텍처 구현 및 Tailwind CSS 4.x 업그레이드, 모나코 에디터로 변경
📋 요약
이 PR은 Feature-Sliced Design (FSD) 아키텍처를 구현하고 유지보수성과 성능 향상을 위해 Tailwind CSS 4.x로 업그레이드합니다.
🚀 주요 변경사항
FSD 아키텍처 구현
index.ts파일 추가하여 적절한 export 구현@/*→./src/*)Tailwind CSS 4.x 업그레이드
@tailwindcss/vite플러그인 추가h-screen클래스 적용 문제 해결파일 구조 변경
🔧 기술적 세부사항
경로 별칭
tsconfig.json에서@/*→./src/*vite.config.ts에서@→./srcImport 변경사항
FSD 레이어 규칙
🎯 장점
@별칭을 사용한 절대 경로 import🧪 테스트
📝 주요 변경사항
@별칭을 사용하도록 업데이트🔄 마이그레이션 가이드
로컬 변경사항이 있다면:
@별칭을 사용하도록 업데이트📚 참고 자료
🔗 관련 커밋
feat: add FSD index.ts files for proper exportsrefactor: rename files to kebab-case following FSD conventionsfeat: add TypeScript path mapping for @ aliasfeat: add Vite path alias configurationrefactor: update imports to use @ path aliasstyle: update CSS imports for Tailwind CSS 4.x