sst 2.43.6 → 2.43.8

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
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { blue, red } from "colorette";
2
+ import { red } from "colorette";
3
3
  import { program } from "./program.js";
4
4
  import { SilentError, VisibleError } from "../error.js";
5
5
  import { useSpinners } from "./spinner.js";
@@ -57,8 +57,6 @@ process.on("uncaughtException", (err) => {
57
57
  console.log();
58
58
  console.trace(err.stack);
59
59
  }
60
- console.log();
61
- console.log(`Need help with this error? Post it in #help on the SST Discord ${blue(`https://sst.dev/discord`)}`);
62
60
  }
63
61
  process.exit(1);
64
62
  });
package/constructs/App.js CHANGED
@@ -267,11 +267,18 @@ export class App extends CDKApp {
267
267
  const functions = useFunctions();
268
268
  const sourcemaps = functions.sourcemaps.forStack(child.stackName);
269
269
  if (sourcemaps.length) {
270
+ // Add policy with access to buckets: CKD bootstrap and SST sourcemap
271
+ // If the object in CDK bootstrap has tags, target object will have the same tags
270
272
  const policy = new Policy(child, "SourcemapUploaderPolicy", {
271
273
  statements: [
272
274
  new PolicyStatement({
273
275
  effect: Effect.ALLOW,
274
- actions: ["s3:GetObject", "s3:PutObject"],
276
+ actions: [
277
+ "s3:GetObject",
278
+ "s3:GetObjectTagging",
279
+ "s3:PutObject",
280
+ "s3:PutObjectTagging",
281
+ ],
275
282
  resources: [
276
283
  sourcemaps[0].asset.bucket.bucketArn + "/*",
277
284
  `arn:${child.partition}:s3:::${bootstrap.bucket}/*`,
@@ -276,7 +276,7 @@ export class SsrFunction extends Construct {
276
276
  `export const ${newHandlerFunction} = awslambda.streamifyResponse(async (event, responseStream, context) => {`,
277
277
  ...injections,
278
278
  ` const { ${oldHandlerFunction}: rawHandler} = await import("./${oldHandlerName}.mjs");`,
279
- ` return rawHandler(event, responseStream);`,
279
+ ` return rawHandler(event, responseStream, context);`,
280
280
  `});`,
281
281
  ].join("\n")
282
282
  : [
@@ -6,6 +6,16 @@ export interface SvelteKitSiteProps extends SsrSiteProps {
6
6
  * @default false
7
7
  */
8
8
  edge?: boolean;
9
+ /**
10
+ * Configures the base path for the SvelteKit app.
11
+ * Base path allows the app to live on a non-root path. The base path must start, but not end with /.
12
+ * @default No base path
13
+ * @example
14
+ * ```js
15
+ * basePath: '/docs'
16
+ * ```
17
+ */
18
+ basePath?: `/${string}`;
9
19
  }
10
20
  type SvelteKitSiteNormalizedProps = SvelteKitSiteProps & SsrSiteNormalizedProps;
11
21
  /**
@@ -20,7 +20,8 @@ export class SvelteKitSite extends SsrSite {
20
20
  });
21
21
  }
22
22
  plan() {
23
- const { path: sitePath, edge } = this.props;
23
+ const { path: sitePath, edge, basePath: rawBasePath } = this.props;
24
+ const basePath = rawBasePath ? `/${rawBasePath}` : "";
24
25
  const serverDir = ".svelte-kit/svelte-kit-sst/server";
25
26
  const clientDir = ".svelte-kit/svelte-kit-sst/client";
26
27
  const prerenderedDir = ".svelte-kit/svelte-kit-sst/prerendered";
@@ -91,13 +92,13 @@ export class SvelteKitSite extends SsrSite {
91
92
  copy: [
92
93
  {
93
94
  from: clientDir,
94
- to: "",
95
+ to: basePath,
95
96
  cached: true,
96
97
  versionedSubDir: "_app",
97
98
  },
98
99
  {
99
100
  from: prerenderedDir,
100
- to: "",
101
+ to: basePath,
101
102
  cached: false,
102
103
  },
103
104
  ],
@@ -122,8 +123,8 @@ export class SvelteKitSite extends SsrSite {
122
123
  pattern: fs
123
124
  .statSync(path.join(sitePath, clientDir, item))
124
125
  .isDirectory()
125
- ? `${item}/*`
126
- : item,
126
+ ? `${basePath}${item}/*`
127
+ : `${basePath}${item}`,
127
128
  origin: "s3",
128
129
  })),
129
130
  ],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "name": "sst",
4
- "version": "2.43.6",
4
+ "version": "2.43.8",
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.43.6",
121
+ "astro-sst": "2.43.8",
122
122
  "async": "^3.2.4",
123
123
  "tsx": "^3.12.1",
124
124
  "typescript": "^5.2.2",
@@ -209,7 +209,7 @@ export const useNodeHandler = () => {
209
209
  const cmd = [
210
210
  "npm install",
211
211
  "--omit=dev",
212
- "--no-optional",
212
+ "--omit=optional",
213
213
  "--force",
214
214
  "--platform=linux",
215
215
  input.props.architecture === "arm_64"