From 5eeceec4491657fb2c83020251fa02bd66de933f Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Sun, 26 Jul 2026 14:02:35 +1000 Subject: [PATCH] Update CI checks to include cycle detection and refine configurations --- .github/workflows/check.yml | 8 ++++---- knip.config.ts | 7 ++++--- package.json | 3 ++- turbo.json | 4 ++++ 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index fa3dbf7e..caa875d6 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -46,11 +46,11 @@ jobs: TURBO_SCM_HEAD: ${{ github.event.pull_request.head.sha }} run: | # `check` is the same turbo task the root `pnpm run check` script runs (`turbo run check - # check:unused`), so CI and local checks are the same task graph — barrels, root format, - # package format, lint, and types. `--affected` is added here only as a PR speed - # optimisation and is never applied to `check:unused`. + # check:cycles check:unused`), so CI and local checks are the same task graph — barrels, + # root format, package format, lint, and types. `--affected` is added here only as a PR + # speed optimisation and is never applied to the unscoped knip runs. corepack pnpm exec turbo run check ${{ github.event_name == 'pull_request' && '--affected' || '' }} # knip is repo-wide, but --affected only selects packages whose own files # changed, so it must run unscoped. Running it via turbo (rather than the # bare `knip` script) pulls in its generate dependencies first. - corepack pnpm exec turbo run check:unused + corepack pnpm exec turbo run check:cycles check:unused diff --git a/knip.config.ts b/knip.config.ts index 82827d43..9bd8d5f5 100644 --- a/knip.config.ts +++ b/knip.config.ts @@ -1,16 +1,17 @@ import type { KnipConfig } from 'knip'; export default { - ignoreBinaries: ['open', 'xdg-open'], + ignoreBinaries: ['xdg-open'], ignoreDependencies: ['eslint-plugin-react-hooks'], + rules: { + cycles: 'error', + }, workspaces: { 'apps/docs': { entry: [ 'scripts/**/*.ts', // Compiled to an inline-able IIFE by the `pack` config in vite.config.ts. 'src/components/playground/editor-skeleton-script.ts', - 'source.config.ts', - 'src/router.tsx', 'src/routes/**/*.ts', 'src/routes/**/*.tsx', 'src/examples/**/*', diff --git a/package.json b/package.json index 11927d5f..db45af89 100644 --- a/package.json +++ b/package.json @@ -8,11 +8,12 @@ "build:packages": "turbo run build --filter=./packages/**", "build:storybook": "turbo run build:storybook --filter=@luke-ui/react", "changeset": "changeset", - "check": "turbo run check check:unused", + "check": "turbo run check check:cycles check:unused", "check:format": "turbo run check:format-root check:format", "check:format-root": "vp fmt . --check", "check:lint": "turbo run check:lint", "check:types": "turbo run check:types", + "check:cycles": "knip --cycles", "check:unused": "knip", "clean": "turbo run clean && rm -rf node_modules", "dev": "turbo run dev dev:storybook", diff --git a/turbo.json b/turbo.json index 18226c47..8345e300 100644 --- a/turbo.json +++ b/turbo.json @@ -13,6 +13,10 @@ "//#check:format-root": { "cache": true }, + "//#check:cycles": { + "cache": true, + "dependsOn": ["@luke-ui/react#generate", "docs#generate"] + }, "//#check:unused": { "cache": true, "dependsOn": ["@luke-ui/react#generate", "docs#generate"] -- 2.51.2