From 32ddc9cfedf662a2a7e72055518442bd31ea80ac Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Mon, 8 Jun 2020 18:58:43 +0000 Subject: [PATCH] fix(core): update --- .gitignore | 4 +- .gitlab-ci.yml | 90 ++++++++++++++++++++++------------------- .vscode/launch.json | 29 +++++++++++++ .vscode/settings.json | 26 ++++++++++++ README.md | 43 -------------------- npmextra.json | 1 + package.json | 19 ++++----- ts/qenv.classes.qenv.ts | 7 +--- 8 files changed, 117 insertions(+), 102 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json delete mode 100644 README.md diff --git a/.gitignore b/.gitignore index 91c0db0..ef13c79 100644 --- a/.gitignore +++ b/.gitignore @@ -15,8 +15,6 @@ node_modules/ # builds dist/ -dist_web/ -dist_serve/ -dist_ts_web/ +dist_*/ # custom \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ac532d3..8ebc8b5 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,24 @@ stages: mirror: stage: security script: - - npmci git mirror + - npmci git mirror tags: - - docker - - notpriv + - lossless + - docker + - notpriv -snyk: +audit: + image: registry.gitlab.com/hosttoday/ht-docker-node:npmci stage: security script: - npmci npm prepare - - npmci command npm install -g snyk - npmci command npm install --ignore-scripts - - npmci command snyk test + - npmci command npm config set registry https://registry.npmjs.org + - npmci command npm audit --audit-level=high tags: - - docker - - notpriv + - lossless + - docker + - notpriv # ==================== # test stage @@ -41,37 +44,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 @@ -81,33 +87,35 @@ codequality: allow_failure: true script: - npmci command npm install -g tslint typescript + - npmci npm prepare - 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: @@ -115,5 +123,5 @@ pages: artifacts: expire_in: 1 week paths: - - public + - public allow_failure: true diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..112db52 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,29 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "current file", + "type": "node", + "request": "launch", + "args": [ + "${relativeFile}" + ], + "runtimeArgs": ["-r", "@gitzone/tsrun"], + "cwd": "${workspaceRoot}", + "protocol": "inspector", + "internalConsoleOptions": "openOnSessionStart" + }, + { + "name": "test.ts", + "type": "node", + "request": "launch", + "args": [ + "test/test.ts" + ], + "runtimeArgs": ["-r", "@gitzone/tsrun"], + "cwd": "${workspaceRoot}", + "protocol": "inspector", + "internalConsoleOptions": "openOnSessionStart" + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..01d2b8d --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,26 @@ +{ + "json.schemas": [ + { + "fileMatch": ["/npmextra.json"], + "schema": { + "type": "object", + "properties": { + "npmci": { + "type": "object", + "description": "settings for npmci" + }, + "gitzone": { + "type": "object", + "description": "settings for gitzone", + "properties": { + "projectType": { + "type": "string", + "enum": ["website", "element", "service", "npm"] + } + } + } + } + } + } + ] +} diff --git a/README.md b/README.md deleted file mode 100644 index 2fc0347..0000000 --- a/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# @pushrocks/qenv -easy promised environments - -## Availabililty and Links -* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/qenv) -* [gitlab.com (source)](https://gitlab.com/pushrocks/qenv) -* [github.com (source mirror)](https://github.com/pushrocks/qenv) -* [docs (typedoc)](https://pushrocks.gitlab.io/qenv/) - -## Status for master -[![build status](https://gitlab.com/pushrocks/qenv/badges/master/build.svg)](https://gitlab.com/pushrocks/qenv/commits/master) -[![coverage report](https://gitlab.com/pushrocks/qenv/badges/master/coverage.svg)](https://gitlab.com/pushrocks/qenv/commits/master) -[![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/qenv.svg)](https://www.npmjs.com/package/@pushrocks/qenv) -[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/qenv/badge.svg)](https://snyk.io/test/npm/@pushrocks/qenv) -[![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 - -Use TypeScript for best in class instellisense. - -qenv works with two files: - -- **qenv.yml** - specifies which ENV vars are required. -- **env.yml** - specifies all env vars that are not already set in the current environment. - -Now obviously you can set build specific env vars in many CI environments. -So there we do not need an **env.yml** since all ENV vars are in place -However when on another machine you can have a env.yml that will be added to the environment by qenv. - -```javascript -import { Qenv } from 'qenv'; - -const myQenv = new Qenv('path/to/dir/where/qenv.yml/is/', 'path/to/dir/where/env.yml/is('); -``` - -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) - -[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com) diff --git a/npmextra.json b/npmextra.json index 386be08..8b4fb50 100644 --- a/npmextra.json +++ b/npmextra.json @@ -4,6 +4,7 @@ "npmAccessLevel": "public" }, "gitzone": { + "projectType": "npm", "module": { "githost": "gitlab.com", "gitscope": "pushrocks", diff --git a/package.json b/package.json index 2a02a38..bba3826 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "version": "4.0.7", "private": false, "description": "easy promised environments", - "main": "dist/index.js", - "typings": "dist/index.d.ts", + "main": "dist_ts/index.js", + "typings": "dist_ts/index.d.ts", "scripts": { "test": "(tstest test/)", "build": "(tsbuild)" @@ -38,14 +38,15 @@ "@pushrocks/smartlog": "^2.0.26" }, "files": [ - "ts/*", - "ts_web/*", - "dist/*", - "dist_web/*", - "dist_ts_web/*", - "assets/*", + "ts/**/*", + "ts_web/**/*", + "dist/**/*", + "dist_*/**/*", + "dist_ts/**/*", + "dist_ts_web/**/*", + "assets/**/*", "cli.js", "npmextra.json", "readme.md" ] -} +} \ No newline at end of file diff --git a/ts/qenv.classes.qenv.ts b/ts/qenv.classes.qenv.ts index 2dfa1cd..988f2a2 100644 --- a/ts/qenv.classes.qenv.ts +++ b/ts/qenv.classes.qenv.ts @@ -15,12 +15,7 @@ export class Qenv { public qenvFilePathAbsolute: string; public envFilePathAbsolute: string; - constructor( - qenvFileBasePathArg = process.cwd(), - envFileBasePathArg, - failOnMissing = true - ) { - + constructor(qenvFileBasePathArg = process.cwd(), envFileBasePathArg, failOnMissing = true) { // lets make sure paths are absolute this.qenvFilePathAbsolute = plugins.path.join( plugins.path.resolve(qenvFileBasePathArg),