Merge remote-tracking branch 'parent/main' into upstream-20240310

This commit is contained in:
KMY 2025-03-10 19:58:05 +09:00
commit 5979c0ea1d
345 changed files with 4304 additions and 2540 deletions

View file

@ -103,4 +103,36 @@ namespace :emojis do
gen_border map[emoji], 'white'
end
end
desc 'Download the JSON sheet data of emojis'
task :download_sheet_json do
source = 'https://raw.githubusercontent.com/iamcal/emoji-data/refs/tags/v15.1.2/emoji.json'
dest = Rails.root.join('app', 'javascript', 'mastodon', 'features', 'emoji', 'emoji_sheet.json')
puts "Downloading emoji data from source... (#{source})"
res = HTTP.get(source).to_s
data = JSON.parse(res)
filtered_data = data.map do |emoji|
filtered_item = {
'unified' => emoji['unified'],
'sheet_x' => emoji['sheet_x'],
'sheet_y' => emoji['sheet_y'],
'skin_variations' => {},
}
emoji['skin_variations']&.each do |key, variation|
filtered_item['skin_variations'][key] = {
'unified' => variation['unified'],
'sheet_x' => variation['sheet_x'],
'sheet_y' => variation['sheet_y'],
}
end
filtered_item
end
File.write(dest, JSON.generate(filtered_data))
end
end