@sitecore-jss/sitecore-jss-rendering-host 22.3.0-canary.11 → 22.3.0-canary.13
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/dist/cjs/defaultAppInvocationInfoResolver.js +2 -4
- package/dist/cjs/devServer.js +2 -3
- package/dist/cjs/renderingHostServer.js +2 -3
- package/dist/cjs/ssrMiddleware.js +8 -8
- package/dist/cjs/tunnel.js +1 -2
- package/dist/esm/defaultAppInvocationInfoResolver.js +1 -2
- package/dist/esm/devServer.js +1 -1
- package/dist/esm/renderingHostServer.js +1 -1
- package/dist/esm/ssrMiddleware.js +1 -1
- package/package.json +7 -6
- package/types/defaultAppInvocationInfoResolver.d.ts +1 -2
- package/types/ssrMiddleware.d.ts +1 -3
|
@@ -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 =
|
|
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;
|
package/dist/cjs/devServer.js
CHANGED
|
@@ -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 =
|
|
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/
|
|
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 =
|
|
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/
|
|
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.
|
|
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 {
|
|
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;
|
package/dist/cjs/tunnel.js
CHANGED
|
@@ -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 =
|
|
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) => {
|
package/dist/esm/devServer.js
CHANGED
|
@@ -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/
|
|
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/
|
|
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);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitecore-jss/sitecore-jss-rendering-host",
|
|
3
|
-
"version": "22.3.0-canary.
|
|
3
|
+
"version": "22.3.0-canary.13",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"generate-docs": "npx typedoc --plugin typedoc-plugin-markdown --readme none --out ../../ref-docs/sitecore-jss-rendering-host src/index.ts --githubPages false"
|
|
15
15
|
},
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": ">=
|
|
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": "^
|
|
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.
|
|
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": "~
|
|
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": "
|
|
70
|
+
"gitHead": "3594160e4faebace2e135b19675ae9583992a405"
|
|
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, }: {
|
package/types/ssrMiddleware.d.ts
CHANGED
|
@@ -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 {
|
|
39
|
+
* @param {object} dataWriter
|
|
42
40
|
* @param {Buffer} dataWriter.output
|
|
43
41
|
*/
|
|
44
42
|
export declare function onReadableStreamDataHandler(dataWriter: {
|