electrobun 0.13.0-beta.24 → 0.13.0-beta.26
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/api/shared/naming.ts +19 -6
- package/package.json +1 -1
- package/src/cli/index.ts +13 -6
|
@@ -27,6 +27,19 @@ export function getAppFileName(appName: string, buildEnvironment: BuildEnvironme
|
|
|
27
27
|
return buildEnvironment === 'stable' ? sanitized : `${sanitized}-${buildEnvironment}`;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Generates the macOS bundle display name (with spaces preserved).
|
|
32
|
+
* Used for the actual .app folder name on macOS.
|
|
33
|
+
* Format: "App Name" (stable) or "App Name-channel" (non-stable)
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* getMacOSBundleDisplayName("My App", "stable") // "My App"
|
|
37
|
+
* getMacOSBundleDisplayName("My App", "canary") // "My App-canary"
|
|
38
|
+
*/
|
|
39
|
+
export function getMacOSBundleDisplayName(appName: string, buildEnvironment: BuildEnvironment): string {
|
|
40
|
+
return buildEnvironment === 'stable' ? appName : `${appName}-${buildEnvironment}`;
|
|
41
|
+
}
|
|
42
|
+
|
|
30
43
|
/**
|
|
31
44
|
* Generates the bundle file name (with platform-specific extension).
|
|
32
45
|
* macOS: "AppName.app" or "AppName-channel.app"
|
|
@@ -103,13 +116,13 @@ export function sanitizeVolumeNameForHdiutil(name: string): string {
|
|
|
103
116
|
}
|
|
104
117
|
|
|
105
118
|
/**
|
|
106
|
-
* Generates the DMG volume name for macOS
|
|
107
|
-
*
|
|
108
|
-
*
|
|
119
|
+
* Generates the DMG volume name for macOS.
|
|
120
|
+
* Takes the original app name (with spaces) and preserves them for display.
|
|
121
|
+
* Format: "App Name" (stable) or "App Name-channel" (non-stable)
|
|
109
122
|
*/
|
|
110
|
-
export function getDmgVolumeName(
|
|
111
|
-
const baseName = sanitizeVolumeNameForHdiutil(
|
|
112
|
-
return buildEnvironment === 'stable' ?
|
|
123
|
+
export function getDmgVolumeName(appName: string, buildEnvironment: BuildEnvironment): string {
|
|
124
|
+
const baseName = sanitizeVolumeNameForHdiutil(appName);
|
|
125
|
+
return buildEnvironment === 'stable' ? baseName : `${baseName}-${buildEnvironment}`;
|
|
113
126
|
}
|
|
114
127
|
|
|
115
128
|
/**
|
package/package.json
CHANGED
package/src/cli/index.ts
CHANGED
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
getLinuxAppImageBaseName,
|
|
33
33
|
sanitizeVolumeNameForHdiutil,
|
|
34
34
|
getDmgVolumeName,
|
|
35
|
+
getMacOSBundleDisplayName,
|
|
35
36
|
} from '../shared/naming';
|
|
36
37
|
import { getTemplate, getTemplateNames } from './templates/embedded';
|
|
37
38
|
// import { loadBsdiff, loadBspatch } from 'bsdiff-wasm';
|
|
@@ -1048,6 +1049,8 @@ if (commandArg === "init") {
|
|
|
1048
1049
|
const targetARCH = currentTarget.arch;
|
|
1049
1050
|
const targetBinExt = targetOS === 'win' ? '.exe' : '';
|
|
1050
1051
|
const appFileName = getAppFileName(config.app.name, buildEnvironment);
|
|
1052
|
+
// macOS bundle display name preserves spaces for the actual .app folder
|
|
1053
|
+
const macOSBundleDisplayName = getMacOSBundleDisplayName(config.app.name, buildEnvironment);
|
|
1051
1054
|
const buildSubFolder = getPlatformFolder(buildEnvironment, currentTarget.os, currentTarget.arch);
|
|
1052
1055
|
const buildFolder = join(projectRoot, config.build.buildFolder, buildSubFolder);
|
|
1053
1056
|
const bundleFileName = getBundleFileName(config.app.name, buildEnvironment, targetOS);
|
|
@@ -1171,13 +1174,15 @@ if (commandArg === "init") {
|
|
|
1171
1174
|
}
|
|
1172
1175
|
|
|
1173
1176
|
// build macos bundle
|
|
1177
|
+
// Use display name (with spaces) for macOS bundle folders, sanitized name for other platforms
|
|
1178
|
+
const bundleName = targetOS === 'macos' ? macOSBundleDisplayName : appFileName;
|
|
1174
1179
|
const {
|
|
1175
1180
|
appBundleFolderPath,
|
|
1176
1181
|
appBundleFolderContentsPath,
|
|
1177
1182
|
appBundleMacOSPath,
|
|
1178
1183
|
appBundleFolderResourcesPath,
|
|
1179
1184
|
appBundleFolderFrameworksPath,
|
|
1180
|
-
} = createAppBundle(
|
|
1185
|
+
} = createAppBundle(bundleName, buildFolder, targetOS);
|
|
1181
1186
|
|
|
1182
1187
|
const appBundleAppCodePath = join(appBundleFolderResourcesPath, "app");
|
|
1183
1188
|
|
|
@@ -1206,7 +1211,7 @@ if (commandArg === "init") {
|
|
|
1206
1211
|
<key>CFBundleIdentifier</key>
|
|
1207
1212
|
<string>${config.app.identifier}</string>
|
|
1208
1213
|
<key>CFBundleName</key>
|
|
1209
|
-
<string>${
|
|
1214
|
+
<string>${bundleName}</string>
|
|
1210
1215
|
<key>CFBundleVersion</key>
|
|
1211
1216
|
<string>${config.app.version}</string>
|
|
1212
1217
|
<key>CFBundlePackageType</key>
|
|
@@ -1932,7 +1937,8 @@ if (commandArg === "init") {
|
|
|
1932
1937
|
// All the unique files are in the bundle now. Create an initial temporary tar file
|
|
1933
1938
|
// for hashing the contents
|
|
1934
1939
|
// tar the signed and notarized app bundle
|
|
1935
|
-
|
|
1940
|
+
// Use sanitized appFileName for tarball paths (URL-safe), but tar content uses actual bundle folder
|
|
1941
|
+
const tmpTarPath = join(buildFolder, `${appFileName}${targetOS === 'macos' ? '.app' : ''}-temp.tar`);
|
|
1936
1942
|
await tar.c(
|
|
1937
1943
|
{
|
|
1938
1944
|
gzip: false,
|
|
@@ -2132,7 +2138,8 @@ if (commandArg === "init") {
|
|
|
2132
2138
|
|
|
2133
2139
|
// Platform suffix is only used for folder names, not file names
|
|
2134
2140
|
const platformSuffix = `-${targetOS}-${targetARCH}`;
|
|
2135
|
-
|
|
2141
|
+
// Use sanitized appFileName for tarball path (URL-safe), but tar content uses actual bundle folder name
|
|
2142
|
+
const tarPath = join(buildFolder, `${appFileName}${targetOS === 'macos' ? '.app' : ''}.tar`);
|
|
2136
2143
|
|
|
2137
2144
|
// For Linux, we've already created the tar in the AppImage section above
|
|
2138
2145
|
// For macOS/Windows, tar the signed and notarized app bundle
|
|
@@ -2202,7 +2209,7 @@ if (commandArg === "init") {
|
|
|
2202
2209
|
rmdirSync(appBundleFolderPath, { recursive: true });
|
|
2203
2210
|
}
|
|
2204
2211
|
|
|
2205
|
-
const selfExtractingBundle = createAppBundle(
|
|
2212
|
+
const selfExtractingBundle = createAppBundle(bundleName, buildFolder, targetOS);
|
|
2206
2213
|
const compressedTarballInExtractingBundlePath = join(
|
|
2207
2214
|
selfExtractingBundle.appBundleFolderResourcesPath,
|
|
2208
2215
|
`${hash}.tar.zst`
|
|
@@ -2261,7 +2268,7 @@ if (commandArg === "init") {
|
|
|
2261
2268
|
buildEnvironment === "stable"
|
|
2262
2269
|
? join(buildFolder, `${appFileName}-stable.dmg`)
|
|
2263
2270
|
: finalDmgPath;
|
|
2264
|
-
const dmgVolumeName = getDmgVolumeName(
|
|
2271
|
+
const dmgVolumeName = getDmgVolumeName(config.app.name, buildEnvironment);
|
|
2265
2272
|
|
|
2266
2273
|
// Create a staging directory for DMG contents (app + Applications shortcut)
|
|
2267
2274
|
const dmgStagingDir = join(buildFolder, '.dmg-staging');
|