Skip to content

Commit 02de0ef

Browse files
authored
Merge pull request #3 from EOS-uiux-Solutions/dev
[React Package] - Gulp setup for fetching SVGs from EOS-Icons
2 parents 352dee8 + d1e7f01 commit 02de0ef

File tree

5 files changed

+61
-1
lines changed

5 files changed

+61
-1
lines changed

gulpfile.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { series, parallel } from 'gulp';
2+
import { clean } from './utils/clean';
3+
import { copy } from './utils/copy';
4+
5+
export default series(
6+
7+
// Cleaning 'src','svg','es','lib' before copying SVGs from 'EOS-Icons'
8+
clean(['src','svg','es','lib']),
9+
10+
// Running all the tasks of copying SVGs from 'EOS-Icons' in parallel
11+
parallel(
12+
13+
copy({
14+
from: ['node_modules/eos-icons/svg/*.svg'],
15+
toDir: 'svg/filled'
16+
}),
17+
18+
copy({
19+
from: ['node_modules/eos-icons/svg/material/*.svg'],
20+
toDir: 'svg/filled'
21+
}),
22+
23+
copy({
24+
from: ['node_modules/eos-icons/animated-svg/*.svg'],
25+
toDir: 'svg/animated'
26+
}),
27+
28+
copy({
29+
from: ['node_modules/eos-icons/svg-outlined/*.svg'],
30+
toDir: 'svg/outlined'
31+
}),
32+
33+
copy({
34+
from: ['node_modules/eos-icons/svg-outlined/material/*.svg'],
35+
toDir: 'svg/outlined'
36+
})
37+
)
38+
);

interface/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export interface CopyCreatorOptions {
2+
from: string[];
3+
toDir: string;
4+
}

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Eos-Icons React npm package",
55
"main": "index.js",
66
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1"
7+
"fetch": "gulp --require ts-node/register/transpile-only"
88
},
99
"repository": {
1010
"type": "git",
@@ -17,13 +17,18 @@
1717
},
1818
"homepage": "https://github.com/EOS-uiux-Solutions/eos-icons-react#readme",
1919
"devDependencies": {
20+
"@types/gulp": "^4.0.8",
2021
"@typescript-eslint/eslint-plugin": "^4.27.0",
2122
"@typescript-eslint/parser": "^4.27.0",
23+
"del": "^6.0.0",
24+
"eos-icons": "^5.1.0",
2225
"eslint": "^7.28.0",
2326
"eslint-config-standard": "^16.0.3",
2427
"eslint-plugin-import": "^2.23.4",
2528
"eslint-plugin-node": "^11.1.0",
2629
"eslint-plugin-promise": "^5.1.0",
30+
"gulp": "^4.0.2",
31+
"ts-node": "^10.0.0",
2732
"typescript": "^4.3.2"
2833
},
2934
"peerDependencies": {

utils/clean.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import del from 'del';
2+
3+
export const clean = (dirs: string[]) =>
4+
function CleanDirectories() {
5+
return del(dirs);
6+
};

utils/copy.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { src, dest } from 'gulp';
2+
import { CopyCreatorOptions } from '../interface';
3+
4+
export const copy = ({ from, toDir }: CopyCreatorOptions) =>
5+
function CopyFiles() {
6+
return src(from).pipe(dest(toDir));
7+
};

0 commit comments

Comments
 (0)