feat: suggest installing dependency as devDependency when appropriate#1052
feat: suggest installing dependency as devDependency when appropriate#1052danielroe merged 5 commits intonpmx-dev:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
2e5f52c to
52c29be
Compare
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis pull request adds functionality to suggest development dependency installation commands. It introduces a new utility module that identifies packages likely to be installed as dev dependencies through a known package list or by scanning README content for dev-install hints. The feature integrates with the terminal install component to display an additional UI block with per-package manager dev installation commands when applicable. Supporting changes include new dev flag handling in install command generation, locale translations for English and Polish, cache versioning updates, and comprehensive test coverage for the new utilities and behaviours. Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
This pull request implements automatic detection and suggestion of dev dependency installation commands for packages that are typically installed as development dependencies. The feature addresses issue #530 by helping developers avoid mistakenly adding dev-only tools as regular dependencies.
Changes:
- Added dev dependency detection heuristics based on a curated list of known dev packages and README analysis
- Updated install command generation to support a
devflag that adds the appropriate flag (-Dor-dfor bun) to the install command - Modified the Terminal/Install UI component to display a suggested dev install command when appropriate
- Added internationalization support for the new UI text in English and Polish locales
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
app/utils/install-command.ts |
Core logic for dev dependency detection, including known package list, README parsing, and command generation with dev flags |
app/components/Terminal/Install.vue |
UI implementation showing suggested dev install command when recommended, with copy functionality |
app/pages/package/[...package].vue |
Integration to pass README HTML data to Terminal/Install component |
test/unit/app/utils/install-command.spec.ts |
Comprehensive tests for dev install commands, detection heuristics, and flag generation |
i18n/locales/en.json, pl-PL.json, en-GB.json, en-US.json |
Translation strings for new UI text |
lunaria/files/*.json |
Translation tracking files for localization workflow |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
app/components/Terminal/Install.vue (1)
161-194: Remove the per-button focus‑visible outline utility.The new dev install copy button adds an inline
focus-visible:outline-accent/70class, but button focus outlines are handled globally. Please drop the outline utility and rely on the global rule.Suggested change
- class="px-2 py-0.5 font-mono text-xs text-fg-muted bg-bg-subtle/80 border border-border rounded transition-colors duration-200 opacity-0 group-hover/devinstallcmd:opacity-100 hover:(text-fg border-border-hover) active:scale-95 focus-visible:opacity-100 focus-visible:outline-accent/70 select-none" + class="px-2 py-0.5 font-mono text-xs text-fg-muted bg-bg-subtle/80 border border-border rounded transition-colors duration-200 opacity-0 group-hover/devinstallcmd:opacity-100 hover:(text-fg border-border-hover) active:scale-95 focus-visible:opacity-100 select-none"Based on learnings: focus-visible styling for button and select elements is implemented globally in app/assets/main.css; avoid per-element focus-visible utility classes like focus-visible:outline-accent/70.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
2321410 to
f378ff6
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
df58238 to
295bacf
Compare
295bacf to
45afe15
Compare
Closes #530
Examples:
https://npmxdev-git-fork-wojtekmaj-dev-dependency-suggestion-npmx.vercel.app/package/@types/react
https://npmxdev-git-fork-wojtekmaj-dev-dependency-suggestion-npmx.vercel.app/package/vite-tsconfig-paths