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

Some way to view output of build commands 💡 #36

Closed sambeevors closed 4 years ago

sambeevors commented 4 years ago

I'd love to be able to get some kind of output file when I run build commands, maybe something like output.json which just shows the build output in a JSON tree

{
    "folders": {
        "emails": {
            "folders": {
                "folder_1": {
                    "folders": {},
                    "files": [
                        "email_1.html",
                        "email_2.html"
                    ]
                },
                "folder_2": {
                    "folders": {},
                    "files": [
                        "email_1.html",
                        "email_2.html",
                        "email_3.html"
                    ]
                }
            }
        },
        "css": {
            "folders": {},
            "files": [
                "extra.css",
                "main.css"
            ]
        }
    }
}

My particular use case is to take the build output, and attach a frontend on to it so admins can preview / approve emails before they are sent. There may be a way to do this already that I'm missing, but after scouring the docs and config files I couldn't find a solution.

Thanks for your work on this, Maizzle is great 🙌🏻

cossssmin commented 4 years ago

Hi Sam,

Check out the event listeners in Jigsaw - afterBuild gives you a list of output file paths.

Note: I'll be focusing exclusively on Maizzle.js in the future, so the Jigsaw/PHP version won't get any new features. There isn't an afterBuild event yet in Maizzle.js, so I'll look into adding that 👍

sambeevors commented 4 years ago

Thanks @cossssmin !