From 74b1ac18a730604ab285b0e7b1176a25d03705b9 Mon Sep 17 00:00:00 2001 From: bluelovers Date: Tue, 28 Jan 2020 05:31:41 +0800 Subject: [PATCH] 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 --- index.js | 2 +- package.json | 9 +++++---- tests/snapshots/cli.js.snap | Bin 1865 -> 1844 bytes tests/snapshots/main.js.md | 2 +- tests/snapshots/main.js.snap | Bin 1125 -> 1125 bytes 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index c873cd50..4d3679eb 100644 --- a/index.js +++ b/index.js @@ -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 }, @@ -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 { diff --git a/package.json b/package.json index 7a5448e7..ef4ced92 100644 --- a/package.json +++ b/package.json @@ -17,20 +17,21 @@ }, "license": "MIT", "author": "Keith Cirkel (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": { diff --git a/tests/snapshots/cli.js.snap b/tests/snapshots/cli.js.snap index 08c5222b10196fce7aefbaa7edb30b5f0902412c..9badae4830e9671b032745801348c80e9a25d7ab 100644 GIT binary patch literal 1844 zcmV-42g~?DRzVXten731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