@eeacms/volto-eea-kitkat 4.1.3 → 4.1.7
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 +42 -0
- package/README.md +21 -0
- package/cypress.json +5 -1
- package/package.json +9 -8
- package/src/i18n.js +0 -180
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,50 @@ 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
|
+
#### [4.1.7](https://github.com/eea/volto-eea-kitkat/compare/4.1.6...4.1.7)
|
|
8
|
+
|
|
9
|
+
- Cleanup obsolte i18n script [`8d8896d`](https://github.com/eea/volto-eea-kitkat/commit/8d8896db6227ec14eb536cee4b632cdeeeed56aa)
|
|
10
|
+
|
|
11
|
+
#### [4.1.6](https://github.com/eea/volto-eea-kitkat/compare/4.1.5...4.1.6)
|
|
12
|
+
|
|
13
|
+
> 24 November 2021
|
|
14
|
+
|
|
15
|
+
- Develop [`#19`](https://github.com/eea/volto-eea-kitkat/pull/19)
|
|
16
|
+
- Cypress tests in child addons [`#18`](https://github.com/eea/volto-eea-kitkat/pull/18)
|
|
17
|
+
- screenshotOnRunFailure: false [`de33099`](https://github.com/eea/volto-eea-kitkat/commit/de330994f12db6e0436ddfcfa0dc173ddeff3778)
|
|
18
|
+
- cy: upload video on failure [`b3c2b46`](https://github.com/eea/volto-eea-kitkat/commit/b3c2b464b14baf5e2a972bc001f5872288faa0a8)
|
|
19
|
+
- Refs #142010 - Optimize Volto-addons gitflow pipelines [`8494683`](https://github.com/eea/volto-eea-kitkat/commit/84946833bfc87dac06ce38a23665b42addafdcfe)
|
|
20
|
+
- archive cypress-reports/videos [`ffa28b1`](https://github.com/eea/volto-eea-kitkat/commit/ffa28b10234ba316ffd7e133a94117e2e0f240ae)
|
|
21
|
+
- Release @eeacms/volto-accordion-block@3.4.8 [`9c99f2b`](https://github.com/eea/volto-eea-kitkat/commit/9c99f2b4ae946baa1c0190efff44ee547565b16a)
|
|
22
|
+
- shift configs -> cypress.json [`8c2ff75`](https://github.com/eea/volto-eea-kitkat/commit/8c2ff758fabf7a156d50ce179555862fec1cad3e)
|
|
23
|
+
- run cypress in child addons [`4a29e33`](https://github.com/eea/volto-eea-kitkat/commit/4a29e33c9ebfc2ca039e9da34bab55e58dc007d3)
|
|
24
|
+
|
|
25
|
+
#### [4.1.5](https://github.com/eea/volto-eea-kitkat/compare/4.1.4...4.1.5)
|
|
26
|
+
|
|
27
|
+
> 19 November 2021
|
|
28
|
+
|
|
29
|
+
- Addons updates [`#17`](https://github.com/eea/volto-eea-kitkat/pull/17)
|
|
30
|
+
- Release @eeacms/volto-block-style@3.5.3 [`6ca12a3`](https://github.com/eea/volto-eea-kitkat/commit/6ca12a382fbb5d8f7662fb5ba7169e5640b056c3)
|
|
31
|
+
- Revert "Release volto-slate@5.1.1" [`fff322e`](https://github.com/eea/volto-eea-kitkat/commit/fff322e60cbb11639bb0987eaad3500225cfa9b8)
|
|
32
|
+
- Release volto-slate@5.1.1 [`39a8899`](https://github.com/eea/volto-eea-kitkat/commit/39a8899700b84a170ad255677289efacca3c4c3a)
|
|
33
|
+
- Revert "Release volto-slate@5.1.0" [`b14761c`](https://github.com/eea/volto-eea-kitkat/commit/b14761c51e7acc132b95a91cf63a5ec7635154dc)
|
|
34
|
+
- Release volto-slate@5.1.0 [`7c1c8b9`](https://github.com/eea/volto-eea-kitkat/commit/7c1c8b971c098682a04cb56f91b1cf85a119bd32)
|
|
35
|
+
|
|
36
|
+
#### [4.1.4](https://github.com/eea/volto-eea-kitkat/compare/4.1.3...4.1.4)
|
|
37
|
+
|
|
38
|
+
> 17 November 2021
|
|
39
|
+
|
|
40
|
+
- Release [`#16`](https://github.com/eea/volto-eea-kitkat/pull/16)
|
|
41
|
+
- Release @eeacms/volto-metadata-block@4.0.2 [`3afddfe`](https://github.com/eea/volto-eea-kitkat/commit/3afddfe665089559fc6921d0b70cc2fa5fb16b04)
|
|
42
|
+
- Update docs about resolutions [`e0af879`](https://github.com/eea/volto-eea-kitkat/commit/e0af879d360c15aa10e471150f9cb2ce6f41b14a)
|
|
43
|
+
- remove tests from master [`b4115c4`](https://github.com/eea/volto-eea-kitkat/commit/b4115c4f595d5767ad0493944ad132f3fdfcf445)
|
|
44
|
+
- Revert "Disable cypress" [`a161c31`](https://github.com/eea/volto-eea-kitkat/commit/a161c31535cf33621c7513ddc5d8954ff9532c4a)
|
|
45
|
+
|
|
7
46
|
#### [4.1.3](https://github.com/eea/volto-eea-kitkat/compare/4.1.2...4.1.3)
|
|
8
47
|
|
|
48
|
+
> 15 November 2021
|
|
49
|
+
|
|
50
|
+
- Enforce Volto add-ons pins with resolutions [`#14`](https://github.com/eea/volto-eea-kitkat/pull/14)
|
|
9
51
|
- Disable cypress [`a406e2d`](https://github.com/eea/volto-eea-kitkat/commit/a406e2dc4be788f924642d43d82c677577a6877a)
|
|
10
52
|
- Roll-back volto-slate to 4.2.1 [`ab6ae97`](https://github.com/eea/volto-eea-kitkat/commit/ab6ae97366c1b75b73d77636f5ab937401b9f8f7)
|
|
11
53
|
- Add dependencies resolutions [`7ade630`](https://github.com/eea/volto-eea-kitkat/commit/7ade6305c9c9dfc5c2e332c50676d5f75ffe4c9f)
|
package/README.md
CHANGED
|
@@ -80,6 +80,27 @@
|
|
|
80
80
|
|
|
81
81
|
1. Happy hacking!
|
|
82
82
|
|
|
83
|
+
## Resolutions
|
|
84
|
+
|
|
85
|
+
Volto EEA KitKat provides a set of generic Volto Add-ons and a `Known Good Set` of these add-ons versions to be used within your Volto projects without having to worry about which add-on version works best with another add-on.
|
|
86
|
+
|
|
87
|
+
While in other systems when you pin a package version to a specific number you will get that package version, in Javascript world [is not that simple](https://medium.com/swlh/welcome-to-dependency-hell-754a896f0440).
|
|
88
|
+
|
|
89
|
+
For this, Volto EEA Kitkat is using [selective dependency resolutions](https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/). While this work as expected in most of the cases, you may still have some surprises.
|
|
90
|
+
|
|
91
|
+
### Troubleshooting
|
|
92
|
+
|
|
93
|
+
1. Make sure your Volto project `yarn.lock` is not polluted. You can always reset your Volto project `yarn.lock` with:
|
|
94
|
+
|
|
95
|
+
$ npm install -g @plone/generator-volto
|
|
96
|
+
$ cd my-volto-project
|
|
97
|
+
$ yo @plone/volto --skip-install --no-interactive /tmp/new-volto-project
|
|
98
|
+
$ cp /tmp/new-volto-project/yarn.lock .
|
|
99
|
+
$ yarn
|
|
100
|
+
|
|
101
|
+
2. Add-on `resolutions` don't work with `workspaces` (development mode), thus you'll need to define `resolutions` within Volto project. To tackle this issue, this Docker image automatically extracts `resolutions` from add-on and add them also to the Volto project before running tests.
|
|
102
|
+
|
|
103
|
+
|
|
83
104
|
### Try `volto-eea-kitkat` with Docker
|
|
84
105
|
|
|
85
106
|
1. Get the latest Docker images
|
package/cypress.json
CHANGED
|
@@ -13,5 +13,9 @@
|
|
|
13
13
|
"mochaFile": "cypress/reports/cypress-[hash].xml",
|
|
14
14
|
"jenkinsMode": true,
|
|
15
15
|
"toConsole": true
|
|
16
|
-
}
|
|
16
|
+
},
|
|
17
|
+
"integrationFolder": "../../../node_modules/@eeacms",
|
|
18
|
+
"testFiles": "**/cypress/integration/**/*.js",
|
|
19
|
+
"videoUploadOnPasses": false,
|
|
20
|
+
"screenshotOnRunFailure": false
|
|
17
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eeacms/volto-eea-kitkat",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.7",
|
|
4
4
|
"description": "@eeacms/volto-eea-kitkat: Volto Add-ons bundle - A known good set of Volto addons to be used within all EEA projects and beyond",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "European Environment Agency: IDM2 A-Team",
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
"@eeacms/volto-block-image-cards"
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@eeacms/volto-accordion-block": "3.4.
|
|
52
|
+
"@eeacms/volto-accordion-block": "3.4.8",
|
|
53
53
|
"@eeacms/volto-banner": "1.0.1",
|
|
54
54
|
"@eeacms/volto-block-divider": "2.1.3",
|
|
55
55
|
"@eeacms/volto-block-image-cards": "0.1.4",
|
|
56
|
-
"@eeacms/volto-block-style": "3.5.
|
|
56
|
+
"@eeacms/volto-block-style": "3.5.3",
|
|
57
57
|
"@eeacms/volto-block-toc": "2.2.2",
|
|
58
58
|
"@eeacms/volto-columns-block": "4.4.6",
|
|
59
59
|
"@eeacms/volto-corsproxy": "2.1.2",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@eeacms/volto-group-block": "4.3.1",
|
|
62
62
|
"@eeacms/volto-listing-block": "0.1.2",
|
|
63
63
|
"@eeacms/volto-matomo": "2.0.3",
|
|
64
|
-
"@eeacms/volto-metadata-block": "4.0.
|
|
64
|
+
"@eeacms/volto-metadata-block": "4.0.2",
|
|
65
65
|
"@eeacms/volto-object-widget": "3.0.0",
|
|
66
66
|
"@eeacms/volto-resize-helper": "0.2.5",
|
|
67
67
|
"@eeacms/volto-sentry-rancher-config": "2.1.2",
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
"volto-slate": "4.2.1"
|
|
78
78
|
},
|
|
79
79
|
"resolutions": {
|
|
80
|
-
"@eeacms/volto-accordion-block": "3.4.
|
|
80
|
+
"@eeacms/volto-accordion-block": "3.4.8",
|
|
81
81
|
"@eeacms/volto-banner": "1.0.0",
|
|
82
82
|
"@eeacms/volto-block-divider": "2.1.3",
|
|
83
83
|
"@eeacms/volto-block-image-cards": "0.1.4",
|
|
84
|
-
"@eeacms/volto-block-style": "3.5.
|
|
84
|
+
"@eeacms/volto-block-style": "3.5.3",
|
|
85
85
|
"@eeacms/volto-block-toc": "2.2.2",
|
|
86
86
|
"@eeacms/volto-columns-block": "4.4.6",
|
|
87
87
|
"@eeacms/volto-corsproxy": "2.1.2",
|
|
@@ -106,14 +106,15 @@
|
|
|
106
106
|
},
|
|
107
107
|
"devDependencies": {
|
|
108
108
|
"@cypress/code-coverage": "^3.9.5",
|
|
109
|
-
"babel-plugin-transform-class-properties": "^6.24.1"
|
|
109
|
+
"babel-plugin-transform-class-properties": "^6.24.1",
|
|
110
|
+
"@plone/scripts": "*"
|
|
110
111
|
},
|
|
111
112
|
"scripts": {
|
|
112
113
|
"release": "release-it",
|
|
113
114
|
"bootstrap": "npm install -g ejs; npm link ejs; node bootstrap",
|
|
114
115
|
"test": "make test",
|
|
115
116
|
"test:fix": "make test-update",
|
|
116
|
-
"i18n": "rm -rf build/messages && NODE_ENV=production
|
|
117
|
+
"i18n": "rm -rf build/messages && NODE_ENV=production i18n --addon",
|
|
117
118
|
"pre-commit": "yarn stylelint:fix && yarn prettier:fix && yarn lint:fix",
|
|
118
119
|
"stylelint": "if [ -d ./project ]; then ./project/node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'; else ../../../node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'; fi",
|
|
119
120
|
"stylelint:overrides": "if [ -d ./project ]; then ./project/node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'; else ../../../node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'; fi",
|
package/src/i18n.js
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
/* eslint no-console: 0 */
|
|
2
|
-
/**
|
|
3
|
-
* i18n script.
|
|
4
|
-
* @module scripts/i18n
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const { find, keys, map, concat, reduce } = require('lodash');
|
|
8
|
-
const glob = require('glob').sync;
|
|
9
|
-
const fs = require('fs');
|
|
10
|
-
const Pofile = require('pofile');
|
|
11
|
-
const babel = require('@babel/core');
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Extract messages into separate JSON files
|
|
15
|
-
* @function extractMessages
|
|
16
|
-
* @return {undefined}
|
|
17
|
-
*/
|
|
18
|
-
function extractMessages() {
|
|
19
|
-
map(glob('src/**/*.js?(x)'), (filename) => {
|
|
20
|
-
babel.transformFileSync(filename, {}, (err) => {
|
|
21
|
-
if (err) {
|
|
22
|
-
console.log(err);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Get messages from separate JSON files
|
|
30
|
-
* @function getMessages
|
|
31
|
-
* @return {Object} Object with messages
|
|
32
|
-
*/
|
|
33
|
-
function getMessages() {
|
|
34
|
-
return reduce(
|
|
35
|
-
concat(
|
|
36
|
-
{},
|
|
37
|
-
...map(
|
|
38
|
-
// We ignore the existing customized shadowed components ones, since most
|
|
39
|
-
// probably we won't be overriding them
|
|
40
|
-
// If so, we should do it in the config object or somewhere else
|
|
41
|
-
glob('build/messages/src/**/*.json', {
|
|
42
|
-
ignore: 'build/messages/src/customizations/**',
|
|
43
|
-
}),
|
|
44
|
-
(filename) =>
|
|
45
|
-
map(JSON.parse(fs.readFileSync(filename, 'utf8')), (message) => ({
|
|
46
|
-
...message,
|
|
47
|
-
filename: filename.match(/build\/messages\/src\/(.*).json$/)[1],
|
|
48
|
-
})),
|
|
49
|
-
),
|
|
50
|
-
),
|
|
51
|
-
(current, value) => {
|
|
52
|
-
let result = current;
|
|
53
|
-
if (current.id) {
|
|
54
|
-
result = {
|
|
55
|
-
[current.id]: {
|
|
56
|
-
defaultMessage: current.defaultMessage,
|
|
57
|
-
filenames: [current.filename],
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (result[value.id]) {
|
|
63
|
-
result[value.id].filenames.push(value.filename);
|
|
64
|
-
} else {
|
|
65
|
-
result[value.id] = {
|
|
66
|
-
defaultMessage: value.defaultMessage,
|
|
67
|
-
filenames: [value.filename],
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
return result;
|
|
71
|
-
},
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Convert messages to pot format
|
|
77
|
-
* @function messagesToPot
|
|
78
|
-
* @param {Object} messages Messages
|
|
79
|
-
* @return {string} Formatted pot string
|
|
80
|
-
*/
|
|
81
|
-
function messagesToPot(messages) {
|
|
82
|
-
return map(keys(messages).sort(), (key) =>
|
|
83
|
-
[
|
|
84
|
-
...map(messages[key].filenames, (filename) => `#: ${filename}`),
|
|
85
|
-
`# defaultMessage: ${messages[key].defaultMessage}`,
|
|
86
|
-
`msgid "${key}"`,
|
|
87
|
-
'msgstr ""',
|
|
88
|
-
].join('\n'),
|
|
89
|
-
).join('\n\n');
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Pot header
|
|
94
|
-
* @function potHeader
|
|
95
|
-
* @return {string} Formatted pot header
|
|
96
|
-
*/
|
|
97
|
-
function potHeader() {
|
|
98
|
-
return `msgid ""
|
|
99
|
-
msgstr ""
|
|
100
|
-
"Project-Id-Version: Plone\\n"
|
|
101
|
-
"POT-Creation-Date: ${new Date().toISOString()}\\n"
|
|
102
|
-
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\\n"
|
|
103
|
-
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\\n"
|
|
104
|
-
"MIME-Version: 1.0\\n"
|
|
105
|
-
"Content-Type: text/plain; charset=utf-8\\n"
|
|
106
|
-
"Content-Transfer-Encoding: 8bit\\n"
|
|
107
|
-
"Plural-Forms: nplurals=1; plural=0;\\n"
|
|
108
|
-
"Language-Code: en\\n"
|
|
109
|
-
"Language-Name: English\\n"
|
|
110
|
-
"Preferred-Encodings: utf-8\\n"
|
|
111
|
-
"Domain: volto\\n"
|
|
112
|
-
|
|
113
|
-
`;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Format header
|
|
118
|
-
* @function formatHeader
|
|
119
|
-
* @param {Array} comments Array of comments
|
|
120
|
-
* @param {Object} headers Object of header items
|
|
121
|
-
* @return {string} Formatted header
|
|
122
|
-
*/
|
|
123
|
-
function formatHeader(comments, headers) {
|
|
124
|
-
return [
|
|
125
|
-
...map(comments, (comment) => `# ${comment}`),
|
|
126
|
-
'msgid ""',
|
|
127
|
-
'msgstr ""',
|
|
128
|
-
...map(keys(headers), (key) => `"${key}: ${headers[key]}\\n"`),
|
|
129
|
-
'',
|
|
130
|
-
].join('\n');
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Sync po by the pot file
|
|
135
|
-
* @function syncPoByPot
|
|
136
|
-
* @return {undefined}
|
|
137
|
-
*/
|
|
138
|
-
function syncPoByPot() {
|
|
139
|
-
const pot = Pofile.parse(fs.readFileSync('locales/volto.pot', 'utf8'));
|
|
140
|
-
|
|
141
|
-
map(glob('locales/**/*.po'), (filename) => {
|
|
142
|
-
const po = Pofile.parse(fs.readFileSync(filename, 'utf8'));
|
|
143
|
-
|
|
144
|
-
fs.writeFileSync(
|
|
145
|
-
filename,
|
|
146
|
-
`${formatHeader(po.comments, po.headers)}
|
|
147
|
-
${map(pot.items, (item) => {
|
|
148
|
-
const poItem = find(po.items, { msgid: item.msgid });
|
|
149
|
-
return [
|
|
150
|
-
`${map(item.references, (ref) => `#: ${ref}`).join('\n')}`,
|
|
151
|
-
`msgid "${item.msgid}"`,
|
|
152
|
-
`msgstr "${poItem ? poItem.msgstr : ''}"`,
|
|
153
|
-
].join('\n');
|
|
154
|
-
}).join('\n\n')}\n`,
|
|
155
|
-
);
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// Main tasks
|
|
160
|
-
console.log('Extracting messages from source files...');
|
|
161
|
-
extractMessages();
|
|
162
|
-
console.log('Synchronizing messages to pot file...');
|
|
163
|
-
// We only write the pot file if it's really different
|
|
164
|
-
const newPot = `${potHeader()}${messagesToPot(getMessages())}\n`.replace(
|
|
165
|
-
/"POT-Creation-Date:(.*)\\n"/,
|
|
166
|
-
'',
|
|
167
|
-
);
|
|
168
|
-
const oldPot = fs
|
|
169
|
-
.readFileSync('locales/volto.pot', 'utf8')
|
|
170
|
-
.replace(/"POT-Creation-Date:(.*)\\n"/, '');
|
|
171
|
-
|
|
172
|
-
if (newPot !== oldPot) {
|
|
173
|
-
fs.writeFileSync(
|
|
174
|
-
'locales/volto.pot',
|
|
175
|
-
`${potHeader()}${messagesToPot(getMessages())}\n`,
|
|
176
|
-
);
|
|
177
|
-
}
|
|
178
|
-
console.log('Synchronizing messages to po files...');
|
|
179
|
-
syncPoByPot();
|
|
180
|
-
console.log('done!');
|