Skip to content

Commit 3846a89

Browse files
committed
feat: add type checking, linting, and formatting checks to workflows and package configurations
1 parent de80946 commit 3846a89

File tree

10 files changed

+145
-3
lines changed

10 files changed

+145
-3
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,14 @@ jobs:
2727
- name: Install dependencies
2828
run: pnpm install --frozen-lockfile
2929

30+
- name: Type check
31+
run: pnpm -r typecheck
32+
33+
- name: Lint
34+
run: pnpm -r lint
35+
36+
- name: Format check
37+
run: pnpm run format:check
38+
3039
- name: Build project
3140
run: pnpm build

.github/workflows/publish-mcp.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ jobs:
3333
- name: Install dependencies (filtered)
3434
run: pnpm install --frozen-lockfile --filter @tempad-dev/mcp...
3535

36+
- name: Type check
37+
run: pnpm --filter @tempad-dev/mcp... run typecheck
38+
39+
- name: Lint
40+
run: pnpm --filter @tempad-dev/mcp... run lint
41+
3642
- name: Build package (with deps)
3743
run: pnpm --filter @tempad-dev/mcp... run build
3844

.github/workflows/publish-plugins.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,14 @@ jobs:
3333
- name: Install dependencies (filtered)
3434
run: pnpm install --frozen-lockfile --filter @tempad-dev/plugins...
3535

36+
- name: Type check
37+
run: pnpm --filter @tempad-dev/plugins... run typecheck
38+
39+
- name: Lint
40+
run: pnpm --filter @tempad-dev/plugins... run lint
41+
3642
- name: Build package
37-
run: pnpm --filter @tempad-dev/plugins run build
43+
run: pnpm --filter @tempad-dev/plugins... run build
3844

3945
- name: Publish @tempad-dev/plugins with provenance
4046
run: cd packages/plugins && npm publish --provenance --access public

.lefthook.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
pre-commit:
2+
parallel: true
3+
commands:
4+
typecheck:
5+
run: pnpm -r typecheck
6+
lint:
7+
files: "\\.(ts|js|mjs|cjs|mts|cts|vue)$"
8+
run: pnpm exec eslint --fix {staged_files}
9+
stage_fixed: true
10+
format:
11+
files: "\\.(ts|js|mjs|cjs|cts|mts|json|md|yml|yaml|vue)$"
12+
run: pnpm exec prettier --write {staged_files}
13+
stage_fixed: true

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"eslint-config-flat-gitignore": "^2.1.0",
1414
"eslint-plugin-perfectionist": "^4.15.1",
1515
"eslint-plugin-vue": "^10.5.1",
16+
"lefthook": "^1.7.17",
1617
"prettier": "^3.6.2",
1718
"typescript": "^5.9.3"
1819
},
@@ -23,11 +24,14 @@
2324
"build:plugins": "pnpm --filter @tempad-dev/plugins build",
2425
"build:mcp": "pnpm --filter @tempad-dev/mcp build",
2526
"lint": "pnpm -r lint",
27+
"lint:fix": "pnpm -r lint:fix",
2628
"format": "pnpm -r format",
2729
"typecheck": "pnpm -r typecheck",
2830
"zip": "pnpm --filter @tempad-dev/extension zip",
2931
"npm:plugins": "pnpm --filter @tempad-dev/plugins publish --access public",
30-
"npm:mcp": "pnpm --filter @tempad-dev/mcp publish --access public"
32+
"npm:mcp": "pnpm --filter @tempad-dev/mcp publish --access public",
33+
"format:check": "pnpm exec prettier --check \"**/*.{js,ts,mjs,cjs,cts,mts,json,md,yml,yaml}\" --ignore-path .gitignore",
34+
"prepare": "lefthook install"
3135
},
3236
"pnpm": {
3337
"onlyBuiltDependencies": [

packages/extension/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"zip": "wxt zip",
1313
"typecheck": "vue-tsc --noEmit",
1414
"postinstall": "wxt prepare",
15-
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix",
15+
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts",
16+
"lint:fix": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix",
1617
"format": "prettier --write \"**/*.{js,ts,jsx,tsx,cjs,mjs,cts,mts,vue,json,md,css}\" --ignore-path .gitignore"
1718
},
1819
"dependencies": {

packages/mcp-server/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"build": "tsdown",
1414
"typecheck": "tsc -p tsconfig.json --noEmit",
1515
"lint": "eslint . --ext .ts,.mts,.cts,.js,.mjs,.cjs",
16+
"lint:fix": "eslint . --ext .ts,.mts,.cts,.js,.mjs,.cjs --fix",
1617
"format": "prettier --write \"**/*.{js,ts,mjs,cjs,cts,mts,json,md}\"",
1718
"prepublishOnly": "pnpm run build"
1819
},

packages/mcp-shared/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"build": "tsdown",
1919
"typecheck": "tsc -p tsconfig.json --noEmit",
2020
"lint": "eslint . --ext .ts,.mts,.cts,.js,.mjs,.cjs",
21+
"lint:fix": "eslint . --ext .ts,.mts,.cts,.js,.mjs,.cjs --fix",
2122
"format": "prettier --write \"**/*.{js,ts,mjs,cjs,cts,mts,json,md}\""
2223
},
2324
"dependencies": {

packages/plugins/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"build": "tsdown",
2020
"typecheck": "tsc -p tsconfig.json --noEmit",
2121
"lint": "eslint . --ext .ts,.mts,.cts,.js,.mjs,.cjs",
22+
"lint:fix": "eslint . --ext .ts,.mts,.cts,.js,.mjs,.cjs --fix",
2223
"format": "prettier --write \"**/*.{js,ts,mjs,cjs,cts,mts,json,md}\"",
2324
"prepublishOnly": "pnpm run build"
2425
},

pnpm-lock.yaml

Lines changed: 100 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)