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

idea-exclude

v1.3.0

Published

Excludes directories in Idea environments

Downloads

118

Readme

idea-exclude

Some your .ideas better be excluded, especially in monorepos

It just updates your IDEA settings. Work with a whole JetBrains product family

🤷‍♂️ why? Cause WebStorm just hangs on a medium size monorepo and you need help it a little

yarn add idea-exclude

# usage
idea-exclude group glob

# exclude all node_modules in the "packages"
idea-exclude node_modules "packages/**/node_modules"

# exclude all node_modules but not in some root directories
idea-exclude node_modules "!(build|node_modules)/**/node_modules"

# can accept a list of files to exclude
idea-exclude custom-files this and this

# set __tests__ as test roots
idea-exclude tests --test-root "**/__tests__"
# set src as source roots
idea-exclude tests --source-root "!(build|node_modules)/**/src"

This project excludes own dist folder, having .idea configuration a few levels above. To enable discoverability of configuration "above" - set the corresponding flag

idea-exclude build dist --lookabove

IDEA platform documentation related to controlled features can be found at

  • https://www.jetbrains.com/help/idea/testing.html#add-test-root
  • https://www.jetbrains.com/help/webstorm/configuring-project-structure.html

API

Exclusion API requires 3 arguments:

  • project root, where your settings (.idea/project.iml) can be found
  • a group name - custom (even empty) string to "scope" changes - you can remove all node_modules as one group, and remove all other products you are not interested in as another.
  • list of files as an array of strings or a glob.
import {exclude, excludeByGlob} from 'idea-exclude';

// excludes
excludeByGlob(process.cwd(), 'all my node_modules', '**/node_modules');
exclude(process.cwd(), 'named-group', ['list', 'of', 'files'])

Example with bolt

const workspaces = await bolt.getWorkspaces();
// as a list of files
exclude(process.cwd(), "monorepo", workspaces.map(({ dir }) => `${dir}/node_modules`));
// or as a glob
excludeByGlob(process.cwd(), "monorepo", `{${workspaces.map(({ dir }) => dir).join(",")}}/node_modules`);

Controlling verbosity level

idea-exclude uses diary for logging and in order to increase verbosity on the output one has to provide ENV variable

DEBUG="idea-exclude:*" idea-exclude node_modules "packages/**/node_modules"

In order to increase verbosity while using API use dedicated debug command

import {debug as enabledIdeaExcludeDebug} from 'idea-exclude';

enabledIdeaExcludeDebug();

Prior art

The original version created by Aleksandr "Sasha" Motsjonov.

Licence

MIT