sst 2.22.9 → 2.22.10

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.
Files changed (3) hide show
  1. package/package.json +1 -1
  2. package/project.js +8 -1
  3. package/sst.mjs +2 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "name": "sst",
4
- "version": "2.22.9",
4
+ "version": "2.22.10",
5
5
  "bin": {
6
6
  "sst": "cli/sst.js"
7
7
  },
package/project.js CHANGED
@@ -47,10 +47,17 @@ export async function initProject(globals) {
47
47
  throw new VisibleError("Could not found a configuration file", "Make sure one of the following exists", ...CONFIG_EXTENSIONS.map((x) => ` - sst${x}`));
48
48
  })();
49
49
  const config = await Promise.resolve(sstConfig.config(globals));
50
- const stage = globals.stage ||
50
+ const stage = process.env.SST_STAGE ||
51
+ globals.stage ||
51
52
  config.stage ||
52
53
  (await usePersonalStage(out)) ||
53
54
  (await promptPersonalStage(out));
55
+ // Set stage to SST_STAGE so that if SST spawned processes are aware
56
+ // of the stage. ie.
57
+ // `sst deploy --stage prod`: `prod` stage passed in via CLI
58
+ // -> spawns `open-next build`
59
+ // -> spawns `sst bind`: `prod` stage read from SST_STAGE
60
+ process.env.SST_STAGE = stage;
54
61
  const [version, cdkVersion, constructsVersion] = await (async () => {
55
62
  try {
56
63
  const packageJson = JSON.parse(await fs
package/sst.mjs CHANGED
@@ -381,7 +381,8 @@ async function initProject(globals) {
381
381
  );
382
382
  }();
383
383
  const config = await Promise.resolve(sstConfig.config(globals));
384
- const stage = globals.stage || config.stage || await usePersonalStage(out) || await promptPersonalStage(out);
384
+ const stage = process.env.SST_STAGE || globals.stage || config.stage || await usePersonalStage(out) || await promptPersonalStage(out);
385
+ process.env.SST_STAGE = stage;
385
386
  const [version2, cdkVersion, constructsVersion] = await (async () => {
386
387
  try {
387
388
  const packageJson = JSON.parse(