ActiveCampaign / postmark-cli

The official CLI tool for Postmark
https://postmarkapp.com
MIT License
79 stars 9 forks source link

Layout support #8

Closed derekrushforth closed 5 years ago

derekrushforth commented 5 years ago

Hey @ibalosh and @matt-west,

This pull request adds layout support to our templates pull and templates push commands. Looking for whatever feedback you guys have about the code and changes to the workflow. I'd love to release this by EOD Thursday (6/27).

templates pull

The folder structure downloaded from this command is a little different now. Templates and layouts are now organized into separate folders:

my-emails
├── layouts
│   └── plain
│       ├── content.html
│       ├── content.txt
│       └── meta.json
└── templates
    ├── password-reset
    │   ├── content.html
    │   ├── content.txt
    │   └── meta.json
    └── welcome
        ├── content.html
        └── meta.json

Changes to meta.json There are a couple minor differences between the meta.json files for templates versus layouts.

templates push

This command now requires that the directory structure matches what you see above. Since this is a breaking change for anybody using the old version, I've bumped the major to 2.0.0.

Here's what pushing a template looks like now:

Screen Shot 2019-06-25 at 11 26 56 AM

Tests

I've modified the tests a bit so they work with the new folders. The tests for the pull command also now check for an empty layout directory. This was only so I could get the tests to pass for now.

@ibalosh, can you tweak these so that we account for layouts on the test server?

cc @rianvdm

ibalosh commented 5 years ago

@derekrushforth added base tests which should be good for release, for stuff like pulling layouts, pushing them with changes, etc

derekrushforth commented 5 years ago

Hey folks,

I've updated the workflow based on the feedback. Here's a rundown:

Let me know what you guys think. If we're good, please approve the PR.