@zenweb/template 3.2.0 → 4.0.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/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/render.js +1 -1
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +2 -2
- package/package.json +11 -6
- package/CHANGELOG.md +0 -13
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { SetupFunction } from '@zenweb/core';
|
|
2
|
-
import { RenderManager } from '@zenweb/result';
|
|
3
2
|
import { TemplateSetupOption, TemplateOption } from './types';
|
|
4
3
|
import { TEMPLATE_OPTION } from './render';
|
|
5
4
|
export * from './types';
|
|
6
|
-
export { RenderManager };
|
|
7
5
|
export default function setup(option: TemplateSetupOption): SetupFunction;
|
|
8
6
|
declare module '@zenweb/core' {
|
|
9
7
|
interface Context {
|
package/dist/index.js
CHANGED
|
@@ -14,9 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.RenderManager = void 0;
|
|
18
17
|
const result_1 = require("@zenweb/result");
|
|
19
|
-
Object.defineProperty(exports, "RenderManager", { enumerable: true, get: function () { return result_1.RenderManager; } });
|
|
20
18
|
const render_1 = require("./render");
|
|
21
19
|
__exportStar(require("./types"), exports);
|
|
22
20
|
function contextTemplate(template_or_option) {
|
package/dist/render.js
CHANGED
|
@@ -41,7 +41,7 @@ class TemplateRender {
|
|
|
41
41
|
if (data instanceof result_1.ResultFail) {
|
|
42
42
|
data = { fail: data };
|
|
43
43
|
if (opt.failTemplate !== false) {
|
|
44
|
-
template = opt.failTemplate || this._option.failTemplate;
|
|
44
|
+
template = opt.failTemplate || this._option.failTemplate || template;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
if (!template) {
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const debug:
|
|
1
|
+
import { Debugger } from '@zenweb/core';
|
|
2
|
+
export declare const debug: Debugger;
|
|
3
3
|
export declare function cwdPath(p: string): string;
|
package/dist/utils.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.cwdPath = exports.debug = void 0;
|
|
4
4
|
const path = require("path");
|
|
5
|
-
const
|
|
6
|
-
exports.debug =
|
|
5
|
+
const core_1 = require("@zenweb/core");
|
|
6
|
+
exports.debug = core_1.debug.extend('template');
|
|
7
7
|
function cwdPath(p) {
|
|
8
8
|
if (p.startsWith('./')) {
|
|
9
9
|
return path.join(process.cwd(), p.slice(2));
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenweb/template",
|
|
3
|
-
"
|
|
3
|
+
"packageManager": "yarn@4.0.2",
|
|
4
|
+
"version": "4.0.0",
|
|
4
5
|
"description": "zenweb template render module",
|
|
5
6
|
"exports": "./dist/index.js",
|
|
6
7
|
"types": "./dist/index.d.ts",
|
|
7
8
|
"scripts": {
|
|
9
|
+
"vscode": "yarn dlx @yarnpkg/sdks vscode",
|
|
8
10
|
"build": "rimraf dist && tsc",
|
|
9
|
-
"prepublishOnly": "
|
|
10
|
-
"dev": "cd example && cross-env DEBUG
|
|
11
|
+
"prepublishOnly": "yarn run build",
|
|
12
|
+
"dev": "cd example && cross-env DEBUG=\\* ts-node app"
|
|
11
13
|
},
|
|
12
14
|
"files": [
|
|
13
15
|
"dist"
|
|
@@ -24,15 +26,18 @@
|
|
|
24
26
|
"license": "MIT",
|
|
25
27
|
"homepage": "https://zenweb.node.ltd",
|
|
26
28
|
"devDependencies": {
|
|
29
|
+
"@types/node": "^20.10.6",
|
|
30
|
+
"@zenweb/inject": "^4.0.6",
|
|
27
31
|
"@zenweb/template-handlebars": "^3.0.0",
|
|
28
32
|
"@zenweb/template-nunjucks": "^3.0.0",
|
|
29
33
|
"cross-env": "^7.0.3",
|
|
30
34
|
"rimraf": "^4.4.1",
|
|
31
35
|
"ts-node": "^10.9.1",
|
|
32
|
-
"typescript": "^5.
|
|
33
|
-
"zenweb": "^
|
|
36
|
+
"typescript": "^5.3.3",
|
|
37
|
+
"zenweb": "^4.2.7"
|
|
34
38
|
},
|
|
35
39
|
"dependencies": {
|
|
36
|
-
"
|
|
40
|
+
"@zenweb/core": "^4.2.1",
|
|
41
|
+
"@zenweb/result": "^3.12.6"
|
|
37
42
|
}
|
|
38
43
|
}
|
package/CHANGELOG.md
DELETED