@midwayjs/view 2.13.3 → 3.0.0-beta.10

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,12 +3,93 @@
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.13.3](https://github.com/midwayjs/midway/compare/v2.13.2...v2.13.3) (2021-09-28)
6
+ # [3.0.0-beta.10](https://github.com/midwayjs/midway/compare/v3.0.0-beta.9...v3.0.0-beta.10) (2021-12-20)
7
+
8
+ **Note:** Version bump only for package @midwayjs/view
9
+
10
+
11
+
12
+
13
+
14
+ # [3.0.0-beta.9](https://github.com/midwayjs/midway/compare/v3.0.0-beta.8...v3.0.0-beta.9) (2021-12-09)
15
+
16
+ **Note:** Version bump only for package @midwayjs/view
17
+
18
+
19
+
20
+
21
+
22
+ # [3.0.0-beta.8](https://github.com/midwayjs/midway/compare/v3.0.0-beta.7...v3.0.0-beta.8) (2021-12-08)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * 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))
28
+
29
+
30
+
31
+
32
+
33
+ # [3.0.0-beta.7](https://github.com/midwayjs/midway/compare/v3.0.0-beta.6...v3.0.0-beta.7) (2021-12-03)
34
+
35
+
36
+ ### Bug Fixes
37
+
38
+ * add app.keys ([#1395](https://github.com/midwayjs/midway/issues/1395)) ([c44afc6](https://github.com/midwayjs/midway/commit/c44afc6cc6764a959d1fa7ae04d60099282d156a))
39
+
40
+
41
+
42
+
43
+
44
+ # [3.0.0-beta.6](https://github.com/midwayjs/midway/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2021-11-26)
45
+
46
+ **Note:** Version bump only for package @midwayjs/view
47
+
48
+
49
+
50
+
51
+
52
+ # [3.0.0-beta.5](https://github.com/midwayjs/midway/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2021-11-25)
53
+
54
+ **Note:** Version bump only for package @midwayjs/view
55
+
56
+
57
+
58
+
59
+
60
+ # [3.0.0-beta.4](https://github.com/midwayjs/midway/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2021-11-24)
61
+
62
+ **Note:** Version bump only for package @midwayjs/view
63
+
64
+
65
+
66
+
67
+
68
+ # [3.0.0-beta.3](https://github.com/midwayjs/midway/compare/v3.0.0-beta.2...v3.0.0-beta.3) (2021-11-18)
69
+
70
+
71
+ ### Features
72
+
73
+ * add component and framework config definition ([#1367](https://github.com/midwayjs/midway/issues/1367)) ([b2fe615](https://github.com/midwayjs/midway/commit/b2fe6157f99659471ff1333eca0b86bb889f61a3))
74
+
75
+
76
+
77
+
78
+
79
+ # [3.0.0-beta.2](https://github.com/midwayjs/midway/compare/v3.0.0-beta.1...v3.0.0-beta.2) (2021-11-16)
80
+
81
+ **Note:** Version bump only for package @midwayjs/view
82
+
83
+
84
+
85
+
86
+
87
+ # [3.0.0-beta.1](https://github.com/midwayjs/midway/compare/v2.12.4...v3.0.0-beta.1) (2021-11-14)
7
88
 
8
89
 
9
90
  ### Features
10
91
 
11
- * add view, view-ejs and view-nunjucks ([#1308](https://github.com/midwayjs/midway/issues/1308)) ([2621ae1](https://github.com/midwayjs/midway/commit/2621ae1a82c5c4a4c4347b9bbb4349c8a75bee00))
92
+ * add view, view-ejs and view-nunjucks ([#1308](https://github.com/midwayjs/midway/issues/1308)) ([a00f44b](https://github.com/midwayjs/midway/commit/a00f44bd769052245cd49d49ab417d621bb89caa))
12
93
 
13
94
 
14
95
 
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  this is a sub package for midway.
7
7
 
8
- Document: [https://midwayjs.org/midway](https://midwayjs.org/midway)
8
+ Document: [https://midwayjs.org](https://midwayjs.org)
9
9
 
10
10
  ## License
11
11
 
@@ -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.13.3",
3
+ "version": "3.0.0-beta.10",
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.13.3",
37
- "@midwayjs/decorator": "^2.13.2",
38
- "@midwayjs/koa": "^2.13.3",
39
- "@midwayjs/mock": "^2.13.3"
36
+ "@midwayjs/core": "^3.0.0-beta.10",
37
+ "@midwayjs/decorator": "^3.0.0-beta.10",
38
+ "@midwayjs/koa": "^3.0.0-beta.10",
39
+ "@midwayjs/mock": "^3.0.0-beta.10"
40
40
  },
41
- "gitHead": "30f63af0d6560421b36f31064cb20b13a53b5afb"
41
+ "gitHead": "153870f2e2dd6b17673ec7591e49224a6bd51b36"
42
42
  }