app-builder-lib 27.0.0-alpha.3 → 27.0.0-alpha.4
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/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -1
- package/dist/codeSign/win/signtoolBaseSignManager.js +9 -2
- package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -1
- package/dist/configuration.d.ts +3 -3
- package/dist/configuration.js.map +1 -1
- package/dist/indexInternal.d.ts +1 -1
- package/dist/indexInternal.d.ts.map +1 -1
- package/dist/indexInternal.js +1 -1
- package/dist/indexInternal.js.map +1 -1
- package/dist/macPackager.d.ts +5 -0
- package/dist/macPackager.d.ts.map +1 -1
- package/dist/macPackager.js +35 -0
- package/dist/macPackager.js.map +1 -1
- package/dist/node-module-collector/moduleManager.d.ts +2 -1
- package/dist/node-module-collector/moduleManager.d.ts.map +1 -1
- package/dist/node-module-collector/moduleManager.js +2 -0
- package/dist/node-module-collector/moduleManager.js.map +1 -1
- package/dist/node-module-collector/nodeModulesCollector.d.ts +13 -23
- package/dist/node-module-collector/nodeModulesCollector.d.ts.map +1 -1
- package/dist/node-module-collector/nodeModulesCollector.js +52 -122
- package/dist/node-module-collector/nodeModulesCollector.js.map +1 -1
- package/dist/node-module-collector/types.d.ts +2 -0
- package/dist/node-module-collector/types.d.ts.map +1 -1
- package/dist/node-module-collector/types.js.map +1 -1
- package/dist/options/linuxOptions.d.ts +0 -10
- package/dist/options/linuxOptions.d.ts.map +1 -1
- package/dist/options/linuxOptions.js.map +1 -1
- package/dist/packager.js +1 -1
- package/dist/packager.js.map +1 -1
- package/dist/platformPackager.d.ts +1 -0
- package/dist/platformPackager.d.ts.map +1 -1
- package/dist/platformPackager.js +5 -6
- package/dist/platformPackager.js.map +1 -1
- package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -1
- package/dist/targets/linux/FlatpakTarget.js +4 -1
- package/dist/targets/linux/FlatpakTarget.js.map +1 -1
- package/dist/targets/linux/FpmTarget.d.ts +6 -0
- package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
- package/dist/targets/linux/FpmTarget.js +25 -3
- package/dist/targets/linux/FpmTarget.js.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.d.ts +14 -0
- package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.js +38 -59
- package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
- package/dist/targets/linux/appimage/AppImageTarget.d.ts +1 -0
- package/dist/targets/linux/appimage/AppImageTarget.d.ts.map +1 -1
- package/dist/targets/linux/appimage/AppImageTarget.js +8 -9
- package/dist/targets/linux/appimage/AppImageTarget.js.map +1 -1
- package/dist/targets/linux/appimage/appImageUtil.d.ts +4 -0
- package/dist/targets/linux/appimage/appImageUtil.d.ts.map +1 -1
- package/dist/targets/linux/appimage/appImageUtil.js +11 -4
- package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
- package/dist/targets/linux/appimage/appLauncher.d.ts.map +1 -1
- package/dist/targets/linux/appimage/appLauncher.js +5 -11
- package/dist/targets/linux/appimage/appLauncher.js.map +1 -1
- package/dist/targets/linux/launcherScript.d.ts +32 -0
- package/dist/targets/linux/launcherScript.d.ts.map +1 -0
- package/dist/targets/linux/launcherScript.js +24 -0
- package/dist/targets/linux/launcherScript.js.map +1 -0
- package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.js +6 -6
- package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
- package/dist/targets/linux/snap/snapCommand.d.ts +2 -2
- package/dist/targets/linux/snap/snapCommand.d.ts.map +1 -1
- package/dist/targets/linux/snap/snapCommand.js +4 -10
- package/dist/targets/linux/snap/snapCommand.js.map +1 -1
- package/dist/targets/win/AppxTarget.d.ts.map +1 -1
- package/dist/targets/win/AppxTarget.js +6 -6
- package/dist/targets/win/AppxTarget.js.map +1 -1
- package/dist/targets/win/MsiTarget.d.ts.map +1 -1
- package/dist/targets/win/MsiTarget.js +8 -11
- package/dist/targets/win/MsiTarget.js.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.js +3 -3
- package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
- package/dist/targets/win/nsis/nsisScriptGenerator.js +1 -1
- package/dist/targets/win/nsis/nsisScriptGenerator.js.map +1 -1
- package/dist/toolsets/icons.d.ts.map +1 -1
- package/dist/toolsets/icons.js +10 -2
- package/dist/toolsets/icons.js.map +1 -1
- package/dist/util/appFileCopier.d.ts.map +1 -1
- package/dist/util/appFileCopier.js +9 -4
- package/dist/util/appFileCopier.js.map +1 -1
- package/dist/util/archCompatibility.d.ts +42 -0
- package/dist/util/archCompatibility.d.ts.map +1 -0
- package/dist/util/archCompatibility.js +202 -0
- package/dist/util/archCompatibility.js.map +1 -0
- package/dist/util/installOrRebuild.d.ts +38 -0
- package/dist/util/installOrRebuild.d.ts.map +1 -0
- package/dist/util/{yarn.js → installOrRebuild.js} +65 -14
- package/dist/util/installOrRebuild.js.map +1 -0
- package/dist/util/langs.d.ts.map +1 -1
- package/dist/util/langs.js +1 -0
- package/dist/util/langs.js.map +1 -1
- package/dist/util/mac/macosIconComposer.d.ts +2 -1
- package/dist/util/mac/macosIconComposer.d.ts.map +1 -1
- package/dist/util/mac/macosIconComposer.js +40 -58
- package/dist/util/mac/macosIconComposer.js.map +1 -1
- package/dist/util/streamSpawnToFile.d.ts +47 -0
- package/dist/util/streamSpawnToFile.d.ts.map +1 -0
- package/dist/util/streamSpawnToFile.js +110 -0
- package/dist/util/streamSpawnToFile.js.map +1 -0
- package/dist/util/toolsetLock.d.ts +2 -0
- package/dist/util/toolsetLock.d.ts.map +1 -1
- package/dist/util/toolsetLock.js +31 -5
- package/dist/util/toolsetLock.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +8 -8
- package/scheme.json +3 -8
- package/templates/appx/appxmanifest.xml +1 -2
- package/templates/nsis/assistedMessages.yml +17 -0
- package/templates/nsis/messages.yml +5 -0
- package/dist/util/yarn.d.ts +0 -23
- package/dist/util/yarn.d.ts.map +0 -1
- package/dist/util/yarn.js.map +0 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Arch } from "builder-util";
|
|
2
|
+
/**
|
|
3
|
+
* The `cpu`/`os` constraint fields as declared in a package's `package.json`.
|
|
4
|
+
* npm/pnpm only *install* the optional platform package matching the host, but the
|
|
5
|
+
* declared values are what we use to decide whether a package belongs in a given build.
|
|
6
|
+
*/
|
|
7
|
+
export interface PackagePlatformFields {
|
|
8
|
+
os?: string | string[] | null;
|
|
9
|
+
cpu?: string | string[] | null;
|
|
10
|
+
}
|
|
11
|
+
export declare function archToNodeCpu(arch: Arch): string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Whether a package may be bundled for the given target `cpu`/`os`, per its declared
|
|
14
|
+
* `package.json` `cpu`/`os` fields. A package with no constraint (plain JS) is always compatible.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isPackageCompatible(pkg: PackagePlatformFields, targetCpu: string | null, targetOs: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Whether a package is inherently single-architecture — i.e. its `cpu` constraint cannot satisfy
|
|
19
|
+
* *both* slices of a macOS universal build (`x64` and `arm64`). Such packages (e.g. `@esbuild/darwin-arm64`)
|
|
20
|
+
* cannot be merged into a universal Mach-O and must be treated as single-arch by `@electron/universal`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function isSingleArchPackage(pkg: PackagePlatformFields): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Recursively walks a `node_modules` directory (handling `@scope` dirs and nested `node_modules`) and
|
|
25
|
+
* collects the `name` of every package whose `package.json` `cpu` marks it as {@link isSingleArchPackage single-arch}.
|
|
26
|
+
* Missing/unreadable directories are treated as empty.
|
|
27
|
+
*/
|
|
28
|
+
export declare function collectSingleArchPackageNames(nodeModulesDir: string, names?: Set<string>): Promise<Set<string>>;
|
|
29
|
+
/**
|
|
30
|
+
* Finds single-arch Mach-O files that are byte-identical in BOTH universal slices — the exact case
|
|
31
|
+
* `@electron/universal` aborts on (`x64Sha === arm64Sha` for a non-fat Mach-O). This catches host binaries
|
|
32
|
+
* placed in packages that declare no `cpu`/`os`, e.g. esbuild's install script overwriting `esbuild/bin/esbuild`
|
|
33
|
+
* with the platform binary. Per-arch binaries (different SHA, e.g. rebuilt `.node` addons) are left for lipo.
|
|
34
|
+
* Returns paths relative to `unpackedDirA`, posix-normalized for matching by `@electron/universal`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function collectIdenticalSingleArchMachOFiles(unpackedDirA: string, unpackedDirB: string): Promise<string[]>;
|
|
37
|
+
/**
|
|
38
|
+
* Combines the given minimatch patterns (as consumed by `@electron/universal`'s `singleArchFiles`) into a
|
|
39
|
+
* single pattern, merged with any user-provided pattern. Returns `userPattern` (possibly undefined) when empty.
|
|
40
|
+
*/
|
|
41
|
+
export declare function buildSingleArchFilesPattern(patterns: Iterable<string>, userPattern: string | undefined): string | undefined;
|
|
42
|
+
//# sourceMappingURL=archCompatibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archCompatibility.d.ts","sourceRoot":"","sources":["../../src/util/archCompatibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAKnC;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAA;IAC7B,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAA;CAC/B;AAID,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAavD;AAgCD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAUnH;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,qBAAqB,GAAG,OAAO,CAMvE;AAED;;;;GAIG;AACH,wBAAsB,6BAA6B,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,GAAE,GAAG,CAAC,MAAM,CAAqB,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CA8BxI;AAuDD;;;;;;GAMG;AACH,wBAAsB,oCAAoC,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAaxH;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAO3H"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { Arch } from "builder-util";
|
|
2
|
+
import { createHash } from "crypto";
|
|
3
|
+
import { open, readdir, readFile } from "fs/promises";
|
|
4
|
+
import * as path from "path";
|
|
5
|
+
// Maps electron-builder's `Arch` to the npm `cpu` token used in `package.json` `cpu` fields.
|
|
6
|
+
// Returns `null` for arches we don't filter on (e.g. `universal`).
|
|
7
|
+
export function archToNodeCpu(arch) {
|
|
8
|
+
switch (arch) {
|
|
9
|
+
case Arch.ia32:
|
|
10
|
+
return "ia32";
|
|
11
|
+
case Arch.x64:
|
|
12
|
+
return "x64";
|
|
13
|
+
case Arch.armv7l:
|
|
14
|
+
return "arm";
|
|
15
|
+
case Arch.arm64:
|
|
16
|
+
return "arm64";
|
|
17
|
+
default:
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function toList(value) {
|
|
22
|
+
if (value == null) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const list = Array.isArray(value) ? value : [value];
|
|
26
|
+
return list.length > 0 ? list : null;
|
|
27
|
+
}
|
|
28
|
+
// Mirrors npm's `checkList` semantics (npm-install-checks): supports `"any"` and `"!"` negation.
|
|
29
|
+
// Returns true when `value` is allowed by `list`.
|
|
30
|
+
function checkList(value, list) {
|
|
31
|
+
if (list.length === 1 && list[0] === "any") {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
let blacklistCount = 0;
|
|
35
|
+
let match = false;
|
|
36
|
+
for (const entry of list) {
|
|
37
|
+
if (entry.startsWith("!")) {
|
|
38
|
+
if (entry.slice(1) === value) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
blacklistCount++;
|
|
42
|
+
}
|
|
43
|
+
else if (entry === value) {
|
|
44
|
+
match = true;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
// allowed if it matched a positive entry, or every entry was a (non-matching) negation
|
|
48
|
+
return match || blacklistCount === list.length;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Whether a package may be bundled for the given target `cpu`/`os`, per its declared
|
|
52
|
+
* `package.json` `cpu`/`os` fields. A package with no constraint (plain JS) is always compatible.
|
|
53
|
+
*/
|
|
54
|
+
export function isPackageCompatible(pkg, targetCpu, targetOs) {
|
|
55
|
+
const os = toList(pkg.os);
|
|
56
|
+
if (os != null && !checkList(targetOs, os)) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
const cpu = toList(pkg.cpu);
|
|
60
|
+
if (targetCpu != null && cpu != null && !checkList(targetCpu, cpu)) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Whether a package is inherently single-architecture — i.e. its `cpu` constraint cannot satisfy
|
|
67
|
+
* *both* slices of a macOS universal build (`x64` and `arm64`). Such packages (e.g. `@esbuild/darwin-arm64`)
|
|
68
|
+
* cannot be merged into a universal Mach-O and must be treated as single-arch by `@electron/universal`.
|
|
69
|
+
*/
|
|
70
|
+
export function isSingleArchPackage(pkg) {
|
|
71
|
+
const cpu = toList(pkg.cpu);
|
|
72
|
+
if (cpu == null) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
return !(checkList("x64", cpu) && checkList("arm64", cpu));
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Recursively walks a `node_modules` directory (handling `@scope` dirs and nested `node_modules`) and
|
|
79
|
+
* collects the `name` of every package whose `package.json` `cpu` marks it as {@link isSingleArchPackage single-arch}.
|
|
80
|
+
* Missing/unreadable directories are treated as empty.
|
|
81
|
+
*/
|
|
82
|
+
export async function collectSingleArchPackageNames(nodeModulesDir, names = new Set()) {
|
|
83
|
+
let entries;
|
|
84
|
+
try {
|
|
85
|
+
entries = await readdir(nodeModulesDir, { withFileTypes: true });
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
return names; // directory does not exist (no unpacked node_modules) or is unreadable
|
|
89
|
+
}
|
|
90
|
+
for (const entry of entries) {
|
|
91
|
+
if (!entry.isDirectory() || entry.name === ".bin") {
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
if (entry.name.startsWith("@")) {
|
|
95
|
+
// scope directory: its children are the actual packages
|
|
96
|
+
const scopeDir = path.join(nodeModulesDir, entry.name);
|
|
97
|
+
let scoped;
|
|
98
|
+
try {
|
|
99
|
+
scoped = await readdir(scopeDir, { withFileTypes: true });
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
for (const child of scoped) {
|
|
105
|
+
if (child.isDirectory()) {
|
|
106
|
+
await inspectPackageDir(path.join(scopeDir, child.name), names);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
await inspectPackageDir(path.join(nodeModulesDir, entry.name), names);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return names;
|
|
115
|
+
}
|
|
116
|
+
async function inspectPackageDir(packageDir, names) {
|
|
117
|
+
try {
|
|
118
|
+
const pkg = JSON.parse(await readFile(path.join(packageDir, "package.json"), "utf8"));
|
|
119
|
+
if (pkg.name && isSingleArchPackage(pkg)) {
|
|
120
|
+
names.add(pkg.name);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
// missing/invalid package.json — skip
|
|
125
|
+
}
|
|
126
|
+
await collectSingleArchPackageNames(path.join(packageDir, "node_modules"), names);
|
|
127
|
+
}
|
|
128
|
+
// Single-arch (non-fat) Mach-O magics, read big-endian from the first 4 bytes. The fat/universal magics
|
|
129
|
+
// (`0xcafebabe`/`0xbebafeca`) are intentionally excluded — those are already-merged binaries that lipo handles.
|
|
130
|
+
const SINGLE_ARCH_MACHO_MAGICS = new Set([0xfeedface, 0xfeedfacf, 0xcefaedfe, 0xcffaedfe]);
|
|
131
|
+
async function isSingleArchMachO(file) {
|
|
132
|
+
let fh;
|
|
133
|
+
try {
|
|
134
|
+
fh = await open(file, "r");
|
|
135
|
+
const buf = Buffer.alloc(4);
|
|
136
|
+
const { bytesRead } = await fh.read(buf, 0, 4, 0);
|
|
137
|
+
return bytesRead === 4 && SINGLE_ARCH_MACHO_MAGICS.has(buf.readUInt32BE(0));
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
return false; // missing/unreadable file
|
|
141
|
+
}
|
|
142
|
+
finally {
|
|
143
|
+
await fh?.close();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
async function sha256(file) {
|
|
147
|
+
return createHash("sha256")
|
|
148
|
+
.update(await readFile(file))
|
|
149
|
+
.digest("hex");
|
|
150
|
+
}
|
|
151
|
+
async function walkFiles(dir, onFile) {
|
|
152
|
+
let entries;
|
|
153
|
+
try {
|
|
154
|
+
entries = await readdir(dir, { withFileTypes: true });
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
return; // directory does not exist or is unreadable
|
|
158
|
+
}
|
|
159
|
+
for (const entry of entries) {
|
|
160
|
+
const p = path.join(dir, entry.name);
|
|
161
|
+
if (entry.isDirectory()) {
|
|
162
|
+
await walkFiles(p, onFile);
|
|
163
|
+
}
|
|
164
|
+
else if (entry.isFile()) {
|
|
165
|
+
await onFile(p);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Finds single-arch Mach-O files that are byte-identical in BOTH universal slices — the exact case
|
|
171
|
+
* `@electron/universal` aborts on (`x64Sha === arm64Sha` for a non-fat Mach-O). This catches host binaries
|
|
172
|
+
* placed in packages that declare no `cpu`/`os`, e.g. esbuild's install script overwriting `esbuild/bin/esbuild`
|
|
173
|
+
* with the platform binary. Per-arch binaries (different SHA, e.g. rebuilt `.node` addons) are left for lipo.
|
|
174
|
+
* Returns paths relative to `unpackedDirA`, posix-normalized for matching by `@electron/universal`.
|
|
175
|
+
*/
|
|
176
|
+
export async function collectIdenticalSingleArchMachOFiles(unpackedDirA, unpackedDirB) {
|
|
177
|
+
const result = [];
|
|
178
|
+
await walkFiles(unpackedDirA, async (fileA) => {
|
|
179
|
+
if (!(await isSingleArchMachO(fileA))) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
const rel = path.relative(unpackedDirA, fileA);
|
|
183
|
+
const fileB = path.join(unpackedDirB, rel);
|
|
184
|
+
if ((await isSingleArchMachO(fileB)) && (await sha256(fileA)) === (await sha256(fileB))) {
|
|
185
|
+
result.push(rel.split(path.sep).join("/"));
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
return result;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Combines the given minimatch patterns (as consumed by `@electron/universal`'s `singleArchFiles`) into a
|
|
192
|
+
* single pattern, merged with any user-provided pattern. Returns `userPattern` (possibly undefined) when empty.
|
|
193
|
+
*/
|
|
194
|
+
export function buildSingleArchFilesPattern(patterns, userPattern) {
|
|
195
|
+
const sorted = Array.from(new Set(patterns)).sort();
|
|
196
|
+
if (sorted.length === 0) {
|
|
197
|
+
return userPattern;
|
|
198
|
+
}
|
|
199
|
+
const detected = sorted.length === 1 ? sorted[0] : `{${sorted.join(",")}}`;
|
|
200
|
+
return userPattern ? `{${userPattern},${detected}}` : detected;
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=archCompatibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archCompatibility.js","sourceRoot":"","sources":["../../src/util/archCompatibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAY5B,6FAA6F;AAC7F,mEAAmE;AACnE,MAAM,UAAU,aAAa,CAAC,IAAU;IACtC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,IAAI,CAAC,IAAI;YACZ,OAAO,MAAM,CAAA;QACf,KAAK,IAAI,CAAC,GAAG;YACX,OAAO,KAAK,CAAA;QACd,KAAK,IAAI,CAAC,MAAM;YACd,OAAO,KAAK,CAAA;QACd,KAAK,IAAI,CAAC,KAAK;YACb,OAAO,OAAO,CAAA;QAChB;YACE,OAAO,IAAI,CAAA;IACf,CAAC;AACH,CAAC;AAED,SAAS,MAAM,CAAC,KAA2C;IACzD,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QAClB,OAAO,IAAI,CAAA;IACb,CAAC;IACD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;IACnD,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;AACtC,CAAC;AAED,iGAAiG;AACjG,kDAAkD;AA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CAAC,QAAQ,CAAA;AAChE,CAAC","sourcesContent":["import { Arch } from \"builder-util\"\nimport { createHash } from \"crypto\"\nimport { open, readdir, readFile } from \"fs/promises\"\nimport * as path from \"path\"\n\n/**\n * The `cpu`/`os` constraint fields as declared in a package's `package.json`.\n * npm/pnpm only *install* the optional platform package matching the host, but the\n * declared values are what we use to decide whether a package belongs in a given build.\n */\nexport interface PackagePlatformFields {\n os?: string | string[] | null\n cpu?: string | string[] | null\n}\n\n// Maps electron-builder's `Arch` to the npm `cpu` token used in `package.json` `cpu` fields.\n// Returns `null` for arches we don't filter on (e.g. `universal`).\nexport function archToNodeCpu(arch: Arch): string | null {\n switch (arch) {\n case Arch.ia32:\n return \"ia32\"\n case Arch.x64:\n return \"x64\"\n case Arch.armv7l:\n return \"arm\"\n case Arch.arm64:\n return \"arm64\"\n default:\n return null\n }\n}\n\nfunction toList(value: string | string[] | null | undefined): string[] | null {\n if (value == null) {\n return null\n }\n const list = Array.isArray(value) ? value : [value]\n return list.length > 0 ? list : null\n}\n\n// Mirrors npm's `checkList` semantics (npm-install-checks): supports `\"any\"` and `\"!\"` negation.\n// Returns true when `value` is allowed by `list`.\nfunction checkList(value: string, list: string[]): boolean {\n if (list.length === 1 && list[0] === \"any\") {\n return true\n }\n let blacklistCount = 0\n let match = false\n for (const entry of list) {\n if (entry.startsWith(\"!\")) {\n if (entry.slice(1) === value) {\n return false\n }\n blacklistCount++\n } else if (entry === value) {\n match = true\n }\n }\n // allowed if it matched a positive entry, or every entry was a (non-matching) negation\n return match || blacklistCount === list.length\n}\n\n/**\n * Whether a package may be bundled for the given target `cpu`/`os`, per its declared\n * `package.json` `cpu`/`os` fields. A package with no constraint (plain JS) is always compatible.\n */\nexport function isPackageCompatible(pkg: PackagePlatformFields, targetCpu: string | null, targetOs: string): boolean {\n const os = toList(pkg.os)\n if (os != null && !checkList(targetOs, os)) {\n return false\n }\n const cpu = toList(pkg.cpu)\n if (targetCpu != null && cpu != null && !checkList(targetCpu, cpu)) {\n return false\n }\n return true\n}\n\n/**\n * Whether a package is inherently single-architecture — i.e. its `cpu` constraint cannot satisfy\n * *both* slices of a macOS universal build (`x64` and `arm64`). Such packages (e.g. `@esbuild/darwin-arm64`)\n * cannot be merged into a universal Mach-O and must be treated as single-arch by `@electron/universal`.\n */\nexport function isSingleArchPackage(pkg: PackagePlatformFields): boolean {\n const cpu = toList(pkg.cpu)\n if (cpu == null) {\n return false\n }\n return !(checkList(\"x64\", cpu) && checkList(\"arm64\", cpu))\n}\n\n/**\n * Recursively walks a `node_modules` directory (handling `@scope` dirs and nested `node_modules`) and\n * collects the `name` of every package whose `package.json` `cpu` marks it as {@link isSingleArchPackage single-arch}.\n * Missing/unreadable directories are treated as empty.\n */\nexport async function collectSingleArchPackageNames(nodeModulesDir: string, names: Set<string> = new Set<string>()): Promise<Set<string>> {\n let entries\n try {\n entries = await readdir(nodeModulesDir, { withFileTypes: true })\n } catch {\n return names // directory does not exist (no unpacked node_modules) or is unreadable\n }\n for (const entry of entries) {\n if (!entry.isDirectory() || entry.name === \".bin\") {\n continue\n }\n if (entry.name.startsWith(\"@\")) {\n // scope directory: its children are the actual packages\n const scopeDir = path.join(nodeModulesDir, entry.name)\n let scoped\n try {\n scoped = await readdir(scopeDir, { withFileTypes: true })\n } catch {\n continue\n }\n for (const child of scoped) {\n if (child.isDirectory()) {\n await inspectPackageDir(path.join(scopeDir, child.name), names)\n }\n }\n } else {\n await inspectPackageDir(path.join(nodeModulesDir, entry.name), names)\n }\n }\n return names\n}\n\nasync function inspectPackageDir(packageDir: string, names: Set<string>): Promise<void> {\n try {\n const pkg: PackagePlatformFields & { name?: string } = JSON.parse(await readFile(path.join(packageDir, \"package.json\"), \"utf8\"))\n if (pkg.name && isSingleArchPackage(pkg)) {\n names.add(pkg.name)\n }\n } catch {\n // missing/invalid package.json — skip\n }\n await collectSingleArchPackageNames(path.join(packageDir, \"node_modules\"), names)\n}\n\n// Single-arch (non-fat) Mach-O magics, read big-endian from the first 4 bytes. The fat/universal magics\n// (`0xcafebabe`/`0xbebafeca`) are intentionally excluded — those are already-merged binaries that lipo handles.\nconst SINGLE_ARCH_MACHO_MAGICS = new Set([0xfeedface, 0xfeedfacf, 0xcefaedfe, 0xcffaedfe])\n\nasync function isSingleArchMachO(file: string): Promise<boolean> {\n let fh\n try {\n fh = await open(file, \"r\")\n const buf = Buffer.alloc(4)\n const { bytesRead } = await fh.read(buf, 0, 4, 0)\n return bytesRead === 4 && SINGLE_ARCH_MACHO_MAGICS.has(buf.readUInt32BE(0))\n } catch {\n return false // missing/unreadable file\n } finally {\n await fh?.close()\n }\n}\n\nasync function sha256(file: string): Promise<string> {\n return createHash(\"sha256\")\n .update(await readFile(file))\n .digest(\"hex\")\n}\n\nasync function walkFiles(dir: string, onFile: (absolutePath: string) => Promise<void>): Promise<void> {\n let entries\n try {\n entries = await readdir(dir, { withFileTypes: true })\n } catch {\n return // directory does not exist or is unreadable\n }\n for (const entry of entries) {\n const p = path.join(dir, entry.name)\n if (entry.isDirectory()) {\n await walkFiles(p, onFile)\n } else if (entry.isFile()) {\n await onFile(p)\n }\n }\n}\n\n/**\n * Finds single-arch Mach-O files that are byte-identical in BOTH universal slices — the exact case\n * `@electron/universal` aborts on (`x64Sha === arm64Sha` for a non-fat Mach-O). This catches host binaries\n * placed in packages that declare no `cpu`/`os`, e.g. esbuild's install script overwriting `esbuild/bin/esbuild`\n * with the platform binary. Per-arch binaries (different SHA, e.g. rebuilt `.node` addons) are left for lipo.\n * Returns paths relative to `unpackedDirA`, posix-normalized for matching by `@electron/universal`.\n */\nexport async function collectIdenticalSingleArchMachOFiles(unpackedDirA: string, unpackedDirB: string): Promise<string[]> {\n const result: string[] = []\n await walkFiles(unpackedDirA, async fileA => {\n if (!(await isSingleArchMachO(fileA))) {\n return\n }\n const rel = path.relative(unpackedDirA, fileA)\n const fileB = path.join(unpackedDirB, rel)\n if ((await isSingleArchMachO(fileB)) && (await sha256(fileA)) === (await sha256(fileB))) {\n result.push(rel.split(path.sep).join(\"/\"))\n }\n })\n return result\n}\n\n/**\n * Combines the given minimatch patterns (as consumed by `@electron/universal`'s `singleArchFiles`) into a\n * single pattern, merged with any user-provided pattern. Returns `userPattern` (possibly undefined) when empty.\n */\nexport function buildSingleArchFilesPattern(patterns: Iterable<string>, userPattern: string | undefined): string | undefined {\n const sorted = Array.from(new Set(patterns)).sort()\n if (sorted.length === 0) {\n return userPattern\n }\n const detected = sorted.length === 1 ? sorted[0] : `{${sorted.join(\",\")}}`\n return userPattern ? `{${userPattern},${detected}}` : detected\n}\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Configuration } from "../configuration.js";
|
|
2
|
+
import { Nullish } from "builder-util-runtime";
|
|
3
|
+
export declare function installOrRebuild(config: Configuration, { appDir, projectDir, workspaceRoot }: DirectoryPaths, options: RebuildOptions, forceInstall: boolean | undefined, env: NodeJS.ProcessEnv): Promise<void>;
|
|
4
|
+
export interface DesktopFrameworkInfo {
|
|
5
|
+
version: string;
|
|
6
|
+
useCustomDist: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function getGypEnv(frameworkInfo: DesktopFrameworkInfo, platform: NodeJS.Platform, arch: string, buildFromSource: boolean): any;
|
|
9
|
+
/**
|
|
10
|
+
* Whether a failed dependency-install spawn should be retried. Everything not matched here fails fast —
|
|
11
|
+
* a genuine install error (E404, ERESOLVE, EACCES, …) must surface immediately, not after 3 backoff
|
|
12
|
+
* retries. Two transient classes are retriable:
|
|
13
|
+
* - Network blips while fetching from the registry.
|
|
14
|
+
* - A Windows-only cmd.exe race: cross-spawn invokes the package manager's `.cmd`/`.CMD` shim via
|
|
15
|
+
* `cmd.exe /d /s /c`, and cmd.exe re-opens the batch file between commands. Under CI load (Defender
|
|
16
|
+
* scan locks, an 8.3/temp cwd, heavy parallel I/O) that re-open intermittently fails with
|
|
17
|
+
* "The batch file cannot be found." *after* the package manager has already finished — a spurious
|
|
18
|
+
* exit code, not a missing file. The install is idempotent (a no-op once node_modules is up to
|
|
19
|
+
* date), so re-running is safe. Guarded to win32 so the narrow message match can't affect other
|
|
20
|
+
* platforms. (Durable fix: stop routing install through cmd.exe, mirroring the collector's
|
|
21
|
+
* powershell.exe -EncodedCommand spawn — tracked separately.)
|
|
22
|
+
*/
|
|
23
|
+
export declare function isRetriableInstallError(message: string): boolean;
|
|
24
|
+
export declare function installDependencies(config: Configuration, { appDir, projectDir, workspaceRoot }: DirectoryPaths, options: RebuildOptions, env: NodeJS.ProcessEnv): Promise<any>;
|
|
25
|
+
export declare function nodeGypRebuild(platform: NodeJS.Platform, arch: string, frameworkInfo: DesktopFrameworkInfo): Promise<void>;
|
|
26
|
+
export interface RebuildOptions {
|
|
27
|
+
frameworkInfo: DesktopFrameworkInfo;
|
|
28
|
+
platform?: NodeJS.Platform;
|
|
29
|
+
arch?: string;
|
|
30
|
+
buildFromSource?: boolean;
|
|
31
|
+
additionalArgs?: Array<string> | null;
|
|
32
|
+
}
|
|
33
|
+
export interface DirectoryPaths {
|
|
34
|
+
appDir: string;
|
|
35
|
+
projectDir: string;
|
|
36
|
+
workspaceRoot: string | Nullish;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=installOrRebuild.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installOrRebuild.d.ts","sourceRoot":"","sources":["../../src/util/installOrRebuild.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAOnD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAI9C,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,aAAa,EACrB,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,EAAE,cAAc,EACrD,OAAO,EAAE,cAAc,EACvB,YAAY,qBAAQ,EACpB,GAAG,EAAE,MAAM,CAAC,UAAU,iBAuBvB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,OAAO,CAAA;CACvB;AAMD,wBAAgB,SAAS,CAAC,aAAa,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,OAiC/H;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAQhE;AAED,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,aAAa,EACrB,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,EAAE,cAAc,EACrD,OAAO,EAAE,cAAc,EACvB,GAAG,EAAE,MAAM,CAAC,UAAU,GACrB,OAAO,CAAC,GAAG,CAAC,CA2Ed;AAED,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,oBAAoB,iBAiBhH;AACD,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,oBAAoB,CAAA;IAEnC,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAA;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb,eAAe,CAAC,EAAE,OAAO,CAAA;IAEzB,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;CACtC;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,GAAG,OAAO,CAAA;CAChC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { asArray, log, retry, spawn, stripSensitiveEnvVars } from "builder-util";
|
|
1
|
+
import { asArray, log, retry, spawn, stripSensitiveEnvVars, TmpDir } from "builder-util";
|
|
2
2
|
import { isNpmNoBinLinks } from "./flags.js";
|
|
3
3
|
import { homedir } from "os";
|
|
4
4
|
import * as path from "path";
|
|
5
5
|
import { PM, getPackageManagerCommand } from "../node-module-collector/index.js";
|
|
6
6
|
import { detectPackageManager } from "../node-module-collector/packageManager.js";
|
|
7
|
+
import { streamSpawnToFile } from "./streamSpawnToFile.js";
|
|
7
8
|
import { rebuild as remoteRebuild } from "./rebuild.js";
|
|
8
9
|
import which from "which";
|
|
9
10
|
import _fsExtra from "fs-extra";
|
|
10
|
-
const { pathExists } = _fsExtra;
|
|
11
|
+
const { pathExists, readFile } = _fsExtra;
|
|
11
12
|
export async function installOrRebuild(config, { appDir, projectDir, workspaceRoot }, options, forceInstall = false, env) {
|
|
12
13
|
const effectiveOptions = {
|
|
13
14
|
buildFromSource: config.nativeModules?.buildDependenciesFromSource === true,
|
|
@@ -63,6 +64,29 @@ export function getGypEnv(frameworkInfo, platform, arch, buildFromSource) {
|
|
|
63
64
|
npm_config_devdir: getElectronGypCacheDir(),
|
|
64
65
|
};
|
|
65
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Whether a failed dependency-install spawn should be retried. Everything not matched here fails fast —
|
|
69
|
+
* a genuine install error (E404, ERESOLVE, EACCES, …) must surface immediately, not after 3 backoff
|
|
70
|
+
* retries. Two transient classes are retriable:
|
|
71
|
+
* - Network blips while fetching from the registry.
|
|
72
|
+
* - A Windows-only cmd.exe race: cross-spawn invokes the package manager's `.cmd`/`.CMD` shim via
|
|
73
|
+
* `cmd.exe /d /s /c`, and cmd.exe re-opens the batch file between commands. Under CI load (Defender
|
|
74
|
+
* scan locks, an 8.3/temp cwd, heavy parallel I/O) that re-open intermittently fails with
|
|
75
|
+
* "The batch file cannot be found." *after* the package manager has already finished — a spurious
|
|
76
|
+
* exit code, not a missing file. The install is idempotent (a no-op once node_modules is up to
|
|
77
|
+
* date), so re-running is safe. Guarded to win32 so the narrow message match can't affect other
|
|
78
|
+
* platforms. (Durable fix: stop routing install through cmd.exe, mirroring the collector's
|
|
79
|
+
* powershell.exe -EncodedCommand spawn — tracked separately.)
|
|
80
|
+
*/
|
|
81
|
+
export function isRetriableInstallError(message) {
|
|
82
|
+
if (/ENOTFOUND|ECONNRESET|ETIMEDOUT|EAI_AGAIN|ECONNREFUSED/.test(message)) {
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
if (process.platform === "win32" && /The batch file cannot be found/i.test(message)) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
66
90
|
export async function installDependencies(config, { appDir, projectDir, workspaceRoot }, options, env) {
|
|
67
91
|
const platform = options.platform || process.platform;
|
|
68
92
|
const arch = options.arch || process.arch;
|
|
@@ -86,19 +110,46 @@ export async function installDependencies(config, { appDir, projectDir, workspac
|
|
|
86
110
|
const spawnEnv = {
|
|
87
111
|
...getGypEnv(options.frameworkInfo, platform, arch, options.buildFromSource === true),
|
|
88
112
|
...env,
|
|
113
|
+
// Silence corepack's activation/download chatter so a `pnpm install` doesn't flood the build log;
|
|
114
|
+
// strict=0 so the app's `packageManager` pin can't abort the install, download prompt/notice off.
|
|
115
|
+
COREPACK_ENABLE_STRICT: "0",
|
|
116
|
+
COREPACK_ENABLE_DOWNLOAD_PROMPT: "0",
|
|
89
117
|
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
118
|
+
const tmpDir = new TmpDir("install-dependencies");
|
|
119
|
+
try {
|
|
120
|
+
await retry(async () => {
|
|
121
|
+
// Stream install output to a file instead of inheriting/buffering it: corepack and the package
|
|
122
|
+
// managers are extremely chatty, so the common (success) path stays quiet and only surfaces the
|
|
123
|
+
// log on failure. On Windows streamSpawnToFile routes through powershell.exe -EncodedCommand
|
|
124
|
+
// rather than cmd.exe, which also sidesteps the spurious ".cmd" shim "batch file cannot be
|
|
125
|
+
// found." re-open race that previously forced the win32 retry guard below.
|
|
126
|
+
const outputFile = await tmpDir.getTempFile({ prefix: "install-", suffix: ".log" });
|
|
127
|
+
const { code, stderr } = await streamSpawnToFile(execPath, execArgs, appDir, outputFile, spawnEnv);
|
|
128
|
+
if (code !== 0) {
|
|
129
|
+
const stdout = await readFile(outputFile, "utf8").catch(() => "");
|
|
130
|
+
throw new Error(`Package install (${execPath} ${execArgs.join(" ")}) exited with code ${code}:\n${stdout}\n${stderr}`);
|
|
98
131
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
132
|
+
if (log.isDebugEnabled) {
|
|
133
|
+
const stdout = await readFile(outputFile, "utf8").catch(() => "");
|
|
134
|
+
log.debug({ stdout, stderr }, "installed dependencies");
|
|
135
|
+
}
|
|
136
|
+
}, {
|
|
137
|
+
retries: 3,
|
|
138
|
+
interval: 1000,
|
|
139
|
+
backoff: 2000,
|
|
140
|
+
shouldRetry: (e) => {
|
|
141
|
+
const message = e?.message ?? "";
|
|
142
|
+
const retriable = isRetriableInstallError(message);
|
|
143
|
+
if (retriable) {
|
|
144
|
+
log.warn({ error: String(message).split("\n")[0] }, "transient error during package install, retrying");
|
|
145
|
+
}
|
|
146
|
+
return retriable;
|
|
147
|
+
},
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
finally {
|
|
151
|
+
await tmpDir.cleanup();
|
|
152
|
+
}
|
|
102
153
|
// Some native dependencies no longer use `install` hook for building their native module, (yarn 3+ removed implicit link of `install` and `rebuild` steps)
|
|
103
154
|
// https://github.com/electron-userland/electron-builder/issues/8024
|
|
104
155
|
return rebuild(config, { appDir, projectDir, workspaceRoot }, options);
|
|
@@ -150,4 +201,4 @@ export async function rebuild(config, { appDir, projectDir, workspaceRoot }, opt
|
|
|
150
201
|
};
|
|
151
202
|
return remoteRebuild(rebuildOptions);
|
|
152
203
|
}
|
|
153
|
-
//# sourceMappingURL=
|
|
204
|
+
//# sourceMappingURL=installOrRebuild.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installOrRebuild.js","sourceRoot":"","sources":["../../src/util/installOrRebuild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,GAAG,EA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} from \"builder-util\"\nimport { isNpmNoBinLinks } from \"./flags.js\"\n\nimport { homedir } from \"os\"\nimport * as path from \"path\"\nimport { Configuration } from \"../configuration.js\"\nimport { PM, getPackageManagerCommand } from \"../node-module-collector/index.js\"\nimport { detectPackageManager } from \"../node-module-collector/packageManager.js\"\nimport { streamSpawnToFile } from \"./streamSpawnToFile.js\"\nimport { rebuild as remoteRebuild } from \"./rebuild.js\"\nimport which from \"which\"\nimport type { RebuildOptions as ElectronRebuildOptions } from \"@electron/rebuild\"\nimport { Nullish } from \"builder-util-runtime\"\nimport _fsExtra from \"fs-extra\"\nconst { pathExists, readFile } = _fsExtra\n\nexport async function installOrRebuild(\n config: Configuration,\n { appDir, projectDir, workspaceRoot }: DirectoryPaths,\n options: RebuildOptions,\n forceInstall = false,\n env: NodeJS.ProcessEnv\n) {\n const effectiveOptions: RebuildOptions = {\n buildFromSource: config.nativeModules?.buildDependenciesFromSource === true,\n additionalArgs: asArray(config.npmArgs),\n ...options,\n }\n let isDependenciesInstalled = false\n\n const dirsToCheck = [...new Set([projectDir, appDir, workspaceRoot].filter((d): d is string => !!d))]\n for (const fileOrDir of [\"node_modules\", \".pnp.js\"]) {\n if ((await Promise.all(dirsToCheck.map(d => pathExists(path.join(d, fileOrDir))))).some(Boolean)) {\n isDependenciesInstalled = true\n\n break\n }\n }\n\n if (forceInstall || !isDependenciesInstalled) {\n await installDependencies(config, { appDir, projectDir, workspaceRoot }, effectiveOptions, env)\n } else {\n await rebuild(config, { appDir, projectDir, workspaceRoot }, effectiveOptions)\n }\n}\n\nexport interface DesktopFrameworkInfo {\n version: string\n useCustomDist: boolean\n}\n\nfunction getElectronGypCacheDir() {\n return path.join(homedir(), \".electron-gyp\")\n}\n\nexport function getGypEnv(frameworkInfo: DesktopFrameworkInfo, platform: NodeJS.Platform, arch: string, buildFromSource: boolean) {\n const npmConfigArch = arch === \"armv7l\" ? \"arm\" : arch\n const common: any = {\n ...stripSensitiveEnvVars(process.env),\n npm_config_arch: npmConfigArch,\n npm_config_target_arch: npmConfigArch,\n npm_config_platform: platform,\n npm_config_build_from_source: buildFromSource,\n // required for node-pre-gyp\n npm_config_target_platform: platform,\n npm_config_update_binary: true,\n npm_config_fallback_to_build: true,\n }\n\n if (platform !== process.platform) {\n common.npm_config_force = \"true\"\n }\n if (platform === \"win32\" || platform === \"darwin\") {\n common.npm_config_target_libc = \"unknown\"\n }\n\n if (!frameworkInfo.useCustomDist) {\n return common\n }\n\n // https://github.com/nodejs/node-gyp/issues/21\n return {\n ...common,\n npm_config_disturl: common.npm_config_electron_mirror || \"https://electronjs.org/headers\",\n npm_config_target: frameworkInfo.version,\n npm_config_runtime: \"electron\",\n npm_config_devdir: getElectronGypCacheDir(),\n }\n}\n\n/**\n * Whether a failed dependency-install spawn should be retried. Everything not matched here fails fast —\n * a genuine install error (E404, ERESOLVE, EACCES, …) must surface immediately, not after 3 backoff\n * retries. Two transient classes are retriable:\n * - Network blips while fetching from the registry.\n * - A Windows-only cmd.exe race: cross-spawn invokes the package manager's `.cmd`/`.CMD` shim via\n * `cmd.exe /d /s /c`, and cmd.exe re-opens the batch file between commands. Under CI load (Defender\n * scan locks, an 8.3/temp cwd, heavy parallel I/O) that re-open intermittently fails with\n * \"The batch file cannot be found.\" *after* the package manager has already finished — a spurious\n * exit code, not a missing file. The install is idempotent (a no-op once node_modules is up to\n * date), so re-running is safe. Guarded to win32 so the narrow message match can't affect other\n * platforms. (Durable fix: stop routing install through cmd.exe, mirroring the collector's\n * powershell.exe -EncodedCommand spawn — tracked separately.)\n */\nexport function isRetriableInstallError(message: string): boolean {\n if (/ENOTFOUND|ECONNRESET|ETIMEDOUT|EAI_AGAIN|ECONNREFUSED/.test(message)) {\n return true\n }\n if (process.platform === \"win32\" && /The batch file cannot be found/i.test(message)) {\n return true\n }\n return false\n}\n\nexport async function installDependencies(\n config: Configuration,\n { appDir, projectDir, workspaceRoot }: DirectoryPaths,\n options: RebuildOptions,\n env: NodeJS.ProcessEnv\n): Promise<any> {\n const platform = options.platform || process.platform\n const arch = options.arch || process.arch\n const additionalArgs = options.additionalArgs\n\n const searchPaths = [projectDir, appDir].concat(workspaceRoot ? [workspaceRoot] : [])\n const { pm, resolvedDirectory: _resolvedWorkspaceDir } = await detectPackageManager(searchPaths)\n\n log.info({ pm, platform, arch, projectDir, appDir, workspaceRoot: _resolvedWorkspaceDir }, \"installing dependencies\")\n\n const execArgs = [\"install\"]\n if (pm === PM.YARN) {\n execArgs.push(\"--prefer-offline\")\n } else if (pm === PM.YARN_BERRY) {\n if (isNpmNoBinLinks()) {\n execArgs.push(\"--no-bin-links\")\n }\n }\n\n const execPath = getPackageManagerCommand(pm)\n\n if (additionalArgs != null) {\n execArgs.push(...additionalArgs)\n }\n\n const spawnEnv = {\n ...getGypEnv(options.frameworkInfo, platform, arch, options.buildFromSource === true),\n ...env,\n // Silence corepack's activation/download chatter so a `pnpm install` doesn't flood the build log;\n // strict=0 so the app's `packageManager` pin can't abort the install, download prompt/notice off.\n COREPACK_ENABLE_STRICT: \"0\",\n COREPACK_ENABLE_DOWNLOAD_PROMPT: \"0\",\n }\n\n const tmpDir = new TmpDir(\"install-dependencies\")\n try {\n await retry(\n async () => {\n // Stream install output to a file instead of inheriting/buffering it: corepack and the package\n // managers are extremely chatty, so the common (success) path stays quiet and only surfaces the\n // log on failure. On Windows streamSpawnToFile routes through powershell.exe -EncodedCommand\n // rather than cmd.exe, which also sidesteps the spurious \".cmd\" shim \"batch file cannot be\n // found.\" re-open race that previously forced the win32 retry guard below.\n const outputFile = await tmpDir.getTempFile({ prefix: \"install-\", suffix: \".log\" })\n const { code, stderr } = await streamSpawnToFile(execPath, execArgs, appDir, outputFile, spawnEnv)\n if (code !== 0) {\n const stdout = await readFile(outputFile, \"utf8\").catch(() => \"\")\n throw new Error(`Package install (${execPath} ${execArgs.join(\" \")}) exited with code ${code}:\\n${stdout}\\n${stderr}`)\n }\n if (log.isDebugEnabled) {\n const stdout = await readFile(outputFile, \"utf8\").catch(() => \"\")\n log.debug({ stdout, stderr }, \"installed dependencies\")\n }\n },\n {\n retries: 3,\n interval: 1000,\n backoff: 2000,\n shouldRetry: (e: any) => {\n const message = e?.message ?? \"\"\n const retriable = isRetriableInstallError(message)\n if (retriable) {\n log.warn({ error: String(message).split(\"\\n\")[0] }, \"transient error during package install, retrying\")\n }\n return retriable\n },\n }\n )\n } finally {\n await tmpDir.cleanup()\n }\n\n // Some native dependencies no longer use `install` hook for building their native module, (yarn 3+ removed implicit link of `install` and `rebuild` steps)\n // https://github.com/electron-userland/electron-builder/issues/8024\n return rebuild(config, { appDir, projectDir, workspaceRoot }, options)\n}\n\nexport async function nodeGypRebuild(platform: NodeJS.Platform, arch: string, frameworkInfo: DesktopFrameworkInfo) {\n log.info({ platform, arch }, \"executing node-gyp rebuild\")\n // this script must be used only for electron\n const nodeGyp = process.platform === \"win32\" ? which.sync(\"node-gyp\") : \"node-gyp\"\n const args = [\"rebuild\"]\n // headers of old Electron versions do not have a valid config.gypi file\n // and --force-process-config must be passed to node-gyp >= 8.4.0 to\n // correctly build modules for them.\n // see also https://github.com/nodejs/node-gyp/pull/2497\n const [major, minor] = frameworkInfo.version\n .split(\".\")\n .slice(0, 2)\n .map(n => parseInt(n, 10))\n if (major <= 13 || (major == 14 && minor <= 1) || (major == 15 && minor <= 2)) {\n args.push(\"--force-process-config\")\n }\n await spawn(nodeGyp, args, { env: getGypEnv(frameworkInfo, platform, arch, true) })\n}\nexport interface RebuildOptions {\n frameworkInfo: DesktopFrameworkInfo\n\n platform?: NodeJS.Platform\n arch?: string\n\n buildFromSource?: boolean\n\n additionalArgs?: Array<string> | null\n}\n\nexport interface DirectoryPaths {\n appDir: string\n projectDir: string\n workspaceRoot: string | Nullish\n}\n\n/** @internal */\nexport async function rebuild(config: Configuration, { appDir, projectDir, workspaceRoot }: DirectoryPaths, options: RebuildOptions) {\n const buildFromSource = options.buildFromSource === true\n const platform = options.platform || process.platform\n const arch = options.arch || process.arch\n\n const {\n frameworkInfo: { version: electronVersion },\n } = options\n const projectRootPath = workspaceRoot || projectDir || appDir\n const logInfo = {\n electronVersion,\n arch,\n buildFromSource,\n workspaceRoot,\n projectDir: log.filePath(projectDir) || \"./\",\n appDir: log.filePath(appDir) || \"./\",\n }\n log.info(logInfo, \"executing @electron/rebuild\")\n\n const mode = config.nativeModules?.rebuildMode ?? \"sequential\"\n const rebuildOptions: ElectronRebuildOptions = {\n buildPath: appDir,\n electronVersion,\n arch,\n platform,\n buildFromSource,\n projectRootPath,\n mode,\n disablePreGypCopy: true,\n }\n return remoteRebuild(rebuildOptions)\n}\n"]}
|
package/dist/util/langs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"langs.d.ts","sourceRoot":"","sources":["../../src/util/langs.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"langs.d.ts","sourceRoot":"","sources":["../../src/util/langs.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,UA4B5B,CAAA;AASD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CASrD;AAED,eAAO,MAAM,IAAI,EAAE,GA0MlB,CAAA;AAGD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyLxB,CAAA"}
|
package/dist/util/langs.js
CHANGED
package/dist/util/langs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"langs.js","sourceRoot":"","sources":["../../src/util/langs.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,OAAO;IACP,OAAO;IACP,OAAO;IACP,OA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ACX,EAAE,EAAE,iBAAiB;IACrB,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,MAAM;CACX,CAAA","sourcesContent":["export const bundledLanguages = [\n \"en_US\",\n \"de_DE\",\n \"fr_FR\",\n \"es_ES\",\n \"zh_CN\",\n \"zh_TW\",\n \"ja_JP\",\n \"ko_KR\",\n \"it_IT\",\n \"nl_NL\",\n \"da_DK\",\n \"sv_SE\",\n \"nb_NO\",\n \"fi_FI\",\n \"ru_RU\",\n \"pt_PT\",\n \"pt_BR\",\n \"pl_PL\",\n \"uk_UA\",\n \"cs_CZ\",\n \"sk_SK\",\n \"hu_HU\",\n \"ar_SA\",\n \"tr_TR\",\n \"th_TH\",\n \"vi_VN\",\n]\n\n// todo \"ro_RO\" \"el_GR\" \"et_EE\" \"ka_GE\"\n\nconst langToLangWithRegion = new Map<string, string>()\nfor (const id of bundledLanguages) {\n langToLangWithRegion.set(id.substring(0, id.indexOf(\"_\")), id)\n}\n\nexport function toLangWithRegion(lang: string): string {\n if (lang.includes(\"_\")) {\n return lang\n }\n\n lang = lang.toLowerCase()\n\n const result = langToLangWithRegion.get(lang)\n return result == null ? `${lang}_${lang.toUpperCase()}` : result\n}\n\nexport const lcid: any = {\n af_ZA: 1078,\n am_ET: 1118,\n ar_AE: 14337,\n ar_BH: 15361,\n ar_DZ: 5121,\n ar_EG: 3073,\n ar_IQ: 2049,\n ar_JO: 11265,\n ar_KW: 13313,\n ar_LB: 12289,\n ar_LY: 4097,\n ar_MA: 6145,\n ar_OM: 8193,\n ar_QA: 16385,\n ar_SA: 1025,\n ar_SY: 10241,\n ar_TN: 7169,\n ar_YE: 9217,\n arn_CL: 1146,\n as_IN: 1101,\n az_AZ: 2092,\n ba_RU: 1133,\n be_BY: 1059,\n bg_BG: 1026,\n bn_IN: 1093,\n bo_BT: 2129,\n bo_CN: 1105,\n br_FR: 1150,\n bs_BA: 8218,\n ca_ES: 1027,\n co_FR: 1155,\n cs_CZ: 1029,\n cy_GB: 1106,\n da_DK: 1030,\n de_AT: 3079,\n de_CH: 2055,\n de_DE: 1031,\n de_LI: 5127,\n de_LU: 4103,\n div_MV: 1125,\n dsb_DE: 2094,\n el_GR: 1032,\n en_AU: 3081,\n en_BZ: 10249,\n en_CA: 4105,\n en_CB: 9225,\n en_GB: 2057,\n en_IE: 6153,\n en_IN: 18441,\n en_JA: 8201,\n en_MY: 17417,\n en_NZ: 5129,\n en_PH: 13321,\n en_TT: 11273,\n en_US: 1033,\n en_ZA: 7177,\n en_ZW: 12297,\n es_AR: 11274,\n es_BO: 16394,\n es_CL: 13322,\n es_CO: 9226,\n es_CR: 5130,\n es_DO: 7178,\n es_EC: 12298,\n es_ES: 3082,\n es_GT: 4106,\n es_HN: 18442,\n es_MX: 2058,\n es_NI: 19466,\n es_PA: 6154,\n es_PE: 10250,\n es_PR: 20490,\n es_PY: 15370,\n es_SV: 17418,\n es_UR: 14346,\n es_US: 21514,\n es_VE: 8202,\n et_EE: 1061,\n eu_ES: 1069,\n fa_IR: 1065,\n fi_FI: 1035,\n fil_PH: 1124,\n fo_FO: 1080,\n fr_BE: 2060,\n fr_CA: 3084,\n fr_CH: 4108,\n fr_FR: 1036,\n fr_LU: 5132,\n fr_MC: 6156,\n fy_NL: 1122,\n ga_IE: 2108,\n gbz_AF: 1164,\n gl_ES: 1110,\n gsw_FR: 1156,\n gu_IN: 1095,\n ha_NG: 1128,\n he_IL: 1037,\n hi_IN: 1081,\n hr_BA: 4122,\n hr_HR: 1050,\n hu_HU: 1038,\n hy_AM: 1067,\n id_ID: 1057,\n ii_CN: 1144,\n is_IS: 1039,\n it_CH: 2064,\n it_IT: 1040,\n iu_CA: 2141,\n ja_JP: 1041,\n ka_GE: 1079,\n kh_KH: 1107,\n kk_KZ: 1087,\n kl_GL: 1135,\n kn_IN: 1099,\n ko_KR: 1042,\n kok_IN: 1111,\n ky_KG: 1088,\n lb_LU: 1134,\n lo_LA: 1108,\n lt_LT: 1063,\n lv_LV: 1062,\n mi_NZ: 1153,\n mk_MK: 1071,\n ml_IN: 1100,\n mn_CN: 2128,\n mn_MN: 1104,\n moh_CA: 1148,\n mr_IN: 1102,\n ms_BN: 2110,\n ms_MY: 1086,\n mt_MT: 1082,\n my_MM: 1109,\n nb_NO: 1044,\n ne_NP: 1121,\n nl_BE: 2067,\n nl_NL: 1043,\n nn_NO: 2068,\n ns_ZA: 1132,\n oc_FR: 1154,\n or_IN: 1096,\n pa_IN: 1094,\n pl_PL: 1045,\n ps_AF: 1123,\n pt_BR: 1046,\n pt_PT: 2070,\n qut_GT: 1158,\n quz_BO: 1131,\n quz_EC: 2155,\n quz_PE: 3179,\n rm_CH: 1047,\n ro_RO: 1048,\n ru_RU: 1049,\n rw_RW: 1159,\n sa_IN: 1103,\n sah_RU: 1157,\n se_FI: 3131,\n se_NO: 1083,\n se_SE: 2107,\n si_LK: 1115,\n sk_SK: 1051,\n sl_SI: 1060,\n sma_NO: 6203,\n sma_SE: 7227,\n smj_NO: 4155,\n smj_SE: 5179,\n smn_FI: 9275,\n sms_FI: 8251,\n sq_AL: 1052,\n sr_BA: 7194,\n sr_SP: 3098,\n sv_FI: 2077,\n sv_SE: 1053,\n sw_KE: 1089,\n syr_SY: 1114,\n ta_IN: 1097,\n te_IN: 1098,\n tg_TJ: 1064,\n th_TH: 1054,\n tk_TM: 1090,\n tmz_DZ: 2143,\n tn_ZA: 1074,\n tr_TR: 1055,\n tt_RU: 1092,\n ug_CN: 1152,\n uk_UA: 1058,\n ur_IN: 2080,\n ur_PK: 1056,\n uz_UZ: 2115,\n vi_VN: 1066,\n wen_DE: 1070,\n wo_SN: 1160,\n xh_ZA: 1076,\n yo_NG: 1130,\n zh_CHS: 4,\n zh_CHT: 31748,\n zh_CN: 2052,\n zh_HK: 3076,\n zh_MO: 5124,\n zh_SG: 4100,\n zh_TW: 1028,\n zu_ZA: 1077,\n}\n\n// noinspection SpellCheckingInspection\nexport const langIdToName = {\n ab: \"Abkhaz\",\n aa: \"Afar\",\n af: \"Afrikaans\",\n ak: \"Akan\",\n sq: \"Albanian\",\n am: \"Amharic\",\n ar: \"Arabic\",\n an: \"Aragonese\",\n hy: \"Armenian\",\n as: \"Assamese\",\n av: \"Avaric\",\n ae: \"Avestan\",\n ay: \"Aymara\",\n az: \"Azerbaijani\",\n bm: \"Bambara\",\n ba: \"Bashkir\",\n eu: \"Basque\",\n be: \"Belarusian\",\n bn: \"Bengali\",\n bh: \"Bihari\",\n bi: \"Bislama\",\n bs: \"Bosnian\",\n br: \"Breton\",\n bg: \"Bulgarian\",\n my: \"Burmese\",\n ca: \"Catalan\",\n ch: \"Chamorro\",\n ce: \"Chechen\",\n ny: \"Chichewa\",\n zh: \"Chinese\",\n cv: \"Chuvash\",\n kw: \"Cornish\",\n co: \"Corsican\",\n cr: \"Cree\",\n hr: \"Croatian\",\n cs: \"Czech\",\n da: \"Danish\",\n dv: \"Divehi\",\n nl: \"Dutch\",\n dz: \"Dzongkha\",\n en: \"English\",\n eo: \"Esperanto\",\n et: \"Estonian\",\n ee: \"Ewe\",\n fo: \"Faroese\",\n fj: \"Fijian\",\n fi: \"Finnish\",\n fr: \"French\",\n ff: \"Fula\",\n gl: \"Galician\",\n ka: \"Georgian\",\n de: \"German\",\n el: \"Greek\",\n gn: \"Guaraní\",\n gu: \"Gujarati\",\n ht: \"Haitian\",\n ha: \"Hausa\",\n he: \"Hebrew\",\n hz: \"Herero\",\n hi: \"Hindi\",\n ho: \"Hiri Motu\",\n hu: \"Hungarian\",\n ia: \"Interlingua\",\n id: \"Indonesian\",\n ie: \"Interlingue\",\n ga: \"Irish\",\n ig: \"Igbo\",\n ik: \"Inupiaq\",\n io: \"Ido\",\n is: \"Icelandic\",\n it: \"Italian\",\n iu: \"Inuktitut\",\n ja: \"Japanese\",\n jv: \"Javanese\",\n kl: \"Kalaallisut\",\n kn: \"Kannada\",\n kr: \"Kanuri\",\n ks: \"Kashmiri\",\n kk: \"Kazakh\",\n km: \"Khmer\",\n ki: \"Kikuyu\",\n rw: \"Kinyarwanda\",\n ky: \"Kyrgyz\",\n kv: \"Komi\",\n kg: \"Kongo\",\n ko: \"Korean\",\n ku: \"Kurdish\",\n kj: \"Kwanyama\",\n la: \"Latin\",\n lb: \"Luxembourgish\",\n lg: \"Ganda\",\n li: \"Limburgish\",\n ln: \"Lingala\",\n lo: \"Lao\",\n lt: \"Lithuanian\",\n lu: \"Luba-Katanga\",\n lv: \"Latvian\",\n gv: \"Manx\",\n mk: \"Macedonian\",\n mg: \"Malagasy\",\n ms: \"Malay\",\n ml: \"Malayalam\",\n mt: \"Maltese\",\n mi: \"Māori\",\n mr: \"Marathi\",\n mh: \"Marshallese\",\n mn: \"Mongolian\",\n na: \"Nauru\",\n nv: \"Navajo\",\n nd: \"Northern Ndebele\",\n ne: \"Nepali\",\n ng: \"Ndonga\",\n nb: \"Norwegian Bokmål\",\n nn: \"Norwegian Nynorsk\",\n no: \"Norwegian\",\n ii: \"Nuosu\",\n nr: \"Southern Ndebele\",\n oc: \"Occitan\",\n oj: \"Ojibwe\",\n cu: \"Old Church Slavonic\",\n om: \"Oromo\",\n or: \"Oriya\",\n os: \"Ossetian\",\n pa: \"Panjabi\",\n pi: \"Pāli\",\n fa: \"Persian\",\n pl: \"Polish\",\n ps: \"Pashto\",\n pt: \"Portuguese\",\n qu: \"Quechua\",\n rm: \"Romansh\",\n rn: \"Kirundi\",\n ro: \"Romanian\",\n ru: \"Russian\",\n sa: \"Sanskrit\",\n sc: \"Sardinian\",\n sd: \"Sindhi\",\n se: \"Northern Sami\",\n sm: \"Samoan\",\n sg: \"Sango\",\n sr: \"Serbian\",\n gd: \"Gaelic\",\n sn: \"Shona\",\n si: \"Sinhala\",\n sk: \"Slovak\",\n sl: \"Slovene\",\n so: \"Somali\",\n st: \"Southern Sotho\",\n es: \"Spanish\",\n su: \"Sundanese\",\n sw: \"Swahili\",\n ss: \"Swati\",\n sv: \"Swedish\",\n ta: \"Tamil\",\n te: \"Telugu\",\n tg: \"Tajik\",\n th: \"Thai\",\n ti: \"Tigrinya\",\n bo: \"Tibetan Standard\",\n tk: \"Turkmen\",\n tl: \"Tagalog\",\n tn: \"Tswana\",\n to: \"Tonga\",\n tr: \"Turkish\",\n ts: \"Tsonga\",\n tt: \"Tatar\",\n tw: \"Twi\",\n ty: \"Tahitian\",\n ug: \"Uyghur\",\n uk: \"Ukrainian\",\n ur: \"Urdu\",\n uz: \"Uzbek\",\n ve: \"Venda\",\n vi: \"Vietnamese\",\n vo: \"Volapük\",\n wa: \"Walloon\",\n cy: \"Welsh\",\n wo: \"Wolof\",\n fy: \"Western Frisian\",\n xh: \"Xhosa\",\n yi: \"Yiddish\",\n yo: \"Yoruba\",\n za: \"Zhuang\",\n zu: \"Zulu\",\n}\n"]}
|
|
1
|
+
{"version":3,"file":"langs.js","sourceRoot":"","sources":["../../src/util/langs.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;CACR,CAAA;AAED,uCAAuC;AAEvC,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAAkB,CAAA;AACtD,KAAK,MAAM,EAAE,IAAI,gBAAgB,EAAE,CAAC;IAClC,oBAAoB,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;AAChE,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IA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AS;IACb,EAAE,EAAE,WAAW;IACf,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,UAAU;IACd,EAAE,EAAE,kBAAkB;IACtB,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,UAAU;IACd,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,WAAW;IACf,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,YAAY;IAChB,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,iBAAiB;IACrB,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,MAAM;CACX,CAAA","sourcesContent":["export const bundledLanguages = [\n \"en_US\",\n \"de_DE\",\n \"fr_FR\",\n \"es_ES\",\n \"zh_CN\",\n \"zh_TW\",\n \"ja_JP\",\n \"ko_KR\",\n \"it_IT\",\n \"nl_NL\",\n \"da_DK\",\n \"sv_SE\",\n \"nb_NO\",\n \"fi_FI\",\n \"ru_RU\",\n \"pt_PT\",\n \"pt_BR\",\n \"pl_PL\",\n \"uk_UA\",\n \"cs_CZ\",\n \"sk_SK\",\n \"hu_HU\",\n \"ar_SA\",\n \"he_IL\",\n \"tr_TR\",\n \"th_TH\",\n \"vi_VN\",\n]\n\n// todo \"ro_RO\" \"el_GR\" \"et_EE\" \"ka_GE\"\n\nconst langToLangWithRegion = new Map<string, string>()\nfor (const id of bundledLanguages) {\n langToLangWithRegion.set(id.substring(0, id.indexOf(\"_\")), id)\n}\n\nexport function toLangWithRegion(lang: string): string {\n if (lang.includes(\"_\")) {\n return lang\n }\n\n lang = lang.toLowerCase()\n\n const result = langToLangWithRegion.get(lang)\n return result == null ? `${lang}_${lang.toUpperCase()}` : result\n}\n\nexport const lcid: any = {\n af_ZA: 1078,\n am_ET: 1118,\n ar_AE: 14337,\n ar_BH: 15361,\n ar_DZ: 5121,\n ar_EG: 3073,\n ar_IQ: 2049,\n ar_JO: 11265,\n ar_KW: 13313,\n ar_LB: 12289,\n ar_LY: 4097,\n ar_MA: 6145,\n ar_OM: 8193,\n ar_QA: 16385,\n ar_SA: 1025,\n ar_SY: 10241,\n ar_TN: 7169,\n ar_YE: 9217,\n arn_CL: 1146,\n as_IN: 1101,\n az_AZ: 2092,\n ba_RU: 1133,\n be_BY: 1059,\n bg_BG: 1026,\n bn_IN: 1093,\n bo_BT: 2129,\n bo_CN: 1105,\n br_FR: 1150,\n bs_BA: 8218,\n ca_ES: 1027,\n co_FR: 1155,\n cs_CZ: 1029,\n cy_GB: 1106,\n da_DK: 1030,\n de_AT: 3079,\n de_CH: 2055,\n de_DE: 1031,\n de_LI: 5127,\n de_LU: 4103,\n div_MV: 1125,\n dsb_DE: 2094,\n el_GR: 1032,\n en_AU: 3081,\n en_BZ: 10249,\n en_CA: 4105,\n en_CB: 9225,\n en_GB: 2057,\n en_IE: 6153,\n en_IN: 18441,\n en_JA: 8201,\n en_MY: 17417,\n en_NZ: 5129,\n en_PH: 13321,\n en_TT: 11273,\n en_US: 1033,\n en_ZA: 7177,\n en_ZW: 12297,\n es_AR: 11274,\n es_BO: 16394,\n es_CL: 13322,\n es_CO: 9226,\n es_CR: 5130,\n es_DO: 7178,\n es_EC: 12298,\n es_ES: 3082,\n es_GT: 4106,\n es_HN: 18442,\n es_MX: 2058,\n es_NI: 19466,\n es_PA: 6154,\n es_PE: 10250,\n es_PR: 20490,\n es_PY: 15370,\n es_SV: 17418,\n es_UR: 14346,\n es_US: 21514,\n es_VE: 8202,\n et_EE: 1061,\n eu_ES: 1069,\n fa_IR: 1065,\n fi_FI: 1035,\n fil_PH: 1124,\n fo_FO: 1080,\n fr_BE: 2060,\n fr_CA: 3084,\n fr_CH: 4108,\n fr_FR: 1036,\n fr_LU: 5132,\n fr_MC: 6156,\n fy_NL: 1122,\n ga_IE: 2108,\n gbz_AF: 1164,\n gl_ES: 1110,\n gsw_FR: 1156,\n gu_IN: 1095,\n ha_NG: 1128,\n he_IL: 1037,\n hi_IN: 1081,\n hr_BA: 4122,\n hr_HR: 1050,\n hu_HU: 1038,\n hy_AM: 1067,\n id_ID: 1057,\n ii_CN: 1144,\n is_IS: 1039,\n it_CH: 2064,\n it_IT: 1040,\n iu_CA: 2141,\n ja_JP: 1041,\n ka_GE: 1079,\n kh_KH: 1107,\n kk_KZ: 1087,\n kl_GL: 1135,\n kn_IN: 1099,\n ko_KR: 1042,\n kok_IN: 1111,\n ky_KG: 1088,\n lb_LU: 1134,\n lo_LA: 1108,\n lt_LT: 1063,\n lv_LV: 1062,\n mi_NZ: 1153,\n mk_MK: 1071,\n ml_IN: 1100,\n mn_CN: 2128,\n mn_MN: 1104,\n moh_CA: 1148,\n mr_IN: 1102,\n ms_BN: 2110,\n ms_MY: 1086,\n mt_MT: 1082,\n my_MM: 1109,\n nb_NO: 1044,\n ne_NP: 1121,\n nl_BE: 2067,\n nl_NL: 1043,\n nn_NO: 2068,\n ns_ZA: 1132,\n oc_FR: 1154,\n or_IN: 1096,\n pa_IN: 1094,\n pl_PL: 1045,\n ps_AF: 1123,\n pt_BR: 1046,\n pt_PT: 2070,\n qut_GT: 1158,\n quz_BO: 1131,\n quz_EC: 2155,\n quz_PE: 3179,\n rm_CH: 1047,\n ro_RO: 1048,\n ru_RU: 1049,\n rw_RW: 1159,\n sa_IN: 1103,\n sah_RU: 1157,\n se_FI: 3131,\n se_NO: 1083,\n se_SE: 2107,\n si_LK: 1115,\n sk_SK: 1051,\n sl_SI: 1060,\n sma_NO: 6203,\n sma_SE: 7227,\n smj_NO: 4155,\n smj_SE: 5179,\n smn_FI: 9275,\n sms_FI: 8251,\n sq_AL: 1052,\n sr_BA: 7194,\n sr_SP: 3098,\n sv_FI: 2077,\n sv_SE: 1053,\n sw_KE: 1089,\n syr_SY: 1114,\n ta_IN: 1097,\n te_IN: 1098,\n tg_TJ: 1064,\n th_TH: 1054,\n tk_TM: 1090,\n tmz_DZ: 2143,\n tn_ZA: 1074,\n tr_TR: 1055,\n tt_RU: 1092,\n ug_CN: 1152,\n uk_UA: 1058,\n ur_IN: 2080,\n ur_PK: 1056,\n uz_UZ: 2115,\n vi_VN: 1066,\n wen_DE: 1070,\n wo_SN: 1160,\n xh_ZA: 1076,\n yo_NG: 1130,\n zh_CHS: 4,\n zh_CHT: 31748,\n zh_CN: 2052,\n zh_HK: 3076,\n zh_MO: 5124,\n zh_SG: 4100,\n zh_TW: 1028,\n zu_ZA: 1077,\n}\n\n// noinspection SpellCheckingInspection\nexport const langIdToName = {\n ab: \"Abkhaz\",\n aa: \"Afar\",\n af: \"Afrikaans\",\n ak: \"Akan\",\n sq: \"Albanian\",\n am: \"Amharic\",\n ar: \"Arabic\",\n an: \"Aragonese\",\n hy: \"Armenian\",\n as: \"Assamese\",\n av: \"Avaric\",\n ae: \"Avestan\",\n ay: \"Aymara\",\n az: \"Azerbaijani\",\n bm: \"Bambara\",\n ba: \"Bashkir\",\n eu: \"Basque\",\n be: \"Belarusian\",\n bn: \"Bengali\",\n bh: \"Bihari\",\n bi: \"Bislama\",\n bs: \"Bosnian\",\n br: \"Breton\",\n bg: \"Bulgarian\",\n my: \"Burmese\",\n ca: \"Catalan\",\n ch: \"Chamorro\",\n ce: \"Chechen\",\n ny: \"Chichewa\",\n zh: \"Chinese\",\n cv: \"Chuvash\",\n kw: \"Cornish\",\n co: \"Corsican\",\n cr: \"Cree\",\n hr: \"Croatian\",\n cs: \"Czech\",\n da: \"Danish\",\n dv: \"Divehi\",\n nl: \"Dutch\",\n dz: \"Dzongkha\",\n en: \"English\",\n eo: \"Esperanto\",\n et: \"Estonian\",\n ee: \"Ewe\",\n fo: \"Faroese\",\n fj: \"Fijian\",\n fi: \"Finnish\",\n fr: \"French\",\n ff: \"Fula\",\n gl: \"Galician\",\n ka: \"Georgian\",\n de: \"German\",\n el: \"Greek\",\n gn: \"Guaraní\",\n gu: \"Gujarati\",\n ht: \"Haitian\",\n ha: \"Hausa\",\n he: \"Hebrew\",\n hz: \"Herero\",\n hi: \"Hindi\",\n ho: \"Hiri Motu\",\n hu: \"Hungarian\",\n ia: \"Interlingua\",\n id: \"Indonesian\",\n ie: \"Interlingue\",\n ga: \"Irish\",\n ig: \"Igbo\",\n ik: \"Inupiaq\",\n io: \"Ido\",\n is: \"Icelandic\",\n it: \"Italian\",\n iu: \"Inuktitut\",\n ja: \"Japanese\",\n jv: \"Javanese\",\n kl: \"Kalaallisut\",\n kn: \"Kannada\",\n kr: \"Kanuri\",\n ks: \"Kashmiri\",\n kk: \"Kazakh\",\n km: \"Khmer\",\n ki: \"Kikuyu\",\n rw: \"Kinyarwanda\",\n ky: \"Kyrgyz\",\n kv: \"Komi\",\n kg: \"Kongo\",\n ko: \"Korean\",\n ku: \"Kurdish\",\n kj: \"Kwanyama\",\n la: \"Latin\",\n lb: \"Luxembourgish\",\n lg: \"Ganda\",\n li: \"Limburgish\",\n ln: \"Lingala\",\n lo: \"Lao\",\n lt: \"Lithuanian\",\n lu: \"Luba-Katanga\",\n lv: \"Latvian\",\n gv: \"Manx\",\n mk: \"Macedonian\",\n mg: \"Malagasy\",\n ms: \"Malay\",\n ml: \"Malayalam\",\n mt: \"Maltese\",\n mi: \"Māori\",\n mr: \"Marathi\",\n mh: \"Marshallese\",\n mn: \"Mongolian\",\n na: \"Nauru\",\n nv: \"Navajo\",\n nd: \"Northern Ndebele\",\n ne: \"Nepali\",\n ng: \"Ndonga\",\n nb: \"Norwegian Bokmål\",\n nn: \"Norwegian Nynorsk\",\n no: \"Norwegian\",\n ii: \"Nuosu\",\n nr: \"Southern Ndebele\",\n oc: \"Occitan\",\n oj: \"Ojibwe\",\n cu: \"Old Church Slavonic\",\n om: \"Oromo\",\n or: \"Oriya\",\n os: \"Ossetian\",\n pa: \"Panjabi\",\n pi: \"Pāli\",\n fa: \"Persian\",\n pl: \"Polish\",\n ps: \"Pashto\",\n pt: \"Portuguese\",\n qu: \"Quechua\",\n rm: \"Romansh\",\n rn: \"Kirundi\",\n ro: \"Romanian\",\n ru: \"Russian\",\n sa: \"Sanskrit\",\n sc: \"Sardinian\",\n sd: \"Sindhi\",\n se: \"Northern Sami\",\n sm: \"Samoan\",\n sg: \"Sango\",\n sr: \"Serbian\",\n gd: \"Gaelic\",\n sn: \"Shona\",\n si: \"Sinhala\",\n sk: \"Slovak\",\n sl: \"Slovene\",\n so: \"Somali\",\n st: \"Southern Sotho\",\n es: \"Spanish\",\n su: \"Sundanese\",\n sw: \"Swahili\",\n ss: \"Swati\",\n sv: \"Swedish\",\n ta: \"Tamil\",\n te: \"Telugu\",\n tg: \"Tajik\",\n th: \"Thai\",\n ti: \"Tigrinya\",\n bo: \"Tibetan Standard\",\n tk: \"Turkmen\",\n tl: \"Tagalog\",\n tn: \"Tswana\",\n to: \"Tonga\",\n tr: \"Turkish\",\n ts: \"Tsonga\",\n tt: \"Tatar\",\n tw: \"Twi\",\n ty: \"Tahitian\",\n ug: \"Uyghur\",\n uk: \"Ukrainian\",\n ur: \"Urdu\",\n uz: \"Uzbek\",\n ve: \"Venda\",\n vi: \"Vietnamese\",\n vo: \"Volapük\",\n wa: \"Walloon\",\n cy: \"Welsh\",\n wo: \"Wolof\",\n fy: \"Western Frisian\",\n xh: \"Xhosa\",\n yi: \"Yiddish\",\n yo: \"Yoruba\",\n za: \"Zhuang\",\n zu: \"Zulu\",\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TmpDir } from "builder-util";
|
|
1
2
|
export interface AssetCatalogResult {
|
|
2
3
|
assetCatalog: Buffer;
|
|
3
4
|
icnsFile: Buffer;
|
|
@@ -7,5 +8,5 @@ export interface AssetCatalogResult {
|
|
|
7
8
|
* @param inputPath The path to the `.icon` file
|
|
8
9
|
* @returns The asset catalog and extra assets
|
|
9
10
|
*/
|
|
10
|
-
export declare function generateAssetCatalogForIcon(inputPath: string): Promise<AssetCatalogResult>;
|
|
11
|
+
export declare function generateAssetCatalogForIcon(tmpDir: TmpDir, inputPath: string): Promise<AssetCatalogResult>;
|
|
11
12
|
//# sourceMappingURL=macosIconComposer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"macosIconComposer.d.ts","sourceRoot":"","sources":["../../../src/util/mac/macosIconComposer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"macosIconComposer.d.ts","sourceRoot":"","sources":["../../../src/util/mac/macosIconComposer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAS,MAAM,EAAE,MAAM,cAAc,CAAA;AAM5C,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAoCD;;;;GAIG;AACH,wBAAsB,2BAA2B,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA+ChH"}
|