12 Commits

Author SHA1 Message Date
Philipp Kunz
f78b0b6fb8 0.0.6 2015-11-17 02:39:46 +01:00
Philipp Kunz
5c8feb571c added dependency badge 2015-11-17 02:39:39 +01:00
Philipp Kunz
87411ef5a4 0.0.5 2015-11-17 02:37:12 +01:00
Philipp Kunz
114fbe6425 added debugmessage 2015-11-17 02:36:58 +01:00
Philipp Kunz
33cf164aca 0.0.4 2015-11-17 02:30:10 +01:00
Philipp Kunz
a13759e8ed 0.0.3 2015-11-17 02:29:24 +01:00
Philipp Kunz
7e588db44a updated Readme and Test 2015-11-17 02:29:18 +01:00
Philipp Kunz
1a9bd0fc15 update travis 2015-11-16 20:26:06 +01:00
c31265d4bd better debug output 2015-11-16 01:50:28 +01:00
d9679f79e2 add tests 2015-11-16 01:40:23 +01:00
e419014edd update 2015-11-16 01:35:56 +01:00
Phil Kunz
caad91a03a Update package.json 2015-11-16 01:26:17 +01:00
9 changed files with 55 additions and 54 deletions

6
.idea/vcs.xml generated
View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@@ -7,10 +7,10 @@ deploy:
provider: npm provider: npm
email: npm@smart-coordination.com email: npm@smart-coordination.com
api_key: api_key:
secure: Otp9t0Nb23QQMl3qv4OHx/uARABUHMBqtyfdt+p3jPRvRriWwD7Wytmvoz8+pBYfBBxbSqL2+Jd1E1nT0V+eUHRJm7cmdd3r4kdpOUBD68VQiPjs/ZbX4X+444M7pl5C+UnJpltncqjKAo5HHq5x68w2nOtZoeemJ85IpvVsh02RKLf0Yjl6qXtpECQCPtuq5UR2d25zm9wGeHnSnsgxDKH8U6hslGHzntgIvRYhCiV24j+OQtRsQFtN6XRZMrV0RIs54NO+mYiuzCY3+Sc4QfxEA1QSMZJdL0V6pKs44xdzVOaRWdn11nLMA64hSnSA7qxOAIqVvDERiPfJOy8Fw+0j4GdFU04MQ4PV/8K4wqh0LeWBF/DRU8rhKtL1GscmMtDX/YJvw2DIvanyT3OLxwag1IvbUDUJo+ptA0/6fYlQxn3tjEa8xu2FQ7dYpTZ+FfwOX+pY7H4Jb7/k8T96ptYet8VZg+t8IWyBJ7X64c/EIEC3d/4QhSZrQReM7TrIbNo/66qe2ddFN+kSQ4d+9whGtwaeXGzIjWB4IfYpw8BxEJEGaiBmiJQVidkIQhnTZZMtcX5crb0IU9YEBN1CAE09mDCJP6xvuUhCPy1hbrF/xgYG7rE8auPA3oiQQdjoGsuTDQB+TMEtVL5QTyk/IRsJyvaI4QpsIV29Ox/2zSc= secure: CDLSxeLMcoLU1E2EVxx9Ti7XIy6uKxvu3IE54NbMOTtLLQdz7cE8VEOfLSu1FZw3mU0iZNw+f3OR8QANnfhmWb5y+gWQlcTl0BZV6vvM/G2SnyQBoKJX4qo8PkRvKWV5ReYD94uVlo5/yRb1beC+FGCAUcPE09vtACPrq2XALVfS0+FrNv7hQO+B8ZV+fKpxEPhgIaZZu2iBexdtU0yvIA7nw8DrcM88PG8YU0fs6S4aDk9qnxcjnmImZENcsvC5htaAckvNtpuhLW+EaT9RjJgqLRuayFFl2OYLRCUzgMGar4I5IBVCBOnA2sWmAquGYfGP0vm0zXg/mi++JQVrPRUZbXo0GVHpFkqV7XzS/daTjg7oV6KUgUp+RzpxTitDr3Wshj+3aLHjxNk3OhuddOC1LStp3NOukMkTo4n4NSf1ja8UtIfjy0NI4+D9aycUAmo6Elpj0QpqIYwjOAWiRJpvaKmxqouk1St1YeMqMN0Xx37xkqieRmVZbH0j7CypdWFicVWQdBE7yp45vAPae5/qDikTgbIrnPZvBPADQi5tJfth2+K8Hi8Twzj+8OjFr4iWAXnWM641jUyLvC4tFlxuOBmomUQ30F/zhWUvFipzyX1LOzYhoqIPwWWTFFTs6IqcWq6OLG86c92c2UdmUvMBUM2gbtGoP7GcXzIz34I=
on: on:
tags: true tags: true
repo: pushrocks/debugsmart repo: pushrocks/smartdebug
notifications: notifications:
slack: sl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oitGHVUPr76ujJWP82ypO2tgIp3XQU0dJVCxDuHnwJO2+hjdI+gCPqxNTpjeujHx3UdkTGNRjuuf9dlZ/D08fApjYxy2fxItTqo3QjP/nrqvBXUOPP8yPHpjIT4H2t5Pr4SJjBGI6X4qhKyFj6s9rA/Xu1rL+45zu1C3uC3z+u3T9UwrbzJ/cZM6r6UQvQmUvIfBNaMlg4I/diQCDIPL+Rhop2nylY3IcHmJnk2itn7kOqj1tohCpFEml5pRuSZy4udWywkdtyBAsHWFLF7oiQ=

View File

@@ -1,39 +1,21 @@
# gulp-bootstrap # smartdebug
works with gulp, but does nothing. Use it to bootstrap your own gulp plugin with TypeScript, Travis and npm. debug your JavaScript the smart way
### Buildstatus/Dependencies ### Buildstatus/Dependencies
[![Build Status](https://travis-ci.org/pushrocks/gulp-bootstrap.svg?branch=master)](https://travis-ci.org/pushrocks/gulp-bootstrap) [![Build Status](https://travis-ci.org/pushrocks/smartdebug.svg?branch=master)](https://travis-ci.org/pushrocks/smartdebug)
[![devDependency Status](https://david-dm.org/pushrocks/gulp-bootstrap/dev-status.svg)](https://david-dm.org/pushrocks/gulp-bootstrap#info=devDependencies) [![Dependency Status](https://david-dm.org/pushrocks/smartdebug.svg)](https://david-dm.org/pushrocks/smartdebug)
[![devDependency Status](https://david-dm.org/pushrocks/smartdebug/dev-status.svg)](https://david-dm.org/pushrocks/smartdebug#info=devDependencies)
### Usage ### Usage
This npm package comes with everything you need to start your own gulp plugin. This plugin is thought for easy debug logging.
Features: ```javascript
var smartDebug = require("smartdebug");
* TypeScript: Code your plugin in TypeScript smartDebug.log("This message is not shown");
* Use gulp to compile TypeScript without the global gulp CLI Tool. smartDebug.activate(true);
* Use travis to deploy to npm smartDebug.log("This debug message is shown");
* Have a master branch for the latest dev version
* Have a release branch for the latest npm version
This package **doesn't require global gulp** (just local -> simply do npm install`) to compile TypeScript.
* to compile TypeScript do `npm test` (You should chain your own tests to this command later on)
* to setup release do `npm run setup`
* to release a patch do `npm run release`
We recommend using travis for npm releasing and test integration.
#### The structure
```
gulp-bootstrap/
|
|- ts/
| |- compile/
| | |- compile.js **** contains gulp task`
| |- index.ts **** Your main TypeScript file.
|
|- index.js **** the compiled module
``` ```
The above code produces debug messages like this:
![debugmessage.png](https://mediaserve.lossless.digital/github.com/pushrocks/smartdebug/debugmessage.png)

View File

@@ -1,15 +1,15 @@
/// <reference path="typings/tsd.d.ts" /> /// <reference path="typings/tsd.d.ts" />
var beautylog = require("beautylog"); var beautylog = require("beautylog")("os");
var colors = require("colors"); var colors = require("colors");
var debugActive = false; var debugActive = false;
var debugsmart = { var smartDebug = {
log: function (message) { log: function (message) {
if (debugActive) { if (debugActive) {
beautylog.log("Debug:".zebra + ' ' + message); beautylog.log("###DEBUG:###".rainbow + ' ' + message);
} }
}, },
activate: function (debugArg) { activate: function (debugArg) {
debugActive = debugArg; debugActive = debugArg;
} }
}; };
module.exports = debugsmart; module.exports = smartDebug;

View File

@@ -1,17 +1,17 @@
{ {
"name": "debugsmart", "name": "smartdebug",
"version": "0.0.2", "version": "0.0.6",
"description": "debug your JavaScript the smart way", "description": "debug your JavaScript the smart way",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "(cd ts/compile && node compile.js)", "test": "(cd ts/compile && node compile.js) && (node test.js)",
"reinstall": "(rm -r node_modules && npm install)", "reinstall": "(rm -r node_modules && npm install)",
"release": "(git pull origin master && npm version patch && git push origin master && git checkout release && git merge master && git push origin release && git checkout master)", "release": "(git pull origin master && npm version patch && git push origin master && git checkout release && git merge master && git push origin release && git checkout master)",
"startdev": "(git checkout master && git pull origin master)" "startdev": "(git checkout master && git pull origin master)"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/pushrocks/debugsmart.git" "url": "https://github.com/pushrocks/smartdebug.git"
}, },
"keywords": [ "keywords": [
"json", "json",
@@ -21,9 +21,9 @@
"author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)", "author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)",
"license": "MIT", "license": "MIT",
"bugs": { "bugs": {
"url": "https://github.com/pushrocks/debugsmart/issues" "url": "https://github.com/pushrocks/smartdebug/issues"
}, },
"homepage": "https://github.com/pushrocks/debugsmart", "homepage": "https://github.com/pushrocks/smartdebug",
"dependencies": { "dependencies": {
"beautylog": "^1.0.3", "beautylog": "^1.0.3",
"colors": "^1.1.2" "colors": "^1.1.2"

7
test.js Normal file
View File

@@ -0,0 +1,7 @@
/// <reference path="typings/tsd.d.ts" />
var smartDebug = require("./index.js");
var bl = require("beautylog")("os");
smartDebug.log("This message is not shown");
smartDebug.activate(true);
smartDebug.log("This debug message is shown");
bl.success("Test successfull");

View File

@@ -12,7 +12,16 @@ gulp.task('compileTS', function() {
return stream; return stream;
}); });
gulp.task('default',['compileTS'], function() { gulp.task('compileTSTest', function() {
var stream = gulp.src('../test.ts')
.pipe(gulpTypescript({
out: "test.js"
}))
.pipe(gulp.dest("../../"));
return stream;
});
gulp.task('default',['compileTS','compileTSTest'], function() {
pr.beautylog.success('Typescript compiled'); pr.beautylog.success('Typescript compiled');
}); });

View File

@@ -1,12 +1,12 @@
/// <reference path="typings/tsd.d.ts" /> /// <reference path="typings/tsd.d.ts" />
var beautylog = require("beautylog"); var beautylog = require("beautylog")("os");
var colors = require("colors"); var colors = require("colors");
var debugActive:boolean = false; var debugActive:boolean = false;
var debugsmart = { var smartDebug = {
log: function(message:string){ log: function(message:string){
if (debugActive) { if (debugActive) {
beautylog.log("Debug:".zebra + ' ' + message); beautylog.log("###DEBUG:###".rainbow + ' ' + message);
} }
}, },
activate: function(debugArg:boolean){ activate: function(debugArg:boolean){
@@ -14,4 +14,4 @@ var debugsmart = {
} }
}; };
module.exports = debugsmart; module.exports = smartDebug;

9
ts/test.ts Normal file
View File

@@ -0,0 +1,9 @@
/// <reference path="typings/tsd.d.ts" />
var smartDebug = require("./index.js");
var bl = require("beautylog")("os");
smartDebug.log("This message is not shown");
smartDebug.activate(true);
smartDebug.log("This debug message is shown");
bl.success("Test successfull");