Compare commits

...

13 Commits

Author SHA1 Message Date
8efa67a4ff 3.3.2 2016-02-25 08:39:48 +01:00
f7304f59a5 add optional docs publishing 2016-02-25 08:39:38 +01:00
070385867e 3.3.1 2016-02-25 08:26:32 +01:00
e429eb8ae0 fix cli call 2016-02-25 08:26:00 +01:00
6045174edb 3.3.0 2016-02-23 20:02:18 +01:00
08dcdb2c9f now installing typings before compiling 2016-02-23 20:02:07 +01:00
44aa92c83c now completeley hiding git console output 2016-02-23 18:58:44 +01:00
e43541cf90 3.2.2 2016-02-23 18:35:36 +01:00
414e845b80 fix config traveling 2016-02-23 18:35:28 +01:00
c18eb85ec8 fixed repo path 2016-02-23 18:24:07 +01:00
3ae3598c96 update env vars 2016-02-23 18:10:03 +01:00
26eca7aa65 added GitHub Token again 2016-02-23 17:44:35 +01:00
48d9de65a0 3.2.1 2016-02-23 17:33:04 +01:00
20 changed files with 82 additions and 92 deletions

View File

@ -2,5 +2,6 @@
support
compile
test/
docs/
examples
.gitignore

View File

@ -1,7 +1,7 @@
language: node_js
node_js:
- "4.3.1"
- "stable"
- 4.3.1
- stable
deploy:
provider: npm
email: npm@lossless.digital
@ -10,3 +10,6 @@ deploy:
on:
tags: true
repo: pushrocks/npmts
env:
global:
secure: kPKBMnEKoC+K5dXpl11NhuK3LSp0c0fRO60Akj3QeQBjUWnVAcF0Ht30c31y0lnJaMEzXhmUIKdR7RQnlmw5be4TYGINzY7FD3Dcv7o+HO1ZQrkpMWSu46jF6ZJer9moGjZ8e0rX8wZyB9SqsXYlwWRzqvxfOVxQfTvU3BEnJKHbhq+R5JMJ8dwLBPNTJKMWKq85KNsjo3ap0BjxdBUoRLzvrn31VOPH30BkvmLGc5YiIz5QmITll/T2wmQKYTNT2qDlEJ729B8pYa3eNlCNi89AxsLDGCmEoJAVrPsyw5g+gAyBqZ1GRULy83UJbELUq7cse3MRLMSwCAm4f0INRAuqcyiKYJ4+LHd0NwKrFQ/dQ0pvyBTbbEjNemXaakkWH7S6F03UvF+u+tiQ7C97XH0CRsseGlm36zCkAClEhtWVWA4U0Q5c6zqRAAOYOI0xquXalRKPTJe7fCYewp2eqmlp8drt8MxancyKI/ynXNoR5vGFzDTSRoPjTlaYQPmbiH4+Nd5+6Qoj94PEIqghebIPDQo3C7vWts4WGccux5b2q524UgB63hjJQA6+GQOo1q4RibouS6WScn8/tW/ZOEP+sNhDfkeiZUIjye+Q3PyzonGHefgSQ8wBbsc8LOX0cKUcEFWr14nhdQ9ZeW+hrSSF04TbM4zGJPGcKhmT2UU=

2
assets/cli.js Normal file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env node
var index = require("./index.js");

View File

@ -4,7 +4,7 @@ var plugins = {
gulp: require("gulp"),
g:{
typescript: require("gulp-typescript"),
header: require("gulp-header")
typings:require("gulp-typings")
},
mergeStream: require("merge2"),
path: require("path")
@ -18,7 +18,13 @@ paths = {
plugins.beautylog.log('now compiling NPMTS');
plugins.gulp.task('indexTS', function() {
plugins.gulp.task("typings",function(){
var stream = plugins.gulp.src(plugins.path.join(paths.packageBase,"ts/typings.json"))
.pipe(plugins.g.typings());
return stream;
});
plugins.gulp.task("TS",["typings"], function() {
var stream = plugins.gulp.src([
plugins.path.join(paths.packageBase,'ts/**/*.ts'),
"!" + plugins.path.join(paths.packageBase,'ts/typings/**/*.d.ts')
@ -27,12 +33,16 @@ plugins.gulp.task('indexTS', function() {
target:"ES5",
module:"commonjs"
}))
.pipe(plugins.g.header('#!/usr/bin/env node\n\n'))
.pipe(plugins.gulp.dest(plugins.path.join(paths.packageBase, 'dist/')));
return stream;
});
plugins.gulp.task('default',['indexTS'], function() {
plugins.gulp.task("CLI",function(){
var stream = plugins.gulp.src(plugins.path.join(paths.packageBase,"assets/cli.js"))
.pipe(plugins.gulp.dest(plugins.path.join(paths.packageBase, 'dist/')))
});
plugins.gulp.task('default',['TS',"CLI"], function() {
plugins.beautylog.success('Typescript compiled');
});

3
dist/cli.js vendored
View File

@ -1,3 +1,2 @@
#!/usr/bin/env node
/// <reference path="./typings/main.d.ts" />
var index = require("./index.js");

2
dist/index.js vendored
View File

@ -1,5 +1,3 @@
#!/usr/bin/env node
/// <reference path="./typings/main.d.ts" />
console.log("**** starting NPMTS ****");
var plugins = require("./npmts.plugins");

2
dist/npmts.cli.js vendored
View File

@ -1,3 +1 @@
#!/usr/bin/env node
/// <reference path="./typings/main.d.ts" />

View File

@ -1,5 +1,3 @@
#!/usr/bin/env node
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");

View File

@ -1,5 +1,3 @@
#!/usr/bin/env node
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");

53
dist/npmts.jsdoc.js vendored
View File

@ -1,9 +1,7 @@
#!/usr/bin/env node
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");
var genJsdoc = function () {
var genJsdoc = function (configArg) {
var done = plugins.Q.defer();
plugins.beautylog.log("now generating " + "JsDoc documentation".blue);
plugins.gulp.src([
@ -14,31 +12,27 @@ var genJsdoc = function () {
opts: {
destination: paths.docsDir
}
}, done.resolve));
}, function () {
done.resolve(configArg);
}));
return done.promise;
};
var publishDocs = function () {
var publishDocs = function (configArg) {
var done = plugins.Q.defer();
try {
var gitUrl = plugins.projectinfo.npm(paths.cwd, {
gitAccessToken: process.env.GITHUB_TOKEN
}).git.httpsUrl;
var deployScript = ""
+ "cd " + paths.docsDir + " "
+ "&& git init "
+ "&& git config user.name \"TRAVIS CI\" "
+ "&& git config user.email \"travis@shipzone.io\" "
+ "&& git add . "
+ "&& git commit -m \"Deploy to GitHub Pages\" "
+ "&& git push --force --quiet "
+ "\"" + gitUrl + "\" "
+ "master:gh-pages "
+ "> /dev/null 2>&1";
}
catch (err) {
console.log(err);
}
if (plugins.smartenv.getEnv().isTravis) {
var gitUrl = plugins.projectinfo.npm(paths.cwd, {
gitAccessToken: process.env.GITHUB_TOKEN
}).git.httpsUrl;
var deployScript = ""
+ "cd " + paths.docsDir + " "
+ "&& git init " + "> /dev/null 2>&1 "
+ "&& git config user.name \"TRAVIS CI\" " + "> /dev/null 2>&1 "
+ "&& git config user.email \"travis@shipzone.io\" " + "> /dev/null 2>&1 "
+ "&& git add . " + "> /dev/null 2>&1 "
+ "&& git commit -m \"Deploy to GitHub Pages\" " + "> /dev/null 2>&1 "
+ "&& git push --force --quiet "
+ "\"" + gitUrl + "\" "
+ "master:gh-pages " + "> /dev/null 2>&1";
if (plugins.smartenv.getEnv().isTravis && configArg.docs && configArg.docs.publish) {
plugins.beautylog.log("now publishing docs to GitHub");
if (!plugins.shelljs.which('git')) {
plugins.beautylog.error('Git is not installed');
@ -48,16 +42,17 @@ var publishDocs = function () {
plugins.beautylog.error('Error: Git failed');
plugins.shelljs.exit(1);
}
done.resolve();
plugins.beautylog.success("Docs have been deployed to GitHub");
done.resolve(configArg);
}
else {
done.resolve();
done.resolve(configArg);
}
return done.promise;
};
exports.run = function () {
exports.run = function (configArg) {
var done = plugins.Q.defer();
genJsdoc()
genJsdoc(configArg)
.then(publishDocs)
.then(done.resolve);
return done.promise;

View File

@ -1,5 +1,3 @@
#!/usr/bin/env node
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmts.plugins");
exports.run = function (configArg) {

2
dist/npmts.paths.js vendored
View File

@ -1,5 +1,3 @@
#!/usr/bin/env node
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmts.plugins");
var paths = {};

View File

@ -1,5 +1,3 @@
#!/usr/bin/env node
/// <reference path="./typings/main.d.ts" />
var plugins = {
beautylog: require("beautylog"),

View File

@ -1,5 +1,3 @@
#!/usr/bin/env node
/// <reference path="./typings/main.d.ts" />
var NpmtsConfigFile = require("./npmts.configfile");
var NpmtsOptions = require("./npmts.options");

2
dist/npmts.tests.js vendored
View File

@ -1,5 +1,3 @@
#!/usr/bin/env node
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");

View File

@ -1,6 +1,6 @@
{
"name": "npmts",
"version": "3.2.0",
"version": "3.3.2",
"description": "write npm modules with TypeScript",
"main": "dist/index.js",
"bin": {
@ -31,7 +31,6 @@
"gulp-concat": "^2.6.0",
"gulp-coveralls": "^0.1.4",
"gulp-function": "^1.1.1",
"gulp-header": "^1.7.1",
"gulp-if": "^2.0.0",
"gulp-istanbul": "^0.10.3",
"gulp-jsdoc3": "^0.2.0",
@ -50,6 +49,6 @@
"typings": "^0.6.8"
},
"devDependencies": {
"gulp-header": "^1.7.1"
"gulp-typings": "^1.1.0"
}
}

View File

@ -9,5 +9,8 @@
"./subts2/",
"./customdir"
],
"coveralls":true
"coveralls":true,
"docs": {
"publish":true
}
}

View File

@ -5,7 +5,7 @@
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/sometest/somerepo.git"
"url": "git+https://github.com/pushrocks/npmts.git"
},
"scripts": {
"test": "(npmts)"

View File

@ -1 +0,0 @@
/// <reference path="./typings/main.d.ts" />

View File

@ -2,7 +2,7 @@
import plugins = require("./npmts.plugins");
import paths = require("./npmts.paths");
var genJsdoc = function(){
var genJsdoc = function(configArg){
var done = plugins.Q.defer();
plugins.beautylog.log("now generating " + "JsDoc documentation".blue);
plugins.gulp.src([
@ -13,38 +13,34 @@ var genJsdoc = function(){
opts: {
destination: paths.docsDir
}
}, done.resolve));
}, function(){
done.resolve(configArg)
}));
return done.promise;
};
var publishDocs = function(){
var publishDocs = function(configArg){
var done = plugins.Q.defer();
try {
var gitUrl = plugins.projectinfo.npm(
paths.cwd,
{
gitAccessToken:process.env.GITHUB_TOKEN
}
).git.httpsUrl;
var gitUrl = plugins.projectinfo.npm(
paths.cwd,
{
gitAccessToken:process.env.GITHUB_TOKEN
}
).git.httpsUrl;
var deployScript = ""
+ "cd " + paths.docsDir + " "
+ "&& git init "
+ "&& git config user.name \"TRAVIS CI\" "
+ "&& git config user.email \"travis@shipzone.io\" "
+ "&& git add . "
+ "&& git commit -m \"Deploy to GitHub Pages\" "
+ "&& git push --force --quiet "
+ "\"" + gitUrl + "\" "
+ "master:gh-pages "
+ "> /dev/null 2>&1";
}
catch (err){
console.log(err);
}
var deployScript = ""
+ "cd " + paths.docsDir + " "
+ "&& git init " + "> /dev/null 2>&1 "
+ "&& git config user.name \"TRAVIS CI\" " + "> /dev/null 2>&1 "
+ "&& git config user.email \"travis@shipzone.io\" " + "> /dev/null 2>&1 "
+ "&& git add . " + "> /dev/null 2>&1 "
+ "&& git commit -m \"Deploy to GitHub Pages\" " + "> /dev/null 2>&1 "
+ "&& git push --force --quiet "
+ "\"" + gitUrl + "\" "
+ "master:gh-pages " + "> /dev/null 2>&1";
if(plugins.smartenv.getEnv().isTravis){
plugins.beautylog.log("now publishing docs to GitHub")
if(plugins.smartenv.getEnv().isTravis && configArg.docs && configArg.docs.publish){
plugins.beautylog.log("now publishing docs to GitHub");
if (!plugins.shelljs.which('git')) {
plugins.beautylog.error('Git is not installed');
plugins.shelljs.exit(1);
@ -52,17 +48,18 @@ var publishDocs = function(){
plugins.beautylog.error('Error: Git failed');
plugins.shelljs.exit(1);
}
done.resolve();
plugins.beautylog.success("Docs have been deployed to GitHub");
done.resolve(configArg);
} else {
done.resolve();
done.resolve(configArg);
}
return done.promise;
};
export var run = function(){
export var run = function(configArg){
var done = plugins.Q.defer();
genJsdoc()
genJsdoc(configArg)
.then(publishDocs)
.then(done.resolve);
return done.promise;