Skip to content

Commit

Permalink
chore: add knip and installed-check + clean up workspace deps
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Jan 7, 2025
1 parent d667025 commit 736102b
Show file tree
Hide file tree
Showing 12 changed files with 959 additions and 928 deletions.
64 changes: 41 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,30 @@ on:
permissions: {}

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"

- name: 📦 Install dependencies
run: pnpm install

- run: pnpm dev:prepare

- name: 🔠 Lint project
run: pnpm lint

- name: ✂️ Knip project
run: pnpm knip --workspace .

- name: ⚙️ Check package engines
run: pnpm installed-check -d --no-workspaces

ci:
strategy:
matrix:
Expand All @@ -23,36 +47,30 @@ jobs:
with:
node-version: 18
cache: "pnpm"
- run: pnpm install

# https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml#L62
# Install playwright's binary under custom directory to cache
- name: Set Playwright path (non-windows)
if: runner.os != 'Windows'
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
- name: Set Playwright path (windows)
if: runner.os == 'Windows'
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV

- name: Cache Playwright's binary
uses: actions/cache@v4
with:
# Playwright removes unused browsers automatically
# So does not need to add playwright version to key
key: ${{ runner.os }}-playwright-bin-v1
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}

- name: 📦 Install dependencies
run: pnpm install

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

- run: pnpm dev:prepare
- run: pnpm lint
- run: pnpm test
- run: pnpm build
- run: pnpm test:types

- name: 🧪 Test project
run: pnpm test

- name: 🛠 Build project
run: pnpm build

- name: 💪 Type check
run: pnpm test:types

- run: pnpm dev:build
- uses: codecov/codecov-action@v5


- name: 🟩 Coverage
uses: codecov/codecov-action@v5
if: matrix.os != 'windows-latest'
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
7 changes: 2 additions & 5 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@
"@vueuse/nuxt": "^12.3.0",
"nuxt": "^3.15.1",
"nuxt-og-image": "^2.2.6",
"perfect-debounce": "^1.0.0"
},
"devDependencies": {
"@nuxt/devtools": "^1.7.0",
"@types/node": "^22.10.5"
"perfect-debounce": "^1.0.0",
"tailwindcss": "^3.4.17"
}
}
54 changes: 54 additions & 0 deletions knip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"workspaces": {
".": {
"entry": [
"build.config.ts",
"src/module.ts",
"src/runtime/**",
"scripts/*"
],
"ignoreDependencies": [
"vitest-environment-nuxt"
]
},
"docs": {
"entry": [
"{components,layouts,pages,plugins,server}/**",
"{app,error}.vue",
"*.ts"
],
"ignoreDependencies": [
"@iconify-json/ph",
"@iconify-json/simple-icons",
"@nuxt/content",
"@nuxt/fonts",
"@nuxt/image",
"@nuxt/ui-pro",
"@nuxthq/studio",
"@nuxtjs/plausible",
"@vueuse/core",
"@vueuse/nuxt",
"nuxt-og-image",
"perfect-debounce"
]
},
"example": {
"ignoreDependencies": [
"@nuxt/image"
]
},
"playground": {
"entry": [
"providers/custom/index.ts",
"{components,layouts,pages,plugins,server}/**",
"{app,error}.vue",
"layers/**",
"*.ts"
],
"ignoreDependencies": [
"@nuxt/image"
]
}
}
}
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,30 @@
},
"devDependencies": {
"@nuxt/eslint-config": "0.7.4",
"@nuxt/image": "link:",
"@nuxt/module-builder": "0.8.4",
"@nuxt/schema": "3.15.1",
"@nuxt/test-utils": "^3.15.1",
"@types/node": "^22.10.5",
"@types/semver": "^7.5.8",
"@unhead/vue": "^1.11.14",
"@vitest/coverage-v8": "^2.1.8",
"@vue/test-utils": "^2.4.6",
"changelogen": "^0.5.7",
"eslint": "9.17.0",
"globby": "^14.0.2",
"happy-dom": "^16.3.0",
"installed-check": "^9.3.0",
"ipx": "^2.1.0",
"jiti": "2.4.2",
"knip": "^5.41.1",
"nitropack": "^2.10.4",
"nuxt": "^3.15.1",
"ofetch": "^1.4.1",
"playwright-core": "^1.49.1",
"semver": "^7.6.3",
"tinyexec": "^0.3.2",
"typescript": "5.6.3",
"unbuild": "^3.2.0",
"vitest": "^2.1.8",
"vitest-environment-nuxt": "^1.0.1",
"vue": "3.5.13",
Expand All @@ -78,12 +83,12 @@
},
"packageManager": "[email protected]",
"resolutions": {
"@nuxt/image": "link:.",
"@nuxt/image": "workspace:*",
"@nuxt/schema": "3.15.1",
"@nuxt/ui": "2.20.0",
"vue": "3.5.13"
},
"engines": {
"node": "^14.16.0 || >=16.11.0"
"node": ">=18.20.5"
}
}
Loading

0 comments on commit 736102b

Please sign in to comment.