@myassis/gateway 1.0.5 → 1.0.7
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/dist/index.js +1 -0
- package/package.json +2 -2
- package/scripts/add-shebang.js +19 -0
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myassis/gateway",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "我的助手 Gateway Service - 本地 AI 网关服务,支持认证、WebSocket 实时通信和任务调度",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dev": "tsx watch src/index.ts",
|
|
25
25
|
"start": "node dist/index.js",
|
|
26
26
|
"build": "tsc --skipLibCheck",
|
|
27
|
-
"postbuild": "npx tsc-alias",
|
|
27
|
+
"postbuild": "node scripts/add-shebang.js && npx tsc-alias",
|
|
28
28
|
"pkg:win": "pkg . --targets node18-win-x64 --output myassis-gateway-win.exe",
|
|
29
29
|
"pkg:linux": "pkg . --targets node18-linux-x64 --output myassis-gateway-linux",
|
|
30
30
|
"pkg:all": "npm run pkg:win && npm run pkg:linux",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = path.dirname(__filename);
|
|
8
|
+
|
|
9
|
+
const filePath = path.join(__dirname, '..', 'dist', 'index.js');
|
|
10
|
+
|
|
11
|
+
// 检查并添加 shebang
|
|
12
|
+
let content = fs.readFileSync(filePath, 'utf8');
|
|
13
|
+
if (!content.startsWith('#!')) {
|
|
14
|
+
content = '#!/usr/bin/env node\n' + content;
|
|
15
|
+
fs.writeFileSync(filePath, content, 'utf8');
|
|
16
|
+
console.log('✅ Added shebang to dist/index.js');
|
|
17
|
+
} else {
|
|
18
|
+
console.log('ℹ️ Shebang already exists in dist/index.js');
|
|
19
|
+
}
|