@eeacms/volto-design-tokens 0.1.0

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.
@@ -0,0 +1,9 @@
1
+ const defaultBabel = require('@plone/volto/babel');
2
+
3
+ function applyDefault(api) {
4
+ const voltoBabel = defaultBabel(api);
5
+ voltoBabel.plugins.push('istanbul');
6
+ return voltoBabel;
7
+ }
8
+
9
+ module.exports = applyDefault;
@@ -0,0 +1 @@
1
+ module.exports = require('@plone/volto/babel');
@@ -0,0 +1,48 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ const projectRootPath = fs.existsSync('./project')
5
+ ? fs.realpathSync('./project')
6
+ : fs.realpathSync('./../../../');
7
+ const packageJson = require(path.join(projectRootPath, 'package.json'));
8
+ const jsConfig = require(path.join(projectRootPath, 'jsconfig.json')).compilerOptions;
9
+
10
+ const pathsConfig = jsConfig.paths;
11
+
12
+ let voltoPath = path.join(projectRootPath, 'node_modules/@plone/volto');
13
+
14
+ Object.keys(pathsConfig).forEach(pkg => {
15
+ if (pkg === '@plone/volto') {
16
+ voltoPath = `./${jsConfig.baseUrl}/${pathsConfig[pkg][0]}`;
17
+ }
18
+ });
19
+ const AddonConfigurationRegistry = require(`${voltoPath}/addon-registry.js`);
20
+ const reg = new AddonConfigurationRegistry(projectRootPath);
21
+
22
+ // Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
23
+ const addonAliases = Object.keys(reg.packages).map(o => [
24
+ o,
25
+ reg.packages[o].modulePath,
26
+ ]);
27
+
28
+
29
+ module.exports = {
30
+ extends: `${projectRootPath}/node_modules/@plone/volto/.eslintrc`,
31
+ settings: {
32
+ 'import/resolver': {
33
+ alias: {
34
+ map: [
35
+ ['@plone/volto', '@plone/volto/src'],
36
+ ...addonAliases,
37
+ ['@package', `${__dirname}/src`],
38
+ ['~', `${__dirname}/src`],
39
+ ],
40
+ extensions: ['.js', '.jsx', '.json'],
41
+ },
42
+ 'babel-plugin-root-import': {
43
+ rootPathSuffix: 'src',
44
+ },
45
+ },
46
+ },
47
+ };
48
+
@@ -0,0 +1,17 @@
1
+ {
2
+ "npm": {
3
+ "publish": false
4
+ },
5
+ "git": {
6
+ "changelog": "npx auto-changelog --stdout --commit-limit false -u --template https://raw.githubusercontent.com/release-it/release-it/master/templates/changelog-compact.hbs",
7
+ "tagName": "${version}"
8
+ },
9
+ "github": {
10
+ "release": true,
11
+ "releaseName": "${version}",
12
+ "releaseNotes": "npx auto-changelog --stdout --commit-limit false -u --template https://raw.githubusercontent.com/release-it/release-it/master/templates/changelog-compact.hbs"
13
+ },
14
+ "hooks": {
15
+ "after:bump": "npx auto-changelog --commit-limit false -p"
16
+ }
17
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,22 @@
1
+ ### Changelog
2
+
3
+ All notable changes to this project will be documented in this file. Dates are displayed in UTC.
4
+
5
+ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
+
7
+ ### [0.1.0](https://github.com/eea/volto-design-tokens/compare/1.0.0...0.1.0) - 13 July 2023
8
+
9
+ #### :house: Internal changes
10
+
11
+ - chore: Change addon name, formatting [dana-cfc4 - [`8d96d9b`](https://github.com/eea/volto-design-tokens/commit/8d96d9bb5614db5695372e9e6cfff4ab195689ef)]
12
+
13
+ ### 1.0.0 - 13 July 2023
14
+
15
+ #### :house: Internal changes
16
+
17
+ - chore: design tokens accesibility [andreiggr - [`40dd05d`](https://github.com/eea/volto-design-tokens/commit/40dd05d6c33a839b32c1aac6a6cb157e786d6f08)]
18
+ - chore: add eea ds tokens [andreiggr - [`57722bd`](https://github.com/eea/volto-design-tokens/commit/57722bdc91149b7656f4776917af5ad15505b7de)]
19
+
20
+ #### :hammer_and_wrench: Others
21
+
22
+ - Initial commit [Andrei Grigore - [`7c2a781`](https://github.com/eea/volto-design-tokens/commit/7c2a78154a5adf5b06dffb422c53aea7cc2e0adb)]
package/DEVELOP.md ADDED
@@ -0,0 +1,51 @@
1
+ # volto-addon-template
2
+
3
+ ## Develop
4
+
5
+ Before starting make sure your development environment is properly set. See [Volto Developer Documentation](https://docs.voltocms.com/getting-started/install/)
6
+
7
+ 1. Make sure you have installed `yo`, `@plone/generator-volto` and `mrs-developer`
8
+
9
+ npm install -g yo @plone/generator-volto mrs-developer
10
+
11
+ 1. Create new volto app
12
+
13
+ yo @plone/volto my-volto-project --addon @eeacms/volto-addon-template --skip-install
14
+ cd my-volto-project
15
+
16
+ 1. Add the following to `mrs.developer.json`:
17
+
18
+ {
19
+ "volto-addon-template": {
20
+ "url": "https://github.com/eea/volto-addon-template.git",
21
+ "package": "@eeacms/volto-addon-template",
22
+ "branch": "develop",
23
+ "path": "src"
24
+ }
25
+ }
26
+
27
+ 1. Install
28
+
29
+ yarn develop
30
+ yarn
31
+
32
+ 1. Start backend
33
+
34
+ docker pull plone
35
+ docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" plone
36
+
37
+ ...wait for backend to setup and start - `Ready to handle requests`:
38
+
39
+ docker logs -f plone
40
+
41
+ ...you can also check http://localhost:8080/Plone
42
+
43
+ 1. Start frontend
44
+
45
+ yarn start
46
+
47
+ 1. Go to http://localhost:3000
48
+
49
+ 1. Happy hacking!
50
+
51
+ cd src/addons/volto-addon-template/
package/DEVELOP.md.tpl ADDED
@@ -0,0 +1,51 @@
1
+ # <%= name %>
2
+
3
+ ## Develop
4
+
5
+ Before starting make sure your development environment is properly set. See [Volto Developer Documentation](https://docs.voltocms.com/getting-started/install/)
6
+
7
+ 1. Make sure you have installed `yo`, `@plone/generator-volto` and `mrs-developer`
8
+
9
+ npm install -g yo @plone/generator-volto mrs-developer
10
+
11
+ 1. Create new volto app
12
+
13
+ yo @plone/volto my-volto-project --addon <%= addonName %> --skip-install
14
+ cd my-volto-project
15
+
16
+ 1. Add the following to `mrs.developer.json`:
17
+
18
+ {
19
+ "<%= name %>": {
20
+ "url": "https://github.com/eea/<%= name %>.git",
21
+ "package": "<%= addonName %>",
22
+ "branch": "develop",
23
+ "path": "src"
24
+ }
25
+ }
26
+
27
+ 1. Install
28
+
29
+ yarn develop
30
+ yarn
31
+
32
+ 1. Start backend
33
+
34
+ docker pull plone
35
+ docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" plone
36
+
37
+ ...wait for backend to setup and start - `Ready to handle requests`:
38
+
39
+ docker logs -f plone
40
+
41
+ ...you can also check http://localhost:8080/Plone
42
+
43
+ 1. Start frontend
44
+
45
+ yarn start
46
+
47
+ 1. Go to http://localhost:3000
48
+
49
+ 1. Happy hacking!
50
+
51
+ cd src/addons/<%= name %>/
@@ -0,0 +1,243 @@
1
+ pipeline {
2
+ agent any
3
+
4
+ environment {
5
+ GIT_NAME = "<%= name %>"
6
+ NAMESPACE = "@eeacms"
7
+ SONARQUBE_TAGS = "volto.eea.europa.eu"
8
+ DEPENDENCIES = ""
9
+ VOLTO = ""
10
+ }
11
+
12
+ stages {
13
+
14
+ stage('Release') {
15
+ when {
16
+ allOf {
17
+ environment name: 'CHANGE_ID', value: ''
18
+ branch 'master'
19
+ }
20
+ }
21
+ steps {
22
+ node(label: 'docker') {
23
+ withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN'),string(credentialsId: 'eea-jenkins-npm-token', variable: 'NPM_TOKEN')]) {
24
+ sh '''docker pull eeacms/gitflow'''
25
+ sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-master" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" -e GIT_TOKEN="$GITHUB_TOKEN" -e NPM_TOKEN="$NPM_TOKEN" -e LANGUAGE=javascript eeacms/gitflow'''
26
+ }
27
+ }
28
+ }
29
+ }
30
+
31
+ stage('Code') {
32
+ when {
33
+ allOf {
34
+ environment name: 'CHANGE_ID', value: ''
35
+ not { changelog '.*^Automated release [0-9\\.]+$' }
36
+ not { branch 'master' }
37
+ }
38
+ }
39
+ steps {
40
+ parallel(
41
+
42
+ "ES lint": {
43
+ node(label: 'docker') {
44
+ 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 eslint'''
45
+ }
46
+ },
47
+
48
+ "Style lint": {
49
+ node(label: 'docker') {
50
+ 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 stylelint'''
51
+ }
52
+ },
53
+
54
+ "Prettier": {
55
+ node(label: 'docker') {
56
+ 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 prettier'''
57
+ }
58
+ }
59
+ )
60
+ }
61
+ }
62
+
63
+ stage('Tests') {
64
+ when {
65
+ allOf {
66
+ environment name: 'CHANGE_ID', value: ''
67
+ anyOf {
68
+ not { changelog '.*^Automated release [0-9\\.]+$' }
69
+ branch 'master'
70
+ }
71
+ }
72
+ }
73
+ steps {
74
+ parallel(
75
+
76
+ "Volto": {
77
+ node(label: 'docker') {
78
+ script {
79
+ try {
80
+ sh '''docker pull plone/volto-addon-ci'''
81
+ 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'''
82
+ sh '''rm -rf xunit-reports'''
83
+ sh '''mkdir -p xunit-reports'''
84
+ sh '''docker cp $BUILD_TAG-volto:/opt/frontend/my-volto-project/coverage xunit-reports/'''
85
+ sh '''docker cp $BUILD_TAG-volto:/opt/frontend/my-volto-project/junit.xml xunit-reports/'''
86
+ sh '''docker cp $BUILD_TAG-volto:/opt/frontend/my-volto-project/unit_tests_log.txt xunit-reports/'''
87
+ stash name: "xunit-reports", includes: "xunit-reports/**"
88
+ archiveArtifacts artifacts: "xunit-reports/unit_tests_log.txt", fingerprint: true
89
+ publishHTML (target : [
90
+ allowMissing: false,
91
+ alwaysLinkToLastBuild: true,
92
+ keepAll: true,
93
+ reportDir: 'xunit-reports/coverage/lcov-report',
94
+ reportFiles: 'index.html',
95
+ reportName: 'UTCoverage',
96
+ reportTitles: 'Unit Tests Code Coverage'
97
+ ])
98
+ } finally {
99
+ catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
100
+ junit testResults: 'xunit-reports/junit.xml', allowEmptyResults: true
101
+ }
102
+ sh script: '''docker rm -v $BUILD_TAG-volto''', returnStatus: true
103
+ }
104
+ }
105
+ }
106
+ }
107
+ )
108
+ }
109
+ }
110
+
111
+ stage('Integration tests') {
112
+ when {
113
+ allOf {
114
+ environment name: 'CHANGE_ID', value: ''
115
+ anyOf {
116
+ not { changelog '.*^Automated release [0-9\\.]+$' }
117
+ branch 'master'
118
+ }
119
+ }
120
+ }
121
+ steps {
122
+ parallel(
123
+
124
+ "Cypress": {
125
+ node(label: 'docker') {
126
+ script {
127
+ try {
128
+ 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'''
129
+ 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 VOLTO=$VOLTO plone/volto-addon-ci cypress'''
130
+ } finally {
131
+ try {
132
+ sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
133
+ sh '''mkdir -p cypress-reports cypress-results cypress-coverage'''
134
+ sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/videos cypress-reports/'''
135
+ sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/reports cypress-results/'''
136
+ coverage = sh script: '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/coverage cypress-coverage/''', returnStatus: true
137
+ if ( coverage == 0 ) {
138
+ publishHTML (target : [allowMissing: false,
139
+ alwaysLinkToLastBuild: true,
140
+ keepAll: true,
141
+ reportDir: 'cypress-coverage/coverage/lcov-report',
142
+ reportFiles: 'index.html',
143
+ reportName: 'CypressCoverage',
144
+ reportTitles: 'Integration Tests Code Coverage'])
145
+ }
146
+ 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'''
147
+ archiveArtifacts artifacts: 'cypress-reports/**/*.mp4', fingerprint: true, allowEmptyArchive: true
148
+ stash name: "cypress-coverage", includes: "cypress-coverage/**", allowEmpty: true
149
+ }
150
+ finally {
151
+ catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
152
+ junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true
153
+ }
154
+ sh script: "docker stop $BUILD_TAG-plone", returnStatus: true
155
+ sh script: "docker rm -v $BUILD_TAG-plone", returnStatus: true
156
+ sh script: "docker rm -v $BUILD_TAG-cypress", returnStatus: true
157
+
158
+ }
159
+ }
160
+ }
161
+ }
162
+ }
163
+
164
+ )
165
+ }
166
+ }
167
+
168
+ stage('Report to SonarQube') {
169
+ when {
170
+ allOf {
171
+ environment name: 'CHANGE_ID', value: ''
172
+ anyOf {
173
+ branch 'master'
174
+ allOf {
175
+ branch 'develop'
176
+ not { changelog '.*^Automated release [0-9\\.]+$' }
177
+ }
178
+ }
179
+ }
180
+ }
181
+ steps {
182
+ node(label: 'swarm') {
183
+ script{
184
+ checkout scm
185
+ unstash "xunit-reports"
186
+ unstash "cypress-coverage"
187
+ def scannerHome = tool 'SonarQubeScanner';
188
+ def nodeJS = tool 'NodeJS';
189
+ withSonarQubeEnv('Sonarqube') {
190
+ sh '''sed -i "s#/opt/frontend/my-volto-project/src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
191
+ sh '''sed -i "s#src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
192
+ 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"
193
+ 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'''
194
+ }
195
+ }
196
+ }
197
+ }
198
+ }
199
+
200
+ stage('Pull Request') {
201
+ when {
202
+ not {
203
+ environment name: 'CHANGE_ID', value: ''
204
+ }
205
+ environment name: 'CHANGE_TARGET', value: 'master'
206
+ }
207
+ steps {
208
+ node(label: 'docker') {
209
+ script {
210
+ if ( env.CHANGE_BRANCH != "develop" ) {
211
+ error "Pipeline aborted due to PR not made from develop branch"
212
+ }
213
+ withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN')]) {
214
+ sh '''docker pull eeacms/gitflow'''
215
+ sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-pr" -e GIT_CHANGE_TARGET="$CHANGE_TARGET" -e GIT_CHANGE_BRANCH="$CHANGE_BRANCH" -e GIT_CHANGE_AUTHOR="$CHANGE_AUTHOR" -e GIT_CHANGE_TITLE="$CHANGE_TITLE" -e GIT_TOKEN="$GITHUB_TOKEN" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e GIT_ORG="$GIT_ORG" -e GIT_NAME="$GIT_NAME" -e LANGUAGE=javascript eeacms/gitflow'''
216
+ }
217
+ }
218
+ }
219
+ }
220
+ }
221
+
222
+ }
223
+
224
+ post {
225
+ always {
226
+ cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
227
+ }
228
+ changed {
229
+ script {
230
+ def details = """<h1>${env.JOB_NAME} - Build #${env.BUILD_NUMBER} - ${currentBuild.currentResult}</h1>
231
+ <p>Check console output at <a href="${env.BUILD_URL}/display/redirect">${env.JOB_BASE_NAME} - #${env.BUILD_NUMBER}</a></p>
232
+ """
233
+ emailext(
234
+ subject: '$DEFAULT_SUBJECT',
235
+ body: details,
236
+ attachLog: true,
237
+ compressLog: true,
238
+ recipientProviders: [[$class: 'DevelopersRecipientProvider'], [$class: 'CulpritsRecipientProvider']]
239
+ )
240
+ }
241
+ }
242
+ }
243
+ }
package/LICENSE.md ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 European Environment Agency
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/Makefile.tpl ADDED
@@ -0,0 +1,97 @@
1
+ SHELL=/bin/bash
2
+
3
+ DIR=$(shell basename $$(pwd))
4
+ ADDON ?= "<%= addonName %>"
5
+
6
+ # We like colors
7
+ # From: https://coderwall.com/p/izxssa/colored-makefile-for-golang-projects
8
+ RED=`tput setaf 1`
9
+ GREEN=`tput setaf 2`
10
+ RESET=`tput sgr0`
11
+ YELLOW=`tput setaf 3`
12
+
13
+ ifeq ($(wildcard ./project),)
14
+ NODE_MODULES = "../../../node_modules"
15
+ else
16
+ NODE_MODULES = "./project/node_modules"
17
+ endif
18
+
19
+ project:
20
+ npm install -g yo
21
+ npm install -g @plone/generator-volto
22
+ npm install -g mrs-developer
23
+ yo @plone/volto project --addon ${ADDON} --workspace "src/addons/${DIR}" --no-interactive
24
+ ln -sf $$(pwd) project/src/addons/
25
+ cp .project.eslintrc.js .eslintrc.js
26
+ cd project && yarn
27
+ @echo "-------------------"
28
+ @echo "$(GREEN)Volto project is ready!$(RESET)"
29
+ @echo "$(RED)Now run: cd project && yarn start$(RESET)"
30
+
31
+ all: project
32
+
33
+ .PHONY: start-test-backend
34
+ start-test-backend: ## Start Test Plone Backend
35
+ @echo "$(GREEN)==> Start Test Plone Backend$(RESET)"
36
+ docker run -i --rm -e ZSERVER_HOST=0.0.0.0 -e ZSERVER_PORT=55001 -p 55001:55001 -e SITE=plone -e APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,kitconcept.volto:default-homepage -e CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,kitconcept.volto,kitconcept.volto.cors -e ADDONS='plone.app.robotframework plone.app.contenttypes plone.restapi kitconcept.volto' plone ./bin/robot-server plone.app.robotframework.testing.PLONE_ROBOT_TESTING
37
+
38
+ .PHONY: start-backend-docker
39
+ start-backend-docker: ## Starts a Docker-based backend
40
+ @echo "$(GREEN)==> Start Docker-based Plone Backend$(RESET)"
41
+ docker run -it --rm --name=plone -p 8080:8080 -e SITE=Plone -e ADDONS="kitconcept.volto" -e ZCML="kitconcept.volto.cors" plone
42
+
43
+ .PHONY: test
44
+ test: ## Run jest tests
45
+ docker pull plone/volto-addon-ci
46
+ 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
47
+
48
+ .PHONY: test-update
49
+ test-update: ## Update jest tests snapshots
50
+ docker pull plone/volto-addon-ci
51
+ 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 yarn test src/addons/${DIR}/src --watchAll=false -u
52
+
53
+ .PHONY: stylelint
54
+ stylelint: ## Stylelint
55
+ $(NODE_MODULES)/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'
56
+
57
+ .PHONY: stylelint-overrides
58
+ stylelint-overrides:
59
+ $(NODE_MODULES)/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'
60
+
61
+ .PHONY: stylelint-fix
62
+ stylelint-fix: ## Fix stylelint
63
+ $(NODE_MODULES)/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}' --fix
64
+ $(NODE_MODULES)/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides' --fix
65
+
66
+ .PHONY: prettier
67
+ prettier: ## Prettier
68
+ $(NODE_MODULES)/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'
69
+
70
+ .PHONY: prettier-fix
71
+ prettier-fix: ## Fix prettier
72
+ $(NODE_MODULES)/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'
73
+
74
+ .PHONY: lint
75
+ lint: ## ES Lint
76
+ $(NODE_MODULES)/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'
77
+
78
+ .PHONY: lint-fix
79
+ lint-fix: ## Fix ES Lint
80
+ $(NODE_MODULES)/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'
81
+
82
+ .PHONY: i18n
83
+ i18n: ## i18n
84
+ rm -rf build/messages
85
+ NODE_ENV=development $(NODE_MODULES)/.bin/i18n --addon
86
+
87
+ .PHONY: cypress-run
88
+ cypress-run: ## Run cypress integration tests
89
+ NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress run
90
+
91
+ .PHONY: cypress-open
92
+ cypress-open: ## Open cypress integration tests
93
+ NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress open
94
+
95
+ .PHONY: help
96
+ help: ## Show this help.
97
+ @echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)"
package/README.md ADDED
@@ -0,0 +1,80 @@
1
+ # volto-addon-template
2
+
3
+ [![Releases](https://img.shields.io/github/v/release/eea/volto-addon-template)](https://github.com/eea/volto-addon-template/releases)
4
+
5
+ [![Pipeline](https://ci.eionet.europa.eu/buildStatus/icon?job=volto-addons%2Fvolto-addon-template%2Fmaster&subject=master)](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-addon-template/job/master/display/redirect)
6
+ [![Lines of Code](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-addon-template-master&metric=ncloc)](https://sonarqube.eea.europa.eu/dashboard?id=volto-addon-template-master)
7
+ [![Coverage](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-addon-template-master&metric=coverage)](https://sonarqube.eea.europa.eu/dashboard?id=volto-addon-template-master)
8
+ [![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-addon-template-master&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=volto-addon-template-master)
9
+ [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-addon-template-master&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-addon-template-master)
10
+
11
+ [![Pipeline](https://ci.eionet.europa.eu/buildStatus/icon?job=volto-addons%2Fvolto-addon-template%2Fdevelop&subject=develop)](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-addon-template/job/develop/display/redirect)
12
+ [![Lines of Code](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-addon-template-develop&metric=ncloc)](https://sonarqube.eea.europa.eu/dashboard?id=volto-addon-template-develop)
13
+ [![Coverage](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-addon-template-develop&metric=coverage)](https://sonarqube.eea.europa.eu/dashboard?id=volto-addon-template-develop)
14
+ [![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-addon-template-develop&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=volto-addon-template-develop)
15
+ [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-addon-template-develop&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-addon-template-develop)
16
+
17
+
18
+ [Volto](https://github.com/plone/volto) add-on
19
+
20
+ ## Features
21
+
22
+ Demo GIF
23
+
24
+ ## Getting started
25
+
26
+ ### Add volto-addon-template to your Volto project
27
+
28
+ 1. Make sure you have a [Plone backend](https://plone.org/download) up-and-running at http://localhost:8080/Plone
29
+
30
+ 1. Start Volto frontend
31
+
32
+ * If you already have a volto project, just update `package.json`:
33
+
34
+ ```JSON
35
+ "addons": [
36
+ "@eeacms/volto-addon-template"
37
+ ],
38
+
39
+ "dependencies": {
40
+ "@eeacms/volto-addon-template": "*"
41
+ }
42
+ ```
43
+
44
+ * If not, create one:
45
+
46
+ ```
47
+ npm install -g yo @plone/generator-volto
48
+ yo @plone/volto my-volto-project --canary --addon @eeacms/volto-addon-template
49
+ cd my-volto-project
50
+ ```
51
+
52
+ 1. Install new add-ons and restart Volto:
53
+
54
+ ```
55
+ yarn
56
+ yarn start
57
+ ```
58
+
59
+ 1. Go to http://localhost:3000
60
+
61
+ 1. Happy editing!
62
+
63
+ ## Release
64
+
65
+ See [RELEASE.md](https://github.com/eea/volto-addon-template/blob/master/RELEASE.md).
66
+
67
+ ## How to contribute
68
+
69
+ See [DEVELOP.md](https://github.com/eea/volto-addon-template/blob/master/DEVELOP.md).
70
+
71
+ ## Copyright and license
72
+
73
+ The Initial Owner of the Original Code is European Environment Agency (EEA).
74
+ All Rights Reserved.
75
+
76
+ See [LICENSE.md](https://github.com/eea/volto-addon-template/blob/master/LICENSE.md) for details.
77
+
78
+ ## Funding
79
+
80
+ [European Environment Agency (EU)](http://eea.europa.eu)