@eeacms/volto-n2k 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,8 +4,15 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [0.1.3](https://github.com/eea/volto-n2k/compare/0.1.2...0.1.3)
8
+
9
+ - Make this compatible with latest changes [`d11991f`](https://github.com/eea/volto-n2k/commit/d11991f3798edebc132929e15bf120ec3d545ab9)
10
+
7
11
  #### [0.1.2](https://github.com/eea/volto-n2k/compare/0.1.1...0.1.2)
8
12
 
13
+ > 14 December 2021
14
+
15
+ - Update [`#3`](https://github.com/eea/volto-n2k/pull/3)
9
16
  - [Webscore fix] Added generic font-family [`48f7eb5`](https://github.com/eea/volto-n2k/commit/48f7eb59c956a1705579ec1796160d31fad77f96)
10
17
  - Refs #142010 - Optimize Volto-addons gitflow pipelines [`7eea1ed`](https://github.com/eea/volto-n2k/commit/7eea1ed2f0360830658266cc44ce9a5de6381776)
11
18
 
package/Jenkinsfile CHANGED
@@ -124,7 +124,7 @@ pipeline {
124
124
  node(label: 'docker') {
125
125
  script {
126
126
  try {
127
- sh '''docker pull plone; docker run -d --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="profile-plone.restapi:blocks" plone fg'''
127
+ sh '''docker pull plone; docker run -d --rm --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="profile-plone.restapi:blocks" plone fg'''
128
128
  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'''
129
129
  } finally {
130
130
  try {
@@ -142,7 +142,8 @@ pipeline {
142
142
  reportName: 'CypressCoverage',
143
143
  reportTitles: 'Integration Tests Code Coverage'])
144
144
  }
145
- archiveArtifacts artifacts: 'cypress-reports/videos/*.mp4', fingerprint: true
145
+ sh '''touch empty_file; for ok_test in $(grep -E 'file=.*failures="0"' $(grep 'testsuites .*failures="0"' $(find cypress-results -name *.xml) empty_file | awk -F: '{print $1}') empty_file | sed 's/.* file="\\(.*\\)" time.*/\\1/' | sed 's#^cypress/integration/##g' | sed 's#^../../../node_modules/@eeacms/##g'); do rm -f cypress-reports/videos/$ok_test.mp4; rm -f cypress-reports/$ok_test.mp4; done'''
146
+ archiveArtifacts artifacts: 'cypress-reports/**/*.mp4', fingerprint: true, allowEmptyArchive: true
146
147
  stash name: "cypress-coverage", includes: "cypress-coverage/**", allowEmpty: true
147
148
  }
148
149
  finally {
@@ -183,10 +184,10 @@ pipeline {
183
184
  unstash "xunit-reports"
184
185
  unstash "cypress-coverage"
185
186
  def scannerHome = tool 'SonarQubeScanner';
186
- def nodeJS = tool 'NodeJS11';
187
+ def nodeJS = tool 'NodeJS';
187
188
  withSonarQubeEnv('Sonarqube') {
188
189
  sh '''sed -i "s#/opt/frontend/my-volto-project/src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
189
- sh "export PATH=$PATH:${scannerHome}/bin:${nodeJS}/bin; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info,./cypress-coverage/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER"
190
+ sh "export PATH=${scannerHome}/bin:${nodeJS}/bin:$PATH; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info,./cypress-coverage/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER"
190
191
  sh '''try=2; while [ \$try -gt 0 ]; do curl -s -XPOST -u "${SONAR_AUTH_TOKEN}:" "${SONAR_HOST_URL}api/project_tags/set?project=${GIT_NAME}-${BRANCH_NAME}&tags=${SONARQUBE_TAGS},${BRANCH_NAME}" > set_tags_result; if [ \$(grep -ic error set_tags_result ) -eq 0 ]; then try=0; else cat set_tags_result; echo "... Will retry"; sleep 60; try=\$(( \$try - 1 )); fi; done'''
191
192
  }
192
193
  }
package/README.md CHANGED
@@ -1,7 +1,18 @@
1
1
  # volto-n2k
2
+
2
3
  [![Releases](https://img.shields.io/github/v/release/eea/volto-n2k)](https://github.com/eea/volto-n2k/releases)
4
+
3
5
  [![Pipeline](https://ci.eionet.europa.eu/buildStatus/icon?job=volto-addons%2Fvolto-n2k%2Fmaster&subject=master)](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-n2k/job/master/display/redirect)
6
+ [![Lines of Code](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-n2k-master&metric=ncloc)](https://sonarqube.eea.europa.eu/dashboard?id=volto-n2k-master)
7
+ [![Coverage](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-n2k-master&metric=coverage)](https://sonarqube.eea.europa.eu/dashboard?id=volto-n2k-master)
8
+ [![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-n2k-master&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=volto-n2k-master)
9
+ [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-n2k-master&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-n2k-master)
10
+
4
11
  [![Pipeline](https://ci.eionet.europa.eu/buildStatus/icon?job=volto-addons%2Fvolto-n2k%2Fdevelop&subject=develop)](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-n2k/job/develop/display/redirect)
12
+ [![Lines of Code](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-n2k-develop&metric=ncloc)](https://sonarqube.eea.europa.eu/dashboard?id=volto-n2k-develop)
13
+ [![Coverage](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-n2k-develop&metric=coverage)](https://sonarqube.eea.europa.eu/dashboard?id=volto-n2k-develop)
14
+ [![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-n2k-develop&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=volto-n2k-develop)
15
+ [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-n2k-develop&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-n2k-develop)
5
16
 
6
17
  [Volto](https://github.com/plone/volto) add-on
7
18
 
@@ -46,6 +57,81 @@ Demo GIF
46
57
 
47
58
  1. Happy editing!
48
59
 
60
+ ## Release
61
+
62
+ ### Automatic release using Jenkins
63
+
64
+ * The automatic release is started by creating a [Pull Request](../../compare/master...develop) from `develop` to `master`. The pull request status checks correlated to the branch and PR Jenkins jobs need to be processed successfully. 1 review from a github user with rights is mandatory.
65
+ * It runs on every commit on `master` branch, which is protected from direct commits, only allowing pull request merge commits.
66
+ * The automatic release is done by [Jenkins](https://ci.eionet.europa.eu). The status of the release job can be seen both in the Readme.md badges and the green check/red cross/yellow circle near the last commit information. If you click on the icon, you will have the list of checks that were run. The `continuous-integration/jenkins/branch` link goes to the Jenkins job execution webpage.
67
+ * Automated release scripts are located in the `eeacms/gitflow` docker image, specifically [js-release.sh](https://github.com/eea/eea.docker.gitflow/blob/master/src/js-release.sh) script. It uses the `release-it` tool.
68
+ * As long as a PR request is open from develop to master, the PR Jenkins job will automatically re-create the CHANGELOG.md and package.json files to be production-ready.
69
+ * The version format must be MAJOR.MINOR.PATCH. By default, next release is set to next minor version (with patch 0).
70
+ * You can manually change the version in `package.json`. The new version must not be already present in the tags/releases of the repository, otherwise it will be automatically increased by the script. Any changes to the version will trigger a `CHANGELOG.md` re-generation.
71
+ * Automated commits and commits with [JENKINS] or [YARN] in the commit log are excluded from `CHANGELOG.md` file.
72
+
73
+ ### Manual release from the develop branch ( beta release )
74
+
75
+ #### Installation and configuration of release-it
76
+
77
+ You need to first install the [release-it](https://github.com/release-it/release-it) client.
78
+
79
+ ```
80
+ npm install -g release-it
81
+ ```
82
+
83
+ Release-it uses the configuration written in the [`.release-it.json`](./.release-it.json) file located in the root of the repository.
84
+
85
+ Release-it is a tool that automates 4 important steps in the release process:
86
+
87
+ 1. Version increase in `package.json` ( increased from the current version in `package.json`)
88
+ 2. `CHANGELOG.md` automatic generation from commit messages ( grouped by releases )
89
+ 3. GitHub release on the commit with the changelog and package.json modification on the develop branch
90
+ 4. NPM release ( by default it's disabled, but can be enabled in the configuration file )
91
+
92
+ To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
93
+
94
+ ```
95
+ export GITHUB_TOKEN=XXX-XXXXXXXXXXXXXXXXXXXXXX
96
+ ```
97
+
98
+ To configure npm, you can use the `npm login` command or use a configuration file with a TOKEN :
99
+
100
+ ```
101
+ echo "//registry.npmjs.org/:_authToken=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" > .npmrc
102
+ ```
103
+
104
+ #### Using release-it tool
105
+
106
+ There are 3 yarn scripts that can be run to do the release
107
+
108
+ ##### yarn release-beta
109
+
110
+ Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
111
+
112
+ ```
113
+ ? Select increment (next version):
114
+ ❯ prepatch (0.1.1-beta.0)
115
+ preminor (0.2.0-beta.0)
116
+ premajor (1.0.0-beta.0)
117
+ Other, please specify...
118
+ ```
119
+
120
+ ##### yarn release-major-beta
121
+
122
+ Same as `yarn release-beta`, but with premajor version pre-selected.
123
+
124
+ ##### yarn release
125
+
126
+ Generic command, does not automatically add the `beta` to version, but you can still manually write it if you choose Other.
127
+
128
+ #### Important notes
129
+
130
+ > Do not use release-it tool on master branch, the commit on CHANGELOG.md file and the version increase in the package.json file can't be done without a PULL REQUEST.
131
+
132
+ > Do not keep Pull Requests from develop to master branches open when you are doing beta releases from the develop branch. As long as a PR to master is open, an automatic script will run on every commit and will update both the version and the changelog to a production-ready state - ( MAJOR.MINOR.PATCH mandatory format for version).
133
+
134
+
49
135
  ## How to contribute
50
136
 
51
137
  See [DEVELOP.md](https://github.com/eea/volto-n2k/blob/master/DEVELOP.md).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-n2k",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "volto-n2k: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -24,18 +24,18 @@
24
24
  "url": "git@github.com:eea/volto-n2k.git"
25
25
  },
26
26
  "dependencies": {
27
- "@eeacms/volto-datablocks": "^2.0.13",
28
- "@eeacms/volto-resize-helper": "^0.2.4",
29
- "@eeacms/volto-openlayers-map": "0.1.2",
30
- "@eeacms/volto-tabs-block": "1.2.7",
27
+ "@eeacms/volto-datablocks": "*",
28
+ "@eeacms/volto-resize-helper": "*",
29
+ "@eeacms/volto-openlayers-map": "*",
30
+ "@eeacms/volto-tabs-block": "*",
31
+ "volto-slate": "*",
31
32
  "d3": "^7.1.1",
32
33
  "d3-shape": "^3.0.1",
33
34
  "react-lazy-load-image-component": "1.5.1",
34
35
  "react-stickynode": "^4.0.0",
35
36
  "react-use-localstorage": "^3.5.3",
36
37
  "resize-observer-polyfill": "1.5.1",
37
- "slick-carousel": "1.8.1",
38
- "volto-slate": "^4.0.3"
38
+ "slick-carousel": "1.8.1"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@cypress/code-coverage": "^3.9.5",
@@ -43,6 +43,8 @@
43
43
  },
44
44
  "scripts": {
45
45
  "release": "release-it",
46
+ "release-major-beta": "release-it major --preRelease=beta",
47
+ "release-beta": "release-it --preRelease=beta",
46
48
  "bootstrap": "npm install -g ejs; npm link ejs; node bootstrap",
47
49
  "stylelint": "../../../node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'",
48
50
  "stylelint:overrides": "../../../node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'",
@@ -3,7 +3,7 @@ import config from '@plone/volto/registry';
3
3
  import { SidebarPortal } from '@plone/volto/components';
4
4
  import InlineForm from '@plone/volto/components/manage/Form/InlineForm';
5
5
  import SlateEditor from 'volto-slate/editor/SlateEditor';
6
- import { Editor } from 'volto-slate/utils';
6
+ import { Editor } from 'slate';
7
7
  import getSchema from './schema';
8
8
  import cx from 'classnames';
9
9
  import './styles.less';
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { UniversalLink } from '@plone/volto/components';
3
3
  import { serializeNodes } from 'volto-slate/editor/render';
4
- import { Editor } from 'volto-slate/utils';
4
+ import { Editor } from 'slate';
5
5
  import cx from 'classnames';
6
6
  import './styles.less';
7
7