mafit 1.1.1 → 1.2.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 +9 -7
- package/scripts/postinstall.js +76 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mafit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Mafit local agent CLI",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -12,19 +12,21 @@
|
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
14
|
"bin",
|
|
15
|
+
"scripts",
|
|
15
16
|
"README.md"
|
|
16
17
|
],
|
|
17
18
|
"optionalDependencies": {
|
|
18
|
-
"mafit-linux-x64": "1.
|
|
19
|
-
"mafit-linux-arm64": "1.
|
|
20
|
-
"mafit-darwin-x64": "1.
|
|
21
|
-
"mafit-darwin-arm64": "1.
|
|
22
|
-
"mafit-windows-x64": "1.
|
|
23
|
-
"mafit-windows-arm64": "1.
|
|
19
|
+
"mafit-linux-x64": "1.2.1",
|
|
20
|
+
"mafit-linux-arm64": "1.2.1",
|
|
21
|
+
"mafit-darwin-x64": "1.2.1",
|
|
22
|
+
"mafit-darwin-arm64": "1.2.1",
|
|
23
|
+
"mafit-windows-x64": "1.2.1",
|
|
24
|
+
"mafit-windows-arm64": "1.2.1"
|
|
24
25
|
},
|
|
25
26
|
"scripts": {
|
|
26
27
|
"build:binaries": "../scripts/build-npm-binaries.sh",
|
|
27
28
|
"pack:check": "npm pack --dry-run",
|
|
29
|
+
"postinstall": "node scripts/postinstall.js",
|
|
28
30
|
"release:npm": "../scripts/release-npm.sh"
|
|
29
31
|
}
|
|
30
32
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
if (process.env.CI === "true") {
|
|
4
|
+
process.exit(0);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
function isChineseLocale() {
|
|
8
|
+
let systemLocale = "";
|
|
9
|
+
try {
|
|
10
|
+
systemLocale = Intl.DateTimeFormat().resolvedOptions().locale || "";
|
|
11
|
+
} catch {
|
|
12
|
+
systemLocale = "";
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const locale = [
|
|
16
|
+
process.env.LC_ALL,
|
|
17
|
+
process.env.LC_MESSAGES,
|
|
18
|
+
process.env.LANG,
|
|
19
|
+
process.env.LANGUAGE,
|
|
20
|
+
systemLocale,
|
|
21
|
+
]
|
|
22
|
+
.filter(Boolean)
|
|
23
|
+
.join(" ")
|
|
24
|
+
.toLowerCase();
|
|
25
|
+
|
|
26
|
+
return /(^|[\s_.@-])zh($|[\s_.@-])/.test(locale) || locale.includes("chinese");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const heading = [
|
|
30
|
+
"",
|
|
31
|
+
".___ ___. ___ _______ __ .___________.",
|
|
32
|
+
"| \\/ | / \\ | ____|| | | |",
|
|
33
|
+
"| \\ / | / ^ \\ | |__ | | `---| |----`",
|
|
34
|
+
"| |\\/| | / /_\\ \\ | __| | | | | ",
|
|
35
|
+
"| | | | / _____ \\ | | | | | | ",
|
|
36
|
+
"|__| |__| /__/ \\__\\ |__| |__| |__| ",
|
|
37
|
+
"",
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
const englishLines = [
|
|
41
|
+
" Mafit installed successfully.",
|
|
42
|
+
"",
|
|
43
|
+
" Quick start:",
|
|
44
|
+
" mafit login Sign in to your Mafit account",
|
|
45
|
+
" mafit web Open the local dashboard",
|
|
46
|
+
" mafit status Check daemon and account status",
|
|
47
|
+
" mafit restart Restart the daemon and web dashboard",
|
|
48
|
+
"",
|
|
49
|
+
" Update later:",
|
|
50
|
+
" npm install -g mafit@latest",
|
|
51
|
+
" mafit restart",
|
|
52
|
+
"",
|
|
53
|
+
" Help:",
|
|
54
|
+
" mafit --help",
|
|
55
|
+
"",
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
const chineseLines = [
|
|
59
|
+
" Mafit 安装成功。",
|
|
60
|
+
"",
|
|
61
|
+
" 快速开始:",
|
|
62
|
+
" mafit login 登录你的 Mafit 账号",
|
|
63
|
+
" mafit web 打开本地看板",
|
|
64
|
+
" mafit status 查看守护进程和账号状态",
|
|
65
|
+
" mafit restart 重启守护进程和本地看板",
|
|
66
|
+
"",
|
|
67
|
+
" 后续更新:",
|
|
68
|
+
" npm install -g mafit@latest",
|
|
69
|
+
" mafit restart",
|
|
70
|
+
"",
|
|
71
|
+
" 查看帮助:",
|
|
72
|
+
" mafit --help",
|
|
73
|
+
"",
|
|
74
|
+
];
|
|
75
|
+
|
|
76
|
+
console.log([...heading, ...(isChineseLocale() ? chineseLines : englishLines)].join("\n"));
|