From 902da0b291277f8a51ddea4781638d5e09e34fe8 Mon Sep 17 00:00:00 2001 From: zyoshoka <107108195+zyoshoka@users.noreply.github.com> Date: Sat, 16 Dec 2023 10:12:07 +0900 Subject: [PATCH] enhance: support Unicode 15.0 emoji (#135) --- CHANGELOG.md | 4 ++++ package-lock.json | 26 +++++++++++++------------- package.json | 2 +- src/@types/twemoji.d.ts | 2 +- src/internal/parser.ts | 4 ++-- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 263361d..5a1fc8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ --> +## 0.x.x (unreleased) +### Features +- Supports Unicode 15.0 emoji + ## 0.23.3 - tweak fn parsing - fnNameList option removed diff --git a/package-lock.json b/package-lock.json index a6593d1..fb43b11 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "mfm-js", - "version": "0.23.2", + "version": "0.23.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "mfm-js", - "version": "0.23.2", + "version": "0.23.3", "license": "MIT", "dependencies": { - "twemoji-parser": "14.0.0" + "@twemoji/parser": "15.0.0" }, "devDependencies": { "@microsoft/api-extractor": "^7.28.4", @@ -1292,6 +1292,11 @@ "tsserver": "typescript/bin/tsserver" } }, + "node_modules/@twemoji/parser": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/@twemoji/parser/-/parser-15.0.0.tgz", + "integrity": "sha512-lh9515BNsvKSNvyUqbj5yFu83iIDQ77SwVcsN/SnEGawczhsKU6qWuogewN1GweTi5Imo5ToQ9s+nNTf97IXvg==" + }, "node_modules/@types/argparse": { "version": "1.0.38", "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz", @@ -5184,11 +5189,6 @@ "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" } }, - "node_modules/twemoji-parser": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/twemoji-parser/-/twemoji-parser-14.0.0.tgz", - "integrity": "sha512-9DUOTGLOWs0pFWnh1p6NF+C3CkQ96PWmEFwhOVmT3WbecRC+68AIqpsnJXygfkFcp4aXbOp8Dwbhh/HQgvoRxA==" - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -6466,6 +6466,11 @@ "integrity": "sha512-jbtC+RgKZ9Kk65zuRZbKLTACf+tvFW4Rfq0JEMXrlmV3P3yme+Hm+pnb5fJRyt61SjIitcrC810wj7+1tgsEmg==", "dev": true }, + "@twemoji/parser": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/@twemoji/parser/-/parser-15.0.0.tgz", + "integrity": "sha512-lh9515BNsvKSNvyUqbj5yFu83iIDQ77SwVcsN/SnEGawczhsKU6qWuogewN1GweTi5Imo5ToQ9s+nNTf97IXvg==" + }, "@types/argparse": { "version": "1.0.38", "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz", @@ -9357,11 +9362,6 @@ "tslib": "^1.8.1" } }, - "twemoji-parser": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/twemoji-parser/-/twemoji-parser-14.0.0.tgz", - "integrity": "sha512-9DUOTGLOWs0pFWnh1p6NF+C3CkQ96PWmEFwhOVmT3WbecRC+68AIqpsnJXygfkFcp4aXbOp8Dwbhh/HQgvoRxA==" - }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", diff --git a/package.json b/package.json index a66c7b9..7a65f8f 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "typescript": "4.7.4" }, "dependencies": { - "twemoji-parser": "14.0.0" + "@twemoji/parser": "15.0.0" }, "files": [ "built", diff --git a/src/@types/twemoji.d.ts b/src/@types/twemoji.d.ts index 4c2c311..902109d 100644 --- a/src/@types/twemoji.d.ts +++ b/src/@types/twemoji.d.ts @@ -1,4 +1,4 @@ -declare module 'twemoji-parser/dist/lib/regex' { +declare module '@twemoji/parser/dist/lib/regex' { const regex: RegExp; export default regex; } diff --git a/src/internal/parser.ts b/src/internal/parser.ts index 0d19f27..20e0072 100644 --- a/src/internal/parser.ts +++ b/src/internal/parser.ts @@ -3,11 +3,11 @@ import * as P from './core'; import { mergeText } from './util'; // NOTE: -// tsdのテストでファイルを追加しているにも関わらず「twemoji-parser/dist/lib/regex」の型定義ファイルがないとエラーが出るため、 +// tsdのテストでファイルを追加しているにも関わらず「@twemoji/parser/dist/lib/regex」の型定義ファイルがないとエラーが出るため、 // このエラーを無視する。 /* eslint @typescript-eslint/ban-ts-comment: 1 */ // @ts-ignore -import twemojiRegex from 'twemoji-parser/dist/lib/regex'; +import twemojiRegex from '@twemoji/parser/dist/lib/regex'; type ArgPair = { k: string, v: string | true }; type Args = Record;