Skip to content

Commit cb79a64

Browse files
committed
Bundle emoji images from emoji-datasource-apple
1 parent df07f46 commit cb79a64

File tree

1,565 files changed

+18
-21
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,565 files changed

+18
-21
lines changed

gulpfile.js

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -215,27 +215,24 @@ function bump (done) {
215215
}
216216
exports.bump = bump
217217

218-
function update (done) {
219-
var emoji = '';
220-
221-
del('./src/images/emoji');
222-
223-
$.download('https://github.com/arvida/emoji-cheat-sheet.com/archive/master.zip')
224-
.pipe($.unzip())
225-
.pipe($.filter(function(file){
226-
return minimatch(file.path, '**/public/graphics/emojis/*.png');
218+
function update () {
219+
const emojiPath = `./v2/images/emoji`
220+
del(emojiPath);
221+
222+
const emojiMap = require('emoji-datasource-apple').reduce((acc, emoji) => ({
223+
...acc,
224+
[emoji.image]: emoji
225+
}), {})
226+
const availableFiles = Object.keys(emojiMap)
227+
228+
return gulp.src('node_modules/emoji-datasource-apple/img/apple/64/*.png')
229+
.pipe($.filter(file => availableFiles.includes(file.basename)))
230+
.pipe($.rename(file => {
231+
const emojiData = emojiMap[`${file.basename}${file.extname}`]
232+
233+
file.basename = emojiData.short_name
234+
file.dirname = './'
227235
}))
228-
.pipe($.rename({ dirname: './' }))
229-
.pipe(gulp.dest('./src/images/emoji'))
230-
.pipe(through2({ objectMode: true }, function(file, enc, cb){
231-
emoji += ',' + path.basename(file.path, path.extname(file.path));
232-
this.push(file);
233-
cb();
234-
}, function(){
235-
gulp.src('./src/emojify.js')
236-
.pipe($.replace(/(\/\*##EMOJILIST\*\/).+$/m, '$1"' + emoji.substr(1) + '";'))
237-
.pipe(gulp.dest('./src'))
238-
.on('end', done);
239-
}));
236+
.pipe(gulp.dest(emojiPath))
240237
}
241238
exports.update = update

v2/images/emoji/+1.png

4.5 KB

v2/images/emoji/-1.png

4.58 KB

v2/images/emoji/100.png

4.78 KB

v2/images/emoji/1234.png

4.11 KB

v2/images/emoji/8ball.png

2.79 KB

v2/images/emoji/a.png

2.89 KB

v2/images/emoji/ab.png

3.52 KB

v2/images/emoji/abc.png

3.55 KB

v2/images/emoji/abcd.png

4.21 KB

0 commit comments

Comments
 (0)