Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Getting started with Package development

Getting started with Package development

Beginner and intermediate hints to increase the credibility of your package. Presented for #laraconeu 2014 in Amsterdam.

Hannes Van De Vreken

August 28, 2014
Tweet

More Decks by Hannes Van De Vreken

Other Decks in Technology

Transcript

  1. REQUIRED STEPS - COMPOSER ! / |-- src | |--

    Foo.php | +-- Bar.php |-- tests | |-- FooTest.php | +-- BarTest.php +-- composer.json
  2. • git tag • version number • message • signed

    with identity • ref REQUIRED STEPS - VERSIONING - GIT
  3. • Prove your code • Prove other people’s code •

    Documentation RECOMMENDED - TESTING - REASONS
  4. • Custom mocks • Only test your own code •

    Keep it simple RECOMMENDED - TESTING - PITFALLS
  5. language: php php: - 5.4 - 5.5 - 5.6 -

    hhvm before_script: - composer self-update - composer install --prefer-source --dev script: - phpunit
  6. { "status": "success", "context": "continuous-integration/travis-ci", "description": "The Travis CI build

    passed", "target_url": "https://travis-ci.org/username/ repo/builds/12345678" } RECOMMENDED - TESTING - TRAVIS
  7. { "name": "vendor/package", "description": "short desc", "license": "MIT", "type": "library",

    "autoload": { "psr-4": { "Vendor\\Package\\": "src/" } }, "require-dev": { "satooshi/php-coveralls": "0.6.*" } }
  8. language: php php: - 5.4 - 5.5 - 5.6 -

    hhvm before_script: - composer self-update - composer install --prefer-source --dev script: - phpunit --coverage-clover build/logs/clo after_success:
 - php vendor/bin/coveralls -v
  9. FRAMEWORK SUPPORT - LARAVEL - ARTISAN • config:publish • asset:publish

    • view:publish • migrate --package="vendor/pack"
  10. • Publishing is easy • Document your packages • I

    want you to develop packages RECAP
  11. • https:/ /youtu.be/jV4iPSHbonk • https:/ /getcomposer.org • http:/ /www.php-fig.org/psr/psr-4/ •

    https:/ /packagist.org/statistics • http:/ /git-scm.com/book/en/Git-Basics-Tagging • https:/ /travis-ci.org • https:/ /coveralls.io • https:/ /developer.github.com/v3/repos/statuses • https:/ /shields.io • http:/ /laravel.com/docs/packages • https:/ /github.com/orchestral/testbench REFERENCES