use import { formatMudPointCount } from '@genarrative/shared' style

This commit is contained in:
2026-07-13 18:48:58 +08:00
parent a3034b1d51
commit e6d0ccc243
9 changed files with 17 additions and 8 deletions
+5 -1
View File
@@ -2,5 +2,9 @@
"name": "@genarrative/shared",
"private": true,
"version": "0.1.0",
"type": "module"
"type": "module",
"exports": {
".": "./src/index.ts"
},
"types": "./src/index.ts"
}
@@ -4,7 +4,7 @@ import { act, fireEvent, render, screen, within } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { expect, test, vi } from 'vitest';
import { formatMudPointCount } from '../index';
import { formatMudPointCount } from '@genarrative/shared';
import { PlatformMudPointWalletEntry } from './PlatformMudPointWalletEntry.tsx';
const breakdown = {
@@ -8,9 +8,9 @@ import {
useState,
} from 'react';
import type { ProfileMudPointBalance } from '@/packages/shared/src';
import MUD_POINT_ICON_SRC from '@/packages/shared/src/icons/topbar-wallet.png';
import { formatMudPointCount } from '@/packages/shared/src/utils/format';
import type { ProfileMudPointBalance } from '../index';
import MUD_POINT_ICON_SRC from '../icons/topbar-wallet.png';
import { formatMudPointCount } from '../utils/format';
export type PlatformMudPointWalletEntryProps = {
balance: number | null;
@@ -8,7 +8,7 @@ import {
} from 'lucide-react';
import type { ProfileMudPointBalance } from '../../../packages/shared/src/contracts/runtime';
import { PlatformMudPointWalletEntry } from '@/packages/shared/src';
import { PlatformMudPointWalletEntry } from '@genarrative/shared';
import { PlatformStatusMessage } from '../common/PlatformStatusMessage';
import { PlatformTextField } from '../common/PlatformTextField';
import { EditorIconButton } from './ImageCanvasEditorPrimitives';
@@ -15,7 +15,7 @@ import { PlatformSubpanel } from '../common/PlatformSubpanel';
import { formatRechargePrice } from '../rpg-entry/rpgEntryProfileFundsViewModel';
import { PlatformProfileModalShell } from './PlatformProfileModalShell';
import type { NativeWechatPaymentState } from './usePlatformProfileCenterController';
import { formatMudPointCount } from '@/packages/shared/src';
import { formatMudPointCount } from '@genarrative/shared';
const WECHAT_NATIVE_PAY_QR_IMAGE_SIZE = 180;
export type PlatformProfileRechargeModalProps = {
@@ -89,7 +89,7 @@ import { PlatformAsyncStatePanel } from '../common/PlatformAsyncStatePanel';
import { PlatformEmptyState } from '../common/PlatformEmptyState';
import { PlatformFilterToolbar } from '../common/PlatformFilterToolbar';
import { PlatformIconButton } from '../common/PlatformIconButton';
import { PlatformMudPointWalletEntry } from '@/packages/shared/src';
import { PlatformMudPointWalletEntry } from '@genarrative/shared';
import { PlatformNavigableListItem } from '../common/PlatformNavigableListItem';
import { PlatformPillBadge } from '../common/PlatformPillBadge';
import {
+3
View File
@@ -19,6 +19,9 @@
"paths": {
"@/*": [
"./*"
],
"@genarrative/shared": [
"./packages/shared/src/index.ts"
]
},
"allowImportingTsExtensions": true,
+1
View File
@@ -53,6 +53,7 @@ export default defineConfig(({mode}) => {
resolve: {
alias: {
'@': path.resolve(__dirname, '.'),
'@genarrative/shared': path.resolve(__dirname, 'packages/shared/src/index.ts'),
},
},
optimizeDeps: {
+1
View File
@@ -7,6 +7,7 @@ export default defineConfig({
alias: {
// Keep shared components' application-root imports resolvable in tests.
'@': path.resolve(__dirname, '.'),
'@genarrative/shared': path.resolve(__dirname, 'packages/shared/src/index.ts'),
},
},
test: {