fix(core): update

This commit is contained in:
Philipp Kunz 2019-09-10 18:03:33 +02:00
parent 7433c1dba4
commit d559b0f402
12 changed files with 59 additions and 396 deletions

21
.gitignore vendored
View File

@ -1,3 +1,22 @@
node_modules/ .nogit/
# artifacts
coverage/ coverage/
public/ public/
pages/
# installs
node_modules/
# caches
.yarn/
.cache/
.rpt2_cache
# builds
dist/
dist_web/
dist_serve/
dist_ts_web/
# custom

View File

@ -1,5 +1,5 @@
# gitzone standard # gitzone ci_default
image: hosttoday/ht-docker-node:npmci image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache: cache:
paths: paths:
@ -34,48 +34,11 @@ snyk:
- docker - docker
- notpriv - 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 # test stage
# ==================== # ====================
testLTS: testStable:
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 stage: test
script: script:
- npmci npm prepare - npmci npm prepare
@ -85,6 +48,18 @@ testSTABLE:
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
- priv
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv - notpriv
release: release:
@ -103,19 +78,11 @@ release:
# ==================== # ====================
codequality: codequality:
stage: metadata stage: metadata
image: docker:stable
allow_failure: true allow_failure: true
services:
- docker:stable-dind
script: script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') - npmci command npm install -g tslint typescript
- docker run - npmci npm install
--env SOURCE_CODE="$PWD" - npmci command "tslint -c tslint.json ./ts/**/*.ts"
--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: tags:
- docker - docker
- priv - priv
@ -131,13 +98,15 @@ trigger:
- notpriv - notpriv
pages: pages:
image: hosttoday/ht-docker-node:npmci image: hosttoday/ht-docker-dbase:npmci
services:
- docker:stable-dind
stage: metadata stage: metadata
script: script:
- npmci command npm install -g typedoc typescript - npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare - npmci npm prepare
- npmci npm install - npmci npm install
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/ - npmci command tsdoc
tags: tags:
- docker - docker
- notpriv - notpriv

1
dist/index.d.ts vendored
View File

@ -1 +0,0 @@
export * from './smartscaf.classes.smartscaf';

7
dist/index.js vendored
View File

@ -1,7 +0,0 @@
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./smartscaf.classes.smartscaf"));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLG1EQUE4QyJ9

View File

@ -1,74 +0,0 @@
import { Smartfile } from '@pushrocks/smartfile';
export interface ScafTemplateContructorOptions {
name?: string;
description?: string;
sourceDir?: string;
}
export declare class ScafTemplate {
static createTemplateFromDir(): Promise<void>;
/**
* the name of the template
*/
name: string;
/**
* the descriptions of the template
*/
description: string;
/**
* the location on disk of the template
*/
dirPath: string;
/**
* the files of the template as array of Smartfiles
*/
templateSmartfileArray: Smartfile[];
requiredVariables: string[];
defaultVariables: any;
suppliedVariables: any;
missingVariables: string[];
constructor(dirPathArg: string);
/**
* read a template from a directory
*/
readTemplateFromDir(): Promise<void>;
/**
* supply the variables to render the teplate with
* @param variablesArg gets merged with this.suppliedVariables
*/
supplyVariables(variablesArg: any): Promise<void>;
/**
* Will ask for the missing variables by cli interaction
*/
askCliForMissingVariables(): Promise<void>;
/**
* writes a file to disk
* @param destinationDirArg
*/
writeToDisk(destinationDirArg: any): Promise<void>;
/**
* finds all variables in a Template in as string
* e.g. myobject.someKey and myobject.someOtherKey
*/
private _findVariablesInTemplate;
/**
* checks if supplied Variables satisfy the template
*/
private _checkSuppliedVariables;
/**
* checks the smartscaf.yml default values at the root of a template
* allows 2 ways of notation in YAML:
* >> myObject.myKey.someDeeperKey: someValue
* >> myObject.yourKey.yourDeeperKey: yourValue
* or
* >> myObject:
* >> - someKey:
* >> - someDeeperKey: someValue
* >> - yourKey:
* >> - yourDeeperKey: yourValue
*/
private _checkDefaultVariables;
/**
* resolve template dependencies
*/
private _resolveTemplateDependencies;
}

File diff suppressed because one or more lines are too long

View File

@ -1,4 +0,0 @@
/**
* adds a variable in string dot notation to an already more or less expanded object
*/
export declare let deepAddToObject: (objectArg: any, varStringArg: string, valueArg: string) => Promise<void>;

View File

@ -1,35 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* adds a variable in string dot notation to an already more or less expanded object
*/
exports.deepAddToObject = async (objectArg, varStringArg, valueArg) => {
let varNamesArray = varStringArg.split('.');
let referencePointer = objectArg;
for (let i = 0; i !== varNamesArray.length; i++) {
let varName = varNamesArray[i];
// is there a next variable ?
let varNameNext = (() => {
if (varNamesArray[i + 1]) {
return varNamesArray[i + 1];
}
return null;
})();
// build the tree in suppliedVariables
if (!referencePointer[varName] && !varNameNext) {
referencePointer[varName] = valueArg;
referencePointer = null;
}
else if (!referencePointer[varName] && varNameNext) {
referencePointer[varName] = {};
referencePointer = referencePointer[varName];
}
else if (referencePointer[varName] && varNameNext) {
referencePointer = referencePointer[varName];
}
else {
throw new Error('Something is strange!');
}
}
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzY2FmLmhlbHBlcnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydHNjYWYuaGVscGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBOztHQUVHO0FBQ1EsUUFBQSxlQUFlLEdBQUcsS0FBSyxFQUFFLFNBQVMsRUFBRSxZQUFvQixFQUFFLFFBQWdCLEVBQUUsRUFBRTtJQUN2RixJQUFJLGFBQWEsR0FBRyxZQUFZLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFDO0lBQzVDLElBQUksZ0JBQWdCLEdBQUcsU0FBUyxDQUFDO0lBQ2pDLEtBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsS0FBSyxhQUFhLENBQUMsTUFBTSxFQUFFLENBQUMsRUFBRSxFQUFFO1FBQy9DLElBQUksT0FBTyxHQUFHLGFBQWEsQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUUvQiw2QkFBNkI7UUFDN0IsSUFBSSxXQUFXLEdBQVcsQ0FBQyxHQUFHLEVBQUU7WUFDOUIsSUFBSSxhQUFhLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxFQUFFO2dCQUN4QixPQUFPLGFBQWEsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUM7YUFDN0I7WUFDRCxPQUFPLElBQUksQ0FBQztRQUNkLENBQUMsQ0FBQyxFQUFFLENBQUM7UUFFTCxzQ0FBc0M7UUFDdEMsSUFBSSxDQUFDLGdCQUFnQixDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsV0FBVyxFQUFFO1lBQzlDLGdCQUFnQixDQUFDLE9BQU8sQ0FBQyxHQUFHLFFBQVEsQ0FBQztZQUNyQyxnQkFBZ0IsR0FBRyxJQUFJLENBQUM7U0FDekI7YUFBTSxJQUFJLENBQUMsZ0JBQWdCLENBQUMsT0FBTyxDQUFDLElBQUksV0FBVyxFQUFFO1lBQ3BELGdCQUFnQixDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQUUsQ0FBQztZQUMvQixnQkFBZ0IsR0FBRyxnQkFBZ0IsQ0FBQyxPQUFPLENBQUMsQ0FBQztTQUM5QzthQUFNLElBQUksZ0JBQWdCLENBQUMsT0FBTyxDQUFDLElBQUksV0FBVyxFQUFFO1lBQ25ELGdCQUFnQixHQUFHLGdCQUFnQixDQUFDLE9BQU8sQ0FBQyxDQUFDO1NBQzlDO2FBQU07WUFDTCxNQUFNLElBQUksS0FBSyxDQUFDLHVCQUF1QixDQUFDLENBQUM7U0FDMUM7S0FDRjtBQUNILENBQUMsQ0FBQyJ9

View File

@ -1,9 +0,0 @@
import * as path from 'path';
import * as lik from '@pushrocks/lik';
import * as smartfile from '@pushrocks/smartfile';
import * as smartfm from '@pushrocks/smartfm';
import * as smarthbs from '@pushrocks/smarthbs';
import * as smartinteract from '@pushrocks/smartinteract';
import * as smartq from '@pushrocks/smartpromise';
import * as smartyaml from '@pushrocks/smartyaml';
export { path, lik, smartfile, smartfm, smarthbs, smartinteract, smartq, smartyaml };

View File

@ -1,26 +0,0 @@
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const path = __importStar(require("path"));
exports.path = path;
const lik = __importStar(require("@pushrocks/lik"));
exports.lik = lik;
const smartfile = __importStar(require("@pushrocks/smartfile"));
exports.smartfile = smartfile;
const smartfm = __importStar(require("@pushrocks/smartfm"));
exports.smartfm = smartfm;
const smarthbs = __importStar(require("@pushrocks/smarthbs"));
exports.smarthbs = smarthbs;
const smartinteract = __importStar(require("@pushrocks/smartinteract"));
exports.smartinteract = smartinteract;
const smartq = __importStar(require("@pushrocks/smartpromise"));
exports.smartq = smartq;
const smartyaml = __importStar(require("@pushrocks/smartyaml"));
exports.smartyaml = smartyaml;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzY2FmLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydHNjYWYucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7QUFBQSwyQ0FBNkI7QUFTcEIsb0JBQUk7QUFSYixvREFBc0M7QUFRdkIsa0JBQUc7QUFQbEIsZ0VBQWtEO0FBTzlCLDhCQUFTO0FBTjdCLDREQUE4QztBQU1mLDBCQUFPO0FBTHRDLDhEQUFnRDtBQUtSLDRCQUFRO0FBSmhELHdFQUEwRDtBQUlSLHNDQUFhO0FBSC9ELGdFQUFrRDtBQUdlLHdCQUFNO0FBRnZFLGdFQUFrRDtBQUV1Qiw4QkFBUyJ9

View File

@ -39,5 +39,16 @@
"@pushrocks/smartinteract": "^2.0.4", "@pushrocks/smartinteract": "^2.0.4",
"@pushrocks/smartpromise": "^3.0.2", "@pushrocks/smartpromise": "^3.0.2",
"@pushrocks/smartyaml": "^2.0.3" "@pushrocks/smartyaml": "^2.0.3"
} },
"files": [
"ts/*",
"ts_web/*",
"dist/*",
"dist_web/*",
"dist_ts_web/*",
"assets/*",
"cli.js",
"npmextra.json",
"readme.md"
]
} }

View File

@ -14,7 +14,7 @@ scaffold projects quickly
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartscaf/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartscaf) [![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartscaf/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartscaf)
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) [![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/) [![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-standard-brightgreen.svg)](http://standardjs.com/) [![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)
## Usage ## Usage
@ -30,6 +30,6 @@ For further information read the linked docs at the top of this README.
For further information read the linked docs at the top of this readme. For further information read the linked docs at the top of this readme.
> MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh) > 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)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://maintainedby.lossless.com) [![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)