20 Commits

Author SHA1 Message Date
Philipp Kunz
1a3aa040e4 0.0.9 2015-11-28 22:48:46 +01:00
Philipp Kunz
79f97b504b small fix 2015-11-28 22:48:41 +01:00
Philipp Kunz
1d58aa38bd 0.0.8 2015-11-28 22:44:05 +01:00
Philipp Kunz
304f3801bd add smartdebug.run() function 2015-11-28 22:43:57 +01:00
Philipp Kunz
c87172ff1f 0.0.7 2015-11-22 07:59:42 +01:00
Philipp Kunz
c782b256c0 added getStatus function 2015-11-22 07:59:34 +01:00
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
Philipp Kunz
57ba53e9d1 0.0.2 2015-11-15 20:56:17 +01:00
Philipp Kunz
401f9e9725 ad travis 2015-11-15 20:55:58 +01:00
9 changed files with 76 additions and 56 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

@@ -1,16 +1,16 @@
language: node_js
node_js:
- "4.1"
- '4.1'
before_install:
- npm install -g tsd
deploy:
provider: npm
email: npm@smart-coordination.com
api_key:
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3Wshj+3aLHjxNk3OhuddOC1LStp3NOukMkTo4n4NSf1ja8UtIfjy0NI4+D9aycUAmo6Elpj0QpqIYwjOAWiRJpvaKmxqouk1St1YeMqMN0Xx37xkqieRmVZbH0j7CypdWFicVWQdBE7yp45vAPae5/qDikTgbIrnPZvBPADQi5tJfth2+K8Hi8Twzj+8OjFr4iWAXnWM641jUyLvC4tFlxuOBmomUQ30F/zhWUvFipzyX1LOzYhoqIPwWWTFFTs6IqcWq6OLG86c92c2UdmUvMBUM2gbtGoP7GcXzIz34I=
on:
tags: true
repo: pushrocks/gulp-bootstrap
repo: pushrocks/smartdebug
notifications:
slack:
secure: f5Uss0z9RPl/QcA/DroB8loyE93aOYI6bqCkrsiUscmZtlv/TVQtT4dxqGA6uvcG6iTQDBi3Ul88dQxWkRm4IqbhY35/iMaV2dHW4FVYMAh8GQMbsfL2sALCcufxD9blw47awv3iFcwhV1EeyesscjgL0JIjduk96v/7G/6QIO2838M1lzlgtj+kRUkim8qkaEs1je3gRrhMUIjLuAdscMXyUKYFMjWo9ACSjVUl30R/ZNemb18itIja6i92GotreBgcfEMczvy58ovDC7xdJUsY8LjMI01DwY+WPRnI0tAhsuI8moBwwcdM4e3bAjKjucQRjO33O5bMWRZ6QCiYd0DnCEFyCPQLJ4GSy/tkD00n8ijLHAOSV3AH1zNbdK1EAdSPQXDvlI36KJn/2hyQLoitGHVUPr76ujJWP82ypO2tgIp3XQU0dJVCxDuHnwJO2+hjdI+gCPqxNTpjeujHx3UdkTGNRjuuf9dlZ/D08fApjYxy2fxItTqo3QjP/nrqvBXUOPP8yPHpjIT4H2t5Pr4SJjBGI6X4qhKyFj6s9rA/Xu1rL+45zu1C3uC3z+u3T9UwrbzJ/cZM6r6UQvQmUvIfBNaMlg4I/diQCDIPL+Rhop2nylY3IcHmJnk2itn7kOqj1tohCpFEml5pRuSZy4udWywkdtyBAsHWFLF7oiQ=

View File

@@ -1,39 +1,21 @@
# gulp-bootstrap
works with gulp, but does nothing. Use it to bootstrap your own gulp plugin with TypeScript, Travis and npm.
# smartdebug
debug your JavaScript the smart way
### Buildstatus/Dependencies
[![Build Status](https://travis-ci.org/pushrocks/gulp-bootstrap.svg?branch=master)](https://travis-ci.org/pushrocks/gulp-bootstrap)
[![devDependency Status](https://david-dm.org/pushrocks/gulp-bootstrap/dev-status.svg)](https://david-dm.org/pushrocks/gulp-bootstrap#info=devDependencies)
[![Build Status](https://travis-ci.org/pushrocks/smartdebug.svg?branch=master)](https://travis-ci.org/pushrocks/smartdebug)
[![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
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
* Use gulp to compile TypeScript without the global gulp CLI Tool.
* Use travis to deploy to npm
* 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
smartDebug.log("This message is not shown");
smartDebug.activate(true);
smartDebug.log("This debug message is shown");
```
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,23 @@
/// <reference path="typings/tsd.d.ts" />
var beautylog = require("beautylog");
var beautylog = require("beautylog")("os");
var colors = require("colors");
var debugActive = false;
var debugsmart = {
var smartDebug = {
log: function (message) {
if (debugActive) {
beautylog.log("Debug:".zebra + ' ' + message);
beautylog.log("###DEBUG:###".rainbow + ' ' + message);
}
},
run: function (functionArg) {
if (debugActive) {
functionArg();
}
},
activate: function (debugArg) {
debugActive = debugArg;
},
getStatus: function () {
return debugActive;
}
};
module.exports = debugsmart;
module.exports = smartDebug;

View File

@@ -1,17 +1,17 @@
{
"name": "debugsmart",
"version": "0.0.1",
"name": "smartdebug",
"version": "0.0.9",
"description": "debug your JavaScript the smart way",
"main": "index.js",
"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)",
"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)"
},
"repository": {
"type": "git",
"url": "https://github.com/pushrocks/debugsmart.git"
"url": "https://github.com/pushrocks/smartdebug.git"
},
"keywords": [
"json",
@@ -21,9 +21,9 @@
"author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)",
"license": "MIT",
"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": {
"beautylog": "^1.0.3",
"colors": "^1.1.2"

9
test.js 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");
bl.log("debug.status() is " + smartDebug.getStatus());
smartDebug.activate(true);
smartDebug.log("This debug message is shown");
bl.log("debug.status() is " + smartDebug.getStatus());
bl.success("Test successfull");

View File

@@ -12,7 +12,16 @@ gulp.task('compileTS', function() {
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');
});

View File

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

10
ts/test.ts Normal file
View File

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