@goldstack/template-ssr-server 0.3.0 → 0.3.3
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/src/templateSSRServer.d.ts +39 -35
- package/dist/src/templateSSRServer.d.ts.map +1 -1
- package/dist/src/templateSSRServer.js +107 -95
- package/dist/src/templateSSRServer.js.map +1 -1
- package/package.json +15 -15
- package/dist/src/compileBundle.d.ts +0 -21
- package/dist/src/compileBundle.d.ts.map +0 -1
- package/dist/src/compileBundle.js +0 -138
- package/dist/src/compileBundle.js.map +0 -1
|
@@ -1,36 +1,40 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { APIGatewayProxyEventV2, APIGatewayProxyResultV2 } from 'aws-lambda';
|
|
3
|
-
import type { BuildConfiguration, ServerBuildOptionsArgs, ClientBuildOptionsArgs } from '@goldstack/template-ssr-server-compile-bundle';
|
|
4
|
-
export type { BuildConfiguration, ServerBuildOptionsArgs, ClientBuildOptionsArgs, };
|
|
5
|
-
import { StaticFileMapper } from 'static-file-mapper';
|
|
6
|
-
export declare const clientBundleFileName = "client.bundle.js";
|
|
7
|
-
export declare const clientCSSFileName = "client.bundle.css";
|
|
8
|
-
export interface RenderDocumentProps<PropType> {
|
|
9
|
-
injectIntoHead: string;
|
|
10
|
-
injectIntoBody: string;
|
|
11
|
-
staticFileMapper: StaticFileMapper;
|
|
12
|
-
event: APIGatewayProxyEventV2;
|
|
13
|
-
properties: PropType;
|
|
14
|
-
}
|
|
15
|
-
export interface PartialRenderPageProps<PropType> {
|
|
16
|
-
entryPoint: string;
|
|
17
|
-
event: APIGatewayProxyEventV2;
|
|
18
|
-
renderDocument?: (props: RenderDocumentProps<PropType>) => string;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { APIGatewayProxyEventV2, APIGatewayProxyResultV2 } from 'aws-lambda';
|
|
3
|
+
import type { BuildConfiguration, ServerBuildOptionsArgs, ClientBuildOptionsArgs } from '@goldstack/template-ssr-server-compile-bundle';
|
|
4
|
+
export type { BuildConfiguration, ServerBuildOptionsArgs, ClientBuildOptionsArgs, };
|
|
5
|
+
import { StaticFileMapper } from 'static-file-mapper';
|
|
6
|
+
export declare const clientBundleFileName = "client.bundle.js";
|
|
7
|
+
export declare const clientCSSFileName = "client.bundle.css";
|
|
8
|
+
export interface RenderDocumentProps<PropType> {
|
|
9
|
+
injectIntoHead: string;
|
|
10
|
+
injectIntoBody: string;
|
|
11
|
+
staticFileMapper: StaticFileMapper;
|
|
12
|
+
event: APIGatewayProxyEventV2;
|
|
13
|
+
properties: PropType;
|
|
14
|
+
}
|
|
15
|
+
export interface PartialRenderPageProps<PropType> {
|
|
16
|
+
entryPoint: string;
|
|
17
|
+
event: APIGatewayProxyEventV2;
|
|
18
|
+
renderDocument?: (props: RenderDocumentProps<PropType>) => string;
|
|
19
|
+
appendToHead?: string;
|
|
20
|
+
appendToBody?: string;
|
|
21
|
+
component: React.FunctionComponent<PropType>;
|
|
22
|
+
staticFileMapper?: StaticFileMapper;
|
|
23
|
+
staticFileMapperStore?: unknown;
|
|
24
|
+
properties: PropType;
|
|
25
|
+
buildConfig?: () => BuildConfiguration;
|
|
26
|
+
}
|
|
27
|
+
export interface RenderPageProps<PropType> {
|
|
28
|
+
entryPoint: string;
|
|
29
|
+
event: APIGatewayProxyEventV2;
|
|
30
|
+
appendToHead?: string;
|
|
31
|
+
appendToBody?: string;
|
|
32
|
+
renderDocument: (props: RenderDocumentProps<PropType>) => string;
|
|
33
|
+
component: React.FunctionComponent<PropType>;
|
|
34
|
+
staticFileMapper?: StaticFileMapper;
|
|
35
|
+
staticFileMapperStore?: unknown;
|
|
36
|
+
properties: PropType;
|
|
37
|
+
buildConfig: () => BuildConfiguration;
|
|
38
|
+
}
|
|
39
|
+
export declare const renderPage: <PropType>({ entryPoint, event, renderDocument, appendToBody, appendToHead, staticFileMapper, staticFileMapperStore, component, properties, buildConfig, }: RenderPageProps<PropType>) => Promise<APIGatewayProxyResultV2>;
|
|
36
40
|
//# sourceMappingURL=templateSSRServer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templateSSRServer.d.ts","sourceRoot":"","sources":["../../src/templateSSRServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,YAAY,CAAC;AAUpB,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;AAEtD,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AACvD,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAErD,MAAM,WAAW,mBAAmB,CAAC,QAAQ;IAC3C,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,KAAK,EAAE,sBAAsB,CAAC;IAC9B,UAAU,EAAE,QAAQ,CAAC;CACtB;AAED,MAAM,WAAW,sBAAsB,CAAC,QAAQ;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,sBAAsB,CAAC;IAC9B,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,CAAC,QAAQ,CAAC,KAAK,MAAM,CAAC;IAClE,SAAS,EAAE,KAAK,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC7C,gBAA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AC9B,UAAU,EAAE,QAAQ,CAAC;CACtB;AAED,MAAM,WAAW,sBAAsB,CAAC,QAAQ;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,sBAAsB,CAAC;IAC9B,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,CAAC,QAAQ,CAAC,KAAK,MAAM,CAAC;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,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,CAAC,EAAE,MAAM,kBAAkB,CAAC;CACxC;AAED,MAAM,WAAW,eAAe,CAAC,QAAQ;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,sBAAsB,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,CAAC,KAAK,EAAE,mBAAmB,CAAC,QAAQ,CAAC,KAAK,MAAM,CAAC;IACjE,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,4LAWQ,QAAQ,uBAAuB,CA+G7D,CAAC"}
|
|
@@ -1,99 +1,111 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.renderPage = exports.clientCSSFileName = exports.clientBundleFileName = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const lambda_compression_1 = require("lambda-compression");
|
|
9
|
-
const server_1 = require("react-dom/server");
|
|
10
|
-
const utils_esbuild_1 = require("@goldstack/utils-esbuild");
|
|
11
|
-
const fs_1 = require("fs");
|
|
12
|
-
const static_file_mapper_1 = require("static-file-mapper");
|
|
13
|
-
exports.clientBundleFileName = 'client.bundle.js';
|
|
14
|
-
exports.clientCSSFileName = 'client.bundle.css';
|
|
15
|
-
const renderPage = async ({ entryPoint, event, renderDocument, staticFileMapper, staticFileMapperStore, component, properties, buildConfig, }) => {
|
|
16
|
-
if (!staticFileMapper && !staticFileMapperStore) {
|
|
17
|
-
throw new Error('`staticFileMapper` or `staticFileMapper` store need to be defined for `renderPage`');
|
|
18
|
-
}
|
|
19
|
-
if (!staticFileMapper) {
|
|
20
|
-
staticFileMapper = new static_file_mapper_1.StaticFileMapperRun({
|
|
21
|
-
store: staticFileMapperStore,
|
|
22
|
-
baseUrl: '_goldstack/static/generated/',
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
if (event.queryStringParameters && event.queryStringParameters['resource']) {
|
|
26
|
-
if (event.queryStringParameters['resource'].indexOf('js') > -1) {
|
|
27
|
-
if (process.env.AWS_LAMBDA_FUNCTION_NAME) {
|
|
28
|
-
// if running in Lambda load bundle from local file system
|
|
29
|
-
let SourceMap = '';
|
|
30
|
-
if (await staticFileMapper.has({
|
|
31
|
-
name: `${process.env.AWS_LAMBDA_FUNCTION_NAME}.map`,
|
|
32
|
-
})) {
|
|
33
|
-
SourceMap = await staticFileMapper.resolve({
|
|
34
|
-
name: `${process.env.AWS_LAMBDA_FUNCTION_NAME}.map`,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
return (0, lambda_compression_1.compress)(event, {
|
|
38
|
-
statusCode: 200,
|
|
39
|
-
headers: {
|
|
40
|
-
'Content-Type': 'application/javascript',
|
|
41
|
-
SourceMap,
|
|
42
|
-
},
|
|
43
|
-
body: `${(0, fs_1.readFileSync)(exports.clientBundleFileName, 'utf-8')}`,
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
// if not running in Lambda build bundle dynamically
|
|
48
|
-
return (0, lambda_compression_1.compress)(event,
|
|
49
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
50
|
-
require((0, utils_esbuild_1.excludeInBundle)('@goldstack/template-ssr-server-compile-bundle')).bundleResponse({
|
|
51
|
-
entryPoint,
|
|
52
|
-
buildConfig: buildConfig(),
|
|
53
|
-
}));
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
if (event.queryStringParameters['resource'].indexOf('sourcemap') > -1) {
|
|
57
|
-
if (process.env.AWS_LAMBDA_FUNCTION_NAME) {
|
|
58
|
-
throw new Error('sourcemap resource not supported in Lambda. Please load sourcemap from static files.');
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
return (0, lambda_compression_1.compress)(event,
|
|
62
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
63
|
-
require((0, utils_esbuild_1.excludeInBundle)('@goldstack/template-ssr-server-compile-bundle')).sourceMapResponse({
|
|
64
|
-
entryPoint,
|
|
65
|
-
buildConfig: buildConfig(),
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
const page = (0, server_1.renderToString)(react_1.default.createElement(component, properties));
|
|
71
|
-
let styles;
|
|
72
|
-
// only inject styles when in lambda - otherwise they are loaded dynamically
|
|
73
|
-
if (process.env.AWS_LAMBDA_FUNCTION_NAME) {
|
|
74
|
-
styles = (0, fs_1.readFileSync)(exports.clientCSSFileName, 'utf-8');
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
styles = undefined;
|
|
78
|
-
}
|
|
79
|
-
const
|
|
80
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.renderPage = exports.clientCSSFileName = exports.clientBundleFileName = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const lambda_compression_1 = require("lambda-compression");
|
|
9
|
+
const server_1 = require("react-dom/server");
|
|
10
|
+
const utils_esbuild_1 = require("@goldstack/utils-esbuild");
|
|
11
|
+
const fs_1 = require("fs");
|
|
12
|
+
const static_file_mapper_1 = require("static-file-mapper");
|
|
13
|
+
exports.clientBundleFileName = 'client.bundle.js';
|
|
14
|
+
exports.clientCSSFileName = 'client.bundle.css';
|
|
15
|
+
const renderPage = async ({ entryPoint, event, renderDocument, appendToBody, appendToHead, staticFileMapper, staticFileMapperStore, component, properties, buildConfig, }) => {
|
|
16
|
+
if (!staticFileMapper && !staticFileMapperStore) {
|
|
17
|
+
throw new Error('`staticFileMapper` or `staticFileMapper` store need to be defined for `renderPage`');
|
|
18
|
+
}
|
|
19
|
+
if (!staticFileMapper) {
|
|
20
|
+
staticFileMapper = new static_file_mapper_1.StaticFileMapperRun({
|
|
21
|
+
store: staticFileMapperStore,
|
|
22
|
+
baseUrl: '_goldstack/static/generated/',
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
if (event.queryStringParameters && event.queryStringParameters['resource']) {
|
|
26
|
+
if (event.queryStringParameters['resource'].indexOf('js') > -1) {
|
|
27
|
+
if (process.env.AWS_LAMBDA_FUNCTION_NAME) {
|
|
28
|
+
// if running in Lambda load bundle from local file system
|
|
29
|
+
let SourceMap = '';
|
|
30
|
+
if (await staticFileMapper.has({
|
|
31
|
+
name: `${process.env.AWS_LAMBDA_FUNCTION_NAME}.map`,
|
|
32
|
+
})) {
|
|
33
|
+
SourceMap = await staticFileMapper.resolve({
|
|
34
|
+
name: `${process.env.AWS_LAMBDA_FUNCTION_NAME}.map`,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return (0, lambda_compression_1.compress)(event, {
|
|
38
|
+
statusCode: 200,
|
|
39
|
+
headers: {
|
|
40
|
+
'Content-Type': 'application/javascript',
|
|
41
|
+
SourceMap,
|
|
42
|
+
},
|
|
43
|
+
body: `${(0, fs_1.readFileSync)(exports.clientBundleFileName, 'utf-8')}`,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
// if not running in Lambda build bundle dynamically
|
|
48
|
+
return (0, lambda_compression_1.compress)(event,
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
50
|
+
require((0, utils_esbuild_1.excludeInBundle)('@goldstack/template-ssr-server-compile-bundle')).bundleResponse({
|
|
51
|
+
entryPoint,
|
|
52
|
+
buildConfig: buildConfig(),
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (event.queryStringParameters['resource'].indexOf('sourcemap') > -1) {
|
|
57
|
+
if (process.env.AWS_LAMBDA_FUNCTION_NAME) {
|
|
58
|
+
throw new Error('sourcemap resource not supported in Lambda. Please load sourcemap from static files.');
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
return (0, lambda_compression_1.compress)(event,
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
63
|
+
require((0, utils_esbuild_1.excludeInBundle)('@goldstack/template-ssr-server-compile-bundle')).sourceMapResponse({
|
|
64
|
+
entryPoint,
|
|
65
|
+
buildConfig: buildConfig(),
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const page = (0, server_1.renderToString)(react_1.default.createElement(component, properties));
|
|
71
|
+
let styles;
|
|
72
|
+
// only inject styles when in lambda - otherwise they are loaded dynamically
|
|
73
|
+
if (process.env.AWS_LAMBDA_FUNCTION_NAME) {
|
|
74
|
+
styles = (0, fs_1.readFileSync)(exports.clientCSSFileName, 'utf-8');
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
styles = undefined;
|
|
78
|
+
}
|
|
79
|
+
const functionName = process.env.AWS_LAMBDA_FUNCTION_NAME;
|
|
80
|
+
let clientBundlePath;
|
|
81
|
+
if (!functionName) {
|
|
82
|
+
clientBundlePath = '?resource=js';
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
clientBundlePath = await staticFileMapper.resolve({
|
|
86
|
+
name: `${functionName}-bundle.js`,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
const document = renderDocument({
|
|
90
|
+
injectIntoHead: `${styles ? `<style>${styles}</style>` : ''}
|
|
91
|
+
${appendToHead ? appendToHead : ''}`,
|
|
81
92
|
injectIntoBody: `
|
|
82
93
|
<div id="root">${page}</div>
|
|
83
94
|
<script>window.initialProperties=${JSON.stringify(properties)};</script>
|
|
84
|
-
<script src="
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
};
|
|
98
|
-
|
|
95
|
+
<script src="${clientBundlePath}"></script>
|
|
96
|
+
${appendToBody ? appendToBody : ''}
|
|
97
|
+
`,
|
|
98
|
+
staticFileMapper: staticFileMapper,
|
|
99
|
+
event,
|
|
100
|
+
properties,
|
|
101
|
+
});
|
|
102
|
+
return (0, lambda_compression_1.compress)(event, {
|
|
103
|
+
statusCode: 200,
|
|
104
|
+
headers: {
|
|
105
|
+
'Content-Type': 'text/html',
|
|
106
|
+
},
|
|
107
|
+
body: document,
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
exports.renderPage = renderPage;
|
|
99
111
|
//# sourceMappingURL=templateSSRServer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templateSSRServer.js","sourceRoot":"","sources":["../../src/templateSSRServer.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAO1B,2DAA8C;AAE9C,6CAAkD;AAClD,4DAA2D;AAC3D,2BAAkC;AAElC,2DAAuE;AAgB1D,QAAA,oBAAoB,GAAG,kBAAkB,CAAC;AAC1C,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"templateSSRServer.js","sourceRoot":"","sources":["../../src/templateSSRServer.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAO1B,2DAA8C;AAE9C,6CAAkD;AAClD,4DAA2D;AAC3D,2BAAkC;AAElC,2DAAuE;AAgB1D,QAAA,oBAAoB,GAAG,kBAAkB,CAAC;AAC1C,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AAoC9C,MAAM,UAAU,GAAG,KAAK,EAAY,EACzC,UAAU,EACV,KAAK,EACL,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,SAAS,EACT,UAAU,EACV,WAAW,GACe,EAAoC,EAAE;IAChE,IAAI,CAAC,gBAAgB,IAAI,CAAC,qBAAqB,EAAE;QAC/C,MAAM,IAAI,KAAK,CACb,oFAAoF,CACrF,CAAC;KACH;IACD,IAAI,CAAC,gBAAgB,EAAE;QACrB,gBAAgB,GAAG,IAAI,wCAAmB,CAAC;YACzC,KAAK,EAAE,qBAAqC;YAC5C,OAAO,EAAE,8BAA8B;SACxC,CAAC,CAAC;KACJ;IACD,IAAI,KAAK,CAAC,qBAAqB,IAAI,KAAK,CAAC,qBAAqB,CAAC,UAAU,CAAC,EAAE;QAC1E,IAAI,KAAK,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE;YAC9D,IAAI,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE;gBACxC,0DAA0D;gBAC1D,IAAI,SAAS,GAAG,EAAE,CAAC;gBACnB,IACE,MAAM,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.3.
|
|
3
|
+
"version": "0.3.3",
|
|
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.1",
|
|
42
|
+
"@goldstack/infra-aws": "0.4.2",
|
|
43
|
+
"@goldstack/template-ssr-server-compile-bundle": "0.3.3",
|
|
44
|
+
"@goldstack/utils-aws-lambda": "0.3.2",
|
|
45
|
+
"@goldstack/utils-esbuild": "0.5.1",
|
|
46
|
+
"@goldstack/utils-package": "0.4.1",
|
|
47
|
+
"@goldstack/utils-package-config-embedded": "0.5.1",
|
|
48
|
+
"@goldstack/utils-sh": "0.5.1",
|
|
49
|
+
"@goldstack/utils-template": "0.4.1",
|
|
50
|
+
"@goldstack/utils-terraform": "0.4.2",
|
|
51
|
+
"lambda-compression": "0.2.1",
|
|
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.2"
|
|
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.1",
|
|
60
|
+
"@goldstack/utils-package-config-generate": "0.3.1",
|
|
61
61
|
"@types/aws-lambda": "^8.10.88",
|
|
62
62
|
"@types/jest": "^28.1.8",
|
|
63
63
|
"@types/node": "^18.7.13",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { APIGatewayProxyResultV2 } from 'aws-lambda';
|
|
2
|
-
export interface CompileBundleResponse {
|
|
3
|
-
bundle: string;
|
|
4
|
-
sourceMap?: string;
|
|
5
|
-
metaFile?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const compileBundle: ({ entryPoint, metaFile, sourceMap, initialProperties, includeCss, }: {
|
|
8
|
-
entryPoint: string;
|
|
9
|
-
metaFile?: boolean | undefined;
|
|
10
|
-
sourceMap?: boolean | undefined;
|
|
11
|
-
initialProperties?: any;
|
|
12
|
-
includeCss: boolean;
|
|
13
|
-
}) => Promise<CompileBundleResponse>;
|
|
14
|
-
export declare const bundleResponse: ({ entryPoint, initialProperties, }: {
|
|
15
|
-
entryPoint: string;
|
|
16
|
-
initialProperties?: any;
|
|
17
|
-
}) => Promise<APIGatewayProxyResultV2>;
|
|
18
|
-
export declare const sourceMapResponse: ({ entryPoint, }: {
|
|
19
|
-
entryPoint: string;
|
|
20
|
-
}) => Promise<APIGatewayProxyResultV2>;
|
|
21
|
-
//# sourceMappingURL=compileBundle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compileBundle.d.ts","sourceRoot":"","sources":["../../src/compileBundle.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAoCrD,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAsBD,eAAO,MAAM,aAAa;gBAOZ,MAAM;;;wBAGE,GAAG;gBACX,OAAO;MACjB,QAAQ,qBAAqB,CAyChC,CAAC;AAEF,eAAO,MAAM,cAAc;gBAIb,MAAM;wBACE,GAAG;MACrB,QAAQ,uBAAuB,CAkBlC,CAAC;AAoBF,eAAO,MAAM,iBAAiB;gBAGhB,MAAM;MAChB,QAAQ,uBAAuB,CAsBlC,CAAC"}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.sourceMapResponse = exports.bundleResponse = exports.compileBundle = void 0;
|
|
7
|
-
const esbuild_1 = require("esbuild");
|
|
8
|
-
const esbuild_plugin_pnp_1 = require("@yarnpkg/esbuild-plugin-pnp");
|
|
9
|
-
const esbuild_css_modules_client_plugin_1 = __importDefault(require("esbuild-css-modules-client-plugin"));
|
|
10
|
-
const utils_sh_1 = require("@goldstack/utils-sh");
|
|
11
|
-
const path_1 = require("path");
|
|
12
|
-
const sharedConfig = (includeCss) => {
|
|
13
|
-
return {
|
|
14
|
-
plugins: [
|
|
15
|
-
(0, esbuild_css_modules_client_plugin_1.default)({
|
|
16
|
-
excludeCSSInject: !includeCss,
|
|
17
|
-
}),
|
|
18
|
-
(0, esbuild_plugin_pnp_1.pnpPlugin)(),
|
|
19
|
-
],
|
|
20
|
-
bundle: true,
|
|
21
|
-
outfile: '/dist/tmp/bundle.js',
|
|
22
|
-
external: [
|
|
23
|
-
'esbuild',
|
|
24
|
-
'@yarnpkg/esbuild-plugin-pnp',
|
|
25
|
-
'@goldstack/template-ssr-server', // this is only required on the server side
|
|
26
|
-
],
|
|
27
|
-
minify: true,
|
|
28
|
-
platform: 'browser',
|
|
29
|
-
format: 'iife',
|
|
30
|
-
treeShaking: true,
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
const getEsBuildConfig = (entryPoint) => {
|
|
34
|
-
const esbuildConfig = (0, utils_sh_1.readToType)('./esbuild.config.json');
|
|
35
|
-
const esbuildLocalPath = (0, utils_sh_1.changeExtension)((0, path_1.dirname)(entryPoint), '.esbuild.config.json');
|
|
36
|
-
const localEsbuildConfig = (0, utils_sh_1.readToType)(esbuildLocalPath);
|
|
37
|
-
return { ...esbuildConfig, ...localEsbuildConfig };
|
|
38
|
-
};
|
|
39
|
-
const getOutput = (extension, result) => {
|
|
40
|
-
const matchedFiles = result.outputFiles.filter((file) => file.path.endsWith(extension));
|
|
41
|
-
if (matchedFiles.length !== 1) {
|
|
42
|
-
throw new Error(`Invalid output from esbuild. Expected only one '${extension}' file but found ${matchedFiles.length}`);
|
|
43
|
-
}
|
|
44
|
-
const output = Buffer.from(matchedFiles[0].contents).toString('utf-8');
|
|
45
|
-
return output;
|
|
46
|
-
};
|
|
47
|
-
const compileBundle = async ({ entryPoint, metaFile, sourceMap, initialProperties, includeCss, }) => {
|
|
48
|
-
const res = await (0, esbuild_1.build)({
|
|
49
|
-
...sharedConfig(includeCss),
|
|
50
|
-
entryPoints: [entryPoint],
|
|
51
|
-
metafile: metaFile,
|
|
52
|
-
sourcemap: sourceMap ? 'inline' : undefined,
|
|
53
|
-
...getEsBuildConfig(entryPoint),
|
|
54
|
-
write: false,
|
|
55
|
-
});
|
|
56
|
-
const output = getOutput('.js', res);
|
|
57
|
-
let result = {
|
|
58
|
-
bundle: '',
|
|
59
|
-
};
|
|
60
|
-
if (!sourceMap) {
|
|
61
|
-
result.bundle = output;
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
result.bundle = removeSourceMap(output);
|
|
65
|
-
}
|
|
66
|
-
if (initialProperties) {
|
|
67
|
-
result.bundle = `window.initialProperties = ${JSON.stringify(initialProperties)};${result.bundle}`;
|
|
68
|
-
}
|
|
69
|
-
if (metaFile) {
|
|
70
|
-
result = {
|
|
71
|
-
...result,
|
|
72
|
-
metaFile: JSON.stringify(res.metafile),
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
if (sourceMap) {
|
|
76
|
-
result = {
|
|
77
|
-
...result,
|
|
78
|
-
sourceMap: extractSourceMap(output),
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
return result;
|
|
82
|
-
};
|
|
83
|
-
exports.compileBundle = compileBundle;
|
|
84
|
-
const bundleResponse = async ({ entryPoint, initialProperties, }) => {
|
|
85
|
-
const res = await (0, exports.compileBundle)({
|
|
86
|
-
entryPoint,
|
|
87
|
-
initialProperties,
|
|
88
|
-
includeCss: true,
|
|
89
|
-
});
|
|
90
|
-
return {
|
|
91
|
-
statusCode: 201,
|
|
92
|
-
headers: {
|
|
93
|
-
'Content-Type': 'application/javascript',
|
|
94
|
-
'Cache-Control': 'no-cache, no-store, must-revalidate',
|
|
95
|
-
Pragma: 'no-cache',
|
|
96
|
-
Expire: '0',
|
|
97
|
-
SourceMap: '?resource=sourcemap',
|
|
98
|
-
},
|
|
99
|
-
body: res.bundle,
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
exports.bundleResponse = bundleResponse;
|
|
103
|
-
const extractSourceMap = (output) => {
|
|
104
|
-
const marker = '//# sourceMappingURL=data:application/json;base64,';
|
|
105
|
-
const startContent = output.indexOf(marker) + marker.length;
|
|
106
|
-
const sourceMapBase64Data = output.substring(startContent);
|
|
107
|
-
const sourceMapData = Buffer.from(sourceMapBase64Data, 'base64').toString('utf-8');
|
|
108
|
-
return sourceMapData;
|
|
109
|
-
};
|
|
110
|
-
const removeSourceMap = (output) => {
|
|
111
|
-
const marker = '//# sourceMappingURL=data:application/json;base64,';
|
|
112
|
-
const startContent = output.indexOf(marker);
|
|
113
|
-
const withoutSourceMap = output.substring(0, startContent);
|
|
114
|
-
return withoutSourceMap;
|
|
115
|
-
};
|
|
116
|
-
const sourceMapResponse = async ({ entryPoint, }) => {
|
|
117
|
-
const res = await (0, esbuild_1.build)({
|
|
118
|
-
...sharedConfig(false),
|
|
119
|
-
entryPoints: [entryPoint],
|
|
120
|
-
sourcemap: 'inline',
|
|
121
|
-
...getEsBuildConfig(entryPoint),
|
|
122
|
-
write: false,
|
|
123
|
-
});
|
|
124
|
-
const output = Buffer.from(res.outputFiles[0].contents).toString('utf-8');
|
|
125
|
-
const sourceMapData = extractSourceMap(output);
|
|
126
|
-
return {
|
|
127
|
-
statusCode: 201,
|
|
128
|
-
headers: {
|
|
129
|
-
'Content-Type': 'application/json',
|
|
130
|
-
'Cache-Control': 'no-cache, no-store, must-revalidate',
|
|
131
|
-
Pragma: 'no-cache',
|
|
132
|
-
Expire: '0',
|
|
133
|
-
},
|
|
134
|
-
body: sourceMapData,
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
exports.sourceMapResponse = sourceMapResponse;
|
|
138
|
-
//# sourceMappingURL=compileBundle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compileBundle.js","sourceRoot":"","sources":["../../src/compileBundle.ts"],"names":[],"mappings":";;;;;;AAAA,qCAAuE;AACvE,oEAAwD;AAExD,0GAA0D;AAG1D,kDAAkE;AAClE,+BAA+B;AAE/B,MAAM,YAAY,GAAG,CAAC,UAAmB,EAAgB,EAAE;IACzD,OAAO;QACL,OAAO,EAAE;YACP,IAAA,2CAAS,EAAC;gBACR,gBAAgB,EAAE,CAAC,UAAU;aAC9B,CAAC;YACF,IAAA,8BAAS,GAAE;SACZ;QACD,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,qBAAqB;QAC9B,QAAQ,EAAE;YACR,SAAS;YACT,6BAA6B;YAC7B,gCAAgC,EAAE,2CAA2C;SAC9E;QACD,MAAM,EAAE,IAAI;QACZ,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,MAAM;QACd,WAAW,EAAE,IAAI;KAClB,CAAC;AACJ,CAAC,CAAC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