Skip to content

Commit 0ab6501

Browse files
committed
docs: update build,config tips in docs
1 parent a92b667 commit 0ab6501

13 files changed

+582
-52
lines changed

CrossPlatform.Docs/CrossPlatform.Docs.njsproj

-6
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@
3030
<DebugSymbols>true</DebugSymbols>
3131
</PropertyGroup>
3232
<ItemGroup>
33-
<Content Include="develop-env-for-linux.md" />
34-
<Content Include="develop-env-for-linux_zh.md" />
35-
<Content Include="develop-env-for-mac.md" />
36-
<Content Include="develop-env-for-mac_zh.md" />
37-
<Content Include="develop-env-for-win.md" />
38-
<Content Include="develop-env-for-win_zh.md" />
3933
<Content Include="electron-config-need-pay-attention.md" />
4034
<Content Include="electron-config-need-pay-attention_zh.md" />
4135
<Content Include="tips.md" />

CrossPlatform.Docs/develop-env-for-linux.md

Whitespace-only changes.

CrossPlatform.Docs/develop-env-for-linux_zh.md

Whitespace-only changes.

CrossPlatform.Docs/develop-env-for-mac.md

Whitespace-only changes.

CrossPlatform.Docs/develop-env-for-mac_zh.md

Whitespace-only changes.

CrossPlatform.Docs/develop-env-for-win.md

Whitespace-only changes.

CrossPlatform.Docs/develop-env-for-win_zh.md

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# pay attention to some config item
2+
3+
## package.json
4+
5+
### homepage
6+
7+
- This field is primarily intended for **`linux-based`** systems. If this field is missing, it may cause errors on **`linux-based`** systems.
8+
9+
### author
10+
11+
- It needs to be adjusted as shown below, primarily for **`linux-based`** systems.
12+
13+
```jsonc
14+
// This format will cause build errors on linux-based systems
15+
{
16+
"author": "artoriasless"
17+
}
18+
19+
// The following format should be used instead
20+
{
21+
"author": {
22+
"name": "artoriasless",
23+
"email": "[email protected]"
24+
}
25+
}
26+
```
27+
28+
## linux.icon : build app icon field for for build on linux-based system
29+
30+
- Example configuration, but it may cause the **`convertIcnsToPng`** error, even if **`opj_decompress`** is installed, the issue might not be resolved.
31+
32+
```jsonc
33+
{
34+
"linux": {
35+
// On linux-based systems, icons can use the icns format
36+
"icon": "/path/to/your/icon.icns",
37+
"target": [
38+
{
39+
"target": "deb",
40+
"arch": ["x64", "arm64"]
41+
}
42+
]
43+
}
44+
}
45+
```
46+
47+
- A more compatible configuration approach
48+
49+
> 1. Prepare a 256x256-sized PNG.
50+
>
51+
> 2. Use an online free image resize tool.
52+
>
53+
> 3. Based on the 256 size, generate PNG icons for each of the following sizes: 8x8, 16x16, 32x32, 48x48, 64x64, 128x128, 256x256
54+
>
55+
> 4. Name them as **`icon_${width}x${height}.png`**.
56+
>
57+
> 5. Store them in a folder named icons.
58+
>
59+
> 6. During the build process, point the application icon to this folder.
60+
61+
```jsonc
62+
{
63+
"linux": {
64+
// This folder contains PNG icons in multiple sizes
65+
"icon": "/path/to/your/icon/folder",
66+
"target": [
67+
{
68+
"target": "deb",
69+
"arch": ["x64", "arm64"]
70+
}
71+
]
72+
}
73+
}
74+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# 需要注意的一些配置项
2+
3+
## package.json
4+
5+
### homepage
6+
7+
- 此字段主要针对 **`linux-based`** 的系统,如果没有该字段,会导致 **`linux-based`** 系统下报错
8+
9+
### author
10+
11+
- 需要调整为如下所示,主要也是针对 **`linux-based`** 系统
12+
13+
```jsonc
14+
// 这样的写法在 linux-based 系统下会构建报错
15+
{
16+
"author": "artoriasless"
17+
}
18+
19+
// 需要采用如下格式
20+
{
21+
"author": {
22+
"name": "artoriasless",
23+
"email": "[email protected]"
24+
}
25+
}
26+
```
27+
28+
## linux.icon : 构建所需配置的 linux 图标配置项
29+
30+
- 示例配置,但是有可能会出现 **`convertIcnsToPng`** 的报错,即使安装了 **`opj_decompress`** 也无法解决
31+
32+
```jsonc
33+
{
34+
"linux": {
35+
// 在 linux-based 系统下,图标是可以使用 icns 格式的
36+
"icon": "/path/to/your/icon.icns",
37+
"target": [
38+
{
39+
"target": "deb",
40+
"arch": ["x64", "arm64"]
41+
}
42+
]
43+
}
44+
}
45+
```
46+
47+
- 兼容性更好的配置写法
48+
49+
> 1. 准备一个 256x256 尺寸的 png
50+
>
51+
> 2. 找一个在线的免费 resize 图片的网站
52+
>
53+
> 3. 基于 256 尺寸,分别生成 8x8、16x16、32x32、48x48、64x64、128x128、256x256 的 png 图标
54+
>
55+
> 4. 分别名为 **`icon_${width}x${height}.png`**
56+
>
57+
> 5. 存放到一个文件夹 icons
58+
>
59+
> 6. 在构建的时候,应用图标指向这个文件夹
60+
61+
```jsonc
62+
{
63+
"linux": {
64+
// 这是一个存放各个尺寸 png 图标的文件夹
65+
"icon": "/path/to/your/icon/folder",
66+
"target": [
67+
{
68+
"target": "deb",
69+
"arch": ["x64", "arm64"]
70+
}
71+
]
72+
}
73+
}
74+
```

0 commit comments

Comments
 (0)