Comparing version 2.2.2 to 2.2.3
@@ -1,21 +0,21 @@ | ||
import { EngineMap } from "./engineMap"; | ||
import { Markdown } from "./engines/markdown"; | ||
import { Handlebars } from "./engines/handlebars"; | ||
import { EJS } from "./engines/ejs"; | ||
import { Pug } from "./engines/pug"; | ||
import { Nunjucks } from "./engines/nunjucks"; | ||
import { Liquid } from "./engines/liquid"; | ||
import { EngineMap } from './engine-map.js'; | ||
import { Markdown } from './engines/markdown.js'; | ||
import { Handlebars } from './engines/handlebars.js'; | ||
import { EJS } from './engines/ejs.js'; | ||
import { Pug } from './engines/pug.js'; | ||
import { Nunjucks } from './engines/nunjucks.js'; | ||
import { Liquid } from './engines/liquid.js'; | ||
export declare class Ecto { | ||
private __mapping; | ||
private __engines; | ||
private readonly __mapping; | ||
private readonly __engines; | ||
private __defaultEngine; | ||
private __ejs; | ||
private __markdown; | ||
private __pug; | ||
private __nunjucks; | ||
private __handlebars; | ||
private __liquid; | ||
constructor(opts?: any); | ||
private readonly __ejs; | ||
private readonly __markdown; | ||
private readonly __pug; | ||
private readonly __nunjucks; | ||
private readonly __handlebars; | ||
private readonly __liquid; | ||
constructor(options?: any); | ||
get defaultEngine(): string; | ||
set defaultEngine(val: string); | ||
set defaultEngine(value: string); | ||
get mappings(): EngineMap; | ||
@@ -28,10 +28,10 @@ get ejs(): EJS; | ||
get liquid(): Liquid; | ||
render(source: string, data?: object, engineName?: string, rootTemplatePath?: string, filePathOutput?: string): Promise<string>; | ||
renderFromFile(filePath: string, data?: object, rootTemplatePath?: string, filePathOutput?: string, engineName?: string): Promise<string>; | ||
private writeFile; | ||
render(source: string, data?: Record<string, unknown>, engineName?: string, rootTemplatePath?: string, filePathOutput?: string): Promise<string>; | ||
renderFromFile(filePath: string, data?: Record<string, unknown>, rootTemplatePath?: string, filePathOutput?: string, engineName?: string): Promise<string>; | ||
ensureFilePath(path: string): Promise<void>; | ||
getEngineByFilePath(filePath: string): string; | ||
isValidEngine(engineName?: string): Boolean; | ||
isValidEngine(engineName?: string): boolean; | ||
registerEngineMappings(): void; | ||
getRenderEngine(engineName: string): EngineInterface; | ||
private writeFile; | ||
} |
144
dist/ecto.js
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Ecto = void 0; | ||
const engineMap_1 = require("./engineMap"); | ||
const markdown_1 = require("./engines/markdown"); | ||
const handlebars_1 = require("./engines/handlebars"); | ||
const ejs_1 = require("./engines/ejs"); | ||
const pug_1 = require("./engines/pug"); | ||
const nunjucks_1 = require("./engines/nunjucks"); | ||
const liquid_1 = require("./engines/liquid"); | ||
const fs = require("fs-extra"); | ||
const engine_map_js_1 = require("./engine-map.js"); | ||
const markdown_js_1 = require("./engines/markdown.js"); | ||
const handlebars_js_1 = require("./engines/handlebars.js"); | ||
const ejs_js_1 = require("./engines/ejs.js"); | ||
const pug_js_1 = require("./engines/pug.js"); | ||
const nunjucks_js_1 = require("./engines/nunjucks.js"); | ||
const liquid_js_1 = require("./engines/liquid.js"); | ||
class Ecto { | ||
constructor(opts) { | ||
this.__mapping = new engineMap_1.EngineMap(); | ||
constructor(options) { | ||
this.__mapping = new engine_map_js_1.EngineMap(); | ||
this.__engines = new Array(); | ||
this.__defaultEngine = "ejs"; | ||
//engines | ||
this.__ejs = new ejs_1.EJS(); | ||
this.__markdown = new markdown_1.Markdown(); | ||
this.__pug = new pug_1.Pug(); | ||
this.__nunjucks = new nunjucks_1.Nunjucks(); | ||
this.__handlebars = new handlebars_1.Handlebars(); | ||
this.__liquid = new liquid_1.Liquid(); | ||
//register engines | ||
this.__engines.push(this.__ejs); | ||
this.__engines.push(this.__markdown); | ||
this.__engines.push(this.__pug); | ||
this.__engines.push(this.__nunjucks); | ||
this.__engines.push(this.__handlebars); | ||
this.__engines.push(this.__liquid); | ||
//register mappings | ||
this.__defaultEngine = 'ejs'; | ||
// Engines | ||
this.__ejs = new ejs_js_1.EJS(); | ||
this.__markdown = new markdown_js_1.Markdown(); | ||
this.__pug = new pug_js_1.Pug(); | ||
this.__nunjucks = new nunjucks_js_1.Nunjucks(); | ||
this.__handlebars = new handlebars_js_1.Handlebars(); | ||
this.__liquid = new liquid_js_1.Liquid(); | ||
// Register engines | ||
this.__engines.push(this.__ejs, this.__markdown, this.__pug, this.__nunjucks, this.__handlebars, this.__liquid); | ||
// Register mappings | ||
this.registerEngineMappings(); | ||
//set the options | ||
if (opts) { | ||
if (this.isValidEngine(opts.defaultEngine)) { | ||
this.__defaultEngine = opts.defaultEngine; | ||
} | ||
// Set the options | ||
if (options !== undefined && this.isValidEngine(options.defaultEngine)) { | ||
this.__defaultEngine = options.defaultEngine; | ||
} | ||
@@ -43,6 +36,6 @@ } | ||
} | ||
set defaultEngine(val) { | ||
val = val.toLowerCase().trim(); | ||
if (this.isValidEngine(val)) { | ||
this.__defaultEngine = val; | ||
set defaultEngine(value) { | ||
value = value.toLowerCase().trim(); | ||
if (this.isValidEngine(value)) { | ||
this.__defaultEngine = value; | ||
} | ||
@@ -53,3 +46,3 @@ } | ||
} | ||
//Engines | ||
// Engines | ||
get ejs() { | ||
@@ -73,42 +66,38 @@ return this.__ejs; | ||
} | ||
//String Render | ||
// String Render | ||
// eslint-disable-next-line max-params | ||
async render(source, data, engineName, rootTemplatePath, filePathOutput) { | ||
let result = ""; | ||
let result = ''; | ||
let renderEngineName = this.__defaultEngine; | ||
//set the render engine | ||
// Set the render engine | ||
if (this.isValidEngine(engineName) && engineName !== undefined) { | ||
renderEngineName = engineName; | ||
} | ||
//get the render engine | ||
let renderEngine = this.getRenderEngine(renderEngineName); | ||
//set the root template path | ||
// Get the render engine | ||
const renderEngine = this.getRenderEngine(renderEngineName); | ||
// Set the root template path | ||
renderEngine.rootTemplatePath = rootTemplatePath; | ||
//get the output | ||
// Get the output | ||
result = await renderEngine.render(source, data); | ||
//write out the file | ||
// Write out the file | ||
await this.writeFile(filePathOutput, result); | ||
return result; | ||
} | ||
//Render from File | ||
// Render from File | ||
// eslint-disable-next-line max-params | ||
async renderFromFile(filePath, data, rootTemplatePath, filePathOutput, engineName) { | ||
let result = ""; | ||
//select which engine | ||
let result = ''; | ||
// Select which engine | ||
if (!engineName) { | ||
engineName = this.getEngineByFilePath(filePath); | ||
} | ||
//get the source | ||
let source = await fs.readFile(filePath, "utf8"); | ||
// Get the source | ||
const source = await fs.readFile(filePath, 'utf8'); | ||
result = await this.render(source, data, engineName, rootTemplatePath, filePathOutput); | ||
return result; | ||
} | ||
async writeFile(filePath, source) { | ||
if (filePath && source) { | ||
await this.ensureFilePath(filePath); | ||
await fs.writeFile(filePath, source); | ||
} | ||
} | ||
async ensureFilePath(path) { | ||
let pathList = path.split("/"); | ||
const pathList = path.split('/'); | ||
pathList.pop(); | ||
let dir = pathList.join("/"); | ||
const dir = pathList.join('/'); | ||
if (!fs.existsSync(dir)) { | ||
@@ -121,4 +110,4 @@ await fs.ensureDir(dir); | ||
if (filePath !== undefined) { | ||
let ext = filePath.slice((filePath.lastIndexOf(".") - 1 >>> 0) + 2); | ||
let engExt = this.__mapping.getName(ext); | ||
const ext = filePath.lastIndexOf('.') >= 0 ? filePath.slice(filePath.lastIndexOf('.') + 1) : ''; | ||
const engExt = this.__mapping.getName(ext); | ||
if (engExt !== undefined) { | ||
@@ -130,3 +119,3 @@ result = engExt; | ||
} | ||
//Engines | ||
// Engines | ||
isValidEngine(engineName) { | ||
@@ -140,34 +129,47 @@ let result = false; | ||
registerEngineMappings() { | ||
this.__engines.forEach(eng => { | ||
eng.names.forEach(name => { | ||
for (const eng of this.__engines) { | ||
for (const name of eng.names) { | ||
this.__mapping.set(name, eng.getExtensions()); | ||
}); | ||
}); | ||
} | ||
} | ||
} | ||
getRenderEngine(engineName) { | ||
let result = this.__ejs; //setting default | ||
let result = this.__ejs; // Setting default | ||
// eslint-disable-next-line default-case | ||
switch (engineName.trim().toLowerCase()) { | ||
case "markdown": | ||
case 'markdown': { | ||
result = this.__markdown; | ||
break; | ||
case "pug": | ||
} | ||
case 'pug': { | ||
result = this.__pug; | ||
break; | ||
case "nunjucks": | ||
} | ||
case 'nunjucks': { | ||
result = this.__nunjucks; | ||
break; | ||
case "mustache": | ||
} | ||
case 'mustache': { | ||
result = this.__handlebars; | ||
break; | ||
case "handlebars": | ||
} | ||
case 'handlebars': { | ||
result = this.__handlebars; | ||
break; | ||
case "liquid": | ||
} | ||
case 'liquid': { | ||
result = this.__liquid; | ||
break; | ||
} | ||
} | ||
return result; | ||
} | ||
async writeFile(filePath, source) { | ||
if (filePath && source) { | ||
await this.ensureFilePath(filePath); | ||
await fs.writeFile(filePath, source); | ||
} | ||
} | ||
} | ||
exports.Ecto = Ecto; | ||
//# sourceMappingURL=ecto.js.map | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWN0by5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9lY3RvLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLCtCQUErQjtBQUMvQixtREFBMEM7QUFDMUMsdURBQStDO0FBQy9DLDJEQUFtRDtBQUNuRCw2Q0FBcUM7QUFDckMsNkNBQXFDO0FBQ3JDLHVEQUErQztBQUMvQyxtREFBMkM7QUFHM0MsTUFBYSxJQUFJO0lBY2hCLFlBQVksT0FBYTtRQWJSLGNBQVMsR0FBYyxJQUFJLHlCQUFTLEVBQUUsQ0FBQztRQUN2QyxjQUFTLEdBQWlCLElBQUksS0FBSyxFQUFjLENBQUM7UUFFM0Qsb0JBQWUsR0FBRyxLQUFLLENBQUM7UUFFaEMsVUFBVTtRQUNPLFVBQUssR0FBUSxJQUFJLFlBQUcsRUFBRSxDQUFDO1FBQ3ZCLGVBQVUsR0FBYSxJQUFJLHNCQUFRLEVBQUUsQ0FBQztRQUN0QyxVQUFLLEdBQVEsSUFBSSxZQUFHLEVBQUUsQ0FBQztRQUN2QixlQUFVLEdBQWEsSUFBSSxzQkFBUSxFQUFFLENBQUM7UUFDdEMsaUJBQVksR0FBZSxJQUFJLDBCQUFV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0,5 @@ | ||
import { BaseEngine } from "../baseEngine"; | ||
import { BaseEngine } from '../base-engine.js'; | ||
export declare class EJS extends BaseEngine implements EngineInterface { | ||
constructor(opts?: object); | ||
render(source: string, data?: object): Promise<string>; | ||
constructor(options?: Record<string, unknown>); | ||
render(source: string, data?: Record<string, unknown>): Promise<string>; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.EJS = void 0; | ||
const baseEngine_1 = require("../baseEngine"); | ||
const ejs = require("ejs"); | ||
class EJS extends baseEngine_1.BaseEngine { | ||
constructor(opts) { | ||
const base_engine_js_1 = require("../base-engine.js"); | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
class EJS extends base_engine_js_1.BaseEngine { | ||
constructor(options) { | ||
super(); | ||
this.names = ["ejs"]; | ||
if (opts) { | ||
this.opts = opts; | ||
this.names = ['ejs']; | ||
if (options) { | ||
this.opts = options; | ||
} | ||
this.setExtensions(["ejs"]); | ||
this.setExtensions(['ejs']); | ||
} | ||
@@ -29,2 +30,2 @@ async render(source, data) { | ||
exports.EJS = EJS; | ||
//# sourceMappingURL=ejs.js.map | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWpzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2VuZ2luZXMvZWpzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDJCQUEyQjtBQUMzQixzREFBNkM7QUFFN0MsZ0VBQWdFO0FBQ2hFLE1BQWEsR0FBSSxTQUFRLDJCQUFVO0lBQ2xDLFlBQVksT0FBaUM7UUFDNUMsS0FBSyxFQUFFLENBQUM7UUFFUixJQUFJLENBQUMsS0FBSyxHQUFHLENBQUMsS0FBSyxDQUFDLENBQUM7UUFFckIsSUFBSSxPQUFPLEVBQUU7WUFDWixJQUFJLENBQUMsSUFBSSxHQUFHLE9BQU8sQ0FBQztTQUNwQjt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HRcdHRoaXMub3B0cyA9IG9wdGlvbnM7XG5cdFx0fVxuXG5cdFx0dGhpcy5zZXRFeHRlbnNpb25zKFsnZWpzJ10pO1xuXHR9XG5cblx0YXN5bmMgcmVuZGVyKHNvdXJjZTogc3RyaW5nLCBkYXRhPzogUmVjb3JkPHN0cmluZywgdW5rbm93bj4pOiBQcm9taXNlPHN0cmluZz4ge1xuXHRcdGlmICghdGhpcy5lbmdpbmUpIHtcblx0XHRcdHRoaXMuZW5naW5lID0gZWpzO1xuXHRcdH1cblxuXHRcdGlmICghdGhpcy5vcHRzKSB7XG5cdFx0XHR0aGlzLm9wdHMgPSB7fTtcblx0XHR9XG5cblx0XHRpZiAodGhpcy5yb290VGVtcGxhdGVQYXRoKSB7XG5cdFx0XHR0aGlzLm9wdHMucm9vdCA9IHRoaXMucm9vdFRlbXBsYXRlUGF0aDtcblx0XHR9XG5cblx0XHRyZXR1cm4gZWpzLnJlbmRlcihzb3VyY2UsIGRhdGEsIHRoaXMub3B0cyBhcyBlanMuT3B0aW9ucyk7XG5cdH1cbn1cbiJdfQ== |
@@ -1,7 +0,7 @@ | ||
import { BaseEngine } from "../baseEngine"; | ||
import { BaseEngine } from '../base-engine.js'; | ||
export declare class Handlebars extends BaseEngine implements EngineInterface { | ||
partialsPath: string; | ||
constructor(opts?: object); | ||
render(source: string, data?: object): Promise<string>; | ||
constructor(options?: Record<string, unknown>); | ||
render(source: string, data?: Record<string, unknown>): Promise<string>; | ||
registerPartials(partialsPath: string): boolean; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Handlebars = void 0; | ||
const baseEngine_1 = require("../baseEngine"); | ||
const handlebars = require("@jaredwray/fumanchu"); | ||
const fs = require("fs-extra"); | ||
const _ = require("underscore"); | ||
class Handlebars extends baseEngine_1.BaseEngine { | ||
constructor(opts) { | ||
const base_engine_js_1 = require("../base-engine.js"); | ||
class Handlebars extends base_engine_js_1.BaseEngine { | ||
constructor(options) { | ||
super(); | ||
this.partialsPath = "/partials"; | ||
this.names = ["handlebars", "mustache"]; | ||
this.opts = opts; | ||
this.partialsPath = '/partials'; | ||
this.names = ['handlebars', 'mustache']; | ||
this.opts = options; | ||
this.engine = handlebars; | ||
this.setExtensions(["hbs", "hjs", "handlebars", "mustache"]); | ||
this.setExtensions(['hbs', 'hjs', 'handlebars', 'mustache']); | ||
} | ||
async render(source, data) { | ||
//register partials | ||
// Register partials | ||
if (this.rootTemplatePath) { | ||
this.registerPartials(this.rootTemplatePath + this.partialsPath); | ||
} | ||
let template = handlebars.compile(source, this.opts); | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument | ||
const template = handlebars.compile(source, this.opts); | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument | ||
let result = template(data, this.opts); | ||
@@ -30,10 +32,10 @@ result = _.unescape(result); | ||
if (fs.pathExistsSync(partialsPath)) { | ||
let partials = fs.readdirSync(partialsPath); | ||
partials.forEach(p => { | ||
let source = fs.readFileSync(partialsPath + "/" + p).toString(); | ||
let name = p.split(".")[0]; | ||
const partials = fs.readdirSync(partialsPath); | ||
for (const p of partials) { | ||
const source = fs.readFileSync(partialsPath + '/' + p).toString(); | ||
const name = p.split('.')[0]; | ||
if (handlebars.partials[name] === undefined) { | ||
handlebars.registerPartial(name, handlebars.compile(source)); | ||
} | ||
}); | ||
} | ||
result = true; | ||
@@ -45,2 +47,2 @@ } | ||
exports.Handlebars = Handlebars; | ||
//# sourceMappingURL=handlebars.js.map | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGFuZGxlYmFycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9lbmdpbmVzL2hhbmRsZWJhcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsa0RBQWtEO0FBQ2xELCtCQUErQjtBQUMvQixnQ0FBZ0M7QUFDaEMsc0RBQTZDO0FBR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cm4gcmVzdWx0O1xuXHR9XG5cblx0cmVnaXN0ZXJQYXJ0aWFscyhwYXJ0aWFsc1BhdGg6IHN0cmluZyk6IGJvb2xlYW4ge1xuXHRcdGxldCByZXN1bHQgPSBmYWxzZTtcblx0XHRpZiAoZnMucGF0aEV4aXN0c1N5bmMocGFydGlhbHNQYXRoKSkge1xuXHRcdFx0Y29uc3QgcGFydGlhbHMgPSBmcy5yZWFkZGlyU3luYyhwYXJ0aWFsc1BhdGgpO1xuXG5cdFx0XHRmb3IgKGNvbnN0IHAgb2YgcGFydGlhbHMpIHtcblx0XHRcdFx0Y29uc3Qgc291cmNlID0gZnMucmVhZEZpbGVTeW5jKHBhcnRpYWxzUGF0aCArICcvJyArIHApLnRvU3RyaW5nKCk7XG5cdFx0XHRcdGNvbnN0IG5hbWUgPSBwLnNwbGl0KCcuJylbMF07XG5cblx0XHRcdFx0aWYgKGhhbmRsZWJhcnMucGFydGlhbHNbbmFtZV0gPT09IHVuZGVmaW5lZCkge1xuXHRcdFx0XHRcdGhhbmRsZWJhcnMucmVnaXN0ZXJQYXJ0aWFsKG5hbWUsIGhhbmRsZWJhcnMuY29tcGlsZShzb3VyY2UpKTtcblx0XHRcdFx0fVxuXHRcdFx0fVxuXG5cdFx0XHRyZXN1bHQgPSB0cnVlO1xuXHRcdH1cblxuXHRcdHJldHVybiByZXN1bHQ7XG5cdH1cbn1cbiJdfQ== |
@@ -1,5 +0,5 @@ | ||
import { BaseEngine } from "../baseEngine"; | ||
import { BaseEngine } from '../base-engine.js'; | ||
export declare class Liquid extends BaseEngine implements EngineInterface { | ||
constructor(opts?: object); | ||
render(source: string, data?: object): Promise<string>; | ||
constructor(options?: Record<string, unknown>); | ||
render(source: string, data?: Record<string, unknown>): Promise<string>; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Liquid = void 0; | ||
const baseEngine_1 = require("../baseEngine"); | ||
const liquidjs_1 = require("liquidjs"); | ||
class Liquid extends baseEngine_1.BaseEngine { | ||
constructor(opts) { | ||
const base_engine_js_1 = require("../base-engine.js"); | ||
class Liquid extends base_engine_js_1.BaseEngine { | ||
constructor(options) { | ||
super(); | ||
this.names = ["liquid"]; | ||
if (opts) { | ||
this.opts = opts; | ||
this.names = ['liquid']; | ||
if (options) { | ||
this.opts = options; | ||
} | ||
this.setExtensions(["liquid"]); | ||
this.setExtensions(['liquid']); | ||
} | ||
@@ -23,8 +23,10 @@ async render(source, data) { | ||
if (!this.engine) { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument | ||
this.engine = new liquidjs_1.Liquid(this.opts); | ||
} | ||
return await this.engine.parseAndRender(source, data); | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call | ||
return this.engine.parseAndRender(source, data); | ||
} | ||
} | ||
exports.Liquid = Liquid; | ||
//# sourceMappingURL=liquid.js.map | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGlxdWlkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2VuZ2luZXMvbGlxdWlkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHVDQUFnRDtBQUNoRCxzREFBNkM7QUFFN0MsTUFBYSxNQUFPLFNBQVEsMkJBQVU7SUFDckMsWUFBWSxPQUFpQztRQUM1QyxLQUFLLEVBQUUsQ0FBQztRQUVSLElBQUksQ0FBQyxLQUFLLEdBQUcsQ0FBQyxRQUFRLENBQUMsQ0FBQztRQUV4QixJQUFJLE9BQU8sRUFBRTtZQUNaLElBQUksQ0FBQyxJQUFJLEdBQUcsT0FBTyxDQUFDO1NBQ3BCO1FBRUQsSUFBSSxDQUFDLGFBQWEsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxDQUFDLENBQUM7SUFDaEMsQ0FBQztJQUVELEtBQUssQ0FBQyxNQUFNLENBQUMsTUFBYyxFQUFFLElBQThC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FzeW5jIHJlbmRlcihzb3VyY2U6IHN0cmluZywgZGF0YT86IFJlY29yZDxzdHJpbmcsIHVua25vd24+KTogUHJvbWlzZTxzdHJpbmc+IHtcblx0XHRpZiAodGhpcy5yb290VGVtcGxhdGVQYXRoKSB7XG5cdFx0XHRpZiAoIXRoaXMub3B0cykge1xuXHRcdFx0XHR0aGlzLm9wdHMgPSB7fTtcblx0XHRcdH1cblxuXHRcdFx0dGhpcy5vcHRzLnJvb3QgPSB0aGlzLnJvb3RUZW1wbGF0ZVBhdGg7XG5cdFx0fVxuXG5cdFx0aWYgKCF0aGlzLmVuZ2luZSkge1xuXHRcdFx0Ly8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby11bnNhZmUtYXJndW1lbnRcblx0XHRcdHRoaXMuZW5naW5lID0gbmV3IExpcXVpZEVuZ2luZSh0aGlzLm9wdHMpO1xuXHRcdH1cblxuXHRcdC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW5zYWZlLXJldHVybiwgQHR5cGVzY3JpcHQtZXNsaW50L25vLXVuc2FmZS1jYWxsXG5cdFx0cmV0dXJuIHRoaXMuZW5naW5lLnBhcnNlQW5kUmVuZGVyKHNvdXJjZSwgZGF0YSk7XG5cdH1cbn1cbiJdfQ== |
@@ -1,5 +0,5 @@ | ||
import { BaseEngine } from "../baseEngine"; | ||
import { BaseEngine } from '../base-engine.js'; | ||
export declare class Markdown extends BaseEngine implements EngineInterface { | ||
constructor(opts?: any); | ||
render(source: string, data?: object): Promise<string>; | ||
constructor(options?: any); | ||
render(source: string, data?: Record<string, unknown>): Promise<string>; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Markdown = void 0; | ||
const baseEngine_1 = require("../baseEngine"); | ||
/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call */ | ||
const markdoc_1 = require("@markdoc/markdoc"); | ||
class Markdown extends baseEngine_1.BaseEngine { | ||
constructor(opts) { | ||
const base_engine_js_1 = require("../base-engine.js"); | ||
class Markdown extends base_engine_js_1.BaseEngine { | ||
constructor(options) { | ||
super(); | ||
this.names = ["markdown"]; | ||
if (opts) { | ||
this.opts = opts; | ||
this.names = ['markdown']; | ||
if (options) { | ||
this.opts = options; | ||
} | ||
this.engine = markdoc_1.default; | ||
this.setExtensions(["md", "markdown"]); | ||
this.setExtensions(['md', 'markdown']); | ||
} | ||
@@ -23,2 +24,2 @@ async render(source, data) { | ||
exports.Markdown = Markdown; | ||
//# sourceMappingURL=markdown.js.map | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFya2Rvd24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZW5naW5lcy9tYXJrZG93bi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwrRkFBK0Y7QUFDL0YsOENBQXVDO0FBQ3ZDLHNEQUE2QztBQUU3QyxNQUFhLFFBQVMsU0FBUSwyQkFBVTtJQUN2QyxZQUFZLE9BQWE7UUFDeEIsS0FBSyxFQUFFLENBQUM7UUFFUixJQUFJLENBQUMsS0FBSyxHQUFHLENBQUMsVUFBVSxDQUFDLENBQUM7UUFFMUIsSUFBSSxPQUFPLEVBQUU7WUFDWixJQUFJLENBQUMsSUFBSSxHQUFHLE9BQU8sQ0FBQztTQUNwQjtRQUVELElBQUksQ0FBQyxNQUFNLEdBQUcsaUJBQU8sQ0FBQztRQUV0QixJQUFJLENBQUMsYUFBYSxDQUFDLENBQUMsSUFBSSxFQUFFLFVBQVUsQ0FBQyxDQUFDLENBQUM7SUFDeEMsQ0FBQztJQUVELEtBQUssQ0FBQyxNQUFNLENBQUMsTUFBYyxFQUFFLElBQThCO1FBQzFELE1BQU0sR0FBRyxHQUFHLElBQUksQ0FBQyxNQUFNLENBQUMsS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bmdpbmUucGFyc2Uoc291cmNlKTtcblx0XHRjb25zdCBjb250ZW50ID0gdGhpcy5lbmdpbmUudHJhbnNmb3JtKGFzdCwgdGhpcy5vcHRzKTtcblx0XHRyZXR1cm4gdGhpcy5lbmdpbmUucmVuZGVyZXJzLmh0bWwoY29udGVudCkgYXMgc3RyaW5nO1xuXHR9XG59XG4iXX0= |
@@ -1,5 +0,5 @@ | ||
import { BaseEngine } from "../baseEngine"; | ||
import { BaseEngine } from '../base-engine.js'; | ||
export declare class Nunjucks extends BaseEngine implements EngineInterface { | ||
constructor(opts?: object); | ||
render(source: string, data?: object): Promise<string>; | ||
constructor(options?: Record<string, unknown>); | ||
render(source: string, data?: Record<string, unknown>): Promise<string>; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Nunjucks = void 0; | ||
const baseEngine_1 = require("../baseEngine"); | ||
const nunjucks = require("nunjucks"); | ||
class Nunjucks extends baseEngine_1.BaseEngine { | ||
constructor(opts) { | ||
const base_engine_js_1 = require("../base-engine.js"); | ||
class Nunjucks extends base_engine_js_1.BaseEngine { | ||
constructor(options) { | ||
super(); | ||
this.names = ["nunjucks"]; | ||
this.names = ['nunjucks']; | ||
this.engine = nunjucks; | ||
this.opts = { autoescape: true }; //default opts | ||
if (opts) { | ||
this.opts = opts; | ||
this.opts = { autoescape: true }; // Default opts | ||
if (options) { | ||
this.opts = options; | ||
} | ||
this.setExtensions(["njk"]); | ||
this.setExtensions(['njk']); | ||
} | ||
@@ -31,2 +31,2 @@ async render(source, data) { | ||
exports.Nunjucks = Nunjucks; | ||
//# sourceMappingURL=nunjucks.js.map | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnVuanVja3MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZW5naW5lcy9udW5qdWNrcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSx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import { BaseEngine } from "../baseEngine"; | ||
import { BaseEngine } from '../base-engine.js'; | ||
export declare class Pug extends BaseEngine implements EngineInterface { | ||
constructor(opts?: object); | ||
render(source: string, data?: object): Promise<string>; | ||
constructor(options?: Record<string, unknown>); | ||
render(source: string, data?: Record<string, unknown>): Promise<string>; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Pug = void 0; | ||
const baseEngine_1 = require("../baseEngine"); | ||
const pug = require("pug"); | ||
class Pug extends baseEngine_1.BaseEngine { | ||
constructor(opts) { | ||
const base_engine_js_1 = require("../base-engine.js"); | ||
class Pug extends base_engine_js_1.BaseEngine { | ||
constructor(options) { | ||
super(); | ||
this.names = ["pug"]; | ||
this.names = ['pug']; | ||
this.engine = pug; | ||
if (opts) { | ||
this.opts = opts; | ||
if (options) { | ||
this.opts = options; | ||
} | ||
this.setExtensions(["pug", "jade"]); | ||
this.setExtensions(['pug', 'jade']); | ||
} | ||
@@ -23,3 +23,4 @@ async render(source, data) { | ||
} | ||
let template = pug.compile(source, this.opts); | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument | ||
const template = pug.compile(source, this.opts); | ||
return template(data); | ||
@@ -29,2 +30,2 @@ } | ||
exports.Pug = Pug; | ||
//# sourceMappingURL=pug.js.map | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2VuZ2luZXMvcHVnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDJCQUEyQjtBQUMzQixzREFBNkM7QUFFN0MsTUFBYSxHQUFJLFNBQVEsMkJBQVU7SUFDbEMsWUFBWSxPQUFpQztRQUM1QyxLQUFLLEVBQUUsQ0FBQztRQUVSLElBQUksQ0FBQyxLQUFLLEdBQUcsQ0FBQyxLQUFLLENBQUMsQ0FBQztRQUVyQixJQUFJLENB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0aGlzLmVuZ2luZSA9IHB1ZztcblxuXHRcdGlmIChvcHRpb25zKSB7XG5cdFx0XHR0aGlzLm9wdHMgPSBvcHRpb25zO1xuXHRcdH1cblxuXHRcdHRoaXMuc2V0RXh0ZW5zaW9ucyhbJ3B1ZycsICdqYWRlJ10pO1xuXHR9XG5cblx0YXN5bmMgcmVuZGVyKHNvdXJjZTogc3RyaW5nLCBkYXRhPzogUmVjb3JkPHN0cmluZywgdW5rbm93bj4pOiBQcm9taXNlPHN0cmluZz4ge1xuXHRcdGlmICh0aGlzLnJvb3RUZW1wbGF0ZVBhdGgpIHtcblx0XHRcdGlmICghdGhpcy5vcHRzKSB7XG5cdFx0XHRcdHRoaXMub3B0cyA9IHt9O1xuXHRcdFx0fVxuXG5cdFx0XHR0aGlzLm9wdHMuYmFzZWRpciA9IHRoaXMucm9vdFRlbXBsYXRlUGF0aDtcblx0XHR9XG5cblx0XHQvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLXVuc2FmZS1hcmd1bWVudFxuXHRcdGNvbnN0IHRlbXBsYXRlID0gcHVnLmNvbXBpbGUoc291cmNlLCB0aGlzLm9wdHMpO1xuXG5cdFx0cmV0dXJuIHRlbXBsYXRlKGRhdGEpO1xuXHR9XG59XG4iXX0= |
{ | ||
"name": "ecto", | ||
"version": "2.2.2", | ||
"version": "2.2.3", | ||
"description": "Modern Template Consolidation Engine for EJS, Markdown, Pug, Nunjucks, Liquid, and Handlebars", | ||
@@ -35,6 +35,6 @@ "main": "./dist/ecto.js", | ||
"watch": "tsc -w -p .", | ||
"clean": "rm -rf ./dist && rm -rf node_modules", | ||
"test": "jest --coverage", | ||
"clean": "rimraf ./dist && rimraf yarn.lock && rimraf package-lock.json && rimraf ./coverage && rimraf ./node_modules", | ||
"test": "xo --fix && vitest run --coverage", | ||
"compile": "tsc -p .", | ||
"build": "rm -rf ./dist && npm i && npm run test && npm run compile", | ||
"build": "rimraf ./dist && yarn && yarn test && yarn compile", | ||
"website:build": "npx docula", | ||
@@ -44,26 +44,28 @@ "website:serve": "npx docula serve" | ||
"dependencies": { | ||
"@jaredwray/fumanchu": "^1.0.3", | ||
"@markdoc/markdoc": "^0.3.2", | ||
"@jaredwray/fumanchu": "^1.1.2", | ||
"@markdoc/markdoc": "^0.3.4", | ||
"ejs": "^3.1.9", | ||
"fs-extra": "^11.1.1", | ||
"helper-date": "^1.0.1", | ||
"liquidjs": "^10.9.2", | ||
"liquidjs": "^10.9.3", | ||
"nunjucks": "^3.2.4", | ||
"pug": "^3.0.2", | ||
"underscore": "^1.13.6", | ||
"winston": "^3.10.0" | ||
"winston": "^3.11.0" | ||
}, | ||
"devDependencies": { | ||
"@types/ejs": "^3.1.3", | ||
"@types/express": "^4.17.18", | ||
"@types/fs-extra": "^11.0.2", | ||
"@types/jest": "^29.5.5", | ||
"@types/mustache": "^4.2.3", | ||
"@types/nunjucks": "^3.2.4", | ||
"@types/pug": "^2.0.7", | ||
"@types/underscore": "^1.11.9", | ||
"@types/ejs": "^3.1.4", | ||
"@types/express": "^4.17.20", | ||
"@types/fs-extra": "^11.0.3", | ||
"@types/mustache": "^4.2.4", | ||
"@types/nunjucks": "^3.2.5", | ||
"@types/pug": "^2.0.8", | ||
"@types/underscore": "^1.11.12", | ||
"@vitest/coverage-v8": "^0.34.6", | ||
"docula": "^0.3.6", | ||
"jest": "^29.7.0", | ||
"ts-jest": "^29.1.1", | ||
"typescript": "^5.2.2" | ||
"rimraf": "^5.0.5", | ||
"typescript": "^5.2.2", | ||
"vitest": "^0.34.6", | ||
"webpack": "^5.89.0", | ||
"xo": "^0.56.0" | ||
}, | ||
@@ -73,10 +75,3 @@ "files": [ | ||
"bin" | ||
], | ||
"jest": { | ||
"preset": "ts-jest", | ||
"testEnvironment": "node", | ||
"modulePathIgnorePatterns": [ | ||
"/dist" | ||
] | ||
} | ||
] | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
86610
529
14
23
1
Updated@jaredwray/fumanchu@^1.1.2
Updated@markdoc/markdoc@^0.3.4
Updatedliquidjs@^10.9.3
Updatedwinston@^3.11.0