mirror of
https://github.com/kokonect-link/cherrypick
synced 2024-11-23 22:56:53 +09:00
refactor: cherrypick-mfm-js to cfm-js
This commit is contained in:
parent
56b5192d7d
commit
142df4882a
@ -108,10 +108,10 @@
|
||||
"bullmq": "5.13.2",
|
||||
"cacheable-lookup": "7.0.0",
|
||||
"cbor": "9.0.2",
|
||||
"cfm-js": "0.24.0-cherrypick.7",
|
||||
"chalk": "5.3.0",
|
||||
"chalk-template": "1.1.0",
|
||||
"cherrypick-js": "workspace:*",
|
||||
"cherrypick-mfm-js": "0.24.0-cherrypick.4",
|
||||
"chokidar": "3.6.0",
|
||||
"cli-highlight": "2.1.11",
|
||||
"color-convert": "2.0.1",
|
||||
|
@ -14,7 +14,7 @@ import { normalizeForSearch } from '@/misc/normalize-for-search.js';
|
||||
import type { IMentionedRemoteUsers } from '@/models/Note.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import type { DefaultTreeAdapterMap } from 'parse5';
|
||||
import type * as mfm from 'cherrypick-mfm-js';
|
||||
import type * as mfm from 'cfm-js';
|
||||
|
||||
const treeAdapter = parse5.defaultTreeAdapter;
|
||||
type Node = DefaultTreeAdapterMap['node'];
|
||||
|
@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import { setImmediate } from 'node:timers/promises';
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
import { In, DataSource, IsNull, LessThan } from 'typeorm';
|
||||
import * as Redis from 'ioredis';
|
||||
import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common';
|
||||
|
@ -7,7 +7,7 @@ import { setImmediate } from 'node:timers/promises';
|
||||
import util from 'util';
|
||||
import { In, DataSource } from 'typeorm';
|
||||
import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common';
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
import type { IMentionedRemoteUsers } from '@/models/Note.js';
|
||||
import { MiNote } from '@/models/Note.js';
|
||||
import type { NotesRepository, UsersRepository } from '@/models/_.js';
|
||||
|
@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
import { MfmService } from '@/core/MfmService.js';
|
||||
import type { MiNote } from '@/models/Note.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
|
@ -6,7 +6,7 @@
|
||||
import { createPublicKey, randomUUID } from 'node:crypto';
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { In } from 'typeorm';
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import type { Config } from '@/config.js';
|
||||
import type { MiPartialLocalUser, MiLocalUser, MiPartialRemoteUser, MiRemoteUser, MiUser } from '@/models/User.js';
|
||||
|
@ -3,7 +3,7 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
import { unique } from '@/misc/prelude/array.js';
|
||||
|
||||
export function extractCustomEmojisFromMfm(nodes: mfm.MfmNode[]): string[] {
|
||||
|
@ -3,7 +3,7 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
import { unique } from '@/misc/prelude/array.js';
|
||||
|
||||
export function extractHashtags(nodes: mfm.MfmNode[]): string[] {
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
// test is located in test/extract-mentions
|
||||
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
|
||||
export function extractMentions(nodes: mfm.MfmNode[]): mfm.MfmMention['props'][] {
|
||||
// TODO: 重複を削除
|
||||
|
@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import RE2 from 're2';
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import ms from 'ms';
|
||||
import { JSDOM } from 'jsdom';
|
||||
|
@ -6,7 +6,7 @@
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { In, IsNull } from 'typeorm';
|
||||
import { Feed } from 'feed';
|
||||
import { parse as mfmParse } from 'cherrypick-mfm-js';
|
||||
import { parse as mfmParse } from 'cfm-js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import type { DriveFilesRepository, NotesRepository, UserProfilesRepository } from '@/models/_.js';
|
||||
import type { Config } from '@/config.js';
|
||||
|
@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import * as assert from 'assert';
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
import { Test } from '@nestjs/testing';
|
||||
|
||||
import { CoreModule } from '@/core/CoreModule.js';
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
import * as assert from 'assert';
|
||||
|
||||
import { parse } from 'cherrypick-mfm-js';
|
||||
import { parse } from 'cfm-js';
|
||||
import { extractMentions } from '@/misc/extract-mentions.js';
|
||||
|
||||
describe('Extract mentions', () => {
|
||||
|
@ -21,8 +21,8 @@
|
||||
"@vue/compiler-sfc": "3.5.10",
|
||||
"astring": "1.9.0",
|
||||
"buraha": "0.0.1",
|
||||
"cfm-js": "0.24.0-cherrypick.7",
|
||||
"cherrypick-js": "workspace:*",
|
||||
"cherrypick-mfm-js": "0.24.0-cherrypick.4",
|
||||
"estree-walker": "3.0.3",
|
||||
"frontend-shared": "workspace:*",
|
||||
"punycode": "2.3.1",
|
||||
|
@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import { VNode, h, SetupContext, provide } from 'vue';
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
import * as Misskey from 'cherrypick-js';
|
||||
import { host } from '@@/js/config.js';
|
||||
import EmUrl from '@/components/EmUrl.vue';
|
||||
|
@ -121,7 +121,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, inject, ref, shallowRef } from 'vue';
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
import * as Misskey from 'cherrypick-js';
|
||||
import { shouldCollapsed, shouldMfmCollapsed } from '@@/js/collapsed.js';
|
||||
import { url } from '@@/js/config.js';
|
||||
|
@ -155,7 +155,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, inject, ref } from 'vue';
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
import * as Misskey from 'cherrypick-js';
|
||||
import { shouldCollapsed, shouldMfmCollapsed } from '@@/js/collapsed.js';
|
||||
import { url } from '@@/js/config.js';
|
||||
|
@ -36,13 +36,13 @@
|
||||
"broadcast-channel": "7.0.0",
|
||||
"buraha": "0.0.1",
|
||||
"canvas-confetti": "1.9.3",
|
||||
"cfm-js": "0.24.0-cherrypick.7",
|
||||
"chart.js": "4.4.4",
|
||||
"chartjs-adapter-date-fns": "3.0.0",
|
||||
"chartjs-chart-matrix": "2.0.1",
|
||||
"chartjs-plugin-gradient": "0.6.1",
|
||||
"chartjs-plugin-zoom": "2.0.1",
|
||||
"cherrypick-js": "workspace:*",
|
||||
"cherrypick-mfm-js": "0.24.0-cherrypick.4",
|
||||
"chromatic": "11.10.4",
|
||||
"compare-versions": "6.1.1",
|
||||
"cropperjs": "2.0.0-rc.2",
|
||||
|
@ -223,7 +223,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, inject, onMounted, ref, shallowRef, Ref, watch, provide } from 'vue';
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
import * as Misskey from 'cherrypick-js';
|
||||
import { isLink } from '@@/js/is-link.js';
|
||||
import { shouldCollapsed, shouldMfmCollapsed } from '@@/js/collapsed.js';
|
||||
|
@ -295,7 +295,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, inject, onMounted, provide, ref, shallowRef } from 'vue';
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
import * as Misskey from 'cherrypick-js';
|
||||
import { CodeDiff } from 'v-code-diff';
|
||||
import { isLink } from '@@/js/is-link.js';
|
||||
|
@ -107,7 +107,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { inject, watch, nextTick, onMounted, defineAsyncComponent, provide, shallowRef, ref, computed } from 'vue';
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
import * as Misskey from 'cherrypick-js';
|
||||
import insertTextAtCursor from 'insert-text-at-cursor';
|
||||
import { toASCII } from 'punycode/';
|
||||
|
@ -123,7 +123,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { inject, watch, nextTick, onMounted, defineAsyncComponent, provide, shallowRef, ref, computed } from 'vue';
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
import * as Misskey from 'cherrypick-js';
|
||||
import insertTextAtCursor from 'insert-text-at-cursor';
|
||||
import { toASCII } from 'punycode/';
|
||||
|
@ -125,7 +125,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, inject, provide, Ref, ref, shallowRef, watch } from 'vue';
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
import * as Misskey from 'cherrypick-js';
|
||||
import { shouldCollapsed, shouldMfmCollapsed } from '@@/js/collapsed.js';
|
||||
import { concat } from '@@/js/array.js';
|
||||
|
@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import { VNode, h, SetupContext, provide } from 'vue';
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
import * as Misskey from 'cherrypick-js';
|
||||
import temml from 'temml/dist/temml.mjs';
|
||||
import { host } from '@@/js/config.js';
|
||||
|
@ -14,7 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { defineAsyncComponent } from 'vue';
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
import * as Misskey from 'cherrypick-js';
|
||||
import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm.js';
|
||||
import { isEnabledUrlPreview } from '@/instance.js';
|
||||
|
@ -50,7 +50,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue';
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
import * as Misskey from 'cherrypick-js';
|
||||
import * as os from '@/os.js';
|
||||
import MkUrlPreview from '@/components/MkUrlPreview.vue';
|
||||
|
@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import { detect } from 'tinyld';
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
|
||||
export default function detectLanguage(text: string): string {
|
||||
const nodes = mfm.parse(text);
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
// test is located in test/extract-mentions
|
||||
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
|
||||
export function extractMentions(nodes: mfm.MfmNode[]): mfm.MfmMention['props'][] {
|
||||
// TODO: 重複を削除
|
||||
|
@ -3,7 +3,7 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import * as mfm from 'cherrypick-mfm-js';
|
||||
import * as mfm from 'cfm-js';
|
||||
import { unique } from '@@/js/array.js';
|
||||
|
||||
// unique without hash
|
||||
|
@ -209,6 +209,9 @@ importers:
|
||||
cbor:
|
||||
specifier: 9.0.2
|
||||
version: 9.0.2
|
||||
cfm-js:
|
||||
specifier: 0.24.0-cherrypick.7
|
||||
version: 0.24.0-cherrypick.7
|
||||
chalk:
|
||||
specifier: 5.3.0
|
||||
version: 5.3.0
|
||||
@ -218,9 +221,6 @@ importers:
|
||||
cherrypick-js:
|
||||
specifier: workspace:*
|
||||
version: link:../cherrypick-js
|
||||
cherrypick-mfm-js:
|
||||
specifier: 0.24.0-cherrypick.4
|
||||
version: 0.24.0-cherrypick.4
|
||||
chokidar:
|
||||
specifier: 3.5.3
|
||||
version: 3.5.3
|
||||
@ -851,6 +851,9 @@ importers:
|
||||
canvas-confetti:
|
||||
specifier: 1.9.3
|
||||
version: 1.9.3
|
||||
cfm-js:
|
||||
specifier: 0.24.0-cherrypick.7
|
||||
version: 0.24.0-cherrypick.7
|
||||
chart.js:
|
||||
specifier: 4.4.4
|
||||
version: 4.4.4
|
||||
@ -869,9 +872,6 @@ importers:
|
||||
cherrypick-js:
|
||||
specifier: workspace:*
|
||||
version: link:../cherrypick-js
|
||||
cherrypick-mfm-js:
|
||||
specifier: 0.24.0-cherrypick.4
|
||||
version: 0.24.0-cherrypick.4
|
||||
chromatic:
|
||||
specifier: 11.10.4
|
||||
version: 11.10.4
|
||||
@ -1215,12 +1215,12 @@ importers:
|
||||
buraha:
|
||||
specifier: 0.0.1
|
||||
version: 0.0.1
|
||||
cfm-js:
|
||||
specifier: 0.24.0-cherrypick.7
|
||||
version: 0.24.0-cherrypick.7
|
||||
cherrypick-js:
|
||||
specifier: workspace:*
|
||||
version: link:../cherrypick-js
|
||||
cherrypick-mfm-js:
|
||||
specifier: 0.24.0-cherrypick.4
|
||||
version: 0.24.0-cherrypick.4
|
||||
estree-walker:
|
||||
specifier: 3.0.3
|
||||
version: 3.0.3
|
||||
@ -5829,6 +5829,9 @@ packages:
|
||||
ccount@2.0.1:
|
||||
resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==}
|
||||
|
||||
cfm-js@0.24.0-cherrypick.7:
|
||||
resolution: {integrity: sha512-WFo+z9uJrx1bftoGpb9BO698BClMUUwka2p2aR+VSPFOhgPHp6b167s1s1UUQYpLU0eyAkStXjd+sptLKTCPHg==}
|
||||
|
||||
chai@4.3.10:
|
||||
resolution: {integrity: sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g==}
|
||||
engines: {node: '>=4'}
|
||||
@ -5914,9 +5917,6 @@ packages:
|
||||
resolution: {integrity: sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==}
|
||||
engines: {node: '>= 6'}
|
||||
|
||||
cherrypick-mfm-js@0.24.0-cherrypick.4:
|
||||
resolution: {integrity: sha512-j+RQtW17aHm7ee7/KAeOEP+jIuzPr0YUgTAzorhLpbYNbshZ9X3BOBZzmuu3B/WhwYGV5rDc1CWjp77gOiFktg==}
|
||||
|
||||
chokidar@3.5.3:
|
||||
resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==}
|
||||
engines: {node: '>= 8.10.0'}
|
||||
@ -17428,6 +17428,10 @@ snapshots:
|
||||
|
||||
ccount@2.0.1: {}
|
||||
|
||||
cfm-js@0.24.0-cherrypick.7:
|
||||
dependencies:
|
||||
'@twemoji/parser': 15.0.0
|
||||
|
||||
chai@4.3.10:
|
||||
dependencies:
|
||||
assertion-error: 1.1.0
|
||||
@ -17539,10 +17543,6 @@ snapshots:
|
||||
parse5: 7.1.2
|
||||
parse5-htmlparser2-tree-adapter: 7.0.0
|
||||
|
||||
cherrypick-mfm-js@0.24.0-cherrypick.4:
|
||||
dependencies:
|
||||
'@twemoji/parser': 15.0.0
|
||||
|
||||
chokidar@3.5.3:
|
||||
dependencies:
|
||||
anymatch: 3.1.3
|
||||
|
Loading…
Reference in New Issue
Block a user