@browserless/cli 9.3.5 → 9.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/commands/goto.js +9 -0
- package/src/commands/screenshot.js +6 -2
- package/src/index.js +3 -3
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@browserless/cli",
|
|
3
3
|
"description": "CLI to interact with Browserless capabilities",
|
|
4
4
|
"homepage": "https://browserless.js.org",
|
|
5
|
-
"version": "9.3.
|
|
5
|
+
"version": "9.3.13",
|
|
6
6
|
"bin": {
|
|
7
7
|
"browserless": "src/index.js"
|
|
8
8
|
},
|
|
@@ -32,15 +32,15 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"beauty-error": "~1.2.9",
|
|
35
|
-
"browserless": "^9.3.
|
|
35
|
+
"browserless": "^9.3.13",
|
|
36
36
|
"dark-mode": "~3.0.0",
|
|
37
|
+
"exit-hook": "~2.2.1",
|
|
37
38
|
"kleur": "~4.1.4",
|
|
38
39
|
"lodash": "~4.17.21",
|
|
39
40
|
"meow": "~9.0.0",
|
|
40
41
|
"ora": "~5.4.1",
|
|
41
42
|
"pretty-bytes": "~5.6.0",
|
|
42
43
|
"process-stats": "~3.5.6",
|
|
43
|
-
"signal-exit": "~3.0.6",
|
|
44
44
|
"term-img": "~5.0.0",
|
|
45
45
|
"unique-random-array": "~2.0.0"
|
|
46
46
|
},
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"test": "exit 0"
|
|
56
56
|
},
|
|
57
57
|
"license": "MIT",
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "8cca102a8535176336acac25a78acf2ae7f51b70"
|
|
59
59
|
}
|
|
@@ -42,11 +42,15 @@ module.exports = async ({ url, browserless, opts }) => {
|
|
|
42
42
|
|
|
43
43
|
if (opts.codeScheme === 'ghcolors') {
|
|
44
44
|
const isDark = darkMode.isDark()
|
|
45
|
+
const color = isDark ? '#29BC9B' : '#f81ce5'
|
|
46
|
+
const bg = isDark ? '#000' : '#fff'
|
|
47
|
+
|
|
45
48
|
opts.colorScheme = isDark ? 'dark' : 'light'
|
|
46
49
|
opts.codeScheme = 'ghcolors'
|
|
47
50
|
opts.styles = [
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
`#screenshot .language-js{background-color:${bg}}`,
|
|
52
|
+
`#screenshot .language-js .token{color:${color};font-family:"Roboto Mono";line-height:56px;font-size: 40px}`,
|
|
53
|
+
`#screenshot .language-text{background-color:${bg};color:${color};font-family:"Roboto Mono";line-height:48px;font-size: 32px}`
|
|
50
54
|
]
|
|
51
55
|
}
|
|
52
56
|
|
package/src/index.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
const createBrowserless = require('browserless')
|
|
6
6
|
const beautyError = require('beauty-error')
|
|
7
|
+
const exitHook = require('exit-hook')
|
|
7
8
|
const path = require('path')
|
|
8
9
|
const fs = require('fs')
|
|
9
10
|
|
|
@@ -44,10 +45,9 @@ const run = async () => {
|
|
|
44
45
|
const browserlessFactory = createBrowserless({ headless })
|
|
45
46
|
const browserless = await browserlessFactory.createContext()
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
exitHook(() => browserlessFactory.close())
|
|
48
49
|
|
|
49
|
-
await browserless.
|
|
50
|
-
await browserlessFactory.close()
|
|
50
|
+
const result = await fn({ url, browserless, opts: cli.flags })
|
|
51
51
|
|
|
52
52
|
return result
|
|
53
53
|
}
|