├── .gitignore ├── .gitattributes ├── icon.png ├── .travis.yml ├── icons ├── class.png ├── const.png ├── function.png ├── interface.png ├── type-alias.png ├── class-deprecated.png ├── const-deprecated.png ├── function-deprecated.png ├── interface-deprecated.png └── type-alias-deprecated.png ├── screenshot.png ├── lib ├── constants.js └── rxjs.js ├── .editorconfig ├── index.js ├── package.json ├── license ├── readme.md ├── test.js └── info.plist /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.js text eol=lf 3 | -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamVerschueren/alfred-rxjs/HEAD/icon.png -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '10' 4 | - '8' 5 | - '6' 6 | -------------------------------------------------------------------------------- /icons/class.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamVerschueren/alfred-rxjs/HEAD/icons/class.png -------------------------------------------------------------------------------- /icons/const.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamVerschueren/alfred-rxjs/HEAD/icons/const.png -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamVerschueren/alfred-rxjs/HEAD/screenshot.png -------------------------------------------------------------------------------- /icons/function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamVerschueren/alfred-rxjs/HEAD/icons/function.png -------------------------------------------------------------------------------- /icons/interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamVerschueren/alfred-rxjs/HEAD/icons/interface.png -------------------------------------------------------------------------------- /icons/type-alias.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamVerschueren/alfred-rxjs/HEAD/icons/type-alias.png -------------------------------------------------------------------------------- /icons/class-deprecated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamVerschueren/alfred-rxjs/HEAD/icons/class-deprecated.png -------------------------------------------------------------------------------- /icons/const-deprecated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamVerschueren/alfred-rxjs/HEAD/icons/const-deprecated.png -------------------------------------------------------------------------------- /icons/function-deprecated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamVerschueren/alfred-rxjs/HEAD/icons/function-deprecated.png -------------------------------------------------------------------------------- /icons/interface-deprecated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamVerschueren/alfred-rxjs/HEAD/icons/interface-deprecated.png -------------------------------------------------------------------------------- /icons/type-alias-deprecated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamVerschueren/alfred-rxjs/HEAD/icons/type-alias-deprecated.png -------------------------------------------------------------------------------- /lib/constants.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | exports.BASE_URL = 'https://rxjs-dev.firebaseapp.com'; 3 | exports.TYPES = new Set(['class', 'const', 'function', 'interface', 'type-alias']); 4 | exports.ONE_DAY = 86400000; 5 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [{package.json,*.yml}] 11 | indent_style = space 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const alfy = require('alfy'); 3 | const rxjs = require('./lib/rxjs'); 4 | 5 | rxjs.getDocs() 6 | .then(methods => { 7 | const items = alfy 8 | .inputMatches(methods, 'title') 9 | .map(method => { 10 | return { 11 | title: method.title, 12 | subtitle: method.type, 13 | autocomplete: method.title, 14 | arg: method.url, 15 | quicklookurl: method.url, 16 | icon: method.icon 17 | }; 18 | }); 19 | 20 | alfy.output(items); 21 | }); 22 | -------------------------------------------------------------------------------- /lib/rxjs.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const alfy = require('alfy'); 3 | const constants = require('./constants'); 4 | 5 | const getIcon = item => { 6 | if (!constants.TYPES.has(item.docType)) { 7 | return; 8 | } 9 | 10 | const moderator = item.stability === 'deprecated' ? '-deprecated' : ''; 11 | 12 | return { 13 | path: `./icons/${item.docType}${moderator}.png` 14 | }; 15 | }; 16 | 17 | const mapItem = (item, type) => ({ 18 | title: item.title, 19 | url: `${constants.BASE_URL}/${item.path}`, 20 | type: item.stability ? `${type} - ${item.stability}` : type, 21 | icon: getIcon(item) 22 | }); 23 | 24 | exports.getDocs = () => alfy 25 | .fetch(`${constants.BASE_URL}/generated/docs/api/api-list.json`, { 26 | maxAge: constants.ONE_DAY, 27 | transform: ([index, operators]) => { 28 | return [ 29 | ...index.items.map(item => mapItem(item, 'Observable')), 30 | ...operators.items.map(item => mapItem(item, 'operator')) 31 | ]; 32 | } 33 | }); 34 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "alfred-rxjs", 3 | "version": "0.3.1", 4 | "description": "Search through the RxJS documentation", 5 | "license": "MIT", 6 | "repository": "SamVerschueren/alfred-rxjs", 7 | "author": { 8 | "name": "Sam Verschueren", 9 | "email": "sam.verschueren@gmail.com", 10 | "url": "github.com/SamVerschueren" 11 | }, 12 | "engines": { 13 | "node": ">=6" 14 | }, 15 | "scripts": { 16 | "test": "xo && ava", 17 | "postinstall": "alfy-init", 18 | "preuninstall": "alfy-cleanup" 19 | }, 20 | "files": [ 21 | "index.js", 22 | "lib", 23 | "icon.png", 24 | "info.plist", 25 | "icons" 26 | ], 27 | "keywords": [ 28 | "alfred", 29 | "workflow", 30 | "rxjs", 31 | "observable", 32 | "observables", 33 | "reactive", 34 | "documentation", 35 | "productivity" 36 | ], 37 | "dependencies": { 38 | "alfy": "^0.6.0" 39 | }, 40 | "devDependencies": { 41 | "alfy-test": "^0.3.0", 42 | "ava": "*", 43 | "xo": "*" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sam Verschueren (github.com/SamVerschueren) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # alfred-rxjs [![Build Status](https://travis-ci.org/SamVerschueren/alfred-rxjs.svg?branch=master)](https://travis-ci.org/SamVerschueren/alfred-rxjs) 2 | 3 | > [Alfred 3](https://www.alfredapp.com/) workflow to search through the RxJS documentation 4 | 5 | 6 | 7 | 8 | ## Install 9 | 10 | ``` 11 | $ npm install -g alfred-rxjs 12 | ``` 13 | 14 | *Requires [Node.js](https://nodejs.org) 6+ and the Alfred [Powerpack](https://www.alfredapp.com/powerpack/).* 15 | 16 | 17 | ## Usage 18 | 19 | In Alfred, type `rxjs`, Enter, and your query. 20 | 21 | Select an item and press Enter to go to its [RxJS](http://reactivex.io/rxjs) documentation.
22 | Press Shift to view the documentation in Quick Look. 23 | 24 | 25 | ## Related 26 | 27 | - [alfred-ng](https://github.com/SamVerschueren/alfred-ng) - Search through the Angular documentation on angular.io 28 | - [alfred-ionic](https://github.com/SamVerschueren/alfred-ionic) - Search through the Ionic documentation 29 | - [alfred-firebase](https://github.com/SamVerschueren/alfred-firebase) - Search through the Firebase documentation 30 | - [alfred-npms](https://github.com/sindresorhus/alfred-npms) - Search for npm packages with npms.io 31 | - [alfred-updater](https://github.com/samverschueren/alfred-updater) - Workflow updater 32 | - [alfy](https://github.com/sindresorhus/alfy) - Create Alfred workflows with ease 33 | 34 | 35 | ## License 36 | 37 | MIT © [Sam Verschueren](https://github.com/SamVerschueren) 38 | -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | import test from 'ava'; 2 | import alfyTest from 'alfy-test'; 3 | 4 | test('observable result', async t => { 5 | const alfy = alfyTest(); 6 | const result = await alfy('replaysubject'); 7 | 8 | t.deepEqual(result, [ 9 | { 10 | title: 'ReplaySubject', 11 | subtitle: 'Observable', 12 | autocomplete: 'ReplaySubject', 13 | arg: 'https://rxjs-dev.firebaseapp.com/api/index/class/ReplaySubject', 14 | quicklookurl: 'https://rxjs-dev.firebaseapp.com/api/index/class/ReplaySubject', 15 | icon: { 16 | path: './icons/class.png' 17 | } 18 | } 19 | ]); 20 | }); 21 | 22 | test('operator result', async t => { 23 | const alfy = alfyTest(); 24 | const result = await alfy('mergeMap'); 25 | 26 | t.deepEqual(result, [ 27 | { 28 | title: 'mergeMap', 29 | subtitle: 'operator', 30 | autocomplete: 'mergeMap', 31 | arg: 'https://rxjs-dev.firebaseapp.com/api/operators/mergeMap', 32 | quicklookurl: 'https://rxjs-dev.firebaseapp.com/api/operators/mergeMap', 33 | icon: { 34 | path: './icons/function.png' 35 | } 36 | }, 37 | { 38 | title: 'mergeMapTo', 39 | subtitle: 'operator', 40 | autocomplete: 'mergeMapTo', 41 | arg: 'https://rxjs-dev.firebaseapp.com/api/operators/mergeMapTo', 42 | quicklookurl: 'https://rxjs-dev.firebaseapp.com/api/operators/mergeMapTo', 43 | icon: { 44 | path: './icons/function.png' 45 | } 46 | } 47 | ]); 48 | }); 49 | 50 | test('deprecated', async t => { 51 | const alfy = alfyTest(); 52 | const result = await alfy('combineLatest'); 53 | 54 | t.deepEqual(result, [ 55 | { 56 | title: 'combineLatest', 57 | subtitle: 'Observable', 58 | autocomplete: 'combineLatest', 59 | arg: 'https://rxjs-dev.firebaseapp.com/api/index/function/combineLatest', 60 | quicklookurl: 'https://rxjs-dev.firebaseapp.com/api/index/function/combineLatest', 61 | icon: { 62 | path: './icons/function.png' 63 | } 64 | }, 65 | { 66 | title: 'combineLatest', 67 | subtitle: 'operator - deprecated', 68 | autocomplete: 'combineLatest', 69 | arg: 'https://rxjs-dev.firebaseapp.com/api/operators/combineLatest', 70 | quicklookurl: 'https://rxjs-dev.firebaseapp.com/api/operators/combineLatest', 71 | icon: { 72 | path: './icons/function-deprecated.png' 73 | } 74 | } 75 | ]); 76 | }); 77 | -------------------------------------------------------------------------------- /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleid 6 | com.samverschueren.alfred-rxjs 7 | category 8 | 9 | connections 10 | 11 | 3FC8F7EB-216E-4CAD-B663-B43CABA3C5E5 12 | 13 | 14 | destinationuid 15 | B227D898-E752-480C-AAE0-5B6BC921099E 16 | modifiers 17 | 0 18 | modifiersubtext 19 | 20 | vitoclose 21 | 22 | 23 | 24 | destinationuid 25 | 88E066FD-5D95-49EF-98EC-73D518F384E2 26 | modifiers 27 | 0 28 | modifiersubtext 29 | 30 | vitoclose 31 | 32 | 33 | 34 | 88E066FD-5D95-49EF-98EC-73D518F384E2 35 | 36 | 37 | destinationuid 38 | BD12A47C-6516-4506-B5A7-D86CD59E8F04 39 | modifiers 40 | 0 41 | modifiersubtext 42 | 43 | vitoclose 44 | 45 | 46 | 47 | B227D898-E752-480C-AAE0-5B6BC921099E 48 | 49 | 50 | destinationuid 51 | C88ED24E-21B4-4435-BEDF-652ADB50F1A1 52 | modifiers 53 | 0 54 | modifiersubtext 55 | 56 | vitoclose 57 | 58 | 59 | 60 | 61 | disabled 62 | 63 | name 64 | rxjs 65 | objects 66 | 67 | 68 | config 69 | 70 | browser 71 | 72 | spaces 73 | 74 | url 75 | {query} 76 | utf8 77 | 78 | 79 | type 80 | alfred.workflow.action.openurl 81 | uid 82 | C88ED24E-21B4-4435-BEDF-652ADB50F1A1 83 | version 84 | 1 85 | 86 | 87 | config 88 | 89 | inputstring 90 | {query} 91 | matchcasesensitive 92 | 93 | matchmode 94 | 2 95 | matchstring 96 | ^http 97 | 98 | type 99 | alfred.workflow.utility.filter 100 | uid 101 | B227D898-E752-480C-AAE0-5B6BC921099E 102 | version 103 | 1 104 | 105 | 106 | config 107 | 108 | alfredfiltersresults 109 | 110 | argumenttype 111 | 0 112 | escaping 113 | 102 114 | keyword 115 | rxjs 116 | queuedelaycustom 117 | 3 118 | queuedelayimmediatelyinitially 119 | 120 | queuedelaymode 121 | 0 122 | queuemode 123 | 2 124 | runningsubtext 125 | Searching... 126 | script 127 | ./node_modules/.bin/run-node index.js "$1" 128 | scriptargtype 129 | 1 130 | scriptfile 131 | index.js 132 | subtext 133 | 134 | title 135 | Search through the RxJS documentation 136 | type 137 | 0 138 | withspace 139 | 140 | 141 | type 142 | alfred.workflow.input.scriptfilter 143 | uid 144 | 3FC8F7EB-216E-4CAD-B663-B43CABA3C5E5 145 | version 146 | 2 147 | 148 | 149 | config 150 | 151 | autopaste 152 | 153 | clipboardtext 154 | {query} 155 | transient 156 | 157 | 158 | type 159 | alfred.workflow.output.clipboard 160 | uid 161 | BD12A47C-6516-4506-B5A7-D86CD59E8F04 162 | version 163 | 2 164 | 165 | 166 | config 167 | 168 | inputstring 169 | {query} 170 | matchcasesensitive 171 | 172 | matchmode 173 | 2 174 | matchstring 175 | ^import 176 | 177 | type 178 | alfred.workflow.utility.filter 179 | uid 180 | 88E066FD-5D95-49EF-98EC-73D518F384E2 181 | version 182 | 1 183 | 184 | 185 | readme 186 | 187 | uidata 188 | 189 | 3FC8F7EB-216E-4CAD-B663-B43CABA3C5E5 190 | 191 | xpos 192 | 10 193 | ypos 194 | 80 195 | 196 | 88E066FD-5D95-49EF-98EC-73D518F384E2 197 | 198 | xpos 199 | 230 200 | ypos 201 | 170 202 | 203 | B227D898-E752-480C-AAE0-5B6BC921099E 204 | 205 | xpos 206 | 230 207 | ypos 208 | 40 209 | 210 | BD12A47C-6516-4506-B5A7-D86CD59E8F04 211 | 212 | xpos 213 | 290 214 | ypos 215 | 140 216 | 217 | C88ED24E-21B4-4435-BEDF-652ADB50F1A1 218 | 219 | xpos 220 | 290 221 | ypos 222 | 10 223 | 224 | 225 | 226 | 227 | --------------------------------------------------------------------------------