Skip to content

Commit

Permalink
Merge pull request #5 from eea/develop
Browse files Browse the repository at this point in the history
Upgrade Cypress 10 / Razzle 4
  • Loading branch information
avoinea committed Oct 28, 2022
2 parents f7a7acc + fb91ddb commit cb5d6ee
Show file tree
Hide file tree
Showing 16 changed files with 498 additions and 162 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');
52 changes: 30 additions & 22 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,46 @@ 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.2.3](https://github.com/eea/volto-timeline-block/compare/0.2.2...0.2.3)
### [1.0.0](https://github.com/eea/volto-timeline-block/compare/0.2.3...1.0.0) - 28 October 2022

#### :nail_care: Enhancements

#### [0.2.2](https://github.com/eea/volto-timeline-block/compare/0.2.1...0.2.2)
- refactor(volto-slate): Replace volto-slate with core @plone/volto-slate [Alin Voinea - [`aa18d6a`](https://github.com/eea/volto-timeline-block/commit/aa18d6a01e6f3e4468a602f1bd26dfa73228308c)]

> 8 June 2022
#### :hammer_and_wrench: Others

- Release [`#3`](https://github.com/eea/volto-timeline-block/pull/3)
- fix(timeline_block): BlockChooser Icon [`8a7b653`](https://github.com/eea/volto-timeline-block/commit/8a7b653a3f9fb9083e06b65860e6fbe73a19969b)
- Remove useless from block title [`2eecc11`](https://github.com/eea/volto-timeline-block/commit/2eecc11c3e1791b222ebcceae691ec6e92854a4e)
- Jenkinsfile [Alin Voinea - [`56815ff`](https://github.com/eea/volto-timeline-block/commit/56815ffa6c1905f8a6463f14f312255e75a2ee76)]
- test(cypress): Cypress 10 / Razzle 4 [Alin Voinea - [`ca50ec9`](https://github.com/eea/volto-timeline-block/commit/ca50ec9a9ab4db0faf0b33fa250814d788741478)]
- Cleanup [Alin Voinea - [`28c2444`](https://github.com/eea/volto-timeline-block/commit/28c244491045ca3ba6a3c182818364f73951f765)]
- Update dependencies [Alin Voinea - [`ab59000`](https://github.com/eea/volto-timeline-block/commit/ab590002fdef3c95d4580893b6e407b51746a290)]
### [0.2.3](https://github.com/eea/volto-timeline-block/compare/0.2.2...0.2.3) - 30 June 2022

#### [0.2.1](https://github.com/eea/volto-timeline-block/compare/0.2.0...0.2.1)
### [0.2.2](https://github.com/eea/volto-timeline-block/compare/0.2.1...0.2.2) - 8 June 2022

> 22 April 2022
#### :bug: Bug Fixes

- fix(icon): Remove console warning about invalid name ri-icon- [`#2`](https://github.com/eea/volto-timeline-block/pull/2)
- fix(timeline_block): BlockChooser Icon [Alin Voinea - [`8a7b653`](https://github.com/eea/volto-timeline-block/commit/8a7b653a3f9fb9083e06b65860e6fbe73a19969b)]

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

> 29 March 2022
- Remove useless from block title [Alin Voinea - [`2eecc11`](https://github.com/eea/volto-timeline-block/commit/2eecc11c3e1791b222ebcceae691ec6e92854a4e)]
### [0.2.1](https://github.com/eea/volto-timeline-block/compare/0.2.0...0.2.1) - 22 April 2022

- Implement timeline block [`#1`](https://github.com/eea/volto-timeline-block/pull/1)
- Release 0.2.0 [`296e2c1`](https://github.com/eea/volto-timeline-block/commit/296e2c1247bb12c71d03cb294a1bf5bc6b5332f4)
- Update description [`ce5a657`](https://github.com/eea/volto-timeline-block/commit/ce5a657d3f3f692b0e36345b2153179866881fab)
- Update README: Add screenshot [`d237607`](https://github.com/eea/volto-timeline-block/commit/d237607c843f12e3692a87b8cdef6ff7f751300d)
- Move timeline block to common group [`57552b9`](https://github.com/eea/volto-timeline-block/commit/57552b9641aa7458acf3432ccfd37590758db5b0)
- Add description [`eab3def`](https://github.com/eea/volto-timeline-block/commit/eab3def6d3ea273252e4881ca448643eb8eb6d25)
- don't use timeline from volto-eea-design-system [`bfcf521`](https://github.com/eea/volto-timeline-block/commit/bfcf52143f656b908f12b3374cc3d596b35fc1f7)
- Run bootstrap [`5edf844`](https://github.com/eea/volto-timeline-block/commit/5edf844a3a00cb9b5a40cd2bed0a9fea49f5c841)
#### :hammer_and_wrench: Others

#### 0.1.0
### [0.2.0](https://github.com/eea/volto-timeline-block/compare/0.1.0...0.2.0) - 29 March 2022

> 23 March 2022
#### :hammer_and_wrench: Others

- Initial commit [`b336dc7`](https://github.com/eea/volto-timeline-block/commit/b336dc76bdfad08e161f67312053a44570584e40)
- Release 0.2.0 [Alin Voinea - [`296e2c1`](https://github.com/eea/volto-timeline-block/commit/296e2c1247bb12c71d03cb294a1bf5bc6b5332f4)]
- Update description [Alin Voinea - [`ce5a657`](https://github.com/eea/volto-timeline-block/commit/ce5a657d3f3f692b0e36345b2153179866881fab)]
- Update README: Add screenshot [Alin Voinea - [`d237607`](https://github.com/eea/volto-timeline-block/commit/d237607c843f12e3692a87b8cdef6ff7f751300d)]
- Move timeline block to common group [Miu Razvan - [`57552b9`](https://github.com/eea/volto-timeline-block/commit/57552b9641aa7458acf3432ccfd37590758db5b0)]
- Add description [Miu Razvan - [`eab3def`](https://github.com/eea/volto-timeline-block/commit/eab3def6d3ea273252e4881ca448643eb8eb6d25)]
- don't use timeline from volto-eea-design-system [Miu Razvan - [`bfcf521`](https://github.com/eea/volto-timeline-block/commit/bfcf52143f656b908f12b3374cc3d596b35fc1f7)]
- Run bootstrap [Miu Razvan - [`5edf844`](https://github.com/eea/volto-timeline-block/commit/5edf844a3a00cb9b5a40cd2bed0a9fea49f5c841)]
### 0.1.0 - 23 March 2022

#### :hammer_and_wrench: Others

- Initial commit [Miu Razvan - [`b336dc7`](https://github.com/eea/volto-timeline-block/commit/b336dc76bdfad08e161f67312053a44570584e40)]
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-timeline-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
49 changes: 48 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +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.

0 comments on commit cb5d6ee

Please sign in to comment.