Skip to content

Commit b97c425

Browse files
fix: release script
1 parent b37059d commit b97c425

File tree

6 files changed

+94
-26
lines changed

6 files changed

+94
-26
lines changed
-8.45 KB
Binary file not shown.

packages/origine2/src/locales/en.po

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,9 @@ msgstr "Create new template"
600600
msgid "创建新游戏"
601601
msgstr "Create new game"
602602

603-
#: src/components/Assets/FileElement.tsx:192
604-
#: src/components/Assets/FileElement.tsx:209
605-
#: src/components/Assets/FileElement.tsx:217
603+
#: src/components/Assets/FileElement.tsx:202
604+
#: src/components/Assets/FileElement.tsx:219
605+
#: src/components/Assets/FileElement.tsx:227
606606
#: src/pages/dashboard/GameElement.tsx:154
607607
#: src/pages/dashboard/TemplateElement.tsx:133
608608
#: src/pages/editor/GraphicalEditor/SentenceEditor/Intro.tsx:206
@@ -1060,7 +1060,7 @@ msgstr "Created"
10601060

10611061
#: src/components/Assets/Assets.tsx:354
10621062
#: src/components/Assets/Assets.tsx:413
1063-
#: src/components/Assets/FileElement.tsx:163
1063+
#: src/components/Assets/FileElement.tsx:172
10641064
msgid "已存在文件或文件夹 {0},请输入其他名称"
10651065
msgstr "File or folder already exists {0}, please enter another name"
10661066

@@ -1313,6 +1313,10 @@ msgstr "Sound effect file"
13131313
msgid "文件名"
13141314
msgstr "File name"
13151315

1316+
#: src/components/Assets/FileElement.tsx:166
1317+
msgid "文件名不可包含特殊符号: '/\\\\:*?\"<>|'"
1318+
msgstr ""
1319+
13161320
#: src/components/Assets/Assets.tsx:492
13171321
msgid "文件大小"
13181322
msgstr "File size"
@@ -1475,7 +1479,7 @@ msgstr "Pin popup"
14751479
msgid "是否自定义分隔符"
14761480
msgstr "Use custom separator"
14771481

1478-
#: src/components/Assets/FileElement.tsx:210
1482+
#: src/components/Assets/FileElement.tsx:220
14791483
msgid "是否要删除 \"{0}\" ?"
14801484
msgstr "Are you sure you want to delete \"{0}\"?"
14811485

@@ -2570,9 +2574,9 @@ msgstr "Configuration"
25702574
msgid "配置模板"
25712575
msgstr "Configure template"
25722576

2573-
#: src/components/Assets/FileElement.tsx:142
2574-
#: src/components/Assets/FileElement.tsx:161
2575-
#: src/components/Assets/FileElement.tsx:185
2577+
#: src/components/Assets/FileElement.tsx:145
2578+
#: src/components/Assets/FileElement.tsx:164
2579+
#: src/components/Assets/FileElement.tsx:195
25762580
#: src/pages/dashboard/GameElement.tsx:124
25772581
#: src/pages/dashboard/TemplateElement.tsx:118
25782582
msgid "重命名"

packages/origine2/src/locales/ja.po

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -603,9 +603,9 @@ msgstr "新しいテンプレートを作成"
603603
msgid "创建新游戏"
604604
msgstr "新しいゲームを作成"
605605

606-
#: src/components/Assets/FileElement.tsx:192
607-
#: src/components/Assets/FileElement.tsx:209
608-
#: src/components/Assets/FileElement.tsx:217
606+
#: src/components/Assets/FileElement.tsx:202
607+
#: src/components/Assets/FileElement.tsx:219
608+
#: src/components/Assets/FileElement.tsx:227
609609
#: src/pages/dashboard/GameElement.tsx:154
610610
#: src/pages/dashboard/TemplateElement.tsx:133
611611
#: src/pages/editor/GraphicalEditor/SentenceEditor/Intro.tsx:206
@@ -1063,7 +1063,7 @@ msgstr "作成済み"
10631063

10641064
#: src/components/Assets/Assets.tsx:354
10651065
#: src/components/Assets/Assets.tsx:413
1066-
#: src/components/Assets/FileElement.tsx:163
1066+
#: src/components/Assets/FileElement.tsx:172
10671067
msgid "已存在文件或文件夹 {0},请输入其他名称"
10681068
msgstr "ファイルまたはフォルダは既に存在します {0}"
10691069

@@ -1312,6 +1312,10 @@ msgstr "効果音ファイル"
13121312
msgid "文件名"
13131313
msgstr "ファイル名"
13141314

1315+
#: src/components/Assets/FileElement.tsx:166
1316+
msgid "文件名不可包含特殊符号: '/\\\\:*?\"<>|'"
1317+
msgstr ""
1318+
13151319
#: src/components/Assets/Assets.tsx:492
13161320
msgid "文件大小"
13171321
msgstr "ファイルサイズ"
@@ -1474,7 +1478,7 @@ msgstr "ポップアップをピン留め"
14741478
msgid "是否自定义分隔符"
14751479
msgstr "カスタム区切り文字を使用"
14761480

1477-
#: src/components/Assets/FileElement.tsx:210
1481+
#: src/components/Assets/FileElement.tsx:220
14781482
msgid "是否要删除 \"{0}\" ?"
14791483
msgstr "\"{0}\"を削除してもよろしいですか?"
14801484

@@ -2569,9 +2573,9 @@ msgstr "構成"
25692573
msgid "配置模板"
25702574
msgstr "テンプレートを設定"
25712575

2572-
#: src/components/Assets/FileElement.tsx:142
2573-
#: src/components/Assets/FileElement.tsx:161
2574-
#: src/components/Assets/FileElement.tsx:185
2576+
#: src/components/Assets/FileElement.tsx:145
2577+
#: src/components/Assets/FileElement.tsx:164
2578+
#: src/components/Assets/FileElement.tsx:195
25752579
#: src/pages/dashboard/GameElement.tsx:124
25762580
#: src/pages/dashboard/TemplateElement.tsx:118
25772581
msgid "重命名"

packages/origine2/src/locales/zhCn.po

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -598,9 +598,9 @@ msgstr "创建新模板"
598598
msgid "创建新游戏"
599599
msgstr "创建新游戏"
600600

601-
#: src/components/Assets/FileElement.tsx:192
602-
#: src/components/Assets/FileElement.tsx:209
603-
#: src/components/Assets/FileElement.tsx:217
601+
#: src/components/Assets/FileElement.tsx:202
602+
#: src/components/Assets/FileElement.tsx:219
603+
#: src/components/Assets/FileElement.tsx:227
604604
#: src/pages/dashboard/GameElement.tsx:154
605605
#: src/pages/dashboard/TemplateElement.tsx:133
606606
#: src/pages/editor/GraphicalEditor/SentenceEditor/Intro.tsx:206
@@ -1054,7 +1054,7 @@ msgstr "已创建"
10541054

10551055
#: src/components/Assets/Assets.tsx:354
10561056
#: src/components/Assets/Assets.tsx:413
1057-
#: src/components/Assets/FileElement.tsx:163
1057+
#: src/components/Assets/FileElement.tsx:172
10581058
msgid "已存在文件或文件夹 {0},请输入其他名称"
10591059
msgstr "已存在文件或文件夹 {0},请输入其他名称"
10601060

@@ -1303,6 +1303,10 @@ msgstr "效果音文件"
13031303
msgid "文件名"
13041304
msgstr "文件名"
13051305

1306+
#: src/components/Assets/FileElement.tsx:166
1307+
msgid "文件名不可包含特殊符号: '/\\\\:*?\"<>|'"
1308+
msgstr "文件名不可包含特殊符号: '/\\\\:*?\"<>|'"
1309+
13061310
#: src/components/Assets/Assets.tsx:492
13071311
msgid "文件大小"
13081312
msgstr "文件大小"
@@ -1465,7 +1469,7 @@ msgstr "是否固定弹窗"
14651469
msgid "是否自定义分隔符"
14661470
msgstr "是否自定义分隔符"
14671471

1468-
#: src/components/Assets/FileElement.tsx:210
1472+
#: src/components/Assets/FileElement.tsx:220
14691473
msgid "是否要删除 \"{0}\" ?"
14701474
msgstr "是否要删除 \"{0}\" ?"
14711475

@@ -2560,9 +2564,9 @@ msgstr "配置"
25602564
msgid "配置模板"
25612565
msgstr "配置模板"
25622566

2563-
#: src/components/Assets/FileElement.tsx:142
2564-
#: src/components/Assets/FileElement.tsx:161
2565-
#: src/components/Assets/FileElement.tsx:185
2567+
#: src/components/Assets/FileElement.tsx:145
2568+
#: src/components/Assets/FileElement.tsx:164
2569+
#: src/components/Assets/FileElement.tsx:195
25662570
#: src/pages/dashboard/GameElement.tsx:124
25672571
#: src/pages/dashboard/TemplateElement.tsx:118
25682572
msgid "重命名"

packages/terre2/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"test:cov": "jest --coverage",
2323
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
2424
"test:e2e": "jest --config ./test/jest-e2e.json",
25-
"pkg": "cd dist && pkg src/main.js -o WebGAL_Terre",
26-
"pkg:linux-arm64": "cd dist && pkg src/main.js -o WebGAL_Terre -t node20-linux-arm64",
25+
"pkg": "tsx pkg-build.ts",
26+
"pkg:linux-arm64": "cross-env PKG_TARGET=node22-linux-arm64 tsx pkg-build.ts",
2727
"update-exe-resources": "tsx update-exe-resources.ts"
2828
},
2929
"dependencies": {

packages/terre2/pkg-build.ts

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import { spawnSync } from 'child_process';
2+
import * as fs from 'fs';
3+
import * as path from 'path';
4+
5+
const distDir = path.join(process.cwd(), 'dist');
6+
if (!fs.existsSync(distDir)) {
7+
console.error('dist folder not found. Run build first.');
8+
process.exit(1);
9+
}
10+
11+
const platformMap: Partial<Record<NodeJS.Platform, string>> = {
12+
aix: 'linux',
13+
android: 'linux',
14+
darwin: 'macos',
15+
freebsd: 'linux',
16+
linux: 'linux',
17+
openbsd: 'linux',
18+
sunos: 'linux',
19+
win32: 'win',
20+
};
21+
22+
const archMap: Record<string, string> = {
23+
x64: 'x64',
24+
arm64: 'arm64',
25+
};
26+
27+
const nodeVersion = process.env.PKG_NODE_VERSION ?? 'node22';
28+
const mappedPlatform = platformMap[process.platform];
29+
const mappedArch = archMap[process.arch];
30+
31+
if (!mappedPlatform || !mappedArch) {
32+
console.error(
33+
`Unsupported platform/arch for pkg: ${process.platform}/${process.arch}`,
34+
);
35+
process.exit(1);
36+
}
37+
38+
const target =
39+
process.env.PKG_TARGET ?? `${nodeVersion}-${mappedPlatform}-${mappedArch}`;
40+
41+
const pkgBin = process.platform === 'win32' ? 'pkg.cmd' : 'pkg';
42+
const pkgArgs = ['src/main.js', '-o', 'WebGAL_Terre', '-t', target];
43+
const extraArgs = process.argv.slice(2);
44+
45+
const result = spawnSync(pkgBin, [...pkgArgs, ...extraArgs], {
46+
stdio: 'inherit',
47+
cwd: distDir,
48+
shell: process.platform === 'win32',
49+
});
50+
51+
if (result.error) {
52+
console.error(result.error);
53+
process.exit(1);
54+
}
55+
56+
process.exit(result.status ?? 1);

0 commit comments

Comments
 (0)