From fd73f1865579fe6768c32f5c6986088f3a1b27f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pe=CC=81ter=20Nya=CC=81ri?= Date: Mon, 6 May 2019 11:59:19 +0200 Subject: [PATCH 1/3] Initial test --- .dockerignore | 4 + ci/Dockerfile | 63 +++++++++++ ci/Jenkinsfile | 139 +++++++++++++++++++++++++ ci/publishDocs.sh | 26 +++++ ci/release.sh | 23 ++++ package-lock.json | 41 ++++++-- projects/docs/karma.conf.js | 11 ++ projects/gentics-ui-core/karma.conf.js | 11 ++ 8 files changed, 307 insertions(+), 11 deletions(-) create mode 100644 .dockerignore create mode 100644 ci/Dockerfile create mode 100644 ci/Jenkinsfile create mode 100644 ci/publishDocs.sh create mode 100644 ci/release.sh diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..6efbb96e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.git +dist +docs +node_modules diff --git a/ci/Dockerfile b/ci/Dockerfile new file mode 100644 index 00000000..01068c5c --- /dev/null +++ b/ci/Dockerfile @@ -0,0 +1,63 @@ +FROM node:10-alpine AS builder +LABEL maintainer="p.nyari@gentics.com" +ARG BUILD_USER="jenkins" +# Installs latest Chromium package +RUN echo @edge http://nl.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories \ + && echo @edge http://nl.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories \ + && apk add --no-cache \ + chromium@edge \ + harfbuzz@edge \ + nss@edge \ + freetype@edge \ + ttf-freefont@edge \ + git \ + && rm -rf /var/cache/* \ + && mkdir /var/cache/apk +ENV CHROME_BIN /usr/bin/chromium-browser +ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true +RUN adduser -D -u 10000 -h /ci ${BUILD_USER} +RUN chown ${BUILD_USER}: /ci -R +USER ${BUILD_USER} +WORKDIR /ci +LABEL stage=builder + +# Setup dependencies +FROM builder as dependencies +COPY package.json package-lock.json ./ +RUN npm set progress=false \ + && npm config set depth 0 +RUN npm ci +COPY --chown=10000 . . +ARG CACHEBUST=1 +RUN echo "Rebuild from here (unique number: $CACHEBUST)" +LABEL stage=buildenv + +# Run unit tests +FROM dependencies AS test +ARG linting=false +ARG testing=false +RUN [ "$linting" != true ] || npm run lint +RUN [ "$testing" != true ] || npm run test -- --watch=false --browsers=ChromeHeadlessCI --reporters=junit +LABEL stage=test + +# Build application +FROM dependencies AS build +RUN npm run build -- --progress=false +LABEL stage=build + +# Release to NPM +FROM dependencies AS release +ARG releaseProjectName='gentics-ui-core' +ARG release=false +ARG releaseNext=false +ARG releaseVersion='' +RUN sh ci/release.sh +LABEL stage=release + +# Publish Docs on Github Pages +FROM dependencies AS docs +ARG GIT_BRANCH='' +ARG publishDocs=false +ARG docsVersion='' +RUN sh ci/publishDocs.sh +LABEL stage=docs \ No newline at end of file diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile new file mode 100644 index 00000000..9bd7b61e --- /dev/null +++ b/ci/Jenkinsfile @@ -0,0 +1,139 @@ +// The GIT repository for this pipeline lib is defined in the global Jenkins setting +@Library('jenkins-pipeline-library') +import com.gentics.* + +// Make the helpers aware of this jobs environment +JobContext.set(this) + +pipeline { + agent { + kubernetes { + label env.BUILD_TAG + defaultContainer 'build' + yaml """ +apiVersion: v1 +kind: Pod +spec: + nodeSelector: + jenkins_worker: true + volumes: + - name: cache + hostPath: + path: /opt/kubernetes/cache + containers: + - name: build + image: docker:18 + imagePullPolicy: Always + command: + - cat + tty: true + resources: + requests: + cpu: 2 + memory: 4Gi + env: + - name: DOCKER_HOST + value: tcp://127.0.0.1:2375 + volumeMounts: + - mountPath: /root/.npm/_cacache + name: cache + subPath: npm/_cacache + - name: docker + image: docker:18-dind + imagePullPolicy: Always + args: + - '--storage-driver=overlay2' + securityContext: + privileged: true + tty: true + imagePullSecrets: + - name: docker-jenkinsbuilds-apa-it +""" + } + } + + environment { + VERSION_CONSTRAINT = /^((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)$/ + } + + options { + gitLabConnection('git.gentics.com') + gitlabBuilds(builds: ['Jenkins build']) + timestamps() + timeout(time: 1, unit: 'HOURS') + ansiColor('xterm') + } + + parameters { + booleanParam(name: 'linting', defaultValue: false, description: 'Whether to run linting') + booleanParam(name: 'testing', defaultValue: true, description: 'Whether to run unit tests') + string(name: 'releaseVersion', defaultValue: '', description: 'Version must comply with semver, a tag will be created, cannot be the same as in package.json') + booleanParam(name: 'release', defaultValue: false, description: "Whether to run the release steps") + booleanParam(name: 'releaseNext', defaultValue: false, description: "Whether release as an upcoming version") + booleanParam(name: 'publishDocs', defaultValue: false, description: 'Build docs app and uploads to Github Pages') + string(name: 'docsVersion', defaultValue: '', description: 'If empty, its auto-detected, otherwise version of the maintenance documentation') + } + + stages { + stage('Clone Github Pages') { + when { + beforeAgent true + expression { + return params.publishDocs + } + } + + steps { + dir('docs') { + git branch: 'gh-pages', + credentialsId: 'git', + url: env.GIT_URL + } + } + } + + stage('Docker build') { + when { + beforeAgent true + expression { + isValidVersion = params.releaseVersion.trim() =~ env.VERSION_CONSTRAINT || params.releaseVersion == '' + return isValidVersion + } + } + + steps { + sh """docker build -f ci/Dockerfile \ + --build-arg linting=${params.linting} \ + --build-arg testing=${params.testing} \ + --build-arg release=${params.release} \ + --build-arg releaseNext=${params.releaseNext} \ + --build-arg releaseVersion=${params.releaseVersion} \ + --build-arg publishDocs=${params.publishDocs} \ + --build-arg docsVersion=${params.docsVersion} \ + --build-arg GIT_BRANCH=${env.GIT_BRANCH} \ + --build-arg CACHEBUST=\$(date +%s) \ + . + """ + } + } + + stage('Publish Docs to Github Pages') { + when { + expression { + return params.publishDocs + } + } + + steps { + echo "Now it should publish..." + } + } + } + + post { + always { + //updateGitlabCommitCurrentBuildStatus name: 'Jenkins build' + notifyMattermostUsers() + } + } +} diff --git a/ci/publishDocs.sh b/ci/publishDocs.sh new file mode 100644 index 00000000..85912fbc --- /dev/null +++ b/ci/publishDocs.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# This should be before set -o errexit! +MAINTPREFIX="maintenance-v[0-9][\.x0-9]+" +isMaintenanceBranch=$(echo "$GIT_BRANCH" | grep -Eq "$MAINTPREFIX"; echo $?) + +set -o errexit +set -o nounset + + +if [ "$publishDocs" == true ] +then + PARAMS="" + + if [ -z "$docsVersion" ] && [ ! -z "$GIT_BRANCH" ] && [ $isMaintenanceBranch -eq 0 ] + then + docsVersion=$(echo "$GIT_BRANCH" | cut -d '-' -f 2) + fi + + if [ ! -z "$docsVersion" ] + then + PARAMS="$PARAMS --docsVersion=${docsVersion}" + fi + + echo "Will publishes docs part... (PARAMS: $PARAMS)" +fi \ No newline at end of file diff --git a/ci/release.sh b/ci/release.sh new file mode 100644 index 00000000..312f0422 --- /dev/null +++ b/ci/release.sh @@ -0,0 +1,23 @@ +#!/bin/sh +set -o errexit +set -o nounset +WORKDIR="$PWD" + +if [ "$release" == true ] +then + if [ ! -z "$releaseVersion" ] + then + cd "/ci/projects/$releaseProjectName/" + npm version "$releaseVersion" + cd "$WORKDIR" + fi + + npm run build -- "$releaseProjectName" + + if [ "$releaseNext" == true ] + then + npm publish --dry-run --tag next "/ci/dist/$releaseProjectName" + else + npm publish --dry-run "/ci/dist/$releaseProjectName" + fi +fi diff --git a/package-lock.json b/package-lock.json index 657a3c8a..56227070 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4392,7 +4392,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -4413,12 +4414,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -4433,17 +4436,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -4560,7 +4566,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -4572,6 +4579,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -4586,6 +4594,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -4593,12 +4602,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -4617,6 +4628,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -4697,7 +4709,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -4709,6 +4722,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -4794,7 +4808,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -4830,6 +4845,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -4849,6 +4865,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -4892,12 +4909,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, diff --git a/projects/docs/karma.conf.js b/projects/docs/karma.conf.js index c57e8065..dddfaa1f 100644 --- a/projects/docs/karma.conf.js +++ b/projects/docs/karma.conf.js @@ -20,6 +20,17 @@ module.exports = function (config) { reports: ['html', 'lcovonly', 'text-summary'], fixWebpackSourcePaths: true }, + customLaunchers: { + ChromeHeadlessCI: { + base: 'Chrome', + flags: [ + '--headless', + '--disable-gpu', + '--no-sandbox', + '--remote-debugging-port=9222' + ], + } + }, reporters: ['progress', 'kjhtml'], port: 9876, colors: true, diff --git a/projects/gentics-ui-core/karma.conf.js b/projects/gentics-ui-core/karma.conf.js index 4c5f8d03..682c0a14 100644 --- a/projects/gentics-ui-core/karma.conf.js +++ b/projects/gentics-ui-core/karma.conf.js @@ -20,6 +20,17 @@ module.exports = function (config) { reports: ['html', 'lcovonly'], fixWebpackSourcePaths: true }, + customLaunchers: { + ChromeHeadlessCI: { + base: 'Chrome', + flags: [ + '--headless', + '--disable-gpu', + '--no-sandbox', + '--remote-debugging-port=9222' + ], + } + }, reporters: ['progress', 'kjhtml'], port: 9876, colors: true, From f6c36f189f48f49bd38a03c32717c19aa0967a98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pe=CC=81ter=20Nya=CC=81ri?= Date: Mon, 3 Jun 2019 16:11:00 +0200 Subject: [PATCH 2/3] Pipeline changes --- .gitignore | 1 + ci/Dockerfile | 63 --------------- ci/Dockerfile.build | 22 ++++++ ci/Jenkinsfile | 102 +++++++++++++++++-------- ci/publishDocs.sh | 0 ci/release.sh | 33 ++++---- package-lock.json | 18 +++++ package.json | 1 + projects/docs/karma.conf.js | 9 ++- projects/gentics-ui-core/karma.conf.js | 10 ++- 10 files changed, 146 insertions(+), 113 deletions(-) delete mode 100644 ci/Dockerfile create mode 100644 ci/Dockerfile.build mode change 100644 => 100755 ci/publishDocs.sh mode change 100644 => 100755 ci/release.sh diff --git a/.gitignore b/.gitignore index 044b16aa..e86cb3aa 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ npm-debug.log yarn-error.log testem.log /typings +/.reports # System Files .DS_Store diff --git a/ci/Dockerfile b/ci/Dockerfile deleted file mode 100644 index 01068c5c..00000000 --- a/ci/Dockerfile +++ /dev/null @@ -1,63 +0,0 @@ -FROM node:10-alpine AS builder -LABEL maintainer="p.nyari@gentics.com" -ARG BUILD_USER="jenkins" -# Installs latest Chromium package -RUN echo @edge http://nl.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories \ - && echo @edge http://nl.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories \ - && apk add --no-cache \ - chromium@edge \ - harfbuzz@edge \ - nss@edge \ - freetype@edge \ - ttf-freefont@edge \ - git \ - && rm -rf /var/cache/* \ - && mkdir /var/cache/apk -ENV CHROME_BIN /usr/bin/chromium-browser -ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true -RUN adduser -D -u 10000 -h /ci ${BUILD_USER} -RUN chown ${BUILD_USER}: /ci -R -USER ${BUILD_USER} -WORKDIR /ci -LABEL stage=builder - -# Setup dependencies -FROM builder as dependencies -COPY package.json package-lock.json ./ -RUN npm set progress=false \ - && npm config set depth 0 -RUN npm ci -COPY --chown=10000 . . -ARG CACHEBUST=1 -RUN echo "Rebuild from here (unique number: $CACHEBUST)" -LABEL stage=buildenv - -# Run unit tests -FROM dependencies AS test -ARG linting=false -ARG testing=false -RUN [ "$linting" != true ] || npm run lint -RUN [ "$testing" != true ] || npm run test -- --watch=false --browsers=ChromeHeadlessCI --reporters=junit -LABEL stage=test - -# Build application -FROM dependencies AS build -RUN npm run build -- --progress=false -LABEL stage=build - -# Release to NPM -FROM dependencies AS release -ARG releaseProjectName='gentics-ui-core' -ARG release=false -ARG releaseNext=false -ARG releaseVersion='' -RUN sh ci/release.sh -LABEL stage=release - -# Publish Docs on Github Pages -FROM dependencies AS docs -ARG GIT_BRANCH='' -ARG publishDocs=false -ARG docsVersion='' -RUN sh ci/publishDocs.sh -LABEL stage=docs \ No newline at end of file diff --git a/ci/Dockerfile.build b/ci/Dockerfile.build new file mode 100644 index 00000000..9d84dded --- /dev/null +++ b/ci/Dockerfile.build @@ -0,0 +1,22 @@ +FROM node:10-alpine + +LABEL maintainer="p.nyari@gentics.com" +ARG BUILD_USER="jenkins" +ENV CHROME_BIN /usr/bin/chromium-browser +ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true + +# Installs latest Chromium package +RUN echo @edge http://nl.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories \ + && echo @edge http://nl.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories \ + && apk add --no-cache \ + chromium@edge \ + harfbuzz@edge \ + nss@edge \ + freetype@edge \ + ttf-freefont@edge \ + git \ + && rm -rf /var/cache/* \ + && mkdir /var/cache/apk + +RUN addgroup -g 10000 ${BUILD_USER} && adduser -D -G ${BUILD_USER} -u 10000 ${BUILD_USER} +USER ${BUILD_USER} diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 9bd7b61e..3f80d771 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -22,7 +22,7 @@ spec: path: /opt/kubernetes/cache containers: - name: build - image: docker:18 + image: """ + buildEnvironmentDockerImage("ci/Dockerfile.build") + """ imagePullPolicy: Always command: - cat @@ -30,12 +30,12 @@ spec: resources: requests: cpu: 2 - memory: 4Gi + memory: 2Gi env: - name: DOCKER_HOST value: tcp://127.0.0.1:2375 volumeMounts: - - mountPath: /root/.npm/_cacache + - mountPath: /home/jenkins/.npm/_cacache name: cache subPath: npm/_cacache - name: docker @@ -57,16 +57,12 @@ spec: } options { - gitLabConnection('git.gentics.com') - gitlabBuilds(builds: ['Jenkins build']) timestamps() timeout(time: 1, unit: 'HOURS') ansiColor('xterm') } parameters { - booleanParam(name: 'linting', defaultValue: false, description: 'Whether to run linting') - booleanParam(name: 'testing', defaultValue: true, description: 'Whether to run unit tests') string(name: 'releaseVersion', defaultValue: '', description: 'Version must comply with semver, a tag will be created, cannot be the same as in package.json') booleanParam(name: 'release', defaultValue: false, description: "Whether to run the release steps") booleanParam(name: 'releaseNext', defaultValue: false, description: "Whether release as an upcoming version") @@ -77,7 +73,6 @@ spec: stages { stage('Clone Github Pages') { when { - beforeAgent true expression { return params.publishDocs } @@ -92,41 +87,84 @@ spec: } } - stage('Docker build') { + stage('Fetch dependencies') { + steps { + sh 'npm set progress=false' + sh 'npm config set depth 0' + sh 'npm ci' + stash includes: 'node_modules/', name: 'node_modules' + } + } + + /*stage('Lint') { + steps { + unstash 'node_modules' + sh 'npm run lint' + } + }*/ + + /*stage('Unit Tests') { + steps { + unstash 'node_modules' + sh 'npm run test -- --watch=false --browsers=ChromeHeadlessCI --reporters=junit' + } + + post { + always { + *///junit '.reports/*/*.xml' + /*} + } + }*/ + + stage('Build') { + steps { + unstash 'node_modules' + sh "npm run build -- --progress=false" + stash includes: 'dist/', name: 'dist' + } + } + + stage('Release') { when { - beforeAgent true - expression { - isValidVersion = params.releaseVersion.trim() =~ env.VERSION_CONSTRAINT || params.releaseVersion == '' - return isValidVersion - } + allOf { + expression { + return params.release + } + expression { + isValidVersion = params.releaseVersion.trim() =~ env.VERSION_CONSTRAINT || params.releaseVersion == '' + return isValidVersion + } + } } steps { - sh """docker build -f ci/Dockerfile \ - --build-arg linting=${params.linting} \ - --build-arg testing=${params.testing} \ - --build-arg release=${params.release} \ - --build-arg releaseNext=${params.releaseNext} \ - --build-arg releaseVersion=${params.releaseVersion} \ - --build-arg publishDocs=${params.publishDocs} \ - --build-arg docsVersion=${params.docsVersion} \ - --build-arg GIT_BRANCH=${env.GIT_BRANCH} \ - --build-arg CACHEBUST=\$(date +%s) \ - . - """ + unstash 'dist' + withCredentials([string(credentialsId: 'npm-token', variable: 'NPM_TOKEN')]) { + sh "echo //registry.npmjs.org/:_authToken=${env.NPM_TOKEN} > .npmrc" + sh "ci/release.sh " + params.releaseNext + ' "' + params.releaseVersion + '"' + } } } - stage('Publish Docs to Github Pages') { + stage('Update Documentation') { when { - expression { - return params.publishDocs - } + allOf { + expression { + return params.publishDocs + } + expression { + isValidVersion = params.releaseVersion.trim() =~ env.VERSION_CONSTRAINT || params.releaseVersion == '' + return isValidVersion + } + } } steps { - echo "Now it should publish..." - } + unstash 'node_modules' + sshagent(["git"]) { + sh "ci/publishDocs.sh" + } + } } } diff --git a/ci/publishDocs.sh b/ci/publishDocs.sh old mode 100644 new mode 100755 diff --git a/ci/release.sh b/ci/release.sh old mode 100644 new mode 100755 index 312f0422..23d8a8b9 --- a/ci/release.sh +++ b/ci/release.sh @@ -3,21 +3,24 @@ set -o errexit set -o nounset WORKDIR="$PWD" -if [ "$release" == true ] +releaseProjectName="gentics-ui-core" +releaseNext=${1:-false} +releaseVersion=$2 + +npm whoami + +if [ ! -z "$releaseVersion" ] then - if [ ! -z "$releaseVersion" ] - then - cd "/ci/projects/$releaseProjectName/" - npm version "$releaseVersion" - cd "$WORKDIR" - fi + cd "projects/$releaseProjectName/" + npm version "$releaseVersion" + cd "$WORKDIR" +fi - npm run build -- "$releaseProjectName" - - if [ "$releaseNext" == true ] - then - npm publish --dry-run --tag next "/ci/dist/$releaseProjectName" - else - npm publish --dry-run "/ci/dist/$releaseProjectName" - fi +npm run build -- "$releaseProjectName" + +if [ "$releaseNext" == true ] +then + npm publish --dry-run --tag next "dist/$releaseProjectName" +else + npm publish --dry-run "dist/$releaseProjectName" fi diff --git a/package-lock.json b/package-lock.json index 56227070..08221130 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6871,6 +6871,24 @@ "karma-jasmine": "^1.0.2" } }, + "karma-junit-reporter": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/karma-junit-reporter/-/karma-junit-reporter-1.2.0.tgz", + "integrity": "sha1-T5xAzt+xo5X4rvh2q/lhiZF8Y5Y=", + "dev": true, + "requires": { + "path-is-absolute": "^1.0.0", + "xmlbuilder": "8.2.2" + }, + "dependencies": { + "xmlbuilder": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-8.2.2.tgz", + "integrity": "sha1-aSSGc0ELS6QuGmE2VR0pIjNap3M=", + "dev": true + } + } + }, "karma-source-map-support": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/karma-source-map-support/-/karma-source-map-support-1.3.0.tgz", diff --git a/package.json b/package.json index 5c34a558..2934eb06 100644 --- a/package.json +++ b/package.json @@ -106,6 +106,7 @@ "karma-coverage-istanbul-reporter": "~2.0.1", "karma-jasmine": "~1.1.2", "karma-jasmine-html-reporter": "^0.2.2", + "karma-junit-reporter": "^1.2.0", "marked": "~0.6.0", "ng-packagr": "^4.7.1", "ngx-build-plus": "^7.7.6", diff --git a/projects/docs/karma.conf.js b/projects/docs/karma.conf.js index dddfaa1f..c46724c3 100644 --- a/projects/docs/karma.conf.js +++ b/projects/docs/karma.conf.js @@ -10,7 +10,8 @@ module.exports = function (config) { require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), require('karma-coverage-istanbul-reporter'), - require('@angular-devkit/build-angular/plugins/karma') + require('@angular-devkit/build-angular/plugins/karma'), + require('karma-junit-reporter') ], client: { clearContext: false // leave Jasmine Spec Runner output visible in browser @@ -32,6 +33,12 @@ module.exports = function (config) { } }, reporters: ['progress', 'kjhtml'], + reporters: ['progress', 'kjhtml', 'junit'], + junitReporter: { + outputDir: '../../.reports', + outputFile: 'docs-results.xml', + suite: '' + }, port: 9876, colors: true, logLevel: config.LOG_INFO, diff --git a/projects/gentics-ui-core/karma.conf.js b/projects/gentics-ui-core/karma.conf.js index 682c0a14..d9f5e67b 100644 --- a/projects/gentics-ui-core/karma.conf.js +++ b/projects/gentics-ui-core/karma.conf.js @@ -10,7 +10,8 @@ module.exports = function (config) { require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), require('karma-coverage-istanbul-reporter'), - require('@angular-devkit/build-angular/plugins/karma') + require('@angular-devkit/build-angular/plugins/karma'), + require('karma-junit-reporter') ], client: { clearContext: false // leave Jasmine Spec Runner output visible in browser @@ -31,7 +32,12 @@ module.exports = function (config) { ], } }, - reporters: ['progress', 'kjhtml'], + reporters: ['progress', 'kjhtml', 'junit'], + junitReporter: { + outputDir: '../../.reports', + outputFile: 'gentics-ui-core-results.xml', + suite: '' + }, port: 9876, colors: true, logLevel: config.LOG_INFO, From 494b331c5a2498656ecffe1d07d7255bc527c3ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pe=CC=81ter=20Nya=CC=81ri?= Date: Tue, 4 Jun 2019 16:57:11 +0200 Subject: [PATCH 3/3] Add lint-staged --- .prettierrc | 3 + ci/publishDocs.sh | 25 +- ci/release.sh | 2 - package-lock.json | 620 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 15 ++ tslint.json | 6 +- 6 files changed, 654 insertions(+), 17 deletions(-) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..27b7389f --- /dev/null +++ b/.prettierrc @@ -0,0 +1,3 @@ +# .prettierrc +printWidth: 120 +singleQuote: true diff --git a/ci/publishDocs.sh b/ci/publishDocs.sh index 85912fbc..c5bdfa89 100755 --- a/ci/publishDocs.sh +++ b/ci/publishDocs.sh @@ -1,5 +1,5 @@ #!/bin/sh - +GIT_BRANCH=$1 # This should be before set -o errexit! MAINTPREFIX="maintenance-v[0-9][\.x0-9]+" isMaintenanceBranch=$(echo "$GIT_BRANCH" | grep -Eq "$MAINTPREFIX"; echo $?) @@ -8,19 +8,16 @@ set -o errexit set -o nounset -if [ "$publishDocs" == true ] +PARAMS="" + +if [ -z "$docsVersion" ] && [ ! -z "$GIT_BRANCH" ] && [ $isMaintenanceBranch -eq 0 ] then - PARAMS="" + docsVersion=$(echo "$GIT_BRANCH" | cut -d '-' -f 2) +fi - if [ -z "$docsVersion" ] && [ ! -z "$GIT_BRANCH" ] && [ $isMaintenanceBranch -eq 0 ] - then - docsVersion=$(echo "$GIT_BRANCH" | cut -d '-' -f 2) - fi +if [ ! -z "$docsVersion" ] +then + PARAMS="$PARAMS --docsVersion=${docsVersion}" +fi - if [ ! -z "$docsVersion" ] - then - PARAMS="$PARAMS --docsVersion=${docsVersion}" - fi - - echo "Will publishes docs part... (PARAMS: $PARAMS)" -fi \ No newline at end of file +echo "Will publishes docs part... (PARAMS: $PARAMS)" \ No newline at end of file diff --git a/ci/release.sh b/ci/release.sh index 23d8a8b9..21cac68e 100755 --- a/ci/release.sh +++ b/ci/release.sh @@ -7,8 +7,6 @@ releaseProjectName="gentics-ui-core" releaseNext=${1:-false} releaseVersion=$2 -npm whoami - if [ ! -z "$releaseVersion" ] then cd "projects/$releaseProjectName/" diff --git a/package-lock.json b/package-lock.json index 08221130..e5ce3b70 100644 --- a/package-lock.json +++ b/package-lock.json @@ -552,6 +552,23 @@ "integrity": "sha512-5pCS4mOsL+ANsFZGdvNLybx4wtqAZJ0MJjMHxvzI3bvIsz6sQvzW8XX92EYIkiPtIvcfG3Aj+Ir5VNyjnZhP7w==", "dev": true }, + "@babel/runtime": { + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.5.tgz", + "integrity": "sha512-TuI4qpWZP6lGOGIuGWtp9sPluqYICmbk8T/1vpSysqJxRPkudh/ofFWyqdcMsDf2s7KvDL4/YHgKyvcS3g9CJQ==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.2" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", + "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==", + "dev": true + } + } + }, "@babel/template": { "version": "7.4.4", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz", @@ -641,6 +658,15 @@ "webpack-sources": "1.3.0" } }, + "@samverschueren/stream-to-observable": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz", + "integrity": "sha512-MI4Xx6LHs4Webyvi6EbspgyAb4D2Q2VtnCQ1blOJcoLS6mVa8lNN2rkIy1CVxfTUpoyIbCTkXES1rLXztFD1lg==", + "dev": true, + "requires": { + "any-observable": "^0.3.0" + } + }, "@schematics/angular": { "version": "7.3.8", "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-7.3.8.tgz", @@ -1163,6 +1189,12 @@ "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", "dev": true }, + "any-observable": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/any-observable/-/any-observable-0.3.0.tgz", + "integrity": "sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog==", + "dev": true + }, "anymatch": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", @@ -2204,12 +2236,36 @@ "unset-value": "^1.0.0" } }, + "caller-callsite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", + "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", + "dev": true, + "requires": { + "callsites": "^2.0.0" + } + }, + "caller-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", + "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", + "dev": true, + "requires": { + "caller-callsite": "^2.0.0" + } + }, "callsite": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=", "dev": true }, + "callsites": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", + "dev": true + }, "camelcase": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", @@ -2397,6 +2453,16 @@ "restore-cursor": "^2.0.0" } }, + "cli-truncate": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-0.2.1.tgz", + "integrity": "sha1-nxXPuwcFAFNpIWxiasfQWrkN1XQ=", + "dev": true, + "requires": { + "slice-ansi": "0.0.4", + "string-width": "^1.0.1" + } + }, "cli-width": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", @@ -3003,6 +3069,12 @@ "assert-plus": "^1.0.0" } }, + "date-fns": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.30.1.tgz", + "integrity": "sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==", + "dev": true + }, "date-format": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/date-format/-/date-format-1.2.0.tgz", @@ -3042,6 +3114,12 @@ "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", "dev": true }, + "dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", + "dev": true + }, "deep-equal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", @@ -3309,6 +3387,30 @@ "buffer-indexof": "^1.0.0" } }, + "doctrine": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-0.7.2.tgz", + "integrity": "sha1-fLhgNZujvpDgQLJrcpzkv6ZUxSM=", + "dev": true, + "requires": { + "esutils": "^1.1.6", + "isarray": "0.0.1" + }, + "dependencies": { + "esutils": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-1.1.6.tgz", + "integrity": "sha1-wBzKqa5LiXxtDD4hCuUvPHqEQ3U=", + "dev": true + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, "dom-serialize": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", @@ -3421,6 +3523,12 @@ "integrity": "sha512-1o25iFRf/dbgauTWalEzmD1EmRN3a2CzP/K7UVpYLEBduk96LF0FyUdCcf4Ry2mAWJ1VxyblFjC93q6qlLwA2A==", "dev": true }, + "elegant-spinner": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-1.0.1.tgz", + "integrity": "sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4=", + "dev": true + }, "elliptic": { "version": "6.4.1", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", @@ -4221,6 +4329,12 @@ "readable-stream": "^2.3.6" } }, + "fn-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fn-name/-/fn-name-2.0.1.tgz", + "integrity": "sha1-UhTXU3pNBqSjAcDMJi/rhBiAAuc=", + "dev": true + }, "follow-redirects": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.7.0.tgz", @@ -4938,6 +5052,17 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "g-status": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/g-status/-/g-status-2.0.2.tgz", + "integrity": "sha512-kQoE9qH+T1AHKgSSD0Hkv98bobE90ILQcXAF4wvGgsr7uFqNvwmh8j+Lq3l0RVt3E3HjSbv2B9biEGcEtpHLCA==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "matcher": "^1.0.0", + "simple-git": "^1.85.0" + } + }, "gauge": { "version": "2.7.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", @@ -4975,6 +5100,12 @@ "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", "dev": true }, + "get-own-enumerable-property-symbols": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.0.tgz", + "integrity": "sha512-CIJYJC4GGF06TakLg8z4GQKvDsx9EMspVxOYih7LerEL/WosUnFIww45CGfxfeKHqlg3twgUrYRT1O3WQqjGCg==", + "dev": true + }, "get-stdin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", @@ -5777,6 +5908,16 @@ "import-from": "^2.1.0" } }, + "import-fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", + "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", + "dev": true, + "requires": { + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" + } + }, "import-from": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/import-from/-/import-from-2.1.0.tgz", @@ -6231,6 +6372,15 @@ "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", "dev": true }, + "is-observable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-observable/-/is-observable-1.1.0.tgz", + "integrity": "sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA==", + "dev": true, + "requires": { + "symbol-observable": "^1.1.0" + } + }, "is-path-cwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", @@ -6276,6 +6426,12 @@ "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=", "dev": true }, + "is-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=", + "dev": true + }, "is-relative": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", @@ -7055,6 +7211,236 @@ "resolve": "^1.1.7" } }, + "lint-staged": { + "version": "8.1.7", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-8.1.7.tgz", + "integrity": "sha512-egT0goFhIFoOGk6rasPngTFh2qDqxZddM0PwI58oi66RxCDcn5uDwxmiasWIF0qGnchHSYVJ8HPRD5LrFo7TKA==", + "dev": true, + "requires": { + "chalk": "^2.3.1", + "commander": "^2.14.1", + "cosmiconfig": "^5.2.0", + "debug": "^3.1.0", + "dedent": "^0.7.0", + "del": "^3.0.0", + "execa": "^1.0.0", + "find-parent-dir": "^0.3.0", + "g-status": "^2.0.2", + "is-glob": "^4.0.0", + "is-windows": "^1.0.2", + "listr": "^0.14.2", + "listr-update-renderer": "^0.5.0", + "lodash": "^4.17.11", + "log-symbols": "^2.2.0", + "micromatch": "^3.1.8", + "npm-which": "^3.0.1", + "p-map": "^1.1.1", + "path-is-inside": "^1.0.2", + "pify": "^3.0.0", + "please-upgrade-node": "^3.0.2", + "staged-git-files": "1.1.2", + "string-argv": "^0.0.2", + "stringify-object": "^3.2.2", + "yup": "^0.27.0" + }, + "dependencies": { + "cosmiconfig": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "dev": true, + "requires": { + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.1", + "parse-json": "^4.0.0" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } + } + }, + "listr": { + "version": "0.14.3", + "resolved": "https://registry.npmjs.org/listr/-/listr-0.14.3.tgz", + "integrity": "sha512-RmAl7su35BFd/xoMamRjpIE4j3v+L28o8CT5YhAXQJm1fD+1l9ngXY8JAQRJ+tFK2i5njvi0iRUKV09vPwA0iA==", + "dev": true, + "requires": { + "@samverschueren/stream-to-observable": "^0.3.0", + "is-observable": "^1.1.0", + "is-promise": "^2.1.0", + "is-stream": "^1.1.0", + "listr-silent-renderer": "^1.1.1", + "listr-update-renderer": "^0.5.0", + "listr-verbose-renderer": "^0.5.0", + "p-map": "^2.0.0", + "rxjs": "^6.3.3" + }, + "dependencies": { + "p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true + } + } + }, + "listr-silent-renderer": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz", + "integrity": "sha1-kktaN1cVN3C/Go4/v3S4u/P5JC4=", + "dev": true + }, + "listr-update-renderer": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/listr-update-renderer/-/listr-update-renderer-0.5.0.tgz", + "integrity": "sha512-tKRsZpKz8GSGqoI/+caPmfrypiaq+OQCbd+CovEC24uk1h952lVj5sC7SqyFUm+OaJ5HN/a1YLt5cit2FMNsFA==", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "cli-truncate": "^0.2.1", + "elegant-spinner": "^1.0.1", + "figures": "^1.7.0", + "indent-string": "^3.0.0", + "log-symbols": "^1.0.2", + "log-update": "^2.3.0", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + } + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "log-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz", + "integrity": "sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg=", + "dev": true, + "requires": { + "chalk": "^1.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "listr-verbose-renderer": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/listr-verbose-renderer/-/listr-verbose-renderer-0.5.0.tgz", + "integrity": "sha512-04PDPqSlsqIOaaaGZ+41vq5FejI9auqTInicFRndCBgE3bXG8D6W1I+mWhk+1nqbHmyhla/6BUrd5OSiHwKRXw==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "cli-cursor": "^2.1.0", + "date-fns": "^1.27.2", + "figures": "^2.0.0" + } + }, "load-json-file": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", @@ -7258,6 +7644,69 @@ "lodash.escape": "^3.0.0" } }, + "log-symbols": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "dev": true, + "requires": { + "chalk": "^2.0.1" + } + }, + "log-update": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-2.3.0.tgz", + "integrity": "sha1-iDKP19HOeTiykoN0bwsbwSayRwg=", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "cli-cursor": "^2.0.0", + "wrap-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "wrap-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-3.0.1.tgz", + "integrity": "sha1-KIoE2H7aXChuBg3+jxNc6NAH+Lo=", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0" + } + } + } + }, "log4js": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/log4js/-/log4js-3.0.6.tgz", @@ -7530,6 +7979,15 @@ } } }, + "matcher": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/matcher/-/matcher-1.1.1.tgz", + "integrity": "sha512-+BmqxWIubKTRKNWx/ahnCkk3mG8m7OturVlqq6HiojGJTd5hVYbgZm6WzcYPCoB+KBT4Vd6R7WSRG2OADNaCjg==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.4" + } + }, "material-design-icons-iconfont": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/material-design-icons-iconfont/-/material-design-icons-iconfont-4.0.5.tgz", @@ -8316,6 +8774,15 @@ "npm-bundled": "^1.0.1" } }, + "npm-path": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/npm-path/-/npm-path-2.0.4.tgz", + "integrity": "sha512-IFsj0R9C7ZdR5cP+ET342q77uSRdtWOlWpih5eC+lu29tIDbNEgDbzgVJ5UFvYHWhxDZ5TFkJafFioO0pPQjCw==", + "dev": true, + "requires": { + "which": "^1.2.10" + } + }, "npm-pick-manifest": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-2.2.3.tgz", @@ -8350,6 +8817,17 @@ "path-key": "^2.0.0" } }, + "npm-which": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/npm-which/-/npm-which-3.0.1.tgz", + "integrity": "sha1-kiXybsOihcIJyuZ8OxGmtKtxQKo=", + "dev": true, + "requires": { + "commander": "^2.9.0", + "npm-path": "^2.0.2", + "which": "^1.2.10" + } + }, "npmlog": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", @@ -9056,6 +9534,15 @@ "find-up": "^2.1.0" } }, + "please-upgrade-node": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.1.1.tgz", + "integrity": "sha512-KY1uHnQ2NlQHqIJQpnh/i54rKkuxCEBx+voJIS/Mvb+L2iYd2NMotwduhKTMjfC1uKoX3VXOxLjIYG66dfJTVQ==", + "dev": true, + "requires": { + "semver-compare": "^1.0.0" + } + }, "plugin-error": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-0.1.2.tgz", @@ -9219,6 +9706,12 @@ "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", "dev": true }, + "prettier": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.17.1.tgz", + "integrity": "sha512-TzGRNvuUSmPgwivDqkZ9tM/qTGW9hqDKWOE9YHiyQdixlKbv7kvEqsmDPrcHJTKwthU774TQwZXVtaQ/mMsvjg==", + "dev": true + }, "pretty-hrtime": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", @@ -9263,6 +9756,12 @@ "retry": "^0.10.0" } }, + "property-expr": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/property-expr/-/property-expr-1.5.1.tgz", + "integrity": "sha512-CGuc0VUTGthpJXL36ydB6jnbyOf/rAHFvmVrJlH+Rg0DqqLFQGAP6hIaxD/G0OAmBJPhXDHuEJigrp0e0wFV6g==", + "dev": true + }, "protoduck": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/protoduck/-/protoduck-5.0.1.tgz", @@ -10225,6 +10724,12 @@ "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", "dev": true }, + "semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", + "dev": true + }, "semver-diff": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", @@ -10431,12 +10936,44 @@ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, + "simple-git": { + "version": "1.113.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-1.113.0.tgz", + "integrity": "sha512-i9WVsrK2u0G/cASI9nh7voxOk9mhanWY9eGtWBDSYql6m49Yk5/Fan6uZsDr/xmzv8n+eQ8ahKCoEr8cvU3h+g==", + "dev": true, + "requires": { + "debug": "^4.0.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, "slash": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", "dev": true }, + "slice-ansi": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", + "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", + "dev": true + }, "smart-buffer": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.0.2.tgz", @@ -10966,6 +11503,12 @@ "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", "dev": true }, + "staged-git-files": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/staged-git-files/-/staged-git-files-1.1.2.tgz", + "integrity": "sha512-0Eyrk6uXW6tg9PYkhi/V/J4zHp33aNyi2hOCmhFLqLTIhbgqWn5jlSzI+IU0VqrZq6+DbHcabQl/WP6P3BG0QA==", + "dev": true + }, "static-extend": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", @@ -11094,6 +11637,12 @@ } } }, + "string-argv": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.0.2.tgz", + "integrity": "sha1-2sMECGkMIfPDYwo/86BYd73L1zY=", + "dev": true + }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -11114,6 +11663,17 @@ "safe-buffer": "~5.1.0" } }, + "stringify-object": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", + "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", + "dev": true, + "requires": { + "get-own-enumerable-property-symbols": "^3.0.0", + "is-obj": "^1.0.1", + "is-regexp": "^1.0.0" + } + }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", @@ -11238,6 +11798,12 @@ "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==", "dev": true }, + "synchronous-promise": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/synchronous-promise/-/synchronous-promise-2.0.9.tgz", + "integrity": "sha512-LO95GIW16x69LuND1nuuwM4pjgFGupg7pZ/4lU86AmchPKrhk0o2tpMU2unXRrqo81iAFe1YJ0nAGEVwsrZAgg==", + "dev": true + }, "tapable": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", @@ -11634,6 +12200,12 @@ "through2": "^2.0.3" } }, + "toposort": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/toposort/-/toposort-2.0.2.tgz", + "integrity": "sha1-riF2gXXRVZ1IvvNUILL0li8JwzA=", + "dev": true + }, "tough-cookie": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", @@ -11739,6 +12311,40 @@ } } }, + "tslint-config-prettier": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.18.0.tgz", + "integrity": "sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg==", + "dev": true + }, + "tslint-eslint-rules": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/tslint-eslint-rules/-/tslint-eslint-rules-5.4.0.tgz", + "integrity": "sha512-WlSXE+J2vY/VPgIcqQuijMQiel+UtmXS+4nvK4ZzlDiqBfXse8FAvkNnTcYhnQyOTW5KFM+uRRGXxYhFpuBc6w==", + "dev": true, + "requires": { + "doctrine": "0.7.2", + "tslib": "1.9.0", + "tsutils": "^3.0.0" + }, + "dependencies": { + "tslib": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz", + "integrity": "sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ==", + "dev": true + }, + "tsutils": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.14.0.tgz", + "integrity": "sha512-SmzGbB0l+8I0QwsPgjooFRaRvHLBLNYM8SeQ0k6rtNDru5sCGeLJcZdwilNndN+GysuFjF5EIYgN8GfFG6UeUw==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + } + } + }, "tsutils": { "version": "2.29.0", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", @@ -12974,6 +13580,20 @@ "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=", "dev": true }, + "yup": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/yup/-/yup-0.27.0.tgz", + "integrity": "sha512-v1yFnE4+u9za42gG/b/081E7uNW9mUj3qtkmelLbW5YPROZzSH/KUUyJu9Wt8vxFJcT9otL/eZopS0YK1L5yPQ==", + "dev": true, + "requires": { + "@babel/runtime": "^7.0.0", + "fn-name": "~2.0.1", + "lodash": "^4.17.11", + "property-expr": "^1.5.0", + "synchronous-promise": "^2.0.6", + "toposort": "^2.0.2" + } + }, "zone.js": { "version": "0.8.29", "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.8.29.tgz", diff --git a/package.json b/package.json index 2934eb06..6c851299 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,17 @@ "test-watch": "ng test gentics-ui-core --watch=true", "lint": "ng lint" }, + "lint-staged": { + "concurrent": false, + "subTaskConcurrency": 1, + "linters": { + "*.ts": [ + "tslint --fix", + "prettier --write", + "git add" + ] + } + }, "repository": { "type": "git", "url": "git+ssh://git@github.com:gentics/gentics-ui-core.git" @@ -107,15 +118,19 @@ "karma-jasmine": "~1.1.2", "karma-jasmine-html-reporter": "^0.2.2", "karma-junit-reporter": "^1.2.0", + "lint-staged": "^8.1.7", "marked": "~0.6.0", "ng-packagr": "^4.7.1", "ngx-build-plus": "^7.7.6", "node-sass-tilde-importer": "~1.0.2", + "prettier": "^1.17.1", "protractor": "~5.4.0", "raw-loader": "^1.0.0", "ts-node": "~7.0.0", "tsickle": ">=0.34.0", "tslint": "~5.11.0", + "tslint-config-prettier": "^1.18.0", + "tslint-eslint-rules": "^5.4.0", "typescript": "~3.2.2" } } diff --git a/tslint.json b/tslint.json index 2e8bfc66..23910531 100644 --- a/tslint.json +++ b/tslint.json @@ -104,5 +104,9 @@ "check-type", "check-typecast" ] - } + }, + "extends": [ + "tslint:latest", + "tslint-config-prettier" + ] }