Skip to content
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

feat(cli): allow hiding scripts from the help list #56

Merged
merged 4 commits into from
Sep 6, 2016
Merged

feat(cli): allow hiding scripts from the help list #56

merged 4 commits into from
Sep 6, 2016

Conversation

sxn
Copy link
Collaborator

@sxn sxn commented Sep 6, 2016

What: Allow scripts to be hidden from the help list.

Why: In order to allow having semi-private scripts - semi because they will still be runnable as long as you know they're there.

How: by changing the src/resolve-script-object-to-string.js::resolveScriptObjectToScript function so that if the hiddenFromHelp property is defined and truthy, undefined is returned.

Allows adding a 'hiddenFromHelp' property to a script object so that it does not show up in the help

list.
@codecov-io
Copy link

codecov-io commented Sep 6, 2016

Current coverage is 100% (diff: 100%)

Merging #56 into master will not change coverage

@@           master   #56   diff @@
===================================
  Files          11    11          
  Lines         242   246     +4   
  Methods         0     0          
  Messages        0     0          
  Branches        0     0          
===================================
+ Hits          242   246     +4   
  Misses          0     0          
  Partials        0     0          

Powered by Codecov. Last update 6a2e93c...438da51

@@ -32,7 +44,7 @@ test('resolves default to the script if it is a string', t => {
t.is(result, 'string')
})

test('does not resolve a script object without a script or defualt', t => {
test('does not resolve a script object without a script or default', t => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

Scripts should not be ignored from the help list simply because the 'hiddenFromHelp' key is present.

They should only be hidden if it's present and truthy. This fixes that and the test that was

supposed to ensure that.

#41
@kentcdodds
Copy link
Collaborator

LGTM

@kentcdodds
Copy link
Collaborator

@sxn, thanks so much for this feature! I've added you as a collaborator on the project. Accept that invitation and feel free to squash and merge this PR yourself :)

Feel free to watch the repo and continue making contributions as you feel the need/desire :) Thanks again!

@sxn
Copy link
Collaborator Author

sxn commented Sep 6, 2016

Nice! Thanks, will do. :)

@kentcdodds
Copy link
Collaborator

Oh one sec! Could you add some docs in the README for this feature?

@sxn
Copy link
Collaborator Author

sxn commented Sep 6, 2016

Sure thing!

sxn added 2 commits September 6, 2016 22:47
Update README.md with instructions about hiddenFromHelp.

#41
Add missing comma so that the example JS object in the README is properly formatted.

#41
@kentcdodds
Copy link
Collaborator

LGTM

@sxn sxn merged commit 825a03a into sezna:master Sep 6, 2016
Sign up for free to 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.

3 participants