From 89be2c9f4e0fc4ccb2f5f2abaaf3b592c5a75002 Mon Sep 17 00:00:00 2001 From: Xunnamius Date: Thu, 22 Oct 2020 09:58:43 -0500 Subject: [PATCH] fix: `imports` and `exports` sorted together (#203) * Removed `exports` sort, added `imports` * fix: removed "exports" from sort assertion in tests; rebuilt snapshots --- index.js | 3 ++- tests/fields.js | 1 - tests/snapshots/cli.js.snap | Bin 1851 -> 1842 bytes tests/snapshots/main.js.md | 2 ++ tests/snapshots/main.js.snap | Bin 1197 -> 1204 bytes 5 files changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 298e87dd..a361b034 100755 --- a/index.js +++ b/index.js @@ -192,7 +192,8 @@ const fields = [ /* vscode */ { key: 'publisher' }, { key: 'sideEffects' }, { key: 'type' }, - { key: 'exports', over: sortObject }, + { key: 'imports' }, + { key: 'exports' }, { key: 'main' }, { key: 'umd:main' }, { key: 'jsdelivr' }, diff --git a/tests/fields.js b/tests/fields.js index 75a033b7..72bc18c7 100644 --- a/tests/fields.js +++ b/tests/fields.js @@ -44,7 +44,6 @@ for (const field of [ // fields sort alphabetically for (const field of [ - 'exports', 'bin', 'contributes', 'commitlint', diff --git a/tests/snapshots/cli.js.snap b/tests/snapshots/cli.js.snap index c35203fbbc0279bcc75f1bc3bd9ea6e6409742c6..05b8477cda4378d4f2687502d1c36394eb6e88c8 100644 GIT binary patch literal 1842 zcmV-22hI3FRzVZ-a$0iGd31dK*VU)ESg|TAWk)cxv!9my$ z5QPwu1#}VAAqE7^B)|X%7!<(}h?5{-Bt&2k10qJm=ic6S+wI4x-B$-CdBVN#dG7k2 z-se8=d(Q1#N{EUy*Z$P!+O(3%$(CWa6bHXAKoI}FlMoV~KO*|(r`m19R2AE|$Vb0T z`RE)uAx%3cMym_oU6;Gyz_`N$(`qOm9ikv)zPO>Wn)NQ9fD_LrC`eq^Q2yukNh0+@5#o zgX0q^A3YsQ$jvWKe)MWx?V2xdA8uKGqTwaVN4F0rRXtz4@Dw)nis0B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ehbKhSFVa{g(A~U+>C2Kmw1rw-~4jwZUCEKWn<#t){QL)^tcL z=3Ejt22EAS)G#?tw3Alw8ZFxyGu84q>Rxm>Jsmqk&ebPpU!7mn-h zOv>oqWG+{flwVP69NpVj9o^eyp?mA`bvDjL%VzsNLnizC3@WZ81B}2nc6W9cls|z& zv|P39?(706Z9p2@twoIPEZA-Zdy)ThFLJ=GZ(nom+c+a6PI!H{Pfcw;d{{u4!?_lRN004r2hi?D? diff --git a/tests/snapshots/main.js.md b/tests/snapshots/main.js.md index de757e34..0219785f 100644 --- a/tests/snapshots/main.js.md +++ b/tests/snapshots/main.js.md @@ -53,6 +53,7 @@ Generated by [AVA](https://avajs.dev). "homepage": "homepage",␊ "husky": "husky",␊ "icon": "icon",␊ + "imports": "imports",␊ "jest": "jest",␊ "jsdelivr": "jsdelivr",␊ "jsnext:main": "jsnext:main",␊ @@ -121,6 +122,7 @@ Generated by [AVA](https://avajs.dev). "publisher": "publisher",␊ "sideEffects": "sideEffects",␊ "type": "type",␊ + "imports": "imports",␊ "exports": "exports",␊ "main": "main",␊ "umd:main": "umd:main",␊ diff --git a/tests/snapshots/main.js.snap b/tests/snapshots/main.js.snap index 83b9dd31559490f8894f1293c2aca24e7b3dd579..e0fb37f3e31421d8bec65770e8d281531f0b7401 100644 GIT binary patch literal 1204 zcmV;l1WWrtRzVRTXr(nmQ$H!N0{MvoKIE$ih+~-TDKZ#E+;**~?w>+_N+?nU+=TZD9ia(3u z$Ij>IY5X9Hk1yh5Ae&#X}L<(^Axo?ivHufWq7PC8o1R`y0| zV9`Q$&wz3R;0@dGykXEFF3q?>5-eo7wOqeRv?%e*h6MTu35pw9%ydmuVpzA)DLrl|E0^!8!;r)VteJ{%9O4@svBI)A-O)g6&! zqoR@WE;Ci40_cGNNxbEAP%s6 zyoG~2UV%EHl5;)2cESZc+n5#P@e0jfVEhHY9<}P0>+f^5VL9nNZau6OcnCVXRrZ44 zkpL#~O`7J&qltXAap~%&U;iQD`_R{Q0JN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