Skip to content

Commit 583076e

Browse files
committed
build: improve consistency of the package scripts
1 parent 5d81742 commit 583076e

File tree

7 files changed

+33
-21
lines changed

7 files changed

+33
-21
lines changed

.github/workflows/ci.yml

+18-8
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,28 @@ jobs:
1818
- name: Install dependencies
1919
run: npm clean-install
2020
env: { HUSKY: 0 }
21+
22+
- name: Build package
23+
run: npm run build
24+
- name: Build docs
25+
run: npm run build:docs
26+
2127
- name: Audit dependencies
22-
run: npm audit && npm audit signatures
28+
run: >
29+
npm audit
30+
npm audit signatures
31+
- name: Audit linting
32+
run: npm run lint
33+
- name: Audit type checks
34+
run: npm run build:typescript
2335
- name: Audit code coverage
2436
run: npm run test:coverage
25-
- name: Audit code formatting
26-
run: npm run format
27-
- name: Audit code linting
28-
run: npm run lint
29-
- name: Upload coverage to Codecov
30-
uses: codecov/codecov-action@v5
31-
with: { token: "${{ secrets.CODECOV_TOKEN }}" }
37+
3238
- name: Upload test results to Codecov
3339
if: ${{ !cancelled() }}
3440
uses: codecov/test-results-action@v1
3541
with: { token: "${{ secrets.CODECOV_TOKEN }}" }
42+
- name: Upload coverage to Codecov
43+
if: ${{ !cancelled() }}
44+
uses: codecov/codecov-action@v5
45+
with: { token: "${{ secrets.CODECOV_TOKEN }}" }

.github/workflows/docs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
- name: Setup Node.js
2929
uses: actions/setup-node@v4
3030
with: { node-version: latest }
31+
3132
- name: Install dependencies
3233
run: npm clean-install
3334
env: { HUSKY: 0 }

.github/workflows/release.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ jobs:
1919
- name: Setup Node.js
2020
uses: actions/setup-node@v3
2121
with: { node-version: latest }
22+
2223
- name: Install dependencies
2324
run: npm clean-install
2425
env: { HUSKY: 0 }
2526
- name: Build plugin
26-
run: npm run build:release
27+
run: npm run build
2728
- name: Release update
2829
env: { GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" }
2930
run: npx semantic-release

.husky/commit-msg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
npm run lint:commit ${1}
1+
npm run commitlint ${1}

.husky/pre-commit

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
npm run format
21
npm run lint

.husky/pre-push

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
npm run build:docs
12
npm run test:coverage

package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@
66
"type": "module",
77
"main": "dist/main.js",
88
"scripts": {
9-
"prepare": "husky && git submodule init",
10-
"build": "tsc && vite build",
9+
"build": "vite build",
1110
"build:clean": "rm -rf node_modules/ dist/ coverage/ docs/",
12-
"build:release": "tsc && vite build --mode production",
13-
"build:watch": "vite build --watch --mode development",
1411
"build:docs": "typedoc --validation",
15-
"lint": "eslint .",
16-
"lint:fix": "eslint --fix .",
17-
"lint:commit": "commitlint --edit",
18-
"format": "prettier --check .",
19-
"format:fix": "prettier --write .",
12+
"build:typescript": "tsc --build",
13+
"build:watch": "vite build --watch",
14+
"build:watch-docs": "typedoc --validation --watch",
15+
"build:watch-typescript": "tsc --build --watch",
16+
"commitlint": "commitlint --edit",
17+
"lint": "eslint . && prettier --check .",
18+
"lint:fix": "prettier --write . && eslint --fix .",
19+
"prepare": "husky",
2020
"test": "vitest run",
2121
"test:coverage": "vitest run --coverage",
2222
"test:watch": "vitest --watch",
23-
"test:watch-coverage": "vitest --watch --coverage"
23+
"test:watch-coverage": "vitest --coverage --watch"
2424
},
2525
"dependencies": {
2626
"@preact/signals": "^2.0.1",

0 commit comments

Comments
 (0)