From eb2ecd562aa0967d0e69d1cce57eb1ca4e614d91 Mon Sep 17 00:00:00 2001 From: Sean Lang Date: Sat, 4 Jun 2016 01:11:30 -0400 Subject: [PATCH 1/6] clean package.json with fixpack --- package.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 32cf204..101b79c 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,8 @@ { "name": "wakatime", - "version": "6.0.2", "description": "Fitbit for programmers. Get automated metrics and insights about your programming.", - "license": "BSD", - "repository": "https://github.com/wakatime/atom-wakatime", + "version": "6.0.2", "author": "WakaTime ", - "main": "./lib/wakatime", - "engines": { - "atom": ">0.50.0" - }, "consumedServices": { "status-bar": { "versions": { @@ -21,5 +15,11 @@ "ini": "^1.3.4", "request": "2.61.0", "rimraf": "2.4.3" - } + }, + "engines": { + "atom": ">0.50.0" + }, + "license": "BSD-3-Clause", + "main": "./lib/wakatime", + "repository": "https://github.com/wakatime/atom-wakatime" } From 5864c9ee459e9d8ffe0ccbaadc58bdb04b488345 Mon Sep 17 00:00:00 2001 From: Sean Lang Date: Sat, 4 Jun 2016 01:13:56 -0400 Subject: [PATCH 2/6] move config schema into package.json --- lib/wakatime.coffee | 22 ---------------------- package.json | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 22 deletions(-) diff --git a/lib/wakatime.coffee b/lib/wakatime.coffee index 758d699..1789310 100644 --- a/lib/wakatime.coffee +++ b/lib/wakatime.coffee @@ -26,28 +26,6 @@ ini = require 'ini' StatusBarTileView = require './status-bar-tile-view' module.exports = - config: - apikey: - title: 'Api Key' - description: 'Your secret key from https://wakatime.com/settings.' - type: 'string' - default: '' - order: 1 - ignore: - title: 'Exclude File Paths' - description: 'Exclude these file paths from logging; POSIX regex patterns' - type: 'array' - default: ['^/var/', '^/tmp/', '^/private/', 'COMMIT_EDITMSG$', 'PULLREQ_EDITMSG$', 'MERGE_MSG$'] - items: - type: 'string' - order: 2 - showStatusBarIcon: - title: 'Show WakaTime in Atom status bar' - description: 'Add an icon to Atom\'s status bar with WakaTime info. Hovering over the icon shows current WakaTime status or error message.' - type: 'boolean' - default: true - order: 3 - activate: (state) -> packageVersion = atom.packages.getLoadedPackage('wakatime').metadata.version setupConfigs() diff --git a/package.json b/package.json index 101b79c..4255357 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,39 @@ "description": "Fitbit for programmers. Get automated metrics and insights about your programming.", "version": "6.0.2", "author": "WakaTime ", + "configSchema": { + "apikey": { + "title": "Api Key", + "description": "Your secret key from https://wakatime.com/settings.", + "type": "string", + "default": "", + "order": 1 + }, + "ignore": { + "title": "Exclude File Paths", + "description": "Exclude these file paths from logging; POSIX regex patterns", + "type": "array", + "default": [ + "^/var/", + "^/tmp/", + "^/private/", + "COMMIT_EDITMSG$", + "PULLREQ_EDITMSG$", + "MERGE_MSG$" + ], + "items": { + "type": "string" + }, + "order": 2 + }, + "showStatusBarIcon": { + "title": "Show WakaTime in Atom status bar", + "description": "Add an icon to Atom's status bar with WakaTime info. Hovering over the icon shows current WakaTime status or error message.", + "type": "boolean", + "default": true, + "order": 3 + } + }, "consumedServices": { "status-bar": { "versions": { From f190d758abe418bc57ac1070aab18b7465537130 Mon Sep 17 00:00:00 2001 From: Sean Lang Date: Sat, 4 Jun 2016 01:15:35 -0400 Subject: [PATCH 3/6] fix unnecessary fat arrows --- lib/wakatime.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/wakatime.coffee b/lib/wakatime.coffee index 1789310..0e8543b 100644 --- a/lib/wakatime.coffee +++ b/lib/wakatime.coffee @@ -161,24 +161,24 @@ enoughTimePassed = (time) -> return lastHeartbeat + 120000 < time setupEventHandlers = (callback) -> - atom.workspace.observeTextEditors (editor) => + atom.workspace.observeTextEditors (editor) -> try buffer = editor.getBuffer() - buffer.onDidSave (e) => + buffer.onDidSave (e) -> file = buffer.file if file? and file lineno = null if editor.cursors.length > 0 lineno = editor.cursors[0].getCurrentLineBufferRange().end.row + 1 sendHeartbeat(file, lineno, true) - buffer.onDidChange (e) => + buffer.onDidChange (e) -> file = buffer.file if file? and file lineno = null if editor.cursors.length > 0 lineno = editor.cursors[0].getCurrentLineBufferRange().end.row + 1 sendHeartbeat(file, lineno) - editor.onDidChangeCursorPosition (e) => + editor.onDidChangeCursorPosition (e) -> file = buffer.file if file? and file lineno = null From 24a1cbcbdd71a7a4325cc6f5dab170218cffd0be Mon Sep 17 00:00:00 2001 From: Sean Lang Date: Sat, 4 Jun 2016 01:17:13 -0400 Subject: [PATCH 4/6] fix inconsistent indentation --- lib/wakatime.coffee | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/wakatime.coffee b/lib/wakatime.coffee index 0e8543b..17237ad 100644 --- a/lib/wakatime.coffee +++ b/lib/wakatime.coffee @@ -241,10 +241,10 @@ installPython = (callback) -> statusBarTileView?.setStatus('extracting python...') unzip(zipFile, __dirname + path.sep + 'python', -> - fs.unlink(zipFile) - console.log 'Finished installing python.' - if callback? - callback() + fs.unlink(zipFile) + console.log 'Finished installing python.' + if callback? + callback() ) ) @@ -446,10 +446,10 @@ formatDate = (date) -> ampm = 'AM' hour = date.getHours() if (hour > 11) - ampm = 'PM' - hour = hour - 12 + ampm = 'PM' + hour = hour - 12 if (hour == 0) - hour = 12 + hour = 12 minute = date.getMinutes() if (minute < 10) minute = '0' + minute From 64a19b1a4ab43ccb6d3114839c2a4c9ec40e097f Mon Sep 17 00:00:00 2001 From: Sean Lang Date: Sat, 4 Jun 2016 01:17:29 -0400 Subject: [PATCH 5/6] strip trailing whitespace --- lib/wakatime.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wakatime.coffee b/lib/wakatime.coffee index 17237ad..3a0785f 100644 --- a/lib/wakatime.coffee +++ b/lib/wakatime.coffee @@ -80,7 +80,7 @@ finishActivation = () -> setupEventHandlers() statusBarTileView?.setTitle('WakaTime ready') statusBarTileView?.setStatus() - + settingChangedHandler = (settings) -> if settings.showStatusBarIcon statusBarTileView?.show() From 4415ca91a0028ceff88e497af76abd38ac4c2ac1 Mon Sep 17 00:00:00 2001 From: Sean Lang Date: Sat, 4 Jun 2016 01:36:55 -0400 Subject: [PATCH 6/6] clean up readme with tidy-markdown fixes numbering on installation section list --- README.md | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 88c59be..c9d18b4 100644 --- a/README.md +++ b/README.md @@ -1,46 +1,36 @@ -atom-wakatime -============= +# atom-wakatime Quantify your coding inside GitHub's Atom editor. - -Installation ------------- +## Installation 1. Inside Atom, navigate to `Preferences`/`Settings` -> `Install` and search for `wakatime`. -![Project Overview](https://wakatime.com/static/img/ScreenShots/atom-wakatime-install-1.png) + ![Project Overview](https://wakatime.com/static/img/ScreenShots/atom-wakatime-install-1.png) 2. Click the `Install` button. -![Project Overview](https://wakatime.com/static/img/ScreenShots/atom-wakatime-install-2.png) + ![Project Overview](https://wakatime.com/static/img/ScreenShots/atom-wakatime-install-2.png) 3. Click `Settings`, then enter your [api key](https://wakatime.com/settings#apikey). 4. Use Atom like you normally do and your time will automatically be tracked for you. -5. Visit https://wakatime.com to see your logged time. - +5. Visit to see your logged time. -Screen Shots ------------- +## Screen Shots ![Project Overview](https://wakatime.com/static/img/ScreenShots/Screen-Shot-2016-03-21.png) - -Configuring ------------ +## Configuring Settings for atom-wakatime are under `Settings -> Packages -> wakatime -> Settings`. Additional settings are in `$HOME/.wakatime.cfg` for [wakatime cli](https://github.com/wakatime/wakatime#configuring). +## Troubleshooting -Troubleshooting ---------------- - -Note: Behind a proxy? Configure Atom to use your proxy when installing wakatime: -https://github.com/atom/apm#behind-a-firewall +Note: Behind a proxy? Configure Atom to use your proxy when installing wakatime: Atom writes errors to the developer console at `View -> Developer -> Toggle Developer Tools`.