html-express-js 4.1.0 → 4.2.1

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/package.json CHANGED
@@ -1,12 +1,24 @@
1
1
  {
2
2
  "name": "html-express-js",
3
- "version": "4.1.0",
3
+ "version": "4.2.1",
4
4
  "description": "An Express template engine to render HTML views using native JavaScript",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
7
7
  "engines": {
8
8
  "node": ">=16"
9
9
  },
10
+ "devEngines": {
11
+ "runtime": {
12
+ "name": "node",
13
+ "version": ">=22.19",
14
+ "onFail": "error"
15
+ },
16
+ "packageManager": {
17
+ "name": "npm",
18
+ "version": ">=10.9.3",
19
+ "onFail": "error"
20
+ }
21
+ },
10
22
  "files": [
11
23
  "src/index.js",
12
24
  "src/index.d.ts"
@@ -47,13 +59,13 @@
47
59
  "@types/mocha": "^10.0.6",
48
60
  "@types/reload": "^3.2.3",
49
61
  "@types/sinon": "^17.0.3",
50
- "chai": "^5.1.0",
62
+ "chai": "^6.0.1",
51
63
  "chokidar": "^4.0.1",
52
64
  "express": "^5.1.0",
53
65
  "husky": "^9.0.7",
54
66
  "mocha": "^11.0.1",
55
67
  "prettier": "^3.0.3",
56
- "release-it": "17.1.1",
68
+ "release-it": "19.0.4",
57
69
  "reload": "^3.2.0",
58
70
  "sinon": "^21.0.0",
59
71
  "typescript": "^5.4.3"
package/src/index.d.ts CHANGED
@@ -31,7 +31,8 @@ export default function _default(opts?: HTMLExpressOptions): {
31
31
  staticIndexHandler: HTMLExpressStaticIndexHandler;
32
32
  engine: Parameters<import("express").Application["engine"]>[1];
33
33
  };
34
- export type HTMLExpressStaticIndexHandler = () => import("express").RequestHandler;
34
+ export type HTMLExpressStaticAsyncRequestHandler = (req: import("express").Request, res: import("express").Response, next: import("express").NextFunction) => Promise<void>;
35
+ export type HTMLExpressStaticIndexHandler = () => HTMLExpressStaticAsyncRequestHandler;
35
36
  export type HTMLExpressBuildStateHandler = (req: import("express").Request) => Promise<Record<string, any>>;
36
37
  export type HTMLExpressOptions = {
37
38
  /**
package/src/index.js CHANGED
@@ -127,9 +127,17 @@ export function html(strings, ...data) {
127
127
  return rawHtml;
128
128
  }
129
129
 
130
+ /**
131
+ * @callback HTMLExpressStaticAsyncRequestHandler
132
+ * @param {import('express').Request} req
133
+ * @param {import('express').Response} res
134
+ * @param {import('express').NextFunction} next
135
+ * @returns {Promise<void>}
136
+ */
137
+
130
138
  /**
131
139
  * @callback HTMLExpressStaticIndexHandler
132
- * @returns {import('express').RequestHandler}
140
+ * @returns {HTMLExpressStaticAsyncRequestHandler}
133
141
  */
134
142
 
135
143
  /**