GithubHelp home page GithubHelp logo

computmaxer / pub Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dart-lang/pub

0.0 2.0 0.0 3.96 MB

The package manager for Dart

Home Page: https://pub.dartlang.org

License: BSD 3-Clause "New" or "Revised" License

Dart 100.00%

pub's Introduction

Pub is the package manager for Dart.

Contributing to pub

Thanks for being interested in contributing to pub! Contributing to a new project can be hard: there's a lot of new code and practices to learn. This document is intended to get you up and running as quickly as possible. If you're looking for documentation on using pub, try dartlang.org.

The first step towards contributing is to contact the pub dev team and let us know what you're working on, so we can be sure not to start working on the same thing at the same time. Just send an email to [email protected] letting 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.

Organization

Pub isn't a package, but it's organized like one. It has four top-level directories:

  • lib/ contains the implementation of pub. Currently, it's all in lib/src/, since there are no libraries intended for public consumption.

  • test/ contains the tests for pub.

  • bin/ contains pub.dart, the entrypoint script that's run whenever a user types "pub" on the command line or runs it in the Dart editor. This is usually run through shell scripts in sdk/bin at the root of the Dart repository.

It's probably easiest to start diving into the codebase by looking at a particular pub command. Each command is encapsulated in files in lib/src/command/.

Running pub

To run pub from the Git repository, run:

dart bin/pub.dart

Testing pub

Before any change is made to pub, all tests should pass. To run a pub test, run:

dart test/path/to/pub_test.dart

To run all tests at once, run:

pub run test

Some pub tests require specific versions of other packages. These packages are included in the repository as Git submodules. To get them, run:

git submodule update --init

Changes to pub should be accompanied by one or more tests that exercise the new functionality. When adding a test, the best strategy is to find a similar test in test/ and follow the same patterns. Note that pub makes wide use of the scheduled_test package in its tests, so it's usually important to be familiar with that when adding tests.

Pub tests come in two basic forms. The first, which is usually used to unit test classes and libraries internal to pub, has many tests in a single file. This is used 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 of user-visible pub commands. Each test has a file to itself, which is named after the test description. This is used when tests can take a long time to run to avoid having the tests time out when running on the build bots. For example, tests/get/hosted/get_transitive_test.dart tests the resolution of transitive hosted dependencies when using pub get.

Landing your patch

All patches to official Dart packages, including to pub, need to undergo code review before they're submitted. The full process for putting up your patch for review is documented elsewhere.

pub's People

Contributors

amouravski avatar cbracken avatar crelier avatar dgrove avatar efortuna avatar floitschg avatar gramster avatar iposva-google avatar johnniwinther avatar karlklose avatar keertip avatar kevmoo avatar lrhn avatar madsager avatar mhausner avatar mkustermann avatar munificent avatar nex3 avatar peter-ahe-google avatar pq avatar rakudrama avatar ricowind avatar rmacnak-google avatar scheglov avatar sethladd avatar sgjesse avatar sigmundch avatar srawlins avatar szakarias avatar whesse avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.