From c74fe3c6e2aae3df4624b9b3a55b45293223ebf5 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 23 Mar 2021 17:43:07 +0900 Subject: [PATCH] refactor: Use path alias --- src/argv.ts | 2 +- src/boot/master.ts | 6 ++--- src/client/components/autocomplete.vue | 4 ++-- src/client/components/emoji-picker.vue | 2 +- src/client/components/notification.vue | 2 +- src/client/components/poll-editor.vue | 2 +- src/client/components/post-form.vue | 6 ++--- .../components/token-generate-window.vue | 2 +- src/client/components/user-info.vue | 2 +- src/client/components/user-preview.vue | 2 +- src/client/filters/user.ts | 4 ++-- src/client/i18n.ts | 2 +- src/client/pages/follow.vue | 2 +- src/client/pages/instance/abuses.vue | 2 +- src/client/pages/instance/settings.vue | 2 +- src/client/pages/instance/users.vue | 2 +- src/client/pages/messaging/index.vue | 2 +- .../pages/messaging/messaging-room.form.vue | 2 +- src/client/pages/messaging/messaging-room.vue | 2 +- .../pages/my-antennas/index.antenna.vue | 2 +- src/client/pages/room/room.vue | 2 +- src/client/pages/user/index.vue | 2 +- src/client/scripts/gen-search-query.ts | 2 +- src/client/scripts/get-user-menu.ts | 2 +- src/client/sw/compose-notification.ts | 4 ++-- src/client/sw/sw.ts | 2 +- src/client/ui/chat/post-form.vue | 6 ++--- src/db/elasticsearch.ts | 2 +- src/db/postgre.ts | 2 +- src/db/redis.ts | 2 +- src/mfm/language.ts | 4 ++-- src/mfm/to-html.ts | 2 +- src/mfm/to-string.ts | 2 +- src/misc/captcha.ts | 2 +- src/misc/convert-host.ts | 2 +- src/misc/download-url.ts | 2 +- src/misc/fetch.ts | 2 +- src/misc/gen-id.ts | 2 +- src/models/repositories/antenna.ts | 2 +- src/models/repositories/app.ts | 2 +- src/models/repositories/blocking.ts | 2 +- src/models/repositories/channel.ts | 2 +- src/models/repositories/clip.ts | 2 +- src/models/repositories/drive-file.ts | 8 +++---- src/models/repositories/drive-folder.ts | 2 +- .../repositories/federation-instance.ts | 2 +- src/models/repositories/following.ts | 2 +- src/models/repositories/hashtag.ts | 2 +- src/models/repositories/messaging-message.ts | 2 +- src/models/repositories/muting.ts | 2 +- src/models/repositories/note-reaction.ts | 4 ++-- src/models/repositories/note.ts | 6 ++--- src/models/repositories/notification.ts | 4 ++-- src/models/repositories/page.ts | 2 +- src/models/repositories/user-group.ts | 2 +- src/models/repositories/user-list.ts | 2 +- src/models/repositories/user.ts | 8 +++---- src/queue/index.ts | 2 +- src/queue/initialize.ts | 2 +- src/queue/processors/db/export-blocking.ts | 2 +- src/queue/processors/db/export-following.ts | 2 +- src/queue/processors/db/export-mute.ts | 2 +- src/queue/processors/db/export-user-lists.ts | 2 +- src/queue/processors/db/import-following.ts | 6 ++--- src/queue/processors/db/import-user-lists.ts | 8 +++---- src/queue/processors/deliver.ts | 6 ++--- src/queue/processors/inbox.ts | 4 ++-- src/queue/queues.ts | 2 +- src/remote/activitypub/db-resolver.ts | 2 +- .../activitypub/kernel/announce/note.ts | 6 ++--- src/remote/activitypub/kernel/create/note.ts | 4 ++-- src/remote/activitypub/kernel/delete/note.ts | 2 +- src/remote/activitypub/kernel/flag/index.ts | 4 ++-- src/remote/activitypub/kernel/read.ts | 2 +- src/remote/activitypub/misc/ld-signature.ts | 2 +- src/remote/activitypub/models/image.ts | 2 +- src/remote/activitypub/models/note.ts | 10 ++++----- src/remote/activitypub/models/person.ts | 10 ++++----- src/remote/activitypub/models/question.ts | 2 +- src/remote/activitypub/renderer/accept.ts | 2 +- src/remote/activitypub/renderer/add.ts | 2 +- src/remote/activitypub/renderer/announce.ts | 2 +- src/remote/activitypub/renderer/block.ts | 2 +- src/remote/activitypub/renderer/create.ts | 2 +- src/remote/activitypub/renderer/delete.ts | 2 +- src/remote/activitypub/renderer/emoji.ts | 2 +- .../activitypub/renderer/follow-relay.ts | 2 +- .../activitypub/renderer/follow-user.ts | 2 +- src/remote/activitypub/renderer/follow.ts | 2 +- src/remote/activitypub/renderer/hashtag.ts | 2 +- src/remote/activitypub/renderer/index.ts | 4 ++-- src/remote/activitypub/renderer/key.ts | 2 +- src/remote/activitypub/renderer/like.ts | 2 +- src/remote/activitypub/renderer/mention.ts | 2 +- src/remote/activitypub/renderer/note.ts | 2 +- src/remote/activitypub/renderer/person.ts | 4 ++-- src/remote/activitypub/renderer/question.ts | 2 +- src/remote/activitypub/renderer/read.ts | 2 +- src/remote/activitypub/renderer/reject.ts | 2 +- src/remote/activitypub/renderer/remove.ts | 2 +- src/remote/activitypub/renderer/undo.ts | 2 +- src/remote/activitypub/renderer/update.ts | 2 +- src/remote/activitypub/renderer/vote.ts | 2 +- src/remote/activitypub/request.ts | 6 ++--- src/remote/activitypub/resolver.ts | 4 ++-- src/remote/resolve-user.ts | 4 ++-- src/remote/webfinger.ts | 2 +- src/server/activitypub.ts | 4 ++-- src/server/activitypub/featured.ts | 2 +- src/server/activitypub/followers.ts | 4 ++-- src/server/activitypub/following.ts | 4 ++-- src/server/activitypub/outbox.ts | 4 ++-- src/server/api/2fa.ts | 2 +- src/server/api/authenticate.ts | 2 +- .../api/common/generate-native-user-token.ts | 2 +- src/server/api/common/getters.ts | 2 +- .../api/common/read-messaging-message.ts | 2 +- src/server/api/common/signin.ts | 4 ++-- src/server/api/common/signup.ts | 4 ++-- src/server/api/define.ts | 2 +- src/server/api/endpoints.ts | 2 +- .../api/endpoints/admin/abuse-user-reports.ts | 2 +- .../endpoints/admin/announcements/create.ts | 2 +- .../endpoints/admin/announcements/delete.ts | 2 +- .../api/endpoints/admin/announcements/list.ts | 2 +- .../endpoints/admin/announcements/update.ts | 2 +- .../admin/delete-all-files-of-a-user.ts | 2 +- src/server/api/endpoints/admin/drive/files.ts | 2 +- .../api/endpoints/admin/drive/show-file.ts | 2 +- src/server/api/endpoints/admin/emoji/add.ts | 4 ++-- src/server/api/endpoints/admin/emoji/copy.ts | 4 ++-- .../api/endpoints/admin/emoji/list-remote.ts | 4 ++-- src/server/api/endpoints/admin/emoji/list.ts | 2 +- .../api/endpoints/admin/emoji/remove.ts | 2 +- .../api/endpoints/admin/emoji/update.ts | 2 +- .../refresh-remote-instance-metadata.ts | 2 +- .../admin/federation/update-instance.ts | 2 +- src/server/api/endpoints/admin/invite.ts | 2 +- .../api/endpoints/admin/moderators/add.ts | 2 +- .../api/endpoints/admin/moderators/remove.ts | 2 +- .../api/endpoints/admin/promo/create.ts | 2 +- .../api/endpoints/admin/reset-password.ts | 2 +- .../admin/resolve-abuse-user-report.ts | 2 +- .../endpoints/admin/show-moderation-logs.ts | 2 +- src/server/api/endpoints/admin/show-user.ts | 2 +- .../api/endpoints/admin/silence-user.ts | 2 +- .../api/endpoints/admin/suspend-user.ts | 2 +- .../api/endpoints/admin/unsilence-user.ts | 2 +- .../api/endpoints/admin/unsuspend-user.ts | 2 +- src/server/api/endpoints/admin/update-meta.ts | 4 ++-- .../api/endpoints/admin/update-remote-user.ts | 2 +- src/server/api/endpoints/announcements.ts | 2 +- src/server/api/endpoints/antennas/create.ts | 4 ++-- src/server/api/endpoints/antennas/delete.ts | 2 +- src/server/api/endpoints/antennas/notes.ts | 2 +- src/server/api/endpoints/antennas/show.ts | 2 +- src/server/api/endpoints/antennas/update.ts | 2 +- src/server/api/endpoints/ap/show.ts | 6 ++--- src/server/api/endpoints/app/create.ts | 4 ++-- src/server/api/endpoints/app/show.ts | 2 +- src/server/api/endpoints/auth/accept.ts | 4 ++-- .../api/endpoints/auth/session/generate.ts | 4 ++-- src/server/api/endpoints/blocking/create.ts | 2 +- src/server/api/endpoints/blocking/delete.ts | 2 +- src/server/api/endpoints/blocking/list.ts | 2 +- src/server/api/endpoints/channels/create.ts | 4 ++-- src/server/api/endpoints/channels/follow.ts | 4 ++-- src/server/api/endpoints/channels/followed.ts | 2 +- src/server/api/endpoints/channels/owned.ts | 2 +- src/server/api/endpoints/channels/show.ts | 2 +- src/server/api/endpoints/channels/timeline.ts | 2 +- src/server/api/endpoints/channels/unfollow.ts | 2 +- src/server/api/endpoints/channels/update.ts | 2 +- src/server/api/endpoints/charts/user/drive.ts | 2 +- .../api/endpoints/charts/user/following.ts | 2 +- src/server/api/endpoints/charts/user/notes.ts | 2 +- .../api/endpoints/charts/user/reactions.ts | 2 +- src/server/api/endpoints/clips/add-note.ts | 4 ++-- src/server/api/endpoints/clips/create.ts | 2 +- src/server/api/endpoints/clips/delete.ts | 2 +- src/server/api/endpoints/clips/notes.ts | 2 +- src/server/api/endpoints/clips/show.ts | 2 +- src/server/api/endpoints/clips/update.ts | 2 +- src/server/api/endpoints/drive.ts | 2 +- src/server/api/endpoints/drive/files.ts | 2 +- .../endpoints/drive/files/attached-notes.ts | 2 +- .../api/endpoints/drive/files/create.ts | 2 +- .../api/endpoints/drive/files/delete.ts | 2 +- src/server/api/endpoints/drive/files/find.ts | 2 +- src/server/api/endpoints/drive/files/show.ts | 2 +- .../api/endpoints/drive/files/update.ts | 2 +- .../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/delete.ts | 2 +- .../api/endpoints/drive/folders/find.ts | 2 +- .../api/endpoints/drive/folders/show.ts | 2 +- .../api/endpoints/drive/folders/update.ts | 2 +- src/server/api/endpoints/drive/stream.ts | 2 +- .../api/endpoints/federation/followers.ts | 2 +- .../api/endpoints/federation/following.ts | 2 +- .../api/endpoints/federation/instances.ts | 4 ++-- .../api/endpoints/federation/show-instance.ts | 4 ++-- src/server/api/endpoints/federation/users.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 +- .../api/endpoints/games/reversi/games.ts | 2 +- .../api/endpoints/games/reversi/games/show.ts | 2 +- .../games/reversi/games/surrender.ts | 2 +- .../api/endpoints/games/reversi/match.ts | 4 ++-- .../api/endpoints/get-online-users-count.ts | 2 +- src/server/api/endpoints/hashtags/show.ts | 2 +- src/server/api/endpoints/hashtags/trend.ts | 6 ++--- src/server/api/endpoints/hashtags/users.ts | 2 +- src/server/api/endpoints/i/2fa/key-done.ts | 2 +- .../api/endpoints/i/2fa/register-key.ts | 2 +- src/server/api/endpoints/i/2fa/register.ts | 2 +- src/server/api/endpoints/i/favorites.ts | 2 +- .../api/endpoints/i/import-following.ts | 2 +- .../api/endpoints/i/import-user-lists.ts | 2 +- src/server/api/endpoints/i/notifications.ts | 2 +- src/server/api/endpoints/i/page-likes.ts | 2 +- src/server/api/endpoints/i/pages.ts | 2 +- src/server/api/endpoints/i/pin.ts | 2 +- .../api/endpoints/i/read-announcement.ts | 4 ++-- src/server/api/endpoints/i/registry/set.ts | 2 +- src/server/api/endpoints/i/revoke-token.ts | 2 +- src/server/api/endpoints/i/signin-history.ts | 2 +- src/server/api/endpoints/i/unpin.ts | 2 +- src/server/api/endpoints/i/update-email.ts | 2 +- src/server/api/endpoints/i/update.ts | 8 +++---- .../api/endpoints/i/user-group-invites.ts | 2 +- .../api/endpoints/messaging/messages.ts | 2 +- .../endpoints/messaging/messages/create.ts | 2 +- .../endpoints/messaging/messages/delete.ts | 2 +- .../api/endpoints/messaging/messages/read.ts | 2 +- src/server/api/endpoints/meta.ts | 6 ++--- src/server/api/endpoints/miauth/gen-token.ts | 4 ++-- src/server/api/endpoints/mute/create.ts | 4 ++-- src/server/api/endpoints/mute/delete.ts | 2 +- src/server/api/endpoints/mute/list.ts | 2 +- src/server/api/endpoints/notes.ts | 2 +- src/server/api/endpoints/notes/children.ts | 2 +- src/server/api/endpoints/notes/clips.ts | 2 +- .../api/endpoints/notes/conversation.ts | 2 +- src/server/api/endpoints/notes/create.ts | 6 ++--- src/server/api/endpoints/notes/delete.ts | 2 +- .../api/endpoints/notes/favorites/create.ts | 4 ++-- .../api/endpoints/notes/favorites/delete.ts | 2 +- .../api/endpoints/notes/global-timeline.ts | 4 ++-- .../api/endpoints/notes/hybrid-timeline.ts | 4 ++-- .../api/endpoints/notes/local-timeline.ts | 4 ++-- src/server/api/endpoints/notes/mentions.ts | 2 +- src/server/api/endpoints/notes/polls/vote.ts | 4 ++-- 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/renotes.ts | 2 +- src/server/api/endpoints/notes/replies.ts | 2 +- .../api/endpoints/notes/search-by-tag.ts | 6 ++--- src/server/api/endpoints/notes/search.ts | 4 ++-- src/server/api/endpoints/notes/show.ts | 2 +- src/server/api/endpoints/notes/state.ts | 2 +- src/server/api/endpoints/notes/timeline.ts | 2 +- src/server/api/endpoints/notes/unrenote.ts | 2 +- .../api/endpoints/notes/user-list-timeline.ts | 2 +- .../api/endpoints/notes/watching/create.ts | 2 +- .../api/endpoints/notes/watching/delete.ts | 2 +- src/server/api/endpoints/page-push.ts | 2 +- src/server/api/endpoints/pages/create.ts | 4 ++-- src/server/api/endpoints/pages/delete.ts | 2 +- src/server/api/endpoints/pages/like.ts | 4 ++-- src/server/api/endpoints/pages/show.ts | 2 +- src/server/api/endpoints/pages/unlike.ts | 2 +- src/server/api/endpoints/pages/update.ts | 2 +- src/server/api/endpoints/pinned-users.ts | 4 ++-- src/server/api/endpoints/promo/read.ts | 4 ++-- src/server/api/endpoints/room/show.ts | 4 ++-- src/server/api/endpoints/sw/register.ts | 4 ++-- src/server/api/endpoints/users/clips.ts | 2 +- src/server/api/endpoints/users/followers.ts | 4 ++-- src/server/api/endpoints/users/following.ts | 4 ++-- .../users/get-frequently-replied-users.ts | 2 +- .../api/endpoints/users/groups/create.ts | 2 +- .../api/endpoints/users/groups/delete.ts | 2 +- .../users/groups/invitations/accept.ts | 4 ++-- .../users/groups/invitations/reject.ts | 2 +- .../api/endpoints/users/groups/invite.ts | 4 ++-- src/server/api/endpoints/users/groups/pull.ts | 2 +- src/server/api/endpoints/users/groups/show.ts | 2 +- .../api/endpoints/users/groups/transfer.ts | 2 +- .../api/endpoints/users/groups/update.ts | 2 +- .../api/endpoints/users/lists/create.ts | 2 +- .../api/endpoints/users/lists/delete.ts | 2 +- src/server/api/endpoints/users/lists/pull.ts | 2 +- src/server/api/endpoints/users/lists/push.ts | 2 +- src/server/api/endpoints/users/lists/show.ts | 2 +- .../api/endpoints/users/lists/update.ts | 2 +- src/server/api/endpoints/users/notes.ts | 2 +- src/server/api/endpoints/users/pages.ts | 2 +- src/server/api/endpoints/users/relation.ts | 2 +- .../api/endpoints/users/report-abuse.ts | 4 ++-- src/server/api/endpoints/users/show.ts | 2 +- src/server/api/endpoints/users/stats.ts | 2 +- src/server/api/limiter.ts | 2 +- src/server/api/openapi/description.ts | 2 +- src/server/api/openapi/gen-spec.ts | 2 +- src/server/api/openapi/schemas.ts | 2 +- src/server/api/private/signin.ts | 4 ++-- src/server/api/private/signup.ts | 4 ++-- src/server/api/service/discord.ts | 6 ++--- src/server/api/service/github.ts | 6 ++--- src/server/api/service/twitter.ts | 4 ++-- src/server/api/stream/channels/antenna.ts | 2 +- src/server/api/stream/channels/channel.ts | 2 +- .../api/stream/channels/global-timeline.ts | 6 ++--- src/server/api/stream/channels/hashtag.ts | 4 ++-- .../api/stream/channels/home-timeline.ts | 4 ++-- .../api/stream/channels/hybrid-timeline.ts | 6 ++--- .../api/stream/channels/local-timeline.ts | 6 ++--- src/server/api/stream/channels/user-list.ts | 2 +- src/server/file/send-drive-file.ts | 6 ++--- src/server/index.ts | 6 ++--- src/server/nodeinfo.ts | 4 ++-- src/server/proxy/proxy-media.ts | 6 ++--- src/server/web/feed.ts | 2 +- src/server/web/index.ts | 8 +++---- src/server/web/manifest.ts | 2 +- src/server/web/url-preview.ts | 6 ++--- src/server/well-known.ts | 6 ++--- src/services/add-note-to-antenna.ts | 4 ++-- src/services/blocking/create.ts | 2 +- .../chart/charts/classes/active-users.ts | 2 +- src/services/chart/charts/classes/drive.ts | 2 +- .../chart/charts/classes/federation.ts | 2 +- src/services/chart/charts/classes/hashtag.ts | 2 +- src/services/chart/charts/classes/instance.ts | 4 ++-- src/services/chart/charts/classes/network.ts | 2 +- src/services/chart/charts/classes/notes.ts | 2 +- .../chart/charts/classes/per-user-drive.ts | 2 +- .../charts/classes/per-user-following.ts | 2 +- .../chart/charts/classes/per-user-notes.ts | 2 +- .../charts/classes/per-user-reactions.ts | 2 +- .../chart/charts/classes/test-grouped.ts | 2 +- .../chart/charts/classes/test-unique.ts | 2 +- src/services/chart/charts/classes/test.ts | 2 +- src/services/chart/charts/classes/users.ts | 2 +- src/services/chart/core.ts | 4 ++-- src/services/chart/index.ts | 2 +- src/services/create-notification.ts | 2 +- src/services/create-system-user.ts | 4 ++-- src/services/drive/add-file.ts | 10 ++++----- src/services/drive/delete-file.ts | 4 ++-- src/services/drive/internal-storage.ts | 2 +- src/services/drive/s3.ts | 2 +- src/services/drive/upload-from-url.ts | 4 ++-- src/services/fetch-instance-metadata.ts | 4 ++-- src/services/following/create.ts | 6 ++--- src/services/following/requests/accept.ts | 2 +- src/services/following/requests/cancel.ts | 2 +- src/services/following/requests/create.ts | 2 +- src/services/i/pin.ts | 6 ++--- src/services/insert-moderation-log.ts | 2 +- src/services/instance-actor.ts | 2 +- src/services/logger.ts | 4 ++-- src/services/messages/create.ts | 2 +- src/services/messages/delete.ts | 2 +- src/services/note/create.ts | 22 +++++++++---------- src/services/note/delete.ts | 4 ++-- src/services/note/polls/vote.ts | 2 +- src/services/note/reaction/create.ts | 6 ++--- src/services/note/reaction/delete.ts | 4 ++-- src/services/note/read.ts | 4 ++-- src/services/note/unread.ts | 2 +- src/services/note/watch.ts | 2 +- src/services/push-notification.ts | 4 ++-- .../register-or-fetch-instance-doc.ts | 6 ++--- src/services/relay.ts | 2 +- src/services/send-email-notification.ts | 2 +- src/services/send-email.ts | 4 ++-- src/services/stream.ts | 2 +- src/services/suspend-user.ts | 2 +- src/services/unsuspend-user.ts | 2 +- src/services/update-hashtag.ts | 4 ++-- src/services/user-list/push.ts | 4 ++-- src/tools/accept-migration.ts | 2 +- src/tools/add-emoji.ts | 2 +- src/tools/resync-remote-user.ts | 2 +- 391 files changed, 557 insertions(+), 557 deletions(-) diff --git a/src/argv.ts b/src/argv.ts index a92338f867..9c69a450db 100644 --- a/src/argv.ts +++ b/src/argv.ts @@ -1,5 +1,5 @@ import * as program from 'commander'; -import config from './config'; +import config from '@/config'; program .version(config.version) diff --git a/src/boot/master.ts b/src/boot/master.ts index 33ccec55d0..ef8692b308 100644 --- a/src/boot/master.ts +++ b/src/boot/master.ts @@ -6,11 +6,11 @@ import * as isRoot from 'is-root'; import { getConnection } from 'typeorm'; import Logger from '../services/logger'; -import loadConfig from '../config/load'; -import { Config } from '../config/types'; +import loadConfig from '@/config/load'; +import { Config } from '@/config/types'; import { lessThan } from '../prelude/array'; import { program } from '../argv'; -import { showMachineInfo } from '../misc/show-machine-info'; +import { showMachineInfo } from '@/misc/show-machine-info'; import { initDb } from '../db/postgre'; const meta = require('../meta.json'); diff --git a/src/client/components/autocomplete.vue b/src/client/components/autocomplete.vue index 2014c710a5..35cfb77301 100644 --- a/src/client/components/autocomplete.vue +++ b/src/client/components/autocomplete.vue @@ -29,9 +29,9 @@