sst 2.1.25 → 2.1.27

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.
@@ -5,18 +5,15 @@ import * as fs from "fs/promises";
5
5
  import { DatabaseMetadata, EnumCollection, PostgresDialect, MysqlDialect, Serializer, Transformer, } from "kysely-codegen";
6
6
  import { Context } from "../../../context/context.js";
7
7
  import { useBus } from "../../../bus.js";
8
- import { useProject } from "../../../project.js";
9
8
  import { Logger } from "../../../logger.js";
10
- import { useAWSClient, useAWSCredentials, } from "../../../credentials.js";
9
+ import { useAWSClient, } from "../../../credentials.js";
11
10
  export const useKyselyTypeGenerator = Context.memo(async () => {
12
11
  let databases = [];
13
12
  const bus = useBus();
14
- const project = useProject();
15
13
  async function generate(db) {
16
14
  if (!db.types)
17
15
  return;
18
16
  Logger.debug("Generating types for", db.migratorID);
19
- const credentials = await useAWSCredentials();
20
17
  const k = new Kysely({
21
18
  dialect: new DataApiDialect({
22
19
  mode: db.engine.includes("postgres") ? "postgres" : "mysql",
@@ -93,7 +90,7 @@ export const useKyselyTypeGenerator = Context.memo(async () => {
93
90
  const db = databases.find((db) => db.migratorID === evt.properties.functionID);
94
91
  if (!db)
95
92
  return;
96
- generate(db);
93
+ generate(db).catch(() => { });
97
94
  });
98
95
  Logger.debug("Loaded kyseley type generator");
99
96
  });
@@ -171,6 +171,7 @@ export declare class App extends cdk.App {
171
171
  * Adds additional default layers to be applied to all Lambda functions in the stack.
172
172
  */
173
173
  addDefaultFunctionLayers(layers: lambda.ILayerVersion[]): void;
174
+ private isFinished;
174
175
  finish(): Promise<void>;
175
176
  isRunningSSTTest(): boolean;
176
177
  getInputFilesFromEsbuildMetafile(file: string): Array<string>;
package/constructs/App.js CHANGED
@@ -202,7 +202,11 @@ export class App extends cdk.App {
202
202
  layers,
203
203
  });
204
204
  }
205
+ isFinished = false;
205
206
  async finish() {
207
+ if (this.isFinished)
208
+ return;
209
+ this.isFinished = true;
206
210
  await useDeferredTasks().run();
207
211
  Auth.injectConfig();
208
212
  this.buildConstructsMetadata();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sst",
3
- "version": "2.1.25",
3
+ "version": "2.1.27",
4
4
  "bin": {
5
5
  "sst": "cli/sst.js"
6
6
  },
package/sst.mjs CHANGED
@@ -6329,18 +6329,15 @@ var init_kysely = __esm({
6329
6329
  "use strict";
6330
6330
  init_context();
6331
6331
  init_bus();
6332
- init_project();
6333
6332
  init_logger();
6334
6333
  init_credentials();
6335
6334
  useKyselyTypeGenerator = Context.memo(async () => {
6336
6335
  let databases = [];
6337
6336
  const bus = useBus();
6338
- const project = useProject();
6339
6337
  async function generate2(db) {
6340
6338
  if (!db.types)
6341
6339
  return;
6342
6340
  Logger.debug("Generating types for", db.migratorID);
6343
- const credentials = await useAWSCredentials();
6344
6341
  const k = new Kysely({
6345
6342
  dialect: new DataApiDialect({
6346
6343
  mode: db.engine.includes("postgres") ? "postgres" : "mysql",
@@ -6413,7 +6410,8 @@ var init_kysely = __esm({
6413
6410
  );
6414
6411
  if (!db)
6415
6412
  return;
6416
- generate2(db);
6413
+ generate2(db).catch(() => {
6414
+ });
6417
6415
  });
6418
6416
  Logger.debug("Loaded kyseley type generator");
6419
6417
  });
@@ -6758,7 +6756,7 @@ var env = (program2) => program2.command(
6758
6756
  const fs19 = await import("fs/promises");
6759
6757
  const { SiteEnv } = await Promise.resolve().then(() => (init_site_env(), site_env_exports));
6760
6758
  const { spawnSync } = await import("child_process");
6761
- const { useAWSCredentials: useAWSCredentials2 } = await Promise.resolve().then(() => (init_credentials(), credentials_exports));
6759
+ const { useAWSCredentials: useAWSCredentials3 } = await Promise.resolve().then(() => (init_credentials(), credentials_exports));
6762
6760
  const { useProject: useProject2 } = await Promise.resolve().then(() => (init_project(), project_exports));
6763
6761
  let spinner;
6764
6762
  while (true) {
@@ -6774,7 +6772,7 @@ var env = (program2) => program2.command(
6774
6772
  const sites = await SiteEnv.values();
6775
6773
  const env2 = sites[process.cwd()] || {};
6776
6774
  const project = useProject2();
6777
- const credentials = await useAWSCredentials2();
6775
+ const credentials = await useAWSCredentials3();
6778
6776
  const joined = args.command?.join(" ");
6779
6777
  if (!joined)
6780
6778
  throw new VisibleError(
@@ -7139,11 +7137,11 @@ var bind = (program2) => program2.command(
7139
7137
  async (args) => {
7140
7138
  const { Config: Config2 } = await Promise.resolve().then(() => (init_config(), config_exports));
7141
7139
  const { spawnSync } = await import("child_process");
7142
- const { useAWSCredentials: useAWSCredentials2 } = await Promise.resolve().then(() => (init_credentials(), credentials_exports));
7140
+ const { useAWSCredentials: useAWSCredentials3 } = await Promise.resolve().then(() => (init_credentials(), credentials_exports));
7143
7141
  const { useProject: useProject2 } = await Promise.resolve().then(() => (init_project(), project_exports));
7144
7142
  const env2 = await Config2.env();
7145
7143
  const project = useProject2();
7146
- const credentials = await useAWSCredentials2();
7144
+ const credentials = await useAWSCredentials3();
7147
7145
  const joined = args.command?.join(" ");
7148
7146
  if (!joined)
7149
7147
  throw new VisibleError("Command is required, e.g. sst bind env");