Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 736102b

Browse files
committed
chore: add knip and installed-check + clean up workspace deps
1 parent d667025 commit 736102b

File tree

12 files changed

+959
-928
lines changed

12 files changed

+959
-928
lines changed

.github/workflows/ci.yml

+41-23
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,30 @@ on:
1111
permissions: {}
1212

1313
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- run: corepack enable
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: 22
22+
cache: "pnpm"
23+
24+
- name: 📦 Install dependencies
25+
run: pnpm install
26+
27+
- run: pnpm dev:prepare
28+
29+
- name: 🔠 Lint project
30+
run: pnpm lint
31+
32+
- name: ✂️ Knip project
33+
run: pnpm knip --workspace .
34+
35+
- name: ⚙️ Check package engines
36+
run: pnpm installed-check -d --no-workspaces
37+
1438
ci:
1539
strategy:
1640
matrix:
@@ -23,36 +47,30 @@ jobs:
2347
with:
2448
node-version: 18
2549
cache: "pnpm"
26-
- run: pnpm install
27-
28-
# https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml#L62
29-
# Install playwright's binary under custom directory to cache
30-
- name: Set Playwright path (non-windows)
31-
if: runner.os != 'Windows'
32-
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
33-
- name: Set Playwright path (windows)
34-
if: runner.os == 'Windows'
35-
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV
36-
37-
- name: Cache Playwright's binary
38-
uses: actions/cache@v4
39-
with:
40-
# Playwright removes unused browsers automatically
41-
# So does not need to add playwright version to key
42-
key: ${{ runner.os }}-playwright-bin-v1
43-
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
50+
51+
- name: 📦 Install dependencies
52+
run: pnpm install
4453

4554
- name: Install Playwright
4655
# does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
4756
run: pnpm playwright-core install chromium
4857

4958
- run: pnpm dev:prepare
50-
- run: pnpm lint
51-
- run: pnpm test
52-
- run: pnpm build
53-
- run: pnpm test:types
59+
60+
- name: 🧪 Test project
61+
run: pnpm test
62+
63+
- name: 🛠 Build project
64+
run: pnpm build
65+
66+
- name: 💪 Type check
67+
run: pnpm test:types
68+
5469
- run: pnpm dev:build
55-
- uses: codecov/codecov-action@v5
70+
71+
72+
- name: 🟩 Coverage
73+
uses: codecov/codecov-action@v5
5674
if: matrix.os != 'windows-latest'
5775
env:
5876
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

docs/package.json

+2-5
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@
2020
"@vueuse/nuxt": "^12.3.0",
2121
"nuxt": "^3.15.1",
2222
"nuxt-og-image": "^2.2.6",
23-
"perfect-debounce": "^1.0.0"
24-
},
25-
"devDependencies": {
26-
"@nuxt/devtools": "^1.7.0",
27-
"@types/node": "^22.10.5"
23+
"perfect-debounce": "^1.0.0",
24+
"tailwindcss": "^3.4.17"
2825
}
2926
}

knip.json

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"$schema": "https://unpkg.com/knip@5/schema.json",
3+
"workspaces": {
4+
".": {
5+
"entry": [
6+
"build.config.ts",
7+
"src/module.ts",
8+
"src/runtime/**",
9+
"scripts/*"
10+
],
11+
"ignoreDependencies": [
12+
"vitest-environment-nuxt"
13+
]
14+
},
15+
"docs": {
16+
"entry": [
17+
"{components,layouts,pages,plugins,server}/**",
18+
"{app,error}.vue",
19+
"*.ts"
20+
],
21+
"ignoreDependencies": [
22+
"@iconify-json/ph",
23+
"@iconify-json/simple-icons",
24+
"@nuxt/content",
25+
"@nuxt/fonts",
26+
"@nuxt/image",
27+
"@nuxt/ui-pro",
28+
"@nuxthq/studio",
29+
"@nuxtjs/plausible",
30+
"@vueuse/core",
31+
"@vueuse/nuxt",
32+
"nuxt-og-image",
33+
"perfect-debounce"
34+
]
35+
},
36+
"example": {
37+
"ignoreDependencies": [
38+
"@nuxt/image"
39+
]
40+
},
41+
"playground": {
42+
"entry": [
43+
"providers/custom/index.ts",
44+
"{components,layouts,pages,plugins,server}/**",
45+
"{app,error}.vue",
46+
"layers/**",
47+
"*.ts"
48+
],
49+
"ignoreDependencies": [
50+
"@nuxt/image"
51+
]
52+
}
53+
}
54+
}

package.json

+8-3
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,30 @@
4949
},
5050
"devDependencies": {
5151
"@nuxt/eslint-config": "0.7.4",
52-
"@nuxt/image": "link:",
5352
"@nuxt/module-builder": "0.8.4",
53+
"@nuxt/schema": "3.15.1",
5454
"@nuxt/test-utils": "^3.15.1",
5555
"@types/node": "^22.10.5",
5656
"@types/semver": "^7.5.8",
57+
"@unhead/vue": "^1.11.14",
5758
"@vitest/coverage-v8": "^2.1.8",
5859
"@vue/test-utils": "^2.4.6",
5960
"changelogen": "^0.5.7",
6061
"eslint": "9.17.0",
6162
"globby": "^14.0.2",
6263
"happy-dom": "^16.3.0",
64+
"installed-check": "^9.3.0",
6365
"ipx": "^2.1.0",
6466
"jiti": "2.4.2",
67+
"knip": "^5.41.1",
68+
"nitropack": "^2.10.4",
6569
"nuxt": "^3.15.1",
6670
"ofetch": "^1.4.1",
6771
"playwright-core": "^1.49.1",
6872
"semver": "^7.6.3",
6973
"tinyexec": "^0.3.2",
7074
"typescript": "5.6.3",
75+
"unbuild": "^3.2.0",
7176
"vitest": "^2.1.8",
7277
"vitest-environment-nuxt": "^1.0.1",
7378
"vue": "3.5.13",
@@ -78,12 +83,12 @@
7883
},
7984
"packageManager": "[email protected]",
8085
"resolutions": {
81-
"@nuxt/image": "link:.",
86+
"@nuxt/image": "workspace:*",
8287
"@nuxt/schema": "3.15.1",
8388
"@nuxt/ui": "2.20.0",
8489
"vue": "3.5.13"
8590
},
8691
"engines": {
87-
"node": "^14.16.0 || >=16.11.0"
92+
"node": ">=18.20.5"
8893
}
8994
}

0 commit comments

Comments
 (0)