sst 2.35.0 → 2.36.0
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/constructs/NextjsSite.d.ts +7 -7
- package/constructs/NextjsSite.js +17 -12
- package/constructs/RemixSite.d.ts +2 -0
- package/constructs/RemixSite.js +3 -0
- package/constructs/SolidStartSite.d.ts +2 -0
- package/constructs/SolidStartSite.js +3 -0
- package/constructs/SsrSite.d.ts +21 -6
- package/constructs/SsrSite.js +1 -0
- package/package.json +2 -2
|
@@ -21,10 +21,10 @@ export interface NextjsSiteProps extends Omit<SsrSiteProps, "nodejs"> {
|
|
|
21
21
|
* How the logs are stored in CloudWatch
|
|
22
22
|
* - "combined" - Logs from all routes are stored in the same log group.
|
|
23
23
|
* - "per-route" - Logs from each route are stored in a separate log group.
|
|
24
|
-
* @default "
|
|
24
|
+
* @default "per-route"
|
|
25
25
|
* @example
|
|
26
26
|
* ```js
|
|
27
|
-
* logging: "
|
|
27
|
+
* logging: "combined",
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
30
|
logging?: "combined" | "per-route";
|
|
@@ -134,7 +134,7 @@ export declare class NextjsSite extends SsrSite {
|
|
|
134
134
|
private appPathsManifest?;
|
|
135
135
|
private pagesManifest?;
|
|
136
136
|
private prerenderManifest?;
|
|
137
|
-
constructor(scope: Construct, id: string,
|
|
137
|
+
constructor(scope: Construct, id: string, rawProps?: NextjsSiteProps);
|
|
138
138
|
static buildDefaultServerCachePolicyProps(): CachePolicyProps;
|
|
139
139
|
protected plan(bucket: Bucket): {
|
|
140
140
|
cloudFrontFunctions?: {
|
|
@@ -205,10 +205,10 @@ export declare class NextjsSite extends SsrSite {
|
|
|
205
205
|
* How the logs are stored in CloudWatch
|
|
206
206
|
* - "combined" - Logs from all routes are stored in the same log group.
|
|
207
207
|
* - "per-route" - Logs from each route are stored in a separate log group.
|
|
208
|
-
* @default "
|
|
208
|
+
* @default "per-route"
|
|
209
209
|
* @example
|
|
210
210
|
* ```js
|
|
211
|
-
* logging: "
|
|
211
|
+
* logging: "combined",
|
|
212
212
|
* ```
|
|
213
213
|
*/
|
|
214
214
|
environment?: Record<string, string> | undefined;
|
|
@@ -312,10 +312,10 @@ export declare class NextjsSite extends SsrSite {
|
|
|
312
312
|
* How the logs are stored in CloudWatch
|
|
313
313
|
* - "combined" - Logs from all routes are stored in the same log group.
|
|
314
314
|
* - "per-route" - Logs from each route are stored in a separate log group.
|
|
315
|
-
* @default "
|
|
315
|
+
* @default "per-route"
|
|
316
316
|
* @example
|
|
317
317
|
* ```js
|
|
318
|
-
* logging: "
|
|
318
|
+
* logging: "combined",
|
|
319
319
|
* ```
|
|
320
320
|
*/
|
|
321
321
|
environment?: Record<string, string> | undefined;
|
package/constructs/NextjsSite.js
CHANGED
|
@@ -20,7 +20,7 @@ import { useFunctions } from "./Function.js";
|
|
|
20
20
|
import { useDeferredTasks } from "./deferred_task.js";
|
|
21
21
|
import { Logger } from "../logger.js";
|
|
22
22
|
const LAYER_VERSION = "2";
|
|
23
|
-
const DEFAULT_OPEN_NEXT_VERSION = "2.3.
|
|
23
|
+
const DEFAULT_OPEN_NEXT_VERSION = "2.3.1";
|
|
24
24
|
const DEFAULT_CACHE_POLICY_ALLOWED_HEADERS = [
|
|
25
25
|
"accept",
|
|
26
26
|
"rsc",
|
|
@@ -46,21 +46,28 @@ export class NextjsSite extends SsrSite {
|
|
|
46
46
|
appPathsManifest;
|
|
47
47
|
pagesManifest;
|
|
48
48
|
prerenderManifest;
|
|
49
|
-
constructor(scope, id,
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
constructor(scope, id, rawProps) {
|
|
50
|
+
const props = {
|
|
51
|
+
logging: rawProps?.logging ?? "per-route",
|
|
52
|
+
experimental: {
|
|
53
|
+
streaming: rawProps?.experimental?.streaming ?? false,
|
|
54
|
+
disableDynamoDBCache: rawProps?.experimental?.disableDynamoDBCache ?? false,
|
|
55
|
+
disableIncrementalCache: rawProps?.experimental?.disableIncrementalCache ?? false,
|
|
56
|
+
...rawProps?.experimental,
|
|
57
|
+
},
|
|
58
|
+
...rawProps,
|
|
59
|
+
};
|
|
53
60
|
super(scope, id, {
|
|
54
61
|
buildCommand: [
|
|
55
62
|
"npx",
|
|
56
63
|
"--yes",
|
|
57
64
|
`open-next@${props?.openNextVersion ?? DEFAULT_OPEN_NEXT_VERSION}`,
|
|
58
65
|
"build",
|
|
59
|
-
...(streaming ? ["--streaming"] : []),
|
|
60
|
-
...(disableDynamoDBCache
|
|
66
|
+
...(props.experimental.streaming ? ["--streaming"] : []),
|
|
67
|
+
...(props.experimental.disableDynamoDBCache
|
|
61
68
|
? ["--dangerously-disable-dynamodb-cache"]
|
|
62
69
|
: []),
|
|
63
|
-
...(disableIncrementalCache
|
|
70
|
+
...(props.experimental.disableIncrementalCache
|
|
64
71
|
? ["--dangerously-disable-incremental-cache"]
|
|
65
72
|
: []),
|
|
66
73
|
].join(" "),
|
|
@@ -70,9 +77,9 @@ export class NextjsSite extends SsrSite {
|
|
|
70
77
|
this.disableDefaultLogging();
|
|
71
78
|
this.uploadSourcemaps();
|
|
72
79
|
}
|
|
73
|
-
if (!disableIncrementalCache) {
|
|
80
|
+
if (!props.experimental.disableIncrementalCache) {
|
|
74
81
|
this.createRevalidationQueue();
|
|
75
|
-
if (!disableDynamoDBCache) {
|
|
82
|
+
if (!props.experimental.disableDynamoDBCache) {
|
|
76
83
|
this.createRevalidationTable();
|
|
77
84
|
}
|
|
78
85
|
}
|
|
@@ -564,8 +571,6 @@ export class NextjsSite extends SsrSite {
|
|
|
564
571
|
this.props.logging === "per-route");
|
|
565
572
|
}
|
|
566
573
|
disableDefaultLogging() {
|
|
567
|
-
// Note: keep default logs enabled
|
|
568
|
-
return;
|
|
569
574
|
const stack = Stack.of(this);
|
|
570
575
|
const server = this.serverFunction;
|
|
571
576
|
const policy = new Policy(this, "DisableLoggingPolicy", {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SsrSite, SsrSiteNormalizedProps, SsrSiteProps } from "./SsrSite.js";
|
|
2
|
+
import { Construct } from "constructs";
|
|
2
3
|
export interface RemixSiteProps extends SsrSiteProps {
|
|
3
4
|
/**
|
|
4
5
|
* The server function is deployed to Lambda in a single region. Alternatively, you can enable this option to deploy to Lambda@Edge.
|
|
@@ -22,6 +23,7 @@ type RemixSiteNormalizedProps = RemixSiteProps & SsrSiteNormalizedProps;
|
|
|
22
23
|
*/
|
|
23
24
|
export declare class RemixSite extends SsrSite {
|
|
24
25
|
props: RemixSiteNormalizedProps;
|
|
26
|
+
constructor(scope: Construct, id: string, props?: RemixSiteProps);
|
|
25
27
|
protected plan(): {
|
|
26
28
|
cloudFrontFunctions?: {
|
|
27
29
|
serverCfFunction: {
|
package/constructs/RemixSite.js
CHANGED
|
@@ -21,6 +21,9 @@ const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
23
|
export class RemixSite extends SsrSite {
|
|
24
|
+
constructor(scope, id, props) {
|
|
25
|
+
super(scope, id, props);
|
|
26
|
+
}
|
|
24
27
|
plan() {
|
|
25
28
|
const { path: sitePath, edge } = this.props;
|
|
26
29
|
const { handler, inject } = this.createServerLambdaBundle(edge ? "edge-server.js" : "regional-server.js");
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SsrSite, SsrSiteNormalizedProps, SsrSiteProps } from "./SsrSite.js";
|
|
2
|
+
import { Construct } from "constructs";
|
|
2
3
|
export interface SolidStartSiteProps extends SsrSiteProps {
|
|
3
4
|
/**
|
|
4
5
|
* The server function is deployed to Lambda in a single region. Alternatively, you can enable this option to deploy to Lambda@Edge.
|
|
@@ -20,6 +21,7 @@ type SolidStartSiteNormalizedProps = SolidStartSiteProps & SsrSiteNormalizedProp
|
|
|
20
21
|
*/
|
|
21
22
|
export declare class SolidStartSite extends SsrSite {
|
|
22
23
|
props: SolidStartSiteNormalizedProps;
|
|
24
|
+
constructor(scope: Construct, id: string, props?: SolidStartSiteProps);
|
|
23
25
|
protected plan(): {
|
|
24
26
|
cloudFrontFunctions?: {
|
|
25
27
|
serverCfFunction: {
|
package/constructs/SsrSite.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Construct } from "constructs";
|
|
|
2
2
|
import { Bucket, BucketProps, IBucket } from "aws-cdk-lib/aws-s3";
|
|
3
3
|
import { Function as CdkFunction, FunctionProps as CdkFunctionProps } from "aws-cdk-lib/aws-lambda";
|
|
4
4
|
import { ICachePolicy, IResponseHeadersPolicy, ViewerProtocolPolicy, AllowedMethods, CachePolicyProps, ErrorResponse } from "aws-cdk-lib/aws-cloudfront";
|
|
5
|
+
import { S3OriginProps } from "aws-cdk-lib/aws-cloudfront-origins";
|
|
5
6
|
import { Schedule } from "aws-cdk-lib/aws-events";
|
|
6
7
|
import { DistributionDomainProps } from "./Distribution.js";
|
|
7
8
|
import { SSTConstruct } from "./Construct.js";
|
|
@@ -329,6 +330,20 @@ export interface SsrSiteProps {
|
|
|
329
330
|
* create the CDK `Distribution` internally.
|
|
330
331
|
*/
|
|
331
332
|
distribution?: SsrCdkDistributionProps;
|
|
333
|
+
/**
|
|
334
|
+
* Override the CloudFront S3 origin properties.
|
|
335
|
+
* @example
|
|
336
|
+
* ```js
|
|
337
|
+
* import { OriginAccessIdenty } from "aws-cdk-lib/aws-cloudfront";
|
|
338
|
+
*
|
|
339
|
+
* cdk: {
|
|
340
|
+
* s3Origin: {
|
|
341
|
+
* originAccessIdentity: OriginAccessIdentity.fromOriginAccessIdentityId(stack, "OriginAccessIdentity", "XXXXXXXX" ),
|
|
342
|
+
* },
|
|
343
|
+
* }
|
|
344
|
+
* ```
|
|
345
|
+
*/
|
|
346
|
+
s3Origin?: S3OriginProps;
|
|
332
347
|
/**
|
|
333
348
|
* Override the CloudFront cache policy properties for responses from the
|
|
334
349
|
* server rendering Lambda.
|
|
@@ -341,12 +356,12 @@ export interface SsrSiteProps {
|
|
|
341
356
|
*
|
|
342
357
|
* ```js
|
|
343
358
|
* serverCachePolicy: new CachePolicy(this, "ServerCache", {
|
|
344
|
-
* queryStringBehavior: CacheQueryStringBehavior.all()
|
|
345
|
-
* headerBehavior: CacheHeaderBehavior.none()
|
|
346
|
-
* cookieBehavior: CacheCookieBehavior.none()
|
|
347
|
-
* defaultTtl: Duration.days(0)
|
|
348
|
-
* maxTtl: Duration.days(365)
|
|
349
|
-
* minTtl: Duration.days(0)
|
|
359
|
+
* queryStringBehavior: CacheQueryStringBehavior.all(),
|
|
360
|
+
* headerBehavior: CacheHeaderBehavior.none(),
|
|
361
|
+
* cookieBehavior: CacheCookieBehavior.none(),
|
|
362
|
+
* defaultTtl: Duration.days(0),
|
|
363
|
+
* maxTtl: Duration.days(365),
|
|
364
|
+
* minTtl: Duration.days(0),
|
|
350
365
|
* })
|
|
351
366
|
* ```
|
|
352
367
|
*/
|
package/constructs/SsrSite.js
CHANGED
|
@@ -414,6 +414,7 @@ function handler(event) {
|
|
|
414
414
|
function createS3Origin(props) {
|
|
415
415
|
const s3Origin = new S3Origin(bucket, {
|
|
416
416
|
originPath: "/" + (props.originPath ?? ""),
|
|
417
|
+
...(cdk?.s3Origin ?? {}),
|
|
417
418
|
});
|
|
418
419
|
const assets = createS3OriginAssets(props.copy);
|
|
419
420
|
const s3deployCR = createS3OriginDeployment(props.copy, assets);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"sideEffects": false,
|
|
3
3
|
"name": "sst",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.36.0",
|
|
5
5
|
"bin": {
|
|
6
6
|
"sst": "cli/sst.js"
|
|
7
7
|
},
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"@types/ws": "^8.5.3",
|
|
121
121
|
"@types/yargs": "^17.0.13",
|
|
122
122
|
"archiver": "^5.3.1",
|
|
123
|
-
"astro-sst": "2.
|
|
123
|
+
"astro-sst": "2.36.0",
|
|
124
124
|
"async": "^3.2.4",
|
|
125
125
|
"tsx": "^3.12.1",
|
|
126
126
|
"typescript": "^5.2.2",
|