OpendataCH / Transport

Swiss public transport API
http://transport.opendata.ch/
MIT License
243 stars 50 forks source link

Decouple the lib from the app #155

Open maidmaid opened 7 years ago

maidmaid commented 7 years ago

To ensure a better use of your great work in the community, why not create a new OpendataCH/TransportLib project that hosts only the library?

fabian commented 7 years ago

I can't see a huge advantage in that, as you can already use this project as a library, there isn't much code related to the app.

maidmaid commented 7 years ago

The main huge advantage is to have a lib with a low level of dependency, by removing dependencies from the Silex app.

Example: currently, if I want to require opendatach/transport in an existing Symfony Standard app, Twig 1.x dependency will be used. With a decoupling, I could use Twig 2.x in my project because Twig will no longer be a dependency of decoupled lib itself but only of the Silex app.

fabian commented 7 years ago

True, the dependencies are an argument. Will think about it.

maidmaid commented 7 years ago

You should keep this repo as main repo that hosts the library, and create for example an opendatach/transport-api that hosts API. In this way, people that used this repo as library will can continue to use this repo.

fabian commented 7 years ago

Could we solve this by moving silex/silex and twig/twig from require to require-dev in composer.json?

maidmaid commented 7 years ago

Partially. It solves dependencies problem when this package is used as dependancy of an other projet, but it will no longer be possible to install this app with --no-dev composer option (often used in production deployment for optimization purposes) when this package is used as an out-of-the-box application.