@eui/tools 5.3.69 → 5.3.70
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/.version.properties
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.3.
|
|
1
|
+
5.3.70
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## 5.3.70 (2022-10-05)
|
|
2
|
+
|
|
3
|
+
##### Chores
|
|
4
|
+
|
|
5
|
+
* **other:**
|
|
6
|
+
* adapt svg sprite generator script for eUI 15 - EUI-6448 [EUI-6448](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-6448) ([e5f8465e](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/e5f8465ea9de6e2204983d45b97349e4439e07c7))
|
|
7
|
+
|
|
8
|
+
* * *
|
|
9
|
+
* * *
|
|
1
10
|
## 5.3.69 (2022-10-03)
|
|
2
11
|
|
|
3
12
|
##### Bug Fixes
|
package/package.json
CHANGED
|
@@ -195,10 +195,10 @@ module.exports.processSvgAssets = (project) => {
|
|
|
195
195
|
return Promise.resolve()
|
|
196
196
|
.then(() => {
|
|
197
197
|
const svgsInPath = path.join(project.paths.rootPath, 'src', 'assets', 'svg');
|
|
198
|
-
const
|
|
199
|
-
const
|
|
198
|
+
const svgsSpritePath = path.join(svgsInPath, sprites);
|
|
199
|
+
const svgsSpriteFile = 'sprite.svg';
|
|
200
200
|
|
|
201
|
-
return svgUtils.generateSvgsSprite(svgsInPath,
|
|
201
|
+
return svgUtils.generateSvgsSprite(svgsInPath, svgsSpritePath, svgsSpriteFile);
|
|
202
202
|
})
|
|
203
203
|
|
|
204
204
|
.catch((e) => {
|
|
@@ -5,11 +5,13 @@ const path = require('path');
|
|
|
5
5
|
|
|
6
6
|
const tools = require('./tools');
|
|
7
7
|
|
|
8
|
-
module.exports.generateSvgsSprite = (svgsInPath,
|
|
8
|
+
module.exports.generateSvgsSprite = (svgsInPath, svgsSpritePath, svgsSpriteFile) => {
|
|
9
9
|
const imagemin = require('imagemin');
|
|
10
10
|
const imageminSvgo = require('imagemin-svgo');
|
|
11
11
|
const svgstore = require('svgstore');
|
|
12
12
|
|
|
13
|
+
const svgsOutPath = path.join(svgsInPath, 'temp');
|
|
14
|
+
|
|
13
15
|
let svgFiles;
|
|
14
16
|
|
|
15
17
|
return Promise.resolve()
|
|
@@ -17,7 +19,7 @@ module.exports.generateSvgsSprite = (svgsInPath, svgsOutPath, svgsSpritePath) =>
|
|
|
17
19
|
return tools.rimraf(svgsOutPath);
|
|
18
20
|
})
|
|
19
21
|
.then(() => {
|
|
20
|
-
return tools.remove(svgsSpritePath);
|
|
22
|
+
return tools.remove(path.join(svgsSpritePath, svgsSpriteFile));
|
|
21
23
|
})
|
|
22
24
|
.then(() => {
|
|
23
25
|
return tools.getFilesGlob(svgsInPath, '**/*.svg');
|
|
@@ -55,6 +57,7 @@ module.exports.generateSvgsSprite = (svgsInPath, svgsOutPath, svgsSpritePath) =>
|
|
|
55
57
|
|
|
56
58
|
const sprites = svgstore();
|
|
57
59
|
|
|
60
|
+
// compiling sprite file
|
|
58
61
|
svgFiles.forEach((f) => {
|
|
59
62
|
sprites.add(
|
|
60
63
|
f.substr(0, f.indexOf('.svg')),
|
|
@@ -62,7 +65,17 @@ module.exports.generateSvgsSprite = (svgsInPath, svgsOutPath, svgsSpritePath) =>
|
|
|
62
65
|
);
|
|
63
66
|
});
|
|
64
67
|
|
|
65
|
-
|
|
68
|
+
// generating json output list
|
|
69
|
+
const outList = svgFiles.map((f) => {
|
|
70
|
+
return f.substr(0, f.indexOf('.svg'));
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const svgsSpriteFileJson = svgsSpriteFile.substr(0, svgsSpriteFile.indexOf('.svg')) + '.json';
|
|
74
|
+
console.log(svgsSpriteFileJson);
|
|
75
|
+
|
|
76
|
+
tools.writeJsonFileSync(path.join(svgsSpritePath, svgsSpriteFileJson), outList);
|
|
77
|
+
|
|
78
|
+
tools.writeFileContent(path.join(svgsSpritePath, svgsSpriteFile), sprites);
|
|
66
79
|
|
|
67
80
|
tools.logSuccess(`OK => ${svgsSpritePath} generated`);
|
|
68
81
|
})
|
package/scripts/utils/tools.js
CHANGED
|
@@ -350,9 +350,13 @@ function move(from, to) {
|
|
|
350
350
|
|
|
351
351
|
function mkdirFilePath(filename) {
|
|
352
352
|
const metadataFilePath = path.dirname(filename);
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
353
|
+
try {
|
|
354
|
+
if (!this.isDirExists(metadataFilePath)) {
|
|
355
|
+
fs.mkdirSync(metadataFilePath, { recursive: true })
|
|
356
|
+
}
|
|
357
|
+
} catch(e) {
|
|
358
|
+
if (e.code === 'EEXIST') return;
|
|
359
|
+
throw e;
|
|
356
360
|
}
|
|
357
361
|
}
|
|
358
362
|
|