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

Add new `search` command #6661

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
8 participants
@thoov
Copy link
Contributor

commented Jan 11, 2017

Adds a new command called search. It currently supports 3 search modes: addon discovery, code discovery, and code exploration which are explained below.

Addon Discovery

The addon discovery mode allows you to search for addons based on a given keyword. This is a great way to discovery addons within the community:

ember search --addon 'i18n'

Code Discovery

The code discovery mode allows you to search all addons that contain a given code snippet. This is great to find other addons that are using a method or hook that you would like to learn more about. As an example, hooks within your index.js file such as: included, treeForApp, treeForPublic, etc. are not well documented. Here we can search to find other addons which are using one of these hooks:

ember search --code 'treeForPublic'

Code Exploration

The last mode is code exploration. This allows you to see actual code diffs based on that code snippet. Note that we must supply the exact addon name via --addon.

ember search --addon 'ember-intl' --code 'treeForPublic'

Slightly unrelated note: It would be interesting to explore (if the cli-core team hasn't already) a way to install global commands like this one via addons without having to add code to ember-cli's code base.

@Cryrivers

This comment has been minimized.

Copy link

commented Jan 11, 2017

nice to see such a feature integrated to Ember CLI! 👍

@rwjblue

This comment has been minimized.

Copy link
Contributor

commented Jan 11, 2017

Might be nice to pull from emberobserver.com's API instead of npm directly, at which point we could provide ratings, categories, etc...

@thoov

This comment has been minimized.

Copy link
Contributor Author

commented Jan 11, 2017

@rwjblue Sounds good. I will use emberobserver's and bring in ratings + categories

@thoov

This comment has been minimized.

Copy link
Contributor Author

commented Jan 11, 2017

Using emberobservers code search allow us to do this:

kapture 2017-01-11 at 15 56 46

@kategengler

This comment has been minimized.

Copy link
Contributor

commented Jan 12, 2017

Just for awareness, Ember Observer's API is about to change to JSONAPI. I plan to support both APIs for a short time but the old version has some serious performance issues so it needs to go.

@thoov

This comment has been minimized.

Copy link
Contributor Author

commented Jan 12, 2017

@kategengler Do you have a sample JSON output ready yet or a dev environment with the new response by chance?

@rondale-sc

This comment has been minimized.

Copy link
Contributor

commented Jan 22, 2017

@thoov Would it be possible to include a link to the github repo with the line number when doing code search so that it would be command clickable right from the terminal?

@thoov

This comment has been minimized.

Copy link
Contributor Author

commented Jan 23, 2017

@rondale-sc Good idea. I will add that

@thoov thoov force-pushed the thoov:search-command branch 2 times, most recently from 969f54c to ae64141 Feb 9, 2017

@homu

This comment has been minimized.

Copy link
Contributor

commented Feb 9, 2017

☔️ The latest upstream changes (presumably #6756) made this pull request unmergeable. Please resolve the merge conflicts.

Add new `search` command
Brings in the ember-cli-search addon which allows addon and code
searching from emberobserver. Sample commands are:

 * ember search --addon 'i18n'
 * ember search --code 'treeForPublic'
 * ember search --addon 'ember-intl' --code 'treeForPublic'

@thoov thoov force-pushed the thoov:search-command branch from ae64141 to a942c86 Feb 9, 2017

@thoov

This comment has been minimized.

Copy link
Contributor Author

commented Feb 9, 2017

@rwjblue @stefanpenner r? Also Im not sure why the build is failing. It looks to be pulling an old commit that I rebased over. Not sure if one of you could clear the cache or something.

@Turbo87 Turbo87 added the Enhancement label Feb 10, 2017

@homu

This comment has been minimized.

Copy link
Contributor

commented Feb 21, 2017

☔️ The latest upstream changes (presumably #6796) made this pull request unmergeable. Please resolve the merge conflicts.

@les2

This comment has been minimized.

Copy link
Contributor

commented Feb 26, 2017

this is awesome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.