Skip to content

Commit 9c592f5

Browse files
authored
Merge pull request #14 from ferocia/cleanup-dependencies
Cleanup dependencies
2 parents 39198cb + 52429d0 commit 9c592f5

9 files changed

+99
-198
lines changed

.prettierrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "es5"
4+
}

package.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,18 @@
55
},
66
"dependencies": {
77
"execa": "^6.1.0",
8-
"minimist": "^1.2.0",
9-
"pify": "^3.0.0",
10-
"tempfile": "^2.0.0",
11-
"which": "^1.2.14"
8+
"minimist": "^1.2.7",
9+
"tempy": "^3.0.0",
10+
"which": "^3.0.0"
1211
},
1312
"description": "A CLI for grabbing ios/android screenshots and saving to your clipboard or filesystem.",
1413
"devDependencies": {
15-
"@types/minimist": "^1.2.0",
16-
"@types/node": "^18.11.13",
17-
"@types/pify": "^0.0.28",
18-
"@types/tempfile": "^1.1.5",
19-
"@types/which": "^1.0.28",
14+
"@types/minimist": "^1.2.2",
15+
"@types/node": "^18.11.14",
16+
"@types/which": "^2.0.1",
2017
"np": "^7.6.2",
21-
"prettier": "^1.4.2",
22-
"rimraf": "^2.6.1",
23-
"tslint": "^5.4.2",
18+
"prettier": "^2.8.1",
19+
"rimraf": "^3.0.2",
2420
"typescript": "^4.9.4"
2521
},
2622
"files": [
@@ -36,6 +32,10 @@
3632
],
3733
"license": "MIT",
3834
"name": "@ferocia-oss/osnap",
35+
"np": {
36+
"yarn": true,
37+
"branch": "main"
38+
},
3939
"private": false,
4040
"publishConfig": {
4141
"access": "public"

src/android.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { CliParameters } from './cli-parameters'
22
import { ErrorCode, createError } from './errors'
3-
import { which } from './which'
4-
import * as execa from 'execa'
3+
import which from 'which'
4+
import {execa} from 'execa'
55
import { existsSync, createWriteStream } from 'fs'
66

77
/**

src/cli-parameters.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as minimist from 'minimist'
1+
import minimist from 'minimist'
22
import { createError, ErrorCode } from './errors'
3-
import * as tempfile from 'tempfile'
3+
import {temporaryFile} from 'tempy';
44

55
export type Platform = 'ios' | 'android'
66

@@ -52,7 +52,7 @@ export function parse(argv?: string[]): CliParameters {
5252
// grab what we need
5353
const platform = getPlatform(parsed)
5454
const useClipboard = !parsed['f']
55-
const filename = (parsed['f'] as string) || tempfile('.png')
55+
const filename = (parsed['f'] as string) || temporaryFile({extension: 'png'});
5656
const device = parsed['d'] as string
5757

5858
return { platform, filename, device, useClipboard }

src/copy-to-clipboard.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as execa from 'execa'
1+
import {execa} from 'execa'
22
import { ErrorCode, createError } from './errors'
33
import { resolve } from 'path'
44

src/ios.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { CliParameters } from './cli-parameters'
2-
import { which } from './which'
2+
import which from 'which'
33
import { ErrorCode, createError } from './errors'
4-
import * as execa from 'execa'
4+
import {execa} from 'execa'
55

66
/**
77
* Finds the path to xcrun or throws an error.
@@ -57,10 +57,7 @@ export async function checkSimulator(xcrunPath: string, device?: string): Promis
5757
*/
5858
export async function saveScreenshot(xcrunPath: string, device: string, filename: string) {
5959
try {
60-
const response = await execa(xcrunPath, ['simctl', 'io', device, 'screenshot', filename])
61-
if (response.code !== 0) {
62-
throw createError(ErrorCode.ScreenshotFail)
63-
}
60+
await execa(xcrunPath, ['simctl', 'io', device, 'screenshot', filename])
6461
} catch (err) {
6562
throw createError(ErrorCode.ScreenshotFail)
6663
}

src/which.ts

-14
This file was deleted.

tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
"noImplicitAny": false,
77
"noImplicitThis": true,
88
"noUnusedLocals": true,
9+
"esModuleInterop": true,
910
"pretty": true,
1011
"target": "es5",
1112
"lib": ["es2015"],
1213
"typeRoots": [
1314
"node_modules/@types"
1415
]
1516
}
16-
}
17+
}

0 commit comments

Comments
 (0)