8000 Feature Request: allow scripts to be ignored from list · Issue #8 · ruyadorno/ntl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Feature Request: allow scripts to be ignored from list #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fiznool opened this issue Sep 4, 2016 · 8 comments
Closed

Feature Request: allow scripts to be ignored from list #8

fiznool opened this issue Sep 4, 2016 · 8 comments

Comments

@fiznool
Copy link
fiznool commented Sep 4, 2016

If you prefer to install npm modules locally, and run them via npm run, you can install ntl in this way:

npm install --save-dev ntl

Then you can configure in your package.json:

"scripts": {
  "start": "ntl",
  ...
}

This means you don't need to install ntl globally, and instead you can run npm start to bring up the ntl options.

The issue is, ntl will also display start as one of the items in the list. It would be nice to ignore this script via a command line flag. For example:

"scripts": {
  "start": "ntl --ignore start",
  ...
}
@fiznool fiznool changed the title Suggestion: allow scripts to be ignored from list Feature Request: allow scripts to be ignored from list Sep 5, 2016
@millette
Copy link
millette commented Aug 20, 2018

Or in general, for example, a precommit script with lint-staged.

The ntl package.json field could be expanded with a blacklist array option. In my case, it would be:

  "scripts": {
    "ntl": "ntl",
    "precommit": "lint-staged",
    "dev": "..."
  },
  "ntl": {
    "blacklist": ["precommit", "ntl"],
    "descriptions": {
      "dev": "Launch dev mode"
    }
  }

@mischah
Copy link
Contributor
mischah commented Feb 15, 2019

👍 for the blacklist option.

Excluding npm start isn’t possible because it’s just a personal use case.

I just wonder if this should be another key in the package.json or if it would make more sense to have an option for that like:

-b, --blacklist       Exclude scripts from the list      [list]

or:

-e, --exclude       Exclude scripts from the list      [list]

Example:

ntl --exclude=precommit,ntl

@mischah
Copy link
Contributor
mischah commented Feb 15, 2019

Hej @ruyadorno,

would you accept a PR for that? :octocat:

@ruyadorno
Copy link
Owner

sure thing! my thoughts:

  • naming-wise I think either --exclude or --ignore are much better options
  • ideally we should support both package.json field AND cli options (but if you want to start with just one that's fine 👍 )
  • another improvement I think could be useful is to be able to accept * in order to ignore a given prefix/suffix e.g: --ignore=pre* to ignore all pre-scripts

@mischah
Copy link
Contributor
mischah commented Feb 22, 2019

@paquan and me are currently working on this.

We have decided to name the option -e --> --exclude to prevent an alias name clash with -i -> --info.

We skip support of defining the excludes via an exclude key in the package.json because this should be done with #23.

@mischah
Copy link
Contributor
mischah commented Feb 22, 2019

PR is created :octocat:

@ruyadorno
Copy link
Owner

Landed on v3.2.0

thank you so much @mischah @Paquan 🎉

@mischah
Copy link
Contributor
mischah commented Mar 8, 2019

It was our pleasure and we hat lots of fun working together on this 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
0