@pob/sort-pkg 3.0.0 → 4.0.0

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-module"]
3
+ "extends": ["@pob/eslint-config/root-commonjs"]
4
4
  }
package/CHANGELOG.md CHANGED
@@ -3,6 +3,61 @@
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.0](https://github.com/christophehurpeau/pob/compare/@pob/sort-pkg@3.3.0...@pob/sort-pkg@4.0.0) (2021-12-11)
7
+
8
+
9
+ ### Features
10
+
11
+ * drop node 12 ([2f32308](https://github.com/christophehurpeau/pob/commit/2f32308b06ca74d0deb3355707e3082fa73e25dc))
12
+
13
+
14
+ ### BREAKING CHANGES
15
+
16
+ * requires node 14
17
+
18
+
19
+
20
+
21
+
22
+ # [3.3.0](https://github.com/christophehurpeau/pob/compare/@pob/sort-pkg@3.2.0...@pob/sort-pkg@3.3.0) (2021-11-11)
23
+
24
+
25
+ ### Features
26
+
27
+ * improve npmignore ([b47706a](https://github.com/christophehurpeau/pob/commit/b47706af4f9be4f8103ec1306879bbd0a6989e6b))
28
+
29
+
30
+
31
+
32
+
33
+ # [3.2.0](https://github.com/christophehurpeau/pob/compare/@pob/sort-pkg@3.1.0...@pob/sort-pkg@3.2.0) (2021-09-05)
34
+
35
+
36
+ ### Features
37
+
38
+ * **@pob/sort-pkg:** add packageManager ([aaad4c9](https://github.com/christophehurpeau/pob/commit/aaad4c9d309d211d5f84ba19b0b8c70b48741483))
39
+ * **@pob/sort-pkg:** add resolutionsExplained and move resolutions up ([a5cd595](https://github.com/christophehurpeau/pob/commit/a5cd59535932f8fc7d7696b9da91728926b3fae6))
40
+
41
+
42
+
43
+
44
+
45
+ # [3.1.0](https://github.com/christophehurpeau/pob/compare/@pob/sort-pkg@3.0.0...@pob/sort-pkg@3.1.0) (2021-08-10)
46
+
47
+
48
+ ### Bug Fixes
49
+
50
+ * go back to commonjs modules for yarn pnp compatibility ([2a6442c](https://github.com/christophehurpeau/pob/commit/2a6442cbc96f221320d796f15d3c84bc1ee4b0ab))
51
+
52
+
53
+ ### Features
54
+
55
+ * use yarn berry by default, add nodeLinker option ([dd69f07](https://github.com/christophehurpeau/pob/commit/dd69f07bea029aff1c3a5f1d22f5981cbbee3539))
56
+
57
+
58
+
59
+
60
+
6
61
  # [3.0.0](https://github.com/christophehurpeau/pob/compare/@pob/sort-pkg@2.2.0...@pob/sort-pkg@3.0.0) (2021-07-11)
7
62
 
8
63
 
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "root": true,
3
- "extends": ["@pob/eslint-config/node-module"]
3
+ "extends": ["@pob/eslint-config/node-commonjs"]
4
4
  }
package/lib/index.js CHANGED
@@ -1,8 +1,10 @@
1
1
  /* eslint-disable complexity */
2
2
 
3
- import sortObject from '@pob/sort-object';
3
+ 'use strict';
4
4
 
5
- export default function sortPkg(pkg) {
5
+ const sortObject = require('@pob/sort-object');
6
+
7
+ module.exports = function sortPkg(pkg) {
6
8
  sortObject(pkg, [
7
9
  'name',
8
10
  'private',
@@ -21,6 +23,7 @@ export default function sortPkg(pkg) {
21
23
  'engineStrict',
22
24
  'os',
23
25
  'cpu',
26
+ /* yarn berry */ 'packageManager',
24
27
  'publishConfig',
25
28
  'workspaces',
26
29
  'browserslist',
@@ -63,19 +66,22 @@ export default function sortPkg(pkg) {
63
66
  'stylelint',
64
67
  'jest',
65
68
  'pob',
69
+ 'resolutions',
70
+ 'resolutionsExplained',
66
71
  'peerDependencies',
67
72
  'peerDependenciesMeta',
68
73
  'devPeerDependencies',
69
74
  'dependencies',
70
75
  'devDependencies',
71
76
  'dependenciesMeta',
77
+ 'optionalDependencies',
72
78
  'bundledDependencies',
73
79
  'bundleDependencies',
74
- 'optionalDependencies',
75
- 'resolutions',
76
80
  ]);
77
81
 
78
82
  if (pkg.scripts) sortObject(pkg.scripts);
83
+ if (pkg.resolutions) sortObject(pkg.resolutions);
84
+ if (pkg.resolutionsExplained) sortObject(pkg.resolutionsExplained);
79
85
  if (pkg.peerDependencies) sortObject(pkg.peerDependencies);
80
86
  if (pkg.devPeerDependencies) sortObject(pkg.devPeerDependencies);
81
87
  if (pkg.dependencies) sortObject(pkg.dependencies);
@@ -83,7 +89,6 @@ export default function sortPkg(pkg) {
83
89
  if (pkg.bundledDependencies) sortObject(pkg.bundledDependencies);
84
90
  if (pkg.bundleDependencies) sortObject(pkg.bundleDependencies);
85
91
  if (pkg.optionalDependencies) sortObject(pkg.optionalDependencies);
86
- if (pkg.resolutions) sortObject(pkg.resolutions);
87
92
 
88
93
  return pkg;
89
- }
94
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pob/sort-pkg",
3
- "version": "3.0.0",
3
+ "version": "4.0.0",
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": "module",
14
+ "type": "commonjs",
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.0.0"
38
+ "@pob/sort-object": "^4.0.0"
39
39
  },
40
- "gitHead": "78eb8bcd2debe186cdde4a3ee4b0c8c33beb33ff"
40
+ "gitHead": "eec3c30b83fbb8d9dd9caa947c6c64977dd14403"
41
41
  }