From bea7e21a8025a8fd5d912283acc57b26fb254457 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 7 Jul 2018 19:19:00 +0900 Subject: [PATCH] Refactorng --- .../common/scripts/compose-notification.ts | 6 +-- .../app/common/views/components/messaging.vue | 2 +- .../components/misskey-flavored-markdown.ts | 2 +- src/client/app/common/views/filters/user.ts | 4 +- src/client/app/common/views/pages/follow.vue | 4 +- .../components/messaging-room-window.vue | 2 +- .../app/desktop/views/components/notes.vue | 2 +- .../views/components/notifications.vue | 2 +- .../desktop/views/components/user-preview.vue | 2 +- .../views/pages/deck/deck.notification.vue | 2 +- .../desktop/views/pages/messaging-room.vue | 4 +- .../app/desktop/views/pages/user/user.vue | 4 +- .../app/mobile/views/components/note-card.vue | 2 +- .../app/mobile/views/components/notes.vue | 2 +- .../views/components/notification-preview.vue | 2 +- .../mobile/views/components/notification.vue | 2 +- .../app/mobile/views/pages/followers.vue | 4 +- .../app/mobile/views/pages/following.vue | 2 +- .../app/mobile/views/pages/messaging-room.vue | 2 +- .../app/mobile/views/pages/messaging.vue | 2 +- src/client/app/mobile/views/pages/user.vue | 2 +- src/index.ts | 46 +++++++------------ src/mfm/parse/elements/mention.ts | 2 +- src/{ => misc}/acct/parse.ts | 0 src/{ => misc}/acct/render.ts | 2 +- src/{ => misc}/cafy-id.ts | 0 src/{utils => misc}/cli/indicator.ts | 0 src/{utils => misc}/cli/progressbar.ts | 0 src/{utils => misc}/dependencyInfo.ts | 0 src/{utils => misc}/environmentInfo.ts | 0 src/{renderers => misc}/get-note-summary.ts | 0 .../get-notification-summary.ts | 2 +- src/{renderers => misc}/get-reaction-emoji.ts | 0 src/{renderers => misc}/get-user-name.ts | 0 src/{renderers => misc}/get-user-summary.ts | 2 +- src/{utils => misc}/logger.ts | 0 src/{utils => misc}/machineInfo.ts | 0 src/{publishers => }/notify.ts | 10 ++-- src/parse-opt.ts | 17 ------- src/{publishers => }/push-sw.ts | 4 +- src/queue/processors/http/process-inbox.ts | 2 +- src/server/activitypub.ts | 1 - .../api/common/read-messaging-message.ts | 6 +-- src/server/api/common/read-notification.ts | 2 +- .../endpoints/aggregation/users/activity.ts | 2 +- .../endpoints/aggregation/users/followers.ts | 2 +- .../endpoints/aggregation/users/following.ts | 2 +- .../api/endpoints/aggregation/users/post.ts | 2 +- .../endpoints/aggregation/users/reaction.ts | 2 +- src/server/api/endpoints/app/show.ts | 2 +- src/server/api/endpoints/drive/files.ts | 2 +- .../api/endpoints/drive/files/create.ts | 2 +- .../api/endpoints/drive/files/delete.ts | 4 +- src/server/api/endpoints/drive/files/find.ts | 2 +- src/server/api/endpoints/drive/files/show.ts | 2 +- .../api/endpoints/drive/files/update.ts | 4 +- .../endpoints/drive/files/upload_from_url.ts | 2 +- src/server/api/endpoints/drive/folders.ts | 2 +- .../api/endpoints/drive/folders/create.ts | 4 +- .../api/endpoints/drive/folders/find.ts | 2 +- .../api/endpoints/drive/folders/show.ts | 2 +- .../api/endpoints/drive/folders/update.ts | 4 +- src/server/api/endpoints/drive/stream.ts | 2 +- src/server/api/endpoints/following/create.ts | 2 +- src/server/api/endpoints/following/delete.ts | 2 +- .../endpoints/following/requests/accept.ts | 2 +- .../endpoints/following/requests/cancel.ts | 2 +- .../endpoints/following/requests/reject.ts | 2 +- src/server/api/endpoints/following/stalk.ts | 2 +- src/server/api/endpoints/following/unstalk.ts | 2 +- .../api/endpoints/games/reversi/games.ts | 2 +- .../api/endpoints/games/reversi/games/show.ts | 2 +- .../api/endpoints/games/reversi/match.ts | 4 +- src/server/api/endpoints/i/favorites.ts | 2 +- src/server/api/endpoints/i/notifications.ts | 2 +- src/server/api/endpoints/i/pin.ts | 2 +- .../api/endpoints/i/regenerate_token.ts | 2 +- src/server/api/endpoints/i/signin_history.ts | 2 +- src/server/api/endpoints/i/update.ts | 4 +- .../api/endpoints/i/update_client_setting.ts | 2 +- src/server/api/endpoints/i/update_home.ts | 15 +++--- .../api/endpoints/i/update_mobile_home.ts | 13 +++--- src/server/api/endpoints/i/update_widget.ts | 4 +- .../api/endpoints/messaging/messages.ts | 2 +- .../endpoints/messaging/messages/create.ts | 10 ++-- src/server/api/endpoints/mute/create.ts | 2 +- src/server/api/endpoints/mute/delete.ts | 2 +- src/server/api/endpoints/mute/list.ts | 2 +- src/server/api/endpoints/notes.ts | 2 +- .../api/endpoints/notes/conversation.ts | 2 +- src/server/api/endpoints/notes/create.ts | 2 +- src/server/api/endpoints/notes/delete.ts | 2 +- .../api/endpoints/notes/favorites/create.ts | 2 +- .../api/endpoints/notes/favorites/delete.ts | 2 +- .../api/endpoints/notes/global-timeline.ts | 2 +- .../api/endpoints/notes/local-timeline.ts | 2 +- src/server/api/endpoints/notes/mentions.ts | 2 +- src/server/api/endpoints/notes/polls/vote.ts | 6 +-- src/server/api/endpoints/notes/reactions.ts | 2 +- .../api/endpoints/notes/reactions/create.ts | 2 +- .../api/endpoints/notes/reactions/delete.ts | 2 +- src/server/api/endpoints/notes/replies.ts | 2 +- src/server/api/endpoints/notes/reposts.ts | 2 +- .../api/endpoints/notes/search_by_tag.ts | 2 +- src/server/api/endpoints/notes/show.ts | 2 +- src/server/api/endpoints/notes/timeline.ts | 2 +- .../api/endpoints/notes/user-list-timeline.ts | 2 +- .../notifications/mark_as_read_all.ts | 2 +- src/server/api/endpoints/users/followers.ts | 2 +- src/server/api/endpoints/users/following.ts | 2 +- .../users/get_frequently_replied_users.ts | 2 +- src/server/api/endpoints/users/lists/push.ts | 4 +- src/server/api/endpoints/users/lists/show.ts | 2 +- src/server/api/endpoints/users/notes.ts | 2 +- src/server/api/endpoints/users/show.ts | 2 +- src/server/api/limitter.ts | 2 +- src/server/api/private/signin.ts | 2 +- src/server/api/service/twitter.ts | 2 +- src/server/api/stream/reversi-game.ts | 2 +- src/server/api/stream/reversi.ts | 2 +- src/server/web/index.ts | 4 +- src/server/webfinger.ts | 2 +- src/services/drive/add-file.ts | 2 +- src/services/following/create.ts | 4 +- src/services/following/delete.ts | 2 +- src/services/following/requests/accept.ts | 2 +- src/services/following/requests/cancel.ts | 2 +- src/services/following/requests/create.ts | 4 +- src/services/note/create.ts | 6 +-- src/services/note/delete.ts | 2 +- src/services/note/reaction/create.ts | 4 +- src/{publishers => }/stream.ts | 2 +- 132 files changed, 180 insertions(+), 212 deletions(-) rename src/{ => misc}/acct/parse.ts (100%) rename src/{ => misc}/acct/render.ts (72%) rename src/{ => misc}/cafy-id.ts (100%) rename src/{utils => misc}/cli/indicator.ts (100%) rename src/{utils => misc}/cli/progressbar.ts (100%) rename src/{utils => misc}/dependencyInfo.ts (100%) rename src/{utils => misc}/environmentInfo.ts (100%) rename src/{renderers => misc}/get-note-summary.ts (100%) rename src/{renderers => misc}/get-notification-summary.ts (96%) rename src/{renderers => misc}/get-reaction-emoji.ts (100%) rename src/{renderers => misc}/get-user-name.ts (100%) rename src/{renderers => misc}/get-user-summary.ts (93%) rename src/{utils => misc}/logger.ts (100%) rename src/{utils => misc}/machineInfo.ts (100%) rename src/{publishers => }/notify.ts (88%) delete mode 100644 src/parse-opt.ts rename src/{publishers => }/push-sw.ts (93%) rename src/{publishers => }/stream.ts (98%) diff --git a/src/client/app/common/scripts/compose-notification.ts b/src/client/app/common/scripts/compose-notification.ts index 2e58649ac..47499e549 100644 --- a/src/client/app/common/scripts/compose-notification.ts +++ b/src/client/app/common/scripts/compose-notification.ts @@ -1,6 +1,6 @@ -import getNoteSummary from '../../../../renderers/get-note-summary'; -import getReactionEmoji from '../../../../renderers/get-reaction-emoji'; -import getUserName from '../../../../renderers/get-user-name'; +import getNoteSummary from '../../../../misc/get-note-summary'; +import getReactionEmoji from '../../../../misc/get-reaction-emoji'; +import getUserName from '../../../../misc/get-user-name'; type Notification = { title: string; diff --git a/src/client/app/common/views/components/messaging.vue b/src/client/app/common/views/components/messaging.vue index 2ddec2998..6abfc92dc 100644 --- a/src/client/app/common/views/components/messaging.vue +++ b/src/client/app/common/views/components/messaging.vue @@ -51,7 +51,7 @@