diff --git a/.github/funding.yml b/.github/funding.yml deleted file mode 100644 index 15edf6e..0000000 --- a/.github/funding.yml +++ /dev/null @@ -1,4 +0,0 @@ -github: sindresorhus -open_collective: sindresorhus -patreon: sindresorhus -custom: https://sindresorhus.com/donate diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1d4d275..268f715 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,12 +10,12 @@ jobs: fail-fast: false matrix: node-version: + - 16 - 14 - 12 - - 10 steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - run: npm install diff --git a/cli.js b/cli.js index 933e7e2..c3ee0dd 100755 --- a/cli.js +++ b/cli.js @@ -1,10 +1,9 @@ #!/usr/bin/env node -'use strict'; -const meow = require('meow'); -const captureWebsite = require('capture-website'); -const arrify = require('arrify'); -const splitOnFirst = require('split-on-first'); -const getStdin = require('get-stdin'); +import meow from 'meow'; +import captureWebsite from 'capture-website'; +import arrify from 'arrify'; +import splitOnFirst from 'split-on-first'; +import getStdin from 'get-stdin'; const cli = meow(` Usage @@ -81,6 +80,7 @@ const cli = meow(` --inset=10,15,-10,15 --inset=30 `, { + importMeta: import.meta, flags: { output: { type: 'string' @@ -196,6 +196,10 @@ options.modules = options.module; options.scripts = options.script; options.styles = options.style; options.cookies = options.cookie; +delete options.module; +delete options.script; +delete options.style; +delete options.cookie; if (options.launchOptions) { options.launchOptions = JSON.parse(options.launchOptions); diff --git a/package.json b/package.json index 974a069..4335846 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,12 @@ "email": "sindresorhus@gmail.com", "url": "https://sindresorhus.com" }, + "type": "module", "bin": { - "capture-website": "cli.js" + "capture-website": "./cli.js" }, "engines": { - "node": ">=10" + "node": ">=12.20" }, "scripts": { "test": "xo && ava" @@ -40,17 +41,17 @@ "jpg" ], "dependencies": { - "arrify": "^2.0.1", - "capture-website": "^1.4.0", - "get-stdin": "^8.0.0", - "meow": "^7.0.1", - "split-on-first": "^2.0.1" + "arrify": "^3.0.0", + "capture-website": "^2.0.0", + "get-stdin": "^9.0.0", + "meow": "^10.0.0", + "split-on-first": "^3.0.0" }, "devDependencies": { - "ava": "^2.4.0", + "ava": "^3.15.0", "create-test-server": "^3.0.1", "execa": "^5.0.0", "file-type": "^12.4.0", - "xo": "^0.38.1" + "xo": "^0.39.1" } } diff --git a/test.js.md b/test.js.md index 0a26e11..6f4bd0d 100644 --- a/test.js.md +++ b/test.js.md @@ -2,7 +2,7 @@ The actual snapshot is saved in `test.js.snap`. -Generated by [AVA](https://ava.li). +Generated by [AVA](https://avajs.dev). ## check flags @@ -14,9 +14,6 @@ Generated by [AVA](https://ava.li). username: 'username', }, clickElement: 'button', - cookie: [ - 'id=unicorn; Expires=Wed, 21 Oct 2018 07:28:00 GMT;', - ], cookies: [ 'id=unicorn; Expires=Wed, 21 Oct 2018 07:28:00 GMT;', ], @@ -49,11 +46,6 @@ Generated by [AVA](https://ava.li). headless: false, }, listDevices: false, - module: [ - 'https://sindresorhus.com/remote-file.js', - 'local-file.js', - 'document.body.style.backgroundColor = \'red\'', - ], modules: [ 'https://sindresorhus.com/remote-file.js', 'local-file.js', @@ -66,7 +58,9 @@ Generated by [AVA](https://ava.li). 'img.ad', ], scaleFactor: 3, + scripts: [], scrollToElement: '#map', + styles: [], timeout: 80, type: 'jpeg.', userAgent: 'I love unicorns', diff --git a/test.js.snap b/test.js.snap index 8d01165..f65cd15 100644 Binary files a/test.js.snap and b/test.js.snap differ