@eeacms/volto-widget-toggle 3.1.2 → 3.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.
@@ -0,0 +1,2 @@
1
+ [ -n "$CI" ] && exit 0
2
+ yarn lint-staged
package/CHANGELOG.md CHANGED
@@ -4,11 +4,26 @@ 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
- ### [3.1.2](https://github.com/eea/volto-widget-toggle/compare/3.1.1...3.1.2) - 24 July 2023
7
+ ### [3.1.3](https://github.com/eea/volto-widget-toggle/compare/3.1.2...3.1.3) - 29 September 2023
8
+
9
+ #### :house: Internal changes
10
+
11
+ - style: lint-staged reorder in package.json [Alin Voinea - [`e76a014`](https://github.com/eea/volto-widget-toggle/commit/e76a0149a1b5fb842e0c4f9f1cff8c2628faa75a)]
12
+
13
+ #### :house: Documentation changes
14
+
15
+ - docs: Update README and DEVELOP [Alin Voinea - [`3a26f66`](https://github.com/eea/volto-widget-toggle/commit/3a26f66d8abf5f4dcd9f963e2671f64009d5e0d6)]
16
+ - docs: Cleanup Makefile, update DEVELOP documentation, i18n - refs #254894 [valentinab25 - [`01571f4`](https://github.com/eea/volto-widget-toggle/commit/01571f44314839c25a206d0991f2b079c704ffcb)]
8
17
 
9
18
  #### :hammer_and_wrench: Others
10
19
 
11
- - test: add unit tests for CheckboxWidget - refs #253277 [ana-oprea - [`7eb7622`](https://github.com/eea/volto-widget-toggle/commit/7eb7622ab02f7a429ad300c0795798aa7301e918)]
20
+ - test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`b2f509e`](https://github.com/eea/volto-widget-toggle/commit/b2f509eb236e0beeccfc8bc89f4c6527a3fca223)]
21
+ - test: Fix package.json scripts to use makefile [Alin Voinea - [`72e8245`](https://github.com/eea/volto-widget-toggle/commit/72e8245a4741988849eaa73e5fd238ff6d340fa9)]
22
+ - test: Fix eslint and yarn i18n [Alin Voinea - [`034eaf8`](https://github.com/eea/volto-widget-toggle/commit/034eaf890faa3a9c09aa6f4ddca1bc04e46782a8)]
23
+ - i18n: Add en [Alin Voinea - [`e60d799`](https://github.com/eea/volto-widget-toggle/commit/e60d799a64230544e37e1f4796dc73bbc0e674c6)]
24
+ - test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`f86b2f7`](https://github.com/eea/volto-widget-toggle/commit/f86b2f7119f24b637e8bc8101effc2c2c3416a65)]
25
+ ### [3.1.2](https://github.com/eea/volto-widget-toggle/compare/3.1.1...3.1.2) - 24 July 2023
26
+
12
27
  ### [3.1.1](https://github.com/eea/volto-widget-toggle/compare/3.1.0...3.1.1) - 12 June 2023
13
28
 
14
29
  #### :hammer_and_wrench: Others
package/DEVELOP.md CHANGED
@@ -2,18 +2,40 @@
2
2
 
3
3
  ## Develop
4
4
 
5
+ 1. Make sure you have `docker` and `docker compose` installed and running on your machine:
6
+
7
+ ```Bash
8
+ git clone https://github.com/eea/volto-widget-toggle.git
9
+ cd volto-widget-toggle
10
+ git checkout -b bugfix-123456 develop
11
+ make
12
+ make start
13
+ ```
14
+
15
+ 1. Wait for `Volto started at 0.0.0.0:3000` meesage
16
+
17
+ 1. Go to http://localhost:3000
18
+
19
+ 1. Initialize git hooks
20
+
21
+ ```Bash
22
+ yarn prepare
23
+ ```
24
+
25
+ 1. Happy hacking!
26
+
27
+ ### Or add @eeacms/volto-widget-toggle to your Volto project
28
+
5
29
  Before starting make sure your development environment is properly set. See [Volto Developer Documentation](https://docs.voltocms.com/getting-started/install/)
6
30
 
7
31
  1. Make sure you have installed `yo`, `@plone/generator-volto` and `mrs-developer`
8
32
 
9
- $ npm install -g yo
10
- $ npm install -g @plone/generator-volto
11
- $ npm install -g mrs-developer
33
+ npm install -g yo @plone/generator-volto mrs-developer
12
34
 
13
35
  1. Create new volto app
14
36
 
15
- $ yo @plone/volto my-volto-project --addon @eeacms/volto-widget-toggle
16
- $ cd my-volto-project
37
+ yo @plone/volto my-volto-project --addon @eeacms/volto-widget-toggle --skip-install
38
+ cd my-volto-project
17
39
 
18
40
  1. Add the following to `mrs.developer.json`:
19
41
 
@@ -28,25 +50,57 @@ Before starting make sure your development environment is properly set. See [Vol
28
50
 
29
51
  1. Install
30
52
 
31
- $ yarn develop
32
- $ yarn
53
+ make develop
54
+ yarn
33
55
 
34
56
  1. Start backend
35
57
 
36
- $ docker run -d --name plone -p 8080:8080 -e SITE=Plone plone
58
+ docker run --pull always -it --rm --name plone -p 8080:8080 -e SITE=Plone plone/plone-backend
37
59
 
38
60
  ...wait for backend to setup and start - `Ready to handle requests`:
39
61
 
40
- $ docker logs -f plone
41
-
42
62
  ...you can also check http://localhost:8080/Plone
43
63
 
44
64
  1. Start frontend
45
65
 
46
- $ yarn start
66
+ yarn start
47
67
 
48
68
  1. Go to http://localhost:3000
49
69
 
50
70
  1. Happy hacking!
51
71
 
52
- $ cd src/addons/volto-widget-toggle/
72
+ cd src/addons/volto-widget-toggle/
73
+
74
+ ## Cypress
75
+
76
+ To run cypress locally, first make sure you don't have any Volto/Plone running on ports `8080` and `3000`.
77
+
78
+ You don't have to be in a `clean-volto-project`, you can be in any Volto Frontend
79
+ project where you added `volto-widget-toggle` to `mrs.developer.json`
80
+
81
+ Go to:
82
+
83
+ ```BASH
84
+ cd src/addons/volto-widget-toggle/
85
+ ```
86
+
87
+ Start:
88
+
89
+ ```Bash
90
+ make
91
+ make start
92
+ ```
93
+
94
+ This will build and start with Docker a clean `Plone backend` and `Volto Frontend` with `volto-widget-toggle` block installed.
95
+
96
+ Open Cypress Interface:
97
+
98
+ ```Bash
99
+ make cypress-open
100
+ ```
101
+
102
+ Or run it:
103
+
104
+ ```Bash
105
+ make cypress-run
106
+ ```
package/README.md CHANGED
@@ -22,17 +22,26 @@
22
22
 
23
23
  ## Getting started
24
24
 
25
- 1. Create new volto project if you don't already have one:
25
+ ### Try volto-widget-toggle with Docker
26
26
 
27
- ```
28
- $ npm install -g yo @plone/generator-volto
29
- $ yo @plone/volto my-volto-project --addon @eeacms/volto-widget-toggle
27
+ git clone https://github.com/eea/volto-widget-toggle.git
28
+ cd volto-widget-toggle
29
+ make
30
+ make start
31
+
32
+ Go to http://localhost:3000
33
+
34
+ ### Add volto-widget-toggle to your Volto project
30
35
 
31
- $ cd my-volto-project
32
- $ yarn add -W @eeacms/volto-widget-toggle
36
+ 1. Make sure you have a [Plone backend](https://plone.org/download) up-and-running at http://localhost:8080/Plone
37
+
38
+ ```Bash
39
+ docker compose up backend
33
40
  ```
34
41
 
35
- 1. If you already have a volto project, just update `package.json`:
42
+ 1. Start Volto frontend
43
+
44
+ * If you already have a volto project, just update `package.json`:
36
45
 
37
46
  ```JSON
38
47
  "addons": [
@@ -40,15 +49,23 @@
40
49
  ],
41
50
 
42
51
  "dependencies": {
43
- "@eeacms/volto-widget-toggle": "^2.0.0"
52
+ "@eeacms/volto-widget-toggle": "*"
44
53
  }
45
54
  ```
46
55
 
56
+ * If not, create one:
57
+
58
+ ```
59
+ npm install -g yo @plone/generator-volto
60
+ yo @plone/volto my-volto-project --canary --addon @eeacms/volto-widget-toggle
61
+ cd my-volto-project
62
+ ```
63
+
47
64
  1. Install new add-ons and restart Volto:
48
65
 
49
66
  ```
50
- $ yarn
51
- $ yarn start
67
+ yarn
68
+ yarn start
52
69
  ```
53
70
 
54
71
  1. Go to http://localhost:3000
package/cypress.config.js CHANGED
@@ -2,12 +2,12 @@ const { defineConfig } = require('cypress');
2
2
 
3
3
  module.exports = defineConfig({
4
4
  viewportWidth: 1280,
5
- defaultCommandTimeout: 8888,
5
+ defaultCommandTimeout: 5000,
6
6
  chromeWebSecurity: false,
7
7
  reporter: 'junit',
8
8
  video: true,
9
9
  retries: {
10
- runMode: 8,
10
+ runMode: 1,
11
11
  openMode: 0,
12
12
  },
13
13
  reporterOptions: {
@@ -0,0 +1,32 @@
1
+ version: "3"
2
+ services:
3
+ backend:
4
+ image: eeacms/plone-backend
5
+ ports:
6
+ - "8080:8080"
7
+ environment:
8
+ SITE: "Plone"
9
+ PROFILES: "eea.kitkat:testing"
10
+
11
+ frontend:
12
+ build:
13
+ context: ./
14
+ dockerfile: ./Dockerfile
15
+ args:
16
+ ADDON_NAME: "${ADDON_NAME}"
17
+ ADDON_PATH: "${ADDON_PATH}"
18
+ VOLTO_VERSION: ${VOLTO_VERSION:-16}
19
+ ports:
20
+ - "3000:3000"
21
+ - "3001:3001"
22
+ depends_on:
23
+ - backend
24
+ volumes:
25
+ - ./:/app/src/addons/${ADDON_PATH}
26
+ environment:
27
+ CI: "true"
28
+ NODE_ENV: "development"
29
+ RAZZLE_JEST_CONFIG: "src/addons/${ADDON_PATH}/jest-addon.config.js"
30
+ RAZZLE_INTERNAL_API_PATH: "http://backend:8080/Plone"
31
+ RAZZLE_DEV_PROXY_API_PATH: "http://backend:8080/Plone"
32
+ HOST: "0.0.0.0"
@@ -0,0 +1,14 @@
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: \n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: \n"
8
+ "Language: \n"
9
+ "Language-Team: \n"
10
+ "Content-Type: \n"
11
+ "Content-Transfer-Encoding: \n"
12
+ "Plural-Forms: \n"
13
+
14
+
@@ -0,0 +1,14 @@
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: \n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: \n"
8
+ "Language: \n"
9
+ "Language-Team: \n"
10
+ "Content-Type: \n"
11
+ "Content-Transfer-Encoding: \n"
12
+ "Plural-Forms: \n"
13
+
14
+
@@ -0,0 +1,14 @@
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: \n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: \n"
8
+ "Language: \n"
9
+ "Language-Team: \n"
10
+ "Content-Type: \n"
11
+ "Content-Transfer-Encoding: \n"
12
+ "Plural-Forms: \n"
13
+
14
+
@@ -0,0 +1,14 @@
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: \n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: \n"
8
+ "Language: \n"
9
+ "Language-Team: \n"
10
+ "Content-Type: \n"
11
+ "Content-Transfer-Encoding: \n"
12
+ "Plural-Forms: \n"
13
+
14
+
package/locales/volto.pot CHANGED
@@ -0,0 +1,16 @@
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Plone\n"
4
+ "POT-Creation-Date: 2023-06-28T10:48:22.678Z\n"
5
+ "Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
6
+ "Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
7
+ "MIME-Version: 1.0\n"
8
+ "Content-Type: text/plain; charset=utf-8\n"
9
+ "Content-Transfer-Encoding: 8bit\n"
10
+ "Plural-Forms: nplurals=1; plural=0;\n"
11
+ "Language-Code: en\n"
12
+ "Language-Name: English\n"
13
+ "Preferred-Encodings: utf-8\n"
14
+ "Domain: volto\n"
15
+
16
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-widget-toggle",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "description": "volto-widget-toggle: Volto add-on to replace checkboxes with toggle buttons",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -22,21 +22,49 @@
22
22
  "@cypress/code-coverage": "^3.10.0",
23
23
  "@plone/scripts": "*",
24
24
  "babel-plugin-transform-class-properties": "^6.24.1",
25
+ "husky": "*",
26
+ "lint-staged": "*",
25
27
  "md5": "^2.3.0"
26
28
  },
29
+ "lint-staged": {
30
+ "src/**/*.{js,jsx,ts,tsx,json}": [
31
+ "make lint-fix",
32
+ "make prettier-fix"
33
+ ],
34
+ "src/**/*.{jsx}": [
35
+ "make i18n"
36
+ ],
37
+ "theme/**/*.{css,less}": [
38
+ "make stylelint-fix"
39
+ ],
40
+ "src/**/*.{css,less}": [
41
+ "make stylelint-fix"
42
+ ],
43
+ "theme/**/*.overrides": [
44
+ "make stylelint-fix"
45
+ ],
46
+ "src/**/*.overrides": [
47
+ "make stylelint-fix"
48
+ ]
49
+ },
27
50
  "scripts": {
28
51
  "release": "release-it",
29
52
  "release-major-beta": "release-it major --preRelease=beta",
30
53
  "release-beta": "release-it --preRelease=beta",
31
54
  "bootstrap": "npm install -g ejs; npm link ejs; node bootstrap",
32
- "stylelint": "../../../node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'",
33
- "stylelint:overrides": "../../../node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'",
34
- "stylelint:fix": "yarn stylelint --fix && yarn stylelint:overrides --fix",
35
- "prettier": "../../../node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'",
36
- "prettier:fix": "../../../node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'",
37
- "lint": "../../../node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'",
38
- "lint:fix": "../../../node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'",
39
- "cypress:run": "../../../node_modules/cypress/bin/cypress run",
40
- "cypress:open": "../../../node_modules/cypress/bin/cypress open"
55
+ "test": "make test",
56
+ "test:fix": "make test-update",
57
+ "pre-commit": "yarn stylelint:fix && yarn prettier:fix && yarn lint:fix",
58
+ "stylelint": "make stylelint",
59
+ "stylelint:overrides": "make stylelint-overrides",
60
+ "stylelint:fix": "make stylelint-fix",
61
+ "prettier": "make prettier",
62
+ "prettier:fix": "make prettier-fix",
63
+ "lint": "make lint",
64
+ "lint:fix": "make lint-fix",
65
+ "i18n": "make i18n",
66
+ "cypress:run": "make cypress-run",
67
+ "cypress:open": "make cypress-open",
68
+ "prepare": "husky install"
41
69
  }
42
70
  }
@@ -2,4 +2,4 @@
2
2
  * Point of contact for component modules.
3
3
  * @module components
4
4
  */
5
- export CheckboxWidget from './manage/Widgets/CheckboxWidget';
5
+ export { default as CheckboxWidget } from './manage/Widgets/CheckboxWidget';
@@ -1 +0,0 @@
1
- module.exports = require('@plone/volto/babel');