Skip to content

Commit

Permalink
deps: Update dev and test dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed May 2, 2023
1 parent 94835cb commit 57b5f18
Show file tree
Hide file tree
Showing 13 changed files with 2,359 additions and 703 deletions.
8 changes: 8 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,12 @@ module.exports = {
// All of the emoji mappings use numbers
'no-magic-numbers': 'off',
},
overrides: [
{
files: ['*.test.ts'],
rules: {
'unicorn/prefer-module': 'off',
},
},
],
};
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@
"node": ">=14.15.0"
},
"devDependencies": {
"@moonrepo/dev": "^1.0.0",
"@types/jest": "^29.0.3",
"babel-preset-moon": "^1.0.2",
"eslint": "^8.24.0",
"eslint-config-moon": "^1.0.2",
"@moonrepo/dev": "^2.0.0",
"@types/jest": "^29.5.1",
"babel-preset-moon": "^2.0.3",
"eslint": "^8.39.0",
"eslint-config-moon": "^2.0.3",
"fast-glob": "^3.2.12",
"fetch-mock-jest": "^1.5.1",
"filesize": "^9.0.11",
"gzip-size": "^7.0.0",
"jest": "^29.0.3",
"jest-preset-moon": "^1.0.2",
"jest": "^29.5.0",
"jest-preset-moon": "^2.0.1",
"lerna": "^5.5.2",
"packemon": "^2.4.1",
"prettier": "^2.7.1",
"prettier-config-moon": "^1.0.1",
"tsconfig-moon": "^1.0.1",
"typescript": "^4.8.3"
"prettier": "^2.8.8",
"prettier-config-moon": "^1.1.2",
"tsconfig-moon": "^1.3.0",
"typescript": "^5.0.4"
},
"workspaces": [
"packages/*",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/fetchFromCDN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function getFetchUrl(path: string, version: string, cdnUrl?: CDNUrlFn | string):
}

if (__DEV__) {
if (!path || !path.endsWith('.json')) {
if (!path?.endsWith('.json')) {
throw new Error('A valid JSON dataset is required to fetch.');
}

Expand Down
4 changes: 2 additions & 2 deletions packages/generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
"dependencies": {
"@types/cheerio": "^0.22.31",
"@types/fs-extra": "^9.0.13",
"@types/node": "^16.11.62",
"@types/node": "^16.18.25",
"@types/node-fetch": "^2.6.2",
"chalk": "^5.0.1",
"cheerio": "^1.0.0-rc.12",
"emojibase": "workspace:*",
"fs-extra": "^10.1.0",
"kuroshiro": "^1.2.0",
"kuroshiro-analyzer-kuromoji": "^1.1.0",
"node-fetch": "^2.6.7",
"node-fetch": "^2.6.9",
"pofile": "^1.1.3",
"regexgen": "^1.3.0",
"transliteration": "^2.3.5"
Expand Down
4 changes: 2 additions & 2 deletions packages/generator/src/builders/verifyDataIntegrity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ export function verifyDataIntegrity(emojis: EmojiMap): EmojiMap {

// Verify there are 2 presentation variations if applicable
if (isObject<EmojiVariation>(emoji.variations)) {
if (!emoji.variations.text || !emoji.variations.text.endsWith(TEXT_VARIATION_SELECTOR)) {
if (!emoji.variations.text?.endsWith(TEXT_VARIATION_SELECTOR)) {
errors.push(`Invalid text presentation variation. Found ${emoji.variations.text}.`);
}

if (!emoji.variations.emoji || !emoji.variations.emoji.endsWith(EMOJI_VARIATION_SELECTOR)) {
if (!emoji.variations.emoji?.endsWith(EMOJI_VARIATION_SELECTOR)) {
errors.push(`Invalid emoji presentation variation. Found ${emoji.variations.emoji}.`);
}

Expand Down
3 changes: 1 addition & 2 deletions packages/generator/src/generators/generateData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,13 @@ async function generateMessages(locale: Locale): Promise<unknown> {
break;
}

case 'SKIN TONE': {
case 'SKIN TONE':
skinTones.push({
key: meta.trim(),
message: String(item.msgstr),
} as SkinToneMessage);

break;
}

default:
break;
Expand Down
9 changes: 3 additions & 6 deletions packages/generator/src/generators/generateRegex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async function createEmojiRegex(

switch (display) {
// Should only contain emoji presentation
case 'emoji': {
case 'emoji':
if (!variations || loose) {
addCodePoint(hexcode);
}
Expand All @@ -70,10 +70,9 @@ async function createEmojiRegex(
}

break;
}

// Should only contain text presentation
case 'text': {
case 'text':
if (loose) {
addCodePoint(hexcode);
}
Expand All @@ -83,10 +82,9 @@ async function createEmojiRegex(
}

break;
}

// Should contain everything
default: {
default:
addCodePoint(hexcode);

if (variations) {
Expand All @@ -99,7 +97,6 @@ async function createEmojiRegex(
}

break;
}
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export async function generateCldr(db: Database) {
for (const emoji of db.emojiList) {
const row = annotations[emoji.hexcode] || annotations[stripHexcode(emoji.hexcode)];

if (!row || !row.annotation || cldr[emoji.hexcode]) {
if (!row?.annotation || cldr[emoji.hexcode]) {
// eslint-disable-next-line no-continue
continue;
}
Expand Down
1 change: 1 addition & 0 deletions packages/test-utils/src/loadEmojiData.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Emoji, joinShortcodes, ShortcodesDataset } from 'emojibase';

export function loadEmojiData(shortcodeDatasets?: ShortcodesDataset[]): Emoji[] {
// eslint-disable-next-line unicorn/prefer-module
const data = require('../test-data.json') as Emoji[];

return shortcodeDatasets ? joinShortcodes(data, shortcodeDatasets) : data;
Expand Down
1 change: 1 addition & 0 deletions packages/test-utils/src/loadMessages.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { MessagesDataset } from 'emojibase';

export function loadMessages(): MessagesDataset {
// eslint-disable-next-line unicorn/prefer-module
return require('../test-messages.json') as MessagesDataset;
}
1 change: 1 addition & 0 deletions packages/test-utils/src/loadShortcodes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ShortcodesDataset } from 'emojibase';

export function loadShortcodes(): ShortcodesDataset {
// eslint-disable-next-line unicorn/prefer-module
return require('../test-shortcodes.json') as ShortcodesDataset;
}
3 changes: 2 additions & 1 deletion tsconfig.options.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": [
"esnext",
"dom"
]
],
"verbatimModuleSyntax": false
}
}
Loading

0 comments on commit 57b5f18

Please sign in to comment.