feat(core): new tools scope

This commit is contained in:
Philipp Kunz 2018-06-07 22:41:25 +02:00
parent 82b6654b94
commit f01e275044
29 changed files with 1841 additions and 1406 deletions

View File

@ -3,66 +3,125 @@ image: hosttoday/ht-docker-node:npmci
cache:
paths:
- .yarn/
- .npmci_cache/
key: "$CI_BUILD_STAGE"
stages:
- security
- test
- release
- trigger
- pages
- metadata
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
tags:
- docker
- notpriv
snyk:
stage: security
script:
- npmci command npm install -g snyk
- npmci command npm install --ignore-scripts
- npmci command snyk test
tags:
- docker
- notpriv
# ====================
# test stage
# ====================
testLEGACY:
stage: test
script:
- npmci test legacy
- npmci node install legacy
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
allow_failure: true
testLTS:
stage: test
script:
- npmci test lts
- npmci node install lts
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
testSTABLE:
stage: test
script:
- npmci test stable
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
release:
stage: release
script:
- npmci publish
- npmci node install stable
- npmci npm publish
only:
- tags
tags:
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
image: docker:stable
allow_failure: true
services:
- docker:stable-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts:
paths: [codeclimate.json]
tags:
- docker
- priv
trigger:
stage: trigger
stage: metadata
script:
- npmci trigger
only:
- tags
tags:
- docker
- notpriv
pages:
image: hosttoday/ht-docker-node:npmci
stage: pages
stage: metadata
script:
- npmci command yarn global add npmpage
- npmci command npm install -g npmpage
- npmci command npmpage
tags:
- docker
- notpriv
only:
- tags
artifacts:

View File

@ -1,13 +1,16 @@
# npmg
setup your environment with the most important tools and update them easily.
## Availabililty
[![npm](https://gitzone.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/npmg)
[![git](https://gitzone.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/gitzone/npmg)
[![git](https://gitzone.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/gitzone/npmg)
[![docs](https://gitzone.gitlab.io/assets/repo-button-docs.svg)](https://gitzone.gitlab.io/npmg/)
## Status for master
[![build status](https://GitLab.com/gitzone/npmg/badges/master/build.svg)](https://GitLab.com/gitzone/npmg/commits/master)
[![coverage report](https://GitLab.com/gitzone/npmg/badges/master/coverage.svg)](https://GitLab.com/gitzone/npmg/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/npmg.svg)](https://www.npmjs.com/package/npmg)
@ -19,11 +22,12 @@ setup your environment with the most important tools and update them easily.
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage
Use TypeScript for best in class instellisense.
For further information read the linked docs at the top of this README.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://gitzone.gitlab.io/assets/repo-footer.svg)](https://git.zone)

4
bin/cli.js Normal file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env node
import * as tsrun from 'tsrun';
process.env.CLI_CALL = 'true';
require("../index.ts");

3
dist/cli.js vendored
View File

@ -1,3 +0,0 @@
#!/usr/bin/env node
process.env.CLI_CALL = 'true'
var index = require("../dist/index.js");

0
dist/index.d.ts vendored
View File

5
dist/index.js vendored
View File

@ -1,5 +0,0 @@
"use strict";
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
View File

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

20
dist/npmg.cli.js vendored
View File

@ -1,20 +0,0 @@
"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");
const npmgInstall = require("./npmg.install");
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* () {
npmgInstall.install('default');
}));
npmgSmartcli.startParse();
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtZy5jbGkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9ucG1nLmNsaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsMENBQXlDO0FBQ3pDLDhDQUE2QztBQUU3QyxJQUFJLFlBQVksR0FBRyxJQUFJLE9BQU8sQ0FBQyxRQUFRLENBQUMsUUFBUSxFQUFFLENBQUE7QUFFdkMsUUFBQSxHQUFHLEdBQUc7SUFDZixZQUFZLENBQUMsVUFBVSxDQUFDLFNBQVMsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFPLE9BQU87UUFDcEQsV0FBVyxDQUFDLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FBQTtJQUNoQyxDQUFDLENBQUEsQ0FBQyxDQUFBO0lBQ0YsWUFBWSxDQUFDLFVBQVUsRUFBRSxDQUFBO0FBQzNCLENBQUMsQ0FBQSxDQUFBIn0=

View File

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

36
dist/npmg.install.js vendored
View File

@ -1,36 +0,0 @@
"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");
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':
yield installExec(packageLibrary.default);
break;
default:
plugins.beautylog.warn('no set has been specified');
break;
}
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtZy5pbnN0YWxsLmpzIiwic291cmNlUm9vdCI6IiIsInN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BTyxhQUFxQjtJQUMvQyxNQUFNLENBQUMsQ0FBQyxhQUFhLENBQUMsQ0FBQyxDQUFDO1FBQ3RCLEtBQUssU0FBUztZQUNaLE1BQU0sV0FBVyxDQUFDLGNBQWMsQ0FBQyxPQUFPLENBQUMsQ0FBQTtZQUN6QyxLQUFLLENBQUE7UUFDUDtZQUNFLE9BQU8sQ0FBQyxTQUFTLENBQUMsSUFBSSxDQUFDLDJCQUEyQixDQUFDLENBQUM7WUFDcEQsS0FBSyxDQUFBO0lBQ1QsQ0FBQztBQUNILENBQUMsQ0FBQSxDQUFBIn0=

View File

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

5
dist/npmg.paths.js vendored
View File

@ -1,5 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./npmg.plugins");
exports.packageBase = plugins.path.join('__dirname', '../');
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtZy5wYXRocy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWcucGF0aHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSwwQ0FBMkM7QUFFaEMsUUFBQSxXQUFXLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsV0FBVyxFQUFFLEtBQUssQ0FBQyxDQUFBIn0=

14
dist/npmg.plugins.js vendored
View File

@ -1,14 +0,0 @@
"use strict";
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

View File

@ -1,13 +1,16 @@
# npmg
setup your environment with the most important tools and update them easily.
## Availabililty
[![npm](https://gitzone.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/npmg)
[![git](https://gitzone.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/gitzone/npmg)
[![git](https://gitzone.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/gitzone/npmg)
[![docs](https://gitzone.gitlab.io/assets/repo-button-docs.svg)](https://gitzone.gitlab.io/npmg/)
## Status for master
[![build status](https://GitLab.com/gitzone/npmg/badges/master/build.svg)](https://GitLab.com/gitzone/npmg/commits/master)
[![coverage report](https://GitLab.com/gitzone/npmg/badges/master/coverage.svg)](https://GitLab.com/gitzone/npmg/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/npmg.svg)](https://www.npmjs.com/package/npmg)
@ -19,6 +22,7 @@ setup your environment with the most important tools and update them easily.
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage
Use TypeScript for best in class instellisense.
To install the package type
@ -36,6 +40,6 @@ npmg install
For further information read the linked docs at the top of this README.
> MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://gitzone.gitlab.io/assets/repo-footer.svg)](https://git.zone)

View File

@ -5,6 +5,7 @@
"npmci": {
"globalNpmTools": [
"npmts"
]
],
"npmAccessLevel": "public"
}
}

1678
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,16 @@
{
"name": "npmg",
"name": "@gitzone/tools",
"version": "1.0.9",
"private": true,
"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 --notest && node ./dist/cli.js install)"
"test": "tsrun test/test.ts",
"build": "echo \"Not needed for now\""
},
"bin": {
"npmg": "dist/cli.js"
"gtools": "bin/cli.js"
},
"repository": {
"type": "git",
@ -30,11 +32,12 @@
"tapbundle": "^1.0.13"
},
"dependencies": {
"@gitzone/tsrun": "^1.0.4",
"@pushrocks/smartcli": "^3.0.1",
"@types/node": "^10.3.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"
"smartshell": "^1.0.6"
}
}

View File

@ -1,11 +1,10 @@
{
"default":[
"npm-check-updates",
"npmdocker",
"npmts",
"gitzone",
"browser-sync",
"@gitzone/npmdocker",
"@gitzone/npmts",
"@gitzone/gitzone",
"typescript",
"tslint"
"tslint",
"@gitzone/tsrun"
]
}

View File

@ -1,12 +1,12 @@
import { expect, tap } from 'tapbundle'
import { expect, tap } from 'tapbundle';
import * as npmgInstall from '../dist/npmg.install'
import * as smartenv from 'smartenv'
import * as npmgInstall from '../ts/tools.install';
import * as smartenv from 'smartenv';
let environment = new smartenv.Smartenv()
let environment = new smartenv.Smartenv();
tap.test("should install default list globally when parsed 'default' as argument", async () => {
await npmgInstall.install('default')
})
await npmgInstall.install('default');
});
tap.start()
tap.start();

View File

@ -1,3 +1,2 @@
import plugins = require("./npmg.plugins");
import * as cli from './npmg.cli'
cli.run()
import plugins = require('./tools.plugins');
import * as cli from './tools.cli';

View File

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

View File

@ -1,30 +0,0 @@
import plugins = require('./npmg.plugins');
import paths = require('./npmg.paths');
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')
);
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
}
}

View File

@ -1,3 +0,0 @@
import plugins = require('./npmg.plugins');
export let packageBase = plugins.path.join('__dirname', '../')

View File

@ -1,14 +0,0 @@
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
}

11
ts/tools.cli.ts Normal file
View File

@ -0,0 +1,11 @@
import * as plugins from './tools.plugins';
import * as toolsInstall from './tools.install';
let npmgSmartcli = new plugins.smartcli.Smartcli();
npmgSmartcli.addCommand('install').subscribe(async argvArg => {
toolsInstall.install('default');
});
npmgSmartcli.addVersion('no version set');
npmgSmartcli.startParse();

30
ts/tools.install.ts Normal file
View File

@ -0,0 +1,30 @@
import plugins = require('./tools.plugins');
import paths = require('./tools.paths');
const 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}`);
plugins.beautylog.log(`Installing ${packageName}`);
}
await plugins.smartshell.exec(`npm install -g ${installString}`);
};
let packageLibrary = plugins.smartfile.fs.toObjectSync(
plugins.path.join(paths.packageBase, 'package_library.json')
);
export const install = async (packageSetArg: String) => {
switch (packageSetArg) {
case 'default':
await installExec(packageLibrary.default);
break;
default:
plugins.beautylog.warn('no set has been specified');
break;
}
};

3
ts/tools.paths.ts Normal file
View File

@ -0,0 +1,3 @@
import plugins = require('./tools.plugins');
export let packageBase = plugins.path.join('__dirname', '../');

View File

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

1217
yarn.lock

File diff suppressed because it is too large Load Diff