@pob/sort-pkg 3.1.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintrc.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "root": true,
3
- "extends": ["@pob/eslint-config/root-commonjs"]
3
+ "extends": ["@pob/eslint-config/root-module"]
4
4
  }
package/CHANGELOG.md CHANGED
@@ -3,6 +3,56 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.0.1](https://github.com/christophehurpeau/pob/compare/@pob/sort-pkg@4.0.0...@pob/sort-pkg@4.0.1) (2021-12-12)
7
+
8
+
9
+ ### Reverts
10
+
11
+ * fix: go back to commonjs modules for yarn pnp compatibility ([4e943b6](https://github.com/christophehurpeau/pob/commit/4e943b65ac843b6900aa4f86294f13b8fb18a0e8))
12
+
13
+
14
+
15
+
16
+
17
+ # [4.0.0](https://github.com/christophehurpeau/pob/compare/@pob/sort-pkg@3.3.0...@pob/sort-pkg@4.0.0) (2021-12-11)
18
+
19
+
20
+ ### Features
21
+
22
+ * drop node 12 ([2f32308](https://github.com/christophehurpeau/pob/commit/2f32308b06ca74d0deb3355707e3082fa73e25dc))
23
+
24
+
25
+ ### BREAKING CHANGES
26
+
27
+ * requires node 14
28
+
29
+
30
+
31
+
32
+
33
+ # [3.3.0](https://github.com/christophehurpeau/pob/compare/@pob/sort-pkg@3.2.0...@pob/sort-pkg@3.3.0) (2021-11-11)
34
+
35
+
36
+ ### Features
37
+
38
+ * improve npmignore ([b47706a](https://github.com/christophehurpeau/pob/commit/b47706af4f9be4f8103ec1306879bbd0a6989e6b))
39
+
40
+
41
+
42
+
43
+
44
+ # [3.2.0](https://github.com/christophehurpeau/pob/compare/@pob/sort-pkg@3.1.0...@pob/sort-pkg@3.2.0) (2021-09-05)
45
+
46
+
47
+ ### Features
48
+
49
+ * **@pob/sort-pkg:** add packageManager ([aaad4c9](https://github.com/christophehurpeau/pob/commit/aaad4c9d309d211d5f84ba19b0b8c70b48741483))
50
+ * **@pob/sort-pkg:** add resolutionsExplained and move resolutions up ([a5cd595](https://github.com/christophehurpeau/pob/commit/a5cd59535932f8fc7d7696b9da91728926b3fae6))
51
+
52
+
53
+
54
+
55
+
6
56
  # [3.1.0](https://github.com/christophehurpeau/pob/compare/@pob/sort-pkg@3.0.0...@pob/sort-pkg@3.1.0) (2021-08-10)
7
57
 
8
58
 
@@ -1,4 +1,20 @@
1
1
  {
2
2
  "root": true,
3
- "extends": ["@pob/eslint-config/node-commonjs"]
3
+ "extends": ["@pob/eslint-config/node-module"],
4
+ "overrides": [
5
+ {
6
+ "files": ["**/*.test.{cjs,js}", "__tests__/**/*.{cjs,js}"],
7
+ "env": {
8
+ "jest": true
9
+ },
10
+ "rules": {
11
+ "import/no-extraneous-dependencies": [
12
+ "error",
13
+ {
14
+ "devDependencies": true
15
+ }
16
+ ]
17
+ }
18
+ }
19
+ ]
4
20
  }
package/lib/index.js CHANGED
@@ -1,10 +1,8 @@
1
1
  /* eslint-disable complexity */
2
2
 
3
- 'use strict';
3
+ import sortObject from '@pob/sort-object';
4
4
 
5
- const sortObject = require('@pob/sort-object');
6
-
7
- module.exports = function sortPkg(pkg) {
5
+ export default function sortPkg(pkg) {
8
6
  sortObject(pkg, [
9
7
  'name',
10
8
  'private',
@@ -23,6 +21,7 @@ module.exports = function sortPkg(pkg) {
23
21
  'engineStrict',
24
22
  'os',
25
23
  'cpu',
24
+ /* yarn berry */ 'packageManager',
26
25
  'publishConfig',
27
26
  'workspaces',
28
27
  'browserslist',
@@ -65,19 +64,22 @@ module.exports = function sortPkg(pkg) {
65
64
  'stylelint',
66
65
  'jest',
67
66
  'pob',
67
+ 'resolutions',
68
+ 'resolutionsExplained',
68
69
  'peerDependencies',
69
70
  'peerDependenciesMeta',
70
71
  'devPeerDependencies',
71
72
  'dependencies',
72
73
  'devDependencies',
73
74
  'dependenciesMeta',
75
+ 'optionalDependencies',
74
76
  'bundledDependencies',
75
77
  'bundleDependencies',
76
- 'optionalDependencies',
77
- 'resolutions',
78
78
  ]);
79
79
 
80
80
  if (pkg.scripts) sortObject(pkg.scripts);
81
+ if (pkg.resolutions) sortObject(pkg.resolutions);
82
+ if (pkg.resolutionsExplained) sortObject(pkg.resolutionsExplained);
81
83
  if (pkg.peerDependencies) sortObject(pkg.peerDependencies);
82
84
  if (pkg.devPeerDependencies) sortObject(pkg.devPeerDependencies);
83
85
  if (pkg.dependencies) sortObject(pkg.dependencies);
@@ -85,7 +87,6 @@ module.exports = function sortPkg(pkg) {
85
87
  if (pkg.bundledDependencies) sortObject(pkg.bundledDependencies);
86
88
  if (pkg.bundleDependencies) sortObject(pkg.bundleDependencies);
87
89
  if (pkg.optionalDependencies) sortObject(pkg.optionalDependencies);
88
- if (pkg.resolutions) sortObject(pkg.resolutions);
89
90
 
90
91
  return pkg;
91
- };
92
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pob/sort-pkg",
3
- "version": "3.1.0",
3
+ "version": "4.0.1",
4
4
  "description": "sort package.json",
5
5
  "keywords": [],
6
6
  "author": "Christophe Hurpeau <christophe@hurpeau.com> (https://christophe.hurpeau.com)",
@@ -11,9 +11,9 @@
11
11
  "directory": "@pob/sort-pkg"
12
12
  },
13
13
  "homepage": "https://github.com/christophehurpeau/pob",
14
- "type": "commonjs",
14
+ "type": "module",
15
15
  "engines": {
16
- "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
16
+ "node": "^14.13.1 || >=16.0.0"
17
17
  },
18
18
  "publishConfig": {
19
19
  "access": "public"
@@ -26,7 +26,7 @@
26
26
  "sideEffects": false,
27
27
  "scripts": {
28
28
  "lint": "yarn run lint:eslint",
29
- "lint:eslint": "yarn --cwd ../.. run eslint --report-unused-disable-directives --quiet @pob/sort-pkg"
29
+ "lint:eslint": "cd ../.. && yarn run eslint --report-unused-disable-directives --resolve-plugins-relative-to . --quiet @pob/sort-pkg"
30
30
  },
31
31
  "prettier": {
32
32
  "trailingComma": "all",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "pob": {},
37
37
  "dependencies": {
38
- "@pob/sort-object": "^3.1.0"
38
+ "@pob/sort-object": "^4.0.1"
39
39
  },
40
- "gitHead": "6f5acfb72365792b3215957cc041f9dd673841e9"
40
+ "gitHead": "c4e9e72111816af56f3303a4c04988011428b06e"
41
41
  }