Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

Commit

Permalink
Release 6.0.0 (#23)
Browse files Browse the repository at this point in the history
Release 6.0.0
  • Loading branch information
dvvanessastoiber authored Jan 13, 2020
2 parents 2d720c6 + c28c7af commit 54d330e
Show file tree
Hide file tree
Showing 18 changed files with 215 additions and 177 deletions.
61 changes: 45 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,83 @@ jobs:
build:
working_directory: ~/phovea
docker:
- image: caleydo/phovea_circleci_python:v2.0
- image: circleci/python:3.7-buster-node-browsers # for node version see Dockerfile on https://hub.docker.com/r/circleci/python
steps:
- checkout
- run:
name: Show Node.js and npm version
command: |
node -v
npm -v
- run:
name: Show Python and pip version
command: |
python --version
pip --version
- run:
name: Install Docker packages from docker_packages.txt
command: |
(!(test -f docker_packages.txt) || (cat docker_packages.txt | xargs sudo apt-get install -y))
- restore_cache:
key: deps1-{{ checksum "package.json" }}
key: deps2-{{ .Branch }}-{{ checksum "package.json" }}
- run:
name: install-npm-wee
name: Install npm dependencies
command: npm install
- run: #remove all resolved github dependencies
name: delete-vcs-dependencies
- 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-{{ checksum "package.json" }}
key: deps2-{{ .Branch }}-{{ checksum "package.json" }}
paths:
- ./node_modules
- run: #install all dependencies
name: install-npm-wee2
- run:
name: Install npm dependencies from git repositories (always get latest commit)
command: npm install
- run:
name: Show installed npm dependencies
command: npm list --depth=1 || true
- restore_cache:
key: deps1-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }}
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }}
- run:
name: install-pip-wee
name: Install pip requirements
command: |
virtualenv ~/venv
. ~/venv/bin/activate
pip install -r requirements_dev.txt
pip install -r requirements.txt
- save_cache:
key: deps1-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }}
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }}
paths:
- ~/venv
- run: #force update of VCS dependencies?
name: update-pip-vcs-dependencies
- run:
name: Force an update of pip dependencies from git repositories # not sure if this is working ?
command: |
. ~/venv/bin/activate
pip install --upgrade --upgrade-strategy=only-if-needed -r requirements.txt
- run:
name: build
name: Show installed pip packages
command: pip list || true
- run:
name: Build
command: |
. ~/venv/bin/activate
npm run build
npm run dist
- store_artifacts:
path: dist
destination: 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:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ node_modules/
/tests/**/*.js
*.map
*.css
/.cache-loader
package-lock.json
42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

8 changes: 7 additions & 1 deletion .yo-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
"libraryExternals": [],
"entries": "./index.js",
"ignores": [],
"today": "Sun, 06 Nov 2016 22:40:46 GMT"
"today": "Sun, 06 Nov 2016 22:40:46 GMT",
"promptValues": {
"authorName": "The Caleydo Team",
"authorEmail": "contact@caleydo.org",
"authorUrl": "https://caleydo.org",
"githubAccount": "caleydo"
}
}
}
8 changes: 5 additions & 3 deletions buildInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function gitHead(cwd) {

function resolveModules() {
const reg = fs.readFileSync('../phovea_registry.js').toString();
const regex = /import '(.*)\/phovea_registry.js'/g;
const regex = /^import '(.*)\/phovea_registry.js'/gm;
const modules = [];
let r;
while ((r = regex.exec(reg)) !== null) {
Expand All @@ -56,7 +56,7 @@ function resolveWorkspace() {
let deps = null;
const resolveModule = (m) => {
console.log('resolve', m);
const pkg = require(`../${m}/package.json`);
const pkg = JSON.parse(fs.readFileSync(`../${m}/package.json`).toString());
const head = gitHead('../' + m);
const repo = pkg.repository.url;
return {
Expand Down Expand Up @@ -139,16 +139,18 @@ 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}`;
}

function metaData(pkg) {
pkg = pkg || require(`./package.json`);
return {
name: pkg.name,
displayName: pkg.displayName,
version: pkg.version,
repository: pkg.repository.url,
homepage: pkg.homepage,
description: pkg.description,
screenshot: resolveScreenshot()
};
Expand Down
69 changes: 69 additions & 0 deletions buildPython.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/**
* Created by sam on 13.11.2016.
*/

const spawnSync = require('child_process').spawnSync;
const fs = require('fs');

function gitHead(cwd) {
const r = spawnSync('git', ['rev-parse', '--verify', 'HEAD'], {
cwd: cwd
});
if (!r.stdout) {
console.error(cwd, r.error);
return 'error';
}
return r.stdout.toString().trim();
}

function resolvePlugin(repo, version) {
if (fs.lstatSync('.git').isDirectory() && repo) {
if (repo.endsWith('.git')) {
repo = repo.slice(0, repo.length - 4);
return repo + '/commit/' + gitHead('.');
}
}
// not a git repo
return version;
}

function toVersion(v) {
const now = new Date().toISOString();
// %Y%m%d-%H%M%S
const fmt = now
.replace(/T/, ' ')
.replace(/\..+/, '')
.replace(/[-:]/, '')
.replace(' ', '-');
return v.replace('SNAPSHOT', fmt);
}

function _main() {
const pkg = require('./package.json');
const name = pkg.name;
const version = toVersion(pkg.version);
const resolved = resolvePlugin((pkg.repository || {}).url, version);

const buildInfo = {
name,
version,
resolved,
description: pkg.description,
homepage: pkg.homepage,
repository: (pkg.repository || {}).url
};

const l = ('build/source/' + name.toLowerCase()).split('/');
l.forEach((_, i) => {
const path = l.slice(0, i + 1).join('/');
if (!fs.existsSync(path)) {
fs.mkdirSync(path);
}
});

fs.writeFileSync('build/source/' + name.toLowerCase() + '/buildInfo.json', JSON.stringify(buildInfo, null, ' '));
}

if (require.main === module) {
_main();
}
1 change: 1 addition & 0 deletions deploy/docker-compose.partial.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version: '2.0'
35 changes: 17 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "tdp_dummy",
"description": "",
"homepage": "https://phovea.caleydo.org",
"version": "5.0.0",
"version": "6.0.0",
"author": {
"name": "The Caleydo Team",
"email": "contact@caleydo.org",
Expand All @@ -18,8 +18,8 @@
},
"main": "build/tdp_dummy.js",
"engines": {
"npm": ">= 3",
"node": ">= 6",
"npm": ">= 6.12",
"node": ">= 12.13",
"iojs": ">= 3"
},
"files": [
Expand All @@ -43,7 +43,7 @@
"predist": "echo hybrid",
"dist": "npm run dist:web && npm run dist:python",
"compile": "tsc",
"lint": "tslint -c tslint.json -p .",
"lint": "tslint -c tslint.json -p . 'src/**/*.ts?(x)' 'tests/**/*.ts?(x)'",
"docs": "npm run docs:web && npm run docs:python",
"prebuild": "echo hybrid",
"posttest": "echo hybrid",
Expand All @@ -63,29 +63,31 @@
"test:python": "test ! $(find tests -name \"*.py\") || python setup.py test",
"predist:web": "npm run build:web && npm run docs:web",
"dist:web": "mkdirp dist && cd build && tar cvzf ../dist/tdp_dummy.tar.gz *",
"dist:python": "python setup.py bdist_egg",
"dist:python": "python setup.py sdist bdist_wheel",
"docs:web": "typedoc --options typedoc.json src/**.ts",
"docs:python": "sphinx-apidoc -o docs -f ./tdp_dummy && sphinx-build ./docs build/docs",
"build:python": "python build.py",
"build:python": "rm -rf build/source && find . -name '*.pyc' -delete && node buildPython.js && cp -r ./tdp_dummy build/source/",
"build:web": "webpack --env prod",
"prebuild:python": "node -e \"process.exit(process.env.PHOVEA_SKIP_TESTS === undefined?1:0)\" || npm run test:python",
"prebuild:web": "node -e \"process.exit(process.env.PHOVEA_SKIP_TESTS === undefined?1:0)\" || npm run test:web",
"predist:python": "npm run build:python && npm run docs:python"
},
"dependencies": {
"tdp_core": "github:datavisyn/tdp_core#semver:^5.0.2"
"tdp_core": "github:datavisyn/tdp_core#semver:^8.0.0"
},
"optionalDependencies": {
"dTiles": "github:datavisyn/dTiles#semver:^3.0.0",
"ordino": "github:Caleydo/ordino#semver:^5.0.0"
"ordino": "github:Caleydo/ordino#semver:^6.0.0"
},
"devDependencies": {
"@types/jasmine": "2.5.47",
"awesome-typescript-loader": "3.1.2",
"cache-loader": "1.2.0",
"css-loader": "0.28.0",
"extract-loader": "0.1.0",
"extract-text-webpack-plugin": "2.1.0",
"extract-loader": "0.1.0",
"ifdef-loader": "2.0.0",
"file-loader": "0.11.1",
"fork-ts-checker-webpack-plugin": "0.4.1",
"html-loader": "0.4.5",
"imports-loader": "0.7.1",
"jasmine": "2.5.3",
Expand All @@ -98,22 +100,19 @@
"karma-sourcemap-loader": "0.3.7",
"karma-webpack": "2.0.3",
"mkdirp": "0.5.1",
"node-sass": "4.7.2",
"node-sass": "^4.12.0",
"null-loader": "0.1.1",
"raw-loader": "0.5.1",
"sass-loader": "6.0.7",
"style-loader": "0.16.1",
"thread-loader": "1.1.2",
"ts-loader": "4.0.1",
"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",
"cache-loader": "1.2.0",
"ifdef-loader": "2.0.0",
"fork-ts-checker-webpack-plugin": "0.4.1",
"thread-loader": "1.1.2",
"ts-loader": "4.0.1"
"webpack-dev-server": "2.4.2"
}
}
4 changes: 0 additions & 4 deletions phovea.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,23 +128,19 @@ module.exports = function (registry, feature) {
factory: 'createScore'
});


/// #if include('dTiles')
registry.push('dTilesSearchProvider', 'dummyA', function () {
return import('./src/DummySearchProvider')
}, {
idType: 'IDTypeA',
factory: 'createA'
});


registry.push('dTilesSearchProvider', 'dummyB', function () {
return import('./src/DummySearchProvider')
}, {
idType: 'IDTypeB',
factory: 'createB'
});
/// #endif
// generator-phovea:end
};

Loading

0 comments on commit 54d330e

Please sign in to comment.