Skip to content

Commit

Permalink
fix(deps): update dependencies
Browse files Browse the repository at this point in the history
- pin log4js@6.3.0 until ESM bug is resolved (see oclif/oclif/issues/695)
- remove `generate` command as it was not functional
- add missing/remove redundant dependencies from lerna packages
  • Loading branch information
john-u committed Feb 11, 2022
1 parent 5583bde commit eaf3cd5
Show file tree
Hide file tree
Showing 17 changed files with 1,432 additions and 3,305 deletions.
2 changes: 1 addition & 1 deletion full_clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

rm -rf node_modules packages/*/node_modules
rm -f node_modules packages/*/tsconfig.tsbuildinfo
rm -rf packages/*/dist
rm -rf packages/*/dist packages/cli/lib
rm -rf packages/*/coverage
rm -rf packages/*/dist_bin
4,492 changes: 1,350 additions & 3,142 deletions package-lock.json

Large diffs are not rendered by default.

38 changes: 0 additions & 38 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,6 @@ that map to the API spec.
* [`smartthings edge:drivers:logcat [DRIVERID]`](#smartthings-edgedriverslogcat-driverid)
* [`smartthings edge:drivers:package [PROJECTDIRECTORY]`](#smartthings-edgedriverspackage-projectdirectory)
* [`smartthings edge:drivers:uninstall [DRIVERID]`](#smartthings-edgedriversuninstall-driverid)
* [`smartthings generate:java`](#smartthings-generatejava)
* [`smartthings generate:node`](#smartthings-generatenode)
* [`smartthings installedapps [ID]`](#smartthings-installedapps-id)
* [`smartthings installedapps:delete [ID]`](#smartthings-installedappsdelete-id)
* [`smartthings installedapps:rename [ID] [NAME]`](#smartthings-installedappsrename-id-name)
Expand Down Expand Up @@ -3325,42 +3323,6 @@ DESCRIPTION

_See code: [@smartthings/plugin-cli-edge](https://github.com/SmartThingsCommunity/edge-cli-plugin/blob/v1.7.0/src/commands/edge/drivers/uninstall.ts)_

## `smartthings generate:java`

generate a Java starter app

```
USAGE
$ smartthings generate:java [-h] [-p <value>]
FLAGS
-h, --help Show CLI help.
-p, --profile=<value> [default: default] configuration profile
DESCRIPTION
generate a Java starter app
```

_See code: [src/commands/generate/java.ts](https://github.com/SmartThingsCommunity/smartthings-cli/blob/v0.0.0-pre.36/packages/cli/src/commands/generate/java.ts)_

## `smartthings generate:node`

generate a NodeJS starter app

```
USAGE
$ smartthings generate:node [-h] [-p <value>]
FLAGS
-h, --help Show CLI help.
-p, --profile=<value> [default: default] configuration profile
DESCRIPTION
generate a NodeJS starter app
```

_See code: [src/commands/generate/node.ts](https://github.com/SmartThingsCommunity/smartthings-cli/blob/v0.0.0-pre.36/packages/cli/src/commands/generate/node.ts)_

## `smartthings installedapps [ID]`

get a specific app or a list of apps
Expand Down
44 changes: 20 additions & 24 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,49 +53,45 @@
"lib/**/*.js"
],
"assets": [
"../../node_modules/generator-smartthings",
"../../node_modules/istextorbinary",
"../../node_modules/yarn"
]
},
"dependencies": {
"@oclif/core": "^1.3.2",
"@oclif/core": "^1.3.4",
"@oclif/plugin-autocomplete": "^1.2.0",
"@oclif/plugin-not-found": "^2.3.1",
"@oclif/plugin-plugins": "^2.1.0",
"@smartthings/cli-lib": "^0.0.0-pre.36",
"@smartthings/core-sdk": "^3.3.0",
"@smartthings/plugin-cli-edge": "^1.7.0",
"aws-sdk": "^2.690.0",
"aws-sdk": "^2.1073.0",
"cli-table": "^0.3.11",
"generator-smartthings": "^1.5.0",
"inquirer": "^8.1.2",
"lodash": "^4.17.19",
"open": "^7.0.3",
"yeoman-environment": "^2.9.1"
"inquirer": "^8.2.0",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21"
},
"devDependencies": {
"@smartthings/cli-testlib": "^0.0.0-pre.36",
"@types/cli-table": "^0.3.0",
"@types/inquirer": "^7.3.3",
"@types/jest": "^26.0.14",
"@types/js-yaml": "^3.12.3",
"@types/lodash": "^4.14.157",
"@types/node": "^12.12.67",
"@types/uuid": "^8.3.0",
"@types/yeoman-environment": "^2.3.3",
"@typescript-eslint/eslint-plugin": "^4.4.0",
"@typescript-eslint/parser": "^4.4.0",
"eslint": "^7.14.0",
"@types/inquirer": "^8.2.0",
"@types/jest": "^27.4.0",
"@types/js-yaml": "^4.0.5",
"@types/lodash": "^4.14.178",
"@types/node": "^16.11.24",
"@types/uuid": "^8.3.4",
"@typescript-eslint/eslint-plugin": "^5.11.0",
"@typescript-eslint/parser": "^5.11.0",
"eslint": "^8.8.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.1.3",
"jest": "^26.5.2",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jest": "^26.1.0",
"jest": "^27.5.1",
"jest-extended": "^0.11.5",
"oclif": "^2.4.3",
"oclif": "^2.4.4",
"pkg": "4.4.9",
"ts-jest": "^26.4.1",
"ts-node": "^9.0.0",
"ts-jest": "^27.1.3",
"ts-node": "^10.5.0",
"typescript": "^4.5.4",
"uuid": "^8.3.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default class ConfigCommand extends SmartThingsCommand {
]
const tableFieldDefinitions: TableFieldDefinition<ConfigItem>[] = [
...listTableFieldDefinitions,
{ label: 'Definition', value: (item) => yaml.safeDump(item.data) },
{ label: 'Definition', value: (item) => yaml.dump(item.data) },
]

const outputListConfig = {
Expand Down
13 changes: 0 additions & 13 deletions packages/cli/src/commands/generate/java.ts

This file was deleted.

13 changes: 0 additions & 13 deletions packages/cli/src/commands/generate/node.ts

This file was deleted.

19 changes: 0 additions & 19 deletions packages/cli/src/lib/generate-command.ts

This file was deleted.

53 changes: 27 additions & 26 deletions packages/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,44 +22,45 @@
"directory": "packages/lib"
},
"dependencies": {
"@oclif/core": "^1.3.2",
"@oclif/core": "^1.3.4",
"@smartthings/core-sdk": "^3.3.0",
"@types/eventsource": "^1.1.5",
"@types/eventsource": "^1.1.8",
"axios": "^0.21.4",
"chalk": "^4.1.0",
"chalk": "^4.1.2",
"cli-table": "^0.3.11",
"eventsource": "^1.1.0",
"express": "^4.17.1",
"express": "^4.17.2",
"get-port": "^5.1.1",
"inquirer": "^8.1.2",
"lodash": "^4.17.19",
"log4js": "^6.3.0",
"open": "^7.0.3",
"inquirer": "^8.2.0",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",
"log4js": "6.3.0",
"open": "^8.4.0",
"os-locale": "^5.0.0",
"qs": "^6.9.3"
"qs": "^6.10.3"
},
"devDependencies": {
"@types/cli-table": "^0.3.0",
"@types/express": "^4.17.6",
"@types/inquirer": "^7.3.3",
"@types/jest": "^26.0.14",
"@types/js-yaml": "^3.12.3",
"@types/lodash": "^4.14.157",
"@types/node": "^12.12.67",
"@types/qs": "^6.9.1",
"@types/uuid": "^8.3.0",
"@typescript-eslint/eslint-plugin": "^4.4.0",
"@typescript-eslint/parser": "^4.4.0",
"eslint": "^7.14.0",
"@types/express": "^4.17.13",
"@types/inquirer": "^8.2.0",
"@types/jest": "^27.4.0",
"@types/js-yaml": "^4.0.5",
"@types/lodash": "^4.14.178",
"@types/node": "^16.11.24",
"@types/qs": "^6.9.7",
"@types/uuid": "^8.3.4",
"@typescript-eslint/eslint-plugin": "^5.11.0",
"@typescript-eslint/parser": "^5.11.0",
"eslint": "^8.8.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.1.3",
"jest": "^26.5.2",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jest": "^26.1.0",
"jest": "^27.5.1",
"jest-extended": "^0.11.5",
"mock-stdin": "^1.0.0",
"oclif": "^2.4.3",
"ts-jest": "^26.4.1",
"ts-node": "^9.0.0",
"oclif": "^2.4.4",
"ts-jest": "^27.1.3",
"ts-node": "^10.5.0",
"typescript": "^4.5.4",
"uuid": "^8.3.2"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/lib/src/__tests__/login-authenticator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@ describe('LoginAuthenticator', () => {

logManager.init(config)

const mkdirMock = fs.mkdirSync as jest.Mock<typeof fs.mkdirSync>
const mkdirMock = jest.mocked(fs.mkdirSync)
const readFileMock = (fs.readFileSync as unknown as jest.Mock<Buffer, [fs.PathLike]>)
.mockImplementation(() => { throw { code: 'ENOENT' } })
const writeFileMock = fs.writeFileSync as jest.Mock<typeof fs.writeFileSync>
const chmodMock = fs.chmod as unknown as jest.Mock<void, [PathLike, string | number, NoParamCallback]>

const getPortMock = (getPort as unknown as jest.Mock<Promise<number>, [getPort.Options | undefined]>)
const getPortMock = jest.mocked(getPort)
.mockResolvedValue(7777)
const postMock = (axios.post as unknown as jest.Mock<Promise<AxiosResponse<unknown>>, [string, unknown, AxiosRequestConfig | undefined]>)
.mockResolvedValue(tokenResponse)
Expand Down
24 changes: 14 additions & 10 deletions packages/lib/src/__tests__/user-query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ describe('user-query', () => {
})

describe('askForInteger', () => {
it.each`input | expected
${'-1'} | ${-1}
${'0'} | ${0}
${'7'} | ${7}
${''} | ${undefined}`('returns number entered', async ({ input, expected }) => {
it.each`
input | expected
${'-1'} | ${-1}
${'0'} | ${0}
${'7'} | ${7}
${''} | ${undefined}
`('returns number entered', async ({ input, expected }) => {
promptSpy.mockResolvedValue({ value: input })

const result = await askForInteger('prompt message')
Expand Down Expand Up @@ -161,11 +163,13 @@ describe('user-query', () => {
})

describe('askForNumber', () => {
it.each`input | expected
${'-1'} | ${-1}
${'0'} | ${0}
${'3.141592'} | ${3.141592}
${''} | ${undefined}`('returns number entered', async ({ input, expected }) => {
it.each`
input | expected
${'-1'} | ${-1}
${'0'} | ${0}
${'3.141592'} | ${3.141592}
${''} | ${undefined}
`('returns number entered', async ({ input, expected }) => {
promptSpy.mockResolvedValue({ value: input })

const result = await askForNumber('prompt message')
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/src/cli-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class CLIConfig {
}

if (this._config == null) {
const parsed = yaml.safeLoad(fs.readFileSync(`${this._configFile}`, 'utf-8'))
const parsed = yaml.load(fs.readFileSync(`${this._configFile}`, 'utf-8'))
if (parsed) {
if (typeof parsed === 'object') {
this._config = { ...parsed }
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/src/io-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function formatFromFilename(filename: string): IOFormat {


export function parseJSONOrYAML<T>(rawInputData: string, source: string): T {
const data = yaml.safeLoad(rawInputData)
const data = yaml.load(rawInputData)
if (!data) {
throw Error(`did not get any data from ${source}`)
}
Expand Down
3 changes: 2 additions & 1 deletion packages/lib/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class Log4JSLogger implements APILogger {
}

get level(): string {
// TODO: fixed in log4js >= 6.4.0
// The types are defined for log4js don't match up with the reality
// of what it's returning.
return (this.logger.level as unknown as Level).levelStr
Expand Down Expand Up @@ -129,7 +130,7 @@ export function loadLoggingConfig(configFilename: string, defaultConfig: Logging
return defaultConfig
}

const parsed = yaml.safeLoad(fs.readFileSync(configFilename, 'utf-8'))
const parsed = yaml.load(fs.readFileSync(configFilename, 'utf-8'))
if (parsed && typeof parsed === 'object') {
return parsed as LoggingConfig
}
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/src/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function jsonFormatter<T>(indent: number): OutputFormatter<T> {
}

export function yamlFormatter<T>(indent: number): OutputFormatter<T> {
return (data: T) => yaml.safeDump(data, { indent })
return (data: T) => yaml.dump(data, { indent })
}

export function itemTableFormatter<T>(tableGenerator: TableGenerator,
Expand Down
22 changes: 11 additions & 11 deletions packages/testlib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@
"@smartthings/cli-lib": "^0.0.0-pre.36"
},
"devDependencies": {
"@types/jest": "^26.0.14",
"@types/js-yaml": "^3.12.3",
"@types/node": "^12.12.67",
"@typescript-eslint/eslint-plugin": "^4.4.0",
"@typescript-eslint/parser": "^4.4.0",
"eslint": "^7.14.0",
"@types/jest": "^27.4.0",
"@types/js-yaml": "^4.0.5",
"@types/node": "^16.11.24",
"@typescript-eslint/eslint-plugin": "^5.11.0",
"@typescript-eslint/parser": "^5.11.0",
"eslint": "^8.8.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.1.3",
"jest": "^26.5.2",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jest": "^26.1.0",
"jest": "^27.5.1",
"jest-extended": "^0.11.5",
"ts-jest": "^26.4.1",
"ts-node": "^9.0.0",
"ts-jest": "^27.1.3",
"ts-node": "^10.5.0",
"typescript": "^4.5.4"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ npm ping
# full clean
rm -rf node_modules packages/*/node_modules
rm -f node_modules packages/*/tsconfig.tsbuildinfo
rm -rf packages/*/dist
rm -rf packages/*/dist packages/cli/lib
rm -rf packages/*/dist_bin

# bootstrap
Expand Down

0 comments on commit eaf3cd5

Please sign in to comment.