@goldstack/template-ssr-server 0.1.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/README.md +3 -0
- package/dist/src/compileBundle.d.ts +20 -0
- package/dist/src/compileBundle.d.ts.map +1 -0
- package/dist/src/compileBundle.js +108 -0
- package/dist/src/compileBundle.js.map +1 -0
- package/dist/src/templateSSRServer.d.ts +16 -0
- package/dist/src/templateSSRServer.d.ts.map +1 -0
- package/dist/src/templateSSRServer.js +71 -0
- package/dist/src/templateSSRServer.js.map +1 -0
- package/package.json +75 -0
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
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, }: {
|
|
8
|
+
entryPoint: string;
|
|
9
|
+
metaFile?: boolean | undefined;
|
|
10
|
+
sourceMap?: boolean | undefined;
|
|
11
|
+
initialProperties?: any;
|
|
12
|
+
}) => Promise<CompileBundleResponse>;
|
|
13
|
+
export declare const bundleResponse: ({ entryPoint, initialProperties, }: {
|
|
14
|
+
entryPoint: string;
|
|
15
|
+
initialProperties?: any;
|
|
16
|
+
}) => Promise<APIGatewayProxyResultV2>;
|
|
17
|
+
export declare const sourceMapResponse: ({ entryPoint, }: {
|
|
18
|
+
entryPoint: string;
|
|
19
|
+
}) => Promise<APIGatewayProxyResultV2>;
|
|
20
|
+
//# sourceMappingURL=compileBundle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compileBundle.d.ts","sourceRoot":"","sources":["../../src/compileBundle.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AA4BrD,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,aAAa;gBAMZ,MAAM;;;wBAGE,GAAG;MACrB,QAAQ,qBAAqB,CAyChC,CAAC;AAEF,eAAO,MAAM,cAAc;gBAIb,MAAM;wBACE,GAAG;MACrB,QAAQ,uBAAuB,CAWlC,CAAC;AAoBF,eAAO,MAAM,iBAAiB;gBAGhB,MAAM;MAChB,QAAQ,uBAAuB,CAmBlC,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sourceMapResponse = exports.bundleResponse = exports.compileBundle = void 0;
|
|
4
|
+
const esbuild_1 = require("esbuild");
|
|
5
|
+
const esbuild_plugin_pnp_1 = require("@yarnpkg/esbuild-plugin-pnp");
|
|
6
|
+
const utils_sh_1 = require("@goldstack/utils-sh");
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
const sharedConfig = {
|
|
9
|
+
plugins: [(0, esbuild_plugin_pnp_1.pnpPlugin)()],
|
|
10
|
+
bundle: true,
|
|
11
|
+
external: [
|
|
12
|
+
'esbuild',
|
|
13
|
+
'@yarnpkg/esbuild-plugin-pnp',
|
|
14
|
+
'@goldstack/template-ssr-server', // this is only required on the server side
|
|
15
|
+
],
|
|
16
|
+
minify: true,
|
|
17
|
+
platform: 'browser',
|
|
18
|
+
format: 'iife',
|
|
19
|
+
treeShaking: true,
|
|
20
|
+
};
|
|
21
|
+
const getEsBuildConfig = (entryPoint) => {
|
|
22
|
+
const esbuildConfig = (0, utils_sh_1.readToType)('./esbuild.config.json');
|
|
23
|
+
const esbuildLocalPath = (0, utils_sh_1.changeExtension)((0, path_1.dirname)(entryPoint), '.esbuild.config.json');
|
|
24
|
+
const localEsbuildConfig = (0, utils_sh_1.readToType)(esbuildLocalPath);
|
|
25
|
+
return { ...esbuildConfig, ...localEsbuildConfig };
|
|
26
|
+
};
|
|
27
|
+
const compileBundle = async ({ entryPoint, metaFile, sourceMap, initialProperties, }) => {
|
|
28
|
+
const res = await (0, esbuild_1.build)({
|
|
29
|
+
...sharedConfig,
|
|
30
|
+
entryPoints: [entryPoint],
|
|
31
|
+
metafile: metaFile,
|
|
32
|
+
sourcemap: sourceMap ? 'inline' : undefined,
|
|
33
|
+
...getEsBuildConfig(entryPoint),
|
|
34
|
+
write: false,
|
|
35
|
+
});
|
|
36
|
+
const output = Buffer.from(res.outputFiles[0].contents).toString('utf-8');
|
|
37
|
+
let result = {
|
|
38
|
+
bundle: '',
|
|
39
|
+
};
|
|
40
|
+
if (!sourceMap) {
|
|
41
|
+
result.bundle = output;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
result.bundle = removeSourceMap(output);
|
|
45
|
+
}
|
|
46
|
+
if (initialProperties) {
|
|
47
|
+
result.bundle = `window.initialProperties = ${JSON.stringify(initialProperties)};${result.bundle}`;
|
|
48
|
+
}
|
|
49
|
+
if (metaFile) {
|
|
50
|
+
result = {
|
|
51
|
+
...result,
|
|
52
|
+
metaFile: JSON.stringify(res.metafile),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
if (sourceMap) {
|
|
56
|
+
result = {
|
|
57
|
+
...result,
|
|
58
|
+
sourceMap: extractSourceMap(output),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
};
|
|
63
|
+
exports.compileBundle = compileBundle;
|
|
64
|
+
const bundleResponse = async ({ entryPoint, initialProperties, }) => {
|
|
65
|
+
const res = await (0, exports.compileBundle)({ entryPoint, initialProperties });
|
|
66
|
+
return {
|
|
67
|
+
statusCode: 201,
|
|
68
|
+
headers: {
|
|
69
|
+
'Content-Type': 'application/javascript',
|
|
70
|
+
SourceMap: '?resource=sourcemap',
|
|
71
|
+
},
|
|
72
|
+
body: res.bundle,
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
exports.bundleResponse = bundleResponse;
|
|
76
|
+
const extractSourceMap = (output) => {
|
|
77
|
+
const marker = '//# sourceMappingURL=data:application/json;base64,';
|
|
78
|
+
const startContent = output.indexOf(marker) + marker.length;
|
|
79
|
+
const sourceMapBase64Data = output.substring(startContent);
|
|
80
|
+
const sourceMapData = Buffer.from(sourceMapBase64Data, 'base64').toString('utf-8');
|
|
81
|
+
return sourceMapData;
|
|
82
|
+
};
|
|
83
|
+
const removeSourceMap = (output) => {
|
|
84
|
+
const marker = '//# sourceMappingURL=data:application/json;base64,';
|
|
85
|
+
const startContent = output.indexOf(marker);
|
|
86
|
+
const withoutSourceMap = output.substring(0, startContent);
|
|
87
|
+
return withoutSourceMap;
|
|
88
|
+
};
|
|
89
|
+
const sourceMapResponse = async ({ entryPoint, }) => {
|
|
90
|
+
const res = await (0, esbuild_1.build)({
|
|
91
|
+
...sharedConfig,
|
|
92
|
+
entryPoints: [entryPoint],
|
|
93
|
+
sourcemap: 'inline',
|
|
94
|
+
...getEsBuildConfig(entryPoint),
|
|
95
|
+
write: false,
|
|
96
|
+
});
|
|
97
|
+
const output = Buffer.from(res.outputFiles[0].contents).toString('utf-8');
|
|
98
|
+
const sourceMapData = extractSourceMap(output);
|
|
99
|
+
return {
|
|
100
|
+
statusCode: 201,
|
|
101
|
+
headers: {
|
|
102
|
+
'Content-Type': 'application/json',
|
|
103
|
+
},
|
|
104
|
+
body: sourceMapData,
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
exports.sourceMapResponse = sourceMapResponse;
|
|
108
|
+
//# sourceMappingURL=compileBundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compileBundle.js","sourceRoot":"","sources":["../../src/compileBundle.ts"],"names":[],"mappings":";;;AAAA,qCAA8C;AAC9C,oEAAwD;AAGxD,kDAAkE;AAClE,+BAA+B;AAE/B,MAAM,YAAY,GAAiB;IACjC,OAAO,EAAE,CA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a,GAAG,MAAM,CAAC,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC,QAAQ,CACvE,OAAO,CACR,CAAC;IACF,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,MAAc,EAAU,EAAE;IACjD,MAAM,MAAM,GAAG,oDAAoD,CAAC;IACpE,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,gBAAgB,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;IAE3D,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC;AACK,MAAM,iBAAiB,GAAG,KAAK,EAAE,EACtC,UAAU,GAGX,EAAoC,EAAE;IACrC,MAAM,GAAG,GAAG,MAAM,IAAA,eAAK,EAAC;QACtB,GAAG,YAAY;QACf,WAAW,EAAE,CAAC,UAAU,CAAC;QACzB,SAAS,EAAE,QAAQ;QACnB,GAAG,gBAAgB,CAAC,UAAU,CAAC;QAC/B,KAAK,EAAE,KAAK;KACb,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC1E,MAAM,aAAa,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAE/C,OAAO;QACL,UAAU,EAAE,GAAG;QACf,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;SACnC;QACD,IAAI,EAAE,aAAa;KACpB,CAAC;AACJ,CAAC,CAAC;AAvBW,QAAA,iBAAiB,qBAuB5B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { APIGatewayProxyEventV2, APIGatewayProxyResultV2 } from 'aws-lambda';
|
|
3
|
+
export declare const clientBundleFileName = "client.bundle.js";
|
|
4
|
+
export interface RenderDocumentProps {
|
|
5
|
+
bundledJsPath: string;
|
|
6
|
+
renderedHtml: string;
|
|
7
|
+
}
|
|
8
|
+
export interface RenderPageProps<PropType> {
|
|
9
|
+
entryPoint: string;
|
|
10
|
+
event: APIGatewayProxyEventV2;
|
|
11
|
+
renderDocument: (props: RenderDocumentProps) => string;
|
|
12
|
+
component: React.FunctionComponent<PropType>;
|
|
13
|
+
properties: PropType;
|
|
14
|
+
}
|
|
15
|
+
export declare const renderPage: <PropType>({ entryPoint, event, renderDocument, component, properties, }: RenderPageProps<PropType>) => Promise<APIGatewayProxyResultV2>;
|
|
16
|
+
//# sourceMappingURL=templateSSRServer.d.ts.map
|
|
@@ -0,0 +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;AAQpB,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AAEvD,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe,CAAC,QAAQ;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,sBAAsB,CAAC;IAC9B,cAAc,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,MAAM,CAAC;IACvD,SAAS,EAAE,KAAK,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC7C,UAAU,EAAE,QAAQ,CAAC;CACtB;AAED,eAAO,MAAM,UAAU,0GAMQ,QAAQ,uBAAuB,CA+D7D,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
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.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
|
+
exports.clientBundleFileName = 'client.bundle.js';
|
|
13
|
+
const renderPage = async ({ entryPoint, event, renderDocument, component, properties, }) => {
|
|
14
|
+
if (event.queryStringParameters && event.queryStringParameters['resource']) {
|
|
15
|
+
if (event.queryStringParameters['resource'].indexOf('js') > -1) {
|
|
16
|
+
if (process.env.AWS_LAMBDA_FUNCTION_NAME) {
|
|
17
|
+
// if running in Lambda load bundle from local file system
|
|
18
|
+
return (0, lambda_compression_1.compress)(event, {
|
|
19
|
+
statusCode: 201,
|
|
20
|
+
headers: {
|
|
21
|
+
'Content-Type': 'application/javascript',
|
|
22
|
+
SourceMap: '?resource=sourcemap',
|
|
23
|
+
},
|
|
24
|
+
body: `window.initialProperties=${JSON.stringify(properties)};${(0, fs_1.readFileSync)(exports.clientBundleFileName, 'utf-8')}`,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
// if not running in Lambda build bundle dynamically
|
|
29
|
+
return (0, lambda_compression_1.compress)(event,
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
31
|
+
require((0, utils_esbuild_1.excludeInBundle)('./compileBundle')).bundleResponse({
|
|
32
|
+
entryPoint,
|
|
33
|
+
initialProperties: properties,
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (event.queryStringParameters['resource'].indexOf('sourcemap') > -1) {
|
|
38
|
+
if (process.env.AWS_LAMBDA_FUNCTION_NAME) {
|
|
39
|
+
// if running in Lambda load sourcemap from local file system
|
|
40
|
+
return (0, lambda_compression_1.compress)(event, {
|
|
41
|
+
statusCode: 201,
|
|
42
|
+
headers: {
|
|
43
|
+
'Content-Type': 'application/json',
|
|
44
|
+
},
|
|
45
|
+
body: (0, fs_1.readFileSync)(exports.clientBundleFileName + '.map', 'utf-8'),
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
return (0, lambda_compression_1.compress)(event,
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
51
|
+
require((0, utils_esbuild_1.excludeInBundle)('./compileBundle')).sourceMapResponse({
|
|
52
|
+
entryPoint,
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const page = (0, server_1.renderToString)(react_1.default.createElement(component, properties));
|
|
58
|
+
const document = renderDocument({
|
|
59
|
+
bundledJsPath: '?resource=js',
|
|
60
|
+
renderedHtml: page,
|
|
61
|
+
});
|
|
62
|
+
return (0, lambda_compression_1.compress)(event, {
|
|
63
|
+
statusCode: 201,
|
|
64
|
+
headers: {
|
|
65
|
+
'Content-Type': 'text/html',
|
|
66
|
+
},
|
|
67
|
+
body: document,
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
exports.renderPage = renderPage;
|
|
71
|
+
//# sourceMappingURL=templateSSRServer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateSSRServer.js","sourceRoot":"","sources":["../../src/templateSSRServer.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAO1B,2DAA8C;AAE9C,6CAAkD;AAClD,4DAA2D;AAC3D,2BAAkC;AAErB,QAAA,oBAAoB,GAAG,kBAAkB,CAAC;AAehD,MAAM,UAAU,GAAG,KAAK,EAAY,EACzC,UAAU,EACV,KAAK,EACL,cAAc,EACd,SAAS,EACT,UAAU,GACgB,EAAoC,EAAE;IAChE,IAAI,KAAK,CAAC,qBAAqB,IAAI,KAAK,CAAC,qBAAqB,CAAC,U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AC,iBAAiB,CAAC;oBAC5D,UAAU;iBACX,CAAC,CACH,CAAC;aACH;SACF;KACF;IAED,MAAM,IAAI,GAAG,IAAA,uBAAc,EAAC,eAAK,CAAC,aAAa,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IAExE,MAAM,QAAQ,GAAG,cAAc,CAAC;QAC9B,aAAa,EAAE,cAAc;QAC7B,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;IACH,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;AArEW,QAAA,UAAU,cAqErB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@goldstack/template-ssr-server",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Building blocks for implementing server-side rendered pages.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"goldstack",
|
|
7
|
+
"utility",
|
|
8
|
+
"infrastructure",
|
|
9
|
+
"ssr",
|
|
10
|
+
"aws",
|
|
11
|
+
"IaC",
|
|
12
|
+
"configuration"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://goldstack.party",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/goldstack/goldstack/issues"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/goldstack/goldstack.git"
|
|
21
|
+
},
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"author": "Max Rohde",
|
|
24
|
+
"sideEffects": false,
|
|
25
|
+
"main": "dist/src/templateSSRServer.js",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "yarn clean && yarn compile",
|
|
28
|
+
"build:watch": "yarn clean && yarn compile-watch",
|
|
29
|
+
"clean": "rimraf ./dist",
|
|
30
|
+
"compile": "tsc -p tsconfig.json",
|
|
31
|
+
"compile-watch": "tsc -p tsconfig.json --watch",
|
|
32
|
+
"compile-watch:light": "nodemon --watch ./src/ -e '*' --exec 'yarn compile'",
|
|
33
|
+
"coverage": "jest --collect-coverage --passWithNoTests --config=./jest.config.js --runInBand",
|
|
34
|
+
"prepublishOnly": "yarn run build",
|
|
35
|
+
"publish": "utils-git changed --exec \"yarn npm publish $@\"",
|
|
36
|
+
"test-ci": "jest --passWithNoTests --config=./jest.config.js --runInBand",
|
|
37
|
+
"version:apply": "utils-git changed --exec \"yarn version $@ && yarn version apply\"",
|
|
38
|
+
"version:apply:force": "yarn version $@ && yarn version apply"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@goldstack/infra": "0.3.38",
|
|
42
|
+
"@goldstack/infra-aws": "0.3.47",
|
|
43
|
+
"@goldstack/utils-aws-lambda": "0.1.32",
|
|
44
|
+
"@goldstack/utils-esbuild": "0.4.3",
|
|
45
|
+
"@goldstack/utils-package": "0.3.41",
|
|
46
|
+
"@goldstack/utils-package-config-embedded": "0.4.5",
|
|
47
|
+
"@goldstack/utils-sh": "0.4.33",
|
|
48
|
+
"@goldstack/utils-template": "0.3.37",
|
|
49
|
+
"@goldstack/utils-terraform": "0.3.71",
|
|
50
|
+
"@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.11",
|
|
51
|
+
"esbuild": "^0.14.48",
|
|
52
|
+
"lambda-compression": "0.1.1",
|
|
53
|
+
"react": "^18.2.0",
|
|
54
|
+
"react-dom": "^18.2.0",
|
|
55
|
+
"source-map-support": "^0.5.21"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@goldstack/utils-docs-cli": "0.3.11",
|
|
59
|
+
"@goldstack/utils-git": "0.1.36",
|
|
60
|
+
"@goldstack/utils-package-config-generate": "0.2.17",
|
|
61
|
+
"@types/aws-lambda": "^8.10.88",
|
|
62
|
+
"@types/jest": "^27.5.1",
|
|
63
|
+
"@types/node": "^17.0.33",
|
|
64
|
+
"@types/react": "^18.0.15",
|
|
65
|
+
"@types/yargs": "^17.0.10",
|
|
66
|
+
"jest": "^28.1.0",
|
|
67
|
+
"rimraf": "^3.0.2",
|
|
68
|
+
"ts-jest": "^28.0.2",
|
|
69
|
+
"ts-node": "^10.8.0",
|
|
70
|
+
"typescript": "^4.7.4"
|
|
71
|
+
},
|
|
72
|
+
"publishConfig": {
|
|
73
|
+
"main": "dist/src/templateSSRServer.js"
|
|
74
|
+
}
|
|
75
|
+
}
|