@eeacms/volto-design-tokens 1.1.1 → 2.0.1
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/.eslintrc.js +65 -0
- package/CHANGELOG.md +23 -1
- package/DEVELOP.md +19 -17
- package/README.md +33 -19
- package/docker-compose.yml +1 -1
- package/jest-addon.config.js +11 -2
- package/package.json +1 -1
- package/src/shadows.less +10 -5
- package/.project.eslintrc.js +0 -48
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const projectRootPath = fs.realpathSync(__dirname + '/../../../');
|
|
4
|
+
|
|
5
|
+
let voltoPath = path.join(projectRootPath, 'node_modules/@plone/volto');
|
|
6
|
+
let configFile;
|
|
7
|
+
if (fs.existsSync(`${projectRootPath}/tsconfig.json`))
|
|
8
|
+
configFile = `${projectRootPath}/tsconfig.json`;
|
|
9
|
+
else if (fs.existsSync(`${projectRootPath}/jsconfig.json`))
|
|
10
|
+
configFile = `${projectRootPath}/jsconfig.json`;
|
|
11
|
+
|
|
12
|
+
if (configFile) {
|
|
13
|
+
const jsConfig = require(configFile).compilerOptions;
|
|
14
|
+
const pathsConfig = jsConfig.paths;
|
|
15
|
+
if (pathsConfig['@plone/volto'])
|
|
16
|
+
voltoPath = `./${jsConfig.baseUrl}/${pathsConfig['@plone/volto'][0]}`;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const { AddonRegistry } = require('@plone/registry/addon-registry');
|
|
20
|
+
const { registry } = AddonRegistry.init(projectRootPath);
|
|
21
|
+
|
|
22
|
+
// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
|
|
23
|
+
const addonAliases = Object.keys(registry.packages).map((o) => [
|
|
24
|
+
o,
|
|
25
|
+
registry.packages[o].modulePath,
|
|
26
|
+
]);
|
|
27
|
+
|
|
28
|
+
const addonExtenders = registry.getEslintExtenders().map((m) => require(m));
|
|
29
|
+
|
|
30
|
+
const defaultConfig = {
|
|
31
|
+
extends: `${voltoPath}/.eslintrc`,
|
|
32
|
+
settings: {
|
|
33
|
+
'import/resolver': {
|
|
34
|
+
alias: {
|
|
35
|
+
map: [
|
|
36
|
+
['@plone/volto', '@plone/volto/src'],
|
|
37
|
+
['@plone/volto-slate', '@plone/volto-slate/src'],
|
|
38
|
+
...addonAliases,
|
|
39
|
+
['@package', `${__dirname}/src`],
|
|
40
|
+
['@root', `${__dirname}/src`],
|
|
41
|
+
['~', `${__dirname}/src`],
|
|
42
|
+
],
|
|
43
|
+
extensions: ['.js', '.jsx', '.json'],
|
|
44
|
+
},
|
|
45
|
+
'babel-plugin-root-import': {
|
|
46
|
+
rootPathSuffix: 'src',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
rules: {
|
|
51
|
+
'react/jsx-no-target-blank': [
|
|
52
|
+
'error',
|
|
53
|
+
{
|
|
54
|
+
allowReferrer: true,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const config = addonExtenders.reduce(
|
|
61
|
+
(acc, extender) => extender.modify(acc),
|
|
62
|
+
defaultConfig,
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
module.exports = config;
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,23 @@ 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
|
+
### [2.0.1](https://github.com/eea/volto-design-tokens/compare/2.0.0...2.0.1) - 8 April 2026
|
|
8
|
+
|
|
9
|
+
#### :bug: Bug Fixes
|
|
10
|
+
|
|
11
|
+
- fix: make test [Alin V. (Claudiu) - [`c6ddc7c`](https://github.com/eea/volto-design-tokens/commit/c6ddc7cb7030a245e255caf3483b48aea2724ec2)]
|
|
12
|
+
|
|
13
|
+
## [2.0.0](https://github.com/eea/volto-design-tokens/compare/1.1.1...2.0.0) - 25 March 2026
|
|
14
|
+
|
|
15
|
+
#### :rocket: New Features
|
|
16
|
+
|
|
17
|
+
- feat: Volto 18 support - refs #287700 [Alin Voinea - [`5b3f7fc`](https://github.com/eea/volto-design-tokens/commit/5b3f7fcc59a2b66d7735350afa9f4da4ae508a08)]
|
|
18
|
+
|
|
19
|
+
#### :house: Internal changes
|
|
20
|
+
|
|
21
|
+
- chore: [JENKINSFILE] add package version in sonarqube [valentinab25 - [`dd52d6f`](https://github.com/eea/volto-design-tokens/commit/dd52d6fca21cdb6acd30ebd3cb3faadd86a48a39)]
|
|
22
|
+
- chore: [JENKINSFILE] use sonarqube branches [EEA Jenkins - [`c84b6fd`](https://github.com/eea/volto-design-tokens/commit/c84b6fde35ba1b69e8edd0a53d66dc6a2c96eda4)]
|
|
23
|
+
|
|
7
24
|
### [1.1.1](https://github.com/eea/volto-design-tokens/compare/1.1.0...1.1.1) - 4 November 2025
|
|
8
25
|
|
|
9
26
|
#### :rocket: New Features
|
|
@@ -13,18 +30,23 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
13
30
|
#### :house: Internal changes
|
|
14
31
|
|
|
15
32
|
- style: Automated code fix [eea-jenkins - [`795da6e`](https://github.com/eea/volto-design-tokens/commit/795da6e5af0dc81e7eb3e292a4e6c43f5284da4e)]
|
|
33
|
+
- chore: [JENKINS] Refactor automated testing [valentinab25 - [`a7e5415`](https://github.com/eea/volto-design-tokens/commit/a7e54158d90d743a7999faf0415c4e7b51ed59da)]
|
|
16
34
|
- chore: husky, lint-staged use fixed versions [valentinab25 - [`d5c8f91`](https://github.com/eea/volto-design-tokens/commit/d5c8f9110d3e806ff89c5030503e6263f4e7cac1)]
|
|
17
35
|
- chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`23a3ae9`](https://github.com/eea/volto-design-tokens/commit/23a3ae9ed0ca323126d2685175603552a690e50b)]
|
|
18
36
|
|
|
19
37
|
#### :hammer_and_wrench: Others
|
|
20
38
|
|
|
21
|
-
- Release 1.1.1 [Alin Voinea - [`b1f3441`](https://github.com/eea/volto-design-tokens/commit/b1f3441fd55e9cfb2e0d866858bb78a907b4fad3)]
|
|
22
39
|
- Bump Version to 1.1.0 [dobri1408 - [`79d93a2`](https://github.com/eea/volto-design-tokens/commit/79d93a21938416fc31d5a6df6547ecf177883522)]
|
|
23
40
|
- fix lint [Dobricean Ioan Dorian - [`105dbeb`](https://github.com/eea/volto-design-tokens/commit/105dbeb2479cd3ebb77fac50b5b5685ee7f919c9)]
|
|
24
41
|
- rename [Dobricean Ioan Dorian - [`d8602b6`](https://github.com/eea/volto-design-tokens/commit/d8602b6dbffbed5431e6355abac41bc5174bc05f)]
|
|
25
42
|
- split programatic colors and non-programatic colors [Dobricean Ioan Dorian - [`397ddfb`](https://github.com/eea/volto-design-tokens/commit/397ddfb1773e00a36000be9c509001b2ef83c277)]
|
|
26
43
|
- update tokens [Dobricean Ioan Dorian - [`09a9a29`](https://github.com/eea/volto-design-tokens/commit/09a9a29c0fae310021b2c157a9819e516448022c)]
|
|
27
44
|
- update tokens [Dobricean Ioan Dorian - [`5301dff`](https://github.com/eea/volto-design-tokens/commit/5301dff94035a6407a4a1a0d563ce29a7e2225eb)]
|
|
45
|
+
- test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`20dd754`](https://github.com/eea/volto-design-tokens/commit/20dd754c90ca146332366774c50901664434aea1)]
|
|
46
|
+
- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`e1f13f8`](https://github.com/eea/volto-design-tokens/commit/e1f13f834cadc1927adcec1c6051965fdd28f55e)]
|
|
47
|
+
- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`98040ce`](https://github.com/eea/volto-design-tokens/commit/98040cec2bd1921988deb69f08edd173df85ace8)]
|
|
48
|
+
- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`1e8be8e`](https://github.com/eea/volto-design-tokens/commit/1e8be8edd4dfe5c7da015461fba0aedc6615b3c6)]
|
|
49
|
+
- test: [JENKINS] Improve cypress time [valentinab25 - [`f94335d`](https://github.com/eea/volto-design-tokens/commit/f94335da5fc295876a563b3c81af680e45c7a200)]
|
|
28
50
|
- test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`8d486a1`](https://github.com/eea/volto-design-tokens/commit/8d486a1739cc3239c163c75795361402ad175daf)]
|
|
29
51
|
### [1.1.0](https://github.com/eea/volto-design-tokens/compare/1.0.2...1.1.0) - 18 August 2025
|
|
30
52
|
|
package/DEVELOP.md
CHANGED
|
@@ -26,21 +26,20 @@
|
|
|
26
26
|
|
|
27
27
|
### Or add @eeacms/volto-design-tokens to your Volto project
|
|
28
28
|
|
|
29
|
-
Before starting make sure your development environment is properly set. See [Volto
|
|
29
|
+
Before starting make sure your development environment is properly set. See the official Plone documentation for [creating a project with Cookieplone](https://6.docs.plone.org/install/create-project-cookieplone.html) and [installing an add-on in development mode in Volto 18 and 19](https://6.docs.plone.org/volto/development/add-ons/install-an-add-on-dev-18.html).
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
For new Volto 18+ projects, use Cookieplone. It includes `mrs-developer` by default.
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
1. Create a new Volto project with Cookieplone
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
yo @plone/volto my-volto-project --addon @eeacms/volto-design-tokens --skip-install
|
|
38
|
-
cd my-volto-project
|
|
35
|
+
uvx cookieplone project
|
|
36
|
+
cd project-title
|
|
39
37
|
|
|
40
38
|
1. Add the following to `mrs.developer.json`:
|
|
41
39
|
|
|
42
40
|
{
|
|
43
41
|
"volto-design-tokens": {
|
|
42
|
+
"output": "packages",
|
|
44
43
|
"url": "https://github.com/eea/volto-design-tokens.git",
|
|
45
44
|
"package": "@eeacms/volto-design-tokens",
|
|
46
45
|
"branch": "develop",
|
|
@@ -48,28 +47,31 @@ Before starting make sure your development environment is properly set. See [Vol
|
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
1.
|
|
50
|
+
1. Add `@eeacms/volto-design-tokens` to the `addons` key in your project `volto.config.js`
|
|
51
|
+
|
|
52
|
+
1. Install or refresh the project setup
|
|
52
53
|
|
|
53
|
-
make
|
|
54
|
-
yarn
|
|
54
|
+
make install
|
|
55
55
|
|
|
56
|
-
1. Start backend
|
|
56
|
+
1. Start backend in one terminal
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
make backend-start
|
|
59
59
|
|
|
60
|
-
...wait for backend to setup and start
|
|
60
|
+
...wait for backend to setup and start, ending with `Ready to handle requests`
|
|
61
61
|
|
|
62
62
|
...you can also check http://localhost:8080/Plone
|
|
63
63
|
|
|
64
|
-
1. Start frontend
|
|
64
|
+
1. Start frontend in a second terminal
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
make frontend-start
|
|
67
67
|
|
|
68
68
|
1. Go to http://localhost:3000
|
|
69
69
|
|
|
70
70
|
1. Happy hacking!
|
|
71
71
|
|
|
72
|
-
cd
|
|
72
|
+
cd packages/volto-design-tokens
|
|
73
|
+
|
|
74
|
+
For legacy Volto 17 projects, keep using the yarn-based workflow from the Volto 17 documentation.
|
|
73
75
|
|
|
74
76
|
## Cypress
|
|
75
77
|
|
|
@@ -81,7 +83,7 @@ project where you added `volto-design-tokens` to `mrs.developer.json`
|
|
|
81
83
|
Go to:
|
|
82
84
|
|
|
83
85
|
```BASH
|
|
84
|
-
cd
|
|
86
|
+
cd packages/volto-design-tokens/
|
|
85
87
|
```
|
|
86
88
|
|
|
87
89
|
Start:
|
package/README.md
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
[](https://github.com/eea/volto-design-tokens/releases)
|
|
4
4
|
|
|
5
5
|
[](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-design-tokens/job/master/display/redirect)
|
|
6
|
-
[](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-design-tokens
|
|
6
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-design-tokens)
|
|
7
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-design-tokens)
|
|
8
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-design-tokens)
|
|
9
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-design-tokens)
|
|
10
10
|
|
|
11
11
|
[](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-design-tokens/job/develop/display/redirect)
|
|
12
|
-
[](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-design-tokens
|
|
12
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-design-tokens&branch=develop)
|
|
13
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-design-tokens&branch=develop)
|
|
14
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-design-tokens&branch=develop)
|
|
15
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-design-tokens&branch=develop)
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
[Volto](https://github.com/plone/volto) Design Tokens
|
|
@@ -39,6 +39,11 @@ Provides the following [EEA design system tokens](https://eea.github.io/):
|
|
|
39
39
|
|
|
40
40
|
Go to http://localhost:3000
|
|
41
41
|
|
|
42
|
+
`make start` now defaults to Volto 18. To run the same setup against Volto 17, use:
|
|
43
|
+
|
|
44
|
+
VOLTO_VERSION=17 make
|
|
45
|
+
VOLTO_VERSION=17 make start
|
|
46
|
+
|
|
42
47
|
### Add volto-design-tokens to your Volto project
|
|
43
48
|
|
|
44
49
|
1. Make sure you have a [Plone backend](https://plone.org/download) up-and-running at http://localhost:8080/Plone
|
|
@@ -52,30 +57,39 @@ Go to http://localhost:3000
|
|
|
52
57
|
* If you already have a volto project, just update `package.json`:
|
|
53
58
|
|
|
54
59
|
```JSON
|
|
55
|
-
"addons": [
|
|
56
|
-
"@eeacms/volto-design-tokens"
|
|
57
|
-
],
|
|
58
|
-
|
|
59
60
|
"dependencies": {
|
|
60
61
|
"@eeacms/volto-design-tokens": "*"
|
|
61
62
|
}
|
|
62
63
|
```
|
|
63
64
|
|
|
64
|
-
|
|
65
|
+
and `volto.config.js`:
|
|
66
|
+
|
|
67
|
+
```JavaScript
|
|
68
|
+
const addons = ['@eeacms/volto-design-tokens'];
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
* If not, create one with Cookieplone, as recommended by the official Plone documentation for Volto 18+:
|
|
65
72
|
|
|
66
73
|
```
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
cd my-volto-project
|
|
74
|
+
uvx cookieplone project
|
|
75
|
+
cd project-title
|
|
70
76
|
```
|
|
71
77
|
|
|
72
|
-
1. Install
|
|
78
|
+
1. Install or update dependencies, then start the project:
|
|
73
79
|
|
|
74
80
|
```
|
|
75
|
-
|
|
76
|
-
yarn start
|
|
81
|
+
make install
|
|
77
82
|
```
|
|
78
83
|
|
|
84
|
+
For a Cookieplone project, start the backend and frontend in separate terminals:
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
make backend-start
|
|
88
|
+
make frontend-start
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
For a legacy Volto 17 project, install the package with `yarn` and restart the frontend as usual.
|
|
92
|
+
|
|
79
93
|
1. Go to http://localhost:3000
|
|
80
94
|
|
|
81
95
|
1. Happy editing!
|
package/docker-compose.yml
CHANGED
package/jest-addon.config.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
const voltoSlatePath = fs.existsSync(
|
|
5
|
+
path.join(__dirname, '../../../node_modules/@plone/volto-slate/src'),
|
|
6
|
+
)
|
|
7
|
+
? '<rootDir>/node_modules/@plone/volto-slate/src'
|
|
8
|
+
: '<rootDir>/node_modules/@plone/volto/packages/volto-slate/src';
|
|
9
|
+
|
|
1
10
|
module.exports = {
|
|
2
11
|
testMatch: ['**/src/addons/**/?(*.)+(spec|test).[jt]s?(x)'],
|
|
3
12
|
collectCoverageFrom: [
|
|
@@ -13,8 +22,8 @@ module.exports = {
|
|
|
13
22
|
'@root/(.*)$': '<rootDir>/src/$1',
|
|
14
23
|
'@plone/volto-quanta/(.*)$': '<rootDir>/src/addons/volto-quanta/src/$1',
|
|
15
24
|
'@eeacms/(.*?)/(.*)$': '<rootDir>/node_modules/@eeacms/$1/src/$2',
|
|
16
|
-
'@plone/volto-slate':
|
|
17
|
-
|
|
25
|
+
'@plone/volto-slate$': voltoSlatePath,
|
|
26
|
+
'@plone/volto-slate/(.*)$': `${voltoSlatePath}/$1`,
|
|
18
27
|
'~/(.*)$': '<rootDir>/src/$1',
|
|
19
28
|
'load-volto-addons':
|
|
20
29
|
'<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
|
package/package.json
CHANGED
package/src/shadows.less
CHANGED
|
@@ -3,26 +3,31 @@
|
|
|
3
3
|
|
|
4
4
|
@shadow-0: none;
|
|
5
5
|
@shadow-1: 0 1px 2px -1px hsla(@shadow-color, calc(@shadow-strength + 9%));
|
|
6
|
-
@shadow-2:
|
|
6
|
+
@shadow-2:
|
|
7
|
+
0 3px 5px -2px hsla(@shadow-color, calc(@shadow-strength + 3%)),
|
|
7
8
|
0 7px 14px -5px hsla(@shadow-color, calc(@shadow-strength + 5%));
|
|
8
|
-
@shadow-3:
|
|
9
|
+
@shadow-3:
|
|
10
|
+
0 -1px 3px 0 hsla(@shadow-color, calc(@shadow-strength + 2%)),
|
|
9
11
|
0 1px 2px -5px hsla(@shadow-color, calc(@shadow-strength + 2%)),
|
|
10
12
|
0 2px 5px -5px hsla(@shadow-color, calc(@shadow-strength + 4%)),
|
|
11
13
|
0 4px 12px -5px hsla(@shadow-color, calc(@shadow-strength + 5%)),
|
|
12
14
|
0 12px 15px -5px hsla(@shadow-color, calc(@shadow-strength + 7%));
|
|
13
|
-
@shadow-4:
|
|
15
|
+
@shadow-4:
|
|
16
|
+
0 -2px 5px 0 hsla(@shadow-color, calc(@shadow-strength + 2%)),
|
|
14
17
|
0 1px 1px -2px hsla(@shadow-color, calc(@shadow-strength + 3%)),
|
|
15
18
|
0 2px 2px -2px hsla(@shadow-color, calc(@shadow-strength + 3%)),
|
|
16
19
|
0 5px 5px -2px hsla(@shadow-color, calc(@shadow-strength + 4%)),
|
|
17
20
|
0 9px 9px -2px hsla(@shadow-color, calc(@shadow-strength + 5%)),
|
|
18
21
|
0 16px 16px -2px hsla(@shadow-color, calc(@shadow-strength + 6%));
|
|
19
|
-
@shadow-5:
|
|
22
|
+
@shadow-5:
|
|
23
|
+
0 -1px 2px 0 hsla(@shadow-color, calc(@shadow-strength + 2%)),
|
|
20
24
|
0 2px 1px -2px hsla(@shadow-color, calc(@shadow-strength + 3%)),
|
|
21
25
|
0 5px 5px -2px hsla(@shadow-color, calc(@shadow-strength + 3%)),
|
|
22
26
|
0 10px 10px -2px hsla(@shadow-color, calc(@shadow-strength + 4%)),
|
|
23
27
|
0 20px 20px -2px hsla(@shadow-color, calc(@shadow-strength + 5%)),
|
|
24
28
|
0 40px 40px -2px hsla(@shadow-color, calc(@shadow-strength + 7%));
|
|
25
|
-
@shadow-6:
|
|
29
|
+
@shadow-6:
|
|
30
|
+
0 -1px 2px 0 hsla(@shadow-color, calc(@shadow-strength + 2%)),
|
|
26
31
|
0 3px 2px -2px hsla(@shadow-color, calc(@shadow-strength + 3%)),
|
|
27
32
|
0 7px 5px -2px hsla(@shadow-color, calc(@shadow-strength + 3%)),
|
|
28
33
|
0 12px 10px -2px hsla(@shadow-color, calc(@shadow-strength + 4%)),
|
package/.project.eslintrc.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
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
|
-
|