refactor: Tweak path alias of client

This commit is contained in:
syuilo
2021-03-23 17:30:14 +09:00
parent 8432c2c9ea
commit d6e23b803b
338 changed files with 1234 additions and 1229 deletions

View File

@ -1,6 +1,6 @@
import { utils, values } from '@syuilo/aiscript';
import * as os from '@/os';
import { $i } from '@/account';
import * as os from '@client/os';
import { $i } from '@client/account';
export function createAiScriptEnv(opts) {
let apiRequests = 0;

View File

@ -1,7 +1,7 @@
import { Ref, ref } from 'vue';
import * as getCaretCoordinates from 'textarea-caret';
import { toASCII } from 'punycode';
import { popup } from '@/os';
import { popup } from '@client/os';
export class Autocomplete {
private suggestion: {
@ -150,7 +150,7 @@ export class Autocomplete {
const _y = ref(y);
const _q = ref(q);
const { dispose } = await popup(import('@/components/autocomplete.vue'), {
const { dispose } = await popup(import('@client/components/autocomplete.vue'), {
textarea: this.textarea,
close: this.close,
type: type,

View File

@ -1,5 +1,5 @@
import parseAcct from '../../misc/acct/parse';
import { host as localHost } from '@/config';
import { host as localHost } from '@client/config';
export async function genSearchQuery(v: any, q: string) {
let host: string;

View File

@ -1,4 +1,4 @@
import { url as instanceUrl } from '@/config';
import { url as instanceUrl } from '@client/config';
import * as url from '../../prelude/url';
export function getStaticImageUrl(baseUrl: string): string {

View File

@ -1,13 +1,13 @@
import { faAt, faListUl, faEye, faEyeSlash, faBan, faPencilAlt, faComments, faUsers, faMicrophoneSlash, faPlug, faExclamationCircle } from '@fortawesome/free-solid-svg-icons';
import { faSnowflake, faEnvelope } from '@fortawesome/free-regular-svg-icons';
import { i18n } from '@/i18n';
import copyToClipboard from '@/scripts/copy-to-clipboard';
import { host } from '@/config';
import { i18n } from '@client/i18n';
import copyToClipboard from '@client/scripts/copy-to-clipboard';
import { host } from '@client/config';
import getAcct from '../../misc/acct/render';
import * as os from '@/os';
import { userActions } from '@/store';
import { router } from '@/router';
import { $i } from '@/account';
import * as os from '@client/os';
import { userActions } from '@client/store';
import { router } from '@client/router';
import { $i } from '@client/account';
export function getUserMenu(user) {
const meId = $i ? $i.id : null;
@ -104,7 +104,7 @@ export function getUserMenu(user) {
}
function reportAbuse() {
os.popup(import('@/components/abuse-report-window.vue'), {
os.popup(import('@client/components/abuse-report-window.vue'), {
user: user,
}, {}, 'closed');
}

View File

@ -1,11 +1,11 @@
import autobind from 'autobind-decorator';
import { PageVar, envVarsDef, Fn, HpmlScope, HpmlError } from '.';
import { version } from '@/config';
import { version } from '@client/config';
import { AiScript, utils, values } from '@syuilo/aiscript';
import { createAiScriptEnv } from '../aiscript/api';
import { collectPageVars } from '../collect-page-vars';
import { initHpmlLib, initAiLib } from './lib';
import * as os from '@/os';
import * as os from '@client/os';
import { markRaw, ref, Ref, unref } from 'vue';
import { Expr, isLiteralValue, Variable } from './expr';

View File

@ -1,7 +1,7 @@
import { instance } from '@/instance';
import { $i } from '@/account';
import { api } from '@/os';
import { lang } from '@/config';
import { instance } from '@client/instance';
import { $i } from '@client/account';
import { api } from '@client/os';
import { lang } from '@client/config';
export async function initializeSw() {
if (instance.swPublickey &&

View File

@ -1,5 +1,5 @@
import { markRaw } from 'vue';
import * as os from '@/os';
import * as os from '@client/os';
import { onScrollTop, isTopVisible, getScrollPosition, getScrollContainer } from './scroll';
const SECOND_FETCH_LIMIT = 30;

View File

@ -1,6 +1,6 @@
import { $i } from '@/account';
import { i18n } from '@/i18n';
import { dialog } from '@/os';
import { $i } from '@client/account';
import { i18n } from '@client/i18n';
import { dialog } from '@client/os';
export function pleaseLogin() {
if ($i) return;

View File

@ -1,4 +1,4 @@
import * as config from '@/config';
import * as config from '@client/config';
export function popout(path: string, w?: HTMLElement) {
let url = path.startsWith('http://') || path.startsWith('https://') ? path : config.url + path;

View File

@ -1,5 +1,5 @@
import { Ref, ref } from 'vue';
import { popup } from '@/os';
import { popup } from '@client/os';
class ReactionPicker {
private src: Ref<HTMLElement | null> = ref(null);
@ -12,7 +12,7 @@ class ReactionPicker {
}
public async init() {
await popup(import('@/components/emoji-picker-dialog.vue'), {
await popup(import('@client/components/emoji-picker-dialog.vue'), {
src: this.src,
asReactionPicker: true,
manualShowing: this.manualShowing

View File

@ -1,7 +1,7 @@
import { faHistory } from '@fortawesome/free-solid-svg-icons';
import * as os from '@/os';
import { i18n } from '@/i18n';
import { router } from '@/router';
import * as os from '@client/os';
import { i18n } from '@client/i18n';
import { router } from '@client/router';
export async function search() {
const { canceled, result: query } = await os.dialog({

View File

@ -1,6 +1,6 @@
import { faUpload, faCloud, faLink } from '@fortawesome/free-solid-svg-icons';
import * as os from '@/os';
import { i18n } from '@/i18n';
import * as os from '@client/os';
import { i18n } from '@client/i18n';
export function selectFile(src: any, label: string | null, multiple = false) {
return new Promise((res, rej) => {

View File

@ -1,4 +1,4 @@
import { ColdDeviceStorage } from '@/store';
import { ColdDeviceStorage } from '@client/store';
const cache = new Map<string, HTMLAudioElement>();

View File

@ -2,7 +2,7 @@ import autobind from 'autobind-decorator';
import { EventEmitter } from 'eventemitter3';
import ReconnectingWebsocket from 'reconnecting-websocket';
import { markRaw } from 'vue';
import { debug, wsUrl } from '@/config';
import { debug, wsUrl } from '@client/config';
import { query as urlQuery } from '../../prelude/url';
/**