Skip to content

chore: update knip config & remove unused code - #2126

Merged
danielroe merged 4 commits into
npmx-dev:mainfrom
webpro:chore/remove-unused-code
Mar 18, 2026
Merged

chore: update knip config & remove unused code#2126
danielroe merged 4 commits into
npmx-dev:mainfrom
webpro:chore/remove-unused-code

Conversation

@webpro

Copy link
Copy Markdown
Contributor

🔗 Linked issue

🧭 Context

After adding support for auto-imports in the Nuxt plugin, we can reduce Knip config. This revealed unused code, which is also deleted in this PR.

📚 Description

  • Removes entry patterns that the Knip plugin adds (better)
  • Removes unused code (fully automated using knip --fix ↔ oxlint ↔ remove-unused-vars)
  • Adds --exclude dependencies for production mode in CI (for flexible dev/deps division)

Please review the removals, let me know what we should restore/ignore!

@vercel

vercelBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

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

ProjectDeploymentActionsUpdated (UTC)
npmx.devReadyReadyPreview, CommentMar 18, 2026 5:51am
2 Skipped Deployments
ProjectDeploymentActionsUpdated (UTC)
docs.npmx.devIgnoredIgnoredPreviewMar 18, 2026 5:51am
npmx-lunariaIgnoredIgnoredMar 18, 2026 5:51am

Request Review

@webprowebpro changed the title chore: opdate knip config & remove unused codechore: update knip config & remove unused codeMar 18, 2026
@codecov

codecovBot commented Mar 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing linesPatch %Lines
app/utils/atproto/likes.ts0.00%2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@webpro
webpro marked this pull request as ready for review March 18, 2026 05:52
@coderabbitai

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR systematically reduces the public API surface of the codebase by converting numerous exported types, interfaces, functions, and constants to internal declarations. Changes span Vue component types, composables, configuration files, utility modules, and schema definitions. Key modifications include removing export keywords from interfaces in Vue components, making helper functions and environment detection constants private, deleting unused validation schemas, removing the parseBasicFrontmatter utility function, and refactoring knip configuration settings. The CI workflow is also updated with an additional knip command flag for dependency exclusion.

Possibly related PRs

Suggested reviewers

  • danielroe
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check nameStatusExplanation
Description check✅ PassedThe PR description clearly relates to the changeset, explaining the context, objectives, and changes made throughout the pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can make CodeRabbit's review stricter and more nitpicky using the `assertive` profile, if that's what you prefer.

Change the reviews.profile setting to assertive to make CodeRabbit's nitpick more issues in your PRs.

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
lunaria/components.ts (1)

144-146: Consider defensive handling for localisation lookup.

The non-null assertion on line 146 relies on upstream filtering to guarantee the localisation exists. While the current data flow is safe (the find is within missingFiles.map which only contains files with a matching localisation), a defensive check or early return would guard against future refactoring that might alter the filtering logic.

The same pattern appears at lines 177–179, 258, and 285–287.

♻️ Optional defensive pattern
 ${missingFiles.map(file => {
const localization = file.localizations.find(
localizationItem => localizationItem.lang === lang,
- )!+ )+ if (!localization) return ''
return html`
knip.ts (1)

42-43: Add a brief rationale for these ignores to prevent future false-negative confusion.

ignoreUnresolved/ignoreFiles here are non-obvious and likely intentional; a short inline note will make later clean-ups safer.

♻️ Suggested tweak
- ignoreUnresolved: ['#oauth/config'],- ignoreFiles: ['app/components/Tooltip/Announce.vue', 'app/components/UserCombobox.vue'],+ /** Nuxt resolution pattern not statically resolved by Knip */+ ignoreUnresolved: ['#oauth/config'],+ /** Known Knip false-positives for auto-registered/template-resolved components */+ ignoreFiles: ['app/components/Tooltip/Announce.vue', 'app/components/UserCombobox.vue'],

As per coding guidelines "Add comments only to explain complex logic or non-obvious implementations".


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5a001bcf-4753-4c9a-a2b0-ac92412153a7

📥 Commits

Reviewing files that changed from the base of the PR and between ad2b174 and 41d586a.

📒 Files selected for processing (19)
  • .github/workflows/ci.yml
  • app/components/Compare/ComparisonGrid.vue
  • app/components/Package/ListControls.vue
  • app/components/Select/Field.vue
  • app/composables/npm/useAlgoliaSearch.ts
  • app/composables/npm/useNpmSearch.ts
  • app/composables/useVirtualInfiniteScroll.ts
  • app/utils/atproto/likes.ts
  • app/utils/atproto/profile.ts
  • config/env.ts
  • knip.ts
  • lunaria/components.ts
  • server/utils/diff.ts
  • shared/schemas/atproto.ts
  • shared/schemas/package.ts
  • shared/schemas/publicUserSession.ts
  • shared/schemas/social.ts
  • shared/schemas/user.ts
  • shared/utils/parse-basic-frontmatter.ts
💤 Files with no reviewable changes (5)
  • shared/schemas/social.ts
  • shared/schemas/atproto.ts
  • shared/schemas/publicUserSession.ts
  • server/utils/diff.ts
  • shared/utils/parse-basic-frontmatter.ts

@danielroedanielroe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🔥

@danielroe
danielroe added this pull request to the merge queueMar 18, 2026
Merged via the queue into npmx-dev:main with commit a482999Mar 18, 2026
21 checks passed
@github-actionsgithub-actionsBot mentioned this pull request Mar 18, 2026
Sign up for freeto 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.

2 participants

@webpro@danielroe