sst 2.28.1 → 2.28.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.
@@ -201,7 +201,7 @@ export interface ApiProps<Authorizers extends Record<string, ApiAuthorizer> = Re
201
201
  */
202
202
  cors?: boolean | ApiCorsProps;
203
203
  /**
204
- * Enable CloudWatch access logs for this API
204
+ * Enable CloudWatch access logs for this API. Defaults to true.
205
205
  *
206
206
  * @default true
207
207
  *
@@ -19,26 +19,6 @@ export class AstroSite extends SsrSite {
19
19
  super(scope, id, {
20
20
  ...props,
21
21
  typesPath: props?.typesPath ?? "src",
22
- fileOptions: props?.fileOptions ?? [
23
- {
24
- exclude: "*",
25
- include: "*.css",
26
- cacheControl: "public,max-age=0,s-maxage=31536000,must-revalidate",
27
- contentType: "text/css; charset=UTF-8",
28
- },
29
- {
30
- exclude: "*",
31
- include: "*.js",
32
- cacheControl: "public,max-age=0,s-maxage=31536000,must-revalidate",
33
- contentType: "application/javascript; charset=UTF-8",
34
- },
35
- {
36
- exclude: "*",
37
- include: "*.html",
38
- cacheControl: "public,max-age=0,s-maxage=31536000,must-revalidate",
39
- contentType: "text/html; charset=UTF-8",
40
- },
41
- ],
42
22
  regional: {
43
23
  ...props?.regional,
44
24
  },
@@ -179,14 +159,28 @@ export class AstroSite extends SsrSite {
179
159
  pattern: route,
180
160
  origin: "regionalServer",
181
161
  })));
182
- const notFoundRoute = buildMeta.routes.find(({ route, type }) => route.match(/^\/404\/?$/) && type === "page");
183
- if (notFoundRoute) {
184
- plan.errorResponses?.push({
185
- httpStatus: 404,
186
- responsePagePath: "/404.html",
187
- responseHttpStatus: 404,
188
- });
189
- }
162
+ buildMeta.routes
163
+ .filter(({ type, route }) => type === "page" && /^\/\d{3}\/?$/.test(route))
164
+ .forEach(({ route, prerender }) => {
165
+ switch (route) {
166
+ case "/404":
167
+ case "/404/":
168
+ plan.errorResponses?.push({
169
+ httpStatus: 404,
170
+ responsePagePath: prerender ? "/404.html" : "/404",
171
+ responseHttpStatus: 404,
172
+ });
173
+ break;
174
+ case "/500":
175
+ case "/500/":
176
+ plan.errorResponses?.push({
177
+ httpStatus: 500,
178
+ responsePagePath: prerender ? "/500.html" : "/500",
179
+ responseHttpStatus: 500,
180
+ });
181
+ break;
182
+ }
183
+ });
190
184
  }
191
185
  return this.validatePlan(plan);
192
186
  }
@@ -248,7 +248,7 @@ export interface SsrSiteProps {
248
248
  * from the server rendering Lambda.
249
249
  */
250
250
  responseHeadersPolicy?: IResponseHeadersPolicy;
251
- server?: Pick<CdkFunctionProps, "vpc" | "vpcSubnets" | "securityGroups" | "allowAllOutbound" | "allowPublicSubnet" | "architecture" | "logRetention"> & Pick<FunctionProps, "copyFiles">;
251
+ server?: Pick<CdkFunctionProps, "layers" | "vpc" | "vpcSubnets" | "securityGroups" | "allowAllOutbound" | "allowPublicSubnet" | "architecture" | "logRetention"> & Pick<FunctionProps, "copyFiles">;
252
252
  };
253
253
  /**
254
254
  * Pass in a list of file options to customize cache control and content type specific files.
@@ -195,7 +195,7 @@ export class SsrSite extends Construct {
195
195
  bind,
196
196
  environment,
197
197
  permissions,
198
- // note: do not need to set vpc settings b/c this function is not being used
198
+ // note: do not need to set vpc and layers settings b/c this function is not being used
199
199
  });
200
200
  }
201
201
  function createWarmer() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "name": "sst",
4
- "version": "2.28.1",
4
+ "version": "2.28.3",
5
5
  "bin": {
6
6
  "sst": "cli/sst.js"
7
7
  },
@@ -119,7 +119,7 @@
119
119
  "@types/ws": "^8.5.3",
120
120
  "@types/yargs": "^17.0.13",
121
121
  "archiver": "^5.3.1",
122
- "astro-sst": "2.28.1",
122
+ "astro-sst": "2.28.3",
123
123
  "tsx": "^3.12.1",
124
124
  "typescript": "^5.2.2",
125
125
  "vitest": "^0.33.0"