Skip to content

Latest commit

 

History

History
82 lines (51 loc) · 2.95 KB

DEVELOPMENT.md

File metadata and controls

82 lines (51 loc) · 2.95 KB

Development

Development install

  1. Clone this repo in your development environment
  2. Run composer install

Install for development within a Laravel app

  1. Remove any existing directory vendor/kontenta/kontour
  2. Install the package from git using composer install --prefer-source
  3. Run cd vendor/kontenta/kontour and composer install to install dependencies within the package.

Testing

composer test from the project directory will run the default test suite containing all tests.

composer test -- --testsuite=Feature will run the Feature tests only.

composer test -- --testsuite=Dusk will run the Dusk tests only.

composer test -- --filter=... will pass through options to phpunit.

composer report will run the tests and generate coverage reports. Note: You need to have Xdebug installed to test coverage.

If you want your own local configuration for phpunit, copy the file phpunit.xml.dist to phpunit.xml and modify the latter to your needs.

Test logs

Any Laravel log messages generated during testing can be found in the vendor/orchestra/testbench-dusk/laravel/storage/logs directory.

Testing with different versions

GitHub Actions is set up to run tests against relevant PHP and Laravel versions. See run-tests.yml for details.

  • composer update --prefer-lowest can be used before running tests for testing backwards compatibility.
  • composer show -D -o can be used to check how far behind latest version the currently installed dependencies are.
  • composer update will install the latest versions of dependencies.

Troubleshooting tests

Chrome versions

If tests report wrong Chrome versions, run ./vendor/bin/dusk-updater detect --auto-update to set it right before running tests again.

Following PSR2

This project can be checked against configured coding standards using composer phpcs from the project directory.

Automatic attempt to fix some reported coding standard violations can be run with ./vendor/bin/phpcbf from the project directory.

Building assets

We're using Laravel Mix for building assets. You can find the build script in webpack.mix.js, run npm install to get started.

  • npm run dev will run a development build
  • npm run watch will watch files for changes and run development builds
  • npm run production will build assets for release

Testing assets within a Laravel app

If you're editing and building assets within a repo in the vendor folder of a real Laravel app, running this command will publish the updated styles:

php artisan vendor:publish --tag="kontour-styling" --force

Or you can softlink the generated css file of this package from your public css directory.

Release new version

Releases are handled through the GitHub releases interface.