Instead of making this part of the build process, let the devs generate stripped-emoji.json

With the expectation that when the file needs to be regenerated to include other keys, the developer will run this script.
This commit is contained in:
Luke Barnard 2017-06-28 13:28:48 +01:00
parent 22ddbc63c3
commit 30f80b57f2
3 changed files with 6 additions and 5 deletions

View file

@ -33,9 +33,8 @@
"scripts": { "scripts": {
"reskindex": "node scripts/reskindex.js -h header", "reskindex": "node scripts/reskindex.js -h header",
"reskindex:watch": "node scripts/reskindex.js -h header -w", "reskindex:watch": "node scripts/reskindex.js -h header -w",
"build:init": "mkdir -p lib && npm run emoji-data-strip", "build": "npm run reskindex && babel src -d lib --source-maps --copy-files",
"build": "npm run build:init && npm run reskindex && babel src -d lib --source-maps", "build:watch": "babel src -w -d lib --source-maps --copy-files",
"build:watch": "npm run build:init && babel src -w -d lib --source-maps",
"emoji-data-strip": "node scripts/emoji-data-strip.js", "emoji-data-strip": "node scripts/emoji-data-strip.js",
"start": "parallelshell \"npm run build:watch\" \"npm run reskindex:watch\"", "start": "parallelshell \"npm run build:watch\" \"npm run reskindex:watch\"",
"lint": "eslint src/", "lint": "eslint src/",

View file

@ -11,7 +11,8 @@ const output = Object.keys(EMOJI_DATA).map(
category: datum.category, category: datum.category,
emoji_order: datum.emoji_order, emoji_order: datum.emoji_order,
}; };
} },
); );
fs.writeFileSync('./lib/stripped-emoji.json', JSON.stringify(output)); // Write to a file in src. Changes should be checked in to git
fs.writeFileSync('./src/stripped-emoji.json', JSON.stringify(output));

1
src/stripped-emoji.json Normal file

File diff suppressed because one or more lines are too long