From 6b2d16b5eaf3a47ac5a6cef9fcc232f12da4b27a Mon Sep 17 00:00:00 2001 From: Holger Stitz Date: Sat, 23 Nov 2019 13:43:12 +0100 Subject: [PATCH 1/4] Run `yo phovea:update` --- .circleci/config.yml | 45 ++++++++++++++++++++++---------------------- .gitignore | 20 ++------------------ .gitlab-ci.yml | 2 +- buildInfo.js | 2 +- deploy/Dockerfile | 2 +- 5 files changed, 27 insertions(+), 44 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0259523..8909887 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,50 +4,49 @@ jobs: working_directory: ~/phovea docker: - image: circleci/node:12-browsers - tags: - - /v\d+.\d+.\d+.*/ steps: - checkout - run: - name: Show node and npm version + name: Show Node.js and npm version command: | node -v npm -v - - run: - name: NPM Force Resolutions - command: npx npm-force-resolutions - restore_cache: - key: deps1-{{ .Branch }}-{{ checksum "package-lock.json" }} + key: deps1-{{ .Branch }}-{{ checksum "package.json" }} - run: name: Install npm dependencies - command: npm ci - # - run: - # name: Remove npm dependencies installed from git repositories (avoid caching of old commits) - # command: | - # (grep -l '._resolved.: .\(git[^:]*\|bitbucket\):' ./node_modules/*/package.json || true) | xargs -r dirname | xargs -r rm -rf + command: npm install + - run: + name: Remove npm dependencies installed from git repositories (avoid caching of old commits) + command: | + (grep -l '._resolved.: .\(git[^:]*\|bitbucket\):' ./node_modules/*/package.json || true) | xargs -r dirname | xargs -r rm -rf - save_cache: - key: deps1-{{ .Branch }}-{{ checksum "package-lock.json" }} + key: deps1-{{ .Branch }}-{{ checksum "package.json" }} paths: - ./node_modules - # - run: - # name: Install npm dependencies from git repositories (always get latest commit) - # command: npm install - run: - name: List node_modules directory - command: ls -la ./node_modules + name: Install npm dependencies from git repositories (always get latest commit) + command: npm install - run: name: Show installed npm dependencies - command: npm list --depth=2 || true - # add `|| true` to ignore error exit code and continue with next build step - # the errors for `npm list` after `npm ci` are already known (see https://npm.community/t/8758/) + command: npm list --depth=1 || true - run: - name: dist + name: Build command: npm run dist - store_artifacts: path: dist - workflows: version: 2 +# build-nightly: +# triggers: +# - schedule: +# cron: "15 1 * * 1-5" # "At 01:15 on every day-of-week from Monday through Friday.”, see: https://crontab.guru/#15_1_*_*_1-5 +# filters: +# branches: +# only: +# - develop +# jobs: +# - build build-branch: jobs: - build: diff --git a/.gitignore b/.gitignore index a203b0b..7fce761 100644 --- a/.gitignore +++ b/.gitignore @@ -1,27 +1,11 @@ -# general things to ignore /.tscache /.idea /build/ /dist/ -*.egg-info/ -*.egg -*.py[cod] -__pycache__/ -*.so -*~ -*.log -*.pot -*.pyc -*.swp -*.lock -# due to using tox and pytest -.tox -.cache -images -*.db node_modules/ /src/**/*.js /tests/**/*.js *.map *.css -/.cache-loader +*.log +/.cache-loader \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 05d99fb..7e48588 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: circleci/node:6-browsers +image: circleci/node:12-browsers variables: GIT_DEPTH: "1" diff --git a/buildInfo.js b/buildInfo.js index 09204ef..4e7bd68 100644 --- a/buildInfo.js +++ b/buildInfo.js @@ -139,7 +139,7 @@ function resolveScreenshot() { if (!fs.existsSync(f)) { return null; } - const buffer = new Buffer(fs.readFileSync(f)).toString('base64'); + const buffer = Buffer.from(fs.readFileSync(f)).toString('base64'); return `data:image/png;base64,${buffer}`; } diff --git a/deploy/Dockerfile b/deploy/Dockerfile index 3d8762e..af2902a 100644 --- a/deploy/Dockerfile +++ b/deploy/Dockerfile @@ -1,6 +1,6 @@ FROM nginx:alpine -MAINTAINER Samuel Gratzl +LABEL maintainer="contact@caleydo.org" ENV PHOVEA_API_SERVER=api ENV PHOVEA_NGINX_PORT=80 From 99e81accdae14e2df7e75360512412cc8d7d2964 Mon Sep 17 00:00:00 2001 From: Holger Stitz Date: Sat, 23 Nov 2019 13:45:55 +0100 Subject: [PATCH 2/4] Update package.json + package-lock.json --- package-lock.json | 12 +++++++++--- package.json | 10 +++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7ba86db..d371d9a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8258,6 +8258,12 @@ "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.19.tgz", "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==", "dev": true + }, + "typescript": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.7.2.tgz", + "integrity": "sha512-p5TCYZDAO0m4G344hD+wx/LATebLWZNkkh2asWUFqSsD2OrDNhbAHuSjobrmsUmdzjJjEeZVU9g1h3O6vpstnw==", + "dev": true } } }, @@ -8268,9 +8274,9 @@ "dev": true }, "typescript": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.7.2.tgz", - "integrity": "sha512-p5TCYZDAO0m4G344hD+wx/LATebLWZNkkh2asWUFqSsD2OrDNhbAHuSjobrmsUmdzjJjEeZVU9g1h3O6vpstnw==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.8.1.tgz", + "integrity": "sha512-Ao/f6d/4EPLq0YwzsQz8iXflezpTkQzqAyenTiw4kCUGr1uPiFLC3+fZ+gMZz6eeI/qdRUqvC+HxIJzUAzEFdg==", "dev": true }, "uglify-js": { diff --git a/package.json b/package.json index 1525404..c60256a 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "predocker": "npm run build", "docker": "docker build -t vega_clue -f deploy/Dockerfile .", "compile": "tsc", - "lint": "tslint -c tslint.json src/**.ts tests/**.ts", - "docs": "typedoc --options typedoc.json src/**.ts", + "lint": "tslint -c tslint.json -p .", + "docs": "typedoc --options typedoc.json src/**/.ts", "prebuild": "node -e \"process.exit(process.env.PHOVEA_SKIP_TESTS === undefined?1:0)\" || npm run test", "pretest": "npm run compile", "test": "test ! -d tests || karma start", @@ -30,8 +30,8 @@ "build" ], "engines": { - "npm": ">= 3", - "node": ">= 6" + "npm": ">= 6.12", + "node": ">= 12.13" }, "devDependencies": { "@types/jasmine": "2.5.47", @@ -61,7 +61,7 @@ "tslib": "1.9.0", "tslint": "5.9.1", "typedoc": "0.11.1", - "typescript": "2.7.2", + "typescript": "2.8.1", "url-loader": "0.5.8", "webpack": "2.3.3", "webpack-dev-server": "2.4.2", From a8bd718cd70c1153209f957446d14eb90c43b4da Mon Sep 17 00:00:00 2001 From: Holger Stitz Date: Sat, 23 Nov 2019 13:49:41 +0100 Subject: [PATCH 3/4] Revert some parts of the CircleCI config --- .circleci/config.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8909887..f5623cb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,25 +11,31 @@ jobs: command: | node -v npm -v + - run: + name: NPM Force Resolutions + command: npx npm-force-resolutions - restore_cache: - key: deps1-{{ .Branch }}-{{ checksum "package.json" }} + key: deps1-{{ .Branch }}-{{ checksum "package-lock.json" }} - run: name: Install npm dependencies - command: npm install - - run: - name: Remove npm dependencies installed from git repositories (avoid caching of old commits) - command: | - (grep -l '._resolved.: .\(git[^:]*\|bitbucket\):' ./node_modules/*/package.json || true) | xargs -r dirname | xargs -r rm -rf + command: npm ci + # - run: + # name: Remove npm dependencies installed from git repositories (avoid caching of old commits) + # command: | + # (grep -l '._resolved.: .\(git[^:]*\|bitbucket\):' ./node_modules/*/package.json || true) | xargs -r dirname | xargs -r rm -rf - save_cache: - key: deps1-{{ .Branch }}-{{ checksum "package.json" }} + key: deps1-{{ .Branch }}-{{ checksum "package-lock.json" }} paths: - ./node_modules + # - run: + # name: Install npm dependencies from git repositories (always get latest commit) + # command: npm install - run: - name: Install npm dependencies from git repositories (always get latest commit) - command: npm install + name: List node_modules directory + command: ls -la ./node_modules - run: name: Show installed npm dependencies - command: npm list --depth=1 || true + command: npm list --depth=2 || true - run: name: Build command: npm run dist From 3396dcd0d2b8d4e22049ac636528e6af694bc525 Mon Sep 17 00:00:00 2001 From: Holger Stitz Date: Sat, 23 Nov 2019 14:17:09 +0100 Subject: [PATCH 4/4] Deactivate typedoc compilation in package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c60256a..26f4394 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "scripts": { - "predist": "npm run build && npm run docs", + "predist": "npm run build", "predocker": "npm run build", "docker": "docker build -t vega_clue -f deploy/Dockerfile .", "compile": "tsc",