Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: Audit 06/03 #171

Merged
merged 6 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
spec: '@yarnpkg/plugin-interactive-tools'
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"
spec: '@yarnpkg/plugin-version'

yarnPath: .yarn/releases/yarn-3.6.3.cjs
1 change: 1 addition & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "independent",
"npmClient": "yarn",
"command": {
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,30 @@
"type": "tsc --build"
},
"engines": {
"node": ">=16.12.0"
"node": ">=20.0.0"
},
"devDependencies": {
"@moonrepo/dev": "^2.0.1",
"@types/jest": "^29.5.5",
"babel-preset-moon": "^2.0.9",
"@moonrepo/dev": "^3.0.1",
"@types/jest": "^29.5.12",
"babel-preset-moon": "^3.0.2",
"cldr-annotations-derived-full": "^44.0.1",
"cldr-annotations-full": "^44.0.1",
"cldr-localenames-full": "^44.0.1",
"cldr-misc-full": "^44.0.1",
"eslint": "^8.50.0",
"eslint-config-moon": "^2.0.10",
"fast-glob": "^3.3.1",
"eslint-config-moon": "^3.1.1",
"fast-glob": "^3.3.2",
"fetch-mock-jest": "^1.5.1",
"filesize": "^10.1.0",
"filesize": "^10.1.2",
"gzip-size": "^7.0.0",
"jest": "^29.7.0",
"jest-preset-moon": "^2.0.5",
"lerna": "^7.3.0",
"jest-preset-moon": "^3.0.1",
"lerna": "^8.1.3",
"packemon": "^3.2.2",
"prettier": "^3.0.3",
"prettier": "^3.3.0",
"prettier-config-moon": "^1.1.2",
"tsconfig-moon": "^1.3.0",
"typescript": "^5.2.2"
"typescript": "^5.4.5"
},
"workspaces": [
"packages/*",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/appendSkinToneIndex.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SkinTone } from './types';
import type { SkinTone } from './types';

/**
* Append a skin tone index (number) to the end of a shortcode.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import type {
Gender,
GroupKey,
Locale,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/fetchEmojis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { fetchFromCDN } from './fetchFromCDN';
import { fetchShortcodes } from './fetchShortcodes';
import { flattenEmojiData } from './flattenEmojiData';
import { joinShortcodes } from './joinShortcodes';
import {
import type {
CompactEmoji,
Emoji,
FetchEmojisExpandedOptions,
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/fetchFromCDN.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { CDNUrlFn, FetchFromCDNOptions } from './types';
import type { CDNUrlFn, FetchFromCDNOptions } from './types';

function getFetchUrl(path: string, version: string, cdnUrl?: CDNUrlFn | string): string {
let fetchUrl = `https://cdn.jsdelivr.net/npm/emojibase-data@${version}/${path}`;

if (typeof cdnUrl === 'function') {
fetchUrl = cdnUrl(path, version);
} else if (typeof cdnUrl === 'string') {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/fetchMessages.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fetchFromCDN } from './fetchFromCDN';
import { FetchFromCDNOptions, Locale, MessagesDataset } from './types';
import type { FetchFromCDNOptions, Locale, MessagesDataset } from './types';

/**
* Fetches and returns localized messages for emoji related information like groups and sub-groups.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/fetchShortcodes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fetchFromCDN } from './fetchFromCDN';
import { FetchFromCDNOptions, Locale, ShortcodePreset, ShortcodesDataset } from './types';
import type { FetchFromCDNOptions, Locale, ShortcodePreset, ShortcodesDataset } from './types';

const ALIASES: Partial<Record<ShortcodePreset, string>> = {
discord: 'joypixels',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/flattenEmojiData.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { joinShortcodesToEmoji } from './joinShortcodesToEmoji';
import { CompactEmoji, Emoji, EmojiLike, ShortcodesDataset } from './types';
import type { CompactEmoji, Emoji, EmojiLike, ShortcodesDataset } from './types';

/**
* By default, emoji skin modifications are nested under the base neutral skin tone emoji.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/fromCodepointToUnicode.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CodePoint, Unicode } from './types';
import type { CodePoint, Unicode } from './types';

/**
* This function will convert an array of numerical codepoints to a literal emoji Unicode character.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/fromHexcodeToCodepoint.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CodePoint, Hexcode } from './types';
import type { CodePoint, Hexcode } from './types';

/**
* This function will convert a hexadecimal codepoint to an array of numerical codepoints.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/fromUnicodeToHexcode.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SEQUENCE_REMOVAL_PATTERN } from './constants';
import { Hexcode, Unicode } from './types';
import type { Hexcode, Unicode } from './types';

/**
* This function will convert a literal emoji Unicode character into a dash separated
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/generateEmoticonPermutations.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Emoticon, PermutationOptions } from './types';
import type { Emoticon, PermutationOptions } from './types';

/**
* This function will generate multiple permutations of a base emoticon character.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ export * from './generateEmoticonPermutations';
export * from './joinShortcodes';
export * from './joinShortcodesToEmoji';
export * from './stripHexcode';
export * from './types';
export type * from './types';
2 changes: 1 addition & 1 deletion packages/core/src/joinShortcodes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { joinShortcodesToEmoji } from './joinShortcodesToEmoji';
import { CompactEmoji, Emoji, EmojiLike, ShortcodesDataset } from './types';
import type { CompactEmoji, Emoji, EmojiLike, ShortcodesDataset } from './types';

/**
* Like `joinShortcodesToEmoji` but joins shortcodes to a list of emoji objects.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/joinShortcodesToEmoji.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CompactEmoji, Emoji, EmojiLike, ShortcodesDataset } from './types';
import type { CompactEmoji, Emoji, EmojiLike, ShortcodesDataset } from './types';

/**
* Will join shortcodes from multiple shortcode datasets into a single emoji object
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/stripHexcode.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SEQUENCE_REMOVAL_PATTERN } from './constants';
import { Hexcode } from './types';
import type { Hexcode } from './types';

const STRIP_PATTERN = new RegExp(`(-| )?(${SEQUENCE_REMOVAL_PATTERN.source})`, 'g');

Expand Down
2 changes: 1 addition & 1 deletion packages/core/tests/flattenEmojiData.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { flattenEmojiData } from '../src/flattenEmojiData';
import { Emoji } from '../src/types';
import type { Emoji } from '../src/types';

describe('flattenEmojiData()', () => {
const data: Emoji[] = [
Expand Down
1 change: 0 additions & 1 deletion packages/core/tests/fromUnicodeToHexcode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ describe('fromUnicodeToHexcode()', () => {
it(`converts unicode to hexcode for ${unicode}`, () => {
const hexcode = fromUnicodeToHexcode(unicode, false);

// eslint-disable-next-line jest/no-conditional-in-test
if (hexcode.length <= 10 && (hexcode.endsWith('FE0E') || hexcode.endsWith('FE0F'))) {
expect(hexcode.replace(SEQUENCE_HEXCODE_PATTERN, '')).toBe(emoji.hexcode);
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/tests/generateEmoticonPermutations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ describe('generateEmoticonPermutations()', () => {
});

it('doesnt assume a face', () => {
expect(generateEmoticonPermutations('\\m/', { isFace: false })).toEqual(['\\m/', '\\M/']);
expect(generateEmoticonPermutations(String.raw`\m/`, { isFace: false })).toEqual([String.raw`\m/`, String.raw`\M/`]);
});
});
2 changes: 1 addition & 1 deletion packages/core/tests/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CompactEmoji, Emoji } from '../src/types';
import type { CompactEmoji, Emoji } from '../src/types';

declare global {
namespace NodeJS {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/tests/joinShortcodes.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { joinShortcodes } from '../src/joinShortcodes';
import { Emoji } from '../src/types';
import type { Emoji } from '../src/types';

function createList(): Emoji[] {
return [
Expand Down
2 changes: 1 addition & 1 deletion packages/core/tests/joinShortcodesToEmoji.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { joinShortcodesToEmoji } from '../src/joinShortcodesToEmoji';
import { Emoji } from '../src/types';
import type { Emoji } from '../src/types';
import { getEmojiWithSkins } from './helpers';

describe('joinShortcodesToEmoji()', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/data/tests/data.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'node:path';
import { EMOJI, Emoji, FEMALE, flattenEmojiData, MALE, TEXT } from 'emojibase';
import { EMOJI, type Emoji, FEMALE, flattenEmojiData, MALE, TEXT } from 'emojibase';

const localeCache: Record<string, Emoji[]> = {};

Expand Down
2 changes: 1 addition & 1 deletion packages/data/tests/shortcodes.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'node:path';
import { ShortcodePreset, ShortcodesDataset } from 'emojibase';
import type { ShortcodePreset, ShortcodesDataset } from 'emojibase';
import SHORTCODE_PATTERN from 'emojibase-regex/shortcode';
import SHORTCODE_NATIVE_PATTERN from 'emojibase-regex/shortcode-native';

Expand Down
10 changes: 4 additions & 6 deletions packages/generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,15 @@
"src/**/*"
],
"dependencies": {
"@types/cheerio": "^0.22.32",
"@types/fs-extra": "^11.0.2",
"@types/node": "^16.18.57",
"@types/node-fetch": "^2.6.6",
"@types/cheerio": "^0.22.35",
"@types/fs-extra": "^11.0.4",
"@types/node": "^20.14.0",
"chalk": "^5.3.0",
"cheerio": "^1.0.0-rc.12",
"emojibase": "workspace:*",
"fs-extra": "^11.1.1",
"fs-extra": "^11.2.0",
"kuroshiro": "^1.2.0",
"kuroshiro-analyzer-kuromoji": "^1.1.0",
"node-fetch": "^2.7.0",
"pofile": "^1.1.4",
"regexgen": "^1.3.0",
"transliteration": "^2.3.5"
Expand Down
4 changes: 2 additions & 2 deletions packages/generator/src/builders/buildAnnotationData.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable complexity */

import util from 'node:util';
import { Locale, stripHexcode } from 'emojibase';
import { type Locale, stripHexcode } from 'emojibase';
import {
FACING_LEFT_PATTERN,
FACING_RIGHT_PATTERN,
Expand All @@ -20,7 +20,7 @@ import { loadLocalization } from '../loaders/loadLocalization';
import { loadPoMessages } from '../loaders/loadPoMessages';
import { loadSequences } from '../loaders/loadSequences';
import { loadZwjSequences } from '../loaders/loadZwjSequences';
import { CLDRAnnotation, CLDRAnnotationMap } from '../types';
import type { CLDRAnnotation, CLDRAnnotationMap } from '../types';

// function doesSequenceMatch(a: string[], b: string[]): boolean {
// // eslint-disable-next-line unicorn/no-for-loop
Expand Down
2 changes: 1 addition & 1 deletion packages/generator/src/builders/buildEmojiData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { loadNames } from '../loaders/loadNames';
import { loadSequences } from '../loaders/loadSequences';
import { loadVariations } from '../loaders/loadVariations';
import { loadZwjSequences } from '../loaders/loadZwjSequences';
import { EmojiMap } from '../types';
import type { EmojiMap } from '../types';
import { joinData } from './joinData';
import { joinMetadataToData } from './joinMetadataToData';
import { joinModifiersToData } from './joinModifiersToData';
Expand Down
2 changes: 1 addition & 1 deletion packages/generator/src/builders/buildVersionedData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { writeCache } from '../helpers/writeCache';
import { loadData } from '../loaders/loadData';
import { loadSequences } from '../loaders/loadSequences';
import { loadZwjSequences } from '../loaders/loadZwjSequences';
import { EmojiDataMap } from '../types';
import type { EmojiDataMap } from '../types';

export type VersionDataMap = Record<string, EmojiDataMap>;

Expand Down
2 changes: 1 addition & 1 deletion packages/generator/src/builders/joinData.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EmojiDataMap } from '../types';
import type { EmojiDataMap } from '../types';

export function joinData(emojis: EmojiDataMap, data: EmojiDataMap) {
Object.keys(data).forEach((hexcode) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/generator/src/builders/joinMetadataToData.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { EMOJI, FULLY_QUALIFIED, TEXT } from 'emojibase';
import { SEQUENCE_REMOVAL_PATTERN, SKIN_MODIFIER_PATTERN } from '../constants';
import { hasProperty } from '../helpers/hasProperty';
import {
import type {
EmojiMap,
EmojiMetadataMap,
EmojiVariationMap,
Expand Down
2 changes: 1 addition & 1 deletion packages/generator/src/builders/joinModifiersToData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
import { hasProperty } from '../helpers/hasProperty';
import { log } from '../helpers/log';
import { extractSkinTone } from '../parsers/extractSkinTone';
import { Emoji, EmojiMap, EmojiModification, SkinTone } from '../types';
import type { Emoji, EmojiMap, EmojiModification, SkinTone } from '../types';

const SKIN_HEXCODE_PATTERN = new RegExp(`-(${SKIN_MODIFIER_PATTERN.source})`, 'g');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EMOJI_VARIATION_SELECTOR, TEXT_VARIATION_SELECTOR } from '../constants';
import { EmojiMap } from '../types';
import type { EmojiMap } from '../types';

export function mergeDuplicateVariations(emojis: EmojiMap) {
Object.keys(emojis).forEach((hexcode) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { flattenData } from '../helpers/flattenData';
import { log } from '../helpers/log';
import { loadEmojiList } from '../loaders/loadEmojiList';
import { loadEmojiStyles } from '../loaders/loadEmojiStyles';
import { Emoji, EmojiMap, EmojiSource } from '../types';
import type { Emoji, EmojiMap, EmojiSource } from '../types';

// This commonly logs errors as the official emoji list is not historical and
// represents latest and future state.
Expand Down
2 changes: 1 addition & 1 deletion packages/generator/src/builders/verifyDataIntegrity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { isHidden } from '../helpers/isHidden';
import { isObject } from '../helpers/isObject';
import { log } from '../helpers/log';
import { toArray } from '../helpers/toArray';
import { EmojiMap, EmojiVariation } from '../types';
import type { EmojiMap, EmojiVariation } from '../types';

export function verifyDataIntegrity(emojis: EmojiMap): EmojiMap {
const usedEmoticons: EmojiMap = {};
Expand Down
4 changes: 2 additions & 2 deletions packages/generator/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable sort-keys, unicorn/better-regex */

import { Locale } from 'emojibase';
import { Property } from './types';
import type { Locale } from 'emojibase';
import type { Property } from './types';

export const INHERIT_PARENT_SYMBOL = '↑↑↑';

Expand Down
2 changes: 1 addition & 1 deletion packages/generator/src/generators/Database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { stripHexcode } from 'emojibase';
import { transliterate } from 'transliteration';
import { log } from '../helpers/log';
import { toArray } from '../helpers/toArray';
import { Emoji, EmojiMap, Hexcode, HexcodeMap, ShortcodeDataMap } from '../types';
import type { Emoji, EmojiMap, Hexcode, HexcodeMap, ShortcodeDataMap } from '../types';
import { toUnicode } from './toUnicode';

export class Database {
Expand Down
2 changes: 1 addition & 1 deletion packages/generator/src/generators/extractCompact.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CompactEmoji, Emoji } from 'emojibase';
import type { CompactEmoji, Emoji } from 'emojibase';

export function extractCompact(data: Emoji[]): CompactEmoji[] {
return data.map((full) => {
Expand Down
12 changes: 6 additions & 6 deletions packages/generator/src/generators/generateData.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* eslint-disable complexity */

import {
Emoji as FinalEmoji,
GroupMessage,
Locale,
SkinToneMessage,
type Emoji as FinalEmoji,
type GroupMessage,
type Locale,
type SkinToneMessage,
stripHexcode,
SubgroupMessage,
type SubgroupMessage,
SUPPORTED_LOCALES,
} from 'emojibase';
import { buildAnnotationData } from '../builders/buildAnnotationData';
Expand All @@ -16,7 +16,7 @@ import { log } from '../helpers/log';
import { readCache } from '../helpers/readCache';
import { writeDataset } from '../helpers/writeDataset';
import { loadPoMessages } from '../loaders/loadPoMessages';
import {
import type {
CLDRAnnotationMap,
Emoji,
EmojiModification,
Expand Down
2 changes: 1 addition & 1 deletion packages/generator/src/generators/generatePoFiles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Emoji, Hexcode, ShortcodesDataset, SUPPORTED_LOCALES } from 'emojibase';
import { type Emoji, type Hexcode, type ShortcodesDataset, SUPPORTED_LOCALES } from 'emojibase';
import { log } from '../helpers/log';
import { toArray } from '../helpers/toArray';
import { loadDataset } from '../loaders/loadDatasetPackage';
Expand Down
2 changes: 1 addition & 1 deletion packages/generator/src/generators/generateRegex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { flattenData } from '../helpers/flattenData';
import { log } from '../helpers/log';
import { toArray } from '../helpers/toArray';
import { writeRegex } from '../helpers/writeRegex';
import { EmojiMap, Hexcode } from '../types';
import type { EmojiMap, Hexcode } from '../types';
import { toUnicode } from './toUnicode';

type TrieMap = Record<string, Trie>;
Expand Down
Loading
Loading