Skip to content

Commit 9ba6457

Browse files
committed
feat: add husky and move prettier to the root project
1 parent 6dce397 commit 9ba6457

11 files changed

+33
-25
lines changed

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run format
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
node_modules
2+
dist
23
package-lock.json
3-
.grafbase
File renamed without changes.

package-lock.json

+22-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+6-4
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@
1515
"clean": "lerna clean",
1616
"build": "lerna run build",
1717
"test": "lerna run test",
18-
"format": "lerna run format",
18+
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md,gql,mjs}\"",
1919
"publish": "lerna publish",
2020
"version": "lerna version",
21-
"changed": "lerna changed"
21+
"changed": "lerna changed",
22+
"prepare": "husky install"
2223
},
23-
"dependencies": {},
2424
"devDependencies": {
25-
"lerna": "^7.4.2"
25+
"husky": "^8.0.3",
26+
"lerna": "^7.4.2",
27+
"prettier": "^3.1.0"
2628
}
2729
}

packages/api/.npmignore

-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@ node_modules
22
src
33
.DS_Store
44
.gitignore
5-
.prettierignore
6-
.prettierrc
75
jest.config.cjs
86
tsconfig.json

packages/api/package.json

-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"host": "^10.1.13"
2323
},
2424
"scripts": {
25-
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md,gql,mjs,cjs}\"",
2625
"build": "directus-extension build",
2726
"dev": "directus-extension build -w --no-minify",
2827
"link": "directus-extension link",
@@ -36,7 +35,6 @@
3635
"@types/node": "^20.8.7",
3736
"http-errors": "^2.0.0",
3837
"jest": "^29.7.0",
39-
"prettier": "^3.0.3",
4038
"sqlite3": "^5.1.6",
4139
"ts-jest": "^29.1.1",
4240
"typescript": "^5.2.2",

packages/cli/.npmignore

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ src
44
.DS_Store
55
.env
66
.gitignore
7-
.prettierignore
8-
.prettierrc
97
example.env
108
jest.config.js
119
tsconfig.json

packages/cli/.prettierignore

-3
This file was deleted.

packages/cli/.prettierrc

-6
This file was deleted.

packages/cli/package.json

-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
},
99
"scripts": {
1010
"build": "tsc",
11-
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md,gql,mjs}\"",
1211
"start": "ts-node-esm src/index.ts",
1312
"test": "jest",
1413
"prepublishOnly": "cp ../../README.md ./README.md && npm install && npm run format && npm test && npm run build"
@@ -27,7 +26,6 @@
2726
"@types/jest": "^29.5.5",
2827
"@types/node": "20.8.0",
2928
"jest": "^29.7.0",
30-
"prettier": "^3.0.3",
3129
"ts-essentials": "^9.4.1",
3230
"ts-jest": "^29.1.1",
3331
"ts-node": "10.9.1",

0 commit comments

Comments
 (0)