sst 2.19.0 → 2.19.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.
@@ -19,7 +19,8 @@ export type CronMetadata = ExtractMetadata<Cron>;
19
19
  import type { EventBus } from "./EventBus.js";
20
20
  export type EventBusMetadata = ExtractMetadata<EventBus>;
21
21
  import type { Function as Fn } from "./Function.js";
22
- export type FunctionMetadata = ExtractMetadata<Fn>;
22
+ import type { SsrFunction } from "./SsrFunction.js";
23
+ export type FunctionMetadata = ExtractMetadata<Fn> | ExtractMetadata<SsrFunction>;
23
24
  import type { KinesisStream } from "./KinesisStream.js";
24
25
  export type KinesisStreamMetadata = ExtractMetadata<KinesisStream>;
25
26
  import type { NextjsSite as SlsNextjsSite } from "./deprecated/NextjsSite.js";
@@ -20,7 +20,8 @@ export interface SsrFunctionProps extends Omit<FunctionOptions, "memorySize" | "
20
20
  copyFiles?: FunctionCopyFilesProps[];
21
21
  logRetention?: RetentionDays;
22
22
  }
23
- export declare class SsrFunction extends Construct {
23
+ export declare class SsrFunction extends Construct implements SSTConstruct {
24
+ readonly id: string;
24
25
  function: CdkFunction;
25
26
  private assetReplacer;
26
27
  private assetReplacerPolicy;
@@ -41,4 +42,16 @@ export declare class SsrFunction extends Construct {
41
42
  private buildAssetFromBundle;
42
43
  private updateCodeReplacer;
43
44
  private updateFunction;
45
+ /** @internal */
46
+ getConstructMetadata(): {
47
+ type: "Function";
48
+ data: {
49
+ arn: string;
50
+ handler: string;
51
+ localId: string;
52
+ secrets: string[];
53
+ };
54
+ };
55
+ /** @internal */
56
+ getFunctionBinding(): undefined;
44
57
  }
@@ -20,12 +20,14 @@ const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
20
20
  // Construct
21
21
  /////////////////////
22
22
  export class SsrFunction extends Construct {
23
+ id;
23
24
  function;
24
25
  assetReplacer;
25
26
  assetReplacerPolicy;
26
27
  props;
27
28
  constructor(scope, id, props) {
28
29
  super(scope, id);
30
+ this.id = id;
29
31
  this.props = {
30
32
  ...props,
31
33
  environment: props.environment || {},
@@ -202,4 +204,20 @@ export class SsrFunction extends Construct {
202
204
  };
203
205
  code.bindToResource(cfnFunction);
204
206
  }
207
+ /** @internal */
208
+ getConstructMetadata() {
209
+ return {
210
+ type: "Function",
211
+ data: {
212
+ arn: this.functionArn,
213
+ handler: this.props.handler,
214
+ localId: this.node.addr,
215
+ secrets: [],
216
+ },
217
+ };
218
+ }
219
+ /** @internal */
220
+ getFunctionBinding() {
221
+ return undefined;
222
+ }
205
223
  }
@@ -877,9 +877,7 @@ function handler(event) {
877
877
  generateBuildId() {
878
878
  // We will generate a hash based on the contents of the "public" folder
879
879
  // which will be used to indicate if we need to invalidate our CloudFront
880
- // cache. As the browser build files are always uniquely hash in their
881
- // filenames according to their content we can ignore the browser build
882
- // files.
880
+ // cache.
883
881
  // The below options are needed to support following symlinks when building zip files:
884
882
  // - nodir: This will prevent symlinks themselves from being copied into the zip.
885
883
  // - follow: This will follow symlinks and copy the files within.
@@ -887,7 +885,6 @@ function handler(event) {
887
885
  dot: true,
888
886
  nodir: true,
889
887
  follow: true,
890
- ignore: [`${this.buildConfig.clientBuildVersionedSubDir}/**`],
891
888
  cwd: path.resolve(this.props.path, this.buildConfig.clientBuildOutputDir),
892
889
  };
893
890
  const files = glob.sync("**", globOptions);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "name": "sst",
4
- "version": "2.19.0",
4
+ "version": "2.19.2",
5
5
  "bin": {
6
6
  "sst": "cli/sst.js"
7
7
  },
package/project.d.ts CHANGED
@@ -29,6 +29,7 @@ export interface ConfigOptions {
29
29
  imageAssetPublishingRoleArn?: string;
30
30
  cloudFormationExecutionRole?: string;
31
31
  lookupRoleArn?: string;
32
+ pathMetadata?: boolean;
32
33
  };
33
34
  }
34
35
  declare const DEFAULTS: {
package/sst.mjs CHANGED
@@ -6018,6 +6018,7 @@ async function synth(opts) {
6018
6018
  useJavaHandler2();
6019
6019
  useDotnetHandler();
6020
6020
  useRustHandler2();
6021
+ const cxapi5 = await import("@aws-cdk/cx-api");
6021
6022
  const { Configuration } = await import("sst-aws-cdk/lib/settings.js");
6022
6023
  const project = useProject();
6023
6024
  const identity = await useSTSIdentity();
@@ -6028,6 +6029,8 @@ async function synth(opts) {
6028
6029
  const cfg = new Configuration();
6029
6030
  await cfg.load();
6030
6031
  let previous2 = /* @__PURE__ */ new Set();
6032
+ const context = cfg.context.all;
6033
+ context[cxapi5.PATH_METADATA_ENABLE_CONTEXT] = project.config.cdk?.pathMetadata ?? false;
6031
6034
  while (true) {
6032
6035
  const app = new App2(
6033
6036
  {
@@ -6042,7 +6045,7 @@ async function synth(opts) {
6042
6045
  },
6043
6046
  {
6044
6047
  outdir: opts.buildDir,
6045
- context: cfg.context.all
6048
+ context
6046
6049
  }
6047
6050
  );
6048
6051
  await opts.fn(app);
package/stacks/synth.js CHANGED
@@ -21,6 +21,7 @@ export async function synth(opts) {
21
21
  useJavaHandler();
22
22
  useDotnetHandler();
23
23
  useRustHandler();
24
+ const cxapi = await import("@aws-cdk/cx-api");
24
25
  const { Configuration } = await import("sst-aws-cdk/lib/settings.js");
25
26
  const project = useProject();
26
27
  const identity = await useSTSIdentity();
@@ -40,6 +41,9 @@ export async function synth(opts) {
40
41
  const cfg = new Configuration();
41
42
  await cfg.load();
42
43
  let previous = new Set();
44
+ const context = cfg.context.all;
45
+ context[cxapi.PATH_METADATA_ENABLE_CONTEXT] =
46
+ project.config.cdk?.pathMetadata ?? false;
43
47
  while (true) {
44
48
  const app = new App({
45
49
  account: identity.Account,
@@ -52,7 +56,7 @@ export async function synth(opts) {
52
56
  isActiveStack: opts.isActiveStack,
53
57
  }, {
54
58
  outdir: opts.buildDir,
55
- context: cfg.context.all,
59
+ context,
56
60
  });
57
61
  await opts.fn(app);
58
62
  await app.finish();