Compare commits
52 Commits
Author | SHA1 | Date | |
---|---|---|---|
7e540bda87 | |||
b293dfe92d | |||
a753a5db2c | |||
27f79b4425 | |||
1ada5dd5a9 | |||
a41bfd442c | |||
2917b10ffb | |||
bfc5bbbbb7 | |||
cf507a4a17 | |||
73a57ed264 | |||
39b79b679c | |||
cc053ee396 | |||
df5371187b | |||
cbda76c380 | |||
e20bcec133 | |||
3e673e04b2 | |||
2090dad540 | |||
ebe7a02ef0 | |||
3f9194f344 | |||
13c9c96cc6 | |||
3f0b2b1599 | |||
d477e492eb | |||
f39cb03fc2 | |||
f42744b927 | |||
038994e9e5 | |||
7a26721420 | |||
0dc307f082 | |||
4b2c0fe461 | |||
50fd5e83ad | |||
3e55a666b2 | |||
5d8ce3f227 | |||
de4bbaed9f | |||
7d18e92ff1 | |||
634763c03f | |||
3352165436 | |||
6c57a4703f | |||
822734e545 | |||
8dcbe98c60 | |||
2fbcb58078 | |||
362f8d5388 | |||
8fb4a60fb3 | |||
7c6b5afd5f | |||
f83eb035c2 | |||
359e844c69 | |||
6b40cfd954 | |||
8f13dbef9f | |||
9ff2453d7b | |||
e40a82e8c9 | |||
cac50f7099 | |||
ef64874411 | |||
870d24701c | |||
d12a09d3d8 |
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,4 +1,7 @@
|
|||||||
.idea/
|
.idea/
|
||||||
.c9/
|
.c9/
|
||||||
node_modules/
|
node_modules/
|
||||||
test/node_modules
|
test/**/node_modules/
|
||||||
|
test/**/typings/
|
||||||
|
ts/*.js
|
||||||
|
ts/*.js.map
|
@ -1,6 +1,6 @@
|
|||||||
.idea/
|
.idea/
|
||||||
support
|
support
|
||||||
compile
|
compile
|
||||||
test
|
test/
|
||||||
examples
|
examples
|
||||||
.gitignore
|
.gitignore
|
22
README.md
22
README.md
@ -1,6 +1,9 @@
|
|||||||
# npmts
|
# npmts
|
||||||
Write npm modules with TypeScript without hassle.
|
Write npm modules with TypeScript without hassle.
|
||||||
|
|
||||||
|
## Status
|
||||||
|
[](https://coveralls.io/github/pushrocks/npmts?branch=master)
|
||||||
|
|
||||||
## How to use npmts
|
## How to use npmts
|
||||||
|
|
||||||
### Install
|
### Install
|
||||||
@ -37,8 +40,23 @@ 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.
|
NPMTS looks for an npmts.json at the root of your package.
|
||||||
Check back soon.
|
|
||||||
|
```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.
|
||||||
|
@ -11,7 +11,7 @@ var plugins = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
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')
|
||||||
|
37
index.d.ts
vendored
37
index.d.ts
vendored
@ -1,32 +1,59 @@
|
|||||||
/// <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: {
|
||||||
typescript: any;
|
coveralls: any;
|
||||||
insert: any;
|
insert: any;
|
||||||
|
istanbul: any;
|
||||||
|
mocha: any;
|
||||||
|
typescript: any;
|
||||||
};
|
};
|
||||||
mergeStream: any;
|
mergeStream: 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 NpmtsDefault {
|
declare module NpmtsConfigFile {
|
||||||
var init: () => void;
|
var run: () => any;
|
||||||
|
}
|
||||||
|
declare module NpmtsOptions {
|
||||||
|
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: {
|
||||||
typescript: any;
|
coveralls: any;
|
||||||
insert: any;
|
insert: any;
|
||||||
|
istanbul: any;
|
||||||
|
mocha: any;
|
||||||
|
typescript: any;
|
||||||
};
|
};
|
||||||
mergeStream: any;
|
mergeStream: 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;
|
||||||
|
256
index.js
256
index.js
@ -6,14 +6,21 @@ 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: {
|
||||||
typescript: require("gulp-typescript"),
|
coveralls: require("gulp-coveralls"),
|
||||||
insert: require("gulp-insert")
|
insert: require("gulp-insert"),
|
||||||
|
istanbul: require("gulp-istanbul"),
|
||||||
|
mocha: require("gulp-mocha"),
|
||||||
|
typescript: require("gulp-typescript")
|
||||||
},
|
},
|
||||||
mergeStream: require("merge2"),
|
mergeStream: require("merge2"),
|
||||||
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;
|
||||||
};
|
};
|
||||||
@ -25,48 +32,225 @@ 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.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" />
|
/// <reference path="./index.ts" />
|
||||||
var NpmtsDefault;
|
var NpmtsConfigFile;
|
||||||
(function (NpmtsDefault) {
|
(function (NpmtsConfigFile) {
|
||||||
NpmtsDefault.init = function () {
|
NpmtsConfigFile.run = function () {
|
||||||
plugins.gulp.task("indexTS", function () {
|
var done = plugins.q.defer();
|
||||||
var tsResult = plugins.gulp.src(paths.indexTS)
|
var config = {};
|
||||||
.pipe(plugins.g.typescript({
|
var configPath = plugins.path.join(paths.cwd, "npmts.json");
|
||||||
out: "index.js",
|
if (plugins.smartfile.checks.fileExistsSync(configPath)) {
|
||||||
declaration: true
|
plugins.beautylog.info("npmts.json".blue + " config file found!");
|
||||||
}));
|
config = plugins.smartfile.readFileToObject(configPath);
|
||||||
return plugins.mergeStream([
|
switch (config.mode) {
|
||||||
tsResult.dts.pipe(plugins.gulp.dest(paths.cwd)),
|
case "default":
|
||||||
tsResult.js
|
case "custom":
|
||||||
.pipe(plugins.g.insert.prepend('#!/usr/bin/env node\n\n'))
|
plugins.beautylog.log("mode is " + config.mode.yellow);
|
||||||
.pipe(plugins.gulp.dest(paths.cwd))
|
done.resolve(config);
|
||||||
]);
|
break;
|
||||||
});
|
default:
|
||||||
plugins.gulp.task("testTS", function () {
|
plugins.beautylog.error("mode " + config.mode.yellow + " not recognised!".red);
|
||||||
plugins.gulp.src(paths.testTS)
|
}
|
||||||
.pipe(plugins.g.typescript({
|
;
|
||||||
out: "test.js"
|
}
|
||||||
}))
|
else {
|
||||||
.pipe(plugins.gulp.dest(paths.cwd));
|
plugins.beautylog.log("no config file found: so mode is " + "default".yellow);
|
||||||
});
|
config.mode = "default";
|
||||||
plugins.gulp.task("default", ["indexTS", "testTS"], function () {
|
done.resolve(config);
|
||||||
plugins.beautylog.success("TypeScript for this module was compiled successfully.");
|
}
|
||||||
});
|
;
|
||||||
plugins.gulp.start.apply(plugins.gulp, ['default']);
|
return done.promise;
|
||||||
};
|
};
|
||||||
})(NpmtsDefault || (NpmtsDefault = {}));
|
})(NpmtsConfigFile || (NpmtsConfigFile = {}));
|
||||||
/// <reference path="./typings/tsd.d.ts" />
|
/// <reference path="./index.ts" />
|
||||||
|
var NpmtsOptions;
|
||||||
|
(function (NpmtsOptions) {
|
||||||
|
NpmtsOptions.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 = (_a = {},
|
||||||
|
_a["./ts/index.ts"] = "./index.js",
|
||||||
|
_a["./ts/test.ts"] = "./test/test.js",
|
||||||
|
_a
|
||||||
|
);
|
||||||
|
config.test = ["./index.js"];
|
||||||
|
done.resolve(config);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
done.resolve(config);
|
||||||
|
}
|
||||||
|
return done.promise;
|
||||||
|
var _a;
|
||||||
|
};
|
||||||
|
})(NpmtsOptions || (NpmtsOptions = {}));
|
||||||
|
/// <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.typescript({
|
||||||
|
out: outputName,
|
||||||
|
declaration: true
|
||||||
|
}));
|
||||||
|
var stream = plugins.mergeStream([
|
||||||
|
tsStream.dts.pipe(plugins.gulp.dest(outputDir)),
|
||||||
|
tsStream.js
|
||||||
|
.pipe(plugins.g.insert.prepend('#!/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.custom.ts" />
|
/// <reference path="./npmts.configfile.ts" />
|
||||||
/// <reference path="./npmts.default.ts" />
|
/// <reference path="./npmts.options.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();
|
||||||
NpmtsDefault.init();
|
var promisechain = NpmtsPromisechain.init();
|
||||||
|
25
package.json
25
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "npmts",
|
"name": "npmts",
|
||||||
"version": "1.0.7",
|
"version": "2.2.3",
|
||||||
"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,9 +8,8 @@
|
|||||||
"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)",
|
||||||
"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)"
|
||||||
"testm": "(cd test/ && npm update && npm test)"
|
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -27,11 +26,19 @@
|
|||||||
},
|
},
|
||||||
"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": "3.9.1",
|
||||||
|
"gulp-coveralls": "^0.1.4",
|
||||||
"gulp-insert": "0.5.0",
|
"gulp-insert": "0.5.0",
|
||||||
"gulp-typescript": "2.10.0",
|
"gulp-istanbul": "^0.10.3",
|
||||||
"merge2": "0.3.6",
|
"gulp-mocha": "^2.2.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",
|
||||||
|
"typings": "^0.6.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
test/assets/coverage/coverage-final.json
Normal file
2
test/assets/coverage/coverage-final.json
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
{
|
||||||
|
"/Users/philkunz/github/pushrocks/npmts/test/assets/index.js":{"path":"/Users/philkunz/github/pushrocks/npmts/test/assets/index.js","s":{"1":1,"2":1,"3":1},"b":{},"f":{"1":1},"fnMap":{"1":{"name":"(anonymous_1)","line":5,"loc":{"start":{"line":5,"column":18},"end":{"line":5,"column":30}}}},"statementMap":{"1":{"start":{"line":4,"column":0},"end":{"line":8,"column":2}},"2":{"start":{"line":6,"column":8},"end":{"line":6,"column":46}},"3":{"start":{"line":9,"column":0},"end":{"line":9,"column":28}}},"branchMap":{},"l":{"4":1,"6":1,"9":1}}}
|
93
test/assets/coverage/lcov-report/assets/index.html
Normal file
93
test/assets/coverage/lcov-report/assets/index.html
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<title>Code coverage report for assets/</title>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<link rel="stylesheet" href="../prettify.css" />
|
||||||
|
<link rel="stylesheet" href="../base.css" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<style type='text/css'>
|
||||||
|
.coverage-summary .sorter {
|
||||||
|
background-image: url(../sort-arrow-sprite.png);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class='wrapper'>
|
||||||
|
<div class='pad1'>
|
||||||
|
<h1>
|
||||||
|
<a href="../index.html">all files</a> assets/
|
||||||
|
</h1>
|
||||||
|
<div class='clearfix'>
|
||||||
|
<div class='fl pad1y space-right2'>
|
||||||
|
<span class="strong">100% </span>
|
||||||
|
<span class="quiet">Statements</span>
|
||||||
|
<span class='fraction'>3/3</span>
|
||||||
|
</div>
|
||||||
|
<div class='fl pad1y space-right2'>
|
||||||
|
<span class="strong">100% </span>
|
||||||
|
<span class="quiet">Branches</span>
|
||||||
|
<span class='fraction'>0/0</span>
|
||||||
|
</div>
|
||||||
|
<div class='fl pad1y space-right2'>
|
||||||
|
<span class="strong">100% </span>
|
||||||
|
<span class="quiet">Functions</span>
|
||||||
|
<span class='fraction'>1/1</span>
|
||||||
|
</div>
|
||||||
|
<div class='fl pad1y space-right2'>
|
||||||
|
<span class="strong">100% </span>
|
||||||
|
<span class="quiet">Lines</span>
|
||||||
|
<span class='fraction'>3/3</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class='status-line high'></div>
|
||||||
|
<div class="pad1">
|
||||||
|
<table class="coverage-summary">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
||||||
|
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
||||||
|
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
||||||
|
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||||
|
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
||||||
|
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||||
|
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
||||||
|
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||||
|
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
||||||
|
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody><tr>
|
||||||
|
<td class="file high" data-value="index.js"><a href="index.js.html">index.js</a></td>
|
||||||
|
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
|
||||||
|
<td data-value="100" class="pct high">100%</td>
|
||||||
|
<td data-value="3" class="abs high">3/3</td>
|
||||||
|
<td data-value="100" class="pct high">100%</td>
|
||||||
|
<td data-value="0" class="abs high">0/0</td>
|
||||||
|
<td data-value="100" class="pct high">100%</td>
|
||||||
|
<td data-value="1" class="abs high">1/1</td>
|
||||||
|
<td data-value="100" class="pct high">100%</td>
|
||||||
|
<td data-value="3" class="abs high">3/3</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div><div class='push'></div><!-- for sticky footer -->
|
||||||
|
</div><!-- /wrapper -->
|
||||||
|
<div class='footer quiet pad2 space-top1 center small'>
|
||||||
|
Code coverage
|
||||||
|
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Feb 11 2016 19:08:46 GMT+0100 (CET)
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script src="../prettify.js"></script>
|
||||||
|
<script>
|
||||||
|
window.onload = function () {
|
||||||
|
if (typeof prettyPrint === 'function') {
|
||||||
|
prettyPrint();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<script src="../sorter.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
92
test/assets/coverage/lcov-report/assets/index.js.html
Normal file
92
test/assets/coverage/lcov-report/assets/index.js.html
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<title>Code coverage report for assets/index.js</title>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<link rel="stylesheet" href="../prettify.css" />
|
||||||
|
<link rel="stylesheet" href="../base.css" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<style type='text/css'>
|
||||||
|
.coverage-summary .sorter {
|
||||||
|
background-image: url(../sort-arrow-sprite.png);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class='wrapper'>
|
||||||
|
<div class='pad1'>
|
||||||
|
<h1>
|
||||||
|
<a href="../index.html">all files</a> / <a href="index.html">assets/</a> index.js
|
||||||
|
</h1>
|
||||||
|
<div class='clearfix'>
|
||||||
|
<div class='fl pad1y space-right2'>
|
||||||
|
<span class="strong">100% </span>
|
||||||
|
<span class="quiet">Statements</span>
|
||||||
|
<span class='fraction'>3/3</span>
|
||||||
|
</div>
|
||||||
|
<div class='fl pad1y space-right2'>
|
||||||
|
<span class="strong">100% </span>
|
||||||
|
<span class="quiet">Branches</span>
|
||||||
|
<span class='fraction'>0/0</span>
|
||||||
|
</div>
|
||||||
|
<div class='fl pad1y space-right2'>
|
||||||
|
<span class="strong">100% </span>
|
||||||
|
<span class="quiet">Functions</span>
|
||||||
|
<span class='fraction'>1/1</span>
|
||||||
|
</div>
|
||||||
|
<div class='fl pad1y space-right2'>
|
||||||
|
<span class="strong">100% </span>
|
||||||
|
<span class="quiet">Lines</span>
|
||||||
|
<span class='fraction'>3/3</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class='status-line high'></div>
|
||||||
|
<pre><table class="coverage">
|
||||||
|
<tr><td class="line-count quiet">1
|
||||||
|
2
|
||||||
|
3
|
||||||
|
4
|
||||||
|
5
|
||||||
|
6
|
||||||
|
7
|
||||||
|
8
|
||||||
|
9
|
||||||
|
10</td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||||
|
<span class="cline-any cline-neutral"> </span>
|
||||||
|
<span class="cline-any cline-neutral"> </span>
|
||||||
|
<span class="cline-any cline-yes">1×</span>
|
||||||
|
<span class="cline-any cline-neutral"> </span>
|
||||||
|
<span class="cline-any cline-yes">1×</span>
|
||||||
|
<span class="cline-any cline-neutral"> </span>
|
||||||
|
<span class="cline-any cline-neutral"> </span>
|
||||||
|
<span class="cline-any cline-yes">1×</span>
|
||||||
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">#!/usr/bin/env node
|
||||||
|
|
||||||
|
/// <reference path="./typings/main.d.ts" />
|
||||||
|
var testplugin = {
|
||||||
|
logSomething: function () {
|
||||||
|
console.log("only function executed");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
module.exports = testplugin;
|
||||||
|
</pre></td></tr>
|
||||||
|
</table></pre>
|
||||||
|
<div class='push'></div><!-- for sticky footer -->
|
||||||
|
</div><!-- /wrapper -->
|
||||||
|
<div class='footer quiet pad2 space-top1 center small'>
|
||||||
|
Code coverage
|
||||||
|
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Feb 11 2016 19:08:46 GMT+0100 (CET)
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script src="../prettify.js"></script>
|
||||||
|
<script>
|
||||||
|
window.onload = function () {
|
||||||
|
if (typeof prettyPrint === 'function') {
|
||||||
|
prettyPrint();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<script src="../sorter.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
212
test/assets/coverage/lcov-report/base.css
Normal file
212
test/assets/coverage/lcov-report/base.css
Normal file
@ -0,0 +1,212 @@
|
|||||||
|
body, html {
|
||||||
|
margin:0; padding: 0;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
font-family: Helvetica Neue, Helvetica, Arial;
|
||||||
|
font-size: 14px;
|
||||||
|
color:#333;
|
||||||
|
}
|
||||||
|
.small { font-size: 12px;; }
|
||||||
|
*, *:after, *:before {
|
||||||
|
-webkit-box-sizing:border-box;
|
||||||
|
-moz-box-sizing:border-box;
|
||||||
|
box-sizing:border-box;
|
||||||
|
}
|
||||||
|
h1 { font-size: 20px; margin: 0;}
|
||||||
|
h2 { font-size: 14px; }
|
||||||
|
pre {
|
||||||
|
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
-moz-tab-size: 2;
|
||||||
|
-o-tab-size: 2;
|
||||||
|
tab-size: 2;
|
||||||
|
}
|
||||||
|
a { color:#0074D9; text-decoration:none; }
|
||||||
|
a:hover { text-decoration:underline; }
|
||||||
|
.strong { font-weight: bold; }
|
||||||
|
.space-top1 { padding: 10px 0 0 0; }
|
||||||
|
.pad2y { padding: 20px 0; }
|
||||||
|
.pad1y { padding: 10px 0; }
|
||||||
|
.pad2x { padding: 0 20px; }
|
||||||
|
.pad2 { padding: 20px; }
|
||||||
|
.pad1 { padding: 10px; }
|
||||||
|
.space-left2 { padding-left:55px; }
|
||||||
|
.space-right2 { padding-right:20px; }
|
||||||
|
.center { text-align:center; }
|
||||||
|
.clearfix { display:block; }
|
||||||
|
.clearfix:after {
|
||||||
|
content:'';
|
||||||
|
display:block;
|
||||||
|
height:0;
|
||||||
|
clear:both;
|
||||||
|
visibility:hidden;
|
||||||
|
}
|
||||||
|
.fl { float: left; }
|
||||||
|
@media only screen and (max-width:640px) {
|
||||||
|
.col3 { width:100%; max-width:100%; }
|
||||||
|
.hide-mobile { display:none!important; }
|
||||||
|
}
|
||||||
|
|
||||||
|
.quiet {
|
||||||
|
color: #7f7f7f;
|
||||||
|
color: rgba(0,0,0,0.5);
|
||||||
|
}
|
||||||
|
.quiet a { opacity: 0.7; }
|
||||||
|
|
||||||
|
.fraction {
|
||||||
|
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
|
||||||
|
font-size: 10px;
|
||||||
|
color: #555;
|
||||||
|
background: #E8E8E8;
|
||||||
|
padding: 4px 5px;
|
||||||
|
border-radius: 3px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.path a:link, div.path a:visited { color: #333; }
|
||||||
|
table.coverage {
|
||||||
|
border-collapse: collapse;
|
||||||
|
margin: 10px 0 0 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.coverage td {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
table.coverage td.line-count {
|
||||||
|
text-align: right;
|
||||||
|
padding: 0 5px 0 20px;
|
||||||
|
}
|
||||||
|
table.coverage td.line-coverage {
|
||||||
|
text-align: right;
|
||||||
|
padding-right: 10px;
|
||||||
|
min-width:20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.coverage td span.cline-any {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0 5px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.missing-if-branch {
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 5px;
|
||||||
|
border-radius: 3px;
|
||||||
|
position: relative;
|
||||||
|
padding: 0 4px;
|
||||||
|
background: #333;
|
||||||
|
color: yellow;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skip-if-branch {
|
||||||
|
display: none;
|
||||||
|
margin-right: 10px;
|
||||||
|
position: relative;
|
||||||
|
padding: 0 4px;
|
||||||
|
background: #ccc;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.missing-if-branch .typ, .skip-if-branch .typ {
|
||||||
|
color: inherit !important;
|
||||||
|
}
|
||||||
|
.coverage-summary {
|
||||||
|
border-collapse: collapse;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.coverage-summary tr { border-bottom: 1px solid #bbb; }
|
||||||
|
.keyline-all { border: 1px solid #ddd; }
|
||||||
|
.coverage-summary td, .coverage-summary th { padding: 10px; }
|
||||||
|
.coverage-summary tbody { border: 1px solid #bbb; }
|
||||||
|
.coverage-summary td { border-right: 1px solid #bbb; }
|
||||||
|
.coverage-summary td:last-child { border-right: none; }
|
||||||
|
.coverage-summary th {
|
||||||
|
text-align: left;
|
||||||
|
font-weight: normal;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.coverage-summary th.file { border-right: none !important; }
|
||||||
|
.coverage-summary th.pct { }
|
||||||
|
.coverage-summary th.pic,
|
||||||
|
.coverage-summary th.abs,
|
||||||
|
.coverage-summary td.pct,
|
||||||
|
.coverage-summary td.abs { text-align: right; }
|
||||||
|
.coverage-summary td.file { white-space: nowrap; }
|
||||||
|
.coverage-summary td.pic { min-width: 120px !important; }
|
||||||
|
.coverage-summary tfoot td { }
|
||||||
|
|
||||||
|
.coverage-summary .sorter {
|
||||||
|
height: 10px;
|
||||||
|
width: 7px;
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: 0.5em;
|
||||||
|
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
|
||||||
|
}
|
||||||
|
.coverage-summary .sorted .sorter {
|
||||||
|
background-position: 0 -20px;
|
||||||
|
}
|
||||||
|
.coverage-summary .sorted-desc .sorter {
|
||||||
|
background-position: 0 -10px;
|
||||||
|
}
|
||||||
|
.status-line { height: 10px; }
|
||||||
|
/* dark red */
|
||||||
|
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
|
||||||
|
.low .chart { border:1px solid #C21F39 }
|
||||||
|
/* medium red */
|
||||||
|
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
|
||||||
|
/* light red */
|
||||||
|
.low, .cline-no { background:#FCE1E5 }
|
||||||
|
/* light green */
|
||||||
|
.high, .cline-yes { background:rgb(230,245,208) }
|
||||||
|
/* medium green */
|
||||||
|
.cstat-yes { background:rgb(161,215,106) }
|
||||||
|
/* dark green */
|
||||||
|
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
|
||||||
|
.high .chart { border:1px solid rgb(77,146,33) }
|
||||||
|
|
||||||
|
|
||||||
|
.medium .chart { border:1px solid #666; }
|
||||||
|
.medium .cover-fill { background: #666; }
|
||||||
|
|
||||||
|
.cbranch-no { background: yellow !important; color: #111; }
|
||||||
|
|
||||||
|
.cstat-skip { background: #ddd; color: #111; }
|
||||||
|
.fstat-skip { background: #ddd; color: #111 !important; }
|
||||||
|
.cbranch-skip { background: #ddd !important; color: #111; }
|
||||||
|
|
||||||
|
span.cline-neutral { background: #eaeaea; }
|
||||||
|
.medium { background: #eaeaea; }
|
||||||
|
|
||||||
|
.cover-fill, .cover-empty {
|
||||||
|
display:inline-block;
|
||||||
|
height: 12px;
|
||||||
|
}
|
||||||
|
.chart {
|
||||||
|
line-height: 0;
|
||||||
|
}
|
||||||
|
.cover-empty {
|
||||||
|
background: white;
|
||||||
|
}
|
||||||
|
.cover-full {
|
||||||
|
border-right: none !important;
|
||||||
|
}
|
||||||
|
pre.prettyprint {
|
||||||
|
border: none !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
|
.com { color: #999 !important; }
|
||||||
|
.ignore-none { color: #999; font-weight: normal; }
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
min-height: 100%;
|
||||||
|
height: auto !important;
|
||||||
|
height: 100%;
|
||||||
|
margin: 0 auto -48px;
|
||||||
|
}
|
||||||
|
.footer, .push {
|
||||||
|
height: 48px;
|
||||||
|
}
|
93
test/assets/coverage/lcov-report/index.html
Normal file
93
test/assets/coverage/lcov-report/index.html
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<title>Code coverage report for All files</title>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<link rel="stylesheet" href="prettify.css" />
|
||||||
|
<link rel="stylesheet" href="base.css" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<style type='text/css'>
|
||||||
|
.coverage-summary .sorter {
|
||||||
|
background-image: url(sort-arrow-sprite.png);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class='wrapper'>
|
||||||
|
<div class='pad1'>
|
||||||
|
<h1>
|
||||||
|
/
|
||||||
|
</h1>
|
||||||
|
<div class='clearfix'>
|
||||||
|
<div class='fl pad1y space-right2'>
|
||||||
|
<span class="strong">100% </span>
|
||||||
|
<span class="quiet">Statements</span>
|
||||||
|
<span class='fraction'>3/3</span>
|
||||||
|
</div>
|
||||||
|
<div class='fl pad1y space-right2'>
|
||||||
|
<span class="strong">100% </span>
|
||||||
|
<span class="quiet">Branches</span>
|
||||||
|
<span class='fraction'>0/0</span>
|
||||||
|
</div>
|
||||||
|
<div class='fl pad1y space-right2'>
|
||||||
|
<span class="strong">100% </span>
|
||||||
|
<span class="quiet">Functions</span>
|
||||||
|
<span class='fraction'>1/1</span>
|
||||||
|
</div>
|
||||||
|
<div class='fl pad1y space-right2'>
|
||||||
|
<span class="strong">100% </span>
|
||||||
|
<span class="quiet">Lines</span>
|
||||||
|
<span class='fraction'>3/3</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class='status-line high'></div>
|
||||||
|
<div class="pad1">
|
||||||
|
<table class="coverage-summary">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
||||||
|
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
||||||
|
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
||||||
|
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||||
|
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
||||||
|
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||||
|
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
||||||
|
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||||
|
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
||||||
|
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody><tr>
|
||||||
|
<td class="file high" data-value="assets/"><a href="assets/index.html">assets/</a></td>
|
||||||
|
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
|
||||||
|
<td data-value="100" class="pct high">100%</td>
|
||||||
|
<td data-value="3" class="abs high">3/3</td>
|
||||||
|
<td data-value="100" class="pct high">100%</td>
|
||||||
|
<td data-value="0" class="abs high">0/0</td>
|
||||||
|
<td data-value="100" class="pct high">100%</td>
|
||||||
|
<td data-value="1" class="abs high">1/1</td>
|
||||||
|
<td data-value="100" class="pct high">100%</td>
|
||||||
|
<td data-value="3" class="abs high">3/3</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div><div class='push'></div><!-- for sticky footer -->
|
||||||
|
</div><!-- /wrapper -->
|
||||||
|
<div class='footer quiet pad2 space-top1 center small'>
|
||||||
|
Code coverage
|
||||||
|
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Feb 11 2016 19:08:46 GMT+0100 (CET)
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script src="prettify.js"></script>
|
||||||
|
<script>
|
||||||
|
window.onload = function () {
|
||||||
|
if (typeof prettyPrint === 'function') {
|
||||||
|
prettyPrint();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<script src="sorter.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
1
test/assets/coverage/lcov-report/prettify.css
Normal file
1
test/assets/coverage/lcov-report/prettify.css
Normal file
@ -0,0 +1 @@
|
|||||||
|
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
|
1
test/assets/coverage/lcov-report/prettify.js
Normal file
1
test/assets/coverage/lcov-report/prettify.js
Normal file
File diff suppressed because one or more lines are too long
BIN
test/assets/coverage/lcov-report/sort-arrow-sprite.png
Normal file
BIN
test/assets/coverage/lcov-report/sort-arrow-sprite.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 209 B |
158
test/assets/coverage/lcov-report/sorter.js
Normal file
158
test/assets/coverage/lcov-report/sorter.js
Normal file
@ -0,0 +1,158 @@
|
|||||||
|
var addSorting = (function () {
|
||||||
|
"use strict";
|
||||||
|
var cols,
|
||||||
|
currentSort = {
|
||||||
|
index: 0,
|
||||||
|
desc: false
|
||||||
|
};
|
||||||
|
|
||||||
|
// returns the summary table element
|
||||||
|
function getTable() { return document.querySelector('.coverage-summary'); }
|
||||||
|
// returns the thead element of the summary table
|
||||||
|
function getTableHeader() { return getTable().querySelector('thead tr'); }
|
||||||
|
// returns the tbody element of the summary table
|
||||||
|
function getTableBody() { return getTable().querySelector('tbody'); }
|
||||||
|
// returns the th element for nth column
|
||||||
|
function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; }
|
||||||
|
|
||||||
|
// loads all columns
|
||||||
|
function loadColumns() {
|
||||||
|
var colNodes = getTableHeader().querySelectorAll('th'),
|
||||||
|
colNode,
|
||||||
|
cols = [],
|
||||||
|
col,
|
||||||
|
i;
|
||||||
|
|
||||||
|
for (i = 0; i < colNodes.length; i += 1) {
|
||||||
|
colNode = colNodes[i];
|
||||||
|
col = {
|
||||||
|
key: colNode.getAttribute('data-col'),
|
||||||
|
sortable: !colNode.getAttribute('data-nosort'),
|
||||||
|
type: colNode.getAttribute('data-type') || 'string'
|
||||||
|
};
|
||||||
|
cols.push(col);
|
||||||
|
if (col.sortable) {
|
||||||
|
col.defaultDescSort = col.type === 'number';
|
||||||
|
colNode.innerHTML = colNode.innerHTML + '<span class="sorter"></span>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return cols;
|
||||||
|
}
|
||||||
|
// attaches a data attribute to every tr element with an object
|
||||||
|
// of data values keyed by column name
|
||||||
|
function loadRowData(tableRow) {
|
||||||
|
var tableCols = tableRow.querySelectorAll('td'),
|
||||||
|
colNode,
|
||||||
|
col,
|
||||||
|
data = {},
|
||||||
|
i,
|
||||||
|
val;
|
||||||
|
for (i = 0; i < tableCols.length; i += 1) {
|
||||||
|
colNode = tableCols[i];
|
||||||
|
col = cols[i];
|
||||||
|
val = colNode.getAttribute('data-value');
|
||||||
|
if (col.type === 'number') {
|
||||||
|
val = Number(val);
|
||||||
|
}
|
||||||
|
data[col.key] = val;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
// loads all row data
|
||||||
|
function loadData() {
|
||||||
|
var rows = getTableBody().querySelectorAll('tr'),
|
||||||
|
i;
|
||||||
|
|
||||||
|
for (i = 0; i < rows.length; i += 1) {
|
||||||
|
rows[i].data = loadRowData(rows[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// sorts the table using the data for the ith column
|
||||||
|
function sortByIndex(index, desc) {
|
||||||
|
var key = cols[index].key,
|
||||||
|
sorter = function (a, b) {
|
||||||
|
a = a.data[key];
|
||||||
|
b = b.data[key];
|
||||||
|
return a < b ? -1 : a > b ? 1 : 0;
|
||||||
|
},
|
||||||
|
finalSorter = sorter,
|
||||||
|
tableBody = document.querySelector('.coverage-summary tbody'),
|
||||||
|
rowNodes = tableBody.querySelectorAll('tr'),
|
||||||
|
rows = [],
|
||||||
|
i;
|
||||||
|
|
||||||
|
if (desc) {
|
||||||
|
finalSorter = function (a, b) {
|
||||||
|
return -1 * sorter(a, b);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < rowNodes.length; i += 1) {
|
||||||
|
rows.push(rowNodes[i]);
|
||||||
|
tableBody.removeChild(rowNodes[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
rows.sort(finalSorter);
|
||||||
|
|
||||||
|
for (i = 0; i < rows.length; i += 1) {
|
||||||
|
tableBody.appendChild(rows[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// removes sort indicators for current column being sorted
|
||||||
|
function removeSortIndicators() {
|
||||||
|
var col = getNthColumn(currentSort.index),
|
||||||
|
cls = col.className;
|
||||||
|
|
||||||
|
cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
|
||||||
|
col.className = cls;
|
||||||
|
}
|
||||||
|
// adds sort indicators for current column being sorted
|
||||||
|
function addSortIndicators() {
|
||||||
|
getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted';
|
||||||
|
}
|
||||||
|
// adds event listeners for all sorter widgets
|
||||||
|
function enableUI() {
|
||||||
|
var i,
|
||||||
|
el,
|
||||||
|
ithSorter = function ithSorter(i) {
|
||||||
|
var col = cols[i];
|
||||||
|
|
||||||
|
return function () {
|
||||||
|
var desc = col.defaultDescSort;
|
||||||
|
|
||||||
|
if (currentSort.index === i) {
|
||||||
|
desc = !currentSort.desc;
|
||||||
|
}
|
||||||
|
sortByIndex(i, desc);
|
||||||
|
removeSortIndicators();
|
||||||
|
currentSort.index = i;
|
||||||
|
currentSort.desc = desc;
|
||||||
|
addSortIndicators();
|
||||||
|
};
|
||||||
|
};
|
||||||
|
for (i =0 ; i < cols.length; i += 1) {
|
||||||
|
if (cols[i].sortable) {
|
||||||
|
// add the click event handler on the th so users
|
||||||
|
// dont have to click on those tiny arrows
|
||||||
|
el = getNthColumn(i).querySelector('.sorter').parentElement;
|
||||||
|
if (el.addEventListener) {
|
||||||
|
el.addEventListener('click', ithSorter(i));
|
||||||
|
} else {
|
||||||
|
el.attachEvent('onclick', ithSorter(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// adds sorting functionality to the UI
|
||||||
|
return function () {
|
||||||
|
if (!getTable()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cols = loadColumns();
|
||||||
|
loadData(cols);
|
||||||
|
addSortIndicators();
|
||||||
|
enableUI();
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
|
||||||
|
window.addEventListener('load', addSorting);
|
14
test/assets/coverage/lcov.info
Normal file
14
test/assets/coverage/lcov.info
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
TN:
|
||||||
|
SF:/Users/philkunz/github/pushrocks/npmts/test/assets/index.js
|
||||||
|
FN:5,(anonymous_1)
|
||||||
|
FNF:1
|
||||||
|
FNH:1
|
||||||
|
FNDA:1,(anonymous_1)
|
||||||
|
DA:4,1
|
||||||
|
DA:6,1
|
||||||
|
DA:9,1
|
||||||
|
LF:3
|
||||||
|
LH:3
|
||||||
|
BRF:0
|
||||||
|
BRH:0
|
||||||
|
end_of_record
|
2
test/assets/customdir/custom.js
Normal file
2
test/assets/customdir/custom.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
var hello = "hello";
|
||||||
|
//# sourceMappingURL=custom.js.map
|
1
test/assets/customdir/custom.js.map
Normal file
1
test/assets/customdir/custom.js.map
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"custom.js","sourceRoot":"","sources":["custom.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,OAAO,CAAC"}
|
1
test/assets/customdir/custom.ts
Normal file
1
test/assets/customdir/custom.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
var hello = "hello";
|
2
test/assets/customdir/tsfile1.js
Normal file
2
test/assets/customdir/tsfile1.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
var something = "something";
|
||||||
|
//# sourceMappingURL=tsfile1.js.map
|
1
test/assets/customdir/tsfile1.js.map
Normal file
1
test/assets/customdir/tsfile1.js.map
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"tsfile1.js","sourceRoot":"","sources":["tsfile1.ts"],"names":[],"mappings":"AAAA,IAAI,SAAS,GAAG,WAAW,CAAC"}
|
1
test/assets/customdir/tsfile1.ts
Normal file
1
test/assets/customdir/tsfile1.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
var something = "something";
|
7
test/assets/customdir/typings.json
Normal file
7
test/assets/customdir/typings.json
Normal 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
4
test/assets/index.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/// <reference path="ts/typings/main.d.ts" />
|
||||||
|
declare var testplugin: {
|
||||||
|
logSomething: () => void;
|
||||||
|
};
|
9
test/assets/index.js
Normal file
9
test/assets/index.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
/// <reference path="./typings/main.d.ts" />
|
||||||
|
var testplugin = {
|
||||||
|
logSomething: function () {
|
||||||
|
console.log("only function executed");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
module.exports = testplugin;
|
13
test/assets/npmts.json
Normal file
13
test/assets/npmts.json
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"mode":"default",
|
||||||
|
"ts":{
|
||||||
|
"./customdir/*.ts":"./"
|
||||||
|
},
|
||||||
|
"typings":[
|
||||||
|
"./ts",
|
||||||
|
"./subts1/",
|
||||||
|
"./subts2/",
|
||||||
|
"./customdir"
|
||||||
|
],
|
||||||
|
"coveralls":true
|
||||||
|
}
|
@ -9,6 +9,5 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"npmts": "*"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
7
test/assets/subts1/typings.json
Normal file
7
test/assets/subts1/typings.json
Normal 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
2
test/assets/test/test.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/// <reference path="ts/typings/main.d.ts" />
|
||||||
|
declare var testplugin: any;
|
12
test/assets/test/test.js
Normal file
12
test/assets/test/test.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/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();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
8
test/assets/ts/index.js
Normal file
8
test/assets/ts/index.js
Normal 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
|
1
test/assets/ts/index.js.map
Normal file
1
test/assets/ts/index.js.map
Normal 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
7
test/assets/ts/index.ts
Normal 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
11
test/assets/ts/test.js
Normal 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
|
1
test/assets/ts/test.js.map
Normal file
1
test/assets/ts/test.js.map
Normal 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
10
test/assets/ts/test.ts
Normal 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()
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
7
test/assets/ts/typings.json
Normal file
7
test/assets/ts/typings.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
1
test/assets/tsfile1.d.ts
vendored
Normal file
1
test/assets/tsfile1.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
declare var something: string;
|
3
test/assets/tsfile1.js
Normal file
3
test/assets/tsfile1.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
var something = "something";
|
0
test/index.d.ts
vendored
0
test/index.d.ts
vendored
@ -1,5 +0,0 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
|
|
||||||
(function () {
|
|
||||||
console.log("test");
|
|
||||||
}());
|
|
@ -1,4 +0,0 @@
|
|||||||
(function () {
|
|
||||||
console.log("test");
|
|
||||||
}());
|
|
||||||
//# sourceMappingURL=index.js.map
|
|
@ -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"}
|
|
@ -1,3 +0,0 @@
|
|||||||
(function(){
|
|
||||||
console.log("test")
|
|
||||||
}());
|
|
10
ts/index.js
10
ts/index.js
@ -1,10 +0,0 @@
|
|||||||
/// <reference path="./typings/tsd.d.ts" />
|
|
||||||
/// <reference path="./npmts.plugins.ts" />
|
|
||||||
/// <reference path="./npmts.cli.ts" />
|
|
||||||
/// <reference path="./npmts.paths.ts" />
|
|
||||||
/// <reference path="./npmts.custom.ts" />
|
|
||||||
/// <reference path="./npmts.default.ts" />
|
|
||||||
var plugins = NpmtsPlugins.init();
|
|
||||||
var paths = NpmtsPaths.init();
|
|
||||||
NpmtsDefault.init();
|
|
||||||
//# sourceMappingURL=index.js.map
|
|
@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,2CAA2C;AAC3C,uCAAuC;AACvC,yCAAyC;AACzC,0CAA0C;AAC1C,2CAA2C;AAE3C,IAAI,OAAO,GAAG,YAAY,CAAC,IAAI,EAAE,CAAC;AAClC,IAAI,KAAK,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC;AAC9B,YAAY,CAAC,IAAI,EAAE,CAAC"}
|
|
14
ts/index.ts
14
ts/index.ts
@ -1,10 +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.custom.ts" />
|
/// <reference path="./npmts.configfile.ts" />
|
||||||
/// <reference path="./npmts.default.ts" />
|
/// <reference path="./npmts.options.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();
|
||||||
NpmtsDefault.init();
|
var promisechain = NpmtsPromisechain.init();
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
/// <reference path="./index.ts" />
|
|
||||||
//# sourceMappingURL=npmts.cli.js.map
|
|
@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"npmts.cli.js","sourceRoot":"","sources":["npmts.cli.ts"],"names":[],"mappings":"AAAA,mCAAmC"}
|
|
93
ts/npmts.compile.ts
Normal file
93
ts/npmts.compile.ts
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
/// <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.typescript({
|
||||||
|
out: outputName,
|
||||||
|
declaration: true
|
||||||
|
}));
|
||||||
|
var stream = plugins.mergeStream([
|
||||||
|
tsStream.dts.pipe(plugins.gulp.dest(outputDir)),
|
||||||
|
tsStream.js
|
||||||
|
.pipe(plugins.g.insert.prepend('#!/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
26
ts/npmts.configfile.ts
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
@ -1,2 +0,0 @@
|
|||||||
/// <reference path="./index.ts" />
|
|
||||||
//# sourceMappingURL=npmts.custom.js.map
|
|
@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"npmts.custom.js","sourceRoot":"","sources":["npmts.custom.ts"],"names":[],"mappings":"AAAA,mCAAmC"}
|
|
@ -1 +0,0 @@
|
|||||||
/// <reference path="./index.ts" />
|
|
@ -1,31 +0,0 @@
|
|||||||
/// <reference path="./index.ts" />
|
|
||||||
var NpmtsDefault;
|
|
||||||
(function (NpmtsDefault) {
|
|
||||||
NpmtsDefault.init = function () {
|
|
||||||
plugins.gulp.task("indexTS", function () {
|
|
||||||
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("testTS", function () {
|
|
||||||
plugins.gulp.src(paths.testTS)
|
|
||||||
.pipe(plugins.g.typescript({
|
|
||||||
out: "test.js"
|
|
||||||
}))
|
|
||||||
.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']);
|
|
||||||
};
|
|
||||||
})(NpmtsDefault || (NpmtsDefault = {}));
|
|
||||||
//# sourceMappingURL=npmts.default.js.map
|
|
@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"npmts.default.js","sourceRoot":"","sources":["npmts.default.ts"],"names":["NpmtsDefault"],"mappings":"AAAA,mCAAmC;AAEnC,IAAO,YAAY,CA+BlB;AA/BD,WAAO,YAAY,EAAC,CAAC;IACNA,iBAAIA,GAAGA;QACd,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACzB,IAAI,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC;iBACzC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;gBACvB,GAAG,EAAC,UAAU;gBACd,WAAW,EAAC,IAAI;aACnB,CAAC,CAAC,CAAC;YAER,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC;gBACvB,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBAC/C,QAAQ,CAAC,EAAE;qBACN,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;qBACzD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aAC1C,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YACxB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC;iBACzB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;gBACvB,GAAG,EAAE,SAAS;aACjB,CAAC,CAAC;iBACF,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA;QAC3C,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,CAAC,SAAS,EAAC,QAAQ,CAAC,EAAC;YAC7C,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,uDAAuD,CAAC,CAAC;QACvF,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IACxD,CAAC,CAAAA;AACLA,CAACA,EA/BM,YAAY,KAAZ,YAAY,QA+BlB"}
|
|
@ -1,34 +0,0 @@
|
|||||||
/// <reference path="./index.ts" />
|
|
||||||
|
|
||||||
module NpmtsDefault {
|
|
||||||
export var init = function() {
|
|
||||||
plugins.gulp.task("indexTS", function(){
|
|
||||||
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("testTS", function(){
|
|
||||||
plugins.gulp.src(paths.testTS)
|
|
||||||
.pipe(plugins.g.typescript({
|
|
||||||
out: "test.js"
|
|
||||||
}))
|
|
||||||
.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']);
|
|
||||||
}
|
|
||||||
}
|
|
24
ts/npmts.options.ts
Normal file
24
ts/npmts.options.ts
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
@ -1,12 +0,0 @@
|
|||||||
/// <reference path="./index.ts" />
|
|
||||||
var NpmtsPaths;
|
|
||||||
(function (NpmtsPaths) {
|
|
||||||
NpmtsPaths.init = function () {
|
|
||||||
var paths = {};
|
|
||||||
paths.cwd = plugins.smartcli.get.cwd().path;
|
|
||||||
paths.indexTS = plugins.path.join(paths.cwd, "ts/index.ts");
|
|
||||||
paths.testTS = plugins.path.join(paths.cwd, "ts/test.ts");
|
|
||||||
return paths;
|
|
||||||
};
|
|
||||||
})(NpmtsPaths || (NpmtsPaths = {}));
|
|
||||||
//# sourceMappingURL=npmts.paths.js.map
|
|
@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"npmts.paths.js","sourceRoot":"","sources":["npmts.paths.ts"],"names":["NpmtsPaths"],"mappings":"AAAA,mCAAmC;AACnC,IAAO,UAAU,CAQhB;AARD,WAAO,UAAU,EAAC,CAAC;IACJA,eAAIA,GAAGA;QACd,IAAI,KAAK,GAAO,EAAE,CAAC;QACnB,KAAK,CAAC,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;QAC5C,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAC,aAAa,CAAC,CAAC;QAC3D,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAC,YAAY,CAAC,CAAC;QACzD,MAAM,CAAC,KAAK,CAAC;IACjB,CAAC,CAAAA;AACLA,CAACA,EARM,UAAU,KAAV,UAAU,QAQhB"}
|
|
@ -3,8 +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.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;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,19 +0,0 @@
|
|||||||
/// <reference path="./index.ts" />
|
|
||||||
var NpmtsPlugins;
|
|
||||||
(function (NpmtsPlugins) {
|
|
||||||
NpmtsPlugins.init = function () {
|
|
||||||
var plugins = {
|
|
||||||
beautylog: require("beautylog"),
|
|
||||||
gulp: require("gulp"),
|
|
||||||
g: {
|
|
||||||
typescript: require("gulp-typescript"),
|
|
||||||
insert: require("gulp-insert")
|
|
||||||
},
|
|
||||||
mergeStream: require("merge2"),
|
|
||||||
path: require("path"),
|
|
||||||
smartcli: require("smartcli")
|
|
||||||
};
|
|
||||||
return plugins;
|
|
||||||
};
|
|
||||||
})(NpmtsPlugins || (NpmtsPlugins = {}));
|
|
||||||
//# sourceMappingURL=npmts.plugins.js.map
|
|
@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"npmts.plugins.js","sourceRoot":"","sources":["npmts.plugins.ts"],"names":["NpmtsPlugins"],"mappings":"AAAA,mCAAmC;AACnC,IAAO,YAAY,CAelB;AAfD,WAAO,YAAY,EAAC,CAAC;IACNA,iBAAIA,GAAGA;QACd,IAAI,OAAO,GAAG;YACV,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC;YAC/B,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC;YACrB,CAAC,EAAE;gBACC,UAAU,EAAE,OAAO,CAAC,iBAAiB,CAAC;gBACtC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC;aACjC;YACD,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC;YAC9B,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC;YACrB,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC;SAChC,CAAC;QACF,MAAM,CAAC,OAAO,CAAC;IACnB,CAAC,CAAAA;AACLA,CAACA,EAfM,YAAY,KAAZ,YAAY,QAelB"}
|
|
@ -3,14 +3,22 @@ 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: {
|
||||||
typescript: require("gulp-typescript"),
|
coveralls: require("gulp-coveralls"),
|
||||||
insert: require("gulp-insert")
|
insert: require("gulp-insert"),
|
||||||
|
istanbul: require("gulp-istanbul"),
|
||||||
|
mocha: require("gulp-mocha"),
|
||||||
|
typescript: require("gulp-typescript")
|
||||||
|
|
||||||
},
|
},
|
||||||
mergeStream: require("merge2"),
|
mergeStream: require("merge2"),
|
||||||
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
11
ts/npmts.promisechain.ts
Normal 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
44
ts/npmts.tests.ts
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
18
ts/tsd.json
18
ts/tsd.json
@ -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
7
ts/typings.json
Normal 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
3
ts/typings/browser.d.ts
vendored
Normal 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" />
|
@ -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;
|
||||||
}
|
}
|
@ -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;
|
||||||
}
|
}
|
@ -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
3
ts/typings/main.d.ts
vendored
Normal 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" />
|
125
ts/typings/main/ambient/colors/colors.d.ts
vendored
Normal file
125
ts/typings/main/ambient/colors/colors.d.ts
vendored
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
// 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
|
||||||
|
// 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;
|
||||||
|
}
|
2092
ts/typings/main/ambient/node/node.d.ts
vendored
Normal file
2092
ts/typings/main/ambient/node/node.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
110
ts/typings/main/ambient/vinyl/vinyl.d.ts
vendored
Normal file
110
ts/typings/main/ambient/vinyl/vinyl.d.ts
vendored
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
// 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
|
||||||
|
// Project: https://github.com/wearefractal/vinyl
|
||||||
|
// Definitions by: vvakame <https://github.com/vvakame/>, jedmao <https://github.com/jedmao>
|
||||||
|
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||||
|
|
||||||
|
|
||||||
|
declare module 'vinyl' {
|
||||||
|
|
||||||
|
import fs = require('fs');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A virtual file format.
|
||||||
|
*/
|
||||||
|
class File {
|
||||||
|
constructor(options?: {
|
||||||
|
/**
|
||||||
|
* Default: process.cwd()
|
||||||
|
*/
|
||||||
|
cwd?: string;
|
||||||
|
/**
|
||||||
|
* Used for relative pathing. Typically where a glob starts.
|
||||||
|
*/
|
||||||
|
base?: string;
|
||||||
|
/**
|
||||||
|
* Full path to the file.
|
||||||
|
*/
|
||||||
|
path?: string;
|
||||||
|
/**
|
||||||
|
* Path history. Has no effect if options.path is passed.
|
||||||
|
*/
|
||||||
|
history?: string[];
|
||||||
|
/**
|
||||||
|
* The result of an fs.stat call. See fs.Stats for more information.
|
||||||
|
*/
|
||||||
|
stat?: fs.Stats;
|
||||||
|
/**
|
||||||
|
* File contents.
|
||||||
|
* Type: Buffer, Stream, or null
|
||||||
|
*/
|
||||||
|
contents?: Buffer | NodeJS.ReadWriteStream;
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default: process.cwd()
|
||||||
|
*/
|
||||||
|
public cwd: string;
|
||||||
|
/**
|
||||||
|
* Used for relative pathing. Typically where a glob starts.
|
||||||
|
*/
|
||||||
|
public base: string;
|
||||||
|
/**
|
||||||
|
* Full path to the file.
|
||||||
|
*/
|
||||||
|
public path: string;
|
||||||
|
public stat: fs.Stats;
|
||||||
|
/**
|
||||||
|
* Type: Buffer|Stream|null (Default: null)
|
||||||
|
*/
|
||||||
|
public contents: Buffer | NodeJS.ReadableStream;
|
||||||
|
/**
|
||||||
|
* Returns path.relative for the file base and file path.
|
||||||
|
* Example:
|
||||||
|
* var file = new File({
|
||||||
|
* cwd: "/",
|
||||||
|
* base: "/test/",
|
||||||
|
* path: "/test/file.js"
|
||||||
|
* });
|
||||||
|
* console.log(file.relative); // file.js
|
||||||
|
*/
|
||||||
|
public relative: string;
|
||||||
|
|
||||||
|
public isBuffer(): boolean;
|
||||||
|
|
||||||
|
public isStream(): boolean;
|
||||||
|
|
||||||
|
public isNull(): boolean;
|
||||||
|
|
||||||
|
public isDirectory(): boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a new File object with all attributes cloned. Custom attributes are deep-cloned.
|
||||||
|
*/
|
||||||
|
public clone(opts?: { contents?: boolean }): File;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If file.contents is a Buffer, it will write it to the stream.
|
||||||
|
* If file.contents is a Stream, it will pipe it to the stream.
|
||||||
|
* If file.contents is null, it will do nothing.
|
||||||
|
*/
|
||||||
|
public pipe<T extends NodeJS.ReadWriteStream>(
|
||||||
|
stream: T,
|
||||||
|
opts?: {
|
||||||
|
/**
|
||||||
|
* If false, the destination stream will not be ended (same as node core).
|
||||||
|
*/
|
||||||
|
end?: boolean;
|
||||||
|
}
|
||||||
|
): T;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a pretty String interpretation of the File. Useful for console.log.
|
||||||
|
*/
|
||||||
|
public inspect(): string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export = File;
|
||||||
|
|
||||||
|
}
|
3
ts/typings/tsd.d.ts
vendored
3
ts/typings/tsd.d.ts
vendored
@ -1,3 +0,0 @@
|
|||||||
/// <reference path="node/node.d.ts" />
|
|
||||||
/// <reference path="colors/colors.d.ts" />
|
|
||||||
/// <reference path="vinyl/vinyl.d.ts" />
|
|
Reference in New Issue
Block a user