DEV Community


Discussion on: How to make an open-source library ?

aleksikauppila profile image
Aleksi Kauppila • Edited

Sort of a broad question but let's tackle at least a few issues.

In case of PHP:

Start a project using composer

mkdir myproject
cd myproject
composer init
// answer questions

In case of license, figure out what suits your project best. Check licenses.

Write code. A lot depends on your use case. What do you want to build? An application? A library? Add dependencies accordingly with Composer. Have good test coverage if you want your code to be reliable.

Tag releases accordingly using your version control system. Use semantic versioning

Publish in Github and packagist