@midwayjs/view-nunjucks 3.0.0-beta.2 → 3.0.0-beta.6

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,41 @@
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.6](https://github.com/midwayjs/midway/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2021-11-26)
7
+
8
+ **Note:** Version bump only for package @midwayjs/view-nunjucks
9
+
10
+
11
+
12
+
13
+
14
+ # [3.0.0-beta.5](https://github.com/midwayjs/midway/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2021-11-25)
15
+
16
+ **Note:** Version bump only for package @midwayjs/view-nunjucks
17
+
18
+
19
+
20
+
21
+
22
+ # [3.0.0-beta.4](https://github.com/midwayjs/midway/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2021-11-24)
23
+
24
+ **Note:** Version bump only for package @midwayjs/view-nunjucks
25
+
26
+
27
+
28
+
29
+
30
+ # [3.0.0-beta.3](https://github.com/midwayjs/midway/compare/v3.0.0-beta.2...v3.0.0-beta.3) (2021-11-18)
31
+
32
+
33
+ ### Features
34
+
35
+ * add component and framework config definition ([#1367](https://github.com/midwayjs/midway/issues/1367)) ([b2fe615](https://github.com/midwayjs/midway/commit/b2fe6157f99659471ff1333eca0b86bb889f61a3))
36
+
37
+
38
+
39
+
40
+
6
41
  # [3.0.0-beta.2](https://github.com/midwayjs/midway/compare/v3.0.0-beta.1...v3.0.0-beta.2) (2021-11-16)
7
42
 
8
43
  **Note:** Version bump only for package @midwayjs/view-nunjucks
@@ -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.2",
3
+ "version": "3.0.0-beta.6",
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.2",
34
+ "@midwayjs/view": "^3.0.0-beta.6",
34
35
  "nunjucks": "^3.2.2"
35
36
  },
36
37
  "devDependencies": {
37
- "@midwayjs/core": "^3.0.0-beta.2",
38
- "@midwayjs/decorator": "^3.0.0-beta.2",
39
- "@midwayjs/koa": "^3.0.0-beta.2",
40
- "@midwayjs/mock": "^3.0.0-beta.2"
38
+ "@midwayjs/core": "^3.0.0-beta.6",
39
+ "@midwayjs/decorator": "^3.0.0-beta.6",
40
+ "@midwayjs/koa": "^3.0.0-beta.6",
41
+ "@midwayjs/mock": "^3.0.0-beta.6"
41
42
  },
42
- "gitHead": "7f07de960da1155a9f7df554e1789c7a97bdd3fe"
43
+ "gitHead": "e4595d30b369e36bef21b36f2b3737d8bc2f802d"
43
44
  }