51cb05f418
Project CI / AI game creator shell Rust crates (push) Successful in 5m56s
Project CI / AI game creator shell Rust lane 2/2 (push) Successful in 6m36s
Project CI / AI game creator shell Rust lane 1/2 (push) Successful in 7m37s
Project CI / Backend tests (push) Successful in 9m22s
Project CI / Frontend tests (push) Successful in 4m40s
Project CI / AI game creator shell web tests (push) Successful in 3m50s
Project CI / Repository checks (push) Successful in 6m30s
Project CI / Native shell tests (push) Successful in 8m32s
本 PR 补齐创作者主页与关注粉丝功能的产品合同和工程设计,供后续按里程碑实施;本次只修改文档。 桌面导航第四项进入自己的创作者主页,“我的”移到第五项。游戏详情可进入作者主页并关注/取消关注;自己或他人的关注、粉丝列表均公开可查看,点击用户头像或昵称可进入其主页。本人支持取消/重新关注、回关和移除粉丝,并明确两个关注方向独立。 工程设计包含关系表与 DTO、认证和事务边界、跨页状态同步、共享组件、深链及验收要求,拆分关系查询和页面交互两个里程碑。按用户要求,游戏列表沿用最多 48 项的现有限制,不增加游戏目录分页改造。 验证: - 已合入最新 origin/master(21c79f54a);共享决策记录冲突保留双方新增内容。 - npm run check:encoding 通过。 - npm run check:doc-index 通过。 - git diff --check 与暂存差异检查通过。 - 相对 master 仅六份文档发生变化;没有业务代码或 schema 修改,未执行业务测试或部署。 Reviewed-on: #638 Co-authored-by: Linghong <ink29535@proton.me> Co-committed-by: Linghong <ink29535@proton.me>
190 lines
7.5 KiB
TypeScript
190 lines
7.5 KiB
TypeScript
import { createRequire } from 'node:module';
|
|
import path from 'node:path';
|
|
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
const aiGameCreatorRequire = createRequire(
|
|
path.resolve(__dirname, 'apps/ai-game-creator-shell/package.json'),
|
|
);
|
|
const reactFileManagerPackageRoot = path.dirname(
|
|
aiGameCreatorRequire.resolve('@cubone/react-file-manager/package.json'),
|
|
);
|
|
|
|
export default defineConfig({
|
|
resolve: {
|
|
alias: [
|
|
{
|
|
find: /^@genarrative\/shared\/components$/,
|
|
replacement: path.resolve(
|
|
__dirname,
|
|
'packages/shared/src/components/index.ts',
|
|
),
|
|
},
|
|
{
|
|
find: /^@cubone\/react-file-manager$/,
|
|
replacement: path.resolve(
|
|
reactFileManagerPackageRoot,
|
|
'dist/react-file-manager.es.js',
|
|
),
|
|
},
|
|
// Keep shared components' application-root imports resolvable in tests.
|
|
{ find: '@', replacement: path.resolve(__dirname, '.') },
|
|
// worktree 复用依赖时,共享包仍须解析到当前检出的源码。
|
|
{
|
|
find: '@genarrative/shared/components/account',
|
|
replacement: path.resolve(
|
|
__dirname,
|
|
'packages/shared/src/components/account.ts',
|
|
),
|
|
},
|
|
{
|
|
find: '@genarrative/shared/components',
|
|
replacement: path.resolve(__dirname, 'packages/shared/src/components'),
|
|
},
|
|
{
|
|
find: '@genarrative/shared/lib',
|
|
replacement: path.resolve(__dirname, 'packages/shared/src/lib'),
|
|
},
|
|
{
|
|
find: /^@genarrative\/shared$/,
|
|
replacement: path.resolve(__dirname, 'packages/shared/src/index.ts'),
|
|
},
|
|
{
|
|
find: '@genarrative/image-canvas-core',
|
|
replacement: path.resolve(
|
|
__dirname,
|
|
'packages/image-canvas-core/src/index.ts',
|
|
),
|
|
},
|
|
{
|
|
find: '@genarrative/image-canvas-react',
|
|
replacement: path.resolve(
|
|
__dirname,
|
|
'packages/image-canvas-react/src/index.ts',
|
|
),
|
|
},
|
|
// The standalone AI shell owns its Tauri guest dependencies. Root tests
|
|
// use inert aliases so the root H5 package keeps the HostBridge boundary.
|
|
{
|
|
find: '@tauri-apps/plugin-clipboard-manager',
|
|
replacement: path.resolve(
|
|
__dirname,
|
|
'apps/ai-game-creator-shell/tests/tauri-plugin-clipboard-manager.mock.ts',
|
|
),
|
|
},
|
|
{
|
|
find: '@tauri-apps/plugin-opener',
|
|
replacement: path.resolve(
|
|
__dirname,
|
|
'apps/ai-game-creator-shell/tests/tauri-plugin-opener.mock.ts',
|
|
),
|
|
},
|
|
// Keep every workspace test on the root install's single React renderer.
|
|
{
|
|
find: 'react',
|
|
replacement: path.resolve(__dirname, 'node_modules/react'),
|
|
},
|
|
{
|
|
find: 'react-dom',
|
|
replacement: path.resolve(__dirname, 'node_modules/react-dom'),
|
|
},
|
|
],
|
|
dedupe: ['react', 'react-dom', 'zustand'],
|
|
},
|
|
test: {
|
|
environment: 'node',
|
|
globals: true,
|
|
// 成功用例不回放被测代码写进 stdout / stderr 的内容:CI 日志里只保留每个
|
|
// 失败用例的断言摘要,避免 React act 警告、dev 调度日志这类噪音刷屏。
|
|
// 需要在本机排查时用 `vitest run --silent=false` 覆盖本次配置。
|
|
silent: true,
|
|
minThreads: 1,
|
|
maxThreads: 8,
|
|
server: {
|
|
deps: {
|
|
inline: [
|
|
/apps\/ai-game-creator-shell\/node_modules\//,
|
|
/node_modules\/@cubone\/react-file-manager/,
|
|
],
|
|
},
|
|
},
|
|
include: [
|
|
'src/index.test.ts',
|
|
'src/config/**/*.test.ts',
|
|
'src/routing/activeAppPageRoutes.test.ts',
|
|
'src/routing/activeAppRoutes.test.ts',
|
|
'src/routing/RouteImageReadyGate.test.ts',
|
|
'src/persistence/**/*.test.ts',
|
|
'src/editor/shared/jsonClient.test.ts',
|
|
'src/services/activeAppTitle.test.ts',
|
|
'src/services/gameDistributionClient.test.ts',
|
|
'src/services/creatorProfileClient.test.ts',
|
|
'src/components/creator/**/*.test.ts',
|
|
'src/components/creator/**/*.test.tsx',
|
|
'src/services/assetReadUrlService.test.ts',
|
|
'src/services/authService.test.ts',
|
|
'src/services/apiClient.test.ts',
|
|
'src/services/clipboard.test.ts',
|
|
'src/services/frontendRuntimeConfigService.test.ts',
|
|
'src/services/sseStream.test.ts',
|
|
'src/services/host-bridge/**/*.test.ts',
|
|
'src/services/image-editor/**/*.test.ts',
|
|
'src/services/external-generation/**/*.test.ts',
|
|
'src/services/payment/**/*.test.ts',
|
|
'src/services/platform-entry/platformProfileClient.test.ts',
|
|
'src/stores/**/*.test.ts',
|
|
'src/stores/**/*.test.tsx',
|
|
'src/components/auth/**/*.test.ts',
|
|
'src/components/auth/**/*.test.tsx',
|
|
'src/components/creation-home/**/*.test.ts',
|
|
'src/components/creation-home/**/*.test.tsx',
|
|
'src/components/game-distribution/**/*.test.ts',
|
|
'src/components/game-distribution/**/*.test.tsx',
|
|
'src/components/shared-components/**/*.test.tsx',
|
|
'src/components/common/AutoGrowTextArea.test.tsx',
|
|
'src/components/common/CreativeImageInputPanel.test.tsx',
|
|
'src/components/common/PlatformDangerConfirmDialog.test.tsx',
|
|
'src/components/common/PlatformFloatingMenu.test.tsx',
|
|
'src/components/common/PlatformImagePreviewModal.test.tsx',
|
|
'src/components/common/PlatformReportDialog.test.tsx',
|
|
'src/components/common/PlatformUtilityInfoModal.test.tsx',
|
|
'src/components/common/PublishShareModal.test.tsx',
|
|
'src/components/image-editor/**/*.test.ts',
|
|
'src/components/image-editor/**/*.test.tsx',
|
|
'src/components/project/**/*.test.ts',
|
|
'src/components/project/**/*.test.tsx',
|
|
'src/components/platform-entry/PlatformActiveMobileWelcomeDialog.test.tsx',
|
|
'src/components/platform-entry/PlatformActiveProfileView.test.tsx',
|
|
'src/components/platform-entry/PlatformEntryActiveFlowShell.test.tsx',
|
|
'src/components/platform-entry/PlatformProfileModalShell.test.tsx',
|
|
'src/components/platform-entry/PlatformProfileReferralModal.test.tsx',
|
|
'src/components/platform-entry/PlatformProfileRewardCodeRedeemModal.test.tsx',
|
|
'src/components/platform-entry/platformProfile*.test.ts',
|
|
'src/components/platform-entry/usePlatformProfileCenterController*.test.tsx',
|
|
'src/components/platform-entry/PlatformProfilePrimitives.test.tsx',
|
|
'src/hooks/useHostNavigationCanGoBack.test.tsx',
|
|
'src/hooks/useResolvedAssetReadUrl.test.tsx',
|
|
'apps/admin-web/src/**/*.test.ts',
|
|
'apps/admin-web/src/**/*.test.tsx',
|
|
'apps/ai-game-creator-shell/tests/**/*.test.ts',
|
|
'apps/ai-game-creator-shell/tests/**/*.test.tsx',
|
|
'apps/ai-game-creator-shell/src/features/ui-editor/utils/transform/tf2css.test.tsx',
|
|
// DirectProject 会话滚动的判据与 hook 与实现同目录:改滚动契约时用例就在旁边。
|
|
'apps/ai-game-creator-shell/src/view/project-development/chat/**/*.test.ts',
|
|
'apps/ai-game-creator-shell/src/view/project-development/chat/**/*.test.tsx',
|
|
'miniprogram/**/*.test.js',
|
|
'scripts/**/*.test.ts',
|
|
'packages/shared/src/contracts/*.test.ts',
|
|
'packages/shared/src/theme.test.ts',
|
|
'packages/shared/src/components/**/*.test.ts',
|
|
'packages/shared/src/components/**/*.test.tsx',
|
|
'packages/shared/src/stores/**/*.test.ts',
|
|
'packages/shared/src/utils/**/*.test.ts',
|
|
'packages/image-canvas-core/src/**/*.test.ts',
|
|
'packages/image-canvas-react/src/**/*.test.ts',
|
|
'packages/image-canvas-react/src/**/*.test.tsx',
|
|
'packages/agc-plugin-sdk/src/**/*.test.ts',
|
|
],
|
|
},
|
|
});
|