@spectrum-css/icons
Advanced tools
Comparing version 2.0.0-alpha.2 to 2.0.0-alpha.3
@@ -12,6 +12,87 @@ /* | ||
*/ | ||
var gulp = require('gulp'); | ||
var rename = require('gulp-rename'); | ||
var svgstore = require('gulp-svgstore'); | ||
const gulp = require('gulp'); | ||
const rename = require('gulp-rename'); | ||
const path = require('path'); | ||
const svgmin = require('gulp-svgmin'); | ||
const replace = require('gulp-replace'); | ||
const sort = require('gulp-sort'); | ||
const svgcombiner = require('gulp-svgcombiner'); | ||
const svgstore = require('gulp-svgstore'); | ||
const del = require('del'); | ||
// Blocked by https://jira.corp.adobe.com/browse/A4U-177 | ||
// const a4uPath = require.resolve('@a4u/a4u-collection-essential-ui-icons-release'); | ||
const a4uPath = path.join(process.cwd(), '..', '..', 'node_modules', '@a4u/a4u-collection-essential-ui-icons-release'); | ||
function clean() { | ||
return del([ | ||
'combined/**', | ||
'medium/**', | ||
'large/**', | ||
]); | ||
} | ||
function copyLargeIcons() { | ||
return gulp.src(path.join(a4uPath, 'assets', 'UI_Icons_SVG_Large/*.svg')) | ||
.pipe(gulp.dest('large/')); | ||
} | ||
function copyMediumIcons() { | ||
return gulp.src(path.join(a4uPath, 'assets', 'UI_Icons_SVG_Medium/*.svg')) | ||
.pipe(gulp.dest('medium/')); | ||
} | ||
function sanitizeIcons() { | ||
return gulp.src('{medium,large}/*.svg') | ||
.pipe(replace(/ data-name=".*?"/g, '')) | ||
.pipe(replace(/ id=".*?"/g, '')) | ||
.pipe(replace(/ class=".*?"/g, '')) | ||
.pipe(replace(/<defs>[\s\S]*?<\/defs>/m, '')) | ||
.pipe(replace(/<title>[\s\S]*?<\/title>/m, '')) | ||
.pipe(svgmin({ | ||
plugins: [ | ||
{ | ||
removeAttrs: { | ||
attrs: [ | ||
'class', | ||
'data-name', | ||
'id' | ||
] | ||
} | ||
}, | ||
{ collapseGroups: true } | ||
] | ||
})) | ||
.pipe(gulp.dest('./')); | ||
} | ||
function generateCombinedIcons() { | ||
return gulp.src('{medium,large}/*.svg') | ||
.pipe(sort()) | ||
.pipe(svgcombiner({ | ||
processName: function(filePath) { | ||
// Clean filename | ||
return path.basename(filePath, path.extname(filePath)).replace(/S_UI(.*?)_.*/, '$1'); | ||
}, | ||
processClass: function(filePath) { | ||
// Return the last directory | ||
return 'spectrum-UIIcon--' + path.dirname(filePath).split(path.sep).pop(); | ||
} | ||
})) | ||
.pipe(gulp.dest('combined/')); | ||
} | ||
// Only ran by Adobe | ||
let updateIcons = gulp.series( | ||
gulp.series( | ||
clean, | ||
gulp.parallel( | ||
copyMediumIcons, | ||
copyLargeIcons | ||
) | ||
), | ||
sanitizeIcons, | ||
generateCombinedIcons | ||
); | ||
var tasks = require('@spectrum-css/component-builder'); | ||
@@ -59,3 +140,4 @@ | ||
exports.updateIcons = updateIcons; | ||
exports.build = exports.buildLite = build; | ||
exports.default = build; |
{ | ||
"name": "@spectrum-css/icons", | ||
"version": "2.0.0-alpha.2", | ||
"version": "2.0.0-alpha.3", | ||
"description": "The Spectrum CSS icon component", | ||
@@ -19,12 +19,19 @@ "author": "", | ||
"peerDependencies": { | ||
"@spectrum-css/vars": "^1.0.0-alpha.0" | ||
"@spectrum-css/vars": "^2.0.0-alpha.1" | ||
}, | ||
"optionalDependencies": { | ||
"@a4u/a4u-collection-essential-ui-icons-release": "^4.1.0" | ||
}, | ||
"devDependencies": { | ||
"@spectrum-css/component-builder": "^1.0.0-alpha.2", | ||
"@spectrum-css/vars": "^2.0.0-alpha.1", | ||
"@spectrum-css/component-builder": "^1.0.0-alpha.3", | ||
"@spectrum-css/vars": "^2.0.0-alpha.2", | ||
"gulp": "^4.0.0", | ||
"gulp-rename": "^1.4.0", | ||
"gulp-replace": "^1.0.0", | ||
"gulp-sort": "^2.0.0", | ||
"gulp-svgcombiner": "^1.0.1", | ||
"gulp-svgmin": "^2.1.0", | ||
"gulp-svgstore": "^7.0.1" | ||
}, | ||
"gitHead": "c688e770cc16413f1ba679c03f744e5fed8d2b07" | ||
"gitHead": "ffafea00c9a4e2db79d32b195379c5e0408ac1c6" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
135598
126
1377
2
9