Closed derekrushforth closed 5 years ago
@derekrushforth added base tests which should be good for release, for stuff like pulling layouts, pushing them with changes, etc
Hey folks,
I've updated the workflow based on the feedback. Here's a rundown:
TemplateType
is now determined by what's specified in meta.json
, instead of assuming based on the folder structuremeta.json
file and either HTML or Text content files are present in the same folder, it's good._layouts
folder and standard templates will remain in the root directory. This is so that we do not introduce breaking changes. The only caveat is that we are not doing anything to detect whether the user has a custom folder structure. If you pull, then make major changes to your structure, then pull again, it's going to use our default structure. I'll look into introducing this as a separate feature release.
my-emails
├── _layouts
│ └── plain
│ ├── content.html
│ ├── content.txt
│ └── meta.json
└── password-reset
│ ├── content.html
│ ├── content.txt
│ └── meta.json
└── welcome
├── content.html
└── meta.json
Let me know what you guys think. If we're good, please approve the PR.
Hey @ibalosh and @matt-west,
This pull request adds layout support to our
templates pull
andtemplates 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:
Changes to meta.json There are a couple minor differences between the meta.json files for templates versus layouts.
LayoutTemplate
that lets people specify the layout alias being used for that particular standard template. It's not required. If users don't include this in thepush
command, we simply insertLayoutTemplate: null
into the API request. This ensures that the layout is not changed at all. If you want to remove the layout being used on a template completely, pass an empty string toLayoutTemplate
. This is how our public API works.Name
andAlias
are required. Does not include theSubject
field.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:
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