From e4c2d86dbca5a2da292b64e00c29c2e5f0117c02 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Fri, 31 Jan 2020 14:51:05 +0000 Subject: [PATCH] fix(core): update --- .gitlab-ci.yml | 84 ++++++++++++----------- .vscode/settings.json | 8 ++- npmextra.json | 1 + package-lock.json | 110 +++++++++++++++--------------- package.json | 23 ++++--- readme.md | 6 +- ts/interfaces/index.ts | 2 +- ts/interfaces/smartscaf.ts | 4 +- ts/smartscaf.classes.smartscaf.ts | 7 +- ts/smartscaf.helpers.ts | 33 --------- ts/smartscaf.plugins.ts | 16 ++++- 11 files changed, 146 insertions(+), 148 deletions(-) delete mode 100644 ts/smartscaf.helpers.ts diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0b92fd3..a95dfb6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,14 +3,14 @@ image: registry.gitlab.com/hosttoday/ht-docker-node:npmci cache: paths: - - .npmci_cache/ - key: "$CI_BUILD_STAGE" + - .npmci_cache/ + key: '$CI_BUILD_STAGE' stages: -- security -- test -- release -- metadata + - security + - test + - release + - metadata # ==================== # security stage @@ -18,21 +18,23 @@ stages: mirror: stage: security script: - - npmci git mirror + - npmci git mirror tags: - - docker - - notpriv + - lossless + - docker + - notpriv snyk: + image: registry.gitlab.com/hosttoday/ht-docker-node: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 + - lossless + - docker + - notpriv # ==================== # test stage @@ -41,37 +43,40 @@ snyk: testStable: stage: test script: - - npmci npm prepare - - npmci node install stable - - npmci npm install - - npmci npm test + - npmci npm prepare + - npmci node install stable + - npmci npm install + - npmci npm test coverage: /\d+.?\d+?\%\s*coverage/ tags: - - docker - - priv + - lossless + - docker + - priv testBuild: stage: test script: - - npmci npm prepare - - npmci node install stable - - npmci npm install - - npmci command npm run build + - npmci npm prepare + - npmci node install stable + - npmci npm install + - npmci command npm run build coverage: /\d+.?\d+?\%\s*coverage/ tags: - - docker - - notpriv + - lossless + - docker + - notpriv release: stage: release script: - - npmci node install stable - - npmci npm publish + - npmci node install stable + - npmci npm publish only: - - tags + - tags tags: - - docker - - notpriv + - lossless + - docker + - notpriv # ==================== # metadata stage @@ -85,30 +90,31 @@ codequality: - npmci npm install - npmci command "tslint -c tslint.json ./ts/**/*.ts" tags: - - docker - - priv + - lossless + - docker + - priv trigger: stage: metadata script: - - npmci trigger + - npmci trigger only: - - tags + - tags tags: - - docker - - notpriv + - lossless + - docker + - notpriv pages: - image: hosttoday/ht-docker-dbase:npmci - services: - - docker:stable-dind stage: metadata script: + - npmci node install lts - npmci command npm install -g @gitzone/tsdoc - npmci npm prepare - npmci npm install - npmci command tsdoc tags: + - lossless - docker - notpriv only: @@ -116,5 +122,5 @@ pages: artifacts: expire_in: 1 week paths: - - public + - public allow_failure: true diff --git a/.vscode/settings.json b/.vscode/settings.json index 6763058..01d2b8d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -11,7 +11,13 @@ }, "gitzone": { "type": "object", - "description": "settings for gitzone" + "description": "settings for gitzone", + "properties": { + "projectType": { + "type": "string", + "enum": ["website", "element", "service", "npm"] + } + } } } } diff --git a/npmextra.json b/npmextra.json index 6a5dba8..363edb9 100644 --- a/npmextra.json +++ b/npmextra.json @@ -7,6 +7,7 @@ "npmAccessLevel": "public" }, "gitzone": { + "projectType": "npm", "module": { "githost": "gitlab.com", "gitscope": "pushrocks", diff --git a/package-lock.json b/package-lock.json index 01c9aa7..c2489a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,18 +5,18 @@ "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.5.5", - "resolved": "https://verdaccio.lossless.one/@babel%2fcode-frame/-/code-frame-7.5.5.tgz", - "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "version": "7.8.3", + "resolved": "https://verdaccio.lossless.one/@babel%2fcode-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", "dev": true, "requires": { - "@babel/highlight": "^7.0.0" + "@babel/highlight": "^7.8.3" } }, "@babel/highlight": { - "version": "7.5.0", - "resolved": "https://verdaccio.lossless.one/@babel%2fhighlight/-/highlight-7.5.0.tgz", - "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", + "version": "7.8.3", + "resolved": "https://verdaccio.lossless.one/@babel%2fhighlight/-/highlight-7.8.3.tgz", + "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", "dev": true, "requires": { "chalk": "^2.0.0", @@ -104,17 +104,27 @@ } }, "@pushrocks/lik": { - "version": "3.0.11", - "resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-3.0.11.tgz", - "integrity": "sha512-SDKRPj9+xBTqozlDPcA7O6BcccM1Tw/sXPVP+OnhNxCubDZ/L2kGNpPpqm43NJUoNxSSo5wdBw4N7MAFYCGdVg==", + "version": "3.0.13", + "resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-3.0.13.tgz", + "integrity": "sha512-YDxYoh2UksEfUxcjSjTwLsW5j852E5FrMG62CUi1I7ZpBxf96b7P1t2pRWsQsNnHRz6FHckW/A1V6XKASB+jZA==", "requires": { - "@pushrocks/smartdelay": "^2.0.3", - "@pushrocks/smartpromise": "^3.0.2", - "@pushrocks/smartrx": "^2.0.3", + "@pushrocks/smartdelay": "^2.0.6", + "@pushrocks/smartpromise": "^3.0.6", + "@pushrocks/smartrx": "^2.0.5", "@pushrocks/smarttime": "^3.0.12", "@types/minimatch": "^3.0.3", "minimatch": "^3.0.4", "symbol-tree": "^3.2.4" + }, + "dependencies": { + "@pushrocks/smartdelay": { + "version": "2.0.6", + "resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartdelay/-/smartdelay-2.0.6.tgz", + "integrity": "sha512-4wUnzWNhRPODpaaL5GuRaje/C5dg+TMhBxmr57PKc2fqYpy6azWJwonf/s5xpcbJLCPJRbj1x8M5MqgCFq2uvg==", + "requires": { + "@pushrocks/smartpromise": "^3.0.6" + } + } } }, "@pushrocks/smartcli": { @@ -270,22 +280,13 @@ } }, "@pushrocks/smartparam": { - "version": "1.0.4", - "resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartparam/-/smartparam-1.0.4.tgz", - "integrity": "sha512-UAqhnTQGBaJRptTK3qTd47Yt2ZTrAWByteow4auSNZD+k0xrpY9mTPPgKh0IwsURe0cZhj7zYNpGiekhKkL4rA==", - "dev": true, + "version": "1.1.3", + "resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartparam/-/smartparam-1.1.3.tgz", + "integrity": "sha512-4cO5WCzjwNe59bAmcAzlUvQfhqEL5UGNOkQ/yvutQjRBVRFNLsHrxRYOMm8l0d8DlsM3AED3hS273ONXJ/uRXg==", "requires": { - "@pushrocks/smartpromise": "^2.0.5", + "@pushrocks/smartpromise": "^3.0.6", "is-promise": "^2.1.0", "minimatch": "^3.0.4" - }, - "dependencies": { - "@pushrocks/smartpromise": { - "version": "2.0.5", - "resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-2.0.5.tgz", - "integrity": "sha512-9j/chLtIiNkR0MDw7Mpxg9slxAVvAQwUZuiaPYX5KpHdKxQaHLI1VZ8IN0vPhwlfgNO4i4vGXV0wB8BvSDj03g==", - "dev": true - } } }, "@pushrocks/smartpath": { @@ -354,21 +355,22 @@ } }, "@pushrocks/tapbundle": { - "version": "3.0.13", - "resolved": "https://verdaccio.lossless.one/@pushrocks%2ftapbundle/-/tapbundle-3.0.13.tgz", - "integrity": "sha512-23O4UMBafCuD+RnUlXNvtT9DGbL1HMD+xZE1Zcr7Ll7WvgxUgRQQfk9kq6qbLLbjaRe1J2Ijsgh1HuZbBaucLQ==", + "version": "3.2.0", + "resolved": "https://verdaccio.lossless.one/@pushrocks%2ftapbundle/-/tapbundle-3.2.0.tgz", + "integrity": "sha512-xnKIGe7NJqxWBaFeKIEXShDjV2wap1XJqmlp3m1MKqmIF62vRpZnkzpyE1ZAoNwiYQmIsXIpvP/PDv+iPevPfw==", "dev": true, "requires": { "@pushrocks/early": "^3.0.3", "@pushrocks/smartdelay": "^2.0.3", + "@pushrocks/smartfile": "^7.0.6", "@pushrocks/smartpromise": "^3.0.2", "smartchai": "^2.0.1" } }, "@types/chai": { - "version": "4.2.3", - "resolved": "https://verdaccio.lossless.one/@types%2fchai/-/chai-4.2.3.tgz", - "integrity": "sha512-VRw2xEGbll3ZiTQ4J02/hUjNqZoue1bMhoo2dgM2LXjDdyaq4q80HgBDHwpI0/VKlo4Eg+BavyQMv/NYgTetzA==", + "version": "4.2.8", + "resolved": "https://verdaccio.lossless.one/@types%2fchai/-/chai-4.2.8.tgz", + "integrity": "sha512-U1bQiWbln41Yo6EeHMr+34aUhvrMVyrhn9lYfPSpLTCrZlGxU4Rtn1bocX+0p2Fc/Jkd2FanCEXdw0WNfHHM0w==", "dev": true }, "@types/chai-as-promised": { @@ -443,9 +445,9 @@ "integrity": "sha512-SGGAhXLHDx+PK4YLNcNGa6goPf9XRWQNAUUbffkwVGGXIxmDKWyGGL4inzq2sPmExu431Ekb9aEMn9BkPqEYFA==" }, "@types/luxon": { - "version": "1.15.2", - "resolved": "https://verdaccio.lossless.one/@types%2fluxon/-/luxon-1.15.2.tgz", - "integrity": "sha512-zHPoyVrLvNaiMRYdhmh88Rn489ZgAgbc6iLxR5Yi0VCNfeNYHcszbhJV2vDHLNrVGy35BPtWBRn4OP2F9BBvFw==" + "version": "1.21.0", + "resolved": "https://verdaccio.lossless.one/@types%2fluxon/-/luxon-1.21.0.tgz", + "integrity": "sha512-Zhrf65tpjOlVIYrUhX9eu1VzRo8iixQDLFPbfqFxPpG4pBTNNPZ2BFhYE0IAsDfW9GWg+RcrUqiLwrGJH4rq4w==" }, "@types/minimatch": { "version": "3.0.3", @@ -453,9 +455,9 @@ "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" }, "@types/node": { - "version": "12.7.9", - "resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-12.7.9.tgz", - "integrity": "sha512-P57oKTJ/vYivL2BCfxCC5tQjlS8qW31pbOL6qt99Yrjm95YdHgNZwjrTTjMBh+C2/y6PXIX4oz253+jUzxKKfQ==" + "version": "13.5.3", + "resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-13.5.3.tgz", + "integrity": "sha512-ZPnWX9PW992w6DUsz3JIXHaSb5v7qmKCVzC3km6SxcDGxk7zmLfYaCJTbktIa5NeywJkkZDhGldKqDIvC5DRrA==" }, "@types/rx": { "version": "4.1.1", @@ -821,9 +823,9 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "cron": { - "version": "1.7.2", - "resolved": "https://verdaccio.lossless.one/cron/-/cron-1.7.2.tgz", - "integrity": "sha512-+SaJ2OfeRvfQqwXQ2kgr0Y5pzBR/lijf5OpnnaruwWnmI799JfWr2jN2ItOV9s3A/+TFOt6mxvKzQq5F0Jp6VQ==", + "version": "1.8.2", + "resolved": "https://verdaccio.lossless.one/cron/-/cron-1.8.2.tgz", + "integrity": "sha512-Gk2c4y6xKEO8FSAUTklqtfSr7oTq0CiPQeLBG5Fl0qoXpZyMcj1SG59YL+hqq04bu6/IuEA7lMkYDAplQNKkyg==", "requires": { "moment-timezone": "^0.5.x" } @@ -1212,9 +1214,9 @@ } }, "luxon": { - "version": "1.19.3", - "resolved": "https://verdaccio.lossless.one/luxon/-/luxon-1.19.3.tgz", - "integrity": "sha512-YwTDjGRQC0QC9Iya2g2eKZfgEFqRId4ZoLHORQcfTMB/5xrTx427V7ZPjQJ1vzvhA2vJfG2bh1Kv8V8IFMWCUA==" + "version": "1.22.0", + "resolved": "https://verdaccio.lossless.one/luxon/-/luxon-1.22.0.tgz", + "integrity": "sha512-3sLvlfbFo+AxVEY3IqxymbumtnlgBwjDExxK60W3d+trrUzErNAz/PfvPT+mva+vEUrdIodeCOs7fB6zHtRSrw==" }, "make-error": { "version": "1.3.5", @@ -1304,9 +1306,9 @@ "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==" }, "moment-timezone": { - "version": "0.5.26", - "resolved": "https://verdaccio.lossless.one/moment-timezone/-/moment-timezone-0.5.26.tgz", - "integrity": "sha512-sFP4cgEKTCymBBKgoxZjYzlSovC20Y6J7y3nanDc5RoBIXKlZhoYwBoZGe3flwU6A372AcRwScH8KiwV6zjy1g==", + "version": "0.5.27", + "resolved": "https://verdaccio.lossless.one/moment-timezone/-/moment-timezone-0.5.27.tgz", + "integrity": "sha512-EIKQs7h5sAsjhPCqN6ggx6cEbs94GK050254TIJySD1bzoM5JTYDwAU1IoVOeTOL6Gm27kYJ51/uuvq1kIlrbw==", "requires": { "moment": ">= 2.9.0" } @@ -1505,9 +1507,9 @@ "dev": true }, "resolve": { - "version": "1.12.0", - "resolved": "https://verdaccio.lossless.one/resolve/-/resolve-1.12.0.tgz", - "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", + "version": "1.15.0", + "resolved": "https://verdaccio.lossless.one/resolve/-/resolve-1.15.0.tgz", + "integrity": "sha512-+hTmAldEGE80U2wJJDC1lebb5jWqvTYAfm3YZ1ckk1gBr0MnCqUKlwK1e+anaFljIl+F5tR5IoZcm4ZDA1zMQw==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -1729,9 +1731,9 @@ "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==" }, "tslint": { - "version": "5.20.0", - "resolved": "https://verdaccio.lossless.one/tslint/-/tslint-5.20.0.tgz", - "integrity": "sha512-2vqIvkMHbnx8acMogAERQ/IuINOq6DFqgF8/VDvhEkBqQh/x6SP0Y+OHnKth9/ZcHQSroOZwUQSN18v8KKF0/g==", + "version": "6.0.0", + "resolved": "https://verdaccio.lossless.one/tslint/-/tslint-6.0.0.tgz", + "integrity": "sha512-9nLya8GBtlFmmFMW7oXXwoXS1NkrccqTqAtwXzdPV9e2mqSEvCki6iHL/Fbzi5oqbugshzgGPk7KBb2qNP1DSA==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -1745,7 +1747,7 @@ "mkdirp": "^0.5.1", "resolve": "^1.3.2", "semver": "^5.3.0", - "tslib": "^1.8.0", + "tslib": "^1.10.0", "tsutils": "^2.29.0" } }, diff --git a/package.json b/package.json index 54f826d..7e88f92 100644 --- a/package.json +++ b/package.json @@ -28,30 +28,31 @@ "@gitzone/tsbuild": "^2.1.17", "@gitzone/tsrun": "^1.2.8", "@gitzone/tstest": "^1.0.28", - "@pushrocks/tapbundle": "^3.0.13", - "@types/node": "^12.7.9", - "tslint": "^5.20.0", + "@pushrocks/tapbundle": "^3.2.0", + "@types/node": "^13.5.3", + "tslint": "^6.0.0", "tslint-config-prettier": "^1.18.0" }, "dependencies": { - "@pushrocks/lik": "^3.0.11", + "@pushrocks/lik": "^3.0.13", "@pushrocks/smartfile": "^7.0.6", "@pushrocks/smartfm": "^2.0.4", "@pushrocks/smarthbs": "^2.0.8", "@pushrocks/smartinteract": "^2.0.4", + "@pushrocks/smartparam": "^1.1.3", "@pushrocks/smartpromise": "^3.0.6", "@pushrocks/smartshell": "^2.0.25", "@pushrocks/smartyaml": "^2.0.3" }, "files": [ - "ts/*", - "ts_web/*", - "dist/*", - "dist_web/*", - "dist_ts_web/*", - "assets/*", + "ts/**/*", + "ts_web/**/*", + "dist/**/*", + "dist_web/**/*", + "dist_ts_web/**/*", + "assets/**/*", "cli.js", "npmextra.json", "readme.md" ] -} +} \ No newline at end of file diff --git a/readme.md b/readme.md index 41bcb4e..3f6d1c5 100644 --- a/readme.md +++ b/readme.md @@ -8,7 +8,7 @@ scaffold projects quickly * [docs (typedoc)](https://pushrocks.gitlab.io/smartscaf/) ## Status for master -[![build status](https://gitlab.com/pushrocks/smartscaf/badges/master/build.svg)](https://gitlab.com/pushrocks/smartscaf/commits/master) +[![pipeline status](https://gitlab.com/pushrocks/smartscaf/badges/master/pipeline.svg)](https://gitlab.com/pushrocks/smartscaf/commits/master) [![coverage report](https://gitlab.com/pushrocks/smartscaf/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smartscaf/commits/master) [![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/smartscaf.svg)](https://www.npmjs.com/package/@pushrocks/smartscaf) [![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartscaf/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartscaf) @@ -27,6 +27,10 @@ For further information read the linked docs at the top of this README. [![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://) +## Contribution + +We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :) + For further information read the linked docs at the top of this readme. > MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) diff --git a/ts/interfaces/index.ts b/ts/interfaces/index.ts index bba25a5..cd8e97d 100644 --- a/ts/interfaces/index.ts +++ b/ts/interfaces/index.ts @@ -1 +1 @@ -export * from './smartscaf'; \ No newline at end of file +export * from './smartscaf'; diff --git a/ts/interfaces/smartscaf.ts b/ts/interfaces/smartscaf.ts index 83e1ffa..c3a451f 100644 --- a/ts/interfaces/smartscaf.ts +++ b/ts/interfaces/smartscaf.ts @@ -1,7 +1,7 @@ export interface ISmartscafFile { - defaults: {[key:string]: string}; + defaults: { [key: string]: string }; dependencies: { merge: string[]; }; runafter: string[]; -} \ No newline at end of file +} diff --git a/ts/smartscaf.classes.smartscaf.ts b/ts/smartscaf.classes.smartscaf.ts index 23e2775..0b5bd3b 100644 --- a/ts/smartscaf.classes.smartscaf.ts +++ b/ts/smartscaf.classes.smartscaf.ts @@ -1,6 +1,5 @@ import * as plugins from './smartscaf.plugins'; import * as interfaces from './interfaces'; -import * as helpers from './smartscaf.helpers'; // interfaces import { Smartfile } from '@pushrocks/smartfile'; @@ -70,7 +69,7 @@ export class ScafTemplate { if (smartscafSmartfile) { smartscafFile = { ...smartscafFile, - ...await plugins.smartyaml.yamlStringToObject(smartscafSmartfile.contentBuffer.toString()) + ...(await plugins.smartyaml.yamlStringToObject(smartscafSmartfile.contentBuffer.toString())) }; } this.smartscafFile = smartscafFile; @@ -117,7 +116,7 @@ export class ScafTemplate { } const answerBucket = await localSmartInteract.runQueue(); await answerBucket.answerMap.forEach(async answer => { - await helpers.deepAddToObject(this.suppliedVariables, answer.name, answer.value); + await plugins.smartparam.smartAdd(this.suppliedVariables, answer.name, answer.value); }); } @@ -248,7 +247,7 @@ export class ScafTemplate { } } - private async runScripts () { + private async runScripts() { if (!this.destinationPath) { throw new Error('cannot run scripts without an destinationdir'); } diff --git a/ts/smartscaf.helpers.ts b/ts/smartscaf.helpers.ts deleted file mode 100644 index aedbfcb..0000000 --- a/ts/smartscaf.helpers.ts +++ /dev/null @@ -1,33 +0,0 @@ -import * as plugins from './smartscaf.plugins'; - -/** - * adds a variable in string dot notation to an already more or less expanded object - */ -export let deepAddToObject = async (objectArg, varStringArg: string, valueArg: string) => { - 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: string = (() => { - 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!'); - } - } -}; diff --git a/ts/smartscaf.plugins.ts b/ts/smartscaf.plugins.ts index 0b868fa..e0a7dd8 100644 --- a/ts/smartscaf.plugins.ts +++ b/ts/smartscaf.plugins.ts @@ -4,8 +4,20 @@ 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 smartparam from '@pushrocks/smartparam'; +import * as smartpromise from '@pushrocks/smartpromise'; import * as smartyaml from '@pushrocks/smartyaml'; import * as smartshell from '@pushrocks/smartshell'; -export { path, lik, smartfile, smartfm, smarthbs, smartinteract, smartq, smartyaml, smartshell }; +export { + path, + lik, + smartfile, + smartfm, + smarthbs, + smartinteract, + smartparam, + smartpromise, + smartyaml, + smartshell +};