Comparing version 0.6.0 to 0.7.0
@@ -68,5 +68,3 @@ 'use strict'; | ||
alfy.log = str => { | ||
if (alfy.debug) { | ||
console.log(str); | ||
} | ||
console.error(str); | ||
}; | ||
@@ -127,3 +125,3 @@ | ||
const key = rawKey.replace(/\./g, '\\.'); | ||
const cachedResponse = alfy.cache.store[rawKey] && alfy.cache.store[rawKey].data; | ||
const cachedResponse = alfy.cache.get(key, {ignoreMaxAge: true}); | ||
@@ -130,0 +128,0 @@ if (cachedResponse && !alfy.cache.isExpired(key)) { |
135
package.json
{ | ||
"name": "alfy", | ||
"version": "0.6.0", | ||
"description": "Create Alfred workflows with ease", | ||
"license": "MIT", | ||
"repository": "sindresorhus/alfy", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"maintainers": [ | ||
{ | ||
"name": "Sam Verschueren", | ||
"email": "sam.verschueren@gmail.com", | ||
"url": "github.com/SamVerschueren" | ||
} | ||
], | ||
"bin": { | ||
"run-node": "run-node.sh", | ||
"alfy-init": "init.js", | ||
"alfy-cleanup": "cleanup.js" | ||
}, | ||
"engines": { | ||
"node": ">=4" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"init.js", | ||
"cleanup.js", | ||
"run-node.sh", | ||
"lib" | ||
], | ||
"keywords": [ | ||
"alfred", | ||
"app", | ||
"workflow", | ||
"plugin", | ||
"helper", | ||
"util", | ||
"utility", | ||
"macos", | ||
"mac", | ||
"osx" | ||
], | ||
"dependencies": { | ||
"alfred-link": "^0.2.0", | ||
"alfred-notifier": "^0.2.0", | ||
"cache-conf": "^0.3.0", | ||
"clean-stack": "^1.0.0", | ||
"conf": "^0.11.0", | ||
"dot-prop": "^4.0.0", | ||
"execa": "^0.5.0", | ||
"got": "^6.3.0", | ||
"hook-std": "^0.2.0", | ||
"loud-rejection": "^1.6.0", | ||
"npm-run-path": "^2.0.2", | ||
"read-pkg-up": "^1.0.1" | ||
}, | ||
"devDependencies": { | ||
"ava": "*", | ||
"delay": "^1.3.1", | ||
"nock": "^8.0.0", | ||
"tempfile": "^1.1.1", | ||
"xo": "*" | ||
} | ||
"name": "alfy", | ||
"version": "0.7.0", | ||
"description": "Create Alfred workflows with ease", | ||
"license": "MIT", | ||
"repository": "sindresorhus/alfy", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"maintainers": [ | ||
{ | ||
"name": "Sam Verschueren", | ||
"email": "sam.verschueren@gmail.com", | ||
"url": "github.com/SamVerschueren" | ||
} | ||
], | ||
"bin": { | ||
"run-node": "run-node.sh", | ||
"alfy-init": "init.js", | ||
"alfy-cleanup": "cleanup.js" | ||
}, | ||
"engines": { | ||
"node": ">=4" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"init.js", | ||
"cleanup.js", | ||
"run-node.sh", | ||
"lib" | ||
], | ||
"keywords": [ | ||
"alfred", | ||
"app", | ||
"workflow", | ||
"plugin", | ||
"helper", | ||
"util", | ||
"utility", | ||
"macos", | ||
"mac" | ||
], | ||
"dependencies": { | ||
"alfred-link": "^0.2.0", | ||
"alfred-notifier": "^0.2.0", | ||
"cache-conf": "^0.6.0", | ||
"clean-stack": "^1.0.0", | ||
"conf": "^1.1.2", | ||
"dot-prop": "^4.0.0", | ||
"execa": "^0.8.0", | ||
"got": "^8.0.1", | ||
"hook-std": "^0.4.0", | ||
"loud-rejection": "^1.6.0", | ||
"npm-run-path": "^2.0.2", | ||
"read-pkg-up": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "*", | ||
"delay": "^2.0.0", | ||
"nock": "^9.0.2", | ||
"tempfile": "^2.0.0", | ||
"xo": "*" | ||
} | ||
} |
101
readme.md
@@ -29,3 +29,3 @@ #  | ||
``` | ||
$ npm install --save alfy | ||
$ npm install alfy | ||
``` | ||
@@ -74,3 +74,3 @@ | ||
Some example usage in the wild: [`alfred-npms`](https://github.com/sindresorhus/alfred-npms), [`alfred-emoj`](https://github.com/sindresorhus/alfred-emoj), [`alfred-ng2`](https://github.com/SamVerschueren/alfred-ng2). | ||
Some example usage in the wild: [`alfred-npms`](https://github.com/sindresorhus/alfred-npms), [`alfred-emoj`](https://github.com/sindresorhus/alfred-emoj), [`alfred-ng`](https://github.com/SamVerschueren/alfred-ng). | ||
@@ -98,17 +98,17 @@ | ||
{ | ||
"name": "alfred-unicorn", | ||
"version": "1.0.0", | ||
"description": "My awesome unicorn workflow", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"scripts": { | ||
"postinstall": "alfy-init", | ||
"preuninstall": "alfy-cleanup" | ||
}, | ||
"dependencies": { | ||
"alfy": "*" | ||
} | ||
"name": "alfred-unicorn", | ||
"version": "1.0.0", | ||
"description": "My awesome unicorn workflow", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"scripts": { | ||
"postinstall": "alfy-init", | ||
"preuninstall": "alfy-cleanup" | ||
}, | ||
"dependencies": { | ||
"alfy": "*" | ||
} | ||
} | ||
@@ -139,12 +139,12 @@ ``` | ||
test(async t => { | ||
const alfy = alfyTest(); | ||
const alfy = alfyTest(); | ||
const result = await alfy('workflow input'); | ||
const result = await alfy('workflow input'); | ||
t.deepEqual(result, [ | ||
{ | ||
title: 'foo', | ||
subtitle: 'bar' | ||
} | ||
]); | ||
t.deepEqual(result, [ | ||
{ | ||
title: 'foo', | ||
subtitle: 'bar' | ||
} | ||
]); | ||
}); | ||
@@ -154,2 +154,16 @@ ``` | ||
## Debugging | ||
When developing your workflow it can be useful to be able to debug it when something is not working. This is when the [workflow debugger](https://www.alfredapp.com/help/workflows/advanced/debugger/) comes in handy. You can find it in your workflow view in Alfred. Press the insect icon to open it. It will show you the plain text output of `alfy.output()` and anything you log with `alfy.log()`: | ||
```js | ||
const unicorn = getUnicorn(); | ||
alfy.log(unicorn); | ||
``` | ||
## Environment variables | ||
Alfred lets users set [environment variables for a workflow](https://www.alfredapp.com/help/workflows/advanced/variables/) which can then be used by that workflow. This can be useful if you, for example, need the user to specify an API token for a service. You can access the workflow environment variables from [`process.env`](https://nodejs.org/api/process.html#process_process_env). For example `process.env.apiToken`. | ||
## API | ||
@@ -187,2 +201,6 @@ | ||
#### log(value) | ||
Log `value` to the [Alfred workflow debugger](https://www.alfredapp.com/help/workflows/advanced/debugger/). | ||
#### matches(input, list, [item]) | ||
@@ -262,10 +280,2 @@ | ||
#### log(text) | ||
##### text | ||
Type: `string` | ||
Text to be logged to the debug panel. Only logs when `alfred.debug` is `true`, so not to interfere with the normal output. | ||
#### error(err) | ||
@@ -507,3 +517,8 @@ | ||
- [alfred-npms](https://github.com/sindresorhus/alfred-npms) - Search for npm packages with npms.io | ||
- [alfred-ng2](https://github.com/SamVerschueren/alfred-ng2) - Search for Angular 2 API references | ||
- [alfred-dark-mode](https://github.com/sindresorhus/alfred-dark-mode) - Toggle the system dark mode | ||
- [alfred-xcode](https://github.com/sindresorhus/alfred-xcode) - Open Xcode projects and workspaces | ||
- [alfred-lock](https://github.com/sindresorhus/alfred-lock) - Lock your Mac | ||
- [alfred-fkill](https://github.com/SamVerschueren/alfred-fkill) - Fabulously search and kill processes | ||
- [alfred-ng](https://github.com/SamVerschueren/alfred-ng) - Search through the Angular documentation on angular.io | ||
- [alfred-ionic](https://github.com/SamVerschueren/alfred-ionic) - Search through the Ionic documentation | ||
- [alfred-react-native](https://github.com/ekonstantinidis/alfred-react-native) - Access the React Native documentation | ||
@@ -513,2 +528,18 @@ - [alfred-hl](https://github.com/importre/alfred-hl) - Syntax highlight code in the clipboard | ||
- [alfredinary](https://github.com/urre/alfredinary) - Capture screenshots and upload to Cloudinary | ||
- [alfred-keycode](https://github.com/radibit/alfred-keycode) - Get JavaScript keycodes | ||
- [alfred-vue](https://github.com/radibit/alfred-vue) - Search the Vue.js API docs | ||
- [alfred-meteor-docs](https://github.com/wolasss/alfred-meteor-docs) - Search the Meteor docs | ||
- [alfred-climbing-grades-converter](https://github.com/wolasss/alfred-climbing-grades-converter) - Convert between climbing grading systems | ||
- [alfred-hotel](https://github.com/exah/alfred-hotel) - Quickly start, stop and open [Hotel](https://github.com/typicode/hotel) apps | ||
- [alfred-coolors](https://github.com/radibit/alfred-coolors) - Find relevant color names | ||
- [alfred-postico-favorites-workflow](https://github.com/payers1/alfred-postico-favorites-workflow) - Open postico favorites | ||
- [alfred-messages](https://github.com/briangonzalez/alfred-messages) - Message your contacts through iMessage | ||
- [alfred-bitbucket](https://github.com/nicklayb/alfred-bitbucket) - List you and your teams public and private Bitbucket repositories | ||
- [alfred-asana](https://github.com/adriantoine/alfred-asana) - Search your Asana tasks | ||
- [alfred-cacher](https://github.com/CacherApp/alfred-cacher) - Find a code snippet from [Cacher](https://www.cacher.io) and copy it to the clipboard | ||
- [alfred-loremipsum](https://github.com/AntonNiklasson/alfred-loremipsum) - Generate placeholder text | ||
- [alfred-kaomoji](https://github.com/vinkla/alfred-kaomoji) - Find relevant kaomoji from text | ||
- [alfred-packagist](https://github.com/vinkla/alfred-packagist) - Search for PHP packages with Packagist | ||
- [alfred-vpn](https://github.com/stve/alfred-vpn) - Connect/disconnect from VPNs | ||
- [alfred-clap](https://github.com/jacc/alfred-clap) - ππ» Clap ππ» stuff ππ» out ππ» in ππ» Alfred! ππ» | ||
@@ -532,2 +563,2 @@ | ||
MIT Β© [Sindre Sorhus](https://sindresorhus.com) | ||
MIT |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
23446
555
160
+ Added@sindresorhus/is@0.7.0(transitive)
+ Addedcache-conf@0.6.0(transitive)
+ Addedcacheable-request@2.1.4(transitive)
+ Addedclone-response@1.0.2(transitive)
+ Addedconf@1.4.0(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddecode-uri-component@0.2.2(transitive)
+ Addeddecompress-response@3.3.0(transitive)
+ Addedfind-up@2.1.0(transitive)
+ Addedfrom2@2.3.0(transitive)
+ Addedgot@8.3.2(transitive)
+ Addedhas-symbol-support-x@1.4.2(transitive)
+ Addedhas-to-string-tag-x@1.4.1(transitive)
+ Addedhook-std@0.4.0(transitive)
+ Addedhttp-cache-semantics@3.8.1(transitive)
+ Addedimurmurhash@0.1.4(transitive)
+ Addedinto-stream@3.1.0(transitive)
+ Addedis-object@1.0.2(transitive)
+ Addedis-plain-obj@1.1.0(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedisurl@1.0.0(transitive)
+ Addedjson-buffer@3.0.0(transitive)
+ Addedjson-parse-better-errors@1.0.2(transitive)
+ Addedkeyv@3.0.0(transitive)
+ Addedload-json-file@4.0.0(transitive)
+ Addedlocate-path@2.0.0(transitive)
+ Addedlowercase-keys@1.0.0(transitive)
+ Addedmake-dir@1.3.0(transitive)
+ Addedmimic-response@1.0.1(transitive)
+ Addednormalize-url@2.0.1(transitive)
+ Addedp-cancelable@0.4.1(transitive)
+ Addedp-is-promise@1.1.0(transitive)
+ Addedp-limit@1.3.0(transitive)
+ Addedp-locate@2.0.0(transitive)
+ Addedp-timeout@2.0.1(transitive)
+ Addedp-try@1.0.0(transitive)
+ Addedparse-json@4.0.0(transitive)
+ Addedpath-type@3.0.0(transitive)
+ Addedpkg-up@2.0.0(transitive)
+ Addedprepend-http@2.0.0(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedquery-string@5.1.1(transitive)
+ Addedread-pkg@3.0.0(transitive)
+ Addedread-pkg-up@3.0.0(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedresponselike@1.0.2(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsort-keys@2.0.0(transitive)
+ Addedstrict-uri-encode@1.1.0(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedurl-parse-lax@3.0.0(transitive)
+ Addedurl-to-options@1.0.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwrite-file-atomic@2.4.3(transitive)
- Removedcache-conf@0.3.0(transitive)
- Removedconf@0.11.2(transitive)
- Removedcross-spawn@4.0.2(transitive)
- Removeddot-prop@3.0.0(transitive)
- Removedenv-paths@0.3.1(transitive)
- Removedexeca@0.5.1(transitive)
- Removedget-stream@2.3.1(transitive)
- Removedhook-std@0.2.0(transitive)
Updatedcache-conf@^0.6.0
Updatedconf@^1.1.2
Updatedexeca@^0.8.0
Updatedgot@^8.0.1
Updatedhook-std@^0.4.0
Updatedread-pkg-up@^3.0.0