sst 2.28.5 → 2.29.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/cli/sst.js CHANGED
@@ -68,7 +68,7 @@ process.on("uncaughtException", (err) => {
68
68
  });
69
69
  // Check Node version
70
70
  const nodeVersion = process.versions.node;
71
- if (Number(nodeVersion.split(".")[0]) < 16) {
72
- throw new VisibleError(`Node.js version ${nodeVersion} is not supported by SST. Please upgrade to Node.js 16 or later.`);
71
+ if (Number(nodeVersion.split(".")[0]) < 18) {
72
+ throw new VisibleError(`Node.js version ${nodeVersion} is not supported by SST. Please upgrade to Node.js 18 or later.`);
73
73
  }
74
74
  program.parse();
@@ -192,7 +192,9 @@ export declare class NextjsSite extends SsrSite {
192
192
  getConstructMetadata(): {
193
193
  type: "NextjsSite";
194
194
  data: {
195
- routes: any[];
195
+ routes: {
196
+ route: string;
197
+ }[] | undefined;
196
198
  mode: "placeholder" | "deployed";
197
199
  path: string;
198
200
  runtime: "nodejs14.x" | "nodejs16.x" | "nodejs18.x";
@@ -205,6 +207,6 @@ export declare class NextjsSite extends SsrSite {
205
207
  };
206
208
  private wrapHandler;
207
209
  private getRoutes;
208
- private useBuildId;
210
+ private getBuildId;
209
211
  }
210
212
  export {};
@@ -191,7 +191,7 @@ export class NextjsSite extends SsrSite {
191
191
  "next-router-state-tree",
192
192
  "next-url",
193
193
  ],
194
- buildId: this.useBuildId(),
194
+ buildId: this.getBuildId(),
195
195
  warmerConfig: {
196
196
  function: path.join(sitePath, ".open-next", "warmer-function"),
197
197
  },
@@ -282,7 +282,7 @@ export class NextjsSite extends SsrSite {
282
282
  type: "NextjsSite",
283
283
  data: {
284
284
  ...metadata.data,
285
- routes: this.getRoutes(),
285
+ routes: this.props.edge || this.doNotDeploy ? undefined : this.getRoutes(),
286
286
  },
287
287
  };
288
288
  }
@@ -306,14 +306,18 @@ export class NextjsSite extends SsrSite {
306
306
  .readFileSync(path.join(sitePath, ".next/routes-manifest.json"))
307
307
  .toString());
308
308
  return [
309
- ...[...content.dynamicRoutes, ...content.staticRoutes].map(({ page }) => ({
309
+ ...[...content.dynamicRoutes, ...content.staticRoutes]
310
+ .map(({ page }) => ({
310
311
  route: page,
311
- })),
312
- ...(content.dataRoutes || []).map(({ page }) => ({
312
+ }))
313
+ .sort((a, b) => a.route.localeCompare(b.route)),
314
+ ...(content.dataRoutes || [])
315
+ .map(({ page }) => ({
313
316
  route: page.endsWith("/")
314
- ? `/_next/data/${this.useBuildId()}${page}index.json`
315
- : `/_next/data/${this.useBuildId()}${page}.json`,
316
- })),
317
+ ? `/_next/data/BUILD_ID${page}index.json`
318
+ : `/_next/data/BUILD_ID${page}.json`,
319
+ }))
320
+ .sort((a, b) => a.route.localeCompare(b.route)),
317
321
  ];
318
322
  }
319
323
  catch (e) {
@@ -321,7 +325,7 @@ export class NextjsSite extends SsrSite {
321
325
  throw new VisibleError(`Failed to read routes data from ".next/routes-manifest.json" for the "${id}" site.`);
322
326
  }
323
327
  }
324
- useBuildId() {
328
+ getBuildId() {
325
329
  const { path: sitePath } = this.props;
326
330
  return fs.readFileSync(path.join(sitePath, ".next/BUILD_ID")).toString();
327
331
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "name": "sst",
4
- "version": "2.28.5",
4
+ "version": "2.29.0",
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.5",
122
+ "astro-sst": "2.29.0",
123
123
  "tsx": "^3.12.1",
124
124
  "typescript": "^5.2.2",
125
125
  "vitest": "^0.33.0"