Use an alias system instead of camelCase function - #3101
Merged
Merged
Conversation
- tests properly camelised comand - tests properly command with hyphen - move generation of documentation in src/cli/commands/index.js - move every command related stuff in src/cli/commands/index.js - tests some corner cases - delete every camelCase use in src/cli/commands/index.js and src/cli/commands/help.js
Contributor
Author
|
@arcanis I rebased after the last commits ;) |
arcanis
requested changes
Apr 20, 2017
| import * as version from './version.js'; commands['version'] = version; | ||
| import * as versions from './versions.js'; commands['versions'] = versions; | ||
| import * as why from './why.js'; commands['why'] = why; | ||
| import * as upgradeInteractive from './upgrade-interactive.js'; commands['upgradeInteractive'] = upgradeInteractive; |
Member
There was a problem hiding this comment.
It might be clearer to do something like this:
import * as bar from './bar';
import * as foo from './foo';
...
let commands = {
bar,
foo,
...
};What do you think?
Contributor
Author
There was a problem hiding this comment.
I think is A LOT clearer; i will change it!
| ); | ||
| }); | ||
|
|
||
| test.concurrent('should show help and ignore unsopported aliases', async () => { |
Member
There was a problem hiding this comment.
unsopported? :p
(same typo on 214 and 221 :)
Contributor
Author
There was a problem hiding this comment.
aaaah thanks and sorry XD
Member
|
Nice work! Just a typo to fix and I merge this 👍 I really feel like github should offer a way to edit PRs from the review interface, for cases like this ... |
Contributor
Author
|
@arcanis done! |
This was referenced Apr 28, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In this pull request I try to remove the camelCase function from src/cli/commands/index.js and
src/cli/commands/help.js and instead I use an alias system.
I move the existing aliases to unsupported-aliases.
We can't still remove the entire dependency
camelCasebecause global command use it.Finally I move every command-related stuff in src/cli/commands/index.js.
Test plan