@restorecommerce/handlebars-helperized 0.1.16 → 0.1.19
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/CHANGELOG.md +27 -0
- package/lib/index.d.ts +2 -2
- package/package.json +11 -11
- package/src/index.ts +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.1.19](https://github.com/restorecommerce/handlebars-helperized/compare/@restorecommerce/handlebars-helperized@0.1.18...@restorecommerce/handlebars-helperized@0.1.19) (2022-05-16)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @restorecommerce/handlebars-helperized
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.1.18](https://github.com/restorecommerce/handlebars-helperized/compare/@restorecommerce/handlebars-helperized@0.1.17...@restorecommerce/handlebars-helperized@0.1.18) (2022-02-22)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @restorecommerce/handlebars-helperized
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [0.1.17](https://github.com/restorecommerce/handlebars-helperized/compare/@restorecommerce/handlebars-helperized@0.1.16...@restorecommerce/handlebars-helperized@0.1.17) (2022-02-15)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* **handlebars-helperized:** made layout, style, opts and customhelpers as optional parameters ([a4e3f6d](https://github.com/restorecommerce/handlebars-helperized/commit/a4e3f6d8879f5f6581ab8cac27c8fa3f588a231c))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
## [0.1.16](https://github.com/restorecommerce/handlebars-helperized/compare/@restorecommerce/handlebars-helperized@0.1.15...@restorecommerce/handlebars-helperized@0.1.16) (2022-02-14)
|
|
7
34
|
|
|
8
35
|
**Note:** Version bump only for package @restorecommerce/handlebars-helperized
|
package/lib/index.d.ts
CHANGED
|
@@ -7,9 +7,9 @@ declare class Renderer {
|
|
|
7
7
|
@param {Array} customHelpersList contains a list of custom helpers (optional)
|
|
8
8
|
*/
|
|
9
9
|
hbs: any;
|
|
10
|
-
style: string;
|
|
10
|
+
style: string | undefined;
|
|
11
11
|
template: any;
|
|
12
|
-
constructor(template: string, layout
|
|
12
|
+
constructor(template: string, layout?: string | undefined, style?: string | undefined, opts?: object | undefined, customHelpersList?: any);
|
|
13
13
|
/**
|
|
14
14
|
@param {Object} context: required data for the placeholders
|
|
15
15
|
@return {String} html
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@restorecommerce/handlebars-helperized",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"description": "Opinionated handlebars based templating engine for rendering e-mail like content",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -27,25 +27,25 @@
|
|
|
27
27
|
"numbro": "^2.3.6"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@types/lodash": "^4.14.
|
|
31
|
-
"@types/mocha": "^9.1.
|
|
32
|
-
"@types/node": "^17.0.
|
|
30
|
+
"@types/lodash": "^4.14.182",
|
|
31
|
+
"@types/mocha": "^9.1.1",
|
|
32
|
+
"@types/node": "^17.0.33",
|
|
33
33
|
"@types/nodemailer": "^6.4.4",
|
|
34
34
|
"@types/nodemailer-html-to-text": "^3.1.0",
|
|
35
35
|
"@types/nodemailer-stub-transport": "^1.1.5",
|
|
36
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
37
|
-
"@typescript-eslint/eslint-plugin-tslint": "^5.
|
|
38
|
-
"@typescript-eslint/parser": "^5.
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "^5.23.0",
|
|
37
|
+
"@typescript-eslint/eslint-plugin-tslint": "^5.23.0",
|
|
38
|
+
"@typescript-eslint/parser": "^5.23.0",
|
|
39
39
|
"assert": "^2.0.0",
|
|
40
40
|
"coveralls": "^3.1.1",
|
|
41
|
-
"eslint": "^8.
|
|
41
|
+
"eslint": "^8.15.0",
|
|
42
42
|
"eslint-plugin-prefer-arrow-functions": "^3.1.4",
|
|
43
43
|
"is-generator": "^1.0.3",
|
|
44
|
-
"mocha": "^
|
|
44
|
+
"mocha": "^10.0.0",
|
|
45
45
|
"npm-run-all": "^4.1.5",
|
|
46
46
|
"nyc": "^15.1.0",
|
|
47
47
|
"should": "^13.2.3",
|
|
48
|
-
"typescript": "^4.
|
|
48
|
+
"typescript": "^4.6.4"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"lint": "eslint src --ext .ts ",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">= 8.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "ec10625052f498dc6cd83f340b26e18ffdf9a6eb"
|
|
64
64
|
}
|
package/src/index.ts
CHANGED
|
@@ -7,7 +7,7 @@ const defaultOpts = {
|
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
// Initializes and configures a custom handlebars instance
|
|
10
|
-
const init = (options: object, customHelpersList: any) => {
|
|
10
|
+
const init = (options: object | undefined, customHelpersList: any) => {
|
|
11
11
|
// default values if nothing given
|
|
12
12
|
const opts = defaults(options, defaultOpts);
|
|
13
13
|
// the basic building block is the handlebars rendering engine
|
|
@@ -22,7 +22,7 @@ const init = (options: object, customHelpersList: any) => {
|
|
|
22
22
|
if (customHelpersList) {
|
|
23
23
|
for (let customHelper of customHelpersList) {
|
|
24
24
|
const filePath = customHelper;
|
|
25
|
-
require(filePath)
|
|
25
|
+
require(filePath)(hbs, opts);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
// extend rendering with layout functionality
|
|
@@ -41,10 +41,10 @@ class Renderer {
|
|
|
41
41
|
*/
|
|
42
42
|
|
|
43
43
|
hbs: any;
|
|
44
|
-
style: string;
|
|
44
|
+
style: string | undefined;
|
|
45
45
|
template: any;
|
|
46
46
|
|
|
47
|
-
constructor(template: string, layout
|
|
47
|
+
constructor(template: string, layout?: string | undefined, style?: string | undefined, opts?: object | undefined, customHelpersList?: any) {
|
|
48
48
|
this.hbs = init(opts, customHelpersList);
|
|
49
49
|
this.style = style;
|
|
50
50
|
if (layout) {
|