maizzle / maizzle-php

Jigsaw-based PHP build system for rapid HTML email development with Tailwind CSS.
https://jigsaw.maizzle.com
MIT License
304 stars 6 forks source link

Consider adding to Packagist #4

Closed simonhamp closed 5 years ago

simonhamp commented 6 years ago

If you set up the composer.json file sufficiently to add to Packagist, PHP/Composer users will be able to install with a single command, e.g.:

composer create-project ThemeMountain/maizzle ./my-maizzle-app

That will take care of downloading the latest tagged version of the repo and installing Composer dependencies in one step.

cossssmin commented 6 years ago

Hi Simon,

I'm not really sure how to go about this. I mean yes, it would be great if people could just create-project, but I'm not clear about two things:

  1. Updating

    composer update, from my understanding, would only update dependencies - in this case, Jigsaw. So in order to get Maizzle updates, one would still need to either manually add changes to files, or create a new project that will pull in the latest tagged release.

  2. Using Maizzle as a dependency

    Adding to Packagist would make people think they could use Maizzle as a dependency in their project. However, all work is done inside the source directory, which would be in fact added under vendor. This can't work, because (a) you gitignore that folder and (b) any composer update will wipe out your work, obviously.

I'd love to make it easier for people to install and get started with Maizzle (and I'm open to ideas), but I can't see how it could work properly through Packagist. I'll admit my PHP knowledge is limited, so maybe I'm missing something?

Thanks!

simonhamp commented 6 years ago

You're right and those are important considerations.

I'd actually approach it in a combined fashion, similar to other projects that have the same issue (Laravel etc), where the actual core of Maizzle would be a package (see laravel/framework) and you have a separate project that is your skeleton that brings everything together (see laravel/laravel).

That way you get the best of both.

As you rightly identified, there would be some work needed to map the source directory to a new location, but I believe this is achievable and will still work as intended.

This might also open up the possibility of Maizzle becoming a dependency of other projects rather than it having to be a project of its own. I already have a use-case for it in this scenario so I may be able to explore extracting it out.

cossssmin commented 6 years ago

Thanks Simon, appreciate the input 👍

I'll think about how this can be split considering both Jigsaw and the Webpack/NPM side of things - it's not just about source, there are other configs to consider as well. In the meanwhile, it would be awesome to get some feedback from @damiani too. Keith? 😀

damiani commented 6 years ago

I can't think of an immediate reason why this wouldn't work, though you'd need to re-map the source and build directories to be in the project root somewhere, merge in a user-editable config.php at build time (since Jigsaw's config.php will be buried in vendor), and set up your own npm scripts. It just might work :)

pmochine commented 6 years ago

I don't want to open an issue, but man really good work! Just found about your package!

cossssmin commented 5 years ago

Considering tightenco/jigsaw#284 (+ other Laravel collisions), and the fact that a Node.js-only version of Maizzle is in the works (will be on NPM), I think it's best to keep this Jigsaw version of Maizzle as a project.

I will continue maintaining/updating it, but will not look into adding it to Packagist anymore.