Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,4 @@ apps/web/src/lib/boot/mobile-plugin-server-registry.generated.ts
apps/web/src/lib/server/plugin-server-loader.generated.ts
apps/web/src/routes/api/plugins/
apps/mobile/android/app/src/main/res/mipmap-*/ic_launcher*.png
.vitest/
11 changes: 9 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!--VITE PLUS START-->
<!--VITE PLUS MANAGE CONTENT, DON'T EDIT MANUALLY-->

# Using Vite+, the Unified Toolchain for the Web

Expand Down Expand Up @@ -47,15 +48,21 @@ Be concise. Do not write unsolicited "WHY" explanations. Required declarations (

## 未发布阶段的数据契约

产品尚未发布:Chronos 自有数据库、数据结构与线格式版本固定为 `1`。直接维护唯一当前结构,不新增升级链、旧格式分支、兼容别名或旧数据补迁移。开发数据失效时手动清空并重新导入,不在启动时自动删除。此约定不改变产品发布号、随宿主发布的插件版本、第三方依赖或外部标准版本。
Chronos 目前尚未发布,保持自有数据库、数据结构与线格式版本固定为 `1`。直接维护唯一当前结构,不新增升级链、旧格式分支、兼容别名或旧数据补迁移。开发数据失效时手动清空并重新导入,不在启动时自动删除。此约定不改变产品发布号、随宿主发布的插件版本、第三方依赖或外部标准版本。

## Commit Convention

Use Gitmoji format: `<emoji> <concise Chinese>` (no `feat:`/`fix:` prefix). e.g., `✨ 新增课表导出功能`.
Do not commit / push unless explicitly requested; reporting completion ≠ committing.

## Branch, Commit, and PR Contracts

- Keep each commit focused on one logical change and follow the Commit Convention above.
- When a larger change can be split into independently reviewable layers and an upper layer depends on lower-layer work that is not merged yet, prefer stacked pull requests: target the bottom pull request at the trunk and each higher pull request at the immediately preceding branch. Keep unrelated changes in separate pull requests targeting the appropriate trunk; all branches in a stack must belong to the same repository.
- Pull request titles do not need Gitmoji. Use `.github/pull_request_template.md` for descriptions and omit the release-notes section for non-release pull requests.

## Validation

Canonical commands are `vp run check` and `vp run test` (see `CONTRIBUTING.md`; `vite.config.ts` tasks wrap `vp check` / `vp test` with `svelte-kit sync` / cwd). Run scoped single-file tests during iteration, full suite once at the end; docs-only changes may skip tests with a note. Run `vp install` only when deps / manifest changed or install is stale. On env issues run `vp env doctor`, attempt the obvious fix first, and only ask for help if still blocked.
Canonical commands are `vp run check` and `vp run test` (see `CONTRIBUTING.md`; the `vite.config.ts` tasks perform project-specific setup and plugin preparation before running the underlying checks). Run scoped single-file tests during iteration, full suite once at the end; docs-only changes may skip tests with a note. Run `vp install` after cloning, switching branches, pulling dependency changes, or when the installation is stale. On env issues run `vp env doctor`, attempt the obvious fix first, and only ask for help if still blocked.

Skills share these validation results for the same final code state. Rerun affected checks only after further changes, failures, or new evidence. Fix failures caused by the requested change; report unrelated failures without expanding scope. Work is complete when the requested behavior is implemented, applicable validation is complete, and any remaining limitations are reported.
2 changes: 1 addition & 1 deletion apps/web/src/lib/i18n/host-i18n.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it, vi } from 'vitest';
import { describe, expect, it, vi } from 'vite-plus/test';
import { ChronosEngine, type ChronosEnv } from '@chronos/core';
import { HOST_MESSAGES, HOST_UI_PLUGIN_ID } from '$lib/i18n/host-messages';

Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/lib/i18n/locale-sync.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest';
import { describe, expect, it, vi, beforeEach, afterEach } from 'vite-plus/test';
import { ChronosEngine } from '@chronos/core';
import type { ChronosEnv } from '@chronos/core';

Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/lib/platform/transfer.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { afterEach, describe, expect, it, vi } from 'vitest';
import { afterEach, describe, expect, it, vi } from 'vite-plus/test';
import { copyTextWithFallback, downloadExportResult, withTimeout } from './transfer';

describe('platform/transfer', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect, vi } from 'vitest';
import { describe, it, expect, vi } from 'vite-plus/test';
import type { PluginManifest } from '@chronos/core';
import { OfficialPluginInstallQueue, type PluginInstallRunner } from './install-queue';

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"tsx": "^4.23.15",
"typescript": "^6.0.3",
"vite": "catalog:",
"vite-plus": "catalog:",
"vitest": "4.1.10"
"vite-plus": "catalog:"
}
}
2 changes: 1 addition & 1 deletion packages/core/tests/course-query.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from 'vite-plus/test';
import { createCourse } from '../src/domain/course';
import { matchesCourseQuery } from '../src/domain/course-query';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/tests/period-time-edit.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from 'vite-plus/test';
import type { Course } from '../src/domain/course';
import { countDistinctCoursesAffectedByPeriodDelete } from '../src/domain/course';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-kit/tests/edge-bar-actions.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from 'vite-plus/test';
import {
createEdgeBarActions,
type EdgeBarAction
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-kit/tests/fit-width-font.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from 'vite-plus/test';
import {
COURSE_CAPSULE_PAD_X_PX,
courseCapsuleInnerWidthPx
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-kit/tests/history-overlay.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { afterEach, describe, expect, it, vi } from 'vitest';
import { afterEach, describe, expect, it, vi } from 'vite-plus/test';
import { createHistoryOverlaySync } from '../src/overlay/history-overlay';
afterEach(() => vi.unstubAllGlobals());
describe('overlay lifecycle', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-kit/tests/middle-truncate-result-cache.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { afterEach, describe, expect, it, vi } from 'vitest';
import { afterEach, describe, expect, it, vi } from 'vite-plus/test';
import {
getMiddleTruncateResult,
setMiddleTruncateResult,
Expand Down
Loading
Loading