From e15a569391b5b1b17c15f33045c7925bd66d98eb Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Mon, 5 Oct 2020 10:33:08 +0000 Subject: [PATCH] fix(core): update --- .gitignore | 4 +- .gitlab-ci.yml | 102 +++++++++++++++++++++++++----------------- .vscode/launch.json | 29 ++++++++++++ .vscode/settings.json | 26 +++++++++++ package.json | 18 +++++--- ts/tools.cli.ts | 2 +- ts/tools.install.ts | 2 +- ts/tools.logging.ts | 4 +- 8 files changed, 131 insertions(+), 56 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json 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 1e3250b..9a4467e 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,36 @@ stages: mirror: stage: security script: - - npmci git mirror + - npmci git mirror + only: + - tags tags: - - docker - - notpriv + - lossless + - docker + - notpriv -snyk: +auditProductionDependencies: + 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 install --production --ignore-scripts + - npmci command npm config set registry https://registry.npmjs.org + - npmci command npm audit --audit-level=high --only=prod --production tags: - - docker - - notpriv + - docker + +auditDevDependencies: + image: registry.gitlab.com/hosttoday/ht-docker-node:npmci + stage: security + script: + - npmci npm prepare + - npmci command npm install --ignore-scripts + - npmci command npm config set registry https://registry.npmjs.org + - npmci command npm audit --audit-level=high --only=dev + tags: + - docker + allow_failure: true # ==================== # test stage @@ -41,37 +56,36 @@ 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 + - docker testBuild: stage: test script: - - npmci npm prepare - - npmci node install lts - - 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 + - docker release: stage: release script: - - npmci node install lts - - npmci npm publish + - npmci node install stable + - npmci npm publish only: - - tags + - tags tags: - - docker - - notpriv + - lossless + - docker + - notpriv # ==================== # metadata stage @@ -79,35 +93,39 @@ release: codequality: stage: metadata allow_failure: true + only: + - tags 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 +133,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..3648eaa --- /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", "wcc"] + } + } + } + } + } + } + ] +} diff --git a/package.json b/package.json index 0bd7877..0747ee4 100644 --- a/package.json +++ b/package.json @@ -45,14 +45,18 @@ "@types/node": "^14.11.2" }, "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" + ], + "browserslist": [ + "last 1 chrome versions" ] -} +} \ No newline at end of file diff --git a/ts/tools.cli.ts b/ts/tools.cli.ts index d0ca02c..cf4ee85 100644 --- a/ts/tools.cli.ts +++ b/ts/tools.cli.ts @@ -4,7 +4,7 @@ import * as toolsInstall from './tools.install'; export const run = async () => { const toolsCli = new plugins.smartcli.Smartcli(); - toolsCli.addCommand('install').subscribe(async argvArg => { + toolsCli.addCommand('install').subscribe(async (argvArg) => { toolsInstall.install('default'); }); diff --git a/ts/tools.install.ts b/ts/tools.install.ts index 6bd14f1..7cb11f0 100644 --- a/ts/tools.install.ts +++ b/ts/tools.install.ts @@ -4,7 +4,7 @@ import { logger } from './tools.logging'; const installExec = async (packageNames: string[]) => { const smartshellInstance = new plugins.smartshell.Smartshell({ - executor: 'bash' + executor: 'bash', }); let installString = ''; diff --git a/ts/tools.logging.ts b/ts/tools.logging.ts index deb01e7..e90f97d 100644 --- a/ts/tools.logging.ts +++ b/ts/tools.logging.ts @@ -7,9 +7,9 @@ export const logger = new plugins.smartlog.Smartlog({ containerName: 'Some Containername', environment: 'local', runtime: 'node', - zone: 'gitzone' + zone: 'gitzone', }, - minimumLogLevel: 'silly' + minimumLogLevel: 'silly', }); logger.addLogDestination(new plugins.smartlogDestinationLocal.DestinationLocal());