Compare commits

..

No commits in common. "master" and "v0.0.1" have entirely different histories.

21 changed files with 2271 additions and 2032 deletions

23
.gitignore vendored
View File

@ -1,19 +1,10 @@
.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/
# custom #npm devug
npm-debug.log
ts/*.js
ts/*.js.map

View File

@ -1,150 +0,0 @@
# 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

16
.travis.yml Normal file
View File

@ -0,0 +1,16 @@
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,4 +1,6 @@
Copyright (c) 2019 Lossless GmbH (hello@lossless.com) The MIT License (MIT)
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
@ -17,3 +19,4 @@ 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,26 +1,2 @@
# @pushrocks/smartcheck # smartcheck
easy checks for web and services assemble checks for nice console output
## 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)

33
index.js Normal file
View File

@ -0,0 +1,33 @@
/// <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 () {
for (var check in this.checks) {
var localTable = beautylog.table.new("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;

View File

@ -1,20 +0,0 @@
{
"gitzone": {
"module": {
"githost": "code.foss.global",
"gitscope": "push.rocks",
"gitrepo": "smartcheck",
"shortDescription": "easy checks for web and services",
"npmPackagename": "@push.rocks/smartcheck",
"license": "MIT",
"projectDomain": "push.rocks"
}
},
"npmci": {
"npmGlobalTools": [],
"npmAccessLevel": "public"
},
"tsdocs": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
}
}

1763
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +1,35 @@
{ {
"name": "@push.rocks/smartcheck", "name": "smartcheck",
"version": "1.0.2", "version": "0.0.1",
"private": false, "description": "Make sure gulp and gulp-taypescript from npm are available. Then run the gulpfile in this directory.",
"description": "easy checks for web and services", "main": "index.js",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"author": "Lossless GmbH",
"license": "MIT",
"scripts": { "scripts": {
"test": "(tstest test/)", "test": "(cd ts/compile && node compile.js) && (node test.js)",
"build": "(tsbuild)", "reinstall": "(rm -r node_modules && npm install)",
"format": "(gitzone format)" "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",
"bugs": {
"url": "https://github.com/pushrocks/smartcheck/issues"
},
"homepage": "https://github.com/pushrocks/smartcheck",
"dependencies": {
"beautylog": "^1.0.4",
"pushrocks": "^1.0.23"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.0.22", "gulp": "3.9.0",
"@gitzone/tstest": "^1.0.15", "gulp-typescript": "2.9.2"
"@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"
} }
} }

7
test.js Normal file
View File

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

27
ts/classes.ts Normal file
View File

@ -0,0 +1,27 @@
/// <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() {
for (var check in this.checks){
var localTable = beautylog.table.new("checks");
localTable.push([this.checks[check].name,this.checks[check].result]);
localTable.print();
}
}
}

30
ts/compile/compile.js Normal file
View File

@ -0,0 +1,30 @@
// 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']);

2
ts/compile/readme.md Normal file
View File

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

View File

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

11
ts/test.ts Normal file
View File

@ -0,0 +1,11 @@
/// <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");

12
ts/tsd.json Normal file
View File

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

2079
ts/typings/node/node.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

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

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

View File

@ -1,14 +0,0 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"verbatimModuleSyntax": true
},
"exclude": [
"dist_*/**/*.d.ts"
]
}