@goldstack/template-ssr-server 0.3.11 → 0.3.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.
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { APIGatewayProxyEventV2, APIGatewayProxyStructuredResultV2 } from 'aws-lambda';
|
|
3
|
+
export declare type ReactPropertiesType = unknown & JSX.IntrinsicAttributes & Record<string, any>;
|
|
3
4
|
import type { BuildConfiguration, ServerBuildOptionsArgs, ClientBuildOptionsArgs } from '@goldstack/template-ssr-server-compile-bundle';
|
|
4
5
|
export type { BuildConfiguration, ServerBuildOptionsArgs, ClientBuildOptionsArgs, };
|
|
5
6
|
import { StaticFileMapper } from 'static-file-mapper';
|
|
6
7
|
import type { Deployment } from '@goldstack/infra';
|
|
7
8
|
export declare const clientBundleFileName = "client.bundle.js";
|
|
8
9
|
export declare const clientCSSFileName = "client.bundle.css";
|
|
9
|
-
export interface RenderDocumentProps<PropType> {
|
|
10
|
+
export interface RenderDocumentProps<PropType extends ReactPropertiesType> {
|
|
10
11
|
injectIntoHead: string;
|
|
11
12
|
injectIntoBody: string;
|
|
12
13
|
deployment: Deployment;
|
|
@@ -14,7 +15,7 @@ export interface RenderDocumentProps<PropType> {
|
|
|
14
15
|
event: APIGatewayProxyEventV2;
|
|
15
16
|
properties: PropType;
|
|
16
17
|
}
|
|
17
|
-
export interface PartialRenderPageProps<PropType> {
|
|
18
|
+
export interface PartialRenderPageProps<PropType extends ReactPropertiesType> {
|
|
18
19
|
entryPoint: string;
|
|
19
20
|
event: APIGatewayProxyEventV2;
|
|
20
21
|
renderDocument?: (props: RenderDocumentProps<PropType>) => Promise<string>;
|
|
@@ -26,7 +27,7 @@ export interface PartialRenderPageProps<PropType> {
|
|
|
26
27
|
properties: PropType;
|
|
27
28
|
buildConfig?: () => BuildConfiguration;
|
|
28
29
|
}
|
|
29
|
-
export interface RenderPageProps<PropType> {
|
|
30
|
+
export interface RenderPageProps<PropType extends ReactPropertiesType> {
|
|
30
31
|
entryPoint: string;
|
|
31
32
|
event: APIGatewayProxyEventV2;
|
|
32
33
|
appendToHead?: string;
|
|
@@ -39,5 +40,5 @@ export interface RenderPageProps<PropType> {
|
|
|
39
40
|
properties: PropType;
|
|
40
41
|
buildConfig: () => BuildConfiguration;
|
|
41
42
|
}
|
|
42
|
-
export declare const renderPage: <PropType>({ entryPoint, event, renderDocument, appendToBody, appendToHead, staticFileMapper, staticFileMapperStore, component, deployment, properties, buildConfig, }: RenderPageProps<PropType>) => Promise<APIGatewayProxyStructuredResultV2>;
|
|
43
|
+
export declare const renderPage: <PropType extends ReactPropertiesType>({ entryPoint, event, renderDocument, appendToBody, appendToHead, staticFileMapper, staticFileMapperStore, component, deployment, properties, buildConfig, }: RenderPageProps<PropType>) => Promise<APIGatewayProxyStructuredResultV2>;
|
|
43
44
|
//# sourceMappingURL=templateSSRServer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templateSSRServer.d.ts","sourceRoot":"","sources":["../../src/templateSSRServer.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"templateSSRServer.d.ts","sourceRoot":"","sources":["../../src/templateSSRServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,KAAK,EACV,sBAAsB,EACtB,iCAAiC,EAClC,MAAM,YAAY,CAAC;AAUpB,oBAAY,mBAAmB,GAAG,OAAO,GACvC,GAAG,CAAC,mBAAmB,GACvB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEtB,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,+CAA+C,CAAC;AAEvD,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,GACvB,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD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SAAS,EAAE,KAAK,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC7C,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,UAAU,EAAE,QAAQ,CAAC;IACrB,WAAW,EAAE,MAAM,kBAAkB,CAAC;CACvC;AAED,eAAO,MAAM,UAAU,oOAYQ,QAAQ,iCAAiC,CAuHvE,CAAC"}
|
|
@@ -92,7 +92,7 @@ const renderPage = async ({ entryPoint, event, renderDocument, appendToBody, app
|
|
|
92
92
|
deployment,
|
|
93
93
|
injectIntoBody: `
|
|
94
94
|
<div id="root">${page}</div>
|
|
95
|
-
<script>window.initialProperties=${JSON.stringify(properties)}
|
|
95
|
+
<script>window.initialProperties=${JSON.stringify(properties)};window.GOLDSTACK_DEPLOYMENT="${deployment.name}"</script>
|
|
96
96
|
<script src="${clientBundlePath}"></script>
|
|
97
97
|
${appendToBody ? appendToBody : ''}
|
|
98
98
|
`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templateSSRServer.js","sourceRoot":"","sources":["../../src/templateSSRServer.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"templateSSRServer.js","sourceRoot":"","sources":["../../src/templateSSRServer.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAiD;AAOjD,2DAA8C;AAE9C,6CAAkD;AAClD,4DAA2D;AAC3D,2BAAkC;AAElC,2DAAuE;AAqB1D,QAAA,oBAAoB,GAAG,kBAAkB,CAAC;AAC1C,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AAsC9C,MAAM,UAAU,GAAG,KAAK,EAAwC,EACrE,UAAU,EACV,KAAK,EACL,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,SAAS,EACT,UAAU,EACV,UAAU,EACV,WAAW,GACe,EAA8C,EAAE;IAC1E,IAAI,CAAC,gBAAgB,IAAI,CAAC,q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;QACpC,UAAU;QACV,cAAc,EAAE;yBACK,IAAI;2CACc,IAAI,CAAC,SAAS,CAC/C,UAAU,CACX,iCAAiC,UAAU,CAAC,IAAI;uBAClC,gBAAgB;UAC7B,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE;KACrC;QACD,gBAAgB,EAAE,gBAAgB;QAClC,KAAK;QACL,UAAU;KACX,CAAC,CAAC;IAEH,OAAO,IAAA,6BAAQ,EAAC,KAAK,EAAE;QACrB,UAAU,EAAE,GAAG;QACf,OAAO,EAAE;YACP,cAAc,EAAE,WAAW;SAC5B;QACD,IAAI,EAAE,QAAQ;KACf,CAAC,CAAC;AACL,CAAC,CAAC;AAnIW,QAAA,UAAU,cAmIrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goldstack/template-ssr-server",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.13",
|
|
4
4
|
"description": "Building blocks for implementing server-side rendered pages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"goldstack",
|
|
@@ -38,26 +38,26 @@
|
|
|
38
38
|
"version:apply:force": "yarn version $@ && yarn version apply"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@goldstack/infra": "0.4.
|
|
42
|
-
"@goldstack/infra-aws": "0.4.
|
|
43
|
-
"@goldstack/template-ssr-server-compile-bundle": "0.3.
|
|
44
|
-
"@goldstack/utils-aws-lambda": "0.3.
|
|
45
|
-
"@goldstack/utils-esbuild": "0.5.
|
|
46
|
-
"@goldstack/utils-package": "0.4.
|
|
47
|
-
"@goldstack/utils-package-config-embedded": "0.5.
|
|
48
|
-
"@goldstack/utils-sh": "0.5.
|
|
49
|
-
"@goldstack/utils-template": "0.4.
|
|
50
|
-
"@goldstack/utils-terraform": "0.4.
|
|
51
|
-
"lambda-compression": "0.2.
|
|
41
|
+
"@goldstack/infra": "0.4.4",
|
|
42
|
+
"@goldstack/infra-aws": "0.4.7",
|
|
43
|
+
"@goldstack/template-ssr-server-compile-bundle": "0.3.10",
|
|
44
|
+
"@goldstack/utils-aws-lambda": "0.3.8",
|
|
45
|
+
"@goldstack/utils-esbuild": "0.5.4",
|
|
46
|
+
"@goldstack/utils-package": "0.4.4",
|
|
47
|
+
"@goldstack/utils-package-config-embedded": "0.5.5",
|
|
48
|
+
"@goldstack/utils-sh": "0.5.4",
|
|
49
|
+
"@goldstack/utils-template": "0.4.4",
|
|
50
|
+
"@goldstack/utils-terraform": "0.4.7",
|
|
51
|
+
"lambda-compression": "0.2.4",
|
|
52
52
|
"react": "^18.2.0",
|
|
53
53
|
"react-dom": "^18.2.0",
|
|
54
54
|
"source-map-support": "^0.5.21",
|
|
55
|
-
"static-file-mapper": "0.3.
|
|
55
|
+
"static-file-mapper": "0.3.5"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@goldstack/utils-docs-cli": "0.3.11",
|
|
59
|
-
"@goldstack/utils-git": "0.2.
|
|
60
|
-
"@goldstack/utils-package-config-generate": "0.3.
|
|
59
|
+
"@goldstack/utils-git": "0.2.4",
|
|
60
|
+
"@goldstack/utils-package-config-generate": "0.3.4",
|
|
61
61
|
"@types/aws-lambda": "^8.10.88",
|
|
62
62
|
"@types/jest": "^29.0.1",
|
|
63
63
|
"@types/node": "^18.7.13",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"rimraf": "^3.0.2",
|
|
69
69
|
"ts-jest": "^28.0.2",
|
|
70
70
|
"ts-node": "^10.9.1",
|
|
71
|
-
"typescript": "^4.
|
|
71
|
+
"typescript": "^4.8.4"
|
|
72
72
|
},
|
|
73
73
|
"publishConfig": {
|
|
74
74
|
"main": "dist/src/templateSSRServer.js"
|