Skip to content

Commit

Permalink
Merge pull request #10 from eea/develop
Browse files Browse the repository at this point in the history
Use latest volto & cypress
  • Loading branch information
avoinea authored Oct 27, 2022
2 parents 011475f + 6251969 commit 420a3ac
Show file tree
Hide file tree
Showing 22 changed files with 727 additions and 251 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: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
.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
screenshots
cypress/videos
cypress/reports
screenshots
videos
.env.local
.env.development.local
.env.test.local
.env.production.local
*~
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
46 changes: 46 additions & 0 deletions .project.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
const fs = require('fs');
const path = require('path');

const projectRootPath = fs.realpathSync('./project'); // __dirname
const packageJson = require(path.join(projectRootPath, 'package.json'));
const jsConfig = require(path.join(projectRootPath, 'jsconfig.json')).compilerOptions;

const pathsConfig = jsConfig.paths;

let voltoPath = path.join(projectRootPath, 'node_modules/@plone/volto');

Object.keys(pathsConfig).forEach(pkg => {
if (pkg === '@plone/volto') {
voltoPath = `./${jsConfig.baseUrl}/${pathsConfig[pkg][0]}`;
}
});
const AddonConfigurationRegistry = require(`${voltoPath}/addon-registry.js`);
const reg = new AddonConfigurationRegistry(projectRootPath);

// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
const addonAliases = Object.keys(reg.packages).map(o => [
o,
reg.packages[o].modulePath,
]);


module.exports = {
extends: `${projectRootPath}/node_modules/@plone/volto/.eslintrc`,
settings: {
'import/resolver': {
alias: {
map: [
['@plone/volto', '@plone/volto/src'],
...addonAliases,
['@package', `${__dirname}/src`],
['~', `${__dirname}/src`],
],
extensions: ['.js', '.jsx', '.json'],
},
'babel-plugin-root-import': {
rootPathSuffix: 'src',
},
},
},
};

97 changes: 42 additions & 55 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,83 +4,70 @@ 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).

#### [2.2.7](https://github.com/eea/volto-widget-toggle/compare/2.2.6...2.2.7)
### [3.0.0](https://github.com/eea/volto-widget-toggle/compare/2.2.7...3.0.0) - 26 October 2022

#### :hammer_and_wrench: Others

#### [2.2.6](https://github.com/eea/volto-widget-toggle/compare/2.2.5...2.2.6)
- Cleanup [Alin Voinea - [`f0bfe89`](https://github.com/eea/volto-widget-toggle/commit/f0bfe892db782472d0911b3562346d80bed2fb94)]
- Typo [Miu Razvan - [`f1faa3d`](https://github.com/eea/volto-widget-toggle/commit/f1faa3d1c0239d377a75b375dcf092cea048c121)]
- Use latest cypress [Miu Razvan - [`165ef4a`](https://github.com/eea/volto-widget-toggle/commit/165ef4a017833e757a69da734985acd18155228e)]
- update(jest): add @plone/volto-slate resolver refs- #153447 [nileshgulia1 - [`b5e6889`](https://github.com/eea/volto-widget-toggle/commit/b5e6889bc22efaeec2025bd79dfe2a839650e4a6)]
### [2.2.7](https://github.com/eea/volto-widget-toggle/compare/2.2.6...2.2.7) - 30 June 2022

> 3 January 2022
#### :hammer_and_wrench: Others

- Release [`#8`](https://github.com/eea/volto-widget-toggle/pull/8)
### [2.2.6](https://github.com/eea/volto-widget-toggle/compare/2.2.5...2.2.6) - 3 January 2022

#### [2.2.5](https://github.com/eea/volto-widget-toggle/compare/2.2.4...2.2.5)
#### :hammer_and_wrench: Others

> 16 December 2021
### [2.2.5](https://github.com/eea/volto-widget-toggle/compare/2.2.4...2.2.5) - 16 December 2021

- Add SonarQube badges [`#7`](https://github.com/eea/volto-widget-toggle/pull/7)
### [2.2.4](https://github.com/eea/volto-widget-toggle/compare/2.2.3...2.2.4) - 10 December 2021

#### [2.2.4](https://github.com/eea/volto-widget-toggle/compare/2.2.3...2.2.4)
#### :hammer_and_wrench: Others

> 10 December 2021
- Refs #142010 - Optimize Volto-addons gitflow pipelines [valentinab25 - [`2bd2039`](https://github.com/eea/volto-widget-toggle/commit/2bd203979963ee5cb15592470e1d341d1bd65291)]
### [2.2.3](https://github.com/eea/volto-widget-toggle/compare/2.2.2...2.2.3) - 28 June 2021

- Develop [`#6`](https://github.com/eea/volto-widget-toggle/pull/6)
- Correct Cypress tests [`#5`](https://github.com/eea/volto-widget-toggle/pull/5)
- Refs #142010 - Optimize Volto-addons gitflow pipelines [`2bd2039`](https://github.com/eea/volto-widget-toggle/commit/2bd203979963ee5cb15592470e1d341d1bd65291)
#### :hammer_and_wrench: Others

#### [2.2.3](https://github.com/eea/volto-widget-toggle/compare/2.2.2...2.2.3)
- refactor code, introduce defaultValue prop to handle default state when value is null [nileshgulia1 - [`560d23f`](https://github.com/eea/volto-widget-toggle/commit/560d23f785e7780cdb30197c2ebc999b85961f46)]
### [2.2.2](https://github.com/eea/volto-widget-toggle/compare/2.2.1...2.2.2) - 4 June 2021

> 28 June 2021
### [2.2.1](https://github.com/eea/volto-widget-toggle/compare/2.2.0...2.2.1) - 14 May 2021

- refactor code, introduce defaultValue prop to handle default state when value is null or undefined [`#4`](https://github.com/eea/volto-widget-toggle/pull/4)
- refactor code, introduce defaultValue prop to handle default state when value is null [`560d23f`](https://github.com/eea/volto-widget-toggle/commit/560d23f785e7780cdb30197c2ebc999b85961f46)
### [2.2.0](https://github.com/eea/volto-widget-toggle/compare/2.1.0...2.2.0) - 25 March 2021

#### [2.2.2](https://github.com/eea/volto-widget-toggle/compare/2.2.1...2.2.2)
#### :hammer_and_wrench: Others

> 4 June 2021
- Release 2.2.0 [Alin Voinea - [`6d37e80`](https://github.com/eea/volto-widget-toggle/commit/6d37e80dec78143118ce76be39aba02b82d4d895)]
- Fix uncontrolled input of type checkbox to be controlled. [Alin Voinea - [`137f5a0`](https://github.com/eea/volto-widget-toggle/commit/137f5a0d72ccf47d29c7c7f9a4bd29ec9ef0598d)]
### [2.1.0](https://github.com/eea/volto-widget-toggle/compare/2.0.0...2.1.0) - 8 March 2021

- Cypress coverage [`#3`](https://github.com/eea/volto-widget-toggle/pull/3)
#### :hammer_and_wrench: Others

#### [2.2.1](https://github.com/eea/volto-widget-toggle/compare/2.2.0...2.2.1)
- Release 2.1.0 [Alin Voinea - [`8a77751`](https://github.com/eea/volto-widget-toggle/commit/8a77751a8eaa3817f4831a21365768387321dc50)]
- Cleanup DEPENDENCIES from Jenkinsfile [Alin Voinea - [`41eb8ba`](https://github.com/eea/volto-widget-toggle/commit/41eb8ba076da6feed4bfc8f05ed1c18678b4a434)]
## [2.0.0](https://github.com/eea/volto-widget-toggle/compare/1.0.1...2.0.0) - 26 February 2021

> 14 May 2021
#### :hammer_and_wrench: Others

- Release 2.0.0 [Alin Voinea - [`28f4b1d`](https://github.com/eea/volto-widget-toggle/commit/28f4b1d2706e4a7a06c05fbd079e195a74059ff1)]
- Volto 12 upgrade: ~/config -> @plone/volto/registry [Alin Voinea - [`f50d72a`](https://github.com/eea/volto-widget-toggle/commit/f50d72a9ec54cf9a53507059ef89a7fe60dcb118)]
### [1.0.1](https://github.com/eea/volto-widget-toggle/compare/1.0.0...1.0.1) - 16 November 2020

#### [2.2.0](https://github.com/eea/volto-widget-toggle/compare/2.1.0...2.2.0)
#### :hammer_and_wrench: Others

> 25 March 2021
- Release 1.0.1 [Alin Voinea - [`454220f`](https://github.com/eea/volto-widget-toggle/commit/454220fa61495427f874fb9b56401fe69689f4fe)]
- Auto-release npm [Alin Voinea - [`10b31b3`](https://github.com/eea/volto-widget-toggle/commit/10b31b3b64330d41f69a033a45030e49d20c16b5)]
## [1.0.0](https://github.com/eea/volto-widget-toggle/compare/0.1.0...1.0.0) - 29 September 2020

- Release 2.2.0 [`6d37e80`](https://github.com/eea/volto-widget-toggle/commit/6d37e80dec78143118ce76be39aba02b82d4d895)
- Fix uncontrolled input of type checkbox to be controlled. [`137f5a0`](https://github.com/eea/volto-widget-toggle/commit/137f5a0d72ccf47d29c7c7f9a4bd29ec9ef0598d)
#### :hammer_and_wrench: Others

#### [2.1.0](https://github.com/eea/volto-widget-toggle/compare/2.0.0...2.1.0)
- Release 1.0.0 [Alin Voinea - [`9298d3d`](https://github.com/eea/volto-widget-toggle/commit/9298d3d68642670c7b16e31ede0c9299e84c8b65)]
### 0.1.0 - 3 September 2020

> 8 March 2021
#### :hammer_and_wrench: Others

- Release 2.1.0 [`8a77751`](https://github.com/eea/volto-widget-toggle/commit/8a77751a8eaa3817f4831a21365768387321dc50)

### [2.0.0](https://github.com/eea/volto-widget-toggle/compare/1.0.1...2.0.0)

> 26 February 2021
- Release 2.0.0 [`28f4b1d`](https://github.com/eea/volto-widget-toggle/commit/28f4b1d2706e4a7a06c05fbd079e195a74059ff1)
- Volto 12 upgrade: ~/config -> @plone/volto/registry [`f50d72a`](https://github.com/eea/volto-widget-toggle/commit/f50d72a9ec54cf9a53507059ef89a7fe60dcb118)

#### [1.0.1](https://github.com/eea/volto-widget-toggle/compare/1.0.0...1.0.1)

> 16 November 2020
- Release 1.0.1 [`454220f`](https://github.com/eea/volto-widget-toggle/commit/454220fa61495427f874fb9b56401fe69689f4fe)
- Auto-release npm [`10b31b3`](https://github.com/eea/volto-widget-toggle/commit/10b31b3b64330d41f69a033a45030e49d20c16b5)

### [1.0.0](https://github.com/eea/volto-widget-toggle/compare/0.1.0...1.0.0)

> 29 September 2020
- Release 1.0.0 [`9298d3d`](https://github.com/eea/volto-widget-toggle/commit/9298d3d68642670c7b16e31ede0c9299e84c8b65)

#### 0.1.0

> 3 September 2020
- Add toggle checkbox [`e5f0fc1`](https://github.com/eea/volto-widget-toggle/commit/e5f0fc1e6a42fdc9e64da274f4781d73bfd270e2)
- Initial commit [`51b8080`](https://github.com/eea/volto-widget-toggle/commit/51b8080f06ba25c85ef293e053284a66a0b7b845)
- Add toggle checkbox [Alin Voinea - [`e5f0fc1`](https://github.com/eea/volto-widget-toggle/commit/e5f0fc1e6a42fdc9e64da274f4781d73bfd270e2)]
- Initial commit [Alin Voinea - [`51b8080`](https://github.com/eea/volto-widget-toggle/commit/51b8080f06ba25c85ef293e053284a66a0b7b845)]
14 changes: 7 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pipeline {
environment {
GIT_NAME = "volto-widget-toggle"
NAMESPACE = "@eeacms"
SONARQUBE_TAGS = "volto.eea.europa.eu,forest.eea.europa.eu,www.eea.europa.eu-ims,climate-energy.eea.europa.eu,sustainability.eionet.europa.eu,biodiversity.europa.eu,clms.land.copernicus.eu,industry.eea.europa.eu,water.europa.eu-freshwater,demo-www.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu,circularity.eea.europa.eu"
SONARQUBE_TAGS = "volto.eea.europa.eu,forest.eea.europa.eu,www.eea.europa.eu-ims,climate-energy.eea.europa.eu,sustainability.eionet.europa.eu,biodiversity.europa.eu,clms.land.copernicus.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 = "alpha"
}
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 plone/volto-addon-ci:alpha cypress'''
} finally {
try {
sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
Expand Down
Loading

0 comments on commit 420a3ac

Please sign in to comment.