Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ jobs:
- name: Typecheck
run: nr typecheck

# Non-blocking until the existing findings are triaged; see knip.jsonc.
- name: Knip
run: nr knip
continue-on-error: true

test:
runs-on: ${{ matrix.os }}
strategy:
Expand Down
92 changes: 92 additions & 0 deletions knip.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"$schema": "https://unpkg.com/knip@6/schema-jsonc.json",
// Snapshot/fixture output that is intentionally unimported source — keep it
// in the analysis for other issue types, just don't flag it as "unused".
//
// The `packages/{oxc,rolldown,vite}/src/app/**` entries are Nuxt app trees
// nested under `src/` (via `srcDir: 'app'`). Knip's Nuxt plugin registers
// its component/composable auto-import compilers relative to the workspace
// root rather than the resolved `nuxt.config` location, so components and
// composables consumed only through Nuxt's auto-import (template tags,
// unimport) can't be traced back and are misreported as unused files.
// `src/node/**`, `src/modules/**` and `src/shared/**` are unaffected and
// stay covered.
"ignoreFiles": [
"test/__snapshots__/**",
"packages/oxc/src/app/fixtures/**",
"e2e/fixtures/**",
"packages/oxc/src/app/**",
"packages/rolldown/src/app/**",
"packages/vite/src/app/**"
],
"workspaces": {
"packages/core": {
// The node/client build entries are already covered by `package.json`
// `bin`/`exports` (resolved back to source via sourcemaps). Only the
// standalone client dev app isn't part of `exports`.
"entry": ["src/client/standalone/main.ts", "src/client/standalone/vite.config.ts"],
"unocss": { "config": ["src/client/standalone/uno.config.ts"] }
},
// packages/kit's entries are fully covered by its `package.json#exports`.
"packages/oxc": {
"nuxt": { "config": ["src/nuxt.config.ts"] },
"unocss": { "config": ["src/uno.config.ts"] }
},
"packages/rolldown": {
"nuxt": { "config": ["src/nuxt.config.ts"] },
"unocss": { "config": ["src/uno.config.ts"] }
},
"packages/vite": {
"nuxt": { "config": ["src/nuxt.config.ts"] },
"unocss": { "config": ["src/uno.config.ts"] }
},
"packages/ui": {
// Preset/component library consumed via package.json `exports` globs
// (components/composables/state/worker/plugins/utils) — not a Nuxt app
// itself, even though it lists `nuxt`/`unocss` as peer dependencies.
"entry": [
"src/components/**/*.vue",
// `DisplayHighlightedPath.ts` is a `.ts` render-function component,
// but the `./components/*` exports glob only maps to `.vue`, so
// consumers importing it deeply (e.g. the rolldown/vite Nuxt apps'
// auto-import shims) can't be traced back to this source file.
"src/components/Display/DisplayHighlightedPath.ts",
"src/composables/*.ts",
"src/state/*.ts",
"src/worker/*.ts",
"src/plugins/*.ts",
"src/utils/*.ts",
"src/unocss/*.ts",
"src/components/**/*.stories.ts"
],
"nuxt": false,
"unocss": false
},
// packages/vitest's entries are fully covered by its `package.json#exports`.
"packages/webext": {
// Built directly from every top-level `src/*.ts` file (see
// `tsdown.config.ts`) rather than a single index — `webext` has no
// `exports` map for source-mapping to pick these up automatically.
// `scripts/build-app.ts` is already found via the `build:extension`
// script in `package.json`.
"entry": ["src/*.ts"]
},
"examples/*": {
// `src/node/index.ts` is covered by `package.json#exports` already.
"entry": ["playground/vite.config.ts", "playground/src/main.{ts,tsx}"]
},
"examples/plugin-file-explorer": {
// A workspace-specific config overrides the `examples/*` wildcard
// entirely, so the playground entries have to be repeated here too.
"entry": [
"playground/vite.config.ts",
"playground/src/main.{ts,tsx}",
"src/ui/main.tsx",
"src/ui/vite.config.ts"
]
},
"playgrounds/core": {
"entry": ["uno.config.ts", "src/oxlint.config.ts"]
}
}
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"docs:serve": "pnpm -C docs run docs:serve",
"docs": "pnpm -C docs run docs",
"example:plugin-file-explorer": "pnpm -C examples/plugin-file-explorer run play:dev",
"knip": "knip",
"lint": "eslint --cache && pnpm -C packages/oxc run lint",
"play:debug": "pnpm -C packages/core run play:debug",
"play:standalone": "pnpm -C packages/core run play:standalone",
Expand All @@ -41,6 +42,7 @@
"docs:serve": "Preview the built documentation site",
"docs": "Start the documentation dev server",
"example:plugin-file-explorer": "Run the file-explorer plugin example",
"knip": "Find unused files, dependencies, and exports with Knip",
"lint": "Lint the codebase with ESLint and oxc",
"play:debug": "Run the core playground in debug mode",
"play:standalone": "Run the standalone client playground",
Expand Down Expand Up @@ -97,6 +99,7 @@
"chokidar": "catalog:devtools",
"esbuild": "catalog:build",
"eslint": "catalog:devtools",
"knip": "catalog:devtools",
"magic-string": "catalog:build",
"nano-staged": "catalog:devtools",
"nostics": "catalog:deps",
Expand Down
1 change: 1 addition & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
"iframe-pane": "catalog:frontend",
"tsdown": "catalog:build",
"typescript": "catalog:devtools",
"unocss": "catalog:build",
"unplugin-vue": "catalog:build",
"unrun": "catalog:build",
"vite": "catalog:build",
Expand Down
1 change: 1 addition & 0 deletions packages/rolldown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"idb-keyval": "catalog:frontend",
"modern-monaco": "catalog:frontend",
"nanovis": "catalog:frontend",
"nuxt": "catalog:build",
"splitpanes": "catalog:frontend",
"theme-vitesse": "catalog:frontend",
"tsdown": "catalog:build",
Expand Down
1 change: 1 addition & 0 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"main": "./src/index.ts",
"module": "./src/index.ts",
"peerDependencies": {
"@floating-ui/dom": "*",
"@vueuse/core": "*",
"d3-hierarchy": "*",
"d3-shape": "*",
Expand Down
1 change: 1 addition & 0 deletions packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"fuse.js": "catalog:frontend",
"modern-monaco": "catalog:frontend",
"nanovis": "catalog:frontend",
"nuxt": "catalog:build",
"splitpanes": "catalog:frontend",
"tsdown": "catalog:build",
"unocss": "catalog:build",
Expand Down
Loading
Loading