Skip to content

Commit

Permalink
Merge pull request #8 from eea/develop
Browse files Browse the repository at this point in the history
Upgrade Cypress 10 / Razzle 4
  • Loading branch information
avoinea authored Oct 28, 2022
2 parents 1d58d4e + 734b3dc commit b47400c
Show file tree
Hide file tree
Showing 19 changed files with 520 additions and 190 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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
.vscode/
.history
.eslintrc.js
.nyc_output
project
coverage
logs
*.log
npm-debug.log*
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');
77 changes: 38 additions & 39 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,60 +4,59 @@ 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.3.3](https://github.com/eea/volto-quote-block/compare/0.3.2...0.3.3)
### [1.0.0](https://github.com/eea/volto-quote-block/compare/0.3.3...1.0.0) - 28 October 2022

#### :nail_care: Enhancements

#### [0.3.2](https://github.com/eea/volto-quote-block/compare/0.3.1...0.3.2)
- refactor(volto-slate): Upgrade to @plone/volto-slate - refs #153447 [Alin Voinea - [`a8745d3`](https://github.com/eea/volto-quote-block/commit/a8745d30aadf8bf23bab81d655ccff07beae3e76)]

> 30 June 2022
#### :hammer_and_wrench: Others

- test(cypress): Remove cypress.json [Alin Voinea - [`467d978`](https://github.com/eea/volto-quote-block/commit/467d978dba7dc792bce569b95e10471971d91eca)]
- test(Jenkins): Update to volto-addon-ci:alpha [Alin Voinea - [`b8c17be`](https://github.com/eea/volto-quote-block/commit/b8c17be3b332423260d5a663ff649a4ec30d29a7)]
- test(lint): Fix eslint [Alin Voinea - [`13cccab`](https://github.com/eea/volto-quote-block/commit/13cccab93c79a428d0655c93c2eb58594df8dbc2)]
- Release 1.0.0 [Alin Voinea - [`4944731`](https://github.com/eea/volto-quote-block/commit/4944731b1c7b9b80620311909202bb75c894760c)]
- test(cypress): Cypress 10 / Razzle 4 [Alin Voinea - [`91262ed`](https://github.com/eea/volto-quote-block/commit/91262eddb7272d12686cdb71952c607846cecb5d)]
- Cleanup [Alin Voinea - [`9b70192`](https://github.com/eea/volto-quote-block/commit/9b7019284a8e2159248cfa6109c8c0f84c6273d8)]
### [0.3.3](https://github.com/eea/volto-quote-block/compare/0.3.2...0.3.3) - 1 August 2022

#### [0.3.1](https://github.com/eea/volto-quote-block/compare/0.3.0...0.3.1)
### [0.3.2](https://github.com/eea/volto-quote-block/compare/0.3.1...0.3.2) - 30 June 2022

> 9 June 2022
### [0.3.1](https://github.com/eea/volto-quote-block/compare/0.3.0...0.3.1) - 9 June 2022

- Fix SlateEditor + clean up [`#5`](https://github.com/eea/volto-quote-block/pull/5)
### [0.3.0](https://github.com/eea/volto-quote-block/compare/0.2.0...0.3.0) - 25 May 2022

#### [0.3.0](https://github.com/eea/volto-quote-block/compare/0.2.0...0.3.0)
#### :hammer_and_wrench: Others

> 25 May 2022
### [0.2.0](https://github.com/eea/volto-quote-block/compare/0.1.2...0.2.0) - 19 May 2022

- refactor(quote): Rename SourceInfo to Extra component [`#4`](https://github.com/eea/volto-quote-block/pull/4)
#### :nail_care: Enhancements

#### [0.2.0](https://github.com/eea/volto-quote-block/compare/0.1.2...0.2.0)
- refactor(quote): Rename sourceInfo field to extra [Alin Voinea - [`51a9e32`](https://github.com/eea/volto-quote-block/commit/51a9e329e6d0a8b1caaadd42ccad1bd54e862210)]

> 19 May 2022
#### :hammer_and_wrench: Others

- Update quote + add testimonial quote variation [`#3`](https://github.com/eea/volto-quote-block/pull/3)
- refactor(quote): Rename sourceInfo field to extra [`51a9e32`](https://github.com/eea/volto-quote-block/commit/51a9e329e6d0a8b1caaadd42ccad1bd54e862210)
- Upgrade footnotes registry to work with volto-slate-footnotes 5.x [`3261f27`](https://github.com/eea/volto-quote-block/commit/3261f27d8749a022171ecdf8c854da832c40a2b9)
- Move reversed option to layout fieldset [`f0a94ac`](https://github.com/eea/volto-quote-block/commit/f0a94ac92820adc661030b095dc91fe048791e26)
- Fix schema [`f27fc86`](https://github.com/eea/volto-quote-block/commit/f27fc86025a004adc700f4f8ba36a080626a94af)
- Add volto-slate back [`a518905`](https://github.com/eea/volto-quote-block/commit/a518905f5a7a98213db0fd99396334dd2dbacef2)
- Use attached image widget [`c6acaa0`](https://github.com/eea/volto-quote-block/commit/c6acaa08ab9d985c963debff78e4d989b90556ac)
- Add footnotes support [`c63729c`](https://github.com/eea/volto-quote-block/commit/c63729cafce78dfe98d875d70214b3d8fd6c1f11)
- Prettier fix [`e4dd69a`](https://github.com/eea/volto-quote-block/commit/e4dd69a3051da854435093dc30f8048a650798a2)
- Remove usememo [`b5880a5`](https://github.com/eea/volto-quote-block/commit/b5880a5a1cf5c9889ec4c211c60f51986fd6255d)
- Upgrade footnotes registry to work with volto-slate-footnotes 5.x [Alin Voinea - [`3261f27`](https://github.com/eea/volto-quote-block/commit/3261f27d8749a022171ecdf8c854da832c40a2b9)]
- Move reversed option to layout fieldset [Alin Voinea - [`f0a94ac`](https://github.com/eea/volto-quote-block/commit/f0a94ac92820adc661030b095dc91fe048791e26)]
- Fix schema [Miu Razvan - [`f27fc86`](https://github.com/eea/volto-quote-block/commit/f27fc86025a004adc700f4f8ba36a080626a94af)]
- Add volto-slate back [Miu Razvan - [`a518905`](https://github.com/eea/volto-quote-block/commit/a518905f5a7a98213db0fd99396334dd2dbacef2)]
- Use attached image widget [Miu Razvan - [`c6acaa0`](https://github.com/eea/volto-quote-block/commit/c6acaa08ab9d985c963debff78e4d989b90556ac)]
- Add footnotes support [Alin Voinea - [`c63729c`](https://github.com/eea/volto-quote-block/commit/c63729cafce78dfe98d875d70214b3d8fd6c1f11)]
- Prettier fix [Miu Razvan - [`e4dd69a`](https://github.com/eea/volto-quote-block/commit/e4dd69a3051da854435093dc30f8048a650798a2)]
- Remove usememo [Miu Razvan - [`b5880a5`](https://github.com/eea/volto-quote-block/commit/b5880a5a1cf5c9889ec4c211c60f51986fd6255d)]
### [0.1.2](https://github.com/eea/volto-quote-block/compare/0.1.1...0.1.2) - 17 May 2022

#### [0.1.2](https://github.com/eea/volto-quote-block/compare/0.1.1...0.1.2)
### [0.1.1](https://github.com/eea/volto-quote-block/compare/0.1.0...0.1.1) - 28 April 2022

> 17 May 2022
#### :hammer_and_wrench: Others

- Disable Blockquote template for now and fix reversed pullquote [`#2`](https://github.com/eea/volto-quote-block/pull/2)
- Improvments [Miu Razvan - [`15b8aac`](https://github.com/eea/volto-quote-block/commit/15b8aac6b575af5b6b05d32cbfd32d8c603b2eb3)]
- Fix tests [Miu Razvan - [`f1faba6`](https://github.com/eea/volto-quote-block/commit/f1faba692370b519c690a831efe80f26d1e9a8cc)]
- Add slate add-on [Miu Razvan - [`57a1e1b`](https://github.com/eea/volto-quote-block/commit/57a1e1bd5d68ec08afb24d6a51346ad54fa891b3)]
- Lint fix [Miu Razvan - [`a1b29b0`](https://github.com/eea/volto-quote-block/commit/a1b29b0ceee5606ec14edd8d60e3196019b07506)]
- Remove uneeded code [Miu Razvan - [`ff26f0d`](https://github.com/eea/volto-quote-block/commit/ff26f0d60193f70e993522f5f3f1328ce3ce6e11)]
### 0.1.0 - 12 April 2022

#### [0.1.1](https://github.com/eea/volto-quote-block/compare/0.1.0...0.1.1)
#### :hammer_and_wrench: Others

> 28 April 2022
- Add quote blocks and volto-slate quote plugin [`#1`](https://github.com/eea/volto-quote-block/pull/1)
- Improvments [`15b8aac`](https://github.com/eea/volto-quote-block/commit/15b8aac6b575af5b6b05d32cbfd32d8c603b2eb3)
- Fix tests [`f1faba6`](https://github.com/eea/volto-quote-block/commit/f1faba692370b519c690a831efe80f26d1e9a8cc)
- Add slate add-on [`57a1e1b`](https://github.com/eea/volto-quote-block/commit/57a1e1bd5d68ec08afb24d6a51346ad54fa891b3)
- Lint fix [`a1b29b0`](https://github.com/eea/volto-quote-block/commit/a1b29b0ceee5606ec14edd8d60e3196019b07506)
- Remove uneeded code [`ff26f0d`](https://github.com/eea/volto-quote-block/commit/ff26f0d60193f70e993522f5f3f1328ce3ce6e11)

#### 0.1.0

> 12 April 2022
- Initial commit [`f748002`](https://github.com/eea/volto-quote-block/commit/f7480020346c8069fc825a439183b8f73445d62c)
- Initial commit [Miu Razvan - [`f748002`](https://github.com/eea/volto-quote-block/commit/f7480020346c8069fc825a439183b8f73445d62c)]
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-quote-block"
NAMESPACE = "@eeacms"
SONARQUBE_TAGS = "volto.eea.europa.eu,demo-www.eea.europa.eu"
SONARQUBE_TAGS = "volto.eea.europa.eu,demo-www.eea.europa.eu,prod-www.eea.europa.eu"
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 VOLTO=$VOLTO plone/volto-addon-ci:alpha cypress'''
} finally {
try {
sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
Expand Down
50 changes: 48 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,51 @@ test-update:
.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 :)"
)"
.*\)/\\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
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = function (api) {
api.cache(true);
const presets = ['razzle/babel'];
const presets = ['razzle'];
const plugins = [
[
'react-intl', // React Intl extractor, required for the whole i18n infrastructure to work
Expand Down
26 changes: 26 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const { defineConfig } = require('cypress');

module.exports = defineConfig({
viewportWidth: 1280,
defaultCommandTimeout: 8888,
chromeWebSecurity: false,
reporter: 'junit',
video: true,
retries: {
runMode: 8,
openMode: 0,
},
reporterOptions: {
mochaFile: 'cypress/reports/cypress-[hash].xml',
jenkinsMode: true,
toConsole: true,
},
e2e: {
setupNodeEvents(on, config) {
// e2e testing node events setup code
require('@cypress/code-coverage/task')(on, config);
return config;
},
baseUrl: 'http://localhost:3000',
},
});
17 changes: 0 additions & 17 deletions cypress.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import { setupBeforeEach, tearDownAfterEach } from '../support';
import { slateBeforeEach, slateAfterEach } from '../support/e2e';

describe('Blocks Tests', () => {
beforeEach(setupBeforeEach);
afterEach(tearDownAfterEach);
beforeEach(slateBeforeEach);
afterEach(slateAfterEach);

it('Add Block: Empty', () => {
// Change page title
cy.get('[contenteditable=true]').first().clear();

cy.get('[contenteditable=true]').first().type('My Add-on Page');
cy.clearSlateTitle();
cy.getSlateTitle().type('My Add-on Page');

cy.get('.documentFirstHeading').contains('My Add-on Page');

cy.get('[contenteditable=true]').first().type('{enter}');
cy.getSlate().click();

// Add block
cy.get('.ui.basic.icon.button.block-add-button').first().click();
Expand Down
26 changes: 0 additions & 26 deletions cypress/plugins/index.js

This file was deleted.

Loading

0 comments on commit b47400c

Please sign in to comment.