feat: 开源母线电容计算器并接入独立自动部署

整理 Buck 与 PMSM 完整源码、离线构建、校核测试和使用说明,采用 MIT 许可。
增加页首开源链接,支持推送 main 后自动测试、构建并发布到原计算器网址。
This commit is contained in:
2026-11-27 04:38:28 +08:00
commit 73ab36f7ff
75 changed files with 8300 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
const fs = require('node:fs');
const path = require('node:path');
const { spawnSync } = require('node:child_process');
const root = path.resolve(__dirname, '..');
const files = fs.readdirSync(path.join(root, 'tests')).filter((name) => name.endsWith('.test.cjs')).sort().map((name) => path.join(root, 'tests', name));
const result = spawnSync(process.execPath, ['--test', '--test-concurrency=1', ...files], { cwd: root, stdio: 'inherit' });
if (result.error) throw result.error;
process.exitCode = result.status ?? 1;