chore: reduce dependencies by own json generator
This commit is contained in:
parent
d5a17ddfeb
commit
9c121bfd34
12
package.json
12
package.json
|
@ -29,7 +29,8 @@
|
|||
"release": "release-it",
|
||||
"example": "yarn --cwd example",
|
||||
"pods": "cd example && pod-install --quiet",
|
||||
"bootstrap": "yarn example && yarn && yarn pods"
|
||||
"bootstrap": "yarn example && yarn && yarn pods",
|
||||
"generateIcons": "node ./scripts/generateIcons.js"
|
||||
},
|
||||
"keywords": [
|
||||
"react-native",
|
||||
|
@ -64,8 +65,11 @@
|
|||
"react": "16.13.1",
|
||||
"react-native": "0.63.4",
|
||||
"react-native-builder-bob": "^0.18.0",
|
||||
"react-native-gesture-handler": "^1.10.3",
|
||||
"react-native-svg": "^12.1.1",
|
||||
"release-it": "^14.2.2",
|
||||
"typescript": "^4.1.3"
|
||||
"typescript": "^4.1.3",
|
||||
"unicode-emoji-json": "^0.2.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "*",
|
||||
|
@ -152,7 +156,5 @@
|
|||
]
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"unicode-emoji-json": "^0.2.1"
|
||||
}
|
||||
"dependencies": {}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
const json = require('unicode-emoji-json/data-by-group.json');
|
||||
const fs = require('fs');
|
||||
|
||||
const newArray = [];
|
||||
for (const [key, value] of Object.entries(json)) {
|
||||
const newData = value.map((emoji) => ({
|
||||
emoji: emoji.emoji,
|
||||
name: emoji.name,
|
||||
slug: emoji.slug,
|
||||
}));
|
||||
newArray.push({ title: key, data: newData });
|
||||
}
|
||||
|
||||
fs.writeFile(
|
||||
'./src/assets/emojis.json',
|
||||
JSON.stringify(newArray),
|
||||
function (err) {
|
||||
if (err) return console.log(err);
|
||||
console.log('emojis.json successfully saved to assets folder');
|
||||
}
|
||||
);
|
|
@ -11,7 +11,7 @@ import type { CategoryTypes, EmojisByCategory } from './types';
|
|||
import { EmojiCategory } from './components/EmojiCategory';
|
||||
import { KeyboardContext } from './KeyboardContext';
|
||||
import { Categories } from './components/Categories';
|
||||
import emojisByGroup from './assets/data-by-group.json';
|
||||
import emojisByGroup from './assets/emojis.json';
|
||||
|
||||
export const EmojiKeyboard = () => {
|
||||
const { width } = useWindowDimensions();
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue