ecto 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/engines/handlebars.js +1 -1
- package/dist/engines/handlebars.js.map +1 -1
- package/package.json +10 -11
package/README.md
CHANGED
|
@@ -362,9 +362,9 @@ We are using [Markdoc](https://markdoc.io/) which has a ton of powerful features
|
|
|
362
362
|
|
|
363
363
|
#### Handlebars
|
|
364
364
|
|
|
365
|
-
In Ecto we use the [handlebars](https://www.npmjs.com/package/handlebars
|
|
365
|
+
In Ecto we use the [handlebars](https://www.npmjs.com/package/handlebars) engine to render `mustache` related templates. This is because handlebars is based on mustache with just more additional features.
|
|
366
366
|
|
|
367
|
-
Handlebars is a fantastic template engine, and we've incorporated helpers to make it even better. We added in [handlebars
|
|
367
|
+
Handlebars is a fantastic template engine, and we've incorporated helpers to make it even better. We added in [helpers-for-handlebars](https://github.com/jaredwray/helpers-for-handlebars) so you can format dates, and more. Here is an example using `Handlebars Helpers` in your template:
|
|
368
368
|
|
|
369
369
|
```javascript
|
|
370
370
|
const ecto = Ecto();
|
|
@@ -570,9 +570,9 @@ The way Handlebars works can be summarized as follows:
|
|
|
570
570
|
2. This function is then executed by passing a JSON object as an argument. This JSON object is known as context and it contains the values of the variables used in the template.
|
|
571
571
|
3. On its execution, the function returns the required HTML after replacing the variables of the template with their corresponding values.
|
|
572
572
|
|
|
573
|
-
In Ecto, we use the [Handlebars](https://www.npmjs.com/package/handlebars
|
|
573
|
+
In Ecto, we use the [Handlebars](https://www.npmjs.com/package/handlebars) engine to render mustache-related templates.
|
|
574
574
|
|
|
575
|
-
Handlebars is a fantastic template engine, and we've incorporated helpers to make it even better. We added in [handlebars
|
|
575
|
+
Handlebars is a fantastic template engine, and we've incorporated helpers to make it even better. We added in [helpers-for-handlebars](https://github.com/jaredwray/helpers-for-handlebars) so you can format dates, and more. Here is an example using Handlebars Helpers in your template:
|
|
576
576
|
|
|
577
577
|
|
|
578
578
|
```javascript
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Handlebars = void 0;
|
|
4
4
|
const baseEngine_1 = require("../baseEngine");
|
|
5
5
|
const handlebars = require("handlebars");
|
|
6
|
-
const helpers = require("handlebars
|
|
6
|
+
const helpers = require("helpers-for-handlebars");
|
|
7
7
|
const fs = require("fs-extra");
|
|
8
8
|
const _ = require("underscore");
|
|
9
9
|
class Handlebars extends baseEngine_1.BaseEngine {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlebars.js","sourceRoot":"","sources":["../../src/engines/handlebars.ts"],"names":[],"mappings":";;;AAAA,8CAA2C;AAC3C,yCAAyC;AACzC,
|
|
1
|
+
{"version":3,"file":"handlebars.js","sourceRoot":"","sources":["../../src/engines/handlebars.ts"],"names":[],"mappings":";;;AAAA,8CAA2C;AAC3C,yCAAyC;AACzC,kDAAkD;AAClD,+BAA+B;AAC/B,gCAAgC;AAEhC,MAAa,UAAW,SAAQ,uBAAU;IAItC,YAAY,IAAY;QACpB,KAAK,EAAE,CAAC;QAHL,iBAAY,GAAW,WAAW,CAAC;QAKtC,IAAI,CAAC,KAAK,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QACxC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;QAEzB,IAAI,CAAC,aAAa,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAAa,EAAE,IAAY;QAEpC,mBAAmB;QACnB,IAAG,IAAI,CAAC,gBAAgB,EAAE;YACtB,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,gBAAgB,GAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SAClE;QAED,OAAO,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAAC;QACpC,IAAI,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAErD,IAAI,MAAM,GAAG,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QACvC,MAAM,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAE5B,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,gBAAgB,CAAC,YAAmB;QAChC,IAAI,MAAM,GAAG,KAAK,CAAC;QACnB,IAAG,EAAE,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE;YAChC,IAAI,QAAQ,GAAG,EAAE,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;YAE5C,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;gBACjB,IAAI,MAAM,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;gBAChE,IAAI,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gBAE3B,IAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,SAAS,EAAE;oBACxC,UAAU,CAAC,eAAe,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;iBAChE;YAEL,CAAC,CAAC,CAAC;YACH,MAAM,GAAG,IAAI,CAAC;SACjB;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAjDD,gCAiDC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ecto",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Modern Template Consolidation Engine for EJS, Markdown, Pug, Nunjucks, and Handlebars",
|
|
5
5
|
"main": "./dist/ecto.js",
|
|
6
6
|
"types": "./dist/ecto.d.ts",
|
|
7
|
-
"type": "module",
|
|
8
7
|
"repository": "https://github.com/jaredwray/ecto.git",
|
|
9
8
|
"author": "Jared Wray <me@jaredwray.com>",
|
|
10
9
|
"license": "MIT",
|
|
@@ -36,32 +35,32 @@
|
|
|
36
35
|
"build": "rm -rf ./dist && npm i && npm run test && npm run compile"
|
|
37
36
|
},
|
|
38
37
|
"dependencies": {
|
|
39
|
-
"@markdoc/markdoc": "^0.1.
|
|
38
|
+
"@markdoc/markdoc": "^0.1.4",
|
|
40
39
|
"ejs": "^3.1.8",
|
|
41
40
|
"fs-extra": "^10.1.0",
|
|
42
41
|
"handlebars": "^4.7.7",
|
|
43
|
-
"handlebars-helpers": "^0.10.0",
|
|
44
42
|
"helper-date": "^1.0.1",
|
|
45
|
-
"
|
|
43
|
+
"helpers-for-handlebars": "https://github.com/jaredwray/helpers-for-handlebars",
|
|
44
|
+
"liquidjs": "^9.39.1",
|
|
46
45
|
"nunjucks": "^3.2.3",
|
|
47
46
|
"pug": "^3.0.2",
|
|
48
47
|
"underscore": "^1.13.4",
|
|
49
|
-
"winston": "^3.
|
|
48
|
+
"winston": "^3.8.1"
|
|
50
49
|
},
|
|
51
50
|
"devDependencies": {
|
|
52
51
|
"@types/ejs": "^3.1.1",
|
|
53
52
|
"@types/express": "^4.17.13",
|
|
54
53
|
"@types/fs-extra": "^9.0.13",
|
|
55
54
|
"@types/handlebars-helpers": "^0.5.3",
|
|
56
|
-
"@types/jest": "^28.1.
|
|
55
|
+
"@types/jest": "^28.1.6",
|
|
57
56
|
"@types/marked": "^4.0.3",
|
|
58
|
-
"@types/mustache": "^4.
|
|
57
|
+
"@types/mustache": "^4.2.0",
|
|
59
58
|
"@types/nunjucks": "^3.2.1",
|
|
60
59
|
"@types/pug": "^2.0.6",
|
|
61
60
|
"@types/underscore": "^1.11.4",
|
|
62
|
-
"jest": "^28.1.
|
|
63
|
-
"ts-jest": "^28.0.
|
|
64
|
-
"typescript": "^4.7.
|
|
61
|
+
"jest": "^28.1.3",
|
|
62
|
+
"ts-jest": "^28.0.7",
|
|
63
|
+
"typescript": "^4.7.4"
|
|
65
64
|
},
|
|
66
65
|
"files": [
|
|
67
66
|
"dist",
|