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

component-hint

v0.4.3

Published

Linting tool for components projects and packages

Downloads

25

Readme

Component Hint

Component Hint is a linting tool for Component.io. The main goal is to detect nuisances prior to publication and alleviate debugging time (e.g. missing paths for local dependencies).

Implemented Checks

  • Ensures a given components contains a component.json file
  • Checks each local dependency exists in exactly one of the given paths
  • Detects any unused paths in the component.json file
  • Check each external dependency exists in exactly one of the given dependency paths (--dep-paths)
  • Check dependencies are only required at a single version through the project
  • Checks that a component doesn't have itself as a dependency
  • Checks that any files listed in the component.json file (i.e. scripts, styles, etc.) actually exist

Other Features

  • In the event a local dependency isn't resolved, it will give you a hint as to where you can find it (uses the given --lookupPaths option)
  • Skips folders with the same name as a dependency if it does not contain a component.json file
  • Recurses into dependencies and checks if there are any other dependency errors (this can be switched to warning level by using --warn-on-deps option)

To Do

  • Parse scripts for usages of require() and ensure those components exist in the component.json
  • Check that the name inside the component.json file is the name used for the folder
  • Other issues

Installation

npm install component-hint
./node_modules/.bin/component-hint

OR if installed globally component-hint can be accessed like any other component command

npm install -g component-hint
component hint

Usage

  Usage: component-hint [options] <component_path ...>

  Options:

    -h, --help                  output usage information
    -V, --version               output the version number
    -v, --verbose               Be verbose during tests. (cannot be used with --quiet
                                or --silent)
    -q, --quiet                 Display only the final outcome.
    -s, --silent                Suppress all output.
    -r, --recursive             Recurse into local and external dependencies.
    -d, --dep-paths <paths>     Colon separated list of paths to external
                                dependencies. (default: "./components")
    -w, --warn-on-deps          Errors caused by external dependencies will only
                                result in a warning and not return a fail status
                                code.
    -i, --ignore-paths <paths>  Colon separated list of paths component-hint should
                                ignore. (supports minimatch globbing)
    -l, --lookup-paths <paths>  Colon separated list of paths to check for the
                                existence of missing local dependencies. This is used
                                to give the user a hint where they can find them.
        --reporter <path>       Path to reporter file to use for output formatting.

  Examples:

    Check multiple component entry points
    $ component-hint /path/to/single/component /path/to/another/component

    Check multiple component entry point which exist in the same folder
    $ component-hint /path/to/multiple/component/folder/*/

License

Component Hint is distributed under the MIT License.