sst 2.1.2 → 2.1.4

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.
@@ -1,13 +1,13 @@
1
1
  import { Kysely } from "kysely";
2
2
  import { DataApiDialect } from "kysely-data-api";
3
- import RDSDataService from "aws-sdk/clients/rdsdataservice.js";
3
+ import { RDSData } from "@aws-sdk/client-rds-data";
4
4
  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
8
  import { useProject } from "../../../project.js";
9
9
  import { Logger } from "../../../logger.js";
10
- import { useAWSCredentials, } from "../../../credentials.js";
10
+ import { useAWSClient, useAWSCredentials, } from "../../../credentials.js";
11
11
  export const useKyselyTypeGenerator = Context.memo(async () => {
12
12
  let databases = [];
13
13
  const bus = useBus();
@@ -24,10 +24,7 @@ export const useKyselyTypeGenerator = Context.memo(async () => {
24
24
  secretArn: db.secretArn,
25
25
  resourceArn: db.clusterArn,
26
26
  database: db.defaultDatabaseName,
27
- client: new RDSDataService({
28
- region: project.config.region,
29
- credentials,
30
- }),
27
+ client: useAWSClient(RDSData),
31
28
  },
32
29
  }),
33
30
  });
@@ -15,7 +15,7 @@ import * as apigV2Cors from "./util/apiGatewayV2Cors.js";
15
15
  import * as apigV2Domain from "./util/apiGatewayV2Domain.js";
16
16
  import * as apigV2AccessLog from "./util/apiGatewayV2AccessLog.js";
17
17
  declare const PayloadFormatVersions: readonly ["1.0", "2.0"];
18
- export type ApiPayloadFormatVersion = (typeof PayloadFormatVersions)[number];
18
+ export type ApiPayloadFormatVersion = typeof PayloadFormatVersions[number];
19
19
  export type ApiAuthorizer = ApiUserPoolAuthorizer | ApiJwtAuthorizer | ApiLambdaAuthorizer;
20
20
  interface ApiBaseAuthorizer {
21
21
  /**
@@ -23,4 +23,5 @@ export declare class RemixSite extends SsrSite {
23
23
  private createServerLambdaBundle;
24
24
  protected createFunctionForRegional(): lambda.Function;
25
25
  protected createFunctionForEdge(): EdgeFunction;
26
+ private normalizeRuntime;
26
27
  }
@@ -60,7 +60,7 @@ export class RemixSite extends SsrSite {
60
60
  clientBuildVersionedSubDir: "build",
61
61
  };
62
62
  }
63
- createServerLambdaBundle(wrapperFile) {
63
+ createServerLambdaBundle(wrapperFile, external) {
64
64
  // Create a Lambda@Edge handler for the Remix server bundle.
65
65
  //
66
66
  // Note: Remix does perform their own internal ESBuild process, but it
@@ -96,7 +96,7 @@ export class RemixSite extends SsrSite {
96
96
  bundle: true,
97
97
  target: "node16",
98
98
  platform: "node",
99
- external: ["aws-sdk"],
99
+ external,
100
100
  outfile: path.join(outputPath, "server.js"),
101
101
  // We need to ensure that the polyfills are injected above other code that
102
102
  // will depend on them. Importing them within the top of the lambda code
@@ -112,8 +112,9 @@ export class RemixSite extends SsrSite {
112
112
  return outputPath;
113
113
  }
114
114
  createFunctionForRegional() {
115
- const { runtime, timeout, memorySize, environment, cdk } = this.props;
116
- const bundlePath = this.createServerLambdaBundle("regional-server.js");
115
+ const { runtime: runtimeRaw, timeout, memorySize, environment, cdk, } = this.props;
116
+ const runtime = this.normalizeRuntime(runtimeRaw);
117
+ const bundlePath = this.createServerLambdaBundle("regional-server.js", runtime === "nodejs18.x" ? [] : ["aws-sdk"]);
117
118
  return new lambda.Function(this, `ServerFunction`, {
118
119
  description: "Server handler for Remix",
119
120
  handler: "server.handler",
@@ -138,8 +139,9 @@ export class RemixSite extends SsrSite {
138
139
  });
139
140
  }
140
141
  createFunctionForEdge() {
141
- const { runtime, timeout, memorySize, permissions, environment } = this.props;
142
- const bundlePath = this.createServerLambdaBundle("edge-server.js");
142
+ const { runtime: runtimeRaw, timeout, memorySize, permissions, environment, } = this.props;
143
+ const runtime = this.normalizeRuntime(runtimeRaw);
144
+ const bundlePath = this.createServerLambdaBundle("edge-server.js", runtime === "nodejs18.x" ? [] : ["aws-sdk"]);
143
145
  return new EdgeFunction(this, `Server`, {
144
146
  scopeOverride: this,
145
147
  format: "cjs",
@@ -152,4 +154,7 @@ export class RemixSite extends SsrSite {
152
154
  environment,
153
155
  });
154
156
  }
157
+ normalizeRuntime(runtime) {
158
+ return runtime || "nodejs18.x";
159
+ }
155
160
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sst",
3
- "version": "2.1.2",
3
+ "version": "2.1.4",
4
4
  "bin": {
5
5
  "sst": "cli/sst.js"
6
6
  },
@@ -76,9 +76,9 @@
76
76
  "immer": "9",
77
77
  "ink": "^3.2.0",
78
78
  "ink-spinner": "^4.0.3",
79
- "kysely": "^0.23.3",
79
+ "kysely": "^0.23.4",
80
80
  "kysely-codegen": "^0.9.0",
81
- "kysely-data-api": "^0.1.4",
81
+ "kysely-data-api": "^0.2.0",
82
82
  "minimatch": "^6.1.6",
83
83
  "openid-client": "^5.1.8",
84
84
  "ora": "^6.1.2",
package/sst.mjs CHANGED
@@ -6213,7 +6213,7 @@ __export(kysely_exports, {
6213
6213
  });
6214
6214
  import { Kysely } from "kysely";
6215
6215
  import { DataApiDialect } from "kysely-data-api";
6216
- import RDSDataService from "aws-sdk/clients/rdsdataservice.js";
6216
+ import { RDSData } from "@aws-sdk/client-rds-data";
6217
6217
  import * as fs17 from "fs/promises";
6218
6218
  import {
6219
6219
  DatabaseMetadata,
@@ -6248,10 +6248,7 @@ var init_kysely = __esm({
6248
6248
  secretArn: db.secretArn,
6249
6249
  resourceArn: db.clusterArn,
6250
6250
  database: db.defaultDatabaseName,
6251
- client: new RDSDataService({
6252
- region: project.config.region,
6253
- credentials
6254
- })
6251
+ client: useAWSClient(RDSData)
6255
6252
  }
6256
6253
  })
6257
6254
  });