Show dart pub add --dev for development-only packages
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start by locating the Install tab implementation and the package metadata used to generate its commands. Review how package authors could indicate development-only usage and confirm the supported dart pub add syntax; done means the generated instructions use the development form for marked packages while regular packages remain unchanged.
Written by the indexing model from the issue text.
Description
Summary
Some packages are intended to be used only as development dependencies, such as code generators, linters, and testing tools.
However, the Install tab on pub.dev always generates a regular install command, for example:
dart pub add build_runner
This can mislead users into adding development-only packages to dependencies instead of dev_dependencies.
Examples
Examples of packages that are typically added as development dependencies:
build_runnerflutter_lintstestriverpod_generator
For these packages, the recommended command would instead be:
dart pub add dev:build_runner
(or the equivalent command for the current supported syntax).
Proposal
Allow package authors to indicate that a package is intended to be installed as a development dependency.
pub.dev could then generate the appropriate install command automatically for those packages.
This would only affect the generated installation instructions and would not prevent users from installing the package as a regular dependency if they intentionally choose to do so.
Motivation
Many beginners simply copy and paste the generated command from the Install tab.
Providing the recommended command would help users follow best practices and reduce accidental misuse of development-only packages.
- Dominant language
- Dart
- Stars
- 944
- Forks
- 183
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 85
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dart-lang/pub-dev
-
Type: enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Type: enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
Migrate to Jaspr?Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
dart-lang/pub-dev#9731 · 2 reactions ·
Maintainers usually reply within 1 day
-
Optimize queryOpenType: enhancement
Difficulty 4/5 3-5 days Newbie friendliness 30/100
dart-lang/pub-dev#9652 · 1 comment ·
Maintainers usually reply within 1 day
-
Epic
Difficulty 5/5 Over a week Newbie friendliness 20/100
Maintainers usually reply within 1 day
All issues in dart-lang/pub-dev
Similar issues
-
bug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
AOSSIE-Org/Ell-ena#356 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
espresso3389/pdfrx#776 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
MostroP2P/app#881 · 1 comment ·
Maintainers usually reply within 1 day
-
[기능 제안]Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
atsign-foundation/at_server#2896 ·
Maintainers usually reply within 1 day