- Notifications
You must be signed in to change notification settings - Fork235
dart-lang/pub
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Pub is the package manager for Dart.
Thanks for being interested in contributing to pub! Contributing to a newproject can be hard: there's a lot of new code and practices to learn. Thisdocument is intended to get you up and running as quickly as possible. Formore information, see thepub tool documentation.
The first step towards contributing is to contact the pub dev team and let usknow what you're working on, so we can be sure not to start working on the samething at the same time. Open anissueletting us know that you're interested in contributing and what you plan on working on.This will also let us give you specific advice about where to start.
Pub isn't a package, but it's organized like one. It has four top-leveldirectories:
lib/contains the implementation of pub. Currently, it's all inlib/src/,since there are no libraries intended for public consumption.test/contains the tests for pub.bin/containspub.dart, the entrypoint script that's run whenever a usertypes "pub" on the command line or runs it in the Dart editor. This is usuallyrun through shell scripts insdk/binat the root of the Dart repository.
It's probably easiest to start diving into the codebase by looking at aparticular pub command. Each command is encapsulated in files inlib/src/command/.
To run pub from the Git repository, run:
dart bin/pub.dartBefore any change is made to pub, all tests should pass. To run a pub test, run:
dart tool/test.dart test/path/to_test.dartTo run all tests at once, run:
dart tool/test.dartChanges to pub should be accompanied by one or more tests that exercise the newfunctionality. When adding a test, the best strategy is to find a similar testintest/ and follow the same patterns.
Pub tests come in two basic forms. The first, which is usually used to unit testclasses and libraries internal to pub, has many tests in a single file. This isused when each test will take a short time to run. For example,test/version_test.dart contains unit tests for pub's Version class.
The other form, used by most pub tests, is usually used for integration tests ofuser-visible pub commands. Each test has a file to itself, which is named afterthe test description. This is used when tests can take a long time to run toavoid having the tests time out when running on the build bots. For example,tests/get/hosted/get_transitive_test.dart tests the resolution of transitivehosted dependencies when usingdart pub get/flutter pub get.
All patches to official Dart packages, including to pub, need to undergo codereview before they're submitted. The full process for putting up your patch forreview isdocumented elsewhere.
About
The pub command line tool
Resources
License
Code of conduct
Contributing
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.