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/giant-poems-reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@smartthings/cli": patch
"@smartthings/cli-lib": patch
---

replace usage of lodash with native ES or separate lodash modules
114 changes: 75 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,19 @@
"@oclif/plugin-not-found": "^2.3.1",
"@oclif/plugin-plugins": "^2.1.0",
"@smartthings/cli-lib": "^1.0.0-beta.0",
"@smartthings/core-sdk": "^3.4.0",
"@smartthings/core-sdk": "^3.4.1",
"@smartthings/plugin-cli-edge": "^1.10.1",
"aws-sdk": "^2.1073.0",
"cli-table": "^0.3.11",
"inquirer": "^8.2.0",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21"
"js-yaml": "^4.1.0"
},
"devDependencies": {
"@smartthings/cli-testlib": "^1.0.0-beta.1",
"@types/cli-table": "^0.3.0",
"@types/inquirer": "^8.2.0",
"@types/jest": "^27.4.1",
"@types/js-yaml": "^4.0.5",
"@types/lodash": "^4.14.178",
"@types/node": "^16.11.24",
"@typescript-eslint/eslint-plugin": "^5.11.0",
"@typescript-eslint/parser": "^5.11.0",
Expand Down
5 changes: 2 additions & 3 deletions packages/cli/src/commands/apps/register.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import _ from 'lodash'
import { App, AppType } from '@smartthings/core-sdk'
import { APICommand, selectFromList, SelectingConfig } from '@smartthings/cli-lib'

Expand All @@ -24,10 +23,10 @@ export default class AppRegisterCommand extends APICommand {
}
const id = await selectFromList<App>(this, config, {
preselectedId: args.id,
listItems: async () => _.flatten(await Promise.all([
listItems: async () => (await Promise.all([
this.client.apps.list({ appType: AppType.WEBHOOK_SMART_APP }),
this.client.apps.list({ appType: AppType.API_ONLY }),
])),
])).flat(),
promptMessage: 'Select an app to register.',
})
await this.client.apps.register(id),
Expand Down
10 changes: 4 additions & 6 deletions packages/cli/src/commands/installedschema.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import _ from 'lodash'

import { Flags } from '@oclif/core'

import { InstalledSchemaApp, SmartThingsClient } from '@smartthings/core-sdk'
Expand All @@ -20,18 +18,18 @@ export async function installedSchemaInstances(client: SmartThingsClient, locati
locationIds = (await client.locations.list()).map(it => it.locationId)
}

const isas = _.flatten(await Promise.all(locationIds.map(async (locationId) => {
const installedApps = (await Promise.all(locationIds.map(async (locationId) => {
try {
return (await client.schema.installedApps(locationId))
} catch(e) {
return []
}
})))
}))).flat()

if (verbose) {
return await withLocations(client, isas)
return await withLocations(client, installedApps)
}
return isas
return installedApps
}

export default class InstalledSchemaAppsCommand extends APICommand {
Expand Down
6 changes: 3 additions & 3 deletions packages/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"dependencies": {
"@oclif/core": "^1.5.1",
"@smartthings/core-sdk": "^3.4.0",
"@smartthings/core-sdk": "^3.4.1",
"@types/eventsource": "^1.1.8",
"axios": "^0.21.4",
"chalk": "^4.1.2",
Expand All @@ -39,7 +39,7 @@
"get-port": "^5.1.1",
"inquirer": "^8.2.0",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",
"lodash.at": "^4.6.0",
"log4js": "6.3.0",
"open": "^8.4.0",
"os-locale": "^5.0.0",
Expand All @@ -51,7 +51,7 @@
"@types/inquirer": "^8.2.0",
"@types/jest": "^27.4.1",
"@types/js-yaml": "^4.0.5",
"@types/lodash": "^4.14.178",
"@types/lodash.at": "^4.6.6",
"@types/node": "^16.11.24",
"@types/qs": "^6.9.7",
"@typescript-eslint/eslint-plugin": "^5.11.0",
Expand Down
Loading