sst 2.0.0-rc.10 → 2.0.0-rc.12

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,7 +1,7 @@
1
1
  import { green, yellow } from "colorette";
2
2
  import fs from "fs/promises";
3
3
  import path from "path";
4
- const PACKAGE_MATCH = ["sst", "aws-cdk", "@aws-cdk"];
4
+ const PACKAGE_MATCH = ["sst", "aws-cdk", "@aws-cdk", "constructs"];
5
5
  const FIELDS = ["dependencies", "devDependencies"];
6
6
  export const update = (program) => program.command("update [ver]", "Update SST and CDK packages to another version", (yargs) => yargs.positional("ver", {
7
7
  type: "string",
@@ -25,9 +25,15 @@ export const update = (program) => program.command("update [ver]", "Update SST a
25
25
  for (const [pkg, existing] of Object.entries(deps)) {
26
26
  if (!PACKAGE_MATCH.some((x) => pkg.startsWith(x)))
27
27
  continue;
28
- const desired = pkg === "sst"
29
- ? metadata.version
30
- : metadata.dependencies["aws-cdk-lib"];
28
+ const desired = (() => {
29
+ if (pkg === "sst")
30
+ return metadata.version;
31
+ if (pkg === "constructs")
32
+ return metadata.dependencies.constructs;
33
+ if (pkg.endsWith("alpha"))
34
+ return metadata.dependencies["@aws-cdk/aws-apigatewayv2-alpha"];
35
+ return metadata.dependencies["aws-cdk-lib"];
36
+ })();
31
37
  if (existing === desired)
32
38
  continue;
33
39
  let arr = results.get(file);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sst",
3
- "version": "2.0.0-rc.10",
3
+ "version": "2.0.0-rc.12",
4
4
  "bin": {
5
5
  "sst": "cli/sst.js"
6
6
  },
@@ -68,8 +68,8 @@
68
68
  "immer": "9",
69
69
  "ink": "^3.2.0",
70
70
  "ink-spinner": "^4.0.3",
71
- "kysely": "^0.22.0",
72
- "kysely-codegen": "^0.8.0",
71
+ "kysely": "^0.23.3",
72
+ "kysely-codegen": "^0.9.0",
73
73
  "kysely-data-api": "^0.1.4",
74
74
  "openid-client": "^5.1.8",
75
75
  "ora": "^6.1.2",
@@ -101,17 +101,20 @@ export const useFunctionBuilder = Context.memo(() => {
101
101
  };
102
102
  const watcher = useWatcher();
103
103
  watcher.subscribe("file.changed", async (evt) => {
104
- const functions = useFunctions();
105
- for (const [functionID, props] of Object.entries(functions.all)) {
106
- const handler = handlers.for(props.runtime);
107
- if (!handler?.shouldBuild({
108
- functionID,
109
- file: evt.properties.file,
110
- }))
111
- continue;
112
- await result.build(functionID);
113
- Logger.debug("Rebuilt function", functionID);
104
+ try {
105
+ const functions = useFunctions();
106
+ for (const [functionID, props] of Object.entries(functions.all)) {
107
+ const handler = handlers.for(props.runtime);
108
+ if (!handler?.shouldBuild({
109
+ functionID,
110
+ file: evt.properties.file,
111
+ }))
112
+ continue;
113
+ await result.build(functionID);
114
+ Logger.debug("Rebuilt function", functionID);
115
+ }
114
116
  }
117
+ catch { }
115
118
  });
116
119
  return result;
117
120
  });
@@ -1,6 +1,10 @@
1
1
  import "../bus.js";
2
2
  declare module "../bus.js" {
3
3
  interface Events {
4
+ "function.ack": {
5
+ workerID: string;
6
+ functionID: string;
7
+ };
4
8
  "function.invoked": {
5
9
  workerID: string;
6
10
  functionID: string;
@@ -21,6 +21,10 @@ export const useRuntimeWorkers = Context.memo(() => {
21
21
  });
22
22
  const lastRequestId = new Map();
23
23
  bus.subscribe("function.invoked", async (evt) => {
24
+ bus.publish("function.ack", {
25
+ functionID: evt.properties.functionID,
26
+ workerID: evt.properties.workerID,
27
+ });
24
28
  let worker = workers.get(evt.properties.workerID);
25
29
  lastRequestId.set(evt.properties.workerID, evt.properties.context.awsRequestId);
26
30
  if (worker)
package/sst.mjs CHANGED
@@ -2671,16 +2671,19 @@ var init_handlers = __esm({
2671
2671
  };
2672
2672
  const watcher = useWatcher();
2673
2673
  watcher.subscribe("file.changed", async (evt) => {
2674
- const functions = useFunctions();
2675
- for (const [functionID, props] of Object.entries(functions.all)) {
2676
- const handler = handlers.for(props.runtime);
2677
- if (!handler?.shouldBuild({
2678
- functionID,
2679
- file: evt.properties.file
2680
- }))
2681
- continue;
2682
- await result.build(functionID);
2683
- Logger.debug("Rebuilt function", functionID);
2674
+ try {
2675
+ const functions = useFunctions();
2676
+ for (const [functionID, props] of Object.entries(functions.all)) {
2677
+ const handler = handlers.for(props.runtime);
2678
+ if (!handler?.shouldBuild({
2679
+ functionID,
2680
+ file: evt.properties.file
2681
+ }))
2682
+ continue;
2683
+ await result.build(functionID);
2684
+ Logger.debug("Rebuilt function", functionID);
2685
+ }
2686
+ } catch {
2684
2687
  }
2685
2688
  });
2686
2689
  return result;
@@ -2907,6 +2910,10 @@ var init_workers = __esm({
2907
2910
  });
2908
2911
  const lastRequestId = /* @__PURE__ */ new Map();
2909
2912
  bus.subscribe("function.invoked", async (evt) => {
2913
+ bus.publish("function.ack", {
2914
+ functionID: evt.properties.functionID,
2915
+ workerID: evt.properties.workerID
2916
+ });
2910
2917
  let worker = workers.get(evt.properties.workerID);
2911
2918
  lastRequestId.set(
2912
2919
  evt.properties.workerID,
@@ -20867,7 +20874,7 @@ function secrets(program2) {
20867
20874
  import { green, yellow } from "colorette";
20868
20875
  import fs12 from "fs/promises";
20869
20876
  import path13 from "path";
20870
- var PACKAGE_MATCH = ["sst", "aws-cdk", "@aws-cdk"];
20877
+ var PACKAGE_MATCH = ["sst", "aws-cdk", "@aws-cdk", "constructs"];
20871
20878
  var FIELDS = ["dependencies", "devDependencies"];
20872
20879
  var update = (program2) => program2.command(
20873
20880
  "update [ver]",
@@ -20894,7 +20901,15 @@ var update = (program2) => program2.command(
20894
20901
  for (const [pkg, existing] of Object.entries(deps)) {
20895
20902
  if (!PACKAGE_MATCH.some((x) => pkg.startsWith(x)))
20896
20903
  continue;
20897
- const desired = pkg === "sst" ? metadata2.version : metadata2.dependencies["aws-cdk-lib"];
20904
+ const desired = (() => {
20905
+ if (pkg === "sst")
20906
+ return metadata2.version;
20907
+ if (pkg === "constructs")
20908
+ return metadata2.dependencies.constructs;
20909
+ if (pkg.endsWith("alpha"))
20910
+ return metadata2.dependencies["@aws-cdk/aws-apigatewayv2-alpha"];
20911
+ return metadata2.dependencies["aws-cdk-lib"];
20912
+ })();
20898
20913
  if (existing === desired)
20899
20914
  continue;
20900
20915
  let arr = results.get(file);