You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the new v4 CLI, I found that the messages being shown when using the CLI (or lack thereof) made it difficult to understand what what happening. For example:
This works as expected and creates an HTML version of my template:
When running both of these commands, neither one showed any sort of logging. After looking at #1014, I saw @iRyusa state that the CLI does not create the dist folder to avoid issues, but anyone else running this command would be unable to determine why both commands aren't working. I think it's important to follow the example set by large CLIs like create-react-app (CRA) that show progress of the CLI operations, or at the very least a meaningful error or success message. For example, CRA uses the following success and fail messages when trying to create a new project (which could be analogous to transpiling from MJML to HTML):
Success Case
Fail Case
In the scenario I described above for the MJML CLI, I think messages like this should be included (at the very least):
Success Case
Compiled MJML template to /path/to/my-template.html
Fail Case
Error! Failed to compile MJML template. Directory /path/to/dist does not exist.
MJML version:
v4.0.2
The text was updated successfully, but these errors were encountered:
On this particular case, we've added a message in cli to warn you that output directory doesn't exist.
I'm not against a "verbose" mode/option for the cli, but default output should stick to the strict minimum, because some existing connectors in MJML ecosystem (ex: some ruby gems) interact directly with stdout.
Thanks for your reply @iRyusa. That makes perfect sense why you would want to keep logging to a minimum.
Is the message you mentioned adding in v4.0.2? I was not seeing a message when using the command mjml ./src/templates/my-template.mjml -o ./dist/my-template.html when ./dist did not exist, which prompted me to post the issue.
Issue
When running the new v4 CLI, I found that the messages being shown when using the CLI (or lack thereof) made it difficult to understand what what happening. For example:
This works as expected and creates an HTML version of my template:
while this doesn't work:
When running both of these commands, neither one showed any sort of logging. After looking at #1014, I saw @iRyusa state that the CLI does not create the
dist
folder to avoid issues, but anyone else running this command would be unable to determine why both commands aren't working. I think it's important to follow the example set by large CLIs like create-react-app (CRA) that show progress of the CLI operations, or at the very least a meaningful error or success message. For example, CRA uses the following success and fail messages when trying to create a new project (which could be analogous to transpiling from MJML to HTML):Success Case
Fail Case
In the scenario I described above for the MJML CLI, I think messages like this should be included (at the very least):
Success Case
Fail Case
MJML version:
v4.0.2
The text was updated successfully, but these errors were encountered: