@eui/tools 6.16.34 → 6.16.36

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.
@@ -99,6 +99,11 @@ module.exports.generateVirtualRemote = (remoteName, cloneRemote = true) => {
99
99
  tools.logInfo(`Copying base sources => ${remoteSkeletonPath} ==> ${remotePath}`);
100
100
  tools.copy(remoteSkeletonPath, remotePath);
101
101
 
102
+ if (remote.build && remote.build.esbuild) {
103
+ tools.logInfo('Esbuild option detected, replacing angular.json esbuild config');
104
+ tools.move(path.join(remotePath, 'angular.esbuild.json'), path.join(remotePath, 'angular.json'));
105
+ }
106
+
102
107
  // adding the dependendies files
103
108
  tools.writeJsonFileSync(path.join(remotePath, 'dependencies-composite.json'), remote.dependencies.composite);
104
109
  if (remote.dependencies.base) {
@@ -3,6 +3,7 @@
3
3
  const path = require('path');
4
4
  const tools = require('./tools');
5
5
 
6
+
6
7
  const writeSprite = (srcPath, files, destPath, outputFile) => {
7
8
  const SVGSpriter = require('svg-sprite');
8
9
 
@@ -39,8 +40,53 @@ const writeSprite = (srcPath, files, destPath, outputFile) => {
39
40
  };
40
41
 
41
42
 
43
+ module.exports.generateSprite = () => {
44
+ let srcPath, spriteFile;
45
+
46
+ Promise.resolve()
47
+ .then(() => {
48
+ const args = tools.getArgs();
49
+
50
+ if (!args.inFolder) {
51
+ throw new Error('inFolder argument not provided');
52
+ }
53
+
54
+ srcPath = path.join(process.cwd(), args.inFolder);
55
+ spriteFile = args.outFile;
56
+
57
+ if (!args.outFile) {
58
+ throw new Error('outFile not provided as argument');
59
+ } else {
60
+ if (args.outFile.indexOf('.svg') < 0) {
61
+ throw new Error('outFile filename should be in svg file format');
62
+ }
63
+ }
64
+
65
+ spriteFile = args.outFile;
66
+
67
+ tools.logInfo(`Building svg sprite from : ${srcPath}`);
68
+ tools.logInfo(`Generating sprite file output : ${spriteFile}`);
69
+
70
+ return tools.getFilesGlob(srcPath, '**/*.svg');
71
+ })
72
+
73
+ .then((svgFiles) => {
74
+ if (svgFiles.length === 0) {
75
+ throw new Error('NO_FILES_FOUND');
76
+ }
77
+
78
+ tools.logInfo(`...found ${svgFiles.length} svg files`);
79
+
80
+ return generateSvgsSprite(srcPath, path.join(srcPath, 'sprites'), spriteFile);
81
+ })
82
+
83
+ .catch((e) => {
84
+ throw e;
85
+ })
86
+ }
87
+
42
88
 
43
- module.exports.generateSvgsSprite = (svgsInPath, svgsSpritePath, svgsSpriteFile) => {
89
+ const generateSvgsSprite = module.exports.generateSvgsSprite = (svgsInPath, svgsSpritePath, svgsSpriteFile) => {
44
90
  const imagemin = require('imagemin');
45
91
  const imageminSvgo = require('imagemin-svgo');
46
92