sst 2.0.0-rc.26 → 2.0.0-rc.29

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/bootstrap.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export declare const useBootstrap: () => Promise<{
2
- version: undefined;
3
- bucket: undefined;
2
+ version: never;
3
+ bucket: never;
4
4
  }>;
package/bootstrap.js CHANGED
@@ -23,10 +23,8 @@ const LATEST_VERSION = "4";
23
23
  const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
24
24
  export const useBootstrap = Context.memo(async () => {
25
25
  Logger.debug("Initializing bootstrap context");
26
- const ret = await loadBootstrapStatus();
27
- if (!ret.version ||
28
- !ret.bucket ||
29
- ret.version !== LATEST_VERSION) {
26
+ let status = await loadBootstrapStatus();
27
+ if (!status || status.version !== LATEST_VERSION) {
30
28
  const project = useProject();
31
29
  const spinner = createSpinner("Deploying bootstrap stack, this only needs to happen once").start();
32
30
  // Create bootstrap stack
@@ -89,22 +87,39 @@ export const useBootstrap = Context.memo(async () => {
89
87
  // Create stack outputs to store bootstrap stack info
90
88
  new CfnOutput(stack, OUTPUT_VERSION, { value: LATEST_VERSION });
91
89
  new CfnOutput(stack, OUTPUT_BUCKET, { value: bucket.bucketName });
90
+ // Deploy bootstrap stack
92
91
  const asm = app.synth();
93
92
  const result = await Stacks.deploy(asm.stacks[0]);
94
93
  if (Stacks.isFailed(result.status)) {
95
94
  throw new VisibleError(`Failed to deploy bootstrap stack:\n${JSON.stringify(result.errors, null, 4)}`);
96
95
  }
97
96
  spinner.succeed();
98
- return loadBootstrapStatus();
97
+ // Fetch bootstrap status
98
+ status = await loadBootstrapStatus();
99
+ if (!status) {
100
+ throw new VisibleError("Failed to deploy bootstrap stack");
101
+ }
99
102
  }
100
- Logger.debug("Loaded bootstrap info: ", JSON.stringify(ret));
101
- return ret;
103
+ Logger.debug("Loaded bootstrap info: ", JSON.stringify(status));
104
+ return status;
102
105
  });
103
106
  async function loadBootstrapStatus() {
107
+ // Get bootstrap CloudFormation stack
104
108
  const cf = useAWSClient(CloudFormationClient);
105
- const result = await cf.send(new DescribeStacksCommand({
106
- StackName: STACK_NAME,
107
- }));
109
+ let result;
110
+ try {
111
+ result = await cf.send(new DescribeStacksCommand({
112
+ StackName: STACK_NAME,
113
+ }));
114
+ }
115
+ catch (e) {
116
+ if (e.Code === "ValidationError"
117
+ && e.message === `Stack with id ${STACK_NAME} does not exist`) {
118
+ return null;
119
+ }
120
+ throw e;
121
+ }
122
+ // Parse stack outputs
108
123
  let version, bucket;
109
124
  (result.Stacks[0].Outputs || []).forEach((o) => {
110
125
  if (o.OutputKey === OUTPUT_VERSION) {
@@ -114,5 +129,8 @@ async function loadBootstrapStatus() {
114
129
  bucket = o.OutputValue;
115
130
  }
116
131
  });
132
+ if (!version || !bucket) {
133
+ return null;
134
+ }
117
135
  return { version, bucket };
118
136
  }
@@ -1,12 +1,15 @@
1
- import { useProject } from "../../project.js";
2
- export const bind = (program) => program.command("bind <command>", "Binds blah", (yargs) => yargs.positional("command", {
1
+ export const bind = (program) => program.command("bind <command>", "Bind your app's resources to a command", (yargs) => yargs
2
+ .positional("command", {
3
3
  type: "string",
4
- describe: "Command to bind to",
4
+ describe: "The command to bind to",
5
5
  demandOption: true,
6
- }), async (args) => {
6
+ })
7
+ .example(`sst bind "vitest run"`, "Bind your resources to your tests")
8
+ .example(`sst bind "tsx scripts/myscript.ts"`, "Bind your resources to a script"), async (args) => {
7
9
  const { Config } = await import("../../config.js");
8
- const { spawnSync, spawn } = await import("child_process");
10
+ const { spawnSync } = await import("child_process");
9
11
  const { useAWSCredentials } = await import("../../credentials.js");
12
+ const { useProject } = await import("../../project.js");
10
13
  const env = await Config.env();
11
14
  const project = useProject();
12
15
  const credentials = await useAWSCredentials();
@@ -1,5 +1,5 @@
1
1
  /// <reference types="yargs" />
2
- import { Program } from "../program.js";
2
+ import type { Program } from "../program.js";
3
3
  export declare const build: (program: Program) => import("yargs").Argv<{
4
4
  stage: string | undefined;
5
5
  } & {
@@ -7,5 +7,5 @@ export declare const build: (program: Program) => import("yargs").Argv<{
7
7
  } & {
8
8
  region: string | undefined;
9
9
  } & {
10
- from: string | undefined;
10
+ to: string | undefined;
11
11
  }>;
@@ -1,10 +1,14 @@
1
- import { useProject } from "../../project.js";
2
- import { createSpinner } from "../spinner.js";
3
- export const build = (program) => program.command("build", "Build stacks code", (yargs) => yargs.option("from", { type: "string" }), async () => {
1
+ export const build = (program) => program.command("build", "Build your app", (yargs) => yargs.option("to", {
2
+ type: "string",
3
+ describe: "Output directory, defaults to .sst/dist",
4
+ }), async (args) => {
5
+ const { useProject } = await import("../../project.js");
6
+ const { createSpinner } = await import("../spinner.js");
4
7
  const { Stacks } = await import("../../stacks/index.js");
5
8
  const spinner = createSpinner("Building stacks").start();
6
9
  await Stacks.synth({
7
10
  fn: useProject().stacks,
11
+ buildDir: args.to,
8
12
  mode: "deploy",
9
13
  });
10
14
  spinner.succeed();
@@ -1,5 +1,5 @@
1
1
  /// <reference types="yargs" />
2
- import { Program } from "../program.js";
2
+ import type { Program } from "../program.js";
3
3
  export declare const consoleCommand: (program: Program) => Promise<import("yargs").Argv<{
4
4
  stage: string | undefined;
5
5
  } & {
@@ -1,7 +1,7 @@
1
- import { blue } from "colorette";
2
- import { useRuntimeServer } from "../../runtime/server.js";
3
- import { useLocalServer } from "../local/server.js";
4
- export const consoleCommand = async (program) => program.command("console", "Start the sst console", (yargs) => yargs, async () => {
1
+ export const consoleCommand = async (program) => program.command("console", "Start the SST Console", (yargs) => yargs, async () => {
2
+ const { blue } = await import("colorette");
3
+ const { useRuntimeServer } = await import("../../runtime/server.js");
4
+ const { useLocalServer } = await import("../local/server.js");
5
5
  await Promise.all([
6
6
  useRuntimeServer(),
7
7
  useLocalServer({
@@ -1,14 +1,20 @@
1
- import { printDeploymentResults } from "../ui/deploy.js";
2
- import { createSpinner } from "../spinner.js";
3
- export const deploy = (program) => program.command("deploy [filter]", "Work on your SST app locally", (yargs) => yargs
4
- .option("from", { type: "string" })
1
+ export const deploy = (program) => program.command("deploy [filter]", "Deploy your app to AWS", (yargs) => yargs
2
+ .option("from", {
3
+ type: "string",
4
+ describe: "Deploy using previously built output",
5
+ })
5
6
  .option("fullscreen", {
6
7
  type: "boolean",
7
8
  describe: "Disable full screen UI",
8
9
  default: true,
9
10
  })
10
- .positional("filter", { type: "string" }), async (args) => {
11
+ .positional("filter", {
12
+ type: "string",
13
+ describe: "Optionally filter stacks to deploy",
14
+ }), async (args) => {
11
15
  const React = await import("react");
16
+ const { printDeploymentResults } = await import("../ui/deploy.js");
17
+ const { createSpinner } = await import("../spinner.js");
12
18
  const { CloudAssembly } = await import("aws-cdk-lib/cx-api");
13
19
  const { blue, bold } = await import("colorette");
14
20
  const { useProject } = await import("../../project.js");
@@ -34,18 +40,22 @@ export const deploy = (program) => program.command("deploy [filter]", "Work on y
34
40
  if (!target.length) {
35
41
  console.log(`No stacks found matching ${blue(args.filter)}`);
36
42
  process.exit(1);
37
- return;
38
43
  }
39
44
  console.log(`Deploying ${bold(target.length + " stacks")} for stage ${blue(project.config.stage)}...`);
40
- let component = undefined;
41
- if (args.fullscreen) {
42
- process.stdout.write("\x1b[?1049h");
43
- component = render(React.createElement(DeploymentUI, { stacks: assembly.stacks.map((s) => s.stackName) }));
44
- }
45
+ const cleanup = (() => {
46
+ if (args.fullscreen) {
47
+ process.stdout.write("\x1b[?1049h");
48
+ const component = render(React.createElement(DeploymentUI, { stacks: assembly.stacks.map((s) => s.stackName) }));
49
+ return () => {
50
+ component.unmount();
51
+ process.stdout.write("\x1b[?1049l");
52
+ };
53
+ }
54
+ const spinner = createSpinner("Deploying stacks");
55
+ return () => spinner.succeed();
56
+ })();
45
57
  const results = await Stacks.deployMany(target);
46
- if (component)
47
- component.unmount();
48
- process.stdout.write("\x1b[?1049l");
58
+ cleanup();
49
59
  printDeploymentResults(results);
50
60
  if (Object.values(results).some((stack) => Stacks.isFailed(stack.status)))
51
61
  process.exit(1);
@@ -1,16 +1,4 @@
1
- import path from "path";
2
- import fs from "fs/promises";
3
- import crypto from "crypto";
4
- import { printDeploymentResults } from "../ui/deploy.js";
5
- import { useFunctions } from "../../constructs/Function.js";
6
- import { dim, gray, yellow } from "colorette";
7
- import { SiteEnv } from "../../site-env.js";
8
- import { usePothosBuilder } from "./plugins/pothos.js";
9
- import { useKyselyTypeGenerator } from "./plugins/kysely.js";
10
- import { useRDSWarmer } from "./plugins/warmer.js";
11
- import { useProject } from "../../project.js";
12
- import { useMetadata } from "../../stacks/metadata.js";
13
- export const dev = (program) => program.command(["start", "dev"], "Work on your SST app locally", (yargs) => yargs.option("fullscreen", {
1
+ export const dev = (program) => program.command(["dev", "start"], "Work on your app locally", (yargs) => yargs.option("fullscreen", {
14
2
  type: "boolean",
15
3
  describe: "Disable full screen UI",
16
4
  default: true,
@@ -29,6 +17,18 @@ export const dev = (program) => program.command(["start", "dev"], "Work on your
29
17
  const { Context } = await import("../../context/context.js");
30
18
  const { DeploymentUI } = await import("../ui/deploy.js");
31
19
  const { useLocalServer } = await import("../local/server.js");
20
+ const path = await import("path");
21
+ const fs = await import("fs/promises");
22
+ const crypto = await import("crypto");
23
+ const { printDeploymentResults } = await import("../ui/deploy.js");
24
+ const { useFunctions } = await import("../../constructs/Function.js");
25
+ const { dim, gray, yellow } = await import("colorette");
26
+ const { SiteEnv } = await import("../../site-env.js");
27
+ const { usePothosBuilder } = await import("./plugins/pothos.js");
28
+ const { useKyselyTypeGenerator } = await import("./plugins/kysely.js");
29
+ const { useRDSWarmer } = await import("./plugins/warmer.js");
30
+ const { useProject } = await import("../../project.js");
31
+ const { useMetadata } = await import("../../stacks/metadata.js");
32
32
  if (args._[0] === "start") {
33
33
  console.log(yellow(`Warning: ${bold(`sst start`)} has been renamed to ${bold(`sst dev`)}`));
34
34
  }
@@ -108,15 +108,20 @@ export const dev = (program) => program.command(["start", "dev"], "Work on your
108
108
  const assembly = pending;
109
109
  const nextChecksum = await checksum(assembly.directory);
110
110
  pending = undefined;
111
- let component = undefined;
112
- if (args.fullscreen) {
113
- process.stdout.write("\x1b[?1049h");
114
- component = render(React.createElement(DeploymentUI, { stacks: assembly.stacks.map((s) => s.stackName) }));
115
- }
111
+ const cleanup = (() => {
112
+ if (args.fullscreen) {
113
+ process.stdout.write("\x1b[?1049h");
114
+ const component = render(React.createElement(DeploymentUI, { stacks: assembly.stacks.map((s) => s.stackName) }));
115
+ return () => {
116
+ component.unmount();
117
+ process.stdout.write("\x1b[?1049l");
118
+ };
119
+ }
120
+ const spinner = createSpinner("Deploying stacks");
121
+ return () => spinner.succeed();
122
+ })();
116
123
  const results = await Stacks.deployMany(assembly.stacks);
117
- if (component)
118
- component.unmount();
119
- process.stdout.write("\x1b[?1049l");
124
+ cleanup();
120
125
  lastDeployed = nextChecksum;
121
126
  printDeploymentResults(results);
122
127
  const keys = await SiteEnv.keys();
@@ -7,5 +7,5 @@ export declare const diff: (program: Program) => import("yargs").Argv<{
7
7
  } & {
8
8
  region: string | undefined;
9
9
  } & {
10
- mode: string;
10
+ dev: boolean | undefined;
11
11
  }>;
@@ -1,19 +1,18 @@
1
- import { useProject } from "../../project.js";
2
- import { Stacks } from "../../stacks/index.js";
3
- import { printStackDiff } from "aws-cdk/lib/diff.js";
4
- import { useAWSClient } from "../../credentials.js";
5
- import { CloudFormationClient, GetTemplateCommand, } from "@aws-sdk/client-cloudformation";
6
- import { createSpinner } from "../spinner.js";
7
- export const diff = (program) => program.command("diff", "", (yargs) => yargs.option("mode", {
8
- type: "string",
9
- describe: "deploy or dev",
10
- default: "deploy",
1
+ export const diff = (program) => program.command("diff", "Compare your app with what is deployed on AWS", (yargs) => yargs.option("dev", {
2
+ type: "boolean",
3
+ describe: "Compare in dev mode",
11
4
  }), async (args) => {
5
+ const { printStackDiff } = await import("aws-cdk/lib/diff.js");
6
+ const { useProject } = await import("../../project.js");
7
+ const { Stacks } = await import("../../stacks/index.js");
8
+ const { useAWSClient } = await import("../../credentials.js");
9
+ const { CloudFormationClient, GetTemplateCommand } = await import("@aws-sdk/client-cloudformation");
10
+ const { createSpinner } = await import("../spinner.js");
12
11
  const spinner = createSpinner("Building stacks");
13
12
  const project = useProject();
14
13
  const assembly = await Stacks.synth({
15
14
  fn: project.stacks,
16
- mode: args.mode,
15
+ mode: args.dev ? "dev" : "deploy",
17
16
  });
18
17
  spinner.succeed();
19
18
  const cfn = useAWSClient(CloudFormationClient);
@@ -1,5 +1,5 @@
1
1
  /// <reference types="yargs" />
2
- import { Program } from "../program.js";
2
+ import type { Program } from "../program.js";
3
3
  export declare const env: (program: Program) => import("yargs").Argv<{
4
4
  stage: string | undefined;
5
5
  } & {
@@ -1,14 +1,15 @@
1
- import { useProject } from "../../project.js";
2
- import { createSpinner } from "../spinner.js";
3
- import fs from "fs/promises";
4
- import { SiteEnv } from "../../site-env.js";
5
- import { spawnSync } from "child_process";
6
- export const env = (program) => program.command("env <command>", "description", (yargs) => yargs.positional("command", {
1
+ export const env = (program) => program.command("env <command>", "Load environment variables and start your frontend", (yargs) => yargs
2
+ .positional("command", {
7
3
  type: "string",
8
- describe: "Command to run with environment variabels loaded",
4
+ describe: "The command to start your frontend",
9
5
  demandOption: true,
10
- }), async (args) => {
11
- const project = useProject();
6
+ })
7
+ .example(`sst env "next dev"`, "Start Next.js with your environment variables")
8
+ .example(`sst env "vite dev"`, "Start Vite with your environment variables"), async (args) => {
9
+ const { createSpinner } = await import("../spinner.js");
10
+ const fs = await import("fs/promises");
11
+ const { SiteEnv } = await import("../../site-env.js");
12
+ const { spawnSync } = await import("child_process");
12
13
  let spinner;
13
14
  while (true) {
14
15
  const exists = await fs
@@ -8,6 +8,8 @@ export declare const remove: (program: Program) => import("yargs").Argv<{
8
8
  region: string | undefined;
9
9
  } & {
10
10
  from: string | undefined;
11
+ } & {
12
+ fullscreen: boolean;
11
13
  } & {
12
14
  filter: string | undefined;
13
15
  }>;
@@ -1,7 +1,14 @@
1
- import { printDeploymentResults } from "../ui/deploy.js";
2
- export const remove = (program) => program.command("remove [filter]", "Remove all stacks for this app", (yargs) => yargs
1
+ export const remove = (program) => program.command("remove [filter]", "Remove your app from AWS", (yargs) => yargs
3
2
  .option("from", { type: "string" })
4
- .positional("filter", { type: "string" }), async (args) => {
3
+ .option("fullscreen", {
4
+ type: "boolean",
5
+ describe: "Disable full screen UI",
6
+ default: true,
7
+ })
8
+ .positional("filter", {
9
+ type: "string",
10
+ describe: "Optionally filter stacks to remove",
11
+ }), async (args) => {
5
12
  const React = await import("react");
6
13
  const { CloudAssembly } = await import("aws-cdk-lib/cx-api");
7
14
  const { blue, bold } = await import("colorette");
@@ -9,6 +16,8 @@ export const remove = (program) => program.command("remove [filter]", "Remove al
9
16
  const { Stacks } = await import("../../stacks/index.js");
10
17
  const { render } = await import("ink");
11
18
  const { DeploymentUI } = await import("../ui/deploy.js");
19
+ const { printDeploymentResults } = await import("../ui/deploy.js");
20
+ const { createSpinner } = await import("../spinner.js");
12
21
  const assembly = await (async function () {
13
22
  if (args.from) {
14
23
  const result = new CloudAssembly(args.from);
@@ -28,11 +37,22 @@ export const remove = (program) => program.command("remove [filter]", "Remove al
28
37
  process.exit(1);
29
38
  }
30
39
  console.log(`Removing ${bold(target.length + " stacks")} for stage ${blue(project.config.stage)}...`);
31
- process.stdout.write("\x1b[?1049h");
32
- const component = render(React.createElement(DeploymentUI, { stacks: target.map((s) => s.stackName) }));
40
+ const cleanup = (() => {
41
+ if (args.fullscreen) {
42
+ process.stdout.write("\x1b[?1049h");
43
+ const component = render(React.createElement(DeploymentUI, { stacks: assembly.stacks.map((s) => s.stackName) }));
44
+ return () => {
45
+ component.unmount();
46
+ process.stdout.write("\x1b[?1049l");
47
+ };
48
+ }
49
+ const spinner = createSpinner("Removing stacks");
50
+ return () => spinner.succeed();
51
+ })();
33
52
  const results = await Stacks.removeMany(target);
34
- component.unmount();
35
- process.stdout.write("\x1b[?1049l");
53
+ cleanup();
36
54
  printDeploymentResults(results);
55
+ if (Object.values(results).some((stack) => Stacks.isFailed(stack.status)))
56
+ process.exit(1);
37
57
  process.exit(0);
38
58
  });
@@ -1,6 +1,6 @@
1
1
  /// <reference types="yargs" />
2
2
  import { Program } from "../../program.js";
3
- export declare const get: (program: Program) => import("yargs").Argv<import("yargs").Omit<{
3
+ export declare const get: (program: Program) => import("yargs").Argv<{
4
4
  stage: string | undefined;
5
5
  } & {
6
6
  profile: string | undefined;
@@ -8,6 +8,6 @@ export declare const get: (program: Program) => import("yargs").Argv<import("yar
8
8
  region: string | undefined;
9
9
  } & {
10
10
  name: string;
11
- }, "name"> & {
12
- name: string;
11
+ } & {
12
+ fallback: boolean | undefined;
13
13
  }>;
@@ -1,33 +1,20 @@
1
- import { red } from "colorette";
2
- export const get = (program) => program
3
- .command("get <name>", "Get secret value", (yargs) => yargs.positional("name", {
1
+ export const get = (program) => program.command("get <name>", "Get the value of a secret", (yargs) => yargs
2
+ .positional("name", {
4
3
  type: "string",
5
- describe: "Name of secret",
4
+ describe: "Name of the secret",
6
5
  demandOption: true,
7
- }), async (args) => {
8
- const { Config } = await import("../../../config.js");
9
- const { bold } = await import("colorette");
10
- try {
11
- const result = await Config.getSecret({
12
- key: args.name,
13
- });
14
- console.log(bold(result));
15
- }
16
- catch {
17
- console.log(red(`${bold(args.name)} is not set`));
18
- }
19
6
  })
20
- .command("get-fallback <name>", "Get secret value", (yargs) => yargs.positional("name", {
21
- type: "string",
22
- describe: "Name of secret",
23
- demandOption: true,
7
+ .option("fallback", {
8
+ type: "boolean",
9
+ describe: "Get the fallback value",
24
10
  }), async (args) => {
11
+ const { red } = await import("colorette");
25
12
  const { Config } = await import("../../../config.js");
26
13
  const { bold } = await import("colorette");
27
14
  try {
28
15
  const result = await Config.getSecret({
29
16
  key: args.name,
30
- fallback: true,
17
+ fallback: args.fallback === true,
31
18
  });
32
19
  console.log(bold(result));
33
20
  }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="yargs" />
2
- import { Program } from "../../program.js";
2
+ import type { Program } from "../../program.js";
3
3
  export declare const list: (program: Program) => import("yargs").Argv<{
4
4
  stage: string | undefined;
5
5
  } & {
@@ -7,5 +7,5 @@ export declare const list: (program: Program) => import("yargs").Argv<{
7
7
  } & {
8
8
  region: string | undefined;
9
9
  } & {
10
- format: string;
10
+ format: string | undefined;
11
11
  }>;
@@ -1,8 +1,11 @@
1
- import { Config } from "../../../config.js";
2
- import { gray } from "colorette";
3
- export const list = (program) => program.command("list [format]", "Fetch and decrypt all secrets", yargs => yargs.positional("format", { type: "string", default: "table" }), async (args) => {
1
+ export const list = (program) => program.command("list [format]", "Fetch all the secrets", (yargs) => yargs.positional("format", {
2
+ type: "string",
3
+ choices: ["table", "env"],
4
+ }), async (args) => {
5
+ const { Config } = await import("../../../config.js");
6
+ const { gray } = await import("colorette");
4
7
  const secrets = await Config.secrets();
5
- switch (args.format) {
8
+ switch (args.format || "table") {
6
9
  case "env":
7
10
  for (const [key, value] of Object.entries(secrets)) {
8
11
  console.log(`${key}=${value.value || value.fallback}`);
@@ -10,8 +13,8 @@ export const list = (program) => program.command("list [format]", "Fetch and dec
10
13
  break;
11
14
  case "table":
12
15
  const keys = Object.keys(secrets);
13
- const keyLen = Math.max("Secrets".length, ...keys.map(key => key.length));
14
- const valueLen = Math.max("Values".length, ...keys.map(key => secrets[key].value
16
+ const keyLen = Math.max("Secrets".length, ...keys.map((key) => key.length));
17
+ const valueLen = Math.max("Values".length, ...keys.map((key) => secrets[key].value
15
18
  ? secrets[key].value.length
16
19
  : `${secrets[key].fallback} (fallback)`.length));
17
20
  console.log("┌".padEnd(keyLen + 3, "─") +
@@ -23,7 +26,7 @@ export const list = (program) => program.command("list [format]", "Fetch and dec
23
26
  "┼" +
24
27
  "".padEnd(valueLen + 2, "─") +
25
28
  "┤");
26
- keys.sort().forEach(key => {
29
+ keys.sort().forEach((key) => {
27
30
  const value = secrets[key].value
28
31
  ? secrets[key].value
29
32
  : `${secrets[key].fallback} ${gray("(fallback)")}`;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="yargs" />
2
- import { Program } from "../../program.js";
3
- export declare const remove: (program: Program) => import("yargs").Argv<import("yargs").Omit<{
2
+ import type { Program } from "../../program.js";
3
+ export declare const remove: (program: Program) => import("yargs").Argv<{
4
4
  stage: string | undefined;
5
5
  } & {
6
6
  profile: string | undefined;
@@ -8,6 +8,6 @@ export declare const remove: (program: Program) => import("yargs").Argv<import("
8
8
  region: string | undefined;
9
9
  } & {
10
10
  name: string;
11
- }, "name"> & {
12
- name: string;
11
+ } & {
12
+ fallback: boolean | undefined;
13
13
  }>;
@@ -1,21 +1,16 @@
1
- import { Config } from "../../../config.js";
2
- export const remove = (program) => program
3
- .command("remove <name>", "Remove secret", (yargs) => yargs.positional("name", {
4
- describe: "Name of secret to remove",
1
+ export const remove = (program) => program.command("remove <name>", "Remove a secret", (yargs) => yargs
2
+ .positional("name", {
3
+ describe: "Name of the secret",
5
4
  type: "string",
6
5
  demandOption: true,
7
- }), async (args) => {
8
- await Config.removeSecret({
9
- key: args.name,
10
- });
11
6
  })
12
- .command("remove-fallback <name>", "Remove secret", (yargs) => yargs.positional("name", {
13
- describe: "Name of secret to remove",
14
- type: "string",
15
- demandOption: true,
7
+ .option("fallback", {
8
+ type: "boolean",
9
+ describe: "Remove the fallback value",
16
10
  }), async (args) => {
11
+ const { Config } = await import("../../../config.js");
17
12
  await Config.removeSecret({
18
13
  key: args.name,
19
- fallback: true,
14
+ fallback: args.fallback === true,
20
15
  });
21
16
  });
@@ -1,14 +1,11 @@
1
- import { get } from "./get.js";
2
- import { list } from "./list.js";
3
- import { remove } from "./remove.js";
4
1
  import { set } from "./set.js";
5
2
  export function secrets(program) {
6
- program.command("secrets", "Manage secrets", (yargs) => {
3
+ program.command("secrets", "Manage the secrets in your app", (yargs) => {
7
4
  yargs.demandCommand(1);
8
- remove(yargs);
9
- get(yargs);
10
- list(yargs);
11
5
  set(yargs);
6
+ // get(yargs);
7
+ // list(yargs);
8
+ // remove(yargs);
12
9
  return yargs;
13
10
  });
14
11
  }
@@ -1,6 +1,6 @@
1
1
  /// <reference types="yargs" />
2
- import { Program } from "../../program.js";
3
- export declare const set: (program: Program) => import("yargs").Argv<import("yargs").Omit<import("yargs").Omit<{
2
+ import type { Program } from "../../program.js";
3
+ export declare const set: (program: Program) => import("yargs").Argv<{
4
4
  stage: string | undefined;
5
5
  } & {
6
6
  profile: string | undefined;
@@ -10,8 +10,6 @@ export declare const set: (program: Program) => import("yargs").Argv<import("yar
10
10
  name: string;
11
11
  } & {
12
12
  value: string;
13
- }, "name"> & {
14
- name: string;
15
- }, "value"> & {
16
- value: string;
13
+ } & {
14
+ fallback: boolean | undefined;
17
15
  }>;