Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
- name: Type check and build renderer
run: pnpm build:renderer

- name: Storage tests
run: pnpm test:storage

backend:
name: Backend Checks (${{ matrix.os }})
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -88,3 +91,6 @@ jobs:

- name: Clippy
run: cargo clippy --manifest-path src-tauri/Cargo.toml -- -D warnings

- name: Native storage tests
run: cargo test --manifest-path src-tauri/Cargo.toml --lib
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pnpm preview # 在本地提供前端构建结果预览

## 配置与数据说明

- 应用使用 WebView / 浏览器的 IndexedDB 和 OPFS 存储项目及媒体数据。
- 项目保存在用户选择的文件夹中;桌面端引用音频绝对路径,Web 端将音频复制到项目文件夹。近期项目元信息保存在 localStorage,不持久化浏览器文件句柄。
- 不要提交用户媒体、生成的构建文件、本地密钥或其他敏感信息。
- 修改依赖时保留 `pnpm-lock.yaml`。
- 编辑 `vite.config.ts` 或部署工作流时,确认 GitHub Pages 的构建路径(`/bas-creater/`)与 Tauri 构建路径(`/`)均正确。
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,12 @@ macOS 签名/公证为可选项:在仓库 secrets 中配置 `APPLE_CERTIFICATE

## 数据存储

项目与媒体数据保存在 WebView 的 IndexedDB / OPFS 中(不支持 OPFS 写入时自动回退到 IndexedDB)。导出 `.basproj` 与 TXT 时,桌面端使用系统保存对话框,Web 端使用浏览器下载。
项目以 `<项目名>.basproj` 保存在用户选定的目录,不要求目录为空;同名项目文件不会被覆盖。已有的 `project.basproj` 仍可打开。桌面端近期项目列表保存在 Tauri 应用配置目录的 `recent-projects.json`。Web 端在 localStorage 保存近期列表,并在 IndexedDB 中仅保存项目文件夹句柄;项目内容和素材仍保存在文件系统。重新打开时会检查文件夹权限;如原文件夹不可用,可通过“打开本地项目”重新选择。

工程文件记录文字、按钮、Path 和音频资产、虚拟素材箱及时间轴编辑数据。素材箱只改变工程内分类,不移动磁盘文件。桌面端导入音频默认引用原文件的绝对路径;Web 端受浏览器限制,将音频复制到项目辅助目录。原文件移动或删除后,可在素材离线提示中重新链接。删除素材或时间轴片段不会删除原始音频;删除项目文件时也保留素材和备份。

素材箱的新建、重命名、删除确认及素材右键重命名使用应用内对话框。名称不能为空;可按回车提交,或按 Esc 取消。

桌面端和 Web 端统一使用 `.<项目文件名>.danmakucut` 作为辅助目录,保存备份和项目内素材。打开旧版 Web 项目时,程序会将旧 `.danmakucut-<项目 ID>` 目录中的数据复制到统一目录;旧目录不会被自动删除,同名文件内容冲突时也不会覆盖。工作台可通过“集中打包工程”创建包含音频的独立副本,不修改原项目和原始素材。BAS 文本导出包含可编译的文字、按钮和 Path,音频仅用于编辑预览,不写入 BAS。

旧版本项目在打开时转换为当前工程格式;自动保存前保留历史备份。项目在切回工作台及保存前检查外部更改,发现冲突时提示用户并拒绝覆盖;浏览器无法完全阻止检查与写入之间发生跨进程更改。Web 项目需要支持 File System Access API 的浏览器,文件夹内的同名文件不会被有意覆盖,但浏览器无法完全阻止其他程序同时创建或修改文件。
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
"build:renderer": "run-p type-check \"build-only {@}\" --",
"build-only": "vite build",
"preview": "vite preview",
"type-check": "vue-tsc --build"
"type-check": "vue-tsc --build",
"test:storage": "node --import tsx --test tests/browser-project-file.test.ts tests/folder-project-storage.test.ts tests/desktop-recent-projects.test.ts tests/project-asset-migration.test.ts tests/clip-instances.test.ts tests/audio-clip.test.ts tests/asset-bins.test.ts"
},
"dependencies": {
"@dantheman827/taglib-ts": "^0.1.5",
"@tailwindcss/vite": "^4.1.17",
"@tanstack/vue-table": "^8.21.3",
"@tauri-apps/api": "^2.12.4",
"@tauri-apps/plugin-dialog": "^2.8.4",
"@tauri-apps/plugin-opener": "^2.7.2",
Expand Down Expand Up @@ -48,6 +50,7 @@
"@vitejs/plugin-vue-jsx": "^5.1.2",
"@vue/tsconfig": "^0.8.1",
"npm-run-all2": "^8.0.4",
"tsx": "^4.23.15",
"tw-animate-css": "^1.4.0",
"typescript": "~5.9.0",
"vite": "^7.2.4",
Expand Down
Loading
Loading