Skip to content

Commit bcce3fe

Browse files
author
Guillaume Badi
committed
Merge pull request #11 from mjmlio/cli-fix
Cli fix
2 parents fa0e791 + bd4af92 commit bcce3fe

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mjml",
3-
"version": "1.0.0",
3+
"version": "1.0.2",
44
"description": "MJML: the only framework that makes responsive-email easy",
55
"main": "./lib/mjml",
66
"scripts": {

src/cli.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { tidy as htmltidy } from 'htmltidy'
44
import mjmlEngine from './index'
55
import { version as VERSION } from '../package.json'
66

7+
const engine = mjmlEngine.mjml2html
8+
79
/*
810
* The version number is the NPM
911
* version number. It should be the same as the MJML engine
@@ -68,6 +70,7 @@ const createComponent = (name, ending) => {
6870

6971
return `
7072
import React, { Component } from 'react'
73+
import _ from 'loadash'
7174
import {
7275
MJMLColumnElement,
7376
elements,
@@ -78,7 +81,7 @@ import {
7881
* Wrap your dependencies here.
7982
*/
8083
const {
81-
${lowerName}: Mj${name},
84+
text: MjText,
8285
} = elements;
8386
8487
const NAME = '${lowerName}'
@@ -128,6 +131,7 @@ class ${name} extends Component {
128131
}
129132
}
130133
134+
registerElement('${lowerName}', ${name}${ending ? ', true' : ''})
131135
export default ${name}
132136
`
133137
}

src/mjml.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
import binary from 'commander'
44
import mjmlEngine from './index'
5-
import mjmlCLI from './cli'
6-
7-
const engine = mjmlEngine.mjml2html
5+
import mjmlCLI from './cli'
86

97
/*
108
* If require.main

0 commit comments

Comments
 (0)