update dependencies and structure

This commit is contained in:
Philipp Kunz 2016-06-09 03:13:40 +02:00
parent 0618e46cd8
commit 040120d034
17 changed files with 95 additions and 56 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
.idea/ .idea/
coverage/ coverage/
docs/
node_modules node_modules
ts/**/*.js ts/**/*.js

5
dist/index.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
import "typings-global";
import { ProjectinfoNpm } from "./projectinfo.classes.npm";
export { ProjectinfoNpm } from "./projectinfo.classes.npm";
export declare let npm: (cwdArg: any, optionsArg: any) => ProjectinfoNpm;
export declare let getName: (cwdArg: any) => string;

29
dist/index.js vendored
View File

@ -1,16 +1,27 @@
var projectinfo = {}; "use strict";
//classes require("typings-global");
var ProjectinfoNPM = require("./projectinfo.npm"); //npm
projectinfo.npm = function (cwdArg, optionsArg) { var projectinfo_classes_npm_1 = require("./projectinfo.classes.npm");
return new ProjectinfoNPM(cwdArg, optionsArg); var projectinfo_classes_npm_2 = require("./projectinfo.classes.npm");
exports.ProjectinfoNpm = projectinfo_classes_npm_2.ProjectinfoNpm;
exports.npm = function (cwdArg, optionsArg) {
return new projectinfo_classes_npm_1.ProjectinfoNpm(cwdArg, optionsArg);
}; };
//quick functions //quick functions
projectinfo.getName = function (cwdArg) { exports.getName = function (cwdArg) {
var localNpm = projectinfo.npm(cwdArg); var localNpm = new projectinfo_classes_npm_1.ProjectinfoNpm(cwdArg);
if (localNpm.status === "ok") { if (localNpm.status === "ok") {
return localNpm.name; return localNpm.name;
} }
}; };
module.exports = projectinfo; /* TODO
projectinfo.git = function(){
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLElBQUksV0FBVyxHQUFPLEVBQUUsQ0FBQztBQUV6QixTQUFTO0FBQ1QsSUFBTyxjQUFjLFdBQVcsbUJBQW1CLENBQUMsQ0FBQztBQUNyRCxXQUF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InNvdXJjZXNDb250ZW50IjpbImltcG9ydCBcInR5cGluZ3MtZ2xvYmFsXCJcbmltcG9ydCBwbHVnaW5zID0gcmVxdWlyZShcIi4vcHJvamVjdGluZm8ucGx1Z2luc1wiKTtcblxuLy9ucG1cbmltcG9ydCB7UHJvamVjdGluZm9OcG19IGZyb20gXCIuL3Byb2plY3RpbmZvLmNsYXNzZXMubnBtXCI7XG5leHBvcnQge1Byb2plY3RpbmZvTnBtfSBmcm9tIFwiLi9wcm9qZWN0aW5mby5jbGFzc2VzLm5wbVwiO1xuZXhwb3J0IGxldCBucG0gPSBmdW5jdGlvbihjd2RBcmcsb3B0aW9uc0FyZyl7XG4gICAgcmV0dXJuIG5ldyBQcm9qZWN0aW5mb05wbShjd2RBcmcsb3B0aW9uc0FyZyk7XG59O1xuXG4vL3F1aWNrIGZ1bmN0aW9uc1xuZXhwb3J0IGxldCBnZXROYW1lID0gZnVuY3Rpb24oY3dkQXJnKXtcbiAgICB2YXIgbG9jYWxOcG0gPSBuZXcgUHJvamVjdGluZm9OcG0oY3dkQXJnKTtcbiAgICBpZiAobG9jYWxOcG0uc3RhdHVzID09PSBcIm9rXCIpe1xuICAgICAgICByZXR1cm4gbG9jYWxOcG0ubmFtZTtcbiAgICB9XG59O1xuXG4vKiBUT0RPXG5wcm9qZWN0aW5mby5naXQgPSBmdW5jdGlvbigpe1xuXG59O1xuXG5wcm9qZWN0aW5mby5tb2pvID0gZnVuY3Rpb24oKXtcblxufTtcbiovIl19

1
dist/projectinfi.classes.git.d.ts vendored Normal file
View File

@ -0,0 +1 @@
import "typings-global";

4
dist/projectinfi.classes.git.js vendored Normal file
View File

@ -0,0 +1,4 @@
"use strict";
require("typings-global");
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInByb2plY3RpbmZpLmNsYXNzZXMuZ2l0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUFnQixDQUFDLENBQUQiLCJmaWxlIjoicHJvamVjdGluZmkuY2xhc3Nlcy5naXQuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgXCJ0eXBpbmdzLWdsb2JhbFwiIl19

12
dist/projectinfo.classes.npm.d.ts vendored Normal file
View File

@ -0,0 +1,12 @@
import "typings-global";
export declare class ProjectinfoNpm {
packageJson: any;
name: string;
version: string;
status: string;
license: string;
git: any;
constructor(cwdArg: string, optionsArg?: {
gitAccessToken?: string;
});
}

22
dist/projectinfo.classes.npm.js vendored Normal file
View File

@ -0,0 +1,22 @@
"use strict";
require("typings-global");
var plugins = require("./projectinfo.plugins");
var ProjectinfoNpm = (function () {
function ProjectinfoNpm(cwdArg, optionsArg) {
if (optionsArg === void 0) { optionsArg = {}; }
this.packageJson = plugins.smartfile.local.toObjectSync(plugins.path.join(plugins.path.resolve(cwdArg), "package.json"), "json");
this.name = this.packageJson.name;
this.version = this.packageJson.version;
this.status = "ok";
this.license = this.packageJson.license;
if (this.packageJson.repository) {
this.git = new plugins.smartstring.GitRepo(this.packageJson.repository.url, optionsArg.gitAccessToken);
}
;
}
;
return ProjectinfoNpm;
}());
exports.ProjectinfoNpm = ProjectinfoNpm;
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInByb2plY3RpbmZvLmNsYXNzZXMubnBtLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUNQLENBQUMsQ0FEc0I7QUFDdkIsSUFBTyxPQUFPLFdBQVcsdUJBQXVCLENBQUMsQ0FBQztBQUNsRDtJQVFJLHdCQUFZLE1BQWEsRUFBQyxVQUF3QztRQUF4QywwQkFBd0MsR0FBeEMsZUFBd0M7UUFDOUQsSUFBSSxDQUFDLFdBQVcsR0FBRyxPQUFPLENBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQyxZQUFZLENBQ25ELE9BQU8sQ0FBQyxJQUFJL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0cmluZztcbiAgICBzdGF0dXM6c3RyaW5nO1xuICAgIGxpY2Vuc2U6c3RyaW5nO1xuICAgIGdpdDtcblxuICAgIGNvbnN0cnVjdG9yKGN3ZEFyZzpzdHJpbmcsb3B0aW9uc0FyZzp7Z2l0QWNjZXNzVG9rZW4/OnN0cmluZ30gPSB7fSl7XG4gICAgICAgIHRoaXMucGFja2FnZUpzb24gPSBwbHVnaW5zLnNtYXJ0ZmlsZS5sb2NhbC50b09iamVjdFN5bmMoXG4gICAgICAgICAgICBwbHVnaW5zLnBhdGguam9pbihcbiAgICAgICAgICAgICAgICBwbHVnaW5zLnBhdGgucmVzb2x2ZShjd2RBcmcpLFxuICAgICAgICAgICAgICAgIFwicGFja2FnZS5qc29uXCJcbiAgICAgICAgICAgICksXG4gICAgICAgICAgICBcImpzb25cIlxuICAgICAgICApO1xuICAgICAgICB0aGlzLm5hbWUgPSB0aGlzLnBhY2thZ2VKc29uLm5hbWU7XG4gICAgICAgIHRoaXMudmVyc2lvbiA9IHRoaXMucGFja2FnZUpzb24udmVyc2lvbjtcbiAgICAgICAgdGhpcy5zdGF0dXMgPSBcIm9rXCI7XG4gICAgICAgIHRoaXMubGljZW5zZSA9IHRoaXMucGFja2FnZUpzb24ubGljZW5zZTtcbiAgICAgICAgaWYgKHRoaXMucGFja2FnZUpzb24ucmVwb3NpdG9yeSl7XG4gICAgICAgICAgICB0aGlzLmdpdCA9ICBuZXcgcGx1Z2lucy5zbWFydHN0cmluZy5HaXRSZXBvKHRoaXMucGFja2FnZUpzb24ucmVwb3NpdG9yeS51cmwsb3B0aW9uc0FyZy5naXRBY2Nlc3NUb2tlbik7XG4gICAgICAgIH07XG5cbiAgICB9O1xufSJdfQ==

View File

@ -1,20 +0,0 @@
/// <reference path="./typings/main.d.ts" />
var plugins = require("./projectinfo.plugins");
var ProjectinfoNPM = (function () {
function ProjectinfoNPM(cwdArg, optionsArg) {
if (optionsArg === void 0) { optionsArg = {}; }
this.packageJson = plugins.smartfile.readFileToObject(plugins.path.join(plugins.path.resolve(cwdArg), "package.json"));
this.name = this.packageJson.name;
this.version = this.packageJson.version;
this.status = "ok";
this.license = this.packageJson.license;
if (this.packageJson.repository) {
this.git = plugins.smartstring.git(this.packageJson.repository.url, optionsArg.gitAccessToken);
}
;
}
return ProjectinfoNPM;
})();
module.exports = ProjectinfoNPM;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInByb2plY3RpbmZvLm5wbS50cyJdLCJuYW1lcyI6WyJQcm9qZWN0aW5mb05QTSIsIlByb2plY3RpbmZvTlBNLmNvbnN0cnVjdG9yIl0sIm1hcHBpbmdzIjoiQUFBQSw0Q0FBNEM7QUFDNUMsSUFBTyxPQUFPLFdBQVcsdUJBQXVCLENBQUMsQ0FBQztBQUNsRDtJQVFJQSx3QkFBWUEsTUFBYUEsRUFBQ0EsVUFBd0NBO1FBQXhDQywwQkFBd0NBLEdBQXhDQSxlQUF3Q0E7UUFDOURBLElBQUlBLENBQUNBLFdBQVdBLEdBQUdBLE9BQU9BLENBQUNBLFNBQVNBLENBQUNBLGdCQUFnQkEsQ0FDakRBLE9BQU9BLENBQUNBLElBQUlBLENBQUNBLElBQUlBLENBQ2JBLE9BQU9BLENBQUNBLElBQUlBLENBQUNBLE9BQU9BLENBQUNBLE1BQU1BLENBQUNBLEVBQzVCQSxjQUFjQSxDQUNqQkEsQ0FDSkEsQ0FBQ0E7UUFDRkEsSUFBSUEsQ0FBQ0EsSUFBSUEsR0FBR0EsSUFBSUEsQ0FBQ0EsV0FBV0EsQ0FBQ0EsSUFBSUEsQ0FBQ0E7UUFDbENBLElBQUlBLENBQUNBLE9BQU9BLEdBQUdBLElBQUlBLENBQUNBLFdBQVdBLENBQUNBLE9BQU9BLENBQUNBO1FBQ3hDQSxJQUFJQSxDQUFDQSxNQUFNQSxHQUFHQSxJQUFJQSxDQUFDQTtRQUNuQkEsSUFBSUEsQ0FBQ0EsT0FBT0EsR0FBR0EsSUF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KFxuICAgICAgICAgICAgICAgIHBsdWdpbnMucGF0aC5yZXNvbHZlKGN3ZEFyZyksXG4gICAgICAgICAgICAgICAgXCJwYWNrYWdlLmpzb25cIlxuICAgICAgICAgICAgKVxuICAgICAgICApO1xuICAgICAgICB0aGlzLm5hbWUgPSB0aGlzLnBhY2thZ2VKc29uLm5hbWU7XG4gICAgICAgIHRoaXMudmVyc2lvbiA9IHRoaXMucGFja2FnZUpzb24udmVyc2lvbjtcbiAgICAgICAgdGhpcy5zdGF0dXMgPSBcIm9rXCI7XG4gICAgICAgIHRoaXMubGljZW5zZSA9IHRoaXMucGFja2FnZUpzb24ubGljZW5zZTtcbiAgICAgICAgaWYgKHRoaXMucGFja2FnZUpzb24ucmVwb3NpdG9yeSl7XG4gICAgICAgICAgICB0aGlzLmdpdCA9IHBsdWdpbnMuc21hcnRzdHJpbmcuZ2l0KHRoaXMucGFja2FnZUpzb24ucmVwb3NpdG9yeS51cmwsb3B0aW9uc0FyZy5naXRBY2Nlc3NUb2tlbik7XG4gICAgICAgIH07XG5cbiAgICB9XG59XG5cbmV4cG9ydCA9IFByb2plY3RpbmZvTlBNOyJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==

5
dist/projectinfo.plugins.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
import "typings-global";
export declare let path: any;
export declare let Q: any;
export import smartfile = require("smartfile");
export import smartstring = require("smartstring");

View File

@ -1,10 +1,8 @@
/// <reference path="./typings/main.d.ts" /> "use strict";
var plugins = { require("typings-global");
path: require("path"), exports.path = require("path");
Q: require("q"), exports.Q = require("q");
smartfile: require("smartfile"), exports.smartfile = require("smartfile");
smartstring: require("smartstring") exports.smartstring = require("smartstring");
};
module.exports = plugins;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInByb2plY3RpbmZvLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsNENBQTRDO0FBQzVD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vbnRlbnQiOlsiaW1wb3J0IFwidHlwaW5ncy1nbG9iYWxcIlxuZXhwb3J0IGxldCBwYXRoID0gcmVxdWlyZShcInBhdGhcIik7XG5leHBvcnQgbGV0IFEgPSAgcmVxdWlyZShcInFcIik7XG5leHBvcnQgaW1wb3J0IHNtYXJ0ZmlsZSA9IHJlcXVpcmUoXCJzbWFydGZpbGVcIik7XG5leHBvcnQgaW1wb3J0IHNtYXJ0c3RyaW5nID0gcmVxdWlyZShcInNtYXJ0c3RyaW5nXCIpOyJdfQ==

View File

@ -3,6 +3,7 @@
"version": "1.0.2", "version": "1.0.2",
"description": "gather information about projects. supports npm, git etc.", "description": "gather information about projects. supports npm, git etc.",
"main": "dist/index.js", "main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": { "scripts": {
"test": "(npmts)" "test": "(npmts)"
}, },
@ -25,7 +26,8 @@
"homepage": "https://gitlab.com/pushrocks/projectinfo#readme", "homepage": "https://gitlab.com/pushrocks/projectinfo#readme",
"devDependencies": { "devDependencies": {
"npmts": "^5.2.5", "npmts": "^5.2.5",
"should": "^9.0.0" "should": "^9.0.0",
"typings-test": "^1.0.1"
}, },
"dependencies": { "dependencies": {
"q": "^1.4.1", "q": "^1.4.1",

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

@ -0,0 +1 @@
import "typings-test";

View File

@ -1,4 +1,5 @@
/// <reference path="../ts/typings/main.d.ts" /> "use strict";
require("typings-test");
var projectinfo = require("../dist/index.js"); var projectinfo = require("../dist/index.js");
var should = require("should"); var should = require("should");
var path = require("path"); var path = require("path");
@ -37,4 +38,4 @@ describe("projectinfo", function () {
}); });
}); });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0RBQWdEO0FBQ2hELElBQUksV0FBVyxHQUFHLE9BQU8sQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO0FBQzlDLElBQU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46XCJzb21ldG9rZW5cIn0pO1xuICAgICAgICBpdChcInNob3VsZCBoYXZlIC5wYWNrYWdlSnNvblwiLGZ1bmN0aW9uKCl7XG4gICAgICAgICAgICBteU5wbS5wYWNrYWdlSnNvblxuICAgICAgICAgICAgICAgLnNob3VsZC5oYXZlLnByb3BlcnR5KFwidmVyc2lvblwiLFwiMS4wLjBcIik7XG4gICAgICAgICAgICBteU5wbS5wYWNrYWdlSnNvblxuICAgICAgICAgICAgICAgLnNob3VsZC5oYXZlLnByb3BlcnR5KFwibmFtZVwiLFwidGVzdHBhY2thZ2VcIik7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGl0KFwic2hvdWxkIGhhdmUgLnZlcnNpb25cIixmdW5jdGlvbigpe1xuICAgICAgICAgICAgbXlOcG1cbiAgICAgICAgICAgICAgICAuc2hvdWxkLmhhdmUucHJvcGVydHkoXCJ2ZXJzaW9uXCIsXCIxLjAuMFwiKVxuICAgICAgICB9KTtcblxuICAgICAgICBpdChcInNob3VsZCBoYXZlIC5uYW1lXCIsZnVuY3Rpb24oKXtcbiAgICAgICAgICAgIG15TnBtXG4gICAgICAgICAgICAgICAgLnNob3VsZC5oYXZlLnByb3BlcnR5KFwibmFtZVwiLFwidGVzdHBhY2thZ2VcIik7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGl0KFwic2hvdWxkIGhhdmUgLmxpY2Vuc2VcIixmdW5jdGlvbigpe1xuICAgICAgICAgICAgbXlOcG1cbiAgICAgICAgICAgICAgICAuc2hvdWxkLmhhdmUucHJvcGVydHkoXCJsaWNlbnNlXCIsXCJNSVRcIik7XG4gICAgICAgIH0pO1xuICAgICAgICBpdChcInNob3VsZCBoYXZlIC5naXRcIixmdW5jdGlvbigpe1xuICAgICAgICAgICAgbXlOcG0uZ2l0Lmh0dHBzVXJsXG4gICAgICAgICAgICAgICAgLnNob3VsZC5lcXVhbChcImh0dHBzOi8vc29tZXRva2VuQGdpdGh1Yi5jb20vc29tZXVzZXIvc29tZX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gICAgICB9KTtcblxuICAgICAgICBpdChcInNob3VsZCBoYXZlIC5uYW1lXCIsZnVuY3Rpb24oKXtcbiAgICAgICAgICAgIG15TnBtXG4gICAgICAgICAgICAgICAgLnNob3VsZC5oYXZlLnByb3BlcnR5KFwibmFtZVwiLFwidGVzdHBhY2thZ2VcIik7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGl0KFwic2hvdWxkIGhhdmUgLmxpY2Vuc2VcIixmdW5jdGlvbigpe1xuICAgICAgICAgICAgbXlOcG1cbiAgICAgICAgICAgICAgICAuc2hvdWxkLmhhdmUucHJvcGVydHkoXCJsaWNlbnNlXCIsXCJNSVRcIik7XG4gICAgICAgIH0pO1xuICAgICAgICBpdChcInNob3VsZCBoYXZlIC5naXRcIixmdW5jdGlvbigpe1xuICAgICAgICAgICAgbXlOcG0uZ2l0Lmh0dHBzVXJsXG4gICAgICAgICAgICAgICAgLnNob3VsZC5lcXVhbChcImh0dHBzOi8vc29tZXRva2VuQGdpdGh1Yi5jb20vc29tZXVzZXIvc29tZXJlcG8uZ2l0XCIpO1xuICAgICAgICB9KTtcblxuICAgIH0pO1xuXG4gICAgZGVzY3JpYmUoXCIuZ2V0TmFtZSgpXCIsZnVuY3Rpb24oKXtcbiAgICAgICAgaXQoXCJzaG91bGQgcmV0dXJuIGEgbmFtZVwiLGZ1bmN0aW9uKCl7XG4gICAgICAgICAgICBwcm9qZWN0aW5mby5nZXROYW1lKHRlc3RCYXNlUGF0aClcbiAgICAgICAgICAgICAgICAuc2hvdWxkLmVxdWFsKFwidGVzdHBhY2thZ2VcIik7XG4gICAgICAgIH0pO1xuICAgIH0pXG59KTsiXX0=

View File

@ -1,4 +1,4 @@
/// <reference path="../ts/typings/main.d.ts" /> import "typings-test";
var projectinfo = require("../dist/index.js"); var projectinfo = require("../dist/index.js");
var should = require("should"); var should = require("should");
var path = require("path"); var path = require("path");

View File

@ -1,6 +1,5 @@
import "typings-global" import "typings-global"
import plugins = require("./projectinfo.plugins"); import plugins = require("./projectinfo.plugins");
var projectinfo:any = {};
//npm //npm
import {ProjectinfoNpm} from "./projectinfo.classes.npm"; import {ProjectinfoNpm} from "./projectinfo.classes.npm";
@ -10,8 +9,8 @@ export let npm = function(cwdArg,optionsArg){
}; };
//quick functions //quick functions
projectinfo.getName = function(cwdArg){ export let getName = function(cwdArg){
var localNpm = projectinfo.npm(cwdArg); var localNpm = new ProjectinfoNpm(cwdArg);
if (localNpm.status === "ok"){ if (localNpm.status === "ok"){
return localNpm.name; return localNpm.name;
} }

View File

@ -9,18 +9,19 @@ export class ProjectinfoNpm {
git; git;
constructor(cwdArg:string,optionsArg:{gitAccessToken?:string} = {}){ constructor(cwdArg:string,optionsArg:{gitAccessToken?:string} = {}){
this.packageJson = plugins.smartfile.readFileToObject( this.packageJson = plugins.smartfile.local.toObjectSync(
plugins.path.join( plugins.path.join(
plugins.path.resolve(cwdArg), plugins.path.resolve(cwdArg),
"package.json" "package.json"
) ),
"json"
); );
this.name = this.packageJson.name; this.name = this.packageJson.name;
this.version = this.packageJson.version; this.version = this.packageJson.version;
this.status = "ok"; this.status = "ok";
this.license = this.packageJson.license; this.license = this.packageJson.license;
if (this.packageJson.repository){ if (this.packageJson.repository){
this.git = plugins.smartstring.git(this.packageJson.repository.url,optionsArg.gitAccessToken); this.git = new plugins.smartstring.GitRepo(this.packageJson.repository.url,optionsArg.gitAccessToken);
}; };
}; };

View File

@ -1,9 +1,5 @@
import "typings-global" import "typings-global"
var plugins = { export let path = require("path");
path: require("path"), export let Q = require("q");
Q: require("q"), export import smartfile = require("smartfile");
smartfile: require("smartfile"), export import smartstring = require("smartstring");
smartstring: require("smartstring")
};
export = plugins;