From 2ed94853ddd2ca4614a82b2a79cc251c09212331 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Wed, 10 May 2017 04:20:57 +0800 Subject: [PATCH] Various minor tweaks --- .editorconfig | 2 +- .gitattributes | 1 + .travis.yml | 2 +- bench/run.js | 4 ++-- cli.js | 1 + lib/babel-config.js | 4 ++-- package.json | 15 ++++++--------- test/api.js | 7 ++++--- test/babel-config.js | 4 ++-- test/beautify-stack.js | 1 + test/cli.js | 4 ++-- 11 files changed, 23 insertions(+), 22 deletions(-) diff --git a/.editorconfig b/.editorconfig index 98a761ddc..1c6314a31 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,6 +7,6 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[{package.json,*.yml}] +[*.yml] indent_style = space indent_size = 2 diff --git a/.gitattributes b/.gitattributes index 59bee062b..c5a6b9cd2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ * text=auto +*.js text eol=lf *.ai binary *.psd binary diff --git a/.travis.yml b/.travis.yml index 769458f75..e4c867c81 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,4 +12,4 @@ before_install: before_script: - 'npm prune' after_success: - - '[ -z "$COVERALLS_REPO_TOKEN" ] && tap --coverage-report=text-lcov | ./node_modules/.bin/coveralls' + - './node_modules/.bin/nyc report --reporter=text-lcov > coverage.lcov && ./node_modules/.bin/codecov' diff --git a/bench/run.js b/bench/run.js index 05176b01e..cfbfdaff0 100644 --- a/bench/run.js +++ b/bench/run.js @@ -3,7 +3,7 @@ const childProcess = require('child_process'); const path = require('path'); const fs = require('fs'); const arrify = require('arrify'); -const mkdirp = require('mkdirp'); +const makeDir = require('make-dir'); const branch = require('git-branch').sync(path.join(__dirname, '..')); const cliPath = require.resolve('../cli'); @@ -124,7 +124,7 @@ Promise.each(combined, definition => { }); }); }).then(() => { - mkdirp.sync(path.join(__dirname, '.results')); + makeDir.sync(path.join(__dirname, '.results')); results['.time'] = Date.now(); fs.writeFileSync( diff --git a/cli.js b/cli.js index 83a6b89e1..1bcdf482a 100755 --- a/cli.js +++ b/cli.js @@ -5,6 +5,7 @@ const debug = require('debug')('ava'); // Prefer the local installation of AVA. const resolveCwd = require('resolve-cwd'); + const localCLI = resolveCwd('ava/cli'); // Use `path.relative()` to detect local AVA installation, diff --git a/lib/babel-config.js b/lib/babel-config.js index 6e0fb1cee..62e841f05 100644 --- a/lib/babel-config.js +++ b/lib/babel-config.js @@ -5,7 +5,7 @@ const chalk = require('chalk'); const figures = require('figures'); const configManager = require('hullabaloo-config-manager'); const md5Hex = require('md5-hex'); -const mkdirp = require('mkdirp'); +const makeDir = require('make-dir'); const colors = require('./colors'); function validate(conf) { @@ -90,7 +90,7 @@ function build(projectDir, cacheDir, userOptions, powerAssert) { const seed = md5Hex([process.versions.node, projectDir]); // Ensure cacheDir exists - mkdirp.sync(cacheDir); + makeDir.sync(cacheDir); // The file names predict where valid options may be cached, and thus should // include the seed. diff --git a/package.json b/package.json index bfc76584b..0daf46131 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,6 @@ "arrify": "^1.0.0", "auto-bind": "^1.1.0", "ava-init": "^0.2.0", - "babel-code-frame": "^6.16.0", "babel-core": "^6.17.0", "bluebird": "^3.0.0", "caching-transform": "^1.0.0", @@ -149,11 +148,11 @@ "lodash.flatten": "^4.2.0", "lodash.isequal": "^4.5.0", "loud-rejection": "^1.2.0", + "make-dir": "^1.0.0", "matcher": "^0.1.1", "md5-hex": "^2.0.0", "meow": "^3.7.0", - "mkdirp": "^0.5.1", - "ms": "^0.7.1", + "ms": "^1.0.0", "multimatch": "^2.1.0", "observable-to-promise": "^0.5.0", "option-chain": "^0.1.0", @@ -174,12 +173,12 @@ "update-notifier": "^2.1.0" }, "devDependencies": { - "babel-preset-react": "^6.5.0", "cli-table2": "^0.2.0", - "coveralls": "^2.11.4", - "delay": "^1.3.0", + "codecov": "^2.1.0", + "del": "^2.2.2", + "delay": "^2.0.0", "execa": "^0.6.0", - "flow-bin": "^0.42.0", + "flow-bin": "^0.45.0", "get-stream": "^3.0.0", "git-branch": "^0.3.0", "has-ansi": "^2.0.0", @@ -188,7 +187,6 @@ "lolex": "^1.4.0", "nyc": "^10.0.0", "proxyquire": "^1.7.4", - "rimraf": "^2.5.0", "signal-exit": "^3.0.0", "sinon": "^2.0.0", "source-map-fixtures": "^2.1.0", @@ -202,7 +200,6 @@ "typings": "types/generated.d.ts", "xo": { "rules": { - "import/newline-after-import": "off", "no-use-extend-native/no-use-extend-native": "off" } }, diff --git a/test/api.js b/test/api.js index e8143b948..d4b1c6151 100644 --- a/test/api.js +++ b/test/api.js @@ -2,9 +2,10 @@ const path = require('path'); const fs = require('fs'); const figures = require('figures'); -const rimraf = require('rimraf'); +const del = require('del'); const test = require('tap').test; const Api = require('../api'); + const testCapitalizerPlugin = require.resolve('./fixture/babel-plugin-test-capitalizer'); const ROOT_DIR = path.join(__dirname, '..'); @@ -658,7 +659,7 @@ function generateTests(prefix, apiCreator) { }); test(`${prefix} caching is enabled by default`, t => { - rimraf.sync(path.join(__dirname, 'fixture/caching/node_modules')); + del.sync(path.join(__dirname, 'fixture/caching/node_modules')); const api = apiCreator({ resolveTestsFrom: path.join(__dirname, 'fixture/caching') @@ -687,7 +688,7 @@ function generateTests(prefix, apiCreator) { }); test(`${prefix} caching can be disabled`, t => { - rimraf.sync(path.join(__dirname, 'fixture/caching/node_modules')); + del.sync(path.join(__dirname, 'fixture/caching/node_modules')); const api = apiCreator({ resolveTestsFrom: path.join(__dirname, 'fixture/caching'), diff --git a/test/babel-config.js b/test/babel-config.js index a12063518..a3b7f0d38 100644 --- a/test/babel-config.js +++ b/test/babel-config.js @@ -2,7 +2,7 @@ const fs = require('fs'); const path = require('path'); const test = require('tap').test; -const mkdirp = require('mkdirp'); +const makeDir = require('make-dir'); const uniqueTempDir = require('unique-temp-dir'); const configManager = require('hullabaloo-config-manager'); @@ -154,7 +154,7 @@ test('updates cached verifier if dependency hashes change', t => { const cacheDir = path.join(projectDir, 'cache'); const depFile = path.join(projectDir, 'plugin.js'); - mkdirp.sync(cacheDir); + makeDir.sync(cacheDir); fs.writeFileSync(depFile, 'foo'); const userOptions = { diff --git a/test/beautify-stack.js b/test/beautify-stack.js index 6a41f0d39..0609d9335 100644 --- a/test/beautify-stack.js +++ b/test/beautify-stack.js @@ -1,6 +1,7 @@ 'use strict'; const proxyquire = require('proxyquire').noPreserveCache(); const test = require('tap').test; + const beautifyStack = proxyquire('../lib/beautify-stack', { debug() { return { diff --git a/test/cli.js b/test/cli.js index 11ecbc0e6..b05d31c2f 100644 --- a/test/cli.js +++ b/test/cli.js @@ -5,7 +5,7 @@ const childProcess = require('child_process'); const test = require('tap').test; const getStream = require('get-stream'); const figures = require('figures'); -const mkdirp = require('mkdirp'); +const makeDir = require('make-dir'); const touch = require('touch'); const proxyquire = require('proxyquire'); const sinon = require('sinon'); @@ -451,7 +451,7 @@ test('workers ensure test files load the same version of ava', t => { // Copy the index.js so the testFile imports it. It should then load the correct AVA install. const targetInstall = path.join(target, 'node_modules/ava'); - mkdirp.sync(targetInstall); + makeDir.sync(targetInstall); fs.writeFileSync( path.join(targetInstall, 'index.js'), fs.readFileSync(path.join(__dirname, '../index.js'))