Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» chore: Introduce sort-package-json (#884)
Browse files Browse the repository at this point in the history
  • Loading branch information
duckception authored Sep 20, 2023
1 parent 41aef1d commit 181d4fd
Show file tree
Hide file tree
Showing 5 changed files with 280 additions and 13 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
6 changes: 3 additions & 3 deletions examples/greetings-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"scripts": {
"run": "tsx src/example.ts"
},
"devDependencies": {
"tsx": "^3.12.10"
},
"dependencies": {
"greetings": "workspace:*"
},
"devDependencies": {
"tsx": "^3.12.10"
}
}
13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
{
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",
"build": "turbo build",
"preinstall": "npx only-allow pnpm",
"lint": "biome format . --write",
"lint:check": "biome check ."
"lint:check": "biome check .",
"prepare": "husky install",
"sort-package-json": "sort-package-json 'package.json' 'packages/*/package.json' 'examples/*/package.json'",
"sort-package-json:check": "sort-package-json 'package.json' 'packages/*/package.json' 'examples/*/package.json' --check"
},
"lint-staged": {
"package.json": "sort-package-json"
},
"devDependencies": {
"@biomejs/biome": "1.2.2",
"commitlint-config-gitmoji": "^2.3.1",
"husky": "^8.0.0",
"lint-staged": "^14.0.1",
"sort-package-json": "^2.5.1",
"turbo": "^1.10.14"
},
"packageManager": "[email protected]",
Expand Down
14 changes: 7 additions & 7 deletions packages/greetings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "greetings",
"version": "1.0.0",
"type": "module",
"main": "./dist/index.js",
"exports": {
".": {
"import": {
Expand All @@ -11,27 +10,28 @@
}
}
},
"main": "./dist/index.js",
"files": [
"dist",
"src",
"types"
],
"scripts": {
"clean": "rimraf dist types",
"types:check": "tsc --noEmit",
"build": "pnpm run clean && pnpm run build:dist && pnpm run build:types",
"build:dist": "tsup",
"build:types": "tsc --emitDeclarationOnly",
"run:greetings": "tsx src/run.ts"
"clean": "rimraf dist types",
"run:greetings": "tsx src/run.ts",
"types:check": "tsc --noEmit"
},
"dependencies": {
"chalk": "^5.3.0"
},
"devDependencies": {
"rimraf": "^5.0.1",
"tsconfig": "workspace:*",
"tsup": "^7.2.0",
"tsx": "^3.12.10",
"typescript": "^5.2.2"
},
"dependencies": {
"chalk": "^5.3.0"
}
}
Loading

0 comments on commit 181d4fd

Please sign in to comment.