Skip to content

Commit

Permalink
infra: sort package.json automatically (#3098)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 authored Sep 9, 2024
1 parent ca9d036 commit 200beb9
Show file tree
Hide file tree
Showing 3 changed files with 369 additions and 191 deletions.
8 changes: 7 additions & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @type {import('prettier').Config}
*/
export default {
plugins: ['prettier-plugin-organize-imports'],
plugins: ['prettier-plugin-organize-imports', 'prettier-plugin-packagejson'],
singleQuote: true,
trailingComma: 'es5',
overrides: [
Expand All @@ -24,5 +24,11 @@ export default {
organizeImportsSkipDestructiveCodeActions: true,
},
},
{
files: 'package.json',
options: {
packageSortOrder: ['name', 'version', 'description', 'scripts'],
},
},
],
};
91 changes: 46 additions & 45 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,36 @@
"name": "@faker-js/faker",
"version": "9.0.0",
"description": "Generate massive amounts of fake contextual data",
"sideEffects": false,
"scripts": {
"clean": "rimraf coverage .eslintcache dist docs/.vitepress/cache docs/.vitepress/dist node_modules",
"build:clean": "rimraf dist",
"build:code": "tsup-node",
"build:types": "tsc --project tsconfig.build.json",
"build": "run-s build:clean build:code build:types",
"generate": "run-s generate:locales generate:api-docs",
"generate:api-docs": "tsx ./scripts/apidocs.ts",
"generate:locales": "tsx ./scripts/generate-locales.ts",
"docs:build": "run-s generate:api-docs docs:build:run",
"docs:build:run": "vitepress build docs",
"docs:build:ci": "run-s build docs:build",
"docs:dev": "run-s generate:api-docs docs:dev:run",
"docs:dev:run": "vitepress dev docs",
"docs:serve": "vitepress serve docs --port 5173",
"docs:diff": "tsx ./scripts/diff.ts",
"format": "prettier --cache --write .",
"lint": "eslint --cache --cache-strategy content .",
"ts-check": "tsc",
"test": "vitest",
"test:update-snapshots": "vitest run -u",
"coverage": "vitest run --coverage",
"cypress": "cypress",
"docs:test:e2e:ci": "run-s docs:build:ci docs:test:e2e:run",
"docs:test:e2e:run": "run-p --race docs:serve \"cypress run\"",
"docs:test:e2e:open": "run-p --race docs:serve \"cypress open\"",
"release": "commit-and-tag-version",
"prepublishOnly": "pnpm run clean && pnpm install && pnpm run build",
"preflight": "pnpm install && run-s generate format lint build test:update-snapshots ts-check"
},
"keywords": [
"faker",
"faker.js",
Expand All @@ -17,6 +46,10 @@
"fake contextual data generator",
"fake contextual data"
],
"homepage": "https://fakerjs.dev",
"bugs": {
"url": "https://github.com/faker-js/faker/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/faker-js/faker.git"
Expand All @@ -27,22 +60,9 @@
"url": "https://opencollective.com/fakerjs"
}
],
"bugs": {
"url": "https://github.com/faker-js/faker/issues"
},
"homepage": "https://fakerjs.dev",
"license": "MIT",
"sideEffects": false,
"type": "module",
"main": "dist/index.cjs",
"module": "dist/index.js",
"types": "index.d.ts",
"typesVersions": {
">=5.0": {
"*": [
"dist/types/*"
]
}
},
"exports": {
".": {
"types": "./dist/types/index.d.ts",
Expand All @@ -58,40 +78,20 @@
},
"./package.json": "./package.json"
},
"main": "dist/index.cjs",
"module": "dist/index.js",
"types": "index.d.ts",
"typesVersions": {
">=5.0": {
"*": [
"dist/types/*"
]
}
},
"files": [
"CHANGELOG.md",
"dist"
],
"scripts": {
"clean": "rimraf coverage .eslintcache dist docs/.vitepress/cache docs/.vitepress/dist node_modules",
"build:clean": "rimraf dist",
"build:code": "tsup-node",
"build:types": "tsc --project tsconfig.build.json",
"build": "run-s build:clean build:code build:types",
"generate": "run-s generate:locales generate:api-docs",
"generate:api-docs": "tsx ./scripts/apidocs.ts",
"generate:locales": "tsx ./scripts/generate-locales.ts",
"docs:build": "run-s generate:api-docs docs:build:run",
"docs:build:run": "vitepress build docs",
"docs:build:ci": "run-s build docs:build",
"docs:dev": "run-s generate:api-docs docs:dev:run",
"docs:dev:run": "vitepress dev docs",
"docs:serve": "vitepress serve docs --port 5173",
"docs:diff": "tsx ./scripts/diff.ts",
"format": "prettier --cache --write .",
"lint": "eslint --cache --cache-strategy content .",
"ts-check": "tsc",
"test": "vitest",
"test:update-snapshots": "vitest run -u",
"coverage": "vitest run --coverage",
"cypress": "cypress",
"docs:test:e2e:ci": "run-s docs:build:ci docs:test:e2e:run",
"docs:test:e2e:run": "run-p --race docs:serve \"cypress run\"",
"docs:test:e2e:open": "run-p --race docs:serve \"cypress open\"",
"release": "commit-and-tag-version",
"prepublishOnly": "pnpm run clean && pnpm install && pnpm run build",
"preflight": "pnpm install && run-s generate format lint build test:update-snapshots ts-check"
},
"devDependencies": {
"@actions/github": "6.0.0",
"@algolia/client-search": "5.2.3",
Expand Down Expand Up @@ -122,6 +122,7 @@
"npm-run-all2": "6.2.2",
"prettier": "3.3.3",
"prettier-plugin-organize-imports": "4.0.0",
"prettier-plugin-packagejson": "2.5.2",
"rimraf": "5.0.10",
"sanitize-html": "2.13.0",
"semver": "7.6.3",
Expand Down
Loading

0 comments on commit 200beb9

Please sign in to comment.