@midwayjs/view 2.13.0 → 2.14.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/CHANGELOG.md CHANGED
@@ -3,6 +3,36 @@
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.0](https://github.com/midwayjs/midway/compare/v2.13.5...v2.14.0) (2021-12-06)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * 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))
12
+
13
+
14
+
15
+
16
+
17
+ ## [2.13.4](https://github.com/midwayjs/midway/compare/v2.13.3...v2.13.4) (2021-10-21)
18
+
19
+ **Note:** Version bump only for package @midwayjs/view
20
+
21
+
22
+
23
+
24
+
25
+ ## [2.13.3](https://github.com/midwayjs/midway/compare/v2.13.2...v2.13.3) (2021-09-28)
26
+
27
+
28
+ ### Features
29
+
30
+ * add view, view-ejs and view-nunjucks ([#1308](https://github.com/midwayjs/midway/issues/1308)) ([2621ae1](https://github.com/midwayjs/midway/commit/2621ae1a82c5c4a4c4347b9bbb4349c8a75bee00))
31
+
32
+
33
+
34
+
35
+
6
36
  ## [2.13.2](https://github.com/midwayjs/midway/compare/v2.13.1...v2.13.2) (2021-09-09)
7
37
 
8
38
  **Note:** Version bump only for package @midwayjs/typegoose
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2013 - Now midwayjs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,12 @@
1
+ # midway-view
2
+
3
+ [![Package Quality](http://npm.packagequality.com/shield/@midwayjs/view.svg)](http://packagequality.com/#?package=@midwayjs/view)
4
+ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/midwayjs/midway/pulls)
5
+
6
+ this is a sub package for midway.
7
+
8
+ Document: [https://midwayjs.org](https://midwayjs.org)
9
+
10
+ ## License
11
+
12
+ [MIT]((http://github.com/midwayjs/midway/blob/master/LICENSE))
package/index.d.ts ADDED
@@ -0,0 +1,47 @@
1
+ export * from './dist/index';
2
+
3
+ interface RenderOptions {
4
+ name?: string;
5
+ root?: string;
6
+ locals?: Record<string, any>;
7
+ viewEngine?: string;
8
+ }
9
+
10
+ declare module '@midwayjs/core/dist/interface' {
11
+ interface Context {
12
+ /**
13
+ * Render a file by view engine, then set to body
14
+ * @param {String} name - the file path based on root
15
+ * @param {Object} [locals] - data used by template
16
+ * @param {Object} [options] - view options, you can use `options.viewEngine` to specify view engine
17
+ * @return {Promise<String>} result - return a promise with a render result
18
+ */
19
+ render(name: string, locals?: any, options?: RenderOptions): Promise<null>;
20
+
21
+ /**
22
+ * Render a file by view engine and return it
23
+ * @param {String} name - the file path based on root
24
+ * @param {Object} [locals] - data used by template
25
+ * @param {Object} [options] - view options, you can use `options.viewEngine` to specify view engine
26
+ * @return {Promise<String>} result - return a promise with a render result
27
+ */
28
+ renderView(
29
+ name: string,
30
+ locals?: any,
31
+ options?: RenderOptions
32
+ ): Promise<string>;
33
+
34
+ /**
35
+ * Render a template string by view engine
36
+ * @param {String} tpl - template string
37
+ * @param {Object} [locals] - data used by template
38
+ * @param {Object} [options] - view options, you can use `options.viewEngine` to specify view engine
39
+ * @return {Promise<String>} result - return a promise with a render result
40
+ */
41
+ renderString(
42
+ name: string,
43
+ locals?: any,
44
+ options?: RenderOptions
45
+ ): Promise<string>;
46
+ }
47
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/view",
3
- "version": "2.13.0",
3
+ "version": "2.14.0",
4
4
  "description": "Midway Component for egg-view",
5
5
  "main": "dist/index.js",
6
6
  "typings": "index.d.ts",
@@ -20,7 +20,8 @@
20
20
  "author": "",
21
21
  "files": [
22
22
  "dist/**/*.js",
23
- "dist/**/*.d.ts"
23
+ "dist/**/*.d.ts",
24
+ "index.d.ts"
24
25
  ],
25
26
  "engines": {
26
27
  "node": ">= 12.13.0"
@@ -32,9 +33,10 @@
32
33
  "extend2": "^1.0.0"
33
34
  },
34
35
  "devDependencies": {
35
- "@midwayjs/core": "^2.13.2",
36
- "@midwayjs/decorator": "^2.13.2",
37
- "@midwayjs/koa": "^2.13.2",
38
- "@midwayjs/mock": "^2.13.2"
39
- }
36
+ "@midwayjs/core": "^2.14.0",
37
+ "@midwayjs/decorator": "^2.14.0",
38
+ "@midwayjs/koa": "^2.14.0",
39
+ "@midwayjs/mock": "^2.14.0"
40
+ },
41
+ "gitHead": "5fd716b0e731162d8e9f0931790fde7402fb83de"
40
42
  }