diff --git a/.circleci/config.yml b/.circleci/config.yml index 2740dfa..4531c5f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,9 +1,18 @@ -version: 2 -jobs: - build: - working_directory: ~/phovea +version: 2.1 + +executors: + python-executor: + working_directory: ~/phovea-python docker: - image: circleci/python:3.7-buster-node-browsers # for node version see Dockerfile on https://hub.docker.com/r/circleci/python + node-executor: + working_directory: ~/phovea-web + docker: + - image: circleci/node:12.13-buster-browsers + +jobs: + python-build: + executor: python-executor steps: - checkout - run: @@ -20,25 +29,6 @@ jobs: 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: deps2-{{ .Branch }}-{{ checksum "package.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 - - save_cache: - key: deps2-{{ .Branch }}-{{ checksum "package.json" }} - paths: - - ./node_modules - - 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-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }} - run: @@ -60,16 +50,96 @@ jobs: - run: name: Show installed pip packages command: pip list || true + - run: + name: Remove all from dist folder + command: | + rm -rf dist && mkdir dist - run: name: Build command: | . ~/venv/bin/activate - npm run dist + npm run dist:python - store_artifacts: path: dist - destination: dist + destination: dist-python + - persist_to_workspace: + root: ~/. + paths: phovea-python + python-publish: + executor: python-executor + steps: + - attach_workspace: + at: ~/. + - run: ls -a + - run: + name: Install twine + command: | + virtualenv ~/venv + . ~/venv/bin/activate + pip install twine + - run: + name: Authentication + command: | + echo -e "[pypi]" >> ~/.pypirc + echo -e "repository = $PYPI_REPOSITORY" >> ~/.pypirc + echo -e "username = $PYPI_USERNAME" >> ~/.pypirc + echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc + - run: + name: Publish package + command: | + . ~/venv/bin/activate + twine upload dist/* + web-build: + executor: node-executor + steps: + - checkout + - run: + name: Show Node.js and npm version + command: | + node -v + npm -v + - restore_cache: + key: deps1-{{ .Branch }}-{{ checksum "package.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 + - save_cache: + 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: Show installed npm dependencies + command: npm list --depth=1 || true + - run: + name: Build + command: npm run dist:web + - store_artifacts: + path: dist + destination: dist-web + - persist_to_workspace: + root: ~/. + paths: phovea-web + web-publish: + executor: node-executor + steps: + - attach_workspace: + at: ~/. + - run: ls -a + - run: + name: Authentication + command: | + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc + - run: + name: Publish package + command: npm publish workflows: - version: 2 + version: 2.1 # build-nightly: # triggers: # - schedule: @@ -79,18 +149,51 @@ workflows: # only: # - develop # jobs: -# - build - build-branch: +# - python-build +# - web-build + build-branches-only: jobs: - - build: + - python-build: filters: tags: - ignore: /^v.*/ - build-tag: + ignore: /.*/ + - web-build: + filters: + tags: + ignore: /.*/ + build-publish-tag: jobs: - - build: + - python-build: + filters: + branches: + ignore: /.*/ + tags: + only: /^v.*/ + - web-build: filters: branches: ignore: /.*/ tags: only: /^v.*/ + - python-publish: + context: + - org-public + requires: + - python-build + - web-build + filters: + branches: + ignore: /.*/ + tags: + only: /^v.*/ + - web-publish: + context: + - org-public + requires: + - python-build + - web-build + filters: + branches: + ignore: /.*/ + tags: + only: /^v.*/ diff --git a/.gitattributes b/.gitattributes index 544c336..711da28 100644 --- a/.gitattributes +++ b/.gitattributes @@ -125,3 +125,10 @@ AUTHORS text # with the python modules ``pickle``, ``dbm.*``, # ``shelve``, ``marshal``, ``anydbm``, & ``bsddb`` # (among others). + + +# Mark compiled files as generated to hide them in PRs +/dist/** linguist-generated=true + +# Hide compiled files from git diff and auto-replace them when merging different branches +/dist/** -diff -merge diff --git a/.gitignore b/.gitignore index 8d6a52a..fd3fcc7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ /.tscache /.idea /build/ +/dist/tsBuildInfoFile *.egg-info/ *.egg *.py[cod] diff --git a/dist/scss/abstracts/_mixins.scss b/dist/scss/abstracts/_mixins.scss new file mode 100644 index 0000000..e69de29 diff --git a/dist/scss/abstracts/_variables.scss b/dist/scss/abstracts/_variables.scss new file mode 100644 index 0000000..e69de29 diff --git a/dist/scss/base/_base.scss b/dist/scss/base/_base.scss new file mode 100644 index 0000000..e69de29 diff --git a/dist/scss/_idtype_color.scss b/dist/scss/components/_idtype_color.scss similarity index 68% rename from dist/scss/_idtype_color.scss rename to dist/scss/components/_idtype_color.scss index 715f38e..ad42aa6 100644 --- a/dist/scss/_idtype_color.scss +++ b/dist/scss/components/_idtype_color.scss @@ -1,5 +1,3 @@ -@import "~tdp_core/dist/scss/idtype_color"; - * { @include idtype_color('IDTypeA', #73dbff); @include idtype_color('IDTypeB', #ff82a0); diff --git a/dist/scss/main.scss b/dist/scss/main.scss index 1fbea77..1558b36 100644 --- a/dist/scss/main.scss +++ b/dist/scss/main.scss @@ -1,4 +1,7 @@ -/** - * Created by Samuel Gratzl on 16.12.2015 - */ -@import './idtype_color'; + @import "./abstracts/mixins"; + @import "./abstracts/variables"; + + @import "./base/base"; + + @import "./components/idtype_color"; + \ No newline at end of file diff --git a/jest.config.js b/jest.config.js index 8024c72..3a68180 100644 --- a/jest.config.js +++ b/jest.config.js @@ -38,7 +38,7 @@ module.exports = { "__APP_CONTEXT__": "TEST_CONTEXT", // has to be set to true, otherwise i18n import fails "ts-jest": { - "tsConfig": { + "tsconfig": { "esModuleInterop": true } } diff --git a/package.json b/package.json index 272e5c5..5478e35 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "tdp_dummy", "description": "", "homepage": "https://phovea.caleydo.org", - "version": "8.0.0", + "version": "9.0.0", "author": { "name": "The Caleydo Team", "email": "contact@caleydo.org", @@ -74,22 +74,22 @@ "predist:python": "npm run build:python && npm run docs:python" }, "dependencies": { - "tdp_core": "^10.0.1" - }, - "optionalDependencies": { - "ordino": "github:Caleydo/ordino#semver:^8.0.1" + "tdp_core": "^11.0.0" }, "devDependencies": { - "@types/jest": "~26.0.5", + "@types/jest": "~26.0.20", "identity-obj-proxy": "~3.0.0", - "jest": "~26.1.0", + "jest": "~26.6.3", "jest-raw-loader": "~1.0.1", "rimraf": "~3.0.2", - "shx": "~0.3.2", - "ts-jest": "~26.1.3", - "tslib": "~2.0.0", + "shx": "~0.3.3", + "ts-jest": "~26.4.4", + "tslib": "~2.0.3", "tslint": "~5.20.1", - "typedoc": "~0.17.8", + "typedoc": "~0.19.2", "typescript": "~3.9.7" + }, + "optionalDependencies": { + "ordino": "github:Caleydo/ordino#semver:^9.0.0" } } diff --git a/requirements.txt b/requirements.txt index 3b2b590..5cf2b6c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -tdp_core>=10.0.0,<11.0.0 +tdp_core>=11.0.0,<12.0.0 \ No newline at end of file diff --git a/requirements_dev.txt b/requirements_dev.txt index f34272b..10476e2 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,6 +1,6 @@ -flake8==3.7.9 -pep8-naming==0.9.1 -pytest==5.3.5 +flake8==3.8.4 +pep8-naming==0.11.1 +pytest==6.1.2 pytest-runner==5.2 -Sphinx==2.4.2 +Sphinx==3.3.1 recommonmark==0.6.0 diff --git a/src/scss/abstracts/_mixins.scss b/src/scss/abstracts/_mixins.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/scss/abstracts/_variables.scss b/src/scss/abstracts/_variables.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/scss/base/_base.scss b/src/scss/base/_base.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/scss/_idtype_color.scss b/src/scss/components/_idtype_color.scss similarity index 68% rename from src/scss/_idtype_color.scss rename to src/scss/components/_idtype_color.scss index 715f38e..ad42aa6 100644 --- a/src/scss/_idtype_color.scss +++ b/src/scss/components/_idtype_color.scss @@ -1,5 +1,3 @@ -@import "~tdp_core/dist/scss/idtype_color"; - * { @include idtype_color('IDTypeA', #73dbff); @include idtype_color('IDTypeB', #ff82a0); diff --git a/src/scss/main.scss b/src/scss/main.scss index 1fbea77..1558b36 100644 --- a/src/scss/main.scss +++ b/src/scss/main.scss @@ -1,4 +1,7 @@ -/** - * Created by Samuel Gratzl on 16.12.2015 - */ -@import './idtype_color'; + @import "./abstracts/mixins"; + @import "./abstracts/variables"; + + @import "./base/base"; + + @import "./components/idtype_color"; + \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index e7bc9b2..2e06f21 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,9 @@ "esModuleInterop": false, "resolveJsonModule": true, "allowSyntheticDefaultImports": true, - "preserveWatchOutput": true + "preserveWatchOutput": true, + "incremental": true, + "tsBuildInfoFile": "dist/tsBuildInfoFile" }, "include": [ "src/**/*.ts",