sst 2.45.0 → 2.45.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.
@@ -9,7 +9,7 @@ export const deploy = (program) => program.command("deploy [filter]", "Deploy yo
9
9
  })
10
10
  .positional("filter", {
11
11
  type: "string",
12
- describe: "Optionally filter stacks to deploy",
12
+ describe: "Optionally filter stacks to deploy using a regex pattern",
13
13
  }), async (args) => {
14
14
  const React = await import("react");
15
15
  const { printDeploymentResults } = await import("../ui/deploy.js");
@@ -59,12 +59,12 @@ export const deploy = (program) => program.command("deploy [filter]", "Deploy yo
59
59
  Colors.line(` ${Colors.bold("Region:")} ${project.config.region}`);
60
60
  Colors.line(` ${Colors.bold("Account:")} ${identity.Account}`);
61
61
  Colors.gap();
62
- const isActiveStack = (stackId) => !args.filter ||
63
- stackId
62
+ const filter = !!args.filter && new RegExp(args.filter, "i");
63
+ const isActiveStack = (stackId) => !filter ||
64
+ filter.test(stackId
64
65
  .toLowerCase()
65
66
  .replace(project.config.name.toLowerCase(), "")
66
- .replace(project.config.stage.toLowerCase(), "")
67
- .includes(args.filter.toLowerCase());
67
+ .replace(project.config.stage.toLowerCase(), ""));
68
68
  // Generate cloud assembly
69
69
  // - if --from is specified, we will use the existing cloud assembly
70
70
  // - if --from is not specified, we will call synth to generate
@@ -1,6 +1,6 @@
1
1
  export const remove = (program) => program.command("remove [filter]", "Remove your app from AWS", (yargs) => yargs.option("from", { type: "string" }).positional("filter", {
2
2
  type: "string",
3
- describe: "Optionally filter stacks to remove",
3
+ describe: "Optionally filter stacks to remove using a regex pattern",
4
4
  }), async (args) => {
5
5
  const React = await import("react");
6
6
  const { dim, blue, bold } = await import("colorette");
@@ -33,12 +33,12 @@ export const remove = (program) => program.command("remove [filter]", "Remove yo
33
33
  mode: "remove",
34
34
  });
35
35
  })();
36
- const target = assembly.stacks.filter((s) => !args.filter ||
37
- s.id
36
+ const filter = !!args.filter && new RegExp(args.filter, "i");
37
+ const target = assembly.stacks.filter((s) => !filter ||
38
+ filter.test(s.id
38
39
  .toLowerCase()
39
40
  .replace(project.config.name.toLowerCase(), "")
40
- .replace(project.config.stage.toLowerCase(), "")
41
- .includes(args.filter.toLowerCase()));
41
+ .replace(project.config.stage.toLowerCase(), "")));
42
42
  if (!target.length) {
43
43
  console.log(`No stacks found matching ${blue(args.filter)}`);
44
44
  throw new SilentError(`No stacks found matching ${args.filter}`);
@@ -9,12 +9,13 @@ import { Queue } from "aws-cdk-lib/aws-sqs";
9
9
  import { SqsEventSource } from "aws-cdk-lib/aws-lambda-event-sources";
10
10
  import { Stack } from "./Stack.js";
11
11
  import { SsrSite, } from "./SsrSite.js";
12
+ import { compareSemver } from "./util/compareSemver.js";
12
13
  import { toCdkSize } from "./util/size.js";
13
14
  import { PolicyStatement } from "aws-cdk-lib/aws-iam";
14
15
  import { RetentionDays } from "aws-cdk-lib/aws-logs";
15
16
  import { VisibleError } from "../error.js";
16
17
  import { Logger } from "../logger.js";
17
- const DEFAULT_OPEN_NEXT_VERSION = "3.0.2";
18
+ const DEFAULT_OPEN_NEXT_VERSION = "3.2.2";
18
19
  /**
19
20
  * The `NextjsSite` construct is a higher level CDK construct that makes it easy to create a Next.js app.
20
21
  * @example
@@ -35,11 +36,14 @@ export class NextjsSite extends SsrSite {
35
36
  prerenderManifest;
36
37
  openNextOutput;
37
38
  constructor(scope, id, props = {}) {
39
+ const openNextVersion = props.openNextVersion ?? DEFAULT_OPEN_NEXT_VERSION;
38
40
  super(scope, id, {
39
41
  buildCommand: [
40
42
  "npx",
41
43
  "--yes",
42
- `open-next@${props?.openNextVersion ?? DEFAULT_OPEN_NEXT_VERSION}`,
44
+ `${compareSemver(openNextVersion, "3.1.3") <= 0
45
+ ? "open-next"
46
+ : "@opennextjs/aws"}@${openNextVersion}`,
43
47
  "build",
44
48
  ].join(" "),
45
49
  ...props,
@@ -0,0 +1 @@
1
+ export declare function compareSemver(v1: string, v2: string): number;
@@ -0,0 +1,17 @@
1
+ export function compareSemver(v1, v2) {
2
+ if (v1 === "latest")
3
+ return 1;
4
+ if (/^[^\d]/.test(v1)) {
5
+ v1 = v1.substring(1);
6
+ }
7
+ if (/^[^\d]/.test(v2)) {
8
+ v2 = v2.substring(1);
9
+ }
10
+ const [major1, minor1, patch1] = v1.split(".").map(Number);
11
+ const [major2, minor2, patch2] = v2.split(".").map(Number);
12
+ if (major1 !== major2)
13
+ return major1 - major2;
14
+ if (minor1 !== minor2)
15
+ return minor1 - minor2;
16
+ return patch1 - patch2;
17
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "name": "sst",
4
- "version": "2.45.0",
4
+ "version": "2.45.1",
5
5
  "bin": {
6
6
  "sst": "cli/sst.js"
7
7
  },
@@ -118,7 +118,7 @@
118
118
  "@types/ws": "^8.5.3",
119
119
  "@types/yargs": "^17.0.13",
120
120
  "archiver": "^5.3.1",
121
- "astro-sst": "2.45.0",
121
+ "astro-sst": "2.45.1",
122
122
  "async": "^3.2.4",
123
123
  "tsx": "^3.12.1",
124
124
  "typescript": "5.2.2",