Skip to content

Commit

Permalink
fix: file should stay near dir (#150)
Browse files Browse the repository at this point in the history
* file should stay near dir

* update test by `npm run test -- -u`

* chore: add `update-snapshot` for update snapshot
  • Loading branch information
bluelovers authored and keithamus committed Jan 27, 2020
1 parent f0d2b83 commit 74b1ac1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ const fields = [
over: onArray(contributors => contributors.map(sortPeopleObject)),
},
/* vscode */ { key: 'publisher' },
{ key: 'files', over: uniq },
{ key: 'sideEffects' },
{ key: 'type' },
{ key: 'exports', over: sortObject },
Expand All @@ -201,6 +200,7 @@ const fields = [
{ key: 'bin', over: sortObject },
{ key: 'man' },
{ key: 'directories', over: sortDirectories },
{ key: 'files', over: uniq },
{ key: 'workspaces' },
// node-pre-gyp https://www.npmjs.com/package/node-pre-gyp#1-add-new-entries-to-your-packagejson
{
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,21 @@
},
"license": "MIT",
"author": "Keith Cirkel <[email protected]> (http://keithcirkel.co.uk/)",
"main": "index.js",
"types": "index.d.ts",
"bin": "cli.js",
"files": [
"index.js",
"index.d.ts",
"cli.js"
],
"main": "index.js",
"types": "index.d.ts",
"bin": "cli.js",
"scripts": {
"lint": "eslint .",
"semantic-release": "semantic-release",
"sort-package-json": "node cli.js package.json --check",
"test": "ava",
"test-coverage": "nyc ava"
"test-coverage": "nyc ava",
"update-snapshot": "ava -u && node cli.js package.json"
},
"husky": {
"hooks": {
Expand Down
Binary file modified tests/snapshots/cli.js.snap
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/snapshots/main.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ Generated by [AVA](https://ava.li).
"author": "author",␊
"contributors": "contributors",␊
"publisher": "publisher",␊
"files": "files",␊
"sideEffects": "sideEffects",␊
"type": "type",␊
"exports": "exports",␊
Expand All @@ -133,6 +132,7 @@ Generated by [AVA](https://ava.li).
"bin": "bin",␊
"man": "man",␊
"directories": "directories",␊
"files": "files",␊
"workspaces": "workspaces",␊
"binary": "binary",␊
"scripts": "scripts",␊
Expand Down
Binary file modified tests/snapshots/main.js.snap
Binary file not shown.

0 comments on commit 74b1ac1

Please sign in to comment.