@sitecore-jss/sitecore-jss-rendering-host 22.3.0 → 22.3.1-canary.11

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.
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getDefaultAppInvocationInfoResolver = void 0;
6
+ exports.getDefaultAppInvocationInfoResolver = getDefaultAppInvocationInfoResolver;
7
7
  const import_fresh_1 = __importDefault(require("import-fresh"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  /**
@@ -16,8 +16,7 @@ const path_1 = __importDefault(require("path"));
16
16
  * `JSSAppName` is the `id` property of the JSON request body that is POSTed to the rendering host by Sitecore.
17
17
  *
18
18
  * `serverBundleName` is the name of the JavaScript file (typically a bundle) that contains the function for rendering your app.
19
- *
20
- * @param {string} [baseAppPath='./dist'] The base path to your JSS app(s), defaults to `./dist`
19
+ * @param {string} [baseAppPath] The base path to your JSS app(s), defaults to `./dist`
21
20
  * @returns {AppInvocationInfoResolver} resolver
22
21
  */
23
22
  function getDefaultAppInvocationInfoResolver({ appPathResolver = (requestJson) => {
@@ -48,4 +47,3 @@ function getDefaultAppInvocationInfoResolver({ appPathResolver = (requestJson) =
48
47
  };
49
48
  return resolver;
50
49
  }
51
- exports.getDefaultAppInvocationInfoResolver = getDefaultAppInvocationInfoResolver;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.startDevServer = void 0;
6
+ exports.startDevServer = startDevServer;
7
7
  const del_1 = require("del");
8
8
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
9
9
  // @ts-ignore
@@ -149,12 +149,11 @@ function startDevServer({ port = 0, tunnelUrl, configFactory, buildArtifactsPath
149
149
  invokeHook(hooks.afterDevServerStarted, server);
150
150
  });
151
151
  }
152
- exports.startDevServer = startDevServer;
153
152
  /**
154
153
  * @param {Function | undefined} hook
155
154
  * @param {...unknown} args
156
155
  */
157
- // eslint-disable-next-line @typescript-eslint/ban-types
156
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
158
157
  function invokeHook(hook, ...args) {
159
158
  if (hook && typeof hook === 'function') {
160
159
  hook(...args);
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.startRenderingHostServer = void 0;
6
+ exports.startRenderingHostServer = startRenderingHostServer;
7
7
  const compression_1 = __importDefault(require("compression"));
8
8
  const express_1 = __importDefault(require("express"));
9
9
  // import importFresh from 'import-fresh';
@@ -47,12 +47,11 @@ function startRenderingHostServer({ port = 0, hostname = 'localhost', hooks = {}
47
47
  invokeHook(hooks.afterServerStarted, server);
48
48
  });
49
49
  }
50
- exports.startRenderingHostServer = startRenderingHostServer;
51
50
  /**
52
51
  * @param {Function | undefined} hook
53
52
  * @param {...unknown} args
54
53
  */
55
- // eslint-disable-next-line @typescript-eslint/ban-types
54
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
56
55
  function invokeHook(hook, ...args) {
57
56
  if (hook && typeof hook === 'function') {
58
57
  hook(...args);
@@ -3,7 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.tryParseJson = exports.extractJsonFromStreamData = exports.onReadableStreamDataHandler = exports.respondWithError = exports.readRequestBodyAsJson = exports.getDefaultAppRendererCallback = exports.ssrMiddleware = void 0;
6
+ exports.ssrMiddleware = void 0;
7
+ exports.getDefaultAppRendererCallback = getDefaultAppRendererCallback;
8
+ exports.readRequestBodyAsJson = readRequestBodyAsJson;
9
+ exports.respondWithError = respondWithError;
10
+ exports.onReadableStreamDataHandler = onReadableStreamDataHandler;
11
+ exports.extractJsonFromStreamData = extractJsonFromStreamData;
12
+ exports.tryParseJson = tryParseJson;
7
13
  const zlib_1 = __importDefault(require("zlib")); // node.js standard lib
8
14
  // may be used by a "standalone" JSS rendering host / express server.
9
15
  const ssrMiddleware = ({ appInvocationInfoResolver, }) => {
@@ -59,7 +65,6 @@ function getDefaultAppRendererCallback(res) {
59
65
  };
60
66
  return callback;
61
67
  }
62
- exports.getDefaultAppRendererCallback = getDefaultAppRendererCallback;
63
68
  /**
64
69
  * @param {IncomingMessage} request
65
70
  */
@@ -75,7 +80,6 @@ function readRequestBodyAsJson(request) {
75
80
  });
76
81
  });
77
82
  }
78
- exports.readRequestBodyAsJson = readRequestBodyAsJson;
79
83
  /**
80
84
  * @param {ServerResponse} res
81
85
  * @param {Error} errorValue
@@ -88,9 +92,8 @@ function respondWithError(res, errorValue) {
88
92
  errorDetails: errorValue.stack || null,
89
93
  }));
90
94
  }
91
- exports.respondWithError = respondWithError;
92
95
  /**
93
- * @param {Object} dataWriter
96
+ * @param {object} dataWriter
94
97
  * @param {Buffer} dataWriter.output
95
98
  */
96
99
  function onReadableStreamDataHandler(dataWriter) {
@@ -103,7 +106,6 @@ function onReadableStreamDataHandler(dataWriter) {
103
106
  }
104
107
  };
105
108
  }
106
- exports.onReadableStreamDataHandler = onReadableStreamDataHandler;
107
109
  /**
108
110
  * @param {Buffer} data
109
111
  * @param {string} [contentEncoding]
@@ -128,7 +130,6 @@ function extractJsonFromStreamData(data, contentEncoding) {
128
130
  }
129
131
  return responseString.then(tryParseJson);
130
132
  }
131
- exports.extractJsonFromStreamData = extractJsonFromStreamData;
132
133
  /**
133
134
  * @param {string} jsonString
134
135
  */
@@ -145,4 +146,3 @@ function tryParseJson(jsonString) {
145
146
  }
146
147
  return null;
147
148
  }
148
- exports.tryParseJson = tryParseJson;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.startRenderHostTunnel = void 0;
6
+ exports.startRenderHostTunnel = startRenderHostTunnel;
7
7
  const ngrok_1 = __importDefault(require("ngrok"));
8
8
  /**
9
9
  * @param {string} renderHostname
@@ -22,4 +22,3 @@ function startRenderHostTunnel(renderHostname, options = { port: 80, proto: 'htt
22
22
  return url;
23
23
  });
24
24
  }
25
- exports.startRenderHostTunnel = startRenderHostTunnel;
@@ -10,8 +10,7 @@ import path from 'path';
10
10
  * `JSSAppName` is the `id` property of the JSON request body that is POSTed to the rendering host by Sitecore.
11
11
  *
12
12
  * `serverBundleName` is the name of the JavaScript file (typically a bundle) that contains the function for rendering your app.
13
- *
14
- * @param {string} [baseAppPath='./dist'] The base path to your JSS app(s), defaults to `./dist`
13
+ * @param {string} [baseAppPath] The base path to your JSS app(s), defaults to `./dist`
15
14
  * @returns {AppInvocationInfoResolver} resolver
16
15
  */
17
16
  export function getDefaultAppInvocationInfoResolver({ appPathResolver = (requestJson) => {
@@ -147,7 +147,7 @@ export function startDevServer({ port = 0, tunnelUrl, configFactory, buildArtifa
147
147
  * @param {Function | undefined} hook
148
148
  * @param {...unknown} args
149
149
  */
150
- // eslint-disable-next-line @typescript-eslint/ban-types
150
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
151
151
  function invokeHook(hook, ...args) {
152
152
  if (hook && typeof hook === 'function') {
153
153
  hook(...args);
@@ -45,7 +45,7 @@ export function startRenderingHostServer({ port = 0, hostname = 'localhost', hoo
45
45
  * @param {Function | undefined} hook
46
46
  * @param {...unknown} args
47
47
  */
48
- // eslint-disable-next-line @typescript-eslint/ban-types
48
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
49
49
  function invokeHook(hook, ...args) {
50
50
  if (hook && typeof hook === 'function') {
51
51
  hook(...args);
@@ -80,7 +80,7 @@ export function respondWithError(res, errorValue) {
80
80
  }));
81
81
  }
82
82
  /**
83
- * @param {Object} dataWriter
83
+ * @param {object} dataWriter
84
84
  * @param {Buffer} dataWriter.output
85
85
  */
86
86
  export function onReadableStreamDataHandler(dataWriter) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sitecore-jss/sitecore-jss-rendering-host",
3
- "version": "22.3.0",
3
+ "version": "22.3.1-canary.11",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "sideEffects": false,
@@ -11,10 +11,10 @@
11
11
  "test": "mocha --require ts-node/register/transpile-only \"./src/**/*.test.ts\"",
12
12
  "prepublishOnly": "npm run build",
13
13
  "coverage": "nyc npm test",
14
- "generate-docs": "npx typedoc --plugin typedoc-plugin-markdown --readme none --out ../../ref-docs/sitecore-jss-rendering-host src/index.ts --githubPages false"
14
+ "generate-docs": "npx typedoc --plugin typedoc-plugin-markdown --outputFileStrategy Members --parametersFormat table --readme none --out ../../ref-docs/sitecore-jss-rendering-host src/index.ts --githubPages false"
15
15
  },
16
16
  "engines": {
17
- "node": ">=20"
17
+ "node": ">=22"
18
18
  },
19
19
  "author": {
20
20
  "name": "Sitecore Corporation",
@@ -40,17 +40,18 @@
40
40
  "@types/express-serve-static-core": "^4.17.33",
41
41
  "@types/glob": "^8.0.1",
42
42
  "@types/mocha": "^10.0.1",
43
- "@types/node": "^20.14.2",
43
+ "@types/node": "^22.9.0",
44
44
  "@types/webpack": "5.28.5",
45
45
  "@types/webpack-dev-middleware": "2.0.5",
46
46
  "@types/webpack-dev-server": "3.1.7",
47
47
  "chai": "^4.3.0",
48
48
  "del-cli": "^5.0.0",
49
- "eslint": "^8.33.0",
49
+ "eslint": "^8.56.0",
50
+ "eslint-plugin-jsdoc": "48.7.0",
50
51
  "mocha": "^10.2.0",
51
52
  "nyc": "^15.1.0",
52
53
  "ts-node": "^10.9.1",
53
- "typescript": "~4.9.5"
54
+ "typescript": "~5.6.3"
54
55
  },
55
56
  "description": "",
56
57
  "types": "types/index.d.ts",
@@ -66,5 +67,5 @@
66
67
  "types",
67
68
  "/global.d.ts"
68
69
  ],
69
- "gitHead": "81b0239517966b6d0debdf6da3f12a98228c4d0c"
70
+ "gitHead": "e0fc3cbbe09cd16d73934faa4807de2867cd3126"
70
71
  }
@@ -9,8 +9,7 @@ import { AppInvocationInfoResolver, JsonObject } from './ssrMiddleware';
9
9
  * `JSSAppName` is the `id` property of the JSON request body that is POSTed to the rendering host by Sitecore.
10
10
  *
11
11
  * `serverBundleName` is the name of the JavaScript file (typically a bundle) that contains the function for rendering your app.
12
- *
13
- * @param {string} [baseAppPath='./dist'] The base path to your JSS app(s), defaults to `./dist`
12
+ * @param {string} [baseAppPath] The base path to your JSS app(s), defaults to `./dist`
14
13
  * @returns {AppInvocationInfoResolver} resolver
15
14
  */
16
15
  export declare function getDefaultAppInvocationInfoResolver({ appPathResolver, baseAppPath, serverBundleName, }: {
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import { IncomingMessage, ServerResponse } from 'http';
4
2
  export type RenderCallback = (errorValue: Error, successValue?: string | {
5
3
  [key: string]: unknown;
@@ -38,7 +36,7 @@ export declare function readRequestBodyAsJson(request: IncomingMessage): Promise
38
36
  */
39
37
  export declare function respondWithError(res: ServerResponse, errorValue: Error): void;
40
38
  /**
41
- * @param {Object} dataWriter
39
+ * @param {object} dataWriter
42
40
  * @param {Buffer} dataWriter.output
43
41
  */
44
42
  export declare function onReadableStreamDataHandler(dataWriter: {