sst 2.18.1 → 2.18.3

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.
@@ -291,6 +291,7 @@ export const dev = (program) => program.command(["dev", "start"], "Work on your
291
291
  }
292
292
  clear();
293
293
  await printHeader({ console: true, hint: "ready!" });
294
+ await useStackBuilder();
294
295
  await Promise.all([
295
296
  useDisconnector(),
296
297
  useRuntimeWorkers(),
@@ -301,6 +302,5 @@ export const dev = (program) => program.command(["dev", "start"], "Work on your
301
302
  useKyselyTypeGenerator(),
302
303
  useRDSWarmer(),
303
304
  useFunctionLogger(),
304
- useStackBuilder(),
305
305
  ]);
306
306
  });
@@ -160,6 +160,7 @@ export declare class App extends CDKApp {
160
160
  private removeGovCloudUnsupportedResourceProperties;
161
161
  private ensureUniqueConstructIds;
162
162
  private codegenTypes;
163
+ private foreachConstruct;
163
164
  stack<T extends FunctionalStack<any>>(fn: T, props?: StackProps & {
164
165
  id?: string;
165
166
  }): ReturnType<T> extends Promise<any> ? Promise<void> : App;
package/constructs/App.js CHANGED
@@ -427,43 +427,53 @@ export class App extends CDKApp {
427
427
  ` }`,
428
428
  `}`,
429
429
  ].join("\n"));
430
- class CodegenTypes {
431
- visit(c) {
432
- if (!isSSTConstruct(c)) {
433
- return;
434
- }
435
- if (c instanceof Function && c._doNotAllowOthersToBind) {
436
- return;
437
- }
438
- const binding = bindType(c);
439
- if (!binding) {
440
- return;
441
- }
442
- const className = c.constructor.name;
443
- const id = c.id;
444
- // Case 1: variable does not have properties, ie. Secrets and Parameters
445
- fs.appendFileSync(`${typesPath}/index.ts`, (binding.variables[0] === "."
446
- ? [
447
- `import "sst/node/${binding.clientPackage}";`,
448
- `declare module "sst/node/${binding.clientPackage}" {`,
449
- ` export interface ${className}Resources {`,
450
- ` "${id}": string;`,
451
- ` }`,
452
- `}`,
453
- ]
454
- : [
455
- `import "sst/node/${binding.clientPackage}";`,
456
- `declare module "sst/node/${binding.clientPackage}" {`,
457
- ` export interface ${className}Resources {`,
458
- ` "${id}": {`,
459
- ...binding.variables.map((p) => ` ${p}: string;`),
460
- ` }`,
461
- ` }`,
462
- `}`,
463
- ]).join("\n"));
430
+ this.foreachConstruct((c) => {
431
+ if (!isSSTConstruct(c)) {
432
+ return;
433
+ }
434
+ if (c instanceof Function && c._doNotAllowOthersToBind) {
435
+ return;
436
+ }
437
+ const binding = bindType(c);
438
+ if (!binding) {
439
+ return;
440
+ }
441
+ const className = c.constructor.name;
442
+ const id = c.id;
443
+ // Case 1: variable does not have properties, ie. Secrets and Parameters
444
+ fs.appendFileSync(`${typesPath}/index.ts`, (binding.variables[0] === "."
445
+ ? [
446
+ `import "sst/node/${binding.clientPackage}";`,
447
+ `declare module "sst/node/${binding.clientPackage}" {`,
448
+ ` export interface ${className}Resources {`,
449
+ ` "${id}": string;`,
450
+ ` }`,
451
+ `}`,
452
+ ]
453
+ : [
454
+ `import "sst/node/${binding.clientPackage}";`,
455
+ `declare module "sst/node/${binding.clientPackage}" {`,
456
+ ` export interface ${className}Resources {`,
457
+ ` "${id}": {`,
458
+ ...binding.variables.map((p) => ` ${p}: string;`),
459
+ ` }`,
460
+ ` }`,
461
+ `}`,
462
+ ]).join("\n"));
463
+ });
464
+ }
465
+ foreachConstruct(fn) {
466
+ const loop = (parent) => {
467
+ for (const child of parent.node.children) {
468
+ fn(child);
469
+ loop(child);
470
+ }
471
+ };
472
+ for (const child of this.node.children) {
473
+ if (child instanceof Stack) {
474
+ loop(child);
464
475
  }
465
476
  }
466
- Aspects.of(this).add(new CodegenTypes());
467
477
  }
468
478
  // Functional Stack
469
479
  // This is a magical global to avoid having to pass app everywhere.
@@ -13,7 +13,7 @@ export interface RDSProps {
13
13
  /**
14
14
  * Database engine of the cluster. Cannot be changed once set.
15
15
  */
16
- engine: "mysql5.6" | "mysql5.7" | "postgresql10.14" | "postgresql11.13" | "postgresql11.16" | "postgresql13.9";
16
+ engine: "mysql5.6" | "mysql5.7" | "postgresql11.13" | "postgresql11.16" | "postgresql13.9";
17
17
  /**
18
18
  * Name of a database which is automatically created inside the cluster.
19
19
  */
@@ -191,7 +191,7 @@ export declare class RDS extends Construct implements SSTConstruct {
191
191
  getConstructMetadata(): {
192
192
  type: "RDS";
193
193
  data: {
194
- engine: "mysql5.6" | "mysql5.7" | "postgresql10.14" | "postgresql11.13" | "postgresql11.16" | "postgresql13.9";
194
+ engine: "mysql5.6" | "mysql5.7" | "postgresql11.13" | "postgresql11.16" | "postgresql13.9";
195
195
  secretArn: string;
196
196
  types: RDSTypes | undefined;
197
197
  clusterArn: string;
package/constructs/RDS.js CHANGED
@@ -202,11 +202,6 @@ export class RDS extends Construct {
202
202
  version: AuroraMysqlEngineVersion.VER_2_07_1,
203
203
  });
204
204
  }
205
- else if (engine === "postgresql10.14") {
206
- return DatabaseClusterEngine.auroraPostgres({
207
- version: AuroraPostgresEngineVersion.VER_10_14,
208
- });
209
- }
210
205
  else if (engine === "postgresql11.13") {
211
206
  return DatabaseClusterEngine.auroraPostgres({
212
207
  version: AuroraPostgresEngineVersion.VER_11_13,
@@ -637,7 +637,7 @@ function handler(event) {
637
637
  for (const item of fs.readdirSync(publicDir)) {
638
638
  const isDir = fs.statSync(path.join(publicDir, item)).isDirectory();
639
639
  this.distribution.addBehavior(isDir ? `${item}/*` : item, new S3Origin(this.bucket, {
640
- originPath: "/" + this.buildConfig.clientBuildS3KeyPrefix,
640
+ originPath: "/" + (this.buildConfig.clientBuildS3KeyPrefix ?? ""),
641
641
  }), {
642
642
  viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
643
643
  allowedMethods: AllowedMethods.ALLOW_GET_HEAD_OPTIONS,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "name": "sst",
4
- "version": "2.18.1",
4
+ "version": "2.18.3",
5
5
  "bin": {
6
6
  "sst": "cli/sst.js"
7
7
  },
package/sst.mjs CHANGED
@@ -7339,6 +7339,7 @@ Are you sure you want to run this stage in dev mode? [y/N] `,
7339
7339
  }
7340
7340
  clear2();
7341
7341
  await printHeader2({ console: true, hint: "ready!" });
7342
+ await useStackBuilder();
7342
7343
  await Promise.all([
7343
7344
  useDisconnector(),
7344
7345
  useRuntimeWorkers2(),
@@ -7348,8 +7349,7 @@ Are you sure you want to run this stage in dev mode? [y/N] `,
7348
7349
  useMetadata2(),
7349
7350
  useKyselyTypeGenerator2(),
7350
7351
  useRDSWarmer2(),
7351
- useFunctionLogger(),
7352
- useStackBuilder()
7352
+ useFunctionLogger()
7353
7353
  ]);
7354
7354
  }
7355
7355
  );