@midwayjs/view-nunjucks 3.0.0-beta.1 → 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,6 +3,84 @@
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
+ # [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-nunjucks
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-nunjucks
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
+ **Note:** Version bump only for package @midwayjs/view-nunjucks
36
+
37
+
38
+
39
+
40
+
41
+ # [3.0.0-beta.6](https://github.com/midwayjs/midway/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2021-11-26)
42
+
43
+ **Note:** Version bump only for package @midwayjs/view-nunjucks
44
+
45
+
46
+
47
+
48
+
49
+ # [3.0.0-beta.5](https://github.com/midwayjs/midway/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2021-11-25)
50
+
51
+ **Note:** Version bump only for package @midwayjs/view-nunjucks
52
+
53
+
54
+
55
+
56
+
57
+ # [3.0.0-beta.4](https://github.com/midwayjs/midway/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2021-11-24)
58
+
59
+ **Note:** Version bump only for package @midwayjs/view-nunjucks
60
+
61
+
62
+
63
+
64
+
65
+ # [3.0.0-beta.3](https://github.com/midwayjs/midway/compare/v3.0.0-beta.2...v3.0.0-beta.3) (2021-11-18)
66
+
67
+
68
+ ### Features
69
+
70
+ * add component and framework config definition ([#1367](https://github.com/midwayjs/midway/issues/1367)) ([b2fe615](https://github.com/midwayjs/midway/commit/b2fe6157f99659471ff1333eca0b86bb889f61a3))
71
+
72
+
73
+
74
+
75
+
76
+ # [3.0.0-beta.2](https://github.com/midwayjs/midway/compare/v3.0.0-beta.1...v3.0.0-beta.2) (2021-11-16)
77
+
78
+ **Note:** Version bump only for package @midwayjs/view-nunjucks
79
+
80
+
81
+
82
+
83
+
6
84
  # [3.0.0-beta.1](https://github.com/midwayjs/midway/compare/v2.12.4...v3.0.0-beta.1) (2021-11-14)
7
85
 
8
86
 
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,18 +1,24 @@
1
1
  declare const _default: {
2
- /**
3
- * nunjucks config
4
- * @member Config#nunjucks
5
- * @property {Boolean} [autoescape=true] - controls if output with dangerous characters are escaped automatically.
6
- * @property {Boolean} [throwOnUndefined=false] - throw errors when outputting a null/undefined value
7
- * @property {Boolean} [trimBlocks=false] - automatically remove trailing newlines from a block/tag
8
- * @property {Boolean} [lstripBlocks=false] - automatically remove leading whitespace from a block/tag
9
- * @property {Boolean} [cache=true] - use a cache and recompile templates each time. false in local env.
10
- */
11
2
  nunjucks: {
3
+ /**
4
+ * controls if output with dangerous characters are escaped automatically.
5
+ */
12
6
  autoescape: boolean;
7
+ /**
8
+ * throw errors when outputting a null/undefined value
9
+ */
13
10
  throwOnUndefined: boolean;
11
+ /**
12
+ * automatically remove trailing newlines from a block/tag
13
+ */
14
14
  trimBlocks: boolean;
15
+ /**
16
+ * automatically remove leading whitespace from a block/tag
17
+ */
15
18
  lstripBlocks: boolean;
19
+ /**
20
+ * use a cache and recompile templates each time. false in local env.
21
+ */
16
22
  cache: boolean;
17
23
  };
18
24
  };
@@ -1,15 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
- /**
5
- * nunjucks config
6
- * @member Config#nunjucks
7
- * @property {Boolean} [autoescape=true] - controls if output with dangerous characters are escaped automatically.
8
- * @property {Boolean} [throwOnUndefined=false] - throw errors when outputting a null/undefined value
9
- * @property {Boolean} [trimBlocks=false] - automatically remove trailing newlines from a block/tag
10
- * @property {Boolean} [lstripBlocks=false] - automatically remove leading whitespace from a block/tag
11
- * @property {Boolean} [cache=true] - use a cache and recompile templates each time. false in local env.
12
- */
13
4
  nunjucks: {
14
5
  autoescape: true,
15
6
  throwOnUndefined: false,
@@ -12,9 +12,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ViewNunjucksConfiguration = void 0;
13
13
  const decorator_1 = require("@midwayjs/decorator");
14
14
  const View = require("@midwayjs/view");
15
- const path_1 = require("path");
16
15
  const view_1 = require("./view");
17
16
  const engine_1 = require("./engine");
17
+ const DefaultConfig = require("./config/config.default");
18
+ const LocalConfig = require("./config/config.local");
18
19
  let ViewNunjucksConfiguration = class ViewNunjucksConfiguration {
19
20
  async onReady(container) {
20
21
  this.app.nunjucks = await container.getAsync(engine_1.NunjucksEnvironment);
@@ -32,7 +33,12 @@ __decorate([
32
33
  ViewNunjucksConfiguration = __decorate([
33
34
  (0, decorator_1.Configuration)({
34
35
  namespace: 'view-nunjucks',
35
- importConfigs: [(0, path_1.join)(__dirname, 'config')],
36
+ importConfigs: [
37
+ {
38
+ default: DefaultConfig,
39
+ local: LocalConfig,
40
+ },
41
+ ],
36
42
  imports: [View],
37
43
  })
38
44
  ], ViewNunjucksConfiguration);
package/index.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import _default from './dist/config/config.default';
2
+ export * from './dist/index';
3
+
4
+ declare module '@midwayjs/core/dist/interface' {
5
+ // eslint-disable-next-line
6
+ interface MidwayConfig extends Partial<typeof _default> {}
7
+ }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@midwayjs/view-nunjucks",
3
- "version": "3.0.0-beta.1",
3
+ "version": "3.0.0-beta.10",
4
4
  "description": "Midway Component for egg-view-nunjucks",
5
5
  "main": "dist/index.js",
6
- "typings": "dist/index.d.ts",
6
+ "typings": "index.d.ts",
7
7
  "scripts": {
8
8
  "build": "tsc",
9
9
  "test": "node --require=ts-node/register ../../node_modules/.bin/jest",
@@ -22,7 +22,8 @@
22
22
  "author": "",
23
23
  "files": [
24
24
  "dist/**/*.js",
25
- "dist/**/*.d.ts"
25
+ "dist/**/*.d.ts",
26
+ "index.d.ts"
26
27
  ],
27
28
  "engines": {
28
29
  "node": ">=12"
@@ -30,14 +31,14 @@
30
31
  "license": "MIT",
31
32
  "dependencies": {
32
33
  "@midwayjs/mw-util": "^1.0.0",
33
- "@midwayjs/view": "^3.0.0-beta.1",
34
+ "@midwayjs/view": "^3.0.0-beta.10",
34
35
  "nunjucks": "^3.2.2"
35
36
  },
36
37
  "devDependencies": {
37
- "@midwayjs/core": "^3.0.0-beta.1",
38
- "@midwayjs/decorator": "^3.0.0-beta.1",
39
- "@midwayjs/koa": "^3.0.0-beta.1",
40
- "@midwayjs/mock": "^3.0.0-beta.1"
38
+ "@midwayjs/core": "^3.0.0-beta.10",
39
+ "@midwayjs/decorator": "^3.0.0-beta.10",
40
+ "@midwayjs/koa": "^3.0.0-beta.10",
41
+ "@midwayjs/mock": "^3.0.0-beta.10"
41
42
  },
42
- "gitHead": "72e4d20c678e65a5440c4e9a6d3b70046daa497c"
43
+ "gitHead": "153870f2e2dd6b17673ec7591e49224a6bd51b36"
43
44
  }