Skip to content

Commit 200beb9

Browse files
authored
infra: sort package.json automatically (#3098)
1 parent ca9d036 commit 200beb9

File tree

3 files changed

+369
-191
lines changed

3 files changed

+369
-191
lines changed

.prettierrc.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @type {import('prettier').Config}
55
*/
66
export default {
7-
plugins: ['prettier-plugin-organize-imports'],
7+
plugins: ['prettier-plugin-organize-imports', 'prettier-plugin-packagejson'],
88
singleQuote: true,
99
trailingComma: 'es5',
1010
overrides: [
@@ -24,5 +24,11 @@ export default {
2424
organizeImportsSkipDestructiveCodeActions: true,
2525
},
2626
},
27+
{
28+
files: 'package.json',
29+
options: {
30+
packageSortOrder: ['name', 'version', 'description', 'scripts'],
31+
},
32+
},
2733
],
2834
};

package.json

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,36 @@
22
"name": "@faker-js/faker",
33
"version": "9.0.0",
44
"description": "Generate massive amounts of fake contextual data",
5-
"sideEffects": false,
5+
"scripts": {
6+
"clean": "rimraf coverage .eslintcache dist docs/.vitepress/cache docs/.vitepress/dist node_modules",
7+
"build:clean": "rimraf dist",
8+
"build:code": "tsup-node",
9+
"build:types": "tsc --project tsconfig.build.json",
10+
"build": "run-s build:clean build:code build:types",
11+
"generate": "run-s generate:locales generate:api-docs",
12+
"generate:api-docs": "tsx ./scripts/apidocs.ts",
13+
"generate:locales": "tsx ./scripts/generate-locales.ts",
14+
"docs:build": "run-s generate:api-docs docs:build:run",
15+
"docs:build:run": "vitepress build docs",
16+
"docs:build:ci": "run-s build docs:build",
17+
"docs:dev": "run-s generate:api-docs docs:dev:run",
18+
"docs:dev:run": "vitepress dev docs",
19+
"docs:serve": "vitepress serve docs --port 5173",
20+
"docs:diff": "tsx ./scripts/diff.ts",
21+
"format": "prettier --cache --write .",
22+
"lint": "eslint --cache --cache-strategy content .",
23+
"ts-check": "tsc",
24+
"test": "vitest",
25+
"test:update-snapshots": "vitest run -u",
26+
"coverage": "vitest run --coverage",
27+
"cypress": "cypress",
28+
"docs:test:e2e:ci": "run-s docs:build:ci docs:test:e2e:run",
29+
"docs:test:e2e:run": "run-p --race docs:serve \"cypress run\"",
30+
"docs:test:e2e:open": "run-p --race docs:serve \"cypress open\"",
31+
"release": "commit-and-tag-version",
32+
"prepublishOnly": "pnpm run clean && pnpm install && pnpm run build",
33+
"preflight": "pnpm install && run-s generate format lint build test:update-snapshots ts-check"
34+
},
635
"keywords": [
736
"faker",
837
"faker.js",
@@ -17,6 +46,10 @@
1746
"fake contextual data generator",
1847
"fake contextual data"
1948
],
49+
"homepage": "https://fakerjs.dev",
50+
"bugs": {
51+
"url": "https://github.com/faker-js/faker/issues"
52+
},
2053
"repository": {
2154
"type": "git",
2255
"url": "git+https://github.com/faker-js/faker.git"
@@ -27,22 +60,9 @@
2760
"url": "https://opencollective.com/fakerjs"
2861
}
2962
],
30-
"bugs": {
31-
"url": "https://github.com/faker-js/faker/issues"
32-
},
33-
"homepage": "https://fakerjs.dev",
3463
"license": "MIT",
64+
"sideEffects": false,
3565
"type": "module",
36-
"main": "dist/index.cjs",
37-
"module": "dist/index.js",
38-
"types": "index.d.ts",
39-
"typesVersions": {
40-
">=5.0": {
41-
"*": [
42-
"dist/types/*"
43-
]
44-
}
45-
},
4666
"exports": {
4767
".": {
4868
"types": "./dist/types/index.d.ts",
@@ -58,40 +78,20 @@
5878
},
5979
"./package.json": "./package.json"
6080
},
81+
"main": "dist/index.cjs",
82+
"module": "dist/index.js",
83+
"types": "index.d.ts",
84+
"typesVersions": {
85+
">=5.0": {
86+
"*": [
87+
"dist/types/*"
88+
]
89+
}
90+
},
6191
"files": [
6292
"CHANGELOG.md",
6393
"dist"
6494
],
65-
"scripts": {
66-
"clean": "rimraf coverage .eslintcache dist docs/.vitepress/cache docs/.vitepress/dist node_modules",
67-
"build:clean": "rimraf dist",
68-
"build:code": "tsup-node",
69-
"build:types": "tsc --project tsconfig.build.json",
70-
"build": "run-s build:clean build:code build:types",
71-
"generate": "run-s generate:locales generate:api-docs",
72-
"generate:api-docs": "tsx ./scripts/apidocs.ts",
73-
"generate:locales": "tsx ./scripts/generate-locales.ts",
74-
"docs:build": "run-s generate:api-docs docs:build:run",
75-
"docs:build:run": "vitepress build docs",
76-
"docs:build:ci": "run-s build docs:build",
77-
"docs:dev": "run-s generate:api-docs docs:dev:run",
78-
"docs:dev:run": "vitepress dev docs",
79-
"docs:serve": "vitepress serve docs --port 5173",
80-
"docs:diff": "tsx ./scripts/diff.ts",
81-
"format": "prettier --cache --write .",
82-
"lint": "eslint --cache --cache-strategy content .",
83-
"ts-check": "tsc",
84-
"test": "vitest",
85-
"test:update-snapshots": "vitest run -u",
86-
"coverage": "vitest run --coverage",
87-
"cypress": "cypress",
88-
"docs:test:e2e:ci": "run-s docs:build:ci docs:test:e2e:run",
89-
"docs:test:e2e:run": "run-p --race docs:serve \"cypress run\"",
90-
"docs:test:e2e:open": "run-p --race docs:serve \"cypress open\"",
91-
"release": "commit-and-tag-version",
92-
"prepublishOnly": "pnpm run clean && pnpm install && pnpm run build",
93-
"preflight": "pnpm install && run-s generate format lint build test:update-snapshots ts-check"
94-
},
9595
"devDependencies": {
9696
"@actions/github": "6.0.0",
9797
"@algolia/client-search": "5.2.3",
@@ -122,6 +122,7 @@
122122
"npm-run-all2": "6.2.2",
123123
"prettier": "3.3.3",
124124
"prettier-plugin-organize-imports": "4.0.0",
125+
"prettier-plugin-packagejson": "2.5.2",
125126
"rimraf": "5.0.10",
126127
"sanitize-html": "2.13.0",
127128
"semver": "7.6.3",

0 commit comments

Comments
 (0)