Skip to content

Commit

Permalink
Bump dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
LitoMore committed Apr 21, 2022
1 parent aede62e commit 651be81
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 17 deletions.
1 change: 1 addition & 0 deletions index.d.ts
Expand Up @@ -197,6 +197,7 @@ export interface Options<Flags extends AnyFlags> {
//}
```
*/
// eslint-disable-next-line @typescript-eslint/ban-types
readonly booleanDefault?: boolean | null | undefined;

/**
Expand Down
5 changes: 4 additions & 1 deletion index.js
@@ -1,4 +1,5 @@
import {dirname} from 'node:path';
import process from 'node:process';
import {fileURLToPath} from 'node:url';
import buildParserOptions from 'minimist-options';
import parseArguments from 'yargs-parser';
Expand Down Expand Up @@ -99,6 +100,7 @@ const validateFlags = (flags, options) => {
}
};

/* eslint complexity: ["error", 25] */
const meow = (helpText, options = {}) => {
if (typeof helpText !== 'string') {
options = helpText;
Expand Down Expand Up @@ -167,7 +169,8 @@ const meow = (helpText, options = {}) => {

normalizePackageData(package_);

process.title = package_.bin ? Object.keys(package_.bin)[0] : package_.name;
// eslint-disable-next-line node/prefer-global/process
global.process.title = package_.bin ? Object.keys(package_.bin)[0] : package_.name;

let {description} = options;
if (!description && description !== false) {
Expand Down
8 changes: 4 additions & 4 deletions package.json
Expand Up @@ -57,11 +57,11 @@
},
"devDependencies": {
"ava": "^3.15.0",
"execa": "^5.1.1",
"execa": "^6.1.0",
"indent-string": "^5.0.0",
"read-pkg": "^6.0.0",
"tsd": "^0.17.0",
"xo": "^0.41.0"
"read-pkg": "^7.1.0",
"tsd": "^0.20.0",
"xo": "^0.48.0"
},
"xo": {
"rules": {
Expand Down
2 changes: 1 addition & 1 deletion test/allow-unkonwn-flags.js
@@ -1,7 +1,7 @@
import path from 'node:path';
import {fileURLToPath} from 'node:url';
import test from 'ava';
import execa from 'execa';
import {execa} from 'execa';

const __dirname = path.dirname(fileURLToPath(import.meta.url));
const fixtureAllowUnknownFlags = path.join(__dirname, 'fixtures', 'fixture-allow-unknown-flags.js');
Expand Down
10 changes: 3 additions & 7 deletions test/fixtures/fixture-required-function.js
Expand Up @@ -23,13 +23,9 @@ const cli = meow({
},
shouldError: {
type: 'boolean',
isRequired: (flags, _) => {
if (flags.allowError) {
return 'should error';
}

return false;
},
isRequired: (flags, _) =>
flags.allowError ? 'should error' : false
,
},
},
});
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/fixture.js
@@ -1,4 +1,5 @@
#!/usr/bin/env node
import process from 'node:process';
import meow from '../../index.js';

const cli = meow({
Expand Down
2 changes: 1 addition & 1 deletion test/is-required-flag.js
@@ -1,7 +1,7 @@
import path from 'node:path';
import {fileURLToPath} from 'node:url';
import test from 'ava';
import execa from 'execa';
import {execa} from 'execa';

const __dirname = path.dirname(fileURLToPath(import.meta.url));
const fixtureRequiredPath = path.join(__dirname, 'fixtures', 'fixture-required.js');
Expand Down
7 changes: 4 additions & 3 deletions test/test.js
@@ -1,9 +1,10 @@
import path from 'node:path';
import process from 'node:process';
import {fileURLToPath} from 'node:url';
import test from 'ava';
import indentString from 'indent-string';
import execa from 'execa';
import {readPackageAsync} from 'read-pkg';
import {execa} from 'execa';
import {readPackage} from 'read-pkg';
import meow from '../index.js';

const __dirname = path.dirname(fileURLToPath(import.meta.url));
Expand Down Expand Up @@ -55,7 +56,7 @@ test('support help shortcut', t => {
});

test('spawn cli and show version', async t => {
const pkg = await readPackageAsync();
const pkg = await readPackage();
const {stdout} = await execa(fixturePath, ['--version']);
t.is(stdout, pkg.version);
});
Expand Down

0 comments on commit 651be81

Please sign in to comment.