-
-
Notifications
You must be signed in to change notification settings - Fork 300
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
Add --no-2fa
flag
#515
Add --no-2fa
flag
#515
Conversation
This should probably be a config too: https://github.com/sindresorhus/np#config |
Any plans to release new np with this feature? |
I added This actually made me realize that in the current implementation there is no way to force |
Thank you very much for this PR!! I hope it gets merged soon. I have been using your fork directly now as a workaround. |
@pixelastic I think #505 gives examples about testing. And personally, I hope #505 can be merged before this one. |
@chinesedfan Thanks for the link to the test examples. I don't have much time to work on it right now, so I'd rather wait until #505 is reviewed and merged officially to use it as a basis for tests. |
#505 is now merged. |
@@ -108,6 +109,7 @@ Currently, these are the flags you can configure: | |||
- `yarn` - Use yarn if possible (`true` by default). | |||
- `contents` - Subdirectory to publish (`.` by default). | |||
- `releaseDraft` - Open a GitHub release draft after releasing (`true` by default). | |||
- `2Fa` - Enable 2FA on new packages (`true` by default) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `2Fa` - Enable 2FA on new packages (`true` by default) | |
- `2fa` - Enable 2FA on new packages (`true` by default) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will require some code change. The CLI code converts --no-2fa
to { "2FA": false }
(yes, including the capitalized F
), which is in turn passed to the ui.js
module as an option.
If you want the option to be named 2fa
(without the capitalization), we'll have to normalize it at some point (ideally normalizing the CLI to 2fa
instead of 2FA
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, let's do that. 2Fa
is really strange. Ideally, meow
would have some kind of transform option for flags, but it doesn't.
|
Co-Authored-By: Sindre Sorhus <[email protected]>
How can I help this move forward? |
|
@sindresorhus how do you want me to commit this? I can fork & rebase this PR, and open another superseeding, or you could commit this directly to the PR if you've got edit permissions.
|
@G-Rath I am surprised that the fix is that simple. I thought a change in meow itself was necessary. Do those simple changes really work? |
Yup, they really work, at least on my machine - you can try them out yourself by install this PR & then applying the patch:
You can use
An ideal solution would be |
Anyone is free to take the changes, fix the remaining issues, and do a new PR. |
Thanks @G-Rath for finishing what I started but never had the time to finish. Well done! |
Hello,
This adds a
--no-2fa
CLI option (as discussed in #398) to bypass enabling 2FA on new packages.The check is pretty trivial; if the
2Fa
option is set to false, the task is skipped. Default value istrue
.The weird capitalization is because that's how CLI options starting with a number are converted internally.
I wanted to add tests to the feature but could not find similar tests I could use as a basis to write my own. Happy to add tests in exchange with a few pointers on how to get started.
Fixes #398