feat: Set up React project foundation and migrate type definitions#152
Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
Open
feat: Set up React project foundation and migrate type definitions#152devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
Conversation
- Initialize React + TypeScript project with Vite - Configure TypeScript strict mode - Install core dependencies (react-router-dom v6, sass, vitest, testing-library) - Set up folder structure (components, contexts, hooks, models, utils, pages) - Migrate type definitions from Angular: - story.ts: Story interface with all properties - comment.ts: Comment interface with recursive structure - settings.ts: Settings interface for app preferences - user.ts: User interface for HN user profiles - feed-type.ts: FeedType and ItemType union types - poll-result.ts: PollResult interface - Create utility functions: - date.ts: formatTimeAgo, formatDate, formatDateTime - comments.ts: formatCommentCount, formatCommentCountAbbreviated - url.ts: hasUrl, extractDomain, isValidUrl, getHackerNewsItemUrl, getHackerNewsUserUrl - Add unit tests for all utility functions (25 tests passing) Co-Authored-By: Jack Meigel <jack.meigel@cognition.ai>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR establishes the React project foundation for migrating the Angular Hacker News PWA to React. It creates a new
react-app/directory containing a Vite-based React + TypeScript project with all necessary type definitions and utility functions migrated from the Angular codebase.Key changes:
components/,contexts/,hooks/,models/,utils/,pages/Review & Testing Checklist for Human
time_agotype in Story interface: The Angularstory.tshastime_ago: numberbut I usedtime_ago: stringto match thecomment.tspattern. Check which is correct for the HN API response.crated_time- I corrected it tocreated_time. Confirm the actual API field name.FeedType = 'news' | 'newest' | 'show' | 'ask' | 'jobs'per the task requirements, separate fromItemType = 'poll' | 'story' | 'job'from the original Angular code. Verify this distinction is correct.Recommended test plan:
cd react-app && npm installnpm run lint- should pass with no errorsnpm run build- should compile successfullynpm test- should pass all 25 testsnpm run dev- should start dev server on port 3000Notes
This is Phase 1 of the Angular to React migration, focusing on foundation setup without requiring Angular component knowledge. The type definitions are pure TypeScript interfaces with no framework dependencies.
Link to Devin run: https://app.devin.ai/sessions/13388063be854a3aa8b82a1eeec96dc7
Requested by: Jack Meigel (@cogjack)