sst 2.42.0 → 2.43.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.
@@ -30,7 +30,7 @@ export const list = (program) => program.command("list [format]", "Fetch all the
30
30
  break;
31
31
  case "env":
32
32
  for (const [key, value] of Object.entries(secrets)) {
33
- console.log(`${key}=${value.value || `${value.fallback} #fallback`}`);
33
+ console.log(`${key}=${`'${value.value}'` || `'${value.fallback}' #fallback`}`);
34
34
  }
35
35
  break;
36
36
  case "table":
@@ -18,38 +18,9 @@ export declare class AstroSite extends SsrSite {
18
18
  private static getBuildMeta;
19
19
  private static getCFRoutingFunction;
20
20
  protected plan(): {
21
- cloudFrontFunctions?: Record<string, {
22
- constructId: string;
23
- injections: string[];
24
- }> | undefined;
25
- edgeFunctions?: Record<string, {
26
- constructId: string;
27
- function: import("./EdgeFunction.js").EdgeFunctionProps;
28
- }> | undefined;
29
- origins: Record<string, {
30
- type: "function";
31
- constructId: string;
32
- function: import("./SsrFunction.js").SsrFunctionProps;
33
- injections?: string[] | undefined;
34
- streaming?: boolean | undefined;
35
- } | {
36
- type: "image-optimization-function";
37
- function: import("aws-cdk-lib/aws-lambda").FunctionProps;
38
- } | {
39
- type: "s3";
40
- originPath?: string | undefined;
41
- copy: {
42
- from: string;
43
- to: string;
44
- cached: boolean;
45
- versionedSubDir?: string | undefined;
46
- }[];
47
- } | {
48
- type: "group";
49
- primaryOriginName: string;
50
- fallbackOriginName: string;
51
- fallbackStatusCodes?: number[] | undefined;
52
- }>;
21
+ cloudFrontFunctions?: Record<string, import("./SsrSite.js").CloudFrontFunctionConfig> | undefined;
22
+ edgeFunctions?: Record<string, import("./SsrSite.js").EdgeFunctionConfig> | undefined;
23
+ origins: Record<string, import("./SsrSite.js").FunctionOriginConfig | import("./SsrSite.js").ImageOptimizationFunctionOriginConfig | import("./SsrSite.js").S3OriginConfig | import("./SsrSite.js").OriginGroupConfig>;
53
24
  edge: boolean;
54
25
  behaviors: {
55
26
  cacheType: "server" | "static";
@@ -64,6 +35,9 @@ export declare class AstroSite extends SsrSite {
64
35
  allowedHeaders?: string[] | undefined;
65
36
  } | undefined;
66
37
  buildId?: string | undefined;
38
+ warmer?: {
39
+ function: string;
40
+ } | undefined;
67
41
  };
68
42
  getConstructMetadata(): {
69
43
  data: {
@@ -1,9 +1,18 @@
1
1
  import { Construct } from "constructs";
2
- import { Runtime, FunctionProps, Architecture } from "aws-cdk-lib/aws-lambda";
3
- import { SsrSite, SsrSiteNormalizedProps, SsrSiteProps } from "./SsrSite.js";
2
+ import { Runtime, FunctionProps as CdkFunctionProps, Architecture } from "aws-cdk-lib/aws-lambda";
3
+ import { EdgeFunctionConfig, FunctionOriginConfig, SsrSite, SsrSiteNormalizedProps, SsrSiteProps } from "./SsrSite.js";
4
4
  import { Size } from "./util/size.js";
5
5
  import { Bucket } from "aws-cdk-lib/aws-s3";
6
- import { CachePolicyProps } from "aws-cdk-lib/aws-cloudfront";
6
+ type OpenNextS3Origin = {
7
+ type: "s3";
8
+ originPath: string;
9
+ copy: {
10
+ from: string;
11
+ to: string;
12
+ cached: boolean;
13
+ versionedSubDir?: string;
14
+ }[];
15
+ };
7
16
  export interface NextjsSiteProps extends Omit<SsrSiteProps, "nodejs"> {
8
17
  /**
9
18
  * OpenNext version for building the Next.js site.
@@ -14,17 +23,6 @@ export interface NextjsSiteProps extends Omit<SsrSiteProps, "nodejs"> {
14
23
  * ```
15
24
  */
16
25
  openNextVersion?: string;
17
- /**
18
- * How the logs are stored in CloudWatch
19
- * - "combined" - Logs from all routes are stored in the same log group.
20
- * - "per-route" - Logs from each route are stored in a separate log group.
21
- * @default "per-route"
22
- * @example
23
- * ```js
24
- * logging: "combined",
25
- * ```
26
- */
27
- logging?: "combined" | "per-route";
28
26
  /**
29
27
  * The server function is deployed to Lambda in a single region. Alternatively, you can enable this option to deploy to Lambda@Edge.
30
28
  * @default false
@@ -42,59 +40,20 @@ export interface NextjsSiteProps extends Omit<SsrSiteProps, "nodejs"> {
42
40
  * ```
43
41
  */
44
42
  memorySize?: number | Size;
45
- };
46
- openNext?: {
47
- /**
48
- * Specify a custom build output path for cases when running OpenNext from
49
- * a monorepo with decentralized build output. This is passed to the
50
- * `--build-output-path` flag of OpenNext.
51
- * @default Default build output path
52
- * @example
53
- * ```js
54
- * buildOutputPath: "dist/apps/example-app"
55
- * ```
56
- */
57
- buildOutputPath?: string;
58
- };
59
- experimental?: {
60
- /**
61
- * Enable streaming. Currently an experimental feature in OpenNext.
62
- * @default false
63
- * @example
64
- * ```js
65
- * experimental: {
66
- * streaming: true,
67
- * }
68
- * ```
69
- */
70
- streaming?: boolean;
71
43
  /**
72
- * Disabling incremental cache will cause the entire page to be revalidated on each request. This can result in ISR and SSG pages to be in an inconsistent state. Specify this option if you are using SSR pages only.
73
- *
74
- * Note that it is possible to disable incremental cache while leaving on-demand revalidation enabled.
44
+ * If set to true, already computed image will return 304 Not Modified.
45
+ * This means that image needs to be immutable, the etag will be computed based on the image href, format and width and the next BUILD_ID.
75
46
  * @default false
76
47
  * @example
77
48
  * ```js
78
- * experimental: {
79
- * disableIncrementalCache: true,
80
- * }
81
- * ```
82
- */
83
- disableIncrementalCache?: boolean;
84
- /**
85
- * Disabling DynamoDB cache will cause on-demand revalidation by path (`revalidatePath`) and by cache tag (`revalidateTag`) to fail silently.
86
- * @default false
87
- * @example
88
- * ```js
89
- * experimental: {
90
- * disableDynamoDBCache: true,
49
+ * imageOptimization: {
50
+ * staticImageOptimization: true,
91
51
  * }
92
- * ```
93
52
  */
94
- disableDynamoDBCache?: boolean;
53
+ staticImageOptimization?: boolean;
95
54
  };
96
55
  cdk?: SsrSiteProps["cdk"] & {
97
- revalidation?: Pick<FunctionProps, "vpc" | "vpcSubnets">;
56
+ revalidation?: Pick<CdkFunctionProps, "vpc" | "vpcSubnets">;
98
57
  /**
99
58
  * Override the CloudFront cache policy properties for responses from the
100
59
  * server rendering Lambda.
@@ -145,8 +104,11 @@ export declare class NextjsSite extends SsrSite {
145
104
  private appPathsManifest?;
146
105
  private pagesManifest?;
147
106
  private prerenderManifest?;
148
- constructor(scope: Construct, id: string, rawProps?: NextjsSiteProps);
149
- static buildDefaultServerCachePolicyProps(): CachePolicyProps;
107
+ private openNextOutput?;
108
+ constructor(scope: Construct, id: string, props?: NextjsSiteProps);
109
+ private createFunctionOrigin;
110
+ private createEcsOrigin;
111
+ private createEdgeOrigin;
150
112
  protected plan(bucket: Bucket): {
151
113
  cloudFrontFunctions?: {
152
114
  serverCfFunction: {
@@ -154,26 +116,11 @@ export declare class NextjsSite extends SsrSite {
154
116
  injections: string[];
155
117
  };
156
118
  } | undefined;
157
- edgeFunctions?: {
158
- edgeServer: {
159
- constructId: string;
160
- function: {
161
- description: string;
162
- bundle: string;
163
- handler: string;
164
- environment: {
165
- CACHE_BUCKET_NAME: string;
166
- CACHE_BUCKET_KEY_PREFIX: string;
167
- CACHE_BUCKET_REGION: string;
168
- };
169
- layers: import("aws-cdk-lib/aws-lambda").ILayerVersion[] | undefined;
170
- };
171
- };
172
- } | undefined;
119
+ edgeFunctions?: Record<string, EdgeFunctionConfig> | undefined;
173
120
  origins: {
121
+ s3: OpenNextS3Origin;
174
122
  imageOptimizer: {
175
123
  type: "image-optimization-function";
176
- constructId: string;
177
124
  function: {
178
125
  description: string;
179
126
  handler: string;
@@ -181,73 +128,39 @@ export declare class NextjsSite extends SsrSite {
181
128
  runtime: Runtime;
182
129
  architecture: Architecture;
183
130
  environment: {
131
+ OPENNEXT_STATIC_ETAG?: string | undefined;
184
132
  BUCKET_NAME: string;
185
133
  BUCKET_KEY_PREFIX: string;
186
134
  };
135
+ permissions: string[];
187
136
  memorySize: number;
188
137
  };
189
138
  };
190
- s3: {
191
- type: "s3";
192
- originPath: string;
193
- copy: ({
194
- from: string;
195
- to: string;
196
- cached: true;
197
- versionedSubDir: string;
198
- } | {
199
- from: string;
200
- to: string;
201
- cached: false;
202
- versionedSubDir?: undefined;
203
- })[];
204
- };
205
- regionalServer?: {
206
- type: "function";
207
- constructId: string;
208
- function: {
209
- description: string;
210
- bundle: string;
211
- handler: string;
212
- environment: {
213
- CACHE_BUCKET_NAME: string;
214
- CACHE_BUCKET_KEY_PREFIX: string;
215
- CACHE_BUCKET_REGION: string;
216
- };
217
- layers: import("aws-cdk-lib/aws-lambda").ILayerVersion[] | undefined;
218
- };
219
- streaming: boolean | undefined;
220
- injections: string[];
221
- } | undefined;
139
+ default: FunctionOriginConfig;
222
140
  };
223
141
  edge: boolean;
224
142
  behaviors: {
225
143
  cacheType: "server" | "static";
226
144
  pattern?: string | undefined;
227
- origin: "s3" | "regionalServer" | "imageOptimizer";
145
+ origin: "default" | "s3" | "imageOptimizer";
228
146
  allowedMethods?: import("aws-cdk-lib/aws-cloudfront").AllowedMethods | undefined;
229
147
  cfFunction?: "serverCfFunction" | undefined;
230
- edgeFunction?: "edgeServer" | undefined;
148
+ edgeFunction?: string | undefined;
231
149
  }[];
232
150
  errorResponses?: import("aws-cdk-lib/aws-cloudfront").ErrorResponse[] | undefined;
233
151
  serverCachePolicy?: {
234
152
  allowedHeaders?: string[] | undefined;
235
153
  } | undefined;
236
154
  buildId?: string | undefined;
155
+ warmer?: {
156
+ function: string;
157
+ } | undefined;
237
158
  };
238
- private prefixPattern;
159
+ private setMiddlewareEnv;
239
160
  private createRevalidationQueue;
240
161
  private createRevalidationTable;
241
162
  getConstructMetadata(): {
242
- type: "NextjsSite";
243
163
  data: {
244
- routes: {
245
- logGroupPrefix: string;
246
- data: {
247
- route: string;
248
- logGroupPath: string;
249
- }[];
250
- } | undefined;
251
164
  mode: "placeholder" | "deployed";
252
165
  path: string;
253
166
  runtime: "nodejs16.x" | "nodejs18.x" | "nodejs20.x";
@@ -258,23 +171,20 @@ export declare class NextjsSite extends SsrSite {
258
171
  secrets: string[];
259
172
  prefetchSecrets: boolean | undefined;
260
173
  };
174
+ type: "NextjsSite";
261
175
  };
262
- private removeSourcemaps;
263
176
  private useRoutes;
264
177
  private useRoutesManifest;
265
178
  private useAppPathRoutesManifest;
266
179
  private useAppPathsManifest;
267
180
  private usePagesManifest;
268
181
  private usePrerenderManifest;
269
- private useServerFunctionPerRouteLoggingInjection;
270
- private useCloudFrontFunctionPrerenderBypassHeaderInjection;
182
+ private useCloudFrontFunctionCacheHeaderKey;
183
+ private useCloudfrontGeoHeadersInjection;
271
184
  private getBuildId;
272
185
  private getSourcemapForAppRoute;
273
186
  private getSourcemapForPagesRoute;
274
- private isPerRouteLoggingEnabled;
275
187
  private handleMissingSourcemap;
276
- private disableDefaultLogging;
277
- private uploadSourcemaps;
278
188
  private static buildCloudWatchRouteName;
279
189
  private static buildCloudWatchRouteHash;
280
190
  static _test: {