From 4a5dfb1b8ace26a4d20cf42f4551b4aef229a24b Mon Sep 17 00:00:00 2001 From: Gao Sun Date: Sat, 8 Oct 2022 17:42:14 +0800 Subject: [PATCH] refactor(cli): per review --- packages/cli/package.json | 3 +-- packages/cli/src/commands/database/{key.ts => config.ts} | 8 ++++---- packages/cli/src/commands/database/index.ts | 6 +++--- 3 files changed, 8 insertions(+), 9 deletions(-) rename packages/cli/src/commands/database/{key.ts => config.ts} (91%) diff --git a/packages/cli/package.json b/packages/cli/package.json index 17ecac537..d03402418 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -7,8 +7,7 @@ "license": "MPL-2.0", "main": "lib/index.js", "bin": { - "logto": "bin/logto", - "lg": "bin/logto" + "logto": "bin/logto" }, "files": [ "bin", diff --git a/packages/cli/src/commands/database/key.ts b/packages/cli/src/commands/database/config.ts similarity index 91% rename from packages/cli/src/commands/database/key.ts rename to packages/cli/src/commands/database/config.ts index ebf82f716..b819f2edd 100644 --- a/packages/cli/src/commands/database/key.ts +++ b/packages/cli/src/commands/database/config.ts @@ -27,8 +27,8 @@ const validateKeys: ValidateKeysFunction = (keys) => { } }; -export const getKey: CommandModule = { - command: 'get-key [keys...]', +export const getConfig: CommandModule = { + command: 'get-config [keys...]', describe: 'Get config value(s) of the given key(s) in Logto database', builder: (yargs) => yargs @@ -67,8 +67,8 @@ export const getKey: CommandModule = { }, }; -export const setKey: CommandModule = { - command: 'set-key ', +export const setConfig: CommandModule = { + command: 'set-config ', describe: 'Set config value of the given key in Logto database', builder: (yargs) => yargs diff --git a/packages/cli/src/commands/database/index.ts b/packages/cli/src/commands/database/index.ts index f7da167e9..086d51193 100644 --- a/packages/cli/src/commands/database/index.ts +++ b/packages/cli/src/commands/database/index.ts @@ -2,7 +2,7 @@ import { CommandModule } from 'yargs'; import { noop } from '../../utilities'; import alteration from './alteration'; -import { getKey, setKey } from './key'; +import { getConfig, setConfig } from './config'; import seed from './seed'; import { getUrl, setUrl } from './url'; @@ -13,8 +13,8 @@ const database: CommandModule = { yargs .command(getUrl) .command(setUrl) - .command(getKey) - .command(setKey) + .command(getConfig) + .command(setConfig) .command(seed) .command(alteration) .demandCommand(1),