Skip to content

Commit

Permalink
Merge pull request #11 from eea/develop
Browse files Browse the repository at this point in the history
Remove hard dependencies to Volto add-ons to avoid dependencies hell
  • Loading branch information
avoinea committed Aug 27, 2021
2 parents f51ffa2 + 97283b2 commit ee01491
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 11 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,26 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [1.2.7](https://github.com/eea/volto-tabs-block/compare/1.2.6...1.2.7)

- Develop [`#10`](https://github.com/eea/volto-tabs-block/pull/10)
- Develop [`#9`](https://github.com/eea/volto-tabs-block/pull/9)
- Cypress coverage [`#8`](https://github.com/eea/volto-tabs-block/pull/8)
- Remove hard dependencies to Volto add-ons [`58c579e`](https://github.com/eea/volto-tabs-block/commit/58c579ebcacb6f924642ee6094e0668b430462b9)

#### [1.2.6](https://github.com/eea/volto-tabs-block/compare/1.2.5...1.2.6)

> 29 July 2021
- Release 1.2.6 [`b316664`](https://github.com/eea/volto-tabs-block/commit/b316664577eb1dceec94d82622c9dc2056dffbba)

#### [1.2.5](https://github.com/eea/volto-tabs-block/compare/1.2.4...1.2.5)

> 29 July 2021
- Develop [`#10`](https://github.com/eea/volto-tabs-block/pull/10)
- Develop [`#9`](https://github.com/eea/volto-tabs-block/pull/9)
- Move less import in View instead of Edit [`84aeff0`](https://github.com/eea/volto-tabs-block/commit/84aeff04a980076f54687c546691d37b6e790478)
- gitignore tweaks [`f4c993d`](https://github.com/eea/volto-tabs-block/commit/f4c993d004b126f08f16651ab9460546fa9e9cad)
- Add Sonarqube tag using frontend addons list [`865906a`](https://github.com/eea/volto-tabs-block/commit/865906a0deb261d44cc23e26bfd2d1dd0e319640)
- Add Sonarqube tag using frontend addons list [`5383861`](https://github.com/eea/volto-tabs-block/commit/538386100adbc868e693c1c2a5ba13461307ffee)
Expand Down
50 changes: 50 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
SHELL=/bin/bash

DIR=$(shell basename $$(pwd))
ADDON ?= "@eeacms/volto-tabs-block"

# We like colors
# From: https://coderwall.com/p/izxssa/colored-makefile-for-golang-projects
RED=`tput setaf 1`
GREEN=`tput setaf 2`
RESET=`tput sgr0`
YELLOW=`tput setaf 3`

project:
npm install -g yo
npm install -g @plone/generator-volto
npm install -g mrs-developer
yo @plone/volto project --addon ${ADDON} --workspace "src/addons/${DIR}" --no-interactive
ln -sf $$(pwd) project/src/addons/
cp .project.eslintrc.js .eslintrc.js
cd project && yarn
@echo "-------------------"
@echo "$(GREEN)Volto project is ready!$(RESET)"
@echo "$(RED)Now run: cd project && yarn start$(RESET)"

all: project

.PHONY: start-test-backend
start-test-backend: ## Start Test Plone Backend
@echo "$(GREEN)==> Start Test Plone Backend$(RESET)"
docker run -i --rm -e ZSERVER_HOST=0.0.0.0 -e ZSERVER_PORT=55001 -p 55001:55001 -e SITE=plone -e APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,kitconcept.volto:default-homepage -e CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,kitconcept.volto,kitconcept.volto.cors -e ADDONS='plone.app.robotframework plone.app.contenttypes plone.restapi kitconcept.volto' plone ./bin/robot-server plone.app.robotframework.testing.PLONE_ROBOT_TESTING

.PHONY: start-backend-docker
start-backend-docker: ## Starts a Docker-based backend
@echo "$(GREEN)==> Start Docker-based Plone Backend$(RESET)"
docker run -it --rm --name=plone -p 8080:8080 -e SITE=Plone -e ADDONS="kitconcept.volto" -e ZCML="kitconcept.volto.cors" plone

.PHONY: test
test:
docker pull plone/volto-addon-ci
docker run -it --rm -e NAMESPACE="@eeacms" -e GIT_NAME="${DIR}" -e RAZZLE_JEST_CONFIG=jest-addon.config.js -v "$$(pwd):/opt/frontend/my-volto-project/src/addons/${DIR}" plone/volto-addon-ci yarn test --watchAll=false

.PHONY: test-update
test-update:
docker pull plone/volto-addon-ci
docker run -it --rm -e NAMESPACE="@eeacms" -e GIT_NAME="${DIR}" -e RAZZLE_JEST_CONFIG=jest-addon.config.js -v "$$(pwd):/opt/frontend/my-volto-project/src/addons/${DIR}" plone/volto-addon-ci yarn test --watchAll=false -u

.PHONY: help
help: ## Show this help.
@echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)"
-s :)"
25 changes: 14 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-tabs-block",
"version": "1.2.5",
"version": "1.2.7",
"description": "volto-tabs-block: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand All @@ -22,24 +22,27 @@
"dependencies": {
"react-slick": "^0.24.0",
"slick-carousel": "^1.8.1",
"@eeacms/volto-block-style": "^2.5.1"
"@eeacms/volto-block-style": "*"
},
"devDependencies": {
"@cypress/code-coverage": "^3.9.5",
"babel-plugin-transform-class-properties": "^6.24.1"
},
"scripts": {
"release": "release-it",
"pre-commit": "yarn stylelint:fix && yarn prettier:fix && yarn lint:fix",
"bootstrap": "npm install -g ejs; npm link ejs; node bootstrap",
"stylelint": "../../../node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'",
"stylelint:overrides": "../../../node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'",
"test": "make test",
"test:fix": "make test-update",
"i18n": "rm -rf build/messages && NODE_ENV=production node src/i18n.js",
"pre-commit": "yarn stylelint:fix && yarn prettier:fix && yarn lint:fix",
"stylelint": "if [ -d ./project ]; then ./project/node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'; else ../../../node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'; fi",
"stylelint:overrides": "if [ -d ./project ]; then ./project/node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'; else ../../../node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'; fi",
"stylelint:fix": "yarn stylelint --fix && yarn stylelint:overrides --fix",
"prettier": "../../../node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'",
"prettier:fix": "../../../node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'",
"lint": "../../../node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'",
"lint:fix": "../../../node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'",
"cypress:run": "../../../node_modules/cypress/bin/cypress run",
"cypress:open": "../../../node_modules/cypress/bin/cypress open"
"prettier": "if [ -d ./project ]; then ./project/node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'; else ../../../node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'; fi",
"prettier:fix": "if [ -d ./project ]; then ./project/node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'; else ../../../node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'; fi",
"lint": "if [ -d ./project ]; then ./project/node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'; else ../../../node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'; fi",
"lint:fix": "if [ -d ./project ]; then ./project/node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'; else ../../../node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'; fi",
"cypress:run": "if [ -d ./project ]; then ./project/node_modules/cypress/bin/cypress run; else ../../../node_modules/cypress/bin/cypress run; fi",
"cypress:open": "if [ -d ./project ]; then ./project/node_modules/cypress/bin/cypress open; else ../../../node_modules/cypress/bin/cypress open; fi"
}
}

0 comments on commit ee01491

Please sign in to comment.