@yujinapp/yuemail 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -4
- package/server-dist/index.js +20 -2
package/package.json
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yujinapp/yuemail",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Voice-first single-user email client. Dictate, sign, send. Local-only, BYOK encrypted vault.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"engines": {
|
|
8
|
-
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=18.0.0"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"yuemail": "bin/yuemail.mjs"
|
|
12
|
+
},
|
|
9
13
|
"main": "./server-dist/index.js",
|
|
10
14
|
"files": [
|
|
11
15
|
"bin/",
|
|
@@ -61,6 +65,6 @@
|
|
|
61
65
|
},
|
|
62
66
|
"repository": {
|
|
63
67
|
"type": "git",
|
|
64
|
-
"url": "https://github.com/yujinapp/yuemail-v3.git"
|
|
68
|
+
"url": "git+https://github.com/yujinapp/yuemail-v3.git"
|
|
65
69
|
}
|
|
66
70
|
}
|
package/server-dist/index.js
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
import express from 'express';
|
|
19
19
|
import path from 'node:path';
|
|
20
20
|
import { fileURLToPath } from 'node:url';
|
|
21
|
-
import { existsSync } from 'node:fs';
|
|
21
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
22
22
|
import { registerVaultRoutes } from './routes/vault.js';
|
|
23
23
|
import { registerDocumentsRoutes } from './routes/documents.js';
|
|
24
24
|
import { registerSignatureRoutes } from './routes/signature.js';
|
|
@@ -29,11 +29,29 @@ export const HOST = '127.0.0.1';
|
|
|
29
29
|
export const PORT = 5180;
|
|
30
30
|
const __filename = fileURLToPath(import.meta.url);
|
|
31
31
|
const __dirname = path.dirname(__filename);
|
|
32
|
+
/** The package version, read from package.json at startup so /api/health
|
|
33
|
+
* never drifts from the published version again (the 0.3.0 vs 0.4.0
|
|
34
|
+
* mismatch was a hardcoded string). Walks up from the build dir to find it. */
|
|
35
|
+
function readPackageVersion() {
|
|
36
|
+
for (const up of ['..', '../..', '../../..']) {
|
|
37
|
+
try {
|
|
38
|
+
const p = path.join(__dirname, up, 'package.json');
|
|
39
|
+
if (existsSync(p)) {
|
|
40
|
+
const v = JSON.parse(readFileSync(p, 'utf-8')).version;
|
|
41
|
+
if (typeof v === 'string' && v)
|
|
42
|
+
return v;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch { /* keep walking up */ }
|
|
46
|
+
}
|
|
47
|
+
return '0.0.0';
|
|
48
|
+
}
|
|
49
|
+
export const APP_VERSION = readPackageVersion();
|
|
32
50
|
export function buildApp(opts = {}) {
|
|
33
51
|
const app = express();
|
|
34
52
|
app.use(express.json({ limit: '10mb' }));
|
|
35
53
|
app.get('/api/health', (_req, res) => {
|
|
36
|
-
res.json({ ok: true, version:
|
|
54
|
+
res.json({ ok: true, version: APP_VERSION });
|
|
37
55
|
});
|
|
38
56
|
registerVaultRoutes(app);
|
|
39
57
|
registerDocumentsRoutes(app);
|