Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
33f1e2a181 | |||
cd4f913216 | |||
e62a1d07cd | |||
be76a10868 | |||
0cf330baf0 | |||
5b250110fc | |||
|
4e9023332d | ||
|
c925cd2e24 |
23
.gitignore
vendored
23
.gitignore
vendored
@ -1,10 +1,19 @@
|
||||
.nogit/
|
||||
|
||||
# artifacts
|
||||
coverage/
|
||||
public/
|
||||
pages/
|
||||
|
||||
# installs
|
||||
node_modules/
|
||||
.settings/
|
||||
.idea/
|
||||
|
||||
# caches and builds
|
||||
.yarn/
|
||||
.cache/
|
||||
dist/
|
||||
dist_web/
|
||||
dist_serve/
|
||||
dist_ts_web/
|
||||
|
||||
#npm devug
|
||||
npm-debug.log
|
||||
|
||||
ts/*.js
|
||||
ts/*.js.map
|
||||
# custom
|
150
.gitlab-ci.yml
Normal file
150
.gitlab-ci.yml
Normal 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
|
16
.travis.yml
16
.travis.yml
@ -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=
|
7
LICENSE
7
LICENSE
@ -1,6 +1,4 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Push.Rocks
|
||||
Copyright (c) 2019 Lossless GmbH (hello@lossless.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -18,5 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
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
|
||||
SOFTWARE.
|
||||
|
||||
SOFTWARE.
|
28
README.md
28
README.md
@ -1,2 +1,26 @@
|
||||
# smartcheck
|
||||
assemble checks for nice console output
|
||||
# @pushrocks/smartcheck
|
||||
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
|
||||
[](https://gitlab.com/pushrocks/smartcheck/commits/master)
|
||||
[](https://gitlab.com/pushrocks/smartcheck/commits/master)
|
||||
[](https://www.npmjs.com/package/@pushrocks/smartcheck)
|
||||
[](https://snyk.io/test/npm/@pushrocks/smartcheck)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](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)
|
||||
|
||||
[](https://maintainedby.lossless.com)
|
||||
|
33
index.js
33
index.js
@ -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;
|
20
npmextra.json
Normal file
20
npmextra.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"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
Normal file
1763
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
51
package.json
51
package.json
@ -1,35 +1,26 @@
|
||||
{
|
||||
"name": "smartcheck",
|
||||
"version": "0.0.2",
|
||||
"description": "Make sure gulp and gulp-taypescript from npm are available. Then run the gulpfile in this directory.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "(cd ts/compile && node compile.js) && (node test.js)",
|
||||
"reinstall": "(rm -r node_modules && npm install)",
|
||||
"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)",
|
||||
"name": "@push.rocks/smartcheck",
|
||||
"version": "1.0.2",
|
||||
"private": false,
|
||||
"description": "easy checks for web and services",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"author": "Lossless GmbH",
|
||||
"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"
|
||||
"scripts": {
|
||||
"test": "(tstest test/)",
|
||||
"build": "(tsbuild)",
|
||||
"format": "(gitzone format)"
|
||||
},
|
||||
"devDependencies": {
|
||||
"gulp": "3.9.0",
|
||||
"gulp-typescript": "2.9.2"
|
||||
"@gitzone/tsbuild": "^2.0.22",
|
||||
"@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"
|
||||
}
|
||||
}
|
||||
}
|
7
test.js
7
test.js
@ -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
8
test/test.ts
Normal 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();
|
@ -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();
|
||||
}
|
||||
}
|
@ -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']);
|
@ -1,2 +0,0 @@
|
||||
# How to compile.
|
||||
Make sure gulp and gulp-taypescript from npm are available. Then run the gulpfile in this directory.
|
18
ts/index.ts
18
ts/index.ts
@ -1,10 +1,10 @@
|
||||
/// <reference path="typings/tsd.d.ts" />
|
||||
/// <reference path="./classes.ts" />
|
||||
var beautylog = require("beautylog")("os");
|
||||
var smartcheck:any = {};
|
||||
import * as plugins from './smartcheck.plugins';
|
||||
|
||||
smartcheck.newStorage = function() {
|
||||
return new CheckStorage;
|
||||
};
|
||||
|
||||
module.exports = smartcheck;
|
||||
/**
|
||||
* smartcheck
|
||||
*/
|
||||
export class Smartcheck {
|
||||
checkServiceStatus() {
|
||||
|
||||
}
|
||||
}
|
||||
|
3
ts/smartcheck.plugins.ts
Normal file
3
ts/smartcheck.plugins.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import * as puppeteer from 'puppeteer';
|
||||
|
||||
export { puppeteer };
|
11
ts/test.ts
11
ts/test.ts
@ -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");
|
||||
|
12
ts/tsd.json
12
ts/tsd.json
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
2079
ts/typings/node/node.d.ts
vendored
2079
ts/typings/node/node.d.ts
vendored
File diff suppressed because it is too large
Load Diff
1
ts/typings/tsd.d.ts
vendored
1
ts/typings/tsd.d.ts
vendored
@ -1 +0,0 @@
|
||||
/// <reference path="node/node.d.ts" />
|
14
tsconfig.json
Normal file
14
tsconfig.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"experimentalDecorators": true,
|
||||
"useDefineForClassFields": false,
|
||||
"target": "ES2022",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"esModuleInterop": true,
|
||||
"verbatimModuleSyntax": true
|
||||
},
|
||||
"exclude": [
|
||||
"dist_*/**/*.d.ts"
|
||||
]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user