Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
24f9e5e982 | |||
660942e798 | |||
f5bc4578d7 | |||
2a87fc839d | |||
149e0cbc9e | |||
3b69350ce2 | |||
ea793f9556 | |||
5266fcd3df | |||
39b7fe99c7 | |||
e1419d85cc | |||
71f8d14ee9 | |||
d539aef414 | |||
a1146e4c79 | |||
6e053fc4c6 | |||
2dffae4872 |
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
.idea/
|
.idea/
|
||||||
.c9/
|
.c9/
|
||||||
node_modules/
|
node_modules/
|
||||||
|
test/node_modules
|
@ -1,3 +1,4 @@
|
|||||||
|
.idea/
|
||||||
support
|
support
|
||||||
compile
|
compile
|
||||||
test
|
test
|
||||||
|
@ -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;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
13
index.js
13
index.js
@ -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"),
|
||||||
@ -19,8 +21,19 @@ plugins.gulp.task("indexTS", function () {
|
|||||||
});
|
});
|
||||||
plugins.gulp.task("indexTS", function () {
|
plugins.gulp.task("indexTS", function () {
|
||||||
plugins.gulp.src(paths.indexTS)
|
plugins.gulp.src(paths.indexTS)
|
||||||
|
.pipe(plugins.gulpTypeScript({
|
||||||
|
out: "index.js"
|
||||||
|
}))
|
||||||
|
.pipe(plugins.gulp.dest(paths.cwd));
|
||||||
|
});
|
||||||
|
plugins.gulp.task("testTS", function () {
|
||||||
|
plugins.gulp.src(paths.testTS)
|
||||||
.pipe(plugins.gulpTypeScript({
|
.pipe(plugins.gulpTypeScript({
|
||||||
out: "test.js"
|
out: "test.js"
|
||||||
}))
|
}))
|
||||||
.pipe(plugins.gulp.dest(paths.cwd));
|
.pipe(plugins.gulp.dest(paths.cwd));
|
||||||
});
|
});
|
||||||
|
plugins.gulp.task("default", ["indexTS", "testTS"], function () {
|
||||||
|
plugins.beautylog.success("TypeScript for this module was compiled successfully.");
|
||||||
|
});
|
||||||
|
plugins.gulp.start.apply(plugins.gulp, ['default']);
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
{
|
{
|
||||||
"name": "npmts",
|
"name": "npmts",
|
||||||
"version": "0.0.1",
|
"version": "1.0.1",
|
||||||
"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)",
|
||||||
|
"release": "(git add -A && git commit -m 'update' && git push origin master && npm version patch && npm publish)",
|
||||||
|
"testm": "(cd test/ && npm update && npm test)"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -26,6 +28,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"
|
||||||
}
|
}
|
||||||
|
3
test/index.js
Normal file
3
test/index.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
(function () {
|
||||||
|
console.log("test");
|
||||||
|
}());
|
21
test/node_modules/npmts/LICENSE
generated
vendored
21
test/node_modules/npmts/LICENSE
generated
vendored
@ -1,21 +0,0 @@
|
|||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2016 Push.Rocks
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
31
test/node_modules/npmts/package.json
generated
vendored
31
test/node_modules/npmts/package.json
generated
vendored
@ -1,31 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "npmts",
|
|
||||||
"version": "0.0.0",
|
|
||||||
"description": "write npm modules with TypeScript",
|
|
||||||
"main": "index.js",
|
|
||||||
"scripts": {
|
|
||||||
"test": "npmts"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/pushrocks/npmts.git"
|
|
||||||
},
|
|
||||||
"keywords": [
|
|
||||||
"TypeScript",
|
|
||||||
"Declaration"
|
|
||||||
],
|
|
||||||
"author": {
|
|
||||||
"name": "Lossless Digital UG",
|
|
||||||
"url": "haftungsbeschraenkt"
|
|
||||||
},
|
|
||||||
"license": "MIT",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/pushrocks/npmts/issues"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/pushrocks/npmts#readme",
|
|
||||||
"gitHead": "1699d259b46348a712c638a4fc76a2579e0ecfd9",
|
|
||||||
"readme": "ERROR: No README data found!",
|
|
||||||
"_id": "npmts@0.0.0",
|
|
||||||
"_shasum": "9baf3fb8c432625908c5f6a545e93e95ea0bd2c4",
|
|
||||||
"_from": "npmts@latest"
|
|
||||||
}
|
|
4
test/ts/index.js
Normal file
4
test/ts/index.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
(function () {
|
||||||
|
console.log("test");
|
||||||
|
}());
|
||||||
|
//# sourceMappingURL=index.js.map
|
1
test/ts/index.js.map
Normal file
1
test/ts/index.js.map
Normal 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"}
|
11
ts/index.js
11
ts/index.js
@ -19,9 +19,20 @@ plugins.gulp.task("indexTS", function () {
|
|||||||
});
|
});
|
||||||
plugins.gulp.task("indexTS", function () {
|
plugins.gulp.task("indexTS", function () {
|
||||||
plugins.gulp.src(paths.indexTS)
|
plugins.gulp.src(paths.indexTS)
|
||||||
|
.pipe(plugins.gulpTypeScript({
|
||||||
|
out: "index.js"
|
||||||
|
}))
|
||||||
|
.pipe(plugins.gulp.dest(paths.cwd));
|
||||||
|
});
|
||||||
|
plugins.gulp.task("testTS", function () {
|
||||||
|
plugins.gulp.src(paths.testTS)
|
||||||
.pipe(plugins.gulpTypeScript({
|
.pipe(plugins.gulpTypeScript({
|
||||||
out: "test.js"
|
out: "test.js"
|
||||||
}))
|
}))
|
||||||
.pipe(plugins.gulp.dest(paths.cwd));
|
.pipe(plugins.gulp.dest(paths.cwd));
|
||||||
});
|
});
|
||||||
|
plugins.gulp.task("default", ["indexTS", "testTS"], function () {
|
||||||
|
plugins.beautylog.success("TypeScript for this module was compiled successfully.");
|
||||||
|
});
|
||||||
|
plugins.gulp.start.apply(plugins.gulp, ['default']);
|
||||||
//# sourceMappingURL=index.js.map
|
//# sourceMappingURL=index.js.map
|
@ -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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IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA;AAC3C,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,CAAC,SAAS,EAAC,QAAQ,CAAC,EAAC;IAC9C,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,uDAAuD,CAAC,CAAC;AACtF,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC"}
|
16
ts/index.ts
16
ts/index.ts
@ -22,8 +22,22 @@ plugins.gulp.task("indexTS", function(){
|
|||||||
|
|
||||||
plugins.gulp.task("indexTS", function(){
|
plugins.gulp.task("indexTS", function(){
|
||||||
plugins.gulp.src(paths.indexTS)
|
plugins.gulp.src(paths.indexTS)
|
||||||
|
.pipe(plugins.gulpTypeScript({
|
||||||
|
out: "index.js"
|
||||||
|
}))
|
||||||
|
.pipe(plugins.gulp.dest(paths.cwd))
|
||||||
|
});
|
||||||
|
|
||||||
|
plugins.gulp.task("testTS", function(){
|
||||||
|
plugins.gulp.src(paths.testTS)
|
||||||
.pipe(plugins.gulpTypeScript({
|
.pipe(plugins.gulpTypeScript({
|
||||||
out: "test.js"
|
out: "test.js"
|
||||||
}))
|
}))
|
||||||
.pipe(plugins.gulp.dest(paths.cwd))
|
.pipe(plugins.gulp.dest(paths.cwd))
|
||||||
});
|
});
|
||||||
|
|
||||||
|
plugins.gulp.task("default",["indexTS","testTS"],function(){
|
||||||
|
plugins.beautylog.success("TypeScript for this module was compiled successfully.");
|
||||||
|
});
|
||||||
|
|
||||||
|
plugins.gulp.start.apply(plugins.gulp, ['default']);
|
Reference in New Issue
Block a user