sst 2.16.0 → 2.16.1

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.
@@ -114,6 +114,7 @@ export const dev = (program) => program.command(["dev", "start"], "Work on your
114
114
  const useStackBuilder = Context.memo(async () => {
115
115
  const watcher = useWatcher();
116
116
  const project = useProject();
117
+ const scriptVersion = Date.now().toString();
117
118
  let lastDeployed;
118
119
  let isWorking = false;
119
120
  let isDirty = false;
@@ -135,6 +136,7 @@ export const dev = (program) => program.command(["dev", "start"], "Work on your
135
136
  project.stacks = sstConfig.stacks;
136
137
  const assembly = await Stacks.synth({
137
138
  increaseTimeout: args["increase-timeout"],
139
+ scriptVersion,
138
140
  fn: project.stacks,
139
141
  outDir: `.sst/cdk.out`,
140
142
  mode: "dev",
@@ -30,7 +30,7 @@ export interface AppDeployProps {
30
30
  readonly region?: string;
31
31
  readonly buildDir?: string;
32
32
  readonly account?: string;
33
- readonly debugStartedAt?: number;
33
+ readonly debugScriptVersion?: string;
34
34
  readonly debugIncreaseTimeout?: boolean;
35
35
  readonly mode: "deploy" | "dev" | "remove";
36
36
  readonly isActiveStack?: (stackName: string) => boolean;
@@ -66,7 +66,7 @@ export declare class App extends CDKApp {
66
66
  */
67
67
  readonly account: string;
68
68
  /** @internal */
69
- readonly debugStartedAt?: number;
69
+ readonly debugScriptVersion?: string;
70
70
  /** @internal */
71
71
  readonly debugIncreaseTimeout?: boolean;
72
72
  /** @internal */
package/constructs/App.js CHANGED
@@ -50,7 +50,7 @@ export class App extends CDKApp {
50
50
  */
51
51
  account;
52
52
  /** @internal */
53
- debugStartedAt;
53
+ debugScriptVersion;
54
54
  /** @internal */
55
55
  debugIncreaseTimeout;
56
56
  /** @internal */
@@ -82,7 +82,7 @@ export class App extends CDKApp {
82
82
  this.isActiveStack = deployProps.isActiveStack;
83
83
  this.defaultFunctionProps = [];
84
84
  if (this.mode === "dev") {
85
- this.debugStartedAt = deployProps.debugStartedAt;
85
+ this.debugScriptVersion = deployProps.debugScriptVersion;
86
86
  this.debugIncreaseTimeout = deployProps.debugIncreaseTimeout;
87
87
  }
88
88
  }
@@ -144,9 +144,8 @@ export class Script extends Construct {
144
144
  // when rebuilding infrastructure. Otherwise, there will always be
145
145
  // a change when rebuilding infrastructure b/c the "version" property
146
146
  // changes on each build.
147
- const version = app.mode === "dev"
148
- ? app.debugStartedAt
149
- : this.props.version ?? Date.now().toString();
147
+ const defaultVersion = app.mode === "dev" ? app.debugScriptVersion : Date.now().toString();
148
+ const version = this.props.version ?? defaultVersion;
150
149
  new CustomResource(this, "ScriptResource", {
151
150
  serviceToken: crFunction.functionArn,
152
151
  resourceType: "Custom::SSTScript",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "name": "sst",
4
- "version": "2.16.0",
4
+ "version": "2.16.1",
5
5
  "bin": {
6
6
  "sst": "cli/sst.js"
7
7
  },
package/sst.mjs CHANGED
@@ -5151,6 +5151,7 @@ async function synth(opts) {
5151
5151
  region: project.config.region,
5152
5152
  mode: opts.mode,
5153
5153
  debugIncreaseTimeout: opts.increaseTimeout,
5154
+ debugScriptVersion: opts.scriptVersion,
5154
5155
  isActiveStack: opts.isActiveStack
5155
5156
  },
5156
5157
  {
@@ -7140,6 +7141,7 @@ var dev = (program2) => program2.command(
7140
7141
  const useStackBuilder = Context2.memo(async () => {
7141
7142
  const watcher = useWatcher2();
7142
7143
  const project = useProject2();
7144
+ const scriptVersion = Date.now().toString();
7143
7145
  let lastDeployed;
7144
7146
  let isWorking = false;
7145
7147
  let isDirty = false;
@@ -7163,6 +7165,7 @@ var dev = (program2) => program2.command(
7163
7165
  project.stacks = sstConfig.stacks;
7164
7166
  const assembly = await Stacks.synth({
7165
7167
  increaseTimeout: args["increase-timeout"],
7168
+ scriptVersion,
7166
7169
  fn: project.stacks,
7167
7170
  outDir: `.sst/cdk.out`,
7168
7171
  mode: "dev"
package/stacks/synth.d.ts CHANGED
@@ -3,6 +3,7 @@ interface SynthOptions {
3
3
  buildDir?: string;
4
4
  outDir?: string;
5
5
  increaseTimeout?: boolean;
6
+ scriptVersion?: string;
6
7
  mode: App["mode"];
7
8
  fn: (app: App) => Promise<void> | void;
8
9
  isActiveStack?: (stackName: string) => boolean;
package/stacks/synth.js CHANGED
@@ -46,6 +46,7 @@ export async function synth(opts) {
46
46
  region: project.config.region,
47
47
  mode: opts.mode,
48
48
  debugIncreaseTimeout: opts.increaseTimeout,
49
+ debugScriptVersion: opts.scriptVersion,
49
50
  isActiveStack: opts.isActiveStack,
50
51
  }, {
51
52
  outdir: opts.buildDir,