Skip to content

Commit 64f64bf

Browse files
huntiemeta-codesync[bot]
authored andcommitted
Add macOS 26 icon for RNDT (#56149)
Summary: Pull Request resolved: #56149 Add `AppIcon.icon` file (Icon Composer) for macOS 26 Tahoe. Also rename previous `.icns` file for consistency. `electron/packager` is updated to `^20.0.0` (`.icon` support was added in `18.4.0`). Changelog: [Internal] Differential Revision: D97292364
1 parent 64c9663 commit 64f64bf

8 files changed

Lines changed: 263 additions & 375 deletions

File tree

.github/workflows/test-all.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ jobs:
512512
run: yarn test-generated-typescript
513513

514514
build_debugger_shell:
515-
runs-on: ubuntu-latest
515+
runs-on: macos-26
516516
needs: check_code_changes
517517
if: needs.check_code_changes.outputs.debugger_shell == 'true'
518518
steps:

flow-typed/npm/electron-packager_v18.x.x.js renamed to flow-typed/npm/electron-packager_v20.x.x.js

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,25 @@
1111
declare module '@electron/packager' {
1212
declare export type AsarOptions = $FlowFixMe;
1313

14-
declare export type ElectronDownloadRequestOptions = $FlowFixMe;
15-
1614
declare export type TargetDefinition = {
1715
arch: TargetArch,
1816
platform: TargetPlatform,
1917
};
2018

21-
declare export type FinalizePackageTargetsHookFunction = (
22-
targets: TargetDefinition[],
23-
callback: HookFunctionErrorCallback,
24-
) => void;
25-
26-
declare export type HookFunction = (
19+
declare export type HookFunctionArgs = {
2720
buildPath: string,
2821
electronVersion: string,
2922
platform: TargetPlatform,
3023
arch: TargetArch,
31-
callback: HookFunctionErrorCallback,
32-
) => void;
24+
};
3325

34-
declare export type IgnoreFunction = (path: string) => boolean;
26+
declare export type HookFunction = (args: HookFunctionArgs) => Promise<void>;
27+
28+
declare export type FinalizePackageTargetsHookFunction = (args: {
29+
targets: TargetDefinition[],
30+
}) => Promise<void>;
3531

36-
declare export type HookFunctionErrorCallback = (err?: Error | null) => void;
32+
declare export type IgnoreFunction = (path: string) => boolean;
3733

3834
declare export interface MacOSProtocol {
3935
name: string;
@@ -102,7 +98,6 @@ declare module '@electron/packager' {
10298
buildVersion?: string;
10399
darwinDarkModeSupport?: boolean;
104100
derefSymlinks?: boolean;
105-
download?: ElectronDownloadRequestOptions;
106101
electronVersion?: string;
107102
electronZipDir?: string;
108103
executableName?: string;
@@ -118,7 +113,7 @@ declare module '@electron/packager' {
118113
};
119114
extraResource?: string | string[];
120115
helperBundleId?: string;
121-
icon?: string;
116+
icon?: string | string[];
122117
ignore?: RegExp | (string | RegExp)[] | IgnoreFunction;
123118
junk?: boolean;
124119
name?: string;
@@ -132,7 +127,7 @@ declare module '@electron/packager' {
132127
protocols?: MacOSProtocol[];
133128
prune?: boolean;
134129
quiet?: boolean;
135-
tmpdir?: string | false;
130+
tmpdir?: string;
136131
usageDescription?: {
137132
[property: string]: string,
138133
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"@babel/plugin-transform-regenerator": "^7.24.7",
5454
"@babel/preset-env": "^7.25.3",
5555
"@babel/preset-flow": "^7.24.7",
56-
"@electron/packager": "^18.3.6",
56+
"@electron/packager": "^20.0.0",
5757
"@expo/spawn-async": "^1.7.2",
5858
"@jest/create-cache-key-function": "^29.7.0",
5959
"@microsoft/api-extractor": "^7.52.2",

packages/debugger-shell/src/electron/resources/icon.icns renamed to packages/debugger-shell/src/electron/resources/AppIcon.icns

File renamed without changes.
Lines changed: 12 additions & 0 deletions
Loading
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"fill" : {
3+
"linear-gradient" : [
4+
"display-p3:0.21574,0.21966,0.23974,1.00000",
5+
"display-p3:0.13729,0.14116,0.15294,1.00000"
6+
]
7+
},
8+
"groups" : [
9+
{
10+
"blur-material" : null,
11+
"layers" : [
12+
{
13+
"glass" : false,
14+
"image-name" : "logo_light.svg",
15+
"name" : "logo_light",
16+
"position" : {
17+
"scale" : 1.37,
18+
"translation-in-points" : [
19+
0,
20+
0
21+
]
22+
}
23+
}
24+
],
25+
"shadow" : {
26+
"kind" : "neutral",
27+
"opacity" : 0.5
28+
},
29+
"specular" : true,
30+
"translucency" : {
31+
"enabled" : false,
32+
"value" : 0.5
33+
}
34+
}
35+
],
36+
"supported-platforms" : {
37+
"squares" : [
38+
"macOS"
39+
]
40+
}
41+
}

scripts/debugger-shell/build-binary.js

Lines changed: 53 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,28 @@ const PACKAGE_ROOT = path.join(
4545
'packages',
4646
'debugger-shell',
4747
);
48+
const ICON_BASE = path.join(PACKAGE_ROOT, 'src/electron/resources');
49+
50+
const platformConfigs = [
51+
{
52+
platform: ['darwin'],
53+
arch: ['x64', 'arm64'],
54+
icon: [
55+
path.join(ICON_BASE, 'AppIcon.icns'),
56+
path.join(ICON_BASE, 'AppIcon.icon'),
57+
],
58+
},
59+
{
60+
platform: ['win32'],
61+
arch: ['x64', 'arm64'],
62+
icon: path.join(ICON_BASE, 'icon.ico'),
63+
},
64+
{
65+
platform: ['linux'],
66+
arch: ['x64', 'arm64'],
67+
icon: path.join(ICON_BASE, 'icon.png'),
68+
},
69+
];
4870

4971
async function main() {
5072
const pkg = JSON.parse(
@@ -73,31 +95,37 @@ async function main() {
7395

7496
await writeBuildInfo();
7597

76-
await packager({
77-
dir: PACKAGE_ROOT,
78-
icon: path.join(PACKAGE_ROOT, 'src/electron/resources/icon'),
79-
platform: ['win32', 'darwin', 'linux'],
80-
arch: ['x64', 'arm64'],
81-
name: APP_NAME,
82-
appVersion: pkg.version,
83-
appCopyright: COPYRIGHT,
84-
appCategoryType: 'public.app-category.developer-tools',
85-
asar: true,
86-
appBundleId: APP_BUNDLE_IDENTIFIER,
87-
out: path.join(PACKAGE_ROOT, 'build'),
88-
win32metadata: {
89-
CompanyName: COMPANY_NAME,
90-
ProductName: APP_NAME,
91-
InternalName: APP_NAME,
92-
FileDescription: `${APP_NAME}.exe`,
93-
OriginalFilename: `${APP_NAME}.exe`,
94-
},
95-
overwrite: true,
96-
ignore: [
97-
...IGNORE_PREFIXES.map(prefix => new RegExp('^' + escapeRegex(prefix))),
98-
...IGNORE_FILES.map(file => new RegExp('^' + escapeRegex(file) + '$')),
99-
],
100-
});
98+
await Promise.all(
99+
platformConfigs.map(platformConfig =>
100+
packager({
101+
...platformConfig,
102+
dir: PACKAGE_ROOT,
103+
name: APP_NAME,
104+
appVersion: pkg.version,
105+
appCopyright: COPYRIGHT,
106+
appCategoryType: 'public.app-category.developer-tools',
107+
asar: true,
108+
appBundleId: APP_BUNDLE_IDENTIFIER,
109+
out: path.join(PACKAGE_ROOT, 'build'),
110+
win32metadata: {
111+
CompanyName: COMPANY_NAME,
112+
ProductName: APP_NAME,
113+
InternalName: APP_NAME,
114+
FileDescription: `${APP_NAME}.exe`,
115+
OriginalFilename: `${APP_NAME}.exe`,
116+
},
117+
overwrite: true,
118+
ignore: [
119+
...IGNORE_PREFIXES.map(
120+
prefix => new RegExp('^' + escapeRegex(prefix)),
121+
),
122+
...IGNORE_FILES.map(
123+
file => new RegExp('^' + escapeRegex(file) + '$'),
124+
),
125+
],
126+
}),
127+
),
128+
);
101129
}
102130

103131
async function writeBuildInfo() {

0 commit comments

Comments
 (0)