Compare commits

...

62 Commits

Author SHA1 Message Date
2d82a3a037 2.4.0 2016-02-17 01:48:38 +01:00
4806f5ceff updated readme 2016-02-17 01:40:01 +01:00
f2ef982189 added sourcemap support 2016-02-17 01:16:21 +01:00
5d6ead017b 2.3.2 2016-02-16 11:29:07 +01:00
1c2b4e421d fix compile script 2016-02-16 11:28:57 +01:00
6cf7d2ca0b update test 2016-02-16 11:14:05 +01:00
676c072631 2.3.1 2016-02-16 10:58:50 +01:00
f29c04e09c update .gitignore 2016-02-16 10:58:42 +01:00
77a06a0fc4 2.3.0 2016-02-16 10:29:26 +01:00
c9792b1955 update target from ES3 to ES5 2016-02-16 10:29:14 +01:00
b87de178c0 2.2.4 2016-02-16 09:53:35 +01:00
0580f29d30 update ReadeMe 2016-02-16 09:52:24 +01:00
2c17273671 update badge order 2016-02-14 03:20:53 +01:00
669ed2e6ab add badges 2016-02-14 03:19:54 +01:00
8bc73b2bf4 update readme 2016-02-14 03:13:03 +01:00
78e5defd7c update readme 2016-02-14 03:12:02 +01:00
7e540bda87 2.2.3 2016-02-11 19:10:14 +01:00
b293dfe92d add figlet greeting 2016-02-11 19:10:01 +01:00
a753a5db2c 2.2.2 2016-02-09 20:36:40 +01:00
27f79b4425 readded test.ts to default build process 2016-02-09 20:36:31 +01:00
1ada5dd5a9 2.2.1 2016-02-09 17:42:43 +01:00
a41bfd442c fix coveralls initial value 2016-02-09 17:42:31 +01:00
2917b10ffb 2.2.0 2016-02-09 17:26:37 +01:00
bfc5bbbbb7 fix coverage path 2016-02-09 17:26:25 +01:00
cf507a4a17 add coverage badge 2016-02-09 17:19:27 +01:00
73a57ed264 2.1.10 2016-02-09 17:01:45 +01:00
39b79b679c fix config traveling 2016-02-09 17:01:37 +01:00
cc053ee396 2.1.9 2016-02-09 16:34:55 +01:00
df5371187b remove scoping problem with gulp task names 2016-02-09 16:34:52 +01:00
cbda76c380 2.1.8 2016-02-09 16:00:20 +01:00
e20bcec133 finetune some paths 2016-02-09 16:00:07 +01:00
3e673e04b2 2.1.7 2016-02-09 06:01:39 +01:00
2090dad540 refine coverage treshold for failure 2016-02-09 06:01:32 +01:00
ebe7a02ef0 2.1.6 2016-02-09 05:47:11 +01:00
3f9194f344 add coveralls config option 2016-02-09 05:46:55 +01:00
13c9c96cc6 add code coverage 2016-02-09 05:39:31 +01:00
3f0b2b1599 2.1.5 2016-02-07 12:19:50 +01:00
d477e492eb small fix 2016-02-07 12:19:42 +01:00
f39cb03fc2 2.1.4 2016-02-07 01:00:28 +01:00
f42744b927 2.1.3 2016-02-06 19:00:20 +01:00
038994e9e5 updated log output 2016-02-06 19:00:02 +01:00
7a26721420 2.1.2 2016-02-06 18:56:51 +01:00
0dc307f082 now handles multiple typings recursivly 2016-02-06 18:56:42 +01:00
4b2c0fe461 2.1.1 2016-02-06 18:07:20 +01:00
50fd5e83ad improve path handling 2016-02-06 18:06:55 +01:00
3e55a666b2 update npm test 2016-02-04 20:43:52 +01:00
5d8ce3f227 2.1.0 2016-02-04 20:41:46 +01:00
de4bbaed9f now accepts config file 2016-02-04 20:41:34 +01:00
7d18e92ff1 2.0.3 2016-02-02 15:20:05 +01:00
634763c03f update beautylog 2016-02-02 15:19:48 +01:00
3352165436 2.0.2 2016-02-01 02:07:50 +01:00
6c57a4703f fix timing error caused by not returning stream 2016-02-01 02:07:41 +01:00
822734e545 2.0.1 2016-02-01 00:24:17 +01:00
8dcbe98c60 now running mocha tests properly 2016-02-01 00:24:08 +01:00
2fbcb58078 2.0.0 2016-01-31 22:25:36 +01:00
362f8d5388 major update 2016-01-31 22:24:57 +01:00
8fb4a60fb3 now includes mocha 2016-01-30 05:29:54 +01:00
7c6b5afd5f restructure 2016-01-30 04:57:24 +01:00
f83eb035c2 1.0.12 2016-01-25 21:20:28 +01:00
359e844c69 update plugins 2016-01-25 21:20:17 +01:00
6b40cfd954 1.0.11 2016-01-25 20:52:42 +01:00
8f13dbef9f fix issue with CI detection 2016-01-25 20:52:29 +01:00
59 changed files with 701 additions and 237 deletions

4
.gitignore vendored
View File

@ -1,6 +1,8 @@
.idea/ .idea/
.c9/ .c9/
node_modules/ node_modules/
test/node_modules test/**/node_modules/
test/**/typings/
test/**/coverage/
ts/*.js ts/*.js
ts/*.js.map ts/*.js.map

View File

@ -1,6 +1,6 @@
.idea/ .idea/
support support
compile compile
test test/
examples examples
.gitignore .gitignore

View File

@ -1,6 +1,13 @@
# npmts # npmts
Write npm modules with TypeScript without hassle. Write npm modules with TypeScript without hassle.
## Status
[![Build Status](https://travis-ci.org/pushrocks/npmts.svg?branch=master)](https://travis-ci.org/pushrocks/npmts)
[![Dependency Status](https://david-dm.org/pushrocks/npmts.svg)](https://david-dm.org/pushrocks/npmts)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/npmts/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/npmts/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/npmts/badges/code.svg)](https://www.bithound.io/github/pushrocks/npmts)
[![Coverage Status](https://coveralls.io/repos/github/pushrocks/npmts/badge.svg?branch=master)](https://coveralls.io/github/pushrocks/npmts?branch=master)
## How to use npmts ## How to use npmts
### Install ### Install
@ -19,6 +26,23 @@ Then use it in package.json's script section to trigger a build:
``` ```
### Default behaviour ### Default behaviour
**Execution order of tasks**
1. Install typings
2. Transpile TypeScript with inline sourcemaps
3. Create Declaration Files
4. Instrumentalize created JavaScript files with istanbul
5. Run Tests
6. Create Coverage report
7. Upload Coverage reports to travis (must be activated, only triggers on travis)
#### Typings
**npmts** looks for `./ts/typings.json` by default and installs any defined typings to `.ts/typings/`.
You can then reference the ./ts/typings/main.d.ts file in your TypeScript code.
#### TypeScript
by default npmts looks for `./ts/index.ts` and `./ts/test.ts` that will compile to by default npmts looks for `./ts/index.ts` and `./ts/test.ts` that will compile to
`./index.js` and `./test.js` `./index.js` and `./test.js`
@ -31,14 +55,40 @@ You can reference it in your package.json like this:
"typings": "./index.d.ts", "typings": "./index.d.ts",
``` ```
#### Instrumentalize Code
npmts instrumentalizes the created JavaScript code to create a coverage report.
#### Tests
When Typings have been installed, TypeScript + Declaration files have been transpiled and the resulting JS has been instrumentalized,
npmts runs `.test/test.js` with mocha.
Any errors will be shown with reference to their originating source in TypeScript.
When requiring the module from other TypeScript files, When requiring the module from other TypeScript files,
the TypeScript Compiler will use the declaration file to resolve typings. the TypeScript Compiler will use the declaration file to resolve typings.
### Custom behaviour ### Custom behaviour
We are currently building support for custom behaviour with a super simple config file. Custom behaviour can be achieved through a config file at the root of your package.
Check back soon. The file must be named **npmts.json**
```json
{
"mode":"custom",
"ts":{
"./customdir/custom.ts":"./customcompiled.js"
},
"typings":[
"./customdir"
]
}
```
* **mode** can be "default" or "custom"
* **ts** You can list as many TypeScript files as you like. The key represents the source TypeScript file, the value the output file.
* **typings** is an array of all direcories that have a typings.json present. Uses the new typings tool from npm.
## Readme for Devs ## Readme for Devs
There is a [README-dev.md](README-dev.md) in the repo. There is a [README-dev.md](README-dev.md) in the repo.

View File

@ -4,14 +4,14 @@ var plugins = {
gulp: require("gulp"), gulp: require("gulp"),
g:{ g:{
typescript: require("gulp-typescript"), typescript: require("gulp-typescript"),
insert: require("gulp-insert") header: require("gulp-header")
}, },
mergeStream: require("merge2") mergeStream: require("merge2")
}; };
plugins.beautylog.log('now compiling the mojo.io gulp tasks'); plugins.beautylog.log('now compiling NPMTS');
plugins.gulp.task('indexTS', function() { plugins.gulp.task('indexTS', function() {
var tsResult = plugins.gulp.src('../ts/index.ts') var tsResult = plugins.gulp.src('../ts/index.ts')
@ -23,7 +23,7 @@ plugins.gulp.task('indexTS', function() {
return plugins.mergeStream([ return plugins.mergeStream([
tsResult.dts.pipe(plugins.gulp.dest('../')), tsResult.dts.pipe(plugins.gulp.dest('../')),
tsResult.js tsResult.js
.pipe(plugins.g.insert.prepend('#!/usr/bin/env node\n\n')) .pipe(plugins.g.header('#!/usr/bin/env node\n\n'))
.pipe(plugins.gulp.dest('../')) .pipe(plugins.gulp.dest('../'))
]); ]);
}); });

48
index.d.ts vendored
View File

@ -1,41 +1,63 @@
/// <reference path="../ts/typings/tsd.d.ts" /> /// <reference path="../ts/typings/main.d.ts" />
declare module NpmtsPlugins { declare module NpmtsPlugins {
var init: () => { var init: () => {
beautylog: any; beautylog: any;
fs: any;
gulp: any; gulp: any;
g: { g: {
if: any; coveralls: any;
insert: any; header: any;
sequence: any; istanbul: any;
tsd: any; mocha: any;
sourcemaps: any;
typescript: any; typescript: any;
}; };
mergeStream: any; mergeStream: any;
sourceMapSupport: any;
path: any; path: any;
q: any;
smartcli: any; smartcli: any;
smartfile: any;
typings: any;
}; };
} }
declare module NpmtsPaths { declare module NpmtsPaths {
var init: () => any; var init: () => any;
} }
declare module NpmtsInfo { declare module NpmtsConfigFile {
var init: () => void; var run: () => any;
} }
declare module NpmtsDefault { declare module NpmtsOptions {
var init: () => void; var run: (configArg: any) => any;
}
declare module NpmtsCompile {
var run: (configArg: any) => any;
}
declare module NpmtsTests {
var run: (configArg: any) => any;
}
declare module NpmtsPromisechain {
var init: () => any;
} }
declare var plugins: { declare var plugins: {
beautylog: any; beautylog: any;
fs: any;
gulp: any; gulp: any;
g: { g: {
if: any; coveralls: any;
insert: any; header: any;
sequence: any; istanbul: any;
tsd: any; mocha: any;
sourcemaps: any;
typescript: any; typescript: any;
}; };
mergeStream: any; mergeStream: any;
sourceMapSupport: any;
path: any; path: any;
q: any;
smartcli: any; smartcli: any;
smartfile: any;
typings: any;
}; };
declare var paths: any; declare var paths: any;
declare var promisechain: any;

281
index.js
View File

@ -6,17 +6,23 @@ var NpmtsPlugins;
NpmtsPlugins.init = function () { NpmtsPlugins.init = function () {
var plugins = { var plugins = {
beautylog: require("beautylog"), beautylog: require("beautylog"),
fs: require("fs-extra"),
gulp: require("gulp"), gulp: require("gulp"),
g: { g: {
if: require("gulp-if"), coveralls: require("gulp-coveralls"),
insert: require("gulp-insert"), header: require("gulp-header"),
sequence: require("gulp-sequence"), istanbul: require("gulp-istanbul"),
tsd: require("gulp-tsd"), mocha: require("gulp-mocha"),
sourcemaps: require("gulp-sourcemaps"),
typescript: require("gulp-typescript") typescript: require("gulp-typescript")
}, },
mergeStream: require("merge2"), mergeStream: require("merge2"),
sourceMapSupport: require("source-map-support").install(),
path: require("path"), path: require("path"),
smartcli: require("smartcli") q: require("q"),
smartcli: require("smartcli"),
smartfile: require("smartfile"),
typings: require("typings")
}; };
return plugins; return plugins;
}; };
@ -28,77 +34,228 @@ var NpmtsPaths;
NpmtsPaths.init = function () { NpmtsPaths.init = function () {
var paths = {}; var paths = {};
paths.cwd = plugins.smartcli.get.cwd().path; paths.cwd = plugins.smartcli.get.cwd().path;
paths.tsd = plugins.path.join(paths.cwd, "ts/tsd.json"); paths.tsDir = plugins.path.join(paths.cwd, "ts/");
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");
paths.testDir = plugins.path.join(paths.cwd, "test/");
return paths; return paths;
}; };
})(NpmtsPaths || (NpmtsPaths = {})); })(NpmtsPaths || (NpmtsPaths = {}));
/// <reference path="./index.ts" /> /// <reference path="./index.ts" />
var NpmtsInfo; var NpmtsConfigFile;
(function (NpmtsInfo) { (function (NpmtsConfigFile) {
NpmtsInfo.init = function () { NpmtsConfigFile.run = function () {
if (process.env.TRAVIS) { var done = plugins.q.defer();
plugins.beautylog.warn("We are on TRAVIS. Typings will not be installed due to GitHub API restrictions."); var config = {};
plugins.beautylog.log("Make sure the repo tracks ting directories"); var configPath = plugins.path.join(paths.cwd, "npmts.json");
if (plugins.smartfile.checks.fileExistsSync(configPath)) {
plugins.beautylog.info("npmts.json".blue + " config file found!");
config = plugins.smartfile.readFileToObject(configPath);
switch (config.mode) {
case "default":
case "custom":
plugins.beautylog.log("mode is " + config.mode.yellow);
done.resolve(config);
break;
default:
plugins.beautylog.error("mode " + config.mode.yellow + " not recognised!".red);
}
;
} }
else { else {
plugins.beautylog.log("We are on a dev machine. Typings will be installed prior to TypeScript compilation."); plugins.beautylog.log("no config file found: so mode is " + "default".yellow);
config.mode = "default";
done.resolve(config);
} }
;
return done.promise;
}; };
})(NpmtsInfo || (NpmtsInfo = {})); })(NpmtsConfigFile || (NpmtsConfigFile = {}));
/// <reference path="./index.ts" />
/// <reference path="./index.ts" /> /// <reference path="./index.ts" />
var NpmtsDefault; var NpmtsOptions;
(function (NpmtsDefault) { (function (NpmtsOptions) {
NpmtsDefault.init = function () { NpmtsOptions.run = function (configArg) {
plugins.gulp.task("defaultTsd", function (cb) { var done = plugins.q.defer();
plugins.beautylog.log("now installing typings from" + " ts/tsd.json".blue); var config = configArg;
plugins.g.if(process.env.TRAVIS, plugins.g.tsd({ if (typeof config.coveralls === "undefined") {
command: 'reinstall', config.coveralls = false;
config: paths.tsd }
}, cb)); if (config.mode == "default") {
}); config.typings = [
plugins.gulp.task("defaultIndexTS", function () { "./ts/"
plugins.beautylog.log("now compiling" + " ts/index.ts".blue); ];
var tsResult = plugins.gulp.src(paths.indexTS) config.ts = (_a = {},
.pipe(plugins.g.typescript({ _a["./ts/index.ts"] = "./index.js",
out: "index.js", _a["./ts/test.ts"] = "./test/test.js",
declaration: true _a
})); );
return plugins.mergeStream([ config.test = ["./index.js"];
tsResult.dts.pipe(plugins.gulp.dest(paths.cwd)), done.resolve(config);
tsResult.js }
.pipe(plugins.g.insert.prepend('#!/usr/bin/env node\n\n')) else {
.pipe(plugins.gulp.dest(paths.cwd)) done.resolve(config);
]); }
}); return done.promise;
plugins.gulp.task("defaultTestTS", function () { var _a;
plugins.beautylog.log("now compiling" + " ts/test.ts".blue);
plugins.gulp.src(paths.testTS)
.pipe(plugins.g.typescript({
out: "test.js"
}))
.pipe(plugins.gulp.dest(paths.cwd));
});
plugins.gulp.task("defaultCleanup", function (cb) {
plugins.beautylog.success("TypeScript for this module compiled successfully.");
cb();
});
plugins.gulp.task("default", function (cb) {
plugins.g.sequence("defaultTsd", "defaultIndexTS", "defaultTestTS", "defaultCleanup", cb);
});
plugins.gulp.start.apply(plugins.gulp, ['default']);
}; };
})(NpmtsDefault || (NpmtsDefault = {})); })(NpmtsOptions || (NpmtsOptions = {}));
/// <reference path="./typings/tsd.d.ts" /> /// <reference path="./index.ts" />
var NpmtsCompile;
(function (NpmtsCompile) {
NpmtsCompile.run = function (configArg) {
var done = plugins.q.defer();
var config = configArg;
plugins.beautylog.log("now running custom tasks");
var moduleStream = plugins.mergeStream({ end: false });
/* -------------------------------------------------
* ----------- first install typings ---------------
* ----------------------------------------------- */
var typingsDone = plugins.q.defer();
var typingsCounter = 0;
var typingsCounterAdvance = function () {
typingsCounter++;
if (typeof config.typings[typingsCounter] != "undefined") {
installTypings();
}
else {
plugins.beautylog.success("custom typings installed successfully");
typingsDone.resolve();
}
};
var installTypings = function () {
plugins.beautylog.log("now installing " + "typings.json".yellow + " from " + config.typings[typingsCounter].blue);
plugins.typings.install({ production: false, cwd: plugins.path.join(paths.cwd, config.typings[typingsCounter]) })
.then(function () {
typingsCounterAdvance();
}, function () {
plugins.beautylog.error("something went wrong: Check if path is correct: " + config.typings[typingsCounter].blue);
typingsCounterAdvance();
});
};
installTypings();
/* -------------------------------------------------
* ----------- second compile TS -------------------
* ----------------------------------------------- */
typingsDone.promise.then(function () {
for (var key in config.ts) {
plugins.beautylog.log("now compiling" + key.blue);
var outputPathIsDir;
try {
if (plugins.fs.statSync(plugins.path.join(paths.cwd, config.ts[key])).isDirectory()) {
outputPathIsDir = true;
}
}
catch (err) {
outputPathIsDir = false;
}
//do some evaluation of the environment
var outputNameSpecified = (!outputPathIsDir
&& (plugins.path.extname(config.ts[key]) == ".js"));
var outputName = (function () {
if (outputNameSpecified) {
return plugins.path.basename(config.ts[key]);
}
else {
return undefined;
}
})();
var outputDir = (function () {
if (outputNameSpecified) {
return plugins.path.dirname(plugins.path.join(paths.cwd, config.ts[key]));
}
else {
return plugins.path.join(paths.cwd, config.ts[key]);
}
})();
var tsStream = plugins.gulp.src(plugins.path.join(paths.cwd, key))
.pipe(plugins.g.sourcemaps.init()) // This means sourcemaps will be generated
.pipe(plugins.g.typescript({
out: outputName,
declaration: true,
target: "ES5"
}));
var stream = plugins.mergeStream([
tsStream.dts.pipe(plugins.gulp.dest(outputDir)),
tsStream.js
.pipe(plugins.g.sourcemaps.write()) // Now the sourcemaps are added to the .js file
.pipe(plugins.g.header('#!/usr/bin/env node\n\n'))
.pipe(plugins.gulp.dest(outputDir))
]);
moduleStream.add(stream);
}
moduleStream.on("queueDrain", function () {
plugins.beautylog.success("custom TypeScript installed successfully");
moduleStream.on("finish", function () {
done.resolve(config);
});
moduleStream.end();
});
});
return done.promise;
};
})(NpmtsCompile || (NpmtsCompile = {}));
/// <reference path="./index.ts" />
var NpmtsTests;
(function (NpmtsTests) {
NpmtsTests.run = function (configArg) {
var done = plugins.q.defer();
var config = configArg;
var istanbul = function () {
var stream = plugins.gulp.src([plugins.path.join(paths.cwd, "index.js")])
.pipe(plugins.g.istanbul())
.pipe(plugins.g.istanbul.hookRequire());
return stream;
};
var mocha = function () {
var stream = plugins.gulp.src(["./test/test.js"])
.pipe(plugins.g.mocha())
.pipe(plugins.g.istanbul.writeReports())
.pipe(plugins.g.istanbul.enforceThresholds({ thresholds: { global: 30 } }));
return stream;
};
var coveralls = function () {
var stream = plugins.gulp.src([plugins.path.join(paths.cwd, "./coverage/lcov.info")])
.pipe(plugins.g.coveralls());
return stream;
};
istanbul().on("finish", function () {
mocha().on("finish", function () {
if (process.env.TRAVIS && config.coveralls) {
coveralls().on("finish", function () {
done.resolve(config);
});
}
else {
done.resolve(config);
}
});
});
return done.promise;
};
})(NpmtsTests || (NpmtsTests = {}));
/// <reference path="./index.ts" />
var NpmtsPromisechain;
(function (NpmtsPromisechain) {
NpmtsPromisechain.init = function () {
var promisechain;
NpmtsConfigFile.run()
.then(NpmtsOptions.run)
.then(NpmtsCompile.run)
.then(NpmtsTests.run);
return promisechain;
};
})(NpmtsPromisechain || (NpmtsPromisechain = {}));
/// <reference path="./typings/main.d.ts" />
/// <reference path="./npmts.plugins.ts" /> /// <reference path="./npmts.plugins.ts" />
/// <reference path="./npmts.cli.ts" /> /// <reference path="./npmts.cli.ts" />
/// <reference path="./npmts.paths.ts" /> /// <reference path="./npmts.paths.ts" />
/// <reference path="./npmts.info.ts" /> /// <reference path="./npmts.configfile.ts" />
/// <reference path="./npmts.custom.ts" /> /// <reference path="./npmts.options.ts" />
/// <reference path="./npmts.default.ts" /> /// <reference path="./npmts.compile.ts" />
/// <reference path="./npmts.tests.ts" />
/// <reference path="./npmts.promisechain.ts" />
console.log("**** starting NPMTS ****");
var plugins = NpmtsPlugins.init(); var plugins = NpmtsPlugins.init();
plugins.beautylog.figletSync("NPMTS");
var paths = NpmtsPaths.init(); var paths = NpmtsPaths.init();
NpmtsInfo.init(); var promisechain = NpmtsPromisechain.init();
NpmtsDefault.init();

View File

@ -1,6 +1,6 @@
{ {
"name": "npmts", "name": "npmts",
"version": "1.0.10", "version": "2.4.0",
"description": "write npm modules with TypeScript", "description": "write npm modules with TypeScript",
"main": "index.js", "main": "index.js",
"typings": "./index.d.ts", "typings": "./index.d.ts",
@ -8,8 +8,7 @@
"npmts": "./index.js" "npmts": "./index.js"
}, },
"scripts": { "scripts": {
"test": "(cd compile && node compile.js)", "test": "(cd compile && node compile.js) && (cd test/assets && node ../../index.js)",
"testm": "(npm test) && (cd test/ && node ../index.js)",
"release": "(git add -A && git commit -m 'update' && git push origin master && npm version patch && npm publish)" "release": "(git add -A && git commit -m 'update' && git push origin master && npm version patch && npm publish)"
}, },
"repository": { "repository": {
@ -27,14 +26,21 @@
}, },
"homepage": "https://github.com/pushrocks/npmts#readme", "homepage": "https://github.com/pushrocks/npmts#readme",
"dependencies": { "dependencies": {
"beautylog": "2.0.2", "beautylog": "2.1.1",
"gulp": "3.9.0", "fs-extra": "^0.26.5",
"gulp-if": "^2.0.0", "gulp": "3.9.1",
"gulp-insert": "0.5.0", "gulp-coveralls": "^0.1.4",
"gulp-sequence": "^0.4.4", "gulp-header": "^1.7.1",
"gulp-tsd": "^0.1.0", "gulp-istanbul": "^0.10.3",
"gulp-typescript": "2.10.0", "gulp-mocha": "^2.2.0",
"merge2": "0.3.6", "gulp-sourcemaps": "^1.6.0",
"smartcli": "0.0.11" "gulp-typescript": "2.11.0",
"gulp-typings": "0.0.0",
"merge2": "1.0.1",
"q": "^1.4.1",
"smartcli": "0.0.11",
"smartfile": "0.0.11",
"source-map-support": "^0.4.0",
"typings": "^0.6.8"
} }
} }

View File

@ -0,0 +1,2 @@
var hello = "hello";
//# sourceMappingURL=custom.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"custom.js","sourceRoot":"","sources":["custom.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,OAAO,CAAC"}

View File

@ -0,0 +1 @@
var hello = "hello";

View File

@ -0,0 +1,2 @@
var something = "something";
//# sourceMappingURL=tsfile1.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"tsfile1.js","sourceRoot":"","sources":["tsfile1.ts"],"names":[],"mappings":"AAAA,IAAI,SAAS,GAAG,WAAW,CAAC"}

View File

@ -0,0 +1 @@
var something = "something";

View File

@ -0,0 +1,7 @@
{
"ambientDependencies": {
"node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#78d36dd49b6b55b9fdfe61776a12bf05c8b07777",
"colors": "github:DefinitelyTyped/DefinitelyTyped/colors/colors.d.ts#09e37435ffb2c56a6f908081194a74756f24f99d",
"vinyl": "github:DefinitelyTyped/DefinitelyTyped/vinyl/vinyl.d.ts#78d36dd49b6b55b9fdfe61776a12bf05c8b07777"
}
}

4
test/assets/index.d.ts vendored Normal file
View File

@ -0,0 +1,4 @@
/// <reference path="ts/typings/main.d.ts" />
declare var testplugin: {
logSomething: () => void;
};

11
test/assets/index.js Normal file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env node
/// <reference path="./typings/main.d.ts" />
var testplugin = {
logSomething: function () {
console.log("only function executed");
}
};
module.exports = testplugin;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QztBQUM1QyxJQUFJLFVBQVUsR0FBRztJQUNiLFlBQVksRUFBRTtRQUNWLE9BQU8sQ0FBQyxHQUFHLENBQUMsd0JBQXdCLENBQUMsQ0FBQztJQUMxQyxDQUFDO0NBQ0osQ0FBQztBQUNGLE1BQU0sQ0FBQyxPQUFPLEdBQUcsVUFBVSxDQUFDIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vdHlwaW5ncy9tYWluLmQudHNcIiAvPlxudmFyIHRlc3RwbHVnaW4gPSB7XG4gICAgbG9nU29tZXRoaW5nOiBmdW5jdGlvbigpe1xuICAgICAgICBjb25zb2xlLmxvZyhcIm9ubHkgZnVuY3Rpb24gZXhlY3V0ZWRcIik7XG4gICAgfVxufTtcbm1vZHVsZS5leHBvcnRzID0gdGVzdHBsdWdpbjsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=

13
test/assets/npmts.json Normal file
View File

@ -0,0 +1,13 @@
{
"mode":"default",
"ts":{
"./customdir/*.ts":"./"
},
"typings":[
"./ts",
"./subts1/",
"./subts2/",
"./customdir"
],
"coveralls":true
}

View File

@ -9,6 +9,5 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"npmts": "*"
} }
} }

View File

@ -0,0 +1,7 @@
{
"ambientDependencies": {
"node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#78d36dd49b6b55b9fdfe61776a12bf05c8b07777",
"colors": "github:DefinitelyTyped/DefinitelyTyped/colors/colors.d.ts#09e37435ffb2c56a6f908081194a74756f24f99d",
"vinyl": "github:DefinitelyTyped/DefinitelyTyped/vinyl/vinyl.d.ts#78d36dd49b6b55b9fdfe61776a12bf05c8b07777"
}
}

2
test/assets/test/test.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
/// <reference path="ts/typings/main.d.ts" />
declare var testplugin: any;

14
test/assets/test/test.js Normal file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env node
/// <reference path="./typings/main.d.ts" />
console.log("**** starting test ****");
var testplugin = require("../index.js");
describe("testplugins", function () {
describe(".logSomething", function () {
it("should log something", function () {
testplugin.logSomething();
});
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsNENBQTRDO0FBQzVDLE9BQU8sQ0FBQyxHQUFHLENBQUMseUJBQXlCLENBQUMsQ0FBQztBQUN2QyxJQUFJLFVBQVUsR0FBRyxPQUFPLENBQUMsYUFBYSxDQUFDLENBQUM7QUFDeEMsUUFBUSxDQUFDLGFBQWEsRUFBQztJQUNuQixRQUFRLENBQUMsZUFBZSxFQUFDO1FBQ3JCLEVBQUUsQ0FBQyxzQkFBc0IsRUFBQztZQUN0QixVQUFVLENBQUMsWUFBWSxFQUFFLENBQUE7UUFDN0IsQ0FBQyxDQUFDLENBQUM7SUFDUCxDQUFDLENBQUMsQ0FBQztBQUNQLENBQUMsQ0FBQyxDQUFDIiwiZmlsZSI6InRlc3QuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwiLi90eXBpbmdzL21haW4uZC50c1wiIC8+XG5jb25zb2xlLmxvZyhcIioqKiogc3RhcnRpbmcgdGVzdCAqKioqXCIpO1xudmFyIHRlc3RwbHVnaW4gPSByZXF1aXJlKFwiLi4vaW5kZXguanNcIik7XG5kZXNjcmliZShcInRlc3RwbHVnaW5zXCIsZnVuY3Rpb24oKXtcbiAgICBkZXNjcmliZShcIi5sb2dTb21ldGhpbmdcIixmdW5jdGlvbigpe1xuICAgICAgICBpdChcInNob3VsZCBsb2cgc29tZXRoaW5nXCIsZnVuY3Rpb24oKXtcbiAgICAgICAgICAgIHRlc3RwbHVnaW4ubG9nU29tZXRoaW5nKClcbiAgICAgICAgfSk7XG4gICAgfSk7XG59KTsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=

8
test/assets/ts/index.js Normal file
View File

@ -0,0 +1,8 @@
/// <reference path="./typings/main.d.ts" />
var testplugin = {
logSomething: function () {
console.log("only function executed");
}
};
module.exports = testplugin;
//# sourceMappingURL=index.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,IAAI,UAAU,GAAG;IACb,YAAY,EAAE;QACV,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAC1C,CAAC;CACJ,CAAC;AACF,MAAM,CAAC,OAAO,GAAG,UAAU,CAAC"}

7
test/assets/ts/index.ts Normal file
View File

@ -0,0 +1,7 @@
/// <reference path="./typings/main.d.ts" />
var testplugin = {
logSomething: function(){
console.log("only function executed");
}
};
module.exports = testplugin;

11
test/assets/ts/test.js Normal file
View File

@ -0,0 +1,11 @@
/// <reference path="./typings/main.d.ts" />
console.log("**** starting test ****");
var testplugin = require("../index.js");
describe("testplugins", function () {
describe(".logSomething", function () {
it("should log something", function () {
testplugin.logSomething();
});
});
});
//# sourceMappingURL=test.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;AACvC,IAAI,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AACxC,QAAQ,CAAC,aAAa,EAAC;IACnB,QAAQ,CAAC,eAAe,EAAC;QACrB,EAAE,CAAC,sBAAsB,EAAC;YACtB,UAAU,CAAC,YAAY,EAAE,CAAA;QAC7B,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}

10
test/assets/ts/test.ts Normal file
View File

@ -0,0 +1,10 @@
/// <reference path="./typings/main.d.ts" />
console.log("**** starting test ****");
var testplugin = require("../index.js");
describe("testplugins",function(){
describe(".logSomething",function(){
it("should log something",function(){
testplugin.logSomething()
});
});
});

View File

@ -0,0 +1,8 @@
{
"ambientDependencies": {
"node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#78d36dd49b6b55b9fdfe61776a12bf05c8b07777",
"mocha": "github:Bartvds/tsd-deftools/typings/DefinitelyTyped/mocha/mocha.d.ts",
"colors": "github:DefinitelyTyped/DefinitelyTyped/colors/colors.d.ts#09e37435ffb2c56a6f908081194a74756f24f99d",
"vinyl": "github:DefinitelyTyped/DefinitelyTyped/vinyl/vinyl.d.ts#78d36dd49b6b55b9fdfe61776a12bf05c8b07777"
}
}

1
test/assets/tsfile1.d.ts vendored Normal file
View File

@ -0,0 +1 @@
declare var something: string;

3
test/assets/tsfile1.js Normal file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env node
var something = "something";

0
test/index.d.ts vendored
View File

View File

@ -1,5 +0,0 @@
#!/usr/bin/env node
(function () {
console.log("test");
}());

View File

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

View File

@ -1 +0,0 @@
{"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

@ -1,3 +0,0 @@
(function(){
console.log("test")
}());

View File

@ -1,18 +0,0 @@
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "master",
"path": "typings",
"bundle": "typings/tsd.d.ts",
"installed": {
"node/node.d.ts": {
"commit": "78d36dd49b6b55b9fdfe61776a12bf05c8b07777"
},
"colors/colors.d.ts": {
"commit": "09e37435ffb2c56a6f908081194a74756f24f99d"
},
"vinyl/vinyl.d.ts": {
"commit": "78d36dd49b6b55b9fdfe61776a12bf05c8b07777"
}
}
}

View File

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

View File

@ -1,12 +1,14 @@
/// <reference path="./typings/tsd.d.ts" /> /// <reference path="./typings/main.d.ts" />
/// <reference path="./npmts.plugins.ts" /> /// <reference path="./npmts.plugins.ts" />
/// <reference path="./npmts.cli.ts" /> /// <reference path="./npmts.cli.ts" />
/// <reference path="./npmts.paths.ts" /> /// <reference path="./npmts.paths.ts" />
/// <reference path="./npmts.info.ts" /> /// <reference path="./npmts.configfile.ts" />
/// <reference path="./npmts.custom.ts" /> /// <reference path="./npmts.options.ts" />
/// <reference path="./npmts.default.ts" /> /// <reference path="./npmts.compile.ts" />
/// <reference path="./npmts.tests.ts" />
/// <reference path="./npmts.promisechain.ts" />
console.log("**** starting NPMTS ****");
var plugins = NpmtsPlugins.init(); var plugins = NpmtsPlugins.init();
plugins.beautylog.figletSync("NPMTS");
var paths = NpmtsPaths.init(); var paths = NpmtsPaths.init();
NpmtsInfo.init(); var promisechain = NpmtsPromisechain.init();
NpmtsDefault.init();

96
ts/npmts.compile.ts Normal file
View File

@ -0,0 +1,96 @@
/// <reference path="./index.ts" />
module NpmtsCompile {
export var run = function(configArg){
var done = plugins.q.defer();
var config = configArg;
plugins.beautylog.log("now running custom tasks");
var moduleStream = plugins.mergeStream({end: false});
/* -------------------------------------------------
* ----------- first install typings ---------------
* ----------------------------------------------- */
var typingsDone = plugins.q.defer();
var typingsCounter:number = 0;
var typingsCounterAdvance = function(){
typingsCounter++;
if(typeof config.typings[typingsCounter] != "undefined"){
installTypings();
} else {
plugins.beautylog.success("custom typings installed successfully");
typingsDone.resolve();
}
};
var installTypings = function() {
plugins.beautylog.log("now installing " + "typings.json".yellow + " from " + config.typings[typingsCounter].blue);
plugins.typings.install({production: false, cwd: plugins.path.join(paths.cwd,config.typings[typingsCounter])})
.then(function(){
typingsCounterAdvance();
},function(){
plugins.beautylog.error("something went wrong: Check if path is correct: " + config.typings[typingsCounter].blue);
typingsCounterAdvance();
});
};
installTypings();
/* -------------------------------------------------
* ----------- second compile TS -------------------
* ----------------------------------------------- */
typingsDone.promise.then(function(){
for (var key in config.ts) {
plugins.beautylog.log("now compiling" + key.blue);
var outputPathIsDir:boolean;
try {
if(plugins.fs.statSync(plugins.path.join(paths.cwd,config.ts[key])).isDirectory()){
outputPathIsDir = true;
}
}
catch(err) {
outputPathIsDir = false;
}
//do some evaluation of the environment
var outputNameSpecified:boolean = (
!outputPathIsDir
&& (plugins.path.extname(config.ts[key]) == ".js")
);
var outputName = (function(){
if(outputNameSpecified){
return plugins.path.basename(config.ts[key])
} else {
return undefined
}
})();
var outputDir = (function(){
if(outputNameSpecified){
return plugins.path.dirname(
plugins.path.join(paths.cwd,config.ts[key])
)
} else {
return plugins.path.join(paths.cwd,config.ts[key])
}
})();
var tsStream = plugins.gulp.src(plugins.path.join(paths.cwd,key))
.pipe(plugins.g.sourcemaps.init()) // This means sourcemaps will be generated
.pipe(plugins.g.typescript({
out: outputName,
declaration: true,
target: "ES5"
}));
var stream = plugins.mergeStream([
tsStream.dts.pipe(plugins.gulp.dest(outputDir)),
tsStream.js
.pipe(plugins.g.sourcemaps.write()) // Now the sourcemaps are added to the .js file
.pipe(plugins.g.header('#!/usr/bin/env node\n\n'))
.pipe(plugins.gulp.dest(outputDir))
]);
moduleStream.add(stream);
}
moduleStream.on("queueDrain",function(){
plugins.beautylog.success("custom TypeScript installed successfully");
moduleStream.on("finish",function(){
done.resolve(config);
});
moduleStream.end();
});
});
return done.promise;
}
}

26
ts/npmts.configfile.ts Normal file
View File

@ -0,0 +1,26 @@
/// <reference path="./index.ts" />
module NpmtsConfigFile {
export var run = function(){
var done = plugins.q.defer();
var config:any = {};
var configPath = plugins.path.join(paths.cwd,"npmts.json");
if(plugins.smartfile.checks.fileExistsSync(configPath)){
plugins.beautylog.info("npmts.json".blue + " config file found!");
config = plugins.smartfile.readFileToObject(configPath);
switch (config.mode){
case "default":
case "custom":
plugins.beautylog.log("mode is " + config.mode.yellow);
done.resolve(config);
break;
default:
plugins.beautylog.error("mode " + config.mode.yellow + " not recognised!".red);
};
} else {
plugins.beautylog.log("no config file found: so mode is " + "default".yellow);
config.mode = "default";
done.resolve(config);
};
return done.promise;
}
}

View File

@ -1 +0,0 @@
/// <reference path="./index.ts" />

View File

@ -1,53 +0,0 @@
/// <reference path="./index.ts" />
module NpmtsDefault {
export var init = function() {
plugins.gulp.task("defaultTsd",function(cb){
plugins.beautylog.log("now installing typings from" + " ts/tsd.json".blue);
plugins.g.if(process.env.TRAVIS,
plugins.g.tsd({
command: 'reinstall',
config: paths.tsd
}, cb)
)
;
});
plugins.gulp.task("defaultIndexTS", function(){
plugins.beautylog.log("now compiling" + " ts/index.ts".blue);
var tsResult = plugins.gulp.src(paths.indexTS)
.pipe(plugins.g.typescript({
out:"index.js",
declaration:true
}));
return plugins.mergeStream([
tsResult.dts.pipe(plugins.gulp.dest(paths.cwd)),
tsResult.js
.pipe(plugins.g.insert.prepend('#!/usr/bin/env node\n\n'))
.pipe(plugins.gulp.dest(paths.cwd))
]);
});
plugins.gulp.task("defaultTestTS", function(){
plugins.beautylog.log("now compiling" + " ts/test.ts".blue);
plugins.gulp.src(paths.testTS)
.pipe(plugins.g.typescript({
out: "test.js"
}))
.pipe(plugins.gulp.dest(paths.cwd))
});
plugins.gulp.task("defaultCleanup",function(cb){
plugins.beautylog.success("TypeScript for this module compiled successfully.");
cb();
});
plugins.gulp.task("default",function(cb){
plugins.g.sequence("defaultTsd","defaultIndexTS","defaultTestTS","defaultCleanup",cb);
});
plugins.gulp.start.apply(plugins.gulp, ['default']);
}
}

View File

@ -1,12 +0,0 @@
/// <reference path="./index.ts" />
module NpmtsInfo {
export var init = function(){
if(process.env.TRAVIS){
plugins.beautylog.warn("We are on TRAVIS. Typings will not be installed due to GitHub API restrictions.");
plugins.beautylog.log("Make sure the repo tracks ting directories")
} else {
plugins.beautylog.log("We are on a dev machine. Typings will be installed prior to TypeScript compilation.");
}
}
}

24
ts/npmts.options.ts Normal file
View File

@ -0,0 +1,24 @@
/// <reference path="./index.ts" />
module NpmtsOptions {
export var run = function(configArg){
var done = plugins.q.defer();
var config = configArg;
if (typeof config.coveralls === "undefined"){
config.coveralls = false;
}
if (config.mode == "default"){
config.typings = [
"./ts/"
];
config.ts = {
["./ts/index.ts"]: "./index.js",
["./ts/test.ts"]: "./test/test.js"
};
config.test = ["./index.js"];
done.resolve(config);
} else {
done.resolve(config);
}
return done.promise;
}
}

View File

@ -3,9 +3,10 @@ module NpmtsPaths {
export var init = function() { export var init = function() {
var paths:any = {}; var paths:any = {};
paths.cwd = plugins.smartcli.get.cwd().path; paths.cwd = plugins.smartcli.get.cwd().path;
paths.tsd = plugins.path.join(paths.cwd,"ts/tsd.json"); paths.tsDir = plugins.path.join(paths.cwd,"ts/");
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");
paths.testDir = plugins.path.join(paths.cwd,"test/");
return paths; return paths;
} }
} }

View File

@ -3,18 +3,24 @@ module NpmtsPlugins {
export var init = function() { export var init = function() {
var plugins = { var plugins = {
beautylog: require("beautylog"), beautylog: require("beautylog"),
fs: require("fs-extra"),
gulp: require("gulp"), gulp: require("gulp"),
g: { g: {
if: require("gulp-if"), coveralls: require("gulp-coveralls"),
insert: require("gulp-insert"), header: require("gulp-header"),
sequence: require("gulp-sequence"), istanbul: require("gulp-istanbul"),
tsd: require("gulp-tsd"), mocha: require("gulp-mocha"),
sourcemaps: require("gulp-sourcemaps"),
typescript: require("gulp-typescript") typescript: require("gulp-typescript")
}, },
mergeStream: require("merge2"), mergeStream: require("merge2"),
sourceMapSupport:require("source-map-support").install(),
path: require("path"), path: require("path"),
smartcli: require("smartcli") q:require("q"),
smartcli: require("smartcli"),
smartfile: require("smartfile"),
typings: require("typings")
}; };
return plugins; return plugins;
} }

11
ts/npmts.promisechain.ts Normal file
View File

@ -0,0 +1,11 @@
/// <reference path="./index.ts" />
module NpmtsPromisechain {
export var init = function(){
var promisechain;
NpmtsConfigFile.run()
.then(NpmtsOptions.run)
.then(NpmtsCompile.run)
.then(NpmtsTests.run);
return promisechain;
}
}

44
ts/npmts.tests.ts Normal file
View File

@ -0,0 +1,44 @@
/// <reference path="./index.ts" />
module NpmtsTests {
export var run = function(configArg) {
var done = plugins.q.defer();
var config = configArg;
var istanbul = function () {
var stream = plugins.gulp.src([plugins.path.join(paths.cwd,"index.js")])
// Covering files
.pipe(plugins.g.istanbul())
// Force `require` to return covered files
.pipe(plugins.g.istanbul.hookRequire());
return stream;
};
var mocha = function () {
var stream = plugins.gulp.src(["./test/test.js"])
.pipe(plugins.g.mocha())
// Creating the reports after tests ran
.pipe(plugins.g.istanbul.writeReports())
// Enforce a coverage of at least 90%
.pipe(plugins.g.istanbul.enforceThresholds({ thresholds: { global: 30 } }));
return stream;
};
var coveralls = function(){
var stream = plugins.gulp.src([plugins.path.join(paths.cwd,"./coverage/lcov.info")])
.pipe(plugins.g.coveralls());
return stream;
};
istanbul().on("finish",function(){
mocha().on("finish",function(){
if(process.env.TRAVIS && config.coveralls){
coveralls().on("finish",function(){
done.resolve(config);
})
} else {
done.resolve(config);
}
})
});
return done.promise;
}
}

View File

@ -1,18 +0,0 @@
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "master",
"path": "typings",
"bundle": "typings/tsd.d.ts",
"installed": {
"node/node.d.ts": {
"commit": "78d36dd49b6b55b9fdfe61776a12bf05c8b07777"
},
"colors/colors.d.ts": {
"commit": "09e37435ffb2c56a6f908081194a74756f24f99d"
},
"vinyl/vinyl.d.ts": {
"commit": "78d36dd49b6b55b9fdfe61776a12bf05c8b07777"
}
}
}

7
ts/typings.json Normal file
View File

@ -0,0 +1,7 @@
{
"ambientDependencies": {
"node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#78d36dd49b6b55b9fdfe61776a12bf05c8b07777",
"colors": "github:DefinitelyTyped/DefinitelyTyped/colors/colors.d.ts#09e37435ffb2c56a6f908081194a74756f24f99d",
"vinyl": "github:DefinitelyTyped/DefinitelyTyped/vinyl/vinyl.d.ts#78d36dd49b6b55b9fdfe61776a12bf05c8b07777"
}
}

3
ts/typings/browser.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
/// <reference path="browser/ambient/colors/colors.d.ts" />
/// <reference path="browser/ambient/node/node.d.ts" />
/// <reference path="browser/ambient/vinyl/vinyl.d.ts" />

View File

@ -1,3 +1,5 @@
// Compiled using typings@0.6.3
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/09e37435ffb2c56a6f908081194a74756f24f99d/colors/colors.d.ts
// Type definitions for Colors.js 0.6.0-1 // Type definitions for Colors.js 0.6.0-1
// Project: https://github.com/Marak/colors.js // Project: https://github.com/Marak/colors.js
// Definitions by: Bart van der Schoor <https://github.com/Bartvds> // Definitions by: Bart van der Schoor <https://github.com/Bartvds>
@ -120,4 +122,4 @@ interface String {
america: string; america: string;
trap: string; trap: string;
random: string; random: string;
} }

View File

@ -1,3 +1,5 @@
// Compiled using typings@0.6.3
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/78d36dd49b6b55b9fdfe61776a12bf05c8b07777/node/node.d.ts
// Type definitions for Node.js v4.x // Type definitions for Node.js v4.x
// Project: http://nodejs.org/ // Project: http://nodejs.org/
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/borisyankov/DefinitelyTyped> // Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/borisyankov/DefinitelyTyped>
@ -2087,4 +2089,4 @@ declare module "constants" {
export var W_OK: number; export var W_OK: number;
export var X_OK: number; export var X_OK: number;
export var UV_UDP_REUSEADDR: number; export var UV_UDP_REUSEADDR: number;
} }

View File

@ -1,9 +1,10 @@
// Compiled using typings@0.6.3
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/78d36dd49b6b55b9fdfe61776a12bf05c8b07777/vinyl/vinyl.d.ts
// Type definitions for vinyl 0.4.3 // Type definitions for vinyl 0.4.3
// Project: https://github.com/wearefractal/vinyl // Project: https://github.com/wearefractal/vinyl
// Definitions by: vvakame <https://github.com/vvakame/>, jedmao <https://github.com/jedmao> // Definitions by: vvakame <https://github.com/vvakame/>, jedmao <https://github.com/jedmao>
// Definitions: https://github.com/borisyankov/DefinitelyTyped // Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module 'vinyl' { declare module 'vinyl' {
@ -106,4 +107,4 @@ declare module 'vinyl' {
export = File; export = File;
} }

3
ts/typings/main.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
/// <reference path="main/ambient/colors/colors.d.ts" />
/// <reference path="main/ambient/node/node.d.ts" />
/// <reference path="main/ambient/vinyl/vinyl.d.ts" />

View File

@ -1,3 +1,5 @@
// Compiled using typings@0.6.3
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/09e37435ffb2c56a6f908081194a74756f24f99d/colors/colors.d.ts
// Type definitions for Colors.js 0.6.0-1 // Type definitions for Colors.js 0.6.0-1
// Project: https://github.com/Marak/colors.js // Project: https://github.com/Marak/colors.js
// Definitions by: Bart van der Schoor <https://github.com/Bartvds> // Definitions by: Bart van der Schoor <https://github.com/Bartvds>
@ -120,4 +122,4 @@ interface String {
america: string; america: string;
trap: string; trap: string;
random: string; random: string;
} }

View File

@ -1,3 +1,5 @@
// Compiled using typings@0.6.3
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/78d36dd49b6b55b9fdfe61776a12bf05c8b07777/node/node.d.ts
// Type definitions for Node.js v4.x // Type definitions for Node.js v4.x
// Project: http://nodejs.org/ // Project: http://nodejs.org/
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/borisyankov/DefinitelyTyped> // Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/borisyankov/DefinitelyTyped>
@ -2087,4 +2089,4 @@ declare module "constants" {
export var W_OK: number; export var W_OK: number;
export var X_OK: number; export var X_OK: number;
export var UV_UDP_REUSEADDR: number; export var UV_UDP_REUSEADDR: number;
} }

View File

@ -1,9 +1,10 @@
// Compiled using typings@0.6.3
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/78d36dd49b6b55b9fdfe61776a12bf05c8b07777/vinyl/vinyl.d.ts
// Type definitions for vinyl 0.4.3 // Type definitions for vinyl 0.4.3
// Project: https://github.com/wearefractal/vinyl // Project: https://github.com/wearefractal/vinyl
// Definitions by: vvakame <https://github.com/vvakame/>, jedmao <https://github.com/jedmao> // Definitions by: vvakame <https://github.com/vvakame/>, jedmao <https://github.com/jedmao>
// Definitions: https://github.com/borisyankov/DefinitelyTyped // Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module 'vinyl' { declare module 'vinyl' {
@ -106,4 +107,4 @@ declare module 'vinyl' {
export = File; export = File;
} }

3
ts/typings/tsd.d.ts vendored
View File

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