@goldstack/template-ssr 0.1.5 → 0.1.6

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.
@@ -2,7 +2,10 @@ import React from 'react';
2
2
  export * from './types/SSRPackage';
3
3
  import type { APIGatewayProxyResultV2 } from 'aws-lambda';
4
4
  import type { RenderPageProps } from '@goldstack/template-ssr-server';
5
+ import { LambdaApiDeploymentConfiguration } from '@goldstack/utils-aws-lambda';
6
+ import { SSRDeploymentConfiguration } from './types/SSRPackage';
5
7
  export type { RenderDocumentProps } from '@goldstack/template-ssr-server';
6
8
  export declare const renderPage: <PropType>(props: RenderPageProps<PropType>) => Promise<APIGatewayProxyResultV2>;
9
+ export declare const createLambdaAPIDeploymentConfiguration: (configuration: SSRDeploymentConfiguration) => LambdaApiDeploymentConfiguration;
7
10
  export declare const hydrate: (c: React.FunctionComponent<any>) => void;
8
11
  //# sourceMappingURL=templateSSR.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"templateSSR.d.ts","sourceRoot":"","sources":["../../src/templateSSR.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AAEnC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAG1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,eAAO,MAAM,UAAU,kDAEpB,QAAQ,uBAAuB,CAGjC,CAAC;AAMF,eAAO,MAAM,OAAO,MAEf,MAAM,iBAAiB,CAAC,GAAG,CAAC,KAC9B,IAiBF,CAAC"}
1
+ {"version":3,"file":"templateSSR.d.ts","sourceRoot":"","sources":["../../src/templateSSR.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AAEnC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAG1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAEhE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,eAAO,MAAM,UAAU,kDAEpB,QAAQ,uBAAuB,CAGjC,CAAC;AAMF,eAAO,MAAM,sCAAsC,kBAClC,0BAA0B,KACxC,gCAOF,CAAC;AAEF,eAAO,MAAM,OAAO,MAEf,MAAM,iBAAiB,CAAC,GAAG,CAAC,KAC9B,IAiBF,CAAC"}
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.hydrate = exports.renderPage = void 0;
20
+ exports.hydrate = exports.createLambdaAPIDeploymentConfiguration = exports.renderPage = void 0;
21
21
  const react_1 = __importDefault(require("react"));
22
22
  __exportStar(require("./types/SSRPackage"), exports);
23
23
  const client_1 = __importDefault(require("react-dom/client"));
@@ -29,6 +29,15 @@ exports.renderPage = renderPage;
29
29
  function isServer() {
30
30
  return !(typeof window != 'undefined' && window.document);
31
31
  }
32
+ const createLambdaAPIDeploymentConfiguration = (configuration) => {
33
+ return {
34
+ apiDomain: configuration.domain,
35
+ hostedZoneDomain: configuration.hostedZoneDomain,
36
+ lambdas: configuration.lambdas,
37
+ lambdaNamePrefix: configuration.lambdaNamePrefix,
38
+ };
39
+ };
40
+ exports.createLambdaAPIDeploymentConfiguration = createLambdaAPIDeploymentConfiguration;
32
41
  const hydrate = (
33
42
  // element: React.ReactElement<any, string | React.JSXElementConstructor<any>>
34
43
  c) => {
@@ -1 +1 @@
1
- {"version":3,"file":"templateSSR.js","sourceRoot":"","sources":["../../src/templateS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EF,SAAS,QAAQ;IACf,OAAO,CAAC,CAAC,OAAO,MAAM,IAAI,WAAW,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC5D,CAAC;AAEM,MAAM,sCAAsC,GAAG,CACpD,aAAyC,EACP,EAAE;IACpC,OAAO;QACL,SAAS,EAAE,aAAa,CAAC,MAAM;QAC/B,gBAAgB,EAAE,aAAa,CAAC,gBAAgB;QAChD,OAAO,EAAE,aAAa,CAAC,OAAO;QAC9B,gBAAgB,EAAE,aAAa,CAAC,gBAAgB;KACjD,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,sCAAsC,0CASjD;AAEK,MAAM,OAAO,GAAG;AACrB,8EAA8E;AAC9E,CAA+B,EACzB,EAAE;IACR,IAAI,QAAQ,EAAE;QAAE,OAAO;IAEvB,MAAM,IAAI,GAAG,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAC7C,IAAI,IAAI,EAAE;QACR,gBAAQ,CAAC,WAAW,CAClB,IAAI,EACJ,eAAK,CAAC,aAAa,CAAC,CAAC,EAAG,MAAc,CAAC,iBAAiB,CAAC,CAC1D,CAAC;KACH;IAED,8CAA8C;IAC9C,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE;QACxC,MAAM,IAAI,KAAK,CACb,8HAA8H,CAC/H,CAAC;KACH;AACH,CAAC,CAAC;AApBW,QAAA,OAAO,WAoBlB"}
@@ -0,0 +1,30 @@
1
+ import { LambdaRoutesConfig } from '@goldstack/utils-aws-lambda';
2
+ /**
3
+ * The prefix to be used for names of the generated lambdas for the dynamic endpoints.
4
+ *
5
+ * @title Lambda Name Prefix
6
+ * @pattern ^[A-Za-z0-9-_]*$
7
+ */
8
+ declare type LambdaNamePrefix = string;
9
+ /**
10
+ * The domain name that the service should be deployed to (e.g. mysite.com)
11
+ *
12
+ * @title Domain
13
+ * @pattern ^[^\s]*
14
+ */
15
+ export declare type Domain = string;
16
+ /**
17
+ * The domain name of the Route 53 hosted zone that the domain for this service should be added to.
18
+ *
19
+ * @title Hosted Zone Domain
20
+ * @pattern ^[^\s]*
21
+ */
22
+ export declare type HostedZoneDomain = string;
23
+ export interface SSRDeploymentConfiguration {
24
+ lambdaNamePrefix?: LambdaNamePrefix;
25
+ domain: Domain;
26
+ hostedZoneDomain: HostedZoneDomain;
27
+ lambdas: LambdaRoutesConfig;
28
+ }
29
+ export {};
30
+ //# sourceMappingURL=SSRDeploymentConfiguration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SSRDeploymentConfiguration.d.ts","sourceRoot":"","sources":["../../../src/types/SSRDeploymentConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE;;;;;GAKG;AACH,aAAK,gBAAgB,GAAG,MAAM,CAAC;AAE/B;;;;;GAKG;AACH,oBAAY,MAAM,GAAG,MAAM,CAAC;AAE5B;;;;;GAKG;AACH,oBAAY,gBAAgB,GAAG,MAAM,CAAC;AAEtC,MAAM,WAAW,0BAA0B;IACzC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,OAAO,EAAE,kBAAkB,CAAC;CAC7B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=SSRDeploymentConfiguration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SSRDeploymentConfiguration.js","sourceRoot":"","sources":["../../../src/types/SSRDeploymentConfiguration.ts"],"names":[],"mappings":""}
@@ -1,34 +1,34 @@
1
1
  import type { AWSDeployment } from '@goldstack/infra-aws';
2
2
  import type { TerraformDeployment } from '@goldstack/utils-terraform';
3
3
  import type { Deployment, DeploymentConfiguration } from '@goldstack/infra';
4
- import type { LambdaApiDeploymentConfiguration } from '@goldstack/utils-aws-lambda';
4
+ import type { SSRDeploymentConfiguration } from './SSRDeploymentConfiguration';
5
5
  import type { Package, Configuration } from '@goldstack/utils-package';
6
- export interface ThisDeploymentConfiguration extends LambdaApiDeploymentConfiguration, DeploymentConfiguration {
6
+ export interface ThisDeploymentConfiguration extends SSRDeploymentConfiguration, DeploymentConfiguration {
7
7
  }
8
8
  export interface ThisDeployment extends Deployment, AWSDeployment, TerraformDeployment {
9
9
  configuration: ThisDeploymentConfiguration;
10
10
  }
11
11
  /**
12
- * Places where the lambda should be deployed to.
12
+ * Places where the service should be deployed to.
13
13
  *
14
14
  * @title Deployments
15
15
  */
16
- export declare type LambdaApiDeployments = ThisDeployment[];
16
+ export declare type SSRDeployments = ThisDeployment[];
17
17
  /**
18
- * Configures this lambda.
18
+ * Configures this service.
19
19
  *
20
- * @title Lambda Configuration
20
+ * @title Service Configuration
21
21
  *
22
22
  */
23
23
  export declare type ThisPackageConfiguration = Configuration;
24
24
  /**
25
- * A deployment for a lambda API.
25
+ * A deployment for a server-side rendering package.
26
26
  *
27
- * @title Lambda API Package
27
+ * @title Server-side Rendering Package
28
28
  */
29
29
  export interface ThisPackage extends Package {
30
30
  configuration: ThisPackageConfiguration;
31
- deployments: LambdaApiDeployments;
31
+ deployments: SSRDeployments;
32
32
  }
33
33
  export { ThisDeploymentConfiguration as SSRDeploymentConfiguration };
34
34
  export { ThisDeployment as SSRDeployment };
@@ -1 +1 @@
1
- {"version":3,"file":"SSRPackage.d.ts","sourceRoot":"","sources":["../../../src/types/SSRPackage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,KAAK,EAAE,OAAO,EAAE,a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c,GAAG,cAAc,EAAE,CAAC;AAE9C;;;;;GAKG;AACH,oBAAY,wBAAwB,GAAG,aAAa,CAAC;AAErD;;;;GAIG;AACH,MAAM,WAAW,WAAY,SAAQ,OAAO;IAC1C,aAAa,EAAE,wBAAwB,CAAC;IACxC,WAAW,EAAE,cAAc,CAAC;CAC7B;AAED,OAAO,EAAE,2BAA2B,IAAI,0BAA0B,EAAE,CAAC;AACrE,OAAO,EAAE,cAAc,IAAI,aAAa,EAAE,CAAC;AAC3C,OAAO,EAAE,wBAAwB,IAAI,gBAAgB,EAAE,CAAC;AACxD,OAAO,EAAE,WAAW,IAAI,UAAU,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goldstack/template-ssr",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Building blocks for implementing server-side rendered pages.",
5
5
  "keywords": [
6
6
  "goldstack",
@@ -41,8 +41,8 @@
41
41
  "dependencies": {
42
42
  "@goldstack/infra": "0.3.38",
43
43
  "@goldstack/infra-aws": "0.3.47",
44
- "@goldstack/template-ssr-server": "0.1.5",
45
- "@goldstack/utils-aws-lambda": "0.1.35",
44
+ "@goldstack/template-ssr-server": "0.1.6",
45
+ "@goldstack/utils-aws-lambda": "0.1.36",
46
46
  "@goldstack/utils-esbuild": "0.4.3",
47
47
  "@goldstack/utils-package": "0.3.41",
48
48
  "@goldstack/utils-package-config-embedded": "0.4.5",