pl-fe: change import alias so it won't change on each project rename
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { selectAccount, selectOwnAccount } from 'pl-fe/selectors';
|
||||
import { selectAccount, selectOwnAccount } from '@/selectors';
|
||||
|
||||
import type { RootState } from 'pl-fe/store';
|
||||
import type { RootState } from '@/store';
|
||||
|
||||
const validId = (id: any) => typeof id === 'string' && id !== 'null' && id !== 'undefined';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { buildAccount } from 'pl-fe/jest/factory';
|
||||
import { buildAccount } from '@/jest/factory';
|
||||
|
||||
import {
|
||||
tagToBadge,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { buildAccount } from 'pl-fe/jest/factory';
|
||||
import { normalizeChatMessage } from 'pl-fe/normalizers/chat-message';
|
||||
import { ChatKeys, IChat } from 'pl-fe/queries/chats';
|
||||
import { queryClient } from 'pl-fe/queries/client';
|
||||
import { buildAccount } from '@/jest/factory';
|
||||
import { normalizeChatMessage } from '@/normalizers/chat-message';
|
||||
import { ChatKeys, IChat } from '@/queries/chats';
|
||||
import { queryClient } from '@/queries/client';
|
||||
|
||||
import { updateChatMessage } from './chats';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import sumBy from 'lodash/sumBy';
|
||||
|
||||
import { normalizeChatMessage } from 'pl-fe/normalizers/chat-message';
|
||||
import { ChatKeys } from 'pl-fe/queries/chats';
|
||||
import { queryClient } from 'pl-fe/queries/client';
|
||||
import { normalizeChatMessage } from '@/normalizers/chat-message';
|
||||
import { ChatKeys } from '@/queries/chats';
|
||||
import { queryClient } from '@/queries/client';
|
||||
|
||||
import { compareDate } from './comparators';
|
||||
import { appendPageItem, flattenPages, sortQueryData, updatePageItem } from './queries';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import KVStore from 'pl-fe/storage/kv-store';
|
||||
import KVStore from '@/storage/kv-store';
|
||||
|
||||
type DomainCapabilities = {
|
||||
lastChecked: number;
|
||||
|
||||
@@ -25,7 +25,7 @@ SOFTWARE.
|
||||
// Adapted from:
|
||||
// https://github.com/javisperez/tailwindcolorshades/blob/master/src/composables/colors.ts
|
||||
|
||||
import type { Rgb, TailwindColorObject } from 'pl-fe/types/colors';
|
||||
import type { Rgb, TailwindColorObject } from '@/types/colors';
|
||||
|
||||
const hexToRgb = (hex: string): Rgb | null => {
|
||||
const sanitizedHex = hex.replace(/##/g, '#');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { List as ImmutableList, fromJS } from 'immutable';
|
||||
|
||||
import config_db from 'pl-fe/__fixtures__/config_db.json';
|
||||
import config_db from '@/__fixtures__/config_db.json';
|
||||
|
||||
import { ConfigDB } from './config-db';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import trimStart from 'lodash/trimStart';
|
||||
import * as v from 'valibot';
|
||||
|
||||
import { mrfSimpleSchema, type MRFSimple } from 'pl-fe/schemas/pleroma';
|
||||
import { mrfSimpleSchema, type MRFSimple } from '@/schemas/pleroma';
|
||||
|
||||
import type { PleromaConfig } from 'pl-api';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
|
||||
import { render, screen } from 'pl-fe/jest/test-helpers';
|
||||
import { render, screen } from '@/jest/test-helpers';
|
||||
|
||||
import { isIntegerId, shortNumberFormat } from './numbers';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { InfiniteData } from '@tanstack/react-query';
|
||||
|
||||
import { queryClient } from 'pl-fe/queries/client';
|
||||
import { queryClient } from '@/queries/client';
|
||||
|
||||
import { PaginatedResult, sortQueryData, updatePageItem } from './queries';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { queryClient } from 'pl-fe/queries/client';
|
||||
import { queryClient } from '@/queries/client';
|
||||
|
||||
import type { InfiniteData, QueryKey } from '@tanstack/react-query';
|
||||
import type { PaginatedResponse } from 'pl-api';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getFeatures, HOLLO, ICESHRIMP_NET, PLEROMA, TOKI, type Instance } from 'pl-api';
|
||||
|
||||
import type { RootState } from 'pl-fe/store';
|
||||
import type { RootState } from '@/store';
|
||||
|
||||
/**
|
||||
* Get the OAuth scopes to use for login & signup.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import boopMp3 from 'pl-fe/assets/sounds/boop.mp3';
|
||||
import boopOgg from 'pl-fe/assets/sounds/boop.ogg';
|
||||
import chatMp3 from 'pl-fe/assets/sounds/chat.mp3';
|
||||
import chatOgg from 'pl-fe/assets/sounds/chat.ogg';
|
||||
import boopMp3 from '@/assets/sounds/boop.mp3';
|
||||
import boopOgg from '@/assets/sounds/boop.ogg';
|
||||
import chatMp3 from '@/assets/sounds/chat.mp3';
|
||||
import chatOgg from '@/assets/sounds/chat.ogg';
|
||||
|
||||
/** pl-fe audio clip. */
|
||||
interface Sound {
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
* @module pl-fe/utils/state
|
||||
*/
|
||||
|
||||
import { getPlFeConfig } from 'pl-fe/actions/pl-fe';
|
||||
import * as BuildConfig from 'pl-fe/build-config';
|
||||
import { isPrerendered } from 'pl-fe/precheck';
|
||||
import { selectOwnAccount } from 'pl-fe/selectors';
|
||||
import { isURL } from 'pl-fe/utils/auth';
|
||||
import { getPlFeConfig } from '@/actions/pl-fe';
|
||||
import * as BuildConfig from '@/build-config';
|
||||
import { isPrerendered } from '@/precheck';
|
||||
import { selectOwnAccount } from '@/selectors';
|
||||
import { isURL } from '@/utils/auth';
|
||||
|
||||
import type { RootState } from 'pl-fe/store';
|
||||
import type { RootState } from '@/store';
|
||||
|
||||
/** Whether to display the fqn instead of the acct. */
|
||||
const displayFqn = (state: RootState): boolean => getPlFeConfig(state).displayFqn;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { join } from 'path-browserify';
|
||||
|
||||
import * as BuildConfig from 'pl-fe/build-config';
|
||||
import * as BuildConfig from '@/build-config';
|
||||
|
||||
/** Gets the path to a file with build configuration being considered. */
|
||||
const joinPublicPath = (...paths: string[]): string => join(BuildConfig.FE_SUBDIRECTORY, ...paths);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { buildStatus } from 'pl-fe/jest/factory';
|
||||
import { buildStatus } from '@/jest/factory';
|
||||
|
||||
import {
|
||||
hasIntegerMediaIds,
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
|
||||
describe('hasIntegerMediaIds()', () => {
|
||||
it('returns true for a Pleroma deleted status', async () => {
|
||||
const status = buildStatus(await import('pl-fe/__fixtures__/pleroma-status-deleted.json') as any);
|
||||
const status = buildStatus(await import('@/__fixtures__/pleroma-status-deleted.json') as any);
|
||||
expect(hasIntegerMediaIds(status)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { isIntegerId } from 'pl-fe/utils/numbers';
|
||||
import { isIntegerId } from '@/utils/numbers';
|
||||
|
||||
import type { Status } from 'pl-fe/normalizers/status';
|
||||
import type { Status } from '@/normalizers/status';
|
||||
import type { IntlShape } from 'react-intl';
|
||||
|
||||
/** Get the initial visibility of media attachments from user settings. */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import tintify from 'pl-fe/utils/colors';
|
||||
import { generateAccent, generateNeutral } from 'pl-fe/utils/theme';
|
||||
import tintify from '@/utils/colors';
|
||||
import { generateAccent, generateNeutral } from '@/utils/theme';
|
||||
|
||||
import type { TailwindColorPalette } from 'pl-fe/types/colors';
|
||||
import type { TailwindColorPalette } from '@/types/colors';
|
||||
|
||||
type PlFeColors = Record<string, Record<string, string>>;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { hexToRgb } from './colors';
|
||||
|
||||
import type { Rgb, Hsl, TailwindColorPalette, TailwindColorObject } from 'pl-fe/types/colors';
|
||||
import type { Rgb, Hsl, TailwindColorPalette, TailwindColorObject } from '@/types/colors';
|
||||
|
||||
// Taken from chromatism.js
|
||||
// https://github.com/graypegg/chromatism/blob/master/src/conversions/rgb.js
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { fromJS } from 'immutable';
|
||||
|
||||
import { buildStatus } from 'pl-fe/jest/factory';
|
||||
import { buildStatus } from '@/jest/factory';
|
||||
|
||||
import { shouldFilter } from './timelines';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Settings } from 'pl-fe/schemas/pl-fe/settings';
|
||||
import { Settings } from '@/schemas/pl-fe/settings';
|
||||
|
||||
import type { Status } from 'pl-fe/normalizers/status';
|
||||
import type { Status } from '@/normalizers/status';
|
||||
|
||||
const shouldFilter = (
|
||||
status: Pick<Status, 'in_reply_to_id' | 'visibility' | 'reblog_id'>,
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
// I hope I got this relicensing stuff right xD
|
||||
import { mappings, URLPurify, type SerializedRules, type SerializedServices } from '@mkljczk/url-purify';
|
||||
|
||||
import KVStore from 'pl-fe/storage/kv-store';
|
||||
import { Me } from 'pl-fe/types/pl-fe';
|
||||
import KVStore from '@/storage/kv-store';
|
||||
import { Me } from '@/types/pl-fe';
|
||||
|
||||
interface KVStoreRulesItem {
|
||||
hashUrl?: string;
|
||||
|
||||
Reference in New Issue
Block a user