Skip to content

Commit 74b1ac1

Browse files
blueloverskeithamus
authored andcommitted
fix: file should stay near dir (#150)
* file should stay near dir * update test by `npm run test -- -u` * chore: add `update-snapshot` for update snapshot
1 parent f0d2b83 commit 74b1ac1

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ const fields = [
180180
over: onArray(contributors => contributors.map(sortPeopleObject)),
181181
},
182182
/* vscode */ { key: 'publisher' },
183-
{ key: 'files', over: uniq },
184183
{ key: 'sideEffects' },
185184
{ key: 'type' },
186185
{ key: 'exports', over: sortObject },
@@ -201,6 +200,7 @@ const fields = [
201200
{ key: 'bin', over: sortObject },
202201
{ key: 'man' },
203202
{ key: 'directories', over: sortDirectories },
203+
{ key: 'files', over: uniq },
204204
{ key: 'workspaces' },
205205
// node-pre-gyp https://www.npmjs.com/package/node-pre-gyp#1-add-new-entries-to-your-packagejson
206206
{

package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,21 @@
1717
},
1818
"license": "MIT",
1919
"author": "Keith Cirkel <[email protected]> (http://keithcirkel.co.uk/)",
20+
"main": "index.js",
21+
"types": "index.d.ts",
22+
"bin": "cli.js",
2023
"files": [
2124
"index.js",
2225
"index.d.ts",
2326
"cli.js"
2427
],
25-
"main": "index.js",
26-
"types": "index.d.ts",
27-
"bin": "cli.js",
2828
"scripts": {
2929
"lint": "eslint .",
3030
"semantic-release": "semantic-release",
3131
"sort-package-json": "node cli.js package.json --check",
3232
"test": "ava",
33-
"test-coverage": "nyc ava"
33+
"test-coverage": "nyc ava",
34+
"update-snapshot": "ava -u && node cli.js package.json"
3435
},
3536
"husky": {
3637
"hooks": {

tests/snapshots/cli.js.snap

-21 Bytes
Binary file not shown.

tests/snapshots/main.js.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ Generated by [AVA](https://ava.li).
112112
"author": "author",␊
113113
"contributors": "contributors",␊
114114
"publisher": "publisher",␊
115-
"files": "files",␊
116115
"sideEffects": "sideEffects",␊
117116
"type": "type",␊
118117
"exports": "exports",␊
@@ -133,6 +132,7 @@ Generated by [AVA](https://ava.li).
133132
"bin": "bin",␊
134133
"man": "man",␊
135134
"directories": "directories",␊
135+
"files": "files",␊
136136
"workspaces": "workspaces",␊
137137
"binary": "binary",␊
138138
"scripts": "scripts",␊

tests/snapshots/main.js.snap

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)