sst 2.16.1 → 2.16.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.
- package/cli/commands/diff.d.ts +2 -0
- package/cli/commands/diff.js +7 -1
- package/constructs/StaticSite.d.ts +1 -0
- package/constructs/StaticSite.js +11 -6
- package/package.json +1 -1
- package/runtime/handlers/python.js +1 -0
- package/runtime/handlers/pythonBundling.d.ts +5 -0
- package/runtime/handlers/pythonBundling.js +4 -2
- package/sst.mjs +7 -2
package/cli/commands/diff.d.ts
CHANGED
package/cli/commands/diff.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { stackNameToId } from "../ui/stack.js";
|
|
2
|
-
export const diff = (program) => program.command("diff", "Compare your app with what is deployed on AWS", (yargs) => yargs
|
|
2
|
+
export const diff = (program) => program.command("diff", "Compare your app with what is deployed on AWS", (yargs) => yargs
|
|
3
|
+
.option("dev", {
|
|
3
4
|
type: "boolean",
|
|
4
5
|
describe: "Compare in dev mode",
|
|
6
|
+
})
|
|
7
|
+
.option("to", {
|
|
8
|
+
type: "string",
|
|
9
|
+
describe: "Output directory, defaults to .sst/dist",
|
|
5
10
|
}), async (args) => {
|
|
6
11
|
const { useProject } = await import("../../project.js");
|
|
7
12
|
const { Stacks } = await import("../../stacks/index.js");
|
|
@@ -14,6 +19,7 @@ export const diff = (program) => program.command("diff", "Compare your app with
|
|
|
14
19
|
const [_metafile, sstConfig] = await Stacks.load(project.paths.config);
|
|
15
20
|
const assembly = await Stacks.synth({
|
|
16
21
|
fn: sstConfig.stacks,
|
|
22
|
+
buildDir: args.to,
|
|
17
23
|
mode: args.dev ? "dev" : "deploy",
|
|
18
24
|
});
|
|
19
25
|
// Diff each stack
|
package/constructs/StaticSite.js
CHANGED
|
@@ -358,18 +358,19 @@ interface ImportMeta {
|
|
|
358
358
|
BucketName: filenamesAsset.s3BucketName,
|
|
359
359
|
ObjectKey: filenamesAsset.s3ObjectKey,
|
|
360
360
|
},
|
|
361
|
-
FileOptions: (fileOptions || []).map(({ exclude, include, cacheControl }) => {
|
|
361
|
+
FileOptions: (fileOptions || []).map(({ exclude, include, cacheControl, contentType }) => {
|
|
362
362
|
if (typeof exclude === "string") {
|
|
363
363
|
exclude = [exclude];
|
|
364
364
|
}
|
|
365
365
|
if (typeof include === "string") {
|
|
366
366
|
include = [include];
|
|
367
367
|
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
368
|
+
return [
|
|
369
|
+
...exclude.map((per) => ["--exclude", per]),
|
|
370
|
+
...include.map((per) => ["--include", per]),
|
|
371
|
+
["--cache-control", cacheControl],
|
|
372
|
+
contentType ? ["--content-type", contentType] : [],
|
|
373
|
+
].flat();
|
|
373
374
|
}),
|
|
374
375
|
ReplaceValues: this.getS3ContentReplaceValues(),
|
|
375
376
|
},
|
|
@@ -482,6 +483,10 @@ function handler(event) {
|
|
|
482
483
|
var request = event.request;
|
|
483
484
|
var uri = request.uri;
|
|
484
485
|
|
|
486
|
+
if (uri.startsWith("/.well-known/")) {
|
|
487
|
+
return request;
|
|
488
|
+
}
|
|
489
|
+
|
|
485
490
|
if (uri.endsWith("/")) {
|
|
486
491
|
request.uri += "index.html";
|
|
487
492
|
} else if (!uri.split("/").pop().includes(".")) {
|
package/package.json
CHANGED
|
@@ -95,6 +95,7 @@ export const usePythonHandler = Context.memo(async () => {
|
|
|
95
95
|
installCommands: input.props.python?.installCommands,
|
|
96
96
|
entry: src,
|
|
97
97
|
runtime: RUNTIME_MAP[input.props.runtime],
|
|
98
|
+
architecture: input.props.architecture,
|
|
98
99
|
outputPathSuffix: ".",
|
|
99
100
|
out: input.out,
|
|
100
101
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Runtime } from "aws-cdk-lib/aws-lambda";
|
|
2
|
+
import { FunctionProps } from "../../constructs/Function.js";
|
|
2
3
|
import { AssetHashType } from "aws-cdk-lib/core";
|
|
3
4
|
/**
|
|
4
5
|
* Dependency files to exclude from the asset hash.
|
|
@@ -20,6 +21,10 @@ export interface BundlingOptions {
|
|
|
20
21
|
* The runtime of the lambda function
|
|
21
22
|
*/
|
|
22
23
|
readonly runtime: Runtime;
|
|
24
|
+
/**
|
|
25
|
+
* Architecture used by the lambda function
|
|
26
|
+
*/
|
|
27
|
+
readonly architecture: FunctionProps["architecture"];
|
|
23
28
|
/**
|
|
24
29
|
* Output path suffix ('python' for a layer, '.' otherwise)
|
|
25
30
|
*/
|
|
@@ -18,7 +18,7 @@ export const BUNDLER_DEPENDENCIES_CACHE = "/var/dependencies";
|
|
|
18
18
|
* Produce bundled Lambda asset code
|
|
19
19
|
*/
|
|
20
20
|
export function bundle(options) {
|
|
21
|
-
const { entry, runtime, outputPathSuffix, installCommands } = options;
|
|
21
|
+
const { entry, runtime, architecture, outputPathSuffix, installCommands } = options;
|
|
22
22
|
const stagedir = FileSystem.mkdtemp("python-bundling-");
|
|
23
23
|
const hasDeps = stageDependencies(entry, stagedir);
|
|
24
24
|
const hasInstallCommands = stageInstallCommands(installCommands || [], stagedir);
|
|
@@ -35,7 +35,9 @@ export function bundle(options) {
|
|
|
35
35
|
fs.copyFileSync(path.join(__dirname, "../../support/python-runtime", dockerfile), path.join(stagedir, dockerfile));
|
|
36
36
|
const image = DockerImage.fromBuild(stagedir, {
|
|
37
37
|
buildArgs: {
|
|
38
|
-
IMAGE: runtime.bundlingImage.image
|
|
38
|
+
IMAGE: runtime.bundlingImage.image +
|
|
39
|
+
// the default x86_64 doesn't need to be set explicitly
|
|
40
|
+
(architecture == "arm_64" ? ":latest-arm64" : ""),
|
|
39
41
|
},
|
|
40
42
|
file: dockerfile,
|
|
41
43
|
});
|
package/sst.mjs
CHANGED
|
@@ -4815,7 +4815,7 @@ import url5 from "url";
|
|
|
4815
4815
|
import path11 from "path";
|
|
4816
4816
|
import { DockerImage, FileSystem } from "aws-cdk-lib/core";
|
|
4817
4817
|
function bundle(options) {
|
|
4818
|
-
const { entry, runtime, outputPathSuffix, installCommands } = options;
|
|
4818
|
+
const { entry, runtime, architecture, outputPathSuffix, installCommands } = options;
|
|
4819
4819
|
const stagedir = FileSystem.mkdtemp("python-bundling-");
|
|
4820
4820
|
const hasDeps = stageDependencies(entry, stagedir);
|
|
4821
4821
|
const hasInstallCommands = stageInstallCommands(
|
|
@@ -4829,7 +4829,7 @@ function bundle(options) {
|
|
|
4829
4829
|
);
|
|
4830
4830
|
const image = DockerImage.fromBuild(stagedir, {
|
|
4831
4831
|
buildArgs: {
|
|
4832
|
-
IMAGE: runtime.bundlingImage.image
|
|
4832
|
+
IMAGE: runtime.bundlingImage.image + (architecture == "arm_64" ? ":latest-arm64" : "")
|
|
4833
4833
|
},
|
|
4834
4834
|
file: dockerfile
|
|
4835
4835
|
});
|
|
@@ -4985,6 +4985,7 @@ var init_python = __esm({
|
|
|
4985
4985
|
installCommands: input.props.python?.installCommands,
|
|
4986
4986
|
entry: src,
|
|
4987
4987
|
runtime: RUNTIME_MAP[input.props.runtime],
|
|
4988
|
+
architecture: input.props.architecture,
|
|
4988
4989
|
outputPathSuffix: ".",
|
|
4989
4990
|
out: input.out
|
|
4990
4991
|
});
|
|
@@ -8297,6 +8298,9 @@ var diff2 = (program2) => program2.command(
|
|
|
8297
8298
|
(yargs2) => yargs2.option("dev", {
|
|
8298
8299
|
type: "boolean",
|
|
8299
8300
|
describe: "Compare in dev mode"
|
|
8301
|
+
}).option("to", {
|
|
8302
|
+
type: "string",
|
|
8303
|
+
describe: "Output directory, defaults to .sst/dist"
|
|
8300
8304
|
}),
|
|
8301
8305
|
async (args) => {
|
|
8302
8306
|
const { useProject: useProject2 } = await Promise.resolve().then(() => (init_project(), project_exports));
|
|
@@ -8309,6 +8313,7 @@ var diff2 = (program2) => program2.command(
|
|
|
8309
8313
|
const [_metafile, sstConfig] = await Stacks.load(project.paths.config);
|
|
8310
8314
|
const assembly = await Stacks.synth({
|
|
8311
8315
|
fn: sstConfig.stacks,
|
|
8316
|
+
buildDir: args.to,
|
|
8312
8317
|
mode: args.dev ? "dev" : "deploy"
|
|
8313
8318
|
});
|
|
8314
8319
|
let changesAcc = 0;
|