From ea66cce072e7a9cd6769963279cce2512aa05b05 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Wed, 21 Aug 2019 22:50:02 +0200 Subject: [PATCH] Meta tweaks --- .gitattributes | 3 +-- .travis.yml | 2 +- index.js | 26 +++++++++++++++----------- package.json | 4 ++-- readme.md | 7 +------ test/test.js | 2 +- 6 files changed, 21 insertions(+), 23 deletions(-) diff --git a/.gitattributes b/.gitattributes index 391f0a4..6313b56 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1 @@ -* text=auto -*.js text eol=lf +* text=auto eol=lf diff --git a/.travis.yml b/.travis.yml index f178ec0..afb9d6d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,3 @@ language: node_js node_js: - - 'node' + - '12' diff --git a/index.js b/index.js index d141273..d05aa7e 100644 --- a/index.js +++ b/index.js @@ -16,25 +16,29 @@ const action = async context => { method: 'post', body: form }); - const id = JSON.parse(response.body).data.id; + const {id} = JSON.parse(response.body).data; context.copyToClipboard(`https://giphy.com/gifs/${id}`); context.notify('URL to the GIF has been copied to the clipboard'); }; +const config = { + apiKey: { + title: 'API key', + type: 'string', + minLength: 13, + default: 'dc6zaTOxFJmzC', // Rate limited test key + required: true + } +}; + const giphy = { title: 'Share to GIPHY', - formats: ['gif'], + formats: [ + 'gif' + ], action, - config: { - apiKey: { - title: 'API key', - type: 'string', - minLength: 13, - default: 'dc6zaTOxFJmzC', // Rate limited test key - required: true - } - } + config }; exports.shareServices = [giphy]; diff --git a/package.json b/package.json index ff9fe58..127e977 100644 --- a/package.json +++ b/package.json @@ -26,8 +26,8 @@ "form-data": "^2.1.4" }, "devDependencies": { - "ava": "^0.23.0", + "ava": "^2.3.0", "kap-plugin-test": "^0.5.0", - "xo": "^0.18.2" + "xo": "^0.24.0" } } diff --git a/readme.md b/readme.md index 940e892..178890a 100644 --- a/readme.md +++ b/readme.md @@ -5,14 +5,9 @@ ## Install -In the `Kap` menu, go to `Preferences…`, select the `Plugins` pane, find this plugin, and click `Install`. +In the `Kap` menu, go to `Preferences…`, select the `Plugins` pane, find this plugin, and toggle it. ## Usage In the editor, after recording, select `GIF`, and then `Share on GIPHY`. - - -## License - -MIT © [Wulkano](https://wulkano.com) diff --git a/test/test.js b/test/test.js index 000cc49..f4eba8c 100644 --- a/test/test.js +++ b/test/test.js @@ -1,7 +1,7 @@ import test from 'ava'; import kapPluginTest from 'kap-plugin-test'; -test(async t => { +test('main', async t => { const plugin = kapPluginTest('unicorn.gif'); plugin.context.request.resolves({