Skip to content

Commit fc3af0a

Browse files
committed
From package scripts to makefiles
1 parent 2316111 commit fc3af0a

9 files changed

Lines changed: 81 additions & 4108 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ jobs:
2525
yarn install
2626
make build
2727
make test
28+
make lint
2829
env:
2930
CI: true

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@ dev: build
1313
"make -C packages/react-sunbeam ${@}" \
1414
"make -C packages/demo ${@}"
1515

16+
lint:
17+
make -C packages/react-sunbeam $@
18+
make -C packages/demo $@
19+
1620
type-check:
17-
yarn tsc --noEmit
21+
make -C packages/react-sunbeam $@
22+
make -C packages/demo $@
1823

1924
test:
2025
make -C packages/react-sunbeam $@

package.json

Lines changed: 4 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3,63 +3,19 @@
33
"workspaces": [
44
"packages/*"
55
],
6-
"scripts": {
7-
"build": "lerna run build",
8-
"commit": "git-cz",
9-
"commit:retry": "git-cz --retry",
10-
"dev": "yarn build && lerna run --parallel --stream dev",
11-
"clean": "lerna run clean",
12-
"lint": "eslint packages/react-sunbeam/src --ext .ts,.tsx && eslint packages/demo/src --ext .ts,.tsx",
13-
"release": "yarn build && lerna publish --conventional-commits",
14-
"test": "lerna run test",
15-
"type-check": "lerna run type-check",
16-
"uninstall": "lerna clean && rimraf ./node_modules"
17-
},
18-
"husky": {
19-
"hooks": {
20-
"pre-commit": "pretty-quick --staged && yarn type-check && yarn lint && yarn test",
21-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
22-
"pre-push": "yarn type-check && yarn lint && yarn test"
23-
}
24-
},
25-
"commitlint": {
26-
"extends": [
27-
"@commitlint/config-conventional"
28-
],
29-
"rules": {
30-
"scope-case": [
31-
0
32-
],
33-
"header-max-length": [
34-
2,
35-
"always",
36-
100
37-
]
38-
}
39-
},
40-
"config": {
41-
"commitizen": {
42-
"path": "cz-conventional-changelog"
43-
}
44-
},
456
"repository": "git+https://github.com/vovaguguiev/react-sunbeam.git",
467
"author": "Vova Guguiev <vladimir.guguiev@gmail.com>",
478
"devDependencies": {
48-
"@commitlint/cli": "^11.0.0",
49-
"@commitlint/config-conventional": "^11.0.0",
509
"@typescript-eslint/eslint-plugin": "^4.7.0",
5110
"@typescript-eslint/parser": "^4.7.0",
52-
"commitizen": "^4.2.2",
53-
"cz-conventional-changelog": "^3.3.0",
5411
"eslint": "^7.13.0",
5512
"eslint-config-prettier": "^6.15.0",
5613
"eslint-plugin-import": "^2.22.1",
5714
"eslint-plugin-react": "^7.21.5",
5815
"eslint-plugin-react-hooks": "^4.2.0",
59-
"husky": "^4.3.0",
60-
"lerna": "^3.22.1",
61-
"prettier": "^2.1.2",
62-
"pretty-quick": "^3.1.0",
63-
"rimraf": "^3.0.2"
16+
"jest": "^26.6.3",
17+
"jest-ts-webcompat-resolver": "^1.0.0",
18+
"ts-jest": "^26.4.4",
19+
"typescript": "^4.1.2"
6420
}
6521
}

packages/demo/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ dev:
1111
'tsc --watch --preserveWatchOutput' \
1212
'deno run --allow-net --allow-read https://deno.land/x/denoliver@2.1.0/mod.ts .. -p 3333 --entry /demo/index.html'
1313

14+
lint:
15+
yarn eslint src --ext .ts,.tsx
16+
1417
type-check:
1518
yarn tsc --noEmit
1619

17-
PHONY: build dev type-check
20+
PHONY: build dev lint type-check

packages/demo/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"concurrently": "^6.0.0",
99
"framer-motion": "^3.10.3",
1010
"react-router": "^5.2.0",
11-
"@types/react-router-dom": "5.1.6",
12-
"typescript": "^4.1.2"
11+
"@types/react-router-dom": "5.1.6"
1312
}
1413
}

packages/demo/src/apps/SettingsMenu/Picker.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,16 @@ export function Picker({
4949
}}
5050
>
5151
{({ focused, path }) => {
52+
// This callback is called during rendering and it never changes so we can safely call hooks inside of it.
53+
/* eslint-disable react-hooks/rules-of-hooks */
5254
const focusManager = useFocusManager()
5355
const prevOpen = usePrevious(open, open)
5456
useEffect(() => {
5557
if (!open || prevOpen === open) return
5658

5759
focusManager.setFocus(path.concat(focusKeyByValue[selectedOption.props.value]))
5860
})
61+
/* eslint-enable react-hooks/rules-of-hooks */
5962

6063
return (
6164
<div

packages/react-sunbeam/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ dev:
1212
type-check:
1313
yarn tsc --noEmit
1414

15+
lint:
16+
yarn eslint src --ext .ts,.tsx
17+
1518
test:
1619
yarn jest
1720

18-
PHONY: clean build dev type-check test
21+
PHONY: clean build dev lint type-check test

packages/react-sunbeam/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,8 @@
2424
"@types/jest": "^26.0.15",
2525
"@types/react": "^17.0.0",
2626
"@types/react-dom": "^17.0.0",
27-
"jest": "^26.6.3",
28-
"jest-ts-webcompat-resolver": "^1.0.0",
2927
"react": "^17.0.1",
30-
"react-dom": "^17.0.1",
31-
"ts-jest": "^26.4.4",
32-
"typescript": "^4.1.2"
28+
"react-dom": "^17.0.1"
3329
},
3430
"peerDependencies": {
3531
"react": "^16 || ^17",

0 commit comments

Comments
 (0)