├── .editorconfig ├── .gitattributes ├── .github └── workflows │ └── ci.yml ├── .gitignore ├── LICENSE ├── README.md ├── icon.png ├── index.js ├── info.plist ├── package.json └── test.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | indent_style = space 8 | indent_size = 2 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | run: 7 | runs-on: ubuntu-latest 8 | 9 | strategy: 10 | matrix: 11 | nodejs: [12] 12 | 13 | name: Node.js ${{ matrix.nodejs }} 14 | 15 | steps: 16 | - uses: actions/checkout@v2 17 | - uses: actions/setup-node@v1 18 | with: 19 | node-version: ${{ matrix.nodejs }} 20 | - run: npm install 21 | - run: npm test 22 | 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Vincent Klaiber 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This package has been archived and abandoned by the owner. It is now read-only. 2 | -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vinkla/alfred-packagist/f3e26caf9e4245b8c44f35757a788d68b6fd335a/icon.png -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const alfy = require('alfy'); 2 | 3 | (async () => { 4 | const data = await alfy.fetch('https://repo.packagist.org/search.json', { 5 | query: { 6 | q: alfy.input 7 | } 8 | }); 9 | 10 | const items = data.results.map(pkg => { 11 | return { 12 | title: pkg.name, 13 | subtitle: pkg.description, 14 | arg: pkg.repository || pkg.url, 15 | mods: { 16 | alt: { 17 | arg: pkg.url, 18 | subtitle: 'Open the Packagist page instead of the GitHub repo' 19 | }, 20 | ctrl: { 21 | arg: pkg.name, 22 | subtitle: 'Copy package name' 23 | } 24 | }, 25 | quicklookurl: pkg.repository && `${pkg.repository}#readme` 26 | }; 27 | }); 28 | 29 | alfy.output(items); 30 | })(); 31 | -------------------------------------------------------------------------------- /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleid 6 | com.vinkla.packagist 7 | category 8 | Productivity 9 | connections 10 | 11 | 9B5F5EE7-FCD6-4A9F-9CFC-CBCF5B44D4CB 12 | 13 | 14 | destinationuid 15 | E014D486-C255-4F75-A53A-8A0942A33E67 16 | modifiers 17 | 0 18 | modifiersubtext 19 | 20 | vitoclose 21 | 22 | 23 | 24 | destinationuid 25 | 2B8498E3-2EEC-4C0A-BFC8-7A89772DC9B8 26 | modifiers 27 | 262144 28 | modifiersubtext 29 | 30 | vitoclose 31 | 32 | 33 | 34 | 35 | createdby 36 | Vincent Klaiber 37 | description 38 | Alfred workflow to search for PHP packages with Packagist 39 | disabled 40 | 41 | name 42 | Packagist 43 | objects 44 | 45 | 46 | config 47 | 48 | alfredfiltersresults 49 | 50 | alfredfiltersresultsmatchmode 51 | 0 52 | argumenttrimmode 53 | 0 54 | argumenttype 55 | 0 56 | escaping 57 | 102 58 | keyword 59 | packagist 60 | queuedelaycustom 61 | 3 62 | queuedelayimmediatelyinitially 63 | 64 | queuedelaymode 65 | 0 66 | queuemode 67 | 1 68 | runningsubtext 69 | Searching… 70 | script 71 | ./node_modules/.bin/run-node index.js "$1" 72 | scriptargtype 73 | 1 74 | scriptfile 75 | 76 | subtext 77 | Search for PHP packages 78 | title 79 | Packagist 80 | type 81 | 0 82 | withspace 83 | 84 | 85 | type 86 | alfred.workflow.input.scriptfilter 87 | uid 88 | 9B5F5EE7-FCD6-4A9F-9CFC-CBCF5B44D4CB 89 | version 90 | 2 91 | 92 | 93 | config 94 | 95 | browser 96 | 97 | spaces 98 | 99 | url 100 | {query} 101 | utf8 102 | 103 | 104 | type 105 | alfred.workflow.action.openurl 106 | uid 107 | E014D486-C255-4F75-A53A-8A0942A33E67 108 | version 109 | 1 110 | 111 | 112 | config 113 | 114 | autopaste 115 | 116 | clipboardtext 117 | {query} 118 | transient 119 | 120 | 121 | type 122 | alfred.workflow.output.clipboard 123 | uid 124 | 2B8498E3-2EEC-4C0A-BFC8-7A89772DC9B8 125 | version 126 | 2 127 | 128 | 129 | readme 130 | 131 | uidata 132 | 133 | 2B8498E3-2EEC-4C0A-BFC8-7A89772DC9B8 134 | 135 | xpos 136 | 190 137 | ypos 138 | 130 139 | 140 | 9B5F5EE7-FCD6-4A9F-9CFC-CBCF5B44D4CB 141 | 142 | xpos 143 | 10 144 | ypos 145 | 10 146 | 147 | E014D486-C255-4F75-A53A-8A0942A33E67 148 | 149 | xpos 150 | 190 151 | ypos 152 | 10 153 | 154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "alfred-packagist", 3 | "version": "1.4.0", 4 | "description": "Alfred workflow to search for PHP packages with Packagist", 5 | "license": "MIT", 6 | "repository": "vinkla/alfred-packagist", 7 | "author": { 8 | "name": "Vincent Klaiber", 9 | "url": "https://github.com/vinkla" 10 | }, 11 | "engines": { 12 | "node": ">=12" 13 | }, 14 | "scripts": { 15 | "test": "xo && ava", 16 | "postinstall": "alfy-init", 17 | "preuninstall": "alfy-cleanup" 18 | }, 19 | "files": [ 20 | "index.js", 21 | "icon.png", 22 | "info.plist" 23 | ], 24 | "keywords": [ 25 | "alfred", 26 | "alfy", 27 | "composer", 28 | "packagist", 29 | "php" 30 | ], 31 | "dependencies": { 32 | "alfy": "^0.10.0" 33 | }, 34 | "devDependencies": { 35 | "alfy-test": "^0.4.0", 36 | "ava": "^3.15.0", 37 | "xo": "^0.38.1" 38 | }, 39 | "xo": { 40 | "space": true 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | const test = require('ava'); 2 | const alfyTest = require('alfy-test'); 3 | 4 | test('main', async t => { 5 | const alfy = alfyTest(); 6 | 7 | const result = await alfy('vinkla/hashids'); 8 | 9 | t.deepEqual(result[0], { 10 | title: 'vinkla/hashids', 11 | subtitle: 'A Hashids bridge for Laravel', 12 | arg: 'https://github.com/vinkla/laravel-hashids', 13 | mods: 14 | { 15 | alt: 16 | { 17 | arg: 'https://packagist.org/packages/vinkla/hashids', 18 | subtitle: 'Open the Packagist page instead of the GitHub repo' 19 | }, 20 | ctrl: { 21 | arg: 'vinkla/hashids', 22 | subtitle: 'Copy package name' 23 | } 24 | }, 25 | quicklookurl: 'https://github.com/vinkla/laravel-hashids#readme' 26 | }); 27 | }); 28 | --------------------------------------------------------------------------------