Đợt sửa lỗi 3 — PR-B (features).
Reverse UX:
- InputPanel accept list + file picker + editor label are now driven by
the active format when direction='reverse'. Label switches from
"Input JSON" to "Input <Format>". Loads-sample button hidden in
reverse (the sample is JSON).
- BatchPanel mirrors the dynamic accept + filename suffix. Per-row
shows `→ .json` in reverse mode.
- batch-processor gained a `direction` parameter. Reverse mode skips
parseJsonInput entirely and routes through converter.reverse(); zip
outputs use `.json` extension regardless of source format.
Docs suite (root):
- PRIVACY.md — offline-first, localStorage inventory.
- SECURITY.md — vulnerability reporting + supported versions.
- DISCLAIMER.md — 1-person + AI-assisted, translation disclaimer.
- MAINTAINERS.md — single-maintainer indie project notes.
- THIRD-PARTY.md — categorized canonical dep list with version/license/link.
- CODE_OF_CONDUCT.md — Contributor Covenant v2.1 by reference.
Docs suite (operational):
- docs/pc_spec.md + docs/dev_env.md — maintainer hardware + toolchain.
- docs/i18n/vi/{pc_spec,dev_env}.md — VI mirrors.
CONTRIBUTING + README updates:
- README + README.vi: new "Project docs" table, Acknowledgements,
Sponsorship sections.
- CONTRIBUTING: "Auto-ignored cases" rules (suspicious code, off-topic
preamble, etc.). Updated translation section to list all four locales
and disclose AI-translation.
About page expansion:
- Donate grid (5 channels from .github/FUNDING.yml).
- Third-party categorized summary (UI / Editor / Parsers / Build / Tauri / i18n)
linking to THIRD-PARTY.md.
- Build info: version, commit SHA (linked to commit), build date —
injected via Vite define from git rev-parse.
- Links: repo, issues, discussions, demo, license.
- Disclaimer footer with translation note.
- All sections wired with new about.* i18n keys in en/vi/ja/zh-CN.
Verification:
- typecheck / lint / 175 tests pass / build OK.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
import { defineConfig } from 'vitest/config';
|
|
import react from '@vitejs/plugin-react';
|
|
import path from 'node:path';
|
|
import pkg from './package.json';
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
define: {
|
|
__APP_VERSION__: JSON.stringify(pkg.version),
|
|
__IS_TAURI_BUILD__: 'false',
|
|
__APP_COMMIT__: '"test"',
|
|
__APP_BUILD_DATE__: '"1970-01-01"',
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
test: {
|
|
environment: 'jsdom',
|
|
// jsdom binds localStorage to the document origin; the default `about:blank`
|
|
// returns a stripped Storage shim. A proper http URL gives the full API.
|
|
environmentOptions: {
|
|
jsdom: {
|
|
url: 'http://localhost/',
|
|
},
|
|
},
|
|
setupFiles: ['./src/test/setup.ts'],
|
|
globals: true,
|
|
css: false,
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'html'],
|
|
include: ['src/**/*.{ts,tsx}'],
|
|
exclude: [
|
|
'src/**/*.test.{ts,tsx}',
|
|
'src/**/__tests__/**',
|
|
'src/test/**',
|
|
'src/main.tsx',
|
|
'src/vite-env.d.ts',
|
|
],
|
|
},
|
|
},
|
|
});
|