Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/sixty-days-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@smartthings/cli": patch
"@smartthings/cli-lib": patch
---

bump @smartthings/plugin-cli-edge to support newer oclif/core version
939 changes: 365 additions & 574 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
"packages/cli"
],
"devDependencies": {
"@changesets/changelog-github": "^0.4.5",
"@changesets/cli": "^2.23.2",
"@changesets/release-utils": "^0.1.8",
"@changesets/changelog-github": "^0.4.6",
"@changesets/cli": "^2.24.2",
"@changesets/release-utils": "^0.1.10",
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"cz-conventional-changelog": "^3.3.0",
Expand Down
12 changes: 12 additions & 0 deletions packages/cli/functional-tests/tests/help_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from pexpect.popen_spawn import PopenSpawn


def test_help_output():
process = PopenSpawn('smartthings --help')

# expect at least some critical commands present in the TOPICS output
# failures here could signal an issue in the build process
process.expect('deviceprofiles')
process.expect('devices')
process.expect('edge')
process.expect('locations')
6 changes: 3 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@
]
},
"dependencies": {
"@oclif/core": "1.9.6",
"@oclif/core": "^1.13.10",
"@oclif/plugin-autocomplete": "^1.3.0",
"@oclif/plugin-not-found": "^2.3.1",
"@oclif/plugin-plugins": "^2.1.0",
"@smartthings/cli-lib": "^1.0.0-beta.12",
"@smartthings/core-sdk": "^5.1.1",
"@smartthings/plugin-cli-edge": "^1.14.1",
"@smartthings/plugin-cli-edge": "^1.15.1",
"aws-sdk": "^2.1175.0",
"inquirer": "^8.2.4",
"js-yaml": "^4.1.0",
Expand All @@ -92,7 +92,7 @@
"eslint-plugin-jest": "^26.6.0",
"jest": "^28.1.3",
"jest-extended": "^0.11.5",
"oclif": "^3.1.0",
"oclif": "^3.1.2",
"pkg": "^5.8.0",
"rimraf": "^3.0.2",
"ts-jest": "^28.0.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ describe('devices-util', () => {
expect(buildTableOutput(tableGeneratorMock, device))
.toEqual('Main Info\nmain table\n\nDevice Integration Info (from virtual)\nvirtual device info\n\n' + summarizedText)

expect(tablePushMock).toHaveBeenCalledTimes(9)
expect(tablePushMock).toHaveBeenCalledTimes(8)
expect(buildTableFromItemMock).toHaveBeenCalledTimes(1)
expect(buildTableFromItemMock).toHaveBeenCalledWith(virtual,
['name', { prop: 'hubId', skipEmpty: true }, { prop: 'driverId', skipEmpty: true }])
Expand Down
4 changes: 2 additions & 2 deletions packages/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"dependencies": {
"@log4js-node/log4js-api": "^1.0.2",
"@oclif/core": "1.9.6",
"@oclif/core": "^1.13.10",
"@smartthings/core-sdk": "^5.1.1",
"@types/eventsource": "^1.1.9",
"axios": "^0.21.4",
Expand Down Expand Up @@ -64,7 +64,7 @@
"jest-extended": "^0.11.5",
"log4js": "^6.6.0",
"mock-stdin": "^1.0.0",
"oclif": "^3.1.0",
"oclif": "^3.1.2",
"rimraf": "^3.0.2",
"ts-jest": "^28.0.6",
"ts-node": "^10.9.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/src/__tests__/api-command.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('api-command', () => {
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
async parse(options?: Interfaces.Input<any>, argv?: string[]): Promise<Interfaces.ParserOutput<any, any>> {
async parse(options?: Interfaces.Input<any, any>, argv?: string[]): Promise<Interfaces.ParserOutput<any, any, any>> {
return {
flags: {},
args: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('APIOrganizationCommand', () => {
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
async parse(options?: Interfaces.Input<any>, argv?: string[]): Promise<Interfaces.ParserOutput<any, any>> {
async parse(options?: Interfaces.Input<any, any>, argv?: string[]): Promise<Interfaces.ParserOutput<any, any, any>> {
return {
flags: {},
args: {},
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/src/__tests__/smartthings-command.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('SmartThingsCommand', () => {
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
async parse(options?: Interfaces.Input<any>, argv?: string[]): Promise<Interfaces.ParserOutput<any, any>> {
async parse(options?: Interfaces.Input<any, any>, argv?: string[]): Promise<Interfaces.ParserOutput<any, any, any>> {
return {
flags: {},
args: {},
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/src/__tests__/sse-command.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('SseCommand', () => {
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
async parse(options?: Interfaces.Input<any>, argv?: string[]): Promise<Interfaces.ParserOutput<any, any>> {
async parse(options?: Interfaces.Input<any, any>, argv?: string[]): Promise<Interfaces.ParserOutput<any, any, any>> {
return {
flags: {},
args: {},
Expand Down
6 changes: 4 additions & 2 deletions packages/lib/src/smartthings-command.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import log4js from '@log4js-node/log4js-api'
import { Command, Flags, Interfaces } from '@oclif/core'
import { Input } from '@oclif/core/lib/interfaces'
import { CLIConfig, loadConfig, Profile } from './cli-config'
import { outputFlags } from './output-builder'
import { DefaultTableGenerator, TableGenerator } from './table-generator'
Expand Down Expand Up @@ -63,6 +64,7 @@ export interface SmartThingsCommandInterface extends Loggable {

/**
* This is needed to get type safety working in derived classes.
* See https://github.com/oclif/oclif.github.io/pull/142
*/
export type InferredFlagsType<T> = T extends Interfaces.FlagInput<infer F>
? F & {
Expand Down Expand Up @@ -182,10 +184,10 @@ export abstract class SmartThingsCommand<T extends InputFlags> extends Command i

this._logger = log4js.getLogger(`cli.${this.ctor.name}`)

const { args, argv, flags } = await this.parse(this.ctor)
const { args, argv, flags } = await this.parse(this.ctor as Input<T, typeof SmartThingsCommand.globalFlags>)
this._args = args
this._argv = argv
this._flags = flags
this._flags = flags as unknown as InferredFlagsType<T>

this._profileName = this.flags.profile || 'default'

Expand Down