sst 2.13.6 → 2.13.8

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,6 +1,7 @@
1
1
  import { App } from "./App.js";
2
2
  export declare const AppContext: {
3
3
  use(): App;
4
+ reset(): void;
4
5
  provide(value: App): void;
5
6
  };
6
7
  export declare const useApp: () => App;
@@ -5,6 +5,7 @@ export declare const Context: {
5
5
  };
6
6
  declare function create<C>(cb?: (() => C) | string, name?: string): {
7
7
  use(): C;
8
+ reset(): void;
8
9
  provide(value: C): void;
9
10
  };
10
11
  declare function reset(): void;
@@ -31,6 +31,10 @@ function create(cb, name) {
31
31
  result.dependants.add(last);
32
32
  return result.value;
33
33
  },
34
+ reset() {
35
+ resetDependencies(id);
36
+ state.contexts.delete(id);
37
+ },
34
38
  provide(value) {
35
39
  // If a new request has started, automatically clear all contexts
36
40
  const requestID = global[Symbol.for("aws.lambda.runtime.requestId")];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "name": "sst",
4
- "version": "2.13.6",
4
+ "version": "2.13.8",
5
5
  "bin": {
6
6
  "sst": "cli/sst.js"
7
7
  },
package/project.d.ts CHANGED
@@ -53,6 +53,7 @@ interface Project {
53
53
  }
54
54
  export declare const ProjectContext: {
55
55
  use(): Project;
56
+ reset(): void;
56
57
  provide(value: Project): void;
57
58
  };
58
59
  export declare function useProject(): Project;
package/sst.mjs CHANGED
@@ -59,6 +59,10 @@ function create(cb, name) {
59
59
  result.dependants.add(last2);
60
60
  return result.value;
61
61
  },
62
+ reset() {
63
+ resetDependencies(id);
64
+ state.contexts.delete(id);
65
+ },
62
66
  provide(value) {
63
67
  const requestID = global[Symbol.for("aws.lambda.runtime.requestId")];
64
68
  if (state.requestID !== requestID) {