Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: upgrade dependencies (#85)
* fix: upgrade dependencies

* fix: manage breaking changes of ignore@5

* chore: only install semantic-release in release job

* feat: upgrade more deps

BREAKING CHANGE: requires node 8
  • Loading branch information
azz committed Oct 13, 2019
1 parent 0172f50 commit 116f248
Show file tree
Hide file tree
Showing 8 changed files with 3,113 additions and 2,822 deletions.
13 changes: 11 additions & 2 deletions .babelrc
@@ -1,3 +1,12 @@
{
"presets": [["env", { "targets": { "node": "6.10" } }]]
}
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "6.10"
}
}
]
]
}
6 changes: 3 additions & 3 deletions .travis.yml
Expand Up @@ -6,17 +6,17 @@ cache:
notifications:
email: false
node_js:
- '9'
- '12'
- '10'
- '8'
- '6'
install:
- yarn
script:
- yarn lint
- yarn build
- yarn test
after_success:
- npm install -g travis-deploy-once@4
- npm install -g semantic-release@11 travis-deploy-once@4
- travis-deploy-once "yarn semantic-release"
branches:
except:
Expand Down
46 changes: 26 additions & 20 deletions package.json
Expand Up @@ -7,6 +7,9 @@
"main": "./dist",
"bin": "./bin/pretty-quick.js",
"license": "MIT",
"engines": {
"node": ">=8"
},
"keywords": [
"git",
"mercurial",
Expand All @@ -24,37 +27,40 @@
"img"
],
"dependencies": {
"chalk": "^2.3.0",
"execa": "^0.8.0",
"find-up": "^2.1.0",
"ignore": "^3.3.7",
"mri": "^1.1.0",
"multimatch": "^3.0.0"
"chalk": "^2.4.2",
"execa": "^2.1.0",
"find-up": "^4.1.0",
"ignore": "^5.1.4",
"mri": "^1.1.4",
"multimatch": "^4.0.0"
},
"scripts": {
"prepublishOnly": "yarn build",
"pretty-quick": "./bin/pretty-quick.js",
"build": "babel src -d dist --copy-files --ignore __tests__",
"test": "jest",
"lint": "eslint . --ignore-path=.gitignore",
"semantic-release": "semantic-release",
"precommit": "./bin/pretty-quick.js --staged"
"semantic-release": "semantic-release"
},
"husky": {
"hooks": {
"pre-commit": "./bin/pretty-quick.js --staged"
}
},
"peerDependencies": {
"prettier": ">=1.8.0"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-preset-env": "^1.6.1",
"eslint": "^4.15.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-jest": "^21.5.0",
"eslint-plugin-prettier": "^2.4.0",
"husky": "^0.14.3",
"jest": "^22.0.4",
"mock-fs": "^4.4.2",
"prettier": "1.9.2",
"semantic-release": "^11.0.2"
"@babel/cli": "^7.6 .4",
"@babel/core": "^7.6.4",
"@babel/preset-env": "^7.6.3",
"eslint": "^5.16.0",
"eslint-config-prettier": "^6.4.0",
"eslint-plugin-jest": "^22.19.0",
"eslint-plugin-prettier": "^3.1.1",
"husky": "^3.0.9",
"jest": "^24.9.0",
"mock-fs": "^4.10.1",
"prettier": "1.18.2"
}
}
2 changes: 1 addition & 1 deletion src/__tests__/pretty-quick.test.js
Expand Up @@ -11,7 +11,7 @@ test('throws an error when no vcs is found', () => {
'root/README.md': '',
});

expect(() => prettyQuick('root')).toThrowError(
expect(() => prettyQuick('root')).toThrow(
'Unable to detect a source control manager.'
);
});
3 changes: 2 additions & 1 deletion src/createIgnorer.js
Expand Up @@ -6,9 +6,10 @@ export default (directory, filename = '.prettierignore') => {
const file = join(directory, filename);
if (existsSync(file)) {
const text = readFileSync(file, 'utf8');
return ignore()
const filter = ignore()
.add(text)
.createFilter();
return path => filter(join(path));
}

return () => true;
Expand Down
5 changes: 4 additions & 1 deletion src/scms/git.js
Expand Up @@ -5,7 +5,10 @@ import { dirname } from 'path';
export const name = 'git';

export const detect = directory => {
const gitDirectory = findUp.sync('.git', { cwd: directory });
const gitDirectory = findUp.sync('.git', {
cwd: directory,
type: 'directory',
});
if (gitDirectory) {
return dirname(gitDirectory);
}
Expand Down
5 changes: 4 additions & 1 deletion src/scms/hg.js
Expand Up @@ -5,7 +5,10 @@ import { dirname } from 'path';
export const name = 'hg';

export const detect = directory => {
const hgDirectory = findUp.sync('.hg', { cwd: directory });
const hgDirectory = findUp.sync('.hg', {
cwd: directory,
type: 'directory',
});
if (hgDirectory) {
return dirname(hgDirectory);
}
Expand Down

0 comments on commit 116f248

Please sign in to comment.