fix(core): update

This commit is contained in:
Philipp Kunz 2019-01-27 18:55:38 +01:00
parent 25871fc970
commit 400e228ffc
6 changed files with 695 additions and 197 deletions

View File

@ -26,6 +26,7 @@ mirror:
snyk:
stage: security
script:
- npmci npm prepare
- npmci command npm install -g snyk
- npmci command npm install --ignore-scripts
- npmci command snyk test
@ -33,24 +34,39 @@ snyk:
- 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
# ====================
testLEGACY:
stage: test
script:
- 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 npm prepare
- npmci node install lts
- npmci npm install
- npmci npm test
@ -62,6 +78,7 @@ testLTS:
testSTABLE:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
@ -118,6 +135,7 @@ pages:
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:
@ -130,13 +148,3 @@ pages:
paths:
- public
allow_failure: true
windowsCompatibility:
image: stefanscherer/node-windows:10-build-tools
stage: metadata
script:
- npm install & npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- windows
allow_failure: true

775
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -26,21 +26,21 @@
"npm"
],
"devDependencies": {
"@gitzone/tsbuild": "^2.0.22",
"@gitzone/tsrun": "^1.1.12",
"@gitzone/tstest": "^1.0.15",
"@pushrocks/tapbundle": "^3.0.5",
"@types/node": "^10.9.2"
"@gitzone/tsbuild": "^2.1.6",
"@gitzone/tsrun": "^1.1.17",
"@gitzone/tstest": "^1.0.18",
"@pushrocks/tapbundle": "^3.0.7",
"@types/node": "^10.12.18"
},
"dependencies": {
"@pushrocks/lik": "^3.0.1",
"@pushrocks/smartfile": "^6.0.8",
"@pushrocks/lik": "^3.0.4",
"@pushrocks/smartfile": "^6.0.12",
"@pushrocks/smartfm": "^2.0.1",
"@pushrocks/smarthbs": "^2.0.0",
"@pushrocks/smartinteract": "^2.0.4",
"@pushrocks/smartpromise": "^2.0.5",
"@pushrocks/smartyaml": "^2.0.3",
"@types/lodash": "^4.14.72",
"lodash": "^4.17.4"
"@types/lodash": "^4.14.120",
"lodash": "^4.17.11"
}
}

View File

@ -3,7 +3,7 @@ import * as path from 'path';
import * as smartscaf from '../ts/index';
process.env.CI = 'true'
process.env.CI = 'true';
let testScafTemplate: smartscaf.ScafTemplate;

View File

@ -11,9 +11,7 @@ export interface ScafTemplateContructorOptions {
}
export class ScafTemplate {
static async createTemplateFromDir() {
}
static async createTemplateFromDir() {}
/**
* the name of the template
@ -102,7 +100,7 @@ export class ScafTemplate {
const smartfileArrayToWrite: Smartfile[] = [];
for (let smartfile of this.templateSmartfileArray) {
// lets filter out template files
if(smartfile.path === '.smartscaf.yml') {
if (smartfile.path === '.smartscaf.yml') {
continue;
}
@ -112,7 +110,7 @@ export class ScafTemplate {
// handle frontmatter
const smartfmInstance = new plugins.smartfm.Smartfm({
fmType: "yaml"
fmType: 'yaml'
});
let parsedTemplate = smartfmInstance.parse(renderedTemplateString) as any;
if (parsedTemplate.data.fileName) {
@ -192,7 +190,7 @@ export class ScafTemplate {
// safeguard against non existent defaults
if (!this.defaultVariables) {
console.log('this template does not specify defaults')
console.log('this template does not specify defaults');
this.defaultVariables = {};
}
}
@ -204,25 +202,32 @@ export class ScafTemplate {
const smartscafSmartfile = this.templateSmartfileArray.find(smartfileArg => {
return smartfileArg.parsedPath.base === '.smartscaf.yml';
});
if(!smartscafSmartfile) {
if (!smartscafSmartfile) {
console.log('No further template dependencies defined!');
return;
}
console.log('Found template dependencies! Resolving them now!');
console.log('looking at templates to merge!');
const smartscafYamlObject = await plugins.smartyaml.yamlStringToObject(smartscafSmartfile.contentBuffer.toString());
if(!smartscafYamlObject) {
const smartscafYamlObject = await plugins.smartyaml.yamlStringToObject(
smartscafSmartfile.contentBuffer.toString()
);
if (!smartscafYamlObject) {
console.log('Something seems strange about the supplied dependencies.yml file.');
return;
}
for (const dependency of smartscafYamlObject.dependencies.merge) {
console.log(`Now resolving ${dependency}`);
const templatePathToMerge = plugins.path.join(this.dirPath, dependency);
if(!plugins.smartfile.fs.isDirectory(templatePathToMerge)) {
console.log(`dependency ${dependency} resolves to ${templatePathToMerge} which ist NOT a directory`);
if (!plugins.smartfile.fs.isDirectory(templatePathToMerge)) {
console.log(
`dependency ${dependency} resolves to ${templatePathToMerge} which ist NOT a directory`
);
continue;
};
const templateSmartfileArray = await plugins.smartfile.fs.fileTreeToObject(templatePathToMerge, '**/*');
}
const templateSmartfileArray = await plugins.smartfile.fs.fileTreeToObject(
templatePathToMerge,
'**/*'
);
this.templateSmartfileArray = this.templateSmartfileArray.concat(templateSmartfileArray);
}
}

View File

@ -1,3 +1,17 @@
{
"extends": "tslint-config-standard"
"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"
}