Skip to content

Commit bf47bf4

Browse files
committed
Make this up to date
1 parent 701311e commit bf47bf4

File tree

15 files changed

+533
-141
lines changed

15 files changed

+533
-141
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
.vscode/
22
.history
33
.eslintrc.js
4+
.nyc_output
45
project
6+
coverage
57
logs
68
*.log
79
npm-debug.log*
810
.DS_Store
911
*.swp
1012
yarn-error.log
13+
yarn.lock
14+
package-lock.json
1115

1216
node_modules
1317
build

.i18n.babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@plone/volto/babel');

.npmignore

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# https://docs.npmjs.com/using-npm/developers.html#keeping-files-out-of-your-package
2+
3+
# Directories
4+
api/
5+
bin/
6+
build/
7+
lib/
8+
g-api/
9+
tests/
10+
11+
# Docs
12+
docs/
13+
14+
# Cypress
15+
cypress/
16+
17+
# Tests
18+
__tests__/
19+
*.snap
20+
21+
# Files
22+
.travis.yml
23+
requirements-docs.txt
24+
requirements-tests.txt
25+
yarn.lock
26+
.dockerignore
27+
.gitattributes
28+
.yarnrc
29+
.nvmrc
30+
changelogupdater.js
31+
pip-selfcheck.json
32+
Dockerfile
33+
CNAME
34+
entrypoint.sh
35+
Jenkinsfile
36+
Makefile
37+
38+
# Logs
39+
logs
40+
*.log
41+
npm-debug.log*
42+
yarn-debug.log*
43+
yarn-error.log*
44+
45+
# Runtime data
46+
pids
47+
*.pid
48+
*.seed
49+
*.pid.lock
50+
51+
# Directory for instrumented libs generated by jscoverage/JSCover
52+
lib-cov
53+
54+
# Coverage directory used by tools like istanbul
55+
coverage
56+
57+
# nyc test coverage
58+
.nyc_output
59+
60+
# node-waf configuration
61+
.lock-wscript
62+
63+
# Compiled binary addons (https://nodejs.org/api/addons.html)
64+
build/Release
65+
66+
# Dependency directories
67+
node_modules/
68+
jspm_packages/
69+
70+
# TypeScript v1 declaration files
71+
typings/
72+
73+
# Optional npm cache directory
74+
.npm
75+
76+
# Optional eslint cache
77+
.eslintcache
78+
79+
# Optional REPL history
80+
.node_repl_history
81+
82+
# Output of 'npm pack'
83+
*.tgz
84+
85+
# Yarn Integrity file
86+
.yarn-integrity
87+
88+
# dotenv environment variables file
89+
.env
90+
91+
# next.js build output
92+
.next
93+
94+
styleguide.config
95+
.vscode
96+
packages

Jenkinsfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@ pipeline {
4141

4242
"ES lint": {
4343
node(label: 'docker') {
44-
sh '''docker run -i --rm --name="$BUILD_TAG-eslint" -e VOLTO="$VOLTO" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci eslint'''
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:alpha eslint'''
4545
}
4646
},
4747

4848
"Style lint": {
4949
node(label: 'docker') {
50-
sh '''docker run -i --rm --name="$BUILD_TAG-stylelint" -e VOLTO="$VOLTO" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci stylelint'''
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:alpha stylelint'''
5151
}
5252
},
5353

5454
"Prettier": {
5555
node(label: 'docker') {
56-
sh '''docker run -i --rm --name="$BUILD_TAG-prettier" -e VOLTO="$VOLTO" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci prettier'''
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:alpha prettier'''
5757
}
5858
}
5959
)
@@ -77,8 +77,8 @@ pipeline {
7777
node(label: 'docker') {
7878
script {
7979
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" plone/volto-addon-ci'''
80+
sh '''docker pull plone/volto-addon-ci:alpha'''
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:alpha'''
8282
sh '''rm -rf xunit-reports'''
8383
sh '''mkdir -p xunit-reports'''
8484
sh '''docker cp $BUILD_TAG-volto:/opt/frontend/my-volto-project/coverage xunit-reports/'''
@@ -126,7 +126,7 @@ pipeline {
126126
script {
127127
try {
128128
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 VOLTO="$VOLTO" -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'''
129+
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'''
130130
} finally {
131131
try {
132132
sh '''rm -rf cypress-reports cypress-results cypress-coverage'''

Makefile

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
SHELL=/bin/bash
22

33
DIR=$(shell basename $$(pwd))
4-
ADDON ?= "@eeacms/volto-depiction"
4+
ADDON ?= "@eeacms/volto-addon-template"
55

66
# We like colors
77
# From: https://coderwall.com/p/izxssa/colored-makefile-for-golang-projects
@@ -34,7 +34,65 @@ start-backend-docker: ## Starts a Docker-based backend
3434
@echo "$(GREEN)==> Start Docker-based Plone Backend$(RESET)"
3535
docker run -it --rm --name=plone -p 8080:8080 -e SITE=Plone -e ADDONS="kitconcept.volto" -e ZCML="kitconcept.volto.cors" plone
3636

37+
.PHONY: test
38+
test:
39+
docker pull plone/volto-addon-ci:alpha
40+
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:alpha
41+
42+
.PHONY: test-update
43+
test-update:
44+
docker pull plone/volto-addon-ci:alpha
45+
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:alpha yarn test src/addons/${DIR}/src --watchAll=false -u
46+
3747
.PHONY: help
38-
help: ## Show this help.
39-
@echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)"
40-
:)"
48+
help: ## Show this help.
49+
@echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)"
50+
51+
52+
ifeq ($(wildcard ./project),)
53+
NODE_MODULES = "../../../node_modules"
54+
else
55+
NODE_MODULES = "./project/node_modules"
56+
endif
57+
58+
.PHONY: stylelint
59+
stylelint:
60+
$(NODE_MODULES)/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'
61+
62+
.PHONY: stylelint-overrides
63+
stylelint-overrides:
64+
$(NODE_MODULES)/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'
65+
66+
.PHONY: stylelint-fix
67+
stylelint-fix:
68+
$(NODE_MODULES)/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}' --fix
69+
$(NODE_MODULES)/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides' --fix
70+
71+
.PHONY: prettier
72+
prettier:
73+
$(NODE_MODULES)/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'
74+
75+
.PHONY: prettier-fix
76+
prettier-fix:
77+
$(NODE_MODULES)/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'
78+
79+
.PHONY: lint
80+
lint:
81+
$(NODE_MODULES)/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'
82+
83+
.PHONY: lint-fix
84+
lint-fix:
85+
$(NODE_MODULES)/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'
86+
87+
.PHONY: i18n
88+
i18n:
89+
rm -rf build/messages
90+
NODE_ENV=development $(NODE_MODULES)/.bin/i18n --addon
91+
92+
.PHONY: cypress-run
93+
cypress-run:
94+
NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress run
95+
96+
.PHONY: cypress-open
97+
cypress-open:
98+
NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress open

README.md

Lines changed: 17 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
[![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-depiction-develop&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=volto-depiction-develop)
1515
[![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-depiction-develop&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-depiction-develop)
1616

17-
1817
[Volto](https://github.com/plone/volto) add-on: To use depiction image scales
1918

2019
## Features
@@ -37,6 +36,7 @@ See [volto-listing-block](https://github.com/eea/volto-listing-block)
3736
```
3837

3938
1. Start Plone backend
39+
4040
```
4141
docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" plone
4242
```
@@ -55,25 +55,25 @@ See [volto-listing-block](https://github.com/eea/volto-listing-block)
5555

5656
1. Start Volto frontend
5757

58-
* If you already have a volto project, just update `package.json`:
58+
- If you already have a volto project, just update `package.json`:
5959

60-
```JSON
61-
"addons": [
62-
"@eeacms/volto-depiction"
63-
],
60+
```JSON
61+
"addons": [
62+
"@eeacms/volto-depiction"
63+
],
6464

65-
"dependencies": {
66-
"@eeacms/volto-depiction": "^1.0.0"
67-
}
68-
```
65+
"dependencies": {
66+
"@eeacms/volto-depiction": "^1.0.0"
67+
}
68+
```
6969

70-
* If not, create one:
70+
- If not, create one:
7171

72-
```
73-
npm install -g yo @plone/generator-volto
74-
yo @plone/volto my-volto-project --addon @eeacms/volto-depiction
75-
cd my-volto-project
76-
```
72+
```
73+
npm install -g yo @plone/generator-volto
74+
yo @plone/volto my-volto-project --addon @eeacms/volto-depiction
75+
cd my-volto-project
76+
```
7777

7878
1. Install new add-ons and restart Volto:
7979

@@ -88,78 +88,7 @@ See [volto-listing-block](https://github.com/eea/volto-listing-block)
8888

8989
## Release
9090

91-
### Automatic release using Jenkins
92-
93-
* 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.
94-
* It runs on every commit on `master` branch, which is protected from direct commits, only allowing pull request merge commits.
95-
* 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.
96-
* 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.
97-
* 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.
98-
* The version format must be MAJOR.MINOR.PATCH. By default, next release is set to next minor version (with patch 0).
99-
* 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.
100-
* Automated commits and commits with [JENKINS] or [YARN] in the commit log are excluded from `CHANGELOG.md` file.
101-
102-
### Manual release from the develop branch ( beta release )
103-
104-
#### Installation and configuration of release-it
105-
106-
You need to first install the [release-it](https://github.com/release-it/release-it) client.
107-
108-
```
109-
npm install -g release-it
110-
```
111-
112-
Release-it uses the configuration written in the [`.release-it.json`](./.release-it.json) file located in the root of the repository.
113-
114-
Release-it is a tool that automates 4 important steps in the release process:
115-
116-
1. Version increase in `package.json` ( increased from the current version in `package.json`)
117-
2. `CHANGELOG.md` automatic generation from commit messages ( grouped by releases )
118-
3. GitHub release on the commit with the changelog and package.json modification on the develop branch
119-
4. NPM release ( by default it's disabled, but can be enabled in the configuration file )
120-
121-
To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
122-
123-
```
124-
export GITHUB_TOKEN=XXX-XXXXXXXXXXXXXXXXXXXXXX
125-
```
126-
127-
To configure npm, you can use the `npm login` command or use a configuration file with a TOKEN :
128-
129-
```
130-
echo "//registry.npmjs.org/:_authToken=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" > .npmrc
131-
```
132-
133-
#### Using release-it tool
134-
135-
There are 3 yarn scripts that can be run to do the release
136-
137-
##### yarn release-beta
138-
139-
Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
140-
141-
```
142-
? Select increment (next version):
143-
❯ prepatch (0.1.1-beta.0)
144-
preminor (0.2.0-beta.0)
145-
premajor (1.0.0-beta.0)
146-
Other, please specify...
147-
```
148-
149-
##### yarn release-major-beta
150-
151-
Same as `yarn release-beta`, but with premajor version pre-selected.
152-
153-
##### yarn release
154-
155-
Generic command, does not automatically add the `beta` to version, but you can still manually write it if you choose Other.
156-
157-
#### Important notes
158-
159-
> 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.
160-
161-
> 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).
162-
91+
See [RELEASE.md](https://github.com/eea/volto-depiction/blob/master/RELEASE.md).
16392

16493
## How to contribute
16594

0 commit comments

Comments
 (0)