grunt-toggl
Advanced tools
Comparing version 0.1.5 to 0.3.0
{ | ||
"name": "grunt-toggl", | ||
"description": "Toggl API for Grunt. E.g. start time tracking with `grunt watch` or `grunt toggl`", | ||
"version": "0.1.5", | ||
"homepage": "https://github.com/davidosomething/grunt-toggl", | ||
"version": "0.3.0", | ||
"author": { | ||
@@ -43,3 +43,3 @@ "name": "David O'Trakoun", | ||
"peerDependencies": { | ||
"grunt": "~0.4.4" | ||
"grunt": ">=0.4.0" | ||
}, | ||
@@ -46,0 +46,0 @@ "keywords": [ |
# <img src="http://davidosomething.com/content/uploads/grunt-toggl-logo.png" alt="grunt-toggl Logo" valign="middle" style="width: 2em; margin: 0 0.2em 0.2em 0;"> grunt-toggl | ||
> Toggl API for Grunt. E.g. start time tracking with `grunt watch` or | ||
`grunt toggl` | ||
> `grunt toggl` | ||
@@ -13,7 +14,9 @@ [![Upstream](http://img.shields.io/badge/upstream-GitHub-lightgrey.svg)](https://github.com/davidosomething/grunt-toggl) | ||
## Demo | ||
![Demo of starting a timer from the command line](http://i0.wp.com/davidosomething.com/content/uploads/grunt-toggl.gif) | ||
## Getting Started | ||
This plugin requires Grunt `~0.4.4` | ||
This plugin requires Grunt `>=0.4.4` | ||
If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out | ||
@@ -39,2 +42,3 @@ the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains | ||
### Overview | ||
In your project's Gruntfile, add a section named `toggl` to the data object | ||
@@ -64,11 +68,14 @@ passed into `grunt.initConfig()`. | ||
##### Here are the ways to specify your API key: ##### | ||
Here are the ways to specify your API key: | ||
#### options.apiKey | ||
Type: `String` | ||
Default value: `` | ||
This is one way to specify your Toggl API key. Not secure if your repo is public. | ||
This is one way to specify your Toggl API key. Not secure if your repo is | ||
public. | ||
#### options.apiEnvVar | ||
Type: `String` | ||
@@ -81,2 +88,3 @@ Default value: `` | ||
#### options.settingsFile | ||
Type: `String` | ||
@@ -88,3 +96,3 @@ Default value: `.toggl` | ||
``` | ||
```json | ||
{ | ||
@@ -102,5 +110,6 @@ "apiKey": "demokeydemokeydemokey", | ||
##### Other options ##### | ||
##### Other options | ||
#### options.workspace | ||
Type: `Integer` | ||
@@ -113,2 +122,3 @@ Default value: `null` | ||
#### options.project | ||
Type: `Integer` | ||
@@ -121,2 +131,3 @@ Default value: `null` | ||
#### options.data | ||
Type: `Object` | ||
@@ -128,25 +139,25 @@ Default value: `{}` | ||
* description: (string, strongly suggested to be used) | ||
* I like to use the `package.json` name in the description, assuming you | ||
- description: (string, strongly suggested to be used) | ||
- I like to use the `package.json` name in the description, assuming you | ||
have it loaded into the pkg variable | ||
(`pkg: grunt.file.readJSON('package.json')`): | ||
``` | ||
```json | ||
data: { | ||
description: '<%= pkg.name %>', | ||
description: '<%= pkg.name %>' | ||
} | ||
``` | ||
* wid: workspace ID (integer, **required** if pid or tid not supplied). | ||
* See [Finding your workspace IDs](#finding-your-workspace-ids) for | ||
- wid: workspace ID (integer, **required** if pid or tid not supplied). | ||
- See [Finding your workspace IDs](#finding-your-workspace-ids) for | ||
how to get the ID using this grunt task. | ||
* pid: project ID (integer, not required) | ||
* See [Finding your project IDs](#finding-your-project-ids) for | ||
- pid: project ID (integer, not required) | ||
- See [Finding your project IDs](#finding-your-project-ids) for | ||
how to get the ID using this grunt task. | ||
* tid: task ID (integer, not required) | ||
* billable: (boolean, not required, default false, available for pro | ||
- tid: task ID (integer, not required) | ||
- billable: (boolean, not required, default false, available for pro | ||
workspaces) | ||
* start: time entry start time (string, **required**, ISO 8601 date and time) | ||
* stop: time entry stop time (string, not required, ISO 8601 date and time) | ||
* duration: time entry duration in seconds. If the time entry is currently | ||
- start: time entry start time (string, **required**, ISO 8601 date and time) | ||
- stop: time entry stop time (string, not required, ISO 8601 date and time) | ||
- duration: time entry duration in seconds. If the time entry is currently | ||
running, the duration attribute contains a negative value, denoting the | ||
@@ -156,7 +167,7 @@ start of the time entry in seconds since epoch (Jan 1 1970). The correct | ||
the current time in seconds since epoch. (integer, **required**) | ||
* created_with: the name of your client app (string, **required**) | ||
* tags: a list of tag names (array of strings, not required) | ||
* duronly: should Toggl show the start and stop time of this time entry? | ||
- created_with: the name of your client app (string, **required**) | ||
- tags: a list of tag names (array of strings, not required) | ||
- duronly: should Toggl show the start and stop time of this time entry? | ||
(boolean, not required) | ||
* at: timestamp that is sent in the response, indicates the time item was last | ||
- at: timestamp that is sent in the response, indicates the time item was last | ||
updated | ||
@@ -175,5 +186,7 @@ | ||
Use: | ||
``` | ||
```bash | ||
grunt toggl:MYTASK:workspaces | ||
``` | ||
To get a JSON list of workspaces. `MYTASK` should be whatever task you have | ||
@@ -188,5 +201,7 @@ configured, since you still need a valid API Key to get the workspaces. | ||
Use: | ||
``` | ||
```bash | ||
grunt toggl:MYTASK:projects | ||
``` | ||
To get a JSON list of projects in the configured workspace. Your task needs to | ||
@@ -199,13 +214,19 @@ have a Workspace ID properly setup in order to use this argument (valid | ||
Use: | ||
``` | ||
```bash | ||
grunt toggl:MYTASK:stopCurrent | ||
``` | ||
To stop the current task timer. This will call the API to find out if there is a current timer running. If there is, another call is made to stop it. | ||
To stop the current task timer. This will call the API to find out if there is | ||
a current timer running. If there is, another call is made to stop it. | ||
*OR* add this to your Gruntfile.js | ||
``` | ||
```javascript | ||
grunt.registerTask('toggl:stop', ['toggl:default:stopCurrent']); | ||
``` | ||
and you will be able to simply call | ||
``` | ||
```bash | ||
grunt toggl:stop | ||
@@ -228,2 +249,3 @@ ``` | ||
## Contributing | ||
In lieu of a formal styleguide, take care to maintain the existing coding | ||
@@ -235,11 +257,13 @@ style. Add unit tests for any new or changed functionality. Lint and test your | ||
* `debug` option that deletes time entries as soon as they're created. | ||
- `debug` option that deletes time entries as soon as they're created. | ||
## Release History | ||
``` | ||
* 2014-04-29 v0.2.0 [ADDED] argument for listing projects in a workspace | ||
```markdown | ||
- 2015-02-21 v0.3.0 [CHANGED] support grunt >=0.4.4 in package.json | ||
- 2014-04-29 v0.2.0 [ADDED] argument for listing projects in a workspace | ||
- 2014-04-29 v0.2.0 [ADDED] argument for listing projects in a workspace | ||
[CHANGED] arg for listing workspaces | ||
* 2014-04-28 v0.1.1 Alpha READY. It works. | ||
* 2014-04-28 v0.1.0 Work in progress, not ready. | ||
- 2014-04-28 v0.1.1 Alpha READY. It works. | ||
- 2014-04-28 v0.1.0 Work in progress, not ready. | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22374
255