Compare commits

...

5 Commits

Author SHA1 Message Date
71f8d14ee9 0.0.4 2016-01-14 19:59:36 +01:00
d539aef414 update 2016-01-14 19:57:42 +01:00
a1146e4c79 0.0.3 2016-01-14 19:32:31 +01:00
6e053fc4c6 0.0.2 2016-01-14 19:32:06 +01:00
2dffae4872 updated bin handling 2016-01-14 19:31:53 +01:00
9 changed files with 38 additions and 13 deletions

View File

@ -1,6 +1,7 @@
// import gulp // import gulp
var gulp = require("gulp"); var gulp = require("gulp");
var gulpTypescript = require("gulp-typescript"); var gulpTypescript = require("gulp-typescript");
var gulpInsert = require("gulp-insert");
var plugins = { var plugins = {
beautylog: require("beautylog") beautylog: require("beautylog")
}; };
@ -9,10 +10,11 @@ plugins.beautylog.log('now compiling the mojo.io gulp tasks');
gulp.task('indexTS', function() { gulp.task('indexTS', function() {
var stream = gulp.src('../ts/index.ts') var stream = gulp.src('../ts/index.ts')
.pipe(gulpTypescript({ .pipe(gulpTypescript({
out: "index.js" out: "index.js"
})) }))
.pipe(gulp.dest("../")); .pipe(gulpInsert.prepend('#!/usr/bin/env node\n\n'))
.pipe(gulp.dest("../"));
return stream; return stream;
}); });

View File

@ -1,3 +1,5 @@
#!/usr/bin/env node
/// <reference path="./typings/tsd.d.ts" /> /// <reference path="./typings/tsd.d.ts" />
var plugins = { var plugins = {
beautylog: require("beautylog"), beautylog: require("beautylog"),
@ -8,6 +10,7 @@ var plugins = {
}; };
var paths = {}; var paths = {};
paths.cwd = plugins.smartcli.get.cwd().path; paths.cwd = plugins.smartcli.get.cwd().path;
console.log(paths.cwd);
paths.indexTS = plugins.path.join(paths.cwd, "ts/index.ts"); paths.indexTS = plugins.path.join(paths.cwd, "ts/index.ts");
paths.testTS = plugins.path.join(paths.cwd, "ts/test.ts"); paths.testTS = plugins.path.join(paths.cwd, "ts/test.ts");
plugins.gulp.task("indexTS", function () { plugins.gulp.task("indexTS", function () {

View File

@ -1,13 +1,14 @@
{ {
"name": "npmts", "name": "npmts",
"version": "0.0.1", "version": "0.0.4",
"description": "write npm modules with TypeScript", "description": "write npm modules with TypeScript",
"main": "index.js", "main": "index.js",
"bin": { "bin": {
"npmts": "index.js" "npmts": "index.js"
}, },
"scripts": { "scripts": {
"test": "(cd compile && node compile.js)" "test": "(cd compile && node compile.js)",
"testm": "(cd test/ && npm update && npm test)"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -26,6 +27,7 @@
"dependencies": { "dependencies": {
"beautylog": "^2.0.2", "beautylog": "^2.0.2",
"gulp": "^3.9.0", "gulp": "^3.9.0",
"gulp-insert": "^0.5.0",
"gulp-typescript": "^2.10.0", "gulp-typescript": "^2.10.0",
"smartcli": "0.0.11" "smartcli": "0.0.11"
} }

23
test/node_modules/npmts/package.json generated vendored
View File

@ -1,10 +1,14 @@
{ {
"name": "npmts", "name": "npmts",
"version": "0.0.0", "version": "0.0.3",
"description": "write npm modules with TypeScript", "description": "write npm modules with TypeScript",
"main": "index.js", "main": "index.js",
"bin": {
"npmts": "index.js"
},
"scripts": { "scripts": {
"test": "npmts" "test": "(cd compile && node compile.js)",
"testm": "(cd test/ && npm update && npm test)"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -23,9 +27,16 @@
"url": "https://github.com/pushrocks/npmts/issues" "url": "https://github.com/pushrocks/npmts/issues"
}, },
"homepage": "https://github.com/pushrocks/npmts#readme", "homepage": "https://github.com/pushrocks/npmts#readme",
"gitHead": "1699d259b46348a712c638a4fc76a2579e0ecfd9", "dependencies": {
"beautylog": "^2.0.2",
"gulp": "^3.9.0",
"gulp-insert": "^0.5.0",
"gulp-typescript": "^2.10.0",
"smartcli": "0.0.11"
},
"gitHead": "a1146e4c79f5e97f51d540c82a2307b3cd5ba9b0",
"readme": "ERROR: No README data found!", "readme": "ERROR: No README data found!",
"_id": "npmts@0.0.0", "_id": "npmts@0.0.3",
"_shasum": "9baf3fb8c432625908c5f6a545e93e95ea0bd2c4", "_shasum": "f845bce63cb3c5185e995c9e55222fb4e187a7e5",
"_from": "npmts@latest" "_from": "npmts@0.0.3"
} }

4
test/ts/index.js Normal file
View File

@ -0,0 +1,4 @@
(function () {
console.log("test");
}());
//# sourceMappingURL=index.js.map

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

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,CAAC;IACG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;AACvB,CAAC,EAAE,CAAC,CAAC"}

View File

@ -8,6 +8,7 @@ var plugins = {
}; };
var paths = {}; var paths = {};
paths.cwd = plugins.smartcli.get.cwd().path; paths.cwd = plugins.smartcli.get.cwd().path;
console.log(paths.cwd);
paths.indexTS = plugins.path.join(paths.cwd, "ts/index.ts"); paths.indexTS = plugins.path.join(paths.cwd, "ts/index.ts");
paths.testTS = plugins.path.join(paths.cwd, "ts/test.ts"); paths.testTS = plugins.path.join(paths.cwd, "ts/test.ts");
plugins.gulp.task("indexTS", function () { plugins.gulp.task("indexTS", function () {

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,IAAI,OAAO,GAAG;IACV,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC;IAC/B,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC,iBAAiB,CAAC;IAC1C,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC;CAChC,CAAC;AAEF,IAAI,KAAK,GAAO,EAAE,CAAC;AACnB,KAAK,CAAC,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;AAC5C,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAC,aAAa,CAAC,CAAC;AAC3D,KAAK,CAAC,MAAM,GAAG,OAA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AACvB,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAC,aAAa,CAAC,CAAC;AAC3D,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAC,YAAY,CAAC,CAAC;AAEzD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;IACzB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC;SAC1B,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;QACzB,GAAG,EAAE,UAAU;KAClB,CAAC,CAAC;SACF,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA;AAC3C,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;IACzB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC;SAC1B,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;QACzB,GAAG,EAAE,SAAS;KACjB,CAAC,CAAC;SACF,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA;AAC3C,CAAC,CAAC,CAAC"}

View File

@ -9,6 +9,7 @@ var plugins = {
var paths:any = {}; var paths:any = {};
paths.cwd = plugins.smartcli.get.cwd().path; paths.cwd = plugins.smartcli.get.cwd().path;
console.log(paths.cwd);
paths.indexTS = plugins.path.join(paths.cwd,"ts/index.ts"); paths.indexTS = plugins.path.join(paths.cwd,"ts/index.ts");
paths.testTS = plugins.path.join(paths.cwd,"ts/test.ts"); paths.testTS = plugins.path.join(paths.cwd,"ts/test.ts");