├── .gitignore ├── .gitattributes ├── .travis.yml ├── icon.png ├── .editorconfig ├── README.md ├── index.js ├── package.json ├── LICENSE └── info.plist /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .yo-rc.json 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.js text eol=lf 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '6' 4 | - '4' 5 | -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kyleshevlin/alfred-ember-module-lookup/HEAD/icon.png -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # alfred-ember-module-lookup 2 | 3 | > Find an Ember module import quickly 4 | 5 | ## Install 6 | 7 | ``` 8 | $ npm install --global alfred-ember-module-lookup 9 | ``` 10 | 11 | *Requires [Node.js](https://nodejs.org) 4+ and the Alfred [Powerpack](https://www.alfredapp.com/powerpack/).* 12 | 13 | 14 | ## Usage 15 | 16 | In Alfred, type `eml` and your query. 17 | 18 | 19 | ## License 20 | 21 | MIT © [Kyle Shevlin](https://kyleshevlin.com) 22 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const alfy = require('alfy') 3 | const mapping = require('ember-rfc176-data') 4 | 5 | function isDefaultExport(localName) { 6 | return !!localName 7 | } 8 | 9 | const pairs = mapping.map( 10 | ({ global, module, export: exportName, localName, deprecated }) => { 11 | if (isDefaultExport(localName)) { 12 | return { 13 | key: localName, 14 | value: `import ${localName} from '${module}'` 15 | } 16 | } 17 | 18 | return { 19 | key: exportName, 20 | value: `import { ${exportName} } from '${module}'` 21 | } 22 | } 23 | ) 24 | 25 | const matches = alfy.inputMatches(pairs, 'key') 26 | 27 | alfy.output( 28 | matches.map(match => ({ 29 | title: match.key, 30 | subtitle: match.value, 31 | arg: match.value 32 | })) 33 | ) 34 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "alfred-ember-module-lookup", 3 | "version": "0.1.0", 4 | "description": "Find an Ember module import quickly", 5 | "license": "MIT", 6 | "repository": "git@github.com:kyleshevlin/alfred-ember-module-lookup.git", 7 | "author": { 8 | "name": "Kyle Shevlin", 9 | "email": "kyle.a.shevlin@gmail.com", 10 | "url": "kyleshevlin.com" 11 | }, 12 | "engines": { 13 | "node": ">=4" 14 | }, 15 | "scripts": { 16 | "format": "prettier --write --no-semi --single-quote --print-width=80 --tab-width=2 \"index.js\"", 17 | "test": "xo && ava", 18 | "postinstall": "alfy-init", 19 | "preuninstall": "alfy-cleanup" 20 | }, 21 | "files": [ 22 | "index.js", 23 | "icon.png", 24 | "info.plist" 25 | ], 26 | "keywords": [ 27 | "alfred", 28 | "workflow", 29 | "alfy" 30 | ], 31 | "dependencies": { 32 | "alfy": "^0.6.0", 33 | "ember-rfc176-data": "^0.3.1" 34 | }, 35 | "devDependencies": { 36 | "alfy-test": "^0.3.0", 37 | "ava": "^0.18.0", 38 | "prettier": "^1.8.2", 39 | "xo": "^0.17.0" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Kyle Shevlin (kyleshevlin.com) 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 | -------------------------------------------------------------------------------- /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleid 6 | com.kyleshevlin.ember-module-lookup 7 | category 8 | Productivity 9 | connections 10 | 11 | 3DB5D062-8D67-4585-8AB8-BFF3F9E933E2 12 | 13 | 14 | destinationuid 15 | 8B9B8144-0C67-41A3-988F-3BFDD3CD00FF 16 | modifiers 17 | 0 18 | modifiersubtext 19 | 20 | vitoclose 21 | 22 | 23 | 24 | 25 | disabled 26 | 27 | name 28 | ember-module-lookup 29 | objects 30 | 31 | 32 | config 33 | 34 | alfredfiltersresults 35 | 36 | alfredfiltersresultsmatchmode 37 | 0 38 | argumenttrimmode 39 | 0 40 | argumenttype 41 | 0 42 | escaping 43 | 102 44 | keyword 45 | eml 46 | queuedelaycustom 47 | 3 48 | queuedelayimmediatelyinitially 49 | 50 | queuedelaymode 51 | 0 52 | queuemode 53 | 2 54 | runningsubtext 55 | Searching... 56 | script 57 | ./node_modules/.bin/run-node index.js "$1" 58 | scriptargtype 59 | 1 60 | scriptfile 61 | index.js 62 | subtext 63 | 64 | title 65 | Find Ember modular import quickly 66 | type 67 | 0 68 | withspace 69 | 70 | 71 | type 72 | alfred.workflow.input.scriptfilter 73 | uid 74 | 3DB5D062-8D67-4585-8AB8-BFF3F9E933E2 75 | version 76 | 2 77 | 78 | 79 | config 80 | 81 | autopaste 82 | 83 | clipboardtext 84 | {query} 85 | transient 86 | 87 | 88 | type 89 | alfred.workflow.output.clipboard 90 | uid 91 | 8B9B8144-0C67-41A3-988F-3BFDD3CD00FF 92 | version 93 | 2 94 | 95 | 96 | readme 97 | 98 | uidata 99 | 100 | 3DB5D062-8D67-4585-8AB8-BFF3F9E933E2 101 | 102 | xpos 103 | 100 104 | ypos 105 | 100 106 | 107 | 8B9B8144-0C67-41A3-988F-3BFDD3CD00FF 108 | 109 | xpos 110 | 300 111 | ypos 112 | 100 113 | 114 | 115 | 116 | 117 | --------------------------------------------------------------------------------