Skip to content

Commit

Permalink
Merge pull request #65 from eea/develop
Browse files Browse the repository at this point in the history
Latest volto compatibility
  • Loading branch information
avoinea committed Oct 27, 2022
2 parents 77c2a8f + b4eade9 commit 08c219f
Show file tree
Hide file tree
Showing 21 changed files with 672 additions and 321 deletions.
2 changes: 1 addition & 1 deletion .coverage.babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const defaultBabel = require('@plone/volto/babel');

function applyDefault(api) {
const voltoBabel = defaultBabel(api);
voltoBabel.plugins.push('@babel/plugin-transform-modules-commonjs', 'transform-class-properties', 'istanbul');
voltoBabel.plugins.push('istanbul');
return voltoBabel;
}

Expand Down
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
.vscode/
.history
.eslintrc.js
.nyc_output
project
coverage
logs
*.log
npm-debug.log*
.DS_Store
*.swp
yarn-error.log
yarn.lock
package-lock.json

node_modules
build
dist
cypress/videos
cypress/reports
screenshots
videos
.env.local
.env.development.local
.env.test.local
Expand Down
1 change: 1 addition & 0 deletions .i18n.babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@plone/volto/babel');
96 changes: 96 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# https://docs.npmjs.com/using-npm/developers.html#keeping-files-out-of-your-package

# Directories
api/
bin/
build/
lib/
g-api/
tests/

# Docs
docs/

# Cypress
cypress/

# Tests
__tests__/
*.snap

# Files
.travis.yml
requirements-docs.txt
requirements-tests.txt
yarn.lock
.dockerignore
.gitattributes
.yarnrc
.nvmrc
changelogupdater.js
pip-selfcheck.json
Dockerfile
CNAME
entrypoint.sh
Jenkinsfile
Makefile

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

styleguide.config
.vscode
packages
18 changes: 5 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ 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).

### [4.0.0](https://github.com/eea/volto-block-style/compare/3.7.2...4.0.0) - 25 October 2022

#### :hammer_and_wrench: Others

- Bring this up to date [Miu Razvan - [`6d7e7a4`](https://github.com/eea/volto-block-style/commit/6d7e7a46078d858800eb894ffb1eba42bdd384e0)]
### [3.7.2](https://github.com/eea/volto-block-style/compare/3.7.1...3.7.2) - 27 September 2022

#### :bug: Bug Fixes
Expand All @@ -19,7 +24,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`928339f`](https://github.com/eea/volto-block-style/commit/928339ffd2991b24844a9ca3691523d7e692ca91)]
### [3.7.0](https://github.com/eea/volto-block-style/compare/3.6.3...3.7.0) - 22 September 2022

#### :hammer_and_wrench: Others
Expand All @@ -39,14 +43,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`c8977dc`](https://github.com/eea/volto-block-style/commit/c8977dc8d8f623601c763aff13c1a8df5fd1eb13)]
### [3.6.0](https://github.com/eea/volto-block-style/compare/3.5.18...3.6.0) - 9 June 2022

#### :hammer_and_wrench: Others

- Release 3.6.0 [Alin Voinea - [`f0b6eb8`](https://github.com/eea/volto-block-style/commit/f0b6eb885feee2bb02fdd4daf6ee7a4747518b23)]
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`e7a6cf9`](https://github.com/eea/volto-block-style/commit/e7a6cf9ba635161d1222e2d5db4c83cb680e3ce2)]
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`a648e9b`](https://github.com/eea/volto-block-style/commit/a648e9b7667bc496050c02c2fcc8b4a3a0a7af1c)]
### [3.5.18](https://github.com/eea/volto-block-style/compare/3.5.17...3.5.18) - 3 March 2022

### [3.5.17](https://github.com/eea/volto-block-style/compare/3.5.16...3.5.17) - 2 March 2022
Expand Down Expand Up @@ -107,7 +108,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`ccd5b62`](https://github.com/eea/volto-block-style/commit/ccd5b622c05a9ee3d906d6eb5df0288fa25a694b)]
- added cy tests [Daniela Mormocea - [`ed8dc6f`](https://github.com/eea/volto-block-style/commit/ed8dc6f55f1f48cb84f6c9879eb4a728e1308639)]
### [3.5.8](https://github.com/eea/volto-block-style/compare/3.5.7...3.5.8) - 13 December 2021

Expand Down Expand Up @@ -137,20 +137,17 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`813a0f5`](https://github.com/eea/volto-block-style/commit/813a0f5a2d1f563b184475a3e6ff620a733ba5da)]
### [3.5.2](https://github.com/eea/volto-block-style/compare/3.5.1...3.5.2) - 29 October 2021

### [3.5.1](https://github.com/eea/volto-block-style/compare/3.5.0...3.5.1) - 19 October 2021

#### :hammer_and_wrench: Others

- Add Sonarqube tag using sustainability-frontend addons list [EEA Jenkins - [`8b20d02`](https://github.com/eea/volto-block-style/commit/8b20d02f809e456af84aaea5ad74115c00e39c3e)]
### [3.5.0](https://github.com/eea/volto-block-style/compare/3.4.5...3.5.0) - 25 September 2021

#### :hammer_and_wrench: Others

- Release 3.5.0 [Alin Voinea - [`0a5a98e`](https://github.com/eea/volto-block-style/commit/0a5a98e531f93470956673e50b6c71f37f59b49e)]
- Add Sonarqube tag using ims-frontend addons list [EEA Jenkins - [`30bb3aa`](https://github.com/eea/volto-block-style/commit/30bb3aa5f49ed5264cf609d6b8f234b07b7988ca)]
### [3.4.5](https://github.com/eea/volto-block-style/compare/3.4.4...3.4.5) - 31 August 2021

#### :hammer_and_wrench: Others
Expand Down Expand Up @@ -207,10 +204,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- Add range slider [Tiberiu Ichim - [`8a91ef1`](https://github.com/eea/volto-block-style/commit/8a91ef168df01e4a0f114596d50a401a14a41251)]
- Separate block wrapping; don't apply multiple times [Tiberiu Ichim - [`2adffd5`](https://github.com/eea/volto-block-style/commit/2adffd58a99af59bb42d72c54f2a05be3b9b2ea1)]
- Separate block wrapping; don't apply multiple times [Tiberiu Ichim - [`584e7a9`](https://github.com/eea/volto-block-style/commit/584e7a9859c7d417708f9aa78b83e94547f2f1ab)]
- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`f6737ef`](https://github.com/eea/volto-block-style/commit/f6737ef68ba906c5fb72e18c77b060aa82ed0a73)]
- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`6a4c6c1`](https://github.com/eea/volto-block-style/commit/6a4c6c16acc88471279a82a62b92555dc1ac20cc)]
- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`2101b55`](https://github.com/eea/volto-block-style/commit/2101b550588402b37cd91b5d582e27a6255d6cac)]
- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`2583c68`](https://github.com/eea/volto-block-style/commit/2583c68ea49ddbedc7b90b9d477cbbe4e2b779fd)]
- Add hidden toggle [Tiberiu Ichim - [`3b8ed26`](https://github.com/eea/volto-block-style/commit/3b8ed26a82c31ff430301adceea1174e92464a77)]
- Add a clear button to the box size widget [Tiberiu Ichim - [`4bdf803`](https://github.com/eea/volto-block-style/commit/4bdf8030d7a4d39d3a48b56ed6c8cddc311b3ff7)]
### [3.3.3](https://github.com/eea/volto-block-style/compare/3.3.2...3.3.3) - 25 June 2021
Expand Down Expand Up @@ -368,7 +361,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- React color ~2.18.1 [Alin Voinea - [`597da25`](https://github.com/eea/volto-block-style/commit/597da253f5266ecc9d0d6e10ee4d365432433416)]
- Cleanup [Alin Voinea - [`8fb40cf`](https://github.com/eea/volto-block-style/commit/8fb40cf4fe721cc26120ab1231d48c4c9eab88a9)]
- Fix README screenshot path [Alin Voinea - [`81f09ec`](https://github.com/eea/volto-block-style/commit/81f09ec9d95b3a555d0bc7e0aa3ad08b4ab005db)]
- yarn prettier [Alin Voinea - [`04f3b9a`](https://github.com/eea/volto-block-style/commit/04f3b9ae36ea8c6d99dad1f6d4cf56e81c032e1a)]
### [0.1.1](https://github.com/eea/volto-block-style/compare/0.1.0...0.1.1) - 22 October 2020

#### :hammer_and_wrench: Others
Expand Down
16 changes: 8 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ pipeline {
environment {
GIT_NAME = "volto-block-style"
NAMESPACE = "@eeacms"
SONARQUBE_TAGS = "volto.eea.europa.eu,climate-energy.eea.europa.eu,forest.eea.europa.eu,clms.land.copernicus.eu,biodiversity.europa.eu,www.eea.europa.eu-ims,sustainability.eionet.europa.eu,industry.eea.europa.eu,water.europa.eu-freshwater,demo-www.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu,circularity.eea.europa.eu,prod-www.eea.europa.eu"
SONARQUBE_TAGS = "volto.eea.europa.eu,climate-energy.eea.europa.eu,forest.eea.europa.eu,clms.land.copernicus.eu,biodiversity.europa.eu,www.eea.europa.eu-ims,sustainability.eionet.europa.eu,industry.eea.europa.eu,water.europa.eu-freshwater,demo-www.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu,circularity.eea.europa.eu,prod-www.eea.europa.eu,water.europa.eu-marine"
DEPENDENCIES = ""
VOLTO = "16.0.0-alpha.14"
VOLTO = "alpha"
}

stages {
Expand Down Expand Up @@ -41,19 +41,19 @@ pipeline {

"ES lint": {
node(label: 'docker') {
sh '''docker run -i --rm --name="$BUILD_TAG-eslint" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci eslint'''
sh '''docker run -i --rm --name="$BUILD_TAG-eslint" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci:alpha eslint'''
}
},

"Style lint": {
node(label: 'docker') {
sh '''docker run -i --rm --name="$BUILD_TAG-stylelint" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci stylelint'''
sh '''docker run -i --rm --name="$BUILD_TAG-stylelint" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci:alpha stylelint'''
}
},

"Prettier": {
node(label: 'docker') {
sh '''docker run -i --rm --name="$BUILD_TAG-prettier" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci prettier'''
sh '''docker run -i --rm --name="$BUILD_TAG-prettier" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci:alpha prettier'''
}
}
)
Expand All @@ -77,8 +77,8 @@ pipeline {
node(label: 'docker') {
script {
try {
sh '''docker pull plone/volto-addon-ci'''
sh '''docker run -i --name="$BUILD_TAG-volto" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci'''
sh '''docker pull plone/volto-addon-ci:alpha'''
sh '''docker run -i --name="$BUILD_TAG-volto" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci:alpha'''
sh '''rm -rf xunit-reports'''
sh '''mkdir -p xunit-reports'''
sh '''docker cp $BUILD_TAG-volto:/opt/frontend/my-volto-project/coverage xunit-reports/'''
Expand Down Expand Up @@ -126,7 +126,7 @@ pipeline {
script {
try {
sh '''docker pull eeacms/plone-backend; docker run --rm -d --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="eea.kitkat:testing" eeacms/plone-backend'''
sh '''docker pull plone/volto-addon-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" -e NODE_ENV=development -e VOLTO="$VOLTO" plone/volto-addon-ci cypress'''
sh '''docker pull plone/volto-addon-ci:alpha; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" -e NODE_ENV=development -e VOLTO="$VOLTO" -e VOLTO=$VOLTO plone/volto-addon-ci:alpha cypress'''
} finally {
try {
sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
Expand Down
97 changes: 71 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SHELL=/bin/bash

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

# We like colors
# From: https://coderwall.com/p/izxssa/colored-makefile-for-golang-projects
Expand All @@ -10,7 +10,7 @@ GREEN=`tput setaf 2`
RESET=`tput sgr0`
YELLOW=`tput setaf 3`

project: ## Make a demo Volto project
project:
npm install -g yo
npm install -g @plone/generator-volto
npm install -g mrs-developer
Expand All @@ -19,35 +19,80 @@ project: ## Make a demo Volto project
cp .project.eslintrc.js .eslintrc.js
cd project && yarn
@echo "-------------------"
@echo "Project is ready!"
@echo "Now run: cd project && yarn start"
@echo "$(GREEN)Volto project is ready!$(RESET)"
@echo "$(RED)Now run: cd project && yarn start$(RESET)"

.PHONY: build-backend
build-backend: ## Build Plone 5.2
(cd api && python3 -m venv .)
(cd api && bin/pip install --upgrade pip)
(cd api && bin/pip install --upgrade wheel)
(cd api && bin/pip install -r requirements.txt)
(cd api && bin/buildout)

.PHONY: build
build:
make build-backend
make build-frontend

all: build

.PHONY: start-backend
start-backend: ## Start Plone Backend
@echo "$(GREEN)==> Start Plone Backend$(RESET)"
(cd api && PYTHONWARNINGS=ignore bin/instance fg)
all: project

.PHONY: start-test-backend
start-test-backend: ## Start Test Plone Backend
@echo "$(GREEN)==> Start Test Plone Backend$(RESET)"
ZSERVER_PORT=55001 CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,kitconcept.volto,kitconcept.volto.cors,eea.volto.slate APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,kitconcept.volto:default-homepage,eea.volto.slate:default ./api/bin/robot-server plone.app.robotframework.testing.PLONE_ROBOT_TESTING
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:alpha
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}" -e CI="true" plone/volto-addon-ci:alpha

.PHONY: test-update
test-update:
docker pull plone/volto-addon-ci:alpha
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}" -e CI="true" plone/volto-addon-ci:alpha yarn test src/addons/${DIR}/src --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 :)"
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 :)"


ifeq ($(wildcard ./project),)
NODE_MODULES = "../../../node_modules"
else
NODE_MODULES = "./project/node_modules"
endif

.PHONY: stylelint
stylelint:
$(NODE_MODULES)/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'

.PHONY: stylelint-overrides
stylelint-overrides:
$(NODE_MODULES)/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'

.PHONY: stylelint-fix
stylelint-fix:
$(NODE_MODULES)/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}' --fix
$(NODE_MODULES)/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides' --fix

.PHONY: prettier
prettier:
$(NODE_MODULES)/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'

.PHONY: prettier-fix
prettier-fix:
$(NODE_MODULES)/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'

.PHONY: lint
lint:
$(NODE_MODULES)/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'

.PHONY: lint-fix
lint-fix:
$(NODE_MODULES)/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'

.PHONY: i18n
i18n:
rm -rf build/messages
NODE_ENV=development $(NODE_MODULES)/.bin/i18n --addon

.PHONY: cypress-run
cypress-run:
NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress run

.PHONY: cypress-open
cypress-open:
NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress open
Loading

0 comments on commit 08c219f

Please sign in to comment.