8d4d766bac7b7dc3a7b11dce12ce0468d5e49c91

Author
Will Mendes <willmendesneto@gmail.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

frontend: add frontend search commands (#7863)

Diff

This diff is truncated to protect this page.

  1diff --git a/plugins/frontend-search/README.md b/plugins/frontend-search/README.md
  2index 24f82b26264dd7e0cd3b1dda59d1f3747782a176..bf76902fd8fb5a81c01a1a769dab56f102e53b79 100644
  3--- a/plugins/frontend-search/README.md
  4+++ b/plugins/frontend-search/README.md
  5@@ -1,9 +1,8 @@
  6-## Introduction ##
  7+## Introduction
  8 
  9 > Searches for your frontend web development made easier
 10 
 11-
 12-## Installation ##
 13+## Installation
 14 
 15 Open your `~/.zshrc` file and enable the `frontend-search` plugin:
 16 
 17@@ -13,54 +12,59 @@ plugins=( ... frontend-search)
 18 
 19 ```
 20 
 21-
 22-## Usage ##
 23+## Usage
 24 
 25 You can use the frontend-search plugin in these two forms:
 26 
 27-* `frontend <context> <term> [more terms if you want]`
 28-* `<context> <term> [more terms if you want]`
 29+- `frontend <context> <term> [more terms if you want]`
 30+- `<context> <term> [more terms if you want]`
 31 
 32 For example, these two are equivalent:
 33 
 34 ```zsh
 35-$ frontend angularjs dependency injection
 36-$ angularjs dependency injection
 37+$ angular dependency injection
 38+# Will turn into ...
 39+$ frontend angular dependency injection
 40 ```
 41 
 42 Available search contexts are:
 43 
 44-| context       | URL                                                                      |
 45-|---------------|--------------------------------------------------------------------------|
 46-| angular(>=2.0)| `https://angular.io/?search=`                                             |
 47-| angularjs(1.x)| `https://google.com/search?as_sitesearch=angularjs.org&as_q=`
 48-| aurajs        | `http://aurajs.com/api/#stq=`                                            |
 49-| bem           | `https://google.com/search?as_sitesearch=bem.info&as_q=`                 |
 50-| bootsnipp     | `https://bootsnipp.com/search?q=`                                         |
 51-| caniuse       | `https://caniuse.com/#search=`                                            |
 52-| codepen       | `https://codepen.io/search?q=`                                            |
 53-| compassdoc    | `http://compass-style.org/search?q=`                                     |
 54-| cssflow       | `http://www.cssflow.com/search?q=`                                       |
 55-| dartlang      | `https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:`  |
 56-| emberjs       | `https://emberjs.com/api/#stp=1&stq=`                                     |
 57-| fontello      | `http://fontello.com/#search=`                                           |
 58-| html5please   | `http://html5please.com/#`                                               |
 59-| jquery        | `https://api.jquery.com/?s=`                                             |
 60-| lodash        | `https://devdocs.io/lodash/index#`                                       |
 61-| mdn           | `https://developer.mozilla.org/search?q=`                                |
 62-| npmjs         | `https://www.npmjs.com/search?q=`                                        |
 63-| qunit         | `https://api.qunitjs.com/?s=`                                            |
 64-| reactjs       | `https://google.com/search?as_sitesearch=facebook.github.io/react&as_q=` |
 65-| smacss        | `https://google.com/search?as_sitesearch=smacss.com&as_q=`               |
 66-| stackoverflow | `https://stackoverflow.com/search?q=`                                     |
 67-| unheap        | `http://www.unheap.com/?s=`                                              |
 68+| context       | URL                                                                         |
 69+| ------------- | --------------------------------------------------------------------------- |
 70+| angular       | `https://angular.io/?search=`                                               |
 71+| angularjs     | `https://google.com/search?as_sitesearch=angularjs.org&as_q=`               |
 72+| bem           | `https://google.com/search?as_sitesearch=bem.info&as_q=`                    |
 73+| bootsnipp     | `https://bootsnipp.com/search?q=`                                           |
 74+| bundlephobia  | `https://bundlephobia.com/result?p=`                                        |
 75+| caniuse       | `https://caniuse.com/#search=`                                              |
 76+| codepen       | `https://codepen.io/search?q=`                                              |
 77+| compassdoc    | `http://compass-style.org/search?q=`                                        |
 78+| cssflow       | `http://www.cssflow.com/search?q=`                                          |
 79+| dartlang      | `https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:`     |
 80+| emberjs       | `https://www.google.com/search?as_sitesearch=emberjs.com/&as_q=`            |
 81+| flowtype      | `https://google.com/search?as_sitesearch=flow.org/en/docs/&as_q=`           |
 82+| fontello      | `http://fontello.com/#search=`                                              |
 83+| github        | `https://github.com/search?q=`                                              |
 84+| html5please   | `https://html5please.com/#`                                                 |
 85+| jestjs        | `https://www.google.com/search?as_sitesearch=jestjs.io&as_q=`               |
 86+| jquery        | `https://api.jquery.com/?s=`                                                |
 87+| lodash        | `https://devdocs.io/lodash/index#`                                          |
 88+| mdn           | `https://developer.mozilla.org/search?q=`                                   |
 89+| nodejs        | `https://www.google.com/search?as_sitesearch=nodejs.org/en/docs/&as_q=`     |
 90+| npmjs         | `https://www.npmjs.com/search?q=`                                           |
 91+| qunit         | `https://api.qunitjs.com/?s=`                                               |
 92+| reactjs       | `https://google.com/search?as_sitesearch=facebook.github.io/react&as_q=`    |
 93+| smacss        | `https://google.com/search?as_sitesearch=smacss.com&as_q=`                  |
 94+| stackoverflow | `https://stackoverflow.com/search?q=`                                       |
 95+| typescript    | `https://google.com/search?as_sitesearch=www.typescriptlang.org/docs&as_q=` |
 96+| unheap        | `http://www.unheap.com/?s=`                                                 |
 97+| vuejs         | `https://www.google.com/search?as_sitesearch=vuejs.org&as_q=`               |
 98 
 99 If you want to have another context, open an Issue and tell us!
100 
101-
102 ## Author
103 
104 **Wilson Mendes (willmendesneto)**
105diff --git a/plugins/frontend-search/_frontend-search.sh b/plugins/frontend-search/_frontend-search.sh
106index 573aa3aaef8c01c7d952b7b2c39cdbe19d754a52..c59640e743386993127fe5ea9197c54c4f95f23f 100644
107--- a/plugins/frontend-search/_frontend-search.sh
108+++ b/plugins/frontend-search/_frontend-search.sh
109@@ -17,28 +17,34 @@ function _frontend() {
110   frontend_points=( "${(f)mapfile[$CONFIG]//$HOME/~}" )
111 
112   commands=(
113-    'jquery: Search in jQuery website'
114-    'mdn: Search in MDN website'
115-    'compassdoc: Search in COMPASS website'
116-    'html5please: Search in HTML5 Please website'
117+    'angular: Search in Angular.io website'
118+    'angularjs: Search in docs.angularjs.org website'
119+    'bem: Search in BEM website'
120+    'bootsnipp: Search in bootsnipp website'
121+    'bundlephobia: Search in Bundlephobia website'
122     'caniuse: Search in Can I Use website'
123-    'aurajs: Search in AuraJs website'
124+    'codepen: Search in codepen website'
125+    'compassdoc: Search in COMPASS website'
126+    'cssflow: Search in cssflow website'
127     'dartlang: Search in Dart website'
128+    'emberjs: Search in Ember website'
129+    'flowtype: Search in Flowtype website'
130+    'fontello: Search in fontello website'
131+    'github: Search in GitHub website'
132+    'html5please: Search in HTML5 Please website'
133+    'jestjs: Search in Jest website'
134+    'jquery: Search in jQuery website'
135     'lodash: Search in Lo-Dash website'
136+    'mdn: Search in MDN website'
137+    'nodejs: Search in NodeJS website'
138+    'npmjs: Search in NPMJS website'
139     'qunit: Search in Qunit website'
140-    'fontello: Search in fontello website'
141-    'bootsnipp: Search in bootsnipp website'
142-    'cssflow: Search in cssflow website'
143-    'codepen: Search in codepen website'
144-    'unheap: Search in unheap website'
145-    'bem: Search in BEM website'
146-    'smacss: Search in SMACSS website'
147-    'angular: Search in Angular website for Angular 2.x'
148-    'angularjs: Search in Angular website for Angular 1.x'
149     'reactjs: Search in React website'
150-    'emberjs: Search in Ember website'
151+    'smacss: Search in SMACSS website'
152     'stackoverflow: Search in StackOverflow website'
153-    'npmjs: Search in NPMJS website'
154+    'typescript: Search in TypeScript website'
155+    'unheap: Search in unheap website'
156+    'vuejs: Search in VueJS website'
157   )
158 
159   _arguments -C \
160@@ -67,9 +73,6 @@ function _frontend() {
161         caniuse)
162           _describe -t points "Warp points" frontend_points && ret=0
163           ;;
164-        aurajs)
165-          _describe -t points "Warp points" frontend_points && ret=0
166-          ;;
167         dartlang)
168           _describe -t points "Warp points" frontend_points && ret=0
169           ;;
170@@ -82,6 +85,9 @@ function _frontend() {
171         fontello)
172           _describe -t points "Warp points" frontend_points && ret=0
173           ;;
174+        github)
175+          _describe -t points "Warp points" frontend_points && ret=0
176+          ;;
177         bootsnipp)
178           _describe -t points "Warp points" frontend_points && ret=0
179           ;;
180@@ -100,9 +106,6 @@ function _frontend() {
181         smacss)
182           _describe -t points "Warp points" frontend_points && ret=0
183           ;;
184-        angular)
185-          _describe -t points "Warp points" frontend_points && ret=0
186-        ;;
187         angularjs)
188           _describe -t points "Warp points" frontend_points && ret=0
189           ;;
190@@ -118,6 +121,24 @@ function _frontend() {
191         npmjs)
192           _describe -t points "Warp points" frontend_points && ret=0
193           ;;
194+        bundlephobia)
195+          _describe -t points "Warp points" frontend_points && ret=0
196+          ;;
197+        flowtype)
198+          _describe -t points "Warp points" frontend_points && ret=0
199+          ;;
200+        typescript)
201+          _describe -t points "Warp points" frontend_points && ret=0
202+          ;;
203+        vuejs)
204+          _describe -t points "Warp points" frontend_points && ret=0
205+          ;;
206+        nodejs)
207+          _describe -t points "Warp points" frontend_points && ret=0
208+          ;;
209diff --git a/plugins/frontend-search/frontend-search.plugin.zsh b/plugins/frontend-search/frontend-search.plugin.zsh
210index bef5992a32ce7ff48098c851c1794024b8f9f600..87243be1376e91a9fdb5ed9f0f3c48fe2a16f517 100644
211--- a/plugins/frontend-search/frontend-search.plugin.zsh
212+++ b/plugins/frontend-search/frontend-search.plugin.zsh
213@@ -1,25 +1,31 @@
214 alias angular='frontend angular'
215 alias angularjs='frontend angularjs'
216-alias aurajs='frontend aurajs'
217 alias bem='frontend bem'
218 alias bootsnipp='frontend bootsnipp'
219+alias bundlephobia='frontend bundlephobia'
220 alias caniuse='frontend caniuse'
221 alias codepen='frontend codepen'
222 alias compassdoc='frontend compassdoc'
223 alias cssflow='frontend cssflow'
224 alias dartlang='frontend dartlang'
225 alias emberjs='frontend emberjs'
226+alias flowtype='frontend flowtype'
227 alias fontello='frontend fontello'
228+alias github='frontend github'
229 alias html5please='frontend html5please'
230+alias jestjs='frontend jestjs'
231 alias jquery='frontend jquery'
232 alias lodash='frontend lodash'
233 alias mdn='frontend mdn'
234+alias nodejs='frontend nodejs'
235 alias npmjs='frontend npmjs'
236 alias qunit='frontend qunit'
237 alias reactjs='frontend reactjs'
238 alias smacss='frontend smacss'
239 alias stackoverflow='frontend stackoverflow'
240+alias typescript='frontend typescript'
241 alias unheap='frontend unheap'
242+alias vuejs='frontend vuejs'
243 
244 function frontend() {
245   emulate -L zsh
246@@ -29,26 +35,32 @@ function frontend() {
247   urls=(
248     angular        'https://angular.io/?search='
249     angularjs      'https://google.com/search?as_sitesearch=angularjs.org&as_q='
250-    aurajs         'http://aurajs.com/api/#stq='
251     bem            'https://google.com/search?as_sitesearch=bem.info&as_q='
252     bootsnipp      'https://bootsnipp.com/search?q='
253+    bundlephobia   'https://bundlephobia.com/result?p='
254     caniuse        'https://caniuse.com/#search='
255     codepen        'https://codepen.io/search?q='
256     compassdoc     'http://compass-style.org/search?q='
257     cssflow        'http://www.cssflow.com/search?q='
258     dartlang       'https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:'
259-    emberjs        'https://emberjs.com/api/#stp=1&stq='
260+    emberjs        'https://www.google.com/search?as_sitesearch=emberjs.com/&as_q='
261+    flowtype       'https://google.com/search?as_sitesearch=flow.org/en/docs/&as_q='
262     fontello       'http://fontello.com/#search='
263-    html5please    'http://html5please.com/#'
264+    github         'https://github.com/search?q='
265+    html5please    'https://html5please.com/#'
266+    jestjs         'https://www.google.com/search?as_sitesearch=jestjs.io&as_q='
267     jquery         'https://api.jquery.com/?s='
268     lodash         'https://devdocs.io/lodash/index#'
269     mdn            'https://developer.mozilla.org/search?q='
270+    nodejs         'https://www.google.com/search?as_sitesearch=nodejs.org/en/docs/&as_q='
271     npmjs          'https://www.npmjs.com/search?q='
272     qunit          'https://api.qunitjs.com/?s='
273     reactjs        'https://google.com/search?as_sitesearch=facebook.github.io/react&as_q='
274     smacss         'https://google.com/search?as_sitesearch=smacss.com&as_q='
275     stackoverflow  'https://stackoverflow.com/search?q='
276+    typescript     'https://google.com/search?as_sitesearch=www.typescriptlang.org/docs&as_q='
277     unheap         'http://www.unheap.com/?s='
278+    vuejs          'https://www.google.com/search?as_sitesearch=vuejs.org&as_q='
279   )
280 
281   # show help for command list
282@@ -59,9 +71,9 @@ function frontend() {
283       print -P "%Uterm%u and what follows is what will be searched for in the %Ucontext%u website,"
284       print -P "and %Ucontext%u is one of the following:"
285       print -P ""
286-      print -P "  angular (>= 2.0), angularjs (1.x), aurajs, bem, bootsnipp, caniuse, codepen,"
287-      print -P "  compassdoc, cssflow, dartlang, emberjs, fontello, html5please, jquery,"
288-      print -P "  lodash, mdn, npmjs, qunit, reactjs, smacss, stackoverflow, unheap"
289+      print -P "  angular, angularjs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow,"
290+      print -P "  dartlang, emberjs, fontello, flowtype, github, html5please, jestjs, jquery, lodash,"
291+      print -P "  mdn, npmjs, nodejs, qunit, reactjs, smacss, stackoverflow, unheap, vuejs, bundlephobia"
292       print -P ""
293       print -P "For example: frontend npmjs mocha (or just: npmjs mocha)."
294       print -P ""
295@@ -75,9 +87,9 @@ function frontend() {
296     echo ""
297     echo "Valid contexts are:"
298     echo ""
299-    echo "  angular (>= 2.0), angularjs (1.x), aurajs, bem, bootsnipp, caniuse, codepen,"
300-    echo "  compassdoc, cssflow, dartlang, emberjs, fontello, html5please, jquery,"
301-    echo "  lodash, mdn, npmjs, qunit, reactjs, smacss, stackoverflow, unheap"
302+    echo "  angular, angularjs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow,"
303+    echo "  dartlang, emberjs, fontello, github, html5please, jest, jquery, lodash,"
304+    echo "  mdn, npmjs, nodejs, qunit, reactjs, smacss, stackoverflow, unheap, vuejs, bundlephobia"
305     echo ""
306     return 1
307   fi