This commit is contained in:
Philipp Kunz 2015-11-15 20:35:13 +01:00
parent 1dc70c5d77
commit e6277a8c13
15 changed files with 2398 additions and 0 deletions

10
.gitignore vendored Normal file
View File

@ -0,0 +1,10 @@
node_modules/
.settings/
.idea/
#npm devug
npm-debug.log
ts/*.js
ts/*.js.map

6
.idea/vcs.xml generated Normal file
View File

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

16
.travis.yml Normal file
View File

@ -0,0 +1,16 @@
language: node_js
node_js:
- "4.1"
before_install:
- npm install -g tsd
deploy:
provider: npm
email: npm@smart-coordination.com
api_key:
secure: y7l1JyBDihAYxbqfuPAUXJfY+PC7RSSCkAtXtBIjPA6wytSBnz55te/Vdy8RFgVty6O/k4hHzrhgUJMSoWKmPuGQ5bMBgkyV9OI5PPp4uEUyy5UdcJZv3cZYpGGDRjLjCHP4pF7AHdRcDUMEiE5ZrDtmUH1SBLoRswieO0TKsiMr3u45yR6rHFoPnnw1YlatoAPpiuP3SLnCrIjQeSOS7y9SL6PpakiquJNtpseVOr60sp39L6vLAeqJ7xTjjNJk23LF/60lfiKtM7QFg9qqE7cxFUWJs7Zmgfg4/hGcU9XRfDfZQgSNntcdFczPejO5juv2KOb1tzH7EhXrWlcF1yd70RBdJbcOn7O6ctHjMCGrCSn6IQPzcNWNErFELfMLsjVQUxbfHSc0iA1JxcYWeXUivrStwVOa9ufuG2KZCQZyEjra3zPdCu9yrE30c/mTace7eJXPYTsNn2tmxvTnFoTWmeQ0xL9Iyz9zceADpxjYJoJ8r4XMDWxWga5G9OPaqCINHxjKhOX0C36YEjYTaeNMNHv6F6BPLdKwQ9SmklMtcyC312nJsXwKy+KYJSoY6WqMef9Zk3ez0o09W0UkSr0qiQkyYCoNm8b1L7VrYuccPH24GE0fn8QMWmeE5TBThYbEIdt6NBoYCDeocflUm5KBrImFGo1peeYS1aQnpoQ=
on:
tags: true
repo: pushrocks/gulp-bootstrap
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=

39
README.md Normal file
View File

@ -0,0 +1,39 @@
# gulp-bootstrap
works with gulp, but does nothing. Use it to bootstrap your own gulp plugin with TypeScript, Travis and npm.
### 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)
### Usage
This npm package comes with everything you need to start your own gulp plugin.
Features:
* 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
```

15
index.js Normal file
View File

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

36
package.json Normal file
View File

@ -0,0 +1,36 @@
{
"name": "debugsmart",
"version": "0.0.0",
"description": "debug your JavaScript the smart way",
"main": "index.js",
"scripts": {
"test": "(cd ts/compile && node compile.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"
},
"keywords": [
"json",
"jade",
"template"
],
"author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)",
"license": "MIT",
"bugs": {
"url": "https://github.com/pushrocks/debugsmart/issues"
},
"homepage": "https://github.com/pushrocks/debugsmart",
"dependencies": {
"beautylog": "^1.0.3",
"colors": "^1.1.2"
},
"devDependencies": {
"gulp": "3.9.0",
"gulp-typescript": "2.9.2",
"pushrocks": "^1.0.22"
}
}

21
ts/compile/compile.js Normal file
View File

@ -0,0 +1,21 @@
// import gulp
var gulp = require("gulp")
var gulpTypescript = require("gulp-typescript");
var pr = require("pushrocks");
gulp.task('compileTS', function() {
var stream = gulp.src('../index.ts')
.pipe(gulpTypescript({
out: "index.js"
}))
.pipe(gulp.dest("../../"));
return stream;
});
gulp.task('default',['compileTS'], function() {
pr.beautylog.success('Typescript compiled');
});
//lets tell gulp to start with the default task.
pr.beautylog.log('Starting Gulp to compile TypeScript');
gulp.start.apply(gulp, ['default']);

2
ts/compile/readme.md Normal file
View File

@ -0,0 +1,2 @@
# How to compile.
Make sure gulp and gulp-taypescript from npm are available. Then run the gulpfile in this directory.

16
ts/index.js Normal file
View File

@ -0,0 +1,16 @@
/// <reference path="typings/tsd.d.ts" />
var beautylog = require("beautylog");
var colors = require("colors");
var debugActive = false;
var debugsmart = {
log: function (message) {
if (debugActive) {
beautylog.log("Debug:".zebra + ' ' + message);
}
},
activate: function (debugArg) {
debugActive = debugArg;
}
};
module.exports = debugsmart;
//# sourceMappingURL=index.js.map

1
ts/index.js.map Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,IAAI,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACrC,IAAI,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE/B,IAAI,WAAW,GAAW,KAAK,CAAC;AAChC,IAAI,UAAU,GAAG;IACb,GAAG,EAAE,UAAS,OAAc;QACxB,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;YACd,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,GAAG,GAAG,GAAG,OAAO,CAAC,CAAC;QAClD,CAAC;IACL,CAAC;IACD,QAAQ,EAAE,UAAS,QAAgB;QAC/B,WAAW,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACJ,CAAC;AAEF,MAAM,CAAC,OAAO,GAAG,UAAU,CAAC"}

17
ts/index.ts Normal file
View File

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

15
ts/tsd.json Normal file
View File

@ -0,0 +1,15 @@
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "master",
"path": "typings",
"bundle": "typings/tsd.d.ts",
"installed": {
"node/node.d.ts": {
"commit": "efa0c1196d7280640e624ac1e7fa604502e7bd63"
},
"colors/colors.d.ts": {
"commit": "aed176536a202b9a2475ce1989ea6d2d0226a185"
}
}
}

123
ts/typings/colors/colors.d.ts vendored Normal file
View File

@ -0,0 +1,123 @@
// Type definitions for Colors.js 0.6.0-1
// Project: https://github.com/Marak/colors.js
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "colors" {
interface Color {
(text: string): string;
black: Color;
red: Color;
green: Color;
yellow: Color;
blue: Color;
magenta: Color;
cyan: Color;
white: Color;
gray: Color;
grey: Color;
bgBlack: Color;
bgRed: Color;
bgGreen: Color;
bgYellow: Color;
bgBlue: Color;
bgMagenta: Color;
bgCyan: Color;
bgWhite: Color;
reset: Color;
bold: Color;
dim: Color;
italic: Color;
underline: Color;
inverse: Color;
hidden: Color;
strikethrough: Color;
rainbow: Color;
zebra: Color;
america: Color;
trap: Color;
random: Color;
}
module e {
export function setTheme(theme:any): void;
export var black: Color;
export var red: Color;
export var green: Color;
export var yellow: Color;
export var blue: Color;
export var magenta: Color;
export var cyan: Color;
export var white: Color;
export var gray: Color;
export var grey: Color;
export var bgBlack: Color;
export var bgRed: Color;
export var bgGreen: Color;
export var bgYellow: Color;
export var bgBlue: Color;
export var bgMagenta: Color;
export var bgCyan: Color;
export var bgWhite: Color;
export var reset: Color;
export var bold: Color;
export var dim: Color;
export var italic: Color;
export var underline: Color;
export var inverse: Color;
export var hidden: Color;
export var strikethrough: Color;
export var rainbow: Color;
export var zebra: Color;
export var america: Color;
export var trap: Color;
export var random: Color;
}
export = e;
}
interface String {
black: string;
red: string;
green: string;
yellow: string;
blue: string;
magenta: string;
cyan: string;
white: string;
gray: string;
grey: string;
bgBlack: string;
bgRed: string;
bgGreen: string;
bgYellow: string;
bgBlue: string;
bgMagenta: string;
bgCyan: string;
bgWhite: string;
reset: string;
bold: string;
dim: string;
italic: string;
underline: string;
inverse: string;
hidden: string;
strikethrough: string;
rainbow: string;
zebra: string;
america: string;
trap: string;
random: string;
}

2079
ts/typings/node/node.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

2
ts/typings/tsd.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
/// <reference path="node/node.d.ts" />
/// <reference path="colors/colors.d.ts" />