-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
chore: add typecheck for templates #5567
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
WalkthroughReplaces defineConfig with defineConfigFactory in two template configs, adds a new typecheck script to two template package.json files, and updates CLI tests to run pnpm typecheck after tests. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant CLI as create-egg CLI
participant Tmpl as Template (simple-ts/tegg)
participant Test as pnpm test
participant TS as pnpm typecheck (tsc --noEmit)
Dev->>CLI: Run scaffolding tests
CLI->>Tmpl: Generate project from template
CLI->>Test: Execute test suite
Test-->>CLI: Exit code
CLI->>TS: Run typecheck (added step)
TS-->>CLI: Exit code
CLI-->>Dev: Test + typecheck completed
note over CLI,TS: New synchronous step added to test flow
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (5)
🧰 Additional context used📓 Path-based instructions (5){package.json,packages/**/package.json,plugins/**/package.json,tools/**/package.json}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
{packages,plugins,tools}/**/package.json📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.ts📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/test/**/*.test.ts📄 CodeRabbit inference engine (AGENTS.md)
Files:
{packages,plugins,tools}/**/test/**/*.test.ts📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (7)📓 Common learnings📚 Learning: 2025-09-28T08:01:03.933ZApplied to files:
📚 Learning: 2025-09-28T08:01:03.933ZApplied to files:
📚 Learning: 2025-09-18T07:56:17.417ZApplied to files:
📚 Learning: 2025-09-28T08:01:03.941ZApplied to files:
📚 Learning: 2025-09-18T07:56:17.417ZApplied to files:
📚 Learning: 2025-09-14T08:41:30.618ZApplied to files:
🧬 Code graph analysis (2)tools/create-egg/src/templates/tegg/config/config.default.ts (1)
tools/create-egg/src/templates/simple-ts/config/config.default.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
🔇 Additional comments (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @fengmk2, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enhancing the type safety and developer experience for projects created with the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces a typecheck script to the simple-ts and tegg templates, which is a great addition for improving code quality and catching type errors early. The implementation is solid, with defineConfig being updated to defineConfigFactory to ensure type compatibility, and tests being added to verify that the generated projects pass the type check. I've suggested a small improvement to integrate the new typecheck script into the CI process for even better quality assurance.
| "ci": "vitest run --coverage", | ||
| "postci": "npm run prepublishOnly && npm start && sleep 10 && npm stop && npm run clean", | ||
| "lint": "oxlint --type-aware", | ||
| "typecheck": "tsc --noEmit", |
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.
It's great that you've added a typecheck script. To ensure type safety is checked automatically during the continuous integration process, consider adding this script to the preci hook. This would make the CI pipeline more robust.
For example:
"preci": "npm run clean && npm run lint && npm run typecheck"| "ci": "npm run test:local -- --coverage", | ||
| "postci": "npm run prepublishOnly && npm start && sleep 10 && npm stop && npm run clean", | ||
| "lint": "oxlint --type-aware", | ||
| "typecheck": "tsc --noEmit", |
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.
Adding the typecheck script is a good improvement. To make it even more effective, you could integrate it into your CI workflow by adding it to the preci script. This will help catch type errors early in the development process.
For example:
"preci": "npm run clean && npm run lint && npm run typecheck"|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #5567 +/- ##
==========================================
- Coverage 81.28% 81.26% -0.02%
==========================================
Files 209 209
Lines 5984 5984
Branches 873 871 -2
==========================================
- Hits 4864 4863 -1
- Misses 1047 1048 +1
Partials 73 73 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|

Summary by CodeRabbit
New Features
Refactor
Tests
Chores