@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 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
- /// <reference types="debug" />
2
- export declare const debug: import("debug").Debugger;
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 debug_1 = require("debug");
6
- exports.debug = (0, debug_1.default)('zenweb:template');
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
- "version": "3.2.0",
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": "npm run build",
10
- "dev": "cd example && cross-env DEBUG=* ts-node app"
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.0.2",
33
- "zenweb": "^3.18.0"
36
+ "typescript": "^5.3.3",
37
+ "zenweb": "^4.2.7"
34
38
  },
35
39
  "dependencies": {
36
- "debug": "^4.3.4"
40
+ "@zenweb/core": "^4.2.1",
41
+ "@zenweb/result": "^3.12.6"
37
42
  }
38
43
  }
package/CHANGELOG.md DELETED
@@ -1,13 +0,0 @@
1
- # Changelog
2
-
3
- ## [3.2.0] - 2023-4-3
4
- - 不再集成内置引擎,使用独立包
5
-
6
- ## [3.1.0] - 2023-4-2
7
- - 完成 failTemplate 功能
8
-
9
- ## [3.0.3] - 2023-4-2
10
- - 清除遗留的 console.log
11
-
12
- ## [3.0.2] - 2023-4-2
13
- - 使用 ctx.template 方法无 engine 指定的情况下使用第一匹配的 engine