sst 2.5.0 → 2.5.2

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.
@@ -26,7 +26,7 @@ const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
26
26
  export class NextjsSite extends SsrSite {
27
27
  constructor(scope, id, props) {
28
28
  super(scope, id, {
29
- buildCommand: "npx --yes open-next@^0.8.0 build",
29
+ buildCommand: "npx --yes open-next@^0.9.0 build",
30
30
  ...props,
31
31
  });
32
32
  }
@@ -263,7 +263,7 @@ export class NextjsSite extends SsrSite {
263
263
  const fallbackOriginGroup = new OriginGroup({
264
264
  primaryOrigin: serverOrigin,
265
265
  fallbackOrigin: s3Origin,
266
- fallbackStatusCodes: [404],
266
+ fallbackStatusCodes: [503],
267
267
  });
268
268
  return {
269
269
  origin: fallbackOriginGroup,
@@ -160,7 +160,7 @@ export declare class Topic extends Construct implements SSTConstruct {
160
160
  * Add subscribers to the topic.
161
161
  *
162
162
  * @example
163
- * ```js {5}
163
+ * ```js
164
164
  * const topic = new Topic(stack, "Topic", {
165
165
  * subscribers: {
166
166
  * subscriber1: "src/function1.handler",
@@ -194,7 +194,7 @@ export declare class Topic extends Construct implements SSTConstruct {
194
194
  /**
195
195
  * Binds the given list of resources to a specific subscriber.
196
196
  * @example
197
- * ```js {5}
197
+ * ```js {8}
198
198
  * const topic = new Topic(stack, "Topic", {
199
199
  * subscribers: {
200
200
  * subscriber1: "src/function1.handler",
@@ -225,7 +225,7 @@ export declare class Topic extends Construct implements SSTConstruct {
225
225
  /**
226
226
  * Attaches the list of permissions to a specific subscriber.
227
227
  * @example
228
- * ```js {5}
228
+ * ```js {8}
229
229
  * const topic = new Topic(stack, "Topic", {
230
230
  * subscribers: {
231
231
  * subscriber1: "src/function1.handler",
@@ -80,7 +80,7 @@ export class Topic extends Construct {
80
80
  * Add subscribers to the topic.
81
81
  *
82
82
  * @example
83
- * ```js {5}
83
+ * ```js
84
84
  * const topic = new Topic(stack, "Topic", {
85
85
  * subscribers: {
86
86
  * subscriber1: "src/function1.handler",
@@ -121,7 +121,7 @@ export class Topic extends Construct {
121
121
  /**
122
122
  * Binds the given list of resources to a specific subscriber.
123
123
  * @example
124
- * ```js {5}
124
+ * ```js {8}
125
125
  * const topic = new Topic(stack, "Topic", {
126
126
  * subscribers: {
127
127
  * subscriber1: "src/function1.handler",
@@ -163,7 +163,7 @@ export class Topic extends Construct {
163
163
  /**
164
164
  * Attaches the list of permissions to a specific subscriber.
165
165
  * @example
166
- * ```js {5}
166
+ * ```js {8}
167
167
  * const topic = new Topic(stack, "Topic", {
168
168
  * subscribers: {
169
169
  * subscriber1: "src/function1.handler",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sst",
3
- "version": "2.5.0",
3
+ "version": "2.5.2",
4
4
  "bin": {
5
5
  "sst": "cli/sst.js"
6
6
  },
@@ -91,7 +91,12 @@ if __name__ == '__main__':
91
91
  # would fail with error ModuleNotFoundError
92
92
  sys.path.append(args.src_path)
93
93
 
94
- module = import_module(args.handler_module)
94
+ # remove leading zeros for relative imports
95
+ if args.handler_module.startswith('.'):
96
+ module = import_module(args.handler_module[1:])
97
+ else:
98
+ module = import_module(args.handler_module)
99
+
95
100
  handler = getattr(module, args.handler_name)
96
101
  result = handler(event, context)
97
102
  data = json.dumps(result, default=handleUnserializable).encode("utf-8")