fix(core): update

This commit is contained in:
Philipp Kunz 2019-03-02 23:10:32 +01:00
parent 4e9023332d
commit 5b250110fc
21 changed files with 2032 additions and 2271 deletions

23
.gitignore vendored
View File

@ -1,10 +1,19 @@
.nogit/
# artifacts
coverage/
public/
pages/
# installs
node_modules/ node_modules/
.settings/
.idea/
# caches and builds
.yarn/
.cache/
dist/
dist_web/
dist_serve/
dist_ts_web/
#npm devug # custom
npm-debug.log
ts/*.js
ts/*.js.map

150
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,150 @@
# gitzone standard
image: hosttoday/ht-docker-node:npmci
cache:
paths:
- .npmci_cache/
key: "$CI_BUILD_STAGE"
stages:
- security
- test
- release
- metadata
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
tags:
- docker
- notpriv
snyk:
stage: security
script:
- npmci npm prepare
- npmci command npm install -g snyk
- npmci command npm install --ignore-scripts
- npmci command snyk test
tags:
- docker
- notpriv
sast:
stage: security
image: registry.gitlab.com/hosttoday/ht-docker-dbase:npmci
variables:
DOCKER_DRIVER: overlay2
allow_failure: true
services:
- docker:stable-dind
script:
- npmci npm prepare
- npmci npm install
- npmci command npm run build
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SAST_CONFIDENCE_LEVEL="${SAST_CONFIDENCE_LEVEL:-3}"
--volume "$PWD:/code"
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/sast:$SP_VERSION" /app/bin/run /code
artifacts:
reports:
sast: gl-sast-report.json
tags:
- docker
- priv
# ====================
# test stage
# ====================
testLTS:
stage: test
script:
- npmci npm prepare
- npmci node install lts
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
testSTABLE:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
release:
stage: release
script:
- 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: metadata
script:
- npmci trigger
only:
- tags
tags:
- docker
- notpriv
pages:
image: hosttoday/ht-docker-node:npmci
stage: metadata
script:
- npmci command npm install -g typedoc typescript
- npmci npm prepare
- npmci npm install
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
tags:
- docker
- notpriv
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true

View File

@ -1,16 +0,0 @@
language: node_js
node_js:
- '4.1'
before_install:
- npm install -g tsd
deploy:
provider: npm
email: npm@smart-coordination.com
api_key:
secure: A5ivaeFNGrPLSsbavHy8vZF74Ey+SMKkhd/3PY4FUQld6WDaKyVprT5PeVzmK41DSlyguR1QxBuLZ9vOz6ogNwO/+rVOjAz0oElKP1/XIGyPmUmtc2IEPzU8ijkERbxzswXodhUt42ro9lA7Du4Y4ofcc91GEgyWcCWUG/zu5zS1xrvjz794kMh41tLpzjN8vLDjxXF4+nievgvrUo0k/yd2OiflibGhykY+svmoI9u5ISSzC13FFClWCRov13cpq/sJ/L8kTL0IshgdJ8aRvfs35qf5mrL8X6aYDj2drOPWvnDRlHV7RXHsUhQxnDPKICgi7vsO+dyktcflmM7Em58TxWKho0bmUFHW/A2ntDXSzCSos5NI8Qw5KMVmiDDgAIvmiy3MctDQDbkPLP6OdthKPRAt9GFwCh9QYE3WvbUblZeoKTcXivhsTiHlYn8u/F1dmswxYpwGpSs0Cjg0Eb+6aP1A//wnbwgE1UywR0njil4Lcth0PFMCUkPmtMLLXbHmW0rCb8gjRYjMu1TzVKv5VGdF1a4rBFUwZK6y7ZxvrsohMPfKJhStBCmbWscYHvoNWsnVx5buIylQky6GGnjX3iD8KXDPLntAR661CXbK76bCSwj8iv+fK3vUUqExmp1cNQsSF64AYlFxf7E6Qkkt3E8vlPN2FMYcpEuJnLk=
on:
tags: true
repo: pushrocks/smartcheck
notifications:
slack:
secure: f5Uss0z9RPl/QcA/DroB8loyE93aOYI6bqCkrsiUscmZtlv/TVQtT4dxqGA6uvcG6iTQDBi3Ul88dQxWkRm4IqbhY35/iMaV2dHW4FVYMAh8GQMbsfL2sALCcufxD9blw47awv3iFcwhV1EeyesscjgL0JIjduk96v/7G/6QIO2838M1lzlgtj+kRUkim8qkaEs1je3gRrhMUIjLuAdscMXyUKYFMjWo9ACSjVUl30R/ZNemb18itIja6i92GotreBgcfEMczvy58ovDC7xdJUsY8LjMI01DwY+WPRnI0tAhsuI8moBwwcdM4e3bAjKjucQRjO33O5bMWRZ6QCiYd0DnCEFyCPQLJ4GSy/tkD00n8ijLHAOSV3AH1zNbdK1EAdSPQXDvlI36KJn/2hyQLoitGHVUPr76ujJWP82ypO2tgIp3XQU0dJVCxDuHnwJO2+hjdI+gCPqxNTpjeujHx3UdkTGNRjuuf9dlZ/D08fApjYxy2fxItTqo3QjP/nrqvBXUOPP8yPHpjIT4H2t5Pr4SJjBGI6X4qhKyFj6s9rA/Xu1rL+45zu1C3uC3z+u3T9UwrbzJ/cZM6r6UQvQmUvIfBNaMlg4I/diQCDIPL+Rhop2nylY3IcHmJnk2itn7kOqj1tohCpFEml5pRuSZy4udWywkdtyBAsHWFLF7oiQ=

View File

@ -1,6 +1,4 @@
The MIT License (MIT) Copyright (c) 2019 Lossless GmbH (hello@lossless.com)
Copyright (c) 2015 Push.Rocks
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -19,4 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.

View File

@ -1,2 +1,26 @@
# smartcheck # @pushrocks/smartcheck
assemble checks for nice console output easy checks for web and services
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartcheck)
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartcheck)
* [github.com (source mirror)](https://github.com/pushrocks/smartcheck)
* [docs (typedoc)](https://pushrocks.gitlab.io/smartcheck/)
## Status for master
[![build status](https://gitlab.com/pushrocks/smartcheck/badges/master/build.svg)](https://gitlab.com/pushrocks/smartcheck/commits/master)
[![coverage report](https://gitlab.com/pushrocks/smartcheck/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smartcheck/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/smartcheck.svg)](https://www.npmjs.com/package/@pushrocks/smartcheck)
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartcheck/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartcheck)
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)
## Usage
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)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://maintainedby.lossless.com)

View File

@ -1,33 +0,0 @@
/// <reference path="./index.ts" />
var Check = (function () {
function Check(nameArg, resultArg) {
this.name = nameArg;
this.result = resultArg;
}
return Check;
})();
var CheckStorage = (function () {
function CheckStorage() {
this.checks = [];
}
CheckStorage.prototype.addCheck = function (name, result) {
var localCheck = new Check(name, result);
this.checks.push(localCheck);
};
CheckStorage.prototype.print = function () {
var localTable = beautylog.table.new("checks");
for (var check in this.checks) {
localTable.push([this.checks[check].name, this.checks[check].result]);
}
localTable.print();
};
return CheckStorage;
})();
/// <reference path="typings/tsd.d.ts" />
/// <reference path="./classes.ts" />
var beautylog = require("beautylog")("os");
var smartcheck = {};
smartcheck.newStorage = function () {
return new CheckStorage;
};
module.exports = smartcheck;

17
npmextra.json Normal file
View File

@ -0,0 +1,17 @@
{
"gitzone": {
"module": {
"githost": "gitlab.com",
"gitscope": "pushrocks",
"gitrepo": "smartcheck",
"shortDescription": "easy checks for web and services",
"npmPackagename": "@pushrocks/smartcheck",
"license": "MIT",
"projectDomain": "push.rocks"
}
},
"npmci": {
"npmGlobalTools": [],
"npmAccessLevel": "public"
}
}

1763
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,35 +1,26 @@
{ {
"name": "smartcheck", "name": "@pushrocks/smartcheck",
"version": "0.0.2", "version": "1.0.1",
"description": "Make sure gulp and gulp-taypescript from npm are available. Then run the gulpfile in this directory.", "private": false,
"main": "index.js", "description": "easy checks for web and services",
"scripts": { "main": "dist/index.js",
"test": "(cd ts/compile && node compile.js) && (node test.js)", "typings": "dist/index.d.ts",
"reinstall": "(rm -r node_modules && npm install)", "author": "Lossless GmbH",
"release": "(npm test) && (git pull origin master && npm version patch && git push origin master && git checkout release && git merge master && git push origin release && git checkout master)",
"startdev": "(git checkout master && git pull origin master)"
},
"repository": {
"type": "git",
"url": "https://github.com/pushrocks/smartcheck.git"
},
"keywords": [
"json",
"jade",
"template"
],
"author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)",
"license": "MIT", "license": "MIT",
"bugs": { "scripts": {
"url": "https://github.com/pushrocks/smartcheck/issues" "test": "(tstest test/)",
}, "build": "(tsbuild)",
"homepage": "https://github.com/pushrocks/smartcheck", "format": "(gitzone format)"
"dependencies": {
"beautylog": "^1.0.4",
"pushrocks": "^1.0.23"
}, },
"devDependencies": { "devDependencies": {
"gulp": "3.9.0", "@gitzone/tsbuild": "^2.0.22",
"gulp-typescript": "2.10.0" "@gitzone/tstest": "^1.0.15",
"@pushrocks/tapbundle": "^3.0.7",
"@types/node": "^10.11.7",
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.15.0"
},
"dependencies": {
"puppeteer": "^1.12.2"
} }
} }

View File

@ -1,7 +0,0 @@
/// <reference path="typings/tsd.d.ts" />
var smartcheck = require("./index.js");
var pr = require("pushrocks");
var myCheckStorage = smartcheck.newStorage();
myCheckStorage.addCheck("Check1", "success");
myCheckStorage.print();
pr.beautylog.success("success");

8
test/test.ts Normal file
View File

@ -0,0 +1,8 @@
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartcheck from '../ts/index';
tap.test('first test', async () => {
console.log(smartcheck.standardExport);
});
tap.start();

View File

@ -1,27 +0,0 @@
/// <reference path="./index.ts" />
class Check {
name:string;
result:string;
constructor(nameArg:string,resultArg:string){
this.name = nameArg;
this.result = resultArg;
}
}
class CheckStorage {
checks:Check[];
constructor() {
this.checks = [];
}
addCheck(name:string,result:string){
var localCheck = new Check(name,result);
this.checks.push(localCheck);
}
print() {
var localTable = beautylog.table.new("checks");
for (var check in this.checks){
localTable.push([this.checks[check].name,this.checks[check].result]);
}
localTable.print();
}
}

View File

@ -1,30 +0,0 @@
// import gulp
var gulp = require("gulp")
var gulpTypescript = require("gulp-typescript");
var pr = require("pushrocks");
gulp.task('compileTS', function() {
var stream = gulp.src('../index.ts')
.pipe(gulpTypescript({
out: "index.js"
}))
.pipe(gulp.dest("../../"));
return stream;
});
gulp.task('compileTestTS', function() {
var stream = gulp.src('../test.ts')
.pipe(gulpTypescript({
out: "test.js"
}))
.pipe(gulp.dest("../../"));
return stream;
});
gulp.task('default',['compileTS','compileTestTS'], function() {
pr.beautylog.success('Typescript compiled');
});
//lets tell gulp to start with the default task.
pr.beautylog.log('Starting Gulp to compile TypeScript');
gulp.start.apply(gulp, ['default']);

View File

@ -1,2 +0,0 @@
# How to compile.
Make sure gulp and gulp-taypescript from npm are available. Then run the gulpfile in this directory.

View File

@ -1,10 +1,10 @@
/// <reference path="typings/tsd.d.ts" /> import * as plugins from './smartcheck.plugins';
/// <reference path="./classes.ts" />
var beautylog = require("beautylog")("os");
var smartcheck:any = {};
smartcheck.newStorage = function() { /**
return new CheckStorage; * smartcheck
}; */
export class Smartcheck {
checkServiceStatus() {
module.exports = smartcheck; }
}

3
ts/smartcheck.plugins.ts Normal file
View File

@ -0,0 +1,3 @@
import * as puppeteer from 'puppeteer';
export { puppeteer };

View File

@ -1,11 +0,0 @@
/// <reference path="typings/tsd.d.ts" />
var smartcheck = require("./index.js");
var pr = require("pushrocks");
var myCheckStorage = smartcheck.newStorage();
myCheckStorage.addCheck("Check1","success");
myCheckStorage.print();
pr.beautylog.success("success");

View File

@ -1,12 +0,0 @@
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "master",
"path": "typings",
"bundle": "typings/tsd.d.ts",
"installed": {
"node/node.d.ts": {
"commit": "efa0c1196d7280640e624ac1e7fa604502e7bd63"
}
}
}

File diff suppressed because it is too large Load Diff

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

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

17
tslint.json Normal file
View File

@ -0,0 +1,17 @@
{
"extends": ["tslint:latest", "tslint-config-prettier"],
"rules": {
"semicolon": [true, "always"],
"no-console": false,
"ordered-imports": false,
"object-literal-sort-keys": false,
"member-ordering": {
"options":{
"order": [
"static-method"
]
}
}
},
"defaultSeverity": "warning"
}