diff --git a/.gitignore b/.gitignore index 7ce199a4..49f8cc9a 100644 --- a/.gitignore +++ b/.gitignore @@ -17,10 +17,6 @@ jest-html-reporters-attach jest_html_reporters.html smartthings-*.zip -# the Typescript outDir that oclif prefers -packages/cli/lib -packages/edge/lib - # functional tests .pytest_cache __pycache__ diff --git a/CHANGELOG.md b/CHANGELOG.md index e06fbf99..534e6d23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,7 @@ - All commands now have examples in their help (`smartthings --help`). - args that require enum-like types are now case-insensitive. e.g. For example, you can now list zigbee devices with `smartthings devices --type zigbee`. -- The config file location is now determined by [envPaths](https://www.npmjs.com/package/env-paths) library +- The config file location is now determined by [env-paths](https://www.npmjs.com/package/env-paths) library rather than oclif. A reasonable attempt has been made at finding the old config and copying it for the user so normally no change is needed. (Future changes will need to be made to the new file, of course.) The `config` command now displays the location of the configuration file. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fab606f2..39ffa66f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -57,8 +57,7 @@ commands. Some ground rules to follow when creating or updating commands: * Commands should be kebab case. The module name is used as the command name and can be placed in a topic by placing it in that topic's directory. * Commands should always include a short one-line description that starts with a lowercase letter - and does not end with a period. A more detailed description can be included after a newline. This - description can be split across lines but should not include newlines (oclif will wrap it). + and does not end with a period. More details can be provided in the epilog if necessary. * Flags are also kebab case and should have a short single-character version only if they are expected to be used often. * Descriptions of flags should be short, start with a lowercase letter, and include no ending @@ -68,12 +67,9 @@ commands. Some ground rules to follow when creating or updating commands: * Descriptions for arguments should be a short phrase without a capital letter and without ending punctuation. * Examples of common tasks should be included with a description of the example. - * Use the [object format](https://oclif.io/docs/commands#other-command-options) - rather than the simple string format when providing examples. * When specifying an id in an example, use a representative example id. * One-line descriptions should start with a lowercase letter and not end with a period. - * There is no need to include `$ ` prefix for command examples because oclif includes it - automatically. + * Use `$0` in place of `smartthings` in the example. ### Command Naming @@ -138,7 +134,7 @@ If you are not familiar with SmartThings, we have [extensive online documentation](https://developer.smartthings.com/docs/getting-started/welcome/). To create and manage your services and devices on SmartThings, create an account in the -[developer workspace](https://smartthings.developer.samsung.com/workspace/). +[developer console](https://developer.smartthings.com/console). The [SmartThings Community](https://community.smartthings.com/) is a good place share and ask questions. diff --git a/README.md b/README.md index 27e2b20e..f4fca84c 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ asking you to log in and give the CLI permission to access your account. The CLI will automatically request login as needed. You can also use a personal access token (PAT) for authentication by passing a `--token ` flag to commands or by creating a -[configuration file](https://github.com/SmartThingsCommunity/smartthings-cli/blob/main/packages/cli/doc/configuration.md) +[configuration file](https://github.com/SmartThingsCommunity/smartthings-cli/blob/main/doc/configuration.md) and including the token in a `token` key for your profile. We generally don't recommend this approach since it less secure, given that PATs don't expire unless revoked by the user, but it can be useful when working with headless servers or for users who frequently switch between accounts. @@ -285,4 +285,4 @@ $ SMARTTHINGS_DEBUG=true smartthings ``` More details about advanced configuration and logging in the CLI can be found on the -[configuration documentation page](https://github.com/SmartThingsCommunity/smartthings-cli/blob/master/packages/cli/doc/configuration.md). +[configuration documentation page](https://github.com/SmartThingsCommunity/smartthings-cli/blob/main/doc/configuration.md). diff --git a/doc/configuration.md b/doc/configuration.md index 6d6a589c..85a67776 100644 --- a/doc/configuration.md +++ b/doc/configuration.md @@ -103,10 +103,10 @@ Command line flags always override configuration options. Logging is useful when you are developing the CLI itself or if you need to debug an issue experienced during general use. -By default, a rolling log file will be created at the [OCLIF CLI cache](https://oclif.io/docs/config) directory. -* macOS: `~/Library/Caches/@smartthings/cli` -* Unix: `~/.cache/@smartthings/cli` -* Windows: `%LOCALAPPDATA%\@smartthings\cli` +By default, a rolling log file will be created at the log directory specified by [env-paths](https://www.npmjs.com/package/env-paths) directory. +* macOS: `~/Library/Logs/@smartthings/cli` +* Unix: `~/.local/state/@smartthings/cli` (or `$XDG_STATE_HOME/@smartthings/cli`) +* Windows: `%LOCALAPPDATA%\@smartthings\cli\Log` The CLI uses [log4js](https://log4js-node.github.io/log4js-node/) for logging. diff --git a/src/lib/command/util/installedschema-util.ts b/src/lib/command/util/installedschema-util.ts index 1f47ed9d..e12b16cf 100644 --- a/src/lib/command/util/installedschema-util.ts +++ b/src/lib/command/util/installedschema-util.ts @@ -15,8 +15,6 @@ export const installedSchemaInstances = async ( locationIds: string[] | undefined, options: { verbose: boolean }, ): Promise<(InstalledSchemaApp & WithNamedLocation)[]> => { - // We accept and handle undefined locationIds because that's what we get from oclif even - // though the type is just `string[]`. if (!locationIds || locationIds.length == 0) { locationIds = (await client.locations.list()).map(it => it.locationId) }