sst 2.24.4 → 2.24.6
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/types.d.ts +15 -0
- package/cli/commands/types.js +19 -0
- package/cli/sst.js +2 -0
- package/constructs/App.d.ts +1 -1
- package/constructs/App.js +6 -0
- package/credentials.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="yargs" />
|
|
2
|
+
import type { Program } from "../program.js";
|
|
3
|
+
export declare const types: (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
|
+
} & {
|
|
14
|
+
future: boolean | undefined;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
export const types = (program) => program.command("types", "Generate resource types in .sst/types", (yargs) => yargs, async () => {
|
|
3
|
+
const { useProject } = await import("../../project.js");
|
|
4
|
+
const { Stacks } = await import("../../stacks/index.js");
|
|
5
|
+
const { App } = await import("../../constructs/App.js");
|
|
6
|
+
const { Colors } = await import("../colors.js");
|
|
7
|
+
const project = useProject();
|
|
8
|
+
const [_metafile, sstConfig] = await Stacks.load(project.paths.config);
|
|
9
|
+
const app = new App({
|
|
10
|
+
mode: "deploy",
|
|
11
|
+
stage: project.config.stage,
|
|
12
|
+
name: project.config.name,
|
|
13
|
+
region: project.config.region,
|
|
14
|
+
});
|
|
15
|
+
sstConfig.stacks(app);
|
|
16
|
+
app.codegenTypes();
|
|
17
|
+
Colors.line(Colors.success(`✔ `), `Types generated in ${path.resolve(project.paths.out, "types")}`);
|
|
18
|
+
process.exit(0);
|
|
19
|
+
});
|
package/cli/sst.js
CHANGED
|
@@ -25,6 +25,7 @@ import { transform } from "./commands/transform.js";
|
|
|
25
25
|
import { diff } from "./commands/diff.js";
|
|
26
26
|
import { version } from "./commands/version.js";
|
|
27
27
|
import { telemetry } from "./commands/telemetry.js";
|
|
28
|
+
import { types } from "./commands/types.js";
|
|
28
29
|
import { connect } from "./commands/connect.js";
|
|
29
30
|
bootstrap(program);
|
|
30
31
|
dev(program);
|
|
@@ -39,6 +40,7 @@ consoleCommand(program);
|
|
|
39
40
|
diff(program);
|
|
40
41
|
version(program);
|
|
41
42
|
telemetry(program);
|
|
43
|
+
types(program);
|
|
42
44
|
connect(program);
|
|
43
45
|
if ("setSourceMapsEnabled" in process) {
|
|
44
46
|
// @ts-expect-error
|
package/constructs/App.d.ts
CHANGED
|
@@ -159,7 +159,7 @@ export declare class App extends CDKApp {
|
|
|
159
159
|
private applyRemovalPolicy;
|
|
160
160
|
private removeGovCloudUnsupportedResourceProperties;
|
|
161
161
|
private ensureUniqueConstructIds;
|
|
162
|
-
|
|
162
|
+
codegenTypes(): void;
|
|
163
163
|
private foreachConstruct;
|
|
164
164
|
stack<T extends FunctionalStack<any>>(fn: T, props?: StackProps & {
|
|
165
165
|
id?: string;
|
package/constructs/App.js
CHANGED
|
@@ -398,6 +398,8 @@ export class App extends CDKApp {
|
|
|
398
398
|
` STAGE: string;`,
|
|
399
399
|
` }`,
|
|
400
400
|
`}`,
|
|
401
|
+
``,
|
|
402
|
+
``,
|
|
401
403
|
].join("\n"));
|
|
402
404
|
this.foreachConstruct((c) => {
|
|
403
405
|
if (!isSSTConstruct(c)) {
|
|
@@ -421,6 +423,8 @@ export class App extends CDKApp {
|
|
|
421
423
|
` "${id}": string;`,
|
|
422
424
|
` }`,
|
|
423
425
|
`}`,
|
|
426
|
+
``,
|
|
427
|
+
``,
|
|
424
428
|
]
|
|
425
429
|
: [
|
|
426
430
|
`import "sst/node/${binding.clientPackage}";`,
|
|
@@ -431,6 +435,8 @@ export class App extends CDKApp {
|
|
|
431
435
|
` }`,
|
|
432
436
|
` }`,
|
|
433
437
|
`}`,
|
|
438
|
+
``,
|
|
439
|
+
``,
|
|
434
440
|
]).join("\n"));
|
|
435
441
|
});
|
|
436
442
|
}
|
package/credentials.js
CHANGED
|
@@ -8,6 +8,7 @@ export const useAWSCredentialsProvider = Context.memo(() => {
|
|
|
8
8
|
const project = useProject();
|
|
9
9
|
Logger.debug("Using AWS profile", project.config.profile);
|
|
10
10
|
const provider = fromNodeProviderChain({
|
|
11
|
+
clientConfig: { region: project.config.region },
|
|
11
12
|
profile: project.config.profile,
|
|
12
13
|
roleArn: project.config.role,
|
|
13
14
|
mfaCodeProvider: async (serialArn) => {
|