@midwayjs/view 2.14.2 → 3.0.0-beta.12

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/CHANGELOG.md CHANGED
@@ -3,7 +3,7 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [2.14.2](https://github.com/midwayjs/midway/compare/v2.14.1...v2.14.2) (2021-12-28)
6
+ # [3.0.0-beta.12](https://github.com/midwayjs/midway/compare/v3.0.0-beta.11...v3.0.0-beta.12) (2021-12-28)
7
7
 
8
8
  **Note:** Version bump only for package @midwayjs/view
9
9
 
@@ -11,18 +11,88 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
- # [2.14.0](https://github.com/midwayjs/midway/compare/v2.13.5...v2.14.0) (2021-12-06)
14
+ # [3.0.0-beta.11](https://github.com/midwayjs/midway/compare/v3.0.0-beta.10...v3.0.0-beta.11) (2021-12-21)
15
+
16
+ **Note:** Version bump only for package @midwayjs/view
17
+
18
+
19
+
20
+
21
+
22
+ # [3.0.0-beta.10](https://github.com/midwayjs/midway/compare/v3.0.0-beta.9...v3.0.0-beta.10) (2021-12-20)
23
+
24
+ **Note:** Version bump only for package @midwayjs/view
25
+
26
+
27
+
28
+
29
+
30
+ # [3.0.0-beta.9](https://github.com/midwayjs/midway/compare/v3.0.0-beta.8...v3.0.0-beta.9) (2021-12-09)
31
+
32
+ **Note:** Version bump only for package @midwayjs/view
33
+
34
+
35
+
36
+
37
+
38
+ # [3.0.0-beta.8](https://github.com/midwayjs/midway/compare/v3.0.0-beta.7...v3.0.0-beta.8) (2021-12-08)
39
+
40
+
41
+ ### Bug Fixes
42
+
43
+ * express routing middleware takes effect at the controller level ([#1364](https://github.com/midwayjs/midway/issues/1364)) ([b9272e0](https://github.com/midwayjs/midway/commit/b9272e0971003443304b0c53815be31a0061b4bd))
44
+
45
+
46
+
47
+
48
+
49
+ # [3.0.0-beta.7](https://github.com/midwayjs/midway/compare/v3.0.0-beta.6...v3.0.0-beta.7) (2021-12-03)
15
50
 
16
51
 
17
52
  ### Bug Fixes
18
53
 
19
- * express routing middleware takes effect at the controller level ([#1364](https://github.com/midwayjs/midway/issues/1364)) ([5d5f299](https://github.com/midwayjs/midway/commit/5d5f2992be116ca71b21f01fd782e3a2ac072496))
54
+ * add app.keys ([#1395](https://github.com/midwayjs/midway/issues/1395)) ([c44afc6](https://github.com/midwayjs/midway/commit/c44afc6cc6764a959d1fa7ae04d60099282d156a))
55
+
56
+
57
+
58
+
59
+
60
+ # [3.0.0-beta.6](https://github.com/midwayjs/midway/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2021-11-26)
61
+
62
+ **Note:** Version bump only for package @midwayjs/view
63
+
64
+
65
+
66
+
67
+
68
+ # [3.0.0-beta.5](https://github.com/midwayjs/midway/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2021-11-25)
69
+
70
+ **Note:** Version bump only for package @midwayjs/view
71
+
72
+
73
+
74
+
75
+
76
+ # [3.0.0-beta.4](https://github.com/midwayjs/midway/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2021-11-24)
77
+
78
+ **Note:** Version bump only for package @midwayjs/view
79
+
80
+
81
+
82
+
83
+
84
+ # [3.0.0-beta.3](https://github.com/midwayjs/midway/compare/v3.0.0-beta.2...v3.0.0-beta.3) (2021-11-18)
85
+
86
+
87
+ ### Features
88
+
89
+ * add component and framework config definition ([#1367](https://github.com/midwayjs/midway/issues/1367)) ([b2fe615](https://github.com/midwayjs/midway/commit/b2fe6157f99659471ff1333eca0b86bb889f61a3))
20
90
 
21
91
 
22
92
 
23
93
 
24
94
 
25
- ## [2.13.4](https://github.com/midwayjs/midway/compare/v2.13.3...v2.13.4) (2021-10-21)
95
+ # [3.0.0-beta.2](https://github.com/midwayjs/midway/compare/v3.0.0-beta.1...v3.0.0-beta.2) (2021-11-16)
26
96
 
27
97
  **Note:** Version bump only for package @midwayjs/view
28
98
 
@@ -30,12 +100,12 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
30
100
 
31
101
 
32
102
 
33
- ## [2.13.3](https://github.com/midwayjs/midway/compare/v2.13.2...v2.13.3) (2021-09-28)
103
+ # [3.0.0-beta.1](https://github.com/midwayjs/midway/compare/v2.12.4...v3.0.0-beta.1) (2021-11-14)
34
104
 
35
105
 
36
106
  ### Features
37
107
 
38
- * add view, view-ejs and view-nunjucks ([#1308](https://github.com/midwayjs/midway/issues/1308)) ([2621ae1](https://github.com/midwayjs/midway/commit/2621ae1a82c5c4a4c4347b9bbb4349c8a75bee00))
108
+ * add view, view-ejs and view-nunjucks ([#1308](https://github.com/midwayjs/midway/issues/1308)) ([a00f44b](https://github.com/midwayjs/midway/commit/a00f44bd769052245cd49d49ab417d621bb89caa))
39
109
 
40
110
 
41
111
 
@@ -1,3 +1,3 @@
1
1
  declare const _default: (appInfo: any) => any;
2
- export = _default;
2
+ export default _default;
3
3
  //# sourceMappingURL=config.default.d.ts.map
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  const path_1 = require("path");
3
4
  const extend = require("extend2");
4
- module.exports = appInfo => {
5
+ exports.default = appInfo => {
5
6
  const originConfig = require('egg-view/config/config.default')(appInfo);
6
7
  return extend(true, originConfig, {
7
8
  view: {
@@ -1,3 +1,3 @@
1
1
  declare const _default: any;
2
- export = _default;
2
+ export default _default;
3
3
  //# sourceMappingURL=config.local.d.ts.map
@@ -1,3 +1,4 @@
1
1
  "use strict";
2
- module.exports = require('egg-view/config/config.local');
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = require('egg-view/config/config.local');
3
4
  //# sourceMappingURL=config.local.js.map
@@ -12,7 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ViewConfiguration = void 0;
13
13
  const decorator_1 = require("@midwayjs/decorator");
14
14
  const mw_util_1 = require("@midwayjs/mw-util");
15
- const path_1 = require("path");
15
+ const DefaultConfig = require("./config/config.default");
16
+ const LocalConfig = require("./config/config.local");
16
17
  const viewManager_1 = require("./viewManager");
17
18
  let ViewConfiguration = class ViewConfiguration {
18
19
  async onReady(container) {
@@ -35,7 +36,12 @@ __decorate([
35
36
  ViewConfiguration = __decorate([
36
37
  (0, decorator_1.Configuration)({
37
38
  namespace: 'view',
38
- importConfigs: [(0, path_1.join)(__dirname, 'config')],
39
+ importConfigs: [
40
+ {
41
+ default: DefaultConfig,
42
+ local: LocalConfig,
43
+ },
44
+ ],
39
45
  })
40
46
  ], ViewConfiguration);
41
47
  exports.ViewConfiguration = ViewConfiguration;
package/index.d.ts CHANGED
@@ -44,4 +44,29 @@ declare module '@midwayjs/core/dist/interface' {
44
44
  options?: RenderOptions
45
45
  ): Promise<string>;
46
46
  }
47
+
48
+ interface MidwayConfig {
49
+ view?: {
50
+ /**
51
+ * give a path to find the file, you can specify multiple path with `,` delimiter
52
+ */
53
+ root?: string;
54
+ /**
55
+ * whether cache the file's path
56
+ */
57
+ cache?: boolean;
58
+ /**
59
+ * defaultExtension can be added automatically when there is no extension when call `ctx.render`
60
+ */
61
+ defaultExtension?: string;
62
+ /**
63
+ * set the default view engine if you don't want specify the viewEngine every request.
64
+ */
65
+ defaultViewEngine?: string;
66
+ /**
67
+ * map the file extension to view engine, such as `{ '.ejs': 'ejs' }`
68
+ */
69
+ mapping?: Record<string, string>;
70
+ };
71
+ }
47
72
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/view",
3
- "version": "2.14.2",
3
+ "version": "3.0.0-beta.12",
4
4
  "description": "Midway Component for egg-view",
5
5
  "main": "dist/index.js",
6
6
  "typings": "index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "index.d.ts"
25
25
  ],
26
26
  "engines": {
27
- "node": ">= 12.13.0"
27
+ "node": ">=12"
28
28
  },
29
29
  "license": "MIT",
30
30
  "dependencies": {
@@ -33,10 +33,10 @@
33
33
  "extend2": "^1.0.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@midwayjs/core": "^2.14.0",
37
- "@midwayjs/decorator": "^2.14.0",
38
- "@midwayjs/koa": "^2.14.2",
39
- "@midwayjs/mock": "^2.14.0"
36
+ "@midwayjs/core": "^3.0.0-beta.12",
37
+ "@midwayjs/decorator": "^3.0.0-beta.12",
38
+ "@midwayjs/koa": "^3.0.0-beta.12",
39
+ "@midwayjs/mock": "^3.0.0-beta.12"
40
40
  },
41
- "gitHead": "68b7fd9182619e8428f353f24a52254abce6e5bf"
41
+ "gitHead": "1c46e53eb934248007eeb7fe3920f5ac24e272c6"
42
42
  }