Skip to content

Commit

Permalink
Reduce dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcgrtz committed Dec 28, 2021
1 parent 38f497b commit 134c5cf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 54 deletions.
3 changes: 1 addition & 2 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import process from 'node:process';
import meow from 'meow';
import pico from 'picocolors';
import mute from './index.js';

const cli = meow(`
Expand All @@ -19,7 +18,7 @@ if (input.length > 0) {
regex = mute(input);
} else {
const now = new Date().getFullYear();
console.log(`No year provided, assuming you meant ${pico.bold(now)}.`);
console.log(`No year provided, assuming you meant ${now}.`);
regex = mute(now);
}

Expand Down
52 changes: 5 additions & 47 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@
"twitter"
],
"dependencies": {
"meow": "^10.1.2",
"picocolors": "^1.0.0"
"meow": "^10.1.2"
},
"devDependencies": {
"ava": "^3.15.0",
"c8": "^7.10.0",
"execa": "^6.0.0",
"strip-ansi": "^7.0.1",
"xo": "^0.47.0"
}
}
3 changes: 1 addition & 2 deletions test/cli.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import test from 'ava';
import {execa} from 'execa';
import stripAnsi from 'strip-ansi';

const options = {pwd: '../'};

test('Input without value assumes current year', async t => {
const {stdout} = await execa('./cli.js', [], options);
t.assert(stdout.startsWith(stripAnsi(`No year provided, assuming you meant ${new Date().getFullYear()}.`)));
t.assert(stdout.startsWith(`No year provided, assuming you meant ${new Date().getFullYear()}.`));
});

test('Input with invalid value', async t => {
Expand Down

0 comments on commit 134c5cf

Please sign in to comment.