Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
Closes GH-29.

These major versions are related to packages moving to ESM or dropping
support for older Node.js versions.

A breaking change is that camelcase now converts `'_'` to `''`.
This only affects `unified-args` internals.
  • Loading branch information
remcohaszing authored Jun 18, 2022
1 parent 0a8f8cd commit f3579f8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lib/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export function options(flags, configuration) {
processor: configuration.processor,
help: config.help,
version: config.version,
files: config._,
files: config[''],
filePath: config.filePath,
watch: config.watch,
extensions: ext.length === 0 ? configuration.extensions : ext,
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
],
"dependencies": {
"@types/text-table": "^0.2.0",
"camelcase": "^6.0.0",
"chalk": "^4.0.0",
"camelcase": "^7.0.0",
"chalk": "^5.0.0",
"chokidar": "^3.0.0",
"fault": "^2.0.0",
"json5": "^2.0.0",
Expand All @@ -46,11 +46,11 @@
"@types/touch": "^3.0.0",
"bail": "^2.0.0",
"c8": "^7.0.0",
"execa": "^5.0.0",
"execa": "^6.0.0",
"prettier": "^2.0.0",
"remark": "^14.0.0",
"remark-cli": "^10.0.0",
"remark-preset-wooorm": "^8.0.0",
"remark-preset-wooorm": "^9.0.0",
"rimraf": "^3.0.0",
"strip-ansi": "^7.0.0",
"tape": "^5.0.0",
Expand All @@ -59,7 +59,7 @@
"typescript": "^4.0.0",
"unified": "^10.0.0",
"vfile-reporter-json": "^3.0.0",
"xo": "^0.44.0"
"xo": "^0.50.0"
},
"scripts": {
"build": "rimraf \"lib/**/*.d.ts\" \"test/**/*.d.ts\" && tsc && type-coverage",
Expand Down
32 changes: 18 additions & 14 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
/**
* @typedef {import('execa').ExecaReturnValue} ExecaReturnValue
*/

import fs from 'node:fs'
import path from 'node:path'
import process from 'node:process'
import execa from 'execa'
import {execa} from 'execa'
import {bail} from 'bail'
import test from 'tape'
import strip from 'strip-ansi'
Expand All @@ -28,7 +32,7 @@ test('unified-args', (t) => {

execa(bin, ['missing.txt']).then(
() => t.fail(),
(/** @type {execa.ExecaReturnValue} */ error) => {
(/** @type {ExecaReturnValue} */ error) => {
t.deepEqual(
[error.exitCode, strip(error.stderr)],
[1, expected],
Expand Down Expand Up @@ -125,7 +129,7 @@ test('unified-args', (t) => {

execa(bin, ['-n']).then(
() => t.fail(),
(/** @type {execa.ExecaReturnValue} */ error) => {
(/** @type {ExecaReturnValue} */ error) => {
t.deepEqual(
[error.exitCode, strip(error.stderr)],
[1, expected],
Expand All @@ -145,7 +149,7 @@ test('unified-args', (t) => {

execa(bin, ['-on']).then(
() => t.fail(),
(/** @type {execa.ExecaReturnValue} */ error) => {
(/** @type {ExecaReturnValue} */ error) => {
t.deepEqual(
[error.exitCode, strip(error.stderr)],
[1, expected],
Expand All @@ -165,7 +169,7 @@ test('unified-args', (t) => {

execa(bin, ['--no']).then(
() => t.fail(),
(/** @type {execa.ExecaReturnValue} */ error) => {
(/** @type {ExecaReturnValue} */ error) => {
t.deepEqual(
[error.exitCode, strip(error.stderr)],
[1, expected],
Expand Down Expand Up @@ -290,7 +294,7 @@ test('unified-args', (t) => {

execa(bin, ['.', flag]).then(
() => t.fail(),
(/** @type {execa.ExecaReturnValue} */ error) => {
(/** @type {ExecaReturnValue} */ error) => {
t.deepEqual(
[error.stdout, error.stderr],
['', expected],
Expand Down Expand Up @@ -337,7 +341,7 @@ test('unified-args', (t) => {
// Should be quoted.
execa(bin, ['.', flag, 'foo:bar']).then(
() => t.fail(),
(/** @type {execa.ExecaReturnValue} */ error) => {
(/** @type {ExecaReturnValue} */ error) => {
t.deepEqual(
[error.exitCode, strip(error.stderr)],
[1, expected],
Expand Down Expand Up @@ -416,7 +420,7 @@ test('unified-args', (t) => {
// Should be quoted.
execa(bin, ['.', flag, './plugin.js=foo:bar']).then(
() => t.fail(),
(/** @type {execa.ExecaReturnValue} */ error) => {
(/** @type {ExecaReturnValue} */ error) => {
t.deepEqual(
[error.exitCode, strip(error.stderr)],
[1, expected],
Expand Down Expand Up @@ -495,7 +499,7 @@ test('unified-args', (t) => {

execa(bin, ['.', '--report']).then(
() => t.fail(),
(/** @type {execa.ExecaReturnValue} */ error) => {
(/** @type {ExecaReturnValue} */ error) => {
t.deepEqual(
[error.exitCode, error.stderr],
[1, 'Error: Missing value: --report <reporter> specify reporter'],
Expand Down Expand Up @@ -604,7 +608,7 @@ test('unified-args', (t) => {

execa(bin, ['one.txt', 'two.txt', '--ignore-pattern', 'one.txt']).then(
() => t.fail(),
(/** @type {execa.ExecaReturnValue} */ error) => {
(/** @type {ExecaReturnValue} */ error) => {
t.deepEqual(
[error.exitCode, strip(error.stderr)],
[1, expected],
Expand Down Expand Up @@ -659,7 +663,7 @@ test('unified-args', (t) => {

setTimeout(seeYouLaterAlligator, delay)

function onsuccess(/** @type {execa.ExecaReturnValue} */ result) {
function onsuccess(/** @type {ExecaReturnValue} */ result) {
resolved = true
fs.unlinkSync(doc)
t.deepEqual(
Expand Down Expand Up @@ -714,7 +718,7 @@ test('unified-args', (t) => {

setTimeout(seeYouLaterAlligator, delay)

function onsuccess(/** @type {execa.ExecaReturnValue} */ result) {
function onsuccess(/** @type {ExecaReturnValue} */ result) {
resolved = true

fs.unlinkSync(doc)
Expand Down Expand Up @@ -748,7 +752,7 @@ test('unified-args', (t) => {

execa(bin, ['-w']).then(
() => t.fail(),
(/** @type {execa.ExecaReturnValue} */ error) => {
(/** @type {ExecaReturnValue} */ error) => {
const actual = strip(error.stderr).split('\n').slice(0, 2).join('\n')

t.deepEqual([error.exitCode, actual], [1, expected], 'should fail')
Expand All @@ -764,7 +768,7 @@ test('unified-args', (t) => {

execa(bin, ['.', '-u', './plugin.js']).then(
() => t.fail(),
(/** @type {execa.ExecaReturnValue} */ error) => {
(/** @type {ExecaReturnValue} */ error) => {
t.deepEqual(
[error.exitCode, strip(error.stderr)],
[1, expected],
Expand Down

0 comments on commit f3579f8

Please sign in to comment.