sst 2.2.6 → 2.2.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.
- package/cli/commands/bootstrap.d.ts +13 -0
- package/cli/commands/bootstrap.js +5 -0
- package/cli/commands/deploy.js +14 -14
- package/cli/commands/dev.js +14 -14
- package/cli/sst.js +2 -0
- package/credentials.js +8 -0
- package/package.json +1 -1
- package/sst.mjs +3006 -2978
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="yargs" />
|
|
2
|
+
import type { Program } from "../program.js";
|
|
3
|
+
export declare const bootstrap: (program: Program) => import("yargs").Argv<{
|
|
4
|
+
stage: string | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
profile: string | undefined;
|
|
7
|
+
} & {
|
|
8
|
+
region: string | undefined;
|
|
9
|
+
} & {
|
|
10
|
+
verbose: boolean | undefined;
|
|
11
|
+
} & {
|
|
12
|
+
role: string | undefined;
|
|
13
|
+
}>;
|
package/cli/commands/deploy.js
CHANGED
|
@@ -25,6 +25,20 @@ export const deploy = (program) => program.command("deploy [filter]", "Deploy yo
|
|
|
25
25
|
useSTSIdentity(),
|
|
26
26
|
useAppMetadata(),
|
|
27
27
|
]);
|
|
28
|
+
async function promptChangeMode() {
|
|
29
|
+
const readline = await import("readline");
|
|
30
|
+
const rl = readline.createInterface({
|
|
31
|
+
input: process.stdin,
|
|
32
|
+
output: process.stdout,
|
|
33
|
+
});
|
|
34
|
+
return new Promise((resolve) => {
|
|
35
|
+
console.log("");
|
|
36
|
+
rl.question(`You were previously running the stage "${project.config.stage}" in dev mode. It is recommended that you use a different stage for production. Read more here — https://docs.sst.dev/live-lambda-development\n\nAre you sure you want to deploy to this stage? (y/N) `, async (input) => {
|
|
37
|
+
rl.close();
|
|
38
|
+
resolve(input.trim() === "y");
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
}
|
|
28
42
|
// Check app mode changed
|
|
29
43
|
if (appMetadata && appMetadata.mode !== "deploy") {
|
|
30
44
|
if (!(await promptChangeMode())) {
|
|
@@ -80,17 +94,3 @@ export const deploy = (program) => program.command("deploy [filter]", "Deploy yo
|
|
|
80
94
|
await saveAppMetadata({ mode: "deploy" });
|
|
81
95
|
process.exit(0);
|
|
82
96
|
});
|
|
83
|
-
async function promptChangeMode() {
|
|
84
|
-
const readline = await import("readline");
|
|
85
|
-
const rl = readline.createInterface({
|
|
86
|
-
input: process.stdin,
|
|
87
|
-
output: process.stdout,
|
|
88
|
-
});
|
|
89
|
-
return new Promise((resolve) => {
|
|
90
|
-
console.log("");
|
|
91
|
-
rl.question("You were previously running this stage in dev mode. It is recommended that you use a different stage for production. Read more here — https://docs.sst.dev/live-lambda-development\n\nAre you sure you want to deploy to this stage? (y/N) ", async (input) => {
|
|
92
|
-
rl.close();
|
|
93
|
-
resolve(input.trim() === "y");
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
}
|
package/cli/commands/dev.js
CHANGED
|
@@ -253,6 +253,20 @@ export const dev = (program) => program.command(["dev", "start"], "Work on your
|
|
|
253
253
|
live: true,
|
|
254
254
|
}),
|
|
255
255
|
]);
|
|
256
|
+
async function promptChangeMode() {
|
|
257
|
+
const readline = await import("readline");
|
|
258
|
+
const rl = readline.createInterface({
|
|
259
|
+
input: process.stdin,
|
|
260
|
+
output: process.stdout,
|
|
261
|
+
});
|
|
262
|
+
return new Promise((resolve) => {
|
|
263
|
+
console.log("");
|
|
264
|
+
rl.question(`You have previously deployed the stage "${useProject().config.stage}" in production. It is recommended that you use a different stage for development. Read more here — https://docs.sst.dev/live-lambda-development\n\nAre you sure you want to run this stage in dev mode? [y/N] `, async (input) => {
|
|
265
|
+
rl.close();
|
|
266
|
+
resolve(input.trim() === "y");
|
|
267
|
+
});
|
|
268
|
+
});
|
|
269
|
+
}
|
|
256
270
|
// Check app mode changed
|
|
257
271
|
if (appMetadata && appMetadata.mode !== "dev") {
|
|
258
272
|
if (!(await promptChangeMode())) {
|
|
@@ -274,17 +288,3 @@ export const dev = (program) => program.command(["dev", "start"], "Work on your
|
|
|
274
288
|
useStackBuilder(),
|
|
275
289
|
]);
|
|
276
290
|
});
|
|
277
|
-
async function promptChangeMode() {
|
|
278
|
-
const readline = await import("readline");
|
|
279
|
-
const rl = readline.createInterface({
|
|
280
|
-
input: process.stdin,
|
|
281
|
-
output: process.stdout,
|
|
282
|
-
});
|
|
283
|
-
return new Promise((resolve) => {
|
|
284
|
-
console.log("");
|
|
285
|
-
rl.question("You have previously deployed this stage in production. It is recommended that you use a different stage for development. Read more here — https://docs.sst.dev/live-lambda-development\n\nAre you sure you want to run this stage in dev mode? [y/N] ", async (input) => {
|
|
286
|
-
rl.close();
|
|
287
|
-
resolve(input.trim() === "y");
|
|
288
|
-
});
|
|
289
|
-
});
|
|
290
|
-
}
|
package/cli/sst.js
CHANGED
|
@@ -12,6 +12,7 @@ dotenv.config({
|
|
|
12
12
|
path: ".env.local",
|
|
13
13
|
override: true,
|
|
14
14
|
});
|
|
15
|
+
import { bootstrap } from "./commands/bootstrap.js";
|
|
15
16
|
import { env } from "./commands/env.js";
|
|
16
17
|
import { dev } from "./commands/dev.js";
|
|
17
18
|
import { bind } from "./commands/bind.js";
|
|
@@ -25,6 +26,7 @@ import { transform } from "./commands/transform.js";
|
|
|
25
26
|
import { diff } from "./commands/diff.js";
|
|
26
27
|
import { version } from "./commands/version.js";
|
|
27
28
|
import { telemetry } from "./commands/telemetry.js";
|
|
29
|
+
bootstrap(program);
|
|
28
30
|
dev(program);
|
|
29
31
|
deploy(program);
|
|
30
32
|
build(program);
|
package/credentials.js
CHANGED
|
@@ -88,6 +88,14 @@ export function useAWSClient(client, force = false) {
|
|
|
88
88
|
delayDecider: (_, attempts) => {
|
|
89
89
|
return Math.min(1.5 ** attempts * 100, 5000);
|
|
90
90
|
},
|
|
91
|
+
// AWS SDK v3 has an idea of "retry tokens" which are used to
|
|
92
|
+
// prevent multiple retries from happening at the same time.
|
|
93
|
+
// This is a workaround to disable that.
|
|
94
|
+
retryQuota: {
|
|
95
|
+
hasRetryTokens: () => true,
|
|
96
|
+
releaseRetryTokens: () => { },
|
|
97
|
+
retrieveRetryTokens: () => 1,
|
|
98
|
+
},
|
|
91
99
|
}),
|
|
92
100
|
});
|
|
93
101
|
cache.set(client.name, result);
|