@tsed/engines 8.25.0 → 8.25.2
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.
|
@@ -5,17 +5,19 @@ import { Engine } from "./Engine.js";
|
|
|
5
5
|
let TwingEngine = class TwingEngine extends Engine {
|
|
6
6
|
$compile(template, options) {
|
|
7
7
|
const engine = this.engine;
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
if (options.settings && options.settings.views && existsSync(options.settings.views)) {
|
|
9
|
+
const loader = engine.createFilesystemLoader(options.settings.views);
|
|
10
|
+
const environment = engine.createEnvironment(loader);
|
|
11
|
+
return async (options) => {
|
|
12
|
+
return environment.render(template, options);
|
|
13
|
+
};
|
|
14
14
|
}
|
|
15
|
-
const $cmp = this.instance.createTemplate(template);
|
|
16
15
|
return async (options) => {
|
|
17
|
-
const
|
|
18
|
-
|
|
16
|
+
const loader = engine.createArrayLoader({
|
|
17
|
+
"index.twig": template
|
|
18
|
+
});
|
|
19
|
+
const environment = engine.createEnvironment(loader);
|
|
20
|
+
return environment.render("index.twig", options);
|
|
19
21
|
};
|
|
20
22
|
}
|
|
21
23
|
};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@tsed/engines",
|
|
3
3
|
"description": "Template engines library. Provide an API to adding custom engines from decorators.",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "8.25.
|
|
5
|
+
"version": "8.25.2",
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
7
|
"main": "./lib/esm/index.js",
|
|
8
8
|
"module": "./lib/esm/index.js",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"@babel/plugin-transform-runtime": "7.25.7",
|
|
43
43
|
"@babel/preset-env": "7.27.2",
|
|
44
44
|
"@babel/preset-react": "7.25.7",
|
|
45
|
-
"@tsed/barrels": "8.25.
|
|
46
|
-
"@tsed/typescript": "8.25.
|
|
45
|
+
"@tsed/barrels": "8.25.2",
|
|
46
|
+
"@tsed/typescript": "8.25.2",
|
|
47
47
|
"@types/semver": "^7.5.8",
|
|
48
48
|
"atpl": "0.9.3",
|
|
49
49
|
"bracket-template": "^1.1.5",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"tinyliquid": "^0.2.34",
|
|
89
89
|
"ts-node": "10.9.2",
|
|
90
90
|
"twig": "^1.17.1",
|
|
91
|
-
"twing": "^
|
|
91
|
+
"twing": "^7.3.1",
|
|
92
92
|
"typescript": "5.9.3",
|
|
93
93
|
"underscore": "^1.13.7",
|
|
94
94
|
"vash": "^0.13.0",
|