This commit is contained in:
Philipp Kunz 2017-05-28 20:03:40 +02:00
parent 939016347d
commit 2e20c5b3cc
26 changed files with 1457 additions and 128 deletions

71
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,71 @@
# gitzone standard
image: hosttoday/ht-docker-node:npmci
cache:
paths:
- .yarn/
key: "$CI_BUILD_STAGE"
stages:
- test
- release
- trigger
- pages
testLEGACY:
stage: test
script:
- npmci test legacy
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
allow_failure: true
testLTS:
stage: test
script:
- npmci test lts
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
testSTABLE:
stage: test
script:
- npmci test stable
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
release:
stage: release
script:
- npmci publish
only:
- tags
tags:
- docker
trigger:
stage: trigger
script:
- npmci trigger
only:
- tags
tags:
- docker
pages:
image: hosttoday/ht-docker-node:npmci
stage: pages
script:
- npmci command yarn global add npmpage
- npmci command npmpage
tags:
- docker
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2016 Git.Zone
Copyright (c) 2016 Lossless GmbH
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

2
dist/cli.js vendored
View File

@ -1,2 +0,0 @@
#!/usr/bin/env node
var index = require("./index.js");

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

11
dist/index.js vendored
View File

@ -1,8 +1,5 @@
"use strict";
var install = require("./npmg.install");
var npmg = {
install: install
};
module.exports = npmg;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFFQSxJQUFPLE9BQU8sV0FBVyxnQkFBZ0IsQ0FBQyxDQUFDO0FBQzNDLElBQUksSUFBSSxHQUFHO0lBQ1AsT0FBTyxFQUFFLE9BQU87Q0FDbkIsQ0FBQztBQUNGLGlCQUFTLElBQUksQ0FBQyIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuL3R5cGluZ3MvbWFpbi5kLnRzXCIgLz5cbmltcG9ydCBwbHVnaW5zID0gcmVxdWlyZShcIi4vbnBtZy5wbHVnaW5zXCIpO1xuaW1wb3J0IGluc3RhbGwgPSByZXF1aXJlKFwiLi9ucG1nLmluc3RhbGxcIik7XG5sZXQgbnBtZyA9IHtcbiAgICBpbnN0YWxsOiBpbnN0YWxsXG59O1xuZXhwb3J0ID0gbnBtZzsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
Object.defineProperty(exports, "__esModule", { value: true });
const cli = require("./npmg.cli");
cli.run();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUNBLGtDQUFpQztBQUNqQyxHQUFHLENBQUMsR0FBRyxFQUFFLENBQUEifQ==

1
dist/npmg.cli.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export declare let run: () => Promise<void>;

20
dist/npmg.cli.js vendored
View File

@ -1,3 +1,17 @@
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJucG1nLmNsaS5qcyIsInNvdXJjZXNDb250ZW50IjpbXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./npmg.plugins");
let npmgSmartcli = new plugins.smartcli.Smartcli();
exports.run = () => __awaiter(this, void 0, void 0, function* () {
npmgSmartcli.addCommand('install').then((argvArg) => __awaiter(this, void 0, void 0, function* () {
}));
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtZy5jbGkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9ucG1nLmNsaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsMENBQXlDO0FBR3pDLElBQUksWUFBWSxHQUFHLElBQUksT0FBTyxDQUFDLFFBQVEsQ0FBQyxRQUFRLEVBQUUsQ0FBQTtBQUV2QyxRQUFBLEdBQUcsR0FBRztJQUNmLFlBQVksQ0FBQyxVQUFVLENBQUMsU0FBUyxDQUFDLENBQUMsSUFBSSxDQUFDLENBQU8sT0FBTztJQUV0RCxDQUFDLENBQUEsQ0FBQyxDQUFBO0FBQ0osQ0FBQyxDQUFBLENBQUEifQ==

1
dist/npmg.install.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export declare let install: (packageSetArg: String) => Promise<void>;

48
dist/npmg.install.js vendored
View File

@ -1,26 +1,36 @@
"use strict";
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmg.plugins");
var paths = require("./npmg.paths");
var installExec = function (packageNames) {
for (var packageName in packageNames) {
var execCommand = "npm install -g " + packageNames[packageName];
plugins.beautylog.info("now installing " + packageNames[packageName]);
plugins.shelljs.exec(execCommand);
}
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var packageLibrary = plugins.smartfile.readFileToObject(plugins.path.join(paths.packageBase, "packageLibrary.json"));
var install = function (packageSetArg) {
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./npmg.plugins");
const paths = require("./npmg.paths");
let installExec = (packageNames) => __awaiter(this, void 0, void 0, function* () {
let installString = '';
for (let packageName of packageNames) {
installString = installString + `${packageName} `;
}
yield plugins.smartshell.exec(`yarn global remove ${installString}`);
for (let packageName of packageNames) {
plugins.beautylog.info(`now preparing ${packageName}`);
yield plugins.smartshell.exec(`yarn global remove ${packageName}`);
}
yield plugins.smartshell.exec(`yarn global add ${installString}`);
});
let packageLibrary = plugins.smartfile.fs.toObjectSync(plugins.path.join(paths.packageBase, 'package_library.json'));
exports.install = (packageSetArg) => __awaiter(this, void 0, void 0, function* () {
switch (packageSetArg) {
case "default":
installExec(packageLibrary.default);
case 'default':
yield installExec(packageLibrary.default);
break;
default:
plugins.beautylog.warn("no set has been specified");
plugins.beautylog.warn('no set has been specified');
break;
}
};
module.exports = install;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWcuaW5zdGFsbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsNENBQTRDO0FBQzVDLElBQU8sT0FBTyxXQUFXLGdCQUFnQixDQUFDLENBQUM7QUFDM0MsSUFBTyxLQUFLLFdBQVcsY0FBYyxDQUFDLENBQUM7QUFDdkMsSUFBSSxXQUFXLEdBQUcsVUFBUyxZQUFxQjtJQUM1QyxHQUFHLENBQUMsQ0FBQyxJQUFJLFdBQVcsSUFBSSxZQUFZLENBQUMsQ0FBQSxDQUFDO1FBQ2xDLElBQUksV0FBVyxHQUFHLGlCQUFpQixHQUFHLFlBQVksQ0FBQyxXQUFXLENBQUMsQ0FB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xNQUFNLENBQUMsQ0FBQyxhQUFhLENBQUMsQ0FBQyxDQUFDO1FBQ3RCLEtBQUssU0FBUztZQUNaLE1BQU0sV0FBVyxDQUFDLGNBQWMsQ0FBQyxPQUFPLENBQUMsQ0FBQTtZQUN6QyxLQUFLLENBQUE7UUFDUDtZQUNFLE9BQU8sQ0FBQyxTQUFTLENBQUMsSUFBSSxDQUFDLDJCQUEyQixDQUFDLENBQUM7WUFDcEQsS0FBSyxDQUFBO0lBQ1QsQ0FBQztBQUNILENBQUMsQ0FBQSxDQUFBIn0=

1
dist/npmg.paths.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export declare let packageBase: string;

12
dist/npmg.paths.js vendored
View File

@ -1,9 +1,5 @@
"use strict";
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmg.plugins");
var paths = {
packageBase: plugins.path.join("__dirname", "../")
};
module.exports = paths;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWcucGF0aHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDRDQUE0QztBQUM1QyxJQUFPLE9BQU8sV0FBVyxnQkFBZ0IsQ0FBQyxDQUFDO0FBQzNDLElBQUksS0FBSyxHQUFHO0lBQ1IsV0FBVyxFQUFFLE9BQU8sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFdBQVcsRUFBQyxLQUFLLENBQUM7Q0FDcEQsQ0FBQTtBQUNELGlCQUFTLEtBQUssQ0FBQyIsImZpbGUiOiJucG1nLnBhdGhzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vdHlwaW5ncy9tYWluLmQudHNcIiAvPlxuaW1wb3J0IHBsdWdpbnMgPSByZXF1aXJlKFwiLi9ucG1nLnBsdWdpbnNcIik7XG5sZXQgcGF0aHMgPSB7XG4gICAgcGFja2FnZUJhc2U6IHBsdWdpbnMucGF0aC5qb2luKFwiX19kaXJuYW1lXCIsXCIuLi9cIilcbn1cbmV4cG9ydCA9IHBhdGhzOyJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./npmg.plugins");
exports.packageBase = plugins.path.join('__dirname', '../');
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtZy5wYXRocy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWcucGF0aHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSwwQ0FBMkM7QUFFaEMsUUFBQSxXQUFXLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsV0FBVyxFQUFFLEtBQUssQ0FBQyxDQUFBIn0=

7
dist/npmg.plugins.d.ts vendored Normal file
View File

@ -0,0 +1,7 @@
import 'typings-global';
import * as beautylog from 'beautylog';
import * as path from 'path';
import * as smartcli from 'smartcli';
import * as smartfile from 'smartfile';
import * as smartshell from 'smartshell';
export { beautylog, path, smartcli, smartfile, smartshell };

20
dist/npmg.plugins.js vendored
View File

@ -1,8 +1,14 @@
"use strict";
/// <reference path="./typings/main.d.ts" />
exports.beautylog = require("beautylog");
exports.path = require("path");
exports.shelljs = require("shelljs");
exports.smartfile = require("smartfile");
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWcucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsNENBQTRDO0FBQ2pDLGlCQUFTLEdBQUcsT0FBTyxDQUFDLFdBQVcsQ0FBQyxDQUFDO0FBQ2pDLFlBQUksR0FBRyxPQUFPLENBQUMsTUFBTSxDQUFDLENBQUM7QUFDcEIsZUFBTyxXQUFXLFNBQVMsQ0FBQyxDQUFDO0FBQ2hDLGlCQUFTLEdBQUcsT0FBTyxDQUFDLFdBQVcsQ0FBQyxDQUFDIiwiZmlsZSI6Im5wbWcucGx1Z2lucy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuL3R5cGluZ3MvbWFpbi5kLnRzXCIgLz5cbmV4cG9ydCBsZXQgYmVhdXR5bG9nID0gcmVxdWlyZShcImJlYXV0eWxvZ1wiKTtcbmV4cG9ydCBsZXQgcGF0aCA9IHJlcXVpcmUoXCJwYXRoXCIpO1xuZXhwb3J0IGltcG9ydCBzaGVsbGpzID0gcmVxdWlyZShcInNoZWxsanNcIik7XG5leHBvcnQgbGV0IHNtYXJ0ZmlsZSA9IHJlcXVpcmUoXCJzbWFydGZpbGVcIik7XG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
Object.defineProperty(exports, "__esModule", { value: true });
require("typings-global");
const beautylog = require("beautylog");
exports.beautylog = beautylog;
const path = require("path");
exports.path = path;
const smartcli = require("smartcli");
exports.smartcli = smartcli;
const smartfile = require("smartfile");
exports.smartfile = smartfile;
const smartshell = require("smartshell");
exports.smartshell = smartshell;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtZy5wbHVnaW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvbnBtZy5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsMEJBQXVCO0FBQ3ZCLHVDQUFzQztBQU9wQyw4QkFBUztBQU5YLDZCQUE0QjtBQU8xQixvQkFBSTtBQU5OLHFDQUFvQztBQU9sQyw0QkFBUTtBQU5WLHVDQUFzQztBQU9wQyw4QkFBUztBQU5YLHlDQUF3QztBQU90QyxnQ0FBVSJ9

10
npmextra.json Normal file
View File

@ -0,0 +1,10 @@
{
"npmts": {
"cli": true
},
"npmci": {
"globalNpmTools": [
"npmts"
]
}
}

View File

@ -3,6 +3,7 @@
"version": "1.0.4",
"description": "setup your environment with the most important tools and update them easily.",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"test": "(npmts)"
},
@ -26,14 +27,14 @@
},
"homepage": "https://github.com/GitZoneTools/npmg#readme",
"devDependencies": {
"npmts": "^3.5.0",
"smartenv": "^1.2.0"
"tapbundle": "^1.0.13"
},
"dependencies": {
"beautylog": "^3.1.2",
"q": "^1.4.1",
"shelljs": "^0.6.0",
"smartcli": "0.0.11",
"smartfile": "1.0.1"
"beautylog": "^6.1.10",
"smartcli": "^2.0.7",
"smartenv": "^3.0.0",
"smartfile": "4.2.17",
"smartshell": "^1.0.6",
"typings-global": "^1.0.16"
}
}

View File

@ -3,6 +3,9 @@
"npm-check-updates",
"npmdocker",
"npmts",
"gitzone"
"gitzone",
"browser-sync",
"typescript",
"tslint"
]
}

View File

@ -1,17 +0,0 @@
/// <reference path="../ts/typings/main.d.ts" />
var npmg = require("../dist/index.js");
var smartenv = require("smartenv");
var environment = smartenv.getEnv();
describe("npmg", function () {
describe(".install()", function () {
it("should install default list globally when parsed 'default' as argument", function () {
if (environment.isC9 || environment.isCI) {
this.timeout(60000);
npmg.install("default");
}
;
});
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0RBQWdEO0FBQ2hELElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO0FBQ3ZDLElBQUksUUFBUSxHQUFHLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQztBQUNuQyxJQUFJLFdBQVcsR0FBRyxRQUFRLENBQUMsTUFBTSxFQUFFLENBQUM7QUFHaEMsUUFBUSxDQUFDLE1BQU0sRUFBQztJQUNaLFFBQVEsQ0FBQyxZQUFZLEVBQUM7UUFDbEIsRUFBRSxDQUFDLHdFQUF3RSxFQUFDO1lBQ3hFLEVBQUUsQ0FBQyxDQ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Jzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==

View File

@ -1 +0,0 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,IAAI,IAAI,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AACvC,IAAI,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACnC,IAAI,WAAW,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC;AAGhC,QAAQ,CAAC,MAAM,EAAC;IACZ,QAAQ,CAAC,YAAY,EAAC;QAClB,EAAE,CAAC,wEAAwE,EAAC;YACxE,EAAE,CAAC,CAAC,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,IAAI,CAAC,CAAA,CAAC;gBACtC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBACpB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAC5B,CAAC;YAAA,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAC"}

View File

@ -1,16 +1,12 @@
/// <reference path="../ts/typings/main.d.ts" />
let npmg = require("../dist/index.js");
let smartenv = require("smartenv");
let environment = smartenv.getEnv();
import { expect, tap } from 'tapbundle'
import * as npmgInstall from '../dist/npmg.install'
import * as smartenv from 'smartenv'
describe("npmg",function(){
describe(".install()",function(){
it("should install default list globally when parsed 'default' as argument",function(){
if (environment.isC9 || environment.isCI){
this.timeout(60000);
npmg.install("default");
};
});
})
});
let environment = new smartenv.Smartenv()
tap.test("should install default list globally when parsed 'default' as argument", async () => {
await npmgInstall.install('default')
})
tap.start()

View File

@ -1,7 +1,3 @@
/// <reference path="./typings/main.d.ts" />
import plugins = require("./npmg.plugins");
import install = require("./npmg.install");
let npmg = {
install: install
};
export = npmg;
import * as cli from './npmg.cli'
cli.run()

View File

@ -0,0 +1,10 @@
import * as plugins from './npmg.plugins'
import * as install from './npmg.install'
let npmgSmartcli = new plugins.smartcli.Smartcli()
export let run = async () => {
npmgSmartcli.addCommand('install').then(async (argvArg) => {
})
}

View File

@ -1,27 +1,30 @@
/// <reference path="./typings/main.d.ts" />
import plugins = require("./npmg.plugins");
import paths = require("./npmg.paths");
let installExec = function(packageNames:string[]){
for (let packageName in packageNames){
let execCommand = "npm install -g " + packageNames[packageName];
plugins.beautylog.info("now installing " + packageNames[packageName]);
plugins.shelljs.exec(execCommand);
};
};
import plugins = require('./npmg.plugins');
import paths = require('./npmg.paths');
let packageLibrary = plugins.smartfile.readFileToObject(
plugins.path.join(paths.packageBase,"packageLibrary.json")
let installExec = async (packageNames: string[]) => {
let installString = ''
for (let packageName of packageNames) {
installString = installString + `${packageName} `
}
await plugins.smartshell.exec(`yarn global remove ${installString}`)
for (let packageName of packageNames) {
plugins.beautylog.info(`now preparing ${packageName}`)
await plugins.smartshell.exec(`yarn global remove ${packageName}`)
}
await plugins.smartshell.exec(`yarn global add ${installString}`)
}
let packageLibrary = plugins.smartfile.fs.toObjectSync(
plugins.path.join(paths.packageBase, 'package_library.json')
);
let install = function(packageSetArg:String){
switch (packageSetArg){
case "default":
installExec(packageLibrary.default);
break;
export let install = async (packageSetArg: String) => {
switch (packageSetArg) {
case 'default':
await installExec(packageLibrary.default)
break
default:
plugins.beautylog.warn("no set has been specified");
break;
plugins.beautylog.warn('no set has been specified');
break
}
};
export = install;
}

View File

@ -1,6 +1,3 @@
/// <reference path="./typings/main.d.ts" />
import plugins = require("./npmg.plugins");
let paths = {
packageBase: plugins.path.join("__dirname","../")
}
export = paths;
import plugins = require('./npmg.plugins');
export let packageBase = plugins.path.join('__dirname', '../')

View File

@ -1,5 +1,14 @@
/// <reference path="./typings/main.d.ts" />
export let beautylog = require("beautylog");
export let path = require("path");
export import shelljs = require("shelljs");
export let smartfile = require("smartfile");
import 'typings-global'
import * as beautylog from 'beautylog'
import * as path from 'path'
import * as smartcli from 'smartcli'
import * as smartfile from 'smartfile'
import * as smartshell from 'smartshell'
export {
beautylog,
path,
smartcli,
smartfile,
smartshell
}

3
tslint.json Normal file
View File

@ -0,0 +1,3 @@
{
"extends": "tslint-config-standard"
}

1217
yarn.lock Normal file

File diff suppressed because it is too large Load Diff