mirror of
https://github.com/Melorise/TamaASR.git
synced 2026-11-07 14:39:32 +00:00
build: 初始化 MeloASR TypeScript 工程
建立 Linux-only 的 TypeScript/Electron 构建基础,统一项目名、包名和 0.1.0 版本元数据。 AI-assisted-by: Codex AI-model: gpt-5.6-sol AI-reasoning-effort: medium Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
node_modules/
|
||||||
|
linux/fcitx5/build/
|
||||||
|
dist/
|
||||||
|
dist-test/
|
||||||
|
release/
|
||||||
|
packaging/out/
|
||||||
|
chatgpt_amd64.deb
|
||||||
Generated
+4158
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"name": "meloasr",
|
||||||
|
"productName": "MeloASR",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"author": "MeloASR contributors",
|
||||||
|
"description": "基于网页语音识别后端和 Fcitx5 的 Linux 实时语音输入工具",
|
||||||
|
"main": "dist/main/index.js",
|
||||||
|
"scripts": {
|
||||||
|
"clean": "node scripts/clean.mjs",
|
||||||
|
"build": "npm run clean && tsc && esbuild src/preload/backend.ts --bundle --platform=node --format=cjs --external:electron --outfile=dist/preload/backend.js && node scripts/copy-static.mjs",
|
||||||
|
"typecheck": "tsc --noEmit",
|
||||||
|
"start": "npm run build && electron --ozone-platform=x11 .",
|
||||||
|
"build:fcitx5": "cmake -S linux/fcitx5 -B linux/fcitx5/build -DCMAKE_BUILD_TYPE=Release && cmake --build linux/fcitx5/build --parallel",
|
||||||
|
"build:linux:dir": "npm run build && electron-builder --config packaging/electron-builder.yml --linux dir",
|
||||||
|
"package:deb": "npm run build:linux:dir && packaging/deb/build-deb.sh",
|
||||||
|
"package:rpm": "npm run build:linux:dir && packaging/rpm/build-rpm.sh",
|
||||||
|
"test": "npm run typecheck && tsc -p tsconfig.test.json && node --test dist-test/test/*.test.js"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "^24.0.0",
|
||||||
|
"electron": "42.3.0",
|
||||||
|
"electron-builder": "^26.0.0",
|
||||||
|
"esbuild": "^0.25.0",
|
||||||
|
"typescript": "^5.9.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import fs from 'node:fs';
|
||||||
|
import path from 'node:path';
|
||||||
|
|
||||||
|
const root = path.resolve(import.meta.dirname, '..');
|
||||||
|
fs.rmSync(path.join(root, 'dist'), { recursive: true, force: true });
|
||||||
|
fs.rmSync(path.join(root, 'dist-test'), { recursive: true, force: true });
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import fs from 'node:fs';
|
||||||
|
import path from 'node:path';
|
||||||
|
|
||||||
|
const root = path.resolve(import.meta.dirname, '..');
|
||||||
|
const copies = [
|
||||||
|
['src/renderer/settings.html', 'dist/renderer/settings.html'],
|
||||||
|
['src/renderer/settings.css', 'dist/renderer/settings.css'],
|
||||||
|
['src/renderer/overlay.html', 'dist/renderer/overlay.html'],
|
||||||
|
['src/renderer/overlay.css', 'dist/renderer/overlay.css'],
|
||||||
|
['logo.png', 'dist/assets/logo.png']
|
||||||
|
];
|
||||||
|
|
||||||
|
for (const [source, target] of copies) {
|
||||||
|
const destination = path.join(root, target);
|
||||||
|
fs.mkdirSync(path.dirname(destination), { recursive: true });
|
||||||
|
fs.copyFileSync(path.join(root, source), destination);
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "CommonJS",
|
||||||
|
"moduleResolution": "Node",
|
||||||
|
"rootDir": "src",
|
||||||
|
"outDir": "dist",
|
||||||
|
"strict": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"types": ["node"]
|
||||||
|
},
|
||||||
|
"include": ["src/**/*.ts"],
|
||||||
|
"exclude": ["node_modules", "dist"]
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"rootDir": ".",
|
||||||
|
"outDir": "dist-test",
|
||||||
|
"sourceMap": false
|
||||||
|
},
|
||||||
|
"include": ["src/**/*.ts", "test/**/*.ts"]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user