npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@alexlafroscia/ember-unused-component-detector

v1.0.8

Published

Locate Ember components that are not actually used in your application

Downloads

13

Readme

Ember Unused Component Detector

CI

A little script for finding unused components in your Ember application

In a large, long-standing codebase, it can be hard to keep track of whether all components are actually used. It's easy to stop using a component and forget to remove it, and because Ember does not do tree-shaking yet, those components will end up in your build output regardless of whether they're used or not.

This script can help suss out these unused components by

  1. Looking into your app directory to find all your component names
  2. Searching your app for their invocation, either in the Octane style, Classic style, or through the component helper

Each found component will be reported in the first found style, and a warning printed if the component cannot be found.

Gotchas

  • Dynamic component names provided to the component helper cannot be found
  • Components are not removed; just reported on. Please double-check your app yourself before removing anything!
  • The contents of files in the app/components and app/templates/components directories are not verified; if the file exists at all it is assumed it is a component!
  • Only the app directory of is searched, so avoid false-positives form your tests; if the test is the only place it's used, it should be removed!

System Requirements

How do I use this?

This tool is best run through npx/yarn dlx

# It's assumed that the current directory is your Ember app if a path is not provided
yarn dlx @alexlafroscia/ember-unused-component-detector ./optional-path-to-project

Debugging

If you want more information about what is going on under-the-hood, you can set the DEBUG=eucd:* environment variable before running the script.

Contributing

Yarn 2 is used for this package; if you have any yarn installation on your computer, you'll be good-to-go!

Run husky install after cloning for linting-on-commit!