Skip to content

Conversation

snomiao
Copy link
Member

@snomiao snomiao commented Aug 12, 2025

Summary

  • Improved knip configuration to better detect unused code by adding missing entry points
  • Added support for Next.js App Router patterns and middleware detection
  • Updated configuration file references to match current project structure

Changes

  • Added middleware.ts and orval.config.ts to entry points
  • Added app/**/*.{js,jsx,ts,tsx} pattern for App Router support
  • Updated next.config.mjs reference to next.config.ts
  • Added @algolia/autocomplete-shared to ignored dependencies to prevent false positives

Test plan

  • Run bun run knip to verify configuration works correctly
  • Confirm no false positives are reported for legitimate dependencies
  • Verify unused code detection still functions as expected

🤖 Generated with Claude Code

@Copilot Copilot AI review requested due to automatic review settings August 12, 2025 13:59
Copy link

vercel bot commented Aug 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
registry-web Ready Ready Preview Comment Oct 2, 2025 10:11am

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds knip as a development dependency to help identify unused code, dependencies, and exports in the codebase. Knip is a static analysis tool that can help maintain code quality by detecting dead code.

  • Added knip@^5.62.0 as a development dependency
  • Created a comprehensive knip.json configuration file with project-specific settings
  • Configured entry points, project files, and ignore patterns for the Next.js project

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
package.json Added knip dependency to devDependencies
knip.json Created configuration file with entry points, ignore patterns, and framework-specific settings

Copy link

🎨 Chromatic Visual Testing Results

Resource URL
🔍 Build Results Chromatic Build
📚 Storybook View Storybook

Check the visual changes and approve or request changes as needed.

Copy link

socket-security bot commented Aug 12, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedknip@​5.64.1991009295100

View full report

@snomiao snomiao changed the title Add knip dependency for unused code detection feat: improve knip configuration for better unused code detection Aug 12, 2025
Copy link

🎨 Chromatic Visual Testing Results

Resource URL
🔍 Build Results Chromatic Build
📚 Storybook View Storybook

Check the visual changes and approve or request changes as needed.

Copy link

🎨 Chromatic Visual Testing Results

Resource URL
🔍 Build Results Chromatic Build
📚 Storybook View Storybook

Check the visual changes and approve or request changes as needed.

Copy link

🎨 Chromatic Visual Testing Results

Resource URL
🔍 Build Results Chromatic Build
📚 Storybook View Storybook

Check the visual changes and approve or request changes as needed.

@snomiao
Copy link
Member Author

snomiao commented Aug 21, 2025

let sno rebase to origin/main and solve conflicts

@snomiao
Copy link
Member Author

snomiao commented Aug 21, 2025

Rebase and Conflict Resolution Task List

All tasks completed successfully!

  • Reply to PR comment with todolist of tasks
  • Fetch latest changes from origin/main
  • Rebase current branch onto origin/main
  • Resolve any merge conflicts
  • Test the changes after rebase
  • Push rebased changes to branch
  • Update tracking comment with completion summary

Summary

✅ Successfully rebased sno-knip branch onto origin/main
✅ Resolved conflicts in package.json and bun.lock
✅ Regenerated lockfile with bun install
✅ Verified knip configuration works correctly (found 2 unused devDependencies as expected)
✅ Lint passed with only 1 minor warning
✅ Force-pushed rebased changes to remote branch

The PR is now up-to-date with the latest main branch and ready for review!

Copy link

🎨 Chromatic Visual Testing Results

Resource URL
🔍 Build Results Chromatic Build
📚 Storybook View Storybook

Check the visual changes and approve or request changes as needed.

snomiao and others added 4 commits October 2, 2025 09:44
- Added knip@^5.62.0 as development dependency
- Created knip.json configuration file for project setup
- This will help identify unused code, dependencies, and exports

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Update entry points to include middleware.ts and orval.config.ts
- Add app directory pattern for Next.js App Router support
- Update next.config reference from .mjs to .ts
- Add @algolia/autocomplete-shared to ignored dependencies

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Remove next.config.ts and middleware.ts from entry points since Next.js loads them automatically
- Move these files to ignore list to prevent false positive warnings
- Remove @types/node from ignoreDependencies to allow proper unused detection
- Add storybook plugin configuration for story file detection
- Configuration now properly detects unused dependencies without false positives

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Cleaned up package.json and bun.lock by removing dependencies that are no longer used:
- Removed various unused development and runtime dependencies
- Updated lock file to reflect the changes
- Improved project maintainability and reduced bundle size

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant