Skip to content

Commit

Permalink
Merge pull request #5 from eea/develop
Browse files Browse the repository at this point in the history
refactor: use latest volto
  • Loading branch information
claudiaifrim committed Nov 1, 2022
2 parents 9b9ab80 + 3a3a8f1 commit 526bff2
Show file tree
Hide file tree
Showing 20 changed files with 697 additions and 238 deletions.
2 changes: 1 addition & 1 deletion .coverage.babel.config.js
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
4 changes: 4 additions & 0 deletions .gitignore
@@ -1,13 +1,17 @@
.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
Expand Down
1 change: 1 addition & 0 deletions .i18n.babel.config.js
@@ -0,0 +1 @@
module.exports = require('@plone/volto/babel');
96 changes: 96 additions & 0 deletions .npmignore
@@ -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
46 changes: 22 additions & 24 deletions CHANGELOG.md
Expand Up @@ -4,39 +4,37 @@ 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).

#### [0.1.4](https://github.com/eea/volto-openlayers-map/compare/0.1.3...0.1.4)
### [0.2.0](https://github.com/eea/volto-openlayers-map/compare/0.1.4...0.2.0) - 1 November 2022

- Add ol/geom import to index.js [`ec72691`](https://github.com/eea/volto-openlayers-map/commit/ec72691270517325d2bb1601a35a4046215f2441)
- Refs #142010 - Optimize Volto-addons gitflow pipelines [`8c08bb6`](https://github.com/eea/volto-openlayers-map/commit/8c08bb699f8ecafe631b6dd14899f008edb166d3)
#### :nail_care: Enhancements

#### [0.1.3](https://github.com/eea/volto-openlayers-map/compare/0.1.2...0.1.3)
- refactor: use latest volto [Miu Razvan - [`e39dd15`](https://github.com/eea/volto-openlayers-map/commit/e39dd153e7a4922892514bdcce079f8e4ecf1ffc)]

> 29 October 2021
### [0.1.4](https://github.com/eea/volto-openlayers-map/compare/0.1.3...0.1.4) - 13 April 2022

- Rendering improvments [`#3`](https://github.com/eea/volto-openlayers-map/pull/3)
#### :hammer_and_wrench: Others

#### [0.1.2](https://github.com/eea/volto-openlayers-map/compare/0.1.1...0.1.2)
- Refs #142010 - Optimize Volto-addons gitflow pipelines [valentinab25 - [`8c08bb6`](https://github.com/eea/volto-openlayers-map/commit/8c08bb699f8ecafe631b6dd14899f008edb166d3)]
### [0.1.3](https://github.com/eea/volto-openlayers-map/compare/0.1.2...0.1.3) - 29 October 2021

> 21 September 2021
### [0.1.2](https://github.com/eea/volto-openlayers-map/compare/0.1.1...0.1.2) - 21 September 2021

- Patch #1 [`#2`](https://github.com/eea/volto-openlayers-map/pull/2)
- Use ol#6.6.x version as there is a bug with the latest version [`8eab985`](https://github.com/eea/volto-openlayers-map/commit/8eab98575f93abf1f6e0e49855fd5737e0ca3b36)
- Added Control; Improved performance [`41e3536`](https://github.com/eea/volto-openlayers-map/commit/41e35369aa97e55f17f8b60d23317671a85ca7dc)
#### :hammer_and_wrench: Others

#### [0.1.1](https://github.com/eea/volto-openlayers-map/compare/0.1.0...0.1.1)
- Use ol#6.6.x version as there is a bug with the latest version [Miu Razvan - [`8eab985`](https://github.com/eea/volto-openlayers-map/commit/8eab98575f93abf1f6e0e49855fd5737e0ca3b36)]
- Added Control; Improved performance [razvanMiu - [`41e3536`](https://github.com/eea/volto-openlayers-map/commit/41e35369aa97e55f17f8b60d23317671a85ca7dc)]
### [0.1.1](https://github.com/eea/volto-openlayers-map/compare/0.1.0...0.1.1) - 31 May 2021

> 31 May 2021
#### :hammer_and_wrench: Others

- Cypress coverage [`#1`](https://github.com/eea/volto-openlayers-map/pull/1)
- fix json [`2e0ae9d`](https://github.com/eea/volto-openlayers-map/commit/2e0ae9dc87d97d0cb5904dd8f8c51e153f0e29a2)
- fix json [valentinab25 - [`2e0ae9d`](https://github.com/eea/volto-openlayers-map/commit/2e0ae9dc87d97d0cb5904dd8f8c51e153f0e29a2)]
### 0.1.0 - 26 May 2021

#### 0.1.0
#### :hammer_and_wrench: Others

> 26 May 2021
- Lint fix [`ec2c2e4`](https://github.com/eea/volto-openlayers-map/commit/ec2c2e43a46c158bb813ade32834bf328b444895)
- Added Heatmap layer [`f802e76`](https://github.com/eea/volto-openlayers-map/commit/f802e76e81c353da9f4e2b7058e40a0fff9f1fe5)
- Added VectorImage & WebGLPoints layers [`f128860`](https://github.com/eea/volto-openlayers-map/commit/f128860ec396f2ad7f6e7791a0054ad9a0f6e6df)
- Openleyers components implemented [`99b84e6`](https://github.com/eea/volto-openlayers-map/commit/99b84e695e860e44ff6f728e37ca8493b9b06b0c)
- Added components for openlayers [`b40679c`](https://github.com/eea/volto-openlayers-map/commit/b40679c21483151c1e588c0dfd1fa9ad5fdfc733)
- Initial commit [`6d0d613`](https://github.com/eea/volto-openlayers-map/commit/6d0d613377abb206619a5506e1a7fb04e56b9e4b)
- Lint fix [razvanMiu - [`ec2c2e4`](https://github.com/eea/volto-openlayers-map/commit/ec2c2e43a46c158bb813ade32834bf328b444895)]
- Added Heatmap layer [razvanMiu - [`f802e76`](https://github.com/eea/volto-openlayers-map/commit/f802e76e81c353da9f4e2b7058e40a0fff9f1fe5)]
- Added VectorImage & WebGLPoints layers [razvanMiu - [`f128860`](https://github.com/eea/volto-openlayers-map/commit/f128860ec396f2ad7f6e7791a0054ad9a0f6e6df)]
- Openleyers components implemented [razvanMiu - [`99b84e6`](https://github.com/eea/volto-openlayers-map/commit/99b84e695e860e44ff6f728e37ca8493b9b06b0c)]
- Added components for openlayers [razvanMiu - [`b40679c`](https://github.com/eea/volto-openlayers-map/commit/b40679c21483151c1e588c0dfd1fa9ad5fdfc733)]
- Initial commit [Miu Razvan - [`6d0d613`](https://github.com/eea/volto-openlayers-map/commit/6d0d613377abb206619a5506e1a7fb04e56b9e4b)]
15 changes: 8 additions & 7 deletions Jenkinsfile
Expand Up @@ -6,6 +6,7 @@ pipeline {
NAMESPACE = "@eeacms"
SONARQUBE_TAGS = "volto.eea.europa.eu,biodiversity.europa.eu"
DEPENDENCIES = ""
VOLTO = "alpha"
}

stages {
Expand Down Expand Up @@ -40,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 @@ -76,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 @@ -124,8 +125,8 @@ pipeline {
node(label: 'docker') {
script {
try {
sh '''docker pull plone; docker run -d --rm --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="profile-plone.restapi:blocks" plone fg'''
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" plone/volto-addon-ci cypress'''
sh '''docker pull eeacms/plone-backend; docker run -d --rm --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="eea.kitkat:testing" eeacms/plone-backend'''
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 plone/volto-addon-ci:alpha cypress'''
} finally {
try {
sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
Expand Down
63 changes: 61 additions & 2 deletions Makefile
Expand Up @@ -34,6 +34,65 @@ 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

0 comments on commit 526bff2

Please sign in to comment.