@spinajs/templates-pug 2.0.180 → 2.0.181
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/lib/cjs/index.d.ts +13 -13
- package/lib/cjs/index.js +114 -114
- package/lib/cjs/index.js.map +1 -1
- package/lib/mjs/index.d.ts +13 -13
- package/lib/mjs/index.js +85 -85
- package/lib/mjs/index.js.map +1 -1
- package/lib/tsconfig.cjs.tsbuildinfo +1 -1
- package/lib/tsconfig.mjs.tsbuildinfo +1 -1
- package/package.json +7 -7
package/lib/cjs/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as pugTemplate from 'pug';
|
|
2
|
-
import { TemplateRenderer } from '@spinajs/templates';
|
|
3
|
-
export declare class PugRenderer extends TemplateRenderer {
|
|
4
|
-
protected Options: pugTemplate.Options;
|
|
5
|
-
protected Templates: Map<string, pugTemplate.compileTemplate>;
|
|
6
|
-
protected devMode: boolean;
|
|
7
|
-
constructor();
|
|
8
|
-
get Type(): string;
|
|
9
|
-
get Extension(): string;
|
|
10
|
-
renderToFile(template: string, model: unknown, filePath: string, language?: string): Promise<void>;
|
|
11
|
-
render(templateName: string, model: unknown, language?: string): Promise<string>;
|
|
12
|
-
protected compile(path: string): Promise<void>;
|
|
13
|
-
}
|
|
1
|
+
import * as pugTemplate from 'pug';
|
|
2
|
+
import { TemplateRenderer } from '@spinajs/templates';
|
|
3
|
+
export declare class PugRenderer extends TemplateRenderer {
|
|
4
|
+
protected Options: pugTemplate.Options;
|
|
5
|
+
protected Templates: Map<string, pugTemplate.compileTemplate>;
|
|
6
|
+
protected devMode: boolean;
|
|
7
|
+
constructor();
|
|
8
|
+
get Type(): string;
|
|
9
|
+
get Extension(): string;
|
|
10
|
+
renderToFile(template: string, model: unknown, filePath: string, language?: string): Promise<void>;
|
|
11
|
+
render(templateName: string, model: unknown, language?: string): Promise<string>;
|
|
12
|
+
protected compile(path: string): Promise<void>;
|
|
13
|
+
}
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
-
};
|
|
24
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
-
if (mod && mod.__esModule) return mod;
|
|
26
|
-
var result = {};
|
|
27
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
28
|
-
__setModuleDefault(result, mod);
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
32
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
33
|
-
};
|
|
34
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
-
};
|
|
37
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.PugRenderer = void 0;
|
|
39
|
-
const intl_1 = require("@spinajs/intl");
|
|
40
|
-
const exceptions_1 = require("@spinajs/exceptions");
|
|
41
|
-
const fs = __importStar(require("fs"));
|
|
42
|
-
const pugTemplate = __importStar(require("pug"));
|
|
43
|
-
const path = __importStar(require("path"));
|
|
44
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
45
|
-
const templates_1 = require("@spinajs/templates");
|
|
46
|
-
const configuration_1 = require("@spinajs/configuration");
|
|
47
|
-
const di_1 = require("@spinajs/di");
|
|
48
|
-
const path_1 = require("path");
|
|
49
|
-
let PugRenderer = class PugRenderer extends templates_1.TemplateRenderer {
|
|
50
|
-
constructor() {
|
|
51
|
-
super();
|
|
52
|
-
this.Templates = new Map();
|
|
53
|
-
}
|
|
54
|
-
get Type() {
|
|
55
|
-
return 'pug';
|
|
56
|
-
}
|
|
57
|
-
get Extension() {
|
|
58
|
-
return '.pug';
|
|
59
|
-
}
|
|
60
|
-
async renderToFile(template, model, filePath, language) {
|
|
61
|
-
const content = await this.render(template, model, language);
|
|
62
|
-
const dir = path.dirname(filePath);
|
|
63
|
-
if (!fs.existsSync(dir)) {
|
|
64
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
65
|
-
}
|
|
66
|
-
fs.writeFileSync(filePath, content);
|
|
67
|
-
}
|
|
68
|
-
async render(templateName, model, language) {
|
|
69
|
-
this.Log.trace(`Rendering pug template ${templateName}`);
|
|
70
|
-
this.Log.timeStart(`PugTemplate.render.start.${templateName}`);
|
|
71
|
-
if (!templateName) {
|
|
72
|
-
throw new exceptions_1.InvalidArgument('template parameter cannot be null or empty');
|
|
73
|
-
}
|
|
74
|
-
let fTemplate = null;
|
|
75
|
-
// if in dev mode always compile template
|
|
76
|
-
// so we dont need to reload app manually
|
|
77
|
-
if (!this.Templates.has((0, path_1.normalize)(templateName)) || this.devMode) {
|
|
78
|
-
await this.compile((0, path_1.normalize)(templateName));
|
|
79
|
-
}
|
|
80
|
-
fTemplate = this.Templates.get((0, path_1.normalize)(templateName));
|
|
81
|
-
const lang = language ? language : (0, intl_1.guessLanguage)();
|
|
82
|
-
const tLang = lang ?? (0, intl_1.defaultLanguage)();
|
|
83
|
-
const content = fTemplate(lodash_1.default.merge(model ?? {}, {
|
|
84
|
-
__: (0, intl_1.__translate)(tLang),
|
|
85
|
-
__n: (0, intl_1.__translateNumber)(tLang),
|
|
86
|
-
__l: intl_1.__translateL,
|
|
87
|
-
__h: intl_1.__translateH,
|
|
88
|
-
}));
|
|
89
|
-
const time = this.Log.timeEnd(`PugTemplate.render.start.${templateName}`);
|
|
90
|
-
this.Log.trace(`Rendering pug template ${templateName} ended, (${time} ms)`);
|
|
91
|
-
return Promise.resolve(content);
|
|
92
|
-
}
|
|
93
|
-
async compile(path) {
|
|
94
|
-
const tCompiled = pugTemplate.compileFile(path, this.Options);
|
|
95
|
-
const pNormalized = (0, path_1.normalize)(path);
|
|
96
|
-
if (!tCompiled) {
|
|
97
|
-
throw new exceptions_1.IOFail(`Cannot compile handlebars template ${pNormalized} from path ${path}`);
|
|
98
|
-
}
|
|
99
|
-
this.Templates.set(pNormalized, tCompiled);
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
PugRenderer
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
+
if (mod && mod.__esModule) return mod;
|
|
26
|
+
var result = {};
|
|
27
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
28
|
+
__setModuleDefault(result, mod);
|
|
29
|
+
return result;
|
|
30
|
+
};
|
|
31
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
32
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
33
|
+
};
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.PugRenderer = void 0;
|
|
39
|
+
const intl_1 = require("@spinajs/intl");
|
|
40
|
+
const exceptions_1 = require("@spinajs/exceptions");
|
|
41
|
+
const fs = __importStar(require("fs"));
|
|
42
|
+
const pugTemplate = __importStar(require("pug"));
|
|
43
|
+
const path = __importStar(require("path"));
|
|
44
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
45
|
+
const templates_1 = require("@spinajs/templates");
|
|
46
|
+
const configuration_1 = require("@spinajs/configuration");
|
|
47
|
+
const di_1 = require("@spinajs/di");
|
|
48
|
+
const path_1 = require("path");
|
|
49
|
+
let PugRenderer = class PugRenderer extends templates_1.TemplateRenderer {
|
|
50
|
+
constructor() {
|
|
51
|
+
super();
|
|
52
|
+
this.Templates = new Map();
|
|
53
|
+
}
|
|
54
|
+
get Type() {
|
|
55
|
+
return 'pug';
|
|
56
|
+
}
|
|
57
|
+
get Extension() {
|
|
58
|
+
return '.pug';
|
|
59
|
+
}
|
|
60
|
+
async renderToFile(template, model, filePath, language) {
|
|
61
|
+
const content = await this.render(template, model, language);
|
|
62
|
+
const dir = path.dirname(filePath);
|
|
63
|
+
if (!fs.existsSync(dir)) {
|
|
64
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
65
|
+
}
|
|
66
|
+
fs.writeFileSync(filePath, content);
|
|
67
|
+
}
|
|
68
|
+
async render(templateName, model, language) {
|
|
69
|
+
this.Log.trace(`Rendering pug template ${templateName}`);
|
|
70
|
+
this.Log.timeStart(`PugTemplate.render.start.${templateName}`);
|
|
71
|
+
if (!templateName) {
|
|
72
|
+
throw new exceptions_1.InvalidArgument('template parameter cannot be null or empty');
|
|
73
|
+
}
|
|
74
|
+
let fTemplate = null;
|
|
75
|
+
// if in dev mode always compile template
|
|
76
|
+
// so we dont need to reload app manually
|
|
77
|
+
if (!this.Templates.has((0, path_1.normalize)(templateName)) || this.devMode) {
|
|
78
|
+
await this.compile((0, path_1.normalize)(templateName));
|
|
79
|
+
}
|
|
80
|
+
fTemplate = this.Templates.get((0, path_1.normalize)(templateName));
|
|
81
|
+
const lang = language ? language : (0, intl_1.guessLanguage)();
|
|
82
|
+
const tLang = lang ?? (0, intl_1.defaultLanguage)();
|
|
83
|
+
const content = fTemplate(lodash_1.default.merge(model ?? {}, {
|
|
84
|
+
__: (0, intl_1.__translate)(tLang),
|
|
85
|
+
__n: (0, intl_1.__translateNumber)(tLang),
|
|
86
|
+
__l: intl_1.__translateL,
|
|
87
|
+
__h: intl_1.__translateH,
|
|
88
|
+
}));
|
|
89
|
+
const time = this.Log.timeEnd(`PugTemplate.render.start.${templateName}`);
|
|
90
|
+
this.Log.trace(`Rendering pug template ${templateName} ended, (${time} ms)`);
|
|
91
|
+
return Promise.resolve(content);
|
|
92
|
+
}
|
|
93
|
+
async compile(path) {
|
|
94
|
+
const tCompiled = pugTemplate.compileFile(path, this.Options);
|
|
95
|
+
const pNormalized = (0, path_1.normalize)(path);
|
|
96
|
+
if (!tCompiled) {
|
|
97
|
+
throw new exceptions_1.IOFail(`Cannot compile handlebars template ${pNormalized} from path ${path}`);
|
|
98
|
+
}
|
|
99
|
+
this.Templates.set(pNormalized, tCompiled);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
exports.PugRenderer = PugRenderer;
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, configuration_1.Config)('templates.pug'),
|
|
105
|
+
__metadata("design:type", Object)
|
|
106
|
+
], PugRenderer.prototype, "Options", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, configuration_1.Config)('configuration.isDevelopment'),
|
|
109
|
+
__metadata("design:type", Boolean)
|
|
110
|
+
], PugRenderer.prototype, "devMode", void 0);
|
|
111
|
+
exports.PugRenderer = PugRenderer = __decorate([
|
|
112
|
+
(0, di_1.Injectable)(templates_1.TemplateRenderer),
|
|
113
|
+
__metadata("design:paramtypes", [])
|
|
114
|
+
], PugRenderer);
|
|
115
115
|
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAA2H;AAC3H,oDAA8D;AAC9D,uCAAyB;AACzB,iDAAmC;AACnC,2CAA6B;AAC7B,oDAAuB;AACvB,kDAAsD;AAEtD,0DAAgD;AAChD,oCAAyC;AACzC,+BAAiC;AAG1B,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,4BAAgB;IAS/C;QACE,KAAK,EAAE,CAAC;QANA,cAAS,GAA6C,IAAI,GAAG,EAAuC,CAAC;IAO/G,CAAC;IAED,IAAW,IAAI;QACb,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAW,SAAS;QAClB,OAAO,MAAM,CAAC;IAChB,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,QAAgB,EAAE,KAAc,EAAE,QAAgB,EAAE,QAAiB;QAC7F,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;QAC7D,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAEnC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YACvB,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;SACxC;QAED,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IAEM,KAAK,CAAC,M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AK,CAAC;YAC7B,GAAG,EAAE,mBAAY;YACjB,GAAG,EAAE,mBAAY;SAClB,CAAC,CACH,CAAC;QAEF,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,4BAA4B,YAAY,EAAE,CAAC,CAAC;QAC1E,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,0BAA0B,YAAY,YAAY,IAAI,MAAM,CAAC,CAAC;QAE7E,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAES,KAAK,CAAC,OAAO,CAAC,IAAY;QAClC,MAAM,SAAS,GAAG,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,MAAM,WAAW,GAAG,IAAA,gBAAS,EAAC,IAAI,CAAC,CAAC;QAEpC,IAAI,CAAC,SAAS,EAAE;YACd,MAAM,IAAI,mBAAM,CAAC,sCAAsC,WAAW,cAAc,IAAI,EAAE,CAAC,CAAC;SACzF;QAED,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAC7C,CAAC;CACF,CAAA;AA7EY,kCAAW;AAEZ;IADT,IAAA,sBAAM,EAAC,eAAe,CAAC;;4CACe;AAK7B;IADT,IAAA,sBAAM,EAAC,6BAA6B,CAAC;;4CACX;sBAPhB,WAAW;IADvB,IAAA,eAAU,EAAC,4BAAgB,CAAC;;GAChB,WAAW,CA6EvB"}
|
package/lib/mjs/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as pugTemplate from 'pug';
|
|
2
|
-
import { TemplateRenderer } from '@spinajs/templates';
|
|
3
|
-
export declare class PugRenderer extends TemplateRenderer {
|
|
4
|
-
protected Options: pugTemplate.Options;
|
|
5
|
-
protected Templates: Map<string, pugTemplate.compileTemplate>;
|
|
6
|
-
protected devMode: boolean;
|
|
7
|
-
constructor();
|
|
8
|
-
get Type(): string;
|
|
9
|
-
get Extension(): string;
|
|
10
|
-
renderToFile(template: string, model: unknown, filePath: string, language?: string): Promise<void>;
|
|
11
|
-
render(templateName: string, model: unknown, language?: string): Promise<string>;
|
|
12
|
-
protected compile(path: string): Promise<void>;
|
|
13
|
-
}
|
|
1
|
+
import * as pugTemplate from 'pug';
|
|
2
|
+
import { TemplateRenderer } from '@spinajs/templates';
|
|
3
|
+
export declare class PugRenderer extends TemplateRenderer {
|
|
4
|
+
protected Options: pugTemplate.Options;
|
|
5
|
+
protected Templates: Map<string, pugTemplate.compileTemplate>;
|
|
6
|
+
protected devMode: boolean;
|
|
7
|
+
constructor();
|
|
8
|
+
get Type(): string;
|
|
9
|
+
get Extension(): string;
|
|
10
|
+
renderToFile(template: string, model: unknown, filePath: string, language?: string): Promise<void>;
|
|
11
|
+
render(templateName: string, model: unknown, language?: string): Promise<string>;
|
|
12
|
+
protected compile(path: string): Promise<void>;
|
|
13
|
+
}
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/mjs/index.js
CHANGED
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { __translate, __translateNumber, __translateL, __translateH, guessLanguage, defaultLanguage } from '@spinajs/intl';
|
|
11
|
-
import { IOFail, InvalidArgument } from '@spinajs/exceptions';
|
|
12
|
-
import * as fs from 'fs';
|
|
13
|
-
import * as pugTemplate from 'pug';
|
|
14
|
-
import * as path from 'path';
|
|
15
|
-
import _ from 'lodash';
|
|
16
|
-
import { TemplateRenderer } from '@spinajs/templates';
|
|
17
|
-
import { Config } from '@spinajs/configuration';
|
|
18
|
-
import { Injectable } from '@spinajs/di';
|
|
19
|
-
import { normalize } from 'path';
|
|
20
|
-
let PugRenderer = class PugRenderer extends TemplateRenderer {
|
|
21
|
-
constructor() {
|
|
22
|
-
super();
|
|
23
|
-
this.Templates = new Map();
|
|
24
|
-
}
|
|
25
|
-
get Type() {
|
|
26
|
-
return 'pug';
|
|
27
|
-
}
|
|
28
|
-
get Extension() {
|
|
29
|
-
return '.pug';
|
|
30
|
-
}
|
|
31
|
-
async renderToFile(template, model, filePath, language) {
|
|
32
|
-
const content = await this.render(template, model, language);
|
|
33
|
-
const dir = path.dirname(filePath);
|
|
34
|
-
if (!fs.existsSync(dir)) {
|
|
35
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
36
|
-
}
|
|
37
|
-
fs.writeFileSync(filePath, content);
|
|
38
|
-
}
|
|
39
|
-
async render(templateName, model, language) {
|
|
40
|
-
this.Log.trace(`Rendering pug template ${templateName}`);
|
|
41
|
-
this.Log.timeStart(`PugTemplate.render.start.${templateName}`);
|
|
42
|
-
if (!templateName) {
|
|
43
|
-
throw new InvalidArgument('template parameter cannot be null or empty');
|
|
44
|
-
}
|
|
45
|
-
let fTemplate = null;
|
|
46
|
-
// if in dev mode always compile template
|
|
47
|
-
// so we dont need to reload app manually
|
|
48
|
-
if (!this.Templates.has(normalize(templateName)) || this.devMode) {
|
|
49
|
-
await this.compile(normalize(templateName));
|
|
50
|
-
}
|
|
51
|
-
fTemplate = this.Templates.get(normalize(templateName));
|
|
52
|
-
const lang = language ? language : guessLanguage();
|
|
53
|
-
const tLang = lang ?? defaultLanguage();
|
|
54
|
-
const content = fTemplate(_.merge(model ?? {}, {
|
|
55
|
-
__: __translate(tLang),
|
|
56
|
-
__n: __translateNumber(tLang),
|
|
57
|
-
__l: __translateL,
|
|
58
|
-
__h: __translateH,
|
|
59
|
-
}));
|
|
60
|
-
const time = this.Log.timeEnd(`PugTemplate.render.start.${templateName}`);
|
|
61
|
-
this.Log.trace(`Rendering pug template ${templateName} ended, (${time} ms)`);
|
|
62
|
-
return Promise.resolve(content);
|
|
63
|
-
}
|
|
64
|
-
async compile(path) {
|
|
65
|
-
const tCompiled = pugTemplate.compileFile(path, this.Options);
|
|
66
|
-
const pNormalized = normalize(path);
|
|
67
|
-
if (!tCompiled) {
|
|
68
|
-
throw new IOFail(`Cannot compile handlebars template ${pNormalized} from path ${path}`);
|
|
69
|
-
}
|
|
70
|
-
this.Templates.set(pNormalized, tCompiled);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
__decorate([
|
|
74
|
-
Config('templates.pug'),
|
|
75
|
-
__metadata("design:type", Object)
|
|
76
|
-
], PugRenderer.prototype, "Options", void 0);
|
|
77
|
-
__decorate([
|
|
78
|
-
Config('configuration.isDevelopment'),
|
|
79
|
-
__metadata("design:type", Boolean)
|
|
80
|
-
], PugRenderer.prototype, "devMode", void 0);
|
|
81
|
-
PugRenderer = __decorate([
|
|
82
|
-
Injectable(TemplateRenderer),
|
|
83
|
-
__metadata("design:paramtypes", [])
|
|
84
|
-
], PugRenderer);
|
|
85
|
-
export { PugRenderer };
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { __translate, __translateNumber, __translateL, __translateH, guessLanguage, defaultLanguage } from '@spinajs/intl';
|
|
11
|
+
import { IOFail, InvalidArgument } from '@spinajs/exceptions';
|
|
12
|
+
import * as fs from 'fs';
|
|
13
|
+
import * as pugTemplate from 'pug';
|
|
14
|
+
import * as path from 'path';
|
|
15
|
+
import _ from 'lodash';
|
|
16
|
+
import { TemplateRenderer } from '@spinajs/templates';
|
|
17
|
+
import { Config } from '@spinajs/configuration';
|
|
18
|
+
import { Injectable } from '@spinajs/di';
|
|
19
|
+
import { normalize } from 'path';
|
|
20
|
+
let PugRenderer = class PugRenderer extends TemplateRenderer {
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
this.Templates = new Map();
|
|
24
|
+
}
|
|
25
|
+
get Type() {
|
|
26
|
+
return 'pug';
|
|
27
|
+
}
|
|
28
|
+
get Extension() {
|
|
29
|
+
return '.pug';
|
|
30
|
+
}
|
|
31
|
+
async renderToFile(template, model, filePath, language) {
|
|
32
|
+
const content = await this.render(template, model, language);
|
|
33
|
+
const dir = path.dirname(filePath);
|
|
34
|
+
if (!fs.existsSync(dir)) {
|
|
35
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
36
|
+
}
|
|
37
|
+
fs.writeFileSync(filePath, content);
|
|
38
|
+
}
|
|
39
|
+
async render(templateName, model, language) {
|
|
40
|
+
this.Log.trace(`Rendering pug template ${templateName}`);
|
|
41
|
+
this.Log.timeStart(`PugTemplate.render.start.${templateName}`);
|
|
42
|
+
if (!templateName) {
|
|
43
|
+
throw new InvalidArgument('template parameter cannot be null or empty');
|
|
44
|
+
}
|
|
45
|
+
let fTemplate = null;
|
|
46
|
+
// if in dev mode always compile template
|
|
47
|
+
// so we dont need to reload app manually
|
|
48
|
+
if (!this.Templates.has(normalize(templateName)) || this.devMode) {
|
|
49
|
+
await this.compile(normalize(templateName));
|
|
50
|
+
}
|
|
51
|
+
fTemplate = this.Templates.get(normalize(templateName));
|
|
52
|
+
const lang = language ? language : guessLanguage();
|
|
53
|
+
const tLang = lang ?? defaultLanguage();
|
|
54
|
+
const content = fTemplate(_.merge(model ?? {}, {
|
|
55
|
+
__: __translate(tLang),
|
|
56
|
+
__n: __translateNumber(tLang),
|
|
57
|
+
__l: __translateL,
|
|
58
|
+
__h: __translateH,
|
|
59
|
+
}));
|
|
60
|
+
const time = this.Log.timeEnd(`PugTemplate.render.start.${templateName}`);
|
|
61
|
+
this.Log.trace(`Rendering pug template ${templateName} ended, (${time} ms)`);
|
|
62
|
+
return Promise.resolve(content);
|
|
63
|
+
}
|
|
64
|
+
async compile(path) {
|
|
65
|
+
const tCompiled = pugTemplate.compileFile(path, this.Options);
|
|
66
|
+
const pNormalized = normalize(path);
|
|
67
|
+
if (!tCompiled) {
|
|
68
|
+
throw new IOFail(`Cannot compile handlebars template ${pNormalized} from path ${path}`);
|
|
69
|
+
}
|
|
70
|
+
this.Templates.set(pNormalized, tCompiled);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
__decorate([
|
|
74
|
+
Config('templates.pug'),
|
|
75
|
+
__metadata("design:type", Object)
|
|
76
|
+
], PugRenderer.prototype, "Options", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
Config('configuration.isDevelopment'),
|
|
79
|
+
__metadata("design:type", Boolean)
|
|
80
|
+
], PugRenderer.prototype, "devMode", void 0);
|
|
81
|
+
PugRenderer = __decorate([
|
|
82
|
+
Injectable(TemplateRenderer),
|
|
83
|
+
__metadata("design:paramtypes", [])
|
|
84
|
+
], PugRenderer);
|
|
85
|
+
export { PugRenderer };
|
|
86
86
|
//# sourceMappingURL=index.js.map
|
package/lib/mjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|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